Particle Swarm Optimizer (PSO)
- class pypop7.optimizers.pso.pso.PSO(problem, options)[source]
Particle Swarm Optimizer (PSO).
This is the abstract class of all PSO classes. Please use any of its instantiated subclasses to optimize the black-box problem at hand. The unique goal of this abstract class is to unify the common interfaces of all its subclasses (different algorithm versions).
Note
PSO is a very popular family of swarm-based search algorithms, originally proposed by an electrical engineer (Russell C. Eberhart) and a psychologist (James Kennedy), two recipients of IEEE Evolutionary Computation Pioneer Award 2012. Its underlying motivation comes from interesting collective behaviors (e.g. flocking) observed in social animals (such as birds), which are often regarded as a particular form of emergence or self-organization. Recently, PSO-type swarm optimizers have been theoretically analyzed under the Consensus-Based Optimization (CBO) or Swarm Gradient Dynamics framework, with more or less modifications to the standard PSO implementation for mathematical tractability.
For some interesting applications of PSO/CBO in diverse areas, please refer to [Melis et al., 2024, Nature], [Wang et al., 2024, Nature Materials], [Nature Communications-2024], [Zhang et al., 2024, CVPR (Snap Inc. + CUHK + Stanford + UCLA)], [Elijošius et al., 2024], [Lugagne et al., 2024, Nature Communications], [Bottrell et al., MNRAS, 2024], [Xie et al., 2024, JGCD], [Chen et al., 2023, Nature Communications], [Guo et al., 2023, ISSTA], [Yang et al., 2023, IEEE-TSP], [Weiss et al., 2023, CGF], [Menke et al., 2023, Ph.D. Dissertation (Harvard University)], [Liu et al., 2022, Nature Communications], [Benedetti et al., 2019], [Venter&Sobieszczanski-Sobieski, 2003, AIAAJ], to name a few.
- Parameters:
problem (dict) –
- problem arguments with the following common settings (keys):
’fitness_function’ - objective function to be minimized (func),
’ndim_problem’ - number of dimensionality (int),
’upper_boundary’ - upper boundary of search range (array_like),
’lower_boundary’ - lower boundary of search range (array_like).
options (dict) –
- optimizer options with the following common settings (keys):
’max_function_evaluations’ - maximum of function evaluations (int, default: np.inf),
’max_runtime’ - maximal runtime to be allowed (float, default: np.inf),
’seed_rng’ - seed for random number generation needed to be explicitly set (int);
- and with the following particular settings (keys):
’n_individuals’ - swarm (population) size, aka number of particles (int, default: 20),
’cognition’ - cognitive learning rate (float, default: 2.0),
’society’ - social learning rate (float, default: 2.0),
’max_ratio_v’ - maximal ratio of velocities w.r.t. search range (float, default: 0.2).
- cognition
cognitive learning rate, aka acceleration coefficient.
- Type:
float
- max_ratio_v
maximal ratio of velocities w.r.t. search range.
- Type:
float
- n_individuals
swarm (population) size, aka number of particles.
- Type:
int
- society
social learning rate, aka acceleration coefficient.
- Type:
float
References
Bolte, J., Miclo, L. and Villeneuve, S., 2024. Swarm gradient dynamics for global optimization: The mean-field limit case. Mathematical Programming, 205(1), pp.661-701.
Cipriani, C., Huang, H. and Qiu, J., 2022. Zero-inertia limit: From particle swarm optimization to consensus-based optimization. SIAM Journal on Mathematical Analysis, 54(3), pp.3091-3121.
Fornasier, M., Huang, H., Pareschi, L. and Sünnen, P., 2022. Anisotropic diffusion in consensus-based optimization on the sphere. SIAM Journal on Optimization, 32(3), pp.1984-2012.
Fornasier, M., Huang, H., Pareschi, L. and Sünnen, P., 2021. Consensus-based optimization on the sphere: Convergence to global minimizers and machine learning. Journal of Machine Learning Research, 22(1), pp.10722-10776.
Blackwell, T. and Kennedy, J., 2018. Impact of communication topology in particle swarm optimization. IEEE Transactions on Evolutionary Computation, 23(4), pp.689-702.
Bonyadi, M.R. and Michalewicz, Z., 2017. Particle swarm optimization for single objective continuous space problems: A review. Evolutionary Computation, 25(1), pp.1-54.
https://www.cs.cmu.edu/~arielpro/15381f16/c_slides/781f16-26.pdf
Floreano, D. and Mattiussi, C., 2008. Bio-inspired artificial intelligence: Theories, methods, and technologies. MIT Press. (See [Chapter 7.2 Particle Swarm Optimization] for details.)
http://www.scholarpedia.org/article/Particle_swarm_optimization
Poli, R., Kennedy, J. and Blackwell, T., 2007. Particle swarm optimization. Swarm Intelligence, 1(1), pp.33-57.
Clerc, M. and Kennedy, J., 2002. The particle swarm-explosion, stability, and convergence in a multidimensional complex space. IEEE Transactions on Evolutionary Computation, 6(1), pp.58-73.
Eberhart, R.C., Shi, Y. and Kennedy, J., 2001. Swarm intelligence. Elsevier.
Shi, Y. and Eberhart, R., 1998, May. A modified particle swarm optimizer. In IEEE World Congress on Computational Intelligence (pp. 69-73). IEEE.
Kennedy, J. and Eberhart, R., 1995, November. Particle swarm optimization. In Proceedings of International Conference on Neural Networks (pp. 1942-1948). IEEE.
Some Interesting Applications of PSO
Here we are listing some (rather all) interesting applications involving PSO, though nearly all of them did NOT use PyPop7.
[Kong et al., Science Advances, 2025], [Xie et al., Science Advances, 2025], [Crespo-Miguel et al., Nature Communications, 2025], [Nature Communications, 2025], [Nature Communications, 2025], [Nature, 2024], [Reviews of Modern Physics, 2024], [Nature Materials, 2024], [Wang et al., Science Advances, 2024], [Yang et al., Science Advances, 2024], [Nature Communications, 2024], [Nature Communications, 2024], [CVPR, 2024], [arXiv, 2024], [MNRAS, 2024], etc.