Ad. Algo
Ad. Algo
Technology (GIMT)
GRAPH TRAVERSAL
A graph traversal finds the edges to be used in the search process without creating
loops that means using graph traversal we visit all vertices of graph without getting
into looping path.
Graph Traversal : There are 2 standard methods of graph traversal Breadth-First Search and Depth
First Search .
Breadth First Search(BFS) :
Breadth-First Search (BFS) is a graph traversal algorithm, where we start from a
selected(source) node and traverse the graph level by level, by exploring the
neighbor nodes at each level.
Depth First Search(DFS) :
Depth First Search (DFS) is a graph traversal algorithm, where we start from a
selected(source) node and go into the depth of this node by recursively calling
the DFS function until no children are encountered. When the dead-end is reached,
this algorithm backtracks and starts visiting the other children of the current node.
BFS(Breadth First Search ) :
BFS traversal of a graph, produces a spanning tree as final result.
Spanning tree is a graph without any loops.
We use queue data structure with maximum size of total number of vertices in the graph to
implement BFS traversal of a graph.
Reference : 5. https://www.scaler.com/topics/graph-traversal
-in-data-structures/
6. https://en.wikipedia.org/wiki/Graph_traversal
7. https://www.javatpoint.com/breadth-first-sear
ch-algorithm
8. https://www.javatpoint.com/graph-algorithms
9. http://www.btechsmartclass.com/data_structu
res/graph-traversal-bfs.html
10. https://images.app.goo.gl/1eaXpRPryZ7z6Evf9
11. https://images.app.goo.gl/8WL2XaZyMY47fgpb
7
THANK YOU