The Hopcroft–Karp algorithm finds maximum cardinality matchings in bipartite graphs in time. It is an adaptation of the Edmonds-Karp algorithm for maximum flow, since bipartite matching is equivalent to finding the maximum (integer) flow if the vertices in each partition are considered sources (respectively sinks) of capacity 1. The minimal cut associated with the flow is equivalent to the minimal vertex cover associated with the matching.
Algorithm
- Input: Bipartite graph
- Output: Matching
- repeat
- maximal set of vertex-disjoint shortest augmenting paths
- until
References
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2001) [1990]. "26". Introduction to Algorithms (2nd edition ed.). MIT Press and McGraw-Hill. pp. 696–697. ISBN 0-262-03293-7.
{{cite book}}
:|edition=
has extra text (help)CS1 maint: multiple names: authors list (link)