A self-stabilizing algorithm for the bridge-finding problem assuming
the distributed demon model
Tetz C. Huang
Ji-Cherng Lin
Department of Computer Science and Department of Computer Science and Engineering, Yuan-Ze University, Engineering, Yuan-Ze University, 135 Yuan-Tung Road, Chung-Li, 135 Yuan-Tung Road, Chung-Li,
Tao-Yuan 320, Taiwan Tao-Yuan 320, Taiwan
E-mail:[email protected] E-mail:[email protected]
Cheng-Pin Wang
Chih-Yuan Chen
Department of Computer Science and Department of Computer Science and Engineering, Yuan-Ze University, Information Engineering, Nanya Institute 135 Yuan-Tung Road, Chung-Li, of Technology, 414, Sec. 3, Chung-Shan
Tao-Yuan 320, Taiwan East Road, Chung-Li, Tao-Yuan 320, Taiwan E-mail:[email protected] E-mail:[email protected]
Abstract
A bridge is an edge whose deletion causes a distributed system to become disconnected. Thus bridges are edges critical to distributed system reliability. In this paper, we propose a self-stabilizing algorithm that can find all bridges in a distributed system. Under the as-sumption that a BFS tree have been constructed in the system, our algorithm is self-stabilizing not only un-der the central demon model but also unun-der the more general distributed demon model. The worst-case sta-bilization time of our algorithm under the distributed demon model is at most n2steps, where n is the
num-ber of nodes in the system.
Keywords: Self-stabilizing algorithm, Bridge finding prob-lem, Distributed demon model.
1
Introduction
A distributed system consists of a set of loosely con-nected processors that do not share a global memory. It is usually modelled by a connected simple undirected graph G = (V, E), with each node x ∈ V representing a processor in the system and each edge {x, y} ∈ E representing the link connecting processors x and y. In the rest of this paper, the terms node and processor will be used interchangeably. In any distributed sys-tem considered in this paper, each processor has a set of shared registers (registers for short). For each
reg-ister rx in a processor x, only x can write values into
it and only x and its neighbors can read values of it. Each processor is equipped with a local algorithm that consists of one or more rules of the form:
condition part → action part.
The condition part (or guard ) is a Boolean expression of registers of the processor and its neighbors, and the action part is an assignment of values to some reg-isters of the processor. If the condition part of one or more rules in a processor is evaluated as true, we say that the processor is privileged to execute the ac-tion part of any of these rules (or privileged to make a move). The local algorithms of all processors in a distributed system constitute a distributed algorithm. The local state of a processor is specified by the val-ues of all its shared registers. The local states of all processors in the system constitute a global configura-tion (configuraconfigura-tion for short) of the system. Normally, a distributed algorithm is designed to solve a specific problem such as the shortest path problem, the mutual exclusion problem, etc. According to the problem to be solved, legitimate configurations are defined in such a way that if the system is in a legitimate configuration, the solution of the problem can be seen.
1.1
The computational models
The central demon model was first introduced by Dijk-stra [4] in 1974. Under this computational model, if the system starts with a configuration in which no node in
the system is privileged, then the system is deadlocked. Otherwise, the central demon in the system will ran-domly select exactly one privileged processor and ex-actly one rule in the processor, and let the selected processor execute the action part of the selected rule. The local state of the activated processor thus changes, which in the meantime results in the change of the con-figuration of the system. The system will then repeat the above process to change configurations as long as it does not encounter any deadlock situation. Thus the behavior of the system under the action of the algo-rithm can be described by executions. An infinite or finite sequence of configurations Γ = (γ1, γ2, . . .) of a
distributed system is called an execution (of the algo-rithm in the system) under the central demon model if for any i ≥ 1, γi+1 is obtained from γi after
ex-actly one processor in the system makes the ith
move γi→ γi+1, and in the case that Γ is finite, it is further
required that no node is privileged in the last configu-ration. An algorithm is defined to be self-stabilizing if every execution of the algorithm has a suffix in which all configurations are legitimate. (Note that although this definition of self-stabilizing algorithms is not suffi-cient for some cases such as the self-stabilization with respect to the mutual exclusion problem, it does ap-ply to most cases, including the self-stabilization with respect to the bridge-finding problem to be studied in this paper.)
The more general distributed demon model was later considered by Burns [1] in 1987. The difference be-tween the central demon model and the distributed demon model is the number of processors that join in the execution of each atomic step of the system. Under the central demon model, exactly one privileged pro-cessor in the system is randomly selected by the central demon to execute its local algorithm in an atomic step. Under the distributed demon model, however, an ar-bitrary number of privileged processors are randomly selected by the distributed demon to execute their lo-cal algorithms simultaneously in an atomic step. In the case of distributed demon model, an atomic step of the system will also be called a system move in this paper. For each of the processors activated by the distributed demon to execute rules in a system move, we say that it joins in the system move. Under the distributed demon model, the behavior of the system under the action of the algorithm can also be described by execu-tions. An infinite or finite sequence of configurations Γ = (γ1, γ2, . . .) of a distributed system is called an
execution (of the algorithm in the system) under the distributed demon model if for any i ≥ 1, γi+1 is
ob-tained from γiafter a certain number of privileged
pro-cessors selected by the distributed demon collectively make the ith
system move γi → γi+1, and in the case
that Γ is finite, it is further required that no node is privileged in the last configuration. The definition for an algorithm to be self-stabilizing under the distributed demon model is the same as under the central demon model. Since “selecting an arbitrary number of privi-leged processors” includes “selecting exactly one priv-ileged processor” as a special case, if a system is self-stabilizing under the distributed demon model, then it is self-stabilizing under the central demon model. However, the converse, as is well-known, is not true.
1.2
Self-stabilizing bridge-finding
algo-rithms
Three self-stabilizing bridge-finding algorithms have been proposed in the past: the SBF Algorithm in Karaata and Chaudhuri [5], the phase I part of Al-gorithm A in Chaudhuri [2], and AlAl-gorithm UNNS in Devismes [3].
In [5], under the assumption that a BFS tree has been constructed in a distributed system, Theorem 13 claims that the SBF Algorithm is a self-stabilizing bridge-finding algorithm under the weakly fair demon model, and Theorem 14 further claims that the SBF Algorithm is self-stabilizing under the (non-fair) cen-tral demon model. After a BFS tree has been con-structed in the system, the SBF algorithm in [5] re-quires O(n2|E|) steps to stabilize under the central
demon model, where n and |E| are the number of nodes and the number of edges in the system, respectively.
Under the assumption that a DFS tree has been con-structed in a distributed system, Lemma 4.17 in [2] and Lemma 2 in [3] show, respectively, that the phase I part of Algorithm A and Algorithm UNNS are self-stabilizing bridge-finding algorithms under the central demon model. After a DFS tree has been constructed, both of these two self-stabilizing bridge-finding algo-rithms require O(n2) to stabilize under the central
de-mon model.
As mentioned above, all the existing self-stabilizing bridge-finding algorithms work under the central de-mon model. However, to the best of our knowledge, no self-stabilizing bridge-finding algorithm under the distributed demon model have been proposed in the past.
1.3
Our contributions
In this paper, we propose a self-stabilizing algorithm that can find all bridges in a distributed system. Un-der the assumption that a BFS tree has been con-structed in the system, our algorithm is self-stabilizing not only under the central demon model but also under the more general distributed demon model. Assuming
that a BFS tree has been constructed, we have also computed the worst-case stabilization time of the al-gorithm under the distributed demon model, which is at most n2 steps, where n is the number of nodes in
the system.
1.4
Organization of this paper
The rest of this paper is organized as follows: In Sec-tion 2, our algorithm is presented, and the meaning of legitimate configurations is clarified - explicitly, it is shown that in any legitimate configuration, all bridges can be identified. In Section 3, a proof is given to show that the proposed algorithm is self-stabilizing un-der the distributed demon model. Moreover, assum-ing that a BFS tree has been constructed, the worst-case stabilization time under the distributed demon model is computed. Section 4 are some concluding remarks concerning a self-stabilizing bridge-finding al-gorithm that works without assuming the presence of any rooted tree.
2
The proposed algorithm and
the legitimate configuration
In this section, our self-stabilizing algorithm for solving the bridge-finding problem will be presented. The distributed system in consideration has a general underlying topology, and can be modelled by a con-nected simple undirected graph G = (V, E), with each node x ∈ V representing a processor in the system and each edge {x, y} ∈ E representing the bidirectional link connecting processors x and y. It is assumed that (1) each node in the system has a unique identity and
there is a special node r in the system,
(2) a BFS spanning tree (namely, BF SG) of G, rooted
at r, has been constructed,
(3) each node x in the system maintains a shared register bx,
(4) N (x) denotes the set of all neighbors of x, and (5) the value of bxis taken from the power set of
E ∪ E, where E = {α | α ∈ E} with α being the simplified expression for the singleton {α}.
For any node x, we define
E(x) = {{x, y} | y ∈ N (x)}, the set of all edges incident to x,
C(x) = {y ∈ N (x) | py= x}, the set of all children of
x in BF SG, where pxstands for the parent
of x in BF SG,
N T (x) = {{x, y} ∈ E | y /∈ C(x) ∧ x /∈ C(y)}, the set of all non-tree edges in G (i.e., edges not in
BF SG) that are incident to x,
One(x) = {α ∈ E | there is exactly one node u ∈ C(x) s.t. α ∈ bu},
T wo(x) = {α ∈ E | there are exactly two nodes u, v ∈ C(x) s.t. α ∈ bu∧ α ∈ bv}.
Algorithm 1 {For any node x}
R1 : (B1(x) 6= ∅ ∨ B2(x) 6= ∅ ∨ B3(x) 6= ∅ ∨ B4(x) 6= ∅)
→ bx:= [bx− (B1(x) ∪ B2(x) ∪ B3(x) ∪ B4(x))]∪
B1(x) ∪ B2(x).
Note that in the above algorithm,
B1(x) = {α ∈ E | ([α ∈ N T (x)] ∨ [α ∈ One(x) ∧ α /∈ E(x)]) ∧ α /∈ bx} B2(x) = {α ∈ E | α ∈ T wo(x) ∧ α /∈ E(x) ∧ α /∈ bx} B3(x) = {α ∈ E | α ∈ bx∧ α /∈ N T (x) ∧ α /∈ One(x)} B4(x) = {α ∈ E | α ∈ bx∧ α /∈ T wo(x)} Bi(x) = {α | α ∈ Bi(x)}, for i = 1, 2 and 4.
Legitimate configurations of Algorithm 1 are defined to be all those configurations in each of which no node in the system is privileged. Thus, when the system is in a legitimate configuration γ, for any node x in V , B1(x) = B2(x) = B3(x) = B4(x) = ∅. The concepts of
ancestor, descendant, common ancestor and the lowest common ancestor in BF SG are as usually defined.
Re-call that for any two nodes x and y, the lowest common ancestor of x and y exists and is unique, which we shall denote by lca(x, y). For any non-tree edge α = {u, v} in G, let Bu be the unique simple path in BF SG
con-necting u and lca(u, v) and Bv be the unique simple
path in BF SG connecting v and lca(u, v). Note that
the simple paths Buand Bvand the edge {u, v} forms
a cycle in G. Let τu,v denote this cycle.
In the following, some graph-theoretic concepts and properties needed in later discussion are listed. Let G = (V, E) be a simple connected graph. The removal of an edge {x, y} from G results in the subgraph G − {x, y} that consists of all nodes of G and all edges of G except {x, y}. An edge {x, y} in G is called a bridge in G if G−{x, y} is disconnected. The following properties are straightforward and hence the proofs are omitted.
Property 1 An edge α is a bridge in G if and only if α does not lie on any cycle in G.
Property 2 Suppose G′= (V, E′) is a BFS spanning
tree rooted at r of a simple connected graph G = (V, E). If {x, y} ∈ E − E′ (i.e., {x, y} is a non-tree edge), then
x is not a descendant of y and y is not a descendant of x in G′.
Property 3 Suppose G′ = (V, E′) is a rooted
span-ning tree for a simple connected graph G = (V, E) and {x, y} is an edge in E′ (i.e., {x, y} is a tree edge) with
y being the child of x. If {x, y} is not a bridge in G, then there exists an edge {u, v} in E − E′ (i.e., {u, v}
is a non-tree edge) such that u is not a descendant of y and v is a descendant of y in G′.
Lemma 1 Suppose the system is in a legitimate con-figuration γ. For any node x, if α ∈ bxor α ∈ bx in γ,
then α is a non-tree edge in G, i.e., α /∈ Eγ.
Proof. Suppose α is a tree edge in G.
Case 1. α ∈ bxin γ. Since B3(x) = ∅ in γ, α /∈ B3(x)
in γ and hence α ∈ One(x) in γ. Hence there exists a child x1of x in BF SG such that α ∈ bx1 in γ. By the
same token, there exists a child x2of x1in BF SGsuch
that α ∈ bx2 in γ. Arguing in this way, we eventually
get infinitely many nodes x, x1, x2, . . . in the system
such that xi+1 is a child of xi in BF SG for any i =
1, 2, . . .. However, this is absurd because BF SG is a
rooted tree with only a finite number of nodes. Case 2. α ∈ bxin γ. Since B4(x) = ∅ in γ, α /∈ B4(x)
in γ and hence α ∈ T wo(x) in γ. Hence there exist two children u and v of x in BF SG such that α ∈ bu
and α ∈ bv in γ. By the same argument as in Case 1
above, we will get a contradiction from the condition that α ∈ bu.
Therefore, α must be a non-tree edge in G.
Lemma 2 Suppose the system is in a legitimate con-figuration γ. Let α = {u, v} be a non-tree edge in G. If x is not an ancestor of either u or v in BF SG, then
α /∈ bx in γ.
Proof. Suppose α ∈ bx in γ. Since x is not an
ancestor of either u or v in BF SG, x 6= u and x 6= v.
Thus, α /∈ N T (x) in γ. Since B3(x) = ∅ in γ, we have
that α /∈ B3(x). Since [α /∈ N T (x)∧α ∈ bx∧α /∈ B3(x)
in γ], we have that α ∈ One(x) in γ. Hence there exists a child x1 of x such that α ∈ bx1 in γ. Since x
is not an ancestor of either u or v in BF SG and x1 is
a descendant of x, we have that x1 is not an ancestor
of either u or v in BF SG. By the same token, there
exists a child x2 of x1 in BF SG such that α ∈ bx2 in
γ, and x2is not an ancestor of either u or v in BF SG.
Arguing in this way, we will eventually get infinitely many nodes x1, x2, . . . in the system such that xi+1 is
a child of xi in BF SG for any i = 1, 2, . . .. However,
this is absurd because BF SGis a rooted tree with only
a finite number of nodes. Therefore, α /∈ bx in γ.
Lemma 3 Suppose the system is in a legitimate con-figuration γ. For any node x ∈ V and any edge α ∈ E, bxcan not contain both α and α in γ.
Proof. Suppose both α ∈ bxand α ∈ bxin γ. Since
B4(x) = ∅ in γ, we have that α /∈ B4(x) in γ. Since
[α /∈ B4(x) ∧ α ∈ bxin γ], we have that α ∈ T wo(x) in
γ.
Case 1. α /∈ N T (x) in γ. Since α ∈ T wo(x) in γ, we have that α /∈ One(x) in γ. Hence we have that α ∈ bx∧ α /∈ N T (x) ∧ α /∈ One(x) in γ, i.e., α ∈ B3(x)
in γ. Consequently, B3(x) 6= ∅ in γ, which causes a
contradiction.
Case 2. α ∈ N T (x) in γ. Let the non-tree edge α be {x, y}. Since α ∈ T wo(x) in γ, there exists a child v of x in BF SG such that α ∈ bv in γ. By Lemma 2 and
α ∈ bvin γ, we have that either x or y is a descenant of
v in BF SG. Since v is a child of x in BF SG, x is not a
descendant of v in BF SG. Thus, y is a descendant of v
in BF SG, and hence y is a descendant of x in BF SG.
Since {x, y} is a non-tree edge in G and since BF SGis
a BFS tree rooted at r for G, this contradicts Property 2.
Therefore, bxcan not contain both α and α in γ.
Lemma 4 Suppose the system is in a legitimate con-figuration γ. Suppose α = {u, v} is a non-tree edge in G and the cycle τu,v in G is as previously defined prior
to Lemma 1. If node x lies on τu,v and x 6= lca(u, v),
then α ∈ bx in γ.
Proof. Recall that τu,v is the cycle formed by Bu,
Bv and α = {u, v}, where Bu is the unique simple
path in BF SG connecting u and lca(u, v), and Bv is
the unique simple path in BF SG connecting v and
lca(u, v). Let Bu = (x0, x1, . . . , xt) with x0 = u,
xt = lca(u, v) and t ≥ 1. Since α ∈ N T (x0) in γ
and B1(x0) = ∅ in γ, we have that α ∈ bx0 in γ. If
t > 1, then x1 6= lca(u, v). For any child y of x1 in
BF SG such that y 6= x0, y cannot be an ancestor of
either u or v in BF SG. By Lemma 2, α /∈ byin γ. This
together with the fact that α ∈ bx0 in γ implies that
α ∈ One(x1) in γ. Since it is obvious that α /∈ E(x1)
and B1(x1) = ∅ in γ, we have that α ∈ bx1in γ. By the
same token, if t > 2, then α ∈ bx2in γ. Arguing in this
way, we will get that α ∈ bxi in γ for i = 0, . . . , t−1. In
other words, we have shown that for any node x in Bu
except lca(u, v), α ∈ bx in γ. Similarly, we can show
that for any node x in Bv except lca(u, v), α ∈ bx in
γ. Hence the lemma is proved.
Lemma 5 Suppose the system is in a legitimate con-figuration γ. Suppose α = {u, v} is a non-tree edge in G. For any node x in G, α ∈ bx in γ if and only if
x = lca(u, v) in BF SG.
Proof. (⇐) Suppose x = lca(u, v) in BF SG. For
any child k of x in BF SG which does not lie on τu,v, k
Lemma 2, α /∈ bk in γ. Since x = lca(u, v) in BF SG,
there are exactly two children u′ and v′ of x in BF S G
which lie on τu,v. By Lemma 4, α ∈ bu′ and α ∈ bv′
in γ. Hence, α ∈ T wo(x) in γ. Since x = lca(u, v) in BF SG and {u, v} is a non-tree edge in G, x 6= u and
x 6= v (for otherwise, u would be a descendant of v or v would be a descendant of u in BF SG, which
contra-dicts Property 2). Hence α /∈ E(x) in G. This together with the fact that α ∈ T wo(x) in γ and B2(x) = ∅ in
γ implies that α ∈ bxin γ.
(⇒) Suppose α ∈ bx in γ. Since B4(x) = ∅ in γ,
α ∈ T wo(x) in γ.
First, we show that x is a common ancestor of u and v in BF SG. Since α ∈ T wo(x) in γ, there exist two
children y1 and y2 of x in BF SG such that α ∈ by1
and α ∈ by2 in γ. By Lemma 2, y1 is an ancestor of
either u or v in BF SG and so is y2. Without loss of
generality, we assume that y1 is an ancestor of u in
BF SG. Thus, y2is not an ancestor of u in BF SG(for
otherwise, both y1 and y2 are ancestors of u in BF SG
and hence y1is a descendant of y2or y2is a descendant
of y1in BF SG, which contradicts the fact that y1 and
y2 are two distinct children of x in BF SG.). Hence y2
must be an ancestor of v in BF SG. Consequently, x is
a common ancestor of u and v in BF SG.
Next, we show that x = lca(u, v) in BF SG. Suppose
x 6= lca(u, v) in BF SG. Since x is a common ancestor
of u and v in BF SG, x lies on the unique simple path
P in BF SG connecting lca(u, v) and the root r. Since
x 6= lca(u, v) in BF SG, there is exactly one child x1of
x in BF SGsuch that x1lies on P . This combined with
the fact that α ∈ T wo(x) in γ implies that there exists a child y of x in BF SG such that y does not lie on P
and α ∈ by in γ. Hence y is not an ancestor of either
u or v in BF SG and α ∈ by in γ. This contradicts
Lemma 2. Therefore, x = lca(u, v) in BF SG.
Lemma 6 Suppose the system is in a legitimate con-figuration γ. Let α = {u, v} be a non-tree edge in G. If node x lies on the unique simple path P in BF SG
con-necting lca(u, v) in BF SG and the root r, then α /∈ bx
in γ.
Proof. Let P = (x0, . . . , xt) with x0 = lca(u, v),
xt= r and t ≥ 0. By Lemmas 3 and 5, we have that
α /∈ bx0 in γ. If t > 0, then x1 6= lca(u, v). Thus for
any child y of x1in BF SGsuch that y 6= x0, y cannot
be an ancestor of either u or v in BF SG. By Lemma
4, α /∈ by in γ. Hence α /∈ One(x1) in γ. This together
with the fact that α /∈ E(x1) and B3(x1) = ∅ in γ
implies that α /∈ bx1 in γ. By the same token, if t > 1
then α /∈ bx2 in γ. Arguing in this way, we will get
that α /∈ bxi in γ for i = 1, . . . , t. Hence the lemma is
proved.
Corollary 1 Suppose the system is in a legitimate configuration γ. Let α = {u, v} be a non-tree edge in G. For any node x, α ∈ bx in γ if and only if x lies
on the cycle τu,v in G and x 6= lca(u, v) in BF SG.
Proof. The “if” part is exactly Lemma 4, while the “only if” part follows immediately from Lemmas 2 and 6.
For presentation’s sake, we use b∗
x to stand for the
set {α ∈ E | α ∈ bxor α ∈ bx}.
Corollary 2 Suppose the system is in a legitimate configuration γ. Let α = {u, v} be a non-tree edge of G inγ. For any node x ∈ V , α ∈ b∗
x in γ if and only
if x lies on the cycle τu,v in G.
Proof.This follows immediately from Lemma 5 and Corollary 1.
The following theorem claims that in any legitimate configuration, all the bridges in G can be identified.
Theorem 1 Suppose the system is in a legitimate con-figuration γ. A tree edge α = {x, y} (i.e., α ∈ Eγ) is
a bridge in G if and only if b∗
x∩ b∗y= ∅ in γ.
Proof. (⇒) Suppose b∗
x∩ b∗y 6= ∅ in γ. Then there
exists an edge β = {u, v} in G such that β ∈ b∗ x∩ b∗y
in γ. By Lemma 1, β is a non-tree edge in G. By Corollary 2, both x and y lie on the cycle τu,v in G.
Hence, x and y can be connected by a simple path in BF SG which lies on τu,v. This simple path must be
exactly the edge {x, y} because {x, y} is the unique simple path in BF SG connecting x and y. Hence the
edge {x, y} must lie on the cycle τu,v. By Property 1,
{x, y} cannot be a bridge in G.
(⇐) Suppose α = {x, y} ∈ Eγ is not a bridge of
G. Without loss of generality, we assume that x is the parent of y in BF SG. By Property 3, there exists a
non-tree edge β = {u, v} such that u is not a descen-dant of y and v is a descendescen-dant of y in BF SG. Let Pv,y
be the unique simple path in BF SG connecting v and
y. For any node z lying on the path Pv,y, z 6= lca(u, v)
(for if z = lca(u, v), then u is a descendant of y, which causes a contradiction). Hence we have that lca(u, v) is an ancestor of x in BF SG. By Lemma 5 and Corollary
1, β or β ∈ bxin γ, and β ∈ byin γ. Hence b∗x∩ b∗y6= ∅
in γ.
3
Correctness proof
In this section, we present a correctness proof, show-ing that Algorithm 1 is self-stabilizshow-ing under the dis-tributed demon model. For convenience in presenta-tion in the rest of this secpresenta-tion, “execupresenta-tion” will mean “execution under the distributed demon model”. The
following lemma is obvious in view of the definition of a legitimate configuration, the definition of a finite execution, and the definition of an algorithm being self-stabilizing under the distributed demon model.
Lemma 7 Algorithm 1 is self-stabilizing under the distributed demon model if and only if any execution of Algorithm 1 is a finite execution.
Lemma 8 For any execution Γ of Algorithm 1 and any node x in the system, if x joins in a system move γ → γ′ in Γ and all children of x in BF S
G does not
join in γ → γ′, then x is not privileged in γ′.
Proof. Since all children of x in BF SG does not
join in γ → γ′, the b-set of all children of x in BF S G
does not change in γ → γ′ and hence the sets One(x)
and T wo(x) do not change due to γ → γ′.
Claim 1. B1(x) = ∅ in γ′.
Proof of claim. Let α be any edge.
Case 1. α does not satisfy [α ∈ N T (x)∨(α ∈ One(x)∧ α /∈ E(x)) in γ′]. Then α /∈ B
1(x) in γ′.
Case 2. α satisfies [α ∈ N T (x) ∨ (α ∈ One(x) ∧ α /∈ E(x)) in γ′]. Since the sets N T (x), E(x) and One(x)
do not change due to γ → γ′, α ∈ N T (x) ∨ (α ∈
One(x) ∧ α /∈ E(x)) in γ. Thus, α /∈ B2(x) ∪ B3(x) in
γ.
Subcase 2.1. α ∈ bx in γ. Then, since α ∈ bx∧ α /∈
B2(x)∪B3(x) in γ, α ∈ bx−(B2(x)∪B3(x)) in γ. Hence
α ∈ [bx−(B1(x)∪B2(x)∪B3(x)∪B4(x))]∪B1(x)∪B2(x)
in γ. Since x executes R1 in γ → γ′, α ∈ b x in γ′.
Hence α /∈ B1(x) in γ′.
Subcase 2.2. α /∈ bx in γ. Then, since α ∈ N T (x) ∨
(α ∈ One(x) ∧ α /∈ E(x)) in γ and α /∈ bx in γ, α ∈
B1(x) in γ. Hence α ∈ [bx− (B1(x) ∪ B2(x) ∪ B3(x) ∪
B4(x))] ∪ B1(x) ∪ B2(x) in γ. Since x executes R1 in
γ → γ′, α ∈ b
x in γ′. Hence α /∈ B1(x) in γ′.
From all the above, we can conclude that B1(x) = ∅ in
γ′.
Claim 2. B2(x) = ∅ in γ′.
Proof of claim. Let α be any edge.
Case 1. α does not satisfy [α ∈ T wo(x) ∧ α /∈ E(x) in γ′]. Then α /∈ B
2(x) in γ′.
Case 2. α satisfies [α ∈ T wo(x) ∧ α /∈ E(x) in γ′].
Since the sets T wo(x) and E(x) do not change due to in γ → γ′, α ∈ T wo(x) ∧ α /∈ E(x) in γ. Thus,
α /∈ B1(x) ∪ B4(x) in γ and hence α /∈ B1(x) ∪ B4(x)
in γ.
Subcase 2.1. α ∈ bx in γ. Then, since α ∈ bx∧ α /∈
B1(x) ∪ B4(x) in γ, α ∈ [bx− (B1(x) ∪ B2(x) ∪ B3(x) ∪
B4(x))] ∪ B1(x) ∪ B2(x) in γ. Since x executes R1 in
γ → γ′, α ∈ b
x in γ′. Hence α /∈ B2(x) in γ′.
Subcase 2.2. α /∈ bxin γ. Then, since α ∈ T wo(x) ∧
α /∈ E(x) ∧ α /∈ bx in γ, α ∈ B2(x) in γ and hence
α ∈ B2(x) in γ. Thus, α ∈ [bx− (B1(x) ∪ B2(x) ∪
B3(x) ∪ B4(x))] ∪ B1(x) ∪ B2(x) in γ. Since x executes
R1 in γ → γ′, α ∈ b
x in γ′. Hence α /∈ B2(x) in γ′.
From all the above, we can conclude that B2(x) = ∅ in
γ′.
Claim 3. B3(x) = ∅ in γ′.
Proof of claim. Let α be any edge.
Case 1. α does not satisfy [α /∈ N T (x) ∧ α /∈ One(x) in γ′]. Then α /∈ B3(x) in γ′.
Case 2. α satisfies [α /∈ N T (x) ∧ α /∈ One(x) in γ′].
Since the sets N T (x) and One(x) do not change due to γ → γ′, α /∈ N T (x) ∧ α /∈ One(x) in γ. Thus,
α /∈ B1(x) in γ.
Subcase 2.1. α ∈ bx in γ. Then, since α /∈ N T (x) ∧
α /∈ One(x) ∧ α ∈ bx in γ, α ∈ B3(x) in γ. Hence α /∈ (bx− B3(x)) ∪ B1(x) in γ and hence α /∈ [bx− (B1(x) ∪ B2(x) ∪ B3(x) ∪ B4(x))] ∪ B1(x) ∪ B2(x) in γ. Since x executes R1 in γ → γ′, α /∈ b xin γ′. Hence α /∈ B3(x) in γ′.
Subcase 2.2. α /∈ bx in γ. Then, since α /∈ bx∧ α /∈
B1(x) in γ, α /∈ (bx − B3(x)) ∪ B1(x) in γ. Hence
α /∈ [bx−(B1(x)∪B2(x)∪B3(x)∪B4(x))]∪B1(x)∪B2(x)
in γ. Since x executes R1 in γ → γ′, α /∈ b x in γ′.
Hence α /∈ B3(x) in γ′.
From all the above, we can conclude that B3(x) = ∅ in
γ′.
Claim 4. B4(x) = ∅ in γ′.
Proof of claim. Let α be any edge.
Case 1. α does not satisfy that α /∈ T wo(x) in γ′.
Then α /∈ B4(x) in γ′.
Case 2. α satisfies that α /∈ T wo(x) in γ′. Since the
set T wo(x) does not change due to γ → γ′, α /∈ T wo(x)
in γ. Thus, α /∈ B2(x) in γ.
Subcase 2.1. α ∈ bxin γ. Then, since α /∈ T wo(x) ∧
α ∈ bx in γ, α ∈ B4(x) in γ and hence α ∈ B4(x)
in γ. Hence α /∈ (bx− B4(x)) ∪ B2(x) in γ and hence
α /∈ [bx−(B1(x)∪B2(x)∪B3(x)∪B4(x))]∪B1(x)∪B2(x)
in γ. Since x executes R1 in γ → γ′, α /∈ b x in γ′.
Hence α /∈ B4(x) in γ′.
Subcase 2.2. α /∈ bx in γ. Then, since α /∈ bx∧ α /∈
B2(x) in γ, α /∈ (bx − B4(x)) ∪ B2(x) in γ. Hence
α /∈ [bx−(B1(x)∪B2(x)∪B3(x)∪B4(x))]∪B1(x)∪B2(x)
in γ. Since x executes R1 in γ → γ′, α /∈ b x in γ′.
Hence α /∈ B4(x) in γ′.
From all the above, we can conclude that B4(x) = ∅ in
γ′.
It follows from all the four claims above that B1(x) =
∅ ∧ B2(x) = ∅ ∧ B3(x) = ∅ ∧ B4(x) = ∅ in γ′. Thus, x
is not privileged in γ′ and the lemma is proved.
Lemma 9 If γi → γi+1 and γj → γj+1 are two
con-secutive system moves in Γ in which x joins, then there exists a child y of x in BF SG such that y joins in a
Proof. We prove this claim by contradiction. Sup-pose no child of x in BF SGcan join in any system move
in (γi, . . . , γj). Then no child of x in BF SG can join
in γi→ γi+1. By Lemma 8, x is not privileged in γi+1
(thus, i + 1 j) and hence B1(x) = B2(x) = B3(x) =
B4(x) = ∅ in γi+1. Since x does not join in any
sys-tem move in (γi+1, . . . , γj) and no child of x in BF SG
can join in any system move in (γi+1, . . . , γj), the sets
bx, One(x) and T wo(x) are all fixed in (γi+1, . . . , γj).
This combined with the fact that E(x) and N T (x) are fixed in Γ implies that the sets B1(x), B2(x),
B3(x) and B4(x) are all fixed in (γi+1, . . . , γj). Hence
B1(x) = B2(x) = B3(x) = B4(x) = ∅ in γj. Thus
x is not privileged in γj and hence x cannot join in
γj → γj+1, which causes a contradiction. Thus, the
lemma is proved.
Lemma 10 For any node x in the system, if the num-ber of system moves in Γ in which at least one child of x in BF SGjoins is m, then x can join in at most m+1
system moves in Γ.
Proof. Suppose x can join in at least m + 2 system moves in Γ. Then It follows from Lemma 9 that there exists at least m + 1 system moves in Γ in which at least one child of x in BF SG joins, which contradicts
the assumption of this claim. Therefore, the claim is proved.
Lemma 11 For any node x in the system, if x has m descendants in BF SG (note: x is a descendant of
itself ), then x can join in at most m system moves in Γ.
Proof. We prove by induction on m.
(1) Induction basis. For m = 1, let x be any node in the system that has 1 descendant in BF SG. Then x
has no child in BF SGand hence the number of system
moves in which at least one child of x in BF SG joins
is zero. It follows from Lemma 10 that x can join in at most 1 system move in Γ.
(2) Inductive step. Assume that k ≥ 1 and the claim is true for 1 ≤ m ≤ k. Let x be any node in the system that has k +1 descendants in BF SG. Let x1, x2, . . . , xj
be all the children of x in BF SGand mx1, mx2, . . . , mxj
be the number of descendants of x1, x2, . . . , xj in
BF SG, respectively. Then mx1, mx2, . . . , mxj are all
less than or equal to k. By the induction hypothesis, x1, x2, . . . , xj can join in at most mx1, mx2, . . . , mxj
system moves in Γ, respectively. Thus, the number of system moves in Γ in which at least one child of x in BF SG joins is q ≤ mx1+ mx2+ · · · + mxj = k. By
Lemma 10, x can join in q + 1 ≤ k + 1 system moves in Γ.
By (1), (2) and the postulate of mathematical in-duction, the lemma is proved.
Lemma 12 If Γ = (γ1, γ2, . . .) is an execution of
Al-gorithm 1, then the length of Γ is at most n2
, where n is the number of nodes in the system.
Proof. Since any node in the system has at most n descendants in BF SG, it can join in at most n system
moves in Γ by Lemma 11. Thus, the number of system moves in Γ is at most n2and the lemma is proved.
Theorem 2 Algorithm 1 is self-stabilizing under the distributed demon model and solves the bridge finding problem. Moreover, Algorithm 1 stabilizes in at most n2steps, where n is the number of nodes in the system.
Proof. This follows from Lemmas 7, 12 and Theo-rem 1.
4
Concluding remarks
In this paper, we have proposed a self-stabilizing algo-rithm that can find all bridges in a distributed system. Assuming that a BFS tree has been constructed, our al-gorithm stabilizes under the distributed demon model in at most n2 steps, where n is the number of nodes in
the system. These results are stronger or more general than most of the results in [2], [3] and [5].
Note that the results in this paper as well as the results in [2], [3] and [5] all have the same weakness -each of them depends on an assumption of the pres-ence of some rooted tree (BFS or DFS tree). Although attempts to combine algorithms have been made in [2], [3] and [5] to get rid of such assumptions, all of them are unsuccessful. For any of these attempts, the failure is simply due to the fact that one of the two to-be-combined algorithms is not self-stabilizing under the central demon model. However, it is worth not-ing that even if the two to-be-combined algorithms are self-stabilizing under the central demon model, the re-sulting combined algorithm may still not remain self-stabilizing under the central demon model if the way of combining is not appropriate. In other words, the com-bining of algorithms under the central demon model is not an obvious but a subtle matter that requires a cer-tain degree of carefulness. In our future work, we will clarify the above issue and also find a self-stabilizing bridge-finding algorithm that does not need to assume the presence of any rooted tree.
References
[1] J.E. Burns, “Self-stabilizing ring without demons”, Technical Report GIT-ICS-87/36, Georgia Tech., 1987.
[2] P. Chaudhuri, “An O(n2
) self-stabilizing algo-rithm for computing bridge-connected compo-nents”, Computing, Vol. 62, pp.55-67, 1999. [3] S. Devismes, “A silent self-stabilizing algorithm for
finding cut-nodes and bridges”, Parallel Processing Letters, Vol. 15, pp.183-198, 2005.
[4] E.W. Dijkstra, “Self-stabilizing systems in spite of distributed control”, Communcation of ACM, Vol. 17, pp.643-644, 1974.
[5] M. H. Karaata, P. Chaudhuri, “A self-stabilizing algorithm for bridge finding”, Distributed Comput-ing, vol. 12, pp.47-53, 1999.