A Self-Stablizing Algorithm for Finding Distances in a Distributed System
全文
(2) 2. of the path equals w(v0 , v1 ) + w(v1 , v2 ) + · · · + w(vt−1 , vt ) = w(v0 , v1 ) + w(v1 , v2 ) + · · · + (w(vt−1 , vt ) + d(vt )) = w(v0 , v1 ) + w(v1 , v2 ) + · · · + (w(vt−2 , vt−1 ) + d(vt−1 )) = · · · = w(v0 , v1 ) + d(v1 ) = d(v0 ) = d(i) So we get a path from i to r which has the weight d(i). Therefore, d(i) ≥ d(i, r). Next, we need only to show that d(i) ≤ d(i, r) for any i. Let {d(i, r) | i ∈ V } = {d0 , d1 , . . . , dt } with 0 = d0 < d1 < · · · < dt . For any node i with d(i, r) = d0 , i must be the source r and d(i) = 0. Thus d(i) ≤ d(i, r). Let k be any integer, with 0 ≤ k < t. Assume that for any node i with d(i, r) ≤ dk , d(i) ≤ d(i, r). Then consider any node i with d(i, r) = dk+1 . Let (v1 , v2 , . . . , vs ) be a shortest path connecting node i and the source r with v1 = i and vs = r. Then (v2 , v3 , . . . , vs ) is a shortest path connecting node v2 and r and d(v2 , r) < d(i, r) = dk+1 . Therefore d(v2 , r) ≤ dk and we have d(v2 ) ≤ d(v2 , r) by the induction hypothesis. But then d(i) = d(v1 ) = min (d(j) + w(i, j)) ≤ j∈N (i). d(v2 ) + w(i, v2 ) = d(v2 , r) + w(i, v2 ) = d(i, r). Thus, we have proved that for any i ∈ V , d(i) ≤ d(i, r). Consequently, d(i) = d(i, r) for any i ∈ V . Thus, as is obvious from the above theorem, there is actually only one legitimate state and when the system is in the legitimate state, our problem is solved. III. An Illustration Figure 1 illustrates the execution of the algorithm. There are six states in Figure 1. In each state, the shaded nodes represent privileged nodes whereas the shaded node with a darkened circle stands for the privileged node selected by the central daemon to make a move. IV. Correctness Proof For the sake of presentation, (R1) is split into two rules: (R1-a) d(i) < min (d(j) + w(i, j)) → d(i) := j∈N (i). min (d(j) + w(i, j)) and. j∈N (i). (R1-b) d(i) >. min (d(j) + w(i, j)) → d(i) :=. j∈N (i). min (d(j) + w(i, j)).. j∈N (i). In view of the algorithm, the following Lemma 1 and Lemma 2 are obvious. Lemma 2: (No deadlock) The system is deadlock-free in each illegitimate state. Lemma 3: (Closure) No node is privileged when the system is in the legitimate state. Next, we want to prove the convergence of the algorithm, that is, we want to show: Starting with any initial state, the system will converge to the legitimate state. So for the following discussion, we let the initial state of the system be fixed. For the sake of presentation in the following proofs,. we define some terminologies and design three bounded functions. Since the system G = (V, E) is a connected graph, a spanning tree T of G exists. If we choose the source r to be the root, then T becomes a rooted tree. For each node i in the system, let dinit (i) be the d(i) in the initial state and let the value du (i) be defined recursively by (1) du (r) = dinit (r) ; and (2) for i = r, du (i) = max{dinit (i), du (p) + w(i, p)}, where p is the parent of i in T . Lemma 4: For each node i in the system, d(i) ≤ du (i) at any time. A node i = r is called a turn node whenever d(i) < min (d(j)+w(i, j)); otherwise, it is called a non-turn node.. j∈N (i). If i is a turn node and d(i) = k then it is called a k-turn node. By definition, A(k) is the set of all k-turn nodes in the system and tk =| A(k) | is the cardinality of A(k) . Let d(i), m = max du (i) and let F1 = (t0 , t1 , . . . , tm ), F2 = i∈V. i∈V. and F = (F1 , F2 ). Note that all these functions including A(k) , tk , F1 , F2 and F have a common domain, the set of all global states. We compare the F1 -values as well as the F -values by lexicographic order. Thus, for any two global states S1 and S2 , F1 (S1 ) < F1 (S2 ) if and only if there is a k ∈ {0, 1, . . . , m} such that tj (S1 ) = tj (S2 ) for any j < k and tk (S1 ) < tk (S2 ) whereas F (S1 ) < F (S2 ) if and only if F1 (S1 ) < F1 (S2 ) or [F1 (S1 ) = F1 (S2 ) and F2 (S1 ) < F2 (S2 )]. Obviously, all the F -values are bounded below by (0, 0, . . . , 0) and between any particular F -value and (0, 0, . . . , 0), there can be only finitely many F -values possible. The following lemmas lead eventually to Theorem 12 which claims the convergence of the algorithm. Since the proofs of all these lemmas are of the same spirit, we presented here in details only that of Lemma 8. Lemma 5: (1) A node which is a turn node right before the system makes a move cannot contribute to the increase of tk , for any k, after the move of the system. (2) The source r can not contribute to the increase of any tk . Lemma 6: F1 does not increase each time after rule R(0) is executed in the system. Lemma 7: F2 decreases each time after rule R(0) is executed in the system. Lemma 8: F1 decreases each time after rule R(1-a) is executed in the system. Proof: Let node i be the node of the system which executes the rule and let d(i) = l right before the execution. (1) Since i is an l-turn node right before the execution of rule R(1-a) and is a non-turn node after the execution, i contributes to the decrease of tl by 1. (2) By Lemma 4, the source and all those nodes which are turn nodes right before the execution do not contribute to the increase of any tk after the execution..
(3) 3. (3) If node j ∈ V − (N (i) ∪{i}) is a non-turn node right before the execution, then by the same argument as in (2) in the proof of Lemma 5, j remains a non-turn node after the execution and therefore does not affect any tk . (4) If node j ∈ N (i) is any non-turn node right before the execution, then d(j) ≥ min (d(k) + w(j, k)) right before k∈N (j). the execution. If d(i) + w(j, i) >. min (d(k) + w(j, k)). k∈N (j). right before the execution, then after the execution, d(i) increases and hence min (d(k) + w(j, k)) remains unk∈N (j). changed; and therefore, d(j) ≥ min (d(k) + w(j, k)) still k∈N (j). and j remains a non-turn node. So in this case, j does not affect any tk . If d(i) + w(j, i) = min (d(k) + w(j, k)) right k∈N (j). before the execution, then d(j) ≥ d(i) + w(j, i) > d(i) = l; and therefore, after the execution, j either remains a nonturn node or becomes an s-turn node, where s = d(j) > l. So in this case, j either does not affect any tk or can only contribute to the increase of some ts with s > l. From all above, we can see tl decreases by at least 1 and tk remains unchanged for any k < l and therefore F1 decreases after the execution of rule R(1-a). Lemma 9: F1 does not increase each time after rule R(1b) is executed in the system. Lemma 10: F2 decreases each time after rule R(1-b) is executed in the system. Theorem 11: F decreases each time after rule R(0), R(1a) or R(1-b) is executed in the system. Proof: Obvious from above Lemmas 5-9. Theorem 12: The algorithm is self-stabilizing. Proof: The convergence property of the algorithm follows from Lemma 1, Theorem 2, the fact that F is bounded below by (0, 0, . . . , 0) and the fact that between the initial value and (0, 0, . . . , 0), there can only be finitely many F values possible; and the closure property of the algorithm follows immediately from Lemma 2. References [1] E. W. Dijkstra, Self-stabilizing systems in spite of distributed control, Communications of the Association of the Computing Machinery, 17, 643-644, (1974). [2] S. T. Huang and N. S. Chen, A self-stabilizing algorithm for constructing breadth-first trees, Information Processing Letters, 41, 109-117, (1992)..
(4) r 4. d (r)=4 1. The initial state. 2 d( i)=3. i. s. 5. 3 j. d( j)=5. r Central daemon picks i to make a move.. d (i)=4. 4. s. 5. 3 j. d (i)=4. 4. d (r)=0. 2. s. j. k. 4. 1 s. 5. 3 j. k. 2. 4. Node i is privileged by R(1). Node s is privileged by R (1).. d (r )=0 1. i. s. 5. 3 j. d (s)=1. Node j is privileged by R(1).. d (k)=4. k 2 r. d (i)=3. 4. d (r )=0 1. 2 i. s. 5 d( j)=6. d (s)=1. d (k)=4. 2. d( j)=5. Central daemon picks j to make a move.. d (r)=0. i. d (i)=3. Node j is privileged by R(1). Node k is privileged by R (1). Node s is privileged by R (1).. d (k)=4. 2. r Central daemon picks i to make a move.. d (s)=2. 3. 2. d( j)=5. r is privileged by R(0). is privileged by R(1). is privileged by R (1). is privileged by R (1).. 1. r d (i)=4. Source Node j Node k Node s. d (k)=4. k. 5. Central daemon picks s to make a move.. d (s)=2. 2. i. d( j)=5. r is privileged by R(0). is privileged by R(1). is privileged by R(1). is privileged by R(1). is privileged by R(1).. 1. i. d( j)=5. Source Node i Node j Node k Node s. d (r)=4. 2. r Central daemon picks r to make a move.. d (k)=4. k. 2. d (s)=2. 2. The legitimate state. 3. 1 j. d( s)=1. k. d (k)=4. Figure 1. An example which illustrates the execution of the algorithm..
(5)
數據
相關文件
Lemma 86 0/1 permanent, bipartite perfect matching, and cycle cover are parsimoniously equivalent.. We will show that the counting versions of all three problems are in
First, in the Intel documentation, the encoding of the MOV instruction that moves an immediate word into a register is B8 +rw dw, where +rw indicates that a register code (0-7) is to
Since even holes can be efficiently detected in an extended clique tree (see Lemma 4.6, which.. is a slightly faster implementation of the algorithm of da Silva and Vušković [21]),
• Color the nodes representing literals by their truth values (color 0 for false and color 1 for true).. – We are dealing with the a-triangles here, not the
EQUIPAMENTO SOCIAL A CARGO DO INSTITUTO DE ACÇÃO SOCIAL, Nº DE UTENTES E PESSOAL SOCIAL SERVICE FACILITIES OF SOCIAL WELFARE BUREAU, NUMBER OF USERS AND STAFF. 數目 N o
Now given the volume fraction for the interface cell C i , we seek a reconstruction that mimics the sub-grid structure of the jump between 0 and 1 in the volume fraction
Then, it is easy to see that there are 9 problems for which the iterative numbers of the algorithm using ψ α,θ,p in the case of θ = 1 and p = 3 are less than the one of the
A Boolean function described by an algebraic expression consists of binary variables, the constant 0 and 1, and the logic operation symbols.. For a given value of the binary