Particle swarm optimization (PSO) searches for a good solution by moving a group of candidate solutions, called particles, through a search space. The idea comes from swarms such as bird flocks: individuals move, but their collective behavior helps the group find a direction. PSO is especially useful when there are too many possible combinations to check one by one. section 7.1 section 7.2
Finding a drone material mix
Suppose a drone’s performance depends on its amounts of aluminum and plastic. Those amounts give each candidate a position in a two-dimensional search space; the resulting performance is its fitness score, not a third dimension to search. Because the amounts can vary by tiny decimal increments, testing every mix is impractical. PSO instead explores selected positions and seeks a high-scoring mix—like hikers searching for a mountain peak. section 7.3
A PSO run follows a repeating cycle:
- Choose the number of particles and give each a random starting position. section 7.5
- Calculate how good each position is using the problem’s fitness measure. section 7.5
- Move the particles using swarm behavior, then evaluate their new positions. Repeat until the stopping condition is met. section 7.5
- Return the best position the swarm found. section 7.5
Figure 7.13 The life cycle of a PSO algorithm
The life-cycle diagram shows where evaluation and movement repeat before the swarm returns a solution. section 7.5
PSO can search large, high-dimensional spaces without exhaustively testing every value. Applications include configuring electrodes for deep-brain stimulation and tuning neural-network weights. As a rule of thumb, swarm algorithms suit continuous numeric choices, while genetic algorithms are often better suited to discrete choices. section 7.10 section 6.1


