Changeset 762:511200bdb71f in lemon-0.x for src/work/marci/max_flow_demo.cc
- Timestamp:
- 08/17/04 13:20:16 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1024
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/max_flow_demo.cc
r652 r762 8 8 #include <hugo/time_measure.h> 9 9 //#include <graph_wrapper.h> 10 #include <max_flow.h> 10 #include <hugo/max_flow.h> 11 #include <augmenting_flow.h> 11 12 //#include <preflow_res.h> 12 #include < hugo/for_each_macros.h>13 #include <for_each_macros.h> 13 14 #include <graph_concept.h> 14 15 … … 39 40 40 41 //typedef FullFeatureGraphConcept Graph; 41 typedef SmartGraph Graph;42 //typedef SageGraph Graph;42 //typedef SmartGraph Graph; 43 typedef SageGraph Graph; 43 44 typedef Graph::Node Node; 44 45 typedef Graph::EdgeIt EdgeIt; … … 76 77 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 77 78 max_flow_test(g, s, t, cap, flow); 79 AugmentingFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 80 augmenting_flow_test(g, s, t, cap, flow); 81 78 82 Graph::NodeMap<bool> cut(g); 79 83 … … 124 128 ts.reset(); 125 129 int i=0; 126 while ( max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }127 std::cout << "elapsed time: " << ts << std::endl; 128 std::cout << "number of augmentation phases: " << i << std::endl; 129 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;130 while (augmenting_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 131 std::cout << "elapsed time: " << ts << std::endl; 132 std::cout << "number of augmentation phases: " << i << std::endl; 133 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 130 134 131 135 FOR_EACH_LOC(Graph::EdgeIt, e, g) { … … 153 157 ts.reset(); 154 158 int i=0; 155 while ( max_flow_test.augmentOnBlockingFlow2()) { ++i; }156 std::cout << "elapsed time: " << ts << std::endl; 157 std::cout << "number of augmentation phases: " << i << std::endl; 158 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;159 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 160 std::cout << "elapsed time: " << ts << std::endl; 161 std::cout << "number of augmentation phases: " << i << std::endl; 162 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 159 163 160 164 FOR_EACH_LOC(Graph::EdgeIt, e, g) { … … 171 175 ts.reset(); 172 176 int i=0; 173 while ( max_flow_test.augmentOnShortestPath()) { ++i; }174 std::cout << "elapsed time: " << ts << std::endl; 175 std::cout << "number of augmentation phases: " << i << std::endl; 176 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;177 while (augmenting_flow_test.augmentOnShortestPath()) { ++i; } 178 std::cout << "elapsed time: " << ts << std::endl; 179 std::cout << "number of augmentation phases: " << i << std::endl; 180 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 177 181 178 182 FOR_EACH_LOC(Graph::EdgeIt, e, g) { … … 189 193 ts.reset(); 190 194 int i=0; 191 while ( max_flow_test.augmentOnShortestPath2()) { ++i; }192 std::cout << "elapsed time: " << ts << std::endl; 193 std::cout << "number of augmentation phases: " << i << std::endl; 194 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;195 while (augmenting_flow_test.augmentOnShortestPath2()) { ++i; } 196 std::cout << "elapsed time: " << ts << std::endl; 197 std::cout << "number of augmentation phases: " << i << std::endl; 198 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 195 199 196 200 FOR_EACH_LOC(Graph::EdgeIt, e, g) {
Note: See TracChangeset
for help on using the changeset viewer.