COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/31/04 13:26:59 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1068
Message:

ResGraphWrapper?<Graph> is done, so does dimacs.h.

File:
1 edited

Legend:

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

    r762 r775  
    1717
    1818// Use a DIMACS max flow file as stdin.
    19 // read_dimacs_demo < dimacs_max_flow_file
    20 
    21 
    22 //   struct Ize {
    23 //   };
    24  
    25 //   struct Mize {
    26 //     Ize bumm;
    27 //   };
    28 
    29 //   template <typename B>
    30 //     class Huha {
    31 //     public:
    32 //       int u;
    33 //       B brr;
    34 //     };
    35 
     19// max_flow_demo < dimacs_max_flow_file
    3620
    3721int main(int, char **) {
     
    4428  typedef Graph::Node Node;
    4529  typedef Graph::EdgeIt EdgeIt;
    46 
    47 
    48 //   Mize mize[10];
    49 //   Mize bize[0];
    50 //   Mize zize;
    51 //   typedef Mize Tize[0];
    52 
    53 //   std::cout << &zize << " " << sizeof(mize) << sizeof(Tize) << std::endl;
    54 //   std::cout << sizeof(bize) << std::endl;
    55 
    56 
    57 //   Huha<Tize> k;
    58 //   std::cout << sizeof(k) << std::endl;
    59 
    60 
    61 //   struct Bumm {
    62 //     //int a;
    63 //     bool b;
    64 //   };
    65 
    66 //   std::cout << sizeof(Bumm) << std::endl;
    67 
    6830
    6931  Graph g;
     
    142104
    143105//   {
    144 //     std::cout << "faster physical blocking flow augmentation ..." << std::endl;
     106//     std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    145107//     FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    146108//     ts.reset();
    147109//     int i=0;
    148 //     while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
     110//     while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }
    149111//     std::cout << "elapsed time: " << ts << std::endl;
    150112//     std::cout << "number of augmentation phases: " << i << std::endl;
    151 //     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     113//     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
     114
     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//     }
    152121//   }
    153 
    154   {
    155     std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    156     FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    157     ts.reset();
    158     int i=0;
    159     while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; }
    160     std::cout << "elapsed time: " << ts << std::endl;
    161     std::cout << "number of augmentation phases: " << i << std::endl;
    162     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
    163 
    164     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
    165       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])
    166         std::cout << "Slackness does not hold!" << std::endl;
    167       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0)
    168         std::cout << "Slackness does not hold!" << std::endl;
    169     }
    170   }
    171122
    172123  {
Note: See TracChangeset for help on using the changeset viewer.