Changeset 715:665689d86225 in lemon0.x for src/work
 Timestamp:
 07/20/04 16:31:24 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@967
 Location:
 src/work/jacint
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

src/work/jacint/makefile
r535 r715 1 BINARIES = max_ matching2 INCLUDEDIRS= I../../include I.. I../{klao,marci,jacint,alpar,johanna,akos}1 BINARIES = max_flow_test 2 INCLUDEDIRS= I../../include I../.. I.. I../{klao,marci,jacint,alpar,johanna,akos} 3 3 include ../makefile 
src/work/jacint/max_flow_test.cc
r588 r715 1 1 #include <iostream> 2 2 3 #include < list_graph.h>4 #include < dimacs.h>3 #include <hugo/list_graph.h> 4 #include <hugo/dimacs.h> 5 5 #include <max_flow.h> 6 #include <time_measure.h> 6 #include <max_flow_no_stack.h> 7 #include <hugo/time_measure.h> 7 8 8 9 using namespace hugo; … … 26 27 << std::endl<<std::endl; 27 28 28 Graph::EdgeMap<int> flow (G,0);29 MaxFlow<Graph, int> max_flow_test(G, s, t, cap, flow );29 Graph::EdgeMap<int> flowstack(G,0); 30 MaxFlow<Graph, int> max_flow_test(G, s, t, cap, flowstack); 30 31 ts.reset(); 31 32 max_flow_test.run(); 32 std::cout << "Elapsed time of run(): " << std::endl 33 std::cout << "Elapsed time of run() with stl stack: " << std::endl 34 <<ts << std::endl; 35 36 Graph::EdgeMap<int> flow(G,0); 37 MaxFlowNoStack<Graph, int> max_flow_test_no_stack(G, s, t, cap, flow); 38 ts.reset(); 39 max_flow_test_no_stack.run(); 40 std::cout << "Elapsed time of run() without stack: " << std::endl 33 41 <<ts << std::endl; 34 42 35 43 Graph::NodeMap<bool> mincut(G); 36 max_flow_test .minMinCut(mincut);44 max_flow_test_no_stack.minMinCut(mincut); 37 45 int min_min_cut_value=0; 38 46 EdgeIt e; … … 42 50 43 51 Graph::NodeMap<bool> cut(G); 44 max_flow_test .minCut(cut);52 max_flow_test_no_stack.minCut(cut); 45 53 int min_cut_value=0; 46 54 for(G.first(e); G.valid(e); G.next(e)) { … … 50 58 51 59 Graph::NodeMap<bool> maxcut(G); 52 max_flow_test .maxMinCut(maxcut);60 max_flow_test_no_stack.maxMinCut(maxcut); 53 61 int max_min_cut_value=0; 54 62 for(G.first(e); G.valid(e); G.next(e)) { … … 57 65 } 58 66 59 std::cout << "\n Checking the result : " <<std::endl;60 std::cout << "Flow value: "<< max_flow_test .flowValue() << std::endl;67 std::cout << "\n Checking the result without stack: " <<std::endl; 68 std::cout << "Flow value: "<< max_flow_test_no_stack.flowValue() << std::endl; 61 69 std::cout << "Min cut value: "<< min_cut_value << std::endl; 62 70 std::cout << "Min min cut value: "<< min_min_cut_value << std::endl; … … 64 72 std::endl; 65 73 66 if ( max_flow_test .flowValue() == min_cut_value &&74 if ( max_flow_test_no_stack.flowValue() == min_cut_value && 67 75 min_cut_value == min_min_cut_value && 68 76 min_min_cut_value == max_min_cut_value ) 69 77 std::cout << "They are equal! " <<std::endl<< std::endl<<"\n"; 70 78 71 79 /* 72 80 73 81 Graph::EdgeMap<int> flow2(G,0); … … 153 161 min_min_cut_value3 == max_min_cut_value3 ) 154 162 std::cout << "They are equal! " <<std::endl<< std::endl<<"\n"; 163 */ 155 164 156 165 return 0;
Note: See TracChangeset
for help on using the changeset viewer.