[BUG] different JuMP optimizers give different results in `maximum_weight_matching`
@Krastanov is already working on this.
Since Jul 14, 2025.
Assessment
This issue has not been assessed yet.
Description
Description of bug
In edge cases with poorly defined matching problems (e.g. empty graphs), JuMP behaves differently depending on the solver being used, leading to unhelpful errors instead of returning an empty matching.
How to reproduce
using Graphs
using GraphsMatching
using JuMP: optimizer_with_attributes, MOI
using HiGHS: HiGHS
using Cbc: Cbc
# try either one of these two
opt = optimizer_with_attributes(HiGHS.Optimizer, MOI.Silent() => true)
opt = optimizer_with_attributes(Cbc.Optimizer, MOI.Silent() => true)
g = SimpleGraph{Int64}(0, [Int64[]])
w = [0;;]
maximum_weight_matching(g,opt,w)
Expected behavior
Return an empty matching.
Actual behavior
For some optimizers, an error is raised.
- Dominant language
- Julia
- Stars
- 20
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphs/GraphsMatching.jl
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaGraphs/GraphsMatching.jl#14 · 27 comments · 4 reactions ·
-
Segfault in `maximum_weight_perfect_matching` when the graph does not have a perfect matchingPossibly taken @etiennedeg claimed this 920 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaGraphs/GraphsMatching.jl#7 · 4 comments ·
All issues in JuliaGraphs/GraphsMatching.jl
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
JuliaStats/LogExpFunctions.jl#134 · 2 comments ·
-
code bug PowerSystems 6.0
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/PowerSystems.jl#1849 ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FluxML/Metalhead.jl#407 ·
Maintainers usually reply within 1 day