Heuristic — swarm metaheuristic

Particle Swarm Optimisation

Aliaspso, particle_swarm
TypeHeuristic — swarm metaheuristic
Auto-seeds fromshuffle (random swarm)

Description

Swarm metaheuristic where each particle is a candidate tour with a velocity — an ordered list of position swaps. Each iteration, the velocity is updated to pull the particle toward both its personal best tour and the global best tour found by any particle. The new position (tour) is obtained by applying the velocity swaps.

TSP-specific adaptations (deviations from Clerc 2004):

AdaptationReason
Velocity cap at ⌈0.35 · n⌉ swapsWithout a cap, velocity grows to ~5n swaps per epoch, scrambling tours into noise
Linear inertia decay W: 0.9 → 0.4High inertia early for broad exploration; decays like a cooling schedule for late fine-tuning
All particles initialised randomlySeeding via the pipeline; PSO itself stays a pure algorithm

Auto-expands to pipeline(shuffle, pso).

Options

FlagDescriptionDefault
--epochsMaximum iterations10 000
--n_nearestNumber of particles (floored at 30)30

Usage

teeline solve pso -i ./data/tsplib/berlin52.tsp
teeline solve particle_swarm -i ./data/tsplib/berlin52.tsp --epochs=500
teeline solve pso -i ./data/tsplib/berlin52.tsp --n_nearest=50

References