Breadth First Traversal (or Search) for a graph is similar to Breadth First Traversal of a tree (See method 2 of this post).
Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs… Read More »
Following two algorithms are generally taught for Minimum Spanning Tree (MST) problem.
Depth-first search (DFS) is an algorithm (or technique) for traversing a graph.
Minimum Spanning Tree (MST) problem: Given connected graph G with positive edge weights, find a min weight set of edges that connects all of the… Read More »