You are on page 1of 2

Prims Kruskal’s

This algorithm is for obtaining minimum This algorithm is for obtaining minimum spanning tree but it
spanning tree by selecting the adjacent is not necessary to choose adjacent vertices of already
vertices of already selected vertices. selected vertices.

Prim’s algorithm initializes with a node Kruskal’s algorithm initiates with an edge

Prim’s algorithms span from one node to Kruskal’s algorithm select the edges in a way that the
another position of the edge is not based on the last step

In prim’s algorithm, graph must be a Kruskal’s can function on disconnected graphs too.
connected graph
Prims Kruskal’s

Prim’s algorithm has a time complexity of Kruskal’s time complexity is O(E lgE ) or O(E lgV )
O(E lgV )

You might also like