Kruskal's Algorithm Steps in Short to find out Minimum Spanning Tree
1. Sort the Edges in The Non-Decreasing Order.
2. Create as many Disjoint Set as many Vertices intially.
3. Pick one edge at a time in non-decreasing order & check both the ends of this edge if they are in the same disjoint set or different, if they are in the different disjoint set , merge them together and save the edge,
else ignore that edge.
1. Sort the Edges in The Non-Decreasing Order.
2. Create as many Disjoint Set as many Vertices intially.
3. Pick one edge at a time in non-decreasing order & check both the ends of this edge if they are in the same disjoint set or different, if they are in the different disjoint set , merge them together and save the edge,
else ignore that edge.
Comments
Post a Comment