Imagine a hundred job applicants, each qualified for a handful of openings. You want to hire as many people as possible, each to a job they can do, and no two assigned to the same role. This is bipartite matching — one of the most fundamental problems in combinatorial optimization.
The naive approach is to keep finding augmenting paths: routes that start at an unmatched applicant, alternate between unmatched and matched edges, and end at an unmatched job. Flip the edges along such a path and the matching grows by one. Repeat until none remain.
But doing that one path at a time is slow — in the worst case. In 1973, John Hopcroft and Richard Karp published an elegant fix: find all shortest augmenting paths in a single BFS phase, augment along all of them simultaneously, and repeat. The key observation — proved in their original paper — is that after at most √V such phases, the matching is maximum. The total cost is therefore , a result that was proved optimal for dense graphs and remains the standard algorithm decades later.
This article is about what that square root really means: why augmenting in phases is so much better, and why finding a maximum matching at all is in P — firmly on the tractable side of the P vs NP dividing line.
Comments
Loading comments...