Skip to content

Add GraphsMatching NX backend extension for minimum_weight_perfect_matching#6

Open
AJ0070 wants to merge 2 commits intoJuliaGraphs:mainfrom
AJ0070:chore/1
Open

Add GraphsMatching NX backend extension for minimum_weight_perfect_matching#6
AJ0070 wants to merge 2 commits intoJuliaGraphs:mainfrom
AJ0070:chore/1

Conversation

@AJ0070
Copy link
Copy Markdown
Member

@AJ0070 AJ0070 commented May 8, 2026

Add an optional GraphsMatching.jl integration for minimum_weight_perfect_matching(g, weights, NXAlgorithm()).

Changes

  • add GraphsMatching as a weak dependency
  • add ext/NetworkXGraphsGraphsMatchingExt.jl
  • add the NXAlgorithm marker type to the base package
  • implement GraphsMatching.minimum_weight_perfect_matching(..., NXAlgorithm())
    for plain Graphs.jl input and wrapped NetworkXGraph input
  • reuse wrapped NetworkX graphs via a copy, so caller-owned graphs are not mutated
  • mirror GraphsMatching’s float-weight rescaling before dispatching to NetworkX
  • add tests for:
    • extension loading
    • plain Graphs.jl graph input
    • wrapped NetworkXGraph input
    • deterministic weighted examples
    • MatchingResult compatibility
  • add one short README note

Note

This backend is implemented because the semantics are close enough for exact use:
NetworkX’s matching backend is exact for integer weights, and GraphsMatching
already rescales floating-point weights to integers before solving. The extension
also checks that the returned matching is perfect before building the
MatchingResult.

AI Disclosure: I used Codex 5.3. I used it initially to provide me skeleton structure for the code following the directory structure, make test to get successful coverage of changes, debugging the failures(e.g. compilation and test failures), update Readme with respect to my changes and also asked it to verify my implementation if there are any bugs or gaps exists. also used chatgpt to format my PR description in markdown.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@AJ0070
Copy link
Copy Markdown
Member Author

AJ0070 commented May 8, 2026

@Krastanov code-style is failing due to other files unrelated to this. I will fix it in other PR after this is merged.

@AJ0070
Copy link
Copy Markdown
Member Author

AJ0070 commented May 9, 2026

@Krastanov

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant