Graph Theory37 sections · 1633 units
Open in Course

Hopcroft-Karp Algorithm

(Faster maximum matching)

Hopcroft-Karp finds maximum matching in O(EV)O(E \sqrt{V}) by finding multiple augmenting paths per iteration using BFS layering. First, BFS finds the shortest augmenting path length. Then, DFS finds all augmenting paths of that length.

This is faster than Kuhn for large graphs but requires more code. Use it when V>104V > 10^4 and O(VE)O(VE) is too slow. Most competitive programming problems are small enough for Kuhn.

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