COIN-OR::LEMON - Graph Library

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/bfsit_vs_byhand.cc

    r555 r577  
    2020  typedef Graph::OutEdgeIt OutEdgeIt;
    2121
    22   Graph G;
     22  Graph g;
    2323  Node s, t;
    24   Graph::EdgeMap<int> cap(G);
    25   readDimacsMaxFlow(std::cin, G, s, t, cap);
    26   Graph::NodeMap<OutEdgeIt> pred(G);
     24  Graph::EdgeMap<int> cap(g);
     25  //readDimacsMaxFlow(std::cin, g, s, t, cap);
     26  readDimacs(std::cin, g);
     27
     28  Graph::NodeMap<OutEdgeIt> pred(g);
    2729  Timer ts;
    2830  {
    2931    ts.reset();
    30     Graph::NodeMap<bool> reached(G);
     32    Graph::NodeMap<bool> reached(g);
    3133    reached.set(s, true);
    3234    pred.set(s, INVALID);
     
    3739      bfs_queue.pop();
    3840      OutEdgeIt e;
    39       for(G.first(e,v); G.valid(e); G.next(e)) {
    40         Node w=G.head(e);
     41      for(g.first(e,v); g.valid(e); g.next(e)) {
     42        Node w=g.head(e);
    4143        if (!reached[w]) {
    4244          bfs_queue.push(w);
     
    5254  {
    5355    ts.reset();     
    54     BfsIterator< Graph, Graph::NodeMap<bool> > bfs(G);
     56    BfsIterator< Graph, Graph::NodeMap<bool> > bfs(g);
    5557    bfs.pushAndSetReached(s);
    5658    pred.set(s, INVALID);
    5759    while (!bfs.finished()) {
    5860      ++bfs;
    59       if (G.valid(bfs) && bfs.isBNodeNewlyReached())
     61      if (g.valid(bfs) && bfs.isBNodeNewlyReached())
    6062        pred.set(bfs.bNode(), bfs);
    6163    }
Note: See TracChangeset for help on using the changeset viewer.