Changeset 206:47f62d789fe7 in lemon-0.x for src/work/marci
- Timestamp:
- 03/19/04 10:09:20 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@298
- Location:
- src/work/marci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/dimacs.h
r180 r206 26 26 getline(is, str); 27 27 break; 28 // case 't': //type29 // getline(is, str);30 // break;31 28 case 'p': //problem definition 32 29 is >> problem >> n >> m; -
src/work/marci/edmonds_karp_demo.cc
r188 r206 35 35 typedef ListGraph MutableGraph; 36 36 37 //typedef SmartGraph Graph;38 typedef ListGraph Graph;37 typedef SmartGraph Graph; 38 //typedef ListGraph Graph; 39 39 typedef Graph::Node Node; 40 40 typedef Graph::EdgeIt EdgeIt; … … 115 115 116 116 { 117 std::cout << "SmartGraph..." << std::endl; 118 std::cout << "edmonds karp demo (physical blocking flow 1 augmentation)..." << std::endl; 119 Graph::EdgeMap<int> flow(G); //0 flow 120 121 Timer ts; 122 ts.reset(); 123 124 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap); 125 //max_flow_test.augmentWithBlockingFlow<Graph>(); 126 int i=0; 127 while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { 128 // for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 129 // std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") "; 130 // } 131 // std::cout<<std::endl; 132 ++i; 133 } 134 135 // std::cout << "maximum flow: "<< std::endl; 136 // for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 137 // std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") "; 138 // } 139 // std::cout<<std::endl; 140 std::cout << "elapsed time: " << ts << std::endl; 141 std::cout << "number of augmentation phases: " << i << std::endl; 142 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 143 } 144 145 { 117 146 std::cout << "edmonds karp demo (on-the-fly blocking flow augmentation)..." << std::endl; 118 147 Graph::EdgeMap<int> flow(G); //0 flow
Note: See TracChangeset
for help on using the changeset viewer.