Kruskal's Algorithm

A Greedy Algorithm for Minimum Spanning Tree

Steps of Kruskal's Algorithm

  1. Sort all edges in non-decreasing order of their weight.
  2. Pick the smallest edge. Check if it forms a cycle with the MST formed so far.
  3. If no cycle is formed, add it to the MST. Otherwise, discard it.
  4. Repeat until there are (V-1) edges in the MST, where V is the number of vertices.
For more details