COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
03/11/04 15:15:07 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@239
Message:

graph wrapper improvements, blocking flow on fly

File:
1 edited

Legend:

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

    r155 r168  
    8888  //max_flow_test.augmentWithBlockingFlow<ListGraph>();
    8989  int i=0;
    90   while (max_flow_test.augmentOnBlockingFlow<ListGraph>()) { ++i; }
     90  while (max_flow_test.augmentOnBlockingFlow<ListGraph>()) {
     91//     for(EachEdgeIt e=G.template first<EachEdgeIt>(); e.valid(); ++e) {
     92//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     93//     }
     94//     std::cout<<std::endl;
     95    ++i;
     96  }
     97  //double post_time=currTime();
     98
     99  //std::cout << "maximum flow: "<< std::endl;
     100  //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) {
     101  //  std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     102  //}
     103  //std::cout<<std::endl;
     104  std::cout << "elapsed time: " << ts << std::endl;
     105  std::cout << "number of augmentation phases: " << i << std::endl;
     106  std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     107  }
     108
     109  {
     110  std::cout << "edmonds karp demo (blocking flow augmentation)..." << std::endl;
     111  ListGraph::EdgeMap<int> flow(G); //0 flow
     112
     113  Timer ts;
     114  ts.reset();
     115  //double pre_time=currTime();
     116  MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap);
     117  //max_flow_test.augmentWithBlockingFlow<ListGraph>();
     118  int i=0;
     119  while (max_flow_test.augmentOnBlockingFlow2()) {
     120//     for(EachEdgeIt e=G.template first<EachEdgeIt>(); e.valid(); ++e) {
     121//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     122//     }
     123//     std::cout<<std::endl;
     124    ++i;
     125  }
    91126  //double post_time=currTime();
    92127
     
    111146  //max_flow_test.augmentWithBlockingFlow<ListGraph>();
    112147  int i=0;
    113   while (max_flow_test.augmentOnShortestPath()) { ++i; }
     148  while (max_flow_test.augmentOnShortestPath()) {
     149//     for(EachEdgeIt e=G.template first<EachEdgeIt>(); e.valid(); ++e) {
     150//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     151//     }
     152//     std::cout<<std::endl;
     153    ++i;
     154  }
    114155  //double post_time=currTime();
    115156
Note: See TracChangeset for help on using the changeset viewer.