Module hopcroft_karp

Module hopcroft_karp 

Source
Expand description

Hopcroft-Karp maximum bipartite matching. Hopcroft-Karp maximum bipartite matching.

Finds the maximum matching in a bipartite graph using alternating BFS and DFS phases, achieving O(E · √V) — significantly faster than the naive O(V · E) augmenting-path approach for large graphs.

Structs§

BipartiteMatching
The result of a Hopcroft-Karp bipartite matching computation.

Functions§

hopcroft_karp
Computes the maximum bipartite matching using the Hopcroft-Karp algorithm.