Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 2581)
+++ lemon/capacity_scaling.h	(revision 2588)
@@ -26,6 +26,4 @@
 
 #include <vector>
-
-#include <lemon/graph_adaptor.h>
 #include <lemon/bin_heap.h>
 
@@ -91,7 +89,4 @@
     class ResidualDijkstra
     {
-      typedef typename Graph::template NodeMap<Cost> CostNodeMap;
-      typedef typename Graph::template NodeMap<Edge> PredMap;
-
       typedef typename Graph::template NodeMap<int> HeapCrossRef;
       typedef BinHeap<Cost, HeapCrossRef> Heap;
@@ -110,5 +105,5 @@
 
       // The distance map
-      CostNodeMap _dist;
+      PotentialMap _dist;
       // The pred edge map
       PredMap &_pred;
@@ -132,5 +127,5 @@
 
       /// Runs the algorithm from the given source node.
-      Node run(Node s, Capacity delta) {
+      Node run(Node s, Capacity delta = 1) {
         HeapCrossRef heap_cross_ref(_graph, Heap::PRE_HEAP);
         Heap heap(heap_cross_ref);
@@ -455,7 +450,7 @@
     }
 
-    /// \brief Returns the flow on the edge.
-    ///
-    /// Returns the flow on the edge.
+    /// \brief Returns the flow on the given edge.
+    ///
+    /// Returns the flow on the given edge.
     ///
     /// \pre \ref run() must be called before using this function.
@@ -464,7 +459,7 @@
     }
 
-    /// \brief Returns the potential of the node.
-    ///
-    /// Returns the potential of the node.
+    /// \brief Returns the potential of the given node.
+    ///
+    /// Returns the potential of the given node.
     ///
     /// \pre \ref run() must be called before using this function.
@@ -518,5 +513,9 @@
           if (-_supply[n] > max_dem) max_dem = -_supply[n];
         }
-        if (max_dem < max_sup) max_sup = max_dem;
+        Capacity max_cap = 0;
+        for (EdgeIt e(_graph); e != INVALID; ++e) {
+          if (_capacity[e] > max_cap) max_cap = _capacity[e];
+        }
+        max_sup = std::min(std::min(max_sup, max_dem), max_cap);
         _phase_num = 0;
         for (_delta = 1; 2 * _delta <= max_sup; _delta *= 2)
@@ -596,5 +595,5 @@
 
           // Augmenting along a shortest path from s to t.
-          Capacity d = _excess[s] < -_excess[t] ? _excess[s] : -_excess[t];
+          Capacity d = std::min(_excess[s], -_excess[t]);
           Node u = t;
           Edge e;
@@ -658,21 +657,22 @@
         // Running Dijkstra
         s = _excess_nodes[next_node];
-        if ((t = _dijkstra->run(s, 1)) == INVALID)
-          return false;
+        if ((t = _dijkstra->run(s)) == INVALID) break;
 
         // Augmenting along a shortest path from s to t
-        Capacity d = _excess[s] < -_excess[t] ? _excess[s] : -_excess[t];
+        Capacity d = std::min(_excess[s], -_excess[t]);
         Node u = t;
         Edge e;
-        while ((e = _pred[u]) != INVALID) {
-          Capacity rc;
-          if (u == _graph.target(e)) {
-            rc = _res_cap[e];
-            u = _graph.source(e);
-          } else {
-            rc = (*_flow)[e];
-            u = _graph.target(e);
-          }
-          if (rc < d) d = rc;
+        if (d > 1) {
+          while ((e = _pred[u]) != INVALID) {
+            Capacity rc;
+            if (u == _graph.target(e)) {
+              rc = _res_cap[e];
+              u = _graph.source(e);
+            } else {
+              rc = (*_flow)[e];
+              u = _graph.target(e);
+            }
+            if (rc < d) d = rc;
+          }
         }
         u = t;
Index: lemon/cost_scaling.h
===================================================================
--- lemon/cost_scaling.h	(revision 2581)
+++ lemon/cost_scaling.h	(revision 2588)
@@ -400,7 +400,7 @@
     }
 
-    /// \brief Returns the flow on the edge.
-    ///
-    /// Returns the flow on the edge.
+    /// \brief Returns the flow on the given edge.
+    ///
+    /// Returns the flow on the given edge.
     ///
     /// \pre \ref run() must be called before using this function.
@@ -409,7 +409,7 @@
     }
 
-    /// \brief Returns the potential of the node.
-    ///
-    /// Returns the potential of the node.
+    /// \brief Returns the potential of the given node.
+    ///
+    /// Returns the potential of the given node.
     ///
     /// \pre \ref run() must be called before using this function.
Index: lemon/cycle_canceling.h
===================================================================
--- lemon/cycle_canceling.h	(revision 2581)
+++ lemon/cycle_canceling.h	(revision 2588)
@@ -356,7 +356,7 @@
     }
 
-    /// \brief Returns the flow on the edge.
-    ///
-    /// Returns the flow on the edge.
+    /// \brief Returns the flow on the given edge.
+    ///
+    /// Returns the flow on the given edge.
     ///
     /// \pre \ref run() must be called before using this function.
@@ -365,7 +365,7 @@
     }
 
-    /// \brief Returns the potential of the node.
-    ///
-    /// Returns the potential of the node.
+    /// \brief Returns the potential of the given node.
+    ///
+    /// Returns the potential of the given node.
     ///
     /// \pre \ref run() must be called before using this function.
Index: lemon/min_cost_flow.h
===================================================================
--- lemon/min_cost_flow.h	(revision 2581)
+++ lemon/min_cost_flow.h	(revision 2588)
@@ -45,8 +45,8 @@
   /// There are four implementations for the minimum cost flow problem,
   /// which can be used exactly the same way.
-  /// - \ref CapacityScaling The capacity scaling algorithm.
-  /// - \ref CostScaling The cost scaling algorithm.
-  /// - \ref CycleCanceling A cycle-canceling algorithm.
-  /// - \ref NetworkSimplex The network simplex algorithm.
+  /// - \ref CapacityScaling
+  /// - \ref CostScaling
+  /// - \ref CycleCanceling
+  /// - \ref NetworkSimplex
   ///
   /// \tparam Graph The directed graph type the algorithm runs on.
Index: lemon/min_mean_cycle.h
===================================================================
--- lemon/min_mean_cycle.h	(revision 2583)
+++ lemon/min_mean_cycle.h	(revision 2588)
@@ -135,5 +135,6 @@
 
     /// \name Execution control
-    /// The simplest way to execute the algorithm is to call run().
+    /// The simplest way to execute the algorithm is to call the run()
+    /// function.
     /// \n
     /// If you only need the minimum mean value, you may call init()
@@ -238,5 +239,5 @@
     /// The result of the algorithm can be obtained using these
     /// functions.
-    /// \n run() must be called before using them.
+    /// \n The algorithm should be executed before using them.
 
     /// @{
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 2581)
+++ lemon/network_simplex.h	(revision 2588)
@@ -777,7 +777,7 @@
     }
 
-    /// \brief Returns the flow on the edge.
-    ///
-    /// Returns the flow on the edge.
+    /// \brief Returns the flow on the given edge.
+    ///
+    /// Returns the flow on the given edge.
     ///
     /// \pre \ref run() must be called before using this function.
@@ -786,7 +786,7 @@
     }
 
-    /// \brief Returns the potential of the node.
-    ///
-    /// Returns the potential of the node.
+    /// \brief Returns the potential of the given node.
+    ///
+    /// Returns the potential of the given node.
     ///
     /// \pre \ref run() must be called before using this function.
