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
Define an array. Array is made up of same data structure that exists in any language. Array is set of same data types. Array is the collection of same elements. These same elem

Given the following search tree, state the order in which the nodes will be searched for breadth first, depth first, hill climbing and best first search, until a solution is reache

After going through this unit, you will be able to: • define and declare Lists; • understand the terminology of Singly linked lists; • understand the terminology of Doubly

Post order traversal: The children of node are visited before the node itself; the root is visited last. Each node is visited after its descendents are visited. Algorithm fo

Ask question find frequency count of function- {for(i=1;i {for(j=1;j {for(k=1;k } } }

Step 1: Choose a vertex in the graph and make it the source vertex & mark it visited. Step 2: Determine a vertex which is adjacent to the source vertex and begun a new search if

Comparative Study of Linear and Binary Search Binary search is lots quicker than linear search. Some comparisons are following: NUMBER OF ARRAY ELEMENTS EXAMINED array

With the help of a program and a numerical example explain the Depth First Traversal of a tree.

The following formula is used to calculate n: n = x * x/(1 - x) . Value x = 0 is used to stop algorithm. Calculation is repeated using values of x until value x = 0 is input. There

This section prescribes additional exercise with the recursive and iterative handling of a binary search tree. Adding to the Binary Search Tree Recursively Add implementation