Particle Swarm Optimiser (PSO)
Particle swarm optimisation (PSO; Kennedy and Eberhart 1995, https://doi.org/10.1109/ICNN.1995.488968) moves a swarm of particles through the search space. Every particle is a candidate with a velocity; it is drawn towards the best position it has found itself and the best position of its neighbours. This page describes the concepts; the configuration (swarms, movers, boundary handling, inertia) is in the section Particle Swarm Optimisation of the Optimisation Language.
Search space
A particle’s position is a candidate, its velocity has one component per search variable. The movers add velocities to positions, so the search variables must be real-valued and of at least cardinal scale; every variable needs a lower and an upper boundary, which limit the positions and the velocities. A configuration with other variables is rejected when it is loaded.
One iteration
flowchart LR
move[Move every particle] --> keep[Keep it within the boundaries]
keep --> evaluate[Evaluate all particles]
evaluate --> best[Update the personal bests]
best --> move
The initial positions come from the 'initialisation', the initial velocities are 0. In every
iteration, the mover computes the new velocity of every particle from its velocity, its
personal best and the personal bests of its neighbours; the new position is the old one plus
the velocity. The boundary handling (wrap, bounce or stick) keeps the position within the
boundaries of its variable. Then all particles are evaluated (in parallel, see
Optimisers), and a particle whose new position
is better than its personal best keeps it as its new personal best. The best personal best of
the swarm is the result of the run (bestSoFar in the memory model).
Memory model
The memory model records every particle in every iteration. A particle that moved is a
mutation of its individual of the previous iteration, a particle that kept its values an
identity. Every move also records the personal bests it used as relationships of the kind
influence, with the role as the property role:
| Mover | Influences |
|---|---|
basic-mover, constriction-factor-mover, arpso-mover |
personal-best (the particle’s own) and neighbourhood-best (the best personal best of its neighbours) |
fips-mover |
neighbour with the personal bests of all neighbours, each neighbour once, also if the topology lists it several times |
The targets are the individuals whose positions became these personal bests, so they can belong to any earlier iteration. A particle is a member of its own neighbourhood: the neighbourhood best can be its own personal best, and the neighbours of FIPS include the particle itself. In the repulsion phase of ARPSO the same personal bests repel the particle, and the memory model records them with the same roles. A move that is undone because the evaluation budget ran out has no influences.
Movers
For every variable, with the position x, the velocity v, the personal best p, the best personal best g of the neighbours and uniform random numbers r1 and r2 in [0, 1):
| Mover | New velocity |
|---|---|
basic-mover |
w v + c1 r1 (p - x) + c2 r2 (g - x), the update of Kennedy and Eberhart (1995) with the inertia weight w of Shi and Eberhart (1998, https://doi.org/10.1109/ICEC.1998.699146) |
constriction-factor-mover |
χ (v + c1 r1 (p - x) + c2 r2 (g - x)) with the constriction factor χ = 2 / |2 - φ - √(φ² - 4φ)| and φ = c1 + c2 ≥ 4 (Clerc and Kennedy 2002, https://doi.org/10.1109/4235.985692) |
fips-mover |
χ (v + (φ / K) Σ_k r_k (p_k - x)) over the personal bests p_k of all K neighbours, χ as above with the given φ ≥ 4 (fully informed particle swarm, Mendes, Kennedy and Neves 2004, https://doi.org/10.1109/TEVC.2004.826074) |
arpso-mover |
w v + d (c1 r1 (p - x) + c2 r2 (g - x)) with d = 1 in the attraction phase and d = -1 in the repulsion phase (Riget and Vesterstrøm 2002, EVALife Technical Report 2002-02, University of Aarhus) |
Every velocity component is limited to the range of its variable. The inertia weight w of
basic-mover and arpso-mover falls linearly from 'inertia-start' to 'inertia-end' within
'inertia-iterations' iterations. A falling inertia lets the swarm explore first and converge
later.
The arpso-swarm measures the diversity of the swarm, the mean distance of the particles from
their centre relative to the diagonal of the search space. Below 'diversity-low' it switches to
repulsion, above 'diversity-high' back to attraction, so a swarm that has collapsed spreads out
again.
Topologies
The topology decides which particles are the neighbours of a particle:
| Topology | Neighbours |
|---|---|
topology.global |
all particles (the default) |
topology.ring |
the 'neighborhood-size' particles around it on a ring of all particles, itself included |
topology.star |
the first particle; the first particle has all particles as neighbours |
topology.square |
the particles above, below and beside it, with the swarm arranged in a rectangle |
A global topology spreads the best position fast and converges fast; a ring spreads it slowly and keeps the swarm diverse for longer.
Examples
- pso-basic: the basic mover with a falling inertia
- pso-topologies: a global and a ring topology in one run
- pso-arpso: switching between attraction and repulsion