Particle swarm optimization is a derivative-free global optimum solver. It is inspired by the surprisingly organized behaviour of large groups of simple animals, such as flocks of birds, schools of fish, or swarms of locusts. The individual creatures, or "particles", in this algorithm are primitive, knowing only four simple things: 1 & 2) their own current location in the search space and fitness value, 3) their previous personal best location, and 4) the overall best location found by all the particles in the "swarm". There are no gradients or Hessians to calculate. Each particle continually adjusts its speed and trajectory in the search space based this information, moving closer towards the global optimum with each iteration. As seen in nature, this computational swarm displays a remarkable level of coherence and coordination despite the simplicity of its individual particles.
Ease of Use
If you are already using the Genetic Algorithm (GA) included with MATLAB's Global Optimization Toolbox, then this Particle Swarm Optimization (PSO) algorithm will save you a great deal of time. It can be called from the MATLAB command line using the same syntax as the GA, with some additional options specific to PSO. This will allow a high degree of code re-usability between the PSO toolbox and the GA toolbox. Certain GA-specific parameters such as cross-over and mutation functions will obviously not be applicable to the PSO algorithm. However, many of the commonly used options for the Genetic Algorithm Toolbox may be used interchangeably with PSO since they are both iterative population-based solvers. See >> help pso (from the ./psopt directory) for more details.
* Modular and customizable
* Support for problems consisting of binary variables. Type >> help psobinary (from the psopt directory) for details.
* Bounded, linear, and nonlinear constraints
* Support for vectorized fitness functions
* Algorithm parameters may be adjusted using an 'options' structure similar to existing MATLAB optimization solvers
* Custom plots may be written using same interface as the Genetic Algorithm plotting functions
* Another optimization solver may be called as a "hybrid function" to refine the results after the particle swarm terminates
A demo function (psodemo.m) is included, with a small library of test functions. To run the demo, from the psopt directory, call >> psodemo with no inputs or outputs.
New features and bug fixes will continue to be released until this is made redundant by the release of an official MATLAB PSO toolbox. Bug reports and feature requests are welcome.
Special thanks to the following people for contributing code and bug fixes:
* Michael Johnston of the IRIS toolbox
* J. Oliver of Brigham Young University
* Ziqiang (Kevin) Chen
* J Kennedy, RC Eberhart, YH Shi. Swarm Intelligence. Academic Press, 2001.
* Particle Swarm Optimization. http://en.wikipedia.org/wiki/Particle_swarm_optimization
* RE Perez, K Behdinan. Particle swarm approach for structural design optimization. Computers and Structures 85 (2007) 1579–1588.
* SM Mikki, AA Kishk. Particle Swarm Optimization: A Physics-Based Approach. Morgan & Claypool, 2008.
Nonlinear inequality constraints in the form c(x) ≤ 0 and nonlinear equality constraints of the form ceq(x) = 0 have now been fully implemented. The newly added 'penalize' constraint boundary enforcement method is now default. It has been redesigned and tested extensively, and should work with all types of constraints.
The older 'soft' or 'absorb' style boundaries may still be used, however they are not very effective if your problem contains any nonlinear equality constraints of the form ceq(x) = 0 or linear equality constraints of the form Aeq*x = beq. If your problem does not require any equality constraints, then calculations may be faster with 'soft' boundaries since infeasible solutions are not evaluated at all and simply assigned a fitness score of infinity.
See the following document for the proper syntax for defining nonlinear constraint functions: http://www.mathworks.com/help/optim/ug/writing-constraints.html#brhkghv-16. To see a demonstration of nonlinear inequality constraints using a quadrifolium overlaid on Rosenbrock's function, run psodemo and choose 'nonlinearconstrdemo' as the test function.