COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
04/23/04 09:41:48 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@509
Message:

.

File:
1 edited

Legend:

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

    r368 r379  
    1111#include <bfs_iterator.h>
    1212#include <graph_wrapper.h>
     13#include <maps.h>
     14#include <edmonds_karp.h>
    1315
    1416using namespace hugo;
     
    4244    std::cout << bgw.tail(e) << "->" << bgw.head(e) << std::endl;
    4345  }
    44 //   Graph::NodeMap<OutEdgeIt> pred(G);
    45 //   Timer ts;
    46 //   {
    47 //     ts.reset();
    48 //     Graph::NodeMap<bool> reached(G);
    49 //     reached.set(s, true);
    50 //     pred.set(s, INVALID);
    51 //     std::queue<Node> bfs_queue;
    52 //     bfs_queue.push(t);
    53 //     while (!bfs_queue.empty()) {
    54 //       Node v=bfs_queue.front();     
    55 //       bfs_queue.pop();
    56 //       OutEdgeIt e;
    57 //       for(G.first(e,v); G.valid(e); G.next(e)) {
    58 //      Node w=G.head(e);
    59 //      if (!reached[w]) {
    60 //        bfs_queue.push(w);
    61 //        reached.set(w, true);
    62 //        pred.set(w, e);
    63 //      }
    64 //       }
    65 //     }
    6646
    67 //     std::cout << ts << std::endl;
    68 //   }
     47  BGW::NodeMap<int> dbyj(bgw);
     48  BGW::EdgeMap<int> dbyxcj(bgw);
    6949
    70 //   {
    71 //     ts.reset();     
    72 //     BfsIterator< Graph, Graph::NodeMap<bool> > bfs(G);
    73 //     bfs.pushAndSetReached(s);
    74 //     pred.set(s, INVALID);
    75 //     while (!bfs.finished()) {
    76 //       ++bfs;
    77 //       if (G.valid(bfs) && bfs.isBNodeNewlyReached())
    78 //      pred.set(bfs.bNode(), bfs);
    79 //     }
    80 //     std::cout << ts << std::endl;
    81 //   }
     50  typedef stGraphWrapper<BGW> stGW;
     51  stGW stgw(bgw);
     52  ConstMap<stGW::Edge, int> const1map(1);
     53  stGW::NodeMap<int> ize(stgw);
     54  stGW::EdgeMap<int> flow(stgw);
     55
     56  BfsIterator< BGW, BGW::NodeMap<bool> > bfs(bgw);
     57  Graph::NodeIt si;
     58  Graph::Node s;
     59  s=g.first(si);
     60  bfs.pushAndSetReached(BGW::Node(s));
     61  while (!bfs.finished()) ++bfs;
     62
     63  BGW::EdgeMap<bool> cap(bgw);
     64  BGW::EdgeMap<bool> flow1(bgw);
     65
     66  typedef ResGraphWrapper< BGW, int, BGW::EdgeMap<bool>, BGW::EdgeMap<bool> >
     67    RBGW;
     68  RBGW rbgw(bgw, cap, flow1);
     69  RBGW::NodeMap<int> u(rbgw);
     70 
     71
     72  MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
     73    max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow);
     74  max_flow_test.augmentOnShortestPath();
    8275
    8376  return 0;
Note: See TracChangeset for help on using the changeset viewer.