src/work/marci/bfs_dfs.h
changeset 986 e997802b855c
parent 921 818510fa3d99
     1.1 --- a/src/work/marci/bfs_dfs.h	Sat Nov 13 12:24:01 2004 +0000
     1.2 +++ b/src/work/marci/bfs_dfs.h	Sat Nov 13 12:53:28 2004 +0000
     1.3 @@ -63,7 +63,7 @@
     1.4  	actual_edge=OutEdgeIt(*graph, s);
     1.5  	//graph->first(actual_edge, s);
     1.6  	if (actual_edge!=INVALID) { 
     1.7 -	  Node w=graph->head(actual_edge);
     1.8 +	  Node w=graph->target(actual_edge);
     1.9  	  if (!reached[w]) {
    1.10  	    bfs_queue.push(w);
    1.11  	    reached.set(w, true);
    1.12 @@ -85,7 +85,7 @@
    1.13  	actual_edge=++OutEdgeIt(*graph, actual_edge);
    1.14  	//++actual_edge;
    1.15  	if (actual_edge!=INVALID) {
    1.16 -	  Node w=graph->head(actual_edge);
    1.17 +	  Node w=graph->target(actual_edge);
    1.18  	  if (!reached[w]) {
    1.19  	    bfs_queue.push(w);
    1.20  	    reached.set(w, true);
    1.21 @@ -100,7 +100,7 @@
    1.22  	  actual_edge=OutEdgeIt(*graph, bfs_queue.front());
    1.23  	  //graph->first(actual_edge, bfs_queue.front());
    1.24  	  if (actual_edge!=INVALID) {
    1.25 -	    Node w=graph->head(actual_edge);
    1.26 +	    Node w=graph->target(actual_edge);
    1.27  	    if (!reached[w]) {
    1.28  	      bfs_queue.push(w);
    1.29  	      reached.set(w, true);
    1.30 @@ -124,9 +124,9 @@
    1.31      /// Returns if a-node is examined.
    1.32      bool isANodeExamined() const { return actual_edge==INVALID; }
    1.33      /// Returns a-node of the actual edge, so does if the edge is invalid.
    1.34 -    Node tail() const { return bfs_queue.front(); }
    1.35 +    Node source() const { return bfs_queue.front(); }
    1.36      /// \pre The actual edge have to be valid.
    1.37 -    Node head() const { return graph->head(actual_edge); }
    1.38 +    Node target() const { return graph->target(actual_edge); }
    1.39      /// Guess what?
    1.40      /// \deprecated 
    1.41      const ReachedMap& getReachedMap() const { return reached; }
    1.42 @@ -186,8 +186,8 @@
    1.43        Parent::operator++();
    1.44        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
    1.45        {
    1.46 -	pred.set(this->head(), this->actual_edge);
    1.47 -	dist.set(this->head(), dist[this->tail()]);
    1.48 +	pred.set(this->target(), this->actual_edge);
    1.49 +	dist.set(this->target(), dist[this->source()]);
    1.50        }
    1.51        return *this;
    1.52      }
    1.53 @@ -246,7 +246,7 @@
    1.54      operator++() { 
    1.55        actual_edge=dfs_stack.top();
    1.56        if (actual_edge!=INVALID/*.valid()*/) { 
    1.57 -	Node w=graph->head(actual_edge);
    1.58 +	Node w=graph->target(actual_edge);
    1.59  	actual_node=w;
    1.60  	if (!reached[w]) {
    1.61  	  OutEdgeIt e(*graph, w);
    1.62 @@ -255,7 +255,7 @@
    1.63  	  reached.set(w, true);
    1.64  	  b_node_newly_reached=true;
    1.65  	} else {
    1.66 -	  actual_node=graph->tail(actual_edge);
    1.67 +	  actual_node=graph->source(actual_edge);
    1.68  	  ++dfs_stack.top();
    1.69  	  b_node_newly_reached=false;
    1.70  	}
    1.71 @@ -276,10 +276,10 @@
    1.72      /// Returns if a-node is examined.
    1.73      bool isANodeExamined() const { return actual_edge==INVALID; }
    1.74      /// Returns a-node of the actual edge, so does if the edge is invalid.
    1.75 -    Node tail() const { return actual_node; /*FIXME*/}
    1.76 +    Node source() const { return actual_node; /*FIXME*/}
    1.77      /// Returns b-node of the actual edge. 
    1.78      /// \pre The actual edge have to be valid.
    1.79 -    Node head() const { return graph->head(actual_edge); }
    1.80 +    Node target() const { return graph->target(actual_edge); }
    1.81      /// Guess what?
    1.82      /// \deprecated
    1.83      const ReachedMap& getReachedMap() const { return reached; }
    1.84 @@ -333,7 +333,7 @@
    1.85        Parent::operator++();
    1.86        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
    1.87        {
    1.88 -	pred.set(this->head(), this->actual_edge);
    1.89 +	pred.set(this->target(), this->actual_edge);
    1.90        }
    1.91        return *this;
    1.92      }