distributed depth-first search

11
Some remarks on distributed depth- first search SUBMITTED BY : NIDHI BARANWAL MCA 3 RD SEM University of Allahabad

Upload: nidhi-baranwal

Post on 17-Feb-2017

139 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: distributed depth-first search

Some remarks on distributed depth-first search

SUBMITTED BY: NIDHI BARANWAL MCA 3RD SEM

University of Allahabad

Page 2: distributed depth-first search

INTRODUCTION

Depth-first search (DFS) is a powerful technique that has been used in designing many efficient graph algorithms on the computer model.

DFS is an algorithm for traversing or searching tree or graph data structures. We start at the root and explores as far as possible along each branch before backtracking

Page 3: distributed depth-first search

HOW IT WORKS?

Input: A graph G and a vertex v of G Output: All vertices reachable from v labelled as discovered

A non-recursive implementation of DFS

1. procedure DFS-iterative(G,v): 2. let S be a stack 3. S.push(v) 4. while S is not empty5. v = S.pop() 6. if v is not labeled as discovered: 7. label v as discovered 8. for all edges from v to w in G.adjacentEdges(v) do9. S.push(w)

Page 4: distributed depth-first search

DISTRIBUTED DFS

A distributed DFS algorithm constructs a DFS tree for a communication network distributively so that when execution terminates at all the nodes, a depth-first search tree is available in a distributed fashion

specifically, every node knows only its parent node and the children nodes

In the distributed setting, several algorithms have been reported, among them the best known ones are those of Cheung , Awerbuch,Cidon,Lakshmanan , Sharma and Makki .

Page 5: distributed depth-first search

AN OVERVIEW

The time complexity is the maximum time elapsed from the beginning to the termination of the algorithm, assuming that delivering a message over a link requires at most one unit of time.

The communication complexity is the total number of messages sent during the execution of the algorithm

Page 6: distributed depth-first search

CONTD…

The algorithm of Cheung simply probes all the edges of the graph, and therefore requires 2|E| messages and time units.

Awerbuch improves the time complexity of Cheung's algorithm from O(|E|) to O(|V|) by using parallel message passing but at the cost of increasing the number of exchanged messages.

Lakshmanan and Cidon improve the message complexity of Awerbuch's algorithm by a constant factor through the elimination of some of the parallelism. The algorithm of Lakshmanan will run correctly even if the FIFO rule is relaxed

Sharma proposed algorithms which improved the communication complexity of distributed DFS from O(|E|) to O(|V|) by removing more unnecessary parallelism at the cost of increasing the message size.

Page 7: distributed depth-first search

AN INNOVATIVE IDEA

The time and message complexity of both Lakshmanan and the Cidon’s algorithm can be improved by using the dynamic backtracking technique of Makki .

The idea is to have each node, except the node source, keep track of the lowest ancestor node, called split point, such that no internal node lying on the tree-path connecting the node and its split point has an ‘unvisited’ link.

That means when the search backtracks at a node, the backtracking will continue until it reaches the split point of that node.

Page 8: distributed depth-first search

ALGORITHM

We use Forward and Return messages to explore the tree. Our key improvement is to reduce the number of Return messages by using dynamic backtracking.

Each node has a copy of the procedure Ddfs .We define a node to be a split point if, when visited, it has two or more unvisited neighbours or if it is the root node.

Nodes which are not split points may be bypassed by Return messages.

Our messages comprise four components: message originator; message type; the set visited of visited nodes; and splitpoint, the previous split point.

Page 9: distributed depth-first search

CONTD…

A node which receives a message executes the Ddfs procedure. Forward messages lead to execution of initialization code for local variables.

In each case, a Forward message is issued to a neighbour , else a Return message is issued to an ancestor, else the algorithm terminates.

Our DDFS algorithm constructs the DFS tree for the distributed system in the order in which nodes are visited during the execution of the algorithm.

The DFS tree is stored in a standard way: at termination the root node is informed. Each node has local variables parent and childset for storing the DFS-tree, a variable unvisited for storing its set of unvisited neighbours.

Page 10: distributed depth-first search

ANALYSIS

The message and time complexity of this DDFS algorithm is b/w |V| and 2|V|-2.

The message complexity is the total number of Forward and Return messages. The number of Forward messages is |V|-1, because each non root node has exactly one Forward message sent to it.

The number of Return messages is at least one, since a Return message must be received by the root ; and at most |V|-1, because each non root node sends at most one Return message. Thus the total number of messages is between |V| and 2|V|-2.

In this algorithm the message and time complexities are the same.

Page 11: distributed depth-first search