control//multi-agent control//flocking
Flocking is the coordinated motion of a group of agents produced by three local rules that each agent applies to the neighbours it perceives: **separation** (do not get too close), **alignment** (head in the average direction of the neighbours) and **cohesion** (move toward their centre). Craig Reynolds used these rules in 1987 to animate bird flocks on a computer (his *boids*), and in robotics they are the textbook way to move many agents together with no plan and no leader.
Flocking is the coordinated motion of a group of agents produced by three local rules that each agent applies to the neighbours it perceives: separation (do not get too close), alignment (head in the average direction of the neighbours) and cohesion (move toward their centre). Craig Reynolds used these rules in 1987 to animate bird flocks on a computer (his boids), and in robotics they are the textbook way to move many agents together with no plan and no leader.
Nobody holds the flock's plan, and the flock appears anyway. One common form of the update for agent iii, with velocity viv_ivi and position pip_ipi, is
vi ← vi+ws si+wa (vˉNi−vi)+wc (pˉNi−pi),v_i\;\leftarrow\;v_i+w_s\,s_i+w_a\,(\bar v_{\mathcal N_i}-v_i)+w_c\,(\bar p_{\mathcal N_i}-p_i),vi←vi+wssi+wa(vˉNi−vi)+wc(pˉNi−pi),
where sis_isi pushes the agent away from neighbours that are too close, vˉNi\bar v_{\mathcal N_i}vˉNi and pˉNi\bar p_{\mathcal N_i}pˉNi are the mean velocity and position of its neighbours, and the www weigh the three rules. The last two terms are the consensus protocol in another form: alignment is consensus on velocity, cohesion is consensus on position.
Small changes in the weights can change the collective behaviour abruptly.
The Vicsek model (1995) keeps only alignment, adds noise, and shows a phase transition: below a critical noise level, or above a critical density, the group switches from disordered milling to ordered motion. Emergent behaviour resists prediction, and a flock tuned in simulation can act differently once real sensing delays enter.
The analysis of alignment is consensus theory on a changing graph. Jadbabaie, Lin and Morse's 2003 result, that agreement survives links coming and going as long as their union over every bounded window is connected, was written to explain the Vicsek model.
Separation is a safety matter and gets priority. On real drones collision avoidance runs as its own layer, often faster than the flocking rule, because a weighted sum of three urges guarantees no minimum distance.
It is the base behaviour of swarm robotics and the clearest picture of emergence, a collective behaviour written in no individual rule.
A group that must fly a known shape uses formation control or precomputed trajectories instead; flocking pays where there is no global communication and the number of agents is large.