↓Skip to main content

Parallel particle swarm optimizer

Description #

A parallel particle swarm optimizer for finding minima of continuous functions, implemented and analysed in a team of two in Rust with a focus on parallel performance.

PSO is a population metaheuristic: a swarm of candidate solutions moves through the search space, each particle pulled towards both its own best-known position and the swarm’s. It parallelises well in principle, since particle updates are independent within an iteration — the interesting part is the synchronisation around the shared global best, which is exactly where the speedup goes to die if you are careless about it.

We implemented several parallelisation strategies and benchmarked them against standard optimisation test functions, measuring both wall-clock speedup and solution quality — a faster variant that converges to a worse minimum is not actually a win. Rust’s ownership model made the shared-state variants considerably less nerve-racking to write than the equivalent C would have been.


Link to GitHub Repository