Please enable JavaScript.
Coggle requires JavaScript to display documents.
PRIM'S ALGORITHM, KRUSKAL'S ALGORITHM - Coggle Diagram
PRIM'S ALGORITHM
Steps to follow
- Initialize the minimum spanning tree with a vertex chosen at random.
- Find all the edges that connect the tree to new vertices, find the minimum and add it to the tree
- Keep repeating step 2 until we get a minimum spanning tree
-
-
-
-
-
-
-
-
KRUSKAL'S ALGORITHM
-
-
-
-
Steps to follow
-
- Pick the smallest edge. Check if it forms a cycle with the spanning tree formed so far. If cycle is not formed, include this edge. Else, discard it.
- Repeat step#2 until there are (V-1) edges in the spanning tree.