Graph Theory37 sections · 1633 units
Open in Course

Kruskal's Time Complexity

(Sorting dominates)

Kruskal's time complexity is O(ElogE)O(E \log E) where EE is the number of edges. Sorting the edges takes O(ElogE)O(E \log E). After sorting, you process each edge once. Union-Find operations (find and union) take nearly O(1)O(1) time with path compression and union by rank.

So the bottleneck is sorting. If edges are already sorted, Kruskal runs in O(Eα(V))O(E \alpha(V)) where α\alpha is the inverse Ackermann function (effectively constant).

Space complexity is O(V)O(V) for the data structures used.