HomeAI & Machine LearningPSO 2D: Fitness Heatmap & Convergence Chart

PSO 2D: Fitness Heatmap & Convergence Chart

2D top-down companion to the 3D PSO terrain sim: the Rastrigin benchmark rendered as a colour-mapped fitness field on a 2D grid, with a live convergence chart tracking best fitness and swarm diversity against iteration, independently computing the same global-best vs ring-topology particle swarm optimization.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-swarm-intelligence-particle-swarm-optimization ↗ Open standalone

Particle Swarm Optimization borrows its update rule from flocking behavior: every candidate solution ("particle") nudges its velocity toward the best position it has personally found and toward the best position known within its neighborhood, then moves. This 2D companion runs the identical PSO search over the Rastrigin benchmark, but represents it two genuinely 2D-native ways: the fitness landscape as a colour-mapped field on a flat grid (no elevation, no camera angle) instead of a 3D terrain, and a live convergence chart tracking best fitness and swarm diversity against iteration — a parameter-space view the 3D version has no equivalent of. Switch neighborhood topology between a fully-connected global-best swarm and a sparse local-best ring to see how it trades convergence speed against resistance to getting stuck in a local optimum.

⚙ Under the hood

2D top-down companion to the 3D PSO terrain sim: the Rastrigin benchmark rendered as a colour-mapped fitness field on a 2D grid, with a live convergence chart tracking best fitness and swarm diversity against iteration, independently computing the same global-best vs ring-topology particle swarm optimization.

particle swarm optimizationswarm intelligencemetaheuristicsoptimizationneighborhood topologyconvergence chart

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)