Changeset 986:e997802b855c in lemon-0.x for src/work/marci/bfs_dfs.h
- Timestamp:
- 11/13/04 13:53:28 (20 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/bfs_dfs.h
r921 r986 64 64 //graph->first(actual_edge, s); 65 65 if (actual_edge!=INVALID) { 66 Node w=graph-> head(actual_edge);66 Node w=graph->target(actual_edge); 67 67 if (!reached[w]) { 68 68 bfs_queue.push(w); … … 86 86 //++actual_edge; 87 87 if (actual_edge!=INVALID) { 88 Node w=graph-> head(actual_edge);88 Node w=graph->target(actual_edge); 89 89 if (!reached[w]) { 90 90 bfs_queue.push(w); … … 101 101 //graph->first(actual_edge, bfs_queue.front()); 102 102 if (actual_edge!=INVALID) { 103 Node w=graph-> head(actual_edge);103 Node w=graph->target(actual_edge); 104 104 if (!reached[w]) { 105 105 bfs_queue.push(w); … … 125 125 bool isANodeExamined() const { return actual_edge==INVALID; } 126 126 /// Returns a-node of the actual edge, so does if the edge is invalid. 127 Node tail() const { return bfs_queue.front(); }127 Node source() const { return bfs_queue.front(); } 128 128 /// \pre The actual edge have to be valid. 129 Node head() const { return graph->head(actual_edge); }129 Node target() const { return graph->target(actual_edge); } 130 130 /// Guess what? 131 131 /// \deprecated … … 187 187 if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 188 188 { 189 pred.set(this-> head(), this->actual_edge);190 dist.set(this-> head(), dist[this->tail()]);189 pred.set(this->target(), this->actual_edge); 190 dist.set(this->target(), dist[this->source()]); 191 191 } 192 192 return *this; … … 247 247 actual_edge=dfs_stack.top(); 248 248 if (actual_edge!=INVALID/*.valid()*/) { 249 Node w=graph-> head(actual_edge);249 Node w=graph->target(actual_edge); 250 250 actual_node=w; 251 251 if (!reached[w]) { … … 256 256 b_node_newly_reached=true; 257 257 } else { 258 actual_node=graph-> tail(actual_edge);258 actual_node=graph->source(actual_edge); 259 259 ++dfs_stack.top(); 260 260 b_node_newly_reached=false; … … 277 277 bool isANodeExamined() const { return actual_edge==INVALID; } 278 278 /// Returns a-node of the actual edge, so does if the edge is invalid. 279 Node tail() const { return actual_node; /*FIXME*/}279 Node source() const { return actual_node; /*FIXME*/} 280 280 /// Returns b-node of the actual edge. 281 281 /// \pre The actual edge have to be valid. 282 Node head() const { return graph->head(actual_edge); }282 Node target() const { return graph->target(actual_edge); } 283 283 /// Guess what? 284 284 /// \deprecated … … 334 334 if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 335 335 { 336 pred.set(this-> head(), this->actual_edge);336 pred.set(this->target(), this->actual_edge); 337 337 } 338 338 return *this;
Note: See TracChangeset
for help on using the changeset viewer.