Metraipolis › archive › dc_49733f7f08be

Hopcroft–Karp algorithm — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-07T16:54:55.914Z
SHA-256 of the archived text
a669f4b33314fb637daf5b970c6c0aafa1f0850e1581b218a19b1723290a577e
Stable URL of this page
https://metraipolis.com/documento/dc_49733f7f08be

How to cite

Hopcroft–Karp algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_49733f7f08be (Metraipolis archive dc_49733f7f08be, sha256 a669f4b33314fb637daf5b970c6c0aafa1f0850e1581b218a19b1723290a577e)
BibTeX
@misc{dc49733f7f08be,
  title = {Hopcroft–Karp algorithm — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_49733f7f08be; sha256 a669f4b33314fb637daf5b970c6c0aafa1f0850e1581b218a19b1723290a577e},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

In computer science, the Hopcroft–Karp algorithm (sometimes more accurately called the Hopcroft–Karp–Karzanov algorithm) is an algorithm that takes a bipartite graph as input and produces a maximum-cardinality matching as output — a set of as many edges as possible with the property that no two edges share an endpoint. It runs in O ( | E | | V | ) {\displaystyle O(|E|{\sqrt {|V|}})} time in the worst case, where E {\displaystyle E} is set of edges in the graph, V {\displaystyle V} is set of vertices of the graph, and it is assumed that | E | = Ω ( | V | ) {\displaystyle |E|=\Omega (|V|)} . In the case of dense graphs the time bound becomes O ( | V | 2.5 ) {\displaystyle O(|V|^{2.5})} , and for sparse random graphs it runs in time O ( | E | log | V | ) {\displaystyle O(|E|\log |V|)} with high probability. The algorithm was discovered by John Hopcroft and Richard Karp (1973) and independently by Alexander Karzanov (1973). As in previous methods for matching such as the Hungarian algorithm and the work of Edmonds (1965), the Hopcroft–Karp algorithm repeatedly increases the size of a partial matching by finding augmenting paths. These paths are sequences of edges of the graph, which alternate between edges in the matching and edges out of the partial matching, and where the initial and final edge are not in the partial matching. Finding an augmenting path allows us to increment the size of the partial matching, by simply toggling the edges of the augmenting path (putting in the partial matching those that were not, and vice versa). Simpler algorithms for bipartite matching, such as the Ford–Fulkerson algorithm‚ find one augmenting path per iteration: the Hopcroft-Karp algorithm instead finds a maximal set of shortest augmenting paths, so as to ensure that only O ( | V | ) {\displaystyle O({\sqrt {|V|}})} iterations are needed instead of O ( | V | ) {\displaystyle O(|V|)} iterations. The same performance of O ( | E | | V | ) {\displaystyle O(|E|{\sqrt {|V|}})} can be achieved to find maximum-cardinality matchings in arbitrary graphs, with the more complicated algorithm of Micali and Vazirani. The Hopcroft–Karp algorithm can be seen as a special case of Dinic's algorithm for the maximum-flow problem.

Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»).
Fonte: Wikipedia in inglese, voce «Hopcroft–Karp algorithm» — https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm
Wikidata Q1516988 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q1516988
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1374258310, consultata il 2026-10-07T16:24:25.737Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 34dc999044f7f92a71dd12720c7856d67a16f4d3c83a31cddf94daec8a9c2f6b