src/work/marci/leda/bipartite_matching_leda_gen.cc
changeset 728 4c9e2f920458
parent 616 31879aac4dc3
child 768 a5e9303a5511
equal deleted inserted replaced
5:619b57710031 6:5d618a55fb33
     8 #include <LEDA/mcb_matching.h>
     8 #include <LEDA/mcb_matching.h>
     9 #include <LEDA/list.h>
     9 #include <LEDA/list.h>
    10 #include <LEDA/graph_gen.h>
    10 #include <LEDA/graph_gen.h>
    11 
    11 
    12 #include <leda_graph_wrapper.h>
    12 #include <leda_graph_wrapper.h>
    13 #include <list_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 <for_each_macros.h>
    17 #include <hugo/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 <max_flow.h>
    22 
    22 
    49   leda::graph lg;
    49   leda::graph lg;
    50   //lg.make_undirected();
    50   //lg.make_undirected();
    51   typedef LedaGraphWrapper<leda::graph> Graph;
    51   typedef LedaGraphWrapper<leda::graph> Graph;
    52   Graph g(lg);
    52   Graph g(lg);
    53 
    53 
    54   //for UndirListGraph
    54   //for UndirSageGraph
    55   //typedef UndirListGraph Graph; 
    55   //typedef UndirSageGraph Graph; 
    56   //Graph g;
    56   //Graph g;
    57 
    57 
    58   typedef Graph::Node Node;
    58   typedef Graph::Node Node;
    59   typedef Graph::NodeIt NodeIt;
    59   typedef Graph::NodeIt NodeIt;
    60   typedef Graph::Edge Edge;
    60   typedef Graph::Edge Edge;
   122   std::cout << "elapsed time: " << ts << std::endl;
   122   std::cout << "elapsed time: " << ts << std::endl;
   123   std::cout << "\n";
   123   std::cout << "\n";
   124 
   124 
   125   ts.reset();
   125   ts.reset();
   126   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   126   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   127   typedef ListGraph MutableGraph;
   127   typedef SageGraph MutableGraph;
   128   while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
   128   while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
   129   std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
   129   std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
   130 	    << std::endl << "Matching size: " 
   130 	    << std::endl << "Matching size: " 
   131 	    << max_flow_test.flowValue() << std::endl;
   131 	    << max_flow_test.flowValue() << std::endl;
   132   std::cout << "elapsed time: " << ts << std::endl;
   132   std::cout << "elapsed time: " << ts << std::endl;