1.1 --- a/src/work/marci/leda/bipartite_matching_leda.cc Thu Apr 29 16:45:40 2004 +0000
1.2 +++ b/src/work/marci/leda/bipartite_matching_leda.cc Thu Apr 29 16:59:00 2004 +0000
1.3 @@ -18,8 +18,7 @@
1.4 //#include <bfs_iterator.h>
1.5 #include <graph_wrapper.h>
1.6 #include <maps.h>
1.7 -#include <edmonds_karp.h>
1.8 -#include <preflow.h>
1.9 +#include <max_flow.h>
1.10
1.11 /**
1.12 * Inicializalja a veletlenszamgeneratort.
1.13 @@ -101,10 +100,12 @@
1.14 ConstMap<stGW::Edge, int> const1map(1);
1.15
1.16 Timer ts;
1.17 + stGW::EdgeMap<int> flow(stgw);
1.18 + MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
1.19 + max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow);
1.20 +
1.21 ts.reset();
1.22 - stGW::EdgeMap<int> max_flow(stgw);
1.23 - MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
1.24 - max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, max_flow);
1.25 + FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
1.26 // while (max_flow_test.augmentOnShortestPath()) { }
1.27 typedef ListGraph MutableGraph;
1.28 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
1.29 @@ -113,35 +114,17 @@
1.30 }
1.31 std::cout << "max flow value: " << max_flow_test.flowValue() << std::endl;
1.32 std::cout << "elapsed time: " << ts << std::endl;
1.33 -// FOR_EACH_LOC(stGW::EdgeIt, e, stgw) {
1.34 -// std::cout << e << ": " << max_flow[e] << "\n";
1.35 -// }
1.36 -// std::cout << "\n";
1.37
1.38 ts.reset();
1.39 - stGW::EdgeMap<int> pre_flow(stgw);
1.40 - Preflow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
1.41 - pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow/*, true*/);
1.42 - pre_flow_test.run();
1.43 + FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
1.44 + max_flow_test.run();
1.45 std::cout << "pre flow value: " << max_flow_test.flowValue() << std::endl;
1.46 std::cout << "elapsed time: " << ts << std::endl;
1.47 -// FOR_EACH_LOC(stGW::EdgeIt, e, stgw) {
1.48 -// std::cout << e << ": " << pre_flow[e] << "\n";
1.49 -// }
1.50 -// std::cout << "\n";
1.51
1.52 ts.reset();
1.53 leda_list<leda_edge> ml=MAX_CARD_BIPARTITE_MATCHING(lg);
1.54 - // stGW::EdgeMap<int> pre_flow(stgw);
1.55 - //Preflow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
1.56 - // pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow, true);
1.57 - //pre_flow_test.run();
1.58 std::cout << "leda matching value: " << ml.size() << std::endl;
1.59 std::cout << "elapsed time: " << ts << std::endl;
1.60 -// FOR_EACH_LOC(stGW::EdgeIt, e, stgw) {
1.61 -// std::cout << e << ": " << pre_flow[e] << "\n";
1.62 -// }
1.63 -// std::cout << "\n";
1.64
1.65 return 0;
1.66 }