The document presents a self-stabilizing algorithm for constructing a depth-first search (DFS) spanning tree in a distributed system. Each processor maintains a path field that represents its path from the root in the DFS tree. The algorithm uses a lexicographic ordering over path representations to ensure the paths converge to the true DFS paths. Once stabilized, each processor can identify the type of each incident edge relative to the DFS tree by comparing its path to its neighbors' paths. The algorithm runs in O(d*n*Δ) rounds, where d is the graph diameter and Δ is the maximum degree. It requires O(n*logΔ) memory per processor.
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Self Stabilizing Depth-first Search
1. Self-stabilizing depthfirst search
Zeev Collin, Shlomi Dolev
Intan Dzikria / M10109802
Management Information System Lab.
Department of Information Management NTUST
3. Distributed Algorithm
Self-Stabilizing
Can be started from any possible global state and once started, the
algorithm regains consistency by itself.
Introduction
The processors in a system may crash and the spontaneously
recover in arbitrary state.
X
When the intermediate period between one recovery and the
following crash is long enough, the algorithm stabilizes.
4. A distributed self-stabilizing Depth First Search
spanning tree algorithm
Use Lexicographic order among paths.
Introduction
Easily extended to obtain other self-stabilizing algorithms for different
types of tree.
6. COMMUNICATION GRAPH
SHARED COMMUNICATION REGISTERS
Self-stabilizing
distributed
system
P1
P3
P2
write
REGISTER
P4
P5
read
P6
SCHEDULER
PROCESSOR HAVE MANY ACTIVITIES ?
Each processor orders its edges by some arbitrary ordering α.
Every processor P and any edge e knows the value of α.
7. Self-stabilizing
distributed
system
P1
P3
P2
A fair execution is an infinite execution in which every processor
executes atomic steps infinitely often.
A task is defined by a set of executions which are called legal
execution.
An algorithm is self-stabilizing for a specific task if any fair
execution of the algorithm has a suffix that is within the set of
legal executions of that task.
P4
P5
An execution of the system is a finite or infinite sequence of
configuration.
P6
8. I’mI’m The Root
the ANCESTOR
So, I’m The Parent
Self-stabilizing
DFS Spanning
Tree
I’ve
I’m the
become
Child
parents
I’ve
I’m the
become
Child
parents
We’re
the Child
All other are DECENDANTS
9. The adjacent edges of every processor P are categorized as
follow:
Self-stabilizing
DFS Spanning
Tree
Tree-edges , the edges that belongs to DFS spanning tree
Incoming edge , the edge that connects P to its parent.
Outgoing edges, the edges that connect P to its children
10. The adjacent edges of every processor P are categorized as follow:
Self-stabilizing
DFS Spanning
Tree
Non Tree-edges, edges that do not belong to the DFS spanning tree
Backward edges, the edges that connect P with Q, where Q is an
ancestor of P.
Forward edges, the edges that connect P with R, where R is a
descendant of P.
11. Self-stabilizing
DFS Spanning
Tree
The output of a distributed algorithm is called a DFS-marked graph.
The output of the paper’s DFS Spanning Tree algorithm, after the
network has converged is a DFS-marked graph maintained in a
distributed fashion.
12. P1
Q
1
Define a lexicographical order “ ” over the
representation of the above set paths, where
is the minimal character.
e.g. ( , 1) ( , 1 , 1 ) ( , 2) (1)
2
T
T
T
T
DFS
Representation
Outgoing edges defined a path
e.g. ( , 5 , 3 )
Path begin with root
Continue through the edge with index 5 in α1
Reaches a processor Q, through this edge and
Ends in processor R, that is reached through
3rd edge of Q.
Root
T
Self-stabilizing
DFS Spanning
Tree
The first DF tree of a graph is the DFS spanning tree that is
obtained by performing a (centralized) DFS algorithm, visiting
the adjacent edges for every processor Pi in order induced by αi
3
R
α1 = 5
13. DFS Spanning
Tree Algorithm
Root P1 :
1. do forever
2.
path1 :=
3. Od
T
Self-stabilizing
DFS Spanning
Tree
The graph obtained by marking, for every 1 ‹ i ≤ n , the edge between Pi and Pi’s
father in fi is the first DFS tree.
Non-root Pi :
1. do forever
2.
for j := 1 to δ do
3.
read_pathj := read(pathj) od
4.
write pathi := min {|read_pathj 0 αj(i)|N , such that 1 ≤ j ≤ δ}
5. od
14. Self-stabilizing
DFS Spanning
Tree
DFS Spanning
Tree Algorithm
Pathi may describe the longest simple path that possible in the
graph. Assigning a too long sequence to a path field causes an
overflow that results in losing the most significant items of the
sequence.
Consider the edges of the tree to be directed from parent toward
the child.
Proved in this algorithm the paths of all the processors eventually
converge to the first paths and hence, define the first DFS tree.
15. Self-stabilizing
DFS Spanning
Tree
Theorem. Every fair execution has a suffix such that for every
configuration in that suffix and for every processor Pi pathi = fi
Proof. By induction on the depth of the processor in the first DFS
tree.
T
DFS Spanning
Tree Algorithm
Base : d = 0. The root assigns the value to pathi , which is fi by the
definition.
16. Self-stabilizing
DFS Spanning
Tree
Step :
Assume there is a suffix of the execution during which the path
fields of all processors whose depth in the first DFS tree is smaller
or equal to d have converged to their first path.
For a given configuration c, let the minimal read value in subtree Ti
be the minimal value of the read_path variables in Ti
DFS Spanning
Tree Algorithm
Let Pf be the father of Pi according to fi
Let c’ be the configuration in which all the above read variables are
grater than ff.
Let min(c) be the minimal value of a path stored in either the path
field or the read_path variable of a processor of Ti in c.
17. Self-stabilizing
DFS Spanning
Tree
The output of the algorithm is a DFS-marked graph, Every
processor after reading the stabilized paths of its neighbors, is able
to identify the type of any of its incident edges relative to the first
DFS tree.
The edge e = (Pi, Pj) is :
1.
2.
DFS Spanning
Tree Algorithm
Incoming edge, if pathi = pathj o αj(i)
Outgoing edge, if pathj = pathi o αi(j)
3.
Backward edge, if pathj is a prefix of pathi and edge is not an
incoming edge.
4. Forward edge, if pathi is a prefix of pathj and edge is not an
outgoing edge.
18. Present a self-stabilizing algorithm for a basic
distributed task, namely, constructing DFS tree.
Concluding
Remarks
DFS algorithm uses a lexicographic order relation on
the path representation.
The scheme is general and could be used to design selfstabilizing algorithms for other graph algorithm tasks
using different order relations.
19. The memory requirement for this algorithm is O(n
log ∆) where ∆ is an upper bound on the degree of a
node.
The time complexity is measured in rounds :
Concluding
Remarks
Execution is finished immediately after each processor has
executed one atomic step.
Finished after each processor has executed one atomic step
following the termination of the first round
So on…
The time complexity of this algorithm is O(d n ∆)
rounds, where d is the diameter of communication
graph.
20. Concluding
Remarks
Self-stabilizing leader election protocols can be composed with
this algorithm using the fair protocol composition method.
The resulting composition is a self-stabilizing DFS for a system of
processors with distinct identifiers.
21. S. Dolev, A. Israeli and S. Moran, Self-stabilization of dynamic
systems assuming only read/write atomicity, in : Proc. 9th Ann.
ACM Symp. On Principles of Distributed Computation, Montreal
(1990) 103 – 117
References
A distributed system consists of n processors denoted by P1, P2,…Pn. P1 is called special and other called regular.Each processor can communicate with some other processors called its neighbors.Each register is serializable with respect to read and write operations.
Communication graph is the graph formed by representing each processor as a node and connecting every pair of neighbors by an edge.Each pair of neighbors connected by an edge that support two-way communication.Communication between neighbors is carried out using sharedcommunication registers.Each register is serializable with respect to read and write operations.Any processor writes in one register , r , and may read from the register from any neighbors.Each processor orders its edges by some arbitrary ordering α.Every processor P and any edge e knows the value of α.A configuration of the system is a vector of states, one for each processor.Processor activity is managed by a scheduler.At any given configuration the scheduler activates a single processor which executes a single atomic step which consist of an internal computation followed by either a read or write action.