Murmuration: Starlings Track a Count, Not a Distance
Explorable Illusions · Published
A starling in a murmuration reacts to about six or seven nearest neighbors, on average. That is the count Ballerini and colleagues reported in PNAS in 2008, from 3D positions of starlings in 10 flocks over Rome. The count stayed about the same in dense flocks and sparse ones, so it is a number of birds, not a distance. In their own computer flocks, a rule like that kept the flock together better after a simulated attack.
Protocol · 5 parts

At a glance
- Name
- Murmuration (a large flock of starlings turning together)
- Also called
- Starling murmuration; in models, flocking; simulated birds are called boids
- First recorded
- Not traced on this page. The six-to-seven neighbor count was reported by Ballerini and colleagues in PNAS in 2008; the boids model was published by Craig Reynolds in 1987
- Type
- Collective motion of European starlings (Sturnus vulgaris), and the flocking models built to imitate it
- Main explanations
- Field result: each starling interacts on average with about six or seven nearest neighbors, a count rather than a distance (strong: 3D positions in 10 flocks). Why six or seven is open: one proposal is a limit on how many objects a bird can track, a second is a range that suits escape from predators (both offered as hypotheses)
- On this page
- A boids player with three rule sliders and a switch between a neighbor radius and a neighbor count, still figures, and a CSV of the run shown on the page
starling-murmuration-glance.csv (CSV) · what the file holds and its license
A murmuration is a large flock of starlings wheeling together, often over the place where they will spend the night. Ballerini and colleagues describe starlings gathering in the evening over the roost in flocks of a few hundred to tens of thousands of birds. This page looks at one bird inside such a flock and asks what it pays attention to. A player further down runs the three flocking rules Craig Reynolds published in 1987.
Six or seven neighbors, near or far
The Rome team photographed 10 flocking events at Termini railway station between December 2005 and February 2006. Cameras set 25 m apart took stereo pairs at 10 frames per second, and from these pairs the team rebuilt the 3D positions of most of the birds in flocks of up to 2,600 European starlings.
Then they looked at where each bird’s neighbors sit. A starling’s nearest neighbor rarely sits along the line of flight, and that lopsided pattern is a trace of how birds react to each other.
The pattern fades for the second, third and further neighbors. In the two flocks plotted in the paper, it is all but gone between the sixth and the seventh. Averaged over all the flocks, the range came to 6.5 birds, with a standard error of 0.9.
Packing varied a lot from flock to flock. The average distance to the nearest neighbor ran from 0.68 m in the densest flock to 1.51 m in the sparsest. The range in meters grew with that spacing. The range counted in birds showed no clear link to it.
Within one fixed distance, the authors note, the densest flock held 10 birds and the sparsest only 1. A rule based on distance would have given each bird a very different number of neighbors in different flocks. The data matched a fixed count.
Why would a count hold a flock together?
Ballerini and colleagues argue that a count is the safer rule when a flock stretches. Under a distance rule, a bird that drifts further out than its range loses touch with the rest of the flock, and stragglers drop out. Under a count rule, the pull between neighbors stays the same at any density, so a flock can thin out, change shape or even split, yet stay just as cohesive.
The figure shows the difference before anything moves. That part follows from the definitions alone: a radius can leave a bird with nobody, and a count never does.
The Rome team tested the idea with a simple 2D flocking model in which each bird turns toward the average heading of its neighbors. A simulated predator then swept past the flock. With a distance rule, the flock most often broke into 5 pieces, and lone stragglers made up 43% of the pieces. With a count rule, the most likely outcome was a single flock, and stragglers made up 5% of the pieces.
This page does not rerun that experiment, because the paper does not give every setting needed to rebuild it.
Reynolds’s three rules for boids
Craig Reynolds built a computer model of flocking in 1986 and called the simulated birds boids. His 1987 paper at the SIGGRAPH conference set out three behaviors, in order of priority: avoid collisions with nearby flockmates, match their velocity, and stay close to them. On his boids page the same three go by shorter names: separation, alignment and cohesion.
In Reynolds’s model, a boid’s nearby flockmates were those in a zone set by distance, and on his boids page also by an angle from the direction of flight. He noticed the catch himself in 1987. If the pull toward the flock were purely local, he wrote, two flocks far enough apart would simply ignore each other. Ballerini and colleagues point out that most flocking models still measured neighbors by distance when they wrote in 2008.
Run the boids yourself
The player below runs a simplified 2D version of Reynolds’s three rules. As in his model, a bird’s neighbors are the birds within a set distance, here 25 units.
A loose flock of 100 birds, ready to run
Light-sensitive? Nothing moves until you press Play. The birds are small dark triangles gliding over a white square, at most 30 small moves a second. Only those small triangles change, so no large area of the panel flashes.
Settings as in the article.
Your device asks for reduced motion, so the flock does not play; it stays at step 0, and the run is drawn below.
This page’s run: birds within 25 units, the weights in the CSV, seed 20261112.
Polarization and groups at the checked steps
| Step | Polarization | Groups |
|---|---|---|
| 0 | 0.829 | 10 |
| 50 | 0.965 | 13 |
| 100 | 0.980 | 11 |
| 200 | 0.984 | 9 |
| 400 | 0.983 | 8 |
| 800 | 0.980 | 8 |
murmuration-start.csv (starting positions, velocities and settings of all 100 birds, CSV)
"A loose flock of 100 birds, ready to run" by Explorable Illusions — https://explorableillusions.com/simulations/starling-murmuration/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
The player starts paused. The world is 800 by 800 units and wraps around at the edges.
At step 0, 100 birds are scattered over a 240 by 240 square, heading within 60 degrees of the same direction at 1.5 units per step. Speeds stay between 1 and 2 units per step. Birds closer than 25 units are linked, and linked birds count as one group. A polarization of 1 would mean every bird heading the same way, and 0 would mean the headings cancel out.
- Press Play and watch the polarization counter.
- Go back to the start and press Step a few times to see single moves.
- Drag the sliders to change the separation, alignment and cohesion weights.
Polarization starts at 0.83 and reads 0.98 by step 100 in this page’s run. That climb is the gasp point of this page: no bird can see more than 25 units, and none is told where the flock is going, yet nearly all of them end up heading the same way. The player moves no faster than 30 steps a second.
What the run shows, next to Reynolds’s description
Reynolds described what his boids did once released near one another. They flocked together, kept a prudent distance from their neighbors, and quickly became polarized, all heading about the same way. Solitary boids and smaller flocks joined into larger ones.
The run is consistent with both points. Polarization reaches 0.965 by step 50. At first some linked birds drift more than 25 units apart, so the group count rises from 10 to 13, and then groups that meet merge, down to 8 by step 210.
The merging stops there. From step 210 to step 800 the count stays at 8: at every recorded step, the 8 groups, flying almost the same way, were more than 25 units apart. That is Reynolds’s own catch from 1987 in action: two flocks far enough apart ignore each other.
Reynolds also noted on his boids page that the heading of his flock a few minutes ahead was all but impossible to predict, even though each boid follows simple rules. A double pendulum is hard to forecast far ahead too, for a different reason: a tiny change at the start grows until two swings part ways. The page’s numbers can be repeated only because the start, the rules and the order of every sum are fixed.
Each bird here reacts only to what surrounds it, a little like the Ebbinghaus illusion, where the same circle can look larger or smaller depending on the circles around it. Traffic runs on local choices too: in the Braess paradox, a new road can make every trip slower when each driver picks the quickest route.
Questions about murmurations
Why six or seven neighbors and not more?
Ballerini and colleagues offer two possible reasons and do not choose between them. One is a limit on tracking: a bird may only be able to keep track of a handful of objects at once, and they note that trained pigeons can tell apart sets of fewer than seven objects. The other is that a range of about this size may suit escape from predators, balancing too little information against too much noise.
Why do starlings gather in such big flocks?
Holding the flock together matters to the birds, Ballerini and colleagues stress, citing earlier work that stragglers and small groups are more likely to fall to predators. Their paper describes starlings gathering over the roost in the evening, and the flocks they filmed reached 2,600 birds. This page has not read further work on why starlings roost together.
What is a boid?
A boid is a simulated flocking bird. Craig Reynolds coined the name for the creatures in his 1986 flocking model, and his 1987 paper describes how each one steers by itself.
Check it yourself
Every model number on this page comes from one program, with 100 birds, the settings in the player’s CSV and starting seed 20261112.
| Claim | Settings | Result |
|---|---|---|
| A radius can leave a bird with no neighbor | the 100 starting birds, radius 25 | 0 to 7 neighbors per bird, 3.38 on average; 2 birds with none |
| A count gives every bird the same number | the same birds, 7 nearest | 7 neighbors per bird |
| The boids line up | radius 25, usual weights | polarization 0.83 at step 0, 0.965 at step 50, 0.980 at step 100 |
| Small groups merge, then stop | radius 25, usual weights | 10 groups at step 0, 13 at step 40, 8 from step 210 to step 800 |
| Without alignment the flock comes apart | radius 25, alignment 0 | 14 groups, 4 of them lone birds, at step 800 |
Polarization and groups every 10 steps (CSV) · what the file holds and its license
The player’s CSV holds the starting position and velocity of all 100 birds and the full settings. Any program that follows the steps described with it can rerun this flock.
Now break it
Turn alignment off. Separation and cohesion still work, but no bird turns to match its neighbors.
In the player, drag the alignment slider to 0 to see it happen. Then try the switch next to the sliders, which gives each bird its 7 nearest neighbors instead of all birds within 25 units, the kind of rule Ballerini and colleagues measured in starlings. This page reports no numbers for that switch, because this simplified player is not the model they tested.
Try this next: Conway’s Game of Life — another grid of simple local rules, where five cells walk across the board and a 36-cell machine keeps sending them out.
Sources
- M. Ballerini, N. Cabibbo, R. Candelier, A. Cavagna, E. Cisbani, I. Giardina, V. Lecomte, A. Orlandi, G. Parisi, A. Procaccini, M. Viale and V. Zdravkovic, “Interaction ruling animal collective behavior depends on topological rather than metric distance: Evidence from a field study,” Proceedings of the National Academy of Sciences 105, no. 4 (2008): 1232–1237. https://pmc.ncbi.nlm.nih.gov/articles/PMC2234121/Read: full text of the PNAS version (Results, Discussion, Materials and Methods, figure legends 1 to 4); the arXiv preprint abstract compared
- Craig W. Reynolds, “Flocks, Herds, and Schools: A Distributed Behavioral Model,” Computer Graphics 21, no. 4 (SIGGRAPH ’87 Conference Proceedings, July 1987): 25–34. https://www.red3d.com/cwr/papers/1987/boids.htmlRead: sections on simulated flocks, the neighborhood and flock behavior, in the author’s online reprint (no figures)
- Craig Reynolds, “Boids: Background and Update,” red3d.com. https://www.red3d.com/cwr/boids/Read: full page
Cite this page
Explorable Illusions. (2026). Murmuration: Starlings Track a Count, Not a Distance. Explorable Illusions. Published 2026-11-13. https://explorableillusions.com/simulations/starling-murmuration/
Add the date you read it. Figures and CSV files on this page are CC BY 4.0 unless their credit line says otherwise.
How pages here are checked Corrections log Report an error: contact@explorableillusions.com
More in Explorable Simulations
- Explorable Simulations
Conway’s Game of Life: A Glider Gun Fires Every 30 Steps
Conway’s Game of Life in four rules: step a five-cell glider across the grid, then watch the Gosper glider gun add one glider every 30 generations.
Picture credit
"Gosper glider gun at generation 90" by Explorable Illusions — https://explorableillusions.com/simulations/game-of-life/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
Explorable SimulationsDouble Pendulum: In a Model, 120° Runs 0.001° Apart Diverge
In this page’s double pendulum model, two swings released 0.001° apart from 120° are over 10° apart after 9.4 s. From 5°, they stay in step for a full minute.
Picture credit (illustration)
Illustration: Explorable Illusions. Generated schematic image — not a photograph, historical record, or test stimulus. Reuse: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), to the extent any rights exist.
Explorable SimulationsBraess Paradox: A New Road Can Make Every Trip Longer
Open a zero-minute shortcut and each of 4,000 drivers in this model network arrives 15 minutes later. See why no one goes back, and Braess's own 83 and 92.
Picture credit (illustration)
Illustration: Explorable Illusions. Generated schematic image — not a photograph, historical record, or test stimulus. Reuse: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), to the extent any rights exist.