Index: test/min_cost_arborescence_test.cc
===================================================================
--- test/min_cost_arborescence_test.cc	(revision 512)
+++ test/min_cost_arborescence_test.cc	(revision 617)
@@ -25,4 +25,5 @@
 #include <lemon/min_cost_arborescence.h>
 #include <lemon/lgf_reader.h>
+#include <lemon/concepts/digraph.h>
 
 #include "test_tools.h"
@@ -71,4 +72,63 @@
   "source 0\n";
 
+
+void checkMinCostArborescenceCompile()
+{
+  typedef double VType;
+  typedef concepts::Digraph Digraph;
+  typedef concepts::ReadMap<Digraph::Arc, VType> CostMap;
+  typedef Digraph::Node Node;
+  typedef Digraph::Arc Arc;
+  typedef concepts::WriteMap<Digraph::Arc, bool> ArbMap;
+  typedef concepts::ReadWriteMap<Digraph::Node, Digraph::Arc> PredMap;
+
+  typedef MinCostArborescence<Digraph, CostMap>::
+            SetArborescenceMap<ArbMap>::
+            SetPredMap<PredMap>::Create MinCostArbType;
+
+  Digraph g;
+  Node s, n;
+  Arc e;
+  VType c;
+  bool b;
+  int i;
+  CostMap cost;
+  ArbMap arb;
+  PredMap pred;
+
+  MinCostArbType mcarb_test(g, cost);
+  const MinCostArbType& const_mcarb_test = mcarb_test;
+
+  mcarb_test
+    .arborescenceMap(arb)
+    .predMap(pred)
+    .run(s);
+
+  mcarb_test.init();
+  mcarb_test.addSource(s);
+  mcarb_test.start();
+  n = mcarb_test.processNextNode();
+  b = const_mcarb_test.emptyQueue();
+  i = const_mcarb_test.queueSize();
+  
+  c = const_mcarb_test.arborescenceCost();
+  b = const_mcarb_test.arborescence(e);
+  e = const_mcarb_test.pred(n);
+  const MinCostArbType::ArborescenceMap &am =
+    const_mcarb_test.arborescenceMap();
+  const MinCostArbType::PredMap &pm =
+    const_mcarb_test.predMap();
+  b = const_mcarb_test.reached(n);
+  b = const_mcarb_test.processed(n);
+  
+  i = const_mcarb_test.dualNum();
+  c = const_mcarb_test.dualValue();
+  i = const_mcarb_test.dualSize(i);
+  c = const_mcarb_test.dualValue(i);
+  
+  ignore_unused_variable_warning(am);
+  ignore_unused_variable_warning(pm);
+}
+
 int main() {
   typedef SmartDigraph Digraph;
@@ -111,17 +171,17 @@
       }
       if (mca.arborescence(it)) {
-        check(sum == cost[it], "INVALID DUAL");
+        check(sum == cost[it], "Invalid dual solution");
       }
-      check(sum <= cost[it], "INVALID DUAL");
+      check(sum <= cost[it], "Invalid dual solution");
     }
   }
 
 
-  check(mca.dualValue() == mca.arborescenceValue(), "INVALID DUAL");
-
-  check(mca.reached(source), "INVALID ARBORESCENCE");
+  check(mca.dualValue() == mca.arborescenceCost(), "Invalid dual solution");
+
+  check(mca.reached(source), "Invalid arborescence");
   for (ArcIt a(digraph); a != INVALID; ++a) {
     check(!mca.reached(digraph.source(a)) ||
-          mca.reached(digraph.target(a)), "INVALID ARBORESCENCE");
+          mca.reached(digraph.target(a)), "Invalid arborescence");
   }
 
@@ -131,15 +191,15 @@
     for (InArcIt a(digraph, n); a != INVALID; ++a) {
       if (mca.arborescence(a)) {
-        check(mca.pred(n) == a, "INVALID ARBORESCENCE");
+        check(mca.pred(n) == a, "Invalid arborescence");
         ++cnt;
       }
     }
-    check((n == source ? cnt == 0 : cnt == 1), "INVALID ARBORESCENCE");
+    check((n == source ? cnt == 0 : cnt == 1), "Invalid arborescence");
   }
 
   Digraph::ArcMap<bool> arborescence(digraph);
-  check(mca.arborescenceValue() ==
+  check(mca.arborescenceCost() ==
         minCostArborescence(digraph, cost, source, arborescence),
-        "WRONG FUNCTION");
+        "Wrong result of the function interface");
 
   return 0;
Index: test/suurballe_test.cc
===================================================================
--- test/suurballe_test.cc	(revision 615)
+++ test/suurballe_test.cc	(revision 440)
@@ -23,5 +23,4 @@
 #include <lemon/path.h>
 #include <lemon/suurballe.h>
-#include <lemon/concepts/digraph.h>
 
 #include "test_tools.h"
@@ -31,94 +30,44 @@
 char test_lgf[] =
   "@nodes\n"
-  "label\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "8\n"
-  "9\n"
-  "10\n"
-  "11\n"
-  "12\n"
+  "label supply1 supply2 supply3\n"
+  "1     0        20      27\n"
+  "2     0       -4        0\n"
+  "3     0        0        0\n"
+  "4     0        0        0\n"
+  "5     0        9        0\n"
+  "6     0       -6        0\n"
+  "7     0        0        0\n"
+  "8     0        0        0\n"
+  "9     0        3        0\n"
+  "10    0       -2        0\n"
+  "11    0        0        0\n"
+  "12    0       -20     -27\n"
   "@arcs\n"
-  "      length\n"
-  " 1  2  70\n"
-  " 1  3 150\n"
-  " 1  4  80\n"
-  " 2  8  80\n"
-  " 3  5 140\n"
-  " 4  6  60\n"
-  " 4  7  80\n"
-  " 4  8 110\n"
-  " 5  7  60\n"
-  " 5 11 120\n"
-  " 6  3   0\n"
-  " 6  9 140\n"
-  " 6 10  90\n"
-  " 7  1  30\n"
-  " 8 12  60\n"
-  " 9 12  50\n"
-  "10 12  70\n"
-  "10  2 100\n"
-  "10  7  60\n"
-  "11 10  20\n"
-  "12 11  30\n"
+  "      cost capacity lower1 lower2\n"
+  " 1  2  70  11       0      8\n"
+  " 1  3 150   3       0      1\n"
+  " 1  4  80  15       0      2\n"
+  " 2  8  80  12       0      0\n"
+  " 3  5 140   5       0      3\n"
+  " 4  6  60  10       0      1\n"
+  " 4  7  80   2       0      0\n"
+  " 4  8 110   3       0      0\n"
+  " 5  7  60  14       0      0\n"
+  " 5 11 120  12       0      0\n"
+  " 6  3   0   3       0      0\n"
+  " 6  9 140   4       0      0\n"
+  " 6 10  90   8       0      0\n"
+  " 7  1  30   5       0      0\n"
+  " 8 12  60  16       0      4\n"
+  " 9 12  50   6       0      0\n"
+  "10 12  70  13       0      5\n"
+  "10  2 100   7       0      0\n"
+  "10  7  60  10       0      0\n"
+  "11 10  20  14       0      6\n"
+  "12 11  30  10       0      0\n"
   "@attributes\n"
   "source  1\n"
   "target 12\n"
   "@end\n";
-
-// Check the interface of Suurballe
-void checkSuurballeCompile()
-{
-  typedef int VType;
-  typedef concepts::Digraph Digraph;
-
-  typedef Digraph::Node Node;
-  typedef Digraph::Arc Arc;
-  typedef concepts::ReadMap<Arc, VType> LengthMap;
-  
-  typedef Suurballe<Digraph, LengthMap> SuurballeType;
-
-  Digraph g;
-  Node n;
-  Arc e;
-  LengthMap len;
-  SuurballeType::FlowMap flow(g);
-  SuurballeType::PotentialMap pi(g);
-
-  SuurballeType suurb_test(g, len);
-  const SuurballeType& const_suurb_test = suurb_test;
-
-  suurb_test
-    .flowMap(flow)
-    .potentialMap(pi);
-
-  int k;
-  k = suurb_test.run(n, n);
-  k = suurb_test.run(n, n, k);
-  suurb_test.init(n);
-  k = suurb_test.findFlow(n);
-  k = suurb_test.findFlow(n, k);
-  suurb_test.findPaths();
-  
-  int f;
-  VType c;
-  c = const_suurb_test.totalLength();
-  f = const_suurb_test.flow(e);
-  const SuurballeType::FlowMap& fm =
-    const_suurb_test.flowMap();
-  c = const_suurb_test.potential(n);
-  const SuurballeType::PotentialMap& pm =
-    const_suurb_test.potentialMap();
-  k = const_suurb_test.pathNum();
-  Path<Digraph> p = const_suurb_test.path(k);
-  
-  ignore_unused_variable_warning(fm);
-  ignore_unused_variable_warning(pm);
-}
 
 // Check the feasibility of the flow
@@ -170,4 +119,5 @@
                 typename Digraph::Node s, typename Digraph::Node t)
 {
+  // Check the "Complementary Slackness" optimality condition
   TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   Node n = s;
@@ -187,18 +137,18 @@
   ListDigraph digraph;
   ListDigraph::ArcMap<int> length(digraph);
-  Node s, t;
+  Node source, target;
 
   std::istringstream input(test_lgf);
   DigraphReader<ListDigraph>(digraph, input).
-    arcMap("length", length).
-    node("source", s).
-    node("target", t).
+    arcMap("cost", length).
+    node("source", source).
+    node("target", target).
     run();
 
   // Find 2 paths
   {
-    Suurballe<ListDigraph> suurballe(digraph, length);
-    check(suurballe.run(s, t) == 2, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), s, t, 2),
+    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
+    check(suurballe.run(2) == 2, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), source, target, 2),
           "The flow is not feasible");
     check(suurballe.totalLength() == 510, "The flow is not optimal");
@@ -207,12 +157,13 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), source, target),
+            "Wrong path");
   }
 
   // Find 3 paths
   {
-    Suurballe<ListDigraph> suurballe(digraph, length);
-    check(suurballe.run(s, t, 3) == 3, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), s, t, 3),
+    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
+    check(suurballe.run(3) == 3, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
@@ -221,12 +172,13 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), source, target),
+            "Wrong path");
   }
 
   // Find 5 paths (only 3 can be found)
   {
-    Suurballe<ListDigraph> suurballe(digraph, length);
-    check(suurballe.run(s, t, 5) == 3, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), s, t, 3),
+    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
+    check(suurballe.run(5) == 3, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
@@ -235,5 +187,6 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), source, target),
+            "Wrong path");
   }
 
