← All papers
First page of Computation in Anonymous Directed Dynamic Networks: Exact Worst-Case Termination Time and Network-Wise Intractability

Computation in Anonymous Directed Dynamic Networks: Exact Worst-Case Termination Time and Network-Wise Intractability

Giuseppe A. Di Luna, Giovanni Viglietta

cs.DC Nov 1, 2026 · v1
All results, including the termination bounds and coNP-completeness, are formally proved in Lean, with AI assistance, in a public repository.
We determine the exact round complexity of Counting in anonymous directed dynamic networks. Agents have no identifiers, but $\ell\geq1$ of them are designated as leaders. Every agent knows $\ell$ and its own leader status, while the population size $n$ is unknown and has to be determined by the agents. Communication proceeds in synchronous rounds; the directed communication graph may change arbitrarily and unpredictably from one round to the next, but is assumed to remain strongly connected. We solve Counting with a distributed algorithm that makes every agent output $n$ and halt after a number of rounds equal to $\begin{cases} n&\text{if }n=\ell\\ 2n-1&\text{if }n>\ell\text{ and }\ell=1\\ 2n-2&\text{if }n>\ell\text{ and }\ell\geq2. \end{cases}$ The algorithm works even for networks with loops and parallel arcs and even when agents learn their outdegree only after sending. We prove that this bound is worst-case tight over directed multigraphs for every $n$ and $\ell$ with $1\leq\ell\leq n$. Moreover, the local computation is polynomial (provided that each communication multigraph has at most $2^{\operatorname{poly}(n)}$ arcs): in every round, each agent solves at most one linear system with up to $n$ variables. By standard techniques, solving Counting also enables the evaluation of any computable function of the multiset of agents' input values within $2n-1$ communication rounds. The bound above optimizes the worst case over all networks. For an individual network, we show that even deciding whether an agent already has enough local information to determine $n$ is $\mathsf{coNP}$-complete (provided that the numbers of parallel arcs are encoded in binary). Thus, worst-case-optimal Counting admits polynomial local computation, whereas exact network-wise optimization is intractable under standard complexity assumptions.

Determine the exact worst-case round complexity of Counting in anonymous directed dynamic networks with ell known leaders, where the communication multigraph changes arbitrarily each round but stays strongly connected. Also determine the complexity of deciding, for a specific network, whether an agent's local information already fixes the network size n.

Agents build history-tree vistas and test candidate sizes m at round 2m-1. Each test anchors on a flat level, solves a linear flow-balance system for anonymities, propagates the values backward and checks the suffix. Matching lower bounds come from explicit multigraph constructions. Network-wise optimality is studied through order spectra of vistas, using polynomial-size history-tree certificates. All results are formalized in Lean with help from an AI assistant.

Counting terminates in exactly n rounds if n = ell, 2n-1 rounds if ell = 1 < n, and 2n-2 rounds if 2 <= ell < n, and these bounds are tight over directed multigraphs. Local computation per round is polynomial, at most one linear system per agent. Deciding whether a vista determines n (AtMostOneVista) is coNP-complete, even for realizable vistas with one leader.

Network modelLeadersTermination boundReference
Undirected multigraphsell=13n-2[11]
Directed simple graphs1<=ell<=n2^{O(n log n)}[32]
Directed multigraphsell=nnThis work
Directed multigraphsell=1<n2n-1This work
Directed multigraphs2<=ell<n2n-2This work
Termination bounds for Counting in anonymous dynamic networks