Bipartite Matching
Use augmenting paths to reassign occupied partners and increase a bipartite matching one edge at a time.
Core idea
For each left vertex, search for an alternating path that ends at a free right vertex. Flipping unmatched and matched edges along that path increases the matching by one.
Read the visualization
A trial edge highlights the current request. When a right vertex is occupied, recursion follows its partner to find another option; a successful chain flips as one augmentation.
Begin with every left and right vertex unmatched.
Complexity and tradeoffs
Time: O(VE). Space: O(V). The DFS-based Hungarian method finds maximum cardinality matching; weighted assignment needs a different variant.
Where it fits
Maximum bipartite matching models worker-job assignment, course selection, and pairing. Weighted assignment and very large sparse graphs use more specialized algorithms.