Kruskal's Algorithm
suggest changeRemarks
Kruskal’s Algorithm is a greedy algorithm used to find Minimum Spanning Tree (MST) of a graph. A minimum spanning tree is a tree which connects all the vertices of the graph and has the minimum total edge weight.
Kruskal’s algorithm does so by repeatedly picking an edge of minimum weight that is not already in the forest and adding it to the result if its endpoints are not yet connected. Otherwise it skips that edge. Union - Find data structure can be used to check whether two vertices are already connected in the MST or not. A few properties of MST are as follows:
- An MST of a graph with
nvertices has exactlyn - 1edges. - There exists a unique path from each vertex to every other vertex.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents