src/work/marci/leda/bipartite_matching_leda.cc
changeset 715 665689d86225
parent 616 31879aac4dc3
child 769 eb61fbc64c16
equal deleted inserted replaced
5:09f706c63ae4 6:32b83a8bf358
     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;
   105     max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow);
   105     max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow);
   106 
   106 
   107   ts.reset();
   107   ts.reset();
   108   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   108   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
   109 //  while (max_flow_test.augmentOnShortestPath()) { }
   109 //  while (max_flow_test.augmentOnShortestPath()) { }
   110   typedef ListGraph MutableGraph;
   110   typedef SageGraph MutableGraph;
   111 //  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
   111 //  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
   112   while (max_flow_test.augmentOnBlockingFlow2()) {
   112   while (max_flow_test.augmentOnBlockingFlow2()) {
   113    std::cout << max_flow_test.flowValue() << std::endl;
   113    std::cout << max_flow_test.flowValue() << std::endl;
   114   }
   114   }
   115   std::cout << "max flow value: " << max_flow_test.flowValue() << std::endl;
   115   std::cout << "max flow value: " << max_flow_test.flowValue() << std::endl;