Changeset 75:87623302a68f in lemon0.x for src/work/marci_graph_demo.cc
 Timestamp:
 02/16/04 12:29:48 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@98
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci_graph_demo.cc
r69 r75 95 95 } 96 96 std::cout << std::endl; 97 97 /* 98 98 std::cout << "bfs from the first node" << std::endl; 99 99 bfs<ListGraph> bfs_test(G, G.first<EachNodeIt>()); … … 109 109 } 110 110 std::cout<<std::endl; 111 111 */ 112 112 113 113 std::cout << "augmenting path flow algorithm test..." << std::endl; … … 174 174 //flowG.setTail(v3_t, v2); 175 175 //flowG.setHead(v3_t, s); 176 176 /* 177 177 for(EachNodeIt i=flowG.first<EachNodeIt>(); i.valid(); ++i) { 178 178 std::cout << node_name.get(i) << ": "; … … 189 189 std::cout << node_name.get(flowG.tail(e)) << ""<< cap.get(e) << ">" << node_name.get(flowG.head(e)) << " "; 190 190 } 191 191 */ 192 192 /* 193 193 while (flowG.first<EachEdgeIt>().valid()) { … … 220 220 */ 221 221 222 std::cout << std::endl; 223 //std::cout << "meg jo" << std::flush; 224 225 ListGraph::EdgeMap<int> flow(flowG, 0); 226 MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(flowG, s, t, flow, cap); 227 max_flow_test.run(); 228 229 std::cout << "maximum flow: "<< std::endl; 230 for(EachEdgeIt e=flowG.template first<EachEdgeIt>(); e.valid(); ++e) { 231 std::cout<<"("<<flowG.tail(e)<< ""<<flow.get(e)<<">"<<flowG.head(e)<<") "; 232 } 233 std::cout<<std::endl; 234 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 222 //std::cout << std::endl; 223 224 225 { 226 ListGraph::EdgeMap<int> flow(flowG, 0); 227 MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(flowG, s, t, flow, cap); 228 max_flow_test.run(); 229 230 std::cout << "maximum flow: "<< std::endl; 231 for(EachEdgeIt e=flowG.template first<EachEdgeIt>(); e.valid(); ++e) { 232 std::cout<<"("<<flowG.tail(e)<< ""<<flow.get(e)<<">"<<flowG.head(e)<<") "; 233 } 234 std::cout<<std::endl; 235 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 236 } 237 238 { 239 std::list<NodeIt> S; 240 S.push_back(s); S.push_back(v3); 241 std::list<NodeIt> T; 242 T.push_back(t); 243 244 ListGraph::EdgeMap<int> flow(flowG, 0); 245 MaxFlow2<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(flowG, S, T, flow, cap); 246 max_flow_test.run(); 247 248 std::cout << "maximum flow: "<< std::endl; 249 for(EachEdgeIt e=flowG.template first<EachEdgeIt>(); e.valid(); ++e) { 250 std::cout<<"("<<flowG.tail(e)<< ""<<flow.get(e)<<">"<<flowG.head(e)<<") "; 251 } 252 std::cout<<std::endl; 253 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 254 } 235 255 236 256 return 0;
Note: See TracChangeset
for help on using the changeset viewer.