lemon/belmann_ford.h
changeset 1741 7a98fe2ed989
parent 1723 fb4f801dd692
child 1754 4bf5ceb49023
     1.1 --- a/lemon/belmann_ford.h	Mon Oct 24 17:03:02 2005 +0000
     1.2 +++ b/lemon/belmann_ford.h	Wed Oct 26 10:50:47 2005 +0000
     1.3 @@ -412,7 +412,7 @@
     1.4      void start() {
     1.5        int num = countNodes(*graph) - 1;
     1.6        for (int i = 0; i < num; ++i) {
     1.7 -	bool ready = true;
     1.8 +	bool done = true;
     1.9  	for (EdgeIt it(*graph); it != INVALID; ++it) {
    1.10  	  Node source = graph->source(it);
    1.11  	  Node target = graph->target(it);
    1.12 @@ -421,14 +421,14 @@
    1.13  	  if (OperationTraits::less(relaxed, (*_dist)[target])) {
    1.14  	    _pred->set(target, it);
    1.15  	    _dist->set(target, relaxed);
    1.16 -	    ready = false; 
    1.17 +	    done = false; 
    1.18  	  }
    1.19  	}
    1.20 -	if (ready) return;
    1.21 +	if (done) return;
    1.22        }
    1.23      }
    1.24  
    1.25 -    /// \brief Executes the algorithm and check the negative circles.
    1.26 +    /// \brief Executes the algorithm and checks the negative circles.
    1.27      ///
    1.28      /// \pre init() must be called and at least one node should be added
    1.29      /// with addSource() before using this function. If there is
    1.30 @@ -442,7 +442,7 @@
    1.31      bool checkedStart() {
    1.32        int num = countNodes(*graph);
    1.33        for (int i = 0; i < num; ++i) {
    1.34 -	bool ready = true;
    1.35 +	bool done = true;
    1.36  	for (EdgeIt it(*graph); it != INVALID; ++it) {
    1.37  	  Node source = graph->source(it);
    1.38  	  Node target = graph->target(it);
    1.39 @@ -451,10 +451,10 @@
    1.40  	  if (OperationTraits::less(relaxed, (*_dist)[target])) {
    1.41  	    _pred->set(target, it);
    1.42  	    _dist->set(target, relaxed);
    1.43 -	    ready = false; 
    1.44 +	    done = false; 
    1.45  	  }
    1.46  	}
    1.47 -	if (ready) return true;
    1.48 +	if (done) return true;
    1.49        }
    1.50        return false;
    1.51      }