Hopcroft–Karp algorithm

This is an old revision of this page, as edited by Anks9b (talk | contribs) at 03:33, 22 April 2008 (Just added the basic definition and the basic idea behind the algorithm. Would add more tomorrow.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Introduction

The Hopcroft–Karp algorithm finds maximum cardinality matchings in bipartite graphs in   time, where V is the number of vertices and E is the number of edges of the graph.[1] [2] In the worst case of dense graphs, i.e., when  , the worst-case time estimate is  .

The algorithm 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.

Instead of finding just a single augmenting path, the algorithm finds a maximal set of shortest paths in each iteration [3]. As a result only   iterations are needed.


Definition

Consider a graph G(V,E). Consider these definitions relative to a matching M in G. An alternating path would be a path in which the edges would belong alternatively to M and E-M. A free vertex is a vertex which has no incoming edges which belong to M. Finally, an augmenting path is an alternating path such that both its end points are free vertices.


Algorithm

The Basic concept that the algorithm relies on is that if we have a matching N of size n, and P is the augmenting path relative to N, then the matching NΔP would have a size of n+1. Thus, since there would be no matching greater in size than the maximum matching, the maximum matching would not have an augmenting path.


References

  1. ^ John E. Hopcroft, Richard M. Karp: An   Algorithm for Maximum Matchings in Bipartite Graphs. SIAM J. Comput. 2(4), 225-231 (1973)
  2. ^ Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2001) [1990]. 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)
  3. ^ Norbert Blum (1999). "A Simplified Realization of the Hopcroft-Karp Approach to Maximum Matching in Nonbipartite Graphs".