ViewWiki

The world, a little closer

Flocking and collective behaviour.

Thousands of starlings swirl at dusk like one creature, yet no bird is in charge. How does a flock steer itself with no leader?

Explore the scene Interactive article

01 / The experiment

Three rules. No leader.

Turn one rule off at a time and watch the flock change, then look inside to see what a single bird pays attention to.

Still of the Flocking and collective behaviour 3D scene, which explores: How does a flock of starlings steer itself with no leader?
Interactive scene

Loading the interactive version…

The explanation below is available while the scene loads.

Starlings wheel over a reed bed at dusk, slowed down so you can follow a single bird. Every bird obeys the same three rules and watches only its seven nearest neighbours.A few hundred birds stand in for a flock that can be tens of thousands strong, and each is drawn about a third larger than life so it shows. The rules are a simple steering model, not measured starling behaviour; each bird also turns back when it strays past the edge of the roost, which keeps the flock in view. Real starlings judge their neighbours by eye, react to falcons and differ from one another.

02 / Three rules

Apart, along, together.

Each bird runs all three on its seven nearest neighbours. Nothing else.

Keep your distance01

Separation

A neighbour inside a bird’s personal space pushes it away, harder the closer it comes. This is what stops birds colliding.

Reads
Neighbours too close
Steers
Away from them
Without it
Birds pile into knots
Go their way02

Alignment

A bird turns, speeds up or slows down to match the way its neighbours are flying. This is what makes a flock travel instead of hover.

Reads
Neighbours’ headings
Steers
To their average heading
Without it
A milling swarm
Stay with them03

Cohesion

A bird steers towards the centre of its neighbours. On the edge of the flock that means inwards, which keeps the flock in one piece.

Reads
Neighbours’ positions
Steers
Towards their middle
Without it
The flock frays apart
The big idea

No bird knows the flock’s shape or where it is going. Every bird runs the same three local rules on the few birds nearest it, and the murmuration emerges from all of them at once.

0 leaders

A shape with no one in charge

On winter evenings, flocks of starlings gather over their roost before settling for the night. Tens of thousands of birds pour across the sky as a single dark cloud that stretches, folds, splits in two and flows back together. This display is called a murmuration. Seen from below it looks choreographed, as though someone were conducting it.

No one is. There is no leader at the front, and no bird can see the shape the whole flock makes. Each one is flying its own flight, a few body lengths from the birds around it. The flock’s shape is something that happens between the birds, not something any of them decides.

Three rules for every bird

In 1987 the computer graphics researcher Craig Reynolds showed that a convincing flock needs surprisingly little. He gave each simulated bird, which he called a “boid”, three rules about the birds nearby:

  • Separation: do not crowd them. Steer away from any neighbour that comes too close.
  • Alignment: go their way. Turn and speed up or slow down to match their average heading.
  • Cohesion: stay with them. Steer towards the middle of where they are.

That is all. No rule mentions the flock, its edge, its size or where it is going. Every bird runs the same three rules on what it sees around it, many times a second, and the flowing shape appears by itself.

Try it: choose One bird’s rules under Follow one bird. One bird turns gold, with lines to the seven birds it is watching, and then its three steers appear as arrows. Watch them for a while: they swing round as its neighbours move, and they are all the bird ever responds to.

Back to the experiment

Seven neighbours, not a fixed distance

Which birds count as “nearby”? In 2008 a team in Rome filmed starling flocks over the city from several cameras at once, rebuilt the position of every bird in three dimensions, and asked whose movements each bird followed. The answer was not “every bird within some distance”. Each starling kept track of about six or seven nearest neighbours, however near or far those happened to be.

That turns out to matter. If birds reacted to everyone within a fixed distance, a flock that spread out would lose touch and fall apart. Because each bird always watches its closest handful, a thinning flock stays connected, and a dense one does not overload anyone. The scene uses the same rule: each bird reads its seven nearest neighbours and nobody else.

Take a rule away

Each rule does one job, and the clearest way to see that job is to switch the rule off.

  • With Alignment off, the birds still stay together and still keep their distance, but nothing makes them head the same way. The flock turns into a milling cloud, more like a swarm of gnats than a flock of birds.
  • With Cohesion off, nothing draws a bird back towards the others. Separation keeps pushing neighbours apart, so the flock loosens, thins and frays into loose groups.
  • With Separation off, cohesion pulls each bird into the middle of its neighbours with nothing to stop it. The birds pile into tight knots that would, in real life, be a tangle of collisions.

Try it: slide Cohesion down to 0% and wait a few seconds for the flock to loosen. Then slide it back to 50% and watch the gaps close up.

Back to the experiment

The flock you see at the start is a balance. Cohesion pulls birds in, separation pushes them apart, and alignment makes them agree on a direction. Turn any one of them up to 100% and the balance shifts: strong alignment gives a flock that moves almost as one rigid sheet, strong separation a more open one.

How a turn travels through the flock

When something at the edge of a real murmuration changes, such as a peregrine falcon diving at the flock, the birds nearest to it swerve. Their neighbours copy them, then the neighbours of those neighbours, and a wave of turning sweeps across the flock. Researchers filming flocks over Rome measured these waves travelling at around 20 to 40 metres a second, crossing a flock of hundreds of birds in well under a second.

In the scene the same thing happens whenever birds at the edge of the roost turn back towards it: the turn starts at the front and runs back through the flock, bird by bird, so the whole cloud swings round without anyone giving an order.

Collective behaviour everywhere

The same idea, many simple individuals following local rules with no plan of the whole, explains much more than starlings:

  • Fish schools wheel and split around a predator, each fish keeping position by sight and by the pressure waves its neighbours make in the water.
  • Ants find the shortest path to food because every ant follows and reinforces scent trails, and short trails are reinforced fastest.
  • Locusts marching in a swarm all head the same way once they are crowded enough, a switch from disorder to order like the one alignment makes in the scene.
  • Crowds of people form lanes when two streams walk through each other, without anyone agreeing to it.

Patterns like these, where order at a large scale comes out of rules at a small scale, are called emergent behaviour. Engineers borrow the idea to make swarms of drones fly together, and animators use it to fill films with flocks, herds and crowds.

What this model leaves out

The scene’s flock is a few hundred birds, not tens of thousands, slowed to about a third of real speed, with each bird drawn a little larger than life. The strengths of the three rules are numbers chosen so the flock looks and behaves like a murmuration; they are not measured from real birds. Real starlings judge their neighbours by eye, with a blind spot behind them, and react a fraction of a second late, whereas the model hands every bird the exact positions and speeds of its seven nearest neighbours straight away.

To keep the flock over the roost and in view, each bird also turns back when it flies past the edge of the reed bed, and keeps between a lowest and a highest height. That extra rule is the same for every bird and still involves no leader, but it is why the flock never wanders away. Real murmurations are shaped by things the model ignores: falcons and hawks, the wind, the light fading, and birds arriving and diving into the reeds to roost.

Reuse with credit to ViewWiki and a link to this page.

04 / Learn this in a course

Practise it, step by step.

This lesson teaches the topic with checked questions.

  1. Moving as one Biology · How animals live