Locally Computable Enumerations - CiteSeerX

0 downloads 0 Views 214KB Size Report
Jul 9, 1997 - integers. Next, we de ne so-called locally bijective labelling of graph ... the maximum value of any connected function de ned on nite set A is jAj.
Locally Computable Enumerations Antoni Mazurkiewicz Institute of Computer Science of PAS Ordona 21, 01-237

Warsaw

[email protected]

July 9, 1997 Abstract

This paper is an extended and modi ed version of [10]. A protocol with local rules is presented for enumerating anonymous nodes of nite graphs. It is proved that such algorithms do not exists for the class of ambiguous graphs, de ned in the paper; the proposed algorithm works successfully for remaining non-ambiguous graphs. It is also proved that protocol is fair, which means that no enumeration of nodes is discriminated by the protocol and that all individual nodes "know\ the fact of successful termination of the protocol activity, provided the number of nodes of a graph is known to the protocol. The described protocol is a generalization of that presented in [9] by the author. Keywords:

Algorithms; distributed systems; graphs; local computations

1 Introduction The issue of enumeration of nodes of a graph by local transformations is worth of consideration for a number of reasons. First, local transformations of graph labellings are good models of distributed computation, where remote graph nodes can change its labelling independently of each other, relying only on communication by messages, passed from one node to another. Secondly, enumeration itself, introducing an order into unordered set of nodes, is a good model of resolving global con icts by local means; the network computation o ers real  partially supported by

grant KBN 8T11C 029 08

examples of such con icts that should be resolved. Thirdly, this issue is interesting from a theoretical point of view, as drawing a border between possibility and impossibility of some algorithmic solutions. Here, instead of the notion of local algorithm we prefer to use the term protocol, reserving the former name for a set of elementary rules concerning a single object. In general, algorithms de ne computations by means of a set of elementary rules, executed in deterministic or non-deterministic way. We nd useful to restrict the above notion to the set of rules concerning one object, and use the notion of a protocol for a set of rules that may concern many objects, without explicit referring to any of them. Roughly speaking, a protocol is an algorithm common to a number of acting objects. Using this terminology, local transformations of graph labellings can be de ned as protocols with sets of transformation rules concerning labels of graph nodes and distinguishing none of them. The paper is organized as follows. First, we introduce some auxiliary notions, useful for condstruction and proving the protocol correctness. These are notions of connected function and of lexicographic ordering of nite sets of positive integers. Next, we de ne so-called locally bijective labelling of graph nodes and by means of this notion de ne ambiguity of graphs. The notion of local protocol enumeration graph nodes is de ned and it is shown that such an algorithm does not exist for the class of ambiguous graphs. In the subsequent part of the paper a protocol is de ned which is universal in this sense that it enumerates any non-ambiguous graph. It is shown that for an ambiguous graph the result of the protocol work is either an enumeration, or a proof that the graph is ambiguous. The paper is closed with some properties of the designed protocol: its fairness and cleaness. Standard mathematical notation is used through the paper; the set of positive integers is denoted by N , and the set N [ f0g of non-negative integers by N0 ; the cardinality of a set A is denoted by jAj.

2 Connected functions Let f be a function with a nite domain X and values being non-negative integers. We say that f is connected, if for each x 2 X

f (x) > 1 ) 9y 2 X : f (y) = f (x) ? 1: (1) Let X be a nite set. It follows from the above de nition that constant functions 0; 1 with 0(x) = 0 and 1(x) = 1 for each x 2 X are connected. The following lemma will be helpful in the sequel.

2

Lemma 1 Let f be connected function on X , let Y  X; x ; x 2 X; x =6 x . If f (x ) = 0 or f (x ) = f (x ) then function g de ned for all x 2 X by the equality:  g(x) = maxff (y) j y 2 Y g + 1; if x = x ; 0

0

is connected.

0

1

0

1

1

f (x) otherwise;

0

Proof. With the notation of Lemma 1, let z 2 X; g (z ) > 1. Consider the case of f (x0 ) = 0. If z 6= x0 , then f (z ) = g(z ) > 1 and by connectivity of f there is u 2 X with f (u) = f (z ) ? 1 > 0. Therefore, u 6= x0 , hence g(u) = f (u), proving g(u) = g(z ) ? 1. If z = x0 , then g(z ) = maxff (y) j y 2 Y g + 1, hence there is y 2 Y with f (y) = g(z ) ? 1 > 0. As in previous case, y 6= x0, hence g(y) = f (u) = g(z ) ? 1. Consider now the case of f (x0 ) = f (x1 ) with x0 6= x1. If z 6= x0, then g(z ) = f (z ) and by connectivity of f there is u 2 X with f (u) = f (z ) ? 1 = g(z ) ? 1 > 0. If u = x0 , then f (u) = f (x0 ) = f (x1 ) and because x0 6= x1 we have f (x1 ) = g(x1) = g(z ) ? 1. If z = x0, then g(z ) = maxff (y) j y 2 Y g + 1, hence there is y 2 Y with f (u) = g(z ) ? 1 > 0. If y = x0, then f (u) = f (x1 ) and since x1 6= x0, f (x1 ) = g(x1 ) which gives g(x1) = g(z ) ? 1. 2

Particular cases of connected functions are enumerations of X , i.e. bijections from X to f1; 2; : : :; jX jg. Let f; g be functions from X to the set of integers; say thet f  g i for each x 2 X : f (x)  g(x). Clearly,  is a (partial) ordering relation in the set of all functions with integer values de ned on X known as \pointwise" ordering). It is easy to see that enumerations of X are maximum connected functions de ned on X , and the constant function 0 is the (unique) minimum connected function on X . Clearly, there is a nite number of connected functions de ned on a nite set; the maximum value of any connected function de ned on nite set A is jAj.

3 Ordering of nite sets For any nite subset A  N let max(A) denotes the greatest integer in A; by convention, max(;) = 0. Let A; B  N ; we say that B is stronger than A and write A  B , if max(A ? B ) < max(B ? A): Observe that for proving A  B it suces to show that for each a 2 A ? B there is b 2 B ? A with a < b. Furthermore, it is obvious that A  B , (A [ C )  (B [ C ); 3

in particular, A  B , (A ? B )  (B ? A), since A = (A ? B ) [ (A \ B ) and B = (B ? A) [ (A \ B ). We have also A  B ) A  B and max(A) < k ) A  fkg, for any A; B  N ; k 2 N .

Lemma 2 Relation  is a total order in the family of all nite subsets of N . Proof. To prove transitivity of  assume A; B; C  N and A  B  C . We have to show that for each a 2 A ? C there is c 2 C ? A with a < c. Let a 2 A ? C; b = max(B ? A); c = max(C ? B ). If a 62 B , then a < b by A  B . If b 2 C , the proof is completed. If b 62 C , then b < c; c cannot be in A, since then it would be greater than max(B ? A), contradicting A  B . Thus, c 2 C ? A and a < c. If a 2 B , then by B  C we have a < c; c is not in A, since then it would contradict A  B ; thus, c 2 C ? A. It proves transitivity of . Asymmetry of  is evident: if it were A  B  A, it would be max(A ? B ) < max(B ? A) < max(A ? B ), a contradiction. To prove totality of , let A; B be arbitrary subsets of N . If A 6= B , then sets A ? B; B ? A are disjoint and at least one of them is non-empty. Thus, because integers are totally ordered by 1. 2

Proof.

Corollary 2. Graphs with prime size or with prime number of edges are not

2

ambiguous (cf. [9])

Corollary 3. Trees are not ambiguous (there is no common divisor greater than 1 of number n of nodes of a tree and of number (n ? 1) of its edges). 2 By virtue of Lemma 4, to each locally bijective labelling  of graph G corresponds number k such that for any node v of G we have sim (v) = k. It allows us to classify locally bijective labellings according to this number and call locally bijective labelling  k-bijective, if sim (v) = k for each node v. Using this terminology, 1-bijective labelling is a bijection. Labelling transformations and protocols. In this paper transformations of graphs are understood as transformations of their labellings subjected to some local rules. By a transformation rule over set S of labels we mean here any pair of label sequences with equal length. Let G = (V; E ) be a graph, r be a transformation rule, r = h(s00 ; s01 ; : : :; s0n); (s000 ; s001 ; : : :; s00n )i; (n  0); and let 0 ; 00 be two labellings of G. We say that labelling 00 arises from 0 by rule r if and only if there exists v0 2 V with NG (v0) = fv1; v2; : : :; vng(n  0), such that 0 (vi ) = s0i ; 00(vi ) = s00i ; (0  i  n) 00 (v) = 0 (v): (v 2 V ? BG (v0)) Intuitively, if the graph has node v labelled with s00 and its n neighbours are labelled with s01 ; s02; : : :; s0n , then rule r is applicable to v and its application results in replacement the label of v with s000 , labels of its corresponding neighbours with s001 ; s002 ; : : :; s00n, respectively, and leaving labels of remaining nodes of the graph unchanged. If a node with above properties does not exist, the rule is not applicable. In other words, transformation rules are special cases of rewritting rules. 7

By the above de nition, an application of a rule to a node depends exclusively on the labels of nodes in the ball around this node and results in changing these labels exclusively. In other words, transformations of a graph labellings de ned by transformation rules as de ned above are local. A protocol over set S of labels is any set of transformation rules over S . Let P be a protocol. Write 0 !P 00 if there is a rule r 2 P such that 00 arises from s0 by r, and write 0 !P 00 , if there exists a nite or in nite sequence (0 ; 1; : : :; n; : : :) of labellings of G, called a run of P , such that 0 = 0; 00 = n and i?1 !P i for each i  1. Labelling 0 is the initial labelling of this run; if a run is nite and no rule in P is applicable to its last element, this element is the nal labelling of the run which is then called terminating. Final labellings of all runs of P are nal labellings of P . Protocol is terminating for a labelling, if any run beginning with this labelling is nite. In general, there is a number of di erent runs of a protocol, terminating or not, that begin with the same labelling, since neither the order nor the choice of applied transformation rules are determined by protocols. Let G be a class of graphs. Protocol P over S is an enumeration protocol for class G , if there is a label s0 2 S such that for each graph G in G it satis es the following conditions: 1. Any run beginning with labelling 0, such that 0(v) = s0 for each node v of G, is terminating; 2. The nal labelling of any run beginning with 0 is bijective. Now, we are going to show that in case of ambiguous graphs the above two conditions exclude each other. Namely, we have the following theorem (being a generalizations of that in [9], and proved along the same lines).

Theorem 2 There is no enumeration protocol for ambiguous graphs. Let G = (V; E ) be an ambiguous graph and suppose, by way of contradiction, that P is an enumeration protocol for G. Since G is ambiguous, there exists a locally bijective labelling 0 of G which is not bijective; this labelling de nes similarity of nodes of G. Let us x this labelling and call any labelling  of G symmetric, if 0 (v0 ) = 0 (v00 ) implies (v0 ) = (v00 ). Since 0 is not bijective, there are at least two di erent nodes in V which are similar. Since any terminal labelling of G has to be bijective, none of symmetric labellings are terminal. Construct now in nite run of P as follows. Clearly, initial labelling, as constant, is symmetric. If a symmetric labelling of the run is aready de ned, Proof.

8

then, since it is not terminal, there is a rule r 2 P applicable to this labelling for node v0. Apply r successively to all nodes similar to v0; it is always possible, since similar nodes have similar and disjoint neighbourhoods. In e ect, a new symmetric labelling is obtained. This procedure can be endlessly repeated, creating an in nite run, the symmetric labellings of which form the sequence: 0 ! (1) !P (2) !P    !P (n) !    ; Thus, P either terminates with not bijective nal labelling, or produces an in nite run. It contradicts the requirements for enumerating protocols. 2 In fact, we have proved above somewhat stronger property of ambiguouss graphs, stating that any protocol for ambiguous graph can generates in nite runs or runs terminating with symmetric labellings.

5 The universal enumeration protocol In this section a protocol E for enumeration non-ambiguous graphs is de ned, solving then completely enumeration problem (for the notion of locality as de ned above). In addition, we shall prove fairness of the protocol in this sense, that each possible enumeration of a non-ambiguous graph can be obtained by a run of the protocol. De ne labels of the protocol as triples hn; L; M i, where n is a non-negative integer, L is a nite set of positive integers, and M is a nite set of pairs (k; W ) with positive integer k and a nite set of positive integers W . If hn; L; M i is a label assigned to a node, n is called the name of the node, L the neighbour register of the node, and M the mailbox of the node. Elements of maiboxes are called messages; if (k; W ) is a message, k is its sender, W is its body. For a given labelling, function which assigns to each node its name is called the naming function (of that labelling). A name n is said to be known to a node (at a given labelling), if the mailbox of this node contains a message with n as the sender name. The set of all names known to a node is the knowledge of this node. We say that a node (at a labelling) is stronger than another (at another labelling), if its neighbour register is stronger (recall de nition in Section3) than the neighbour register of the other. For a given labelling, the ball information is the set of messages: (name, neighbour register) with names of nodes in the ball as the senders, and with their neighbour registers as the bodies. Call the designed protocol E ; informal description of E follows. Initially, all labels of nodes of a processed graph are equal to h0; ;; ;i. Protocol contains transformation rules of two types, called transmitting and renaming. For description purposes, local transformations will be de ned by referring to 9

the center v of a ball and to its neighbours in N (v), giving rst the applicability condition (de ning the rst element of the pair consisting a rule), and next the result of its application (giving the second element of the pair). Let then v be an arbitrary node; below these two types of transformations are described. 1. Transmitting. If the mailboxes of nodes in B (v) have not the same contents, then unify all their contents and this uni ed contents assign back to mailboxes of all nodes in B (v). After transmitting, all nodes in B (v) have the equal mailbox contents, containing the previous ones as subsets. 2. Renaming. If mailboxes of nodes in B (v) have all the same contents, and either the name of v is 0, or the mailbox of v contains a message from a sender with the same name as v but stronger than v, then replace the name of v with k + 1, where k is the greatest name known to v; in neighbour registers of all nodes in N (v) replace the old name of v with its new name (i.e. with k + 1), and nally, add the new ball information to all mailboxes of nodes in B (v). Formal description of protocol E is the following: 1 [ E  (S k  S k ); k=1

where S = N0  2N  2(N0 2N ) , is such that for each k  1 h(s00 ; s01 ; : : :; s0k ); (s000 ; s001 ; : : :; s00k )i 2 E if and only if for each i = 1; 2; : : :; k there are n0i ; L0i ; Mi0; n00i ; L00i ; Mi00 with s0i = hn0i ; L0i ; Mi0i; s00i = hn00i ; L00i ; Mi00i; and either _ 0 M0 6= Mi0 and

^

or and

ik

1

^ ik

(n00i = n0i ^ L00i = L0i ^ Mi00 =

ik

0

[ j k

Mj0 );

0

M00 = Mi0 ^ (n00 = 0 _ n00 > 0 ^ 9L : (n00 ; L) 2 M00 ^ L00  L)

1

n000 = 1 + maxfn j 9L : (n; L) 2 M00 g ^

^ 00 0 ni = ni ^

ik

1

10

^ 00 L000 = L00 ^ Li = (L0i ? fn00g) [ fn000 g ^ ^ 00 1i0k Mi = Mi [ f(n00j ; L00j ) j 0  j  kg: ik

0

In this description, according to the de nition of transformation rules, n; M; L refer to the names, neighbourhood registers, and mailboxes of nodes: before transformation, if marked with a single primes, and after transformation, if marked with double primes. Subscript 0 refers to labellings of the central node of the processed ball, subscripts 1; 2; : : :; k to its k neighbours. Let G = (V; E ) be a graph of size N and let (0; 1; : : :; i; : : :) (4) be a run of protocol E , with 0 (v) = h0; ;; ;i for each v 2 V . Let i ; Li; Mi denote functions de ned for each v 2 V and i  0 by equality i (v) = hi(v); Li (v); Mi (v)i. Set Si (v) = fk j 9L : (k; L) 2 Mi (v)g (Si (v) is the set of names "known" to v at labelling i , hence it is the "knowledge\ of v at labelling i). In order to prove that E is an enumerating protocol, we prove rst some auxiliary lemmas concerning invariants of run (4) and next some termination properties.

Lemma 5 (Growing properties) The following propositions hold for any v 2 V and any i  0: (i) i (v)  i ; Li (v)  Li (v), and Mi (v)  Mi (v). (ii) If i(v) = n > 0, then there is v0 2 V such that i (v0 ) = n and Li (v)  +1

+1

+1

+1

Li+1 (v0 ) (created names exist forever, with non-decreasing strength).

Proof. (i) If i (v ) 6= i+1 (v ), then i+1 (v ) = max(Si (v )) + 1, and since i (v ) 2 Si (v), i+1(v) > i (v). If Li (v) 6= Li+1 (v), then by renaming rule Li+1 (v) = (Li (v) ? fk0 g) [ fk00g for some integers k0 ; k00 such that 0  k0 < k00. Thus, according to the de nition of strenght ordering, Li (v)  Li+1 (v). The inclusion Mi (v)  Mi+1 (v) is obvious. (ii) We prove property (ii) by induction w.r. to i. If i = 0, the proposition is vacuously true. Assume, as induction hypothesis, that it holds for all k; 0  k < i, and prove it for k = i. Let i(v) = n > 0. If i(v) = i+1 (v), the property is proved. If i(v) 6= i+1 (v), then there exists k  i and vk with k (vk ) = n and Li (v)  Lk (vk ). If k = i, then since vk 6= vi we have i (vk ) = i+1(vk ), Li (v)  Li+1 (vk ), and the proposition is proved. If k < i, then by repetitive inductive arguments we infer that there exists v0 such that i (v0 ) = n and Li (v)  Li (v0 ), hence v 6= v0 , and, as in the previous case, i+1(v0 ) = n with 2 Li (v)  Li+1 (v0 ). It ends the proof.

11

Lemma 6 (Invariant properties) The following propositions hold for any v 2 V and any i  0: (i) Li (v) = i(N (v)) ? f0g. (ii) If v0 2 B (v) and i(v0 ) = n > 0, then n 2 Si (v) (every node knows its own name and the names of its neighbours). (iii) If v0 ; v00 2 B (v) and i(v0 ) = i(v00 ) > 0, then v0 = v00 (local uniqueness of created names). (iv) i is connected, and i(v)  jV j. If i = 0, all propositions of Lemma trivially hold. Assume they hold for i  0; we shall prove them for i + 1. (i) Assume Li (v) = i(N (v)) ? f0g. If none of nodes in N (v) has been changed its name at i, then Li+1 (v) = Li (v) = i (N (v)) ? f0g = i+1(N (v)) ? f0g. Let v0 2 N (v) be such that i(v0 ) 6= i+1 (v0 ). Then, by renaming rule, Li+1 (v) = (Li (v) ? fi(v0 )g) [ fi+1(v0 )g; but then i+1(N (v)) = (i(N (v)) ? fi(v0 )g) [ fi+1(v0 )g, hence again Li+1 (v) = i+1(N (v)) ? f0g. (ii) Let v0 2 B (v) and i+1 (v0 ) = n > 0. If n = i(v0 ), then clearly n 2 Si+1 (v). If n 6= i(v0 ), then by renaming rule (n; Li+1 (v0 )) 2 Mi+1 (v); anyhow, n 2 Si+1 (v). (iii) Let v0 ; v00 2 B (v); i (n0) > 0; i(v00 ) => 0; v0 6= v00 . We have to prove that i+1(v0 ) 6= i+1(v00 ). If i(v0 ) = i+1(v0 ) and i(v00 ) = i+1(v00 ), the proof is over (none of the two nodes have been renamed at i). If one of them, say v0 , has been renamed, then its new name is greater than any name in Si (v0 ). Since v00 2 B (v), by (ii) i (v00 ) 2 Si (v). By renaming condition, Si (v) = Si (v0 ), hence i+1(v0 ) > i+1(v00 ). It proves (iii). (iv) Assume i to be connected and consider i+1. If i+1 = i , then i+1 is connected. If i+1 6= i, then there exists v 2 V with i(v) < i+1(v). By renaming rule, either i (v) = 0 or i+1 = j (vj ) + 1 for some node vj and j  i. If i+1 (v) = 1, then i+1 is connected. If i+1(v) > 1, then by proposition (ii) of Lemma 5 there is v0 such that 0 < i+1 (v0 ) = j (vj ); hence, i+1(v) = i+1(v0 ) + 1. Since i is connected, its values are bounded by jV j. It ends the proof. 2

Proof.

Theorem 3 (Termination property) Let G = (V; E) be an arbitrary graph and let 0 (v) = h0; ;; ;i for all v 2 V ; then protocol E terminates for G labelled with 0. Proof. Let G = (V; E ) be a graph, jV j = N , and let 0 be a labelling of G such that 0(v) = h0; ;; ;i for all v 2 V . Let  be the ordering of the set of all labels

12

of E de ned by the equivalence: hn0; L0 ; M 0i  hn00; L00; M 00i i n0  n00; L0  L00; and M 0  M 00. Extend this order from labels to labellings of G in the pointwise way: 0  00 i 0 (v)  00(v) for all v 2 V . Let (4) be run of E . Then, by growing properties, i  i+1 for all i  0. Moreover, it is also easy to see that i 6= i+1 for all i  0, since there is a node in V such that i (v) < i+1(v) or Mi (v) 6= Mi+1 (v). From these it follows that all runs of E are strictly increasing sequences of labellings:

0 < 1 <    < i < : : :: By invariant property 4 of Lemma 6 i (v)  jV j for each v 2 V ; the strenght of any nite subset of positive integers not greater than N is bounded by N +1, and any mailboxe is contained in the set f(k; W ) j 0  k  N; W  f1; 2; : : :; N gg. It means that the sequence (4) terminates, that is, E is terminating. 2

Lemma 7 (Final properties) Let f be the nal labelling. Then the following properties hold for all v; v0 ; v00 2 V : (i) (ii) (iii) (iv) (v)

Mf (v0 ) = Mf (v00 ); f (v) > 0; Lf (v) = f (N (v)); f (v0 ) = f (v00 ) implies f (N (v0 )) = f (N (v00 )); f is locally bijective.

Proof. Let f be the nal labelling of run (4) of E . Then (i) holds, since otherwise a transmitting step would be possible; (ii) holds, since otherwise renaming step would be possible; (iii) is a direct consequence of property (i) of Lemma 6, since 0 62 f (v) for all v 2 V . To prove (iv), assume f (v0 ) = f (v00 ); if f (N (v0 )) 6= f (N (v00 )), it would be either f (N (v0 ))  f (N (v00 )), or f (N (v00 )) 6= f (N (v0 )); in any case, the step renaming one of v0 ; v00 (that with the weaker neighbourhood register) would be possible. (v) follows from property (iii) of Lemma 6 and (iv) of the present lemma. It ends the proof. 2

Theorem 4 E is an enumeration protocol for the class of all non-ambiguous

graphs.

Proof. Let G = (V; E ) be a graph and f the nal labelling of a run of E for G. By proposition (iv) of Lemma 6 f is connected, by proposition (v) of Lemma 7 f is locally bijective. Hence, f is either enumeration (if it is a maximum connected function on V ), or otherwise it is a labelling indicating the ambiguity

13

of G and, in consequence, the inherent impossibility of the enumerating protocol construction for G. It ends the proof. 2

Fairness property. We say that protocol P over set S of labels is fair for graph G of size N , if there exists function  de ned on S such that for each bijection

: V ?! f1; 2; : : :; N g there is a run of P for G with nal labelling f such that

 (f (v)) = (v) for each v 2 V . In other words, there is a translation of labels into integers such for any a priori given enumeration of nodes of a graph there is a run of P for this graph such that the translated nal labelling is exactly the given enumeration (no enumeration is discriminated by P ).

Theorem 5 Protocol E is fair for any graph (ambiguous or not). Let S0 be the set of labels of protocol E . De ne  : S0 ?! N0 by the equality:  (hn; L; M i) = n. Let G = (V; E ) be a graph of size N and : V ?! f1; 2; : : :; N g be a bijection. Denote by vi the node of G with (vi ) = i, for all i; 1  i  N . Construct the run of E as follows. Let, for each i with 1  i  N , (i) (v) = h (i)(v); L(i) (v); M (i) (v)i be labels de ned for each v 2 V as follows. De ne (0) as 0 ; if (i) has been already de ned, (i+1) arises from (i) by renaming node vi+1 and next by applying successively transmission steps until M (i+1)(v) = M (i+1) (vi+1 ) for all v 2 V . From the de nition of E it follows that in the run de ned as above  if 1  k  i;  (i)(vk ) = k; 0; otherwise, for all i; 1  i  N . It is also clear that (N ) is the nal labelling of this run and that  (N ) (vk ) = k, which ends the proof of fairness of E . 2

Proof.

Ultimate properties. In the previous paragraph it has been shown the termination property of protocol E . The question arises whether some global properties of a labelling occurring in a run can be recognized by local means or not, i.e. whether a label of a node at the labelling contains or not a sucient information for proving such properties. One such property of labelling  of protocol E is that a node has an ultimate name at . Let 0 !E  and let v 2 V; (v) = hn; L; M i; we say that n is the ultimate name of v at labelling , if for any 0 with  !E 0 such that 0 (v) = hn0; L0 ; M 0i the equality n = n0 holds. It is very easy to decide whether, limiting applications of E to graphs of size N (with an arbitrary but xed N  1), an instantaneous name of a node is ultimate or not: 14

Theorem 6 For any run of E for a graph with size N , the name of a node at  is ultimate, if this node knows name N .

Proof. If the name of a node knowing N were not ultimate at a labelling, sooner or later it would be renamed and its new name at a subsequent labelling would be greater that N which, by connectivity of labellings, is impossible for a graph with size N . 2

Thus, after having received a message from a node named with N , the node \knows" about the positive termination of the run (with naming function being an enumeration of nodes of the processed graph) and that in any prolongation of the run its name will not be changed anymore. However, in case of unsuccessful runs for ambiguous graphs, even of known size, nodes do not know the fact of termination of the run. For more information on the subject see [11].

6 Conclusions In the paper a protocol for enumerating nodes of nite,connected, non-directed graphs without self-loops is described. The proposed algorithm does not use the nodes names; graph nodes are anonymous. It is proved that the protocol is universal in the sense that either it terminates successfully, or it supplies a proof of impossibility of existence of such a protocol. The result is based on the notion of locality of transformations; for the discussed protocol local transformations of graph labellings are transformations de ned on centered balls, i.e. nodes together with all their neighbours, treated in a uniform way. However, it is not the only way of de ning locality in graphs. There are, however, other notions of \local pieces" of graphs, e.g. one can take into consideration maximal (full) subgraphs graphs with diameter not greater than k, or centered balls with radius k, k  1, or even pairs of nodes connected by an arc only. With notions of the locality resulting from the above subgraphs, the de nition of ambiguity can be di erent than that presented here and the construction of enumerating protocols is an open question.

Acknowledgements. The author is deeply grateful to Yves Metivier and Wieslaw Zielonka from LaBRI, University of Bordeaux I, for their helpful discussion with the author, as well as comments and criticism of an earlier version of the paper. Without their stimulating comments the paper would never appear in the present form. 15

References [1] D. Angluin, Global and local properties in networks of processors, Proc. 12th Symposium on the Theory of Computing (1980) 82-93 [2] B. Courcelle and Y. Metivier, Coverings and minors: application to local computations on graphs, Europ. J. of Combinatorics 15 (1994) 127-138. [3] E.W. Dijkstra, Solution of a problem in concurrent programming control, Comm. ACM 8 (1965) 569. [4] H. Garcia-Molina, Election in a distributed computing system, IEEE Trans. Comp. 31 (1982) 48-59 [5] R.E, Johnson and F.B. Schneider, Symmetry and similarity in distributed systems, Proc. 4th Conference on Principles of Distributed Computing, (1985) 13-22 [6] G. Le Lann, Distributed systems { towards a formal approach, in: B. Gilchrist, ed., Information Processing 77 (IFIP) (North-Holland, Amsterdam, 1977) 155-160 [7] I. Litovsky and Y. Metivier, Graph rewritting systems as a tool to design and to prove graph and network algorithms, Internal Rept. 9070, LaBRI, Universite de Bordeaux I (1990) [8] I. Litovsky, Y. Metivier and W. Zielonka, The power and limitations of local computations an graphs and networks, Lecture Notes in Comp. Sci. 657 (1993) 333-345. [9] A. Mazurkiewicz, Solvability of the asynchronous ranking problem, Inform. Process. Lett. 28 (1988) 221-224. [10] A. Mazurkiewicz, Distributed Enumeration, Inform. Process. Lett. (in print). [11] Y. Metivier, A. Muscholl and P.-A. Wacrenier, About the local detection of termination of local computations in graphs, Working paper of French-German project PROCOPE, (1997). [12] M. Raynal, Distributed Algorithms and Protocols (J. Wiley & Sons, New York) (1988)

16