Abstract 1 Introduction 2 Model and Problem 3 Algorithms that Use Nearly 𝒏 Random Bits in Total 4 Lower bounds and a Complementary Algorithm for General Graphs 5 Main Technical Tool: Strongly-Separable Blocks in a Matrix 6 Conclusion References

What Is the Minimum Number of Random Bits Required for Computability and Efficiency in Anonymous Networks?

Dariusz R. Kowalski ORCID School of Computer and Cyber Sciences, Augusta University, GA, USA Piotr Krysta111Piotr Krysta is also affiliated with University of Liverpool, Liverpool, UK. ORCID School of Computer and Cyber Sciences, Augusta University, GA, USA Shay Kutten ORCID Faculty of Data and Decision Sciences and GTEP program, Technion, Haifa, Israel
Abstract

Angluin (STOC’80) and Yamashita and Kameda (PODC’88) show that some useful distributed tasks are impossible (for deterministic algorithms) in a general network if nodes do not possess unique identifiers. However, any task decidable in the non-distributed context, can be solved deterministically if the network has a unique leader. Alternatively, much research has been devoted to randomized distributed algorithms in anonymous networks. We present tight upper and lower bounds for the fundamental question: How much randomness is necessary and sufficient to solve Leader Election (LE) in anonymous networks, i.e., to transform an anonymous network into a non-anonymous one? We prove that at least one random bit per node is required in some cases. Surprisingly, a single random bit is also enough, for a total of n bits, where n is the number of nodes. However, the time complexity of our (total of) n random bits algorithm for general networks turned out to be impractically high. Hence, we also developed time-efficient algorithms for the very symmetric graphs of cliques and cycles, paying only an additional cost of o(n) random bits.

The primary steps of our algorithms are of independent interest. At first glance, it seems that using one random bit per node, any algorithm can distinguish only two sets of nodes: those with 0 and those with 1. Our algorithms manage to partition the nodes into more than two sets with high probability. In some sense, they perform the task of a “distributed pseudorandom generator”, for example, one of our algorithms turns n bits, one per node, into n unique (with high probability) numbers. Even though a complete graph looks very symmetric, the algorithms explore interesting asymmetries inherent in any n permutations (of n values each), if each describes the assignment (by the adversary) of ports in a node to edges leading to neighbors.

Finally, we show how to transform any randomized algorithm that generates xn+o(n) random bits in total to one where each node generates at most x+1 bits. Our results apply to both synchronous and asynchronous networks.

Keywords and phrases:
Distributed computability, Anonymous Networks, Randomness, Leader Election
Category:
RANDOM
Funding:
Shay Kutten: Shay Kutten was supported in part by grant 1346/22 from the Israeli Science Foundation.
Copyright and License:
[Uncaptioned image] © Dariusz R. Kowalski, Piotr Krysta, and Shay Kutten; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Distributed algorithms
; Computing methodologies Distributed algorithms
Acknowledgements:
We thank Omer Reingold for his help in tailoring the universal exploration sequence to our needs. Shay Kutten was supported in part by grant 1346/22 from the Israeli Science Foundation. His research was carried out within the framework of Grand Technion Energy Program (GTEP). A part of the work was carried out while with Fraunhofer SIT, Darmstadt, Germany.
Editors:
Alina Ene and Eshan Chattopadhyay

1 Introduction

Symmetry-breaking tasks (e.g., “out of competing processes, who gets the access to a resource that cannot be shared?”) lie at the heart of distributed computing. They are necessary for scheduling, voting, overcoming partitions in replicated databases and group services, and much more. Their solution can also reduce the complexity of many distributed algorithms. Inherently, symmetry-breaking tasks can only be solved using randomization, unless processes are initially different, e.g., each possessing a unique identifying number (ID) [4, 17, 35]. Hence, finding the minimum amount of randomness necessary to solve symmetry-breaking tasks characterizes the boundary between what is (distributively) computable and what is not. Specifically, the task of electing the leader (a single unique node) is complete for solvability in the sense that its solution allows the solution of every distributed task (which is solvable in the non-distributed context).222This fact is well known; let us explain briefly how, for completeness. The leader initiates a depth-first search (DFS) network traversal, giving each node a unique (DFS) number. Then, each node broadcasts all its information (e.g., its input, if any, and the DFS numbers of its neighbors), identifying itself by using its DFS number. The leader thus learns all the information available anywhere in the network, computes any function, and broadcasts the solution. This paper addresses the technical question of the minimum randomness required to solve the Leader Election problem (LE).

Our algorithms’ primary step may be of interest in itself: in each node, they construct an ID that is unique with a very high probability. This is easy if each node flips some O(logn) random bits since those are independent between nodes. Our algorithms manage to compose unique IDs from bits that appear in the IDs of multiple nodes. Let us note that in [17], they managed to elect a leader using only about 2.441716n random bits, but using a biased coin (which may need additional random bits to simulate if only a fair coin is given). Further innovation allowed [2] to use only 4n random bits (generated by fair coins) in expectation. However, the maximum number of random bits used there in a single node may be Ω(logn) with high probability. In a sense, these algorithms generate unique IDs for only some of the nodes, while still using logarithmically many independent random bits per such an ID. Our new techniques, intuitively, carefully “recycle” random bits.

From the theoretical viewpoint, we find it intriguing that exactly one random bit in each node is the exact border between the (always) possible and the impossible (for some tasks in some networks). In fact, we managed to approximate this optimum by a factor 2 relatively easily (see Section 1.1), but going below a factor of 2 seemed difficult. We think that this task is still worthwhile, as is the case with similar questions in many other areas of theoretical computer science.333The case of non-distributed time complexity is an exception; there, one tends to ignore small constants since those depend on the specific kind of machine, e.g., the model of the computer. Let us name a few: going below a factor of 2 in the competitiveness of online algorithms (e.g., in [3], going from 1.945 to 1.923) possibly, not even reaching the optimum, or below 2 in approximation (e.g., [10]), or from 3 to 2 rounds of communication for cryptographic protocols (e.g., [12]), or even from a lower bound of n1 on the number of registers to that of n ([36]), or from f+2 rounds to f+1 (possible when f, the number of actual Byzantine faults is the same as t, the given bound on the number of faults) [11].

In addition to the general theoretical interest, let us mention the relatively recent interest in devices with limited capabilities. See, for example, Biologically inspired Distributed Algorithms (BDS), programmable matter, sensor networks, population protocols, etc. Many of those are even required to function using a constant memory size. Equipping such a system with some truly random source (e.g., with a device that can measure the decay of Cesium atoms) is out of the question. Similarly, it is unrealistic to expect such devices to make the cryptographic calculations required by a good pseudorandom generator. (Anyhow, a cryptographic pseudorandom generator at a node generally needs a seed of more than a constant number of bits, while such weak devices are often assumed to have only a constant-sized memory.) Even the previous O(n) algorithms needed Ω(logn) bits on some nodes, so they could not be used for such devices. However, nanofabricating each device with one random bit seems a realistic requirement.

We made several choices to help the reader. First, our results apply to both synchronous and asynchronous networks and to both general and complete networks. To simplify the exposition, we describe the results for synchronous networks; translating them to asynchronous ones is a known art [7]. We also describe a simplified algorithm (with weaker results) first and then generalize. We first describe algorithms for complete networks; those are also rather message and time efficient and may present the main technical difficulty. (They elect a leader with high probability (whp) but it is rather trivial to turn them into Las Vegas ones.) For general networks, we then show the lower bound. To show that the lower bound is tight for some networks, we describe a simpler algorithm for which the needed number of random bit in each node is exactly the lower bound (exactly 1 in each node). Unfortunately, the algorithm for a general network is very time and message inefficient (and it elects a leader whp). It, too, utilizes the idea of recycling the same random bits by multiple nodes while still ensuring independence between the bit strings used by different nodes.

Table 1: The number of random bits used in randomized leader election protocols. All results are whp except where noted differently. () always succeeds but complexity whp; () each node uses exactly 1 random bit and succeeds whp; λ(G) is a 2SEC index of G.
Paper Random bits Comments
Almost all, except below O(nlogn) various topologies
Itai and Rodeh [17] 2.441716n ring graph; unfair coin
Afek and Matias [2] 4n+o(n) general graph
  This paper, Sec. 1.1 2n+o(n) complete graph
This paper, Thm. 7 n+o(n) complete graph; ()
This paper, Thm. 14 n general graph; ()
This paper, Thm. 10, 13 n (lower bound) complete graph; Δ-regular graph G, λ(G)=Δ

1.1 Technical difficulty, approach and contribution

Existing techniques.

The typical leader election algorithm for anonymous networks (see Table 1 for a detailed comparison) has nodes first select some identity randomly and then proceed like deterministic ones. With this approach, it is difficult to get below O(logn) random bits per node. Our algorithm for general graphs manages to provide every node with an identity that is unique with high probability, even though each node generates only one random bit. Hence, in some sense, this algorithm performs the task of a “distributed pseudorandom generator” by turning n bits into n numbers of length Ω(logn) each, such that each of them is unique with a sufficiently high probability.

A different idea was used in [2]; in the first step, a node uses a geometric random process to decide how long the node’s random ID would be, and in the second step, tosses additional coins to compose that ID. The total number of random bits is 4n+o(n) in expectation. In the algorithm of [17] for a ring, the candidates collaborate to find a, the total number of candidates. Each candidate then tosses a non-symmetric coin and decides with probability 1/a to remain a candidate. This is repeated until there remains precisely one candidate. The number of unfair coin tosses is 2.441716n in expectation. That is, the approach of the two papers that saved on random bits (versus those that used O(nlogn)) was to separate candidates for leadership into two sets: winners and losers, that is, one of two different identities: either 0 or 1, using one coin per node. Then those algorithms recur. This approach (even after we improve it in Algorithm Splt12 below) seems doomed to use more than just one random bit at each node. Intuitively, our main algorithm for complete networks generates more than two different identities using one random bit per node. Again, in a sense, this does the work of a “distributed pseudorandom generator.”

Our preliminary approach – Algorithm Splt𝟏𝟐.

The following simple algorithm (described informally) Splt12 also has nodes toss again. However, the total number of fair coin tosses is reduced to 2n+o(n). Nevertheless, the main reason we present it is that it allows us to point out where we want to push the impact of the first bit a little further. Consider a set of n candidates for leadership. Very informally, if each draws one bit at random, the set splits into two: those who drew 1 and those who drew 0. If both sets are non-empty, have the larger of these two subsets stop being candidates, breaking symmetry by preferring those who drew 1 if the sizes are equal. We apply the algorithm recursively on the remaining subset until one node remains. It is easy to see that the total expected number of random bits used is 2n+o(n), since nodes who stop being candidates stop using random coins.

Speaking intuitively, Algorithm Splt12 performs a binary search. The main technical contribution in Algorithm Splt2Many, described next, is that we use a single bit per node to convert this search into a k-ary search for values of k that are larger than 2. For that, a node also uses random bits from other nodes. On one hand, a complete network is highly symmetric, thus it looks as if two nodes u,v use the random bit of some third node w, this should not help them in eliminating one of them. Surprisingly, we show that it does.

Our main approach for fully connected networks.

Algorithm Splt2Many manages to split the set of remaining candidates into more than two subsets on one coin flip per node, thus eliminating more than half of the candidates. We demonstrate this by first presenting a simpler analysis of the algorithm (Theorem 5 in Section 3.1), showing that tossing one bit per node can split the candidates into 3 subsets (so only those in the smallest subsets remain candidates). Theorem 7 in Section 3.2 takes this much further and shows the analogous property for values of k (chosen later) larger than 3 using more involved methods. We also show how to bound the maximum number of tokens generated by each node, see Section 3.3. Consider any integer value k3. Intuitively, we manage the above k-ways split by extracting information from the commonly assumed structure of ports [4, 34, 15]. Surprisingly, our algorithm manages to do that even in highly symmetric networks and even though the structure is assumed to be set by an adversary. In some more detail (see Section 2), the standard network models are graphs. The edges (v,x) that v is an endpoint of are numbered at v (the numbers range between 1 to v’s degree δ(v)). This numbering may be, in general, not consistent between v and the other endpoint x or any other node, as we allow the numbering to be chosen by an adversary. To emphasize this possible inconsistency, it is usually assumed that a node v does not send (or receive) messages over the edge numbered i (at node v), but instead over v’s port number i, which is connected by an edge to some node that the adversary chose at the beginning of the execution.

In a complete network, the adversarial decision of which edge of a node v[n1]={1,,n1} leads to which node, implies a permutation on the set of nodes, once we add v itself at the first position of the permutation. Let M be an n×n matrix containing these permutations as its columns, and let matrix M be decided by the adversary (observing the above rule of the first position). We term the technique by which we extract information from this structure, strongly-separable blocks. It may be of independent interest.

Main technical tool: strongly-separable blocks in a matrix.

Given matrix M of permutations and a parameter kn, our approach is to find in M a collection of b(n,k)=2k2 disjoint submatrices B1,,Bb(n,k), each of size k×k, where each submatrix Bi contains as its entries elements from a unique subset V(Bi)[n] of size |V(Bi)|=k; that is, for any ij, V(Bi)V(Bj)=.

We present an algorithm to constructively prove the existence of a collection of strongly separable blocks using a careful combination of the probabilistic method (Section 5.1) and a greedy recursive approach (Section 5.2). The consecutive blocks are constructed one by one considering “dominated and diverse” rows of M. A row of M is dominated roughly, if it contains a value v[n] that occurs in a relatively large fraction of positions in this row. A row is diverse if it contains at least two distinct values u,v[n], uv. We first prove, roughly, that if Matrix M (in fact, the remaining sub-matrix M of M), has no dominated and diverse rows and M is sufficiently large, we can find at least 2k2 strongly-separable blocks in M by using the probabilistic method.

Our main algorithm for constructing strongly-separable blocks uses a multi-stage recursion, see Section 5.2. We formulate an appropriate inductive assumption which, whenever it holds, allows us to keep choosing strongly-separable blocks within epochs, until 2k2 blocks are chosen or all rows in the remaining sub-matrix M are not dominated. If, during this recursive process, the remaining sub-matrix does not have any dominated and diverse rows, we finish up constructing the blocks by the above probabilistic argument.

Analysing Algorithm Splt2Many through the lenses of strongly-separable blocks.

For each i[n], we define Xi as a 0/1 fair coin random variable and study n-dimensional 0/1 vectors (X1,,Xn){0,1}n in the vector space over the field GF(2). By disjointness of the sets V(Bi), there exists a 0/1 assignment to variables Xj that implies existence of b(n,k) linearly independent vectors in this vector space. Each such vector corresponds to a submatrix Bi and has Xj=1 for jV(Bi) and Xj=0 for j[n]V(Bi). Thus, by the fact that there are many, 2k2, submatrices Bi, we know the following: If we now sample each Xj, for j[n], independently, then with probability at least 1(2k12k)b(n,k), there exists at least one block whose k 0/1 column vectors are pairwise distinct. These vectors will define k distinct IDs to perform the k-way recursive split in our algorithm for computing the leader. Section 3.1 contains a warm-up analysis of Algorithm Splt2Many, and Section 3.2 – analysis of Algorithm Splt2ManyIDs, for any k, using the existence of strongly-separable blocks.

LE in general networks via TokenIDs.

Our second algorithm, in Section 4.3, works in any graph and uses only one random bit per node. It also builds IDs, but this time, by using competing tokens (originally anonymous). Each token traverses the graph using deterministic universal exploration sequences [29] and simultaneously “builds up” its uniqueness by (a) accumulating random bits met at each traversed node and (b) eliminating competing tokens that arrive simultaneously at the same node. Although the algorithm is polynomial for time and communication complexities, this polynomial is of a high degree, so the upper bounds are much higher than those for Algorithm Splt2Many from Section 3, described earlier (which uses nearly n random bits in complete graphs). (Moreover, the polynomial is not in n but rather in an upper bound N on n.) See also Section 6 for a discussion about the complexity.

The lower bounds.

In certain graphs, there are local port numberings which enforce every node to draw at least one random bit, in order to elect a leader, see Section 4. Our first proof is for complete graphs, exploiting only adversarial point numbering. Our second proof uses a novel definition of shared coloring of edges, which generalizes the classic edge coloring in graphs and “colors” edges in some classes of graphs more effectively than the classic chromatic index would suggest (in the sense that it may result in using fewer colors). It shows that some colorable classes of graphs require n random bits to solve LE. We believe that this technique can prove useful for solving various problems in anonymous networks. It may also be interesting on its own. The proofs have to account for the distributed nature of leader election algorithms, for instance, nodes can communicate before drawing random bits and gather different “views”; as a consequence, only some of them may decide to draw random bits or may do it at different times.

1.2 Additional related work

It is commonly accepted that obtaining truly random bits is difficult and costly, see, e.g., [32, 8]. Many papers in contexts other than distributed algorithms treated the number of random bits used as a resource that can be optimized, should be accounted for, or replaced by pseudorandomness. A rather arbitrary short list of examples is [16, 5, 14].

A classic paper [21] connects the “amount of randomness” in context of distributed computing to the efficiency of routing algorithms. The authors motivated the number of random bits used by an algorithm to measure the “amount of randomness” by citing [19], who showed that this measure is closely related to entropy. They also noted that while the necessity of randomness for increasing efficiency in non-distributed computing still needed to be established, their trade-off established it in the context of distributed computing.

In the current paper, we investigate the amount of randomness required so that algorithms will be at all possible. We also start the research into the issue of a possible trade-off between randomness and efficiency in symmetry breaking. The theory and the many practical applications of leader election are far too rich to survey here. See any textbook on distributed algorithms or distributed computing, e.g., [25, 27, 6, 30, 33, 9].

Deterministic leader election (LE) was proven impossible in complete anonymous networks [4]. This paper also suggested the problem of efficient random LE in a (complete) network. A characterization of anonymous networks where LE is possible was given in [35]. The question of which kind of (adversarial) schedules do not allow an election was addressed in [18]. We show that LE is impossible even with random bits if fewer than n random bits are available.

A randomized LE algorithm was suggested by [17]; it was among the very first distributed computing problems to be studied using randomization shortly after [28]. Recall that except for this paper and [2], all the other randomized LE papers we are aware of use Ω(nlogn) random bits. It was also shown in [17] that randomized LE algorithms may be inherently more message-efficient than deterministic ones (by a log-factor) even when a deterministic solution exists. A randomized algorithm for a general anonymous graph was first suggested in [31]. The efficiency of LE for randomized algorithms has been widely addressed. In particular, a lower bound of Ω(m) messages (m is the number of edges) and Ω(D) time (D is the diameter of the network) were established for some graphs in [22] together with an upper bound O(m). An upper bound of O(D) time was shown in [26]. Better complexities are possible in some graphs; for example, in [23], upper bounds of a constant time and O(nlogn) messages were shown for a complete graph. This was generalized in [13] to O(nlog7/2ntmix) messages and O(tmixlogn) time where tmix is the mixing time of random walks on the network graph. They also show that Ω(nΦ3/4) messages are needed for any LE algorithm succeeding with probability 1o(1), where Φ is conductance of a graph. The upper bound was improved to O(tmixΦ) in [20]. For randomized algorithms on a complete graph, a trade-off between time and message complexities was shown in [24] even when the adversary decides when to wake nodes up. For any k[2..O(lognloglogn)], their algorithm uses O(n1+1/k) messages and k+8 time. They also show a superlinear message lower bound of Ω(n1.5) messages for a randomized algorithm on a synchronous complete graph with running time of 2. In [1], they verify (by a randomized algorithm) a unique leader.

Paper structure.

Section 2 introduces the anonymous CONGEST model and the LE problem. Section 3 gives the main Splt2Many algorithm on cliques, and analyzes it using the technical tool studied in Section 5. Section 4 presents the lower bounds and Section 4.3 presents Algorithm TokenID for general networks. Missing proofs from Sections 3 and 4.3 are deferred to the full version. Finally, Section 6 concludes the paper.

2 Model and Problem

We assume the standard CONGEST model [27] for asynchronous networks and anonymous nodes. To shorten and simplify the description of algorithms, we sometimes use other models, but show how to convert the results to asynchronous and CONGEST. 444In particular, the algorithm for general graphs we present in the LOCAL model [27] and then translate; for now, let us just say that the LOCAL model allows much larger messages, so the translation is basically breaking long messages into some x shorter ones, and multiplying the message and or time complexity by that x. For the ease of exposition only, we assume synchronous networks where all the nodes start their executions simultaneously. However, our results also apply to asynchronous ones. It is known how to use synchronous algorithms in asynchronous fault-free networks (especially when not trying to optimize time and messages) [7] (and many later papers), so we do not elaborate on it. The reader is referred to the rich literature for details of the model. However, let us provide some more details for the sake of completeness.

A network is represented by a graph G=(V,E), where V is the set of nodes that represent the processors in the network and |V|=n, while E represents communication links. Except in the case of complete graphs, we assume that each node does not know n but does know an upper bound N on the actual number of nodes n. The time is partitioned into slots. In a slot, each node receives the messages sent to it by its neighbors in the graph in the previous slots, computes, and possibly sends messages to some or all of its neighbors. A message contains O(logn) bits. (A longer message can be implemented, of course, by sending multiple O(logn) ones.) The edges adjacent to a node v are numbered in v from 1 to the degree of v. An edge (u,v) numbered i at u may be numbered ji at v. We say that if u sends a message over its port i, it will reach v over v’s port j and vice versa. An adversary selects the pairing of ports before the execution (oblivious adversary), and the nodes are unaware of this pairing initially. Nodes do not have unique identifiers (IDs) and all of them run the same code. A node can draw random bits. For convenience, we define that port 0 at each node leads to the node itself.555For convenience, when clear from the context, we may abuse mathematical formalism slightly and use “modulo” operation in a few places, but mean a modified operation in which we cycle back to port 1 instead of 0.

In the Leader Election (LE) problem, all the nodes terminate and the leader node eventually knows it is the (unique) elected leader with high probability (whp), and any other node knows it is not.

3 Algorithms that Use Nearly 𝒏 Random Bits in Total

We develop here Algorithm Splt2Many for complete graphs (see the pseudo-code) that, intuitively, uses a single coin flip per node to eliminate more than half of the remaining candidates. (Recall that one half are removed by a simple flip per node in Algorithm Splt12.) Hence, the total number of random bits is only n+o(n) – very close to one bit per node. For convenience, let the set V of nodes be represented by the set [n]={1,2,,n}, and let us refer to nodes also by lower case initial Latin alphabet letters a,b,c,d,e,. Recall that such names are not known to the nodes.

Definition 1.

Let the Neighbors Vector (NV), (denoted by vb), of each node b[n] be the vector of b’s ports, where ports (positions) are numbered 0,1,,n1. We assume that port 0 of a node b leads to b itself, that is, v0b=b. When clear from the context, we may abuse notation and, instead of referring to the port of vb in the i’s position of vb (that is, to vib), we may be speaking of the node c to which port i of b leads. Note that node b does not know to which node b’s port i leads, all the names are just for our convenience.

Definition 2.

Let the ID Bit Vector (IBV) be similar to the neighbors vector, except that in the IBV of a node b[n] for any position i, instead of the ith port of b that leads to some node c, there appears the random bit drawn by node c.

Note, for any node b[n], (v0b,v1b,,vn1b) is a permutation of the set [n], with v0b=b.

We first analyze Algorithm Splt2Many for k=3 as a warm-up in Section 3.1, followed by a general and improved analysis for any k in Section 3.2, with the main technical tool deferred to Section 5. Recall that k is the parameter in k-way split of our algorithm (see the beginning of Section 3.2 for an explanation about k). Techniques for additionally bounding the maximum number of random bits per node are described in Section 3.3.

3.1 Analysis of Algorithm Splt2Many using 1.5𝒏+𝒐(𝒏) random bits

Algorithm Splt2Many.
Lemma 3.

There exists a partition of all the nodes from [n] into pair-wise disjoint sets, [n]=St1St2Sts, ij:StiStj=, such that |Stj|{3,4,5} for each j[s], and such that if each node from [n] independently chooses a random bit, then, in each set Stj independently for each j[s], some three neighbors vectors va,vb,vc for a,b,cStj will produce at least three distinct ID bit vectors with probability at least 1/32.

Recall that proofs missing here will appear in the full version. When applying Lemma 3 to prove the next lemma, the term f(n)/5 appears because each set in the partition may have size up to 5. But for the number of different IDs created, the lemma shows only 3.

Lemma 4.

Suppose we are given any subset of at least f(n) nodes for some n>1. The number of different (in value) ID bit vectors among the nodes in the subset is at least 3 with probability at least 1(3132)f(n)/5.

Theorem 5.

For f(n)=log2(n) and g(n)=f(n), the total number of random bits used by Algorithm Splt2Many is at most 1.5n+o(n) with very high probability.

Proof.

Suppose there are some xi nodes participating in recursion level i of Algorithm Splt2Many, where x1=n. By Lemma 4, the number of nodes xi+1 participating in level i+1 is at most max{1,xi/3} with probability at least 1(3132)xi/51(3132)f(n)/5.

Since only a node that participates in a recursion level draws a random bit (and it draws only one at that level), this is also the number of bits drawn in level i+1. Let s be the number of levels (recursive calls) after which we have at most f(n) remaining nodes. The number of nodes xi+1 participating in level i+1 is larger than xi/3 with probability at most (3132)f(n)/5. Therefore, by union bound, the total number of random bits used in all recursive calls is, at most i=0sn/3i=n1(1/3)s+12/3<32n, with probability at least 1s(3132)f(n)/5. Conditioned on this random event, we have that n/3sf(n), which gives that slog3(n/f(n)). Taking s=log3(n/f(n)) as the number of recursion levels, the probability of success of the recursive part of our algorithm is at least 1s(3132)f(n)/51log3(n/f(n))nΘ(log(n)).(*)

In the remainder of the analysis, we condition on the random event above. We now look at steps (6-7), in which each of at most f(n) remaining nodes independently chooses g(n) random bits and uses them to define its ID. Let us estimate the probability that all such f(n) random IDs are pairwise distinct. Given any two remaining nodes, the probability that their IDs are the same is at most (1/2)g(n). Therefore, by union bound, the probability that all random IDs of all f(n) remaining nodes are distinct is at least 1(f(n))22g(n)=1(f(n))2nlog(n).(**)

By combining the two success probabilities above, (*) and (**) by union bound, the final success probability of the overall algorithm is 1f(n)2+log3(n/f(n))nΘ(log(n)). The total number of random bits used in steps (6-7) is at most f(n)g(n)=f(n)2=o(n).

Let us comment that the general method described in Section 3.3 can be applied to this algorithm at the cost of increasing the time and the message complexity. This means that the bound on the maximum number of bits used by a single node can be made 2 while the total number of bits drawn will remain 1.5n+o(n).

3.2 Analysis of Algorithm Splt2Many using 𝒏+ϵ𝒏+𝒐(𝒏) random bits

Let k1 be an integer parameter in k-way split of the algorithm. Recall, that Algorithm Splt2Many is specified by two functions, f(n) and g(n), which depend on the (current) number of nodes n during its recursive execution. If the set S of remaining nodes has size |S|>f(n), the algorithm finds a subset of S of size at most |S|/k with certain probability and recurses on it, hence k-way split. This is done until the set S of remaining nodes has size |S|f(n), in which case each node in S chooses a random ID of length g(n), identifying the final leader with large probability.

Our intention is to analyze algorithm Splt2Many for k being a small increasing function of n, or any fixed constant much smaller than n, which correspond to the two regimes (A) and (B) in Theorem 7. We analyze the probability that Algorithm Splt2Many distinguishes k IDs, by analyzing properties of a corresponding random matrix.

Preliminaries.

Suppose that we are given an n×n matrix M, whose each column contains a permutation of numbers from [n]={1,2,,n} such that column i[n] contains the permutation (a1,a2,,an) with a1=i, i.e. the first number in the permutation is the column number. We call B a submatrix of size k of matrix M if B contains cells of M induced by a subset of k rows and subset of k columns of matrix M. Below we will also call elements of matrix M variables because they will play a role of random variables which will independently draw a random bit with equal probability. Note that each such (random) variable i[n] has exactly one occurrence in each column of M, but occurs exactly n times in the whole matrix M.

A collection of strongly-separable blocks with parameter k<<n in matrix M is a set of 2k2 row- and column-disjoint submatrices of matrix M, each of size k×k, such that: (1) each k×k submatrix B in the collection has a unique set of variables, denoted V(B)[n], with occurrences only in B (i.e., these variables do not occur in any other submatrices of the collection); and (2) there exists at least one mapping τ:V(B){0,1} such that all k column 0/1 vectors in B are pair-wise distinct under mapping τ. To explain condition (2) formally, let τ¯:[n]{0,1} be an extension of mapping τ to the full set of variables [n], such that τ¯(i)=τ(i) if iV(B) and τ¯(i)=0 if i[n]V(B). Then, condition (2) means that the set {(τ¯(B1,i),τ¯(B2,i),,τ¯(Bk,i)):i[k]} of 0/1 vectors contains k distinct vectors; note that we assume that the consecutive columns (and rows) of submatrix B are numbered 1,2,,k.

Main lemma.

We use our main technical tool – Lemma 17 from Section 5.2 – that implies an existence of a collection of b(n,k) strongly-separable blocks in matrix M. We will use this lemma in two cases. In the first case, we will assume that b(n,k)=2k2 for any kcloglogn; in this case we will take in fact k=cloglogn. In the second case, we will take b(n,k)=log1ε(n)4k for any fixed constant kcloglogn and any fixed constant ε(0,1). Note that in the second case, k can be an arbitrarily large fixed constant and thus, in that case n will need to be large enough. In this case, it can easily be checked that b(n,k)=log1ε(n)4k fulfills Lemma 16. In Lemma 16, we prove the existence of b(n,k)=2k2 strongly-separable blocks. But because constant c(0,1) can be arbitrarily close to 1 and 1ε can be chosen to be (asymptotically) close to c2, we have that for k=cloglogn, 2k2log1ε(n), and so log1ε(n)4k2k2. Therefore Lemma 16 also implies in particular the existence of log1ε(n)4k strongly-separable blocks.

Let us now consider the first step (1) of Algorithm Splt2Many, where each node independently draws a random bit and its random IDs are created. Our probabilistic reasoning here will use this probabilistic space and experiment. By Lemma 17 and by the definition of strongly-separable blocks, for any such block B in matrix M, there exists at least one 0/1 assignment to its variables in V(B) that makes all its 0/1 column vectors distinct, using their coordinates that correspond to the rows of B and therefore also the corresponding rows of M. We show in Lemma 17 that |V(B)|=k and therefore there are a total of 2k 0/1 assignments to the variables in V(B). This means that in the considered probabilistic space with probability at least 1/2k there are k distinct vectors in block B and therefore also in the whole matrix M – the column vectors of M which correspond to the columns of submatrix B. Therefore, with probability at most (2k1)/2k, the k 0/1 column vectors in B are not distinct. But we have b(n,k) strongly-separable blocks B in matrix M and their sets of variables V(B) are pair-wise disjoint, meaning that the events of distinguishing the column vectors in any two blocks are probabilistically independent. This implies that with probability at least 1(2k12k)b(n,k), there exists at least one block B whose k 0/1 column vectors are pair-wise distinct. This is exactly the probabilistic event that we need for Algorithm Splt2Many; please compare with such an analogous event for Algorithm Splt2Many. This proves the following lemma.

Lemma 6.

Given any subset of at least f(n) nodes for some integer n>1, the number of different (in value) ID bit vectors among the nodes in the subset is at least k with probability at least 1(2k12k)b(n,k), where k=k(f(n)).

Theorem 7.
  1. (A)

    For f(n)=nγ, g(n)=log(f(n)3) and some fixed γ(0,13), the total number of bits used by Algorithm Splt2Many is at most n+o(n) with probability at least 1O(1h(n)), where k=k(n)=cloglogn, and h(n)=e2k(k1)/log(n); for example the result holds if we take h(n)=log(n).

  2. (B)

    For f(n)=elog1ε(n)/(4k2k) and g(n)=log(f(n)3), the total number of bits used by Algorithm Splt2Many is at most n+nk1+o(n) with probability at least 1log(n)(1elog1ε(n))14k2k, for any fixed ε(0,1), and an arbitrarily large constant k with 4kcloglogn.

Proof.

Let xi be the number of nodes participating in the recursion level i of Algorithm Splt2Many, where x1=n. Then, by Lemma 6, the number of nodes xi+1 participating in iteration i+1 is at most max{1,xi/k} with probability at least 1(2k12k)b(n,k). Here, b(n,k)=2k2 for k=cloglogn in part (A) of the theorem. In part (B), we will take b(n,k)=log1ε(n)4k for any fixed constant kcloglogn and any fixed constant ε(0,1). Note, that constant c(0,1) can be arbitrarily close to 1 and 1ε is (asymptotically) close to c2, so ε can be chosen arbitrarily close to 0 – see Lemma 16 with 2k2 replaced by b(n,k).

Since only a node that participates in a recursion level draws a random bit (and it draws only one at that recursion level), this is also the number of bits drawn in recursion level i+1. Let s be the number of recursive calls after which we have f(n) remaining nodes. The number of nodes xi+1 participating in recursion level i+1 is larger than xi/k with probability at most (2k12k)b(n,k). Therefore, by union bound, the total number of random bits used in all recursive calls is at most i=0sn/ki=n1(1/k)s+111/k<kk1n, with probability at least 1s(2k12k)b(n,k). Conditioned on this random event, we have that n/ksf(n), which gives that slogk(n/f(n)). Taking s=logk(n/f(n)) as the number of recursion levels, the probability of success of the recursive part of our algorithm is at least

1s(2k12k)b(n,k)=1s(112k)2kb(n,k)2k1s(1e)b(n,k)/2k=1log(n/f(n))log(k)eb(n,k)/2k.

In part (A), we have that this probability is

1log(n/f(n))log(k)eb(n,k)/2k=1O(1h(n)), (1)

where h(n)=e2k(k1)/log(n). This estimate follows because b(n,k)=2k2, log(n/f(n))=(1γ)log(n), k=k(f(n)), where k(n)=cloglogn, and then we obtain that

log(n/f(n))log(k)eb(n,k)/2klog(n)eb(n,k)/2k=1h(n).

It is also easy to check that the above inequality holds when we take h(n)=log(n).

In part (B), we take b(n,k)=log1ε(n)4k, and we have that the above probability is

1log(n/f(n))log(k)eb(n,k)/2k=1log(n/f(n))log(k)(1elog1ε(n))14k2k, (2)

so this is almost with high probability, because elog1ε(n)=nΘ(1) when ε=0 (but remember ε is any fixed constant ε>0) and k is an arbitrarily large fixed constant.

In the remaining analysis, we condition on the above random event. We will now look at steps (6-7) of the algorithm, in which each of the f(n) remaining nodes independently chooses g(n) random bits and uses them to define its ID. We will estimate the probability that all such f(n) random IDs are pairwise distinct. Given any two remaining nodes, the probability that their IDs are the same is at most (1/2)g(n). Thus, by union bound, the probability that all random IDs of all f(n) remaining nodes are distinct is at least

1(f(n))22g(n). (3)

In part (A), the probability (3) is 1(f(n))22g(n)=11f(n), and by combining it with probability (1) using union bound, the final success probability of the algorithm is indeed 1O(1h(n)).

In part (B), the probability (3) is 1(f(n))22g(n)=11f(n)=1(1elog1ε(n))14k2k, and by combining it with probability (2), the final success probability of the overall algorithm is at least 1log(n)(1elog1ε(n))14k2k.

The total number of random bits used in steps (6-7) is at most f(n)g(n)=f(n)log(f(n)3)=o(n). Thus, the total number of random bits the algorithm uses in part (A) is at most kk1n+f(n)log(f(n)3)=n+nk1+f(n)log(f(n)3)=n+o(n), because f(n)=nγ and k=k(n)=cloglogn, where γ(0,1/3). The total number of random bits in part (B) is at most kk1n+f(n)log(f(n)3)=n+nk1+f(n)log(f(n)3)=n+nk1+o(n).

3.3 Bounding the maximum number of bits drawn by a single node

Above, we presented algorithms that economize on the total number of random bits and still require some nodes (e.g., the eventually elected leader) to draw many bits. In this section, we show that these and any other algorithms can be amended such that the maximum number of bits drawn by any single node is just the average (rounded up), without increasing the total number of drawn random bits. The main idea is relatively simple. Given an algorithm (henceforth the original algorithm) where the average number of random bits drawn by a node, rounded up, is some known x, consider any execution step when some node v has already drawn x bits. We say that v is saturated. However, suppose the algorithm now requires v to draw an additional random bit.666Without loss of generality, a step of the algorithm requires generating at most one bit. We amend the algorithm so that v finds some other node u that is still unsaturated and has u draw the required bit and ship it to v. In general, this amendment increases time and communication. For that, we need to show that v can generate a token that traverses the graph deterministically and returns to v having found an unsaturated node.

Observation 8.

Consider any Leader Election (LE) algorithm ALG in the anonymous graph model. If ALG solves LE using at most xn random bits (for an integer x known to the nodes) in total over all the nodes, then there exists an algorithm ALG’ that solves LE using at most x random bits per node. Moreover, the total number of random bits used by ALG’ is exactly the same as the total number used by ALG. In particular, the algorithm of Section 3.2 uses n+ϵn+o(n) random bits in total, and at most 2 random bits per node.

The details and proof will appear in the full version. Let us comment that our algorithm for a complete graph guarantees the bound on the average number of random bits needed only whp. If one uses that algorithm together with the load balancing of the current section, the algorithm fails (but whp, this does not happen).

4 Lower bounds and a Complementary Algorithm for General Graphs

Before formalizing the proof of our lower bound on the number of random bits needed to solve Leader Election, let us remind the reader that a node may perform any amount of communication and computing before deciding whether or not to draw a random bit. This means that the fact that one node draws such a bit does not necessarily mean that others will draw too. For example, if the port of some node v leading to its neighbor u is numbered i, and the port of u leading to v is numbered j<i, then, at least from local considerations, the two may act differently.

Lower bounds in distributed computing often use the concept of a history of computation at nodes. In our model, the history of computation at a node is defined as follows. Initially, a history at a node consists of the number of its local ports. In any round, each node appends the random bits it drew at the beginning of this round to its current history and sends the result via each port, attaching the corresponding port number to each of them. At the end of the round (after receiving all messages), the history at a node is extended by appending to its current history each message received in the current round, together with the local port number through which the message arrived at the node. The following property can be derived by a straightforward inductive argument over the consecutive rounds and actions taken by the algorithm. Here, an “action” means the result of a state transition function, that can include the following: which local variables to change and how (e.g., whether to draw a random bit, how to modify existing variables, whether to stop or not), what message to send via each port, and storing the received messages with their arrival local port numbers.

Proposition 9.

Consider any LE algorithm. If the histories of two nodes are identical at a given time, their first subsequent actions will be identical.

4.1 A lower bound for leader election in complete graphs

Theorem 10.

Every algorithm solving LE with at least a positive constant probability on the clique of n nodes requires n random bits in total.

Proof.

This result follows from the following property, which we will prove in the remainder: there is a local port numbering in the clique such that until some node draws the first (over all the nodes) random bit, in each round, all histories (and thus, states and messages sent/received by certain ports) are the same across all nodes. Indeed, if t is the first round when someone draws a random bit, because of the same histories at nodes by that time, the next action at all nodes will be the same by Proposition 9, and since one of them will be drawing a random bit eventually (otherwise, leader election is impossible in the anonymous clique [4, 35]) so will all of them. So, the total number of drawn random bits is (at least) n.

The proof of the above property is by contradiction. Consider the following local port numbering, depending on whether n is even or odd.

Case 1: n is even. It implies that the node degree of each node in the cliques is odd, and thus, the edges could be partitioned into n1 perfect matchings. The adversary can assign a unique number in {1,,n1} to each matching in the partition, and we say that the ith matching has ports on both sides locally numbered i.

Case 2: n is odd. It implies that the node degree is even, and thus we could partition all edges into (n1)/2 hamiltonian cycles. We assign a unique number from {1,,(n1)/2} to each of the Hamiltonian cycles in the partition. Local ports are assigned as follows. For each ith Hamiltonian cycle, the adversary directs the cycle in an arbitrary direction and assigns port number 2i to the port via which the ith cycle leaves the node, and number 2i1 to the port via which the cycle enters the node.

Now, by the contradictory assumption, for the defined local port numbering, there is a round t such that by the beginning of that round, no node draws any random bit. Still, there are some two nodes, call them v,w,777As emphasized earlier, in the analysis, we use names only to distinguish nodes when applying mathematical arguments. This does not violate the anonymity of nodes and algorithms. such that their histories (and thus, their states) are different at the beginning of round t. Without loss of generality, let t be the first round with such a property. Observe that t2, because, at the beginning of round 1, all nodes have the same (empty, or containing only the same number n) history and no distinguishing IDs. From the definition of round t, it follows that all nodes had the same history at the beginning of round t1. Therefore, all nodes make the same decisions about what message to send via each port. There are two cases to consider, as the defined local port labeling depends on it.

Ad Case 1: n is even. It follows that if nodes decide to send the same message via port i, all nodes receive this particular message via port i. Since there was no randomness in round t1, the history is the same at all nodes at the end of round t1 and, hence, at the beginning of round t. This is a contradiction, finishing the proof of the invariant (and thus the theorem) in Case 1.

Ad Case 2: n is odd. It follows that if nodes decide to send same message via port 2i1, for some number i{1,,(n1)/2}, all nodes receive this particular message via their local port 2i, and vice versa. Since there was no randomness in round t1, the history is the same at all nodes at the end of round t1, and, hence, the beginning of round t. This contradiction finishes the proof of the invariant (and thus the theorem) in Case 2.

4.2 Extending the lower bound to general networks

There exist graphs where the lower bound does not hold since a deterministic election is possible [35]. The main challenge in extending the lower bound to other graphs is in finding worst-case assignments of ports to neighbors by the adversary so that the anonymous nodes (who are not aware of who each port leads to) have to draw at least one truly random bit each. We construct such adversarial ports’ assignments by exploiting the following concept of 2-shared edge coloring.

𝟐-shared edge coloring (2SEC)

Suppose we are given a simple (no multi-edges) undirected graph G=(V,E). Let F={1,,κ} be a set of colors, split into first κ1 so called one-shared colors and the remaining κ2=κκ1 so called 2-shared colors (any of κ1,κ2 could be zero). We say that a function ϕ:EF is a 2-shared edge coloring (2SEC) of graph G with κ colors if

  1. 1.

    for every one-shared color i{1,,κ1}, all edges with assigned color i are independent (i.e., do not have any shared node);

  2. 2.

    for every 2-shared color j{κ1+1,,κ}, all edges with assigned 2-shared color j form a sub-graph of G which may contain only node-disjoint paths and cycles, and at least one path or cycle has a length of at least 2 (at least 3 if it is a cycle).

Intuitively, 2SEC with κ colors means that we could partition the colors into one-shared and 2-shared, and edges colored by a one-shared color must form a matching (each node is shared by at most one colored edge) while edges colored by a 2-shared color must form a node-disjoint collection of paths and cycles (each node is shared by at most two colored edges, and at least one node is shared by exactly 2 edges, to distinguish from one-shared colors).

Next, we define the 2SEC (chromatic) index of a given graph G. For a given 2SEC ϕ of G, let κ be the number of colors in ϕ and κ1 be the number of one-shared colors; we call κ1+2κ2=2κκ1 the index of 2SEC ϕ of graph G and denote λ(G,ϕ). The 2SEC (chromatic) index of graph G, λ(G), is the minimum of λ(G,ϕ) over all valid 2SECs ϕ of G. Note that the 2SEC index of a graph is never bigger than the (edge) chromatic number of this graph, because (classic) edge coloring is also a 2SEC (in which we do not use any 2-shared colors); therefore, each simple undirected graph has at least one 2SEC. The latter is, however, more general than the classic edge coloring – for instance, Petersen graph is known for requiring at least 4 colors to be classically edge-colored, while there is a 2SEC chromatic index of Petersen graph is 3: (both the internal and the external cycle can be colored by a shared color, contributing 2 to the 2SEC chromatic index, while the matching connecting them can be colored by a one-shared color, contributing 1 to the 2SEC index). Similar difference in chromatic numbers between classic and 2SEC colorings occurs in case of cycles of odd length (3 vs 2).

Next, we study the question what is the 2SEC index of a given graph.

Lemma 11.

If G is a simple undirected graph of n nodes and m edges, then λ(G)2mn.

Proof.

Consider a node of graph G and its 2SEC coloring ϕ. By the pigeonhole principle, a node v in G of degree at least 2mn exists. Some κ1 edges incident to v are colored by one-shared colors, while the remaining incident edges are colored by κ2 2-shared colors. (Either κ1 or κ2 may be 0.) By the fact that all incident edges must be colored, 2mnκ1+2κ2=λ(G,ψ), as each 2-shared color could be present in at most two edges incident to v. Since we considered any coloring ϕ, it also follows that λ(G)=minϕλ(G,ϕ)2mn.

We can also characterize Δ-regular graphs G with λ(G)=Δ as follows:

Lemma 12.

In the case of a Δ-regular graph G with λ(G)=Δ, edges colored with any 2-shared color form a spanning sub-graph of graph G (i.e., each node is incident to at least one edge) which is a collection of node-disjoint cycles.

Proof.

The proof is by observing that, for a given node with Δ neighbors, we can use each one-shared color to color at most one of its incident edges, and each 2-shared color to color at most 2 of its incident edges. Let κ1 be the number of one-shared colors and Δκ12 be the number of different 2-shared colors.

Suppose, to the contrary, that some 2-shared color does not cover some node or contains a path. It means that it colors at most one of the incident edges of some node v. It would follow that node v has at most κ1+2(Δκ121)+1Δ1 incident edges, which is a contradiction with the fact that the number of incident edges to v in Δ-regular graph is Δ. (In the above formula, we count edges incident to node v as follows: κ1 comes from the upper bound on the number of edges colored by one-shared colors, (Δκ121) is the upper bound on the number of 2-shared colors that color two edges incident to v, and “+1” is the contribution of the 2-shared color that is used only for coloring one incident edge.)

From 2SEC to impossibility of leader election with less than 𝒏 random bits

Theorem 13.

Each algorithm solving Leader Election with a non-zero probability on Δ-regular graphs G with λ(G)=Δ requires at least n truly random bits in total.

Proof.

We need to show that for any given Δ-regular graph G with λ(G)=Δ, there is an adversarial port numbering enforcing identical histories of nodes in any round before some node decides to draw a random bit. Then, we could apply Proposition 9 to conclude that in this case, all nodes draw their first random bit simultaneously, and thus, the total number of random bits is at least n.

First, we find a 2SEC of graph G with 2SEC index Δ – it exists because λ(G)=Δ. W.l.o.g., we may assume that the first κ1 colors are one-shared and the remaining κ2=Δκ12 are 2-shared colors (each contributing 2 to the 2SEC index λ(G)=Δ). Then, for each one-shared color iκ1, we assign to both end ports of edges colored by i port number i. For each 2-shared color j>κ1, we assign ports j1=j and j2=j+κ2 to the ends of each edge with this 2-shared color, in such a way that for any two such edges sharing a node, say v, we assign different port numbers j1,j2 to ports corresponding to those edges and also that each such edge has two different port numbers assigned to its end nodes. This can be done easily by directing (arbitrarily) each cycle in the sub-graph consisting of edges colored by j, and then assigning j1 to the port corresponding to an in-coming edge of the 2-shared color j (according to our arbitrary direction) and number j2 to the port corresponding to the out-going edge of the 2-shared color j. Such an assignment is possible by Lemma 12, stating that indeed, in the case of the considered graphs, the edges of 2-shared coloring edges define a spanning sub-graph containing only node-disjoint cycles.

Now consider an algorithm execution on graph G with the above port numbering. We show that until some node decides to draw a truly random bit, the histories at all nodes are identical. The proof is by induction on the round number. As in the proof of Theorem 10, if a message (the same at all nodes, due to the identical previous histories) is sent by port iκ1 then it is received at each node via port i, and if it is sent (same at all nodes, due to the identical previous histories) by port j>κ1 then it is also received by each node via the same port j, where κ1<j,jΔ and |jj|=κ2, i.e., j,j are ports assigned when considering 2-shared color min{j,j}. In the latter case, we use the property of our port assignment that each node has both ports j,j used in such a way that on the other side of the link with port j there is a port j and vice versa. Hence, the histories become enhanced in the same way at all nodes.

Thus, it follows immediately from Proposition 9 that all the nodes perform the same action of drawing a truly random bit at that time, as their state transition function has been deterministic so far and is applied to the same histories. Hence, the total number of random bits is at least n.

 Remark.

Obviously, there are also graphs that require fewer than n random bits to elect a leader. In some cases, e.g., in a star graph, an anonymous network can elect a leader with zero random bits.

4.3 TokenID: 𝟏-bit algorithm for general graphs

For completeness, let us now show the tightness of the lower bound by presenting a Monte Carlo LE algorithm, called TokenID, for general graphs. It uses exactly one random bit per node and is, thus, optimal in the number of random bits used, as proven in Theorem 13. It elects a leader with high probability.

Because of the space limitation, the algorithm and its analysis were removed here and will appear in the full version of this paper. Intuitively, every node is the starting point of a deterministic walk that visits all the nodes, relying on the universal traversal of [29]. The walker collects the bits along the walk into a long “ID”. Indeed, the same bits appear in all the “IDs” of all the walkers, but we manage to manipulate these “IDs” to be able to show that the bits in many positions (of the “ID”) are independent between one walk to the other. Hence, the highest “ID” can be elected.

Theorem 14.

Consider any off-the-shelf deterministic (CONGEST) leader election algorithm DetALG for general graphs with time complexity T and message complexity M. Let the exploration algorithm’s time (and message) complexity be R in CONGEST. Using DetALG as a subroutine, algorithm TokenID(N) is a Monte Carlo algorithm that elects a unique leader using time complexity T+R and message complexity M+R, with probability of success that is at least 1n22n/2+1 in any CONGEST network of nN nodes, m edges, and diameter diam.

5 Main Technical Tool: Strongly-Separable Blocks in a Matrix

We prove here that a collection of (at least) b(n,k)=2k2 strongly-separable blocks exist. The main idea is to construct blocks, one by one, by considering so called “dominated and diverse” rows (see formal definitions below). For each such row r, we add it to the constructed block, we select a dominating value that was not considered earlier in the construction, as well as one occurrence of a different value (we choose the column in which it occurs to the constructed block). Then we restrict the sub-matrix used in the next construction steps by removing the selected row and the columns that do not contain the chosen dominating value in row r. We describe details and analyze this construction in Section 5.2. This construction may, however, stop before selecting a sufficient number of strongly-separable blocks, due to no dominated rows in the remaining sub-matrix – in this case, we apply a probabilistic argument for the existence of a sufficient number of blocks in Section 5.1.

Consider a sub-matrix M of M and its row i. We say that a variable xj is i-dominating if it occurs in at least ψ=1k4(b(n,k))2=1k4(2k2)2 fraction of positions in row i of M. We call a row i dominated if there is an i-dominating variable. We call a row diverse if it contains at least two different variables.

5.1 No dominated rows

First, we consider the case when there are no dominated and diverse rows in matrix M, and in general, in its sub-matrix M that remains during the block selection process. In this case, we show that as long as M is sufficiently large and the number of diverse rows is large enough, one can find at least 2k2 strongly-separable blocks in M by a probabilistic argument.888Note that using a non-constructive argument in the analysis does not imply inefficiency of the algorithm itself. It is used only that certain block selection is possible at some stage of the algorithm, but the algorithm itself does not have to compute these blocks (the algorithm only compares obtained IDs and counts their multiplicities).

Lemma 15.

Suppose we are given a sub-matrix M of M such that its number of columns is not bigger than the number of rows and none of its rows is dominated. Moreover, there are at least n diverse rows and at least n columns in M. Then, there are at least 2k2 strongly-separable blocks in M, provided kcloglogn for any constant 0<c<1.

Proof.

The proof is by a probabilistic argument. W.l.o.g., we may restrict to diverse rows, i.e., we may assume that M contains only diverse rows.999Otherwise, we could remove from M non-diverse rows, as they are not needed for this proof, and once we show the existence of strongly-separable blocks, we do not need matrix M anymore. We assume a local numbering of rows and columns in M, that is, from 1 to the number of rows in M and from 1 to the number of columns in M, respectively. Let α be the minimum between the number of rows and the number of columns in M. Let us choose, independently at random, a sequence of kb(n,k) numbers in {1,,α}, where b(n,k)=2k2 is the required number of blocks; call them r1,,rkb(n,k). Let M′′ be the sub-matrix of M induced by rows and columns r1,,rkb(n,k). Define an i-th block of M′′, for ib(n,k), as induced by rows and columns 1+(i1)k,,ik.

We first prove that any block i is strongly-separable from any block j<i. We proceed by induction on i.

Consider a block i and any variable stored outside of its diagonal; call the coordinates of this variable x,y{1+(i1)k,,ik}, where xy. Let Xx,y be a random variable equal to 1 if the variable stored in M′′[x,y] occurs on the diagonal of M′′ or in any previous blocks, and equal to 0 otherwise.

We now argue that the probability that Xx,y=1 is smaller than b(n,k)ψk2 Indeed, there are at most b(n,k)k2 variables on different positions of the b(n,k) blocks, while by the fact that row rx of M is not dominated (and diverse), these variables occupy less than

b(n,k)k2αψ

positions in row rx of M in total. Hence, the probability that M[rx,ry] is one of them is smaller than b(n,k)k2αψα=b(n,k)ψk2, by the random choice of ry.

Using this above upper bound on the probability that Xx,y=1, we get:

E[i=1b(n,k)x=1+(i1)kiky{1+(i1)k,,ik}{x}Xx,y]<b(n,k)kkb(n,k)ψk2=1,

by the definition of ψ. By a probabilistic argument, using the fact that all variables Xx,y are binary, with a positive probability all of them have to be 0 (otherwise, with probability 1 their sum would be at least 1, and so the expected value of the sum – which would be a contradiction with our above sharp estimate). Consequently, there is a selection of r1,,rkb(n,k), and thus matrix M′′, such that each non-diagonal position in any block of M′′ contains a unique variable. Hence, in such selection of matrix M′′, its blocks are strongly-separable in M′′, and thus also in M.

5.2 Multi-stage recursive construction of blocks

The following process of selecting a block is repeated until 2k2 blocks are selected or all rows in the remaining sub-matrix M are not dominated. We call a single selection of a block an epoch.

We start with the whole matrix M1=M. Let Mi be the sub-matrix of M considered at the beginning of epoch i, where i1 is an integer (we also call it a matrix remaining after selecting i1 blocks). Let Ui be a set of variables assigned to selected block i – we want to choose it such that it is disjoint with other sets Ui, for 1i<i, and such that for any 0-1 assignment to other variables, there is a 0-1 assignment to the variables in Ui that guarantees that all columns in block i are different. Let Ui of the ith block B be the set V(B) in the main analysis. We show now how to construct, recursively, block i, for any 1i2k2.

First, we restate the desired properties of matrix Mi. It cannot contain any row or column selected to any block 1,,i1. In the construction we also removed all rows dominated by values in U1Ui1, as we cannot rely on those variables when selecting dominating variables (intuitively, dominating variables, one per row of the block, will be added to Ui).

We select rows and columns in block i one-by-one, each time reducing the remaining matrix Mi; we denote the sequence of reduced matrices Mi=Mi,0,Mi,1,,Mi,k. The row and column selected in step j+1 of building block i are defined based on matrix Mi,j, for any 0j<k. If there is a dominated and diverse row r in Mi,j, say by some variable xa, we choose this row and a column with some variable xbxa for block i (existence of xb follows from diversity property of row r).

We define sets Ui,j+1,U¯i,j+1 as sets Ui,j{xa} and U¯i,j{xb}, respectively, where Ui,0,U¯i,0 are both initiated as empty sets and the final sets Ui,U¯i for the constructed block i will be equal to Ui,k and U¯i,k, resp. Intuitively, variables in Ui are the ones used to show that, no matter what are the 0-1 values assigned to other variables (including variables in U¯i), we can assign values 0-1 to them in a way that all columns in block i become different. It follows that Ui has k elements for any ib(n,p), that is, |V(B)|=k where B is any constructed block.

To obtain Mi,j+1 from Mi,j, we apply the following reductions (the former matrix is a sub-matrix of the latter). We first remove from Mi,j all columns without xa in row r, and then we remove row r and all other rows dominated only by variables in Ui,j+1U¯i,j+1i<i(UiU¯i). Finally, we remove all rows that have only one variable in all positions. Note that row 0 of M will never be removed from any Mi,j while obtaining Mi,j+1, because it is diverse but not dominated (it contains different variables at different positions).

It may happen that there is no dominated and diverse row r in Mi,j. In this case, we break the construction and apply Lemma 15 to M equal to Mi,j. This allows finding at least 2k2 strongly-separable blocks in M, which are also strongly-separable in M. We show in next lemma that during the construction, the conditions necessary to apply Lemma 15 (if we need to stop the construction because of the lack of a dominated and diverse row) are met.

Lemma 16.

Suppose we are given a positive integer kcloglogn, for any constant 0<c<1. If the construction does not break by defining matrix Mi,j+1, for some 1i2k2 and 0j<k, this matrix has at least

nψik+jnψk2k2ncolumns, and at leastn2(ik+j)21ψn2k2(2k2)2ψn/2

rows, out of which at least

nψik+j2(ik+j)21ψnψk2k22k2(2k2)21ψnare diverse.
Proof.

The bounds on the number of rows and columns follow directly from specifying matrix Mi,j+1 recursively from Mi,j. If we assume, inductively, that the number of rows in Mi,j was at least n2(ik+j)21ψ, when constructing Mi,j+1 we remove one additional row and at most |Ui,j+1U¯i,j+1i<i(UiU¯i)|1ψ=(2(ik+j+1))1ψ rows that could be dominated by values in Ui,j. Hence,

Mi,j+1Mi,j2(ik+j+1)1ψn2(ik+j)21ψ2(ik+j+1)1ψ1n2(ik+j+1)21ψ.

Since kcloglogn and i<2k2, the lower bound can be further bounded from below by n2k2(2k2)2ψ and then further by n/2.

Similar recursive arguments guarantee that since we leave at least ψ fraction of columns of Mi,j when defining Mi,j+1. Since kcloglogn, we have that (1/ψ)k2k2n, and thus the lower bound can be further bounded from below by n.

It remains to lower bound the number of diverse rows in Mi,j+1. Suppose, to the contrary, that it is smaller than nψik+j2(ik+j)21ψ. Let X be the set of variables occurring in non-diverse rows. Each non-diverse row contributes a different variable to X, as columns are permutations. Let y be the number of rows in Mi,j+1. It follows that

|X|>y(nψik+j2(ik+j)21ψ)n2(ik+j+1)21ψnψik+j+2(ik+j)21ψ=nnψik+j,

where the first inequality follows from the definition of y and the contradictory assumption, and the second inequality comes from the lower bound on the number of rows of Mi,j+1 proved earlier. Consequently, since row 0 of the original matrix M, which is also in Mi,j+1 because it is forbidden to be removed, contains different variables at different columns and the number of columns is at least nψik+j, one of these variables, say xa, must be in X. It follows from the definition of X that the variable xa must entirely fill in one of the rows of M. It cannot be row 0, because this row contains different variables. This is a contradiction: the column with xa in its row 0 is a permutation, but on the other hand, it also has the same variable xa in one of the non-diverse rows (double occurrence of xa in one column).

Lemma 17.

The construction specified above correctly outputs at least 2k2 strongly-separable blocks, for any kcloglogn, where 0<c<1 is a constant. Moreover, each set Ui, corresponding to set of variables V(B) of the ith constructed block B, has k variables, for any ib(n,k).

Proof.

If the construction stops before finishing 2k2 strongly-separable blocks one-by-one, the size of the remaining matrix M is still at least n/2 rows, out of which at least n are diverse, and n columns, by Lemma 16. Hence, Lemma 15 finishes the proof.

Otherwise, the construction finishes with block 2k2. To prove that blocks are strongly-separable, observe that they are defined on sub-matrices Mi, which are by definition disjoint with previously defined blocks 1,,i1, for any i2k2. Hence, the blocks are row- and column-disjoint. The sets of variables Ui assigned to them, corresponding to sets V(B) for constructed blocks B, are also disjoint, because we are seeking (and adding to intermediate sets Ui,1,) dominating variables excluding those in U1Ui1. Set Ui=V(B) has exactly k elements, which follows directly from its construction. Hence, for a given assignment of variables outside iUi, a suitable 0-1 assignment of variables in iUi that implies the strongly-separable property of blocks can be constructed separately for each block.

It remains to show that for each block, for any 0-1 assignment of variables not in Ui, there is a 0-1 assignment of variables in Ui that makes all columns in block i different. For each row r in the construction, we chose a column with some variable xbxa, with xbU¯i, while all other columns in this block (selected simultaneously with the remaining rows in this block) have xa in row r, where xaUi. Hence, it is enough to set the value of xa to be different from the value xb, which could already be fixed, to guarantee that the column selected simultaneously with row r is different from all columns selected later in this block. Since it holds for any row and associated column of the block, and variables xa are different for each row, the sought 0-1 assignment distinguishing all columns in the block exists.

6 Conclusion

Many challenging and interesting questions arise. Much work has been devoted to singularly optimal algorithms, which are simultaneously optimal, or “near-optimal” in their time and message complexities. In light of the current paper, it is natural to expand the definition of singular (near) optimality and ask whether there are algorithms that are (near) optimal simultaneously in terms of time, messages, and the number of random bits they consume, as well as the maximum number of random bits drawn by a single node. Otherwise, the exact trade-offs between the measures would be interesting.

An interesting observation is that the time and message complexities of the TokenID algorithm (at least using a straightforward analysis) are a large polynomial of the bound N on n even under the LOCAL model. In networks with unique IDs, any (solvable) problem on the network graph G=(V,E) can be solved using O(n|E|) messages and O(diameter(G)) time, simply by any node sending all its information to all the other nodes so every node can simulate the whole graph. It is not clear how to perform such a simulation in anonymous networks. On the other hand, at least under the LOCAL model, it is not hard to observe that the time complexity of Algorithm Splt2Many is O(logn).101010This is by exploiting Lemma 4, regarding a fraction of recursing nodes after a single step, by observing that steps use independent random bits to decide whether they recurse or not, and that the functions f(n) used in our theorems (and in the probability of recursing by only a small fraction of nodes, see Lemma 4) are large enough, i.e., ω(logn).

Alternatively, it can be interesting to show that a tightly optimal maximum number of random bits (matching even the optimal constant) in a single node prevents an algorithm from being optimal in either its message complexity or its time complexity, or both.

Our results apply to asynchronous networks. In particular, if one does not care about the amount of communication, one can use Synchronizer alpha [7] that translates an algorithm designed to work on a synchronous network to work on an asynchronous one, paying O(|E|) messages per rounds in a general network. Finding singularly optimal algorithms (under an expanded definition that includes an optimal number of random bits) in the asynchronous case is more challenging than in the synchronous one. Alternatively, it may be easier (than in synchronous networks) to establish a trade-off between the amount of communication (and/or time) and the number of random bits.

Given a leader, many other tasks no longer require additional random bits since the nodes can now be given IDs. The ID assignment, though, requires time and communication. Hence, it still makes sense to ask what the trade-off between efficiency (communication and time) is and the number of random bits.

Is it possible to balance the random number generations over the nodes of a given algorithm Alg in an anonymous network without knowing the average (on the nodes) number of random bits required by Alg?

Finally, we have demonstrated that our algorithms have, in some sense, the effect of pseudorandom generators. It would be interesting to formalize this notion and to explore other applications of that effect.

References

  • [1] Karl Abrahamson, Andrew Adler, Lisa Higham, and David Kirkpatrick. Probabilistic solitude verification on a ring. In Proceedings of the fifth annual ACM symposium on Principles of distributed computing, pages 161–173, 1986. doi:10.1145/10590.10604.
  • [2] Yehuda Afek and Yossi Matias. Elections in anonymous networks. Information and Computation, 113(2):312–330, 1994. doi:10.1006/INCO.1994.1075.
  • [3] Susanne Albers. Better bounds for online scheduling. In Proceedings of the Twenty-Ninth Annual ACM Symposium on Theory of Computing, pages 130–139, 1997. doi:10.1145/258533.258566.
  • [4] Dana Angluin. Local and global properties in networks of processors. In Proceedings of the twelfth annual ACM Symposium on Theory of Computing (STOC), pages 82–93, 1980.
  • [5] Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, and Mario Szegedy. Proof verification and the hardness of approximation problems. Journal of the ACM (JACM), 45(3):501–555, 1998. doi:10.1145/278298.278306.
  • [6] Hagit Attiya and Jennifer Welch. Distributed computing: fundamentals, simulations, and advanced topics, volume 19. John Wiley & Sons, 2004.
  • [7] Baruch Awerbuch. Complexity of network synchronization. Journal of the ACM (JACM), 32(4):804–823, 1985. doi:10.1145/4221.4227.
  • [8] Peter Bierhorst, Emanuel Knill, Scott Glancy, Yanbao Zhang, Alan Mink, Stephen Jordan, Andrea Rommal, Yi-Kai Liu, Bradley Christensen, Sae Woo Nam, et al. Experimentally generated randomness certified by the impossibility of superluminal signals. Nature, 556(7700):223–226, 2018. doi:10.1038/S41586-018-0019-0.
  • [9] Kenneth P Birman. Guide to reliable distributed systems: building high-assurance applications and cloud-hosted services. Springer Science & Business Media, 2012.
  • [10] Irit Dinur and Samuel Safra. On the hardness of approximating minimum vertex cover. Annals of mathematics, pages 439–485, 2005.
  • [11] Danny Dolev, Ruediger Reischuk, and H Raymond Strong. Early stopping in byzantine agreement. Journal of the ACM (JACM), 37(4):720–741, 1990. doi:10.1145/96559.96565.
  • [12] Sanjam Garg and Akshayaram Srinivasan. Two-round multiparty secure computation from minimal assumptions. Journal of the ACM, 69(5):1–30, 2022. doi:10.1145/3566048.
  • [13] Seth Gilbert, Peter Robinson, and Suman Sourav. Leader election in well-connected graphs. In Proceedings of the 2018 ACM Symposium on Principles of Distributed Computing, PODC 2018, pages 227–236. ACM, 2018. doi:10.1145/3212734.3212754.
  • [14] Johan Håstad, Russell Impagliazzo, Leonid A Levin, and Michael Luby. A pseudorandom generator from any one-way function. SIAM Journal on Computing, 28(4):1364–1396, 1999. doi:10.1137/S0097539793244708.
  • [15] Lauri Hella, Matti Järvisalo, Antti Kuusisto, Juhana Laurinharju, Tuomo Lempiäinen, Kerkko Luosto, Jukka Suomela, and Jonni Virtema. Weak models of distributed computing, with connections to modal logic. Distributed Comput., 28(1):31–53, 2015. doi:10.1007/S00446-013-0202-3.
  • [16] Russell Impagliazzo and David Zuckerman. How to recycle random bits. In FOCS, volume 30, pages 248–253, 1989. doi:10.1109/SFCS.1989.63486.
  • [17] Alon Itai and Michael Rodeh. Symmetry breaking in distributed networks. In FOCS, volume 81, pages 150–158, 1981. doi:10.1109/SFCS.1981.41.
  • [18] Ralph E Johnson and Fred B Schneider. Symmetry and similarity in distributed systems. In Proceedings of the fourth Annual ACM Symposium on Principles of Distributed Computing, PODC 1985, pages 13–22, 1985. doi:10.1145/323596.323598.
  • [19] Donald Knuth. The complexity of nonuniform random number generation. Algorithm and Complexity, New Directions and Results, 1976.
  • [20] Dariusz R. Kowalski and Miguel A. Mosteiro. Time and communication complexity of leader election in anonymous networks. In 41st IEEE International Conference on Distributed Computing Systems, ICDCS 2021, pages 449–460, 2021. doi:10.1109/ICDCS51616.2021.00050.
  • [21] Danny Krizanc, David Peleg, and Eli Upfal. A time-randomness tradeoff for oblivious routing (extended abstract). In Janos Simon, editor, Proceedings of the 20th Annual ACM Symposium on Theory of Computing, May 2-4, 1988, Chicago, Illinois, USA, pages 93–102. ACM, 1988. doi:10.1145/62212.62221.
  • [22] Shay Kutten, Gopal Pandurangan, David Peleg, Peter Robinson, and Amitabh Trehan. On the complexity of universal leader election. J. ACM, 62(1):7:1–7:27, March 2015. doi:10.1145/2699440.
  • [23] Shay Kutten, Gopal Pandurangan, David Peleg, Peter Robinson, and Amitabh Trehan. Sublinear bounds for randomized leader election. Theoretical Computer Science, 561:134–143, 2015. doi:10.1016/J.TCS.2014.02.009.
  • [24] Shay Kutten, Peter Robinson, Ming Ming Tan, and Xianbin Zhu. Improved tradeoffs for leader election. In Proceedings of the 2023 ACM Symposium on Principles of Distributed Computing, PODC 2023, pages 355–365, 2023. doi:10.1145/3583668.3594576.
  • [25] Nancy A Lynch. Distributed algorithms. Elsevier, 1996.
  • [26] David Peleg. Time-optimal leader election in general networks. Journal of Parallel and Distributed Computing, 8(1):96–99, 1990. doi:10.1016/0743-7315(90)90074-Y.
  • [27] David Peleg. Distributed computing: a locality-sensitive approach. SIAM, 2000.
  • [28] Michael O Rabin. The choice coordination problem. Acta Informatica, 17(2):121–134, 1982. doi:10.1007/BF00288965.
  • [29] Omer Reingold. Undirected connectivity in log-space. Journal of the ACM (JACM), 55(4):1–24, 2008. doi:10.1145/1391289.1391291.
  • [30] Nicola Santoro. Design and analysis of distributed algorithms. John Wiley & Sons, 2006.
  • [31] Baruch Schieber. Calling names in nameless networks. In Proceedings of the eighth annual ACM Symposium on Principles of distributed computing, pages 319–328, 1989. doi:10.1145/72981.73004.
  • [32] Meltem Sonmez Turan, John M. Kelsey, and Kerry A. McKay. How random is your RNG? In Shmoocon Proceedings, Washington, DC. National Institute of Standards and Technology (NIST), 2015. URL: https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=917957(AccessedSeptember25,2023).
  • [33] Maarten Van Steen and Andrew S Tanenbaum. Distributed systems. Maarten van Steen Leiden, The Netherlands, 2017.
  • [34] Masafumi Yamashita and Tiko Kameda. Computing on an anonymous network. In Proceedings of the Seventh Annual ACM Symposium on Principles of Distributed Computing, PODC ’88, pages 117–130, New York, NY, USA, 1988. Association for Computing Machinery. doi:10.1145/62546.62568.
  • [35] Masafumi Yamashita and Tsunehiko Kameda. Computing on anonymous networks. ii. decision and membership problems. IEEE Transactions on Parallel and Distributed Systems, 7(1):90–96, 1996.
  • [36] Leqi Zhu. A tight space bound for consensus. In Proceedings of the forty-eighth annual ACM symposium on Theory of Computing, pages 345–350, 2016. doi:10.1145/2897518.2897565.