# HG changeset patch
# User Balazs Dezso <deba@inf.elte.hu>
# Date 1235243941 -3600
# Node ID 926295286bdb51ee3cb4c9937296a0d5a728fdfa
# Parent 33085d6328e470d6ad8cc11f1616bebb4f08066c
Add missing header to gomory_hu_tree.h header and fix test (ticket #66)
diff -r 33085d6328e4 -r 926295286bdb lemon/gomory_hu_tree.h
a
|
b
|
|
19 | 19 | #ifndef LEMON_GOMORY_HU_TREE_H |
20 | 20 | #define LEMON_GOMORY_HU_TREE_H |
21 | 21 | |
| 22 | #include <limits> |
| 23 | |
22 | 24 | #include <lemon/preflow.h> |
23 | 25 | #include <lemon/concept_check.h> |
24 | 26 | #include <lemon/concepts/maps.h> |
diff -r 33085d6328e4 -r 926295286bdb test/Makefile.am
a
|
b
|
|
16 | 16 | test/dim_test \ |
17 | 17 | test/edge_set_test \ |
18 | 18 | test/error_test \ |
| 19 | test/gomory_hu_test \ |
19 | 20 | test/graph_copy_test \ |
20 | 21 | test/graph_test \ |
21 | 22 | test/graph_utils_test \ |
diff -r 33085d6328e4 -r 926295286bdb test/gomory_hu_test.cc
a
|
b
|
|
24 | 24 | "3\n" |
25 | 25 | "4\n" |
26 | 26 | "@arcs\n" |
27 | | " label length\n" |
| 27 | " label capacity\n" |
28 | 28 | "0 1 0 1\n" |
29 | 29 | "1 2 1 1\n" |
30 | 30 | "2 3 2 1\n" |
… |
… |
|
48 | 48 | Node s = graph.u(e); |
49 | 49 | Node t = graph.v(e); |
50 | 50 | |
51 | | if (cut[s] && !cut[t]) { |
| 51 | if (cut[s] != cut[t]) { |
52 | 52 | sum += capacity[e]; |
53 | 53 | } |
54 | 54 | } |
… |
… |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | | int main(int argc, const char *argv[]) { |
| 59 | int main() { |
60 | 60 | Graph graph; |
61 | 61 | IntEdgeMap capacity(graph); |
62 | 62 | |
… |
… |
|
68 | 68 | ght.init(); |
69 | 69 | ght.run(); |
70 | 70 | |
71 | | |
72 | | int cnt = 0; |
73 | | std::cerr << countNodes(graph) << std::endl; |
74 | 71 | for (NodeIt u(graph); u != INVALID; ++u) { |
75 | | std::cerr << ++cnt << std::endl; |
76 | | int bcnt = 0; |
77 | 72 | for (NodeIt v(graph); v != u; ++v) { |
78 | 73 | Preflow<Graph, IntEdgeMap> pf(graph, capacity, u, v); |
79 | 74 | pf.runMinCut(); |