Preprint
Article

This version is not peer-reviewed.

GPU-Accelerated Simulation and Automated Critical-Point Detection for Leader–Follower Swarms: Informed-Agent Thresholds and Communication Topology Calibrated to Starling Flocks

Submitted:

10 November 2026

Posted:

11 November 2026

You are already at the latest version

Abstract
Swarms of drones and other mobile agents often rely on a few informed members to keep the group aligned, yet how many are needed, and how the communication rule affects the result, is rarely quantified under realistic conditions. We addressed this with a Vicsek model of 3000 agents in which informed agents (heading noise 0.10) are mixed with uninformed agents (noise 0.50), with density, perception range and speed calibrated to field data from starling flocks. Simulations ran on graphics processing units using a memory-optimized periodic cell list and an exact k-nearest-neighbour search, both checked against brute force at start-up. Critical points were located by an adaptive Binder-cumulant bisection that needed 7–8 runs instead of the 25–41 of a uniform grid. About 10% informed agents ordered the swarm, and finite-size scaling over 1000–8000 agents placed the threshold for large swarms near 11%. With range-based communication the starling parameters lay at the order–disorder transition. Communication with the seven nearest neighbours made order 2.6 times less sensitive to density, and density independent when speed was scaled with neighbour spacing, but required about nine neighbours. These results give design rules for leader–follower swarms: minimizing informed agents and communication links, and scaling speed for robustness.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

Swarms of drones, ground robots and other mobile agents must stay aligned while each member senses only its neighbours and acts with error. Two design questions follow directly: how many informed agents a swarm needs to remain ordered, and whether agents should communicate with everyone within a fixed range or with a fixed number of nearest neighbours. Both are usually answered by trial and error in simulation, because the answers depend on swarm size, density and speed, and because the boundary between ordered and disordered motion is a phase transition whose location is costly to find. Natural flocks offer a tested reference design: starlings keep cohesive formations of thousands of birds at high speed. This study uses starling field data to calibrate a minimal swarm model and develops the simulation and analysis tools needed to answer the two design questions quantitatively.
Collective motion emerges when local alignment rules overcome individual noise. The Vicsek model captures this with one rule: each particle moves at constant speed and adopts the mean heading of its neighbours, plus noise [1]. Lowering the noise or raising the density drives the system from a disordered gas to a polarized flock. Later work showed that this transition is discontinuous in large systems [2,3].
Starling flocks are the best-measured natural case. Three-dimensional reconstructions of flocks with 122 to 4268 birds gave nearest-neighbour distances of 0.68–1.51 m, speeds of about 8–19 m/s and polarizations of 0.84–0.99 [4,5]. Each bird interacts with about 6–7 nearest neighbours, regardless of their distance [6]. Velocity fluctuations are correlated over distances that grow with flock size [7]. Together these findings suggest that flocks sit close to a critical point.
Two lines of earlier work provide the methods we build on. The first located the Vicsek transition and its nature with the Binder cumulant: its dip to negative values as system size grows showed that the transition is discontinuous [2], a result confirmed in larger systems [3]. Finite-size scaling of the order parameter and its fluctuations has also been used to estimate the critical noise and exponents [8]. These analyses scan the control parameter on a grid, which is costly near the transition, where runs must be long and samples many. The second line fixed model parameters from field data: the interaction of starlings was shown to be topological [6], and maximum-entropy inference recovered the pairwise interactions between birds from measured velocity correlations [9]. We join the two. We take the Binder-cumulant criterion from the first line, automate it with bisection and adaptive sampling, and apply it to a model whose parameters come from the second.
Real flocks are also heterogeneous, and several studies have added heterogeneity to the Vicsek model. Informed individuals with a preferred direction can steer a group, and larger groups need a smaller informed fraction [10]; a single informed drone can lead a swarm when the influence of its neighbours is weighted hierarchically [11]. Noise heterogeneity has been studied in three forms: spatial, where only part of the domain is noisy [12]; between sub-populations, where a sufficiently low-noise sub-population dominates the dynamics of the whole group [13]; and between two species that differ in motility and noise in a reciprocal model [14]. Neighbour-selection rules have also been varied [15]. What remains open is a quantitative map of how a low-noise minority shifts the order–disorder transition: located with finite-size scaling, under parameters that match real birds, and with metric and topological interaction compared on equal terms.
This study fills that gap with GPU simulations of a heterogeneous-noise Vicsek model calibrated to starling data, framed throughout as a design problem for leader–follower swarms. Its contributions are:
1.
Leadership threshold: the fraction of experienced birds needed to order a flock of naive birds, about 10%.
2.
Criticality test: density, perception range, flight speed and neighbour number swept around starling values, which all fall in the critical region.
3.
Metric versus topological interaction: a quantified trade-off between order and robustness to density.
4.
Scale-free correlations: correlation length growing linearly with system size.
5.
Software: a validated GPU implementation with O ( N ) memory and an exact topological neighbour search, and an adaptive Binder-cumulant bisection algorithm that finds critical swarm parameters three to five times faster than a grid scan, released as open code.

2. Materials and Methods

2.1. Model

N birds move in a periodic square box of side L = N / ρ . At each step, bird i adopts the mean heading of its neighbourhood N i (itself included) plus its own noise:
θ i ( t + 1 ) = arg ∑ j ∈ N i ( t ) e i θ j ( t ) + η i ξ i ( t ) , ξ i ∼ U ( − π , π ) ,
r i ( t + 1 ) = r i ( t ) + v 0 Δ t ( cos θ i , sin θ i ) .
In the metric model N i holds all birds within radius r 0 ; in the topological model it holds the k nearest birds [16]. Our noise amplitude η maps to the standard Vicsek convention as η std = 2 π η . A fraction f = N 1 / N of birds is experienced ( η 1 ); the rest are naive ( η 2 ).

2.2. Interaction Radius, Speed and Noise

The model has three dimensionless control groups, and each has a direct biological reading.
  • Interaction radius r 0 is the perception range: the distance within which a bird sees and follows others. Together with density it sets the mean neighbour number k = π r 0 2 ρ . Small k leaves birds isolated, so local alignment cannot spread; large k links the flock into one network.
  • Speed v 0 Δ t / r 0 is the distance flown per update in units of the perception range. It sets how fast neighbourhoods renew. As v 0 → 0 the model becomes a static XY-like system; larger v 0 mixes birds and carries heading information across the flock.
  • Noise η is the error in perceiving and executing a heading: sensory limits, motor imprecision and decision uncertainty. The heading error is uniform on ± π η , so η = 1 randomizes the heading completely and η = 0 gives perfect alignment. Noise plays the role of temperature in a magnet: it competes with the aligning interaction. In our heterogeneous flock, experienced birds have small η 1 and naive birds large η 2 .
In an equilibrium two-dimensional system with continuous symmetry, fluctuations destroy true long-range order (the Mermin–Wagner theorem). Self-propulsion evades this restriction: moving birds carry information across the flock, which allows true long-range order in two dimensions [17,18]. The order–disorder transition of the Vicsek model is therefore genuine, and its location depends on k, v 0 Δ t / r 0 , η and the system size.

2.3. Calibration to Starling Data

Table 1 gives the calibration; r 0 is the length unit. The density is set so that a bird has about seven neighbours, matching the 6–7 topological neighbours of starlings. The speed follows from the mean flight speed and an assumed update time.

2.4. Order Parameter, Susceptibility and Binder Cumulant

The order parameter Ω measures how aligned the flock is: the length of the mean heading vector,
Ω ( t ) = | 1 N ∑ j = 1 N e i θ j ( t ) | .
Ω = 1 when all birds fly in one direction and Ω ≈ 1 / N when headings are random. In a finite flock Ω never reaches exactly zero, so the transition cannot be located from a threshold value of Ω .
The susceptibility measures how strongly Ω fluctuates:
χ = N 〈 Ω 2 〉 − 〈 Ω 〉 2 .
Deep in either phase Ω is stable and χ is small. At the transition the flock switches between ordered and disordered states, so χ peaks, and the peak grows with N.
The Binder cumulant compares the fourth moment of Ω with the square of its second moment [19]:
U 4 = 1 − 〈 Ω 4 〉 3 〈 Ω 2 〉 2 .
Its two limits follow from the shape of the distribution of Ω . In the ordered phase Ω is sharply peaked, so 〈 Ω 4 〉 ≈ 〈 Ω 2 〉 2 and U 4 → 2 / 3 . In the disordered phase the two components of the mean heading are Gaussian, so Ω 2 is exponentially distributed, 〈 Ω 4 〉 = 2 〈 Ω 2 〉 2 and U 4 → 1 / 3 . U 4 is nearly independent of N at a continuous critical point, so curves for different N cross there. A dip of U 4 below 1 / 3 near the transition signals a bimodal distribution of Ω , the coexistence of ordered and disordered states typical of a discontinuous transition [2].
Velocity-fluctuation correlations follow Cavagna et al. [7]. With δ u i = u i − 〈 u 〉 normalized to unit variance, C ( r ) is the mean of δ u i · δ u j over pairs at distance r. The correlation length ξ is the first zero crossing of C ( r ) ; ξ ∝ L indicates scale-free correlations.

2.5. GPU Implementation and Validation

The code runs on CuPy (CUDA) with an identical NumPy path for CPUs. Metric neighbours are found with a periodic cell list, so memory scales as O ( N ) instead of the O ( N 2 ) of a full distance matrix. Topological neighbours are found exactly with an expanding cell stencil: a bird’s k nearest neighbours are accepted only when the k-th lies within the radius the stencil is guaranteed to cover; otherwise the stencil grows, with an all-pairs fallback. At every start-up both searches are compared with brute force on a test configuration that includes a dense cluster; a mismatch stops the run.

2.6. Simulation Design

Table 2 lists every simulation experiment. Unless stated otherwise, all runs use N = 3000 , ρ = 2.2 , r 0 = 1 , v 0 Δ t / r 0 = 0.4 , η 1 = 0.10 , η 2 = 0.50 , f = 0.10 and metric interaction.
Two run profiles share this design. Test runs use 3000 steps, the last 1500 as the steady state and 3 seeds; production runs use 10,000 steps, the last 5000 and 5 seeds. E8 stores a snapshot every 100 steps of the steady state. Error bars are standard errors across seeds, and fixed seeds make every result exactly reproducible.

2.7. Algorithm 1: Binder-Cumulant Bisection

The procedure combines three standard tools: the Binder cumulant [19,20], bisection root finding [21] and a block bootstrap error estimate [22,23]. We define the critical point p c of a control parameter p as the value where U 4 crosses U * = 1 / 2 , the midpoint of its ordered and disordered limits. Because U 4 is monotonic in p across the transition, p c is found by bisection (Algorithm 1).
Algorithm 1:Binder-cumulant bisection with adaptive sampling.
Input: 
bracket [ p lo , p hi ] , tolerance δ , seeds S, seed cap S max , target U * = 1 / 2
Output: 
critical point p c and its uncertainty
1:
Evaluate U 4 ( p lo ) and U 4 ( p hi ) ; they must lie on opposite sides of U *
2:
while p hi − p lo > δ do
3:
     p m ← ( p lo + p hi ) / 2 ; evaluate U 4 ( p m ) with S seeds
4:
    while  | U 4 ( p m ) − U * | < 2 σ U and seeds < S max do▹ σ U : block bootstrap error
5:
        add one seed and update U 4 ( p m ) , σ U
6:
    end while
7:
    keep the half-interval whose ends straddle U *
8:
end while 
9:
p c ← linear interpolation of U 4 between the final ends; uncertainty ≤ final bracket width
The cost is 2 + ⌈ log 2 ( ( p hi − p lo ) / δ ) ⌉ evaluations, against ( p hi − p lo ) / δ + 1 for a uniform grid of the same resolution. For the noise ( [ 0.30 , 0.70 ] , δ = 0.01 ) this is 8 runs instead of 41, and for the neighbour number ( k = 1 –25) 7 runs instead of 25, a three- to five-fold saving that grows logarithmically with the required precision. Adaptive sampling adds seeds only where the decision is uncertain, so simulation time is spent near the transition. The method gives a finite-size estimate p c ( N ) ; the limit N → ∞ requires Binder crossings across sizes.

3. Results

In every sweep, the starling reference value falls inside the transition region of the model. Table 3 summarizes where each transition lies. All values come from GPU runs with 3000 steps and 3 seeds unless stated otherwise.

3.1. Noise Baseline

A homogeneous flock orders below η c ≈ 0.48 ( η std ≈ 3.0 ) (Figure 1). χ peaks at η = 0.50 and U 4 falls from 0.64 to 0.31 between η = 0.45 and 0.55. Binder bisection gives η c = 0.476 ± 0.006 ( η std = 2.99 ) in 8 evaluations and 11 min on the GPU, consistent with a shorter CPU run ( 0.480 ± 0.013 ). At η 1 = 0.10 the flock reaches Ω = 0.967 , matching the mean polarization of real starlings. At η = 0.55 , U 4 = 0.306 dips below the disordered limit of 1 / 3 , a possible sign of a discontinuous transition that production runs must confirm.

3.2. Experienced-Leader Threshold

About 10% experienced birds are enough to order a flock of naive birds (Figure 2). χ peaks at f = 0.10 , and U 4 reaches the ordered plateau ( ≥ 0.64 ) from f = 0.16 on. With no experienced birds ( f = 0 ), Ω = 0.16 and U 4 = 0.42 , between the disordered and ordered limits. Because the naive birds sit at η c , a small experienced minority tips the balance toward order. Above the transition Ω grows slowly and reaches only 0.67 at f = 0.50 , below the observed starling band.

3.3. Density, Perception Range and Speed

The starling value lies in the critical region of all three sweeps (Figure 3, Figure 4 and Figure 5), at f = 0.10 :
  • Density: order rises across ρ ≈ 1.5 – 3.5 ; χ reaches its maximum at ρ = 2.2 and 2.75 (27.6 and 27.7) and U 4 reaches the ordered plateau at ρ ≈ 3.5 .
  • Perception range: the sharpest transition of the series; χ peaks at r 0 = 1.10 and U 4 reaches the ordered plateau at r 0 ≈ 1.2 .
  • Flight speed: χ peaks exactly at the mean starling speed ( v 0 Δ t / r 0 = 0.40 , ≈11.8 m/s). Below v 0 Δ t / r 0 ≈ 0.25 , Ω stays on a plateau of 0.18–0.20 with large fluctuations; above 0.8 the flock is ordered.
Density and perception range act through one variable, the mean neighbour number k = π r 0 2 ρ . At k ≈ 10 the two sweeps agree ( Ω ≈ 0.45 from ρ = 3.0 – 3.5 and 0.451 at r 0 = 1.2 ), although v 0 / r 0 differs (0.40 versus 0.33). At lower k the perception-range sweep is somewhat more ordered ( Ω = 0.250 at k = 5.6 versus 0.217 at k = 5.5 ), consistent with its larger v 0 / r 0 (0.44–0.50) and with the speed sweep, in which faster flocks are more ordered.

3.4. Metric Versus Topological Interaction

Topological interaction makes the flock 2.6 times less sensitive to density but less ordered (Figure 6 and Figure 7). Over ρ = 0.5 –6, Ω changes by 0.566 in the metric model and by 0.217 in the topological model with k = 7 . In sparse flocks ( ρ = 0.5 ) topological birds stay more ordered ( Ω = 0.095 versus 0.037), because metric birds lose their neighbours. In the k sweep (2000 steps, 3 seeds), the topological transition lies at k ≈ 8 –12: χ peaks at k = 12 and U 4 reaches the ordered plateau (0.655) at k = 14 . At the starling value k = 7 the flock remains on the disordered side ( Ω = 0.157 , U 4 = 0.50 ), whereas the metric model with the same mean neighbour number reaches Ω = 0.27 . Binder bisection (Algorithm 1) places the critical neighbour number at k c = 9.1 ± 1.0 (bracket 9–10, 7 evaluations, 34 min on the GPU), about two neighbours above the starling value.
The residual density dependence of the topological model is a speed effect (Figure 7, control). With fixed v 0 , a bird’s step measured in neighbour spacings grows as v 0 ρ . When v 0 is scaled as v 0 = 0.4 2.2 / ρ , keeping v 0 ρ constant, the range of Ω over ρ = 0.5 –6 falls from 0.217 to 0.026 ( Ω = 0.133 – 0.159 ), the size of the seed-to-seed standard errors (up to 0.018), while the metric model still varies by 0.550. This is expected from scaling: the topological rule has no length scale of its own, so with v 0 ρ fixed a change of density is only a change of units. Density pairs in a ratio of 4 ( ρ = 0.75 and 3, 1 and 4, 1.5 and 6) even give bit-identical results, because a length rescaling by 2 is exact in floating point.

3.5. Finite-Size Scaling

The leader-ratio transition sharpens with flock size and its location drifts upward (Figure 8; N = 1000 , 2000, 4000 and 8000; 6000 steps, 5 seeds). Three observations support a genuine phase transition:
  • Disordered side: for a naive-only flock ( f = 0 ), Ω falls from 0.25 to 0.19, 0.13 and 0.09, and U 4 from 0.52 to 0.46, 0.40 and 0.35, approaching the disordered limit of 1 / 3 as N grows.
  • Susceptibility: χ max grows from 11.0 to 20.8, 28.4 and 39.3, with its position between f = 0.06 and 0.10. A power-law fit over four sizes gives χ max ∝ L 1.19 .
  • Binder crossings: raw U 4 values scatter by about ± 0.03 near the transition, so each curve was fitted with a logistic step, U 4 ( f ) = a + ( 2 / 3 − a ) / 1 + exp [ − ( f − f 0 ) / w ] , and the fitted curves were crossed. The width w falls from 0.063 to 0.056, 0.040 and 0.024 ( w ∝ L − 0.92 ), so the transition sharpens with size. The fitted curves cross at f = 0.100 ( N = 2000 / 4000 ) and f = 0.118 ( N = 4000 / 8000 ). Above f ≈ 0.18 all four curves merge on the ordered plateau.
The smallest flock ( N = 1000 ) lies outside the scaling regime: its U 4 never approaches 1 / 3 , and its fitted curve meets that of N = 2000 only near f ≈ 0.2 , on the ordered plateau where the curves are nearly flat. The two largest pairs give f c ≈ 0.11 ± 0.01 , and extrapolating the χ peaks linearly in 1 / L gives f c ( ∞ ) ≈ 0.107 , in agreement. The threshold for large swarms is therefore about 11%, slightly above the 10% found at N = 3000 . The exponent 1.19 lies below the value 2 expected for a discontinuous transition in two dimensions, so the order of this transition remains open at these sizes.

3.6. Scale-Free Velocity Correlations

The correlation length grows in proportion to system size in both regimes (Figure 9; N = 500 –4000; 3 seeds, 45 snapshots per size). In the starling-like regime (homogeneous η = 0.10 , Ω = 0.965 – 0.971 ), ξ / L = 0.28 , 0.26, 0.29 and 0.31 for N = 500 , 1000, 2000 and 4000; in the critical mixture ( Ω = 0.27 – 0.41 ) ξ / L = 0.28 , 0.29, 0.29 and 0.28. Linear fits give ξ ≈ 0.33 L − 1.0 and ξ ≈ 0.28 L + 0.0 , so in the critical mixture ξ is strictly proportional to L. The C ( r ) curves of all sizes and both regimes collapse onto one curve when plotted against r / L , crossing zero at r / L ≈ 0.28 . A flock as ordered as real starlings thus shows correlations without an intrinsic length scale, as reported in the field [7].

3.7. Reproducibility

The parameter point ρ = 2.2 , r 0 = 1 , v 0 Δ t / r 0 = 0.4 , f = 0.10 appears in four independent scripts (density, perception-range, speed and density-robustness sweeps), and all four give the same value on the GPU: Ω = 0.268127 , χ = 27.6287 . GPU and CPU runs agree within statistical error; for the perception-range sweep both place the χ peak at r 0 = 1.10 .

4. Discussion

Calibrating a minimal model to starling data places the flock at its critical point along four independent axes. This agrees with field evidence for scale-free correlations [7] and near-critical speed control [5]. It also offers a mechanism: a flock poised at criticality is maximally sensitive, so a small change in composition, density or speed produces a large collective response.
Leadership. The experienced fraction acts as an order-inducing field. Because naive birds alone sit at η c , about 10% of experienced birds suffice, in line with the finding that a small informed minority can lead a group [10]. Reaching the observed polarization of about 0.97, however, requires either a larger experienced fraction or lower naive noise; measuring individual noise levels in real flocks would test this prediction.
A trade-off in topological interaction. Topological interaction keeps a flock cohesive when density changes, as argued from field data [6]. Our results add its cost: at the same mean neighbour number it yields less order, because dense clusters cannot recruit extra neighbours. Its residual density dependence is consistent with a speed effect: at fixed v 0 , the step measured in neighbour spacings grows as v 0 ρ , which increases mixing. A control run confirms this: with v 0 ∝ ρ − 1 / 2 , so that v 0 ρ stays fixed, the topological flock becomes density independent.
Implications for swarm engineering. The Vicsek rule underlies consensus and flocking control of mobile agents [24,25], so the results translate into design guidelines for leader–follower swarms such as drone formations [11]. First, the fraction of informed agents needed for order depends on swarm size: about 10% sufficed for 3000 agents, and finite-size scaling up to 8000 agents places the large-swarm threshold near 11%, so leader counts should be sized for the largest deployment. Second, range-based (metric) communication gives more order at a given mean neighbour number, whereas k-nearest (topological) communication keeps order stable when the swarm spreads out or compresses; with 10% informed agents it needs about nine neighbours ( k c = 9.1 ) to order. Third, a k-nearest swarm becomes density independent when agent speed is scaled with the mean neighbour spacing ( v 0 ∝ ρ − 1 / 2 ). Each guideline is an optimization target: the smallest informed fraction and the fewest communication links (smallest k) that keep the swarm ordered, at a speed that makes order insensitive to density. Algorithm 1 solves the first two as one-dimensional searches in 7–8 simulations each, and can be nested to optimize several swarm parameters at a fraction of the cost of a full grid scan.
Limitations. The model is two-dimensional, whereas starling flocks are thin three-dimensional sheets. The speed mapping assumes an update time of about 0.1 s. Periodic boundaries replace the open edge of a real flock. Results at N = 3000 are finite-size estimates; production runs and larger N are needed to settle the order of the transition and the scaling exponents.
Future work. Natural extensions are a leader-ratio sweep in the topological model with k = 7 , three-dimensional and open-boundary simulations, and comparison with tracked trajectories of real flocks.

5. Conclusions

We presented a GPU simulation framework and an automated critical-point search for leader–follower swarms, with model parameters calibrated to starling flocks. The cell-list and exact k-nearest-neighbour kernels are checked against brute force at every start-up, and the Binder-cumulant bisection (Algorithm 1) locates a transition in 7–8 simulations instead of the 25–41 of a uniform grid. For swarm design the results give three quantitative rules. (i) About 10% informed agents order a swarm of 3000 whose uninformed members alone sit at the critical point, and finite-size scaling up to 8000 agents places the threshold for large swarms near 11%. (ii) Range-based communication gives more order at a given neighbour number, whereas nearest-neighbour communication needs about nine links ( k c = 9.1 ) but is 2.6 times less sensitive to density. (iii) Scaling agent speed with the mean neighbour spacing ( v 0 ∝ ρ − 1 / 2 ) makes a nearest-neighbour swarm density independent.
Each rule is an optimization target: the smallest informed fraction and the fewest communication links that keep the swarm ordered, at a speed that makes order insensitive to density. Because Algorithm 1 treats any control parameter as a one-dimensional search, it can be nested to optimize several swarm parameters at a fraction of the cost of a grid scan. Extending the framework to three dimensions, open boundaries and hardware tests on drone swarms is the next step.

Author Contributions

Conceptualization, C.D.; methodology, C.D.; software, C.D.; validation, C.D. and M.R.E.; formal analysis, C.D. and M.R.E; investigation, C.D. and M.R.E.; data curation, C.D. and M.R.E.; writing—original draft preparation, C.D.; writing—review and editing, M.R.E.; visualization, C.D. and M.R.E.; supervision, C.D. All authors have read and agreed to the published version of the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

All code, raw time series and metric tables are available at https://github.com/Deniz2030/vicsek-leader-follower-swarms; release v1.0, which produced the results in this article, is archived on Zenodo at https://doi.org/10.5281/zenodo.23979306. Every figure is reproduced by one command (Table A1); fixed seeds make the numbers identical across runs. Shared modules: vicsek_core.py (simulation, neighbour search, self-test, observables) and vicsek_report.py (figures, CSV export, command line). Publication figures are drawn from the saved CSV files with python make_figures.py. Requirements: Python 3, NumPy, pandas, SciPy, Matplotlib; CuPy for GPU runs. Hardware used for production runs: NVIDIA GeForce RTX 4060 Laptop GPU (8 GB), driver 581.86, CUDA 13.0.

Acknowledgments

During the preparation of this manuscript, the authors used Claude (Anthropic) to develop and validate the simulation code, support the data analysis, prepare the figures and draft the text. The authors reviewed and edited all output and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
CPU Central processing unit
CUDA Compute Unified Device Architecture
GPU Graphics processing unit
kNN k-nearest neighbours
STARFLAG Starlings in Flight project (field data source)

Appendix A. Commands That Reproduce Each Figure

Table A1 lists the script and command behind each figure of this article.
Table A1. Scripts and commands that reproduce each figure (repository release v1.0).
Table A1. Scripts and commands that reproduce each figure (repository release v1.0).
Figure Script Command
Figure 1 Noise baseline 5_sweep_eta.py python 5_sweep_eta.py
Figure 2 Leader ratio 1sweep_n1_ratio.py python 1sweep_n1_ratio.py
Figure 3 Density 2_sweep_rho.py python 2_sweep_rho.py
Figure 4 Perception range 3_sweep_r0.py python 3_sweep_r0.py
Figure 5 Flight speed 4_sweep_factor.py python 4_sweep_factor.py
Figure 6 and Figure 7 Topological 6_sweep_topological.py python 6_sweep_topological.py
Figure 8 Finite size 7_finite_size.pymerge_finite_size.py python 7_finite_size.py –N_list 1000 2000 4000–steps 6000 –seeds 5then –N_list 8000 with the same settings;python merge_finite_size.py
Figure 9 Correlations 8_correlation_starling.py python 8_correlation_starling.py
Critical points find_critical.py python find_critical.py –param eta –lo 0.30 –hi 0.70 –tol 0.01python find_critical.py –param k –lo 1 –hi 25 –tol 1
All figures make_figures.py python make_figures.py

References

  1. Vicsek, T.; Czirók, A.; Ben-Jacob, E.; Cohen, I.; Shochet, O. Novel type of phase transition in a system of self-driven particles. Phys. Rev. Lett. 1995, 75, 1226–1229. [Google Scholar] [CrossRef] [PubMed]
  2. Grégoire, G.; Chaté, H. Onset of collective and cohesive motion. Phys. Rev. Lett. 2004, 92, 025702. [Google Scholar] [CrossRef] [PubMed]
  3. Chaté, H.; Ginelli, F.; Grégoire, G.; Raynaud, F. Collective motion of self-propelled particles interacting without cohesion. Phys. Rev. E 2008, 77, 046113. [Google Scholar] [CrossRef] [PubMed]
  4. Ballerini, M.; Cabibbo, N.; Candelier, R.; Cavagna, A.; Cisbani, E.; Giardina, I.; Orlandi, A.; Parisi, G.; Procaccini, A.; Viale, M.; et al. Empirical investigation of starling flocks: A benchmark study in collective animal behaviour. Anim. Behav. 2008, 76, 201–215. [Google Scholar] [CrossRef]
  5. Bialek, W.; Cavagna, A.; Giardina, I.; Mora, T.; Pohl, O.; Silvestri, E.; Viale, M.; Walczak, A.M. Social interactions dominate speed control in poising natural flocks near criticality. Proc. Natl. Acad. Sci. USA 2014, 111, 7212–7217. [Google Scholar] [CrossRef] [PubMed]
  6. Ballerini, M.; Cabibbo, N.; Candelier, R.; Cavagna, A.; Cisbani, E.; Giardina, I.; Lecomte, V.; Orlandi, A.; Parisi, G.; Procaccini, A.; et al. Interaction ruling animal collective behavior depends on topological rather than metric distance: Evidence from a field study. Proc. Natl. Acad. Sci. USA 2008, 105, 1232–1237. [Google Scholar] [CrossRef] [PubMed]
  7. Cavagna, A.; Cimarelli, A.; Giardina, I.; Parisi, G.; Santagati, R.; Stefanini, F.; Viale, M. Scale-free correlations in starling flocks. Proc. Natl. Acad. Sci. USA 2010, 107, 11865–11870. [Google Scholar] [CrossRef] [PubMed]
  8. Baglietto, G.; Albano, E.V. Finite-size scaling analysis and dynamic study of the critical behavior of a model for the collective displacement of self-driven individuals. Phys. Rev. E 2008, 78, 021125. [Google Scholar] [CrossRef] [PubMed]
  9. Bialek, W.; Cavagna, A.; Giardina, I.; Mora, T.; Silvestri, E.; Viale, M.; Walczak, A.M. Statistical mechanics for natural flocks of birds. Proc. Natl. Acad. Sci. USA 2012, 109, 4786–4791. [Google Scholar] [CrossRef] [PubMed]
  10. Couzin, I.D.; Krause, J.; Franks, N.R.; Levin, S.A. Effective leadership and decision-making in animal groups on the move. Nature 2005, 433, 513–516. [Google Scholar] [CrossRef] [PubMed]
  11. Liu, X.; Xiang, X.; Chang, Y.; Yan, C.; Zhou, H.; Tang, D. Hierarchical weighting Vicsek model for flocking navigation of drones. Drones 2021, 5, 74. [Google Scholar] [CrossRef]
  12. Zhang, B.-Q.; Shao, Z.-G. Collective motion of self-propelled particles with complex noise environments. Phys. A 2021, 563, 125382. [Google Scholar] [CrossRef]
  13. Netzer, G.; Yarom, Y.; Ariel, G. Heterogeneous populations in a network model of collective motion. Phys. A 2019, 530, 121550. [Google Scholar] [CrossRef]
  14. Dutta, A.K.; Mangeat, M.; Rieger, H.; Paul, R.; Chatterjee, S. Stability of flocking in the reciprocal two-species Vicsek model: Effects of relative population, motility, and noise. Phys. Rev. E 2025, 112, 024137. [Google Scholar] [CrossRef] [PubMed]
  15. Wang, X.; Zhao, H.; Li, L. An improved Vicsek model of swarms based on a new neighbor strategy considering view and distance. Appl. Sci. 2023, 13, 11513. [Google Scholar] [CrossRef]
  16. Ginelli, F.; Chaté, H. Relevance of metric-free interactions in flocking phenomena. Phys. Rev. Lett. 2010, 105, 168103. [Google Scholar] [CrossRef] [PubMed]
  17. Toner, J.; Tu, Y. Long-range order in a two-dimensional dynamical XY model: How birds fly together. Phys. Rev. Lett. 1995, 75, 4326–4329. [Google Scholar] [CrossRef] [PubMed]
  18. Bertin, E.; Droz, M.; Grégoire, G. Boltzmann and hydrodynamic description for self-propelled particles. Phys. Rev. E 2006, 74, 022101. [Google Scholar] [CrossRef] [PubMed]
  19. Binder, K. Finite size scaling analysis of Ising model block distribution functions. Z. Phys. B Condens. Matter 1981, 43, 119–140. [Google Scholar] [CrossRef]
  20. Landau, D.P.; Binder, K. A Guide to Monte Carlo Simulations in Statistical Physics, 4th ed.; Cambridge University Press: Cambridge, UK, 2014. [Google Scholar]
  21. Press, W.H.; Teukolsky, S.A.; Vetterling, W.T.; Flannery, B.P. Numerical Recipes: The Art of Scientific Computing, 3rd ed.; Cambridge University Press: Cambridge, UK, 2007. [Google Scholar]
  22. Künsch, H.R. The jackknife and the bootstrap for general stationary observations. Ann. Stat. 1989, 17, 1217–1241. [Google Scholar] [CrossRef]
  23. Efron, B.; Tibshirani, R.J. An Introduction to the Bootstrap; Chapman & Hall: New York, NY, USA, 1993. [Google Scholar]
  24. Jadbabaie, A.; Lin, J.; Morse, A.S. Coordination of groups of mobile autonomous agents using nearest neighbor rules. IEEE Trans. Autom. Control 2003, 48, 988–1001. [Google Scholar] [CrossRef]
  25. Olfati-Saber, R. Flocking for multi-agent dynamic systems: Algorithms and theory. IEEE Trans. Autom. Control 2006, 51, 401–420. [Google Scholar] [CrossRef]
Figure 1. Noise sweep of a homogeneous flock ( N = 3000 , ρ = 2.2 , r 0 = 1 , v 0 Δ t / r 0 = 0.4 ). (a) Order parameter 〈 Ω 〉 with standard errors across seeds; (b) susceptibility χ = N Var ( Ω ) ; (c) Binder cumulant U 4 , with the ordered (2/3) and disordered (1/3) limits dotted. Dashed lines mark the experienced ( η 1 = 0.10 ) and naive ( η 2 = 0.50 ) noise levels; the solid line marks η c = 0.476 located by Algorithm 1.
Figure 1. Noise sweep of a homogeneous flock ( N = 3000 , ρ = 2.2 , r 0 = 1 , v 0 Δ t / r 0 = 0.4 ). (a) Order parameter 〈 Ω 〉 with standard errors across seeds; (b) susceptibility χ = N Var ( Ω ) ; (c) Binder cumulant U 4 , with the ordered (2/3) and disordered (1/3) limits dotted. Dashed lines mark the experienced ( η 1 = 0.10 ) and naive ( η 2 = 0.50 ) noise levels; the solid line marks η c = 0.476 located by Algorithm 1.
Preprints 243501 g001
Figure 2. Experienced-leader sweep: naive birds ( η 2 = 0.50 ) mixed with a fraction f = N 1 / N of experienced birds ( η 1 = 0.10 ); other parameters as in Figure 1. (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 .
Figure 2. Experienced-leader sweep: naive birds ( η 2 = 0.50 ) mixed with a fraction f = N 1 / N of experienced birds ( η 1 = 0.10 ); other parameters as in Figure 1. (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 .
Preprints 243501 g002
Figure 3. Density sweep with 10% experienced birds. (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 . The dashed line marks the starling-calibrated density ρ = 2.2 .
Figure 3. Density sweep with 10% experienced birds. (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 . The dashed line marks the starling-calibrated density ρ = 2.2 .
Preprints 243501 g003
Figure 4. Perception-range sweep with 10% experienced birds. Panels as in Figure 3; the dashed line marks the calibrated r 0 = 1 (≈3 m).
Figure 4. Perception-range sweep with 10% experienced birds. Panels as in Figure 3; the dashed line marks the calibrated r 0 = 1 (≈3 m).
Preprints 243501 g004
Figure 5. Flight-speed sweep with 10% experienced birds, on a logarithmic axis. Panels as in Figure 3. The shaded band is the observed starling speed range (8.1–19.2 m/s, v 0 Δ t / r 0 = 0.27 – 0.65 for Δ t = 0.1 s); the dashed line marks the mean speed ( v 0 Δ t / r 0 = 0.4 ).
Figure 5. Flight-speed sweep with 10% experienced birds, on a logarithmic axis. Panels as in Figure 3. The shaded band is the observed starling speed range (8.1–19.2 m/s, v 0 Δ t / r 0 = 0.27 – 0.65 for Δ t = 0.1 s); the dashed line marks the mean speed ( v 0 Δ t / r 0 = 0.4 ).
Preprints 243501 g005
Figure 6. Topological interaction: sweep of the number k of nearest neighbours with 10% experienced birds (2000 steps, 3 seeds). (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 . The shaded band marks the 6–7 neighbours reported for starlings; the solid line marks k c = 9.1 located by Algorithm 1.
Figure 6. Topological interaction: sweep of the number k of nearest neighbours with 10% experienced birds (2000 steps, 3 seeds). (a) 〈 Ω 〉 ; (b) χ ; (c) U 4 . The shaded band marks the 6–7 neighbours reported for starlings; the solid line marks k c = 9.1 located by Algorithm 1.
Preprints 243501 g006
Figure 7. Density robustness of metric ( r 0 = 1 , circles) and topological ( k = 7 , squares) interaction for ρ = 0.5 – 6.0 (logarithmic axis) with 10% experienced birds. (a) Fixed speed v 0 Δ t / r 0 = 0.4 ; (b) speed scaled as v 0 ∝ ρ − 1 / 2 , so that the step per mean neighbour spacing is constant. “Range” is the maximum minus the minimum of 〈 Ω 〉 over the sweep; the dashed line marks ρ = 2.2 .
Figure 7. Density robustness of metric ( r 0 = 1 , circles) and topological ( k = 7 , squares) interaction for ρ = 0.5 – 6.0 (logarithmic axis) with 10% experienced birds. (a) Fixed speed v 0 Δ t / r 0 = 0.4 ; (b) speed scaled as v 0 ∝ ρ − 1 / 2 , so that the step per mean neighbour spacing is constant. “Range” is the maximum minus the minimum of 〈 Ω 〉 over the sweep; the dashed line marks ρ = 2.2 .
Preprints 243501 g007
Figure 8. Finite-size scaling of the experienced-leader transition ( N = 1000 –8000 at ρ = 2.2 ; 6000 steps, 5 seeds; darker = larger N). (a) Binder cumulant U 4 with fitted logistic curves; (b) susceptibility χ ; (c) peak susceptibility χ max against box size L on logarithmic axes, with the power-law fit χ max ∝ L 1.19 and the peak position f labelled.
Figure 8. Finite-size scaling of the experienced-leader transition ( N = 1000 –8000 at ρ = 2.2 ; 6000 steps, 5 seeds; darker = larger N). (a) Binder cumulant U 4 with fitted logistic curves; (b) susceptibility χ ; (c) peak susceptibility χ max against box size L on logarithmic axes, with the power-law fit χ max ∝ L 1.19 and the peak position f labelled.
Preprints 243501 g008
Figure 9. Velocity-fluctuation correlations in the starling-like regime (homogeneous η = 0.10 , solid) and the critical mixture (dashed) for N = 500 –4000 (lighter = smaller N). (a) Correlation function C ( r ) ; (b) C against the rescaled distance r / L , where all curves collapse; (c) correlation length ξ against L with linear fits.
Figure 9. Velocity-fluctuation correlations in the starling-like regime (homogeneous η = 0.10 , solid) and the critical mixture (dashed) for N = 500 –4000 (lighter = smaller N). (a) Correlation function C ( r ) ; (b) C against the rescaled distance r / L , where all curves collapse; (c) correlation length ξ against L with linear fits.
Preprints 243501 g009
Table 1. Model parameters calibrated to starling flocks.
Table 1. Model parameters calibrated to starling flocks.
Parameter Value Basis
N 3000 Observed flocks of 122–4268 birds
ρ 2.2 π r 0 2 ρ ≈ 6.9 neighbours
r 0 1 (≈3 m) 2D mean nearest-neighbour distance 0.34 r 0 ≈ observed ∼ 1  m
v 0 Δ t / r 0 0.4 11.8 m/s × Δ t ≈ 0.1  s (assumed update time)
η 1 (experienced) 0.10 Homogeneous Ω ≈ 0.97 , the mean observed polarization
η 2 (naive) 0.50 At the homogeneous critical noise η c ≈ 0.48 – 0.50
Table 2. Simulation experiments.
Table 2. Simulation experiments.
Experiment Swept parameter Range Points Held fixed / changed Output
E1 Noise η (all birds) 0.05–0.70; fine grid 0.44–0.56 16; 13 homogeneous flock η c , Figure 1
E2 Leader ratio f = N 1 / N 0–0.50 15 η 1 , η 2 f c , Figure 2
E3 Density ρ 0.5–6.0 15 f = 0.10 Figure 3
E4 Perception range r 0 0.4–2.5 15 v 0 fixed, so v 0 Δ t / r 0 varies Figure 4
E5 Speed v 0 Δ t / r 0 0.03–2.0 (log) 15 r 0 = 1 Figure 5
E6A Neighbour number k (topological) 1–25 15 ρ = 2.2 Figure 6
E6B Density robustness ρ 0.5–6.0 8 × 2 metric r 0 = 1 vs. topological k = 7 ; control with v 0 ∝ ρ − 1 / 2 Figure 7
E7 Finite size f at several N 0–0.30; N = 1000 –8000 13 per N ρ = 2.2 , so L grows with N χ max ( L ) , U 4 crossings, Figure 8
E8 Correlations N 500–4000 4 per regime regimes: homogeneous η = 0.10 ; critical mix ξ ( L ) , Figure 9
E9 Critical point η , f, ρ , r 0 , v 0 or k user bracket; δ = 0.01 ( η ), 1 (k) 7–8 Algorithm 1 p c ± error
Table 3. Location of the susceptibility peak in each sweep and the corresponding starling value.
Table 3. Location of the susceptibility peak in each sweep and the corresponding starling value.
Sweep Control Parameter χ Peak Starling Value
Noise (homogeneous) η 0.50 η 1 = 0.10 (ordered), η 2 = 0.50
Leader ratio f = N 1 / N 0.10 not measured in the field
Density ρ 2.2–2.75 2.2
Perception range r 0 1.10 1.0
Flight speed v 0 Δ t / r 0 0.40 0.40 (band 0.27–0.65)
Topological neighbours k 12 6–7
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.