A Self-stabilizing Algorithm for the Center-finding Problem Under a More Realistic Demon
全文
(2) A SELF-STABILIZING ALGORITHM FOR THE CENTER-FINDING PROBLEM UNDER A MORE REALISTIC DEMON TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU Abstract. The problem of locating centers in distributed systems are especially important since they are ideal locations for placing resources that need to be shared among different processors in a network. In this paper, we design and prove the correctness of a self-stabilizing center-finding algorithm under a more realistic demon in a distributed system with a tree topology.. 1. Introduction E. W. Dijkstra first introduced the notion of self-stabilization in a distributed system in his pioneering paper [2] (cf. also [3][4]) in 1974, in which he coined the phrase and showed the feasibility of designing such algorithms in a distributed system. In addition to Dijkstra’s classic papers [2][3][4], a good reference for the basics on the self-stabilizing system of Dijkstra type can be found in Bruell et al. [5]. Later in 1993, Dolev et al., introduced a new type of self-stabilizing system in their famous paper [1]. The computational model of the new type of system assumes the read/write separate atomicity. Under such an assumption, each atomic step in the system of Dolev type consists of internal computations Date: July 2, 2002. Key words and phrases. Self-stabilizing algorithm, center, rooted tree, model of computation, read/write separate atomicity, read/write composite atomicity. 1.
(3) 2. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. and either a single read operation or a single write operation. In this setting, Dolev et al. presented two simple self-stabilizing algorithms in [1], one of which is for the mutual exclusion problem and the other is for the breadth-first search tree problem. As is proved in the paper, both algorithms are self-stabilizing under the computational model of Dolev type. Self-stabilizing center-finding algorithms in a distributed system that uses the computational model of Dijkstra type have been investigated during the past [5][6]. In this paper, we design and prove the correctness of a self-stabilizing algorithm that finds the center(s) for any distributed system with a tree topology that uses the computational model of Dolev type. To the best of our knowledge, there has been no published paper so far that discusses the self-stabilizing centerfinding algorithm in a distributed system whose computational model assumes the read/write separate atomicity. The rest of this paper is arranged as follows. In Section 2, the algorithm is proposed and the meaning of the legitimate configuration is explained. The correctness proof of the algorithm is given in Section 3. Finally, in Section 4, some remarks conclude the whole discussion.. 2. The Center-finding Algorithm Let T = (V, E) be an undirected tree that is used to model a distributed system with a tree topology. Each node x ∈ V represents a processor in the system and each edge {x, y} ∈ E represents the bidirectional link connecting processors x.
(4) A SELF-STABILIZING CENTER-FINDING ALGORITHM. H
(5). . . H
(6) . . H
(7). . . . . H
(8) H
(9). H
(10). H
(11). 3. . H
(12). . . H
(13). . . . . H
(14). . Figure 1. Eccentricities of nodes in a tree. The shaded node stands for the unique center of the tree. and y. For any x, y ∈ V , let d(x, y) denote the distance between x and y, that is, the length of the unique simple path in T that connects x and y. Let e(x) = max {d(x, y) | y ∈ V } denote the eccentricity of a node x, viz. the distance between x and a farthest vertex from x in T . Then a center of T is a node with the minimum eccentricity. The so-called center-finding problem for the system T is to identify the center(s) of the system. Proposition 1 states a well-known property regrading the center(s) of a tree. The proof of it can be found in Theorem 2.1 in [7].. Proposition 1. A tree has a unique center or two adjacent centers (cf. Figure 1 and 2). For later use, for any x ∈ V , we define N (x) to be the set of all x’s neighbors. We also introduce some notations p(x), T (x) and H(x) relating to T in the following definition. Then, we demonstrate some properties with regard to H(x)..
(15) 4. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. Definition 1. Let T = (V, E) be as above. Case 1. T has a unique center c. In this case, we designate c as the root and T thus becomes a rooted tree at c. For any x ∈ V − {c}, the parent of x is denoted by p(x). For any x ∈ V , let T (x) represents the subtree of T rooted at x . Then we define H(x) = max{d(x, y) | y is a leaf node in T (x)}, i.e., the height of T (x). Case 2. T has two centers c1 , c2 . In this case, we first delete from T the edge connecting c1 and c2 and thus obtain two subtrees T1 and T2 of T , where c1 ∈ V (T1 ) and c2 ∈ V (T2 ). T1 and T2 can be considered as rooted trees at c1 and c2 , respectively. For any x ∈ V − {c1 , c2 }, p(x) denotes the parent of x in the rooted tree to which x belongs. For any x ∈ V , the meanings of T (x) and H(x) are also apparent. We now give two examples to assist readers in comprehending the notions given in above definition. The tree shown in Figure 3-(1) has a unique center c. It induces a rooted tree at c shown in Figure 3-(2). The shaded nodes constitutes. H
(16). . . H
(17) . . H
(18). H
(19). . . . . H
(20) H
(21). . H
(22). . . H
(23). . . . H
(24). . Figure 2. Eccentricities of nodes in a tree. The two shaded nodes stand for the two centers of the tree..
(25) A SELF-STABILIZING CENTER-FINDING ALGORITHM. 7. . . . . . F. . 5. . . .
(26). 7. F. . . . . . . . . .
(27). Figure 3. A tree with a unique center c and the induced rooted tree rooted at c.. the subtree T (3) with H(3) = 2. Also note that p(5) = 4. Next, the tree shown in Figure 4-(1) has two adjacent centers c1 and c2 . It induces two rooted trees T1 and T2 in Figure 4-(2). The shaded nodes represent the subtree T (2) with H(2) = 1. Also note that p(7) = 2.. Lemma 1. Suppose x is a node in T such that deg(x) > 1 and x is not a center of T . Then H(p(x)) ≥ H(x) + 1 and [ ∀y ∈ N (x) − {p(x)}, H(y) ≤ H(x) − 1 ] and [ ∃y0 ∈ N (x) − {p(x)} such that H(y0 ) = H(x) − 1 ]..
(28) 6. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. Lemma 2. Suppose T has a unique center c. Then [ ∀y ∈ N (c), H(y) ≤ H(c)−1 ] and [ ∃y1 , y2 ∈ N (c) such that y1 6= y2 and H(y1 ) = H(y2 ) = H(c) − 1 ]. Lemma 3. Suppose T has two centers c1 and c2 . Then H(c1 ) = H(c2 ), [ ∀y ∈ N (c1 ) − {c2 }, H(y) ≤ H(c1 ) − 1 ] and [ ∃y0 ∈ N (c1 ) − {c2 } such that H(y0 ) = H(c1 ) − 1 ]. Later in this section, we will propose a self-stabilizing algorithm that finds the center(s) for the distributed system T with a tree topology. The underlying model of computation employed here in the system was introduced by Dolev et. 7. . . . . F. F. . . . . .
(29). 7. F. . . . 7. F. . . . . . . . .
(30). Figure 4. A tree with two centers c1 and c2 and the induced rooted trees rooted at c1 and c2 ..
(31) A SELF-STABILIZING CENTER-FINDING ALGORITHM. 7. al. in [1] (cf. also [8]) that assumes the read/write separate atomicity instead of the commonly used read/write composite atomicity. Thus, for each x ∈ V and for each y ∈ N (x), let x maintain a register hxy , in which x writes and from which y reads. The register is serializable with respect to read and write operations. For each processor x with deg(x) > 1 and for each y ∈ N (x), let x also maintain a local variable ryx , in which x stores the value that it reads from the shared register hyx of the neighbor y. The values of each register hxy and each local variable ryx are in the range N = {0, 1, 2, . . .}. Figure 5 illustrates the distributed system that assumes the read/write separate atomicity and is equipped with the proposed algorithm. Nx,r = {ryx | y ∈ N (x)} denotes the multi-set of values − of all x’s local variables whereas Nx,r = Nx,r − {max Nx,r } denotes the set Nx,r. with one maximum value in it removed. For example, if Nx,r = {3, 4, 4}, then − Nx,r = {3, 4}. The legitimate configurations for the system are defined to be. those configurations in which ∀x ∈ V , [ deg(x) = 1 ∧ hxy = 0 for the unique − y ∈ N (x) ] or [ deg(x) > 1 ∧ (∀y ∈ N (x), ryx = hyx ∧ hxy = 1 + max Nx,r ) ].. Theorem 1 (Uniqueness). If the system T = (V, E) is in any legitimate configuration, then ∀x ∈ V and ∀y ∈ N (x), hxy = H(x), the height of T (x).. The above theorem shows the meaning and the uniqueness of the legitimate configuration. The converse is also true, which shows the existence of the legitimate configuration..
(32) 8. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. Theorem 2 (Existence). The configuration in which [ ∀x ∈ V and ∀y ∈ N (x), hxy = H(x) ] and [ ∀x ∈ V with deg(x) > 1 and ∀y ∈ N (x), ryx = hyx ] is a legitimate configuration. The above two theorems reveal that there is actually a unique legitimate configuration, that is, the configuration in the statement of Theorem 2, and when the system is in the legitimate configuration, for any x ∈ V and for any y ∈ N (x), the register hxy records the height H(x) of T (x). Now we equip the system with the algorithm. Self-stabilizing center-finding algorithm {For every leaf node x in the system} 1. repeat forever 2.. if hxy 6= 0 then write(hxy := 0) endif (where y is the unique neighbor of x.). 3. endrepeat {For every non-leaf node x in the system} 01. repeat forever 02. for each y ∈ N (x) do 03.. read (ryx := hyx ). 04. endfor 05. for each y ∈ N (x) do 06.. − − if hxy 6= 1 + max Nx,r then write (hxy = 1 + max Nx,r ) endif.
(33) A SELF-STABILIZING CENTER-FINDING ALGORITHM. 9. 07. endfor 08. endrepeat. It should be understood that each processor in the system runs its own program indefinitely and at its own pace, and the running of the program has to follow the order of the statements in the program.. 3. Correctness Proof We now give the correctness proof in the following theorem. To facilitate the presentation in the following proof, we define some terminologies. We say that a node x with deg(x) > 1 just completes a full round of reading all its neighbors whenever x just completes a full execution of the loop from statement 02 to statement 04 in the algorithm. Likewise, we say that a node x with deg(x) > 1 just completes a full round of writing all its registers whenever x just completes a full execution of the loop from statement 05 to statement 07. For any time instant t, we use hxy (t+ ) to denote the value of hxy right after t and hxy (t− ) to denote the value of hxy right before t. If hxy (t+ ) = hxy (t− ), the value of hxy at t is well-defined and is denoted as hxy (t); otherwise, hxy (t) is undefined. Likewise, ryx (t+ ) and ryx (t− ) stand for the value of ryx right after t and the value of ryx right before t, respectively. If ryx (t+ ) = ryx (t− ), the value of ryx at t is well-defined and is denoted as ryx (t); otherwise, ryx (t) is undefined..
(34) 10. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. Theorem 3 (Self-stabilization). Regardless of any initial state, the system will converge to the legitimate state and then stay in the legitimate state thereafter.. Proof. Let t = 0 be the initial time instant and L be the diameter of T . Let m=. L 2. .. Claim. ∀j ∈ {0, 1, . . . , m}, there exists an instant tj > 0 such that ∀t > tj , [ ∀x ∈ V with 0 ≤ H(x) ≤ j and ∀y ∈ N (x), hxy (t) = H(x) ] and [ ∀x ∈ V with H(x) > j and ∀y ∈ N (x), hxy (t+ ) ≥ j ]. Proof of the Claim. We prove the claim by induction on j. For j = 0, in view of statement 2 in the algorithm, it is obvious that for each x ∈ V with H(x) = 0, there exists a t0 (x) > 0 such that ∀t > t0 (x), hxy (t) = 0 for y ∈ N (x). Let t0 = max t0 (x). Then, ∀t > t0 , [ ∀x ∈ V with H(x) = 0, hxy (t) = 0 for y ∈ N (x) x∈M0. ] and [ ∀x ∈ V with H(x) > 0 and ∀y ∈ N (x), hxy (t+ ) ≥ 0 (since, as mentioned before, the register hxy always attains a value in N = {0, 1, 2, . . .} for any x ∈ V and for any y ∈ N (x)) ]. Hence the claim is true for j = 0. Let 0 ≤ k < m. Assume that for j = k, the claim is true, that is, there exists a tk > 0 such that ∀t > tk , [ ∀x ∈ V with 0 ≤ H(x) ≤ k and ∀y ∈ N (x), hxy (t) = H(x) ] and [ ∀x ∈ V with H(x) > k and ∀y ∈ N (x), hxy (t+ ) ≥ k ]. Subclaim 1. If x ∈ V with H(x) = k + 1, then there exists a t1 (x) > tk such − that ∀t > t1 (x), max Nx,r (t) = k.. Proof of Subclaim 1. Case 1. x is not a center. Then, by Lemma 1, [ H(p(x)) ≥ k + 2 ], [ ∀y ∈.
(35) A SELF-STABILIZING CENTER-FINDING ALGORITHM. 11. N (x)−{p(x)}, H(y) ≤ k ] and [ ∃y0 ∈ N (x)−{p(x)} such that H(y0 ) = k ]. Thus, by the induction hypothesis, ∀t > tk , [ hp(x)x (t+ ) ≥ k ], [ ∀y ∈ N (x) − {p(x)}, hyx (t) = H(y) ≤ k ] and [ hy0 x (t) = H(y0 ) = k ]. Let tp(x) > tk be an instant at which x reads rp(x)x = hp(x)x . Then ∀t ≥ tp(x) , if we let t0p(x) be the last instant in the time interval (tk , t] at which x reads rp(x)x = hp(x)x , then we can see that rp(x)x (t+ ) = hp(x)x (t0p(x) ) and thus rp(x)x (t+ ) ≥ k. Similarly, ∀y ∈ N (x) − {p(x)}, ∃ty > tk such that [ ∀t ≥ ty , ryx (t+ ) ≤ k ] and [ ∀t ≥ ty0 , ry0 x (t+ ) = k ]. Let − t1 (x) = max ty . Then t1 (x) > tk and ∀t ≥ t1 (x), max Nx,r (t+ ) = k. Consey∈N (x). − quently, ∀t > t1 (x), max Nx,r (t+ ) = k.. Case 2. x is the unique center of T . By employing Lemma 2 and arguing analogously as in Case 1, we will get a t1 (x) > tk such that ∀t > t1 (x), max − Nx,r (t+ ) = k.. Case 3. x is one of the two centers of T . By employing Lemma 3 and arguing analogously as in Case 1, we will obtain a t1 (x) > tk such that ∀t > t1 (x), max − Nx,r (t+ ) = k. Therefore, Subclaim 1 is proved.. Let x and t1 (x) be as in Subclaim 1. Let t2 (x) > t1 (x) be the first instant after t1 (x) at which x just completes a full round of reading all its neighbors. Let y ∈ N (x) be arbitrary. (a) If after t1 (x), the value of hxy is never changed, then − hxy (t2 (x)) = 1 + max Nx,r (t2 (x)). (Otherwise, x will execute statement 06 in the. algorithm to change the value of hxy after t2 (x)). Hence, hxy (t2 (x)) = 1 + k, by Subclaim 1. Therefore, we have (]): ∀t ≥ t1 (x), hxy (t) = hxy (t2 (x)) = 1+k. (b) If after t1 (x), the value of hxy is ever changed, then let t¯y > t1 (x) be the first instant.
(36) 12. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. − ¯+ after t1 (x) at which the value of hxy is changed. Then hxy (t¯+ y ) = 1+max Nx,r (ty ).. ¯ Hence, hxy (t¯+ y ) = 1 + k, again by Subclaim 1. Since after ty , the guard condition in statement 06 in the algorithm never evaluates to true, node x will never execute the write action. Therefore, we have (]]): ∀t > t¯y , hxy (t) = 1 + k. From (]) and (]]) above, it follows obviously that there exists a t∗ > tk such that ∀t > t∗ and ∀y ∈ N (x), hxy (t) = k + 1. Thus, we have shown (): ∀x ∈ V with H(x) = k + 1, ∃t∗ > tk such that ∀t > t∗ and ∀y ∈ N (x), hxy (t) = k + 1. By arguing in the same manner as in the above proof of Subclaim 1 and by employing Lemmas 1, 2 and 3 again, we will obtain Subclaim 2. If x ∈ V with H(x) > k + 1, then there exists a t∗1 (x) > tk such − that ∀t ≥ t∗1 (x), max Nx,r (t+ ) ≥ k.. Then, arguing analogously as right after Subclaim 1, we will eventually get (F): For any x ∈ V with H(x) > k + 1, there exists a t˜ > tk such that ∀t > t˜ and ∀y ∈ N (x), hxy (t+ ) ≥ k +1. Consequently, by () and (F) above, there exists an instant tk+1 > 0 (e.g. tk+1 can be chosen to be max{t∗ , t˜}) such that ∀t > tk+1 , [ ∀x ∈ V with 0 ≤ H(x) ≤ k + 1 and ∀y ∈ N (x), hxy (t) = H(x) ] and [ ∀x ∈ V with H(x) > k + 1 and ∀y ∈ N (x), hxy (t) ≥ k + 1 ], that is, the claim is true for j = k + 1. Therefore, by the postulate of mathematical induction, the claim at the beginning is proved. According to above claim, there exists a tm > 0 such that ∀t > tm , ∀x ∈ V with 0 ≤ H(x) ≤ m and ∀y ∈ N (x), hxy (t) = H(x). This obviously implies that ∀x ∈ V and ∀y ∈ N (x), hxy = H(x) never changes after tm . Consequently,.
(37) A SELF-STABILIZING CENTER-FINDING ALGORITHM. 13. in view of the algorithm, there exists a t∗m > tm such that after t∗m , ∀x ∈ V with H(x) > 0 and ∀y ∈ N (x), ryx = hyx . Therefore, after t∗m , [ ∀x ∈ V with H(x) = 0, hxy = 0 for y ∈ N (x) ] and [ ∀x ∈ V with H(x) > 0 and ∀y ∈ N (x), hxy = H(x)∧ ryx = hyx ], that is, the system is in the legitimate configuration. Hence, the proof is completed.. . 4. Concluding Remarks In the above, we have shown that the proposed algorithm is indeed selfstabilizing in a distributed system whose underlying computational model assumes the read/write separate atomicity and in the legitimate configuration, all hxy ’s records the height H(x) of T (x). Arguing analogously as in the proof of Theorem 1, we can get that the h-value h(x) defined in [5] and H(x) defined in this paper are actually the same. Thus, by Theorem 4.4 in [5], as soon as the system reaches the legitimate configuration, identifying a center of T is to select a node x that satisfies hxy ≥ hyx for any y ∈ N (x). Hence the center-finding problem is solved.. References [1] S. Dolev, A. Israeli and S. Moran, Self-stabilization of dynamic systems assuming only read/write atomicity, Distributed Computing 7, 3-16, (1993). [2] E. W. Dijkstra, Self-stabilizing systems in spite of distributed control, Communications of the Association of the Computing Machinery 17, 643-644, (1974)..
(38) 14. TETZ C. HUANG, JI-CHERNG LIN AND NATHAN MOU. [3] E. W. Dijkstra, Self-stabilization in spite of distributed control. In Selected writings on computing: a personal perspective, 41-46, Berlin-Heidelberg-New York: Springer-Verlag, (1982). [4] E. W. Dijkstra, A belated proof of self-stabilization, Distributed Computing 1, 5-6, (1986). [5] S. C. Bruell, S. Ghosh, M. H. Karaata and S. V. Pemmaraju, Self-stabilizing algorithms for finding centers and medians of trees, SIAM Journal on Computing 29 (2), 600-614, (1999). [6] Tetz C. Huang ,Ji-Cherng Lin and H. J. Chen, A self-stabilizing algorithm which finds a 2-center of a tree, Computers and Mathematics with Applications 40, 607-624, (2000). [7] F. Buckley and F. Harary, Distance in Graphs, Addison-Wesley, Redwood City, CA, (1990). [8] S. Dolev, Self-stabilization, MIT Press, (2000).. Department of Computer Engineering and Science, Yuan-Ze University, 135 Yuan-Tung Rd., Chung-Li Taoyuan 32026, Taiwan E-mail address: [email protected], [email protected], [email protected].
(39)
數據
相關文件
Here, a deterministic linear time and linear space algorithm is presented for the undirected single source shortest paths problem with positive integer weights.. The algorithm
Primal-dual approach for the mixed domination problem in trees Although we have presented Algorithm 3 for finding a minimum mixed dominating set in a tree, it is still desire to
In particular, we present a linear-time algorithm for the k-tuple total domination problem for graphs in which each block is a clique, a cycle or a complete bipartite graph,
Then, we tested the influence of θ for the rate of convergence of Algorithm 4.1, by using this algorithm with α = 15 and four different θ to solve a test ex- ample generated as
Section 3 is devoted to developing proximal point method to solve the monotone second-order cone complementarity problem with a practical approximation criterion based on a new
Although we have obtained the global and superlinear convergence properties of Algorithm 3.1 under mild conditions, this does not mean that Algorithm 3.1 is practi- cally efficient,
In this paper, we develop a novel volumetric stretch energy minimization algorithm for volume-preserving parameterizations of simply connected 3-manifolds with a single boundary
In this work, for a locally optimal solution to the NLSDP (2), we prove that under Robinson’s constraint qualification, the nonsingularity of Clarke’s Jacobian of the FB system