10
J. Parallel Distrib. Comput. 74 (2014) 2193–2202 Contents lists available at ScienceDirect J. Parallel Distrib. Comput. journal homepage: www.elsevier.com/locate/jpdc Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs Joel Antonio Trejo-Sánchez a,b,, José Alberto Fernández-Zepeda a a Department of Computer Science, Center for Scientific Research and Higher Education of Ensenada (CICESE), Ensenada 22860, B.C., Mexico b Department of Basic Sciences, Universidad del Caribe, Cancun 77528, Quintana Roo, Mexico highlights We propose a distributed algorithm for the maximal 2-packing set in a geometric outerplanar graph. The execution time of this algorithm is O(n) steps. The algorithm has three phases: leader election, graph exploration, and vertex coloring. The vertex coloring phase resembles an ear decomposition of the input graph. When the input graph is a ring, the algorithm computes the maximum 2-packing set. article info Article history: Received 8 March 2013 Received in revised form 30 November 2013 Accepted 5 December 2013 Available online 19 December 2013 Keywords: Distributed algorithm Geometric graph Outerplanar graph Ear decomposition 2-packing set abstract In this paper, we present a deterministic distributed algorithm that computes the maximal 2-packing set in a geometric outerplanar graph. In a geometric outerplanar graph, all the vertices have location coordinates in the plane and lie on the boundary of the graph. Our algorithm consists of three phases. First, it elects a vertex as the leader. Second, it explores the graph to determine relevant information about the structure of the input graph. Third, with this information, it computes a maximal 2-packing set. When the input graph is a ring, the algorithm computes a maximum 2-packing set. The execution time of this algorithm is O(n) steps and it uses O(n log n) messages. This algorithm does not require knowledge of the size of the input graph. To the best of our knowledge, this is the first deterministic distributed algorithm that solves such a problem for a geometric outerplanar graph in a linear number of steps. © 2013 Elsevier Inc. All rights reserved. 1. Introduction A distributed system is a collection of independent processors that communicate with each other using a computer network. Such processors cooperate to reach a common global goal. Graphs can naturally model distributed systems and researchers have studied and solved many graph problems related to these systems. This paper deals with the design of a deterministic distributed algorithm that solves the maximal 2-packing set problem (M2PS) in geometric outerplanar graphs. A very well-known concept in graph theory is the independent set. Let G = (V , E ) be an undirected connected graph, where V and E are the set of vertices and edges, respectively. A subset I V is Corresponding author at: Department of Basic Sciences, Universidad del Caribe, Cancun 77528, Quintana Roo, Mexico. E-mail addresses: [email protected], [email protected] (J.A. Trejo-Sánchez), [email protected] (J.A. Fernández-Zepeda). an independent set of G, if any arbitrary pair of vertices u,v I are not neighbors in G. A 2-packing set is an independent set with further restrictions; in particular, a 2-packing set [14,10] is a subset S V , such that the length of the shortest path between any pair of vertices u,v S is at least three (some authors refer S as the strong stable set [16,7]). More generally, a k-packing set is a subset L V such that the length of the shortest path between any pair of vertices in L is at least k + 1 (in this sense, the independent set is also known as the 1-packing set). Most of the research in this area focuses on the maximal independent set (MIS). Some relevant distributed algorithms for finding a MIS are [25,5,21,6,27,19]. The fastest distributed algorithms to solve the MIS problem are the ones presented by Panconesi and Srinivasan [25] (for general graphs) that run in O(2 O( log n) ) rounds; by Barenboim and Elkin [5] and Kuhn [21] (for low degree graphs) that run in O(+ log n) rounds, where is the maximum degree in G; and Barenboim and by Elkin [6] (for bounded arboricity graphs) that run in O(log n/ log log n) rounds. All these algorithms have sublinear running time and most of them use the network decomposition 0743-7315/$ – see front matter © 2013 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/j.jpdc.2013.12.002

Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

Embed Size (px)

Citation preview

Page 1: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

J. Parallel Distrib. Comput. 74 (2014) 2193–2202

Contents lists available at ScienceDirect

J. Parallel Distrib. Comput.

journal homepage: www.elsevier.com/locate/jpdc

Distributed algorithm for the maximal 2-packing in geometricouterplanar graphsJoel Antonio Trejo-Sánchez a,b,∗, José Alberto Fernández-Zepeda a

a Department of Computer Science, Center for Scientific Research and Higher Education of Ensenada (CICESE), Ensenada 22860, B.C., Mexicob Department of Basic Sciences, Universidad del Caribe, Cancun 77528, Quintana Roo, Mexico

h i g h l i g h t s

• We propose a distributed algorithm for the maximal 2-packing set in a geometric outerplanar graph.• The execution time of this algorithm is O(n) steps.• The algorithm has three phases: leader election, graph exploration, and vertex coloring.• The vertex coloring phase resembles an ear decomposition of the input graph.• When the input graph is a ring, the algorithm computes the maximum 2-packing set.

a r t i c l e i n f o

Article history:Received 8 March 2013Received in revised form30 November 2013Accepted 5 December 2013Available online 19 December 2013

Keywords:Distributed algorithmGeometric graphOuterplanar graphEar decomposition2-packing set

a b s t r a c t

In this paper, we present a deterministic distributed algorithm that computes the maximal 2-packingset in a geometric outerplanar graph. In a geometric outerplanar graph, all the vertices have locationcoordinates in the plane and lie on the boundary of the graph. Our algorithm consists of three phases.First, it elects a vertex as the leader. Second, it explores the graph to determine relevant information aboutthe structure of the input graph. Third, with this information, it computes amaximal 2-packing set. Whenthe input graph is a ring, the algorithm computes a maximum 2-packing set. The execution time of thisalgorithm is O(n) steps and it uses O(n log n) messages. This algorithm does not require knowledge of thesize of the input graph. To the best of our knowledge, this is the first deterministic distributed algorithmthat solves such a problem for a geometric outerplanar graph in a linear number of steps.

© 2013 Elsevier Inc. All rights reserved.

1. Introduction

A distributed system is a collection of independent processorsthat communicate with each other using a computer network.Such processors cooperate to reach a common global goal. Graphscan naturally model distributed systems and researchers havestudied and solvedmany graph problems related to these systems.This paper deals with the design of a deterministic distributedalgorithm that solves the maximal 2-packing set problem (M2PS)in geometric outerplanar graphs.

A very well-known concept in graph theory is the independentset. Let G = (V , E) be an undirected connected graph, where V andE are the set of vertices and edges, respectively. A subset I ⊆ V is

∗ Corresponding author at: Department of Basic Sciences, Universidad del Caribe,Cancun 77528, Quintana Roo, Mexico.

E-mail addresses: [email protected], [email protected] (J.A. Trejo-Sánchez),[email protected] (J.A. Fernández-Zepeda).

0743-7315/$ – see front matter© 2013 Elsevier Inc. All rights reserved.http://dx.doi.org/10.1016/j.jpdc.2013.12.002

an independent set of G, if any arbitrary pair of vertices u, v ∈ Iare not neighbors in G. A 2-packing set is an independent set withfurther restrictions; in particular, a 2-packing set [14,10] is a subsetS ⊆ V , such that the length of the shortest path between any pairof vertices u, v ∈ S is at least three (some authors refer S as thestrong stable set [16,7]). More generally, a k-packing set is a subsetL ⊆ V such that the length of the shortest path between any pairof vertices in L is at least k + 1 (in this sense, the independent setis also known as the 1-packing set). Most of the research in thisarea focuses on themaximal independent set (MIS). Some relevantdistributed algorithms for finding a MIS are [25,5,21,6,27,19].

The fastest distributed algorithms to solve the MIS problem arethe ones presented by Panconesi and Srinivasan [25] (for generalgraphs) that run inO(2O(

√log n)) rounds; by Barenboim and Elkin [5]

and Kuhn [21] (for low degree graphs) that run in O(∆ + log∗ n)rounds, where ∆ is the maximum degree in G; and Barenboimand by Elkin [6] (for bounded arboricity graphs) that run inO(log n/ log log n) rounds. All these algorithms have sublinearrunning time and most of them use the network decomposition

Page 2: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

2194 J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202

technique [4]. (This technique generates a partition of the verticesof the input graph and generates a set of clusters of specificcharacteristics. Certain graph problems can be partially solved,independently and in parallel, in each cluster. Then, by combiningthe partial solutions of the clusters, it is possible to generate asolution for the original problem. This is the approach used bymany sublinear running time algorithms for the MIS.) All thesealgorithms require that vertices know the number n of vertices inthe input graph or at least an upper bound on this parameter. Thisis a strong assumption for certain types of networks (e.g. dynamicnetworks), since computing the number of vertices in a networkrequires Ω(n) time units [3]. In our paper, we do not assume thatvertices know any of these parameters.

Finding a 2-packing set in a graph is useful in applications thatrequire mutual exclusion in the vertices at a distance two. Oneexample is the frequency assignment problem [13], in which theassignment should avoid co-channel interference. Finding a M2PSis also useful as a subroutine in algorithms that solvemore complexproblems and that require ensuring mutual exclusion amongvertices with overlapping neighborhoods [11,15]. A 2-packing setS is maximum when S is the largest cardinality 2-packing set in G.Finding a maximum 2-packing set is an NP-hard problem [16]. Asimpler problem is finding the M2PS. A 2-packing set S is maximalif there does not exist a 2-packing set S ′ such that S ⊂ S ′.

There are many similarities between the MIS (maximal 1-packing set) and the M2PS problems. Although there exist somedistributed algorithms that run in sublinear time for the firstproblem for general graphs, there does not exist, as far aswe know,any sublinear algorithm for the second problem for general graphs.One issue that hinders this implementation is that for the M2PSproblem, vertices need to have information of other vertices at adistance 2. Gathering this information can be expensive for graphsthat do not have constant degree. For this reason, at least fromthe theoretical point of view, computing a M2PS seems to be moredifficult that computing a MIS.

One easy way to compute a M2PS for a graph G by using theMIS algorithm of [6] is the following. First, compute the graph G2;second, execute the MIS algorithm of [6] on G2. The resulting MISis a M2PS of G. Notice that this algorithm runs in sublinear timeonly ifG has constant degree. For high degree graphs (or even someouterplanar graphs), G2 can be a dense graph and computing all itsedges requires Ω(n2) work. For this reason, the execution time ofthis procedure is no longer sublinear when using n processors.

When the value of n is unknown, many of the current MISalgorithms cannot directly be used to compute a M2PS. However,there exist some methods that make it possible to executethese algorithms without the requirement of knowing n. Kormanet al. [19] provided a method that eliminates, in distributedalgorithms, the requirement of knowing n (with no overhead intime complexity). The main disadvantage of this method is thatit assumes that the size of any message is unbounded (whichis a very unrealistic assumption). The algorithms of [25,5,6] canuse this method to eliminate the requirement of knowing n or apolynomial estimate of n. However, this implies an overhead ofΩ(∆2) to transform the size of messages to O(log n) bits (sincethe method of [19] requires that some vertices read informationof other vertices at a distance 2). Remember that ∆ can be as bigas O(n) for outerplanar graphs. Schneider and Wattenhofer [27]designed an optimal distributed algorithm for computing a MIS inO(log∗ n) rounds for bounded independence graphs, without therequirement that vertices know the value of n. For general graphs,this algorithm can be as slow asO(n) rounds. Note that outerplanargraphs are not necessarily bounded independence graphs.

Even if the value of n is known, a procedure similar to the oneproposed by [6] to compute aM2PSwould fail during the process ofcombining the partial solutions of the clusters (since some vertices

with high degree would need to read information at a distance 2 inother clusters).

There exist relevant results to compute a M2PS in the self-stabilizing context (self-stabilization is a property of some dis-tributed systems in which the system guarantees to converge toa legal state in a finite number of steps, regardless of the initialstate and will remain in a legal state in the absence of faults [9]).Gairing et al. [10] presented a self-stabilizing algorithm for find-ing the M2PS in an arbitrary graph; this algorithm converges to alegitimate state in an exponential number of steps. More recently,Shi [28] presented a self-stabilizing algorithm to compute a M2PSin an arbitrary graph inO(n2) rounds. Turau [32] presented a gener-alization of the distance-2model in self-stabilizing systems, whichmakes it possible to find a M2PS in Ω(n2) rounds. Recently, Trejo-Sánchez and Fernández-Zepeda [30] presented a self-stabilizing al-gorithm that computes a M2PS in a cactus graph in O(D) rounds,where D is the diameter of the cactus.

Very few algorithms focus on finding the maximum 2-packingset. Mjelde [23] designed a self-stabilizing dynamic programmingalgorithm to compute amaximum 2-packing set in a tree that con-verges in O(n3) steps. The algorithm in [30] computes the maxi-mum 2-packing set when the input cactus is a ring.

There exist other works that focus on finding the maximal k-packing set. Manne and Mjelde [22] proposed a self-stabilizingalgorithm that finds a maximal k-packing for an arbitrary graphin an exponential number of steps. Goddard et al. [12] defined aframework to access vertex information at a distance k which, ifapplied to an outerplanar graph, might find aM2PS inΩ(n3) steps.Note that all these results are for the self-stabilizing paradigm.

A graph G is a plane graph if we can draw it in such a way thattwo edges only meet in the vertices. Given a plane graph G, theirfaces are the regions bounded by the edges of G. Let G be a planegraph,G is also outerplanar if all of its vertices lie on the boundary ofthe graph.We refer to the region outside the graph as the outerface.Outerplanar graphs have attracted a lot of attention, since somecomputational problems that are NP-hard for arbitrary graphs canbe solved in polynomial time in outerplanar graphs [17,33]. Notethat trees, rings and cacti are subclasses of the outerplanar graphs.

The algorithm that we propose in this paper receives as inputan outerplanar geometric graph. Geometric graphs assume thattheir vertices know their coordinates in the plane. Edges arestraight lines connecting any pair of vertices that can communicatewith each other. Kranakis et al. [20] use geometric graphs todiscover routes in an undirected graph. Chávez et al. [8] presentedan algorithm for discovering routes for directed geometricouterplanar graphs. Someof the ideas behind the exploration of thegeometric outerplanar graph in our algorithm are also present inthese papers. We use the location information of geometric graphsto simplify the exploration of the input graph.

The results obtained by using geometric graphs have proved tobe helpful for the solution of various combinatorial and computa-tion geometry problems [24]. Knowing the location of each vertexin the plane is a realistic assumption because this information isnow easily available by the use of Geographic Positioning Systems(GPS).

Although our algorithm solves a problem that is defined for anundirected graph, we model the distributed system where it runsas a directed graph D = (V , A), where V and A are the set of ver-tices and directed edges, respectively, and |V | = n. Each vertex ofthe graph represents a processor and each directed edge a commu-nication link between processors.We assume that processors com-municate with each other by using the message passing model [2]inwhich each processor communicateswith its neighbors by send-ing messages over communication channels. We assume that eachvertex uhas a unique identifier ofO(log n) bits and it knows its ownlocation and the locations of all its neighbors. The message length

Page 3: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202 2195

Fig. 1. Weak dual graph T ∗(G) of outerplanar graph G.

is O(log n) bits (this is also known as the CON GEST model [26]).We assume an asynchronousmodel in which there is not a fixed up-per bound on how much time elapses between consecutive stepsof a processor [2]. Wemeasure the message and time complexitiesas the maximum number of messages and steps required by thealgorithm, respectively.

In this paper, we propose a deterministic distributed algorithm,called 2-Packing, for finding a M2PS in a geometric outerplanargraph G. The execution time of the Algorithm 2-Packing is O(n)steps, where n is the number of vertices on the input graph.The message complexity is O(n log n) messages (due to a leaderelection algorithm used by Algorithm 2-Packing). To the best ofour knowledge, the Algorithm 2-Packing is the first deterministicdistributed algorithm that computes a M2PS for a geometricouterplanar graph in a linear number of steps. Additionally, thisalgorithm computes the maximum 2-packing set when G is a ring.

The Algorithm 2-Packing divides in three independent phases.The first phase designates a unique vertex as the leader. The secondphase performs a procedure that explores the input graph to obtainrelevant information for the following phase (the number n ofvertices in the input graph, the boundary of the outerface of G,determining whether or not the input graph is outerplanar). Thethird phase designates which vertices belong to the M2PS. Theprocedure of the third phase resembles an ear decomposition.

We organize the rest of the paper as follows. Section 2describes some basic concepts that are useful for the descriptionof the Algorithm 2-Packing. Section 3 describes the Algorithm2-Packing. Section 4 proves the correctness of the proposedalgorithm and presents its analysis. Finally, Section 5 providessome concluding remarks and future work.

2. Preliminaries

This section presents some basic terminology and conceptson graphs that we use during the description of the Algorithm2-Packing. The distance between two vertices of a graph G isthe length of the shortest path that connects those vertices. Avertex whose removal disconnects G is a cut vertex. An edge whoseremoval disconnects G is a bridge. A graph G is biconnected if it doesnot have cut vertices.

The dual graph G∗ = (V ∗, E∗) of an undirected outerplanargraphG is the graph obtained byG as follows. Replace each face ofGby one vertex of V ∗ and insert an edge between vertices u, v ∈ V ∗if and only if the boundaries of the faces that correspond to u andv share at least one edge. Theweak dual graph T ∗(G) = (V ∗T , E∗T ) ofG is the induced subgraph of G∗ obtained by removing the vertexcorresponding to the outerface. Particularly, if the outerplanargraph is biconnected, theweak dual graph is a tree [1]. Fig. 1 showsa biconnected outerplanar graph G with eight vertices and fourinternal faces. The tree in dotted lines and gray vertices is theweakdual graph T ∗(G) of G.

LetG = (V , E) be an undirected graph, and let P0 be an arbitrarysimple cycle in G. An ear decomposition of G, starting with P0, is anordered partition of the set of edges E = P0 ∪ P1 ∪ · · · ∪ Pk, suchthat ∀i (1 ≤ i ≤ k), Pi is a simple path whose end vertices belong

to P0 ∪ P1 ∪ · · · ∪ Pi−1 but none of its internal vertices do. Notethat we can represent an ear Pi as a set of ordered vertices Pi =v1, v2, . . . , vk. In Fig. 1, when P0 = a, b, h, a; then P1 = h, e, b;P2 = h, g, f , e; and P3 = e, d, c, b.

Ear decomposition is fundamental for many applications ingraph problems such as planarity testing and graph connectivity.Some distributed algorithms for ear decomposition can be foundin [18,31]. During the third phase of our proposed algorithm, wecompute a procedure that resembles an ear decomposition foreach biconnected component of the input geometric outerplanargraph G.

In this paper, G refers to the undirected geometric outerplanargraph that is the input for the Algorithm 2-Packing. We modelthe distributed systemwhere the Algorithm 2-Packing runs by thedirected graph D. Both graphs G and D have basically the sametopology. We can see D as the directed version of G. We obtain Dby replacing every edge (u, v) of G by two directed edges ⟨u, v⟩and ⟨v, u⟩. In some parts of the algorithm we make reference to G,but sometimes we explicitly use D because the algorithm needs todistinguish between edges ⟨u, v⟩ and ⟨v, u⟩.

Let N(u) be the set of vertices adjacent to vertex u (the openneighborhood of u). The closed neighborhood of u is N[u] =N(u) ∪ u. Let A(u)→ =

e(u)→0 , . . . , e(u)→

|N(u)|−1

and A(u)← =

e(u)←0 , . . . , e(u)←|N(u)|−1

be the set of output and input edges

incident to u, respectively. The label assignment for edges is as fol-lows: for a global point of view, the label of each edge is an orderedpair of vertices (e.g. edge ⟨u, v⟩ is the directed edge that goes fromuto v);we call this label the global label of the edge. At the same time,each vertex assigns a local label to each of its incident edges. Forvertex u, local label e(u)→0 corresponds to the edge ⟨u, v⟩, wherev = min w|w ∈ N(u); edge e(u)→1 is the closest output edge toe(u)→0 in the counterclockwise sense. Knowing this information ispossible since the input graph is geometric. The system sets thelocal labels of the remaining edges using the same procedure. Ingeneral, the output edge that follows e(u)→i in the counterclock-wise sense is edge e(u)→(i+1)mod(|N(u)|). We use a similar procedure tolabel input edges. Function vtxu(i) returns the neighbor v ∈ N(u)connected to edges e(u)→i and e(u)←i . Function vtx_inverseu(v) re-turns the index i of edges e(u)→i and e(u)←i that connect u to v andv to u, respectively.

Any edge that lies on the boundary of the graph is an outeredge; otherwise, it is an inner edge. A walk W in a graph is a non-empty sequence of vertices W = v0, v1, . . . , vn. If in W , v0 = vn,then W is a closed walk. We say that a closed walk W is a leftwardclosed walk if for any arbitrary edge ⟨u, v⟩ ∈ W the following edgein W , say edge ⟨v, w⟩, is the edge incident to v that is closest to⟨u, v⟩ in the clockwise sense. An outer leftward closed walk in D isa leftward closed walk that consists exclusively of outer edges. IfD is connected, there exists an outer leftward closed walk, calledWO, that contains all the outer edges of D. Note that WO is themaximal outer leftward closed walk in D. Given a walkW1 that endsin vertex u and a walk W2 that starts in u, the concatenation of W1andW2 (denoted byW1W2) is thewalk obtainedwhenwalkW2 isappended to walkW1 by fusioning suchwalks in vertex u. A way tosimulate a leftwardwalk in a graph is through the use of a traversaltoken. A token that traverses a leftwardwalk is a leftward token. Allthe tokens in the present paper are leftward tokens, so we simplyrefer to them as tokens.

The leader of a graph is a unique vertex that performs special ac-tivities. The first phase of the Algorithm 2-Packing elects a leader,r , in the input graph G. Assume that the leader r is a cut vertex in G.Let C ′ =

C ′1, C ′2, . . . , C ′f

be the set of connected components of

G after removing r . Let Zi = VC′i∪ r and let C =

C1, C2, . . . , Cf

be the set of all r-components of G. The r-component Ci = G [Zi],where G [Zi] is the subgraph of G induced by the set Zi. We usethe concept of r-component in Sections 3 and 4 to extend the Al-gorithm 2-Packing for handling arbitrary geometric outerplanargraphs.

Page 4: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

2196 J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202

3. Proposed algorithm

This section gives a general description of the Algorithm 2-Packing, which consists of three independent phases. The leaderelection phase sets a unique vertex as the leader. In the graph explo-ration phase, the leader gathers information about the structure ofthe input graph by using a set of tokens. The vertex coloring phaseuses a set of tokens and the information provided by the graph ex-ploration phase to identify those vertices that belong to the M2PS.Pseudo-code 1 presents the Algorithm 2-Packing.

Pseudo-code 1. Algorithm 2-Packing(G)Input: A geometrical outerplanar connected undirected graph G=(V , E).Output: A M2PS S ⊆ Vbegin

DL← Leader-Election-Phase(G)

DE← Graph-Exploration-Phase(DL)

GC← Vertex-Coloring-Phase(DE )

end

There exist many algorithms in the literature for implementingthe leader election phase (see [29,2]). For our leader election phase,we use the algorithm proposed by Awerbuch [3], since it is optimalin message and time. This algorithm assumes a message passingmodel in an asynchronous network. The input for the leaderelection phase is a geometric outerplanar connected undirectedgraph G (the leader election phase works also for non-geometricgraphs). The output of this phase is a geometrical outerplanargraph DL

= (V L, AL), which is graph D with a special vertex r (theleader). The execution time of this phase is O(n) steps, where n isthe number of vertices of the input graph. Themessage complexityis O(n log n) messages.

We describe the graph exploration phase in Section 3.1 and thevertex coloring phase in Section 3.2 (in this last section, we assumethat the input outerplanar graph is biconnected). In Section 3.3, weextend the vertex coloring phase so it can handle any geometricouterplanar graph. Now, we define the graph exploration phase ofthe Algorithm 2-Packing.

3.1. Graph exploration phase

The graph exploration phase receives as input a geometricalouterplanar graph DL as described previously. The graph explo-ration phase uses two tokens, created by r , to transverse DL. Theoutput of this phase is the graph DE

= (V E, AE). DE is graph D inwhich the leader r , all the cut vertices, and all the outer and inneredges of D have been identified.

We divide the graph exploration phase into two subphasesdescribed as follows.

1. During the first exploration subphase, r sends the first explo-ration token T1 through each one of its output edges e(r)→i , fori = 0, . . . , |N(r)| − 1. By using the information gathered byT1, r determines the outer output edges incident to r and alsodetermines whether or not r is a cut vertex. This subphase usesthe following procedure to compute the above information:• Assume that r sends T1 through edges e(r)→i and it returns

to r through edge e(r)←j . If j = (i + 1)mod|N(r)|, then edgee(r)→i is an outer output edge. Particularly, if j = i, then edge(r, vtxr(i)) ∈ E is also a bridge in G. Even more, if |N(r)| > 1,then r is a cut vertex.• Assume that every time r sends T1 through edge e(r)→i and

it returns to r through edge e(r)←(i+1)mod|N(r)|, for all i = 0,. . . , |N(r)| − 1. In this case, there exists only one outer out-put edge. This outer output edge is included in the maximalouter leftward closed walkWO.

2. During the second exploration subphase, r sends a secondexploration token T2 only through each of its outer outputedges to identify all the inner and outer edges of DL. With theinformation provided by token T2, the algorithm identifies WO

and all the cut vertices in DL. This subphase uses the followingprocedure:• The algorithm marks u as a cut vertex when a vertex u = r

receives T2 twice or more.• The algorithm marks as outer edges only those edges that T2

traverses in DL; otherwise, it marks them as inner edges.

The first and second exploration tokens T1 and T2 contain theidentifier of the leader r . Additionally, T1 contains a counter thatevery vertex increments when T1 visits it.

Remark 1. Note that exploration token T2 can be used to deter-mine whether or not the input graph G is outerplanar. Since T2 tra-verses exclusively through the boundary of the outerface of G, allthe vertices in Gmust receive T2 if G is outerplanar; otherwise, G isnot outerplanar.

Next, we describe the graph exploration phase of our algorithm.Pseudo-code 2 presents the Graph-Exploration-Phase.

Pseudo-code 2. Graph-Exploration-PhaseInput: A geometrical outerplanar graph DL

= (V L, AL).Output: A geometrical outerplanar graph DE

= (V E , AE) Initially,maxLength is 0. Initially, all vertices are non-cut vertices. Initially, each edge is inner.for leader vertex r .begin1. If (∃ an edge e(r)→i such that

token T1 has not traversed through it AND T1 is not in transit) then2. Vertex r sends T1 through edge e(r)→i3. end_if4. If (r receives T1 from e(r)←j ) then5. If (j = (i+ 1)mod|N(r)|) then6. If (the length of the closed walk traversed by T1 is bigger than maxLength)

then7. max_index← i8. maxLength← the length of the closed walk traversed by T19. end_if10. else11. Vertex r marks edge e(r)→i as an outer output edge12. Vertex r configures itself as a cut vertex if |N(r)| > 113. end_if14. end_if15. If (r is a non-cut vertex AND r sent T1 through all its output edges AND T1

is not in transit) then16. z ← max_index17. Vertex r marks edge e(r)→z as an outer output edge18. end_if19. For all outer output edges e(r)→i do20. Vertex r sends exploration token T221. end_for22. If (all tokens T2 have returned to r) then23. Vertex r starts the coloring phase24. end_if

For any vertex u = r25. If (u receives a token T1 from e(u)←i ) then26. Vertex u increases the counter of T1 and forwards T1 to edge e(u)→

(i−1)mod|N(r)|27. end_if28. If (u receives a token T2 from e(u)←i ) then29. If (u has previously received token T2) then30. Vertex u configures itself as a cut vertex31. end_if32. Vertex u increases the counter of T2 and forwards T2 to edge e(u)→

(i−1)mod|N(r)|33. Vertex umarks edge e(u)←i as an outer input edge34. Vertex umarks edge e(u)→

(i−1)mod|N(r)| as an outer output edge35. end_ifend

Section 4.1 presents the analysis and proof of correctness of thegraph exploration phase.

Page 5: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202 2197

3.2. Vertex coloring phase

The goal of the vertex coloring phase is to compute a M2PS,S, in G. This phase colors as red all the vertices that belong to S;otherwise, it colors them blue. Depending on how far blue verticesare from a red vertex, we distinguish two classes of blue vertices. Avertex is blue-1 if one of its neighbors is red; otherwise, it is blue-2.

The input for this phase is the geometrical outerplanar graphDE

produced by the graph exploration phase. The output of this phaseis the graphGC

= (V C , EC ), which is the graphGwith the followingadditional information for any vertex u ∈ V :

• If u ∈ S, then its variables are u.clr = red, u.ptr = u (u is a redvertex).• If u ∈ S and there exists a vertex v ∈ N(u), such that v ∈ S,

then its variables are u.clr = blue and u.ptr = v (u is a blue-1vertex).• If u ∈ S and for any v ∈ N(u), v ∈ S, then its variables are

u.clr = blue and u.ptr = u (u is a blue-2 vertex).

It is important to notice that in an outerplanar graph, any pairof adjacent cycles shares at most one edge. When this graph isbiconnected, any pair of adjacent cycles shares exactly one edge. Toease the explanation of the vertex coloring phase, we first assumethat G is biconnected and that |V | ≥ 3; later, in Section 3.3, weextend the algorithm to handle a general geometric outerplanargraph.

The general idea of the algorithm for this phase is to perform aprocedure that resembles an ear decomposition of the undirectedgraph G. Since G is biconnected, the first ear is a cycle and anyfollowing ear is an open path. After discovering this first cycle,the algorithm counts the number of vertices in the cycle andthen it assigns them colors from the set red, blue-1, blue-2. Thefirst cycle (and its respective face) corresponds to the root of theweak dual graph T ∗(G) of G. Then, this algorithm determines ifthere exists a cycle adjacent to the previously processed cycle.This algorithm searches for the following cycle by performing aprocedure that is equivalent to a preorder depth first search ofT ∗(G). (A preorder traversal first visits the root of a tree and then,recursively, follows a preorder traversal of each of its subtrees fromleft to right.) If such a cycle exists, this algorithmperforms the sameprocedure as the previous cycle and it continues recursively. Thisphase ends when all the vertices of all the ears of G have beencolored. Now, we introduce some variables and basic definitionsfor the implementation of this phase.

The first cycle, C0 (which is also ear P0), is incident to r andcontains the unique outer output edge of r on DE . Any followingcycle Ci is the concatenation of an open ear Pi with the edge definedby the two end vertices of Pi. The cycle root, ri, of cycle Ci is thevertex that discovers the existence of Ci. Vertex ri coordinatesthe coloring of any uncolored vertex in Ci. Note that r is also thecycle root of C0. Assume that the vertices in Ci are the sequenceci,1, ci,2, . . . , ci,j, ci,1, where ci,1 = ri.

We now provide more specific details about the implementa-tion of this phase. Initially, the algorithm colors vertex r as red.Weassume that all other vertices are uncolored.When the cycle root ridiscovers cycle Ci, the algorithm executes the following three sub-phases for all i ≥ 1.

• Counting subphase. Cycle root ri first creates a counting token TEthat traverses cycle Ci. TE increases its internal counter everytime it visits a vertex in Ci (this counter was cleared during thecreation of TE).When vertex ri receives TE , it gathers the numberof vertices in Ci. Token TE also gathers the color of vertex ci,jduring its traversal through Ci.

• Red/blue subphase. Cycle root ri creates a red/blue token TC thattraverses cycle Ci. TC contains the number of vertices of Ci andthe color of any previously colored vertex of Ci. If ri is blue-2, it recolors to blue-1 and points to ci,2 on Ci before it sendsTC . When a vertex ci,k of Ci, for 2 ≤ k ≤ j − 4, receives TC ,ci,k determines its color and its pointer based on the color ofvertex ci,k−1 (by choosing an appropriate color from the set red,blue-1) and its pointer. This coloring forms a sequence like thefollowing . . . , red, blue-1, blue-1, red, blue-1, blue-1 , . . . , andso on. For k ≥ j− 3, the algorithm executes the following rulessequentially when ci,k receives TC . The objective of these rulesis to avoid the distance between two red vertices being smallerthan three.– For vertex ci,j−3.∗ If ci,j−4 is red, then ci,j−3 colors as blue-1 and sets its pointer

to ci,j−4.∗ If ci,j−4 is blue-1 and points to ci,j−3, then ci,j−3 colors as red.∗ If ci,j−4 is blue-1 and does not point to ci,j−3 and ci,j is red,

then ci,j−3 colors as blue-2.∗ Otherwise, ci,j−3 colors as blue-1 and sets its pointer to

ci,j−2.– For vertex ci,j−2.∗ If ci,j−3 is red, then ci,j−2 colors as blue-1 and sets its pointer

to ci,j−3.∗ If ci,j−3 is blue-1 and points to ci,j−2 and ci,j is not red, then

ci,j−2 colors as red.∗ If ci,j−3 is blue-1 and does not point to ci,j−2 and (ci,j or ci,1

is red), then ci,j−2 colors as blue-2.∗ Otherwise, ci,j−2 colors as blue-1 and sets its pointer to

ci,j−1.– For vertex ci,j−1.∗ If ci,j−2 is red, then ci,j−1 colors as blue-1 and sets its pointer

to ci,j−2.∗ If ci,j−2 is blue-1 and points to ci,j−1 and (neither ci,j nor ci,1

is red), then ci,j−1 colors as red.∗ If ci,j−2 is blue-2 and ci,1 is red, then ci,j−1 colors as blue-2.∗ If ci,j−2 is blue-2 and ci,1 is not red and (ci,j is red or

uncolored), then ci,j−1 colors as blue-1 and sets its pointerto ci,j.∗ If ci,j−2 is blue-1 and does not point to ci,j−1 and (ci,j is red or

uncolored), then ci,j−1 colors as blue-1 and sets its pointerto ci,j.∗ Otherwise, ci,j−1 colors as blue-2.

– For uncolored vertex ci,j.∗ If ci,j−1 is red, then ci,j colors as blue-1 and sets its pointer

to ci,j−1.∗ If ci,j−1 is blue-1 and points to ci,j, then ci,j colors as red.∗ If ci,j−1 is blue-2 and ci,1 is red, then ci,j colors as blue-1 and

sets its pointer to ci,1.∗ If ci,j−1 is blue-1 and does not point to ci,j and ci,1 is red,

then ci,j colors as blue-1 and sets its pointer to ci,1.∗ Otherwise, ci,j−1 colors as blue-2.

– For colored vertex ci,j.∗ If ci,j is blue-2 and ci,j−1 is red, then ci,j recolors as blue-1

and sets its pointer to ci,j−1.• Searching subphase. Cycle root ri creates a search token TS that

traverses cycle Ci. When a vertex u receives TS , it determines ifthe following edge, (u, v), in Ci is shared between Ci and a newcycle Cj (cycle Cj is the concatenation of ear Pj and edge (u, v)).If Cj exists, the algorithm executes these three subphases in Cjrecursively, starting at u. This phase endswhen token TS returnsto ri.

Pseudo-code 3, called Vertex-Coloring-Phase, presents thealgorithm of this phase.

Page 6: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

2198 J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202

Pseudo-code 3. Vertex-Coloring-PhaseInput: A geometric outerplanar graph DE .Output: A geometric colored outerplanar graph GC . We refer to a field of a token T as T ⟨field⟩. Vertex v is the neighbor of r such that edge ⟨r, v⟩ is the only outeroutput edge of r in DE . Boolean function new_cycle receives as input an index k anddetermines, given the edge e(u)→k , if edge e(u)←kbelongs to a new cycle Cj.Vertex-Coloring-Phase for vertex rbegin1. If (r has not yet send a search token TS ) then2. Set the color of r as red3. k← vtx_inverser (v)

4. process_cycle(k)5. end_if

Vertex-Coloring-Phase for u = r6. Wait until TE arrives to u7. k← is the index of the input edge from TE arrives to u8. TE ⟨count⟩ = TE ⟨count⟩ + 19. Forward TE through e(u)→

(k−1)mod|N(u)|10. wait until TC arrives to u11. k← is the index of the input edge from TC arrives to u12. Assign correctly u.clr , and u.ptr13. TC ⟨count⟩ = TC ⟨count⟩ + 114. Forward TC through e(u)→

(k−1)mod|N(u)|15. Wait until TS arrives to u16. k← is the index of the input edge from TS arrives to u17. If (new_cycle((k− 1)mod|N(u)|)) then18. process_cycle((k− 1)mod|N(u)|)19. end_if20. Forward TS to e(u)→(k− 1)mod|N(u)|

Function process_cyle(k) for any vertex u21. Vertex u creates and sends a token TE through edge e(u)→

(k−1)mod|N(u)|to count the number of vertices of its current cycle and gathers informationabout vertices that were previously colored.

22. Wait until TE returns to u.23. Vertex u creates and sends a red/blue token TC through edge

e(u)→(k−1)mod|N(u)| to color the uncolored vertices of its current cycle.

24. Wait until TC returns to u.25. Vertex u creates a search token TS .26. If (new_cycle((k− 1)mod|N(u)|)) then27. process_cycle((k− 1)mod|N(u)|)28. end_if29. Vertex u sends TS through edge e(u)→

(k−1)mod|N(u)| .30. Wait until TS returns to u.31. Exit.end

3.3. Extended vertex coloring phase

Now, we extend the vertex coloring phase to handle any con-nected geometric outerplanar graph G that is not necessarily bi-connected (i.e. when G has cut vertices). The leader election andthe graph exploration phases work for this case. We now presentthese changes.

We say that a vertex u is the bi-comp root of biconnected com-ponent K if u is the vertex that discovers K . Note that r is the bi-comp root of all the biconnected components it belongs to. Assumethat u is a cut vertex in G and belongs to the biconnected com-ponent K . Assume that the algorithm previously colored u duringthe processing of biconnected component K . When u receives thesearch token TS , the algorithm stops temporarily the processingof K and initiates the processing of the new biconnected compo-nent K ′ discovered by u. Note that K ′ can be a bridge or a non-bridge and u can be the bi-comp root ofmore than one biconnectedcomponent. Depending on the type and number of biconnectedcomponents, we have three cases. The first one is for a non-bridgebiconnected component. The second one is for a bridge. The thirdone is when there exists more than one biconnected component.Next, we explain the three cases.

• Assume that vertex u is the bi-comp root of a new biconnectedcomponent K ′ that is not a bridge. The algorithm processes K ′

by executing the counting, red/blue and search subphases. Ifduring the search subphase of K ′, the algorithm finds anothercut vertex v, the algorithm stops the processing of K ′ andperforms the processing of the new biconnected componentrecursively. After u receives token TS from the search subphaseduring the processing of K ′, the algorithm continues with theprocessing of component K .• Assume that u is the bi-comp root of a new biconnected com-

ponent K ′ that is the bridge (u, v) of G. The algorithm omits thecounting subphase for this case, since it is trivial. Then, u cre-ates the red/blue token TC and sends it through edge ⟨u, v⟩ ofDE . When v receives TC , it colors itself according to the follow-ing simple rule:– If u is red, then v colors as blue-1 and sets its pointer to u.– If u is blue-1, then v colors as blue-2.– If u is blue-2, then v colors as red and u recolors as blue-1

when TC returns to u.After visiting vertex v, TC returns to u. Next, u sends a searchtoken TS through edge ⟨u, v⟩. After v receives TS , if necessary,it performs recursively the same procedure as u in a new com-ponent. After u receives TS through edge ⟨v, u⟩, the algorithmcontinues the processing of component K .• Assume that u is the bi-comp root of s new biconnected com-

ponents. In the same way as the previous cases, the algorithmstops temporarily the processing of K . Then, the algorithm pro-cesses completely each of the s biconnected components, one ata time (each biconnected component can be a bridge or a non-bridge). After finishing the processing of the last biconnectedcomponent (when u receives the last TS), the algorithm contin-ues with the processing of K .

Now, we prove the correctness and present the analysis of theAlgorithm 2-Packing.

4. Correctness of the algorithm

Since all the phases of the Algorithm 2-Packing are indepen-dent, we separately prove the correctness and complexity of thegraph exploration phase in Section 4.1 and the vertex coloringphase (that includes its extended version) in Section 4.2.

4.1. Correctness and analysis of the graph exploration phase

Now, we prove the correctness of the graph exploration phase.Lemmas 1–4 and Corollary 1 are auxiliary results for Lemma 5,which proves that the first exploration subphase identifies theouter output edges incident to leader r andwhether or not r is a cutvertex. Lemma 6 and Corollary 2 state that the second explorationsubphase finds all the cut vertices and all the outer and inneredges of DL. Corollaries 3 and 4 establish the time and messagecomplexities of this phase.

Lemma 1. Let r be the leader of DL and let ⟨r, vi⟩ be one of its outputedges. If r sends a token T through edge ⟨r, vi⟩, T always returns to r.

Proof. We prove by contradiction. Assume that r sends a tokenT through edge ⟨r, vi⟩, T does not disappear during the traversal,and T does not return to r . Since T does not return to r and it doesnot disappear, then T must be moving in an infinite loop C , whereC = c1, . . . , ck, c1 and ci ∈ V L, for all 1 ≤ i ≤ k. Notice that r ∈ C .Let vi, . . . , vj, c1, be the leftwardwalk that T follows from r to C . So,T arrives to C through edge

vj, c1

, then T moves to edge ⟨c1, c2⟩,

and continues traversing the cycle in clockwise direction until itreaches c1 again, through edge ⟨ck, c1⟩. From c1, T moves throughedge ⟨c1, c2⟩ (since we are assuming that T moves indefinitely onC), which contradicts the definition of leftward token (a leftwardtoken must follow edge

c1, vj

as illustrated in Fig. 2). Therefore, T

cannot move indefinitely on a cycle without arriving at r .

Page 7: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202 2199

Fig. 2. Auxiliary diagram for the proof of Lemma 1.

Lemma 2. Let r be the leader of DL and let ⟨r, v1⟩ be one of its outeroutput edges. Any leftward closedwalkW that starts in r through edge⟨r, v1⟩ is an outer leftward closed walk.

Proof. We prove by contradiction. Assume that W starts in rthrough edge ⟨r, v1⟩ and W is not an outer leftward closed walk.Since ⟨r, v1⟩ is included in both W and WO, and W is not anouter leftward closedwalk, thenW andWO must separate in somevertex vj. Let

vj, q

be the first edge from W that differs from the

one in WO (which has edgevj, vj+1

instead). Both walks share

the previous edgevj−1, vj

and since both walks use the leftward

movement convention, then the edge that followsvj−1, vj

must

be the same in both walks. So there exists a contradiction and Wmust be an outer leftward closed walk.

Lemma 3. Let r be the leader of DL and let W be the leftward closedwalk that the first exploration token T1 follows after r sends it throughedge ⟨r, i⟩. Edge (r, i) is a bridge in G if and only if T1 returns to rthrough edge ⟨i, r⟩.

Proof. ⇒We prove by contradiction. Assume that edge (r, i) is abridge in G, that r initiates a leftward closed walk W by sending atoken T1 through edge ⟨r, i⟩, and T1 returns to r by an edge differentfrom ⟨i, r⟩. If (r, i) is a bridge in G, the only way T1 can return to r(after leaving through edge ⟨r, i⟩) is through edge ⟨i, r⟩. This is acontradiction of the original assumption.⇐Weprove by contradiction. Assume that r starts the leftward

closed walk W = r, i, w1, w2, . . . , ws, i, r by sending T1 throughedge ⟨r, i⟩, that T1 returns to r through edge ⟨i, r⟩, and that edge(r, i) is not a bridge in G.

Since edge (r, i) is not a bridge in G, then there exists a walkQ = i, q1, q2, . . . , qt , r that goes from i to r and that does nottravel through edge ⟨i, r⟩. Assume that wm = qz is the last vertexthat belongs to both W and Q , respectively, before they separateas shown in Fig. 3 (this vertex must exist since both walks containvertex i and both arrive to r from different vertices). Since T1 isa leftward token, it must travel through vertices r, i, . . . , wm, andfrom wm to qz+1 rather than wm+1, which is a contradiction of theinitial assumption. Therefore, (r, i) must be a bridge in G.

Corollary 1. Let r be the leader of DL. Let W be the leftward closedwalk that r starts by sending the first exploration token T1 throughedge ⟨r, i⟩. If edge (r, i) is a bridge in G, then W is an outer leftwardclosed walk.

Proof. Since edge (r, i) is a bridge inG, edge ⟨r, i⟩ is an outer outputedge. By Lemma 2,W is an outer leftward closed walk.

For simplicity, we use the following auxiliary notation forLemmas 4 and 5. Let vi

= vtxr(i) be the vertex that is connected tothe i-ary edge of r .

Fig. 3. Auxiliary diagram for the proof of Lemma 3.

Lemma 4. Let r be the leader of DL and also a non-cut vertex. LetWi be the leftward closed walk that r starts by sending the firstexploration token T1 through edge

r, vi

, for 0 ≤ i ≤ |N(r)| − 1.

Then, if Wx = max(|Wi|), for all i, then Wx = WO, and ⟨r, vx⟩ is theonly outer output edge incident to r.

Proof. We prove by contradiction. Assume that Wx = max(|Wi|),for all i, and Wx = WO. Note that WO visits all the outer edges ofDL and exactly one output edge incident to r belongs to WO. Thus,one of the leftward closed walks must beWO.

Since Wx = WO, then |Wx| > |WO|. Since WO includes all the

outer edges of DL, then Wx must include at least one inner edge.Wx cannot be a leftward closedwalk consisting exclusively of inneredges, because this type of leftward closed walks is at most as bigas WO (when G is a ring). Consequently, Wx must include at leastone outer edge. By Lemma 2, any leftward closed walk that startsin an outer edge is an outer leftward closed walk and must consistexclusively of outer edges. So, there is a contradiction because Wxcannot have inner edges. Therefore,Wx = WO.

Lemma 5. Let r be the leader of DL and also a non-cut vertex. LetWi be the leftward closed walk that r starts by sending the firstexploration token T1 through edge

r, vi

, for 0 ≤ i ≤ |N(r)| − 1.

Only one of the following three statements is true:

a. |N(r)| = 1, edge (r, v0) is a bridge in G,r, v0

is an outer output

edge in DL, and W0 = WO.b. |N(r)| = 2.• If |W0| > |W1|, then W0 = WO and

r, v0

is an outer output

edge in DL.• If |W0| < |W1|, then W1 = WO and

r, v1

is an outer output

edge in DL.• If |W0| = |W1|, then W0 = WO,

r, v0

is an outer output edge

in DL, and G is a ring.c. |N(r)| ≥ 3. If Wx = max(|Wi|), for all i, then Wx = WO,

and ⟨r, vx⟩ is an outer output edge in DL. Additionally, for eachleftward closed walk that r starts by sending the first explorationtoken T1 through edge vertex

r, vi

, token T1 returns to r through

edgev(i+1)mod|N(r)|, r

.

Proof. We prove each statement separately.

a. Since |N(r)| = 1, then v0 is the only neighbor of r . If we removeedge (r, v0) from G, r disconnects from v0, so edge (r, v0) is abridge in G. Since edge (r, v0) is a bridge in G, edge

r, v0

is an

outer output edge in DL. By Lemma 2,W0 = WO.

Page 8: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

2200 J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202

Fig. 4. Auxiliary diagram for the proof of Case 2 of Statement c of Lemma 5.

b. Since |N(r)| = 2 and r is a non-cut vertex, then edges (r, v0)and (r, v1) are not bridges in G. Since they are not bridges, byLemmas 1 and 3, any leftward closed walk that starts in r whenit sends a token through edge

r, v0

(or

r, v1

) must arrive at

edgev1, r

(or

v0, r

). By Lemma 4, if Wx = max(|W0|, |W1|),

then Wx = WO and ⟨r, vx⟩ is an outer output edge in DL. When|W0| = |W1|, graph G is a ring and |WO

| = |W I|, where W I is

the longest leftward walk consisting exclusively of inner edges.c. Since Wx = max(|Wi|), for all i, then by Lemma 4, Wx = WO

and ⟨r, vx⟩ is an outer output edge in DL.

We prove by contradiction the remainder of Statement c.Assume that there exists a leftward walk Wi that r starts by

sending the first exploration token T1 through edger, vi

, and such

a walk returns to r by an edge different fromv(i+1)mod|N(r)|, r

.

Since r is a non-cut vertex with |N(r)| ≥ 3, then (r, vi) cannotbe a bridge in G; by Lemma 3, token T1 cannot return through edgevi, r

.

Thus, assume that T1 returns through edgev(i+j)mod|N(r)|, r

,

where j ∈ 0, 1. By the initial assumption, there exists a leftwardclosed walk that starts in

r, vi

and ends in

v(i+j)mod|N(r)|, r

, for

some j ∈ 0, 1.To show the existence of a contradiction, it is necessary to

analyze the possible positions of vertex v(i+1)mod|N(r)| in the plane.There exist three cases.

Case 1. When vertex v(i+1)mod|N(r)| is inside some internal facebounded by the edges traversed byWi. There exists a contradiction,since we assume that G is outerplanar and, in such a graph, eachvertex of G lies on the boundary of the graph.

Case 2. When vertex v(i+1)mod|N(r)| is on the boundary defineby Wi, i.e. Wi = r, vi, q1, . . . , qs, v(i+1)mod|N(r)|, qs+1, . . . , qs+t ,v(i+j)mod|N(r)|, r .

There exists a contradiction, since Qi = r, vi, q1, . . . , qs,v(i+1)mod|N(r)|, r bounds an internal face of G and a token would gothrough Qi rather thanWi. Fig. 4 illustrates this case.

Case 3.When vertex v(i+1)mod|N(r)| is outside the face bounded byedges traversed by Wi. Since Wi is a leftward closed walk, it doesnot exist any path that goes from any vertex different from r inWito v(i+1)mod|N(r)|. This implies that r is a cut vertex, which is a con-tradiction.

There are contradictions in the three cases. Therefore, token T1must return through edge

v(i+1)mod|N(r)|, r

.

Remark 2. Note that in each r-component Ci of G (see Section 2),vertex r is a non-cut vertex and Ci can be expressed individually assome case of those specified by Lemma 5. The objective of the firstexploration subphase is to identify exactly one outer output edgeof r for each r-component Ci of G.

So far, we have proved that the first exploration subphase iscorrect.Wenowprove that the second exploration subphase is alsocorrect.

Fig. 5. Auxiliary diagram for the proof of Lemma 6.

Lemma 6. Let r be the leader of DL. Assume that G consists of fr-components. Let WO

Ci = r, vi,1, . . . , vi,m, r be the outer leftwardclosed walk that r starts by sending the second exploration token T2through the outer edge

r, vi,1

in r-component Ci. A vertex vi,k = r is

a cut vertex if and only if vi,k appears more than once in WOCi.

Proof. ⇒We prove by contradiction. Assume that a vertex vi,k =

r is a cut vertex and it appears only once in WOCi. Since vi,k

is a cut vertex, its removal splits the graph in two or moreconnected components. Since WO

Ci exists, then there also exists awalk vi,k+1, . . . , r, . . . , vi,k−1 that connects vi,k+1 to vi,k−1, whichis a contradiction because we are assuming that vi,k is a cut vertex.Therefore, vi,k must appear at least twice in WO

Ci to disconnect thegraph after its removal.⇐ We prove by contradiction. Assume that a vertex vi,k = r ,

vi,k appears at least twice in WOCi, and vi,k is a non-cut vertex.

Let Wk = vi,k, wi,1, wi,2, . . . , wi,t , vi,k be a proper outer leftwardclosed subwalk of WO

Ci that starts and finishes in vi,k. Let vi,k+1be the following vertex of vi,k after the end of Wk. Since vi,k isa non-cut vertex, there exists a walk Q = wi,t , q1, . . . , qs, vi,k+1that goes from wi,t to vi,k+1 without passing through vi,k. SinceT2 is a leftward token, it must travel through the follow-ing path . . . , vi,k−1, vi,k, wi,1, wi,2, . . . , wi,t , q1, . . . , qs, vi,k+1, . . . ,which is a contradiction since we are assuming that T2 visits vi,ktwice. Therefore, vi,k must be a cut vertex (Fig. 5 illustrates thiscase).

Corollary 2. The second exploration subphase identifies all the outerand inner edges of DL.

Proof. By Lemma 2, when r sends the second exploration token T2to generate walk WO

Ci in an r-component Ci, T2 travels exclusivelyand through all the outer edges of r-component Ci. Thus, if T2travels through edge ⟨u, v⟩, this edge is an outer edge in Ci;otherwise, it is an inner edge. Since r performs this procedure for allthe r-components of the input graph, the graph exploration phaseidentifies all the outer and inner edges of DL.

Corollary 3. The graph exploration phase computes the graph DE inO(n) steps.

Proof. During the first subphase, token T1 travels each edge ofDL atmost once before it disappears. A similar procedure occurs duringthe second exploration subphasewhen r sends token T2. Therefore,the execution time of this phase is O(n) steps, since an outerplanargraph with n vertices has O(n) edges.

Corollary 4. The graph exploration phase requires O(n) messages.

Proof. Every time a token visits an edge is because the algorithmgenerated a message. Therefore, the graph exploration phasegenerates O(n) messages.

Page 9: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202 2201

4.2. Correctness and analysis of the vertex coloring phase

Now, we prove the correctness of the vertex coloring phase fortwo cases: first, when G is a non-bridge biconnected componentand it has m cycles (see Section 3.2), and second, when G has cutvertices (see Section 3.3). In both cases, we demonstrate that thealgorithm generates a M2PS on G.

Lemma 7. Let r be the leader of DE . The vertex coloring phase gener-ates a M2PS on G, when G is a non-bridge biconnected component.

Proof. We prove by induction on the number of cycles of G.Base case: Consider the first cycle C0 = v1, v2, . . . , vj, v1 of

G, where r = v1. Note that the algorithm initially colors vertexr as red. First, r creates a counting token TE that traverses C0;after r receives TE , it collects the number j of vertices in C0. Next,the algorithm assigns a sequence of colors to the vertices of C0 asfollows. red, blue-1, blue-1, red , . . . , for the first j−4 vertices of C0.

Note that the assignment of colors to the first j − 4 verticesof C0 generates a M2PS in those vertices. To assure a M2PS in C0,the color assignment for vertices vj−3, vj−2, vj−1 and vj must becarefully chosen. The coloring for these four vertices depends onthe value of j and the algorithm uses the rules of Section 3.2 toassign colors to those vertices. It is straightforward to check thatthese rules always generate a M2PS in a cycle. Note that the M2PSfor C0 is also maximum.

Inductive hypothesis: Assume that the algorithm computes aM2PS for the first k cycles of G, where k < m.

Inductive step. Let Ck = w1, w2, . . . , wh, w1 be the k + 1-arycycle of G, where w1 is the cycle root. Note that Ck shares exactlyone edge, (w1, wh), with cycle Cs, for some s, where 0 ≤ s ≤k− 1. By the inductive hypothesis, vertices w1 and wh are alreadycolored. First, w1 generates a counting token TE that traverses Ck;after w1 receives TE , vertex w1 gets the number of vertices h inCk and the color of wh. Later, the algorithm assigns a sequence ofcolors, starting inw2 and ending inwh−4, similarly to the sequenceof the base case, but considering the color of w1. Similarly to thebase case, to assign colors to vertices wh−3, wh−2, wh−1 and torecolor wh (if necessary), the algorithm considers the value of hand the colors of w1 and wh (by using the rules of Section 3.2).Similarly for the base case, it is straightforward to check that theserules always color correctly these last vertices and the algorithmgenerates a M2PS in cycle Ck.

When G has cut vertices, we can extend the proof of Lemma 7as follows. There are two cases to consider.

Case 1. When cut vertex u discovers a new non-bridge bicon-nected component. Vertex u behaves as the root of the new bicon-nected component and the algorithm colors its vertices as shownin Lemma7. The only difference is that now u is not necessarily red.

Case 2. When cut vertex u discovers bridge (u, v). Since u isalready colored, the assignment of color to v is trivial.

Corollary 5. The vertex coloring phase computes the graphGC in O(n)steps.

Proof. During the counting subphase, token TE travels througheach edge of DE at most once before it disappears. A similarprocedure occurs during the red/blue subphase and during thesearch subphase when r sends tokens TC and TS , respectively.Therefore, the execution time of this phase is O(n) steps, since anouterplanar graph with n vertices has O(n) edges.

Corollary 6. The vertex coloring phase requires O(n) messages.

Proof. Every time a token visits an edge is because the algorithmgenerated a message. Therefore, the algorithm generates O(n)messages.

Theorem 1 summarizes the result of this paper.

Theorem 1. The Algorithm 2-Packing with the extension describedin Section 3.3, for the vertex coloring phase, computes in O(n) stepsa M2PS when the input graph is a connected geometric outerplanargraph with n vertices.

5. Concluding remarks

In this paper, we present the deterministic distributed Algo-rithm 2-Packing that produces a M2PS in a geometric outerplanargraph G in O(n) steps, where n is the number of vertices of G (wedo not assume that the algorithm knows n). We present its cor-rectness and time complexity. The algorithm requires O(n log n)messages, but it reduces to O(n) if we assume that the leader waspreviously elected. The Algorithm 2-Packing computes the max-imum 2-packing set when G is a ring. The Algorithm 2-Packingidentifies the cut vertices and bridges ofG and validateswhether ornotG is outerplanar.With a simplemodification, the algorithmalsogenerates an ear decomposition of G. To the best of our knowledge,this algorithm is the first distributed algorithm that computes amaximal 2-packing set for a geometric outerplanar graph G in alinear number of steps.

An interesting problem for future work is to remove the restric-tion of the input graph to be geometric. Another interesting re-search direction is to incorporate into the Algorithm 2-Packing theself-stabilizing property. Finally, it would be interesting to studythe possibility of designing a sublinear execution time algorithmfor the M2PS problem by using the network decomposition tech-nique (the one used by many sublinear MIS algorithms).

References

[1] G. Agnarsson,M.M.Halldórsson, On colorings of squares of outerplanar graphs,in: Proceedings of the Fifteenth Annual ACM-SIAM Symposium on DiscreteAlgorithms, Society for Industrial and Applied Mathematics, SIAM, 2004,pp. 244–253.

[2] H. Attiya, J. Welch, Distributed Computing: Fundamentals, Simulations andAdvanced Topics, second ed., John Wiley Interscience, 2004.

[3] B. Awerbuch, Optimal distributed algorithms for minimum weight spanningtree, counting, leader election, and related problems, in: Proceedings of theNineteenth Annual ACM Symposium on Theory of Computing, ACM, 1987,pp. 230–240.

[4] B. Awerbuch, M. Luby, A. Goldberg, S.A. Plotkin, Network decompositionand locality in distributed computation, in: 30th Annual Symposium onFoundations of Computer Science, IEEE, 1989, pp. 364–369.

[5] L. Barenboim, M. Elkin, Distributed (δ+1)-coloring in linear (in δ) time,in: Proceedings of the 41st Annual ACM Symposium on Theory of Computing,ACM, 2009, pp. 111–120.

[6] L. Barenboim, M. Elkin, Sublogarithmic distributed MIS algorithm for sparsegraphs using Nash–Williams decomposition, Distrib. Comput. 22 (2010)363–379.

[7] K. Cameron, J. Edmonds, Finding a strong stable set or a meyniel obstructionin any graph, in: S. Felsner (Ed.), European Conference on Combinatorics,Graph Theory and Applications, volume AE of DMTCS Proceedings, in: DiscreteMathematics and Theoretical Computer Science, 2005, pp. 203–206.

[8] E. Chávez, S. Dobrev, E. Kranakis, J. Opatrny, L. Stacho, J. Urrutia, Routediscovery with constant memory in oriented planar geometric networks,Networks 48 (2006) 7–15.

[9] E.W. Dijkstra, Self-stabilizing systems in spite of distributed control, Commun.ACM 17 (1974) 643–644.

[10] M. Gairing, R.M. Geist, S.T. Hedetniemi, P. Kristiansen, A self-stabilizingalgorithm for maximal 2-packing, Nordic J. Comput. 11 (2004) 1–11.

[11] M. Gairing, S.T. Hedetniemi, P. Kristiansen, A.A. McRae, Self-stabilizingalgorithms for k-domination, in: 6th International Symposium on Self-Stabilizing Systems, SSS, Springer-Verlag, 2003, pp. 49–60.

[12] W. Goddard, S.T. Hedetniemi, D.P. Jacobs, V. Trevisan, Distance-k knowledgein self-stabilizing algorithms, Theoret. Comput. Sci. 399 (2008) 118–127.

[13] W. Hale, Frequency assignment: theory and applications, Proc. IEEE 68 (1980)1497–1514.

[14] T. Haynes, S. Hedetniemi, P. Slater, Domination in Graphs: Advanced Topics,in: Monographs and Textbooks in Pure and Applied Mathematics, MarcelDekker, 1998.

[15] S.M. Hedetniemi, S.T. Hedetniemi, H. Jiang, K. Kennedy, A.A. McRae, A self-stabilizing algorithm for optimally efficient sets in graphs, Inform. Process.Lett. 112 (2012) 621–623.

Page 10: Distributed algorithm for the maximal 2-packing in geometric outerplanar graphs

2202 J.A. Trejo-Sánchez, J.A. Fernández-Zepeda / J. Parallel Distrib. Comput. 74 (2014) 2193–2202

[16] D.S. Hochbaum, D.B. Shmoys, A best possible heuristic for the k-centerproblem, Math. Oper. Res. 10 (1985) 180–184.

[17] T. Horváth, J. Ramon, S. Wrobel, Frequent subgraph mining in outerplanargraphs, Data Min. Knowl. Discov. 21 (2010) 472–508.

[18] A. Kazmierczak, S. Radhakrishnan, An optimal distributed ear decompositionalgorithm with applications to biconnectivity and outerplanarity testing, IEEETrans. Parallel Distrib. Syst. 11 (2000) 110–118.

[19] A. Korman, J.S. Sereni, L. Viennot, Toward more localized local algorithms:removing assumptions concerning global knowledge, Distrib. Comput. 26(2013) 289–308.

[20] E. Kranakis, H. Singh, J. Urrutia, Compass routing on geometric networks,in: Proceedings of the 11th Canadian Conference on Computational Geometry,UBC, Vancouver, British Columbia, Canada, CCCG, 1999, pp. 1–4.

[21] F. Kuhn, Weak graph colorings: distributed algorithms and applications,in: Proceedings of the Twenty-First Annual Symposium on Parallelism inAlgorithms and Architectures, ACM, 2009, pp. 138–144.

[22] F.Manne,M.Mjelde, Amemory efficient self-stabilizing algorithm formaximalk-packing, in: Proceedings of the 8th International Conference on Stabilization,Safety, and Security of Distributed Systems, SSS’06, Springer-Verlag, Berlin,Heidelberg, 2006, pp. 428–439.

[23] M. Mjelde, K -packings and k-dominations on tree graphs, 2004. Chair-Pardalos, Panagote M.

[24] J. Pach, Notes on geometric graph theory, Discrete Comput. Geom. 6 (1991)273–285. Papers from DIMACS special year.

[25] A. Panconesi, A. Srinivasan, On the complexity of distributed networkdecomposition, J. Algorithms 20 (1996) 356–374.

[26] D. Peleg, Distributed Computing: A Locality-sensitive Approach, Vol. 5, SIAM,2000.

[27] J. Schneider, R. Wattenhofer, An optimal maximal independent set algorithmfor bounded-independence graphs, Distrib. Comput. 22 (2010) 349–361.

[28] Z. Shi, A self-stabilizing algorithm to maximal 2-packing with improvedcomplexity, Inform. Process. Lett. 112 (2012) 525–531.

[29] G. Tel, Introduction to Distributed Algorithms, Cambridge University Press,2000.

[30] J.A. Trejo-Sánchez, J.A. Fernández-Zepeda, A self-stabilizing algorithm for themaximal 2-packing in a cactus graph, in: IPDPS Workshops, IEEE ComputerSociety, 2012, pp. 863–871.

[31] Y.H. Tsin, On finding an ear decomposition of an undirected graph distribu-tively, Inform. Process. Lett. 91 (2004) 147–153.

[32] V. Turau, Efficient transformation of distance-2 self-stabilizing algorithms,J. Parallel Distrib. Comput. 72 (2012) 603–612.

[33] P. Winter, Generalized steiner problem in series-parallel networks, J. Algo-rithms 7 (1986) 549–566.

Joel Antonio Trejo-Sánchez received the B.Sc. degreefrom the Universidad Autónoma de Yucatán, México, in2003. He received the M.Sc. degree in Computer SciencefromCINVESTAV, Guadalajara,México in 2006. Since 2007,he is a full professor with tenure at the Department of Ba-sic Sciences at the Universidad del Caribe, México. He iscurrently a Ph.D. student in the Department of ComputerScience at CICESE, since 2009. His research interests in-clude distributed algorithms, self-stabilization and graphtheory.

José Alberto Fernández-Zepeda received his B.Sc. andM.Sc. from the Universidad Nacional Autónoma de Méx-ico in 1991 and 1994, respectively, and his Ph.D. fromLouisiana State University in 1999. Since 2000, he has beenwith the Department of Computer Science at CICESE, Mex-ico, where he is currently an associate professor. His re-search interests include analysis and design of parallel anddistributed algorithms and software process improvementin small organizations.