Changeset 762:511200bdb71f in lemon-0.x for src/work/marci/lg_vs_sg_vs_sg.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/lg_vs_sg_vs_sg.cc
r643 r762 8 8 #include <hugo/smart_graph.h> 9 9 #include <hugo/dimacs.h> 10 #include <max_flow.h> 10 #include <hugo/max_flow.h> 11 #include <augmenting_flow.h> 11 12 #include <hugo/time_measure.h> 12 #include < hugo/for_each_macros.h>13 #include <for_each_macros.h> 13 14 14 15 using namespace hugo; … … 38 39 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 39 40 max_flow_test(g, s, t, cap, flow/*, true*/); 41 AugmentingFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 42 augmenting_flow_test(g, s, t, cap, flow/*, true*/); 40 43 41 44 std::cout << "SageGraph ..." << std::endl; … … 54 57 ts.reset(); 55 58 int i=0; 56 while ( max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }57 std::cout << "elapsed time: " << ts << std::endl; 58 std::cout << "number of augmentation phases: " << i << std::endl; 59 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;59 while (augmenting_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 60 std::cout << "elapsed time: " << ts << std::endl; 61 std::cout << "number of augmentation phases: " << i << std::endl; 62 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 60 63 } 61 64 … … 76 79 ts.reset(); 77 80 int i=0; 78 while ( max_flow_test.augmentOnBlockingFlow2()) { ++i; }79 std::cout << "elapsed time: " << ts << std::endl; 80 std::cout << "number of augmentation phases: " << i << std::endl; 81 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;81 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 82 std::cout << "elapsed time: " << ts << std::endl; 83 std::cout << "number of augmentation phases: " << i << std::endl; 84 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 82 85 } 83 86 … … 87 90 ts.reset(); 88 91 int i=0; 89 while ( max_flow_test.augmentOnShortestPath()) { ++i; }90 std::cout << "elapsed time: " << ts << std::endl; 91 std::cout << "number of augmentation phases: " << i << std::endl; 92 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;92 while (augmenting_flow_test.augmentOnShortestPath()) { ++i; } 93 std::cout << "elapsed time: " << ts << std::endl; 94 std::cout << "number of augmentation phases: " << i << std::endl; 95 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 93 96 } 94 97 } … … 110 113 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 111 114 max_flow_test(g, s, t, cap, flow/*, true*/); 115 AugmentingFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 116 augmenting_flow_test(g, s, t, cap, flow/*, true*/); 112 117 // MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 113 118 // max_flow_test(g, s, t, cap, flow); … … 129 134 ts.reset(); 130 135 int i=0; 131 while ( max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }132 std::cout << "elapsed time: " << ts << std::endl; 133 std::cout << "number of augmentation phases: " << i << std::endl; 134 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;136 while (augmenting_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 137 std::cout << "elapsed time: " << ts << std::endl; 138 std::cout << "number of augmentation phases: " << i << std::endl; 139 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 135 140 } 136 141 … … 151 156 ts.reset(); 152 157 int i=0; 153 while ( max_flow_test.augmentOnBlockingFlow2()) { ++i; }154 std::cout << "elapsed time: " << ts << std::endl; 155 std::cout << "number of augmentation phases: " << i << std::endl; 156 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;158 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 159 std::cout << "elapsed time: " << ts << std::endl; 160 std::cout << "number of augmentation phases: " << i << std::endl; 161 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 157 162 } 158 163 … … 162 167 ts.reset(); 163 168 int i=0; 164 while ( max_flow_test.augmentOnShortestPath()) { ++i; }165 std::cout << "elapsed time: " << ts << std::endl; 166 std::cout << "number of augmentation phases: " << i << std::endl; 167 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;169 while (augmenting_flow_test.augmentOnShortestPath()) { ++i; } 170 std::cout << "elapsed time: " << ts << std::endl; 171 std::cout << "number of augmentation phases: " << i << std::endl; 172 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 168 173 } 169 174 } … … 185 190 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 186 191 max_flow_test(g, s, t, cap, flow/*, true*/); 192 AugmentingFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 193 augmenting_flow_test(g, s, t, cap, flow/*, true*/); 187 194 // MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 188 195 // max_flow_test(g, s, t, cap, flow); … … 204 211 ts.reset(); 205 212 int i=0; 206 while ( max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }207 std::cout << "elapsed time: " << ts << std::endl; 208 std::cout << "number of augmentation phases: " << i << std::endl; 209 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;213 while (augmenting_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 214 std::cout << "elapsed time: " << ts << std::endl; 215 std::cout << "number of augmentation phases: " << i << std::endl; 216 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 210 217 } 211 218 … … 226 233 ts.reset(); 227 234 int i=0; 228 while ( max_flow_test.augmentOnBlockingFlow2()) { ++i; }229 std::cout << "elapsed time: " << ts << std::endl; 230 std::cout << "number of augmentation phases: " << i << std::endl; 231 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;235 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 236 std::cout << "elapsed time: " << ts << std::endl; 237 std::cout << "number of augmentation phases: " << i << std::endl; 238 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 232 239 } 233 240 … … 237 244 ts.reset(); 238 245 int i=0; 239 while ( max_flow_test.augmentOnShortestPath()) { ++i; }240 std::cout << "elapsed time: " << ts << std::endl; 241 std::cout << "number of augmentation phases: " << i << std::endl; 242 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;246 while (augmenting_flow_test.augmentOnShortestPath()) { ++i; } 247 std::cout << "elapsed time: " << ts << std::endl; 248 std::cout << "number of augmentation phases: " << i << std::endl; 249 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 243 250 } 244 251 } 245 246 247 248 252 249 253 return 0;
Note: See TracChangeset
for help on using the changeset viewer.