COIN-OR::LEMON - Graph Library

Changeset 99:f26897fb91fd in lemon-0.x for src/work/iterator_bfs_demo.cc


Ignore:
Timestamp:
02/18/04 16:58:28 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@128
Message:

dfs iterator: DfsIterator4 improved version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/iterator_bfs_demo.cc

    r75 r99  
    8080  }
    8181
     82  {
     83    std::cout << "iterator dfs demo 4 ..." << std::endl;
     84    DfsIterator4< ListGraph, ListGraph::OutEdgeIt, ListGraph::NodeMap<bool> > dfs(G);
     85    dfs.pushAndSetReached(s);
     86    while (!dfs.finished()) {
     87      ++dfs;
     88      if (OutEdgeIt(dfs).valid()) {
     89        std::cout << "OutEdgeIt: " << dfs;
     90        std::cout << " aNode: " << G.aNode(dfs);
     91        std::cout << " bNode: " << G.bNode(dfs) << " ";
     92      } else {
     93        std::cout << "OutEdgeIt: " << "invalid";
     94        std::cout << " aNode: " << dfs.aNode();
     95        std::cout << " bNode: " << "invalid" << " ";
     96      }
     97      if (dfs.isBNodeNewlyReached()) {
     98        std::cout << "bNodeIsNewlyReached ";
     99      } else {
     100        std::cout << "bNodeIsNotNewlyReached ";
     101      }
     102      if (dfs.isANodeExamined()) {
     103        std::cout << "aNodeIsExamined ";
     104      } else {
     105        std::cout << "aNodeIsNotExamined ";
     106      }
     107      std::cout<<std::endl;
     108      //++dfs;
     109    }
     110  }
     111
     112
    82113  typedef ConstTrivGraphWrapper<ListGraph> CTGW;
    83114  CTGW wG(G);
Note: See TracChangeset for help on using the changeset viewer.