Asynchrony induces polarization in attraction-based models of collective motion

Animal groups frequently move in a highly organized manner, as represented by flocks of birds and schools of fish. Despite being an everyday occurrence, we do not fully understand how this works. In particular, what social interactions between animals give rise to the flock structures we observe? This question is often investigated using self-propelled particle models where particles represent the individual animals. These models differ in the social interactions used, individual particle properties, and various technical assumptions. One particular technical assumption relates to whether all particles update their headings and positions at exactly the same time (synchronous update) or not (asynchronous update). Here, we investigate the causal effects of this assumption in an attraction-only model and find that it has a dramatic impact. Polarized groups do not form when synchronous update is used, but are produced with asynchronous update, and this phenomenon is robust with respect to variation in particle displacements and inclusion of noise. Given that many important models have been implemented with synchronous update only, we speculate that our understanding of the social interactions on which they are based may be incomplete. Perhaps previously unobserved phenomena will emerge if other potentially more realistic update schemes are used.


Introduction
Moving animal groups such as schools of fish and flocks of birds often move in a highly coordinated fashion. How do such organized groups emerge despite the fact that each member of the group only experiences its immediate surroundings and often no leader can be identified? This question is typically investigated using self-propelled particle (SPP) models. In a typical SPP model, a number of particles move in the plane, or space, and update their headings at each time step according to a specified local interaction rule operating on the position, and/or the heading, of nearby particles. An example of a common local interaction rule is one where particles are repelled from nearby particles (repulsion), take the average heading of particles at intermediate distances (orientation), and are attracted to particles which are further away (attraction) [1,2]. A large number of models implementing various subsets of attraction, repulsion and alignment have been proposed and analysed in recent years [3,4].
SPP models have proven successful in explaining how collective motion may emerge from repeated local interactions between individuals in general settings and in specific experimental and real-world situations [3,4]. However, the use of SPP models has also attracted some criticism, both as models of real-world phenomena and in relation to how they are constructed [5][6][7]. Over the past decade, models have been adapted in various ways to resolve some of the issues. For example, models have included non-constant speeds [5], more realistic neighbour detection [8][9][10], more realistic visual system [11], leaders and shepherds [12][13][14], explicit environmental and social coupling [15], alignment-free interactions [16][17][18][19][20] and much more.
Although other specific concerns are outlined in [5][6][7], most that have been addressed focus on improving the models by making some aspect of the individual particles or their interactions more realistic. What about more low-level assumptions and choices? For example, regardless of how sophisticated the individuals and the social interactions between them are, all SPP models must include instructions for how to update particle headings and positions. One option is to update all particle positions and headings at exactly the same time (synchronous update), or use some type of asynchronous update scheme where particles may update their headings and positions at different times. This issue has been thoroughly investigated in related fields and shown to be important. For example, in robotics [21][22][23][24], cellular automata [25][26][27][28][29], coupled map lattices [30] and Ising spin systems [31]. In particular, direct comparison of asynchronous and synchronous versions of particular cellular automata show that asynchronous update tends to increase the stability of the automaton (see [28] for an overview).
Direct comparisons of this type are largely absent from the SPP model literature, and in most models, it is assumed that all particles calculate and update their headings synchronously. This assumption has been questioned by several authors and some have chosen to implement asynchronous update schemes [32][33][34][35][36]. These studies have revealed that implementing an asynchronous update scheme allows for some previously elusive empirical observations to be reproduced by SPP models. In particular, speed distributions in fish schools [32], interactions of a topological nature consistent with those observed in starling flocks [33], and collective motion in locusts [35] and soldier crabs [36]. However, despite these particular empirically motivated findings, systematic direct comparisons of various update schemes in standard SPP models have not been conducted, and it is still largely unknown what effects the choice of update scheme may have on models of this type. From a mathematical/computational point of view this choice may well have a dramatic effect; potentially in a way similar to other welldocumented choices made in model construction like choices between discrete and continuous or spatial and non-spatial models [37].
Here we compare the effect of implementing the synchronous and a particular asynchronous update scheme in the simplest SPP model known to produce the three standard groups ( polarized groups, mills and swarms), the local attraction model (LAM) [34]. If this choice has an effect on this model, it is likely to have an effect on more sophisticated models, and as much of our current understanding of collective motion in moving animal groups is based on SPP models, this would be a valuable insight.

Model and methods
The LAM is an SPP model in which N particles move at constant speed in two dimensions and interact via local attraction only [34] (figure 1a). On every time step, each particle calculates the position of the local centre of mass (LCM) of all particles within a distance of R from it (its neighbours). The new heading of particle i ( D i tþ1 ) is a linear combination of the normalized direction toward the LCM (Ĉ i t ), its normalized current heading (D i t ) and a normalized uniform noise vector ( The parameter c specifies the relative strength of attraction to the LCM when the relative tendency to proceed with the current heading is 1 and the parameter e specifies the intensity of the vectorial noise royalsocietypublishing.org/journal/rsos R. Soc. open sci. 6: 190381 term. The particle will then move a distance of d in the direction specified by D i tþ1 . From [34], we know that different groups will form depending on if c is less than, approximately equal to, or larger than 1. More specifically, if c 1 polarized groups form (figure 1b(i)). If c 1 swarms will form (figure 1b(iii)). If c 1 undirected mills will form (figure 1b(ii)). At least this holds when an asynchronous update scheme is used and the noise intensity e ¼ 0.

Synchronous and asynchronous update schemes
The synchronous update scheme is the standard updating scheme where all particles calculate their new headings and update their positions at exactly the same time on each time step (figure 2a). The asynchronous update scheme chosen here is one in which all the particles update their headings and positions sequentially on each time step, and the order in which they do so is randomized from one time step to the next (figure 2b). This particular choice is motivated in the discussion. synchronous update algorithm asynchronous update algorithm 1: for t from 1 to T do 1: for t from 1 to T do 2: for i from 1 to N do 2: determine the neighbours of all particles 3: determine the neighbours of particle i 3: update heading of all particles 4: update heading of particle i 4: update position of all particles 5: update position of particle i 6: end for 7: randomize particle order 8: end for 5: end for (b) (a) Figure 2. Pseudocode for the synchronous update (a) and the asynchronous update (b). For each time step t from 1 to the maximum simulation time T both algorithms update the position of each of the N particles, but how the three update steps (determine neighbours, update heading and update position) are carried out is different. With the synchronous update, each step is completed for all particles before the next step starts, whereas with the asynchronous update all three steps are carried out for one particle (i) before the first step is carried out for the next particle (i þ 1

Simulations and measures
First, we ran 100 simulations for each c from 0.04 to 2 in increments of 0.02 in both the synchronous case and in the asynchronous case without noise (e ¼ 0). Keeping all other parameters fixed at N ¼ 50, R ¼ 4, d ¼ 0.5. Periodic boundary conditions were used and at the start of each simulation each particle was assigned a uniformly distributed position and heading. A simulation will terminate when the maximum time T is reached, or when a specific group type has been identified. In this article, T ¼ 15 000 time steps, except when investigating polarized group formation in the synchronous case in which it is set to T ¼ 10 8 . A simulation may terminate before the maximum time is reached if a certain group has formed early. This is determined by continuously measuring the polarization a and scaled size s throughout the simulation and comparing them to values associated with known groups.
The polarization measures the degree to which the N particles are heading in the same direction and is defined by where N is the total number of particles andD i is the normalized current heading of particle i [38]. By definition, a ranges from 0 to 1 and polarized groups have large a values and mills have small a values. Swarms and random configurations have intermediate a-values. The size measure of a group of N particles distributed on a square of side length L is given by where DP x is the length of the range of particle x-coordinates and DP y is the length of the range of particle y-coordinates [34]. It provides an estimate of how much of the available space the group of particles occupy. If no group formed s is large, cohesive polarized groups have small s, mills have a s value that decreases with c, and swarms have very small s. Combining these two measures allows us to distinguish between the three groups in figure 1b and the case when no group has formed. In this study, we chose L ¼ 10 to ensure that at most one group is present at the end of each simulation so that the polarization and scaled size measures are well defined. If L is larger, multiple copies of the groups may be present (see electronic supplementary material, codeS2.m). If over 50 consecutive time steps s , 0.01, a cohesive group has formed and the a-values will inform us about which one it is. If over 50 consecutive time steps a . 0.995, a polarized group has formed, and if over 50 consecutive time steps 0.01 , s , 0.25 and a , 0.02 a large mill has formed. If any of these three situations are detected, the simulation will terminate early. Once a simulation has terminated, either by reaching the maximum time or terminating early, we collect the mean of a and s over the last 50 steps of the simulation, and the number of time steps it took until the simulation terminated t.
We also ran a set of simulations to determine how varying d and e affects group formation. We used d ¼ 0.001, 0.3, 1 and 2, and e ¼ c/10, c/2, c and 5c, and for each d and e value we ran 70 simulations following the simulation protocol described above.
To investigate the formation of polarized groups in more detail, we ran a set of simulations containing a mix of N a asynchronously updating particles and N 2 N a synchronously updating particles with c ¼ 0.1. More specifically, we considered four total group sizes N ¼ 10, 50, 100 and 200, and ran 100 simulations for each (N, N a )-pair with N a from 0 to N and then calculated the average polarization as a function of proportion of asynchronously updating particles N a . We did this in two ways, one where the asynchronously updating particles update before the synchronously updating particles on each time step, and one where they update after the synchronously updating particles on each time step.

Results
Depending on the choice of synchronous (figure 2a) or asynchronous update (figure 2b), the tendency of the model to produce polarized groups (figure 1b(i)) is very different. In figure 3, we see that for c , 0.2 there is a dramatic difference between the asynchronous update and synchronous update. In the former, we see the signature of polarized groups (large a, small s) and in the latter, no group (small a, large s). Figure 4 shows the time to polarized group formation for c from 0.04 to 0.18 over 100 simulations in the asynchronous case. We see that the time to formation decreases with increasing c and tends to be less than 10 000 time steps. Corresponding simulations in the synchronous case with an upper time limit royalsocietypublishing.org/journal/rsos R. Soc. open sci. 6: 190381 of 10 8 time steps did not produce a single polarized group. For c from just above 0.2-1, the asynchronous and synchronous update both produce mills and this regime appears largely unaffected by update scheme choice. For c larger than 1, the asynchronous and synchronous update produce qualitatively different results. In the asynchronous case, mills quickly degenerate as c increases above 1 and from then on partially mobile swarms are produced. In the synchronous case, mills are produced for c larger than 1 and only become truly degenerate and swarm-like very close to c ¼ 2.

Influence of varying the noise intensity e
The effects of varying e on the model behaviour are illustrated in figure 6. For noise intensities up to c/10, the behaviour of the asynchronous and synchronous update models are largely unaffected (cf. figure 3). At e ¼ c/2 the behaviour of the models for small c, i.e. asynchronous update produces polarized groups and synchronous update produces no groups, is largely unaffected. However, for e ¼ c/2 the mill and swarm regimes are strongly affected in both cases, and from this noise intensity on they will produce similar types of groups in these regimes. Up until e ¼ c mills and swarms are still produced, but as e increases beyond this value they start to degenerate, and at e ¼ 5c no cohesive group will form. We also note that while cohesive polarized groups do not form when e ¼ c, we observe a high degree of polarization (more than 0.7) for certain c values with the asynchronous update. , we see that cohesive polarized groups still form for e ¼ c/2, but that the mill and swarm regimes are severely affected and now produce something that can be described as mill-swarm hybrids whose size decreases with c. By comparing (a) and (b) with (c) and (d ), we see that the impact of increasing the noise intensity has a similar impact on the mill and swarm regimes of both models and for e c they produce essentially the same type groups in these regimes.
royalsocietypublishing.org/journal/rsos R. Soc. open sci. 6: 190381 to form. Figure 7 shows the mean polarization (a) over 100 simulations as a function of proportion of asynchronously updating particles for groups of sizes 10, 50, 100 and 200 and we observe that the proportion of asynchronously updating particles required for consistent polarized group formation decreases with N if we exclude the N ¼ 10 case. In particular, polarized groups are consistently produced when the proportion of asynchronously updating particles is larger than 0.4 for N ¼ 50, 0.3 for N ¼ 100 and 0.2 for N ¼ 200. We also found that whether the asynchronous update was before or after the synchronous has no discernible effect on this phenomenon. Therefore, we only include the result from when the asynchronous update was first in figure 7 (see electronic supplementary material, figure S1 for both).

Discussion
We have shown that the choice between asynchronous and synchronous update has a dramatic effect on group formation in the LAM. In particular, the formation of polarized groups is inhibited in the synchronous case ( figure 3). Since many influential models of collective motion exclusively use synchronous updating, further analysis of these models may reveal previously unseen groups and collective phenomena which add to the asynchrony-induced speed distribution and topological-like interactions described in [32,33]. How a model will behave under the local interaction rules alone when other potentially more realistic update schemes are used is largely unknown. Perhaps properties that are rare or non-existent in groups generated by standard SPP models, for example, the multistability and transition behaviour reported in [39], are sensitive to choice of updating scheme. In particular, it appears that the synchronous update may calm the system down, as exemplified by the swarm phase in our study. In the asynchronous case, swarms are more mobile, as indicated by high polarization values for c . 1.4 in figure 3a. By contrast, in the synchronous case the swarms are almost stationary, exhibiting very low polarization for c . 1.7 in figure 3b. This is a stark contrast to the effects of synchrony and asynchrony on cellular automata described in [28] and on the coupled map lattice in [30] where it was reported that replacing synchronous update with asynchronous updates acts to stabilize the local dynamics. In addition, our study establishes that attraction in combination with asynchrony in heading update alone induces polarized collective motion, adding to the growing literature on alignment-free models capable of producing polarized groups in two and three dimensions [16 -20]. Work on models of this type is motivated, in part, by the need to explain how polarized collective motion emerges in schools of fish where no alignment responses can be detected [40,41]. These alignment-free models are attraction -repulsion models and the cause of their polarization inducing capacity is likely to be an interplay between attractive and repulsive forces, often in combination with some known polarization inducing mechanism such as asymmetric interactions (e.g. blind zones). And while these models may be preferable in some cases, we believe that there are other situations where using asynchrony in update (in combination with attraction) may be more appropriate. For example, in situations where it is known that the individuals are updating in an asynchronous manner, e.g. guppies exhibiting burst-and-glide swimming [42,43] and locusts exhibiting pause-and-go motion [44,45].
We also establish that polarized groups reliably form in simulations with a mix of asynchronously and synchronously updating particles, and that the proportion of asynchronously updating particles required decreases with the total number of particles for N . 10 ( figure 7). This is potentially important because it shows that if a small proportion of individuals are updating asynchronously, even if these individuals are constantly changing, the group is able to agree on a common heading while interacting only via attraction. Suggesting that perhaps collective migration phenomena, typically explained by the existence of a small proportion of informed individuals within groups where individuals have an explicit tendency to align their headings [12,46] may be explained without this tendency to align. Instead the common migration heading may emerge from attractive interactions alone in combination with asynchronous updates. This would be a particularly useful mechanism for explaining collective migration in species of fish where explicit alignment responses could not be detected [40,41].
We also show that including noise (figure 6) and varying d ( figure 5) does not prevent polarized groups from forming when asynchronous update is used and does not enable polarized groups to form with synchronous update. The variation of d study also establishes that the lower limit on c for mill formation (i.e. upper limit on c for polarized group formation/no group) appear unaffected by the choice of asynchronous and synchronous update. In [34], a simple heuristic was used to derive an approximate lower limit on c for mill formation in terms of R and d [34, eq. 7] and shown to approximate the polarized group-mill boundary well via simulations [34, fig. 3]. In terms of the notation used in the current manuscript, the approximate lower limit on c for mill formation from [34] becomes 2d/R, and for d ¼ 0.3, 1 and 2 this gives 0.15, 0.5 and 1, which are close to the transitions regions we observe in figure  5 in both the synchronous and asynchronous case. While this does not explain why polarized groups form in the asynchronous case and not in the synchronous case it does intuitively help explain why the range of c over which polarized groups/no group form increases with d. Namely, because the range of c over which mills form decreases with d which permits other groups, or no group, to form where mills used to form. The study of varying d also suggests that the smallest c value for which polarized groups form in the asynchronous case may be dependent on d. In figure 5a, we see that at c ¼ 0.04 the mean polarization differs between d ¼ 0.3, 1 and 2. In particular, the mean polarization for d ¼ 0.3 is approximately 0.5, whereas for d ¼ 1 it is approximately 1. At present, we do not have an explanation for this phenomenon and future work is planned to address it via a thorough study of the c ! 0 limit.
Despite being criticized, the synchronous update still seems to be the default choice in SPP model construction. We speculate that there are many reasons for this. Most well-known models were originally presented in that way, and it is more straightforward to obtain a continuum approximation of the model and thus make other analysis tools available. In addition, if one decides to use asynchronous updates, which particular scheme should one choose? The asynchronous update scheme used here, and in part in [34], was chosen mainly because it has the same update rate at the time step level as the synchronous update against which it was compared, the randomization of update sequence between time steps prevents artefacts arising from a strict persistent update order, and it was straightforward to implement in a way that allowed for a mix of asynchronously and synchronously updating particles. However, other asynchronous update schemes have been implemented [32,33,36,[45][46][47] and these may be more suitable in some situations. In particular, we note that our asynchronous update differs significantly from the asynchronous update employed in [32,33,46], which is based on stochastic 'neighbour picking'. Where the asynchrony is introduced via probabilistic selection of individuals to update within each time step (equal probability with replacement) and probabilistic interaction partner selection for each individual chosen to update. This differs from the asynchronous update scheme presented here where all particles will update in sequential random order on each time step and interact equally with all neighbours in the interaction zone. While the former approach, and the stochastic multiple-choice action approaches employed in [36,45], is more appropriate for studying the combined effects of noise at the level of individual behaviours/interactions and stochastic asynchronous update, our approach complements it by isolating update order-related effects via the use of deterministic interactions.
It should be emphasized that we are not claiming that the asynchronous update scheme used here is more realistic than the synchronous one against which it was compared. We do claim that this choice in itself may be critically important in the study of collective motion via SPP models. Perhaps, in some situations, it may be as important as the form of the social interaction rule itself, as in our example royalsocietypublishing.org/journal/rsos R. Soc. open sci. 6: 190381 presented here. Therefore, we suggest that in future theoretical studies of minimal SPP models a variety of different update schemes be explored, presented and compared. In modelling specific experiments, or observations, we suggest using pilot data to estimate the update distribution and use that to inform the update choice selection. It would be very unfortunate if a carefully designed model that has the capacity to reproduce key properties observed in a specific experiment is abandoned, or made more complicated by adding more social interactions or constraints, because an underlying assumption like this one was overlooked. Our suggestions are in line with the programmes proposed in [5][6][7], and we believe that our work represents a concrete example illustrating the importance of continuing to work in the directions set out by these authors.
Data accessibility. All code used to obtain the results presented in this manuscript may be downloaded from https:// github.com/danielstrombom/Asynchrony.