Graph traversal schemes, Data Structure & Algorithms

Q. Explain various graph traversal schemes and write their advantages and disadvantages.

Ans.

Graph Traversal Scheme is explained below

In many troubles we wish to investigate the total vertices in a graph in some systematic order. In graph we frequently do not have any one vertex singled out as special and therefore the traversal may begin at an arbitrary vertex. The two famous methods or techniques for traversing are:-

a) Depth first traversal is explained below:
The breadth traversal of a graph is roughly analogous to pre-order traversal of an ordered tree. Assume that the traversal has just visited a vertex or, and let W0, W1,......Wk be the vertices near to V. Then we shall next visit W0 and keep W1.....Wk  waiting. After visiting W0  we traverse all the vertices to which it is near before returning to traverse W1, W2, ........Wk.

b) Breadth first traversal: of a graph is around analogous to level by level traversal of ordered tree. If the traversal has just visited a vertex V, then it next visits all the vertices adjoining to V. Putting the vertices adjoining to these is a waiting list to be traversed after all the vertices adjoining to V have been visited. The figure below shows the order of visiting the vertices of one graph under both DFS and BFS.

1202_traversal.png

DFT = 1 2 3 4 5 6 7 8 9

BFT= 1 2 9 3 5 6 4 7 8

Posted Date: 7/13/2012 2:28:12 AM | Location : United States







Related Discussions:- Graph traversal schemes, Assignment Help, Ask Question on Graph traversal schemes, Get Answer, Expert's Help, Graph traversal schemes Discussions

Write discussion on Graph traversal schemes
Your posts are moderated
Related Questions
In this assignment, you are invited to design and implement a software system for catalogue sale. A catalogue is organised in a tree structure. Each node of the catalogue tree repr

Ask consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is repr

Define the terms     i) Key attribute     ii) Value set  Key attribute:  An entity  type  usually  has  an attribute  whose  values  are  distinct  fr

Q. Write down the binary search algorithm and trace to search element 91 in following given list: 13          30          62           73         81         88             91

The assignment aims at consolidating your knowledge on data mining techniques and developing practical skills through solving a problem of transcription factor binding sites recogn

The class Element represents a single node that can be part of multiple elements on a hotplate and runs in its own thread. The constructor accepts the initial temperature and a hea

An adjacency matrix representation of a graph cannot having information of : Parallel edges

Ask queConsider the following functional dependencies: Applicant_ID -> Applicant_Name Applicant_ID -> Applicant_Address Position_ID -> Positoin_Title Position_ID -> Date_Position_O

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

The algorithm to delete any node having key from a binary search tree is not simple where as several cases has to be considered. If the node to be deleted contains no sons,