|
21 | 21 | g1t = GenericGraph(SimpleGraph(edges1)) |
22 | 22 | @test res1.weight == cost_mst |
23 | 23 | # acyclic graphs have n - c edges |
24 | | - @test nv(g1t) - ne(g1t) == length(connected_components(g1t)) == count_connected_components(g1t) |
| 24 | + @test nv(g1t) - ne(g1t) == |
| 25 | + length(connected_components(g1t)) == |
| 26 | + count_connected_components(g1t) |
25 | 27 | @test nv(g1t) == nv(g) |
26 | 28 |
|
27 | 29 | res2 = boruvka_mst(g, distmx; minimize=false) |
28 | 30 | edges2 = [Edge(src(e), dst(e)) for e in res2.mst] |
29 | 31 | g2t = GenericGraph(SimpleGraph(edges2)) |
30 | 32 | @test res2.weight == cost_max_vec_mst |
31 | | - @test nv(g2t) - ne(g2t) == length(connected_components(g2t)) == count_connected_components(g2t) |
| 33 | + @test nv(g2t) - ne(g2t) == |
| 34 | + length(connected_components(g2t)) == |
| 35 | + count_connected_components(g2t) |
32 | 36 | @test nv(g2t) == nv(g) |
33 | 37 | end |
34 | 38 | # second test |
|
60 | 64 | edges3 = [Edge(src(e), dst(e)) for e in res3.mst] |
61 | 65 | g3t = GenericGraph(SimpleGraph(edges3)) |
62 | 66 | @test res3.weight == weight_vec2 |
63 | | - @test nv(g3t) - ne(g3t) == length(connected_components(g3t)) == count_connected_components(g3t) |
| 67 | + @test nv(g3t) - ne(g3t) == |
| 68 | + length(connected_components(g3t)) == |
| 69 | + count_connected_components(g3t) |
64 | 70 | @test nv(g3t) == nv(gx) |
65 | 71 |
|
66 | 72 | res4 = boruvka_mst(g, distmx_sec; minimize=false) |
67 | 73 | edges4 = [Edge(src(e), dst(e)) for e in res4.mst] |
68 | 74 | g4t = GenericGraph(SimpleGraph(edges4)) |
69 | 75 | @test res4.weight == weight_max_vec2 |
70 | | - @test nv(g4t) - ne(g4t) == length(connected_components(g4t)) == count_connected_components(g4t) |
| 76 | + @test nv(g4t) - ne(g4t) == |
| 77 | + length(connected_components(g4t)) == |
| 78 | + count_connected_components(g4t) |
71 | 79 | @test nv(g4t) == nv(gx) |
72 | 80 | end |
73 | 81 |
|
|
123 | 131 | edges5 = [Edge(src(e), dst(e)) for e in res5.mst] |
124 | 132 | g5t = GenericGraph(SimpleGraph(edges5)) |
125 | 133 | @test res5.weight == weight_vec3 |
126 | | - @test nv(g5t) - ne(g5t) == length(connected_components(g5t)) == count_connected_components(g5t) |
| 134 | + @test nv(g5t) - ne(g5t) == |
| 135 | + length(connected_components(g5t)) == |
| 136 | + count_connected_components(g5t) |
127 | 137 | @test nv(g5t) == nv(gd) |
128 | 138 |
|
129 | 139 | res6 = boruvka_mst(g, distmx_third; minimize=false) |
130 | 140 | edges6 = [Edge(src(e), dst(e)) for e in res6.mst] |
131 | 141 | g6t = GenericGraph(SimpleGraph(edges6)) |
132 | 142 | @test res6.weight == weight_max_vec3 |
133 | | - @test nv(g6t) - ne(g6t) == length(connected_components(g6t)) == count_connected_components(g6t) |
| 143 | + @test nv(g6t) - ne(g6t) == |
| 144 | + length(connected_components(g6t)) == |
| 145 | + count_connected_components(g6t) |
134 | 146 | @test nv(g6t) == nv(gd) |
135 | 147 | end |
136 | 148 | end |
0 commit comments