src/work/marci/leda/bipartite_matching_leda_gen.cc
changeset 849 cc3867a7d380
parent 768 a5e9303a5511
child 921 818510fa3d99
equal deleted inserted replaced
7:92d24c580fe7 8:0e972419424c
    12 #include <leda_graph_wrapper.h>
    12 #include <leda_graph_wrapper.h>
    13 #include <sage_graph.h>
    13 #include <sage_graph.h>
    14 //#include <smart_graph.h>
    14 //#include <smart_graph.h>
    15 //#include <dimacs.h>
    15 //#include <dimacs.h>
    16 #include <hugo/time_measure.h>
    16 #include <hugo/time_measure.h>
    17 #include <hugo/for_each_macros.h>
    17 #include <for_each_macros.h>
    18 #include <hugo/graph_wrapper.h>
    18 #include <hugo/graph_wrapper.h>
    19 #include <bipartite_graph_wrapper.h>
    19 #include <bipartite_graph_wrapper.h>
    20 #include <hugo/maps.h>
    20 #include <hugo/maps.h>
    21 #include <max_flow.h>
    21 #include <hugo/max_flow.h>
       
    22 #include <augmenting_flow.h>
    22 
    23 
    23 /**
    24 /**
    24  * Inicializalja a veletlenszamgeneratort.
    25  * Inicializalja a veletlenszamgeneratort.
    25  * Figyelem, ez nem jo igazi random szamokhoz,
    26  * Figyelem, ez nem jo igazi random szamokhoz,
    26  * erre ne bizzad a titkaidat!
    27  * erre ne bizzad a titkaidat!
   123   std::cout << "\n";
   124   std::cout << "\n";
   124 
   125 
   125   ts.reset();
   126   ts.reset();
   126   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   127   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   127   typedef SageGraph MutableGraph;
   128   typedef SageGraph MutableGraph;
   128   while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
   129   AugmentingFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 
       
   130     max_flow_test_1(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow/*, true*/);
       
   131   while (max_flow_test_1.augmentOnBlockingFlow<MutableGraph>()) { }
   129   std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
   132   std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
   130 	    << std::endl << "Matching size: " 
   133 	    << std::endl << "Matching size: " 
   131 	    << max_flow_test.flowValue() << std::endl;
   134 	    << max_flow_test_1.flowValue() << std::endl;
   132   std::cout << "elapsed time: " << ts << std::endl;
   135   std::cout << "elapsed time: " << ts << std::endl;
   133 
   136 
   134   return 0;
   137   return 0;
   135 }
   138 }