Class | Graph algorithm |
---|---|
Data structure | Graph |
Worst-case performance | |
Worst-case space complexity |
In computer science, the Hopcroft–Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching – a set of as many edges as possible with the property that no two edges share an endpoint. It runs in time in the worst case, where is set of edges in the graph, and is set of vertices of the graph. In the case of dense graphs the time bound becomes , and for random graphs it runs in near-linear time.