Algo 4
Algo 4
• SPANNING TREE
E=
•This algorithm is for obtaining minimum spanning tree by selecting the adjacent vertices of already selected
vertices.
•Prim’s algorithm initiates with a node.
•It traverses one node more than one time to get the minimum distance.
•Prim’s algorithm gives connected component as well as it works only on connected graph.
•Prim’s algorithm runs faster in dense graphs.
Facts About Kruskal’s Algorithm:
•This algorithm is for obtaining minimum spanning tree but it is not necessary to choose adjacent vertices of
already selected vertices.
•Kruskal’s algorithm selects the edges in a way that the position of the edge is not based on the last step.
•Kruskal’s algorithm can generate forest (disconnected components) at any instance as well as it can work on
disconnected components.