Changeset 775:e46a1f0623a0 in lemon-0.x for src/work/marci/max_flow_demo.cc
- Timestamp:
- 08/31/04 13:26:59 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1068
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/max_flow_demo.cc
r762 r775 17 17 18 18 // Use a DIMACS max flow file as stdin. 19 // read_dimacs_demo < dimacs_max_flow_file 20 21 22 // struct Ize { 23 // }; 24 25 // struct Mize { 26 // Ize bumm; 27 // }; 28 29 // template <typename B> 30 // class Huha { 31 // public: 32 // int u; 33 // B brr; 34 // }; 35 19 // max_flow_demo < dimacs_max_flow_file 36 20 37 21 int main(int, char **) { … … 44 28 typedef Graph::Node Node; 45 29 typedef Graph::EdgeIt EdgeIt; 46 47 48 // Mize mize[10];49 // Mize bize[0];50 // Mize zize;51 // typedef Mize Tize[0];52 53 // std::cout << &zize << " " << sizeof(mize) << sizeof(Tize) << std::endl;54 // std::cout << sizeof(bize) << std::endl;55 56 57 // Huha<Tize> k;58 // std::cout << sizeof(k) << std::endl;59 60 61 // struct Bumm {62 // //int a;63 // bool b;64 // };65 66 // std::cout << sizeof(Bumm) << std::endl;67 68 30 69 31 Graph g; … … 142 104 143 105 // { 144 // std::cout << " faster physicalblocking flow augmentation ..." << std::endl;106 // std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; 145 107 // FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 146 108 // ts.reset(); 147 109 // int i=0; 148 // while ( max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }110 // while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } 149 111 // std::cout << "elapsed time: " << ts << std::endl; 150 112 // std::cout << "number of augmentation phases: " << i << std::endl; 151 // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 113 // std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; 114 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 // } 152 121 // } 153 154 {155 std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;156 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);157 ts.reset();158 int i=0;159 while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }160 std::cout << "elapsed time: " << ts << std::endl;161 std::cout << "number of augmentation phases: " << i << std::endl;162 std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;163 164 FOR_EACH_LOC(Graph::EdgeIt, e, g) {165 if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])166 std::cout << "Slackness does not hold!" << std::endl;167 if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0)168 std::cout << "Slackness does not hold!" << std::endl;169 }170 }171 122 172 123 {
Note: See TracChangeset
for help on using the changeset viewer.