Changeset 476:cfe550761745 in lemon0.x for src/work/marci/lg_vs_sg.cc
 Timestamp:
 04/29/04 18:25:03 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@633
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/lg_vs_sg.cc
r465 r476 7 7 #include <smart_graph.h> 8 8 #include <dimacs.h> 9 #include <edmonds_karp.h>10 9 #include <preflow.h> 11 10 #include <time_measure.h> … … 35 34 Timer ts; 36 35 Graph::EdgeMap<int> flow(G); //0 flow 37 Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >38 pre_flow_test(G, s, t, cap, flow/*, true*/);39 36 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 40 max_flow_test(G, s, t, cap, flow );37 max_flow_test(G, s, t, cap, flow/*, true*/); 41 38 42 39 std::cout << "ListGraph ..." << std::endl; … … 45 42 std::cout << "preflow ..." << std::endl; 46 43 ts.reset(); 47 pre_flow_test.run();44 max_flow_test.run(); 48 45 std::cout << "elapsed time: " << ts << std::endl; 49 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;46 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 50 47 } 51 48 … … 61 58 } 62 59 63 {64 std::cout << "faster physical blocking flow augmentation ..." << std::endl;65 FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);66 ts.reset();67 int i=0;68 while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }69 std::cout << "elapsed time: " << ts << std::endl;70 std::cout << "number of augmentation phases: " << i << std::endl;71 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;72 }60 // { 61 // std::cout << "faster physical blocking flow augmentation ..." << std::endl; 62 // FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); 63 // ts.reset(); 64 // int i=0; 65 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; } 66 // std::cout << "elapsed time: " << ts << std::endl; 67 // std::cout << "number of augmentation phases: " << i << std::endl; 68 // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 69 // } 73 70 74 71 { … … 109 106 Timer ts; 110 107 Graph::EdgeMap<int> flow(G); //0 flow 111 Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >112 pre_flow_test(G, s, t, cap, flow/*, true*/);113 108 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 114 max_flow_test(G, s, t, cap, flow); 109 max_flow_test(G, s, t, cap, flow/*, true*/); 110 // MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 111 // max_flow_test(G, s, t, cap, flow); 115 112 116 113 std::cout << "SmatrGraph ..." << std::endl; … … 120 117 FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); 121 118 ts.reset(); 122 pre_flow_test.run();119 max_flow_test.run(); 123 120 std::cout << "elapsed time: " << ts << std::endl; 124 std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;121 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 125 122 } 126 123 … … 136 133 } 137 134 138 {139 std::cout << "faster physical blocking flow augmentation ..." << std::endl;140 FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);141 ts.reset();142 int i=0;143 while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }144 std::cout << "elapsed time: " << ts << std::endl;145 std::cout << "number of augmentation phases: " << i << std::endl;146 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;147 }135 // { 136 // std::cout << "faster physical blocking flow augmentation ..." << std::endl; 137 // FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); 138 // ts.reset(); 139 // int i=0; 140 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; } 141 // std::cout << "elapsed time: " << ts << std::endl; 142 // std::cout << "number of augmentation phases: " << i << std::endl; 143 // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 144 // } 148 145 149 146 {
Note: See TracChangeset
for help on using the changeset viewer.