Skip to content

Add Hopcroft-Karp matching algorithm#291

Open
Robbybp wants to merge 21 commits intoJuliaGraphs:masterfrom
Robbybp:hk-matching
Open

Add Hopcroft-Karp matching algorithm#291
Robbybp wants to merge 21 commits intoJuliaGraphs:masterfrom
Robbybp:hk-matching

Conversation

@Robbybp
Copy link

@Robbybp Robbybp commented Jul 31, 2023

The Hopcroft-Karp algorithm computes a maximum-cardinality matching of a bipartite graph. This algorithm is very useful, and I would like to use it in some other projects.

I'm opening this PR here rather than in GraphsMatching as this PR does not add dependencies, and there has been some talk, e.g. in #191, of adding basic matching functionality to the Graphs.jl repository.

Additions

  • maximum_cardinality_matching function. This accepts a graph, and an optional AbstractMaximumMatchingAlgorithm to specify which algorithm to use (only Hopcroft-Karp is available for now). This design is motivated by the discussion in Rename algorithms by what they return instead of their creator #264.
  • hopcroft_karp_matching function, which implements the Hopcroft-Karp algorithm for maximum cardinality matching on a bipartite graph
  • Tests and basic documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants