{'fraction_non_alphanumeric': 0.03332228616191136, 'fraction_numerical': 0.009678828598113946, 'mean_word_length': 4.252611172653901, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Foraging in Particle Systems via Self-Induced Phase Changes

The foraging problem asks how a collective of particles with limited computational, communication and movement capabilities can autonomously compress around a food source and disperse when the food is depleted or shifted, which may occur at arbitrary times. We would like the particles to iteratively self-organize, using only local interactions, to correctly gather whenever a food particle remains in a position long enough and search if no food particle has existed recently. Unlike previous approaches, these search and gather phases should be self-induced so as to be indefinitely repeatable as the food evolves, with microscopic changes to the food triggering macroscopic, system-wide phase transitions. We present a stochastic foraging algorithm based on a phase change in the fixed magnetization Ising model from statistical physics: Our algorithm is the first to leverage self-induced phase changes as an algorithmic tool. A key component of our algorithm is a careful token passing mechanism ensuring a dispersion broadcast wave will always outpace a compression wave. We also present a highly structured alternative algorithm that gathers by incrementally building a spiral tightly wrapped around the food particle.


Introduction
Collective behavior of interacting agents is a fundamental, nearly ubiquitous phenomenon across fields, reliably producing rich and complex coordination. Examples at the micro-and nano-scales include coordinating cells (including our own immune system or self-repairing tissue and bacterial colonies), micro-scale swarm robotics, and interacting particle systems in physics; at the macro scale it can represent flocks of birds, coordination of drones, and societal dynamics such as segregation [28]. Common properties of these disparate systems is that they 1) respond to simple environmental conditions and 2) many undergo phase changes as parameters of the systems are slowly modified, allowing collectives to gracefully toggle between two often dramatically different macroscopic states. Insights from statistical physics, discrete probability, and computer science already have been useful for rigorously describing limiting behavior of large systems undergoing such phase changes in a surprising variety of contexts, including chemistry [22], biology [1], economics [5], swarm robotics [17], and physics [20]. Here, we seek to understand how to design distributed algorithms for collective coordination, such as foraging, by algorithmically inducing phase changes in interacting systems, where the desired macrostate is driven by some small, local environmental signal such as the presence or absence and location of a dynamically changing food source.
Self-organizing collective behaviors are found throughout nature, e.g., shoals of fish aggregating to intimidate predators [21], fire ants forming rafts to survive floods [23], and bacteria forming biofilms to share nutrients when metabolically stressed [18,25]. Inspired by such systems, researchers in swarm robotics and active matter have used many approaches towards enabling ensembles of simple, independent units to cooperatively accomplish complex tasks [26]. Current approaches present inherent tradeoffs, especially as individual robots become smaller and have limited functional capabilities [32] or approach the thermodynamic limits of computing [31] and power [9].
Programmable matter was coined by Toffoli and Margolus in 1991 to realize a physical computing medium composed of simple, homogeneous entities that is scalable, versatile, instantly reconfigurable, safe to handle, and robust to failures [30]. There are formidable challenges to realizing programmable matter computationally and many researchers in distributed computing and swarm and modular robotics have investigated how such small, simply programmed entities can coordinate to solve complex tasks and exhibit useful emergent collective behavior. A more ambitious goal is to design programmable matter systems of self-actuated individuals that autonomously respond to their environment.
To better understand how to model such collective behaviors, the work in [7, 6, 2, 17], among others, uses self-organizing particle systems (or SOPS) that allows us to define a formal distributed algorithm and rigorously quantify long-term behavior. Particles in a SOPS exist on the vertices (or nodes) of a lattice, with at most one particle per vertex, and move between vertices along lattice edges. Each particle is anonymous (unlabeled), interacts only with particles on adjacent lattice vertices, has limited (normally assumed to be constant-size) memory, and does not have access to any global information such as a coordinate system or the total number of particles. Recently, particle systems that leverage phase transitions in basic physical systems have proven fruitful for driving basic programmable matter systems to accomplish simple tasks, but these tend not to be self-induced or adaptable depending on the current need. As an example, a problem of interest is dynamic free aggregation, where particles gather together without preference for a specific aggregation site (see Section 3.2.1 of [4]), and dispersion, its inverse, have been widely studied, but without much effort toward understanding the underlying distributed computational models or the formal algorithmic underpinnings of interacting particles. Many studies in self-actuated systems take inspiration from emergent behavior in social insects, but either lack rigorous mathematical foundations explaining the generality and limitations as sizes scale (see, e.g., [15,14,8]) or rely on long-range signaling, such as microphones or line-of-sight sensors [29,12,13,24]. Cannon et al. [7] designed a distributed Markov chain algorithm for dynamic free aggregation in the connected setting, referred to as compression, where a connected SOPS wants to cluster in a configuration of small perimeter while maintaining connectivity at all times. Building on a variant of the Ising model from statistical physics, the authors rigorously proved that by adding a ferromagnetic attraction λ between particles suffices to stochastically lead the particles in a SOPS to α-compressed configurations, where the constant α > 1 determines an upper bound on the ratio of the configuration perimeter by the minimum possible system perimeter. The Markov chain is defined so that each configuration σ appears with probability π(σ) = λ |E(σ)| /Z at stationarity, where |E(σ)| is the number of edges in σ and Z is the normalizing constant. It is rigorously shown that the SOPS will reach an α-compressed configuration at stationarity, for some constant α > 1, if the attraction force λ is strong enough and not if the attraction is sufficiently small. Moreover, it is also shown that when the attraction forces are small, the configurations will nearly maximize their perimeter and achieve expansion. Additional algorithms based on this approach, which also exhibit similar phase changes, found applications to the separation problem [6], where colored particles would like to separate into clusters of same color particles, aggregation [17] where the system would like to compress but no longer needs to remain connected, shortcut bridging [2], locomotion [27], alignment [16] and transport [17].
We are interested in whether such phase changes (or bifurcations) can be self-modulated, whereby a simple parameter governing the system behavior can self-regulate according to environmental cues that are communicated through the collective to induce desirable system-wide behaviors. Our goal here is to self-regulate a system-wide adjustment in the bias parameters when one or more particles notice the presence or depletion of food to induce the appropriate global coordination to provably transition the collective between macro-modes when required.
The Foraging Problem: In the foraging problem, "ants" (i.e., particles) may initially be searching for "food" (i.e., any resource in the environment, e.g., an energy source); once a food source is found, the ants that have learned about the food source start informing other ants, and these transition to a compression state that leads them to start to gather around the food source to consume the food, i.e., to incrementally enter a gather phase; however, once the source is depleted, the ants closer to the depleted source start a broadcast wave, gradually informing other ants that they should restart the search phase again by individually switching to an internal dispersion state. The foraging problem is very general and has several fundamental application domains, including search-and-rescue operations in swarms of nano-or micro-robots; health applications (e.g., a collective of nano-sensors that could search for, identify, and gather around a foreign body to isolate or consume it, then resume searching, etc.); and finding and consuming/deactivating hazards in a nuclear reactor or a minefield.
It is appealing to use the compression/expansion algorithm of [7], where a phase change corresponds to a system-wide change of the bias parameter λ: Small λ, namely λ < 2.17, provably corresponds to expansion mode, which is desirable to search for food, while large λ, namely λ > 2 + √ 2, corresponds to compression (or gather) mode, desirable when food has been discovered. (A similar phase change occurs when the particles are allowed to disconnect, as explained in Section 2, but the notion of compression becomes more complicated.) Our goal is to perform a system-wide adjustment in the bias parameters when one or more particles notice the presence or depletion of food to induce the appropriate global coordination to provably transition the collective between macro-modes when required. Informally, one can imagine individual particles adjusting their λ parameter to be high when they are fed, encouraging compression around the food, and making λ small when they are hungry, promoting the search for more food.

Our Results and Techniques:
We present the first rigorous local distributed algorithms for solving the foraging problem: Adaptive α-Compression, based on the stochastic compression algorithm of [7], and Adaptive Spiraling, which takes a more structured, incremental approach to compression. In both algorithms, there are two main states a particle can be in at any point in time, dispersion or compression, which, at the macro-level, should induce the collective to enter the search or gather phases respectively. Particles in the dispersion state move around in a process akin to a simple exclusion process, where they perform a random walk while avoiding two particles occupying the same site. Particles enter a compression state when food is found and this information is propagated in the system, consequently resulting in the system gathering and compressing around the food.
Adaptive α-Compression uses a variant of the compression algorithm of [7] to function in the case where particles are to compress around a single fixed point (the food particle). While the compression algorithm largely stays the same, the proofs -in particular, the one showing ergodicity of the underlying Markov Chain -are non-trivial and do not follow directly from [7]. Using this modified compression algorithm, we allow the particles to stochastically reassemble into configurations with low perimeter around the food. We prove the following theorem (which follows from Theorems 10 and 11): Theorem 1. Starting from any valid configuration, in the presence of a single food particle that remains static for a sufficient amount of time, our Adaptive α-Compression algorithm will converge to an α-compressed configuration, for any α > 1, connected to the food particle at stationarity with high probability. Conversely, if there are no food particles in the system for a sufficient amount of time, all particles will converge to the dispersion state.
The second, more structured, algorithm for compressing around the food has particles incrementally attach to the end of a spiral that is growing predictably and tightly wrapped around the food source. By marking which particle was the last to join, we can ensure that a minimum perimeter cluster centered at the food source grows incrementally as more particles attach. This idea is simple in principle, although the correct local conditions must be carefully chosen to ensure that the spiral is the only possible structure that forms, and that all other structures that may remain as a food particle is moved around adversarially will dissipate in a timely manner. While this careful spiral construction has the added advantage of leading to a self-stabilizing algorithm -in the sense that it will converge to the desired configuration starting from an arbitrary (potentially corrupted) system configuration -its highly structured, sequential nature slows progress and the method may break down under small perturbations in the environment, such as obstacles and situations where the food location and longevity are dynamic.
We prove the following theorem (which follows from Theorems 20 and 21): Theorem 2. From any starting configuration, in the presence of a single food particle that remains static for a sufficient amount of time, the Adaptive Spiraling Algorithm will reach a configuration where all particles form a single spiral tightly centered at the food particle. Conversely, if no food particles are in the system for a sufficient amount of time, all particles will converge to the dispersion state.
The algorithms in this paper are, to the best of our knowledge, the first to leverage self-induced phase changes as an algorithmic tool. We note that the compression algorithm of Cannon et al. [7] was not shown rigorously to converge in polynomial time, although they give strong experimental evidence that this is the case. All other parts of the α-Compression Algorithm provably run in expected polynomial time, as does Adaptive Spiraling.
For both approaches, the challenge is to share information locally and autonomously so that eventually most particles enter the correct state and the system exhibits the appropriate phase behavior. We rely on token passing for the system to be able to collectively transition between (multiple, possibly overlapping) gather and search phases. In order to ensure that, our token passing scheme needs to be carefully engineered so that when the food particle moves or vanishes, the rate at which the compressed cluster around the food dissipates (via particles returning to the dispersion state) outpaces the rate at which the cluster may continue to grow (via particles joining the cluster in a compression state), ensuring that the broadcast wave of the "dispersion token" will always outpace that of a compression wave. We address this formally and in detail in Sections 3 and 4 .

Model and Preliminaries
We consider an abstraction of a self-organizing particle system (SOPS) on the triangular lattice. More specifically, particles occupy vetices in Λ = Λ N , which is a √ N × √ N piece of the triangular lattice with periodic boundary conditions, where each vertex is occupied by at most one particle. We assume that particles have constant-size memory, and have no global orientation or any other global information beyond a common chirality. Particles communicate by sending tokens to its nearest neighbors (i.e., with particles occupying adjacent vertices in the lattice), where a token is a constant-size piece of information. We are given a singular, stationary food source (which we also refer to as a food particle) that may be placed at any point in space, removed, or shifted around at arbitrary times, possibly adversarially.
Individual particles are activated according to their own Poisson clocks, possibly with different rates, and perform instantaneous actions upon activation. It will be convenient to refer a vertex in Λ according to hypothetical global coordinates (x, y), but note that this is just for ease of exposition, since the particles are not aware of any such global coordinate system. In this convention, a vertex (x, y) ∈ Λ has edges to the vertices corresponding to (x − 1, y − 1), (x − 1, y), (x − 1, y), (x + 1, y), (x, y + 1) ,(x + 1, y + 1), with the arithmetic taken modulo √ N . Particles are aware of their own and their neighbors' current states and when a particle is activated, it may do a bounded amount of computation, send at most one token (not necessarily identical) to each of its neighbors, and choose one of its six neighbors in the lattice to see if it is unoccupied and move there. Note that this model can be viewed as a high level abstraction of the (canonical) Amoebot model [10] under a sequential scheduler, where at most one particle would be active at any point in time. One should be able to port the model and algorithms presented in this paper to the Amoebot model; however a formal description on how this should be done is beyond the scope of this paper.
The compression algorithm of Cannon et al. [7], first defined on the infinite lattice, also works in the finite setting, which is how we present it. We are given a Markov chain (M COM , Ω COM , π COM ), where Ω COM is the set of simply connected configurations with n particles, M COM is the transition matrix giving the probabilities of moves, and π COM is the stationary distribution over Ω COM . A closely related algorithm (M AGG , Ω AGG , π AGG ) relaxes the connectivity requirement and is defined on a finite graph so that the particles can find each other, with Ω AGG corresponding to all assignments of particles to distinct vertices [17], M AGG the transition probabilities that no longer need to maintain connectivity, and π AGG the corresponding stationary distribution. In both cases, for any allowable configurations σ and τ differing by the move of a single particle p along one lattice edge, the transition probability is proportional to min(1, λ n −n ), where λ > 0 is a bias parameter that is an input to the algorithm, n is the number of neighbors of p in σ and n is the number of neighbors of p in τ . These probabilities are defined so that the Markov chain M COM converges to the Boltzmann distribution π COM such that π COM (σ) is proportional to λ E(σ) , where σ ∈ Ω COM and E(σ) is the number of nearest neighbor pairs in configuration σ. Likewise, the Markov chain M AGG converges to π AGG such that π AGG (σ) is also proportional to λ E(σ) , for any σ ∈ Ω AGG . Both algorithms are known to exhibit phase changes as the parameter λ is varied, leading to aggregation (compression) when λ is large and dispersion (expansion) when λ is small.
Recall that a configuration is α-compressed if the perimeter (measured by the length of the closed walk around its boundary edges) is at most α p min (n), for some constant α > 1, where p min (n) denotes the minimum possible perimeter of a connected system with n particles. When the configurations can be disconnected, we need a more subtle definition of compression. Namely, a configuration is (β, δ) − aggregated if there exists a subset R of vertices such that: 1. At most β √ N edges have exactly one endpoint in R; 2. The density of particles in R is at least 1 − δ; and 3. The density of particles not in R is at most δ. We will make use of of the following theorems, which were shown in the non-adaptive settings where there is only one goal and this remains unchanged.

Theorem 3. Compression/Expansion [7]
: Let configuration σ be drawn from the stationary distribution of M COM on a bounded, compact region of the triangular lattice, when the number of particles N is sufficiently large. If λ > 3.24, then with high probability 1 there exists a constant α > 0 such that σ will be α-compressed. However, when λ < 2.17, the configuration σ will be expanded with high probability.
Theorem 4. Aggregation/Dispersion [17]: Let configuration σ be drawn from the stationary distribution of M AGG on a bounded, compact region of the triangular lattice, when the number of particles N is sufficiently large. If λ > 5.66, then with high probability there exist constants β > 0 and 0 < δ < 1/2 such that σ will be (β, δ)-aggregated. However, when 0.98 < λ < 1.02, the configuration σ will be dispersed with high probability.

Adaptive α-Compression
We now show how to build upon the compression and aggregation algorithms so that the particles collectively gather when there is food and disperse to search for food when there is none or they are not aware of any using only local movement and communication. We would like for the particles to encode their current knowledge of the world with a small number of states so that the majority will collectively perform the appropriate gather or disperse behavior, iteratively self-regulating to adaptively transition between these phases as the food location changes or disappears. For convenience, the algorithm we describe here is a fairly straightforward hybrid of both compression and aggregation algorithms where we carefully toggle between the high λ (compression) regime for connected configurations (Theorem 3) and the low λ (dispersion) regime for disconnected configurations (Theorem 4). This combined approach allows us to compress into configurations that are simply connected, which helps the token passing protocol, and then to disconnect when searching for food, which allows the particles to provably explore the domain more efficiently. Interestingly Theorems 3 and 4 still hold in this hybrid setting. We note that the same results do hold in the more straightforward setting of compression/expansion where we always keep the configurations simply connected, but then the search for food is less efficient.
The Adaptive α-Compression Algorithm works by integrating two main mechanisms: a state-based mechanism which each particle uses to determine whether it is appropriate to disperse or compress and a stochastic compression/dispersion algorithm, that implements the Markov chain allowing a simply-connected set of particles to compress or disperse.
We start by defining the state-based mechanism which includes six states: four compression states C = {C, C G , C F , C GF }, a dispersion state D, and a dispersion token state (DT ). The four compression states allow a particle to encode two additional bits of information: labels C G or C GF indicate that the particle currently holds on to a growth token (which is used to grow the compressed cluster in a controlled way), while C F or C GF indicate that the particle believes it is currently next to a food particle. Particles labeled C have neither a growth token nor awareness of food.
Particles in the dispersion state execute simple random walks, disallowing moves into locations that are currently occupied. The compression states coordinate to implement the gather phase; when activated, these particles execute the compression algorithm from [7] by picking a random direction, and if moving in the chosen movement satisfies certain properties (outlined in Section 3.1), the move is executed with a probability chosen to converge to a Gibbs measure proportional to λ E (σ), where configuration σ has E(σ) nearest neighbor pairs on the lattice. These actions are used to form a low-perimeter cluster around the food particle. The dispersion token state is only used as an intermediate state to propagate the dispersion token, which we will discuss later. We do not define any movement for these particles as they switch to the dispersion state on activation.
Growth Token: Our aim is for all particles in the dispersion state to eventually join the cluster comprised by the set of compression state particles connected to the food particle. A particle in the dispersion state can switch to a compression state if it makes direct contact with the food particle. To grow the cluster of particles beyond the initial layer around the food, we introduce a mechanism of growth token. New growth tokens are constantly generated by particles neighboring the food particle, which are then passed randomly between particles of the cluster. If a particle in the dispersion state comes into contact with a particle in the cluster holding a growth token, the growth token is consumed, and the dispersion state particle joins the cluster (by switching to a compression state). This system of growth tokens intentionally limits the rate of growth of the cluster of particles, which is key to ensuring that when the food particle is removed, the cluster disperses more quickly than it grows.

Dispersion Token:
The dispersion token allows for a mechanism to return a cluster of particles to the dispersion state after a food particle has been removed. When a particle neighboring a food particle detects that the food particle has vanished, it generates a dispersion token, which spreads quickly throughout the cluster, returning all particles of the cluster to the dispersion state. This is done through the dispersion token state, which on activation switches the activated particle to the dispersion state and all neighbors to the dispersion token state.

Particle Actions
When a particle is activated, it can move and change its internal state. We divide this process into two steps, which we call the state change step and the particle movement step. These two steps are executed one after the other. In each of these steps, we break down the particle's behavior by the state it is currently in. There are two types of constant-size tokens that may be exchanged between two adjacent particles in the algorithm (which we call growth and dispersion tokens). For ease of explanation, and since we are under the assumption of a sequential scheduler, we present our token passing scheme by assuming that a particle u who wants to send a token to a neighboring particle v can do so by writing the token directly into the memory of v.
Step 1 -State Change We describe the behavior of each of the states on activation of a particle u. Let p < 1 6 be a fixed positive constant that will determine the probability of a particle adjacent to the food particle to switch to a compression state, or of generating a new growth token when eligible, as we explain below.
Dispersion State (D): If next to a food particle, switch u to state C F with probability p. If u is not next to a food particle, and there is a neighboring compression state particle with a growth token (in state C G or C GF ), then with probability p, consume that growth token (switching the neighboring particle to state C or C F ) and switch u to state C. Compression State (C, C G , C GF , C F ): If u has the food bit set (state C GF or C F ) but is not next to the food particle, does not have the food bit set but is next to the food particle, or is next to the food particle but shares a compression state neighbor with the food particle without the food bit set, switch u to state D and switch all compression state neighbors of u to state DT . Otherwise, if u has the growth token bit set (state C G or C GF ), pick a random direction. If the neighbor v in that direction is in a compression state without the growth bit set, flip the growth bit on both u and v (effectively passing the growth token from u to v). If u does not have the growth token bit set but is next to the food particle, generate a growth token by flipping the corresponding bit with probability p. Dispersion Token State (DT ): On activation, switch to state D and switch all compression state neighbors of u to the state DT .
Step 2 -Particle Movement This step is applied after the state change step.
Dispersion State (D): Executes a simple random walk, by picking a direction at random, and moving in that direction if and only if the immediate neighboring site in that direction is unoccupied. Compression State (C, C G , C GF , C F ): Executes a compression movement. It first picks a direction at random to move in. If this move is a valid compression move (Definition 5), we will make the move with the probability given in Definition 7. After this, regardless of whether the move is made, we set the food bit to 1 if the particle is now adjacent to food, and 0 otherwise. Dispersion Token State (DT ): A particle in the dispersion token state will not have the chance to move, as on activation it would have switched to the dispersion state. We use the term cluster particles to refer to the food particle or particles in a compression state or the dispersion token state. We restrict the movements of the compression state particles to keep the cluster particles connected. Suppose a compression state particle in location wants to move to an empty adjacent location . Denote by N ( ) and N ( ) the sets of lattice sites neighboring the positions and respectively. Also, N ( ∪ ) is defined to be N ( ) ∪ N ( ) \ { , }. Finally, let S := N ( ) ∩ N ( ) denote the set of sites adjacent to both and (thus |S| ∈ {0, 1, 2}).

Definition 5 (Valid Compression Moves). Consider the following two properties:
Property 1: |S| ≥ 1 and every cluster particle in N ( ∪ ) is connected to a cluster particle in S through N ( ∪ ). Property 2: |S| = 0, and each have at least one neighbor, all cluster particles in N ( )\{ } are connected by paths within this set, and all cluster particles in N ( ) \ { } are connected by paths within this set. We say the move from to is a valid compression move if it satisfies both properties, and N ( ) contains less than 5 cluster particles.
Definition 6 (Local Disconnection). Consider a cluster particle currently in position trying to move to an adjacent location. We say the movement causes local disconnection if the set of cluster particles in N ( ) ∪ { } were connected through cluster particles in the same set, but no longer will be after the movement.
We can see that valid compression moves do not cause local disconnection.
Definition 7 (Transition probabilities). Fix λ > 1. Even when a movement is valid, we only make the move with the probability min{1, λ e(σ )−e(σ) }, where σ and σ are the configurations before and after the movement is made, and e(·) represents the number of edges between cluster particles in a configuration. It is important to note that even though e(·) is a global property, the difference e(σ ) − e(σ) can be computed locally by only counting the number of neighbors the particle has before and after its movement.
These movement conditions and probabilities are based on the compression algorithm in [7], giving the algorithm its name. With a far-from-trivial modification of the analysis in [7] to account for the immobile food particle, we show in Appendix C that this allows the cluster of particles to form a configuration of low-perimeter.

The state invariant:
For a fixed configuration, we consider a graph with the vertex set consisting of the set of all particles in a compression state or the dispersion token state. Vertices are adjacent in the graph if their corresponding particles are adjacent in the lattice. In this section, a component refers to a connected component of this graph. Notably, food particles are not considered part of any connected component (See Figure 1). This allows us to define the following state invariant, that we know holds from an initial configuration with every particle in the dispersion state. In Appendix A.1 we show Lemma 9, which states that this key state invariant always holds when running the Adaptive α-Compression Algorithm, despite the potential adversarial movement of the food particle. Lemma 9. When the Adaptive α-Compression Algorithm is run starting from a configuration where every particle is in the dispersion state, the state invariant will hold on every subsequent configuration.

Gathering and Dispersing
To verify the behavior of the algorithm in response to environmental changes, we show the following two theorems.
Theorem 10. Starting from any configuration satisfying the state invariant, given that the food particle exists and remains in a fixed position for a sufficient amount of time, we DT DT CF f CF CF CF Figure 1 A configuration with four components that satisfies the state invariant. Particles in the dispersion state are not drawn. The label f refers to the food particle, DT refers to dispersion state particles, and CF refers to particles with the food bit set.
will reach a configuration where all particles are in a compression state in a single cluster around the food particle in a polynomial number of steps in expectation.
Furthermore, for any α > 1, there exists a λ α > 1 such that for any λ > λ α as used in Definition 7, after a sufficiently long time has passed, the perimeter of the cluster will be at most αp min with high probability, where p min is the minimum possible perimeter of a cluster of the same size.
Theorem 11. Starting from any configuration satisfying the state invariant, if there is no food particle in the system for a sufficient amount of time, all particles will return to the dispersion state within a polynomial number of steps in expectation.
A key component of the proof is the elimination of residual particles, which are particles that remain from previous attempts to gather and that we wish to return to the dispersion state.
Definition 12 (Residual Components and Particles). A residual component is a component that satisfies at least one of the following three criteria: 1. Or it contains a particle in the dispersion token state; 2. It contains a compression state particle with the food bit set that is not adjacent to food; 3. It contains a compression state particle without the food bit set that is adjacent to food. We call particles belonging to residual components residual particles Out of the four components displayed in Figure 1, only the component in the bottom left is not a residual component. When starting from an arbitrary configuration, there are likely to be a large amount of residual particles that need to cleared out. Residual particles are the remnants of partially built clusters as the food particle moves from place to place prior to the start of our analysis. Residual particles are problematic as they obstruct existing particles, do not contribute to the main cluster and can cause even more residual particles to form. Our main strategy to show that all residual particles will eventually vanish is to define a potential function that decreases more quickly than it increases.
Definition 13 (Potential). For a configuration σ, we define its potential Φ(σ) as: Where Φ C (σ), Φ DT (σ) and Φ T (σ) represent the number of compression state particles, the number of dispersion token particles, and the number of compression state particles with growth tokens respectively.
We use the following lemma to guarantee that the expected number of steps before all residual particles are removed is polynomial. The proof of this lemma is given in Appendix A.2. This same lemma will be used again later in the proof of the Adaptive Spiraling algorithm.
Lemma 14. Fix integers n, k ≥ 1, and 0 < η < 1. Consider two random sequences of probabilities (p t ) t∈N ≥0 and (q t ) t∈N ≥0 , with the properties that 1 n ≤ p t ≤ 1 and 0 ≤ q t ≤ ηp t , and p t + q t ≤ 1. Now consider a sequence (X t ) t∈N ≥0 , where X 0 = k, and .
In this case, (X t ) t∈N ≥0 represents the sequence of potentials, starting from some configuration satisfying the state invariant. In Appendix A.3, we make use of this to show that assuming no change in the food, we reach a configuration with no residual components within a polynomial number of steps in expectation. In addition, we show that once all residual components are eliminated, no new ones will be generated, and all compression state particles must form a single cluster (defined formally as a connected component when we include both compression state particles and the food particle as vertices) around the food particle.
In the case where no food particle exists, this necessarily implies that all particles will be in the dispersion state, giving us Theorem 11. In the case where a food particle exists and remains in place, we need to show next that all dispersion state particles eventually switch to the compression state. Lemma 15 implies this as without residual particles, no compression state particle can switch back to the dispersion state.
Lemma 15. Suppose that the food particle exists and remains in a fixed location, the state invariant holds, and that there are no residual particles in the configuration. Then the number of steps before the next particle switches from the dispersion to some compression state is polynomial in expectation.
The proof of this uses bounds on hitting times of random walks on evolving connected graphs [3], and is given in Appendix A.4. This gives us the first part of Theorem 10.
We note that the ability to appropriately gather and disperse does not rely on the specific movements behavior defined for the compression state particles. The token passing mechanism functions as long as they only make moves that maintain local connectivity. In this case however, as we desire a low perimeter configuration of the cluster for the second part of Theorem 10, we apply the movement behaviors from the compression algorithm of [7].

Achieving α-Compression.
Assuming irreducibility of the Markov chain, the results of [7] guarantee that for any α > 1, there exists a sufficiently large constant λ such that at stationarity, the perimeter of the cluster is at most α times as large as its minimum possible perimeter with high probability. However, while the Metropolis-Hastings algorithm allows us to obtain the same stationary distribution and hence the same low-perimeter clusters, irreducibility of the Markov chain is  not a given, despite using the same set of moves. This is as the food particle, which we do not have control over, is part of the cluster. This is described in the following theorem: Lemma 16. We consider configurations of particles in compression states with a single food particle. Suppose that there is enough space on the lattice for all particles to be laid out on a single line on any position and in any direction, without the line intersecting itself. If the compression state particles can only make the moves given in Definition 5 while the food particle remains fixed in place, there exists a sequence of valid moves to transform any connected configuration of particles into any hole-free configuration of particles.
We call a configuration hole-free if there exists no closed path over the particles that encircles an empty site of the lattice. The proof, which is given in Appendix C, builds upon the analysis in [7], which describes a sequence of valid compression moves to transform any connected configuration of particles into a single long line. Unfortunately, having a single immobile particle makes this proof significantly more complex.
The main strategy in the proof is to treat the immobile food particle as the "center" of the configuration, and consider the lines extending from the center in each of the six possible directions. These lines, which we call "spines", divide the lattice into six regions. The sequence of moves described in [7] is then modified to operate within one of these regions, with limited side effects on the two regions counterclockwise from this region. We call this sequence of moves a "comb", and show that there is a sequence of comb operations that can be applied to the configuration, repeatedly going round the six regions in counterclockwise order, until the resulting configuration is a single long line. We then observe that any valid compression move transforming a hole-free configuration to a hole-free configuration is also valid in the reverse direction, giving us the statement of the lemma.

Adaptive Spiraling
In Adaptive Spiraling, particles attempt to construct a minimum perimeter configuration by incrementally building a spiral tightly wrapped around the food particle. Each particle checks for a specific local structure, and we show that if this local structure is satisfied by every particle, the only possible result is the spiral. If the food particle moves or vanishes, particles dissipate in a similar manner -those closest to the food particle are the first to notice that the food particle is no longer present, and thus switch to the dispersion state. Particles in outer layers of the spiral eventually also switch to the dispersion state when they see their neighbors on the inner side of the spiral switch to the dispersion state.
if v is a stable particle then 3: s ← the base state of v.

4:
if v is verifiable then

5:
Set the state of v to s * 6: else 7: Set the state of v to s.

8:
else if v is an attachable particle for some state s and direction d then 9: if v is currently in the dispersion state then 10: Switch v to compression state s with parent direction d with probability ρ.

11:
else 12: Switch v to compression state s with parent direction d.
Similar to the Adaptive α-Compression Algorithm, particles have two main types of states, dispersion and compression. The compression states are labeled to ensure that deviations from the desired structure do not happen. Specifically, we encode sub-states of the compression state, which we label with 0 to 6 and 0 * to 5 * , along with one of six possible "parent" directions. States 0 to 5 are used for the initial six particles to attach around the food particle in counterclockwise order, while every subsequent particle in the spiral is in state 6. Additionally, for the initial six particles, the verified states 0 * to 5 * are used to confirm that all of the six particles are in the correct state and direction before continuing to build the spiral. The parent directions indicate the next particle in the spiral in the inwards direction. More details on these states are given in Appendix B.
A particle in the dispersion state moves as a simple random walk over the underlying lattice, with moves into occupied lattice sites rejected. A particle in a compression state on the other hand, does not move. In our model, a particle is able to observe the states and directions of its neighbors. A particle, when activated, uses this information to potentially switch between states, and try to make a move if it is in the dispersion state after.
Algorithm 1 describes the behavior of a particle v when it is activated. The basic idea is that a particle switches to some compression state when it satisfies an "attachment property" (for some state and direction), and to the dispersion state when it does not. This "attachment property" is a predicate that considers a particle, its local neighborhood, a state s and direction d. A particle satisfies the attachment property under a state s and a direction d if it satisfies the specific local conditions described in Appendix B.1.Importantly, every particle in a spiral ( Figure 2) satisfies the attachment property with its current state and direction.
Definition 17. We say the base state s of a particle of state s is x if s ∈ {x, x * }. The following definitions are useful for the description of the algorithm and its proof: Stable particle: A particle in a compression state that satisfies the attachment property with its current parent direction d and current state s. Unstable particle: A particle in a compression state that does not satisfy the attachment property with its current parent direction d and current state s. Attachable particle: A particle that is unstable or in the dispersion state, that would satisfy the attachment property for some direction d and state s. Verifiable particle: Consider a stable particle v of base state s ≤ 5. For v to be stable, it must be one of the six particles circling the food particle. If s = 5, we say v is verifiable. Otherwise, denote by u the particle one step counterclockwise of v around the food particle.
We say v is verifiable if u exists, is of compression state (s + 1) * , and has v as its parent. The algorithm contains a "Verification" step, which is used to confirm that all six particles neighboring the food are present in the correct states and directions, before continuing to build the spiral. To do this, the six particles neighboring the food, while stable, can switch between the verified and unverified states, depending on whether they are verifiable.
If we reach a state where every particle is stable, assuming that there are at least six particles in the system, the only possible end result is a single spiral built around the food particle ( Figure 2). The end goal of the algorithm is thus for every particle to be stable.
We also define an "attachment probability" ρ ∈ (0, 1 2 ), which is used when a dispersion state particle is to join the spiral by switching to a compression state. This attachment probability limits the speed of growth of the spiral, so that when a food particle vanishes and the spiral needs to dissipate, it will do so at a greater rate than it can grow.

Analysis of Adaptive Spiraling
If the food particle remains in a fixed position for a sufficiently long time, our ultimate objective is for all particles in the system to form a single spiral, with the food particle in the center. If no food particle is present for a sufficiently long time, all particles should return to the dispersion state. We show that these outcomes are achieved within a polynomial number of time steps in expectation. The spiral is our desired final configuration if the food exists and remains in place. We define the spiral as follows:

Definition 18 (Spiral). A spiral is a maximal sequence of compression state particles
the sequence of particles are in a "counterclockwise spiral" configuration originating from the food particle, as illustrated in Figure 2.
We call a particle a spiral particle if it is part of some spiral. Note that for a fixed food particle location, there are only six possible spirals that can be formed, each corresponding to a starting position adjacent to the food. We observe that multiple spirals may start forming in the system, after seven or more particles join the spiral, only one spiral will continue to grow.
Recall that our algorithm's effectiveness is contingent on there being no change in the food's existence or position for a sufficient amount of time. Thus, our proof starts from a point of time after which no change in the food particle occurs. However, the configuration we start from may be completely arbitrary, as the food particle could have been moved adversarially prior to when we begin the analysis, potentially creating difficult starting configurations. For example, the adversarial movement of the food can cause the construction of partially built spirals, which may continue to grow and possibly self-sustain as information about the incomplete nature of the spiral or lack of food particle in the center takes time to propagate through the system.
For the purposes of the proof, we assume that there are at least six particles in the system, and that there is sufficient space for the particles to move around. To be precise, we do not consider configurations with enough particles for the formed spiral to make contact with itself via wraparound, blocking the remaining particles from joining the spiral (Figure 3). Suppose that the food particle exists and is static. To form a single spiral around the food particle, the first challenge to deal with is the lack of global knowledge of orientation. We resolve this through the initial six particles surrounding the food particle. We show that the algorithm, by obeying the attachment property, guarantees the formation of what we call a "complete circle", a circle of six particles labeled 0 * to 5 * in counterclockwise order around the food particle. Once this is established, construction of the spiral begins by building a counterclockwise sequence of particles starting from the particle labeled 5 * . Appendix B.1 explains in detail how this is achieved from any starting configuration. Breaking symmetry in this manner is important because of the highly structured nature of Adaptive Spiraling. On the other hand, Adaptive α-Compression does not have to deal with such an issue.
Similar to Adaptive α-Compression, a key part of our proof is the eventual elimination of "residual particles", particles we do not want in the configuration. For Adaptive Spiraling, a residual particle is defined as follows: Definition 19 (Residual Particle). A residual particle in a configuration is a particle in a compression state that is not a spiral article but is either in state 6 or is not adjacent to food.
Residual particles pose two main problems: They obstruct particles in the dispersion state, preventing them from reaching the required locations to extend the spiral. Also, dispersion state particles may mistakenly attach to residual particles, creating more residual particles instead of making meaningful progress.
As in Adaptive α-Compression, we apply Lemma 14 to argue that the number of residual particles decreases more quickly than it increases. In this case, the random variable X t represents the number of residual particles t time steps after some reference point. To show that the preconditions of Lemma 14, for each possible configuration, we define an auxiliary graph with the particles as vertices, and parent directions as directed edges (Definition 35) The full argument is outlined in Appendix B.1, which we outline in the following paragraphs.
Under specific conditions, we show that each dispersion state particle that can become a residual particle on activation has a path over the auxiliary graph to either the food particle or an unstable residual particle -one that does not satisfy the attachment property and thus returns to the dispersion state on activation. By showing that no vertex of the auxiliary graph has in-degree greater than 1, this allows us to upper bound the probability of gaining a new residual particle in the next iteration by the probability of losing a residual particle.
Finally, we show that no residual particles will form again after the number of residual particles hits 0. This, with the assumption that the "complete circle" around the food particle as described earlier has fully formed, ensures that the only remaining particles are dispersion state particles are or part of a single spiral with the food particle in the center. Known results on the hitting time of exclusion processes gives us the remainder of the proof. The elimination of residual particles also applies to the case where no food particle exists, this time guaranteeing that all remaining particles are in the dispersion state.
The following two theorems constitute the proof of correctness of the Adaptive Spiraling algorithm. The proofs are given in Appendix B.2.
Theorem 20. From any starting configuration, given that the food particle exists and remains in a fixed position for a sufficient amount of time, we will reach a configuration where all particles form a single spiral around the food particle in a polynomial number of steps in expectation.
Theorem 21. From any starting configuration, if there is no food particle for a sufficient amount of time, all particles will return to the dispersion state within a polynomial number of steps in expectation.

Conclusions
We demonstrate through two algorithms that self-induced phase changes, here implemented via careful token passing in response to an environmental signal, can be used as an algorithmic tool to transition between multiple desirable emergent macrostates. We see this as a promising direction for collective systems of interacting agents in applications such as self-healing and search-and-rescue tasks in robot swarms. In the first case, the macrostates represent two natural regimes in ferromagnetic systems corresponding to high temperature, where particles disperse, and low temperature, where particles compress. Since both of these behaviors emerge from changing a simple parameter corresponding to temperature, the Adaptive α-Compression algorithm can be thought of as particles adjusting their parameters based on individual experiences, such as whether they have been fed recently, in addition to bringing about a beneficial global outcome for the collective. We show how careful token passing can overcome potential issues with particles self-actuating autonomously in a distributed setting. The second algorithm demonstrates that the concept of self-induced phase changes can be used even in highly structured algorithms that are not motivated by simple physical systems of interacting particles. The macrobehavior is encoded in states and the appropriate collective behavior emerges as the particles learn which phase of the algorithm is appropriate at any given time.
In addition to seeming more reminiscent of how groups of organisms might gather and search for food when foraging, we see several advantages of Adaptive α-Compression over Adaptive Spiraling. First, the structured Adaptive Spiraling algorithm can fail in the presence of an obstruction, such as dead particles or other objects that prevent particles from occupying certain sites in the lattice. Obstacles are especially disruptive to Adaptive Spiraling, as it relies on a very specific structure being maintained. If an obstacle is in the path of the spiral being built, the spiral will not be able to grow any further. On the other hand, in the Adaptive α-Compression Algorithm, any particle that has not been completely "walled off" by obstacles will eventually join a component containing the food particle. We note, however, that while all particles will eventually join a component containing a food particle, if there are many obstructions, this may prevent low-perimeter clusters from forming, even in the best situation.
A second advantage to the stochastic approach is when we have multiple food particles where we want the particles to form multiple compressed components. In the Adaptive Spiraling algorithm, we have similar issues to the case of obstacles. If two food particles are close enough to each other for their clusters growing around them to meet, these clusters will obstruct each other, preventing any further growth. The Adaptive α-Compression Algorithm however, with a small modification to prevent clusters from merging, continues to ensure that every particle eventually joins a cluster containing a food particle, although again, a crowded field of deliberately placed food particles may prevent clusters from reaching low perimeter configurations. One might note though, that the cases where undesirable low perimeter configurations are not reached are uncommon. Figure 4 illustrates the typical configurations that may form around multiple food particles, and Figure 5 gives an example of food particles placed in specific locations preventing low-perimeter configurations from being reached. We believe that the proofs for the single food particle case will extend to the multiple food particle setting and suggest this for future study.
Also as future work, we believe that, when carefully translated to the amoebot model [10], one can show that the Adaptive Spiral Algorithm to be the first self-stabilizing hexagon formation algorithm in the presence of a seed under this model.

Appendix A Details for the Adaptive α-Compression Algorithm
We proceed by giving the final details of the algorithm and proofs for the Adaptive α-Compression Algorithm that exceeded the space in the main text.

A.1 Establishing the state invariant (Lemma 9)
Recall that the state invariant is satisfied if each component contains a particle in state C GF , C F or DT . Lemma 9 states that the state invariant always holds if we start with all particles in the dispersion state.
Proof of Lemma 9. We would like to show that the state invariant holds throughout the Adaptive α-Compression Algorithm. Consider any configuration where the state invariant currently holds, and let u be the next particle to be activated. We show that the state invariant continues to hold after both the state change step and the particle movement step of the algorithm.

State Change
Step: If particle u is in the dispersion state, if u switches to state C F when next to a food particle, the component u joins automatically satisfies the invariant. If u is consuming a growth token from a neighboring compression state particle to switch to a compression state, it must be joining an existing component that previously already satisfied the invariant, and thus will continue to do so. If u is in the dispersion token state, activating u can potentially split the component it is in into multiple components. However, as all neighbors of u will also be set to state DT , each of these new components will contain a particle of state DT .
If u is in a compression state, particle u transferring a growth token or generating a new growth token does not affect the invariant. Thus we only need to consider the case where u switches to the dispersion state while spreading the dispersion token, in which case the argument used when u is in the dispersion token state applies in the same way.

Particle Movement
Step: If u is not in a compression state, it is clear that this step will not affect the invariant. Thus we assume u to be in a compression state. To check that the state invariant is satisfied, we only need to look at the components in the new configuration that have been changed in some way by the movement of u -in other words, the component u joins after its movement, and the component(s) u leaves behind after its movement (which may be the same component as the one u joins). If u joins a component it was not a part of in the original configuration, this component must previously already satisfy the invariant, and will continue to do so even with u attached. Thus, we only need to check the component(s) that u leaves behind after its movement.
There are two possible ways moving u could cause the components it left behind to no longer satisfy the invariant. The first is when u bridges two components, separating these components after the move, and only one of these two components has a particle of state C F , C GF or DT . The second possibility is when u is in state C F or C GF -the component could have no other particle of state C F , C GF of DT , and moving u could make it detach from the component or make u unset its food bit.
Since u is currently in a compression state, u could have either been in the dispersion state or a compression state prior to its activation. If u was in the dispersion state, any component(s) u is part of before the movement would have already satisfied the invariant without u, and so would continue to satisfy the invariant even after u is moved.
We can thus assume u was in a compression state prior to its activation. As u had passed the state change step of the algorithm without switching to the dispersion state, if it is neighboring the food particle, all compression state neighbors it shares with the food particle must be in states C F or C GF .
In the first case stated above, as u cannot make moves that locally disconnects its neighbors (which can include the food particle), the only way u can disconnect two components is when the food particle continues to connect the neighbors of u corresponding to these components. This implies that each of the two components will have a particle in state C F or C GF .
In the second case, we consider the shared compression state neighbors between u and the food particle, which must be in states C F or C GF . Any component u leaves behind (disconnects from) after its movement must contain one of these shared neighbors. This is because otherwise, u's movement would locally disconnect this component from the food particle, which it cannot do.

A.2 Expected time to remove residual particles (Lemma 14)
Next, we prove Lemma 14, establishing a polynomial bound on the expected time to remove residual particles, by first showing the following two lemmas.
We compute S 1 by conditioning on the first step: Lemma 23. Fix integers n, k ≥ 1, and 0 < η < 1. Consider a random sequence of probabilities (r t ) t∈N ≥0 , such that 1+η n ≤ r t ≤ 1 for all t ∈ N ≥0 . Now consider a sequence Proof. We observe that the sequence (Y t ) t∈N ≥0 behaves in the same way as (W (k) t ) t∈N ≥0 from Lemma 22, except that on each round, we have a probability 1 − r t of doing nothing.
This allows us next to bound the time to remove residual particles.
Proof of Lemma 14. We define random variables r t := (1+η)p t for all t ∈ N ≥0 , which allows us to couple the sequences (X t ) t∈N ≥0 and (Y t ) t∈N ≥0 so that X t decreases by (at least) one if and only if Y t decreases by one and X t increases by (at least) one if and only if Y t increases by one. This shows that for all t and real numbers x, P r( We can show that T X is also stochastically dominated by T Y as follows:

A.3 Eliminating residual particles
Showing the following three lemmas allow us to conclude that if there is no change in the food particle for long enough, we will reach a stage where DT -state particles will no longer form, and particles in compression states can only be in components that are in contact with the food particle. If there is no food particle, this necessarily means that all particles will end up in the dispersion state.
Lemma 24. We start from a configuration where the state invariant currently holds. Assume that there is no change in the food particle from the current point on. Then the expected number of steps before we reach a configuration with no residual components is at most 2n 2 /(1 − 6ρ).

Proof.
We consider the sequence of potentials (Φ(σ t )) t∈N ≥0 with σ 0 representing the configuration we start with, and make use of Lemma 14.
By the definition of a residual component, as long as there exists a residual component, there will be at least one particle that when activated, will switch to the dispersion state, reducing the current potential by at least one. Thus, the probability of decreasing the current potential by at least one in any step is at least 1/n. The consumption of a growth token to add a new compression state particle to a residual component does not change the current potential. Switching particles to the dispersion token state also does not affect the potential.
With no movement of the food particle, there are only two ways for the potential to increase. The first is when a new growth token is generated, and the second is when a dispersion state particle switches to a compression state by being next to a food particle. Either of these increase the current potential by exactly 1. Both of these can only happen through the activation of particles adjacent to food, and only happen with probability ρ. As there are at most 6 of these, this happens with probability at most 6ρ/n < 1/n.
Lemma 25. We start from a configuration where the state invariant currently holds. Assume that there is no change in the food particle from the current point on. If there are no residual particles, then no residual particle can be generated from then on.
Proof. With no residual components, all particles in the configuration will have the food bit set if and only if they are adjacent to food. There are also no DT particles, so no particle on activation will switch to the DT state. When a particle moves, it will set its food bit accordingly, so no residual components will form.
Lemma 26. Suppose that the state invariant holds and there are no residual particles. Then all components will neighbor the food particle.
Proof. With no residual components, each component must contain a compression state particle with the food bit set, which must necessarily neighbor the food particle.

A.4
Bounding the time to compress (Lemma 15) We will now verify that particles revert to the compression state if a food particle remains present once there are no residual particles. We will refer to connected components consisting of particles in the compression state together with any food particle as clusters. (Note that these are different from components.) Proof of Lemma 15. We consider the amount of time it takes for a new particle to join the cluster assuming that another particle does not join the cluster first. For a particle to join the cluster, it must be activated while adjacent to a particle in the cluster that is holding a growth token. We can upper bound the expected amount of time before this happens by the amount of time it takes for all particles in the cluster to obtain a growth token, followed by the amount of time it takes for a particle to "collide" with the cluster. First, we claim that assuming no new particles join the cluster, then within a polynomial amount of steps, all particles in the cluster will be holding a growth token. To see this, note that as there are at most n particles in the cluster, we only need an upper bound on the amount of time it takes for a new growth token to be generated, starting from an arbitrary configuration of the cluster. Unfortunately, as a particle can only hold one growth token at a time, new growth tokens can only be generated when a particle without a growth token neighbors the food particle. We thus need to bound the expected amount of time it takes for a compression state particle without a growth token to neighbor the food particle.
Mark a particle that currently does not hold a growth token. If a neighboring particle containing a growth token is activated and transfers its growth token to the marked particle, we move the mark to said neighboring particle. If a neighboring particle without a growth token is activated, for the sake of our analysis we may pretend it does, randomly picking an outgoing direction, and receiving the mark if the marked particle happens to be its neighbor in the picked direction (even though no growth token is transferred). As we assume no new particle joins the cluster, the set of particles in the cluster (the set of food particles and compression state particles) is fixed. Movement of the particles in the cluster in effect only reconfigures the graph's edges. The mark moving in this manner is thus equivalent to following the d max -random walk over a connected evolving graph, which is a sequence (G t ) t∈N ≥0 of connected graphs sharing the same vertex set but with possibly differing edges, as described in [3,11]. This gives us an expected hitting time upper bound of O(n 3 log n) [11] activations of the marked particle, or O(n 4 log n) iterations (the asymptotic bound is the same even as we take into account that the probability of generating a new growth token is a non-zero constant p < 1).
Note that while in practice it is not possible for the mark to actually transfer to the food particle, we are only concerned with the chain up to the point where the mark neighbors the food particle, so this analysis sufficiently shows that a new growth token will be generated in expected polynomial time.
Finally, we claim that if every particle in the cluster already has a growth token, and if there are still particles not in the compression state, then a new particle will "collide" with the cluster and join it in polynomial expected time. Note that the particles in the dispersion state follow a simple exclusion process. By considering obstructed movements as swap moves rather than rejected moves, we can analyze the hitting time of a simple exclusion process as independent simple random walks over the lattice. If the food particle and the particles in the cluster do not exist, as our triangular lattice is a regular graph, a simple upper bound for the number of steps before some dispersion state particle reaches the current is location of the food particle is O(N 2 ) [19] activations of any one particle, which translates to O(N 2 n) iterations. In practice however, the dispersion state particle must collide with either the food particle or a compression state particle before this happens, which switches it to the compression state with a constant probability p. This gives us a loose upper bound of O(N 2 n + n 5 log n) iterations for a new particle joining the cluster, giving us the claim, and hence the Lemma.

Appendix B Details for the Adaptive Spiraling Algorithm
The spiral algorithm proceeds in stages, with the most delicate being at the onset when the food particle is first discovered. Particles in the compression state start attaching to the food in cyclic order until the food is completely surrounded by 6 particles. These particles are verified or unverified, with the verification process ensuring that the particles are consistently numbered and not in a hybrid state where multiple particles are labeled as the initial point on the spiral or particles have detached and reattached out of sequence. The verification process ensures that particles are labeled 0 through 5 in cyclic order. In the verification process, particles move from label an unverified label x to a verified label x * , x ∈ {0, ..., 5}, to indicate that the particle is correctly labeled. All subsequent particles to join the spiral are labeled 6 and do not need to be verified because they can only attach in one place. Our goal is to use the compression states to make sure the spiral forms with parent nodes indicating the steps in the spiral. Verification occurs until a complete and verified circle is formed, at which point the spiral can expand sequentially without an opportunity for error. We divide the progress of the spiral into stages, as follows: Stage 1: Inconsistent: Arbitrary configuration, whether a particle is in a verified state indicates nothing about the existence of a complete circle. Stage 2: Before complete circle: the configuration is consistent (Definition 29), but has not yet formed a complete circle. Stage 3: complete circle: the configuration is consistent and has a complete circle. Stage 4: Verified complete circle: the configuration is consistent, has a complete circle and all six positions of the complete circle are filled by verified particles.
We will now define the stages more precisely and explain how the algorithm progresses forward through these stages during a compression phase without ever progressing backwards through stages.

B.1 Protocols for consistent spiral formation
A particle in a compression state defines a parent direction pointing toward one of its six neighbors in the lattice. We enumerate the possible directions with numbers 0, 1, 2, 3, 4, 5, with addition and subtraction defined modulo 6. Particles do not have a global sense of direction, but they can set direction with reference to the particles surrounding it, using a common chirality. We define directions numerically only to simplify our notation for relative directions; for a direction d, direction d + 1 would be clockwise, and d − 1 would be counterclockwise. We call the immediate neighbor of this particle in the direction d the parent of the particle. The intention is for the path of parent pointers to traverse the spiral inwards, terminating at the food particle.
The attachment property: In order to forbid moves that violate our definitions, we define an attachment property that restricts particles can to join the spiral only when they satisfy an attachment property, that we now specify. For any particle v and direction d and state s, denote by v p the neighbor of v in direction d, if it exists. The neighbors of v clockwise and counterclockwise of v p are denoted v cw and v ccw respectively. We denote by d p , d cw , d ccw their respective parent directions if they are in a compression state, and we denote by s p , s cw , s ccw their states, and these variables are null otherwise. Particle v satisfies the attachment property with direction d and state s if v p exists and v meets the following criteria, enumerating the necessary local conditions, typically based on the state of the parent particle: if v p is not in the dispersion state; if v p is a food particle, then s ∈ {0, 0 * } or v ccw is a particle in a compression state and s ccw = 5; if s p = 0, then s = 1, d p = d + 2, and v cw is a food particle; if s p ∈ {1, 2, 3, 4}, then s = s p + 1, d p = d + 1, and v cw is a food particle; if s p = 5, then s = 6, d p = d, and s cw = 0 * ; if s p = 6, then s = 6 and s cw ∈ {0, 1, 2, 3, 4, 5, 6}, and if s cw = 0, then d p = d + 1 and d cw ∈ {d p , d p + 1}; or if s cw ≥ 1, then d p ∈ {d, d + 1}, and d cw = d p .

Circle formation:
We are now prepared to describe how the first 6 particles join the spiral to form the initial circle around the food. The verified states 0 * to 5 * are used to confirm that all six particles around the food particle are part of a single spiral, before allowing additional particles to join the spiral. However, as the food particle may relocate at any time, a verified state may not always present the most up-to-date information of the current state of the spiral. Figure 6 gives an example of this happening.

Figure 6
A sequence of moves causing the verified states to give inaccurate information on the status of six particles surrounding the food. Particles in the dispersion state are not drawn. Note that the food particle can be moved at any time between steps of the algorithm.
To get around this, we define the notion of consistency. Informally, the consistency of a configuration tells us if verified states are giving accurate information on the current state of the spiral. While a configuration may become inconsistent after a food particle relocates, if the food particle remains in place from then on, we will show that the configuration will eventually become consistent, and will remain consistent from then on. We first make the following definitions: Definition 27 (Circles). A circle is defined by its center and one neighboring site, designated position 0. Going counterclockwise around the center starting at 0 defines the positions 1, 2, 3, 4, 5 associated with the circle.
Let σ be any configuration of particles with states. For any circle, we say position x ∈ {0, 1, . . . , 5} is correctly filled in the circle if position x contains a particle in compression state x or x * , and its parent direction points towards the center, if x = 0, and pointing towards position x − 1, if x > 0.
Definition 28 (Inconsistency Value). Fix a configuration σ. If a circle in σ has the food particle in the center, then the circle is assigned an inconsistency value x + 1, where x is the largest position in {0, 1, 2, 3, 4, 5} that contains a correctly filled particle in compression state x * , as long as at least one of x + 1, . . . , 5 is not correctly filled. If such a position does not exist, then the circle is assigned the value 0. If the circle does not have the food particle in the center, the inconsistency value is the number of positions y that are correctly filled with a particle in state y * .
The inconsistency value of a configuration is the sum of the inconsistency values over all possible circles on the lattice.

Definition 29 (Consistency of a Configuration). We say a configuration is consistent if and only if its inconsistency value is 0.
In other words, a configuration is consistent if the only particles in verified states are adjacent to the food particle, and for any position adjacent to the food with a particle in state x * , for x ∈ {0, 1, 2, 3, 4, 5}, there is a circle centered at the food with positions x, x + 1, . . . 5 all correctly filled.
Definition 30 (Complete Circle). We say a circle is a complete circle if it has the food particle in the center and all six of its positions are correctly filled.
There can only be one complete circle around a food particle at a time. While the food particle remains fixed, all six adjacent particles on the circle are stable, so they will never switch to the dispersion state. Note also that in a consistent configuration, a particle in compression state 0 * only exists if it is part of a complete circle.
Achieving consistency: We now show that from any starting configuration, assuming the food is constant, we will achieve consistency within an expected polynomial number of steps and the configuration will remain consistent until the food changes.

Lemma 31. The activation of a particle can never increase the inconsistency value of any circle.
Proof. Fix some circle and suppose it has some inconsistency value z in {0, 1, 2, 3, 4, 5}. If the circle has no food particle in the center, its inconsistency value can only increase if it gains a new correctly-filled particle in a verified state. This is however not possible without a food particle in the center, as this new particle would be unstable and hence would instead switch to the dispersion state on activation.
On the other hand, suppose that there is a food particle in the center of the circle. The only way the inconsistency value of the circle can increase is for the new configuration to be correctly filled with a verified particle in position y > z − 1, but not all of the positions y, y +1, . . . , 5 are correctly filled. Note that this rules out y = 5. This gives us two possibilities. Either position y was not previously correctly filled with a verified particle, or it was correctly filled with a verified particle but all of y, y + 1, . . . , 5 were correctly filled but now aren't.
For the first case, the last iteration must have changed the correctly filled particle in some position y from state y to y * . As y < 5, this can only happen when position y + 1 contained a correctly filled particle in state (y + 1) * in the previous configuration, which is a contradiction as that would imply the inconsistency value of the circle was at least y + 2.
For the second case, this must mean some position x > y was previously correctly filled but no longer is. However, this is not possible as with the food particle in the center, the particle in position x was stable in the previous configuration.
Lemma 32. If the inconsistency value of a configuration is greater than 0, the probability that the inconsistency value decreases by at least 1 on the next iteration is at least 1/n.

Proof.
Consider any circle with some inconsistency value z > 0. It must have some position correctly filled by a particle in a verified state. If the circle has no food particle in the center, activating this particle will switch it to the dispersion state, reducing the circle's value by 1.
If the circle has the food particle in the center, the position z − 1 must contain a correctly filled particle in the verified state (z − 1) * , but not all of z, z + 1, . . . , 5 are correctly filled. Thus z − 1 cannot be 5, and as z − 1 is the largest such position, position z will not contain a correctly filled particle in a verified state. Thus, when the particle in position z − 1 is activated, it will switch to either the unverified state z − 1 or the dispersion state, reducing the inconsistency value of the circle by at least 1. As no circle will increase in inconsistency value by Lemma 31, the inconsistency value of the configuration must strictly decrease.
Out of the 6N possible circles we can define on the lattice, we note that as a configuration only has n < N particles, at most 6 × 6 × n = 36n of these circles can contain a particle. The inconsistency value of any circle is at most 5, so the inconsistency value of any configuration is at most 180n. Thus by Lemmas 31 and 32, after O(n 2 ) expected steps, we will reach a consistent configuration, which remains consistent from then on.
The following lemma shows that we cannot progress backward through stages. Furthermore, we show in Appendix B.2 that the algorithm progresses through the stages efficiently.
Lemma 33. Once we reach a stage i ∈ {2, 3, 4}, we cannot regress to any earlier stage.
Proof. We cannot regress to Stage 1 from any later stage, as by Lemma 31, a configuration once consistent remains consistent from then on. We cannot return to Stage 2 after reaching Stage 3 or 4, as all particles in the six positions defining a complete circle will always be stable, and so can no longer change state or direction beyond switching between their verified and unverified states. After reaching Stage 4, none of these six particles can return to an unverified state, thus we remain in Stage 4 from then on.

Removing residual particles:
After achieving consistency, the next important step is the removal of residual particles (Definition 19), similar to what was necessary for Adaptive α-Compression. Our objective is to prove the following lemma: Lemma 34. Suppose that either of these conditions currently hold, and continue to hold. 1. There is no particle in compression state 0 * in the current configuration.

The configuration is in Stage 4 (verified complete circle).
Then we will reach a state with no residual particles within n 2 1−2ρ = O(n 2 ) steps.
Definition 35 (Auxiliary Graph). For a given configuration, we define an auxiliary directed graph H with particles as vertices. For each stable particle, we define an edge to its parent. For each attachable particle, we define an edge to each of its potential parents.
It is important to note that edges of the graph H do not always correspond to the parent directions of particles in the configuration. In particular, unstable particles may not have an outgoing edge in H despite being in a compression state, and attachable particles will have an outgoing edge in H despite not having a parent direction. The following Lemma gives us a crucial property of this auxiliary graph H: Lemma 36. Other than the food particle, no vertex of H has in-degree greater than 1.
Proof. Fix any non-food vertex u. If there is an edge into u, u must be in a compression state and thus has a parent in some direction d. Thus for any vertex v with an edge into u, the direction of u from v must be either d or d − 1, limiting the possible locations of v to two. Let the particles at these locations be v 1 and v 2 , where u is at directions d from v 1 , and direction d − 1 from v 2 . If there is an edge from v 1 to u in H, then v 1 satisfies the attachment property in direction d. As v 2 is the particle counterclockwise of u from the perspective of v 1 , v 2 must either be a food particle or be in a compression state with direction either d or d + 1, meaning there is no edge from v 2 to u in H. Thus, v 1 and v 2 cannot simultaneously have edges towards u.
This property of auxiliary graphs gives us the following lemma: Lemma 37. Suppose that we are in either of these two situations: 1. There is no particle in compression state 0 * in the current configuration.

The configuration is in Stage 4 (verified complete circle).
Let S a denote the set of attachable particles in the dispersion state that can become a residual particle by changing to some compression state in some direction, and let S u denote the set of unstable residual particles that are not attachable. Then |S a | ≤ |S u | + 1.
Proof. Consider an attachable particle v in the dispersion state. If v can become a residual particle in some compression state s and direction d, it has an outward edge in the direction d on the auxiliary graph H. We follow the a path out of v over H, until we reach a particle u with no outgoing edge. Suppose u is not the food particle. The predecessor to u in this path was stable or attachable, so u must be in some compression state. As u has no outgoing edge, it must be unstable and not attachable. Hence u is not a spiral particle. As v would be a residual particle in compression state s and direction d, if v is adjacent to food, we must have s = 6. If v is not adjacent to food, it cannot be attachable unless s = 6.
If u is not state 6, there must have been a particle earlier in the path which is attachable with a parent of state 5 * . This indicates that there is a particle of state 0 * in the configuration ,and so the configuration must be in Stage 4 by the preconditions of this lemma. This means u cannot be adjacent to food as all neighbors of the food particle are stable. Hence, we can conclude that u is also a residual particle.
As no vertex of H has in-degree greater than 1, this gives an injection from S a to S u ∪{v f }, where v f is the food particle, which gives us the required result.
Lemma 38. Suppose that we are in either of these two situations: 1. There is no particle in compression state 0 * in the current configuration.

The configuration is in Stage 4 (verified complete circle). A new residual particle can only come from an attachable particle being activated.
Proof. Suppose there exists a new residual particle v that was not an attachable particle in the previous step. Thus, in the previous step, v is a stable particle in a compression state.
As v was not residual, it was either a spiral particle, or is a particle in a state s ≤ 5 adjacent to food.
If v was in a state s ≤ 5 and was adjacent to food, it cannot switch to state 6 without being an attachable particle, and would remain adjacent to food as it cannot move. Hence it would not become a residual particle on the current step, which is a contradiction.
If v was a spiral particle in the previous step, there must be a particle in compression state 0 * , so the configuration must be in Stage 4. In Stage 4, v could not have become a non-spiral particle in this step as every particle before it in the spiral is stable and verifiable, and hence could not have changed states.
Lemma 39. Suppose that we are in either of these two situations: 1. There is no particle in compression state 0 * in the current configuration.

The configuration is in Stage 4 (verified complete circle).
Then if there is a residual particle, then at least one of them is unstable.
Proof. Consider any residual particle. If it is unstable, we are done. Particles with base states 0 to 5 cannot be stable unless adjacent to food, so a stable residual particle must be in state 6. We start from this particle, and follow its edge out on the auxiliary graph H. If we continue following this path, there are multiple possibilities. The path could end on a particle of state 6, a particle of base state 5 or less, the food particle, or loop back to the particle we started with.
In the first case, the path ends on a particle in state 6. This implies this last particle is unstable. This particle will also be a residual particle.
In the second case, the path ends on a particle not in state 6 (either states 0-5, 0 * -5 * , or the food particle). Let v be the last state 6 particle in this path. If v is unstable, we are done as v is also a residual particle. So we may assume v is stable. For it to be stable, the particle clockwise of its parent direction must be in state 0 * . By the preconditions of this Lemma, our configuration is thus in Stage 4, and as the parent of v must be in state 5 * , this path must end on the food particle.
Thus, consider the sequence of particles starting from the particle in state 0 * in the configuration, following the parent directions in reverse order. Each particle has in-degree at most 1, so this sequence is well-defined. Denote by u 1 and u 2 the first non-spiral particle in this sequence and last spiral particle in the sequence respectively (both of these will exist, and u 2 is the parent of u 1 ). Denote by u the position where the next particle in the spiral after u 2 should have been. We note that necessarily, u 1 is in state 6 and u 2 is in states 5 * or 6. Let d 1 , d 2 denote the parent directions of u 1 , u 2 respectively. If u 1 is unstable, we are done. We thus assume u 1 to be stable, meaning that either d 1 = d 2 or d 1 = d 2 − 1. As u 1 is not in the next position of the spiral after u 2 , we must have d 2 = d 1 , and the direction of u 2 from position u is d 2 − 1. Hence u is the position clockwise of u 2 from the perspective of u 1 , and as u 1 is stable, u must be occupied by a particle in a compression state. As we are in Stage 4, u cannot be in state 0 * or u 1 would be a spiral particle. If u is in state 0, it cannot be adjacent to the food particle, and so is an unstable residual particle, which would mean we are done. If u is in any other state, as u 1 is stable, u must have parent direction d 2 . This is illustrated in Figure 7a. This would make its parent a particle in the spiral other than u 2 (the sites marked by crosses in Figure 7a must contain particles in the spiral), which necessarily implies that it is unstable as by Lemma 36, two stable particles cannot have the same parent particle.
The third and final case is when the path forms a cycle. All particles in this path will be residual particles as they are not spiral particles, so if there are no unstable residual particles, these particles must all be stable and in state 6. We start from an arbitrary particle in the cycle and follow the sequence of parent particles one round around the cycle. For each particle in this sequence, we consider the particle clockwise of its current direction (represented by v cw in the definition of the attachment property). After removing duplicates, these "clockwise particles" gives us another sequence {p0, ..., p k−1 } of particles.
Our claim is that the parent of each particle p i is the next particle p i+1modk in this sequence, modulo k. In other words, following the parent directions gives us another cycle. To prove this claim, we first eliminate the possibility of any of these clockwise particles being of state 0 * . We first note that at this stage, with one food particle, there can only be one particle of state 0 * , which will be part of a complete circle of particles of states 0 * to 5 * going counterclockwise around the food particle. As a clockwise particle being 0 * forces d p = d + 1 for that particle, any path of particles where 0 * is a clockwise particle will inevitably wrap around the 0 * particle, which leads to the particle of state 5 * of the circle, implying that the path ends in the food particle, rather than forming a cycle. Thus, as every particle in the cycle is stable, its clockwise particle must have the same direction as its parent. Each particle p i (with direction d pi ) is the clockwise particle of some particle w 0 (with direction d w0 ) in the original cycle. Let w 1 and w 2 (with directions d w1 and d w2 respectively) be the next two particles following the parent directions in the original cycle. As w 0 is stable, we have d w1 ∈ {d w0 , d w0 + 1}. If d w1 = d w0 , the clockwise particle of w 1 will be p i+1 and the parent of p i . If d w1 = d w0 + 1, the clockwise particle of w 1 will also be p i , which implies its parent w 2 must have direction d w2 = d w1 , which like the first case, would imply that the clockwise particle of w 2 will be p i+1 and the parent of p i . These two  (d) In the third case of the proof, as every particle in cycle C1 is stable, the set of "clockwise particles" of C1 forms another cycle C2. cases are illustrated in Figures 7b and 7c respectively. As illustrated in Figure 7d, if every particle in this new cycle is also stable, we can repeat this process to generate yet another cycle. We repeat this to continue generating new cycles until we find one with an unstable particle. Suppose that this never happens. If the first cycle happens to be a straight line (looping at the boundary of the torus), every subsequent cycle must also be a straight line, necessarily filling the entire lattice with straight lines. This cannot happen as we do not consider cases where there are enough particles to fill every site of the lattice. Thus, each of these cycles must have a "bend", which is a particle whose parent's direction d p is one step clockwise from its current direction (rather than being in the same direction as the current particle). This implies that each cycle created will have strictly fewer particles than the previous, creating a contradiction as we cannot do this indefinitely.
These Lemmas allow us to prove Lemma 34, which states that under certain conditions, all residual particles will be removed in polynomial expected time: Proof of Lemma 34. We make use of Lemma 14 for this proof. We first denote by (σ t ) t∈N ≥0 a random process where σ t represents the configuration t steps after the current step. For a configuration σ t , let X(σ t ) denote the number of residual particles in σ t . On each step, by Lemma 38, X(σ t ) can only increase by at most 1. The probability q(σ t ) of X(σ t ) increasing by 1 is at most ρ|Sa| n , and the probability p(σ t ) of X(σ t ) decreasing by at least 1 is at least |Su| n . By Lemma 39, we have p(σ t ) ≥ 1 n , and by Lemma 37, we have q(σ t ) ≤ ρ|Sa| n ≤ ρ(|Su|+1) n ≤ 2ρ |Su| n ≤ 2ρp(σ t ). As ρ < 1 2 in Algorithm 1, by Lemma 14 the expected amount of steps before X(σ t ) first reaches 0 is at most nX(σ0) 1−2ρ ≤ n 2 1−2ρ .

B.2 Correctness of adaptive spiraling
We are now prepared to show the main theorems (Theorems 20 and 21) to verify the correctness of the Adaptive Spiraling algorithm. We first state and prove two final lemmas.
Lemma 40 (Stage 4 Lemma). If there are no residual particles and we are currently in Stage 4 (verified complete circle) the following will be true in all subsequent iterations: 1. There will be no residual particles. 2. All compression state particles are spiral particles. 3. The number of spiral particles can never decrease. 4. Consider the set of possible locations not containing a particle in a compression state.
There is exactly one location in this set (the "end" of the spiral) where a particle in the dispersion state can be attachable. A particle switching from the dispersion state to a compression state in this location increases the number of spiral particles by 1.

Proof.
Suppose that there are no residual particles in a configuration. As all particles neighboring the food particle are spiral particles, this implies that all compression state particles are spiral particles (2). In Stage 4, all spiral particles necessarily belong to the same spiral starting from the food particle, and it can be easily checked that every particle in this spiral satisfies the conditions required for stability. Hence, all spiral particles are stable.
This implies that as long as there are no residual particles in the current iteration, no particles will switch from a compression state to the dispersion state in the next iteration, so the spiral remains intact (3). Furthermore, with a single spiral, there will be exactly one location where a particle in the dispersion state can switch to a compression state, to increase the number of spiral particles by 1 (4). Thus, there will also be no residual particles in the next iteration, and consequently from then on (1). This gives us statements (2), (3) and (4) in all subsequent iterations as well.
Lemma 41. Suppose that there is no particle in compression state 0 * in the current configuration.Then we cannot gain a new residual particle in the next iteration if none currently exist.
Proof. We show that the configuration in the next iteration will have no residual particle, given that the current configuration has no residual particle.
If there is no particle in state 0 * , no particle can be a spiral particle, so the only particles in a compression state must be next to a food particle, and cannot be in state 6. As long as there is no particle of state 0 * in the current configuration, we cannot add a new compression state particle in state 6. We also cannot add a new compression state particle in states other than 6 in locations not neighboring the food particle. Thus, it is not possible to gain a new residual particle.

Lemma 42. It takes a polynomial number of steps in expectation to progress to the next stage. In particular, a loose upper bound for the expected number of steps to reach Stage 4 from an arbitrary configuration is O(N 3 n).
Proof. As seen in Appendix B.1, a configuration in Stage 1 will reach at least Stage 2 by achieving consistency in O(n 2 ) steps.
In Stage 2, there will be no particle in compression state 0 * . We can only obtain a particle in compression state 0 * after we reach Stage 3. Thus by Lemma 34, we will reach a state with no residual particles within O(n 2 ) steps, and by Lemma 41, we will never gain any new residual particles as long as we remain in Stage 2. This means that the only particles in compression states will be adjacent to food. We then note that when a particle switches to some compression state while adjacent to food, it will always either be stable or attachable, and thus will never leave its position. Assuming at least six particles in the system, similar to the analysis in the proof of Lemma 15 with a loose O(N 3 ) [19] bound on hitting times of simple random walks on graphs of N vertices, we can bound the amount of steps to fill all six positions in the neighborhood of the food particle by O(6 · N 3 n) = O(N 3 n). Once this neighborhood is filled, we note that activating each of the six particles once in counterclockwise order will give us a complete circle. This happens after O(n) steps in expectation, and puts us in Stage 3.
In Stage 3, if the particles in the neighborhood of the food particle corresponding to the states 5, 4, 3, 2, 1, 0 are activated in sequence, all of these particles will switch to the states 5 * , 4 * , 3 * , 2 * , 1 * , 0 * respectively, bringing us to Stage 4. It takes O(n) steps for this to happen in expectation.
Combining these bounds and noting that we cannot regress to earlier stages (Lemma 33) gives us a polynomial upper bound of O(N 3 n + n 2 ) = O(N 3 n) for reaching Stage 4 when starting from an arbitrary configuration.
We are now prepared to prove the two main theorems.
Proof of Theorem 20. By Lemmas 33 and 42, we will reach Stage 4 within O(N 3 n) steps in expectation, and remain in Stage 4 from then on. By Lemma 34 within O(n 2 ) steps in expectation, we will reach a configuration with no residual particles.
By Lemma 40, all compression state particles from then on will be spiral particles, which means they will necessarily all be part of a single spiral. Furthermore, there is always exactly one position wbere a particle can join the spiral by switching to some compression state. We assume a reasonable amount of extra space for particles in the dispersion state to move around (see Figure 3 for when this is not true).
The particles in the dispersion state follow random walks, and once again with an analysis similar to that in the proof of Lemma 15 but with O(N 3 ) [19] hitting times of simple random walks, and taking into account that a new particle only joins the spiral with some constant probability ρ ∈ (0, 1 2 ), a loose upper bound for the expected time for the next particle to join the spiral is O( 1 ρ N 3 n) = O(N 3 n). Thus with n particles in the configuration, all particles will be part of the spiral after O(N 3 n 2 ) steps in expectation. Combining this with the time it takes to reach Stage 4 and remove all residual particles gives us a loose upper bound of O(N 3 n 2 + N 3 n + n 2 ) = O(N 3 n 2 ) steps for all particles to gather.

Proof of Theorem 21.
If there is no food particle, all compression state particles will be residual particles. Any particle in state 0 * will be unstable and non-attachable, and thus will switch to the dispersion state on activation. No new particles of state 0 * can form either. In the worst case over all possible starting configurations, by the analysis of the coupon collector's problem, there will be no more particles in state 0 * after O(n log n) iterations in expectation.
After that, by Lemma 34, we will reach a state with no residual particles after O(n 2 ) steps in expectation. This means all particles will be in the dispersion state. Furthermore, with no food particle or particles in compression states, no particle will be able to switch to a compression state after this.

Appendix C Ergodicity of M COM
We conclude by proving Lemma 16, showing that the Markov chain M COM is irreducible (and thus ergodic) by showing that all states are reachable using compression moves in the presence of food (as in Section 3.1). The proof of ergodicity given in Cannon et al. [7] without food particles was already fairly involved, but with the addition food particles that cannot themselves move, the proof becomes substantially more challenging. We overcome this by introducing a "comb" operation that organizes particles radially around the food. We will treat the immobile food particle as the "center" of the configuration. From the center, there are six directions one can move in a straight line on the triangular lattice -up, down, up-left, down-left, up-right, down-right. We call these six straight lines of particles extending from the food particle spines. We refer to particles on the spines as spine particles, and particles not on spines as non-spine particles. We similarly use the names spine and non-spine locations to refer to sites on the triangular lattices.
On each spine, we call the furthest out (in terms of distance from the food particle) particle on the spine with no adjacent non-spine particles the anchor particle of the spine. The spine particles further out than the anchor particle are called tail particles. The distance of a spine location from the center refers to its shortest-path distance (which would be along the spine) to the food particle on the triangular lattice. For each integer r ≥ 1, the hexagon of radius r refers to the regular hexagon with corners defined by the six spine locations of distance r from the center. The distance of a non-spine location from the center would then be the radius of the smallest such hexagon it is contained within. An important concept that we will use in the proof is the length of a spine. The length of a spine is defined to be the distance of its anchor particle to the center. If it has no anchor particle, the length of the spine is 0.
We notate the six spines using one of the spines as a reference spine. If the reference spine is denoted S i , where i is an integer modulo 6, then S i+1 , S i+2 , . . . , S i+5 denote the subsequent spines in a counterclockwise order from S i .
The proof centers around a specific transformation we call a "comb" operation. This  The comb operation is applied in to the five points marked with crosses in Figure 9a from left to right in sequence, starting from (x1, y1). Figure 9b illustrates the end result.
comb operation is applied from one spine (which we refer to as the source spine) to an adjacent spine (which we refer to as the target spine), and has the effect of "pushing" the particles between the two spines towards the target spine.
Our system exhibits reflection symmetry and 6-fold rotational symmetry, so this comb operation can be defined in 6×2 = 12 different ways. However, for simplicity of discussion, we will only define the comb operation in one orientation, specifically on the left side, downwards. This is a comb from the spine going in the up-left direction to the spine going into the down-left direction. We rotate or reflect the configuration freely, depending on which pair of adjacent spines we want to comb between.

C.1 The comb operation
We define our two-dimensional coordinate system (lane, depth) with reference to the source spine, assumed to be going in the up-left direction. A position ( , 0) for ≥ 0 refers to the position on the source spine steps away from the food particle. If < 0, this refers to the position − steps in the direction of the spine directly opposite the source spine. A position ( , d) refers to the location d steps downwards from position ( , 0). Thus, d denotes the (signed) distance of the position from the source spine. Before we define the comb operation, the following definitions tells us what can and cannot be combed.  With this, we can define the comb procedure. Aside from operating only below a given depth, this comb procedure is identical to the process used the proof of irreducibility in [7]. As this operation is covered in detail in said paper, we will be brief with its explanation here.

The comb operation:
The comb procedure (applied to a combable position ( , d)) has two phases, line formation and line merging. After the line formation phase, the first two conditions for ( , d) to be combed will be satisfied by the configuration (Figure 11a). The line merging phase gives us the third condition ( Figure 11b).
Line formation Let L denote the set of particles on lane on or below ( , d). The particles in L can be grouped into connected components within L. The line formation phase operates from top to bottom on L, removing the topmost particle of each component with size greater than 1 at each turn, until every component on L has size 1. We maintain the invariant that ( + 1, d + 1) is combed after each turn, while reducing the number of particles in L by 1.
We call a site "shiftable" if there is a particle on the site, and it has exactly two neighboring particles, one directly below and one directly up-right of it. In a turn, there are two possible cases. Denote by p the topmost particle of the topmost component with size greater than 1.
If p is shiftable, we apply what we call a "shift", which moves a set of particles on a line either down-right or up-right, so that p either becomes unoccupied or non-shiftable. To apply a shift, we consider the sequence of sites p = p 1 , p 2 , . . . , where each site p i+1 is exactly two steps down-right of site p i . Let k be the largest integer such that all of the sites p 1 , p 2 , . . . , p k are shiftable. Figures 10a, 10b and 10c illustrate examples where k = 2. Consider the first non-shiftable site p k+1 in the sequence, and the sites directly above and directly down-left of p k+1 , which we will call p U k+1 and p DL k+1 respectively. If p k+1 is unoccupied or either of p U k+1 or p DL k+1 are occupied, then moving p k one step down-right is a valid move (Figures 10a, 10b).
We can thus go backwards through the sequence from p k to p 1 , moving each particle one step down-right, ending with shifting p = p 1 one step down-right, so that the site p originally was occupying now becomes unoccupied. On the other hand, if p k+1 is occupied but p U k+1 and p DL k+1 aren't, as p k+1 is non-shiftable, the remaining three neighbors (down, down-right and up-right) must form a single component, meaning moving p k+1 one step up-left is a valid move (Figure 10c). We can then subsequently move each particle from p k+1 to p 2 one step up-left, culminating in p = p 1 becoming non-shiftable, leading in to the second case which we will describe next. Note that after a shift, the invariant that ( + 1, d + 1) is combed still holds.
If p is not shiftable, by the invariant we maintain, the sites above, up-left and down-left of p must be unoccupied, while the site directly below p is occupied. Thus, if the site up-right of p is occupied, so must the site down-right of p. As ( + 1, d + 1) is combed, the component on L p belongs to will have no particles down-left of it, except for potentially one line of particles extending from the bottommost particle of the component. The particle at p can thus be moved down-left, down along the component on L p belongs to, then down-left to reach the end of the beforementioned line if it exists, and down once more to join the end of this line (Figure 10d). In all, this reduces the number of particles in L by 1, while maintaining the invariant that ( + 1, d + 1) is combed.
Thus, after the line formation phase, every component in L will have exactly 1 particle, while ( + 1, d + 1) remains combed. As the site above ( , d) is empty, the first two conditions for ( , d) being combed are satisfied. The line merging phase will give us the third condition. Figures 11a and 11b illustrate configurations before and after the line merging phase.
Line merging Let C denote the column of sites directly to the right of ( , d). The lines extending down and left in the residual region of ( , d) may extend from particles in C that are not the bottommost particles of their respective components. To fix this, the line merging phase processs these lines from the lowest to the highest. To move a line downwards by one step, the particles of the line are shifted down one by one, starting from the rightmost particle of the line and ending with the particle on the end of the line. These moves are always possible as long as there is no line directly below the current line. If there is a line directly below, we merge the current line into the line below by moving the particles one at the time to the end of the line below with a straightforward sequence of moves, starting with the leftmost particle of the current line.  The description of the comb procedure above gives us the following Lemma: Lemma 46. After executing a comb operation on a combable position ( , d), the position ( , d) will be combed (Definition 44).
The following Lemma states that combs only affect sites below it.
( , d) Figure 12 Illustration of the unaffected region above the position to be combed ( , d) from Lemma 47, and an unenterable region R ( 2 ,d 2 ) from Lemma 53 corresponding to some position ( 2, d2) strictly to the right of ( , d). Both of these regions include the boundaries drawn in the Figure. Lemma 47 (Unaffected Region Above). Consider the two half-lines extending down-left and down-right from a combable position ( , d) as in Figure 12. A comb operation on ( , d) will not affect (will not move any particle into or out of) any site above these lines, not including the lines themselves. In addition, if the site ( − 1, d) (one step directly down-right) is occupied, no site on the half-line going down-right from ( − 1, d), including ( − 1, d) itself, will be affected either.
Proof. We observe that in the comb procedure, aside from the "shift" moves, all of the moves occur only within the residual region of ( , d). The shift moves only go down-right or up-left, and if the shift originates from some position p, the shift does not move any particle up-left from p. Hence, the shifts also do not affect any site above the two half-lines described in the Lemma.
We observe that the only part of the procedure that can affect particles on the half-line going down-right from ( − 1, d) is a potential shift move on a particle on position ( , d). However, if ( − 1, d) is occupied, ( , d) will not be shiftable, and so this shift move will not occur.
To apply a sequence of comb operations to "push" particles down towards the target spine, we only need to find a (not necessarily straight) "line" of vacant positions. The following definition and lemma makes this more formal.
Lemma 48 (Combable Sequence). Consider a sequence of pairs ((x 1 , y 1 ), (x 2 , y 2 ), . . . , (x k , y k )), where each item in the sequence represents a (lane, depth) pair. We call this a combable sequence if: 1. x 1 vertically coincides with the leftmost particle of the configuration. 6. For each i ∈ {1, 2, . . . , k}, if y i = 0, then the position (x i − 1, 0) must be occupied by a particle. An example of such a sequence is illustrated in Figure 9a.

Lemma 50 (Combability of Each
Step in a Sequence). When combing a combable sequence ((x 1 , y 1 ), (x 2 , y 2 ), . . . , (x k , y k )) as described in Definition 49, when (x i , y i ) is the next position to be combed, (x i , y i ) will be combable.
Proof. We first note that for any i, by the definition of a combable sequence, the location directly above (x i , y i ) must be empty, and if y i = 0, then (x i − 1, 0) is occupied. These two conditions continue to be true even as combs 1, . . . , i − 1 are executed, as by Lemma 47, none of these prior combs will affect (x i , y i − 1) or (x i − 1, y i ). This covers two of the conditions necessary for (x i , y i ) to be combable.
When i = 1, (x 1 , y 1 ) is clearly combable as there are no particles to the left of x 1 , and the site directly above (x 1 , y 1 ) is empty.
For i ≥ 2, as (x i−1 , y i−1 ) was combed in the previous step, (x i−1 , y i−1 ) is combed (Lemma 46). There are two cases for y i . If y i = y i−1 − 1, then (x i + 1, y i + 1) = (x i−1 , y i−1 ) is combed. On the other hand, if y i = y i−1 , then (x i + 1, y i ) = (x i−1 , y i−1 ) is combed. As (x i , y i − 1) is unoccupied, every location starting from (x i + 1, y i ) extending down-left must also be unoccupied, which implies (x i + 1, y i + 1) is combed. This gives us our final condition, so (x i , y i ) is combable.
In addition to the two properties of the comb operation given as Lemmas 46 and 47, we state and show a few more properties of the comb operation that we will use later in the proof.
Lemma 51 (Combing and Spine Lengths). After executing a comb on some position ( , d) where d < , the length of the spine going down-left will be at most − 1.
Proof. Let S denote the spine going down-left. The coordinates ( , ) denotes the position on the spine S vertically below ( , d). If ( , ) is empty after the comb, then every site down-left of ( , ) is also empty, so the spine S has length at most − 1. If ( , ) is not empty after the comb, ( , d) being combed ensures that ( , ) and every particle on the spine S down-left of ( , ) are tail particles, so spine S has length at most − 1.
Lemma 52 (Preservation of the Rightmost extent). Let denote the lane (x-coordinate) of the rightmost particle of a configuration. After a comb operation is applied, the lanes to the right of (sites with lane less than ) will continue to be empty.
Proof. Consider a comb applied to some position ( * , d). As we enforce that * > 0 for a comb, this position is necessarily to the left of the food particle, while the rightmost particle of the configuration must be either on the same lane as the food particle or further right. All moves aside from the "shift" moves in a comb procedure of a position ( * , d) operate only within the residual region of ( * , d), and so will not affect any site on lane or further right.
In the shift moves, a particle is only moved rightward (down-right) if it is shiftable. A shiftable particle must have a particle directly up-right of it, so a shift move cannot move a particle rightward of . ( , d). Consider the region R ,d containing every location on or below these lines (Figure 12).

Lemma 53 (Unenterable Region Below). Consider a position ( , d) and the diagonal halflines extending down-left and down-right from
If the region R ,d is unoccupied, if a comb operation is applied on a lane strictly to the left of lane , R ,d will continue to be unoccupied after the comb.
Proof. For the shift movements in the line formation phase, a particle is only moved downright if it is shiftable, which means it must have a particle directly below it. Thus, R ,d cannot be entered from the left side (left of lane ) by this movement unless there is already a particle in R ,d . In addition, as the shift movements only move particles down-right or up-left, it cannot move particles into R ,d from the right side (right of lane ).
For the other movements in the comb operation, we only need to consider possibly entry into R ,d from the left side, as these movements occur only within the residual region of the comb, which is strictly to the left of ( , d).
In the line formation phase, only down-left and downward movements are used. Down-left movements cannot enter R ,d , and downward movements only occur when there is a particle directly down-right of the particle to be moved.
In the line merging phase, we simply need to consider the end state of the comb. The end state consists of straight lines stretching down-left from the lane (column) one lane right of the lane to be combed. All of the particles in this lane are above R ,d after the line formation phase, and as ≤ , all lines stretching down-left from these particles will also be above R ,d .

C.2 Using combs to show ergodicity
Our objective is to show that from any (connected) configuration, there exists a sequence of valid moves to transform the configuration into a straight line with the food particle at one end. As valid moves cannot introduce holes into a configuration, and all valid moves between hole-free configurations are reversible, this would imply that one can transform any connected configuration of particles into any hole-free configuration of particles using only valid moves. We proceed by showing that we can always reduce the minimum spine length of any configuration with a series of moves to reach a straight line of particles.
Lemma 54. If the minimum spine length of a configuration is at least 1, there exists a sequence of moves to reduce the minimum spine length of the configuration.
To reduce the minimum spine length of the configuration, we execute spine combs in a specific order. Pick a spine of minimum length and denote it as S 0 . We apply spine combs in a counterclockwise order, from S 0 to S 1 , followed by S 1 to S 2 , and so on. When applying comb a comb operation from a source spine S i to a target spine S i+1 , as always, for ease of analysis, we will treat S i and S i+1 as the spines going in the up-left and down-left directions from the food particle respectively.
Definition 55 (Spine Comb). Let r denote the length of the source spine S 0 . Let r t denote the distance of the furthest out particle on the source spine from the food particle (hence the particles of distances r + 1, . . . , r t are the tail particles).
A spine comb applies a comb on the combable sequence ((x 1 , y 1 ), (x 2 , y 2 ), . . . , (x k , y k )), where x 1 vertically coincides with the leftmost particle of the configuration, x i = x 1 − i + 1 for each i ∈ {2, 3, . . . , k}, x k = r + 1, y i = 1 whenever x i > r t , and y i = 0 when r + 1 ≤ x i ≤ r t . From the definition of tail particles one can easily verify that this (x i , y i − 1) is vacant for f (a) Gap between spines.  each i ∈ {1, 2, . . . , k}. Figure 9 illustrates configurations before and after a spine comb is applied.
Lemma 56. Consider a spine comb from a source spine of length r. After the spine comb, the position (r + 1, 1) will be combed. Also, the region between (and including) the two half-lines extending up-left and down-left indefinitely from the position (r + 1, 0) will be empty.
Proof. The last comb operation is on position (r + 1, 1) or (r + 1, 0). If it is the former, (r + 1, 1) will be combed (Lemma 46). If it is on the latter, as none of the comb operations will affect the site (r, 0) directly down-right of the last comb position, (r, 0) will remain occupied by a particle. As (r + 1, 0) is combed, there will be no particles on the diagonal stretching down-left from (r + 1, 0). Hence, (r + 1, 1) is also combed.
The region described in the lemma can be divided into "files", diagonal lines going down-left. Consider any site (x, y) in this region. If (x, y) is in the lowest file of the region (on the diagonal extending down-left from (r + 1, 0)), as (r + 1, 1) is combed, (x, y) must be unoccupied. Otherwise, if (x, y + 1) is in the same file as some position in the combable sequence, let (x i , y i ) be the last position in the sequence in the same file as (x, y + 1). After (x i , y i ) is combed, (x, y) must be empty. Subsequent combs will not affect (x, y) by Lemma 47. If (x, y + 1) is not in the same file as any position in the combable sequence, (x, y) must be empty as (x 1 , y 1 ) is vertically aligned with the leftmost particle of the configuration. Similarly by Lemma 47, none of the combs will move a particle into (x, y). Hence, (x, y) will be empty after the spine comb in all cases.
After a spine comb is applied, there are two possible cases, having a gap in the line (defined next), and not having a gap in the line. If there is a gap in the line, we show that we can directly reduce the minimum spine length of the configuration from here, giving us the result of Lemma 54. Hence, we can proceed with the rest of the proof of Lemma 54 assuming that there will never be a gap in the line.
Definition 57 (Gap in the line). Let r be the length of the source spine S i . Consider the vertical line segment of sites from the location of the anchor particle of S i down to the site on the target spine S i+1 of distance r from the center, including the two spine location endpoints. If there is a site on this line segment that is unoccupied by particles, we say that there is a gap in the line from the source spine to the target spine.
Lemma 58 (Reducing minimum spine length using a gap). After a spine comb is applied from a source spine of minimum length, if there is a gap in the line from the source spine to the target spine, there exists a sequence of moves to reduce the minimum spine length of the configuration.
Proof. Let r denote the length of the source spine S i . Suppose that there is an unoccupied site (r, d) on this line segment. If the unoccupied site on the line segment is on the source spine S i (which actually never happens), as every site on the spine of distance greater than r will be unoccupied by Lemma 56, the new minimum spine length would be at most r − 1. If the unoccupied site is on the target spine S i+1 , as (r + 1, 1) is combed, every site of the target spine of distance greater than this unoccupied site would also be unoccupied. Hence the minimum spine length would also have decreased to at most r − 1 in this case.
If the unoccupied site (r, d) lies strictly between the source spine and the target spine, we apply one more comb on position (r, d + 1). Position (r, d + 1) is combable as (r, d) is empty, and (r + 1, 1) being combed ensures that all sites on the half-line extending down-left from (r, d) are also empty, so (r + 1, d + 1) is also combed. By Lemma 51, combing (r, d + 1) results in the target spine having length at most r − 1.
Thus, from now on we may assume that whenever a spine comb is executed from a source spine of minimum length, there will be no gaps in the line between the source spine and the target spine. In addition, we assume that the comb operations do not cause any other spine (in particular the spine going downwards) to end up with a spine length below the current minimum spine length, as in this case we have already achieved the result of Lemma 54. The following Lemma shows that such a spine comb "pushes" all of the particles of distance greater than the minimum spine length towards the target spine ore beyond.
Lemma 59 (Resulting configuration assuming no gap exists). Suppose that a spine comb is executed from a source spine S i (of minimal length r) to a target spine S i+1 , and assume that there are no gaps in the line between S i and S i+1 . In the resulting configuration, there will be no particles of distance greater than r strictly between the source spine and target spine, or on the source spine itself. Furthermore, the lengths of both the source spine and target spine will now be exactly r.
Proof. After the spine comb, position (r + 1, 1) will be combed, and the region between the down-left and up-left diagonals extending from (r + 1, 0) as described in Lemma 56 will be empty. As there is no gap in the line from S i to S i+1 , the only lines extending left and down in the residual region of (r + 1, 1) will be on the target spine or below, giving us the first part of this Lemma.
The length of the source spine is r as position (r, 0) is occupied while no position on the source spine beyond that is. For the length of the target spine, the position on the target spine of distance r from the food particle is occupied and is not a tail particle, and by Lemma 54, (r + 1, 1) being combed implies that the target spine has length at most r.
As a spine comb sets the length of the target spine S i+1 to be the same as that of the source spine S i , which has minimum length, we can continue executing spine combs in a counterclockwise fashion, from S i+1 to S i+2 , followed by S i+2 to S i+3 , and so on. We show that after seven of these spine combs which do not create gaps, we will reach a type of configuration we will call a hexagon with a tail. Figure 14 illustrates examples of these "hexagon with a tail" configurations, though one should note that it is not necessary for all sites on the outer hexagon to be filled.    Definition 60 (Hexagon with a Tail). We say a configuration forms a has the "hexagon with a tail" arrangement of radius r if: All spines have length exactly r.
There are tail particles on at most one of the spines. Aside from these tail particles, there are no particles of distance greater than r from the center. If r = 0, this "regular hexagon" comprises of only the food particle. In other words, a hexagon with a tail of radius r has all of the particles extending in a straight line from the food particle.
Lemma 61 (Reaching a Hexagon with a Tail). After seven spine combs in a counterclockwise order starting from a spine of minimum length r, assuming that no gaps in the lines are formed and that no spine ends up with length below r in the process, we will end up with a hexagon with a tail arrangement of radius r.
Proof. We will denote the starting spine as S 0 , and name the remaining spines S 1 to S 5 in counterclockwise order. The spine combs hence go from S 0 to S 1 , from S 1 to S 2 and so on, with the final (seventh) comb being from S 0 to S 1 . Spine S 0 is assumed to be a minimum length spine, of length r.
By Lemma 47, a spine comb from spines S i to S i+1 will only affect particles on spines S i , S i+1 , S i+2 , and the particles between spines S i and S i+1 , between spines S i+1 and S i+2 , and between spines S i+2 and S i+3 . Note that this does include the particles on spine S i+3 . Hence, the first four spine combs will not affect the result of the first spine comb from S 0 to S 1 .
On the fifth spine comb from S 4 to S 5 , as usual without loss of generality we take S 4 to be the spine going up-left and S 5 to be the spine going down-left. Spine S 0 will thus be going downwards and spine S 1 will be going down-right. Due to the effects of the first three combs, there will be no particle further right than the anchor particle of spine S 1 . By Lemma 52, while the fifth spine comb may move particles onto spine S 0 or the region between spines S 0 and S 1 , none of these particles in the resulting configuration will be further right than the anchor particle of spineS 1 .
On the sixth spine comb from S 5 to S 0 , taking S 5 to be going up-left and S 0 to be going down-left, consider the position (−r − 1, 0), which is one particle down-right of the anchor particle of the down-right spine S 2 . The region R −r−1,0 , as defined in Lemma 53, will be empty after the fifth spine comb, due to what we have just shown to happen after the fifth spine comb. By Lemma 53, this region will continue to be empty after the sixth spine comb.
On the seventh and final spine comb from S 0 to S 1 , take S 0 to be going up-left and S 1 to be going down-left. Consider the positions (r, 0) and (r, r), which are on the source spine S 0 and target spine S 1 respectively, of distance r from the center. As a result of the sixth spine comb with Lemma 59, all particles of distance greater than r from the center must lie between (inclusive) the two diagonal lines going up-left from the positions (r, 0) and (r, r). Now, from the position (r, r + 1) which lies directly below (r, r) and the position (−r − 1, 0), which lies on spine S 3 of distance r + 1 from the center, we consider the two regions R r,r+1 and R −r−1,0 as in Lemma 53. Both of these regions are initially empty, and so will remain empty after the seventh comb. By Lemmas 47 and 59, the only place where particles of distance greater than r can be are on the target spine S 1 .
As we had assumed that no spine will have ended up with length less than r in the process, this means we have reached a hexagon with a tail arrangement of radius r.
The following Lemma then concludes the proof that we can always reduce the minimum spine length, provided that the current minimum spine length is at least 1.
Lemma 62. From a hexagon with a tail arrangement of radius r ≥ 1, there exists a sequence of moves to reduce the minimum spine length by 1.

Proof.
Consider the set H of positions of distance exactly r from the center. This set of positions is in the shape of a hexagon. If one of these sites is unfilled, without loss of generality assume this site (r, d) is on the left side of the hexagon (it is not on a corner as all spines have length r). The site (r, d + 1) is combable, which by Lemma 51 gives us a way to reduce the length of the spine going down-left to at most r − 1.
If no such gap in H currently exists, we show that we can create such a gap. If r = 1, pick any particle on the hexagon H aside from the one on the spine the tail is on. This particle can be moved to a vacant spot between two spines, reducing the minimum spine length to 0.
Otherwise, as the configuration is assumed to be connected, there is a path of particles from the center (food) particle to a particle on H. This implies that there is a particle of v −2 distance r − 2 from the center adjacent to a particle v −1 of distance r − 1 from the center. Note that if r = 2, v −2 will be the food particle. If v −1 is adjacent to a corner particle of the hexagon H, assuming without loss of generality that this corner is on the spine going up-left, we can move this corner particle one step down-left, and if there are any tail particles attached to this corner particle, they can then subsequently be moved one-by-one one step down-left as well (Figure 14a). This reduces the minimum spine length to at most r − 1.
If v −1 is not adjacent to a corner particle of H, we note that v −1 and v −2 will share a neighboring site u −1 of distance r − 1 from the center. The sites u −1 and v −1 share a neighbor particle v 0 on H. If site u −1 is unoccupied, particle v 0 can be moved into site u −1 , creating a gap in the hexagon H (Figure 14b). If u −1 is occupied, v 0 can be moved in the opposite direction of u −1 , to a position u +1 of distance r + 1 from the center, creating a gap in the hexagon H (Figure 14c).
In both of these cases, by reflection and rotational symmetry, without loss of generality, this newly created gap v 0 is on the left wall of the hexagon H, and if the particle was moved to u +1 , u +1 is directly up-left of v 0 . The site directly below v 0 is thus combable, and by Lemma 51, combing this reduces the minimum spine length to at most r − 1.
Finally, we show that we can reach a straight line of particles, thus showing ergodicity of the chain since the chain is reversible.
Lemma 63. From any connected configuration of particles with one single immobile (food) particle, there exists a sequence of valid moves to transform this configuration into a straight line of particles with the food particle at one end.
Proof. Applying Lemma 54 repeatedly allows us to arrive at a configuration with minimum spine length 0. Applying Lemma 61 from here gives us a hexagon with a tail arrangement of radius 0, which is a straight line of particles with the food particle at one end.
We observe that the direction in which the final tail faces is irrelevant, as there is a simple sequence of moves to change the direction of the tail, by moving the particles one by one to the location of the new tail, starting from the particle at the very end of the initial tail. This thus allows us to conclude Lemma 16, which also implies that the Markov chain is irreducible.
(a) All particles in dispersion state.
(b) Six food particles placed.
(c) All particles in compression state. (d) One food particle moved, dispersion starts.
(e) Cluster fully dispersed. (f) All particles have rejoined other clusters.

Figure 15
Simulation of Adaptive α-Compression with multiple food particles. The images are in chronological order and the simulation continues in Figure 16. Dispersion state particles are in yellow, compression state particles are in red with a growth ticket and in blue without, and dispersion token state particles are in purple. The food particle is drawn slightly larger and is in green.
(a) Three food particles moved, dispersion starts. (b) Three clusters fully dispersed.
(c) All particles have rejoined other clusters.
(d) All food particles moved, dispersion starts.
(e) Dispersion in progress.
(f) All particles fully dispersed.

Figure 16
Continuation of the simulation of the Adaptive α-Compression algorithm in Figure 15.