COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
03/19/04 10:09:20 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@298
Message:

.

File:
1 edited

Legend:

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

    r188 r206  
    3535  typedef ListGraph MutableGraph;
    3636
    37 //  typedef SmartGraph Graph;
    38   typedef ListGraph Graph;
     37  typedef SmartGraph Graph;
     38  //typedef ListGraph Graph;
    3939  typedef Graph::Node Node;
    4040  typedef Graph::EdgeIt EdgeIt;
     
    115115
    116116  {
     117    std::cout << "SmartGraph..." << std::endl;
     118    std::cout << "edmonds karp demo (physical blocking flow 1 augmentation)..." << std::endl;
     119    Graph::EdgeMap<int> flow(G); //0 flow
     120
     121    Timer ts;
     122    ts.reset();
     123
     124    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap);
     125    //max_flow_test.augmentWithBlockingFlow<Graph>();
     126    int i=0;
     127    while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
     128//     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) {
     129//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     130//     }
     131//     std::cout<<std::endl;
     132      ++i;
     133    }
     134
     135//   std::cout << "maximum flow: "<< std::endl;
     136//   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) {
     137//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
     138//   }
     139//   std::cout<<std::endl;
     140    std::cout << "elapsed time: " << ts << std::endl;
     141    std::cout << "number of augmentation phases: " << i << std::endl;
     142    std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     143  }
     144
     145  {
    117146    std::cout << "edmonds karp demo (on-the-fly blocking flow augmentation)..." << std::endl;
    118147    Graph::EdgeMap<int> flow(G); //0 flow
Note: See TracChangeset for help on using the changeset viewer.