We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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:
GraphsMatching.jl/src/blossomv.jl
Lines 34 to 41 in 7d14c0b
The text was updated successfully, but these errors were encountered:
I'm wondering if an acceptable fix to this could be changing the wnew line to:
wnew
wnew[e] = round(Int32, (c-cmin) / max(cmax-cmin, 1) * tmax)
EDIT: An alternative could be to just short-circuit: if all weights are the same, a valid answer is:
mate = collect(reverse(vertices(g))) weight = nv(g) * first(values(w)) / 2 MatchingResult(weight, mate)
Sorry, something went wrong.
fix same-weight bug (issue JuliaGraphs#5)
f9414ee
Fix same-weight bug (issue #5) (#6)
76286e2
* fix same-weight bug (issue #5) * Fix weight * Fix typos * change to first strategy * revert to spaces * correct formatting using blue style --------- Co-authored-by: etienneINSA <[email protected]>
No branches or pull requests
MWE:
This fails due to the rescaling of weights which assumes that there are different weights:
GraphsMatching.jl/src/blossomv.jl
Lines 34 to 41 in 7d14c0b
The text was updated successfully, but these errors were encountered: