26
26
]
27
27
match = maximum_weight_matching (g, CbcSolver (), w)
28
28
@test match. mate[1 ] == 3
29
- @test match. weight == 3
29
+ @test match. weight ≈ 3
30
30
31
31
g = CompleteBipartiteGraph (2 ,2 )
32
32
w = zeros (4 ,4 )
@@ -35,7 +35,7 @@ w[1,4] = 1.
35
35
w[2 ,3 ] = 2.
36
36
w[2 ,4 ] = 11.
37
37
match = maximum_weight_maximal_matching (g, CbcSolver (), w)
38
- @test match. weight == 21
38
+ @test match. weight ≈ 21
39
39
@test match. mate[1 ] == 3
40
40
@test match. mate[3 ] == 1
41
41
@test match. mate[2 ] == 4
@@ -48,7 +48,7 @@ w[1,4] = 0.5
48
48
w[2 ,3 ] = 11
49
49
w[2 ,4 ] = 1
50
50
match = maximum_weight_maximal_matching (g, CbcSolver (), w)
51
- @test match. weight == 11.5
51
+ @test match. weight ≈ 11.5
52
52
@test match. mate[1 ] == 4
53
53
@test match. mate[4 ] == 1
54
54
@test match. mate[2 ] == 3
@@ -63,7 +63,7 @@ w[2,4] = 1
63
63
w[2 ,5 ] = - 1
64
64
w[2 ,6 ] = - 1
65
65
match = maximum_weight_maximal_matching (g,CbcSolver (),w,0 )
66
- @test match. weight == 11.5
66
+ @test match. weight ≈ 11.5
67
67
@test match. mate[1 ] == 4
68
68
@test match. mate[4 ] == 1
69
69
@test match. mate[2 ] == 3
@@ -78,7 +78,7 @@ w[1,6] = 1
78
78
w[1 ,5 ] = - 1
79
79
80
80
match = maximum_weight_maximal_matching (g,CbcSolver (),w,0 )
81
- @test match. weight == 12
81
+ @test match. weight ≈ 12
82
82
@test match. mate[1 ] == 6
83
83
@test match. mate[2 ] == 5
84
84
@test match. mate[3 ] == - 1
@@ -92,7 +92,7 @@ w[1,2] = 1
92
92
w[3 ,2 ] = 1
93
93
w[1 ,3 ] = 1
94
94
match = maximum_weight_matching (g,CbcSolver (),w)
95
- @test match. weight == 1
95
+ @test match. weight ≈ 1
96
96
97
97
98
98
g = Graph (4 )
@@ -106,7 +106,7 @@ w[1,4] = 3
106
106
w[2 ,4 ] = 1
107
107
108
108
match = maximum_weight_matching (g,CbcSolver (),w)
109
- @test match. weight == 3
109
+ @test match. weight ≈ 3
110
110
@test match. mate[1 ] == 4
111
111
@test match. mate[2 ] == - 1
112
112
@test match. mate[3 ] == - 1
@@ -118,7 +118,7 @@ add_edge!(g, 2,3)
118
118
add_edge! (g, 3 ,1 )
119
119
add_edge! (g, 3 ,4 )
120
120
match = maximum_weight_matching (g,CbcSolver ())
121
- @test match. weight == 2
121
+ @test match. weight ≈ 2
122
122
@test match. mate[1 ] == 2
123
123
@test match. mate[2 ] == 1
124
124
@test match. mate[3 ] == 4
@@ -131,7 +131,7 @@ w[1,3] = 1
131
131
w[3 ,4 ] = 1
132
132
133
133
match = maximum_weight_matching (g,CbcSolver (), w)
134
- @test match. weight == 2
134
+ @test match. weight ≈ 2
135
135
@test match. mate[1 ] == 2
136
136
@test match. mate[2 ] == 1
137
137
@test match. mate[3 ] == 4
@@ -144,7 +144,7 @@ w[1,3] = 5
144
144
w[3 ,4 ] = 1
145
145
146
146
match = maximum_weight_matching (g,CbcSolver (),w)
147
- @test match. weight == 5
147
+ @test match. weight ≈ 5
148
148
@test match. mate[1 ] == 3
149
149
@test match. mate[2 ] == - 1
150
150
@test match. mate[3 ] == 1
@@ -169,7 +169,7 @@ match = minimum_weight_perfect_matching(g, w)
169
169
@test match. mate[2 ] == 1
170
170
@test match. mate[3 ] == 4
171
171
@test match. mate[4 ] == 3
172
- @test match. weight == 600
172
+ @test match. weight ≈ 600
173
173
174
174
w = Dict (
175
175
Edge (1 , 2 ) => 500 ,
@@ -184,7 +184,7 @@ match = minimum_weight_perfect_matching(g, w)
184
184
@test match. mate[2 ] == 4
185
185
@test match. mate[3 ] == 1
186
186
@test match. mate[4 ] == 2
187
- @test match. weight == 1400
187
+ @test match. weight ≈ 1400
188
188
189
189
g = CompleteBipartiteGraph (2 ,2 )
190
190
w = Dict {Edge,Float64} ()
@@ -198,7 +198,7 @@ match = minimum_weight_perfect_matching(g, w)
198
198
@test match. mate[4 ] == 1
199
199
@test match. mate[2 ] == 3
200
200
@test match. mate[3 ] == 2
201
- @test match. weight == - 11.5
201
+ @test match. weight ≈ - 11.5
202
202
203
203
204
204
g = CompleteGraph (4 )
@@ -214,4 +214,4 @@ match = minimum_weight_perfect_matching(g, w, 50)
214
214
@test match. mate[4 ] == 1
215
215
@test match. mate[2 ] == 3
216
216
@test match. mate[3 ] == 2
217
- @test match. weight == 11.5
217
+ @test match. weight ≈ 11.5
0 commit comments