Distributed Maximal Matching: Greedy is Optimal
DDistributed Maximal Matching:Greedy is Optimal
Juho Hirvonen and Jukka SuomelaHelsinki Institute for Information Technology HIITUniversity of Helsinki
Abstract.
We study distributed algorithms that find a maximal matching in ananonymous, edge-coloured graph. If the edges are properly coloured with k colours,there is a trivial greedy algorithm that finds a maximal matching in k − k -edge-coloured graphs requires k − O (∆ + log ∗ k ) rounds, and prior work implies a lower bound of Ω(polylog(∆) +log ∗ k ) rounds. Our work closes the gap between upper and lower bounds: the complexityis Θ(∆ + log ∗ k ) rounds. To our knowledge, this is the first linear-in-∆ lower bound forthe distributed complexity of a classical graph problem. Corresponding author:
Jukka SuomelaHelsinki Institute for Information Technology HIITP.O. Box 68, FI-00014 University of Helsinki, [email protected].fi a r X i v : . [ c s . D C ] O c t Introduction
In the study of deterministic distributed graph algorithms, there are two parameters that arecommonly used to describe the computational complexity of a graph problem: n , the number ofnodes in the graph, and ∆, the maximum degree of the graph. For a wide range of problems, thecomplexity is well-understood as a function of n , but understanding the complexity as a functionof ∆ is one of the major open problems in the area. For example, the maximal matching problemcan be solved in O (∆ + log ∗ n ) rounds [13], while the best lower bound is Ω(polylog(∆) + log ∗ n )[8–10, 12].The present works gives the first tight lower bound that is linear in ∆ for a classical graphproblem. In particular, we study the problem of finding a maximal matching in anonymous, edge-coloured graphs . If the edges are k -coloured, the problem can be solved in O (∆ + log ∗ k ) roundswith an adaptation of a simple deterministic algorithm [13]. It is well-known that the complexity isΩ(log ∗ k ) rounds [12]; we close the case by proving a lower bound of Ω(∆) rounds. For many graph problems, the state-of-the-art algorithms are extremely fast even if the networkis very large—provided that ∆ is small. For example, the following problems can be solved in O (∆ + log ∗ n ) synchronous communication rounds (assuming O (log n )-bit node identifiers): • maximal matching [13], • vertex colouring with ∆ + 1 colours [3, 7], • edge colouring with 2∆ − O (∆) rounds, independently of n (even in anonymousnetworks without unique identifiers): • maximal matching in 2-coloured graphs [5], • maximal edge packing [2], • n in the running time is well-understood. Inparticular, Linial’s [12] lower bound shows that maximal matching, vertex colouring, and edgecolouring require Ω(log ∗ n ) rounds, even if ∆ = 2.However, we do not yet understand the dependence on ∆. For example, the best known lowerbound for the maximal matching problem is logarithmic in ∆ [8–10], while the above upper boundsare linear in ∆.Some polylog(∆) upper bounds are known for graph problems. For example, good approximationsof fractional matchings can be found in polylog(∆) rounds [9]; however, this does not seem to yielda deterministic polylog(∆)-time algorithm for any of the above problems. Ha´n´ckowiak et al.’s [6]algorithm finds a maximal matching in polylog( n ) rounds, avoiding the linear dependence on ∆;however, it comes at the cost of a non-optimal dependence on n .It is easy to come up with an artificial problem with the complexity of Θ(∆), but so far no suchtight results are known for classical graph problems such as maximal matchings. The lower-boundresult by Kuhn and Wattenhofer [11] comes close, but it only applies to a restricted family ofalgorithms. 1 .2 Greedy Maximal Matching We will focus on the task of finding a maximal matching in an edge-coloured graph, using adeterministic distributed algorithm in a network of anonymous nodes (see Section 2 for formallyprecise definitions and e.g. the survey [14] for more background information).If the graph is edge-coloured with k colours, there is a very simple greedy algorithm that solvesthe problem in k steps: We start with an empty matching M ← ∅ . Then, in step i we consider alledges of colour i in parallel. If an edge { u, v } is of colour i , and neither u nor v is matched, we add { u, v } to M . The following figure illustrates the greedy algorithm for k = 4; the thick edges indicatematching M .
23 11 24 3342 43 24 11 2 22 2 3 333 4 444
To analyse the exact running time of the greedy algorithm, we need to fix the model ofcomputation. As usual, each node is a computational entity and there is an edge if the nodes canexchange messages with each other—the same graph is both the problem instance and the networktopology. Throughout this work, the running time is defined to be the number of synchronouscommunication rounds. Initially, each node knows the colours of its incident edges. In every round,each node in parallel (1) sends a message to each of its neighbours, (2) receives a message from eachof its neighbours, and (3) updates its own state. After each round, a node can stop and announceits local output : whether it is matched and with which neighbour.With these definitions, it is straightforward to verify that the running time of the greedyalgorithm is at most k − Lemma 1.
Let k be a positive integer. There exists a deterministic distributed algorithm withrunning time k − that finds a maximal matching in any anonymous, k -edge-coloured graph. We can also easily verify that the analysis is tight, i.e., the worst-case running time of the greedyalgorithm is exactly k − k = 4. Inthe greedy algorithm u is unmatched while v is matched. However, radius-2 neighbourhoods of u and v are indistinguishable; in order to produce a different output, we must propagate informationover distance k − x to u and from y to v . Hence any faithful implementation of thegreedy algorithm requires at least k − ux vy Naturally, if our goal is to find a maximal matching, there is a wide range of possible algorithms,and in many special cases we already know how to beat the greedy algorithm. However, we showthat in the general case, the greedy algorithm is optimal . The main contribution is summarised inthe following theorem. 2 heorem 2.
Let k be a positive integer. A deterministic distributed algorithm that finds a maximalmatching in any anonymous, k -edge-coloured graphs requires at least k − communication rounds. We prove Theorem 2 in Section 3. The lower bound holds even if we allow arbitrarily largemessages and unbounded local computations, while the matching upper bound is achieved by asimple algorithm that uses only small messages, little memory, and trivial state transitions.
Let us now return to the case of bounded-degree graph. If k (cid:29) ∆, we can use Cole–Vishkin [4] stylecolour reduction techniques to considerably speed up the algorithm. For example, a straightforwardadaptation of Panconesi and Rizzi’s [13] algorithm finds a maximal matching in O (∆ + log ∗ k )rounds.Linial’s [12] result gives us the lower bound of Ω(log ∗ k ); however, so far it has not been knownwhether Ω(∆) rounds is required. Our result now settles this question. The maximum degree of a k -edge-coloured graph is at most k , and we have the following corollary. Corollary 3.
A deterministic distributed algorithm that finds a maximal matching in an anonymousedge-coloured graph of maximum degree ∆ requires Ω(∆) communication rounds.
Incidentally, our lower-bound construction is a d -regular graph with d = k −
1, and hence thiswork shows that we need d rounds even in the seemingly simple case of d -regular graphs (assuming d ≥ d -regular graphs with d = k , the problem becomes trivial: the edgesof colour 1 form a perfect matching and we can solve the problem in constant time. The case of d = k − Our lower-bound result covers the case of anonymous networks, including the widely-studied port-numbering model [1, 15] and its weaker variants [16] such as the broadcast model [2]. What remainsopen is the case of networks in which nodes have unique identifiers. Nevertheless, our result showsthat in order to break the Ω(∆) barrier, an algorithm has to make an essential use of the uniquenode identifiers.
In our lower-bound construction, we will need to manipulate edge-coloured trees, and certaingroup-theoretic concepts turn out to be useful. G k Throughout this text, k is a positive integer. We use the shorthand notations X + xX − x [ i ] G k e X + x = X ∪ { x } and X − x = X \ { x } for a set X , and [ i ] = { , , . . . , i } for an integer i .We define the group G k = (cid:104) , , . . . , k | , , . . . , k (cid:105) . That is, the generators of group G k are1 , , . . . , k , and we have the relations c = cc = e for each c ∈ [ k ]; we use e to denote the identityelement, and we use the multiplicative notation xy or x · y for the group operation. Group G k is3 Γ Γ ( V ) Γ ( U ) e e e e Figure 1: In this example, V = { e, , , · , , · , · } ⊆ G is a 3-colour system and U = ¯3 V .For example, V [1] = U [1] and V = V [2] (cid:54) = U [2] (cid:54) = U .the free product of k cyclic groups of order two, a.k.a. the group generated by k involutions, theuniversal Coxeter group, or the free Coxeter group.Let Γ k Γ k be the Cayley graph of G k with respect to the generators [ k ]; see Figure 1 for anillustration. In Γ k , we have a node for each element x ∈ G k , and there is an edge of colour c ∈ [ k ]from x ∈ G k to y ∈ G k if y = xc . As each generator is its own inverse, there is an edge of colour c from x to y iff there is an edge of colour c from y to x ; hence we can interpret Γ k as an undirectedgraph. It can be verified that Γ k is a k -regular k -edge-coloured tree; Γ k is countably infinite if k ≥ x ∈ G k is a product x = c c · · · c (cid:96) such that c i ∈ [ k ] and c i − (cid:54) = c i . The reduced form is unique; it corresponds to the sequence of edge colours along theunique path from e to x in Γ k . We use the length of the path to define the norm | x | ¯ x tailheadpred | x | = (cid:96) .We use the shorthand notation ¯ x = x − for the inverse of x ∈ G k . If x ∈ G k − e , there is aunique c ∈ [ k ] such that | xc | = | x | −
1; we say that c is the tail of x , in notation tail( x ) = c . Wealso define head( x ) = tail(¯ x ) and pred( x ) = x tail( x ) for each x ∈ G k − e .We make the following observations: If x, y ∈ G k , then | ¯ xy | is the length of the unique pathfrom x to y in Γ k ; in particular, d ( x, y ) = | ¯ xy | defines a metric on G k . If | ¯ xy | = 1, nodes x and y are connected with an edge of colour ¯ xy . We have | ¯ x | = | x | for all x ∈ G k and | xy | ≡ | x | + | y | mod 2 for all x, y ∈ G k . The equality | xy | = | x | + | y | holds iff x = e , y = e , or tail( x ) (cid:54) = head( y ).If V ⊆ G k and x ∈ G k , we define xVxf xV = { xv : v ∈ V } . If V ⊆ G k , f : V → X , and x ∈ G k ,we also define the function xf : xV → X as follows: ( xf )( y ) = f (¯ xy ) for each y ∈ xV . That is,( xf )( xv ) = f ( v ) for each v ∈ V . A non-empty set V ⊆ G k is a k -colour system if v ∈ V − e implies pred( v ) ∈ V . That is, a coloursystem is a prefix-closed subset; put otherwise, we can start from any v ∈ V and walk towards e inΓ k without leaving V . We define the set of edges E ( V )Γ k ( V ) E ( V ) = {{ pred( v ) , v } : v ∈ V − e } . Let Γ k ( V ) bethe graph with the node set V and the edge set E ( V ). Now Γ k ( V ) is a connected subgraph of thetree Γ k ; see Figure 1 for an example. Observe that if T is any k -edge-coloured tree, then we canconstruct a k -colour system V ⊆ G k such that T and Γ k ( V ) are isomorphic.The following lemma is straightforward to verify.4 emma 4. If V is a k -colour system and u ∈ V , then ¯ uV is a k -colour system. Moreover, x (cid:55)→ ¯ ux is an isomorphism from Γ k ( V ) to Γ k (¯ uV ) that preserves adjacencies and edge colours. For a colour system V and integer h , we define V [ h ] f [ h ] V [ h ] = { v ∈ V : | v | ≤ h } . Similarly, if f : V → X ,we define that f [ h ] : V [ h ] → X is the restriction of f to V [ h ]. Note that V [ h ] is a colour system.The set u ((¯ uV )[ h ]) ⊆ V consists of all nodes that are within distance h from u ∈ V in Γ k ( V ).Let C ( V, v )deg C ( V, v ) = { ¯ uv : { u, v } ∈ E ( V ) } denote the set of colours incident to v ∈ V in Γ k ( V ). Notethat C ( V, v ) = { c ∈ [ k ] : vc ∈ V } = (¯ vV )[1] − e . The degree of v is deg( V, v ) = | C ( V, v ) | , and coloursystem V is said to be d -regular if deg( V, v ) = d for all v ∈ V .If V is a colour system and c ∈ C ( V, e ), we define prune prune(
V, c ) = { v ∈ V − e : head( v ) (cid:54) = c } + e .Observe that U = prune( V, c ) is a colour system. Moreover, if V is d -regular, then deg( U, u ) = d forall u ∈ U − e and deg( U, e ) = d − For the purposes of our lower-bound result, it is sufficient to define formally what a distributedalgorithm A outputs if we apply it in Γ k ( V ), where V is a colour system.We already gave an informal definition of a distributed algorithm in Section 1.2. In particular,we assumed that the nodes are anonymous (they do not have unique identifiers), and initially eachnode knows the colours of the incident edges. Put otherwise, initially a node v ∈ V knows precisely(¯ vV )[1]. Now if we let the nodes exchange all information that they have, after the first roundeach node v ∈ V can reconstruct (¯ vV )[2], and recursively, after r rounds each node knows precisely(¯ vV )[ r + 1]. We will use this as our definition of a distributed algorithm.Assume that A is a function that associates a local output A ( V, v ) with any colour system V and node v ∈ V . Then we say that A is a distributed algorithm with running time r if (¯ uU )[ r + 1] =(¯ vV )[ r + 1] implies A ( U, u ) = A ( V, v ). ⊥⊥ ⊥ We say that a distributed algorithm A finds a maximal matching in colour system V if(M1) we have A ( V, v ) ∈ C ( V, v ) + ⊥ for each v ∈ V ,(M2) if A ( V, v ) = c (cid:54) = ⊥ then vc ∈ V and A ( V, vc ) = c ,(M3) if A ( V, v ) = ⊥ and c ∈ C ( V, v ) then A ( V, vc ) (cid:54) = ⊥ .The interpretation is that A ( V, v ) = ⊥ if v is unmatched and A ( V, v ) = c ∈ C ( v ) if v is matchedalong the edge of colour c . Property (M2) ensures that the output is consistent, and property (M3)ensures that the matching is maximal. Let us first cover the case of k ≤ Lemma 5.
Let k ≤ be a positive integer. A deterministic distributed algorithm that finds amaximal matching in any anonymous, k -edge-coloured graphs requires at least k − communicationrounds.Proof. The case of k = 1 is trivial. Let us then focus on the case of k = 2. Define the 2-coloursystems T = { e, } , U = { e, } , and V = { e, , } . Now A ( T,
1) = 1 and A ( U,
2) = 2 for any5istributed algorithm A . However, we must have either A ( V, (cid:54) = 1 or A ( V, (cid:54) = 2, even though(¯1 T )[1] = (¯1 V )[1] and (¯2 U )[1] = (¯2 V )[1].The rest of this work contains the proof of the following theorem that covers the case of k ≥ Theorem 6.
Let kdA k ≥ be an integer, and let d = k − . Assume that A is a distributed algorithmthat finds a maximal matching in any d -regular k -colour system. Then there are two d -regular k -colour systems U and V such that U [ d ] = V [ d ] , A ( U, e ) (cid:54) = ⊥ , and A ( V, e ) = ⊥ . In particular, the running time of A is at least d = k −
1. Theorem 2 follows.
For the rest of this work, choose k , d , and A as in the statement of Theorem 6, and let r be therunning time of A . All colour systems are k -colour systems.Sections 3.2–3.7 introduce a number of concepts that we will use to present our lower-boundconstruction. After that, we prove Theorem 6 by induction; the base case is in Section 3.8, and theinductive step in Section 3.9. An h -template is a pair ( T, τ ) where T ⊆ G k is an h -regular colour system and τ : T → [ k ]associates a forbidden colour τ ( t ) ∈ [ k ] \ C ( T, t ) with each t ∈ T . The set of free colours is F ( T, τ, t ) F ( T, τ, t ) = [ k ] \ ( C ( T, t ) + τ ( t )) for each t ∈ T . {2, P : τ : F : C :
22 1 2 4 3
Let b be an integer with 0 ≤ b ≤ d − h . A b -colourpicker for ( T, τ ) is a function P that associates asubset P ( t ) ⊆ F ( T, τ, t ) of size b with each node t ∈ T . That is, a b -colour picker chooses b freecolours for each node. The figure on the right givesan example with h = 2, b = 1, d = 4, and k = 5; a2-template is an infinite path and a 1-colour pickerchooses exactly one free colour for each node.Let P and Q be colour pickers for ( T, τ ). We say that P and Q are disjoint if P ( t ) ∩ Q ( t ) = ∅ for all t ∈ T . If P and Q are disjoint colour pickers for ( T, τ ), we can construct a colour picker R bysetting R ( t ) = P ( t ) ∪ Q ( t ) for each t ∈ T . Let (
T, τ ) be an h -template and let P be a b -colour picker for ( T, τ ). We will define a relation (cid:32) between G k and T recursively as follows; see Figure 2 for an illustration.(i) We have e (cid:32) e , c (cid:32) c for each c ∈ C ( T, e ), and c (cid:32) e for each c ∈ P ( e ).(ii) Assume that x (cid:32) t and x (cid:54) = e .We have xc (cid:32) tc for each c ∈ C ( T, t ) − tail( x ), and xc (cid:32) t for each c ∈ P ( t ) − tail( x ).We make the following observations.(a) If x (cid:32) t and x (cid:32) t , we have t = t .(b) If x (cid:32) t and x (cid:54) = e , we have tail( x ) ∈ C ( T, t ) ∪ P ( t ).(c) If x (cid:32) t , x (cid:54) = e , and tail( x ) ∈ C ( T, t ), we have pred( x ) (cid:32) t tail( x ).6 {5}{3}{5}{4}{4} P :
22 1 2 4 3442 1 5 21 2 4 33 52442 1 2 44 5 pT : X : ee Figure 2: Here T is a 2-template and P is a 1-colour picker. The arrows illustrate the relation (cid:32) between X and T , and hence also function p . In this case, X is a 3-regular colour system.(d) If x (cid:32) t , x (cid:54) = e , and tail( x ) ∈ P ( t ), we have pred( x ) (cid:32) t .(e) If x (cid:32) t and c ∈ C ( T, t ), we have xc (cid:32) tc .(f) If x (cid:32) t and c ∈ P ( t ), we have xc (cid:32) t .(g) If x (cid:32) t and c ∈ [ k ] \ ( C ( T, t ) ∪ P ( t )), there is no t (cid:48) ∈ T with xc (cid:32) t (cid:48) .(h) If x (cid:32) t then | x | ≥ | t | .(i) For each t ∈ T there exists an x such that x (cid:32) t .Let X = { x ∈ G k : x (cid:32) t for some t ∈ T } . Define the function p : X → T as follows: for each x ∈ X , let p ( x ) be the unique element with x (cid:32) p ( x ). Let ξ = τ ◦ p . We say that ( X, ξ, p ) is the P -extension of ( T, τ ), in notation, ext ext(
T, τ, P ) = (
X, ξ, p ). Remark . We can interpret extensions as universal covering graphs [1] as follows. First, considerthe edge-coloured tree G = Γ k ( T ). Then modify G as follows: for each t ∈ T and c ∈ P ( t ), add aself-loop of colour c from t to itself. Now G is an edge-coloured multigraph; then we construct theuniversal covering graph T of G (i.e., we “unfold” all self-loops of G ). Graph T is an edge-colouredtree; it can be verified that T is isomorphic to Γ k ( X ). Let us first prove that an extension is a template.
Lemma 7.
Assume that ( T, τ ) is an h -template, P is a b -colour picker for ( T, τ ) , and ( X, ξ, p ) =ext(
T, τ, P ) . Then X is an ( h + b ) -regular colour system, and ( X, ξ ) is an ( h + b ) -template. Foreach x ∈ X we have C ( X, x ) = C ( T, p ( x )) ∪ P ( p ( x )) .Proof. Each x ∈ X − e has pred( x ) ∈ X ; hence X is a colour system. If x ∈ X and c ∈ [ k ], we have xc ∈ X iff c ∈ C ( T, p ( x )) ∪ P ( p ( x )); hence C ( X, x ) = C ( T, p ( x )) ∪ P ( p ( x )) and deg( x ) = h + b . Itfollows that X is ( h + b )-regular. By assumption, ξ ( x ) = τ ( p ( x )) / ∈ C ( T, p ( x )) ∪ P ( p ( x )) = C ( X, x );that is, ξ associates a valid forbidden colour with each x ∈ X , and we conclude that ( X, ξ ) is an( h + b )-template.Next, we observe that an extension has a high degree of symmetry.7 emma 8. Let ( X, ξ, p ) = ext(
T, τ, P ) , x, y ∈ X , and p ( x ) = p ( y ) . Then ¯ xX = ¯ yX , ¯ xξ = ¯ yξ , and ¯ xp = ¯ yp .Proof. Let w ∈ ¯ xX . Assume that w = c c · · · c (cid:96) , where c i ∈ [ k ], and define w i = c c · · · c i . Wehave w i ∈ ¯ xX and xw i ∈ x ¯ xX = X for all i ; let t i = p ( xw i ).With these definitions, xw i (cid:32) t i for all i = 0 , , . . . , (cid:96) . We will prove by induction that yw i (cid:32) t i for all i . The base case of i = 0 is trivial. Now assume that xw i (cid:32) t i and yw i (cid:32) t i . Aswe have xw i c i +1 (cid:32) t i +1 , there are two possibilities. If c i +1 ∈ C ( T, t i ), then t i +1 = t i c i +1 and yw i c i +1 (cid:32) t i c i +1 . Otherwise c i +1 ∈ P ( t i ), t i +1 = t i and yw i c i +1 (cid:32) t i . In both cases yw i +1 (cid:32) t i +1 .It follows that yw (cid:32) t (cid:96) , and hence yw ∈ X with p ( yw ) = t (cid:96) = p ( xw ). We have shown that w ∈ ¯ xX implies w = ¯ yyw ∈ ¯ yX and (¯ yp )( w ) = (¯ yp )(¯ yyw ) = p ( yw ) = p ( xw ) = (¯ xp )( w ). Bysymmetry, w ∈ ¯ yY implies w ∈ ¯ xX . Finally, ¯ xp = ¯ yp implies ¯ xξ = ¯ yξ .We also show that the order in which we extend does not affect the end result. If we have twodisjoint colour pickers P and Q , we can first apply P and then Q , or vice versa, and we obtainthe same result as if we used the colour picker t (cid:55)→ P ( t ) ∪ Q ( t ) directly; in this sense, extensionscommute. =ext( P ) ext( Q ○ p )ext( P ∪ Q ) p qp ○ qT , τ K , κ L , λ X , ξ Lemma 9.
Assume that ( T, τ ) is a template and P and Q are disjoint colour pickers for ( T, τ ) .Let R ( t ) = P ( t ) ∪ Q ( t ) for each t ∈ T . Let ( K, κ, p ) = ext(
T, τ, P ) , ( L, λ, q ) = ext(
K, κ, Q ◦ p ) , and ( X, ξ, r ) = ext(
T, τ, R ) . Now X = L , λ = ξ , and p ◦ q = r .Proof. Let x = c c · · · c (cid:96) , where c i ∈ [ k ], and define x i = c c · · · c i . We prove by induction that if x i ∈ X , we also have x i ∈ L with p ( q ( x i )) = r ( x i ), and if x i / ∈ X , we also have x i / ∈ L .The base case i = 0 is trivial: p ( q ( e )) = p ( e ) = e = r ( e ) and e ∈ X ∩ L . Now assume that x i ∈ X ∩ L and p ( q ( x i )) = r ( x i ). There are four cases depending on c i +1 :(a) Assume that c i +1 ∈ C ( T, r ( x i )) = C ( T, p ( q ( x i ))). Then c i +1 ∈ C ( K, q ( x i )), x i +1 ∈ X ∩ L , and p ( q ( x i +1 )) = p ( q ( x i c i +1 )) = p ( q ( x i ) c i +1 ) = p ( q ( x i )) c i +1 = r ( x i ) c i +1 = r ( x i c i +1 ) = r ( x i +1 ).(b) Assume that c i +1 ∈ P ( r ( x i )) = P ( p ( q ( x i ))) ⊆ R ( r ( x i )). Then c i +1 ∈ C ( K, q ( x i )), x i +1 ∈ X ∩ L , and p ( q ( x i +1 )) = p ( q ( x i c i +1 )) = p ( q ( x i ) c i +1 ) = p ( q ( x i )) = r ( x i ) = r ( x i c i +1 ) = r ( x i +1 ).(c) Assume that c i +1 ∈ Q ( r ( x i )) = Q ( p ( q ( x i ))) ⊆ R ( r ( x i )). Then c i +1 ∈ ( Q ◦ p )( q ( x i )), x i +1 ∈ X ∩ L , and p ( q ( x i +1 )) = p ( q ( x i )) = r ( x i ) = r ( x i c i +1 ) = r ( x i +1 ).(d) Otherwise x i +1 / ∈ X and x i +1 / ∈ L . As a consequence, x i + j / ∈ X and x i + j / ∈ L for all j > X = L , p ◦ q = r , and λ = τ ◦ p ◦ q = τ ◦ r = ξ . Let (
T, τ ) be an h -template. Define a ( d − h )-colour picker P by setting P ( t ) = F ( T, τ, t ) foreach t ∈ T . Let ( V, g, p ) = ext(
T, τ, P ). We say that (
V, p ) is the realisation of template (
T, τ ), innotation, real ( V, p ) = real(
T, τ ). 8ntuitively, V is a concrete problem instance—it is always a d -regular colour system, and hencewe can apply algorithm A to V . Templates can be seen as compact, schematic representations ofproblem instances.Lemma 8 has the following corollary. Corollary 10.
Let ( V, p ) = real(
T, τ ) . If u, v ∈ V and p ( u ) = p ( v ) , then ¯ uV = ¯ vV . In particular, A ( V, u ) = A ( V, v ) . Put otherwise, if (
T, τ ) is a template with the realisation (
V, p ), each node t ∈ T representsan equivalence class p − ( t ) ⊆ V of nodes with identical outputs. For each t ∈ T , we define A ( T, τ, t ) A ( T, τ, t ) = A ( V, v ) where v ∈ p − ( t ); by Corollary 10, this does not depend on the choice of v .We define M ( T, τ ) M ( T, τ ) = {{ u, v } ∈ E ( T ) : A ( T, τ, u ) = A ( T, τ, v ) = ¯ uv } . Note that M ( T, τ ) isalways a matching in the tree Γ k ( T ), but the matching is not necessarily maximal. If S ⊆ T , wealso define M ( · , · , · ) M ( T, S, τ ) = {{ u, v } ∈ M ( T, τ ) : u, v ∈ S } , the restriction of M ( T, τ ) to S .Lemma 9 has the following corollary; it shows that a template and its extensions have the samerealisations. Corollary 11.
Let ( K, κ, p ) = ext(
T, τ, P ) , ( X, r ) = real(
T, τ ) , and ( L, q ) = real(
K, κ ) . Then X = L , p ◦ q = r , and A ( K, κ, x ) = A ( T, τ, p ( x )) for all x ∈ K . The following lemma is yet another application of the symmetry that we have in extensions:if a template has free colours (i.e., h < d ), then an algorithm produces a perfect matching in therealisation of the template.
Lemma 12.
Assume that ( T, τ ) is an h -template with h < d . Then A ( T, τ, t ) (cid:54) = ⊥ for all t ∈ T .Proof. Let (
V, p ) = real(
T, τ ), t ∈ T , and v ∈ p − ( t ). If h < d , there exists a c ∈ F ( T, τ, t ).Let u = vc ; we have p ( u ) = p ( v ) = t , c ∈ C ( V, v ), and A ( V, u ) = A ( V, v ) = A ( T, τ, t ). Now A ( T, τ, t ) = ⊥ would contradict property (M3). Let Z ˆ c Z = { e } be the colour system with only one node. For each c ∈ [ k ], let ˆ c denote the functionˆ c : Z → [ k ] that maps ˆ c ( e ) = c . Now ( Z, ˆ c ) is a 0-template for each c ∈ [ k ].If A is the greedy algorithm, we have A ( Z, ˆ1 , e ) = 2 and A ( Z, ˆ3 , e ) (cid:54) = 2. The following lemmageneralises this observation. Lemma 13.
There are distinct colours c , c , c ∈ [ k ] such that A ( Z, ˆ c , e ) = c and A ( Z, ˆ c , e ) (cid:54) = c .Proof. For each c ∈ [ k ], let h ( c ) = A ( Z, ˆ c, e ). By Lemma 12, we have h ( c ) ∈ [ k ] for each c ∈ [ k ].Moreover, h ( c ) ∈ [ k ] − ˆ c ( e ) = [ k ] − c . Hence we have a function h : [ k ] → [ k ] that does not have anyfixed points.(a) Assume that h ( h (1)) (cid:54) = 1. Then we can choose c = h (1), c = h ( h (1)), and c = 1.(b) Assume that h ( h (1)) = 1. Let c ∈ [ k ] − { , h (1) } . If h ( c ) = h (1), we can choose c = h (1), c = 1, and c = c . If h ( c ) (cid:54) = h (1), we can choose c = 1, c = h (1), and c = c .9 .7 Compatible Templates and Critical Pairs Let h ≥
1. We say that templates (
S, σ ) and (
T, τ ) are h -compatible if(C1) S [ h ] = T [ h ],(C2) σ [ h −
1] = τ [ h − h -compatible templates are not necessarily h -templates.We say that ( S, σ ) and (
T, τ ) form an h -critical pair if they are h -compatible h -templates andthey satisfy the following additional properties:(C3) A ( T, τ, e ) / ∈ C ( T, e ),(C4) A ( S, σ, s ) ∈ C ( S, s ) for each s ∈ S .If h < d , Lemma 12 and property (C3) imply that A ( T, τ, e ) ∈ F ( T, τ, e ). Property (C4) impliesthat M ( S, σ ) is a perfect matching in Γ k ( S ), while property (C3) implies that M ( T, τ ) cannot be aperfect matching in Γ k ( T ). In this section we show that there exists a 1-critical pair. Choose c , c , c ∈ [ k ] as in Lemma 13and let c = A ( Z, ˆ c , e ). Note that c (cid:54) = c ; however, we may have c = c .Let K = L = X = { e, c } . Define κ ( e ) = κ ( c ) = ξ ( e ) = c and λ ( e ) = λ ( c ) = ξ ( c ) = c . Now( K, κ ), (
L, λ ), and (
X, ξ ) are 1-templates; the construction is illustrated below: c c κ : A ( K , κ ): c c A ( L , λ ): λ : c ? c ? ξ : A ( X , ξ ): c c c c K : L : X : e e ec c c If p ( e ) = p ( c ) = e and P ( e ) = c , we have ( K, κ, p ) = ext( Z, ˆ c , P ) and ( L, λ, p ) = ext( Z, ˆ c , P ).Therefore A ( K, κ, v ) = c for each v ∈ K and A ( L, λ, v ) = c for each v ∈ L .Now we construct 1-templates S , σ T , τ ( S , σ ) and ( T , τ ) as follows:(i) If A ( X, ξ, e ) (cid:54) = c , we choose ( S , σ ) = ( K, κ ) and ( T , τ ) = ( X, ξ ).(ii) If A ( X, ξ, e ) = c , we choose ( S , σ ) = (¯ c X, ¯ c ξ ) and ( T , τ ) = (¯ c L, ¯ c λ ). Lemma 14.
Templates ( S , σ ) and ( T , τ ) form a -critical pair.Proof. We have S [1] = T [1] = K = L = X = { e, c } , verifying property (C1). To verify (C2),note that case (i) implies σ ( e ) = τ ( e ) = c and case (ii) implies σ ( e ) = τ ( e ) = c . To verifyproperty (C3), observe that A ( T , τ , e ) (cid:54) = c while C ( T , e ) = { c } . To verify property (C4), observethat A ( S , σ , s ) = c and C ( S , s ) = { c } for all s ∈ S . Now assume that ( S h , σ h ) and ( T h , τ h ) form an h -critical pair, where 1 ≤ h < d . In this section, wewill construct an ( h + 1)-critical pair ( S h +1 , σ h +1 ) and ( T h +1 , τ h +1 ).Recall that Lemma 12 implies that A ( S h , σ h , s ) (cid:54) = ⊥ for all s ∈ S h and A ( T h , τ h , t ) (cid:54) = ⊥ for all t ∈ T h . We define two colour pickers as follows; see Figures 3 and 4 for illustrations.(i) Define a 1-colour picker Q for ( T h , τ h ) as follows. Let t ∈ T h . If A ( T h , τ h , t ) ∈ F ( T h , τ h , t ), wechoose Q ( t ) = { A ( T h , τ h , t ) } . Otherwise we choose an arbitrary free colour c ∈ F ( T h , τ h , t )and set Q ( t ) = { c } . 10
4} {1} Q : P : {3}{3} 31 τ h : A ( T h , τ h ):1 A ( S h , σ h ): σ h : 3113 τ h +1 : A ( T h +1 , τ h +1 ): 3??3 j σ h +1 : A ( S h +1 , σ h +1 ): 3113 ξ : A ( X , ξ ): 3??3 j κ : A ( K , κ ): 122121121212122121 K (even) K (distant) L (odd) L (distant) S h : T h : K : L : X : K L χ e eeee χχ S h +1 : T h +1 : ee λ : A ( L , λ ): 311331133131133113 Figure 3: Inductive step. In this example, h = 1 and χ = 3. We assume that j / ∈ { , } , and thuswe can choose y = χ in Lemma 15. 11ii) Define a 1-colour picker P for ( S h , σ h ) as follows. Let s ∈ S h . If | s | ≤ h −
1, we have s ∈ T h and F ( S h , σ h , s ) = F ( T h , τ h , s ); hence we can choose P ( s ) = Q ( s ). Otherwise we choose anarbitrary free colour c ∈ F ( S h , σ h , s ) and set P ( s ) = { c } .Let ( K, κ, p ) = ext( S h , σ h , P ), ( L, λ, q ) = ext( T h , τ h , Q ), and χ = A ( T h , τ h , e ). We make thefollowing observations:(a) ( K, κ ) and (
L, λ ) are ( h + 1)-templates,(b) ( K, κ ) and (
L, λ ) are h -compatible,(c) { e, χ } ∈ E ( K ) and { e, χ } ∈ E ( L ),(d) p ( e ) = p ( χ ) = e and q ( e ) = q ( χ ) = e ,(e) ¯ χK = K , ¯ χκ = κ , ¯ χL = L , and ¯ χλ = λ ,(f) A ( K, κ, v ) ∈ C ( K, v ) for each v ∈ K , i.e., M ( K, κ ) is a perfect matching in Γ k ( K ),(g) A ( L, λ, v ) ∈ C ( L, v ) for each v ∈ L , i.e., M ( L, λ ) is a perfect matching in Γ k ( L ),(h) { e, χ } / ∈ M ( K, κ ) but { e, χ } ∈ M ( L, λ ).Now we will use (
K, κ ) and (
L, λ ) to construct a new ( h + 1)-template ( X, ξ ); refer to Figure 3.Let K = prune( K, χ ), L = χ prune( ¯ χL, χ ), and X = K ∪ L . Define ξ : X → [ k ] as follows: ξ ( v ) = κ ( v ) for all v ∈ K and ξ ( v ) = λ ( v ) for all v ∈ L . We make the following observations:(a) ( X, ξ ) is an ( h + 1)-template,(b) ( X, ξ ), (
K, κ ), and (
L, λ ) are pairwise h -compatible,(c) ( ¯ χX, ¯ χξ ), ( ¯ χK, ¯ χκ ), and ( ¯ χL, ¯ χλ ) are pairwise h -compatible.(d) (¯ yX, ¯ yξ ) and (¯ yK, ¯ yκ ) are ( h + 1)-compatible for any y ∈ K ,(e) (¯ yX, ¯ yξ ) and (¯ yL, ¯ yλ ) are ( h + 1)-compatible for any y ∈ L .Hence we have a family of ( h + 1)-compatible ( h + 1)-templates; however, we need to construct an( h + 1)-critical pair. Lemma 15.
There exists a node y ∈ X such that A ( X, ξ, y ) / ∈ C ( X, y ) .Proof. We say that an edge { u, v } is distant if | u | > r + 1 and | v | > r + 1; otherwise it is near .Set M ( K, κ ) is a perfect matching in Γ k ( K ). Moreover, { e, χ } / ∈ M ( K, κ ); therefore we haveeither { u, v } ⊆ K or { u, v }∩ K = ∅ for each { u, v } ∈ M ( K, κ ). It follows that (cid:83) M ( K, K , κ ) = K .Let K (cid:48) ⊆ M ( K, K , κ ) consists of the edges that are distant, and let K (cid:48) = M ( K, K , κ ) \ K (cid:48) consistof the edges that are near. Define K = (cid:83) K (cid:48) and K = (cid:83) K (cid:48) ; see Figure 3 for an illustration.Set M ( L, λ ) is a perfect matching in Γ k ( L ). Moreover, { e, χ } ∈ M ( L, λ ); this is the uniqueedge that joins L and L \ L . Therefore we have (cid:83) M ( L, L , λ ) = L − χ . Let L (cid:48) ⊆ M ( L, L , λ )consists of the edges that are distant, and let L (cid:48) = M ( L, L , λ ) \ L (cid:48) consist of the edges that arenear. Define L = ( (cid:83) L (cid:48) ) + χ and L = (cid:83) L (cid:48) .It follows that(a) K , K , L , and L form a partition of X ,(b) (¯ vK )[ r + 1] = (¯ vX )[ r + 1] and (¯ vκ )[ r + 1] = (¯ vξ )[ r + 1] for any v ∈ K ,(c) (¯ vL )[ r + 1] = (¯ vX )[ r + 1] and (¯ vλ )[ r + 1] = (¯ vξ )[ r + 1] for any v ∈ L ,(d) A ( K, κ, v ) = A ( X, ξ, v ) for any v ∈ K ,(e) A ( L, λ, v ) = A ( X, ξ, v ) for any v ∈ L ,(f) { u, v } ∈ K (cid:48) ∪ L (cid:48) implies { u, v } ∈ M ( X, ξ ),(g) K is a finite set with an even number of nodes,(h) L is a finite set with an odd number of nodes.12 : L : Q : {4} {4}{3} {4}{3} {4}{4}{3} {4} {4}{4} 3113 τ h : A ( T h , τ h ): 3113 P : {4} {4}{4} {4}{4} {4} {4}{4} 1313 σ h : A ( S h , σ h ): 3113
222 3 33 121 3 22 3123 4 2 S h : T h : ee eK K χ L
123 3 4442 12 34 32414 342 243 2 42 43 22 43 24 12 4 e χ L Figure 4: Inductive step. In this example, h = 2 and χ = 4.13y a parity argument, there is a node y ∈ K ∪ L such that y / ∈ (cid:83) M ( X, ξ ), i.e., A ( X, ξ, y ) / ∈ C ( X, y ).Now choose y as in Lemma 15, and define ( S h +1 , σ h +1 ) and ( T h +1 , τ h +1 ) as follows:(a) If y ∈ K , define S i , σ i T i , τ i S h +1 = ¯ yK , σ h +1 = ¯ yκ , T h +1 = ¯ yX , and τ h +1 = ¯ yξ .(b) If y ∈ L , define S h +1 = ¯ yL , σ h +1 = ¯ yλ , T h +1 = ¯ yX , and τ h +1 = ¯ yξ . Lemma 16.
Templates ( S h +1 , σ h +1 ) and ( T h +1 , τ h +1 ) form an ( h + 1) -critical pair.Proof. First, assume that y ∈ K . We have already observed that ( S h +1 , σ h +1 ) = (¯ yK, ¯ yκ ) and( T h +1 , τ h +1 ) = (¯ yX, ¯ yξ ) are ( h + 1)-compatible. Moreover, we have A ( T h +1 , τ h +1 , e ) = A ( X, ξ, y ) / ∈ C ( X, y ) = C ( T h +1 , e ) and A ( S h +1 , σ h +1 , s ) = A ( K, κ, ys ) ∈ C ( K, ys ) = C ( S h +1 , s ) for each s ∈ S h +1 . Hence ( S h +1 , σ h +1 ) and ( T h +1 , τ h +1 ) form an ( h + 1)-critical pair.The case of y ∈ L is analogous.By induction, there are d -templates ( S d , σ d ) and ( T d , τ d ) that form a d -critical pair. Theorem 6follows by choosing U = S d and V = T d . Acknowledgements
We thank Mika G¨o¨os for comments and feedback, and Petteri Kaski, Christoph Lenzen, Joel Rybicki,and Roger Wattenhofer for discussions. This work was supported in part by the Academy of Finland,Grants 132380 and 252018, the Research Funds of the University of Helsinki, and the FinnishCultural Foundation. 14 eferences [1] Dana Angluin. Local and global properties in networks of processors. In
Proc. 12th Symposium onTheory of Computing (STOC 1980) , pages 82–93. ACM Press, 1980.[2] Matti ˚Astrand and Jukka Suomela. Fast distributed approximation algorithms for vertex cover and setcover in anonymous networks. In
Proc. 22nd Symposium on Parallelism in Algorithms and Architectures(SPAA 2010) , pages 294–302. ACM Press, 2010.[3] Leonid Barenboim and Michael Elkin. Distributed (∆ + 1)-coloring in linear (in ∆) time. In
Proc. 41stSymposium on Theory of Computing (STOC 2009) , pages 111–120. ACM Press, 2009.[4] Richard Cole and Uzi Vishkin. Deterministic coin tossing with applications to optimal parallel listranking.
Information and Control , 70(1):32–53, 1986.[5] Micha(cid:32)l Ha´n´ckowiak, Micha(cid:32)l Karo´nski, and Alessandro Panconesi. On the distributed complexity ofcomputing maximal matchings. In
Proc. 9th Symposium on Discrete Algorithms (SODA 1998) , pages219–225. SIAM, 1998.[6] Micha(cid:32)l Ha´n´ckowiak, Micha(cid:32)l Karo´nski, and Alessandro Panconesi. On the distributed complexity ofcomputing maximal matchings.
SIAM Journal on Discrete Mathematics , 15(1):41–57, 2001.[7] Fabian Kuhn. Weak graph colorings: Distributed algorithms and applications. In
Proc. 21st Symposiumon Parallelism in Algorithms and Architectures (SPAA 2009) , pages 138–144. ACM Press, 2009.[8] Fabian Kuhn, Thomas Moscibroda, and Roger Wattenhofer. What cannot be computed locally! In
Proc.23rd Symposium on Principles of Distributed Computing (PODC 2004) , pages 300–309. ACM Press,2004.[9] Fabian Kuhn, Thomas Moscibroda, and Roger Wattenhofer. The price of being near-sighted. In
Proc.17th Symposium on Discrete Algorithms (SODA 2006) , pages 980–989. ACM Press, 2006.[10] Fabian Kuhn, Thomas Moscibroda, and Roger Wattenhofer. Local computation: Lower and upperbounds, 2010. Manuscript, arXiv:1011.5470 [cs.DC].[11] Fabian Kuhn and Roger Wattenhofer. On the complexity of distributed graph coloring. In
Proc. 25thSymposium on Principles of Distributed Computing (PODC 2006) , pages 7–15. ACM Press, 2006.[12] Nathan Linial. Locality in distributed graph algorithms.
SIAM Journal on Computing , 21(1):193–201,1992.[13] Alessandro Panconesi and Romeo Rizzi. Some simple distributed algorithms for sparse networks.
Distributed Computing , 14(2):97–100, 2001.[14] Jukka Suomela. Survey of local algorithms. , 2011.Manuscript submitted for publication.[15] Masafumi Yamashita and Tsunehiko Kameda. Computing on anonymous networks: Part I – characterizingthe solvable cases.
IEEE Transactions on Parallel and Distributed Systems , 7(1):69–89, 1996.[16] Masafumi Yamashita and Tsunehiko Kameda. Leader election problem on networks in which processoridentity numbers are not distinct.
IEEE Transactions on Parallel and Distributed Systems , 10(9):878–887,1999., 10(9):878–887,1999.