COIN-OR::LEMON - Graph Library

Changeset 206:47f62d789fe7 in lemon-0.x for src/work/marci


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

.

Location:
src/work/marci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/dimacs.h

    r180 r206  
    2626        getline(is, str);
    2727        break;
    28 //       case 't': //type
    29 //      getline(is, str);
    30 //      break;
    3128      case 'p': //problem definition
    3229        is >> problem >> n >> m;
  • 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.