Minimum Spanning Tree

Module 4.10 — Kruskal's and Prim's algorithms

Graph:
Algorithm:
Speed:
Step 0 / 0
4265103187ABCDEF

MST Edges (0/5)Total: 0

Sorted Edges

CF1
AD2
CE3
AB4
BD5
BC6
EF7
DE8
BE10

Comparison

Kruskal's
O(E log E)
Sort + Union-Find
Edge-centric
Prim's
O((V+E) log V)
Priority queue
Vertex-centric

MST Properties

• Connects all V vertices with V-1 edges
• Minimum total edge weight
• No cycles
• May not be unique if equal-weight edges exist