Flocking
View on Wikipedia

Flocking is the behavior exhibited when a group of birds, called a flock, are foraging or in flight. Sheep and goats also exhibit flocking behavior. Flocking by birds and mammals is similar to schooling in fish and these are often studied together.
Flocking is generally believed to arise from the need for cover and protection from predators in animal behavior.[1] This is an emergent behaviour governed by local rules that are followed by individuals and does not involve any central coordination.
In nature
[edit]There are parallels with the shoaling behaviour of fish, the swarming behaviour of insects, and herd behaviour of land animals. During the winter months, starlings are known for aggregating into huge flocks of hundreds to thousands of individuals, murmurations, which when they take flight altogether, render large displays of intriguing swirling patterns in the skies above observers.
Measurement
[edit]Measurements of bird flocking have been made[2] using high-speed cameras, and a computer analysis has been made to test the simple rules of flocking mentioned below. It is found that they generally hold true in the case of bird flocking, but the long range attraction rule (cohesion) applies to the nearest 5–10 neighbors of the flocking bird and is independent of the distance of these neighbors from the bird. In addition, there is an anisotropy with regard to this cohesive tendency, with more cohesion being exhibited towards neighbors to the sides of the bird, rather than in front or behind. This is likely due to the field of vision of the flying bird being directed to the sides rather than directly forward or backward.
Another recent study is based on an analysis of high speed camera footage of flocks above Rome, and uses a computer model assuming minimal behavioural rules.[3][4][5][6]
Algorithms
[edit]Various algorithms have been introduced to aid in the study of biological flocking. These algorithms have different origins, from computer graphics to physics, each offering a unique perspective on the real phenomena.
Computer simulations and mathematical models that have been developed to emulate the flocking behaviours of birds can also generally be applied to the "flocking" behaviour of other species. As a result, the term "flocking" is sometimes applied, in computer science, to species other than birds, to mean collective motion by a group of self-propelled entities, a collective animal behaviour exhibited by many living beings such as fish, bacteria, and insects.[7]
Reynolds' Models
[edit]Flocking behaviour was simulated on a computer in 1987 by Craig Reynolds with the program Boids.[8] This program simulates simple agents (boids) that move according to a set of three basic rules: separation, alignment and cohesion. The result, akin to a flock of birds, a school of fish, or a swarm of insects, was developed for motion picture visual effects.
Rules
[edit]
Reynolds' models of flocking behaviour are controlled by three simple rules:
- Separation
- Avoid crowding neighbours (short range repulsion)
- Alignment
- Steer towards average heading of neighbours
- Cohesion
- Steer towards average position of neighbours (long range attraction)
With these three simple rules, the flock moves in an extremely realistic way, creating complex motion and interaction that would be extremely hard to create otherwise.
Rule variants
[edit]The basic model has been extended in several different ways since Reynolds proposed it. For instance, Delgado-Mata et al.[9] extended the basic model to incorporate the effects of fear. Olfaction was used to transmit emotion between animals, through pheromones modelled as particles in a free expansion gas.
Hartman and Benes[10] introduced a complementary force to the alignment that they call the change of leadership. This steer defines the chance of the bird to become a leader and try to escape.
Vicsek Models
[edit]An early model from the domain of physics, the Vicsek model [11] gained attention in the study of flocking as a form active matter, a system where energy is continually added (unlike thermodynamic models).
Applied to collective motion and swarming, Vicsek models demonstrate that a simpler set of rules with just fixed speed, self-propelled particles, and neighbor alignment, are able to achieve sub-group flocking and milling (vortex structures). These models are attractive in physics due to their simplicity and universality.
Such models however, do not exhibit speed changes due to climbing and diving in flight, or complex phenomena such as orientation waves due to perceptual vision.
Aerodynamic Models
[edit]Hemelrijk and Hildenbrandt[12] used attraction, alignment, and avoidance, and extended this with a number of traits of real starlings:
- birds fly according to fixed wing aerodynamics, while rolling when turning (thus losing lift);
- they coordinate with a limited number of interaction neighbours of 7 (like real starlings);
- they try to stay above a sleeping site (like starlings do at dawn), and when they happen to move outwards from the sleeping site, they return to it by turning; and
- they move at relative fixed speed.
The authors showed that the specifics of flying behaviour as well as large flock size and low number of interaction partners were essential to the creation of the variable shape of flocks of starlings.
Orientation Models
[edit]Hoetzlein[13] introduced the orientation-model in 2024 which separates the perceptual aspects of bird flight from the underlying aerodynamic model, linking these two control systems only by a heading target similar to real flight control. The perceptual model of each bird is orientation-based, mapped to a sphere, which more closely matches the biological vision system. The output of perception is a target heading angle (not a vector), which is used to control an aerodynamic model much like a flight simulator. Energy and frequency analysis in this work bridge the study of real bird kinetics with simulation models. This model demonstrates emergent, spontaneous orientation waves for the first time, a key feature in flocking murmurations.
Complexity
[edit]In flocking simulations, there is no central control; each bird behaves autonomously. In other words, each bird has to decide for itself which flocks to consider as its environment.
A basic implementation of a flocking algorithm has complexity – each bird could potentially interact and respond to every other bird. To limit complexity, it is assumed that birds only interact with a limited number of neighbors spatially in 2D or 3D. This was proven empirically in 2008 by Ballerini et al.,[14] where it was shown that Starlings typically interact with at most seven topological neighbors.
Improvements:
- Spatial Subdivision.[15] The entire area/volume of the flock is divided uniformly. Each bin stores which birds it contains. Each time a bird moves from one bin to another, bin contents are updated.
- Complexity: , k is number of surrounding bins to consider.
Lee Spector, Jon Klein, Chris Perry and Mark Feinstein studied the emergence of collective behaviour in evolutionary computation systems.[16]
Bernard Chazelle proved that under the assumption that each bird adjusts its velocity and position to the other birds within a fixed radius, the time it takes to converge to a steady state is an iterated exponential of height logarithmic in the number of birds. This means that if the number of birds is large enough, the convergence time will be so great that it might as well be infinite.[17] This result applies only to convergence to a steady state. For example, arrows fired into the air at the edge of a flock will cause the whole flock to react more rapidly than can be explained by interactions with neighbors, which are slowed down by the time delay in the bird's central nervous systems—bird-to-bird-to-bird.
Applications
[edit]In Cologne, Germany, two biologists from the University of Leeds demonstrated a flock-like behaviour in humans. The group of people exhibited a very similar behavioural pattern to that of a flock, where if 5% of the flock would change direction the others would follow suit. When one person was designated as a predator and everyone else was to avoid him, the flock behaved very much like a school of fish.[18]
Flocking has also been considered as a means of controlling the behaviour of Unmanned Air Vehicles (UAVs).[19]
Flocking is a common technology in screensavers, and has found its use in animation. Flocking has been used in many films[20] to generate crowds which move more realistically. Tim Burton's Batman Returns (1992) featured flocking bats.[improper synthesis?]
Flocking behaviour has been used for other interesting applications. It has been applied to automatically program Internet multi-channel radio stations.[21] It has also been used for visualizing information[22] and for optimization tasks.[23]
See also
[edit]References
[edit]- ^ Hamilton, W.D. (1971). "Geometry of the Selfish Herd". Journal of Theoretical Biology. 31 (2): 295–311. Bibcode:1971JThBi..31..295H. doi:10.1016/0022-5193(71)90189-5. PMID 5104951.
- ^ Feder, Toni (October 2007). "Statistical physics is for the birds". Physics Today. 60 (10): 28–30. Bibcode:2007PhT....60j..28F. doi:10.1063/1.2800090.
- ^ Hildenbrandt, H; Carere, C; Hemelrijk, CK (2010). "Self-organized aerial displays of thousands of starlings: a model". Behavioral Ecology. 21 (6): 1349–1359. arXiv:0908.2677. doi:10.1093/beheco/arq149.
- ^ Hemelrijk, CK; Hildenbrandt, H (2011). "Some causes of the variable shape of flocks of birds". PLOS ONE. 6 (8) e22479. Bibcode:2011PLoSO...622479H. doi:10.1371/journal.pone.0022479. PMC 3150374. PMID 21829627.
- ^ Project Starflag
- ^ Swarm behaviour model by University of Groningen
- ^ O'Loan, OJ; Evans, MR (1999). "Alternating steady state in one-dimensional flocking". Journal of Physics A: Mathematical and General. 32 (8). IOP Publishing: L99. arXiv:cond-mat/9811336. Bibcode:1999JPhA...32L..99O. doi:10.1088/0305-4470/32/8/002. S2CID 7642063.
- ^ Reynolds, Craig W. (1987). "Flocks, herds and schools: A distributed behavioural model.". ACM SIGGRAPH Computer Graphics. Vol. 21. pp. 25–34.
- ^ Delgado-Mata C, Ibanez J, Bee S, et al. (2007). "On the use of Virtual Animals with Artificial Fear in Virtual Environments". New Generation Computing. 25 (2): 145–169. doi:10.1007/s00354-007-0009-5. S2CID 26078361.
- ^ Hartman C, Benes B (2006). "Autonomous boids". Computer Animation and Virtual Worlds. 17 (3–4): 199–206. doi:10.1002/cav.123. S2CID 15720643.
- ^ Vicsek, T.; Czirok, A.; Ben-Jacob, E.; Cohen, Inon; Shochet, O (1995), "Novel Type of Phase Transition in a System of Self-Driven Particles", Physical Review Letters, 75 (6): 1226–1229, arXiv:cond-mat/0611743, Bibcode:1995PhRvL..75.1226V, doi:10.1103/PhysRevLett.75.1226
- ^ Hemelrijk, C. K.; Hildenbrandt, H. (2011). "Some Causes of the Variable Shape of Flocks of Birds". PLOS ONE. 6 (8) e22479. Bibcode:2011PLoSO...622479H. doi:10.1371/journal.pone.0022479. PMC 3150374. PMID 21829627.
- ^ Hoetzlein, R. C. (2024). "Flock2: A model for orientation-based social flocking". Journal of Theoretical Biology. 593 111880. arXiv:2404.17804. Bibcode:2024JTBio.59311880H. doi:10.1016/j.jtbi.2024.111880. PMID 38972569.
- ^ Ballerini M.; Cabibbo N.; Candelier R.; Cavagna A.; Cisbani E.; Giardina I.; Lecomte V.; Orlandi A.; Parisi G.; Procaccini A.; Viale M.; Zdravkovic V. (2008), Interaction ruling animal collective behavior depends on topological rather than metric distance: Evidence from a field study, vol. 105, Proc. Natl. Acad. Sci., pp. 1232–1237
- ^ Hoetzlein, R. (2014), Fast Fixed-Radius Nearest Neighbors: Interactive Million-Particles Fluids, GPU Technology Conference
- ^ Spector, L.; Klein, J.; Perry, C.; Feinstein, M. (2003). "Emergence of Collective Behavior in Evolving Populations of Flying Agents". Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2003). Springer-Verlag. Retrieved 2007-05-01.
- ^ Bernard Chazelle, The Convergence of Bird Flocking, J. ACM 61 (2014)
- ^ "http://psychcentral.com/news/2008/02/15/herd-mentality-explained/1922.html Archived 2014-11-29 at the Wayback Machine". Retrieved on October 31st 2008.
- ^ Senanayake, M., Senthooran, I., Barca, J. C., Chung, H., Kamruzzaman, J., & Murshed, M. "Search and tracking algorithms for swarms of robots: A survey."
- ^ Gabbai, J. M. E. (2005). Complexity and the Aerospace Industry: Understanding Emergence by Relating Structure to Performance using Multi-Agent Systems (Thesis). Manchester: University of Manchester Doctoral Thesis. Archived from the original on 2014-12-19. Retrieved 2007-02-21.
- ^ Ibanez J, Gomez-Skarmeta AF, Blat J (2003). "DJ-boids: emergent collective behaviour as multichannel radio station programming". Proceedings of the 8th international conference on Intelligent User Interfaces. pp. 248–250. doi:10.1145/604045.604089.
- ^ Moere A V (2004). "Time-Varying Data Visualization Using Information Flocking Boids" (PDF). Proceedings of the IEEE Symposium on Information Visualization. pp. 97–104. doi:10.1109/INFVIS.2004.65. Archived (PDF) from the original on 2022-10-09.
- ^ Cui Z, Shi Z (2009). "Boid particle swarm optimisation". International Journal of Innovative Computing and Applications. 2 (2) 31778: 77–85. doi:10.1504/IJICA.2009.031778.
Sources
[edit]- Bouffanais, Roland (2016). Design and Control of Swarm Dynamics. SpringerBriefs in Complexity. Springer Singapore. doi:10.1007/978-981-287-751-2. ISBN 978-981-287-750-5.
- Cucker, Felipe; Steve Smale (2007). "The Mathematics of Emergence" (PDF). Japanese Journal of Mathematics. 2: 197–227. doi:10.1007/s11537-007-0647-x. S2CID 2637067. Retrieved 2008-06-09.
- Shen, Jackie (Jianhong) (2008). "Cucker–Smale Flocking under Hierarchical Leadership". SIAM J. Appl. Math. 68 (3): 694–719. arXiv:q-bio/0610048. doi:10.1137/060673254. S2CID 14655317. Retrieved 2008-06-09.
- Fine, B.T.; D.A. Shell (2013). "Unifying microscopic flocking motion models for virtual, robotic, and biological flock members". Auton. Robots. 35 (2–3): 195–219. doi:10.1007/s10514-013-9338-z. S2CID 14091388.
- Vásárhelyi, G.; C. Virágh; G. Somorjai; T. Nepusz; A.E. Eiben; T. Vicsek (2018). "Optimized flocking of autonomous drones in confined environments". Science Robotics. 3 (20) eaat3536 (published 18 July 2018). doi:10.1126/scirobotics.aat3536. hdl:1871.1/87dd0889-cb66-4699-a27b-fc34f75e9b6d. PMID 33141727.
External links
[edit]Flocking
View on GrokipediaFlocking in Nature
Definition and Characteristics
Flocking refers to the emergent collective motion observed in large groups of animals, particularly birds, where individuals coordinate their movements through decentralized, local interactions without the need for central control or leadership. This self-organized behavior arises from simple rules followed by each animal, leading to cohesive group dynamics that can involve thousands of individuals moving in unison. Unlike hierarchical systems, decisions in flocking are distributed, with each participant responding primarily to its immediate neighbors, resulting in global patterns such as synchronized direction changes that occur in fractions of a second.[6][7] The core characteristics of flocking include three fundamental interaction rules: cohesion, separation, and alignment. Cohesion drives individuals to remain proximate to their neighbors, fostering group unity through attractive social forces like gregariousness. Separation ensures collision avoidance by maintaining minimal distances, counteracted by repulsive forces such as intolerance to overcrowding. Alignment involves matching the velocity and direction of nearby individuals, promoting parallel movement and rapid propagation of directional changes across the group; this often operates on a topological basis, where each animal interacts with a fixed number of nearest neighbors regardless of density. These rules balance to produce stable, ordered formations without explicit communication.[8][7] Flocking is distinct from related collective behaviors such as schooling in fish, which features denser, more rigidly parallel aquatic formations; milling in insects, characterized by rotational or vortex-like patterns; and herding in mammals, which frequently incorporates leadership hierarchies or external guidance. In contrast, flocking emphasizes flexible, aerial coordination driven purely by peer interactions. Evolutionarily, flocking confers advantages including enhanced predator avoidance via the confusion effect and collective vigilance, improved foraging efficiency through shared detection of resources, and energy conservation during prolonged movement by exploiting aerodynamic drafting, where trailing individuals benefit from reduced air resistance created by those ahead (saving up to 20–30% energy in V-formations).[9] Flocking in general has been shown to increase annual adult survival rates across bird species.[10][6]Biological Examples
Flocking behaviors are prominently observed in avian species, particularly in the murmurations of European starlings (Sturnus vulgaris), where thousands to millions of birds synchronize their movements into fluid, wave-like formations during evening roosting. These displays, which can span hundreds of meters, serve primarily as anti-predator defenses by confusing aerial predators like falcons through rapid, unpredictable shifts in group shape. In such flocks, individual starlings maintain topological interactions with about seven nearest neighbors, enabling scale-free correlations where velocity changes propagate across the entire group, independent of flock size, thus enhancing collective responsiveness to threats. Vortex-like patterns occasionally emerge in these formations, contributing to the dynamic, swirling structures that amplify evasion tactics in open skies. Fish schooling exemplifies flocking in aquatic environments, with species like sardines (Sardina pilchardus) and herring (Clupea harengus) forming dense, polarized groups that range from dozens to millions of individuals during migrations and foraging. These schools, often spanning kilometers, reduce predation risk through mechanisms such as the confusion effect, where predators struggle to single out targets amid the coordinated motion. Early theoretical work by Hamilton in 1971 proposed that such geometries minimize an individual's peripheral exposure in a group, positioning central members safer from attack, a principle that aligns with observed polarizations in herring schools navigating oceanic currents for food access and predator avoidance. Insect swarms demonstrate flocking in terrestrial and aerial contexts, as seen in desert locusts (Schistocerca gregaria), which transition from solitary to gregarious phases under high population densities, forming migratory bands of millions that devastate vegetation across continents. This phase polyphenism, triggered by physical contacts and serotonin surges, enables synchronized marching and flight, optimizing resource exploitation in arid ecosystems while evading localized threats. Similarly, non-migratory swarms of midges (Chironomus riparius) in laboratory and wild settings aggregate into hovering clouds of hundreds to thousands, exhibiting metric interactions that stabilize the group against wind perturbations and support mating in humid, vegetated habitats. Mammalian flocking occurs in terrestrial herds, such as the annual migration of wildebeest (Connochaetes taurinus) in the Serengeti ecosystem, where herds of up to 1.5 million individuals traverse savannas in cohesive waves synchronized by local alignments and environmental cues like rainfall-driven grass growth. This collective navigation facilitates access to seasonal pastures while diluting predation risks from lions and crocodiles during river crossings. Domestic sheep (Ovis aries) also display innate flocking, with groups of dozens to hundreds bunching centrally under threat from dogs or predators, consistent with selfish herd dynamics that prioritize individual safety by shifting peripheral positions to others. Across taxa, flocking scales from small clusters of dozens, aiding local foraging, to vast assemblies of millions, amplifying survival in predator-rich or resource-scarce landscapes.Measurement and Observation
The study of natural flocking behaviors relies on empirical techniques to capture the precise movements of individuals within groups. High-speed videography, employing synchronized cameras, enables the recording of rapid aerial maneuvers in birds.[7] Stereo vision systems, utilizing multiple calibrated cameras, facilitate three-dimensional reconstruction of trajectories by triangulating positions from overlapping views, allowing researchers to track up to thousands of birds simultaneously in dense formations.[7][11] For larger-scale or migratory flocks, GPS tracking devices attached to individual birds provide longitudinal data on positions, speeds, and directions at high temporal resolution, revealing leadership hierarchies and collective decision-making. Key metrics quantify the degree of coordination and structure in flocks. The polarization vector, defined as the magnitude of the average velocity direction across individuals, serves as an order parameter to measure alignment, with values approaching 1 indicating strong collective motion.[7] Nearest-neighbor distances assess local density and interaction ranges, typically averaging 1-2 meters in starling flocks and revealing topological rather than metric interactions where birds respond to a fixed number of neighbors regardless of distance.[12] Turning rates, expressed in radians per second, capture maneuver dynamics, often exceeding 0.3 radians per second during evasion, while correlation lengths estimate the spatial extent of synchronized velocity fluctuations, scaling linearly with flock size in natural swarms.[13] Observing dense flocks presents significant challenges, particularly handling occlusions where birds overlap in camera views, complicating individual identification and trajectory continuity.[14] Scaling observations from controlled lab environments to unpredictable field conditions further complicates data collection, as environmental factors like lighting and weather introduce noise and limit tracking accuracy.[14] Post-2010 advances have enhanced these methods. Drone-based platforms enable non-invasive aerial monitoring of flock sizes and behaviors, minimizing disturbance while providing overhead perspectives for species like waterbirds, with approaches as close as 4 meters yielding high-resolution footage.[15][16] Machine learning techniques, such as deep neural networks, have improved trajectory analysis by inferring hidden interactions from noisy video data, as demonstrated in studies of starling murmurations where models reconstruct positions and predict collective responses.[17] These tools have been applied to empirical data from starling flocks, offering insights into anti-predator dynamics without relying on simulations.Computational Models of Flocking
Reynolds' Boids Model
The Boids model was developed by computer graphics researcher Craig Reynolds in 1986 as a method for simulating the flocking behavior of birds in animated films, drawing inspiration from observations of natural group motion in birds, fish, and land animals.[18] An initial implementation was completed in just 10 days using Symbolics Common Lisp on a Lisp Machine, with the work formalized in Reynolds' seminal 1987 SIGGRAPH paper.[18] At its core, the Boids model simulates flocking through a collection of autonomous agents called "boids," each representing a simplified bird-like entity in a two- or three-dimensional environment.[18] These agents move according to simple local rules that govern their steering behavior, relying on limited perception of nearby boids rather than global coordination.[18] The emergent flocking patterns—such as cohesive groups turning in unison—arise from the interactions of these rules applied simultaneously to all boids, without any central control or pre-scripted paths.[18] Each boid maintains a position, velocity, and orientation, updating its trajectory based on acceleration vectors derived from the rules.[18] The model employs three primary steering rules, each producing an acceleration request in the form of a unit vector scaled by a strength factor between 0 and 1.[18] Separation directs a boid to steer away from the positions of nearby flockmates to prevent collisions and crowding; this is computed as the vector sum (or average direction) pointing away from each neighbor within the perception zone, with stronger repulsion for closer boids.[18] Alignment steers a boid toward the average heading of its neighbors, promoting synchronized movement; this involves averaging the velocity vectors of all perceived boids to derive a target direction.[18] Cohesion guides a boid toward the average position (centroid) of its neighbors, encouraging the group to stay together; the steering vector points from the boid's current position to this computed center of mass.[18] Implementation of the Boids model centers on efficient neighbor detection and rule arbitration for each boid at every time step.[18] Neighbors are identified within a spherical perception zone around the boid, defined by a radius parameter and an exponent for distance sensitivity (e.g., inverse square falloff, inspired by studies of fish schooling), ensuring locality without requiring knowledge of distant agents.[18] For rule computation, the steering vectors are combined through weighted averaging—where each rule's vector is multiplied by a tunable weight reflecting its priority—or via strict priority ordering to resolve conflicts.[18] The resulting acceleration is limited by the boid's maximum speed and applied to update velocity, with optional damping to simulate inertia.[18] A simplified pseudocode outline for a single boid's update cycle illustrates the process:for each boid in flock:
neighbors = find_boids_within_radius(boid.position, radius)
if neighbors.empty():
continue # No steering if isolated
# Separation: average vector away from neighbors
separation = zero_vector
for each neighbor in neighbors:
diff = boid.position - neighbor.position
if length(diff) > 0:
separation += normalize(diff) / length(diff) # Inverse distance weighting
separation = normalize(separation)
# Alignment: average velocity of neighbors
alignment = average([n.velocity for n in neighbors])
alignment = normalize(alignment)
# Cohesion: steer toward average position
center = average([n.position for n in neighbors])
cohesion = normalize(center - boid.position)
# Combine rules with weights
steering = (weight_sep * separation + weight_align * alignment + weight_coh * cohesion)
steering = normalize(steering) * max_acceleration
# Update
boid.velocity += steering
boid.velocity = limit(boid.velocity, max_speed)
boid.position += boid.velocity * delta_time
This structure achieves real-time simulation for modest flock sizes, though early implementations ran at O(N²) time complexity, processing about 80 boids in 95 seconds per frame on 1980s hardware.[18] Parameter tuning, such as adjusting rule weights (e.g., higher separation for dense flocks) and perception radius, allows animators to customize behaviors for desired visual effects.[18]