Giter VIP home page Giter VIP logo

quantum-particle-swarm-optimization's Introduction

Quantum Particle Swarm Optimizer

General-purpose Mathematical Optimizer

About

This is a general-purpose mathematical optimization library for C++. By applying this library, you can solve single- and multi-variable optimizations, constrained and unconstrained problems and even non-convex problems.

Theory behind the algorithm

This solution is based on combination of particle swarm optimization and delta potential well from quantum physics. The mathematical optimizer inspired by quantum mechanics is a new way to enhance classical optimization techniques to have higher chance in finding of global minima, while the C++ implementation is a great tool for faster running.

Vision

I wanted to provide a reliable tool that applies state-of-the-art approaches and it is also fast and easily integrable into other programming environments as well. For example, wrapping C++ code into .Net environment or into Python, is also possible and helps a lot to improve the running speed of your projects as well.

How different is it from original Particle Swarm Optimization?

  • Delta potential well is applied to calculate movements of particles
  • Velocity parameter is removed
  • Linearly rebalancing explorative and exploiting ratios to controll the importance of the local and global minima for the swarm
  • There re only two required input parameters from the user:
    • swarm size
    • dimension of the problem
  • Thus, no apriori knowledge is necessary to find better solutions. This solver is ready to manage your problem without any fine-tuning.

Building and running project

This library requires GCC v9+ to run.

After cloning the repo, you can run the tester:

cd quantum-particle-swarm-optimization
g++ -O -Wall tester.cpp -o tester
./tester

You can expect an output like this:

Goldstein price function benchmarking
Swarm size: 300
Total iterations: 1000
Global Best: 3
Griewank function benchmarking
Swarm size: 200
Total iterations: 1000
Global Best: 0
Schwefel function benchmarking
Swarm size: 200
Total iterations: 2000
Global Best: 947.507

Want to add to your existing project?

Apply this header in your C++ project:

#include "qpso.h"

Then you can call the Swarm Optimizer:

QPSOptimiser::Swarm testSwarm(200, 30, foo); // swarmSize = 200; dimensions = 30; problem to solve = foo
testSwarm.solve(1000); // Iteration number is 1000
testSwarm.print_results(true); // If argument is True, then it will show the calculated arguments' values

Development

Want to contribute? Great!

Please send a message to Roland Szenczi and we can discuss.

License

MIT

quantum-particle-swarm-optimization's People

Contributors

sznczy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

hanqilearn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.