|
1 | 1 | using Graphs |
2 | 2 | using GraphsMatching |
3 | 3 | using Test |
4 | | -using Cbc |
| 4 | +using HiGHS |
5 | 5 | using JuMP |
6 | 6 | using LinearAlgebra: I |
7 | 7 |
|
|
21 | 21 | w = transpose(w) * w |
22 | 22 | match_sol = maximum_weight_matching( |
23 | 23 | g, |
24 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 24 | + HiGHS.Optimizer, |
25 | 25 | w, |
26 | 26 | ) |
27 | 27 | match_red = maximum_weight_matching_reduction(g, w) |
|
44 | 44 | ] |
45 | 45 | match = maximum_weight_matching( |
46 | 46 | g, |
47 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 47 | + HiGHS.Optimizer, |
48 | 48 | w, |
49 | 49 | ) |
50 | 50 | @test match.mate[1] == 3 |
|
57 | 57 | w[1, 3] = 1 |
58 | 58 | match = maximum_weight_matching( |
59 | 59 | g, |
60 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 60 | + HiGHS.Optimizer, |
61 | 61 | w, |
62 | 62 | ) |
63 | 63 | @test match.weight ≈ 1 |
|
75 | 75 |
|
76 | 76 | match = maximum_weight_matching( |
77 | 77 | g, |
78 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 78 | + HiGHS.Optimizer, |
79 | 79 | w, |
80 | 80 | ) |
81 | 81 | @test match.weight ≈ 3 |
|
91 | 91 | add_edge!(g, 3, 4) |
92 | 92 | match = maximum_weight_matching( |
93 | 93 | g, |
94 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 94 | + HiGHS.Optimizer, |
95 | 95 | ) |
96 | 96 | @test match.weight ≈ 2 |
97 | 97 | @test match.mate[1] == 2 |
|
107 | 107 |
|
108 | 108 | match = maximum_weight_matching( |
109 | 109 | g, |
110 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 110 | + HiGHS.Optimizer, |
111 | 111 | w, |
112 | 112 | ) |
113 | 113 | @test match.weight ≈ 2 |
|
124 | 124 |
|
125 | 125 | match = maximum_weight_matching( |
126 | 126 | g, |
127 | | - optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 127 | + HiGHS.Optimizer, |
128 | 128 | w, |
129 | 129 | ) |
130 | 130 | @test match.weight ≈ 5 |
|
147 | 147 | g, |
148 | 148 | w, |
149 | 149 | algorithm = LPAlgorithm(), |
150 | | - optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 150 | + optimizer = HiGHS.Optimizer, |
151 | 151 | ) |
152 | 152 | @test match.weight ≈ 21 |
153 | 153 | @test match.mate[1] == 3 |
|
165 | 165 | g, |
166 | 166 | w, |
167 | 167 | algorithm = LPAlgorithm(), |
168 | | - optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 168 | + optimizer = HiGHS.Optimizer, |
169 | 169 | ) |
170 | 170 | @test match.weight ≈ 11.5 |
171 | 171 | @test match.mate[1] == 4 |
|
185 | 185 | g, |
186 | 186 | w, |
187 | 187 | algorithm = LPAlgorithm(), |
188 | | - optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 188 | + optimizer = HiGHS.Optimizer, |
189 | 189 | cutoff = 0, |
190 | 190 | ) |
191 | 191 | @test match.weight ≈ 11.5 |
|
206 | 206 | g, |
207 | 207 | w, |
208 | 208 | algorithm = LPAlgorithm(), |
209 | | - optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0), |
| 209 | + optimizer = HiGHS.Optimizer, |
210 | 210 | cutoff = 0, |
211 | 211 | ) |
212 | 212 | @test match.weight ≈ 12 |
|
0 commit comments