Info & Theory
Bipartite matching pairs vertices from two disjoint sets — L (applicants) and R (jobs) — along edges that only ever run between the two sets. A matching is a set of edges sharing no endpoints; the goal is to find one of maximum size.
Augmenting paths
An augmenting path starts and ends at unmatched vertices and alternates: unmatched edge, matched edge, unmatched edge, … Because it begins and ends unmatched, it always contains exactly one more unmatched edge than matched edge.
Why flipping helps
Swapping the matched/unmatched status of every edge on an augmenting path turns each of its endpoints into a matched vertex while keeping every interior vertex matched (just to a different neighbour). The net effect is +1 to the matching size. A matching is maximum exactly when no augmenting path exists — this is the Berge lemma.
Hopcroft–Karp complexity
Searching for one augmenting path with a single DFS from each unmatched vertex costs O(E), and up to V searches may be needed, giving O(V·E) overall. Hopcroft–Karp instead finds a maximal batch of shortest, vertex-disjoint augmenting paths in each phase (one BFS to find shortest-path length, then DFS to extract disjoint paths), needing only O(√V) phases — O(E√V) total.
Kőnig's theorem
In any bipartite graph, the size of a maximum matching equals the size of a minimum vertex cover (the smallest set of vertices touching every edge). This duality, known as Kőnig's theorem, links matching directly to covering and underlies many combinatorial-optimisation results.