Graph Traversals - Data Structures
Graph Traversals - Data Structures
Graph traversal is technique used for searching a vertex in a graph. The graph traversal is also used
to decide the order of vertices to be visit in the search process. A graph traversal finds the egdes to
be used in the search process without creating loops that means using graph traversal we visit all
verticces of graph without getting into looping path.
There are two graph traversal techniques and they are as follows...
DFS traversal of a graph, produces aspanning treeas final result.Spanning Treeis a graph without
any loops. We useStack data structurewith maximum size of total number of vertices in the graph
to implement DFS traversal of a graph.
Back trackingis coming back to the vertex from which we came to current vertex.
Example
http://btechsmartclass.com/DS/U3_T10.html 1/4
11/1/2017 Graph Traversals :: Data Structures
http://btechsmartclass.com/DS/U3_T10.html 2/4
11/1/2017 Graph Traversals :: Data Structures
http://btechsmartclass.com/DS/U3_T10.html 3/4
11/1/2017 Graph Traversals :: Data Structures
http://btechsmartclass.com/DS/U3_T10.html 4/4