Changeset 472:052af4060f3e in lemon0.x for src/work/marci
 Timestamp:
 04/29/04 17:58:34 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@629
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/edmonds_karp_demo.cc
r465 r472 6 6 #include <smart_graph.h> 7 7 #include <dimacs.h> 8 #include <edmonds_karp.h>8 //#include <edmonds_karp.h> 9 9 #include <time_measure.h> 10 10 //#include <graph_wrapper.h> 11 11 #include <preflow.h> 12 #include <preflow_res.h>12 //#include <preflow_res.h> 13 13 #include <for_each_macros.h> 14 14 … … 73 73 Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 74 74 pre_flow_test(G, s, t, cap, flow/*, true*/); 75 Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >76 pre_flow_ize(G, s, t, cap, flow/*, false*/);75 // Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 76 // pre_flow_ize(G, s, t, cap, flow/*, false*/); 77 77 // PreflowRes<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 78 78 // pre_flow_res(G, s, t, cap, flow/*, true*/); 79 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >80 max_flow_test(G, s, t, cap, flow);79 //MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 80 // max_flow_test(G, s, t, cap, flow); 81 81 82 82 { … … 92 92 FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); 93 93 ts.reset(); 94 pre_flow_ ize.preflow(Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);94 pre_flow_test.preflow(Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW); 95 95 std::cout << "elapsed time: " << ts << std::endl; 96 std::cout << "flow value: "<< pre_flow_ ize.flowValue() << std::endl;96 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; 97 97 } 98 98 … … 111 111 ts.reset(); 112 112 int i=0; 113 while ( max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }113 while (pre_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 114 114 std::cout << "elapsed time: " << ts << std::endl; 115 115 std::cout << "number of augmentation phases: " << i << std::endl; 116 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;116 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; 117 117 } 118 118 119 {120 std::cout << "faster physical blocking flow augmentation ..." << std::endl;121 FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);122 ts.reset();123 int i=0;124 while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }125 std::cout << "elapsed time: " << ts << std::endl;126 std::cout << "number of augmentation phases: " << i << std::endl;127 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;128 }119 // { 120 // std::cout << "faster physical blocking flow augmentation ..." << std::endl; 121 // FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); 122 // ts.reset(); 123 // int i=0; 124 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; } 125 // std::cout << "elapsed time: " << ts << std::endl; 126 // std::cout << "number of augmentation phases: " << i << std::endl; 127 // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 128 // } 129 129 130 130 { … … 133 133 ts.reset(); 134 134 int i=0; 135 while ( max_flow_test.augmentOnBlockingFlow2()) { ++i; }135 while (pre_flow_test.augmentOnBlockingFlow2()) { ++i; } 136 136 std::cout << "elapsed time: " << ts << std::endl; 137 137 std::cout << "number of augmentation phases: " << i << std::endl; 138 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;138 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; 139 139 } 140 140 … … 144 144 ts.reset(); 145 145 int i=0; 146 while ( max_flow_test.augmentOnShortestPath()) { ++i; }146 while (pre_flow_test.augmentOnShortestPath()) { ++i; } 147 147 std::cout << "elapsed time: " << ts << std::endl; 148 148 std::cout << "number of augmentation phases: " << i << std::endl; 149 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;149 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; 150 150 } 151 151
Note: See TracChangeset
for help on using the changeset viewer.