Dancing with Friends and Enemies: Swarm Intelligence in Boids

Dancing with friends and enemies: boids' swarm intelligence

Dancing with Friends and Enemies: Swarm Intelligence in Boids

A playful experiment turns 1,000 particles into dancers, each with a randomly chosen friend and enemy, moving closer to the center, toward friends, and away from enemies. The simple rules produce mesmerizing swirling patterns, illustrating how macro-scale swarm behavior emerges from local interactions. The post includes code, animations, and variations like 3D and ring configurations.

The description of the system as a dance was an attempt to explain the swirling pattern on the screen without using mathematical language.

More from this day

2026-08-17