Particle Swarm Optimization
Particle Swarm Optimization (PSO) is a population-based optimizer for continuous search spaces, introduced by James Kennedy and Russell Eberhart in 1995. Candidate solutions — particles — move through the space, each pulled toward the best point it has personally found and toward the best point any of its neighbours has found.
Where ant colony optimization coordinates through the environment, PSO coordinates through social information sharing. Both are swarm intelligence; they differ in the channel the information travels through.
The algorithm
Each particle carries a position (a candidate solution), a velocity , and a memory of the best position it has visited. The swarm, or the particle’s neighbourhood within it, tracks a best .
Each iteration:
with drawn uniformly from , independently per component. The three terms are inertia, weighted by , carrying the particle forward and resisting abrupt turns; the cognitive pull toward the particle’s own best; and the social pull toward the neighbourhood best. After moving, each particle evaluates the objective and updates and if it improved on them.
That is the whole algorithm. Its persistence in a field that has produced far more sophisticated methods says something about the ratio of simplicity to performance.
Dynamics
Stability
The update is a stochastic second-order difference equation, and it does not converge for arbitrary parameters. A badly parameterized swarm diverges, velocities growing without bound until the run overflows.
Analysis of the deterministic version establishes a stability region in . The constriction coefficient formulation of Clerc and Kennedy derives a multiplier that guarantees convergent trajectories without hand-tuned velocity clamping. The widely quoted values and come from that analysis, not from folklore.
Note what convergence means here: the swarm converges to a point. Whether that point is the global optimum is not guaranteed, and generally it is not.
Exploration and exploitation
The inertia weight governs the balance. High keeps particles traversing the space; low lets the attractive terms draw them in. Decaying linearly across a run — explore early, exploit late — is standard and usually effective.
The failure mode is premature convergence. The swarm collapses onto before anyone has established that is good. Once every particle coincides with it, both attractive terms vanish, velocities decay under , and the search is over. Diversity is the resource, and it is spent monotonically.
Variants
Topology
Which particles does range over? This choice matters more than the parameter values do.
Global-best (gbest) shows every particle the swarm’s best. Information propagates
instantly, convergence is fast, and premature convergence is likely.
Local-best (lbest), on a ring, shows each particle only a few fixed neighbours.
Information diffuses slowly, distinct regions of the space are explored in parallel for
longer, and the global optimum is found more often — later.
Von Neumann, random, and dynamically rewiring topologies sit between. The governing principle recurs throughout this field: connectivity of the interaction graph determines how fast the population reaches consensus, and fast consensus is not always what you want. Compare algebraic connectivity in the consensus literature — the same eigenvalue, the same tradeoff, opposite preference.
Adaptive parameters
Rather than fixing , , and , adaptive schemes adjust them from observed swarm state: population diversity, improvement rate, or mean distance from the global best. Fuzzy and self-adaptive controllers exist. They help, and they introduce parameters of their own.
Hybrids
PSO combines readily with local search to refine its output, with evolutionary operators such as mutation to restore lost diversity, and with quantum-inspired formulations that sample positions from a probability distribution rather than integrating a velocity — dispensing with the velocity term altogether.
Constraints and multiple objectives
Constrained problems are handled by penalty functions that degrade infeasible solutions; repair operators that project infeasible particles back into the feasible region; feasibility-preserving update rules that never leave it; or by treating constraint violation as an additional objective.
Multi-objective PSO maintains an external archive of non-dominated solutions and draws from it, usually favouring sparsely populated regions of the Pareto front so the approximation stays well spread.
Applications
PSO suits objectives that are continuous, expensive or awkward to differentiate, and moderately dimensioned. Engineering design uses it for structural and aerodynamic shape, controller gains, and antenna geometry. Machine learning uses it for hyperparameter search and feature weighting, and occasionally for direct network training. And swarm research uses it to tune other swarms — optimizing the weights of a flocking controller, for instance.
That last case deserves naming for what it is: a swarm optimizer tuning a swarm. Our own orchestrator does the analogous job with Bayesian search rather than PSO, because when each objective evaluation is a full simulation, the sample efficiency of a surrogate model beats the simplicity of a population.
Implementation
Numerics. Clamp velocity, or adopt the constriction formulation which makes clamping unnecessary. Define a boundary policy — reflect, absorb, or reinitialize — because particles will leave the search box. Seed the population by Latin hypercube or Sobol sampling rather than uniformly at random; coverage is measurably better at small population sizes.
Parallelism. Fitness evaluations are independent within an iteration and dominate cost. Synchronous PSO evaluates the whole population then updates. Asynchronous PSO updates each particle as its evaluation returns, tolerating heterogeneous evaluation times at no reliable cost in solution quality.
Monitor swarm diversity (mean pairwise distance), the improvement rate of , velocity magnitudes, and the fraction of particles pinned at the boundary. Diversity collapse with no improvement in means the run is finished, whatever the iteration budget says.
Pitfalls. The gbest topology converges prematurely on multimodal problems almost by
construction. Parameters outside the stability region diverge silently until something
overflows. And a population too small for the dimension cannot cover it — population should
grow with dimensionality, though sublinearly.
What PSO teaches
Strip away the optimization framing and PSO makes a claim about collective decision-making: individuals combining private experience with social information outperform individuals using either alone — but only until social influence overwhelms private evidence, at which point the population converges on a shared belief that reflects nobody’s observations.
That is an information cascade in algorithmic form. PSO’s premature convergence and a herd’s are the same pathology. Read this way, the inertia weight is a mechanism for preserving independent evidence against the pull of consensus, and is the knob that destroys it.