Changeset 774:4297098d9677 in lemon-0.x for src/work/marci/bfs_dfs.h
- Timestamp:
- 08/30/04 14:01:47 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/bfs_dfs.h
r671 r774 61 61 bfs_queue.push(s); 62 62 graph->first(actual_edge, s); 63 if ( graph->valid(actual_edge)) {64 Node w=graph-> bNode(actual_edge);63 if (actual_edge!=INVALID) { 64 Node w=graph->head(actual_edge); 65 65 if (!reached[w]) { 66 66 bfs_queue.push(w); … … 79 79 BfsIterator<Graph, /*OutEdgeIt,*/ ReachedMap>& 80 80 operator++() { 81 if ( graph->valid(actual_edge)) {82 graph->next(actual_edge);83 if ( graph->valid(actual_edge)) {84 Node w=graph-> bNode(actual_edge);81 if (actual_edge!=INVALID) { 82 ++actual_edge; 83 if (actual_edge!=INVALID) { 84 Node w=graph->head(actual_edge); 85 85 if (!reached[w]) { 86 86 bfs_queue.push(w); … … 95 95 if (!bfs_queue.empty()) { 96 96 graph->first(actual_edge, bfs_queue.front()); 97 if ( graph->valid(actual_edge)) {98 Node w=graph-> bNode(actual_edge);97 if (actual_edge!=INVALID) { 98 Node w=graph->head(actual_edge); 99 99 if (!reached[w]) { 100 100 bfs_queue.push(w); … … 118 118 bool isBNodeNewlyReached() const { return b_node_newly_reached; } 119 119 /// Returns if a-node is examined. 120 bool isANodeExamined() const { return !(graph->valid(actual_edge)); }120 bool isANodeExamined() const { return actual_edge==INVALID; } 121 121 /// Returns a-node of the actual edge, so does if the edge is invalid. 122 122 Node aNode() const { return bfs_queue.front(); } … … 238 238 actual_edge=dfs_stack.top(); 239 239 //actual_node=G.aNode(actual_edge); 240 if ( graph->valid(actual_edge)/*.valid()*/) {241 Node w=graph-> bNode(actual_edge);240 if (actual_edge!=INVALID/*.valid()*/) { 241 Node w=graph->head(actual_edge); 242 242 actual_node=w; 243 243 if (!reached[w]) { … … 248 248 b_node_newly_reached=true; 249 249 } else { 250 actual_node=graph-> aNode(actual_edge);251 graph->next(dfs_stack.top());250 actual_node=graph->tail(actual_edge); 251 ++dfs_stack.top(); 252 252 b_node_newly_reached=false; 253 253 } … … 267 267 bool isBNodeNewlyReached() const { return b_node_newly_reached; } 268 268 /// Returns if a-node is examined. 269 bool isANodeExamined() const { return !(graph->valid(actual_edge)); }269 bool isANodeExamined() const { return actual_edge==INVALID; } 270 270 /// Returns a-node of the actual edge, so does if the edge is invalid. 271 271 Node aNode() const { return actual_node; /*FIXME*/}
Note: See TracChangeset
for help on using the changeset viewer.