Boids Explorer © 2026 Theodore P. Pavlic · MIT License

Reynolds' Boids (1987) produces lifelike flocking from three purely local rules applied to every agent at each step: separation (avoid crowding), alignment (match neighbors' headings), and cohesion (steer toward the local center of mass). The name "Boid" is a portmanteau of bird-oid — bird-like. Each rule acts within its own spatial radius — separation closest, cohesion farthest — and the emergent collective motion depends sensitively on the balance of their weights. Unlike other classic collective motion models such as the Vicsek model (Vicsek et al., 1995), Boids has no explicit noise term; behavioral richness arises from the nonlinear interplay of three competing forces. For an interactive simulation, see Tab ② Simulation.

Current state
▶ Focus boid ▶ Separation zone ▶ Alignment zone ▶ Cohesion zone ▶ Non-neighbor
The Three Rules
① Separation — avoid crowding
fsep = −Σj: d<rs (xj−xi) / |xj−xi|
Repulsion from boids inside the separation radius rs. Normalized so near and far neighbors contribute equally.
② Alignment — match headings
falign = normalize(Σj: d<raj) − v̂i
Steer toward the average heading of neighbors within ra. Drives directional coherence; the primary flocking force.
③ Cohesion — stay together
fcoh = normalize(CoMj: d<rc − xi)
Steer toward the center of mass of neighbors within rc. Keeps the flock from dispersing; rc is typically the largest radius.
➡ New Heading
v(t+1) = normalize(v(t) + wsfsep + wafalign + wcfcoh) · vmax
Weighted sum steers the current velocity; direction is normalized and speed is reset to vmax. Ordering rs < ra ≤ rc is typical.
System Properties
Order Parameter φ
φ = (1/N)|Σj ej| = (1/N)√((Σcosθ)2+(Σsinθ)2)
φ = 0: all headings random. φ = 1: perfect alignment. A global statistic of collective coherence — not part of the per-boid dynamics.
φ ≈ 0
φ ≈ 0.5
φ ≈ 1
Algorithm Sketch
initialize N boids in [0,L]²: xi ∼ U([0,L]²); θi ∼ U(−π,π) vi = vmax(cosθi, sinθi) repeat each timestep: for each boid i: fsep = steer away from {j: d < rs} falign = match heading of {j: d < ra} fcoh = toward CoM of {j: d < rc} vi ← normalize(vi + wsfsep + wafalign + wcfcoh) · vmax xi ← xi + vi apply boundary conditions
Key Differences from Vicsek
Vicsek uses a single averaging rule with additive noise; Boids uses three competing forces without noise. The three radii create spatial structure absent in Vicsek — a boid simultaneously repels its nearest neighbors, aligns with a wider group, and coheres with an even wider group. Tuning their weights and radii produces qualitatively distinct collective states: directed flocking, compact swarming, milling vortices, and dispersed wandering — a richer behavioral landscape than Vicsek's ordered-vs-disordered binary.