Symmetry Breaking in Anonymous Networks - Semantic Scholar

2 downloads 0 Views 205KB Size Report
Nov 9, 1995 - mous network of processors by a deterministic algorithm. We also show ... Similarly, port awareness, the existence, at each vertex, of a local numbering of ..... It is di cult in practice to generate independent ran- dom strings in a ...
Symmetry Breaking in Anonymous Networks Bruno Codenotti

Peter Gemmelly

Janos Simonz

November 9, 1995 Abstract We characterize exactly the cases when it is possible to elect a leader in an anonymous network of processors by a deterministic algorithm. We also show that for every graph there is a probabilistic algorithm that elects a leader with high probability and uses very few random bits. The algorithms can be made self-stabilizing.

1 Introduction We consider the problem of electing a leader in an anonymous network of processors. We model distributed systems by a graph, with vertices corresponding to processors, and edges to communication links. We assume that each vertex with the same degree has identical processors. In particular, processors are anonymous: they do not have unique identi ers. We consider both synchronous and asynchronous models, and models with and without 'edge awareness' (local names for outgoing and for incoming edges). Our four models will be de ned precisely in the sequel. It is well known that once a leader is found, many other properties of the network can be computed easily. For example, the leader can grow a breadth- rst tree, count the number of vertices in the network, assign unique identi ers to them, etc. Conversely, if each processor has a unique identi er, one can elect the processor with smallest (or largest) identi er to be the leader. When dealing with randomized algorithms, it is easy to verify that O(log n) random bits per processor will almost surely result in a unique processor with minimum Istituto di Matematica Computazionale del CNR, Pisa, Italy. Partially supported by ESPRIT Basic Research Action, Project 9072 'GEPPCOM'. e-mail:[email protected] y Sandia National Laboratories. e-mail: [email protected]. Portions of this work were done while visiting IMC-CNR in Pisa, partially supported by GNIM-CNR z Department of Computer Science, The University of Chicago. e-mail: [email protected]. Portions of this work were done while visiting IMC-CNR in Pisa, sponsored by a grant from CNR 

1

name in an n-processor network. Our techniques can be used to give easy proofs that for some graphs (log n) random bits per processor are necessary. Leader election is a basic symmetry breaking operation in distributed computing. Intuitively, it is possible to elect a leader in networks with `built-in' asymmetry, and impossible to do so in 'symmetric' networks. Our paper gives a precise characterization of this intuition. It turns out that the kind of asymmetry that can be detected in a distributed fashion depends on the particular model of computation used. For example, the standard de nitions of asynchronous models (de ned below) let us assume that at any given time only one processor is active. This provides enough asymmetry to ensure that a leader can be elected in K (a single edge connecting two vertices, a very symmetric graph) [1]. On the other hand, it is not hard to prove that no synchronous algorithm can elect a leader in this graph. Figure 1 in Appendix B is a more complicated example of the di erence between synchronous and asynchronous models. Similarly, port awareness, the existence, at each vertex, of a local numbering of the edges incident at the vertex (their position in the adjacency list) may introduce some non-obvious asymmetry. For example, the complete bipartite graph K has nontrivial automorphisms, so we would expect that no leader election is possible, at least by synchronous algorithms. This is not the case: there is an easy algorithm to elect a leader, in any labeling of K (see Section 5). A natural conjecture is that leader election is impossible if and only if for any vertex the graph has an automorphism that moves the vertex (respecting edge labels if such labels exist). The condition is clearly necessary, since if we start all processors in the same state, the processors in an orbit of the automorphism will remain in the same state: in particular, all processors (or none) will be elected leader. Unfortunately, the converse does not hold: Figure 3 exhibits a graph that has a distinguished vertex that is not moved by any automorphism, yet we can prove, using our characterizations that no distributed algorithm can elect a leader in the graph. These examples should suggest that the problem is in fact interesting. While one may argue that in practice assigning unique identi ers to processors is a simple task, and one can easily spare the relatively few bits needed to do so, there are both theoretical and practical reasons to study anonymous networks. It is unclear how to assign in practice unique identi ers in a distributed fashion, and there may be reliability reasons to assume anonymity (identi ers may get lost, corrupted, etc.). Still, we do not claim that our results are practical. Rather, we believe that distributed symmetry breaking is a worthwhile case study that may help us understand the extent to which local information can be used to establish global properties in distributed computations. In the rest of this abstract we review brie y the history of the problem, previous work, and sketch our results. 2

2;3

2;3

2

2 History The seminal paper in the area is due to Angluin [1]. She de ned the problem and used the notion of covering from topological graph theory to capture sucient conditions for impossibility of leader election on certain anonymous networks [1]. The model of computation used in the paper is rather unorthodox, and is based on Milne and Milner's theory of communicating sequential processes [11], but the proof works for all reasonable models of parallel computation, including the ones used by us. She proves that if a network G has the property that there is a smaller network H such that there is an embedding of G into H (in which case H is said to be a covering of G), then there cannot be a deterministic leader election algorithm in G. This implies, for example that it is impossible to elect a leader in a cycle of composite length. Unfortunately, Angluin's condition is necessary, but not sucient. Figure 2 shows an example of a graph that does not have a covering, but can be shown not to have a leader election algorithm by our techniques. The need for sucient conditions is illustrated by the fact that until the appearance of the work of Burns and Pachl [3] it was not clear that in rings of prime size it is possible to elect a leader in the asynchronous model (in fact it can be done with processors that are nite automata [6]). Further developments are less well known. An interesting paper by Johnson and Schneider [10], de ned edge labelings (as part of the tools the algorithm designer could use, although this was not the formalism used in the paper), de ned 'local views' that processors could obtain, and observed that the Dining Philosophers Problem could be solved in some cases (for example when n = 6). Yamashita and Kameda [13], building on the paper above, characterize the solvable instances of the leader election problem in the case of synchronous networks of anonymous processors, by graph-theoretic terms. (The model used in [13] is called asynchronous, but in fact all asynchrony is in the communication mechanism, and corresponds to a synchronous operation.) Although our formalism is di erent, our characterization and even our proof are those of [13]. In this paper we give a characterization for both synchronous and asynchronous networks, under both the conditions of edge awareness and no edge awareness. One of the four cases (the synchronous model with edge awareness) is the result of [13]. Self-stabilization has been introduced by Dijkstra in his classic 1974 paper [4], and since then has been viewed as a convenient property of distributed computations. There has been a considerable e ort towards characterizing network operations that admit self-stabilizing algorithms (see, e.g., [12] [5]). In the case of leader election, an algorithm is self-stabilizing if a leader is eventually elected, even though an adversary can set the initial con guration of the network to an arbitrary state. Our leader election algorithms can be made self-stabilizing, although in this abstract we will only sketch the necessary ideas. 3

3 Preliminaries We consider four models, which correspond to the choice of the model of synchrony (synchronous vs. asynchronous) and to the way a processor interacts with its links (edge awareness vs. no edge awareness). In all models, there is an underlying graph, with edges corresponding to links between processors. In this abstract we will assume for the sake of simplicity that these are two-way links, but our results hold also for directed graphs. In synchronous models we assume the existence of a global clock. At each clock cycle, every processor executes one step of its computation. The step may depend on the state of adjacent processors. (Although this model, inspired by cellular automata, is not very realistic for distributed systems, it can be easily simulated by an asynchronous network with FIFO message bu ers at links.) Our model of asynchronous computation is that of a central daemon (cf. [3]). Processors are enabled if their state is such that they can perform a step of their program. In general, at any point in time there are several enabled processors. An adversary chooses one of these to perform one step of its computation. At this point there will be a new set of enabled processors, and the adversary selects one of these. The process goes on until there are no enabled processors. Algorithms must be designed so that eventually a leader is elected, no matter what the choices of the daemon are. We consider two models for the links. Processors have edge awareness if the edges of the graph G have a labeling. Each of the vertices adjacent to an edge contributes a number to the labeling. If vertex v has degree d, then it uses the numbers f1 : : : dg for its contribution to the labeling, a distinct number for each edge adjacent to it. (We can think of this as the processor being aware of which input/output port is associated with a given link. When designing our algorithms, we assume we do not have control of this local labeling: our algorithms must work no matter how an adversary chooses to associate links with ports.) In models without edge awareness processors cannot distinguish among edges. Thus, we have four distinct computational models. We assume that initially all processors are in the same state. As stated before, we can extend our algorithms to be self-stabilizing, i.e. work without any assumptions about the initial con guration.

De nition 1 Given an undirected graph G = (V ; E ), vertices v 2 V , and sets of vertices S; T  V , we have: degree(v) = jfw : (v; w) 2 E gj degree(v; T ) = jfw : w 2 T; (v; w) 2 E gj degree(S; T ) = jf(v; w) : v 2 S; w 2 T; (v; w) 2 E gj G

G

G

G

G

4

G

G

De nition 2 local views

Given a labeled graph G and a vertex v 2 G, the local 1-view of v is the set of d pairs of numbers (1; x1); : : : (d; x ) where: d is the degree of v, and each pair (i; x ) represents the numbers contributed to the labeling of an edge by v and one of v's neighbors respectively. d

i

Local 1-views can be computed by a straightforward distributed protocol in models with edge awareness. One can continue the process: neighbors take turns broadcasting their current view of the graph. Each processor can build a tree, which we call local view, by having a root whose children are the previous local views received from the neighbors. We say that a local view has level k if it incorporates all paths of length k in the graph.

4 Homomorphisms Our necessary and sucient conditions for leader election, in the four models discussed above (synchronous and asynchronous, with and without edge awareness) are given by the existence of four specialized graph homomorphisms. In the following paragraphs we give the de nitions of these homomorphisms.

De nition 3 A homomorphism from graph G = (V ; E ) into graph H = (V ; E ) is an G

G

H

H

onto map p from V to V , with the following property. Consider the induced map from E to E , de ned by p ((u; v)) = (p(u); p(v)). Then E is exactly the range of this map. G

H

H

e

G

H

In other words, the map preserves edges (if (u; v) is an edge of G, then (p(u); p(v)) is an edge of H ), and for every edge (s; t) of H there is an edge (u; v) of G with s = p(u) and t = p(v). The homomorphisms we will deal with will always satisfy the following two conditions on preimages of vertices of H: 1. 8v 2 V , jp? (v)j  2; 2. 8u ; v 2 V , the graph induced by p? (u), p? (v) is regular bipartite. In other words, 8s ; t 2 V there are d , d such that 8u 2 p? (s) degree(u; p? (t)) = jf(u; v) v 2 p? (t)gj = d , 8v 2 p? (t), degree(u; p? (t)) = jf(u; v) u 2 p? (s)gj = d . 1

H

1

H

H

1

1

1

1

2

1

1

1

1

1

2

Now we can de ne the 4 specialized homomorphisms, by introducing additional conditions. 1. For models with edge awareness, all preimages must have the same cardinality, i.e., 8v ; w 2 V , jp? (v)j = jp? (w)j. 2. For asynchronous models, H must have no self-loops. H

1

1

5

3. For synchronous models, if there is edge awareness, then 8v 2 V , (each connected component of) the subgraph G ?1 of G induced by p? (v) has the following properties: H

p

1

(v )

(a) it is d-regular. (b) If d is even, then its edges can be partitioned into disjoint sets of cycles where each set of cycles covers each vertex of p? (v) exactly once. (c) If d is odd, then it has a perfect matching such that when the edges corresponding to this perfect matching are removed, the remaining graph satis es property (b) above. 1

if there is no edge awareness, 8w in V , the graph induced by p? (w) is regular. 1

H

We will denote the 4 specialized homomorphisms so obtained by S -homomorphism (homomorphism that satis es the additional constraints for the synchronous model with edge awareness), S -homomorphism (synchronous model without edge awareness), A-homomorphism (asynchronous model with edge awareness), and A -homomorphism (asynchronous model without edge awareness). Note that the de nition of an S -homomorphism is a relaxation of the de nition of an S homomorphism in two senses. The graphs induced by each preimage no longer have to have a special partition of cycle covers structure, and the preimages no longer have to be of the same size. Precise de nitions can be found in Appendix A. N

N

N

5 Algorithms and characterizations Our main theorem below states that in each of the four cases it is impossible to elect a leader if and only if there is an appropriate homomorphism from the network into another one. Intuitively, these homomorphisms capture the appropriate notion of 'symmetry'. More precisely, if there is a homomorphism, the 'additional condition 1' present in all de nitions, guarantees that each vertex v of V has several preimages in the original network. We prove that every leader election algorithm will leave all the preimages in the same state: hence if a leader is ever elected, all the preimages will become leaders. We will also show that if there is no such homomorphism, a leader can be found in the corresponding model of distributed computation. H

Theorem 1 Assume all processors of G are initially in the same state. It is impossible to elect a leader in G by a deterministic distributed algorithm if and only if

1. There is an S-homomorphism into some graph H, and the model of computation is synchronous with edge awareness

6

2. There is an S -homomorphism into some graph H, and the model of computation is synchronous with no edge awareness 3. There is an A-homomorphism into some graph H, and the model of computation is asynchronous with edge awareness 4. There is an A -homomorphism into some graph H, and the model of computation is asynchronous with no edge awareness. N

N

Proof: We give here the proof for the asynchronous model with edge awareness.

(Sketch:) We need the following Lemma, whose proof will be given in the full paper.

Lemma 2 If there is an A-homomorphism from G into H , then there exists labeling of G such that 8v 2 H; 8s; t 2 p? (v); s; t have the same local 1-view. 1

If there is an A-homomorphism, the adversary labels the edges of the graph with the labeling guaranteed to exist by the lemma above. The adversary then schedules the processors in such a way that if a processor in the preimage p? (v) makes a move, then all processors in this preimage, one at a time, make a move. Because of the conditions of an A-homomorphism, this will be possible. Moreover, all the processors belonging to the preimage will have the same neighbors, with corresponding neighbors being in the same state. Thus, all processors in the same preimage remain in the same state. Since all preimages have at least two members, it is impossible to elect a leader. If there is no A-homomorphism, we show how we can elect a leader. For the moment, assume that each processor knows n, the number of vertices of the graph. We will argue later that this is not necessary. The processors compute local views up to depth 2n. In other words, processes send messages to all their neighbors, with their current view of the graph. Messages contain information about the label of the edge they were transmitted through. This is done repeatedly, until we are guaranteed that the depth of local views is 2n. (Since the processors are asynchronous, we need to keep local counters to keep the process synchronized. Such details will be given in the full paper.) Thus, each process will build a labeled tree (which we call local view) with the labels of outgoing edges connecting it to the labeled trees received from the neighbor that is the other endpoint of the link. The vertices partition themselves into equivalence classes based upon what depth n local view they have. It follows from the de nition of A-homomorphism that the equivalence classes will have the same cardinality. Note that a depth 2n tree will have all depth n trees as subtrees. If the equivalence classes each contain only one processor (this happens if there are exactly n distinct subtrees of depth n, then the processor with, say, the lexicographically smallest view will become the leader. If the equivalence classes have more than one member each, then members of each class labels themselves either A or B according to the following rule: 1

7

 If the processor wakes up and all neighbors in its equivalence class are unlabeled, it labels itself A.  If the processor wakes up and any neighbor in its equivalence class is labeled, it labels itself B .

At the end of this \A-B game", the processors recompute their local views up to depth 2n, taking into account each processor's previous class and label. They then recompute the equivalence classes. If the equivalence classes each contain only one processor (again, they will all always have the same cardinality), then the processors elect as leader the processor with the lexicographically smallest view. Otherwise, they repeat the process (A ? B game and computing views) until the classes do have one member each or until the classes have no internal edges (and hence induce an A-homomorphism). In each iteration, the number of the equivalence classes must at least double, so this process ends.

2

The algorithm, as sketched above, makes essential use of the knowledge of n, the number of vertices in the graph. It is possible to elect a leader even if n is not known. We can only outline the relevant ideas in this abstract. First, what we mean in this case by 'leader election' is that if a leader can be elected in G (in spite of adversary labeling of edges, and in spite of the schedule given by the central daemon), we will eventually succeed in electing a leader. Otherwise, we may not elect any processor, or may mistakenly designate several processors as leaders. Note that even when a leader is eventually elected, there may be a period during which several processors (mistakenly) believe themselves leaders: all we require is that a single processor be elected 'in the limit'. Given this notion of leader election, our general strategy is as follows. For n = 1; 2;    we run the algorithm above. For any n for which the algorithm succeeds, the leader imposes a breadth- rst tree on the network, counts the number of vertices, and checks that it is n. This will succeed for the correct value of n (and also for some larger values.) Assuming that a leader can be elected in the network, we will nd it as soon as n becomes the actual size of the network. In the synchronous case, the same leader will be elected for all greater values of n. In the asynchronous case, because of di erent schedules, we may get di erent leaders. We overcome this diculty by checking the network for leaders elected in previous rounds, say when we had n = p. If there are any, we check whether it is consistent to assume that the network has size p. If so, the leader 'abdicates' and lets the previous leader remain the leader. It is only if an error is detected that the previous leader is killed, and the new leader candidate actually becomes a leader if this happens for all smaller values of n. Simple possibility and impossibility results for speci c graphs are corollaries of our theorem.

Corollary 3 For every n > 1 it is impossible to elect a leader in K in the synchronous n

model, even in the case of edge awareness.

8

Corollary 4 With edge awareness, there exists a leader election algorithm that successfully

elects a leader in K i i,j are relatively prime. Proof: Consider K for i,j relatively prime. Let the vertices be partitioned into i 'left' and j 'right' vertices. We elect the left processor b that has the smallest z, such that there are exactly z right processors whose 1-edge connects it to b, and z is unique. (such a z exists in every labeling, because i and j are relatively prime.) i;j

i;j

5.1

Self-stabilization

We can strengthen our algorithms (when they exist) to be self-stabilizing. The self-stabilizing algorithms are far from practical. Due to space limitations, we give only a very rough sketch of the techniques needed to accomplish this. The basic idea is to continuously restart the election algorithm: eventually it will correctly elect a leader. Also, the size of the network is not known (the adversary may have set the variables to arbitrary values), so we have to also try all possible values for the size of the network. Since we want to eventually elect always the same processor to be the leader, we must rerun the algorithm so that if a processor was correctly elected by a previous process, we defer to it. To be able to establish what a 'previous process' is, we rst obtain a global self-stabilizing clock, using the techniques of [2]. We compose two self-stabilizing algorithms using the methodology of [7], so we may assume the existence of a correct clock. Each process carries with it the time it begun. The messy details are omitted from the abstract. Note that this is not a realistic algorithm: the number of processes (and, therefore, message length) increases without bound.

6 Randomized Leader Election Algorithms Our characterizations for the possibility of leader election by deterministic algorithms allows us to obtain simple probabilistic algorithms for leader election in anonymous networks. These algorithms use independent coin tosses at each processor, and correctly elect a leader with high probability. As discussed before, it is easy to obtain such algorithms, either by tossing O(log n) coins at each processor to obtain distinct identi ers, or to play an elimination tournament among processors where individual games are decided by random coin tosses. Again in this case, we expect that a leader will be elected after O(log n) rounds, and thus O(log n) random bits will be used per processor. These bounds depend on n, the number of processors, but are independent of the underlying graph. Our algorithms use a very small number of random bits. There are several reasons to use algorithms that use few random bits. It is dicult in practice to generate independent random strings in a distributed environment. Thus, random bits are a possibly scarce resource in distributed computations, and it is interesting to study the 'randomness requirements' of distributed algorithms. 9

Consider the following randomized algorithm, for both the synchronous and the asynchronous model. Given a network with underlying graph G, for every node v 2 V assign independently at random the labels 1; 2;    degree(v) to the edges incident on v. (Note that this corresponds to simply associating each link with an arbitrary port.) From now on, our algorithm becomes the deterministic leader election algorithm described in our proofs. G

Theorem 5 The probability that a unique leader will be elected is 1 ? 1=poly(n). The proof is an estimate of the probability that there is an appropriate homomorphism after the random labeling of the edges, and is omitted from this abstract. Our techniques also yield lower bounds on the number of random bits required for leader election.

Theorem 6 There are n-vertex graphs that require (log n) random bits per processor in order to elect a leader.

Proof: (sketch). Consider K , the complete graph on n vertices in the synchronous model n

with no edge awareness. We may assume that every probabilistic algorithm starts by tossing the appropriate number of coins at processors, and becomes a deterministic algorithm with access to these bits. If there are less than 1=2 log n random bits per processor, then with high probability there will be an S -embedding of K , and thus, no leader election algorithm. 2 N

n

7 Conclusions We believe that homomorphisms are an elegant and powerful tool in the theory of distributed algorithms. Our homomorphism-based characterizations not only enabled us to settle the leader election question in di erent models of computation, but provides upper and lower bounds for probabilistic algorithms. A homomorphism based technique was recently used to prove impossibility of self-stabilizing phase clocks [9]. We believe that there are many more potential applications.

References [1] D. Angluin, Global and Local Properties in Networks of Processors, Proc. 12th STOC (1980), 82-93. [2] A. Arora, S. Dolev, M. Gouda, Maintaining Digital Clocks in Step Parallel Processing Letters v.2 n.1 (1991) 11-18. [3] J.E. Burns, J.Pachl Uniform Self-Stabilizing Rings, ACM Trans. Progr. Lang. Syst. 11 (1989), 330-344. 10

[4] E.W. Dijstra, Self-Stabilizing Systems in spite of Distributed Control, Comm. ACM 17(11) (1974), 643-644. [5] M. G. Gouda The Triumph and Tribulation of System Stabilization, in JM Helary, M. Raynal (eds) Distributed Algorithms - 9th WDAG Springer (1995), 1-18. [6] G. Itkis, C. Lin, J. Simon Deterministic, Constant Space, Self-Stabilizing Leader Election on Uniform Rings, in JM Helary, M. Raynal (eds) Distributed Algorithms - 9th WDAG Springer (1995), 288-302. [7] S. Katz, K. J. Perry, Self-stabilizing Extensions for Message-Passing Systems, Distributed Computing v.7 (1993) 17-26. [8] C. Lin, S. Mahaney, S. Kurtz, J. Simon Simple Algorithms for Leader Election in Synchronous Rings, preprint, The University of Chicago (1992). [9] C. Lin, J. Simon, Possibility and Impossibility Results for Self-Stabilizing Phase Clocks on Synchronous Rings, Proceedings 2nd WSS, U. of Nevada Las Vegas (1995). [10] R.E. Johnson, F.B.Schneider Symmetry and Similarity in Distributed Systems, Proc. 4th PODC (1985), 13-22. [11] G. A. Milne, R. Milner Concurrent Processes and Their Syntax, Journal of the ACM 26, (1979), 302-321. [12] M.Schneider Self-Stabilization, ACM Computing Surveys 25(1) (1993), 45-67. [13] M. Yamashita, T.Kameda Computing on Anonymous Networks, Proc. 7th PODC (1988), 117-130.

11

8 Appendix A: De nitions of the homomorphisms De nition 4 An S -homomorphism from G = (V ; E ) into H = (V ; E ) is an onto map G

G

H

H

p from V to V that induces a map from E to E , whose range is E , and such that G

H

G

H

H

1. 8v 2 V , jp?1 (v)j  2; H

2. 8u ; v 2 V , the graph induced by p?1 (u), p?1 (v) is regular bipartite. In other words, 8s ; t 2 V there are d1, d2 such that 8u 2 p?1 (s) jf(u; v) v 2 p?1 (t)gj = d1, 8v 2 p?1 (t) jf(u; v) u 2 p?1 (s)gj = d2. H

H

3. 8v ; w 2 V , jp?1(v)j = jp?1 (w)j. H

4. 8v 2 V , (each connected component of) the subgraph G ?1 ( ) of G induced by p?1 (v) has the following properties: H

p

v

(a) it is d-regular. (b) If d is even, then its edges can be partitioned into disjoint sets of cycles where each set of cycles covers each vertex of p?1 (v) exactly once. (c) If d is odd, then it has a perfect matching such that when the edges corresponding to this perfect matching are removed, the remaining graph satis es the above property (b).

De nition 5 An S -homomorphism from G = (V ; E ) into H = (V ; E ) is an onto map N

G

G

H

H

p from V to V that induces a map from E to E , whose range is E , and such that G

H

G

H

H

1. 8v 2 V , jp?1 (v)j  2; H

2. 8u ; v 2 V , the graph induced by p?1 (u), p?1 (v) is regular bipartite. In other words, 8s ; t 2 V there are d1, d2 such that 8u 2 p?1 (s) jf(u; v) v 2 p?1 (t)gj = d1, 8v 2 p?1 (t) jf(u; v) u 2 p?1 (s)gj = d2. H

H

3. 8w in V , the graph induced by p?1 (w) is regular. H

De nition 6 An A-homomorphism from G = (V ; E ) into H = (V ; E ) is an onto map G

G

H

H

p from V to V that induces a map from E to E , whose range is E , and such that G

H

G

H

H

1. 8v 2 V , jp?1 (v)j  2; H

2. 8u ; v 2 V , the graph induced by p?1 (u), p?1 (v) is regular bipartite. In other words, 8s ; t 2 V there are d1, d2 such that 8u 2 p?1 (s) jf(u; v) v 2 p?1 (t)gj = d1, 8v 2 p?1 (t) jf(u; v) u 2 p?1 (s)gj = d2. H

H

3. 8v ; w 2 V , jp?1(v)j = jp?1 (w)j. H

12

4. H must have no self-loops.

De nition 7 An A -homomorphism from G = (V ; E ) into H = (V ; E ) is an onto N

G

G

H

H

map p from V to V that induces a map from E to E , whose range is E , and such that G

H

G

H

H

1. 8v 2 V , jp?1 (v)j  2; H

2. 8u ; v 2 V , the graph induced by p?1 (u), p?1 (v) is regular bipartite. In other words, 8s ; t 2 V there are d1, d2 such that 8u 2 p?1 (s) jf(u; v) v 2 p?1 (t)gj = d1, 8v 2 p?1 (t) jf(u; v) u 2 p?1 (s)gj = d2. H

H

3. H must have no self-loops.

13

9 Appendix B: Figures In Figures 1, 2, and 3 we provide examples that outline the di erence between the synchronous and the asynchronous case, between Angluin's covering and homomorphisms, and between nontrivial automorphisms and homomorphisms, respectively. Note that, although the graph in Figure 3 has a special node, this that cannot be discovered from local views. This fact shows that leader election does not simply coincide with symmetry breaking. More in general, we can show that there is a graph with no nontrivial automorphisms, (so we can nd a special vertex - in fact every vertex is special) but no leader election algorithms. The example of Figure 4 illustrate two di erent graphs that cannot be distinguished, given the multiset of local views.

G

H

Figure 1: The graph G does not have a homomorphism without self loops. Thus it is possible to elect a leader in G in the asynchronous case. The mapping of the graph G onto H is a homomorphism with self-loops. Thus it is not possible to elect a leader in G in the synchronous case.

G

H

Figure 2: The graph G does not have a covering. On the other hand there is a homomorphism of G into H, so it is not possible to elect a leader in G.

14

Figure 3: The graph G does have a homomorphism although there is a distinguished vertex that cannot be moved by any automorphism.

Figure 4: A node cannot know to which of these two graphs it belongs.

15