Efficient Assignment of Identities in Anonymous Populations

David Doty, Mahsa Eftekhari, Othon Michail, Paul G. SpirakisarXiv 2022 · DOI

Abstract

Population protocols are a standard model for distributed computing in networks of anonymous, computationally limited agents. A fundamental problem in this model is size counting: determining the exact number of agents $n$ in the population. While fast protocols exist for "non-uniform" settings where an estimate of $n$ is known, "uniform" protocols—those that work for any $n$ without prior knowledge—have traditionally been slow, requiring at least linear time. This paper presents the first uniform population protocol that calculates the exact population size in nearly logarithmic time, specifically $O(\log n \log \log n)$. This is achieved through a novel combination of unique identity generation, leader election, and fast averaging.

Introduction

In the population protocol model, agents interact in random pairs. This model is particularly relevant for systems like chemical reaction networks or sensor swarms where centralized control is impossible. A core challenge is the "chicken-and-egg" problem of size counting: to count the population quickly, protocols typically require a rough estimate of $n$ to set internal parameters (like timer thresholds). However, obtaining this estimate is itself a form of counting.

Previous research showed that if agents have no prior knowledge of $n$, the time required to count or even elect a leader was $O(n)$. This paper breaks this barrier by introducing a protocol that "self-bootstraps," growing its memory and complexity as it discovers more about the population size.

The ExactCounting Protocol

The proposed solution, EXACTCOUNTING, operates by running several sub-protocols in parallel. Each agent maintains a state that includes a unique code, a leader code, and various numerical values for averaging and timing.

The main ExactCounting protocol coordinates sub-protocols for identification, leader election, averaging, and timing.

As shown in Protocol 1, every interaction triggers four main components:

  1. UniqueID: Generates and extends random bitstrings to ensure agents eventually have distinct identities.
  2. ElectLeader: Uses these identities to elect a unique leader (the agent with the lexicographically largest code).
  3. Averaging: A density-estimation process where a leader introduces a large value $M$ into the system, which is then averaged across all agents.
  4. Timer: A phase clock that prevents agents from outputting a count until the averaging process has likely converged.

Unique Identification and Level-Doubling

A key innovation is the UniqueID subprotocol. To avoid the slow $O(n)$ time of standard ID generation, the authors use a "level-doubling" strategy.

The UniqueID subprotocol ensures that agents with colliding codes extend their identities to maintain uniqueness.

When two agents with the same code $C$ meet, they don't just add one bit; they double the length of their code (or extend it to match the other agent's length). This exponential growth allows the protocol to reach the necessary $\log n$ depth in only $O(\log \log n)$ stages. Each stage takes $O(\log n)$ time, leading to the overall nearly logarithmic complexity.

Leader Election and Restarts

Because the UniqueID process is dynamic, the "leader" can change frequently in the early stages. To handle this volatility, the protocol uses a restart mechanism. Whenever an agent's leader code (LC) changes—indicating a new potential leader has been discovered—the downstream Averaging and Timer protocols are reset. This ensures that the final count is based on a stable leader.

Results and Complexity

The protocol achieves exact counting in $O(\log n \log \log n)$ parallel time with high probability. In terms of state complexity, the primary protocol uses $O(n^{60})$ states. While this constant is large, it translates to approximately $60 \log n$ bits of memory per agent, which is theoretically efficient. The authors also demonstrate a trade-off: by slowing the growth rate, the state complexity can be reduced to $O(n^9)$ while maintaining $O(\log^2 n)$ time.

Conclusion

This work represents a significant step forward in population protocol theory by proving that sublinear-time exact counting is possible without prior knowledge of the population size. Future work includes reducing the high constant factors in state complexity and developing "terminating" protocols where agents can definitively know when the counting process is complete.

Summary updated

Abstract

We consider the fundamental problem of assigning distinct labels to agents in the probabilistic model of population protocols. Our protocols operate under the assumption that the size n of the population is embedded in the transition function. Their efficiency is expressed in terms of the number of states utilized by agents, the size of the range from which the labels are drawn, and the expected number of interactions required by our solutions. Our primary goal is to provide efficient protocols for this fundamental problem complemented with tight lower bounds in all the three aspects. W.h.p. (with high probability), our labeling protocols are silent, i.e., eventually each agent reaches its final state and remains in it forever, and they are safe, i.e., never update the label assigned to any single agent. We first present a silent w.h.p. and safe labeling protocol that draws labels from the range [1,2n]. Both the number of interactions required and the number of states used by the protocol are asymptotically optimal, i.e., O(n log n) w.h.p. and O(n), respectively. Next, we present a generalization of the protocol, where the range of assigned labels is [1,(1+ε) n]. The generalized protocol requires O(n log n / ε) interactions in order to complete the assignment of distinct labels from [1,(1+ε) n] to the n agents, w.h.p. It is also silent w.h.p. and safe, and uses (2+ε)n+O(n^c) states, for any positive c < 1. On the other hand, we consider the so-called pool labeling protocols that include our fast protocols. We show that the expected number of interactions required by any pool protocol is ≥ (n²)/(r+1), when the labels range is 1,… , n+r < 2n. Furthermore, we provide a protocol which uses only n+5√ n +O(n^c) states, for any c < 1, and draws labels from the range 1,… ,n. The expected number of interactions required by the protocol is O(n³). Once a unique leader is elected it produces a valid labeling and it is silent and safe. On the other hand, we show that (even if a unique leader is given in advance) any silent protocol that produces a valid labeling and is safe with probability > 1-(1/n), uses ≥ n+√{(n-1)/2}-1 states. Hence, our protocol is almost state-optimal. We also present a generalization of the protocol to include a trade-off between the number of states and the expected number of interactions. Finally, we show that for any silent and safe labeling protocol utilizing n+t < 2n states, the expected number of interactions required to achieve a valid labeling is ≥ (n²)/(t+1).
BibTeX
@misc{doty2022efficient,
  author = {David Doty and Mahsa Eftekhari and Othon Michail and Paul G. Spirakis},
  title = {{Efficient Assignment of Identities in Anonymous Populations}},
  year = {2022},
  eprint = {1805.04832},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.04832},
}
Figure