Changeset 100:f1de2ab64e1c in lemon-0.x for src/work/marci/edmonds_karp_demo.cc
- Timestamp:
- 02/18/04 18:27:13 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@129
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/edmonds_karp_demo.cc
r73 r100 20 20 readDimacsMaxFlow(std::cin, G, s, t, cap); 21 21 22 /* 23 double pre_time_copy=currTime(); 24 ListGraph F; 25 ListGraph::NodeMap<NodeIt> G_to_F(G); 26 typedef ListGraph::EachNodeIt EachNodeIt; 27 for(EachNodeIt n=G.first<EachNodeIt>(); n.valid(); ++n) { 28 G_to_F.set(n, F.addNode()); 29 } 30 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 31 F.addEdge(G_to_F.get(G.tail(e)), G_to_F.get(G.head(e))); 32 } 33 double post_time_copy=currTime(); 34 std::cout << "copy time: " << post_time_copy-pre_time_copy << " sec"<< std::endl; 35 */ 36 22 37 std::cout << "edmonds karp demo..." << std::endl; 23 38 ListGraph::EdgeMap<int> flow(G); //0 flow … … 25 40 double pre_time=currTime(); 26 41 MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap); 42 max_flow_test.augmentWithBlockingFlow(); 27 43 max_flow_test.run(); 28 44 double post_time=currTime();
Note: See TracChangeset
for help on using the changeset viewer.