COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
02/04/04 13:46:33 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@74
Message:

.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/iterator_bfs_dfs_demo.cc

    r45 r59  
    182182  }
    183183 
     184  {
     185    std::cout << "iterator bfs demo 2 ..." << std::endl;
     186    //ListGraph::NodeMap<bool> reached(G, false);
     187    //reached.set(s, true);
     188    //std::queue<ListGraph::OutEdgeIt> bfs_queue;
     189    //bfs_queue.push(G.first<OutEdgeIt>(s));
     190    BfsIterator2< ListGraph, ListGraph::OutEdgeIt, ListGraph::NodeMap<bool> > bfs(G);
     191    bfs.pushAndSetReached(s);
     192    while (!bfs.finished()) {
     193      if (OutEdgeIt(bfs).valid()) {
     194        std::cout << "OutEdgeIt: " << bfs;
     195        std::cout << " aNode: " << G.aNode(bfs);
     196        std::cout << " bNode: " << G.bNode(bfs) << " ";
     197      } else {
     198        std::cout << "OutEdgeIt: " << "invalid";
     199        std::cout << " aNode: " << G.aNode(bfs);
     200        std::cout << " bNode: " << "invalid" << " ";
     201      }
     202      if (bfs.isBNodeNewlyReached()) {
     203        std::cout << "bNodeIsNewlyReached ";
     204      } else {
     205        std::cout << "bNodeIsNotNewlyReached ";
     206      }
     207      if (bfs.isANodeExamined()) {
     208        std::cout << "aNodeIsExamined ";
     209      } else {
     210        std::cout << "aNodeIsNotExamined ";
     211      }
     212      std::cout<<std::endl;
     213      ++bfs;
     214    }
     215  }
     216 
     217
     218
    184219
    185220  {
Note: See TracChangeset for help on using the changeset viewer.