Index: lemon/circulation.h
===================================================================
--- lemon/circulation.h	(revision 669)
+++ lemon/circulation.h	(revision 658)
@@ -22,5 +22,4 @@
 #include <lemon/tolerance.h>
 #include <lemon/elevator.h>
-#include <limits>
 
 ///\ingroup max_flow
@@ -121,7 +120,7 @@
 
      The exact formulation of this problem is the following.
-     Let \f$G=(V,A)\f$ be a digraph, \f$lower: A\rightarrow\mathbf{R}\f$
-     \f$upper: A\rightarrow\mathbf{R}\cup\{\infty\}\f$ denote the lower and
-     upper bounds on the arcs, for which \f$lower(uv) \leq upper(uv)\f$
+     Let \f$G=(V,A)\f$ be a digraph,
+     \f$lower, upper: A\rightarrow\mathbf{R}^+_0\f$ denote the lower and
+     upper bounds on the arcs, for which \f$0 \leq lower(uv) \leq upper(uv)\f$
      holds for all \f$uv\in A\f$, and \f$sup: V\rightarrow\mathbf{R}\f$
      denotes the signed supply values of the nodes.
@@ -129,5 +128,5 @@
      supply, if \f$sup(u)<0\f$, then \f$u\f$ is a demand node with
      \f$-sup(u)\f$ demand.
-     A feasible circulation is an \f$f: A\rightarrow\mathbf{R}\f$
+     A feasible circulation is an \f$f: A\rightarrow\mathbf{R}^+_0\f$
      solution of the following problem.
 
@@ -152,8 +151,4 @@
      the direction of the arcs and taking the negative of the supply values
      (e.g. using \ref ReverseDigraph and \ref NegMap adaptors).
-
-     This algorithm either calculates a feasible circulation, or provides
-     a \ref barrier() "barrier", which prooves that a feasible soultion
-     cannot exist.
 
      Note that this algorithm also provides a feasible solution for the
@@ -343,11 +338,4 @@
   private:
 
-    bool checkBoundMaps() {
-      for (ArcIt e(_g);e!=INVALID;++e) {
-        if (_tol.less((*_up)[e], (*_lo)[e])) return false;
-      }
-      return true;
-    }
-
     void createStructures() {
       _node_num = _el = countNodes(_g);
@@ -393,5 +381,5 @@
     /// Sets the upper bound (capacity) map.
     /// \return <tt>(*this)</tt>
-    Circulation& upperMap(const UpperMap& map) {
+    Circulation& upperMap(const LowerMap& map) {
       _up = &map;
       return *this;
@@ -480,7 +468,4 @@
     void init()
     {
-      LEMON_DEBUG(checkBoundMaps(),
-        "Upper bounds must be greater or equal to the lower bounds");
-
       createStructures();
 
@@ -512,7 +497,4 @@
     void greedyInit()
     {
-      LEMON_DEBUG(checkBoundMaps(),
-        "Upper bounds must be greater or equal to the lower bounds");
-
       createStructures();
 
@@ -522,9 +504,9 @@
 
       for (ArcIt e(_g);e!=INVALID;++e) {
-        if (!_tol.less(-(*_excess)[_g.target(e)], (*_up)[e])) {
+        if (!_tol.positive((*_excess)[_g.target(e)] + (*_up)[e])) {
           _flow->set(e, (*_up)[e]);
           (*_excess)[_g.target(e)] += (*_up)[e];
           (*_excess)[_g.source(e)] -= (*_up)[e];
-        } else if (_tol.less(-(*_excess)[_g.target(e)], (*_lo)[e])) {
+        } else if (_tol.positive((*_excess)[_g.target(e)] + (*_lo)[e])) {
           _flow->set(e, (*_lo)[e]);
           (*_excess)[_g.target(e)] += (*_lo)[e];
@@ -767,7 +749,4 @@
     {
       Flow delta=0;
-      Flow inf_cap = std::numeric_limits<Flow>::has_infinity ?
-        std::numeric_limits<Flow>::infinity() :
-        std::numeric_limits<Flow>::max();
       for(NodeIt n(_g);n!=INVALID;++n)
         if(barrier(n))
@@ -777,8 +756,5 @@
           Node s=_g.source(e);
           Node t=_g.target(e);
-          if(barrier(s)&&!barrier(t)) {
-            if (_tol.less(inf_cap - (*_up)[e], delta)) return false;
-            delta+=(*_up)[e];
-          }
+          if(barrier(s)&&!barrier(t)) delta+=(*_up)[e];
           else if(barrier(t)&&!barrier(s)) delta-=(*_lo)[e];
         }
Index: lemon/min_cost_arborescence.h
===================================================================
--- lemon/min_cost_arborescence.h	(revision 631)
+++ lemon/min_cost_arborescence.h	(revision 672)
@@ -37,5 +37,5 @@
   /// Default traits class for MinCostArborescence class.
   /// \param GR Digraph type.
-  /// \param CM Type of cost map.
+  /// \param CM Type of the cost map.
   template <class GR, class CM>
   struct MinCostArborescenceDefaultTraits{
@@ -47,5 +47,5 @@
     ///
     /// The type of the map that stores the arc costs.
-    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
+    /// It must conform to the \ref concepts::ReadMap "ReadMap" concept.
     typedef CM CostMap;
 
@@ -59,7 +59,8 @@
     ///
     /// The type of the map that stores which arcs are in the
-    /// arborescence.  It must meet the \ref concepts::WriteMap
-    /// "WriteMap" concept.  Initially it will be set to false on each
-    /// arc. After it will set all arborescence arcs once.
+    /// arborescence.  It must conform to the \ref concepts::WriteMap
+    /// "WriteMap" concept, and its value type must be \c bool
+    /// (or convertible). Initially it will be set to \c false on each
+    /// arc, then it will be set on each arborescence arc once.
     typedef typename Digraph::template ArcMap<bool> ArborescenceMap;
 
@@ -67,6 +68,6 @@
     ///
     /// This function instantiates a \c ArborescenceMap.
-    /// \param digraph is the graph, to which we would like to
-    /// calculate the \c ArborescenceMap.
+    /// \param digraph The digraph to which we would like to calculate
+    /// the \c ArborescenceMap.
     static ArborescenceMap *createArborescenceMap(const Digraph &digraph){
       return new ArborescenceMap(digraph);
@@ -75,5 +76,7 @@
     /// \brief The type of the \c PredMap
     ///
-    /// The type of the \c PredMap. It is a node map with an arc value type.
+    /// The type of the \c PredMap. It must confrom to the
+    /// \ref concepts::WriteMap "WriteMap" concept, and its value type
+    /// must be the \c Arc type of the digraph.
     typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
 
@@ -93,20 +96,19 @@
   /// \brief Minimum Cost Arborescence algorithm class.
   ///
-  /// This class provides an efficient implementation of
+  /// This class provides an efficient implementation of the
   /// Minimum Cost Arborescence algorithm. The arborescence is a tree
   /// which is directed from a given source node of the digraph. One or
-  /// more sources should be given for the algorithm and it will calculate
-  /// the minimum cost subgraph which are union of arborescences with the
+  /// more sources should be given to the algorithm and it will calculate
+  /// the minimum cost subgraph that is the union of arborescences with the
   /// given sources and spans all the nodes which are reachable from the
   /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+e).
   ///
-  /// The algorithm provides also an optimal dual solution, therefore
+  /// The algorithm also provides an optimal dual solution, therefore
   /// the optimality of the solution can be checked.
   ///
-  /// \param GR The digraph type the algorithm runs on. The default value
-  /// is \ref ListDigraph.
-  /// \param CM This read-only ArcMap determines the costs of the
+  /// \param GR The digraph type the algorithm runs on.
+  /// \param CM A read-only arc map storing the costs of the
   /// arcs. It is read once for each arc, so the map may involve in
-  /// relatively time consuming process to compute the arc cost if
+  /// relatively time consuming process to compute the arc costs if
   /// it is necessary. The default map type is \ref
   /// concepts::Digraph::ArcMap "Digraph::ArcMap<int>".
@@ -114,9 +116,7 @@
   /// by the algorithm. The default traits class is
   /// \ref MinCostArborescenceDefaultTraits
-  /// "MinCostArborescenceDefaultTraits<GR, CM>".  See \ref
-  /// MinCostArborescenceDefaultTraits for the documentation of a
-  /// MinCostArborescence traits class.
+  /// "MinCostArborescenceDefaultTraits<GR, CM>".
 #ifndef DOXYGEN
-  template <typename GR = ListDigraph,
+  template <typename GR,
             typename CM = typename GR::template ArcMap<int>,
             typename TR =
@@ -128,5 +128,6 @@
   public:
 
-    /// The traits.
+    /// \brief The \ref MinCostArborescenceDefaultTraits "traits class" 
+    /// of the algorithm. 
     typedef TR Traits;
     /// The type of the underlying digraph.
@@ -396,5 +397,5 @@
 
     template <class T>
-    struct DefArborescenceMapTraits : public Traits {
+    struct SetArborescenceMapTraits : public Traits {
       typedef T ArborescenceMap;
       static ArborescenceMap *createArborescenceMap(const Digraph &)
@@ -406,31 +407,38 @@
 
     /// \brief \ref named-templ-param "Named parameter" for
-    /// setting ArborescenceMap type
+    /// setting \c ArborescenceMap type
     ///
     /// \ref named-templ-param "Named parameter" for setting
-    /// ArborescenceMap type
+    /// \c ArborescenceMap type.
+    /// It must conform to the \ref concepts::WriteMap "WriteMap" concept,
+    /// and its value type must be \c bool (or convertible).
+    /// Initially it will be set to \c false on each arc,
+    /// then it will be set on each arborescence arc once.
     template <class T>
-    struct DefArborescenceMap
+    struct SetArborescenceMap
       : public MinCostArborescence<Digraph, CostMap,
-                                   DefArborescenceMapTraits<T> > {
+                                   SetArborescenceMapTraits<T> > {
     };
 
     template <class T>
-    struct DefPredMapTraits : public Traits {
+    struct SetPredMapTraits : public Traits {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &)
       {
         LEMON_ASSERT(false, "PredMap is not initialized");
+        return 0; // ignore warnings
       }
     };
 
     /// \brief \ref named-templ-param "Named parameter" for
-    /// setting PredMap type
+    /// setting \c PredMap type
     ///
     /// \ref named-templ-param "Named parameter" for setting
-    /// PredMap type
+    /// \c PredMap type.
+    /// It must meet the \ref concepts::WriteMap "WriteMap" concept, 
+    /// and its value type must be the \c Arc type of the digraph.
     template <class T>
-    struct DefPredMap
-      : public MinCostArborescence<Digraph, CostMap, DefPredMapTraits<T> > {
+    struct SetPredMap
+      : public MinCostArborescence<Digraph, CostMap, SetPredMapTraits<T> > {
     };
 
@@ -465,7 +473,7 @@
     }
 
-    /// \brief Sets the arborescence map.
-    ///
-    /// Sets the arborescence map.
+    /// \brief Sets the predecessor map.
+    ///
+    /// Sets the predecessor map.
     /// \return <tt>(*this)</tt>
     MinCostArborescence& predMap(PredMap& m) {
@@ -477,157 +485,4 @@
       return *this;
     }
-
-    /// \name Query Functions
-    /// The result of the %MinCostArborescence algorithm can be obtained
-    /// using these functions.\n
-    /// Before the use of these functions,
-    /// either run() or start() must be called.
-
-    /// @{
-
-    /// \brief Returns a reference to the arborescence map.
-    ///
-    /// Returns a reference to the arborescence map.
-    const ArborescenceMap& arborescenceMap() const {
-      return *_arborescence;
-    }
-
-    /// \brief Returns true if the arc is in the arborescence.
-    ///
-    /// Returns true if the arc is in the arborescence.
-    /// \param arc The arc of the digraph.
-    /// \pre \ref run() must be called before using this function.
-    bool arborescence(Arc arc) const {
-      return (*_pred)[_digraph->target(arc)] == arc;
-    }
-
-    /// \brief Returns a reference to the pred map.
-    ///
-    /// Returns a reference to the pred map.
-    const PredMap& predMap() const {
-      return *_pred;
-    }
-
-    /// \brief Returns the predecessor arc of the given node.
-    ///
-    /// Returns the predecessor arc of the given node.
-    Arc pred(Node node) const {
-      return (*_pred)[node];
-    }
-
-    /// \brief Returns the cost of the arborescence.
-    ///
-    /// Returns the cost of the arborescence.
-    Value arborescenceValue() const {
-      Value sum = 0;
-      for (ArcIt it(*_digraph); it != INVALID; ++it) {
-        if (arborescence(it)) {
-          sum += (*_cost)[it];
-        }
-      }
-      return sum;
-    }
-
-    /// \brief Indicates that a node is reachable from the sources.
-    ///
-    /// Indicates that a node is reachable from the sources.
-    bool reached(Node node) const {
-      return (*_node_order)[node] != -3;
-    }
-
-    /// \brief Indicates that a node is processed.
-    ///
-    /// Indicates that a node is processed. The arborescence path exists
-    /// from the source to the given node.
-    bool processed(Node node) const {
-      return (*_node_order)[node] == -1;
-    }
-
-    /// \brief Returns the number of the dual variables in basis.
-    ///
-    /// Returns the number of the dual variables in basis.
-    int dualNum() const {
-      return _dual_variables.size();
-    }
-
-    /// \brief Returns the value of the dual solution.
-    ///
-    /// Returns the value of the dual solution. It should be
-    /// equal to the arborescence value.
-    Value dualValue() const {
-      Value sum = 0;
-      for (int i = 0; i < int(_dual_variables.size()); ++i) {
-        sum += _dual_variables[i].value;
-      }
-      return sum;
-    }
-
-    /// \brief Returns the number of the nodes in the dual variable.
-    ///
-    /// Returns the number of the nodes in the dual variable.
-    int dualSize(int k) const {
-      return _dual_variables[k].end - _dual_variables[k].begin;
-    }
-
-    /// \brief Returns the value of the dual variable.
-    ///
-    /// Returns the the value of the dual variable.
-    const Value& dualValue(int k) const {
-      return _dual_variables[k].value;
-    }
-
-    /// \brief Lemon iterator for get a dual variable.
-    ///
-    /// Lemon iterator for get a dual variable. This class provides
-    /// a common style lemon iterator which gives back a subset of
-    /// the nodes.
-    class DualIt {
-    public:
-
-      /// \brief Constructor.
-      ///
-      /// Constructor for get the nodeset of the variable.
-      DualIt(const MinCostArborescence& algorithm, int variable)
-        : _algorithm(&algorithm)
-      {
-        _index = _algorithm->_dual_variables[variable].begin;
-        _last = _algorithm->_dual_variables[variable].end;
-      }
-
-      /// \brief Conversion to node.
-      ///
-      /// Conversion to node.
-      operator Node() const {
-        return _algorithm->_dual_node_list[_index];
-      }
-
-      /// \brief Increment operator.
-      ///
-      /// Increment operator.
-      DualIt& operator++() {
-        ++_index;
-        return *this;
-      }
-
-      /// \brief Validity checking
-      ///
-      /// Checks whether the iterator is invalid.
-      bool operator==(Invalid) const {
-        return _index == _last;
-      }
-
-      /// \brief Validity checking
-      ///
-      /// Checks whether the iterator is valid.
-      bool operator!=(Invalid) const {
-        return _index != _last;
-      }
-
-    private:
-      const MinCostArborescence* _algorithm;
-      int _index, _last;
-    };
-
-    /// @}
 
     /// \name Execution Control
@@ -690,5 +545,5 @@
     /// \return The processed node.
     ///
-    /// \warning The queue must not be empty!
+    /// \warning The queue must not be empty.
     Node processNextNode() {
       Node node = queue.back();
@@ -713,5 +568,6 @@
     /// \brief Returns the number of the nodes to be processed.
     ///
-    /// Returns the number of the nodes to be processed.
+    /// Returns the number of the nodes to be processed in the priority
+    /// queue.
     int queueSize() const {
       return queue.size();
@@ -755,11 +611,167 @@
     /// mca.start();
     /// \endcode
-    void run(Node node) {
+    void run(Node s) {
       init();
-      addSource(node);
+      addSource(s);
       start();
     }
 
     ///@}
+
+    /// \name Query Functions
+    /// The result of the %MinCostArborescence algorithm can be obtained
+    /// using these functions.\n
+    /// Either run() or start() must be called before using them.
+
+    /// @{
+
+    /// \brief Returns the cost of the arborescence.
+    ///
+    /// Returns the cost of the arborescence.
+    Value arborescenceCost() const {
+      Value sum = 0;
+      for (ArcIt it(*_digraph); it != INVALID; ++it) {
+        if (arborescence(it)) {
+          sum += (*_cost)[it];
+        }
+      }
+      return sum;
+    }
+
+    /// \brief Returns \c true if the arc is in the arborescence.
+    ///
+    /// Returns \c true if the given arc is in the arborescence.
+    /// \param arc An arc of the digraph.
+    /// \pre \ref run() must be called before using this function.
+    bool arborescence(Arc arc) const {
+      return (*_pred)[_digraph->target(arc)] == arc;
+    }
+
+    /// \brief Returns a const reference to the arborescence map.
+    ///
+    /// Returns a const reference to the arborescence map.
+    /// \pre \ref run() must be called before using this function.
+    const ArborescenceMap& arborescenceMap() const {
+      return *_arborescence;
+    }
+
+    /// \brief Returns the predecessor arc of the given node.
+    ///
+    /// Returns the predecessor arc of the given node.
+    /// \pre \ref run() must be called before using this function.
+    Arc pred(Node node) const {
+      return (*_pred)[node];
+    }
+
+    /// \brief Returns a const reference to the pred map.
+    ///
+    /// Returns a const reference to the pred map.
+    /// \pre \ref run() must be called before using this function.
+    const PredMap& predMap() const {
+      return *_pred;
+    }
+
+    /// \brief Indicates that a node is reachable from the sources.
+    ///
+    /// Indicates that a node is reachable from the sources.
+    bool reached(Node node) const {
+      return (*_node_order)[node] != -3;
+    }
+
+    /// \brief Indicates that a node is processed.
+    ///
+    /// Indicates that a node is processed. The arborescence path exists
+    /// from the source to the given node.
+    bool processed(Node node) const {
+      return (*_node_order)[node] == -1;
+    }
+
+    /// \brief Returns the number of the dual variables in basis.
+    ///
+    /// Returns the number of the dual variables in basis.
+    int dualNum() const {
+      return _dual_variables.size();
+    }
+
+    /// \brief Returns the value of the dual solution.
+    ///
+    /// Returns the value of the dual solution. It should be
+    /// equal to the arborescence value.
+    Value dualValue() const {
+      Value sum = 0;
+      for (int i = 0; i < int(_dual_variables.size()); ++i) {
+        sum += _dual_variables[i].value;
+      }
+      return sum;
+    }
+
+    /// \brief Returns the number of the nodes in the dual variable.
+    ///
+    /// Returns the number of the nodes in the dual variable.
+    int dualSize(int k) const {
+      return _dual_variables[k].end - _dual_variables[k].begin;
+    }
+
+    /// \brief Returns the value of the dual variable.
+    ///
+    /// Returns the the value of the dual variable.
+    Value dualValue(int k) const {
+      return _dual_variables[k].value;
+    }
+
+    /// \brief LEMON iterator for getting a dual variable.
+    ///
+    /// This class provides a common style LEMON iterator for getting a
+    /// dual variable of \ref MinCostArborescence algorithm.
+    /// It iterates over a subset of the nodes.
+    class DualIt {
+    public:
+
+      /// \brief Constructor.
+      ///
+      /// Constructor for getting the nodeset of the dual variable
+      /// of \ref MinCostArborescence algorithm.
+      DualIt(const MinCostArborescence& algorithm, int variable)
+        : _algorithm(&algorithm)
+      {
+        _index = _algorithm->_dual_variables[variable].begin;
+        _last = _algorithm->_dual_variables[variable].end;
+      }
+
+      /// \brief Conversion to \c Node.
+      ///
+      /// Conversion to \c Node.
+      operator Node() const {
+        return _algorithm->_dual_node_list[_index];
+      }
+
+      /// \brief Increment operator.
+      ///
+      /// Increment operator.
+      DualIt& operator++() {
+        ++_index;
+        return *this;
+      }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is invalid.
+      bool operator==(Invalid) const {
+        return _index == _last;
+      }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is valid.
+      bool operator!=(Invalid) const {
+        return _index != _last;
+      }
+
+    private:
+      const MinCostArborescence* _algorithm;
+      int _index, _last;
+    };
+
+    /// @}
 
   };
@@ -770,9 +782,10 @@
   ///
   /// Function type interface for MinCostArborescence algorithm.
-  /// \param digraph The Digraph that the algorithm runs on.
-  /// \param cost The CostMap of the arcs.
-  /// \param source The source of the arborescence.
-  /// \retval arborescence The bool ArcMap which stores the arborescence.
-  /// \return The cost of the arborescence.
+  /// \param digraph The digraph the algorithm runs on.
+  /// \param cost An arc map storing the costs.
+  /// \param source The source node of the arborescence.
+  /// \retval arborescence An arc map with \c bool (or convertible) value
+  /// type that stores the arborescence.
+  /// \return The total cost of the arborescence.
   ///
   /// \sa MinCostArborescence
@@ -783,9 +796,9 @@
                                               ArborescenceMap& arborescence) {
     typename MinCostArborescence<Digraph, CostMap>
-      ::template DefArborescenceMap<ArborescenceMap>
+      ::template SetArborescenceMap<ArborescenceMap>
       ::Create mca(digraph, cost);
     mca.arborescenceMap(arborescence);
     mca.run(source);
-    return mca.arborescenceValue();
+    return mca.arborescenceCost();
   }
 
Index: lemon/suurballe.h
===================================================================
--- lemon/suurballe.h	(revision 670)
+++ lemon/suurballe.h	(revision 631)
@@ -26,5 +26,4 @@
 
 #include <vector>
-#include <limits>
 #include <lemon/bin_heap.h>
 #include <lemon/path.h>
@@ -44,24 +43,20 @@
   /// from a given source node to a given target node in a digraph.
   ///
-  /// Note that this problem is a special case of the \ref min_cost_flow
-  /// "minimum cost flow problem". This implementation is actually an
-  /// efficient specialized version of the \ref CapacityScaling
-  /// "Successive Shortest Path" algorithm directly for this problem.
-  /// Therefore this class provides query functions for flow values and
-  /// node potentials (the dual solution) just like the minimum cost flow
-  /// algorithms.
+  /// In fact, this implementation is the specialization of the
+  /// \ref CapacityScaling "successive shortest path" algorithm.
   ///
   /// \tparam GR The digraph type the algorithm runs on.
-  /// \tparam LEN The type of the length map.
-  /// The default value is <tt>GR::ArcMap<int></tt>.
+  /// The default value is \c ListDigraph.
+  /// \tparam LEN The type of the length (cost) map.
+  /// The default value is <tt>Digraph::ArcMap<int></tt>.
   ///
   /// \warning Length values should be \e non-negative \e integers.
   ///
   /// \note For finding node-disjoint paths this algorithm can be used
-  /// along with the \ref SplitNodes adaptor.
+  /// with \ref SplitNodes.
 #ifdef DOXYGEN
   template <typename GR, typename LEN>
 #else
-  template < typename GR,
+  template < typename GR = ListDigraph,
              typename LEN = typename GR::template ArcMap<int> >
 #endif
@@ -81,26 +76,21 @@
     /// The type of the lengths.
     typedef typename LengthMap::Value Length;
-#ifdef DOXYGEN
-    /// The type of the flow map.
-    typedef GR::ArcMap<int> FlowMap;
-    /// The type of the potential map.
-    typedef GR::NodeMap<Length> PotentialMap;
-#else
     /// The type of the flow map.
     typedef typename Digraph::template ArcMap<int> FlowMap;
     /// The type of the potential map.
     typedef typename Digraph::template NodeMap<Length> PotentialMap;
-#endif
-
     /// The type of the path structures.
-    typedef SimplePath<GR> Path;
+    typedef SimplePath<Digraph> Path;
 
   private:
 
-    // ResidualDijkstra is a special implementation of the
-    // Dijkstra algorithm for finding shortest paths in the
-    // residual network with respect to the reduced arc lengths
-    // and modifying the node potentials according to the
-    // distance of the nodes.
+    /// \brief Special implementation of the Dijkstra algorithm
+    /// for finding shortest paths in the residual network.
+    ///
+    /// \ref ResidualDijkstra is a special implementation of the
+    /// \ref Dijkstra algorithm for finding shortest paths in the
+    /// residual network of the digraph with respect to the reduced arc
+    /// lengths and modifying the node potentials according to the
+    /// distance of the nodes.
     class ResidualDijkstra
     {
@@ -131,5 +121,5 @@
 
       /// Constructor.
-      ResidualDijkstra( const Digraph &graph,
+      ResidualDijkstra( const Digraph &digraph,
                         const FlowMap &flow,
                         const LengthMap &length,
@@ -137,6 +127,6 @@
                         PredMap &pred,
                         Node s, Node t ) :
-        _graph(graph), _flow(flow), _length(length), _potential(potential),
-        _dist(graph), _pred(pred), _s(s), _t(t) {}
+        _graph(digraph), _flow(flow), _length(length), _potential(potential),
+        _dist(digraph), _pred(pred), _s(s), _t(t) {}
 
       /// \brief Run the algorithm. It returns \c true if a path is found
@@ -247,14 +237,14 @@
     /// Constructor.
     ///
-    /// \param graph The digraph the algorithm runs on.
+    /// \param digraph The digraph the algorithm runs on.
     /// \param length The length (cost) values of the arcs.
-    Suurballe( const Digraph &graph,
-               const LengthMap &length ) :
-      _graph(graph), _length(length), _flow(0), _local_flow(false),
-      _potential(0), _local_potential(false), _pred(graph)
-    {
-      LEMON_ASSERT(std::numeric_limits<Length>::is_integer,
-        "The length type of Suurballe must be integer");
-    }
+    /// \param s The source node.
+    /// \param t The target node.
+    Suurballe( const Digraph &digraph,
+               const LengthMap &length,
+               Node s, Node t ) :
+      _graph(digraph), _length(length), _flow(0), _local_flow(false),
+      _potential(0), _local_potential(false), _source(s), _target(t),
+      _pred(digraph) {}
 
     /// Destructor.
@@ -268,10 +258,7 @@
     ///
     /// This function sets the flow map.
-    /// If it is not used before calling \ref run() or \ref init(),
-    /// an instance will be allocated automatically. The destructor
-    /// deallocates this automatically allocated map, of course.
-    ///
-    /// The found flow contains only 0 and 1 values, since it is the
-    /// union of the found arc-disjoint paths.
+    ///
+    /// The found flow contains only 0 and 1 values. It is the union of
+    /// the found arc-disjoint paths.
     ///
     /// \return <tt>(*this)</tt>
@@ -288,10 +275,7 @@
     ///
     /// This function sets the potential map.
-    /// If it is not used before calling \ref run() or \ref init(),
-    /// an instance will be allocated automatically. The destructor
-    /// deallocates this automatically allocated map, of course.
-    ///
-    /// The node potentials provide the dual solution of the underlying
-    /// \ref min_cost_flow "minimum cost flow problem".
+    ///
+    /// The potentials provide the dual solution of the underlying
+    /// minimum cost flow problem.
     ///
     /// \return <tt>(*this)</tt>
@@ -318,6 +302,4 @@
     /// This function runs the algorithm.
     ///
-    /// \param s The source node.
-    /// \param t The target node.
     /// \param k The number of paths to be found.
     ///
@@ -326,14 +308,14 @@
     /// arc-disjoint paths found.
     ///
-    /// \note Apart from the return value, <tt>s.run(s, t, k)</tt> is
-    /// just a shortcut of the following code.
+    /// \note Apart from the return value, <tt>s.run(k)</tt> is just a
+    /// shortcut of the following code.
     /// \code
-    ///   s.init(s);
-    ///   s.findFlow(t, k);
+    ///   s.init();
+    ///   s.findFlow(k);
     ///   s.findPaths();
     /// \endcode
-    int run(const Node& s, const Node& t, int k = 2) {
-      init(s);
-      findFlow(t, k);
+    int run(int k = 2) {
+      init();
+      findFlow(k);
       findPaths();
       return _path_num;
@@ -343,9 +325,5 @@
     ///
     /// This function initializes the algorithm.
-    ///
-    /// \param s The source node.
-    void init(const Node& s) {
-      _source = s;
-
+    void init() {
       // Initialize maps
       if (!_flow) {
@@ -359,26 +337,23 @@
       for (ArcIt e(_graph); e != INVALID; ++e) (*_flow)[e] = 0;
       for (NodeIt n(_graph); n != INVALID; ++n) (*_potential)[n] = 0;
-    }
-
-    /// \brief Execute the algorithm to find an optimal flow.
+
+      _dijkstra = new ResidualDijkstra( _graph, *_flow, _length,
+                                        *_potential, _pred,
+                                        _source, _target );
+    }
+
+    /// \brief Execute the successive shortest path algorithm to find
+    /// an optimal flow.
     ///
     /// This function executes the successive shortest path algorithm to
-    /// find a minimum cost flow, which is the union of \c k (or less)
+    /// find a minimum cost flow, which is the union of \c k or less
     /// arc-disjoint paths.
     ///
-    /// \param t The target node.
-    /// \param k The number of paths to be found.
-    ///
     /// \return \c k if there are at least \c k arc-disjoint paths from
-    /// the source node to the given node \c t in the digraph.
-    /// Otherwise it returns the number of arc-disjoint paths found.
+    /// \c s to \c t in the digraph. Otherwise it returns the number of
+    /// arc-disjoint paths found.
     ///
     /// \pre \ref init() must be called before using this function.
-    int findFlow(const Node& t, int k = 2) {
-      _target = t;
-      _dijkstra =
-        new ResidualDijkstra( _graph, *_flow, _length, *_potential, _pred,
-                              _source, _target );
-
+    int findFlow(int k = 2) {
       // Find shortest paths
       _path_num = 0;
@@ -406,10 +381,11 @@
     /// \brief Compute the paths from the flow.
     ///
-    /// This function computes the paths from the found minimum cost flow,
-    /// which is the union of some arc-disjoint paths.
+    /// This function computes the paths from the flow.
     ///
     /// \pre \ref init() and \ref findFlow() must be called before using
     /// this function.
     void findPaths() {
+      // Create the residual flow map (the union of the paths not found
+      // so far)
       FlowMap res_flow(_graph);
       for(ArcIt a(_graph); a != INVALID; ++a) res_flow[a] = (*_flow)[a];
@@ -438,9 +414,55 @@
     /// @{
 
-    /// \brief Return the total length of the found paths.
-    ///
-    /// This function returns the total length of the found paths, i.e.
-    /// the total cost of the found flow.
-    /// The complexity of the function is O(e).
+    /// \brief Return a const reference to the arc map storing the
+    /// found flow.
+    ///
+    /// This function returns a const reference to the arc map storing
+    /// the flow that is the union of the found arc-disjoint paths.
+    ///
+    /// \pre \ref run() or \ref findFlow() must be called before using
+    /// this function.
+    const FlowMap& flowMap() const {
+      return *_flow;
+    }
+
+    /// \brief Return a const reference to the node map storing the
+    /// found potentials (the dual solution).
+    ///
+    /// This function returns a const reference to the node map storing
+    /// the found potentials that provide the dual solution of the
+    /// underlying minimum cost flow problem.
+    ///
+    /// \pre \ref run() or \ref findFlow() must be called before using
+    /// this function.
+    const PotentialMap& potentialMap() const {
+      return *_potential;
+    }
+
+    /// \brief Return the flow on the given arc.
+    ///
+    /// This function returns the flow on the given arc.
+    /// It is \c 1 if the arc is involved in one of the found paths,
+    /// otherwise it is \c 0.
+    ///
+    /// \pre \ref run() or \ref findFlow() must be called before using
+    /// this function.
+    int flow(const Arc& arc) const {
+      return (*_flow)[arc];
+    }
+
+    /// \brief Return the potential of the given node.
+    ///
+    /// This function returns the potential of the given node.
+    ///
+    /// \pre \ref run() or \ref findFlow() must be called before using
+    /// this function.
+    Length potential(const Node& node) const {
+      return (*_potential)[node];
+    }
+
+    /// \brief Return the total length (cost) of the found paths (flow).
+    ///
+    /// This function returns the total length (cost) of the found paths
+    /// (flow). The complexity of the function is O(e).
     ///
     /// \pre \ref run() or \ref findFlow() must be called before using
@@ -453,53 +475,4 @@
     }
 
-    /// \brief Return the flow value on the given arc.
-    ///
-    /// This function returns the flow value on the given arc.
-    /// It is \c 1 if the arc is involved in one of the found arc-disjoint
-    /// paths, otherwise it is \c 0.
-    ///
-    /// \pre \ref run() or \ref findFlow() must be called before using
-    /// this function.
-    int flow(const Arc& arc) const {
-      return (*_flow)[arc];
-    }
-
-    /// \brief Return a const reference to an arc map storing the
-    /// found flow.
-    ///
-    /// This function returns a const reference to an arc map storing
-    /// the flow that is the union of the found arc-disjoint paths.
-    ///
-    /// \pre \ref run() or \ref findFlow() must be called before using
-    /// this function.
-    const FlowMap& flowMap() const {
-      return *_flow;
-    }
-
-    /// \brief Return the potential of the given node.
-    ///
-    /// This function returns the potential of the given node.
-    /// The node potentials provide the dual solution of the
-    /// underlying \ref min_cost_flow "minimum cost flow problem".
-    ///
-    /// \pre \ref run() or \ref findFlow() must be called before using
-    /// this function.
-    Length potential(const Node& node) const {
-      return (*_potential)[node];
-    }
-
-    /// \brief Return a const reference to a node map storing the
-    /// found potentials (the dual solution).
-    ///
-    /// This function returns a const reference to a node map storing
-    /// the found potentials that provide the dual solution of the
-    /// underlying \ref min_cost_flow "minimum cost flow problem".
-    ///
-    /// \pre \ref run() or \ref findFlow() must be called before using
-    /// this function.
-    const PotentialMap& potentialMap() const {
-      return *_potential;
-    }
-
     /// \brief Return the number of the found paths.
     ///
@@ -516,5 +489,5 @@
     /// This function returns a const reference to the specified path.
     ///
-    /// \param i The function returns the <tt>i</tt>-th path.
+    /// \param i The function returns the \c i-th path.
     /// \c i must be between \c 0 and <tt>%pathNum()-1</tt>.
     ///
