self stabilizing depth-first search

22
Self-stabilizing depth- first search Zeev Collin, Shlomi Dolev Intan Dzikria / M10109802 Management Information System Lab. Department of Information Management NTUST

Upload: intan-dzikria

Post on 22-Jan-2018

1.684 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Self Stabilizing Depth-first Search

Self-stabilizing depth-first searchZeev Collin, Shlomi Dolev

Intan Dzikria / M10109802

Management Information System Lab. Department of Information Management NTUST

Page 2: Self Stabilizing Depth-first Search

Outline

INTRODUCTION

SELF-STABILIZING DISTRIBUTED SYSTEM

SELF-STABILIZING DFS SPANNING TREE

CONCLUDING REMARKS

Page 3: Self Stabilizing Depth-first Search

Introduction

Distributed Algorithm Self-Stabilizing

Can be started from any possible global state and once started, the algorithm regains consistency by itself.

The processors in a system may crash and the spontaneously recover in arbitrary state.

When the intermediate period between one recovery and the following crash is long enough, the algorithm stabilizes.

X

Page 4: Self Stabilizing Depth-first Search

Introduction

A distributed self-stabilizing Depth First Search spanning tree algorithm

Use Lexicographic order among paths.

Easily extended to obtain other self-stabilizing algorithms for different types of tree.

Page 5: Self Stabilizing Depth-first Search

Self-stabilizing distributed system

P1

P3 P2

P4

P6P5

We’re Regular

All of Us are NEIGHBORS

Page 6: Self Stabilizing Depth-first Search

Self-stabilizing distributed system

P1

P3 P2

P4

P6P5

COMMUNICATION GRAPH

SHARED COMMUNICATION REGISTERS

read

write

REGISTER

PROCESSOR HAVE MANY ACTIVITIES ? SCHEDULER

Each processor orders its edges by some arbitrary ordering α.Every processor P and any edge e knows the value of α.

Page 7: Self Stabilizing Depth-first Search

Self-stabilizing distributed system

An execution of the system is a finite or infinite sequence of configuration.

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.

P1

P3 P2

P4

P6P5

Page 8: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

I’m The Root So, I’m The Parent

I’m the Child

I’m the Child

I’ve become parents

I’ve become parents

We’re the Child

I’m the ANCESTOR

All other are DECENDANTS

Page 9: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

The adjacent edges of every processor P are categorized as follow:

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

Page 10: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

The adjacent edges of every processor P are categorized as follow: 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.

Page 11: Self Stabilizing Depth-first Search

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.

Page 12: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

DFS Representation

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

P1

RootOutgoing edges defined a pathe.g. ( , 5 , 3 ) Path begin with rootContinue through the edge with index 5 in α1

Reaches a processor Q, through this edge and Ends in processor R, that is reached through3rd edge of Q.

T

Q

α1 = 5

R

1

2

3

Define a lexicographical order “ ” over therepresentation of the above set paths, where

is the minimal character.e.g. ( , 1) ( , 1 , 1 ) ( , 2) (1)

T

T T T

Page 13: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

DFS Spanning Tree Algorithm

Root P1 :

1. do forever

2. path1 :=

3. Od

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

The graph obtained by marking, for every 1 ‹ i ≤ n , the edge between Pi and Pi’sfather in fi is the first DFS tree.

T

Page 14: Self Stabilizing Depth-first Search

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.

Page 15: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

DFS Spanning Tree Algorithm

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.

Base : d = 0. The root assigns the value to pathi , which is fi by the definition. T

Page 16: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

DFS Spanning Tree Algorithm

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

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.

Page 17: Self Stabilizing Depth-first Search

Self-stabilizing DFS Spanning Tree

DFS Spanning Tree Algorithm

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. Incoming edge, if pathi = pathj o αj(i)

2. 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.

Page 18: Self Stabilizing Depth-first Search

Concluding Remarks

Present a self-stabilizing algorithm for a basic distributed task, namely, constructing DFS tree.

DFS algorithm uses a lexicographic order relation on the path representation.

The scheme is general and could be used to design self-stabilizing algorithms for other graph algorithm tasks using different order relations.

Page 19: Self Stabilizing Depth-first Search

Concluding Remarks

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 : 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.

Page 20: Self Stabilizing Depth-first Search

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.

Page 21: Self Stabilizing Depth-first Search

References

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

Page 22: Self Stabilizing Depth-first Search

Thank You