A Self-stabilizing Algorithm for Bridge Finding

Embed Size (px)

Citation preview

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    1/7

    Distrib. Comput. (1999) 12: 4753

    c Springer-Verlag 1999

    A self-stabilizing algorithm for bridge ndingMehmet Hakan Karaata, Pranay Chaudhuri

    Department of Electrical and Computer Engineering, Kuwait University, P.O. Box 5969 Safat-13060 Kuwait, (e-mail: {karaata, pranay }@eng.kuniv.edu.kw)

    Received: July 1997 / Accepted: January 1999

    Summary. A self-stabilizing algorithm is presented in thispaper that nds the bridges of a connected undirected graphon a distributed or network model of computation afterO (|E |n 2) moves. The algorithm is resilient to transient faultsand does not require initialization. In addition, a correctnessproof of the algorithm is provided. The paper concludes withremarks on the time complexity of the algorithm.

    Key words: Biconnected components Bridge Distributedsystems Self-stabilization

    1 Introduction

    Consider a connected undirected graph G = (V, E ), whereV is the set of n nodes, and E is the set of e edges. With-out loss of generality, we assume V to be {1, 2, , n }. Anedge ( i, j ) E is a bridge of G if the removal of ( i, j )disconnects G . If the graph represents a communication net-work, then the existence of a bridge can become the potentialcause for failure or congestion in the network. Thus, fromthe fault tolerance point of view identication of the bridgesof a network, if any, is essential. The best sequential algo-rithm for the bridge nding problem, due to Tarjan [19], hastime complexity O (n + e). This problem has also been in-

    vestigated extensively in the context of parallel processing(see e. g., [3,16,20,21]. There also exists an efcient dis-tributed algorithm for bridge nding due to Chaudhuri [4].However, to the best of our knowledge, no self-stabilizingbridge nding algorithm is available in the literature.

    In this paper, we present a self-stabilizing distributed al-gorithm for the bridge nding problem. The proposed algo-rithm, referred to as SBF, can withstand transient failures .We view a fault that perturbs the state of the system butnot the program as a transient fault. The algorithm makesO (|E |n 2) moves to identify all the bridges in a graph. Wealso expressed the time complexity of the algorithm in termsof rounds as O (|E |d), where d n 1 is the diameter of the graph.

    A desirable property of fault tolerant distributed systemsis the property of self-stabilization. A self-stabilizing system

    guarantees that, regardless of the current conguration, thesystem reaches a legal state in a bounded number of stepsand the system state remains legal thereafter. Straightforwardadaptation of any of the existing parallel or distributed algo-rithms for the bridge nding problem to the self-stabilizingversion of the algorithm seem to be difcult, since the self-stabilizing algorithms are inherently fault tolerant and haveto satisfy additional properties.

    Since the introduction of self-stabilization in distributedsystems by Dijkstra [5], self-stabilizing algorithms for manyfundamental problems in distributed systems have been pro-posed. For example, self-stabilizing mutual exclusion algo-rithms for various classes of networks have been presentedin [2, 6, 9, 12, 14]; self-stabilizing algorithms for electing aleader appear in [7, 10, 15]; self-stabilizing algorithms forgraph coloring are presented in [8, 18]; general techniquesfor constructing self-stabilizing algorithms are dealt within [1, 13]. These algorithms are tolerant to transient fail-ures. A detailed survey on self-stabilization is available dueto Schneider [17].

    The paper is organized as follows. In Section 2, wepresent our model of computation. Section 3 contains somedenitions and provides the basis of the algorithm. Section4 presents the self-stabilizing bridge nding algorithm. InSection 5, we provide the correctness proof of the proposedalgorithm. Section 5 also presents a proof of the time com-plexity bound and a discussion on fairness issues related

    to the algorithm. We conclude the paper in Section 6 withfurther remarks on related issues such as time complexity.

    2 Computational model

    Let G = (V, E ) be an arbitrary graph with vertex set V andedge set E , where |V | = n . We assume that each vertexof G is a process, also called node. Each node maintains aset of local variables whose values can be updated by thenode after inspecting its own local variables and the localvariables of its neighbors. The program of a node i can beexpressed as

    [G [1] M [1] G [2] M [2] . . . G [k] M [k]],where

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    2/7

    48 M.H. Karaata, P. Chaudhuri

    each guard G [ ] is a boolean function of the variablesof node i and the variables of its neighboring nodes;

    each move M [ ] updates the variables of node i ; and *[S ] corresponds to the repeated execution of the state-

    ment S until all guards are false.

    Note that each move denotes an atomic action. If a guardof node i evaluates to true, we say that the guard and node iare enabled. Furthermore, if two or more guards of the samenode or of different nodes are enabled at the same time,then the scheduler arbitrarily selects a subset of the enabledguards and allows the execution of the corresponding movesto be completed. In the case of the central scheduler , the sizeof the subset is one and the execution of a move is completedbefore any guard is reevaluated; whereas in the case of thedistributed scheduler , the size of the set is arbitrary.

    We assume that the scheduler is weakly fair. That is, if a guard is enabled and remains enabled, it eventually makesa move. We make this assumption for the sake of simplify-

    ing the proofs. As we show later, SBF algorithm is correctwithout any fairness assumption.The state of a node is composed of the set of variables

    at the node. The system state is the cartesian product of thestates of the nodes in the system. A state of the system isan element of the state space. The system state before thesystem is started is referred to as the initial state .

    3 Basis of the algorithm

    The self-stabilizing bridge nding algorithm is based on twoimportant observations. These are presented in the form of the following lemmas, whose proofs are straightforward andhence omitted.

    Lemma 1 Let G = (V, E ) be a connected undirected graphand T (r ) = (V, E ) be any spanning tree of G rooted at noder V . If (i, j ) E is a bridge of G then (i, j ) E , i. e.,either j is a child of i or i is a child of j in T (r ).

    A node i is said to be the child of another node j , withrespect to a spanning tree T (r ), if j is the immediate prede-cessor of i in T (r ); alternatively j is said to be the parentof i . For each node i V , f (i) denotes the parent of nodei in T .

    The following lemma states a fundamental property of bridges of a graph.

    Lemma 2 Let G = (V, E ) be a connected undirected graphand T be any spanning rooted tree in G . Also, let (i, j ) beany edge in T where i is the parent of j . Edge (i, j ) is not abridge in G iff G has an edge (u, v ) not in T where u is adescendant of an ancestor of i (i inclusive) but not j and vis a descendent of j ( j inclusive).

    For a pair of nodes i and j in a rooted tree T (r ) = (V, E ),the collection of nodes CA (i, j ) is dened to be the set of common ancestors if and only if x CA (i, j ) is an ancestorof both i and j . It is obvious that the root of the tree r CA (i, j ). A common ancestor v of a pair of nodes i and j in arooted tree T (r ) is dened to be the lowest common ancestor if and only if every common ancestor v CA (i, j ) { v}of i and j is an ancestor of v. That is, node v is the lowest

    common ancestor of a pair of nodes i , and j , if v is theancestor of both i and j with the lowest height in T .

    Notice that an edge of G is a bridge if it belongs to aspanning tree of G and does not satisfy the property denedin Lemma 2. The algorithm assumes that a spanning tree of the given graph G = (V, E ) is available. For this purpose,we assume that the breath-rst search (BFS) spanning treeof G , rooted at r V , is rst obtained by applying theself-stabilizing BFS algorithm described in [11].

    Prior to formally describing the SBF algorithm, we rstpresent the basis of the algorithm. We assume that theself-stabilizing BFS algorithm and the bridge nding al-gorithm run concurrently, however before the BFS tree isconstructed, the moves made by the bridge nding algo-rithm may not guarantee any progress. Upon termination of the BFS algorithm, bridge nding algorithm identies thebridges using the BFS tree. We are not presenting the self-stabilizing BFS algorithm, since it can be adopted from [11].In the rest of this paper, we assume the presence of BFSspanning tree T = (V, E ), where E E constructed bythe self-stabilizing BFS algorithm as mentioned above.

    We now describe our approach implemented by the SBFalgorithm to identify bridges of G . We associate a uniqueid with each edge and node in G . In addition, each nodalprocess contains a variable s called s -set of process i anddenoted by s (i) containing a set of edge ids. We know thateach non-tree edge ( i, j ) E and edges on paths v, , iand v, , j in T , referred to as branches of node v, wherev is the lowest common ancestor of i and j , form a cycle.Hence, none of the tree edges on these two paths can be abridge. The bridge nding algorithm identies these edgesas follows. When a node discovers that it is incident on a

    non-tree edge x = (i, j ), it includes the edge id x in its s -set.Then, each ancestor node on the branches connected by edge(i, j ) includes the edge id in its s -set when it nds the edgeid (i, j ) in the s -set of its child. Eventually, in a bottom upfashion all these nodes on these branches contain the edgeid x in their s -sets. After this process is completed, upontermination of the algorithm, a tree edge ( i, j ) is identiedas a bridge if sets s (i) and s ( j ) do not contain any commonelements.

    The above discussion on our approach to detect bridgesdoes not include the details that make the algorithm dis-tributed and self-stabilizing. We now describe these issues.

    As mentioned earlier, upon discovering a non-tree edge

    x = (i, j ), nodes i and j include the edge id in their s -sets. Then, node is parent p includes x in its set and thennode ps parent includes x in its s -set, and so on. Similarly, j s ancestors include x in their s -sets. We know that thispropagation needs to stop at the lowest common ancestor vof nodes i and j . If both the propagation reach node v atthe same time, since node v nds x in the s -sets of exactlytwo of its children, it can determine that it is the lowestcommon ancestor of i and j and prevent the propagationof x to continue to its ancestors. For that purpose, node vincludes {x} in its s -set instead of x to indicate that it is thelowest common ancestor of nodes i and j and stops upwardpropagation of edge id x . When vs parent nds {x} in the s -set of node v, it does not include x in its s -set and the upwardpropagation stops at node v. However, since the propagationin two branches of v are not synchronized, one propagation

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    3/7

    A self-stabilizing algorithm for bridge nding 49

    Fig. 1. The state of a system after termination

    may reach node v rst and continue further up. Eventually,when both propagations reach node v, node v includes {x}in its s -set, indicating that node v is the lowest commonancestor of nodes i and j , and removes x from its s -set.Consecutively, after discovering that their childrens s -setsdo not include edge id x , the ancestors of node v removeedge id x from their s -sets. Note the difference betweens (v) = {(i, j )} and s (v) = {{(i, j )}}. The former indicatesthat ( i, j ) is a non-tree edge and node v is in the cycle

    produced by edge ( i, j ) when added to the correspondingspanning tree. Whereas, the latter indicates that node v isthe lowest common ancestor of nodes i and j .

    The above concepts are illustrated with the help of anexample in Figure 1. In the gure, a BFS tree rooted atnode 1 is shown where each tree edge is shown by solidlines and each non-tree edge is shown by dashed lines. Thegraph contains two non-tree edges, namely (3 , 4) and (6 , 7).Notice that the s -set of each ancestor of nodes 3 and 4up to their lowest common ancestor contains (3 , 4). Sincenode 1 is the lowest common ancestor of nodes 3 and 4,its s -set contains {(3, 4)}. Similarly, since node 5 is thelowest common ancestor of nodes 6 and 7, its s -set contains{(6 , 7)}. Also, notice that the only bridge in the graph isedge (4 , 5) and s -sets of nodes 4 and 5 do not contain anyelement in common indicating that edge (4 , 5) is a bridge. Itis easy to see that for every other pairs of nodes ( i, j ) suchthat ( i, j ) E contain a common element in their s -sets.(We say that two nodes contain a common element x wheneither both the nodes contain x or one contains x and theother contains {x})

    4 Self-stabilizing bridge nding algorithm

    This section presents the self-stabilizing bridge nding al-gorithm implementing the strategy described above.

    The self-stabilizing bridge nding algorithm is given inFig. 2.

    Node i

    VARIABLE s (i ) : a subset of elements of the form x and {x}where x is an edge in G

    PARAMETER x : an edge in G

    ACTIONS

    ((incident.x one.x ) ( incident.x one.x ))(x s (i )) s (i ) = s (i ) {{ x } } {x }

    two.x ({x } s (i )) s (i ) = s (i ) { x }{ { x }}( incident.x one.x ) (x s (i )) s (i ) = s (i ) { x }( incident.x one.x ) two.x ({x } s (i )) s (i ) = s (i ) {{ x }}where

    incident.x : x is a non-tree edge incident on node ione.x : x is in the s -set of exactly one child of i in the treetwo.x : x is in the s -sets of exactly two children of node i

    Fig. 2. The self-stabilizing bridge nding algorithm (SBF Algorithm)

    Throughout the paper, we refer to the rst guard of thealgorithm as G1, the second guard as G2, and so on. Upondiscovering a non-tree edge x = (i, j ) incident on them,nodes i and j include the edge id in their s -sets, see G1.Then, each node k on branches i, , v propagates x upby including it in its s -set when it nds exactly one of itschildren with x in its s -set. Notice that this propagation isalso implemented by G1 of the bridge nding algorithm.During this process each node on these branches includes

    x in its s -set. When both propagations reach node v, nodev includes {x} in its s -set and removes x from its s -set if it is previously included in s (v), see G2. Absence of edgeid x in s (v) initiates the removal of x from the s -sets of itsancestors, and eventually, all the ancestors of node v removex from their s -sets, see G3. This is necessary because onepropagation may reach node v rst and continue further up.In addition, for each node k in G , Guard G4 removes {(i, j )}from s (k) if k is not the lowest common ancestor of nodesi and j .

    Thus far, we have presented an algorithm that sets s -values for each node. Note that since the information aboutthe bridges in the system is implicitly maintained in s -sets of nodes in a distributed manner, therefore, we do not explicitlyidentify the bridges. Based on the s -values of itself and s -values of its neighbors, each node i can determine whetheredge x = (i, j ) incident on it is a bridge edge or not asfollows. If edge ( i, j ) is a tree edge and both s (i) and s ( j )do not contain either ( p,q) or {( p,q)}, where ( p,q) is anarbitrary non-tree edge in G , then edge ( i, j ) is a bridge.

    5 Correctness

    5.1 Partial correctness

    Let x = (i, j ) be an arbitrary non-tree edge of G . Also, letv be the lowest common ancestor of nodes i and j . Let thepaths v, , i and v, , j be called B i and B j . It is easy

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    4/7

    50 M.H. Karaata, P. Chaudhuri

    to see that B i and B j form a cycle along with edge ( i, j ) inG . Therefore, no edge on paths B i and B j is a bridge.

    The following lemmas establish the partial correctnessof our algorithm.

    Lemma 3 If algorithm SBF terminates, after termination the following holds. For every node k in G , {(i, j )} s (k) iff node k is the lowest common ancestor of nodes i and j , and (i, j ) E E .

    Proof First, we show that if s (k) contains {x} = {(i, j )},then node k is the lowest common ancestor of nodes i and j . Suppose that s (k) contains {x}, however, node k is notthe lowest common ancestor of nodes i and j . Recall that allthe guards are disabled since the algorithm has terminated.If {x} remains in s (k), then exactly two children of nodek , nodes u and w contain x in their s -sets, since guard G4is disabled for node k . First, notice that nodes i and j mayhave either the same depth or their depths differ by one as

    edge ( i, j ) is a non-tree edge with respect to a BFS spanningtree of G . In order for edge x to be in the s -sets of nodesu and w one of the following must hold. Without loss of generality,

    u = i and w = j , u = i and node w has a child c containing x in its s -set

    and c = j , or each node, u and w, has a child containing x in its s -set.

    In the rst two cases, i.e., if u = i and w = j , or u = iand c = j , then node k is the lowest common ancestor of nodes i and j . This is a contradiction. Then, the third casemust hold. That is, nodes u and w have children u 1 and w1

    containing x in their s -sets. Similarly, nodes u 1 and w1 musthave two children u 2 and w2 containing x in their s -sets bythe same argument given above and so on. However, sincethe graph is nite and descendant relationship is acyclic,for each pair of nodes u l and wl we cannot have a pair of children containing x in their s -sets. This is a contradiction.Thus, node k is the lowest common ancestor of nodes i and j . In addition, it is easy to see that if {(i, j )} s (k), then(i, j ) E E

    We now show that after termination, if node k is thelowest common ancestor of nodes i and j , then s (k) contains{x} = {(i, j )}. According to Algorithm SBF, node i incidenton a non-tree edge x = (i, j ) includes x in its s -set s (i) since

    guard G1 is disabled for node i . Similarly, node j includesx in its s -set, s ( j ). Since s (i) includes x , if the parent of node i , denoted by f (i), is not the lowest common ancestorof nodes i and j , it includes x in its s -set since guard G1 isdisabled for node k . Analogously, the parent of f (i) includesx in its s -set, and so on. Similarly, ancestors of node j up tonode k include x in their s -sets. It is easy to see that sincetwo children of node k include x in their s -sets and G2 isdisabled for node k , node k , the lowest common ancestorof nodes i and j , includes {x} in s (k). Hence, the proof follows.

    Lemma 4 If algorithm SBF terminates, after termination the following holds. For every node k in V , (i, j ) s (k) iff nodek is on path B i or B j , node k is not the lowest commonancestor of nodes i and j , and (i, j ) E E .

    Proof We rst show that for an arbitrary node k V , if s (k) contains x = (i, j ), then node k is on path B i or B j ,and node k is not the lowest common ancestor of nodes iand j . Assume that if s (k) contains x = (i, j ), then nodek is not on path B i or B j . Since guard G3 disabled fornode k and ( i, j ) s (k), we know that either edge ( i, j )is incident on node k or for only a single child c of nodek , s (c) contains edge ( i, j ). Now, we consider each one of these cases separately.

    Case 1. Edge x is incident on node k .Then, k is on path B i or B j . This is a contradiction

    Case 2. Edge x is not incident on node k and for only asingle child c of node k , s (c) includes edge ( i, j ).

    Let the descendants of node k , v1 , v2 , v3 , , v t be suchthat k = f (v1 ) and vi = f (vi +1 ), where 1 i < t , t 1and node vt is the descendant of node k with the lowestheight that contains x in its s -set. We know that node vtis incident on edge x since guard G3 is disabled for nodevt . Consequently, nodes v1 , v2 , v3 , , vt contain x in theirs -sets since for all of them guard G3 is disabled. Notice thatvt = i or vt = j holds and path v1 , v2 , v3 , , vt belongs topaths B i or B j . Hence, we have that for an arbitrary nodek V , if s (k) contains x = (i, j ), then node k is on path B ior B j .

    Suppose that s (k) contains x = (i, j ) and node k isthe lowest common ancestor of nodes i and j . Then byLemma 3, we have that {(i, j )} s (k). Consecutively,{(i, j )}, (i, j ) s (k) and either G3 or G4 is enabled fornode k .

    This is a contradiction. Hence, if x = (i, j ) s (k), thennode k is not the lowest common ancestor of nodes i and

    j . Note that it can also readily be seen that if ( i, j ) s (k),then ( i, j ) E E .To complete the proof, we need to also show that for an

    arbitrary node k V , if node k is on path B i or B j , nodek is not the lowest common ancestor of nodes i and j and(i, j ) E E , then s (k) contains ( i, j ). The proof of theabove claim is similar to the proof of the previous claims inthe proof, hence is omitted.

    The following lemma establishing the partial correctnessof the algorithm follows from Lemma 1, 2, 3, and 4.

    Lemma 5 (Partial Correctness) After termination, tree edge( p,q) is a bridge iff both s ( p) and s (q) do not include either

    x = (i, j ) or {(i, j )} , where (i, j ) is a non-tree edge in G .

    5.2 Algorithm complexity and termination

    In this section, we present the worst case time complexityor the upper bound of the SBF algorithm.

    We rst classify the moves of the algorithm into twocategories called initial moves and non-initial moves . Theinitial moves are the ones that are caused by arbitrary ini-tialization and the non-initial moves are the ones that arecaused by other moves in the system. We know that eachmove by node i causes an element x to be included in s (i)or removed from s (i). We also know that if x E is addedto s (i), x is either a non-tree edge incident on i or it is an el-ement of the s -set of a descendant of node i . Edge id x E

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    5/7

    A self-stabilizing algorithm for bridge nding 51

    is referred to as an initial edge id with respect to s (i) if ithas been in s (i) since the start of the system. Otherwise, itis referred to as non-initial edge id. A move that includesedge id x in s (i) is referred to as an initial move if

    x is incident on node i , or

    x is an initial edge id with respect to the s -set of a childof node i .

    In addition, a move that removes edge id x from s (i) isreferred to as an initial move , if x is not contained in thes -set of any child of node i since the start of the system.Otherwise, the move is referred to as a non-initial move.

    Now, we show that the algorithm terminates afterO (|E |n 2) moves. We rst show the upper bounds on thenumber of initial moves.

    Lemma 6 The total number of initial moves is O (|E |n ).

    Proof Let i be an arbitrary node and x an arbitrary edge

    id. We rst show that edge id x cannot be included in s (i)twice by initial moves. It is easy to see that if x s (i),and x s ( j ) for a child j of i and x is an initial edge idwith respect to s ( j ) or edge x is incident on i , then node imay include x in s (i) by making an initial move, see G1.We know that in order for x to be included in s (i) for thesecond time, x needs to be removed from s (i) after it isincluded by an initial move for the rst time, see G1. First,observe that if edge x is incident on i , x cannot be removedfrom s (i). Also, observe that before x is removed from s (i),between the two initial moves, a state is reached in whichx s ( j ) for all children j of i , see G3. Then, by denitionof initial edge ids, we have that after reaching such a stateno child of i contains initial edge id x in its s -set. Thus,node i cannot make a second initial move to include x ins (i).

    It can easily be shown that an initial move including x ins (i) cannot be followed by another initial move removing xfrom s (i) using a similar line of argument. Similarly, it canreadily be observed that an initial move removing x froms (i) cannot be followed by another initial move including xin s (i) by the denition of initial move, also see G1 and G3.In addition, observe that after node i removes x from s (i)once by an initial move, it cannot remove x from s (i) againby another initial move by the denition of initial move, alsosee G1 and G3. Therefore, each edge id can be included inan s -set or removed from an s -set at most once by an initialmove. Hence, the proof follows.

    An execution in a distributed system can be describedas a sequence of moves M 1 , M 2 , where M j is a movemade by a node in the system. Consider a move M k by anarbitrary node i . We identify a unique child j of node i anda unique move M l where l < k , by node j to be the causeof move M k dened as follows.

    Dene cause () for initial moves

    cause (M k ) = M k if M k is an initial move by node i .

    Dene cause () for non-initial moves including edge idx in s (i)

    cause (M k ) = M l if M l is the last move made by a childof node i that included x in its s -set.

    Analogously, dene cause () for non-initial moves re-moving edge id x from s (i)

    cause (M k ) = M l if M l is the last move made by a childof node i that removed x from its s -set.

    We now state two useful properties related to the functioncause (). The rst property is that distinct moves by a nodehave distinct causes.

    Proposition 7 If M p and M q are distinct moves by node ithen

    cause (M p ) = cause (M q ).

    The next property that we establish is that the causerelationship is acyclic and the cause of a move by node iis always another move by a child of node i . The followingproposition follows from the fact that each node only readsits childrens variables to evaluate its guards, see AlgorithmSBF in Figure 2.

    Proposition 8 Let M k be a move by node i . If M k is not theinitial move by node i , then the move cause (M k ) is made bya child of node i .

    Now, based on the denition of cause () we dene thenotion of the source of a move. We then show that distinctmoves have distinct sources and use that to prove an upperbound on the total number of moves made by all the nodesin the system.

    For each move M k dene

    source (M k ) =M k if M k is an initial movesource (cause (M k )) if M k is a non-initial move

    Intuitively, source (M k ) can be thought of as an initialmove that causes M k through a chain of moves.The following proposition states a useful property of

    sources of moves. The proof of this proposition immedi-ately follows from Proposition 7 and Proposition 8, henceomitted.

    Proposition 9 The source of each move of Algorithm SBF isa distinct initial move.

    The following lemma establishes the termination of thealgorithm.

    Lemma 10 (Termination) Algorithm SBF terminates inO (|E |n 2 ) moves.

    Proof The proof follows from Lemma 6 and Proposition 9.

    As a consequence of Lemma 5 and Lemma 10, we nowestablish the total correctness of our algorithm.

    Lemma 11 (Total Correctness) Algorithm SBF identies allbridges of G after O (|E |n 2) moves.

    We now provide the round complexity of our algorithm.A round refers to a minimum execution sequence in whicheach enabled action is taken at least once. The followinglemma shows the round complexity of our algorithm.

    Lemma 12 Algorithm SBF terminates after O (d|E |) rounds,where d n 1 is the diameter of G .

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    6/7

    52 M.H. Karaata, P. Chaudhuri

    Proof It can readily be observed that after O (|E |) rounds,the edge id of each non-tree edge is included in the s -set of the nodes on which it is incident.

    Now, in each O (|E |) rounds of the algorithm, these non-tree edge ids included in various s -sets are guaranteed topropagate one level closer to the root. Since d is the diam-eter of the graph, the distance of the farthest node from theroot is no more than d. Therefore, after O (d|E |) rounds thealgorithm terminates.

    Now, we show that algorithm SBF is self-stabilizing.Let P RE be a predicate dened over SY S , the set of

    global states of the system. An algorithm ALG running onSY S is said to be self-stabilizing with respect to P RE if itsatises:

    Closure: If a global state q satises P RE , then any globalstate that is reachable from q using algorithm ALG , alsosatises P RE .

    Convergence: Starting from an arbitrary global state, thedistributed system SY S is guaranteed to reach a global statesatisfying P RE in a nite number of steps of ALG .

    Global states satisfying P RE are said to be stable . Sim-ilarly, a global state that does not satisfy P RE is referredto as an instable state . To show that an algorithm is self-stabilizing with respect to P RE , we need to show the sat-isability of both closure and convergence conditions. Inaddition, to show that an algorithm solves a certain prob-lem, we need to either prove partial correctness or showthat through transitions made by the algorithm among stablestates the problem is solved.

    We now show that the algorithm SBF is self-stabilizing

    by establishing the convergence and the closure properties.Let P be a predicate dened as follows. For every nodek in G , (i, j ) s (k) iff node k is on path B i or B j and nodek is not the lowest common ancestor of nodes i and j , and{(i, j )} s (k) iff node k is the lowest common ancestor of nodes i and j

    By Lemma 3, Lemma 4 and Lemma 10, we know thatpredicate P is eventually satised establishing the conver-gence property. In addition, by Lemma 10, we know thatwhen predicate P is satised, no guard is enabled. There-fore, the closure property is trivially satised. Hence, thealgorithm SBF is self-stabilizing.

    From the above discussion, Lemma 5 and Lemma 10,we have the following theorem.

    Theorem 13 Algorithm SBF is self-stabilizing and it identi- es all bridges after O (|E |n 2) moves.

    We presented algorithm SBF under the weak fairnessassumption. The following theorem shows that algorithmSBF is correct without this fairness assumption.

    Theorem 14 Algorithm SBF is correct without any fairnessassumption.

    Proof Suppose that there exits a guard which remains en-abled but the corresponding move is never made. Then, theexecution must continue with other enabled guards. Noticethat each move by an arbitrary node i , disables its guard andmay only enable a guard of node f (i), parent of node i . As

    a consequence, since the graph does not contain any cycle,the number of moves in the system is nite. Therefore, theenabled guard eventually remains as the only enabled guardin the system and the corresponding move is made. Hence,the proof follows.

    6 Conclusions

    We assumed that our algorithm and the algorithm that con-structs a BFS tree (BFS algorithm) execute concurrently andSBF algorithm can guarantee progress only after the BFSalgorithm terminates. However, for the sake of brevity wegave the algorithm complexity of the SBF algorithm assum-ing that the BFS algorithm has already been terminated. Itis easy to see that the loose worst case complexity of thecombined algorithm is the product of the complexities of theindividual algorithms. It is an open problem to nd the tighttime complexity bound for the combined algorithm.

    On a distributed or network model of computation, wehave presented a self-stabilizing algorithm that identies theset of bridges in a connected undirected graph. We assumedthat algorithm BFS of [11] is used to compute initially theBFS spanning tree T of G. Algorithm SBF assumes thatevery node knows only about its neighbor node numbers.Therefore, starting only with the neighbor information toeach node of G, it is possible to nd the bridges of G afterO (|E |n 2 ) moves or O (|E |d) rounds. We showed that theproposed algorithm is correct and it works with an unfairscheduler.

    Acknowledgements. We would like to thank the anonymous referees fortheir suggestions and constructive comments on an earlier version of thepaper. Their suggestions have greatly enhanced the readability of the paper.

    References

    1. Awerbuch B, Varghese G: Distributed program checking: A paradigmfor building self-stabilizing distributed protocols. 31st Annual IEEESymposium on Foundations of Computer Science, 1991, pp. 258267

    2. Burns JE, Pachl J: Uniform self-stabilizing rings. ACM Transactionson Programming Languages and Systems 11:330344 (1989)

    3. Chaudhuri P: Parallel Algorithms: Design and Analysis. Sydney:Prentice-Hall 1992

    4. Chaudhuri P: An efcient distributed bridge-nding algorithm. Infor-mation Sciences 81:7385 (1994)

    5. Dijkstra EW: Self-stabilizing systems in spite of distributed control.EWD 391, In Selected Writings on Computing: A Personal Perspective,1973, pp. 4146

    6. Dijkstra EW: Some beautiful arguments using mathematical induction.Acta Informatica 13:18 (1980)

    7. Dolev S, Israeli A, Moran S: Self-stabilization of dynamic systemsassuming only read/write atomicity. 9th Annual ACM Symposium onPrinciples of Distributed Computing, 1990, pp. 103118

    8. Ghosh S, Karaata MH: A self-stabilizing algorithm for coloring planargraphs. Distrib Comput 7:5559 (1993)

    9. Herman T: Probabilistic self-stabilization. Inform Process Lett 35:6367 (1990)

    10. Huang ST: Leader election in uniform rings. ACM Transactions onProgramming Language Systems 15:563573 (1993)

    11. Huang ST, Chen NS: A self-stabilizing algorithm for constructingbreadth-rst trees. Inform Process Lett 41:109117 (1992)

    12. Israeli A, Jalfon M: Token management schemes and random walksyield self-stabilizing mutual exclusion. 9th Annual ACM Symposiumon Principles of Distributed Computing, 1990, pp. 119132

  • 8/8/2019 A Self-stabilizing Algorithm for Bridge Finding

    7/7

    A self-stabilizing algorithm for bridge nding 53

    13. Katz S, Perry KJ: Self-stabilizing extensions for message passing sys-tems. 9th Annual ACM Symposium on Principles of Distributed Com-puting, 1990, pp. 91101

    14. Kruijer HSM: Self-stabilization (in spite of distributed control) in tree-structured systems. Inform Process Lett 8:9195 (1979)

    15. Lin X, Ghosh S: Self-stabilizing maxima nding. In Proceedings of the 28th Annual Allerton Conference, 1991, pp. 662671

    16. Savage C, Ja JJ: Fast, efcient parallel algorithms for some graphproblems. SIAM J Comput 10:682691 (1981)

    17. Schneider M: Self-stabilization. ACM Comput Surv 25:4567 (1993)18. Sur S, Srimani PK: A self-stabilizing distributed algorithm for BFS

    spanning trees of a symmetric graph. Parallel Process Lett 2:171179(1992)

    19. Tarjan RE: Sorting using networks of stacks and queues. Journal of the ACM 19:341346 (1972)

    20. Tarjan RE, Vishkin U: An efcient parallel biconnectivity algorithm.TR-69, Ultracomputer Note-51, CoTR-69, Ultracomputer Note-51,Courant Institute of Mathematical Sciences, NY, 1983

    21. Tsin YH, Chin FY: Efcient parallel algorithms for class of graphtheoretic problems. SIAM J Comput 13:580599 (1984)

    Mehmet Hakan Karaata received his PhD degree in Computer Science in1995 from the University of Iowa. He joined Bilkent University, Ankara,Turkey as an Assistant Professor in 1995. He is currently working as anAssistant Professor in the Department of Electrical and Computer Engineer-ing, Kuwait University. His research interests include distributed systems,fault tolerant computing, self-stabilization and algorithm complexity.

    Pranay Chaudhuri received his BSc(Hons) and BTech(Electronics) fromCalcutta University. His ME and PhD both in Computer Science and Engi-neering came from Jadavpur University, Calcutta. At present he is an Asso-ciate Professor in the Department of Electrical and Computer Engineering,Kuwait University. Dr Chaudhuri has held faculty positions at the IndianInstitute of Technology, Kharagpur and the University of New South Wales,Australia prior to his joining the Kuwait University in February, 1993. DrChaudhuris research interests include Parallel and Distributed Algorithms,Graph Theory, and Distributed O/S. He is the author of over 40 researchpapers in these areas and a book entitled, Parallel Algorithms: Design and Analysis (Prentice Hall, 1992). Dr Chaudhuri is the recipient of severalinternational awards for his research contribution.