@@ -77,7 +77,7 @@ function minimum_weight_perfect_matching(
7777end
7878
7979function 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...
8181) where {U<: Real ,E<: Edge }
8282 wnew = Dict {E,U} ()
8383 for (e, c) in w
@@ -111,25 +111,6 @@ function minimum_weight_perfect_matching(
111111 return MatchingResult (weight, match. mate)
112112end
113113
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-
133114function minimum_weight_perfect_matching (g:: Graph , w:: Dict{E,U} , :: LEMONMWPMAlgorithm ) where {U<: Integer ,E<: Edge }
134115 max = 2 * abs (maximum (values (w)))
135116 weights = [- get (w, e, max) for e in edges (g)]
0 commit comments