src/work/marci/bipartite_matching_leda.cc
changeset 417 4ce3d5f675ea
parent 411 3c8801529a1f
equal deleted inserted replaced
0:dd4d851cdca6 1:45b71a04e907
    12 #include <list_graph.h>
    12 #include <list_graph.h>
    13 //#include <smart_graph.h>
    13 //#include <smart_graph.h>
    14 //#include <dimacs.h>
    14 //#include <dimacs.h>
    15 #include <time_measure.h>
    15 #include <time_measure.h>
    16 #include <for_each_macros.h>
    16 #include <for_each_macros.h>
    17 #include <bfs_iterator.h>
    17 //#include <bfs_iterator.h>
    18 #include <graph_wrapper.h>
    18 #include <graph_wrapper.h>
    19 #include <maps.h>
    19 #include <maps.h>
    20 #include <edmonds_karp.h>
    20 #include <edmonds_karp.h>
    21 #include <preflow.h>
    21 #include <preflow.h>
    22 
    22 
    45 using namespace hugo;
    45 using namespace hugo;
    46 
    46 
    47 int main() {
    47 int main() {
    48   //for leda graph
    48   //for leda graph
    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 UndirListGraph
    55   //typedef UndirListGraph Graph; 
    55   //typedef UndirListGraph Graph; 
   201 //     std::cout << e << ": " << pre_flow[e] << "\n"; 
   201 //     std::cout << e << ": " << pre_flow[e] << "\n"; 
   202 //   }
   202 //   }
   203 //   std::cout << "\n";
   203 //   std::cout << "\n";
   204 
   204 
   205   ts.reset();  
   205   ts.reset();  
   206   MAX_CARD_BIPARTITE_MATCHING(lg);
   206   leda_list<leda_edge> ml=MAX_CARD_BIPARTITE_MATCHING(lg);
   207   //  stGW::EdgeMap<int> pre_flow(stgw);
   207   //  stGW::EdgeMap<int> pre_flow(stgw);
   208   //Preflow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 
   208   //Preflow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 
   209   //  pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow, true);
   209   //  pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow, true);
   210   //pre_flow_test.run();
   210   //pre_flow_test.run();
   211   //std::cout << "pre flow value: " << max_flow_test.flowValue() << std::endl;
   211   std::cout << "leda matching value: " << ml.size() << std::endl;
   212   std::cout << "elapsed time: " << ts << std::endl;
   212   std::cout << "elapsed time: " << ts << std::endl;
   213 //   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) { 
   213 //   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) { 
   214 //     std::cout << e << ": " << pre_flow[e] << "\n"; 
   214 //     std::cout << e << ": " << pre_flow[e] << "\n"; 
   215 //   }
   215 //   }
   216 //   std::cout << "\n";
   216 //   std::cout << "\n";