← Back to PSO docs

teeline · algorithms/pso

Particle Swarm Optimisation

A swarm of tour-particles updates each epoch. Each particle's velocity is a list of city-swap moves built from three components: ω keeps momentum from the previous epoch, C₁ pulls toward the particle's own personal best, and C₂ pulls toward the global best. Inertia ω decays over time, shifting the swarm from exploration toward exploitation.

01234567891011
Particles
01954
gbest
12212
dist 2212
22185
dist 2185
32179
dist 2179
41983
dist 1983
52185
dist 2185
● gbest tour● best particle● swarm● city
Press Step or Run to begin
ω (inertia) = 0.900
High — broad exploration
epoch
0
gbest dist
1953.6
avg dist
2116
v_max
5 swaps
Balanced swarm size
cities: 12particles: 6ω: 0.4→0.9C₁=C₂=1.5v_max: 5