## What is Particle Swarm Optimization?

Particle swarm optimization (PSO) is an optimization algorithm that uses swarm intelligence to solve problems that can be represented as a point or surface in a multi-dimensional space.

This differs from ant colony optimization because the swarm is given random starting solutions first instead of exploring the entire parameter space. Candidate solutions (particles) are plotted in the n-space and given an initial velocity, as well as a communication channel between the particles. A swarm of simple formulas move these particles through the solution space, and evaluate the quality of the solution according to some fitness criterion after each timestep. Over time, particles accelerate towards those particles within their communication group that have the highest fitness values.

The main advantage of this approach is that the large number of simple computational agents are less sensitive to the problem of local minima.

## How does Particle Swarm Optimization Work in Practice?

After being initialized with a group of random particles (solutions), the PSO searches for optimal solutions by updating particles over multiple iterations. Each particle is updated by following two best values. The first one is the best solution (fitness) it has achieved so far, also called pbest. The second value tracked by the particle swarm optimizer is the universal “best value” obtained so far by any particle in the population, called gbest. If a particle takes part of the population as its topological neighbors, the best value is considered a “local best,” called lbest.