← All case studies
Evolutionary Computing · metaheuristics

Particle Swarm Optimization on Rastrigin

Tuning swarm dynamics on a notoriously multimodal benchmark to reach the global optimum far faster — and validating it rather than trusting a single lucky run.

MATLABPSODifferential Evolutionparameter sweeps2025
173 → 16
iterations to converge
0
fewer iterations
0
benchmarks (Rastrigin, Rosenbrock)
multi-run
validated with statistics

The problem

The Rastrigin function is a classic optimization trap: a smooth global bowl studded with dozens of regular local minima. Naïve optimizers get stuck in the nearest dip. The task was to make Particle Swarm Optimization escape them reliably — and quickly.

Approach

Results

Tuned inertia damping plus a well-chosen population let the swarm converge in 16 iterations instead of 173 — a 90.8% reduction — while still reaching the global optimum. The sweeps showed inertia weight as the dominant lever: too high and the swarm never settles, too low and it stalls in a local minimum.

Convergence curves for PSO techniques
Convergence across PSO techniques.
Swarm trajectory over the Rastrigin contour
Swarm over the Rastrigin contour.
Inertia-weight sweep
Inertia-weight parameter sweep.
Method comparison on Rastrigin
Method comparison on Rastrigin.

What I took away

View repository on GitHub →

← Previous: Robot Localization Next: Traffic-Signal Fuzzy System →
×