An interactive essay
Nobody’sin Charge
On flocks, ants, slime, fireflies, and other things that organize themselves
On winter evenings over Rome, starlings gather by the hundreds of thousands and pour themselves across the sky.
The shape folds, splits, and heals in a fraction of a second. No bird is directing it. Each one is watching only a handful of its neighbors.
So where does the shape come from?
Part I
The Index Card
In which a flock is built from three sentences.
Craig Reynolds wanted to animate a flock of birds without animating any birds. It was 1986, he was a programmer in the graphics division of Symbolics, and choreographing thousands of flight paths by hand was hopeless. So he turned the problem inside out. Instead of describing the flock, he described a single bird, one that knows nothing about any flock, and then made a lot of them.
He called them boids. Every boid follows the same three rules.
- Separation. Don’t crowd your neighbors.
- Alignment. Fly the way they’re flying.
- Cohesion. Stay near the middle of them.
That’s the whole specification. What’s surprising is how much of a flock it produces, and how little of that you can find by reading the rules. Let’s add them one at a time.
This is everything a boid knows: where it is, which way it’s heading, and who is inside a small circle around it, minus a blind spot behind. The rest of the sky might as well not exist.
The neighbors are in view, but there’s no steering rule yet. This boid keeps its heading, even when another one passes straight through its circle.
Without rules, boids are just particles: straight paths crossing each other without noticing. Let’s give them something to care about.
Rule one
Separation. We’ve stopped the clock. Anyone inside the inner circle is too close, and pushes the boid away, harder the closer they are. The pushes add up to a single direction of escape.
Separation changes encounters, not destinations. Nearby boids bend one another’s paths away. The crowd spreads out, but nothing asks two neighbors to agree on where they’re going.
Rule two
Alignment. Average the velocities of the neighbors in the circle. The blue arrow is a target; the black arrow magnifies the turn from one update by the factor marked on its arc. Notice what this rule ignores: where the neighbors are. It only cares where they’re going.
Keep separation and add alignment. Agreement spreads from neighbors to neighborhoods, until streams of boids are traveling together. They can still drift apart: neither rule pulls a straggler back in.
Which way do they end up going? Nobody chooses. The direction is an accident of the starting positions. Run it again and you’ll get a different one.
Rule three
Cohesion. Find the average position of your neighbors and steer toward it. This is the rule that reels in stragglers and turns a stream into a group.
Now add cohesion. The scattered streams pull into moving groups. Separation resists the inward collapse; alignment turns a gathering into a procession. A flock is the compromise between all three.
Now go looking for the flock in the code. You won’t find it. There’s no flock variable, no list of members, no leader. We drew those outlines ourselves; the boids can’t see them.
The flock exists only in the pattern.
Reynolds showed boids at SIGGRAPH in 1987, along with a short film, Stanley and Stella in: Breaking the Ice, about a bird and a fish who fall in love; the flock and the school around them are boids. Hollywood took notice. The bat swarms in Batman Returns were boids, and in 1998 Reynolds received an Academy Award for his contributions to computer animation. The flocks, schools, and stampedes of the films that followed grew from the same idea.
Taking it apart
Each rule is doing essential work, and you can tell because each one fails in its own way when it’s left alone. Separation alone makes a gas. Alignment alone makes traffic: orderly lanes that drift apart and never regroup. Cohesion alone makes knots, clumps that collapse inward and orbit their own centers.
Drag the point toward a corner to hand the flock over to one rule.
Part II
The Hawk
In which we ask why anyone would join a flock.
Reynolds’s rules explain how birds flock. They don’t explain why a bird would bother. A flock is conspicuous, crowded, and competitive. Why join one?
The biologist W. D. Hamilton offered a bleak answer in 1971. Picture frogs sitting around a pond, and a snake that surfaces at a random spot and eats the nearest frog. Each frog’s risk is proportional to its domain of danger: the patch of ground closer to it than to any other frog. Draw every frog’s domain and the pond is tiled with polygons, a pattern geometers call a Voronoi diagram.
A frog can shrink its domain by hopping into a gap between its neighbors. This makes the neighbors’ domains grow. When everyone does it, the group pulls itself into a tight knot, and whoever is stuck on the outside pays for it. Hamilton called this the selfish herd: a group made entirely of individuals trying to put someone else between themselves and the snake.
Notice that the selfish rule, move toward your neighbors, is just cohesion with a darker motive.
Hamilton’s idea waited four decades for a clean test. In 2012, Andrew King and colleagues strapped GPS backpacks to a flock of 46 sheep, recorded every animal’s position each second, and sent in a sheepdog. As the dog closed in, the sheep didn’t simply flee. They pressed toward the middle of the flock, each trying to get a neighbor between itself and the dog.
The swerve
Whatever the reason for joining, a flock can do something no bird can do alone. When a hawk or a falcon dives into a murmuration, the birds nearest to it swerve, and the swerve races outward through the flock. In 2014, a team in Rome filmed starlings turning in flight and found that the turn crossed a 400-bird flock in about half a second, traveling at a steady 20 to 40 meters per second and barely fading as it went.
You’re the hawk. Move through the flock.
The same group found something subtler, too. In 2008 they reconstructed the 3D position of every bird in flocks of thousands, using synchronized cameras on the roof of a museum in Rome. Each starling, it turned out, pays attention to a fixed number of neighbors, six or seven, however far away those neighbors happen to be. Boids use a fixed distance instead.
The difference shows up when something tears a flock open. A boid whose neighbors scatter beyond its radius simply forgets them and flies off alone. A starling just looks farther.
By distance everyone within a fixed radius0 alone
By number the seven nearest, however far0 alone
The Rome group found one more thing, and it leads to the next chapter. In 2010 they measured how each bird’s small departures from the flock’s average motion were correlated with those of birds farther away. The correlations didn’t fade out at some fixed distance. They spanned the whole flock, however big the flock was. In physics, correlations that reach across an entire system are the signature of a system poised at a critical point, like a magnet at the temperature where it loses its magnetism.
Part III
The Freezing Point
In which physicists remove almost everything, and the flock survives.
Physicists love a model they can strip for parts. In 1995, Tamás Vicsek and his colleagues took the idea behind boids and threw away nearly everything: no separation, no cohesion, no turning limits. Each particle moves at a constant speed, and each step it points itself in the average direction of the particles near it, plus a random error.
An error here means a turn away from the neighbors’ average heading. At noise 0.5, that turn can be as much as 90° either way. Each particle makes a fresh mistake each step. There is no preferred direction hiding in the code. If a direction wins, the crowd has to invent it.
At high noise, agreement is short-lived. Colors show heading: a patch of one color is a little neighborhood moving together. Fresh errors keep tearing those neighborhoods apart.
Order near zero doesn’t mean nobody agrees. Each patch of color is a neighborhood in agreement. It’s the patches that disagree with each other, and averaged together they cancel almost to nothing.
Now reduce the errors. A patch of agreement survives longer, travels farther, and meets more particles. Those recruits bring more recruits. Watch the trace bend upward as local agreement becomes a direction for the whole box.
The change takes time. Stop scrolling near η = 0.4 and the noise stays fixed while the crowd keeps negotiating. A vertical stretch of the trace means the system is changing even though the noise isn’t.
The halfway state has a shape. Dense, ordered bands can travel through a thin, disordered background. A band gathers particles at its front and loses them behind, like a moving traffic jam. The particles pass through it; the pattern outlives its members.
A single agreement score hides that coexistence. Look back at the colors and the empty space: order and density are rising together.
Lower the noise further. Now a particle can cross the whole box and still be moving roughly the same way as everyone else. Nobody it meets along the way has a reason to turn it.
This is a phase transition: a collective property appears that no isolated particle can possess. Nothing in the update rule says when to make a band or which direction to choose.
At zero noise, mistakes stop. Agreement already established can persist. But zero noise is not a command to align: disconnected groups can keep different headings until they meet. The crowd has a history, not just a setting.
Turn the noise back up. An organized crowd takes time to fall apart, just as a disorganized one takes time to agree. The returning trace need not retrace the descent.
There isn’t one magic noise value for every flock. Density, speed, box size, and how long you wait all matter. This trace is one finite experiment; finding a transition precisely means repeating it, letting each setting settle, and comparing larger systems.
Agreement that travels
Here is the strange part. In an equilibrium system, two dimensions are a difficult place to keep arrows aligned. Mermin and Wagner showed that a continuous direction, coupled only over short distances, cannot sustain true long-range order at a nonzero temperature under the theorem’s assumptions. Small fluctuations accumulate over ever larger distances.
A flock isn’t at equilibrium. Its particles propel themselves. A particle carries its heading to new neighbors, so information travels with the matter carrying it. Toner and Tu showed how this transport lets a moving flock sustain order in two dimensions. The loophole is motion.
The bands reveal another difference from a magnet: the arrows can carry themselves into a denser patch. More neighbors make alignment more effective; alignment helps a moving patch survive. Later work found that, in large Vicsek systems, the onset of flocking involves coexistence between a dilute disordered phase and dense traveling bands. The analogy to freezing is useful, but the material here is spending energy just to stay in motion.
For decades this was a theorist’s cartoon. Then, in 2013, Antoine Bricard, Denis Bartolo, and colleagues in Lyon built one. They spread millions of plastic beads, each about five thousandths of a millimeter across, on the floor of a racetrack-shaped channel and switched on an electric field. The field sets each bead spinning, and a spinning bead on a floor rolls. As it rolls, it stirs the fluid around it in a way that turns its neighbors to roll in the same direction: alignment, with nothing alive involved.
Part IV
Messages in the Dirt
In which ants use the ground as a notebook.
Birds coordinate by watching each other. Plenty of ants can barely see. They coordinate through the ground.
A forager that finds food heads home laying down a chemical trail. Other ants tend to follow trails, and when they find food, they lay trail too. The chemical evaporates, so a trail survives only as long as it keeps paying off. The French biologist Pierre-Paul Grassé, studying termites in 1959, gave this kind of coordination a name: stigmergy. Work leaves a mark, and the mark directs the next piece of work.
The colony ends up solving problems no ant understands. Offer it two routes to the same food and it tends to settle on the shorter one. Nobody measured anything: ants on the short route simply finish more round trips, so its trail gets repainted more often, which draws more ants, who repaint it faster still. In 1989 Simon Goss, Jean-Louis Deneubourg, and colleagues watched Argentine ants do exactly this on a two-branched bridge.
It doesn’t always work. Sometimes the colony commits to the long way early and takes a while to unlearn it, which is also true of people. And a trail that only rewards being followed can trap its followers. In 1921 the naturalist William Beebe came across army ants in Guyana that had lost their trail and closed into a loop. Each ant followed the scent of the ant ahead, and the loop was the only trail there was. By his account it was about 1,200 feet around, an ant took two and a half hours to complete a lap, and the march went on for two days as the dead piled up along the route. Biologists call this an ant mill.
Beebe’s mill ended when a few stragglers wandered off and the rest followed them into the forest. The same feedback that trapped the ants also freed them. A few years after that bridge experiment, Marco Dorigo turned the idea into an algorithm, ant colony optimization, which sends virtual ants across graphs to find short routes. Its virtual pheromone evaporates on purpose, so that bad loops fade. The ground became a data structure.
Part V
The Brainless Engineer
In which a single cell lays out a railway.
Physarum polycephalum is a slime mold: a single, enormous, brainless cell the color of egg yolk. It forages by spreading out a fan of branching tubes, then thickening the tubes that carry food and letting the rest wither away.


In 2000, Toshiyuki Nakagaki showed that Physarum could find the shortest path through a maze. Ten years later, his group gave it a harder problem. They placed oat flakes on a wet plate at the positions of 36 cities around Tokyo and set the slime mold down at Tokyo. It avoids bright light, so they lit the sea, the lakes, and the mountains to keep it on the plain.
Within about a day it had connected the cities with a network of tubes. Compare them with railways serving the same population centres as the food sites here.
The researchers scored the slime on three things engineers care about: how much tube it used, how directly it connected the cities, and whether the network stayed connected when a link broke. On all three, it was comparable to the real railways.
Breaking a link is easy to try. Click any tube to shine a light on it. The mold abandons the lit patch and finds another way around.
The mold in this dish is a crowd of particles, following a model Jeff Jones published in 2010. Each particle has three sensors pointing ahead. It turns toward whichever sensor smells the most trail, takes a step, and drops a little more trail. The trail spreads and fades, and no particle can step where another already stands.
That’s the whole model: the ants’ trick without the ants’ purpose. Here it runs on a hundred thousand particles with no food at all, and it still builds a network that never quite settles. The trails organize the particles, and the particles maintain the trails.
Three numbers shape the particle: how widely its sensors spread, how far ahead they reach, and how sharply it turns. Jones found that the two angles alone take the same crowd anywhere from an ever-rewiring network to scattered islands, and that a longer reach makes the network coarser. Redraw the particle on the card below, and the whole dish reorganizes to match.
Memory without a brain
A network that rebuilds itself is also a record of where it has been. In 2008, Tetsu Saigusa and colleagues hit crawling Physarum with a cold, dry spell at regular intervals. Each time, it slowed down. After three spells they stopped, and at the moment the next one was due, the mold slowed down anyway, as if it had been expecting it.
Its body keeps time: the tubes squeeze rhythmically, sloshing the cell’s insides back and forth every minute or two. In 2021, Mirna Kramar and Karen Alim argued that it also keeps notes in the tubes themselves. A tube that carried food grows thick and stays thick, so the pattern of thick and thin tubes records past meals. Not everyone agrees that this counts as memory. Either way, there is nowhere else for the information to be.
Part VI
Sync
In which the pattern moves from space into time.
Everything so far has organized itself in space. Some of the most striking patterns in nature are organized in time.
Along tidal rivers in Southeast Asia, male fireflies gather in mangrove trees by the thousands and flash in unison, all night long. For centuries Western travelers came home with stories about it, and for centuries other Westerners refused to believe them. In 1917, one writer in Science decided the effect must come from his own twitching eyelids: “The insects had nothing whatsoever to do with it.”
Each firefly carries an internal clock that ticks toward its next flash. When it sees a neighbor flash, its own clock jumps ahead a little. In 1990, Renato Mirollo and Steven Strogatz proved that, under a few mild conditions, a population of clocks like this doesn’t just sometimes fall into step. From almost any starting point, it always does.
The proof turns on two facts you can watch below. First, the jump is bigger for a clock that is nearly due, so a clock running just behind a flasher gets shoved over the top and flashes with it. Second, two clocks that flash together receive the same jumps forever after. Groups can merge but never split, so the number of groups can only go down.
The fireflies of Southeast Asia fit this picture well: each one, kept alone, flashes like a metronome. The synchronous fireflies of the Great Smoky Mountains do not. When Raphaël Sarfati, Orit Peleg, and colleagues put a single Photinus carolinus in a tent, it flashed whenever it liked, with no rhythm at all. Once there were fifteen or more, bursts of flashes swept through the tent about every twelve seconds. The rhythm wasn’t in any firefly. It belonged to the group.
The same mathematics reaches well beyond insects. Mirollo and Strogatz were extending a 1975 model of the heart by Charles Peskin. Your heartbeat is set by the sinoatrial node, a patch of about ten thousand pacemaker cells. No single cell is the leader. Each one charges up, fires, and nudges its neighbors, and the node beats as one.
Part VII
Swarmalators
In which the fireflies start to swarm.
Flocks move, but they don’t keep time. Fireflies keep time, but they don’t move. Plenty of animals do both.
On summer nights in Japan, male tree frogs gather on the raised paths between flooded rice paddies and call for mates. Neighbors take turns, each frog slotting its calls into the gaps between those of the frogs beside it. Frogs are hard to watch in the dark, so in 2011 a team of researchers lined a paddy path with homemade sensors, each a microphone wired to a light that blinked whenever a frog called nearby. They called the devices Fireflies.
Frogs also hop. If when a frog calls depends on where it sits, and where it sits depends on when it calls, what does the chorus turn into? In 2017, Kevin O’Keeffe, Hyunsuk Hong, and Steven Strogatz wrote down the simplest version of that question, for creatures whose rhythm affects where they go and whose position affects their rhythm. They called them swarmalators.
Two numbers run the model. J sets how strongly swarmalators are drawn to others in the same phase. K sets how strongly nearby swarmalators pull each other’s phases together, or, when it’s negative, push them apart. Color shows phase.
None of the five states is written into the model. Rings of rainbow, frozen crystals, and slow internal rivers all come from the same two rules. The authors suggested where real ones might be found: among sperm, in frog choruses, and in suspensions of microscopic magnets. Since then, the list has grown.
Every system in this essay works the same way. A crowd of agents, each following a rule you could fit on an index card, none of them aware of the pattern they belong to.
The flock isn’t in any bird. The highway isn’t in any ant. The railway isn’t anywhere in the slime. They live in between, in interactions repeated millions of times.
Nobody’s in charge.
Everybody’s paying attention.