Changeset 311:6635b11938fe in lemon-0.x for src/work/marci/edmonds_karp_demo.cc
- Timestamp:
- 04/06/04 14:00:34 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@429
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/edmonds_karp_demo.cc
r305 r311 9 9 #include <time_measure.h> 10 10 //#include <graph_wrapper.h> 11 12 class CM { 13 public: 14 template<typename T> int get(T) const {return 1;} 15 }; 11 #include <preflow.h> 16 12 17 13 using namespace hugo; … … 89 85 // std::cout << "p2:" << cgw.nodeNum() << std::endl; 90 86 91 92 { 93 std::cout << "edmonds karp demo (physical blocking flow augmentation)..." << std::endl; 87 { 88 std::cout << "preflow ..." << std::endl; 89 Graph::EdgeMap<int> flow(G); //0 flow 90 91 Timer ts; 92 ts.reset(); 93 94 Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 95 max_flow_test(G, s, t, cap, flow); 96 max_flow_test.run(); 97 // int i=0; 98 // while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { 99 // for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 100 // std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") "; 101 // } 102 // std::cout<<std::endl; 103 // ++i; 104 // } 105 106 // std::cout << "maximum flow: "<< std::endl; 107 // for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 108 // std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") "; 109 // } 110 // std::cout<<std::endl; 111 std::cout << "elapsed time: " << ts << std::endl; 112 // std::cout << "number of augmentation phases: " << i << std::endl; 113 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 114 } 115 116 { 117 std::cout << "physical blocking flow augmentation ..." << std::endl; 94 118 Graph::EdgeMap<int> flow(G); //0 flow 95 119 … … 119 143 120 144 { 121 std::cout << " edmonds karp demo (physical blocking flow 1 augmentation)..." << std::endl;145 std::cout << "faster physical blocking flow augmentation ..." << std::endl; 122 146 Graph::EdgeMap<int> flow(G); //0 flow 123 147 … … 147 171 148 172 { 149 std::cout << " edmonds karp demo (on-the-fly blocking flow augmentation)..." << std::endl;173 std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; 150 174 Graph::EdgeMap<int> flow(G); //0 flow 151 175 … … 175 199 176 200 { 177 std::cout << " edmonds karp demo (on-the-fly shortest path augmentation)..." << std::endl;201 std::cout << "on-the-fly shortest path augmentation ..." << std::endl; 178 202 Graph::EdgeMap<int> flow(G); //0 flow 179 203
Note: See TracChangeset
for help on using the changeset viewer.