COIN-OR::LEMON - Graph Library

Changeset 577:e8703f0a6e2f in lemon-0.x for src/work/marci/lg_vs_sg.cc


Ignore:
Timestamp:
05/07/04 13:57:34 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@753
Message:

top-sort, dimacs mods.

File:
1 edited

Legend:

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

    r555 r577  
    2626    typedef Graph::EdgeIt EdgeIt;
    2727
    28     Graph G;
     28    Graph g;
    2929    Node s, t;
    30     Graph::EdgeMap<int> cap(G);
     30    Graph::EdgeMap<int> cap(g);
    3131    std::ifstream ins(in.c_str());
    32     readDimacsMaxFlow(ins, G, s, t, cap);
     32    //readDimacsMaxFlow(ins, g, s, t, cap);
     33    readDimacs(ins, g, cap, s, t);
    3334
    3435    Timer ts;
    35     Graph::EdgeMap<int> flow(G); //0 flow
     36    Graph::EdgeMap<int> flow(g); //0 flow
    3637    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    37       max_flow_test(G, s, t, cap, flow/*, true*/);
     38      max_flow_test(g, s, t, cap, flow/*, true*/);
    3839
    3940    std::cout << "ListGraph ..." << std::endl;
     
    4950    {
    5051      std::cout << "physical blocking flow augmentation ..." << std::endl;
    51       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     52      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    5253      ts.reset();
    5354      int i=0;
     
    6061//     {
    6162//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    62 //       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     63//       FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    6364//       ts.reset();
    6465//       int i=0;
     
    7172    {
    7273      std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    73       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     74      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    7475      ts.reset();
    7576      int i=0;
     
    8283    {
    8384      std::cout << "on-the-fly shortest path augmentation ..." << std::endl;
    84       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     85      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    8586      ts.reset();
    8687      int i=0;
     
    9899    typedef Graph::EdgeIt EdgeIt;
    99100
    100     Graph G;
     101    Graph g;
    101102    Node s, t;
    102     Graph::EdgeMap<int> cap(G);
     103    Graph::EdgeMap<int> cap(g);
    103104    std::ifstream ins(in.c_str());
    104     readDimacsMaxFlow(ins, G, s, t, cap);
     105    //readDimacsMaxFlow(ins, g, s, t, cap);
     106    readDimacs(ins, g, cap, s, t);
    105107
    106108    Timer ts;
    107     Graph::EdgeMap<int> flow(G); //0 flow
     109    Graph::EdgeMap<int> flow(g); //0 flow
    108110    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    109       max_flow_test(G, s, t, cap, flow/*, true*/);
     111      max_flow_test(g, s, t, cap, flow/*, true*/);
    110112    //    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    111     //  max_flow_test(G, s, t, cap, flow);
     113    //  max_flow_test(g, s, t, cap, flow);
    112114
    113115    std::cout << "SmatrGraph ..." << std::endl;
     
    115117    {
    116118      std::cout << "preflow ..." << std::endl;
    117       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     119      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    118120      ts.reset();
    119121      max_flow_test.run();
     
    124126    {
    125127      std::cout << "physical blocking flow augmentation ..." << std::endl;
    126       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     128      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    127129      ts.reset();
    128130      int i=0;
     
    135137//     {
    136138//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    137 //       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     139//       FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    138140//       ts.reset();
    139141//       int i=0;
     
    146148    {
    147149      std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    148       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     150      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    149151      ts.reset();
    150152      int i=0;
     
    157159    {
    158160      std::cout << "on-the-fly shortest path augmentation ..." << std::endl;
    159       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     161      FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
    160162      ts.reset();
    161163      int i=0;
Note: See TracChangeset for help on using the changeset viewer.