JuliaGraphs / JuliaGraphs/GraphsMatching.jl
2-node graphs and same-weight graphs error
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 20
- Forks
- 8
- Avg merge
- 9h 15m
- Merged PRs (30d)
- 1
Description
MWE:
minimum_weight_perfect_matching(Graph([Edge(1,2)]), Dict(Edge(1,2)=>2.0))
ERROR: InexactError: trunc(Int32, NaN)
Stacktrace:
[1] trunc
@ ./float.jl:760 [inlined]
[2] round
@ ./float.jl:359 [inlined]
[3] minimum_weight_perfect_matching(g::SimpleGraph{Int64}, w::Dict{Graphs.SimpleGraphs.SimpleEdge{Int64}, Float64}; tmaxscale::Float64)
@ GraphsMatching ~/.julia/packages/GraphsMatching/f764e/src/blossomv.jl:40
[4] minimum_weight_perfect_matching(g::SimpleGraph{Int64}, w::Dict{Graphs.SimpleGraphs.SimpleEdge{Int64}, Float64})
@ GraphsMatching ~/.julia/packages/GraphsMatching/f764e/src/blossomv.jl:33
[5] top-level scope
@ REPL[558]:1
This fails due to the rescaling of weights which assumes that there are different weights:
https://github.com/JuliaGraphs/GraphsMatching.jl/blob/7d14c0b345eb701f86ff20236e26a8a050994932/src/blossomv.jl#L34-L41
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the two-node example from the issue, then inspect src/blossomv.jl around lines 34-41 where minimum_weight_perfect_matching rescales weights. Check the behavior when all weights are equal, and verify that the example completes without the InexactError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100