Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 658)
+++ test/CMakeLists.txt	(revision 674)
@@ -3,8 +3,4 @@
   ${PROJECT_BINARY_DIR}
 )
-
-IF(HAVE_GLPK)
-  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
-ENDIF(HAVE_GLPK)
 
 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
@@ -41,12 +37,20 @@
   unionfind_test)
 
-IF(HAVE_LP)
+IF(LEMON_HAVE_LP)
   ADD_EXECUTABLE(lp_test lp_test.cc)
-  IF(HAVE_GLPK)
-    TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
-  ENDIF(HAVE_GLPK)
+  SET(LP_TEST_LIBS lemon)
+  IF(LEMON_HAVE_GLPK)
+    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
+  ENDIF(LEMON_HAVE_GLPK)
+  IF(LEMON_HAVE_CPLEX)
+    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
+  ENDIF(LEMON_HAVE_CPLEX)
+  IF(LEMON_HAVE_CLP)
+    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
+  ENDIF(LEMON_HAVE_CLP)
+  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
   ADD_TEST(lp_test lp_test)
 
-  IF(WIN32 AND HAVE_GLPK)
+  IF(WIN32 AND LEMON_HAVE_GLPK)
     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
@@ -56,15 +60,30 @@
       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND HAVE_GLPK)
-ENDIF(HAVE_LP)
+  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
+  IF(WIN32 AND LEMON_HAVE_CPLEX)
+    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
+    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
+      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
+    )
+  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
+ENDIF(LEMON_HAVE_LP)
 
-IF(HAVE_MIP)
+IF(LEMON_HAVE_MIP)
   ADD_EXECUTABLE(mip_test mip_test.cc)
-  IF(HAVE_GLPK)
-    TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
-  ENDIF(HAVE_GLPK)
+  SET(MIP_TEST_LIBS lemon)
+  IF(LEMON_HAVE_GLPK)
+    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
+  ENDIF(LEMON_HAVE_GLPK)
+  IF(LEMON_HAVE_CPLEX)
+    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
+  ENDIF(LEMON_HAVE_CPLEX)
+  IF(LEMON_HAVE_CBC)
+    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
+  ENDIF(LEMON_HAVE_CBC)
+  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
   ADD_TEST(mip_test mip_test)
 
-  IF(WIN32 AND HAVE_GLPK)
+  IF(WIN32 AND LEMON_HAVE_GLPK)
     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
@@ -74,6 +93,13 @@
       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     )
-  ENDIF(WIN32 AND HAVE_GLPK)
-ENDIF(HAVE_MIP)
+  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
+  IF(WIN32 AND LEMON_HAVE_CPLEX)
+    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
+    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
+    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
+      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
+    )
+  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
+ENDIF(LEMON_HAVE_MIP)
 
 FOREACH(TEST_NAME ${TESTS})
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 622)
+++ test/lp_test.cc	(revision 674)
@@ -26,17 +26,17 @@
 #endif
 
-#ifdef HAVE_GLPK
+#ifdef LEMON_HAVE_GLPK
 #include <lemon/glpk.h>
 #endif
 
-#ifdef HAVE_CPLEX
+#ifdef LEMON_HAVE_CPLEX
 #include <lemon/cplex.h>
 #endif
 
-#ifdef HAVE_SOPLEX
+#ifdef LEMON_HAVE_SOPLEX
 #include <lemon/soplex.h>
 #endif
 
-#ifdef HAVE_CLP
+#ifdef LEMON_HAVE_CLP
 #include <lemon/clp.h>
 #endif
@@ -380,5 +380,5 @@
   lpTest(lp_skel);
 
-#ifdef HAVE_GLPK
+#ifdef LEMON_HAVE_GLPK
   {
     GlpkLp lp_glpk1,lp_glpk2;
@@ -389,5 +389,5 @@
 #endif
 
-#ifdef HAVE_CPLEX
+#ifdef LEMON_HAVE_CPLEX
   try {
     CplexLp lp_cplex1,lp_cplex2;
@@ -400,5 +400,5 @@
 #endif
 
-#ifdef HAVE_SOPLEX
+#ifdef LEMON_HAVE_SOPLEX
   {
     SoplexLp lp_soplex1,lp_soplex2;
@@ -409,5 +409,5 @@
 #endif
 
-#ifdef HAVE_CLP
+#ifdef LEMON_HAVE_CLP
   {
     ClpLp lp_clp1,lp_clp2;
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 622)
+++ test/mip_test.cc	(revision 674)
@@ -23,13 +23,13 @@
 #endif
 
-#ifdef HAVE_CPLEX
+#ifdef LEMON_HAVE_CPLEX
 #include <lemon/cplex.h>
 #endif
 
-#ifdef HAVE_GLPK
+#ifdef LEMON_HAVE_GLPK
 #include <lemon/glpk.h>
 #endif
 
-#ifdef HAVE_CBC
+#ifdef LEMON_HAVE_CBC
 #include <lemon/cbc.h>
 #endif
@@ -130,5 +130,5 @@
 {
 
-#ifdef HAVE_GLPK
+#ifdef LEMON_HAVE_GLPK
   {
     GlpkMip mip1;
@@ -138,5 +138,5 @@
 #endif
 
-#ifdef HAVE_CPLEX
+#ifdef LEMON_HAVE_CPLEX
   try {
     CplexMip mip2;
@@ -148,5 +148,5 @@
 #endif
 
-#ifdef HAVE_CBC
+#ifdef LEMON_HAVE_CBC
   {
     CbcMip mip1;
Index: test/suurballe_test.cc
===================================================================
--- test/suurballe_test.cc	(revision 463)
+++ test/suurballe_test.cc	(revision 670)
@@ -23,4 +23,5 @@
 #include <lemon/path.h>
 #include <lemon/suurballe.h>
+#include <lemon/concepts/digraph.h>
 
 #include "test_tools.h"
@@ -30,44 +31,94 @@
 char test_lgf[] =
   "@nodes\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"
+  "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"
   "@arcs\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"
+  "      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"
   "@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
@@ -119,5 +170,4 @@
                 typename Digraph::Node s, typename Digraph::Node t)
 {
-  // Check the "Complementary Slackness" optimality condition
   TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   Node n = s;
@@ -137,18 +187,18 @@
   ListDigraph digraph;
   ListDigraph::ArcMap<int> length(digraph);
-  Node source, target;
+  Node s, t;
 
   std::istringstream input(test_lgf);
   DigraphReader<ListDigraph>(digraph, input).
-    arcMap("cost", length).
-    node("source", source).
-    node("target", target).
+    arcMap("length", length).
+    node("source", s).
+    node("target", t).
     run();
 
   // Find 2 paths
   {
-    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
-    check(suurballe.run(2) == 2, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), source, target, 2),
+    Suurballe<ListDigraph> suurballe(digraph, length);
+    check(suurballe.run(s, t) == 2, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), s, t, 2),
           "The flow is not feasible");
     check(suurballe.totalLength() == 510, "The flow is not optimal");
@@ -157,13 +207,12 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), source, target),
-            "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
   }
 
   // Find 3 paths
   {
-    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
-    check(suurballe.run(3) == 3, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
+    Suurballe<ListDigraph> suurballe(digraph, length);
+    check(suurballe.run(s, t, 3) == 3, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), s, t, 3),
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
@@ -172,13 +221,12 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), source, target),
-            "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
   }
 
   // Find 5 paths (only 3 can be found)
   {
-    Suurballe<ListDigraph> suurballe(digraph, length, source, target);
-    check(suurballe.run(5) == 3, "Wrong number of paths");
-    check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
+    Suurballe<ListDigraph> suurballe(digraph, length);
+    check(suurballe.run(s, t, 5) == 3, "Wrong number of paths");
+    check(checkFlow(digraph, suurballe.flowMap(), s, t, 3),
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
@@ -187,6 +235,5 @@
           "Wrong potentials");
     for (int i = 0; i < suurballe.pathNum(); ++i)
-      check(checkPath(digraph, suurballe.path(i), source, target),
-            "Wrong path");
+      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
   }
 
