COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/31/04 19:54:22 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1070
Message:

graph_wrapper.h is ready for hugo 0.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/max_flow_demo.cc

    r775 r777  
    11// -*- c++ -*-
     2
     3// Use a DIMACS max flow file as stdin.
     4// max_flow_demo < dimacs_max_flow_file
     5
     6
    27#include <iostream>
    38#include <fstream>
     
    1520
    1621using namespace hugo;
    17 
    18 // Use a DIMACS max flow file as stdin.
    19 // max_flow_demo < dimacs_max_flow_file
    2022
    2123int main(int, char **) {
     
    103105  }
    104106
    105 //   {
    106 //     std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    107 //     FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    108 //     ts.reset();
    109 //     int i=0;
    110 //     while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }
    111 //     std::cout << "elapsed time: " << ts << std::endl;
    112 //     std::cout << "number of augmentation phases: " << i << std::endl;
    113 //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
     107  {
     108    std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
     109    FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
     110    ts.reset();
     111    int i=0;
     112    while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }
     113    std::cout << "elapsed time: " << ts << std::endl;
     114    std::cout << "number of augmentation phases: " << i << std::endl;
     115    std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
    114116
    115 //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
    116 //       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])
    117 //      std::cout << "Slackness does not hold!" << std::endl;
    118 //       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0)
    119 //      std::cout << "Slackness does not hold!" << std::endl;
    120 //     }
    121 //   }
     117    FOR_EACH_LOC(Graph::EdgeIt, e, g) {
     118      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])
     119        std::cout << "Slackness does not hold!" << std::endl;
     120      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0)
     121        std::cout << "Slackness does not hold!" << std::endl;
     122    }
     123  }
    122124
    123125  {
Note: See TracChangeset for help on using the changeset viewer.