Changeset 777:a82713ed19f3 in lemon-0.x for src/work/marci/max_flow_demo.cc
- Timestamp:
- 08/31/04 19:54:22 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1070
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/max_flow_demo.cc
r775 r777 1 1 // -*- c++ -*- 2 3 // Use a DIMACS max flow file as stdin. 4 // max_flow_demo < dimacs_max_flow_file 5 6 2 7 #include <iostream> 3 8 #include <fstream> … … 15 20 16 21 using namespace hugo; 17 18 // Use a DIMACS max flow file as stdin.19 // max_flow_demo < dimacs_max_flow_file20 22 21 23 int main(int, char **) { … … 103 105 } 104 106 105 //{106 //std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;107 //FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);108 //ts.reset();109 //int i=0;110 //while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }111 //std::cout << "elapsed time: " << ts << std::endl;112 //std::cout << "number of augmentation phases: " << i << std::endl;113 //std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;107 { 108 std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; 109 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 110 ts.reset(); 111 int i=0; 112 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 113 std::cout << "elapsed time: " << ts << std::endl; 114 std::cout << "number of augmentation phases: " << i << std::endl; 115 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 114 116 115 //FOR_EACH_LOC(Graph::EdgeIt, e, g) {116 //if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])117 //std::cout << "Slackness does not hold!" << std::endl;118 //if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0)119 //std::cout << "Slackness does not hold!" << std::endl;120 //}121 //}117 FOR_EACH_LOC(Graph::EdgeIt, e, g) { 118 if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 119 std::cout << "Slackness does not hold!" << std::endl; 120 if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 121 std::cout << "Slackness does not hold!" << std::endl; 122 } 123 } 122 124 123 125 {
Note: See TracChangeset
for help on using the changeset viewer.