src/work/marci/max_flow_demo.cc
changeset 577 e8703f0a6e2f
parent 555 995bc1f1a3ce
child 640 d426dca0aaf7
     1.1 --- a/src/work/marci/max_flow_demo.cc	Fri May 07 10:57:31 2004 +0000
     1.2 +++ b/src/work/marci/max_flow_demo.cc	Fri May 07 11:57:34 2004 +0000
     1.3 @@ -63,14 +63,15 @@
     1.4  //   std::cout << sizeof(Bumm) << std::endl;
     1.5  
     1.6  
     1.7 -  Graph G;
     1.8 +  Graph g;
     1.9    Node s, t;
    1.10 -  Graph::EdgeMap<int> cap(G);
    1.11 -  readDimacsMaxFlow(std::cin, G, s, t, cap);
    1.12 +  Graph::EdgeMap<int> cap(g);
    1.13 +  //readDimacsMaxFlow(std::cin, g, s, t, cap);
    1.14 +  readDimacs(std::cin, g, cap, s, t);
    1.15    Timer ts;
    1.16 -  Graph::EdgeMap<int> flow(G); //0 flow
    1.17 +  Graph::EdgeMap<int> flow(g); //0 flow
    1.18    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.19 -    max_flow_test(G, s, t, cap, flow);
    1.20 +    max_flow_test(g, s, t, cap, flow);
    1.21  
    1.22    {
    1.23      std::cout << "preflow ..." << std::endl;
    1.24 @@ -82,7 +83,7 @@
    1.25  
    1.26    {
    1.27      std::cout << "preflow ..." << std::endl;
    1.28 -    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.29 +    FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.30      ts.reset();
    1.31      max_flow_test.preflow(MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);
    1.32      std::cout << "elapsed time: " << ts << std::endl;
    1.33 @@ -91,7 +92,7 @@
    1.34  
    1.35  //   {
    1.36  //     std::cout << "wrapped preflow ..." << std::endl;
    1.37 -//     FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.38 +//     FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.39  //     ts.reset();
    1.40  //     pre_flow_res.run();
    1.41  //     std::cout << "elapsed time: " << ts << std::endl;
    1.42 @@ -100,7 +101,7 @@
    1.43  
    1.44    {
    1.45      std::cout << "physical blocking flow augmentation ..." << std::endl;
    1.46 -    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.47 +    FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.48      ts.reset();
    1.49      int i=0;
    1.50      while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }
    1.51 @@ -111,7 +112,7 @@
    1.52  
    1.53  //   {
    1.54  //     std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    1.55 -//     FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.56 +//     FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.57  //     ts.reset();
    1.58  //     int i=0;
    1.59  //     while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    1.60 @@ -122,7 +123,7 @@
    1.61  
    1.62    {
    1.63      std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    1.64 -    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.65 +    FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.66      ts.reset();
    1.67      int i=0;
    1.68      while (max_flow_test.augmentOnBlockingFlow2()) { ++i; }
    1.69 @@ -133,7 +134,7 @@
    1.70  
    1.71    {
    1.72      std::cout << "on-the-fly shortest path augmentation ..." << std::endl;
    1.73 -    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.74 +    FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    1.75      ts.reset();
    1.76      int i=0;
    1.77      while (max_flow_test.augmentOnShortestPath()) { ++i; }