⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 48s17 days 22 hours 18 minutes 48 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 48s17 days 22 hours 18 minutes 48 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.