A Discrete Model of Collective Marching on Rings
AA Discrete Model of Collective Marching on Rings
Michael Amir , Noa Agmon , and Alfred M. Bruckstein Technion - Israel Institute of Technology, [email protected] , [email protected] Bar-Ilan University, Department of Computer Science [email protected]
Abstract.
We study the collective motion of autonomous mobile agents on a ringlike environment.The agents’ dynamics is inspired by known laboratory experiments on the dynamics of locust swarms.In these experiments, locusts placed at arbitrary locations and initial orientations on a ring-shapedarena are observed to eventually all march in the same direction. In this work we ask whether, and howfast, a similar phenomenon occurs in a stochastic swarm of simple agents whose goal is to maintain thesame direction of motion for as long as possible. The agents are randomly initiated as marching eitherclockwise or counterclockwise on a wide ring-shaped region, which we model as k “narrow” concentrictracks on a cylinder. Collisions cause agents to change their direction of motion. To avoid this, agentsmay decide to switch tracks so as to merge with platoons of agents marching in their direction.We prove that such agents must eventually converge to a local consensus about their direction of motion,meaning that all agents on each narrow track must eventually march in the same direction. We giveasymptotic bounds for the expected amount of time it takes for such convergence or “stabilization” tooccur, which depends on the number of agents, the length of the tracks, and the number of tracks. Weshow that when agents also have a small probability of “erratic”, random track-jumping behaviour,a global consensus on the direction of motion across all tracks will eventually be reached. Finally, weverify our theoretical findings in numerical simulations. Keywords: mobile robotics, swarms, crowd dynamics, natural algorithms
Birds, locusts, human crowds and swarm-robotic systems exhibit interesting collective motion patterns.The underlying autonomous agentic behaviours from which these patterns emerge have been an enduringtopic of great interest [2,5,17,18]. In particular, a lot of research has centred around the analysis of formalmathematical models for swarm dynamics in its various manifestations [7,9,14,28]. Rigorous mathematicalresults are necessary for understanding swarms and for designing predictable and effective swarm-roboticsystems. However, multi-agent swarms have a uniquely complex and “mesoscopic” nature [11], and relativelyfew standard techniques for the analysis of such systems have been established. Consequently, the analysisof new models of swarm dynamics is important for advancing our understanding of the subject.In this work, we study the dynamics of “locust-like” agents moving on a discrete ringlike surface. Themodel we study is inspired by the following well-documented experiment [3]: place many locusts on a ringlikearena at random positions and orientations. They start to move around and bump into the walls and intoeach other, and as they do so, remarkably, over time, they begin to collectively march in the same direction;clockwise or counterclockwise (Figure 1). Inspired by observing these experiments, we asked the followingquestion: what are simple and reasonable myopic rules of behaviour that might lead to this phenomenon?Our goal is to study this question from an algorithmic perspective, by considering a model of discretizedmobile agents that act upon a local algorithm. As with much of the literature on swarm dynamics [10,7,4],our goal is not to study a mathematical model of locusts in particular (the precise mechanisms underlyinglocusts’ behaviours are very complex and subject to intense ongoing research, e.g. [3,5]), but to study thekinds of algorithmic local interactions that lead to collective marching and similar phenomena. As such,we are interested in simple “algorithmic” principles that yield collective marching or that approximate thebiologically emerging behaviours. The resulting model is idealized and simple to describe, but the patternsof behaviour that take place in it as it progresses towards a “stabilized” state of collective marching areconceptually and mathematically complex. a r X i v : . [ c s . M A ] D ec Michael Amir, Noa Agmon, and Alfred M. Bruckstein
Fig. 1:
The collective clockwise marching of locusts in a ring arena (image by Amir Ayali).
The starting point for this work is the following postulated “rationalization” of what a locust-like agentwants to do: it wants to keep moving in the same direction of motion (clockwise or counterclockwise) foras long as possible. We can therefore consider a model of locust-like agents that never change their headingunless they collide, heads-on, with agents marching in the opposite direction, and are forced to do so due tothe pressure which is exerted on them. When possible, these agents prefer to bypass agents that are headedtowards them, rather than collide with those agents. This is done by changing lanes; moving in an orthogonalmanner between concentric narrow tracks which partition the ringlike arena. The formal description of this“rationalized” model is given in Section 2, and will be our subject of study.
Contribution.
We describe and study a stochastic model of locust-like agents in a discretized ringlike arenawhich is modelled as multiple tracks that wrap around a cylinder. We show that our agents eventually reacha “local consensus” about the direction of marching, meaning that all agents on the same track will marchin the same direction. We give asymptotic bounds for the amount of time this takes based on the number ofagents and the physical dimensions of the arena. Because of the idealized “precise” nature of our model, aglobal consensus where all locusts walk in the same direction (as in Figure 1) is not guaranteed, since locustsin different tracks might never meet. However, we show that, when a small probability of “erratic”, randombehaviour is added to the model, such a global consensus must occur. We verify our claims via simulationsand make some further empirical observations that may inspire future investigations into the model.Despite being simple to describe, analyzing the model proved tricky in several respects. Our analysisstrategy is to show that the model repeatedly passes between two phases: one in which it is “chaotic”, suchthat locusts are arbitrarily moving about, and one in which it is “orderly”, such that all locusts are in a kindof dense deadlock situation and collisions are frequent. We derive our asymptotic bounds from studying thewell-behaved phase while bounding the amount of time the locusts can spend in the chaotic phase.
Related work.
The experiments inspiring our work are discussed in [5,3]. The mathematical modellingof the collective motion of natural organisms such as birds, locusts and ants, and the convergence of suchsystems of agents to stable formations, has been discussed in numerous works including [14,18,28,29].The central focus of this work regards consensus: do the agents eventually converge to the same directionof motion, and how long does it take? Similar questions are often asked in the field of opinion dynamics.Mathematically, if the agents’ direction of motion (clockwise or counterclockwise) is considered an “opinion”,we can compare our model to models in this field. When there are no empty locations at all in the environment,our model is fairly close to the voter model on a ring network with two distinct opinions, the main differencebeing that, unlike in the voter model, our agents’ direction of motion determines which agents’ opinions caninfluence them (an excellent survey on this topic is [15]). The comparison to the voter model breaks whenwe introduce empty locations and multiple ringlike tracks, at which point we must take into account thephysical location of every agent when considering which agents can influence its opinion. Several works haveexplored models of opinion dynamics in a ring environment where the agents’ physical location is taken intoaccount [8,20]. Our model is distinct from these in several respects: first, in our model, an agents’ internal
Discrete Model of Collective Marching on Rings 3 state–its direction of motion–plays an active part in the algorithm that determines which locations an agentmay move to. Second, we partition our ring topology into several narrow rings (“tracks”) that agents mayswitch between, and an agents’ decision to switch tracks is influenced by the presence of platoons of agentsmoving in its direction in the track that it wants to switch to. In other words, we model agents that activelyattempt to “swarm” together with agents moving in their direction of motionProtocols for achieving consensus about a value, location or the collective direction of motion have alsobeen investigated in swarm robotics and distributed algorithms [6,13,26,27]. However, in this work, we arenot searching for a protocol that is designed to efficiently bring about consensus; we are investigating aprotocol that is inspired by natural phenomena and want to see whether it leads to consensus and how longthis takes on average.Broadly speaking, some mathematical similarities may be drawn between our model and interactingparticle systems such as the simple exclusion process, which have been used to understand biological transportand traffic phenomena [12]. Such particle systems have been studied on rings [21]. In these discrete models,as in our model, agents possess a physical dimension, which constrains the locations they might move to intheir environment. These are not typically multi-agent models where agents have an internal state (such asa persistent direction of motion), but rather models of particle motion and diffusion, and the research focusis quite different; the main point of similarity to our model is in the way that a given discrete location canonly be occupied by a single agent.
We postulate here a model for locust-inspired marching in a wide ringlike arena, which is divided intonarrow concentric rings. For simplicity, we map the arena to the surface of a discretized cylinder of height k partitioned into k narrow rings of length n , which are called tracks . For example, the environment of Figure2 corresponds to k = 3 , n = 8 (3 tracks of length 8). The coordinate ( x, y ) refers to the x th location on the y th track (which can also be seen as the x th location of a ring of length n wrapped around the cylinder atheight y ). Since we are on a cylinder, we have that ∀ x, ( x + n, y ) ≡ ( x, y ).A swarm of m identical agents, or “locusts”, which we label A , . . . , A m , are dispersed at arbitrarylocations on the cylinder and move autonomously at discrete time steps t = 0 , , . . . . A given location ( x, y )on the cylinder can contain at most one locust. Each locust A i is initiated with either a “clockwise” or“counterclockwise” heading , which determines their present direction of motion. We define b ( A i ) = 1 when A i has clockwise heading, and b ( A i ) = − A i has counterclockwise heading.The locusts move synchronously at discrete time steps t = 0 , , . . . . At every time step, locusts try to movein their direction of motion: if a locust A is at ( x, y ), it will attempt to move to ( x + b ( A ) , y ). A clockwisemovement corresponds to adding 1 to x , and a counterclockwise movement corresponds to subtracting 1.The locusts have physical dimension, so if the location a locust attempts to move to already contains anotherlocust at the beginning of the time step, the locust instead stays put. If A i and A j are both attempting tomove to the same location, one of them is chosen uniformly at random to move to the location and the otherstays put.Locusts that are adjacent exert pressure on each other to change their heading: if A i has a clockwiseheading and A j has a counterclockwise heading, and they lie on the coordinates ( x, y ) and ( x + 1 , y ) respec-tively, then at the end of the current time step, one locust (chosen uniformly at random) will flip its headingto the other locust’s heading. Such an event is called a conflict between A i and A j . A conflict is “won” bythe locust that successfully converts the other locust to their heading.Let A be a locust at ( x, y ). If the locust A has clockwise heading, then the front of A is the first locustafter A in the clockwise direction, and the back of A is the first locust in the counterclockwise direction. Vice-versa when A has counterclockwise heading. Formally, the front of A is the location of the form ( x + b ( A ) i, y )which minimizes i subject to the constraints that ( x + b ( A ) i, y ) contains a locust and i ≥
1. The back of A is the location of the form ( x − b ( A ) i, y ) which minimizes i subject to analogous constraints. The locusts inthe front and back of A are denoted A → and A ← respectively, and are called A ’s neighbours ; these are thelocusts that are directly in front of and behind A . Note that when a track has two or less locusts, A → = A ← ,and when a track has one locust, A = A → = A ← .Besides moving in the direction of their heading within their track, a locust A at ( x, y ) can switch tracks,moving vertically from ( x, y ) to ( x, y + 1) or ( x, y −
1) (unless this would cause it to go above track k or Michael Amir, Noa Agmon, and Alfred M. Bruckstein below track 1). Such vertical movements occur after the horizontal movements of locusts along the tracks.Locusts are incentivized to move vertically when this enables them to avoid changing their heading (inertia).Specifically, A may move to the location E = ( x, y ±
1) at time t when:1. At the beginning of time t , A and A → are not adjacent to each other and b ( A ) (cid:54) = b ( A → ).2. Once A moves to E , the updated A ← and A → in the new track will have heading b ( A ).3. No locust will attempt to move horizontally to E at time t + 1.Condition (1) states that there is an imminent conflict between A and A → which is bound to occur.Condition (2) guarantees that, by changing tracks to avoid this conflict, A is not immediately advancingtowards another collision; A ’s new neighbours will have the same heading as A . Condition (3) guaranteesthat the location A wants to move to on the new track isn’t being contested by another locust already on thattrack. Together, these conditions mean that locusts only change tracks if this results in avoiding collisionsand in “swarming” together with other agents marching in the same direction of motion. If a locust cannotsense that all three conditions (1), (2) and (3) are fulfilled, it does not switch tracks.Besides these conditions, we make no assumptions about when locusts move vertically. In other words,locusts do not always need to change tracks when they are allowed to by rules (1)-(3); they may do soarbitrarily, say with some probability q or according to any internal scheduler or algorithm. We do notdetermine in any sense the times when locusts move tracks–but only determine the preconditions requiredfor such movements; our results in the following sections remain true regardless. This makes our resultsgeneral in the sense that they hold for many different track-switching “swarming” rules, so long as thoserules do not break the conditions (1)-(3).Figure 2 illustrates one time step of the model, split into horizontal and vertical movement phases. Fig. 2:
One step of the locust model with k = 3, n = 8 split into horizontal and vertical movements. The leftmostfigure is the initial configuration at the beginning of the current time step t , the middle illustrates changes to theconfiguration after conflicts and horizontal movements, and the rightmost figure is the configuration at the beginningof time t +1 (or equivalently the end of time t ) after vertical movements. The front and back of the blue locust are thered and green locusts respectively. The purple locusts conflict with each other. Since conditions (1)-(3) are fulfilled,the blue locust may switch tracks, and it does so. In order to slightly simplify our analysis of the model, we assume that every track has at least 2 locustsat all times, although our results remain true without this assumption.Everywhere in this work, the beginning of a time step refers to the configuration of the swarm at thattime step before any locusts moved, and the end of a time step refers to the configuration at that time stepafter all locust movements are complete.
We will mainly be interested studying the stability of the headings of the locusts over time. Does the modelreach a point where the locusts stop changing their heading? If so, are their headings all identical? How soondoes this stabilization occur?In the case of a single track ( k = 1), we shall see that the locusts all eventually stabilize with identicalheading, and bound the expected time for this to happen in terms of m and n . In the multi-track case, Discrete Model of Collective Marching on Rings 5 we shall see that the locusts stabilize and agree on a heading locally (i.e., all locusts on the same track eventually have identical heading and thereafter never change their heading), and bound the expected timeto stabilization in terms of m, n, k . In the multi-track case, we shall also show that adding a small probabilityof “erratic” track-switching behaviour induces global consensus: all locusts across all tracks eventually haveidentical heading. k = 1) We start by studying the case k = 1, that is, we study a swarm of m locusts marching on a single track oflength n . Throughout this section, we assume this is the case, except in Definition 2, which we will use inlater sections.For the rest of this section, let us call the swarm non-stable at time t if there are two locusts A i and A j such that b ( A i ) (cid:54) = b ( A j ); otherwise, the swarm is stable . We wish to bound the number of time steps ittakes for the system to become stable, T stable . The primary goal of the rest of this section is to prove thefollowing Theorem, which tells us that the expected time to stabilization grows quadratically in the numberof locusts, and linearly in the length of the rings’ lone track. Theorem 1
For any configuration of m locusts on a ring with a single track, E [ T stable ] ≤ m + 2( n − m ) = O ( m + n − m ) . Additionally, there are initial locust configurations for which E [ T stable ] = Ω ( m + n − m ) . In particular, Theorem 1 tells us that all locusts must have identical bias within finite expected time.This fact in isolation (without the time bounds in the statement of the theorem) is relatively straightforwardto prove, by noting that the evolution of the locusts’ headings and locations can be modelled as a finiteMarkov chain, and the only absorbing classes in this Markov chain are ones in which all locusts have thesame heading (see [19]).We give next a definition of segments , which are sets of agents all on the same track that share a directionof motion. This will allow us to partition the swarm into segments, such that every locust belongs to a uniquesegment (see Figure 3). Although this section focuses on the case of a single track (and claims in this sectionare made under the assumption that there is only a single track), the definition is general, as we will use itin subsequent sections. Note that segments are only well-defined for tracks where not all locusts have thesame heading.
Definition 2.
At any time t , let K be one of the k tracks, such that not all locusts in K have identicalheading. A locust A i in K for which b ( A ← i ) (cid:54) = b ( A i ) is called a segment tail at time t . For A i which isa segment tail, define the sequence of locusts B = A i and B i +1 = B → i . Let B q be the first locust in thissequence for which b ( B q ) (cid:54) = b ( B ) . The set { B , B , . . . B q − } is called the segment of the agents B , . . . B q − at time t . The locust B q − is called a segment head . Fig. 3:
A locust configuration with n = 8 , k = 3. Locusts are colored based on their segment. Only locusts which are segment heads at the beginning of a time step can change their heading at thattime step. When the heads of two segments are adjacent to each other, the resulting conflict causes one to
Michael Amir, Noa Agmon, and Alfred M. Bruckstein change its heading, leave its previous segment, and instead become part of the other segment. If the head ofa segment is also the tail of a segment, the segment is eliminated when it changes heading. Segment tails canalso cease being tails when two segments of the same heading merge (due to the segment of opposite headingthat separated them being eliminated), in which case the number of segments decreases. No other action byan agent can change the number of segments. Hence, the number of segments and segment tails can only godown, and no agent ever becomes a segment tail due to changing its heading. Therefore there must exist alocust, determined probabilistically based on the evolution of the swarm, which remains a segment tail atall times t < T stable and never changes its heading. Denote one such locust A W (if there is more than one,choose arbitrarily). Definition 3.
The segment of A W at the beginning of time t is called the winning segment at time t , anddenoted SW ( t ) . The head of SW ( t ) is labelled H W ( t ) . For convenience, if at time t the swarm is stable,then we let SW ( t ) equal the entire swarm. Lemma 4
Let C m denote the number of changes to the size of SW ( t ) that occur before a swarm of m agentsis stable. Then E [ C m ] ≤ m .Proof. The swarm is stable iff | SW ( t ) | = m . | SW ( t ) | can only decrease, by 1 locust at a time, if H W ( t )conflicts with another locust and loses. | SW ( t ) | can increase in several ways, for example when it mergeswith other segments. In particular, | SW ( t ) | increases by at least 1 whenever H W ( t ) conflicts with a locustand wins (which happens with probability at least 1 / SW being the winningsegment). Hence, whenever SW ( t ) changes in size, it is more likely to grow than to shrink. We can bound E [ C m ] by comparing the growth of | SW ( t ) | to a random walk with absorbing boundaries at 0 and m ([1]):Consider a random walk on the integers which starts at | SW (0) | . At any time step t , the walker takes astep left with probability 0 .
5, otherwise it takes a step right. If the walker reaches either 0 or m , the walkends. Denote by C ∗ m the time it takes the walk to end. Using coupling (cf. [25]), we can clearly see that E [ C m ] ≤ E [ C ∗ m | the walker never reaches 0], since per the last paragraph, | SW ( t ) | clearly grows at least asfast as the position of the random walker (note that | SW ( t ) | > E [ C ∗ m | the walker never reaches 0]. Since the walk is memoryless, we can thinkof this quantity as the number of steps the random walker takes to get to m , assuming it must move rightwhen it is at 0, and assuming the step count restarts whenever it moves from 0 to 1. If we count the stepswithout resetting the count, we get that this is simply the expected number of steps it takes a random walkerwalled at 0 to reach position m , which is at most m (cf. [1]). Hence E [ C ∗ m | the walker never reaches 0] ≤ m . (cid:117)(cid:116) Lemma 5
The expected number of time steps t < T stable in which | SW ( t ) | does not change is bounded by n − m ) . We will need some definitions and lemmas to help us prove this Lemma.
Definition 6.
Let A and B be two locusts or two locations which lie on the same track. The clockwisedistance from A to B is the number of clockwise steps required to get from A (or A ’s location) to B (or B ’slocation), and is denoted dist c ( A, B ) . The counterclockwise distance from A to B is denoted dist cc ( A, B ) andequals dist c ( B, A ) . For the rest of this section, let us assume without loss of generality that A W (the tail of the winningsegment) has clockwise heading. Label the empty locations of the ring at time t = 0 as E , E , . . . E n − m ,sorted by their counterclockwise distance to A W at time t = 0, such that E minimizes dist cc ( E i , A W ), E has the second smallest distance, and so on. We will treat these empty locations as having persistentidentities: whenever a locust A moves from its current location to E i , we will instead say that A and E i swapped , and so E i ’s new location is A ’s old location.We say a location E i is inside the segment SW ( t ) at time t if the two locusts which have the smallestclockwise and counterclockwise distance to E i respectively are both in SW ( t ). Otherwise, we say that E i is outside SW ( t ). A locust or location A is said to be between E i and E j , j > i , if dist c ( E i , A ) < dist c ( E i , E j ). Discrete Model of Collective Marching on Rings 7
Definition 7.
All locations are initially blocked . A location E i becomes unblocked at time t +1 if all emptylocations E j such that j < i are unblocked at time t , and a locust from SW ( t ) swapped locations with E i attime t . Once a location becomes unblocked , it remains that way forever. Lemma 8
There is some time step t ∗ ≤ n − m such that:1. Every blocked empty location E is outside SW ( t ∗ ) (if any exist)2. At least t ∗ empty locations are unblocked.Proof. If E is outside SW (0), then the same must be true for all other empty locations, and we are done.Otherwise, E becomes unblocked at time t = 1. If E i becomes unblocked at time t , then at time t , it cannotbe adjacent to E i +1 , since the locust that swapped with E i in the previous time step is now between E i and E i +1 . By definition, there are no empty locations E j between E i and E i +1 . Consequently, if E i +1 is inside SW ( t ) at time t , it will swap with a locust of SW ( t ) at time t , and become unblocked at time t + 1. If E i +1 is outside the segment at time t , it will become unblocked at the first time step t (cid:48) > t that it begins inside SW ( t (cid:48) ). Hence, if E i becomes unblocked at time t , then E i +1 becomes unblocked at time t + 1 or E i +1 isoutside SW ( t + 1) at time t + 1.Let t ∗ be the smallest time where there are no blocked empty locations inside SW ( t ∗ ). By the above, atevery time step t ≤ t ∗ an empty location becomes unblocked, hence there are at least t ∗ unblocked emptylocations at time t ∗ . Also, since there are n − m empty locations, this implies t ∗ ≤ n − m . (cid:117)(cid:116) Lemma 9
There is no time t < T stable where an unblocked location can swap with H W ( t ) (i.e., there is notime t where an unblocked empty location E is located one step clockwise from H W ( t ) ).Proof. First consider what happens when E becomes unblocked: it swaps its location with a locust in SW ( t ),and since E is the clockwise-closest empty location to A W , the entire counterclockwise path from E to A W consist only of locusts from SW ( t ). Hence E will move counterclockwise at every time step, until itswaps with A W . Once it swaps with A W , E will not swap with another locust at all times t < T stable , sincefor that to occur we must have that b ( A ← W ) = b ( A W ), which is impossible since by definition A W remains asegment tail until t = T stable . E does not swap with H W ( t ) while E moves counterclockwise towards A W nor after E and A W swap as long as the swarm is unstable, hence there is no time step t < T stable when E is unblocked and swaps with H W ( t ).Now consider E . E becomes unblocked at least one time step after E , and there is at least one locustin SW ( t ) which is between E and E at the time step E becomes unblocked (in particular, the locustin SW ( t ) that swapped with E must be between E and E at that time). Since E subsequently movestowards A W at every time step until they swap, E cannot become adjacent to E until they both swapwith A W . Hence the location one step counterclockwise to E must always be a locust, until it swaps with A W , meaning that similar to E , E also moves counterclockwise towards A W at every time step after E becomes unblocked until they both swap. Consequently, just like E , there is no time step t < T stable when E is unblocked and swaps with H W ( t ).More generally, by a straightforward inductive argument, the exact same thing is true of E i : once itbecomes unblocked, it moves counterclockwise towards A W at every time step until it swaps with A W . Thus,upon becoming unblocked, E i does not swap with H W ( t ) as long as t < T stable . (cid:117)(cid:116) Using Lemmas 8 and 9, let us prove Lemma 5.
Proof.
If, at the beginning of time step t , H W ( t ) is adjacent to a locust from a different segment, then | SW ( t ) | will change at the end of this time step due to the locusts’ conflict. Hence, to prove Lemma 5, itsuffices to show that out of all the time steps before time T stable , H W ( t ) is not adjacent to the head of adifferent segment in at most 2( n − m ) different steps in expectation.If all empty locations are unblocked at time n − m , then by Lemma 9, H W ( t ) conflicts with the head ofanother segment at all times t ≥ n − m . Therefore, | SW ( t ) | will change at every time step n − m < t < T stable ,which is what we wanted to prove.If all empty locations are not unblocked by time n − m , then by Lemma 5, there must be some time t ∗ ≤ n − m where at least t ∗ locusts are unblocked and all blocked locusts are outside SW ( t ∗ ). Let E j bethe minimal-index blocked location which is outside SW ( t ∗ ) at time t ∗ . Since there are no blocked empty Michael Amir, Noa Agmon, and Alfred M. Bruckstein locations inside SW ( t ∗ ), all locations E i with i < j are unblocked. Hence, E j will become unblocked assoon as it swaps with the head of the winning segment. Since (by the clockwise sorting order of E , E , . . . ) E j +1 cannot swap with the winning segment head before E j is unblocked, E j +1 will also become unblockedafter the first time step where it swaps the winning segment head. The same is true for E j +2 , . . . E n − m .Hence, every empty location that H W ( t ) swaps with after time t ∗ becomes unblocked. By Lemma 5, thetotal swaps H W ( t ) could have made before time T stable is thus most t ∗ + ( n − m − j ) ≤ n − m . Wheneveran empty location is one step clockwise to H W ( t ), they will swap with probability at least 0 . H W ( t ) is not adjacent to the head of another segment isbounded by 2( n − m ). (cid:117)(cid:116) The proof of Theorem 1 now follows.
Proof.
Lemma 5 tells us that before time T stable , | SW ( t ) | does not change in at most 2( n − m ) time steps inexpectation, whereas Lemma 4 tells us that the expected number of changes to | SW ( t ) | before time T stable isat most m . Hence, for any configuration of m agents on a ring of track length n , E [ T stable ] ≤ m + 2( n − m ).Let us now show a locust configuration for which E [ T stable ] = Ω ( m + n ), so as to asymptoticallymatch the upper bound we found. Consider a ring with k = 1, m divisible by 2, and an initial locustconfiguration where locusts are found at coordinates (0 , , (1 , , . . . ( m/ ,
1) with clockwise heading and at( − , , ( − , , . . . ( − m/ − ,
1) with counterclockwise heading, and the rest of the ring is empty. This is aring with exactly two segments, each of size m/
2. Since after every conflict, the segment sizes are offset by1 in either direction, the expected number of conflicts between the heads of the segments that is necessaryfor stabilization is equal to the expected number of steps a random walk with absorbing boundaries at m/ − m/ m / n − m from each other, it takes Ω ( n − m ) steps for them to reach each other. Hence the expected time for this ringto stabilize is Ω ( m + n − m ). (cid:117)(cid:116) k > Let us now investigate the case where k >
1, that is, m locusts are marching on a cylinder of height k partitioned into k tracks of length n . The first question we should ask is whether, just as in the case of thelocusts in a k = 1 environment, there is some time T where all locusts have identical heading. The answer is“not necessarily”: consider for example the case k = 2 where on the k = 1 track, all locusts march clockwise,and on the k = 2 track, all locusts march counterclockwise. By the rules for switching tracks (see Section2), no locusts will ever switch tracks in this configuration, hence the locusts will perpetually have opposingheadings. As we shall prove in this section, on the cylinder, swarms stabilize locally –meaning that eventually,all locusts on the same track have identical heading, but this heading is not always shared globally.Let us say that the y th track is stable if all locusts whose location is ( · , y ) have identical heading. Notethat once a track becomes stable, it remains this way forever, as by the model, the only locusts that maymove into the track must have the same heading as its locusts. Let T stable be the first time when every allthe k tracks are stable. Our goal will be to prove the following asymptotic bounds on T stable : Theorem 10 E [ T stable ] = O (min(log( k ) n , mn + m )) . The bound O ( mn + m ) is more useful when there is a relatively small number of locusts; m (cid:47) (cid:112) log( k ) n .The bound O (log( k ) n ) is better when there is a large number of locusts.Recalling Definition 2, each locust in the system belongs to some segment. Each track has its ownsegments, and these may sometimes grow or shrink due to conflicts, or due to agents passing from theircurrent segment to a track on a different segment. In this section, we will treat segments as having persistentidentities, similar to SW in the previous section. This is encapsulated in Definition 11: Definition 11.
Let S be a segment whose tail is A . Then S ( t ) refers to the segment whose tail is A at thebeginning of time t . If A is not a segment tail at time t , then we will say S ( t ) = ∅ (this can happen once A changes its heading, moves to another track, or due to another segment merging with S ( t ) which might cause b ( A ← ) to equal b ( A ) , thus making A no longer the tail).Furthermore, if S is a segment, define S to be the segment tail and S i +1 = S → i . Discrete Model of Collective Marching on Rings 9
Let us give a few examples of the notation in Definition 11. Suppose at time t we have some segment S .Then the tail of S is S , and the head is S | S | . S ( t ) is the segment whose tail is S at time t , hence S ( t ) = S .Finally, S ( t ) | S ( t ) | ( t ) is the head of the segment S ( t ).In the k > T stable .One crucial fact however, is that the number of segments on any individual track is non-increasing. This isbecause, first, as in the previous section, locusts moving and conflicting on the same track can never createnew segments. Second, by the locust model, locusts can only move into another track when this places thembetween two locusts that already belong to some (clockwise or counterclockwise) segment. That being said,locusts moving in and out of a given track makes it much harder to measure how close a track is to stabilityby the method we used in the previous section. Hence, in the following definitions of compact and deadlocked locust sets, our goal is to identify configurations of locusts which locusts cannot enter into, which makestheir analysis easier. Subsequently, we will show that segments must enter into deadlock “relatively often”,which is what will enable the analysis. Definition 12.
Let X be any set of locusts { X , X , . . . } such that X i +1 = X → i ( X is not necessarily asegment). X is called compact if one of the following is true:1. Every locust in X has clockwise heading and for every locust X i ∈ X , i < | X | , there is a locust X j ∈ X such that dist c ( X i , X j ) ≤ .2. Every locust in X has counterclockwise heading and for every locust X i ∈ X , i < | X | , there is a locust X j ∈ X such that dist cc ( X i , X j ) ≤ . Definition 13.
Let X = { X , X , . . . X j } and Y = { Y , Y , . . . Y k } be two compact sets, such that the locustsof X have clockwise heading and the locusts of Y have counterclockwise heading. X and Y are in deadlock if dist c ( X j , Y k ) = 1 . (See Figure 4) A compact set of locusts X is essentially a platoon of locusts all on the same track which are headingin one direction, and are all jammed together with at most one empty space between each consecutive pair.As long as X remains compact, no new locusts can enter the track between any two locusts of X , becausethe model states that locusts do not move vertically into empty locations to which a locust is attemptingto move horizontally, and the locusts in a compact set are always attempting to move horizontally to theempty location in front of them. Fig. 4:
Two segments in deadlock, colored green and red.
Definition 14.
A maximal compact set is a set X such that for any locust A / ∈ X , X ∪ A is not compact. A straightforward observation is that locusts can only belong to one maximal compact set:
Observation 15
Let A be a locust. If X and Y are maximal compact sets containing A , then X = Y . Lemma 16
Let X and Y be two sets of locusts in deadlock at the beginning of time t . Then at everysubsequent time step, the locusts in X ∪ Y can be separated into sets X (cid:48) and Y (cid:48) that are in deadlock, or thelocusts in X ∪ Y all have identical heading. Proof.
Let X = { X , X , . . . X j } and Y = { Y , Y , . . . Y k } be compact sets such that X i +1 = X → i , Y i +1 = Y → i . It suffices to show that if X and Y are in deadlock at (the beginning of) time t , they will remain thatway at time t + 1, unless X ∪ Y ’s locusts have identical heading. Let us assume without loss of generality(“w.l.o.g.”) that X has clockwise heading, and therefore Y has counterclockwise heading. By the definitionof deadlock, at time t , X j and Y k conflict, and the locust that loses joins the other set. Suppose w.l.o.g. that X j is the locust that lost. If | X | = 1, then the locusts all have identical heading, and we are done. Otherwise,set X (cid:48) = { X , . . . X j − } and Y (cid:48) = { Y , Y , . . . Y k , X j } . Note that since X and Y are compact at time t , nolocust could have moved vertically into the empty spaces between pairs of locusts in X ∪ Y . Furthermore thelocusts of X and Y all march towards X j and Y k respectively, hence the distance between any consecutivepair X i , X i +1 or Y i , Y i +1 could not have increased. Thus X (cid:48) and Y (cid:48) are compact.To show that X (cid:48) and Y (cid:48) are deadlocked at time t + 1, we need just to show that dist c ( X j − , X j ) is 1 attime t + 1. Since the distances do not increase, if dist c ( X j − , X j ) was 1 at time t , we are done. Otherwise dist c ( X j − , X j ) = 2 at time t , and since X j did not move (it was in a conflict with Y k ), X j − decreased thedistance in the last time step, hence it is now 1. (cid:117)(cid:116) Lemma 17
Suppose P and Q are the only segments on track K at time t , and P ’s locusts have clockwiseheading. Let d = dist c ( P , Q ) . After at most 3d time steps, P ( t + (cid:98) d (cid:99) ) and Q ( t + (cid:98) d (cid:99) ) are in deadlock,or the track is stable.Proof. The track K is consists of the locations of the form ( x, y ) for some fixed y and 1 ≤ x ≤ n . Forbrevity, in this proof we will denote the location ( x, y ) simply by its horizontal coordinate, i.e., x , by writing( x ) = ( x, y ).We may assume w.l.o.g. that t = 0, and that P is initially at (0). Note that this means Q is at ( d ) attime 0. If at any time t ≤ d , the track is stable, then we are done, so we assume for contradiction that thisis not the case. This means that P and Q do not change their headings before time 3d. This being the case,we get that dist c ( P , Q ) is non-increasing before time 3d. As the segments P ( t ) and Q ( t ) move towardseach other at every time step t ≤ d , we can consider only the interval of locations [0 , d ], i.e., the locations(0) , (1) , . . . ( d ). We then define the distance dist ( · , · ) between two locusts in this interval whose x -coordinatesare x and x as | x − x | .At any time t ≤ d , we may partition the locusts in [0 , d ] into maximal compact sets of locusts. Thispartition is unique, by Observation 15. Let us label the maximal compact sets of locusts that belong to P ( t )as C t , C t , . . . C tc t , where the segments are indexed from 1 to c t , sorted by increasing x coordinates, such that C t contains the locusts closest to (0). Analogously, we label the maximal compact sets that belong to Q ( t ) as W t , W t , . . . W tw t , with indices running from 1 to w t , sorted by decreasing x -coordinates such that W t containsthe locusts that are closest to ( d ) (see Figure 5). In this proof, the distance between two sets of locusts X, Y ,denoted dist ( X, Y ), is defined simply as the minimal distance between two locusts A ∈ X, B ∈ Y . Our proofwill utilise the functions: L ( t ) = c t − (cid:88) i =1 dist ( C ti , C ti +1 ) , L ( t ) = w t − (cid:88) i =1 dist ( W ti , W ti +1 ) L ( t ) = dist ( C tc t , W tw t ) , L ( t ) = L ( t ) + L ( t ) + L ( t ) (1) L ( t ) is the sum of distances between consecutive clockwise-facing sets in the partition at time t . L ( t ) isthe sum of distances between the counterclockwise sets. L ( t ) is the distance between the two closest clockwiseand counterclockwise facing sets. The function L ( t ) is the sum of distances between consecutive compactsets in the partition. When L (0) = 1, there is necessarily only one clockwise and one counterclockwise facingset in the partition, which must equal to P ( t ) and Q ( t ) respectively. Furthermore, L ( t ) = 1 implies that thedistance between P ( t ) and Q ( t ) is 1. Hence when L ( t ) = 1, P ( t ) and Q ( t ) are both in deadlock. The converseis true as well, hence L ( t ) = 1 if and only if P ( t ) , Q ( t ) are in deadlock. We will use L ( t ) as a potential or“Lyapunov” function [22] and show it must decrease to 1 within 3d time steps. By Lemma 16, once P and Q are in deadlock they will remain in deadlock until one of them is eliminated, which completes the proof.Let us denote by max ( X ) the locust with maximum x -coordinate in X , and by min ( X ) the locust withminimal x -coordinate. We may also use max ( X ) and min ( X ) to denote the x coordinate of said locust. Notethat dist ( C ti , C ti +1 ) is the distance between max ( C ti ) and min ( C ti +1 ). Discrete Model of Collective Marching on Rings 11
Fig. 5:
A partition into maximal compact subsets as in our construction. In this configuration, L ( t ) = 3, L ( t ) = 3, L ( t ) = 0, and L ( t ) = 6. Recall that in the locust model, every time step is divided into a phase where locusts move horizontally(on their respective tracks), and a phase where they move vertically. First, let us show that the sum ofdistances L ( t ) does not increase due to changes in either the horizontal or vertical phase. Since L ( t ) isthe sum of distances between compact partition sets whose locusts move clockwise, and for all C ti exceptperhaps C tc t , max ( C ti ) always moves clockwise, the distance dist ( C ti , C ti +1 ) does not increase as a result oflocust movements (note that clockwise movements of max ( C ti ) do not result in a new compact set becausethe rest of the locusts in C ti follow it). Furthermore, since conflicts cannot result in a new maximal compactset in the partition, conflicts do not increase L ( t ). Hence, L ( t ) does not increase in the horizontal phase. Inthe vertical phase, clockwise-heading locusts entering the track either create a new set in the partition, whichdoes not affect the sum of distances (as they then merely form a “mid-point” between two other maximalcompact sets), or they join an existing compact set, which can only decrease L ( t ). By the locust model, theonly locusts that can move tracks are max ( C tc t ) and min ( W tw t ), since these are the only locusts for whichthe condition b ( A ) (cid:54) = b ( A → ) is true, so locusts moving tracks cannot affect L ( t ) either. In conclusion, L ( t )is non-increasing at any time step. By analogy, L ( t ) is non-increasing.Similar to L and L , the distance L ( t ) can cannot increase as a result of locusts entering the track.It can increase as a result of a locust conflict which eliminates either W tw t or C tc t , but such an increase iscompensated for by a comparable decrease in either L ( t ) or L ( t ). It is also simple to check that, since P ( t )and Q ( t ) are always moving towards each other when they are not in deadlock, there will be at least twocompact sets in the partition that decrease their distance to each other, hence L , L or L must decreaseby at least 1 in the horizontal phase. Hence, we conclude that L ( t ) decreases by at least 1 in every time stepwhere L ( t ) (cid:54) = 1 and no locusts in K move to another track.What happens when they do move to another track? As proven, L ( t ) and L ( t ) do not increase. However,the distance L ( t ) will increase, since the only locusts that can move tracks are max ( C tw t ) and min ( W tc t ). Itis straightforward to check that when C tc t contains more than one locust, L ( t ) will increase by at most 2 asa result of max ( C tw t ) moving tracks. When C tc t contains exactly one locust, L ( t ) can increase significantly(as L ( t ) then becomes the distance between C tc t − and W w t ), but any increase is matched by the decreasein L ( t ) as a result of C tc t being eliminated. Analogous statement hold for W tw t , and hence L ( t ) can increaseby at most 2 as a result of one locust moving out of the track. We need to bound, then, the number of locustsin K that move tracks before time 3 d . We define the potential function F ( t ): F ( t ) = c t − (cid:88) i =1 ( dist ( C ti , C ti +1 ) −
1) + w t − (cid:88) i =1 ( dist ( W ti , W ti +1 ) −
1) + | P ( t ) ∪ Q ( t ) | == L ( t ) + L ( t ) − c t − w t + | P ( t ) ∪ Q ( t ) | (2) F ( t ) is the sum of the empty locations between consecutive compact sets in the partition whose locustshave the same heading, plus the number of locusts in K . Note that F ( t ) ≥ t . We will show F ( t ) is non-increasing, and that it decreases whenever a locust leaves the track. Hence, at most F (0) locustscan leave the track.Let us show that F ( t ) is non-increasing. We already know L and L are non-increasing. In the horizontalphase, | P ( t ) ∪ Q ( t ) | is of course unaffected. c t and w t can decrease as a result of maximal compact sets merging,hence increasing F , but this can only happen when the distance between two such sets has decreased, hencethe resulting increase to F is undone by a decrease in L and L . Hence, F ( t ) does not increase because oflocusts’ actions during the horizontal phase.Likewise, locusts moving from K can decrease c t or w t when they cause a maximal compact set to beeliminated, but this is matched by a comparable decrease in L or L which means that F does not increase due to locusts moving out of the track. Furthermore, | P ( t ) ∪ Q ( t ) | decreases when this happens. Hence, alocust moving out of the track decreases F ( t ) by at least 1. Finally, let us show that locusts entering thetrack does not increase F ( t ).At time t , locusts can only enter the track in empty locations that are found in intervals of the form[ max ( W ti ) , min ( W ti +1 )] or [ max ( C ti +1 ) , min ( C ti )] for some i . In particular, locusts cannot enter empty loca-tions that are between two locusts belonging to the same compact set (because a locust in that set will alwaysbe attempting to move to that location in the next time step, and the model disallows vertical movementsto such locations), nor can they enter the track on the empty locations between min ( C tc t ) and max ( W tw t ).Thus, locusts entering the track at time t decrease the amount of empty locations between two clockwise orcounterclockwise compact partition sets, hence decreasing L ( t ) − c t or L ( t ) − w t . A locust entering K mightresult in two compact sets merging, hence decreasing c t or w t which increases F , but since there are alwaysat least two empty locations between compact partition sets with the same heading, this can only happenif two empty locations are eliminated, hence on net F decreases. Finally, a new locust entering increases | P ( t ) ∪ Q ( t ) | by 1. On net, we see that new locusts entering K either decreases or does not affect F .In conclusion, F ( t ) is non-increasing, and any time a locust moves to another track, F ( t ) decreases by 1.Thus, at most F (0) locusts can move from K to another track. Recall that locusts moving out of the trackcan increase L ( t ) by at most 2. Hence after at most L (0) + 2 F (0) ≤ d + 2 d = 3 d time steps, L ( t ) = 1. (cid:117)(cid:116) Lemma 18
Let seg ( t ) denote the set of segments in all tracks at time t . At time t +3 n , either every segmentis in deadlock with some other segment, or | seg ( t + 3 n ) | < | seg ( t ) | .Proof. Consider some track K and a segment P which is in that track at time t . Let us assume that | seg ( t + 3 n ) | = | seg ( t ) | , and show that P ( t + 3 n ) must be in deadlock with another segment. At any time t (cid:48) ≥ t , as long as the number of segments on K does not decrease, the locusts of P ( t (cid:48) ) will be marchingtowards locusts of another segment, which we will label Q ( t (cid:48) ). They cannot collide or conflict with locustsbelonging to any segment other than Q ( t (cid:48) ). Hence, other segments in K do not affect the evolution of P ( t )and Q ( t ) before time t + 3 n , and we can assume w.l.o.g. that P ( t ) and Q ( t ) are the only segments in K at time t . Let d be as in the statement of Lemma 17. Since n ≥ d , Lemma 17 tells us that at some time t ≤ t ∗ ≤ t + 3 n , P ( t ∗ ) and Q ( t ∗ ) must be in deadlock. Since by Lemma 16, P and Q must remain in deadlockuntil one of them is eliminated, we see that at time t + 3 n they must still be in deadlock, since we assumed | seg ( t ) | = | seg ( t + 3 n ) | . (cid:117)(cid:116) Theorem 19 E [ T stable ] ≤ mn + π m = O ( mn + m ) Proof.
Let | seg ( t ) | denote the number of segments at time t . E [ T stable ] can be computed as the sum of times E [ T + T + . . . + T | seg (0) | ], where T i is the expected time until the number of segments drops below i , if itis currently i (we increment the index by 2 since segments are necessarily eliminated in pairs).Let us estimate E [ T i ]. Suppose that at time t , the number of segments is 2 i . Then after 3 n steps at most,either the number of segments has decreased, or all segments are in deadlock. There are in total i pairs ofsegments in deadlock, and as there are m locusts, there must be a pair P ( t + 3 n ) , Q ( t + 3 n ) that contains atmost m/i locusts. By Lemma 16, P ( t + 3 n ) , Q ( t + 3 n ) remain in deadlock until either P or Q is eliminated.We can compute precisely how long this takes, since at every time step after time t + 3 n , the heads of P and Q conflict, resulting in one of the segments increasing in size and the other decreasing. Hence, the expectedtime it takes P or Q to be eliminated is precisely the expected time it takes a symmetric random walkstarting at 0 to reach either | P ( t + 3 n ) | or −| Q ( t + 3 n ) | , which is | P ( t + 3 n ) | · | Q ( t + 3 n ) | ≤ ( m i ) . Hence, E [ T i ] ≤ n + ( m i ) . Consequently: E [ T + T + . . . + T | seg (0) | ] ≤ n · | seg (0) | ∞ (cid:88) i =1 ( m i ) ≤ nm + π m (3)Where we used the inequality | seg (0) | ≤ m/ (cid:80) ∞ i =1 ( i ) = π . (cid:117)(cid:116) Next we will prove the bound E [ T stable ] = O (log( k ) n ). For this, we require the following result: Lemma 20
Consider k independent random walks with absorbing barriers at and n , i.e., random walksthat end once they reach or n . The expected time until all k walks end is O ( n log( k )) . Discrete Model of Collective Marching on Rings 13
Proof.
First, let us set k = 1 and estimate the probability that the one walk has not ended by time t . Let P be the transition probability matrix of the random walk, and let v be the vector describing the initialprobability distribution of the location of the random walker. Then v P t is the probability distribution ofits location after t time steps [24]. The evolution of v P t is well-studied and relates to “the discrete heatequation” [23]. The probability that the walk has not ended at time t is the sum (cid:80) n − i =1 v ( i ). Asymptotically,this sum is bounded by O ( λ t ) where λ = cos ( π n ) is the 2nd largest eigenvalue of P (cf. [23]).Returning to general k , let T k be a random variable denoting the time when all k walks end. By lookingat the series expansion of cos (1 /x ), we may verify that for n > cos ( π n ) < − n . From the previousparagraph, and because the walks are independent, we therefore see that P r ( T k ≥ t ) = 1 − P r ( T < t ) k = 1 − (cid:0) − O ( λ t ) (cid:1) k = 1 − (cid:0) − O ((1 − n ) t ) (cid:1) k (4)Consequently, for t (cid:29) n , the following asymptotics hold for some constant C : P r ( T k ≥ t ) < − (1 − Ce − t/n ) k (5)Where we used the fact that (1 + x/n ) n → e x as n → ∞ . Note that P r ( T k ≥ t + n log( C )) < − (1 − e − t/n ) k . Hence: E [ T k ] = (cid:90) ∞ P r ( T k > t ) dt ≤ n log( C ) + (cid:90) ∞ − (1 − e − t/n ) k dt == n log( C ) + (cid:90) ∞ − k (cid:88) j =0 (cid:18) kj (cid:19) ( − j e − tj/n dt = n log( C ) + − k (cid:88) j =1 (cid:18) kj (cid:19) ( − j (cid:90) ∞ e − tj/n dt == n log( C ) + − n k (cid:88) j =1 (cid:18) kj (cid:19) ( − j j = O ( n log( k )) (6)Where we used the equality (cid:80) kj =1 (cid:0) kj (cid:1) ( − j j = − H k , H k being the k th harmonic number. (cid:117)(cid:116) Theorem 21 E [ T stable ] = O (log( k ) · n ) Proof.
Let seg i ( t ) denote the number of segments in track i at time t , and define M t = max ≤ i ≤ k seg i ( t ).Let us bound the expect time it takes for M t to decrease. Define the set K ( t ) to be all tracks that have |M t | segments at time t . Then M t decreases at the first time t (cid:48) > t when all tracks in K ( t ) have had their numberof segments decrease. We may bound this with the following argument: by Lemma 18, if M t doesn’t decreaseafter 3 n time steps (i.e., M t = M t +3 n ), all tracks in K ( t + 3 n ) now have all their segments in deadlock. Thenumber of deadlocked segment pairs at every track in K ( t + 3 n ) is M t /
2, so in every such track there issuch a pair with at most 2 n/ M t locusts. By Lemma 20, using similar reasoning to Theorem 19, these pairsof deadlocked segments resolve into a single segment after at most c · log( k ) (cid:0) nM t (cid:1) time for some constant c .Hence, the number of expected time steps for M t to decrease is bounded above by 3 n + c log( k ) (cid:0) nM t (cid:1) . T stable is the first time when M t = 0. Let us assume n is even for simplicity (the computation will holdregardless, up to rounding). Then the maximum possible number of segments at time t = 0 is n , and M t decreases in jumps of 2 or more (since segments can only be eliminated in pairs). Hence, T stable is bounded bythe amount of time it takes M t to decrease at most n/ n + c log( k ) (cid:0) nM t (cid:1) over M t = n, n − , n − , . . . E [ T stable ] ≤ n · n + c log( k ) (cid:0) nn (cid:1) + c log( k ) (cid:0) nn − (cid:1) + . . . + c log( k ) (cid:0) n (cid:1) ≤≤ n + 4 c log( k ) n ∞ (cid:88) i =1 ( 12 i ) = 32 n + π c log( k ) n = O (log( k ) n ) (7)As claimed. (cid:117)(cid:116) The proof of Theorem 10 follows immediately from Theorems 19 and 21, by taking the minimum. (cid:117)(cid:116)
Erratic track switching and global consensus
Theorem 10 shows that, in finite expected time, alllocusts on a given track have identical heading. This is a stable local consensus, in the sense that twodifferent tracks may have locusts marching in opposite directions forever. We might ask what modificationsto the model would force a global consensus, i.e., make it so that stabilization occurs only when all locustsacross all tracks have identical heading. There is in fact a simple change that would force this to occur: letus assume that any locust, with some probability p ∈ (0 , T stable . Westudy the question of how p affects T stable empirically in the next section. Theorem 22
Assuming there is at least one empty space (i.e., m < nk ), and the probability of erratic trackswitching is < p < , the locusts all have identical heading in finite expected time.Proof. Our goal is to show that all locusts must have identical heading in finite expected time. We will finda crude upper bound for this time. It suffices to show that as long as there are two locusts with differentheadings in the system (perhaps not on the same track), there is a bounded-above-0 probability q thatwithin a some constant, finite number of time steps C (we will show C = O (log( k ) n + nk )), the numberof locusts with clockwise heading will increase. This amounts to showing that there is a sequence of events,each individual event happening with non-zero probability, that culminates in a conflict between two locustsoccurring (since any conflict has probability 0 . q > m · C time steps; thiscompletes the proof.Let us show such a sequence of events. First let us consider the case where there is a track in whichtwo locusts have non-identical headings. In this case, assuming no locusts behave erratically for O (log( k ) n )steps (which occurs with a tiny but bounded-above-0 probability p O (log( k ) n m ) > O (log( k ) n ) steps, locusts on the same track will have identical heading. Hence, there is asequence of events that happens with non-zero probability which leads to local consensus in the tracks.Then let us assume that all tracks are in local consensus. The only thing that causes locusts in localconsensus to move tracks is erratic behaviour. If two adjacent tracks have locusts with non-identical heading,and there is at least one empty space in one of them, then within at most n time steps an empty space willbe vertically adjacent to a locust in the other track, at which point, with probability p , a locust will movefrom one track to the other. This creates a situation where in one track there are locusts of different headingsagain. If the erratic locust moves tracks at the right time, upon moving it will be adjacent to another locustin its new track, whose heading is different. Hence, the erratic locust will enter a conflict in the next timestep, which will increase the number of clockwise locusts with probability 0 . some track, erraticbehaviour can cause that empty location to move vertically in an arbitrary fashion until, after at most k movements, it enters a track from the pair. With non-zero probability, this can take at most nk time steps,after which we are reduced to the situation in the previous paragraph.A pair of adjacent tracks that have locusts with different headings must exist unless there is globalconsensus. Hence, in every O (log( k ) n + nk ) time steps where there is no global consensus, there is a someprobability q > (cid:117)(cid:116) Let us explore some questions about the expected value of T stable through numerical simulations. Certainaspects of the locusts’ dynamics were not studied in our formal analysis: the most interesting of which is the Discrete Model of Collective Marching on Rings 15
Fig. 6:
Simulations of the locust model. The y axis is T stable . Column (a) measures T stable for k = 1 ...
30, with n fixedat 30. Column (b) measures T stable for n = 1 ...
60, with k fixed at 5. Column (c) measures T stable with n = 30 , k = 5,and p (the probability of erratic behaviour) going from 0 to 1. The top row measures T stable for a sparse locustconfiguration, while the bottom row does so for a dense configuration. The dashed line estimates T stable when locustsnever switch tracks (except while behaving erratically in column c); the blue line estimates T stable when locusts switchtracks as often as the model rules allow. helpful effects of track switching on T stable . Recall that our model allows locusts to switch tracks if this wouldenable them to avoid a conflict and join a track where locally , locusts are marching in their same direction.At least in principle, this seems like it should help our locusts achieve local stability faster, hence decrease T stable . However, recall also that we do not specify when locusts switch tracks, which means that some locustsmight never switch tracks, or they might choose to do so in the worst possible moments. Hence, the positiveeffect track-switching usually has on T stable cannot be reflected in the bounds we found for E [ T stable ], sincethese bounds must reflect all possible locust behaviours. Under ordinary circumstances, however, it seemsas though frequent track switching should noticeably decrease the time to local stabilization. As we shall seenumerically, this is indeed the case. This justifies the track-switching behaviour as a mechanism that, despitebeing highly local, enables the locusts to come to local consensus about the direction of motion sooner.In Figure 6, (a) and (b), we measure T stable as it varies with n and k . We simulate two different locustconfigurations: a “dense” configuration, and a “sparse” configuration. In the dense configuration, 50% oflocations are initiated with a locust, with the locations chosen at random. In the sparse configuration, 10%of locations are initiated with a locust (or slightly more, to guarantee all tracks start with 2 locusts). Thelocusts are initiated with random heading. We measure the effect of track switching on T stable : the opaquelines measure T stable when locusts switch tracks as often as they can (while still obeying the rules of themodel), and the dotted lines measure T stable when locusts never switch tracks. For every value of n , k , weran the simulation 1000 to 3000 times and averaged T stable over all simulations.As we can see, in the sparse configuration, track-switching has a significantly positive effect on time tostabilization. For example, with k = 30, n = 30, T stable is approximately 13 . p of erratic behaviour affects T stable . As weproved in the previous section, whenever p >
0, stabilization requires global rather than local consensus.Hence, we cannot directly compare the T stable of these graphs with columns (a) and (b), where T stable measures the time to local consensus. We see that E [ T stable ] approaches ∞ as p goes to 0, as one wouldexpect, since when p = 0, global stability can never occur in some initial configurations. E [ T stable ] decreasessharply as p goes to some critical point around 0 .
1, and decreases much more slowly afterwards. It isinteresting to note that low probability of erratic behaviour affects E [ T stable ] significantly more in the sparse configuration, where for p = 0 .
02, if locusts also switch tracks whenever the model allows them, E [ T stable ]was measured as being approximately 1974, as opposed to 669 in the dense configuration. One of the corereasons for this seems to be that, in the sparse configuration, when a locust erratically moves to a track witha lot of locusts not sharing its heading, it will often be able to non-erratically move back to its former track,thus preventing locust interactions between tracks of different headings. When we increase p , the sparseconfiguration begins to stabilize faster than the dense configuration. When we disabled the locusts’ abilityto switch tracks non-erratically, T stable was significantly smaller in the sparse configuration ( E [ T stable ] ≈ p = 0 . We studied convergence to collective motion in a model of discrete locust-inspired swarms, and bounded theexpected time to stabilization in terms of the number of agents m , the number of tracks k , and the length ofthe tracks n . We showed that when the swarm stabilizes, we reach a local consensus regarding the directionof motion. We also showed that, when the model is extended to allow a small probability of erratic behaviourto perturb the system, global consensus eventually occurs.A direct continuation of our work would be to find upper bounds on time to stabilization when thereis some probability of erratic behaviour. Furthermore, our empirical simulations suggest several curiousphenomena related to erratic behaviour: first, there seems to be a clash between “erratic” and non-erratic,“rational” track-switching, as when locusts switch tracks non-erratically in order to avoid collisions, thisseems to accelerate the attainment of local consensus, but mostly hinder the attainment of global consensus.Second, increasing the probability of erratic track-switching p behaviour was helpful in accelerating globalconsensus up to a point, but in simulations, its impact seemed to fall off past a small critical value of p . Infuture work, it would be interesting to investigate these aspects of the model.Although our dynamics model is inspired by experiments on locusts, it is better understood in moregeneral and abstract terms as a model that describes a situation where many agents that wish to maintaina direction of motion are confined to a small space where they exert pressure on each other. It is naturalto ask what kinds of collective marching, if any, we should expect when this small space has a differenttopology; rather than a ringlike arena, we might consider, e.g., a square arena. We believe that rich modelsof swarm dynamics can be discovered through observing natural organisms exert pressure on each other insuch environments. In the introduction, we mentioned points of similarity between our model and models ofopinion dynamics. We suspect that these points of similarity will remain in settings with non-ringlike arenas,and might provide a starting point for formally modelling and analysing them. Whether or not this is thecase, we believe that a more universal understanding of what happens when agents in small spaces exertpressure is an important topic that has implications on our ability to predict the outcome of and designeffective swarming algorithms for multi-robot systems placed in such situations. We would like to thank Amir Ayali of Tel Aviv University for bringing our attention to the experiments onlocusts and for graciously letting us use the image in Figure 1. We also thank Ofer Zeitouni of the WeizmannInstitute of Science for helpful discussions.
References
1. David Aldous and James Fill. Reversible markov chains and random walks on graphs, 1995.2. Yaniv Altshuler, Alex Pentland, and Alfred M Bruckstein. Introduction to swarm search. In
Swarms and NetworkIntelligence in Search , pages 1–14. Springer, 2018. Discrete Model of Collective Marching on Rings 173. Guy Amichay, Gil Ariel, and Amir Ayali. The effect of changing topography on the coordinated marching oflocust nymphs.
PeerJ , 4:e2742, December 2016.4. Michael Amir and Alfred M Bruckstein. Probabilistic pursuits on graphs.
Theoretical Computer Science , 2019.5. Gil Ariel and Amir Ayali. Locust collective motion and its modeling.
PLOS Computational Biology ,11(12):e1004522, December 2015.6. Ariel Barel, Rotem Manor, and Alfred M Bruckstein. Come together: Multi-agent geometric consensus. arXivpreprint arXiv:1902.01455 , 2017.7. Alfred M. Bruckstein. Why the ant trails look so straight and nice.
The Mathematical Intelligencer , 15(2):59–62,1993.8. Anjan Kumar Chandra and Abhik Basu. Diffusion controlled model of opinion dynamics.
Reports in Advancesof Physical Sciences , 1(01):1740008, 2017.9. Hugues Chat´e, Francesco Ginelli, Guillaume Gr´egoire, Fernando Peruani, and Franck Raynaud. Modeling collec-tive motion: variations on the vicsek model.
The European Physical Journal B , 64(3):451–456, 2008.10. Bernard Chazelle. Natural algorithms and influence systems.
Communications of the ACM , 55(12):101–110,2012.11. Bernard Chazelle. Toward a theory of markov influence systems and their renormalization. arXiv preprintarXiv:1802.01208 , 2018.12. T Chou, K Mallick, and RKP Zia. Non-equilibrium statistical mechanics: from a paradigmatic model to biologicaltransport.
Reports on progress in physics , 74(11):116601, 2011.13. Jorge Cort´es. Distributed algorithms for reaching consensus on general functions.
Automatica , 44(3):726–737,2008.14. Andr´as Czir´ok, M´aria Vicsek, and Tam´as Vicsek. Collective motion of organisms in three dimensions.
PhysicaA: Statistical Mechanics and its Applications , 264(1-2):299–304, 1999.15. Yucheng Dong, Min Zhan, Gang Kou, Zhaogang Ding, and Haiming Liang. A survey on the fusion process inopinion dynamics.
Information Fusion , 43:57–65, 2018.16. Richard A Epstein.
The theory of gambling and statistical logic . Academic Press, 2012.17. Natalie Fridman and Gal A. Kaminka. Modeling pedestrian crowd behavior based on a cognitive model of socialcomparison theory.
Computational and Mathematical Organization Theory , 16(4):348–372, November 2010.18. Simon Garnier, Maud Combe, Christian Jost, and Guy Theraulaz. Do ants need to estimate the geometricalproperties of trail bifurcations to find an efficient route? a swarm robotics test bed.
PLoS Computational Biology ,9(3):e1002903, 2013.19. Charles Miller Grinstead and James Laurie Snell.
Introduction to probability . American Mathematical Soc., 2012.20. Peter Hegarty, Anders Martinsson, and Edvin Wedin. The hegselmann-krause dynamics on the circle converge.
Journal of Difference Equations and Applications , 22(11):1720–1731, 2016.21. Thomas Kriecherbauer and Joachim Krug. A pedestrian’s view on interacting particle systems, kpz universalityand random matrices.
Journal of Physics A: Mathematical and Theoretical , 43(40):403001, 2010.22. Joseph La Salle and Solomon Lefschetz.
Stability by Liapunov’s Direct Method with Applications . Elsevier, 2012.23. Gregory F Lawler.
Random walk and the heat equation , volume 55. American Mathematical Soc., 2010.24. David Asher Levin, Yuval Peres, and Elizabeth Lee Wilmer.
Markov chains and mixing times . American Math-ematical Society, 2009.25. Torgny Lindvall.
Lectures on the coupling method . Courier Corporation, 2002.26. Rotem Manor and Alfred M Bruckstein. Chase your farthest neighbour. In
Distributed Autonomous RoboticSystems , pages 103–116. Springer, 2018.27. Reza Olfati-Saber, J Alex Fax, and Richard M Murray. Consensus and cooperation in networked multi-agentsystems.
Proceedings of the IEEE , 95(1):215–233, 2007.28. Katja Ried, Thomas M¨uller, and Hans J Briegel. Modelling collective motion based on the principle of agency:General framework and the case of marching locusts.
PloS one , 14(2):e0212044, 2019.29. Masashi Shiraishi and Yoji Aizawa. Collective patterns of swarm dynamics and the lyapunov analysis of individualbehaviors.