Hopcroft–Karp algorithm
Builds on Bipartite graphMatchingPathAlgorithm
Definition
Let be a finite bipartite graph with vertex classes and , and let be a matching in . A vertex is free if it lies on no edge of . An augmenting path for is a path between two distinct free vertices whose edges alternate between edges not in and edges in .
The Hopcroft–Karp algorithm is the following algorithm.
- Start with .
- Find the least length of an augmenting path for ; if there is none, return .
- Choose a maximal set of pairwise vertex-disjoint augmenting paths of length .
- Replace by the symmetric difference , where each is seen as a set of edges, and return to step 2.
Each pass through steps 2 to 4 is a phase.
Remarks
Example: let and with edges , and . In the first phase , and a maximal set of disjoint single edges is , which is already a perfect matching. If instead the first phase chooses , the second phase uses the augmenting path of length and gives the same size .
Non-example: the path is not augmenting for , because is not free.
By Berge's theorem, a matching is maximum if and only if it has no augmenting path, so the output is a maximum matching. Step 2 uses breadth-first search and step 3 uses depth-first search, so each phase takes time . There are phases, so the total time is , where is the number of vertices and the number of edges.
Reading path
To understand this page from the ground up, read these 5 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Algorithm concept
- Bipartite graph concept
- Matching concept
- Path concept
- Hopcroft–Karp algorithm definition
Further reading
About this page
| Tag | KN5KTC6KNW |
|---|---|
| URI | m2://KN5KTC6KNW |
| Kind | definition |
| Writing | W0 stub |
| MSC | 05C70, 05C85, 68W40 |
| Defines | Hopcroft–Karp algorithm |
| Uses | Bipartite graph, Matching, Path, Algorithm |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.