Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hopcroft-Karp matching algorithm #291

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

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