Changeset 87:46705346edd4 in lemon-0.x for src/work/marci
- Timestamp:
- 02/17/04 12:24:21 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@114
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/preflow_demo_jacint.cc
r82 r87 5 5 #include <dimacs.hh> 6 6 #include <preflow_push_max_flow.h> 7 #include <preflow_push_hl.h> 7 8 #include <time_measure.h> 8 9 … … 20 21 readDimacsMaxFlow(std::cin, G, s, t, cap); 21 22 22 std::cout << "preflow demo (JACINT)..." << std::endl; 23 { 24 std::cout << "preflow demo (preflow_push_max_flow by JACINT)..." << std::endl; 23 25 //ListGraph::EdgeMap<int> flow(G); //0 flow 24 26 … … 40 42 std::cout << "flow value: "<< max_flow_test.maxflow() << std::endl; 41 43 std::cout << "cut value: "<< cut_value << std::endl; 44 } 45 46 /* 47 { 48 std::cout << "preflow demo (preflow_push_hl by JACINT)..." << std::endl; 49 //ListGraph::EdgeMap<int> flow(G); //0 flow 50 51 double pre_time=currTime(); 52 preflow_push_hl<ListGraph, int> max_flow_test(G, s, t, cap); 53 max_flow_test.run(); 54 ListGraph::NodeMap<bool> cut=max_flow_test.mincut(); 55 int cut_value=0; 56 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 57 if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); 58 } 59 double post_time=currTime(); 60 //std::cout << "maximum flow: "<< std::endl; 61 //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 62 // std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") "; 63 //} 64 //std::cout<<std::endl; 65 std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 66 std::cout << "flow value: "<< max_flow_test.maxflow() << std::endl; 67 std::cout << "cut value: "<< cut_value << std::endl; 68 } 69 */ 42 70 43 71 return 0;
Note: See TracChangeset
for help on using the changeset viewer.