Open thchr opened 1 year ago
I'm wondering if an acceptable fix to this could be changing the wnew
line to:
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)
MWE:
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