Changeset 59:41c7f9c09a12 in lemon-0.x for src/work/iterator_bfs_dfs_demo.cc
- Timestamp:
- 02/04/04 13:46:33 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@74
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/iterator_bfs_dfs_demo.cc
r45 r59 182 182 } 183 183 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 184 219 185 220 {
Note: See TracChangeset
for help on using the changeset viewer.