Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 40s1 days 16 hours 1 minutes 40 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 40s1 days 16 hours 1 minutes 40 seconds.

Sign in to watch this lesson
Advanced - Graphs · 5:21
A matching in a bipartite graph grows by one whenever we flip an augmenting path, an alternating path whose two ends are free, and Berge's lemma says a matching with no augmenting path is maximum. Kuhn's algorithm runs one depth-first search per left vertex, clearing the visited array each time, for O(n₁·m) in total, so the smaller side belongs on the left. König's theorem then turns the maximum matching into a minimum vertex cover, which solves problems such as covering every flagged cell of a grid with the fewest rows and columns.