src/work/marci/bipartite_matching_try.cc
changeset 720 193d881b23ad
parent 640 d426dca0aaf7
child 762 511200bdb71f
equal deleted inserted replaced
9:5aaec319ab08 10:2cccd3ac53a2
     2 #include <iostream>
     2 #include <iostream>
     3 #include <fstream>
     3 #include <fstream>
     4 #include <vector>
     4 #include <vector>
     5 #include <cstdlib>
     5 #include <cstdlib>
     6 
     6 
     7 #include <list_graph.h>
     7 #include <sage_graph.h>
     8 //#include <smart_graph.h>
     8 //#include <smart_graph.h>
     9 //#include <dimacs.h>
     9 //#include <dimacs.h>
    10 #include <hugo/time_measure.h>
    10 #include <hugo/time_measure.h>
    11 #include <hugo/for_each_macros.h>
    11 #include <hugo/for_each_macros.h>
    12 #include <bfs_dfs.h>
    12 #include <bfs_dfs.h>
    38 }
    38 }
    39 
    39 
    40 using namespace hugo;
    40 using namespace hugo;
    41 
    41 
    42 int main() {
    42 int main() {
    43   typedef UndirListGraph Graph; 
    43   typedef UndirSageGraph Graph; 
    44   typedef Graph::Node Node;
    44   typedef Graph::Node Node;
    45   typedef Graph::NodeIt NodeIt;
    45   typedef Graph::NodeIt NodeIt;
    46   typedef Graph::Edge Edge;
    46   typedef Graph::Edge Edge;
    47   typedef Graph::EdgeIt EdgeIt;
    47   typedef Graph::EdgeIt EdgeIt;
    48   typedef Graph::OutEdgeIt OutEdgeIt;
    48   typedef Graph::OutEdgeIt OutEdgeIt;
   164   ts.reset();
   164   ts.reset();
   165   stGW::EdgeMap<int> max_flow(stgw);
   165   stGW::EdgeMap<int> max_flow(stgw);
   166   MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 
   166   MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 
   167     max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, max_flow);
   167     max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, max_flow);
   168 //  while (max_flow_test.augmentOnShortestPath()) { }
   168 //  while (max_flow_test.augmentOnShortestPath()) { }
   169   typedef ListGraph MutableGraph;
   169   typedef SageGraph MutableGraph;
   170 //  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
   170 //  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
   171   while (max_flow_test.augmentOnBlockingFlow2()) {
   171   while (max_flow_test.augmentOnBlockingFlow2()) {
   172    std::cout << max_flow_test.flowValue() << std::endl;
   172    std::cout << max_flow_test.flowValue() << std::endl;
   173   }
   173   }
   174   std::cout << "max flow value: " << max_flow_test.flowValue() << std::endl;
   174   std::cout << "max flow value: " << max_flow_test.flowValue() << std::endl;