diff -r 718479989797 -r 3f1c7a6c33cd lemon/dijkstra.h
--- a/lemon/dijkstra.h Mon May 07 08:48:40 2007 +0000
+++ b/lemon/dijkstra.h Mon May 07 08:49:57 2007 +0000
@@ -601,7 +601,7 @@
/// is empty.
Node nextNode()
{
- return _heap->empty()?_heap->top():INVALID;
+ return !_heap->empty()?_heap->top():INVALID;
}
///\brief Returns \c false if there are nodes
@@ -664,11 +664,16 @@
///
///\param nm must be a bool (or convertible) node map. The algorithm
///will stop when it reaches a node \c v with nm[v]==true.
+ ///
+ ///\return The reached node \c v with nm[v]==true<\tt> or
+ ///\c INVALID if no such node was found.
template
- void start(const NodeBoolMap &nm)
+ Node start(const NodeBoolMap &nm)
{
while ( !_heap->empty() && !nm[_heap->top()] ) processNextNode();
- if ( !_heap->empty() ) finalizeNodeData(_heap->top(),_heap->prio());
+ if ( _heap->empty() ) return INVALID;
+ finalizeNodeData(_heap->top(),_heap->prio());
+ return _heap->top();
}
///Runs %Dijkstra algorithm from node \c s.