@@ -77,7 +77,7 @@ function minimum_weight_perfect_matching(
77
77
end
78
78
79
79
function minimum_weight_perfect_matching (
80
- g:: Graph , w:: Dict{E,U} , cutoff, algorithm:: AbstractMinimumWeightPerfectMatchingAlgorithm = LEMONMWPMAlgorithm (); kws...
80
+ g:: Graph , w:: Dict{E,U} , cutoff:: Real , algorithm:: AbstractMinimumWeightPerfectMatchingAlgorithm = LEMONMWPMAlgorithm (); kws...
81
81
) where {U<: Real ,E<: Edge }
82
82
wnew = Dict {E,U} ()
83
83
for (e, c) in w
@@ -111,25 +111,6 @@ function minimum_weight_perfect_matching(
111
111
return MatchingResult (weight, match. mate)
112
112
end
113
113
114
- function minimum_weight_perfect_matching (g:: Graph , w:: Dict{E,U} , :: BlossomVAlgorithm ) where {U<: Integer ,E<: Edge }
115
- m = BlossomV. Matching (nv (g))
116
- for (e, c) in w
117
- BlossomV. add_edge (m, src (e) - 1 , dst (e) - 1 , c)
118
- end
119
- BlossomV. solve (m)
120
-
121
- mate = fill (- 1 , nv (g))
122
- totweight = zero (U)
123
- for i in 1 : nv (g)
124
- j = BlossomV. get_match (m, i - 1 ) + 1
125
- mate[i] = j <= 0 ? - 1 : j
126
- if i < j
127
- totweight += w[Edge (i, j)]
128
- end
129
- end
130
- return MatchingResult (totweight, mate)
131
- end
132
-
133
114
function minimum_weight_perfect_matching (g:: Graph , w:: Dict{E,U} , :: LEMONMWPMAlgorithm ) where {U<: Integer ,E<: Edge }
134
115
max = 2 * abs (maximum (values (w)))
135
116
weights = [- get (w, e, max) for e in edges (g)]
0 commit comments