.
authormarci
Wed, 04 Feb 2004 12:59:17 +0000
changeset 6089d2ce014e12
parent 59 41c7f9c09a12
child 61 30e734e6adff
.
src/work/marci_graph_demo.cc
     1.1 --- a/src/work/marci_graph_demo.cc	Wed Feb 04 12:46:33 2004 +0000
     1.2 +++ b/src/work/marci_graph_demo.cc	Wed Feb 04 12:59:17 2004 +0000
     1.3 @@ -165,6 +165,12 @@
     1.4      std::cout << std::endl;
     1.5    }
     1.6  
     1.7 +  //flowG.deleteEdge(s_v1);
     1.8 +  //flowG.deleteEdge(s_v2);
     1.9 +  //flowG.deleteEdge(v1_v2);
    1.10 +  //flowG.deleteEdge(v1_v3);
    1.11 +  
    1.12 +
    1.13    //flowG.setTail(v3_t, v2);
    1.14    //flowG.setHead(v3_t, s);
    1.15  
    1.16 @@ -179,6 +185,9 @@
    1.17      std::cout << std::endl;
    1.18    }
    1.19    
    1.20 +  for(EachEdgeIt e=flowG.first<EachEdgeIt>(); e.valid(); ++e) {
    1.21 +    std::cout << node_name.get(flowG.tail(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.head(e)) << " ";
    1.22 +  }
    1.23  
    1.24    /*
    1.25    while (flowG.first<EachEdgeIt>().valid()) {
    1.26 @@ -210,10 +219,18 @@
    1.27    }
    1.28    */
    1.29  
    1.30 -  //ListGraph::EdgeMap<int> flow(flowG, 0);
    1.31 -  //ResGraph<ListGraph, int> res_graph(flowG, cap, flow); 
    1.32 -  max_flow_type<ListGraph, int> max_flow_test(flowG, s, t, cap);
    1.33 +  std::cout << std::endl;
    1.34 +  //std::cout << "meg jo" << std::flush;
    1.35 +
    1.36 +  ListGraph::EdgeMap<int> flow(flowG, 0);
    1.37 +  MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(flowG, s, t, flow, cap);
    1.38    max_flow_test.run();
    1.39  
    1.40 +  std::cout << "maximum flow: "<< std::endl;
    1.41 +  for(EachEdgeIt e=flowG.template first<EachEdgeIt>(); e.valid(); ++e) { 
    1.42 +    std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
    1.43 +  }
    1.44 +  std::cout<<std::endl;
    1.45 +
    1.46    return 0;
    1.47  }