Bug fix
authordeba
Wed, 01 Mar 2006 09:40:16 +0000
changeset 1988875fe3f689e0
parent 1987 8cd6683382e0
child 1989 d276e88aa48a
Bug fix
lemon/dijkstra.h
     1.1 --- a/lemon/dijkstra.h	Mon Feb 27 15:43:25 2006 +0000
     1.2 +++ b/lemon/dijkstra.h	Wed Mar 01 09:40:16 2006 +0000
     1.3 @@ -543,14 +543,14 @@
     1.4      ///The optional second parameter is the initial distance of the node.
     1.5      ///
     1.6      ///It checks if the node has already been added to the heap and
     1.7 -    ///It is pushed to the heap only if either it was not in the heap
     1.8 -    ///or the shortest path found till then is longer then \c dst.
     1.9 +    ///it is pushed to the heap only if either it was not in the heap
    1.10 +    ///or the shortest path found till then is shorter than \c dst.
    1.11      void addSource(Node s,Value dst=dijkstraZero<Value>())
    1.12      {
    1.13        if(_heap->state(s) != Heap::IN_HEAP) {
    1.14  	_heap->push(s,dst);
    1.15        } else if((*_heap)[s]<dst) {
    1.16 -	_heap->push(s,dst);
    1.17 +	_heap->set(s,dst);
    1.18  	_pred->set(s,INVALID);
    1.19        }
    1.20      }