Changeset 303:1b377a730d02 in lemon-0.x for src/work/marci/edmonds_karp_demo.cc
- Timestamp:
- 04/05/04 18:52:46 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@421
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/edmonds_karp_demo.cc
r271 r303 4 4 5 5 #include <list_graph.h> 6 #include <smart_graph.h>6 //#include <smart_graph.h> 7 7 #include <dimacs.h> 8 8 #include <edmonds_karp.h> 9 9 #include <time_measure.h> 10 #include <graph_wrapper.h>10 //#include <graph_wrapper.h> 11 11 12 12 class CM { … … 91 91 92 92 { 93 typedef TrivGraphWrapper<const Graph> GW;94 GW gw(G);95 93 std::cout << "edmonds karp demo (physical blocking flow augmentation)..." << std::endl; 96 GW::EdgeMap<int> flow(gw); //0 flow 97 98 Timer ts; 99 ts.reset(); 100 101 typedef GW::EdgeMapWrapper< Graph::EdgeMap<int>, int > EMW; 102 EMW cw(cap); 103 MaxFlow<GW, int, GW::EdgeMap<int>, EMW > max_flow_test(gw, s, t, flow, cw); 94 Graph::EdgeMap<int> flow(G); //0 flow 95 96 Timer ts; 97 ts.reset(); 98 99 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 100 max_flow_test(G, s, t, flow, cap); 104 101 int i=0; 105 102 while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { … … 122 119 123 120 { 124 typedef TrivGraphWrapper<const Graph> GW;125 GW gw(G);126 121 std::cout << "edmonds karp demo (physical blocking flow 1 augmentation)..." << std::endl; 127 GW::EdgeMap<int> flow(gw); //0 flow 128 129 Timer ts; 130 ts.reset(); 131 132 typedef GW::EdgeMapWrapper< Graph::EdgeMap<int>, int > EMW; 133 EMW cw(cap); 134 MaxFlow<GW, int, GW::EdgeMap<int>, EMW > max_flow_test(gw, s, t, flow, cw); 122 Graph::EdgeMap<int> flow(G); //0 flow 123 124 Timer ts; 125 ts.reset(); 126 127 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 128 max_flow_test(G, s, t, flow, cap); 135 129 int i=0; 136 130 while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { … … 153 147 154 148 { 155 typedef TrivGraphWrapper<const Graph> GW;156 GW gw(G);157 149 std::cout << "edmonds karp demo (on-the-fly blocking flow augmentation)..." << std::endl; 158 GW::EdgeMap<int> flow(gw); //0 flow 159 160 Timer ts; 161 ts.reset(); 162 163 typedef GW::EdgeMapWrapper< Graph::EdgeMap<int>, int > EMW; 164 EMW cw(cap); 165 MaxFlow<GW, int, GW::EdgeMap<int>, EMW > max_flow_test(gw, s, t, flow, cw); 150 Graph::EdgeMap<int> flow(G); //0 flow 151 152 Timer ts; 153 ts.reset(); 154 155 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 156 max_flow_test(G, s, t, flow, cap); 166 157 int i=0; 167 158 while (max_flow_test.augmentOnBlockingFlow2()) { … … 184 175 185 176 { 186 typedef TrivGraphWrapper<const Graph> GW;187 GW gw(G);188 177 std::cout << "edmonds karp demo (on-the-fly shortest path augmentation)..." << std::endl; 189 GW::EdgeMap<int> flow(gw); //0 flow 190 191 Timer ts; 192 ts.reset(); 193 194 typedef GW::EdgeMapWrapper< Graph::EdgeMap<int>, int > EMW; 195 EMW cw(cap); 196 MaxFlow<GW, int, GW::EdgeMap<int>, EMW> max_flow_test(gw, s, t, flow, cw); 178 Graph::EdgeMap<int> flow(G); //0 flow 179 180 Timer ts; 181 ts.reset(); 182 183 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 184 max_flow_test(G, s, t, flow, cap); 197 185 int i=0; 198 186 while (max_flow_test.augmentOnShortestPath()) {
Note: See TracChangeset
for help on using the changeset viewer.