Changeset 986:e997802b855c in lemon-0.x for src/work/marci/iterator_bfs_demo.cc
- Timestamp:
- 11/13/04 13:53:28 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/iterator_bfs_demo.cc
r921 r986 24 24 string operator[](typename Graph::Edge e) const { 25 25 return 26 (node_name_map[graph. tail(e)]+"->"+node_name_map[graph.head(e)]);26 (node_name_map[graph.source(e)]+"->"+node_name_map[graph.target(e)]); 27 27 } 28 28 }; … … 96 96 if (Graph::Edge(bfs)!=INVALID) { 97 97 cout << edge_name[bfs] << /*endl*/", " << 98 node_name[G. tail(bfs)] <<99 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 100 node_name[G. head(bfs)] <<98 node_name[G.source(bfs)] << 99 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 100 node_name[G.target(bfs)] << 101 101 (bfs.isBNodeNewlyReached() ? ": is newly reached." : 102 102 ": is not newly reached."); 103 103 } else { 104 104 cout << "invalid" << /*endl*/", " << 105 node_name[bfs. tail()] <<105 node_name[bfs.source()] << 106 106 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 107 107 … … 130 130 if (Graph::Edge(dfs)!=INVALID) { 131 131 cout << edge_name[dfs] << /*endl*/", " << 132 node_name[G. tail(dfs)] <<133 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 134 node_name[G. head(dfs)] <<132 node_name[G.source(dfs)] << 133 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 134 node_name[G.target(dfs)] << 135 135 (dfs.isBNodeNewlyReached() ? ": is newly reached." : 136 136 ": is not newly reached."); 137 137 } else { 138 138 cout << "invalid" << /*endl*/", " << 139 node_name[dfs. tail()] <<139 node_name[dfs.source()] << 140 140 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 141 141 … … 172 172 if (GW::Edge(bfs)!=INVALID) { 173 173 cout << edge_name[GW::Edge(bfs)] << /*endl*/", " << 174 node_name[gw. tail(bfs)] <<175 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 176 node_name[gw. head(bfs)] <<174 node_name[gw.source(bfs)] << 175 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 176 node_name[gw.target(bfs)] << 177 177 (bfs.isBNodeNewlyReached() ? ": is newly reached." : 178 178 ": is not newly reached."); 179 179 } else { 180 180 cout << "invalid" << /*endl*/", " << 181 node_name[bfs. tail()] <<181 node_name[bfs.source()] << 182 182 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 183 183 … … 206 206 if (GW::Edge(dfs)!=INVALID) { 207 207 cout << edge_name[GW::Edge(dfs)] << /*endl*/", " << 208 node_name[gw. tail(dfs)] <<209 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 210 node_name[gw. head(dfs)] <<208 node_name[gw.source(dfs)] << 209 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 210 node_name[gw.target(dfs)] << 211 211 (dfs.isBNodeNewlyReached() ? ": is newly reached." : 212 212 ": is not newly reached."); 213 213 } else { 214 214 cout << "invalid" << /*endl*/", " << 215 node_name[dfs. tail()] <<215 node_name[dfs.source()] << 216 216 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 217 217 … … 311 311 cout << "bfs and dfs iterator demo on the bidirected graph" << endl; 312 312 // for(GW::EdgeIt e(gw); e!=INVALID; ++e) { 313 // cout << node_name[gw. tail(e)] << "->" << node_name[gw.head(e)] << " ";313 // cout << node_name[gw.source(e)] << "->" << node_name[gw.target(e)] << " "; 314 314 // } 315 315 for(GW::NodeIt n(gw); n!=INVALID; ++n) { … … 335 335 if (GW::Edge(bfs)!=INVALID) { 336 336 cout << edge_name[GW::Edge(bfs)] << /*endl*/", " << 337 node_name[gw. tail(bfs)] <<338 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 339 node_name[gw. head(bfs)] <<337 node_name[gw.source(bfs)] << 338 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 339 node_name[gw.target(bfs)] << 340 340 (bfs.isBNodeNewlyReached() ? ": is newly reached." : 341 341 ": is not newly reached."); 342 342 } else { 343 343 cout << "invalid" << /*endl*/", " << 344 node_name[bfs. tail()] <<344 node_name[bfs.source()] << 345 345 (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 346 346 … … 369 369 if (GW::Edge(dfs)!=INVALID) { 370 370 cout << edge_name[GW::Edge(dfs)] << /*endl*/", " << 371 node_name[gw. tail(dfs)] <<372 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 373 node_name[gw. head(dfs)] <<371 node_name[gw.source(dfs)] << 372 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 373 node_name[gw.target(dfs)] << 374 374 (dfs.isBNodeNewlyReached() ? ": is newly reached." : 375 375 ": is not newly reached."); 376 376 } else { 377 377 cout << "invalid" << /*endl*/", " << 378 node_name[dfs. tail()] <<378 node_name[dfs.source()] << 379 379 (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 380 380
Note: See TracChangeset
for help on using the changeset viewer.