Skip to content

Implement Hopcroft-Karp algorithm for maximum bipartite matching. Issue: #214#525

Merged
ZigRazor merged 3 commits intoZigRazor:masterfrom
awesohame:hopcroft-karp
Aug 25, 2025
Merged

Implement Hopcroft-Karp algorithm for maximum bipartite matching. Issue: #214#525
ZigRazor merged 3 commits intoZigRazor:masterfrom
awesohame:hopcroft-karp

Conversation

@awesohame
Copy link
Copy Markdown
Contributor

Implements the Hopcroft-Karp algorithm for finding maximum cardinality matching in bipartite graphs with O(E√V) time complexity.

  • added hopcroftKarp() method to Graph class
  • added 13 test cases to cover different scenarios
  • Updated README.md with algorithm documentation

Pull Request for Issue #214

Added new unit tests for the Hopcroft-Karp algorithm to cover more scenarios and edge cases. This led to a fix for a bug where graphs with no possible matching were handled incorrectly. Also updated the README documentation.
@ZigRazor ZigRazor linked an issue Aug 25, 2025 that may be closed by this pull request
@ZigRazor ZigRazor added enhancement New feature or request development Development of new Functionalities core something about core labels Aug 25, 2025
@ZigRazor ZigRazor added this to the Algorithm Implementation milestone Aug 25, 2025
@awesohame awesohame marked this pull request as draft August 25, 2025 15:14
@awesohame awesohame marked this pull request as ready for review August 25, 2025 16:21
@awesohame
Copy link
Copy Markdown
Contributor Author

@ZigRazor fixed cross-platform compatibility issue, tests now run on macOS and Ubuntu. sorry if I triggered extra CI runs. let me know if anything else is missing.

@ZigRazor
Copy link
Copy Markdown
Owner

It's ok!
Thank you

@ZigRazor ZigRazor merged commit 4737a59 into ZigRazor:master Aug 25, 2025
9 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core something about core development Development of new Functionalities enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Hopcroft–Karp algorithm

2 participants