Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 467)
+++ test/CMakeLists.txt	(revision 468)
@@ -4,7 +4,5 @@
 
 SET(TESTS
-  adaptors_test
   bfs_test
-  circulation_test
   counter_test
   dfs_test
@@ -13,4 +11,5 @@
   dim_test
   error_test
+  edge_set_test
   graph_copy_test
   graph_test
@@ -19,13 +18,8 @@
   heap_test
   kruskal_test
-  lp_test
-  mip_test
   maps_test
   max_matching_test
-  radix_sort_test
+  random_test
   path_test
-  preflow_test
-  random_test
-  suurballe_test
   time_measure_test
   unionfind_test)
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 467)
+++ test/Makefile.am	(revision 468)
@@ -1,48 +1,42 @@
 EXTRA_DIST += \
-	test/CMakeLists.txt
+	test/CMakeLists.txt \
+        test/min_cost_flow_test.lgf \
+        test/preflow_graph.lgf
 
 noinst_HEADERS += \
 	test/graph_test.h \
-	test/test_tools.h
+        test/test_tools.h
 
 check_PROGRAMS += \
-	test/adaptors_test \
 	test/bfs_test \
-	test/circulation_test \
-	test/counter_test \
+        test/circulation_test \
+        test/counter_test \
 	test/dfs_test \
 	test/digraph_test \
 	test/dijkstra_test \
-	test/dim_test \
+        test/dim_test \
+	test/edge_set_test \
 	test/error_test \
+	test/graph_adaptor_test \
 	test/graph_copy_test \
 	test/graph_test \
 	test/graph_utils_test \
-	test/hao_orlin_test \
 	test/heap_test \
 	test/kruskal_test \
-	test/maps_test \
+	test/hao_orlin_test \
+        test/maps_test \
 	test/max_matching_test \
-	test/path_test \
-	test/preflow_test \
-	test/radix_sort_test \
-	test/random_test \
-	test/suurballe_test \
-	test/test_tools_fail \
-	test/test_tools_pass \
-	test/time_measure_test \
+        test/random_test \
+        test/path_test \
+        test/preflow_test \
+        test/suurballe_test \
+        test/test_tools_fail \
+        test/test_tools_pass \
+        test/time_measure_test \
 	test/unionfind_test
-
-if HAVE_LP
-check_PROGRAMS += test/lp_test
-endif HAVE_LP
-if HAVE_MIP
-check_PROGRAMS += test/mip_test
-endif HAVE_MIP
 
 TESTS += $(check_PROGRAMS)
 XFAIL_TESTS += test/test_tools_fail$(EXEEXT)
 
-test_adaptors_test_SOURCES = test/adaptors_test.cc
 test_bfs_test_SOURCES = test/bfs_test.cc
 test_circulation_test_SOURCES = test/circulation_test.cc
@@ -52,5 +46,7 @@
 test_dijkstra_test_SOURCES = test/dijkstra_test.cc
 test_dim_test_SOURCES = test/dim_test.cc
+test_edge_set_test_SOURCES = test/edge_set_test.cc
 test_error_test_SOURCES = test/error_test.cc
+test_graph_adaptor_test_SOURCES = test/graph_adaptor_test.cc
 test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
@@ -59,11 +55,8 @@
 test_kruskal_test_SOURCES = test/kruskal_test.cc
 test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
-test_lp_test_SOURCES = test/lp_test.cc
 test_maps_test_SOURCES = test/maps_test.cc
-test_mip_test_SOURCES = test/mip_test.cc
 test_max_matching_test_SOURCES = test/max_matching_test.cc
 test_path_test_SOURCES = test/path_test.cc
 test_preflow_test_SOURCES = test/preflow_test.cc
-test_radix_sort_test_SOURCES = test/radix_sort_test.cc
 test_suurballe_test_SOURCES = test/suurballe_test.cc
 test_random_test_SOURCES = test/random_test.cc
Index: test/adaptors_test.cc
===================================================================
--- test/adaptors_test.cc	(revision 465)
+++ 	(revision )
@@ -1,1486 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2009
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include <iostream>
-#include <limits>
-
-#include <lemon/list_graph.h>
-#include <lemon/grid_graph.h>
-#include <lemon/bfs.h>
-#include <lemon/path.h>
-
-#include <lemon/concepts/digraph.h>
-#include <lemon/concepts/graph.h>
-#include <lemon/concepts/graph_components.h>
-#include <lemon/concepts/maps.h>
-#include <lemon/concept_check.h>
-
-#include <lemon/adaptors.h>
-
-#include "test/test_tools.h"
-#include "test/graph_test.h"
-
-using namespace lemon;
-
-void checkReverseDigraph() {
-  // Check concepts
-  checkConcept<concepts::Digraph, ReverseDigraph<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, ReverseDigraph<ListDigraph> >();
-  checkConcept<concepts::AlterableDigraphComponent<>,
-               ReverseDigraph<ListDigraph> >();
-  checkConcept<concepts::ExtendableDigraphComponent<>,
-               ReverseDigraph<ListDigraph> >();
-  checkConcept<concepts::ErasableDigraphComponent<>,
-               ReverseDigraph<ListDigraph> >();
-  checkConcept<concepts::ClearableDigraphComponent<>,
-               ReverseDigraph<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef ReverseDigraph<Digraph> Adaptor;
-
-  Digraph digraph;
-  Adaptor adaptor(digraph);
-
-  // Add nodes and arcs to the original digraph
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Digraph::Node n3 = digraph.addNode();
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Digraph::Arc a3 = digraph.addArc(n2, n3);
-
-  // Check the adaptor
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 0);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 2);
-
-  checkGraphInArcList(adaptor, n1, 2);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check the orientation of the arcs
-  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
-    check(adaptor.source(a) == digraph.target(a), "Wrong reverse");
-    check(adaptor.target(a) == digraph.source(a), "Wrong reverse");
-  }
-
-  // Add and erase nodes and arcs in the digraph through the adaptor
-  Adaptor::Node n4 = adaptor.addNode();
-
-  Adaptor::Arc a4 = adaptor.addArc(n4, n3);
-  Adaptor::Arc a5 = adaptor.addArc(n2, n4);
-  Adaptor::Arc a6 = adaptor.addArc(n2, n4);
-  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
-  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
-
-  adaptor.erase(a1);
-  adaptor.erase(n3);
-
-  // Check the adaptor
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 4);
-  checkGraphConArcList(adaptor, 4);
-
-  checkGraphOutArcList(adaptor, n1, 2);
-  checkGraphOutArcList(adaptor, n2, 2);
-  checkGraphOutArcList(adaptor, n4, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n4, 3);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check the digraph
-  checkGraphNodeList(digraph, 3);
-  checkGraphArcList(digraph, 4);
-  checkGraphConArcList(digraph, 4);
-
-  checkGraphOutArcList(digraph, n1, 0);
-  checkGraphOutArcList(digraph, n2, 1);
-  checkGraphOutArcList(digraph, n4, 3);
-
-  checkGraphInArcList(digraph, n1, 2);
-  checkGraphInArcList(digraph, n2, 2);
-  checkGraphInArcList(digraph, n4, 0);
-
-  checkNodeIds(digraph);
-  checkArcIds(digraph);
-
-  checkGraphNodeMap(digraph);
-  checkGraphArcMap(digraph);
-
-  // Check the conversion of nodes and arcs
-  Digraph::Node nd = n4;
-  nd = n4;
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = a4;
-  ad = a5;
-  Adaptor::Arc aa = a1;
-  aa = a2;
-}
-
-void checkSubDigraph() {
-  // Check concepts
-  checkConcept<concepts::Digraph, SubDigraph<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, SubDigraph<ListDigraph> >();
-  checkConcept<concepts::AlterableDigraphComponent<>,
-               SubDigraph<ListDigraph> >();
-  checkConcept<concepts::ExtendableDigraphComponent<>,
-               SubDigraph<ListDigraph> >();
-  checkConcept<concepts::ErasableDigraphComponent<>,
-               SubDigraph<ListDigraph> >();
-  checkConcept<concepts::ClearableDigraphComponent<>,
-               SubDigraph<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef Digraph::NodeMap<bool> NodeFilter;
-  typedef Digraph::ArcMap<bool> ArcFilter;
-  typedef SubDigraph<Digraph, NodeFilter, ArcFilter> Adaptor;
-
-  Digraph digraph;
-  NodeFilter node_filter(digraph);
-  ArcFilter arc_filter(digraph);
-  Adaptor adaptor(digraph, node_filter, arc_filter);
-
-  // Add nodes and arcs to the original digraph and the adaptor
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Adaptor::Arc a3 = adaptor.addArc(n2, n3);
-
-  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 2);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide an arc
-  adaptor.status(a2, false);
-  adaptor.disable(a3);
-  if (!adaptor.status(a3)) adaptor.enable(a3);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 2);
-  checkGraphConArcList(adaptor, 2);
-
-  checkGraphOutArcList(adaptor, n1, 1);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide a node
-  adaptor.status(n1, false);
-  adaptor.disable(n3);
-  if (!adaptor.status(n3)) adaptor.enable(n3);
-
-  checkGraphNodeList(adaptor, 2);
-  checkGraphArcList(adaptor, 1);
-  checkGraphConArcList(adaptor, 1);
-
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n2, 0);
-  checkGraphInArcList(adaptor, n3, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide all nodes and arcs
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = false;
-  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = false;
-
-  checkGraphNodeList(adaptor, 0);
-  checkGraphArcList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check the conversion of nodes and arcs
-  Digraph::Node nd = n3;
-  nd = n3;
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = a3;
-  ad = a3;
-  Adaptor::Arc aa = a1;
-  aa = a2;
-}
-
-void checkFilterNodes1() {
-  // Check concepts
-  checkConcept<concepts::Digraph, FilterNodes<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, FilterNodes<ListDigraph> >();
-  checkConcept<concepts::AlterableDigraphComponent<>,
-               FilterNodes<ListDigraph> >();
-  checkConcept<concepts::ExtendableDigraphComponent<>,
-               FilterNodes<ListDigraph> >();
-  checkConcept<concepts::ErasableDigraphComponent<>,
-               FilterNodes<ListDigraph> >();
-  checkConcept<concepts::ClearableDigraphComponent<>,
-               FilterNodes<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef Digraph::NodeMap<bool> NodeFilter;
-  typedef FilterNodes<Digraph, NodeFilter> Adaptor;
-
-  Digraph digraph;
-  NodeFilter node_filter(digraph);
-  Adaptor adaptor(digraph, node_filter);
-
-  // Add nodes and arcs to the original digraph and the adaptor
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Adaptor::Arc a3 = adaptor.addArc(n2, n3);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 2);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide a node
-  adaptor.status(n1, false);
-  adaptor.disable(n3);
-  if (!adaptor.status(n3)) adaptor.enable(n3);
-
-  checkGraphNodeList(adaptor, 2);
-  checkGraphArcList(adaptor, 1);
-  checkGraphConArcList(adaptor, 1);
-
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n2, 0);
-  checkGraphInArcList(adaptor, n3, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide all nodes
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = false;
-
-  checkGraphNodeList(adaptor, 0);
-  checkGraphArcList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check the conversion of nodes and arcs
-  Digraph::Node nd = n3;
-  nd = n3;
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = a3;
-  ad = a3;
-  Adaptor::Arc aa = a1;
-  aa = a2;
-}
-
-void checkFilterArcs() {
-  // Check concepts
-  checkConcept<concepts::Digraph, FilterArcs<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, FilterArcs<ListDigraph> >();
-  checkConcept<concepts::AlterableDigraphComponent<>,
-               FilterArcs<ListDigraph> >();
-  checkConcept<concepts::ExtendableDigraphComponent<>,
-               FilterArcs<ListDigraph> >();
-  checkConcept<concepts::ErasableDigraphComponent<>,
-               FilterArcs<ListDigraph> >();
-  checkConcept<concepts::ClearableDigraphComponent<>,
-               FilterArcs<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef Digraph::ArcMap<bool> ArcFilter;
-  typedef FilterArcs<Digraph, ArcFilter> Adaptor;
-
-  Digraph digraph;
-  ArcFilter arc_filter(digraph);
-  Adaptor adaptor(digraph, arc_filter);
-
-  // Add nodes and arcs to the original digraph and the adaptor
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Adaptor::Arc a3 = adaptor.addArc(n2, n3);
-
-  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 2);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide an arc
-  adaptor.status(a2, false);
-  adaptor.disable(a3);
-  if (!adaptor.status(a3)) adaptor.enable(a3);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 2);
-  checkGraphConArcList(adaptor, 2);
-
-  checkGraphOutArcList(adaptor, n1, 1);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Hide all arcs
-  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = false;
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check the conversion of nodes and arcs
-  Digraph::Node nd = n3;
-  nd = n3;
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = a3;
-  ad = a3;
-  Adaptor::Arc aa = a1;
-  aa = a2;
-}
-
-void checkUndirector() {
-  // Check concepts
-  checkConcept<concepts::Graph, Undirector<concepts::Digraph> >();
-  checkConcept<concepts::Graph, Undirector<ListDigraph> >();
-  checkConcept<concepts::AlterableGraphComponent<>,
-               Undirector<ListDigraph> >();
-  checkConcept<concepts::ExtendableGraphComponent<>,
-               Undirector<ListDigraph> >();
-  checkConcept<concepts::ErasableGraphComponent<>,
-               Undirector<ListDigraph> >();
-  checkConcept<concepts::ClearableGraphComponent<>,
-               Undirector<ListDigraph> >();
-
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef Undirector<Digraph> Adaptor;
-
-  Digraph digraph;
-  Adaptor adaptor(digraph);
-
-  // Add nodes and arcs/edges to the original digraph and the adaptor
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Adaptor::Edge e3 = adaptor.addEdge(n2, n3);
-
-  // Check the original digraph
-  checkGraphNodeList(digraph, 3);
-  checkGraphArcList(digraph, 3);
-  checkGraphConArcList(digraph, 3);
-
-  checkGraphOutArcList(digraph, n1, 2);
-  checkGraphOutArcList(digraph, n2, 1);
-  checkGraphOutArcList(digraph, n3, 0);
-
-  checkGraphInArcList(digraph, n1, 0);
-  checkGraphInArcList(digraph, n2, 1);
-  checkGraphInArcList(digraph, n3, 2);
-
-  checkNodeIds(digraph);
-  checkArcIds(digraph);
-
-  checkGraphNodeMap(digraph);
-  checkGraphArcMap(digraph);
-
-  // Check the adaptor
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 6);
-  checkGraphEdgeList(adaptor, 3);
-  checkGraphConArcList(adaptor, 6);
-  checkGraphConEdgeList(adaptor, 3);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 2);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Check the edges of the adaptor
-  for (Adaptor::EdgeIt e(adaptor); e != INVALID; ++e) {
-    check(adaptor.u(e) == digraph.source(e), "Wrong undir");
-    check(adaptor.v(e) == digraph.target(e), "Wrong undir");
-  }
-
-  // Check CombinedArcMap
-  typedef Adaptor::CombinedArcMap
-    <Digraph::ArcMap<int>, Digraph::ArcMap<int> > IntCombinedMap;
-  typedef Adaptor::CombinedArcMap
-    <Digraph::ArcMap<bool>, Digraph::ArcMap<bool> > BoolCombinedMap;
-  checkConcept<concepts::ReferenceMap<Adaptor::Arc, int, int&, const int&>,
-    IntCombinedMap>();
-  checkConcept<concepts::ReferenceMap<Adaptor::Arc, bool, bool&, const bool&>,
-    BoolCombinedMap>();
-
-  Digraph::ArcMap<int> fw_map(digraph), bk_map(digraph);
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    fw_map[a] = digraph.id(a);
-    bk_map[a] = -digraph.id(a);
-  }
-
-  Adaptor::CombinedArcMap<Digraph::ArcMap<int>, Digraph::ArcMap<int> >
-    comb_map(fw_map, bk_map);
-  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
-    if (adaptor.source(a) == digraph.source(a)) {
-      check(comb_map[a] == fw_map[a], "Wrong combined map");
-    } else {
-      check(comb_map[a] == bk_map[a], "Wrong combined map");
-    }
-  }
-
-  // Check the conversion of nodes and arcs/edges
-  Digraph::Node nd = n3;
-  nd = n3;
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = e3;
-  ad = e3;
-  Adaptor::Edge ea = a1;
-  ea = a2;
-}
-
-void checkResidualDigraph() {
-  // Check concepts
-  checkConcept<concepts::Digraph, ResidualDigraph<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, ResidualDigraph<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef Digraph::ArcMap<int> IntArcMap;
-  typedef ResidualDigraph<Digraph, IntArcMap> Adaptor;
-
-  Digraph digraph;
-  IntArcMap capacity(digraph), flow(digraph);
-  Adaptor adaptor(digraph, capacity, flow);
-
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Digraph::Node n3 = digraph.addNode();
-  Digraph::Node n4 = digraph.addNode();
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Digraph::Arc a3 = digraph.addArc(n1, n4);
-  Digraph::Arc a4 = digraph.addArc(n2, n3);
-  Digraph::Arc a5 = digraph.addArc(n2, n4);
-  Digraph::Arc a6 = digraph.addArc(n3, n4);
-
-  capacity[a1] = 8;
-  capacity[a2] = 6;
-  capacity[a3] = 4;
-  capacity[a4] = 4;
-  capacity[a5] = 6;
-  capacity[a6] = 10;
-
-  // Check the adaptor with various flow values
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    flow[a] = 0;
-  }
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 6);
-  checkGraphConArcList(adaptor, 6);
-
-  checkGraphOutArcList(adaptor, n1, 3);
-  checkGraphOutArcList(adaptor, n2, 2);
-  checkGraphOutArcList(adaptor, n3, 1);
-  checkGraphOutArcList(adaptor, n4, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-  checkGraphInArcList(adaptor, n4, 3);
-
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    flow[a] = capacity[a] / 2;
-  }
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 12);
-  checkGraphConArcList(adaptor, 12);
-
-  checkGraphOutArcList(adaptor, n1, 3);
-  checkGraphOutArcList(adaptor, n2, 3);
-  checkGraphOutArcList(adaptor, n3, 3);
-  checkGraphOutArcList(adaptor, n4, 3);
-
-  checkGraphInArcList(adaptor, n1, 3);
-  checkGraphInArcList(adaptor, n2, 3);
-  checkGraphInArcList(adaptor, n3, 3);
-  checkGraphInArcList(adaptor, n4, 3);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    flow[a] = capacity[a];
-  }
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 6);
-  checkGraphConArcList(adaptor, 6);
-
-  checkGraphOutArcList(adaptor, n1, 0);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 2);
-  checkGraphOutArcList(adaptor, n4, 3);
-
-  checkGraphInArcList(adaptor, n1, 3);
-  checkGraphInArcList(adaptor, n2, 2);
-  checkGraphInArcList(adaptor, n3, 1);
-  checkGraphInArcList(adaptor, n4, 0);
-
-  // Saturate all backward arcs
-  // (set the flow to zero on all forward arcs)
-  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
-    if (adaptor.backward(a))
-      adaptor.augment(a, adaptor.residualCapacity(a));
-  }
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 6);
-  checkGraphConArcList(adaptor, 6);
-
-  checkGraphOutArcList(adaptor, n1, 3);
-  checkGraphOutArcList(adaptor, n2, 2);
-  checkGraphOutArcList(adaptor, n3, 1);
-  checkGraphOutArcList(adaptor, n4, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-  checkGraphInArcList(adaptor, n4, 3);
-
-  // Find maximum flow by augmenting along shortest paths
-  int flow_value = 0;
-  Adaptor::ResidualCapacity res_cap(adaptor);
-  while (true) {
-
-    Bfs<Adaptor> bfs(adaptor);
-    bfs.run(n1, n4);
-
-    if (!bfs.reached(n4)) break;
-
-    Path<Adaptor> p = bfs.path(n4);
-
-    int min = std::numeric_limits<int>::max();
-    for (Path<Adaptor>::ArcIt a(p); a != INVALID; ++a) {
-      if (res_cap[a] < min) min = res_cap[a];
-    }
-
-    for (Path<Adaptor>::ArcIt a(p); a != INVALID; ++a) {
-      adaptor.augment(a, min);
-    }
-    flow_value += min;
-  }
-
-  check(flow_value == 18, "Wrong flow with res graph adaptor");
-
-  // Check forward() and backward()
-  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
-    check(adaptor.forward(a) != adaptor.backward(a),
-          "Wrong forward() or backward()");
-    check((adaptor.forward(a) && adaptor.forward(Digraph::Arc(a)) == a) ||
-          (adaptor.backward(a) && adaptor.backward(Digraph::Arc(a)) == a),
-          "Wrong forward() or backward()");
-  }
-
-  // Check the conversion of nodes and arcs
-  Digraph::Node nd = Adaptor::NodeIt(adaptor);
-  nd = ++Adaptor::NodeIt(adaptor);
-  Adaptor::Node na = n1;
-  na = n2;
-  Digraph::Arc ad = Adaptor::ArcIt(adaptor);
-  ad = ++Adaptor::ArcIt(adaptor);
-}
-
-void checkSplitNodes() {
-  // Check concepts
-  checkConcept<concepts::Digraph, SplitNodes<concepts::Digraph> >();
-  checkConcept<concepts::Digraph, SplitNodes<ListDigraph> >();
-
-  // Create a digraph and an adaptor
-  typedef ListDigraph Digraph;
-  typedef SplitNodes<Digraph> Adaptor;
-
-  Digraph digraph;
-  Adaptor adaptor(digraph);
-
-  Digraph::Node n1 = digraph.addNode();
-  Digraph::Node n2 = digraph.addNode();
-  Digraph::Node n3 = digraph.addNode();
-
-  Digraph::Arc a1 = digraph.addArc(n1, n2);
-  Digraph::Arc a2 = digraph.addArc(n1, n3);
-  Digraph::Arc a3 = digraph.addArc(n2, n3);
-
-  checkGraphNodeList(adaptor, 6);
-  checkGraphArcList(adaptor, 6);
-  checkGraphConArcList(adaptor, 6);
-
-  checkGraphOutArcList(adaptor, adaptor.inNode(n1), 1);
-  checkGraphOutArcList(adaptor, adaptor.outNode(n1), 2);
-  checkGraphOutArcList(adaptor, adaptor.inNode(n2), 1);
-  checkGraphOutArcList(adaptor, adaptor.outNode(n2), 1);
-  checkGraphOutArcList(adaptor, adaptor.inNode(n3), 1);
-  checkGraphOutArcList(adaptor, adaptor.outNode(n3), 0);
-
-  checkGraphInArcList(adaptor, adaptor.inNode(n1), 0);
-  checkGraphInArcList(adaptor, adaptor.outNode(n1), 1);
-  checkGraphInArcList(adaptor, adaptor.inNode(n2), 1);
-  checkGraphInArcList(adaptor, adaptor.outNode(n2), 1);
-  checkGraphInArcList(adaptor, adaptor.inNode(n3), 2);
-  checkGraphInArcList(adaptor, adaptor.outNode(n3), 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check split
-  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
-    if (adaptor.origArc(a)) {
-      Digraph::Arc oa = a;
-      check(adaptor.source(a) == adaptor.outNode(digraph.source(oa)),
-            "Wrong split");
-      check(adaptor.target(a) == adaptor.inNode(digraph.target(oa)),
-            "Wrong split");
-    } else {
-      Digraph::Node on = a;
-      check(adaptor.source(a) == adaptor.inNode(on), "Wrong split");
-      check(adaptor.target(a) == adaptor.outNode(on), "Wrong split");
-    }
-  }
-
-  // Check combined node map
-  typedef Adaptor::CombinedNodeMap
-    <Digraph::NodeMap<int>, Digraph::NodeMap<int> > IntCombinedNodeMap;
-  typedef Adaptor::CombinedNodeMap
-    <Digraph::NodeMap<bool>, Digraph::NodeMap<bool> > BoolCombinedNodeMap;
-  checkConcept<concepts::ReferenceMap<Adaptor::Node, int, int&, const int&>,
-    IntCombinedNodeMap>();
-//checkConcept<concepts::ReferenceMap<Adaptor::Node, bool, bool&, const bool&>,
-//  BoolCombinedNodeMap>();
-  checkConcept<concepts::ReadWriteMap<Adaptor::Node, bool>,
-    BoolCombinedNodeMap>();
-
-  Digraph::NodeMap<int> in_map(digraph), out_map(digraph);
-  for (Digraph::NodeIt n(digraph); n != INVALID; ++n) {
-    in_map[n] = digraph.id(n);
-    out_map[n] = -digraph.id(n);
-  }
-
-  Adaptor::CombinedNodeMap<Digraph::NodeMap<int>, Digraph::NodeMap<int> >
-    node_map(in_map, out_map);
-  for (Adaptor::NodeIt n(adaptor); n != INVALID; ++n) {
-    if (adaptor.inNode(n)) {
-      check(node_map[n] == in_map[n], "Wrong combined node map");
-    } else {
-      check(node_map[n] == out_map[n], "Wrong combined node map");
-    }
-  }
-
-  // Check combined arc map
-  typedef Adaptor::CombinedArcMap
-    <Digraph::ArcMap<int>, Digraph::NodeMap<int> > IntCombinedArcMap;
-  typedef Adaptor::CombinedArcMap
-    <Digraph::ArcMap<bool>, Digraph::NodeMap<bool> > BoolCombinedArcMap;
-  checkConcept<concepts::ReferenceMap<Adaptor::Arc, int, int&, const int&>,
-    IntCombinedArcMap>();
-//checkConcept<concepts::ReferenceMap<Adaptor::Arc, bool, bool&, const bool&>,
-//  BoolCombinedArcMap>();
-  checkConcept<concepts::ReadWriteMap<Adaptor::Arc, bool>,
-    BoolCombinedArcMap>();
-
-  Digraph::ArcMap<int> a_map(digraph);
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    a_map[a] = digraph.id(a);
-  }
-
-  Adaptor::CombinedArcMap<Digraph::ArcMap<int>, Digraph::NodeMap<int> >
-    arc_map(a_map, out_map);
-  for (Digraph::ArcIt a(digraph); a != INVALID; ++a) {
-    check(arc_map[adaptor.arc(a)] == a_map[a],  "Wrong combined arc map");
-  }
-  for (Digraph::NodeIt n(digraph); n != INVALID; ++n) {
-    check(arc_map[adaptor.arc(n)] == out_map[n],  "Wrong combined arc map");
-  }
-
-  // Check the conversion of nodes
-  Digraph::Node nd = adaptor.inNode(n1);
-  check (nd == n1, "Wrong node conversion");
-  nd = adaptor.outNode(n2);
-  check (nd == n2, "Wrong node conversion");
-}
-
-void checkSubGraph() {
-  // Check concepts
-  checkConcept<concepts::Graph, SubGraph<concepts::Graph> >();
-  checkConcept<concepts::Graph, SubGraph<ListGraph> >();
-  checkConcept<concepts::AlterableGraphComponent<>,
-               SubGraph<ListGraph> >();
-  checkConcept<concepts::ExtendableGraphComponent<>,
-               SubGraph<ListGraph> >();
-  checkConcept<concepts::ErasableGraphComponent<>,
-               SubGraph<ListGraph> >();
-  checkConcept<concepts::ClearableGraphComponent<>,
-               SubGraph<ListGraph> >();
-
-  // Create a graph and an adaptor
-  typedef ListGraph Graph;
-  typedef Graph::NodeMap<bool> NodeFilter;
-  typedef Graph::EdgeMap<bool> EdgeFilter;
-  typedef SubGraph<Graph, NodeFilter, EdgeFilter> Adaptor;
-
-  Graph graph;
-  NodeFilter node_filter(graph);
-  EdgeFilter edge_filter(graph);
-  Adaptor adaptor(graph, node_filter, edge_filter);
-
-  // Add nodes and edges to the original graph and the adaptor
-  Graph::Node n1 = graph.addNode();
-  Graph::Node n2 = graph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-  Adaptor::Node n4 = adaptor.addNode();
-
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
-
-  Graph::Edge e1 = graph.addEdge(n1, n2);
-  Graph::Edge e2 = graph.addEdge(n1, n3);
-  Adaptor::Edge e3 = adaptor.addEdge(n2, n3);
-  Adaptor::Edge e4 = adaptor.addEdge(n3, n4);
-
-  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 8);
-  checkGraphEdgeList(adaptor, 4);
-  checkGraphConArcList(adaptor, 8);
-  checkGraphConEdgeList(adaptor, 4);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 2);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 3);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide an edge
-  adaptor.status(e2, false);
-  adaptor.disable(e3);
-  if (!adaptor.status(e3)) adaptor.enable(e3);
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 6);
-  checkGraphEdgeList(adaptor, 3);
-  checkGraphConArcList(adaptor, 6);
-  checkGraphConEdgeList(adaptor, 3);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 1);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 2);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide a node
-  adaptor.status(n1, false);
-  adaptor.disable(n3);
-  if (!adaptor.status(n3)) adaptor.enable(n3);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 4);
-  checkGraphEdgeList(adaptor, 2);
-  checkGraphConArcList(adaptor, 4);
-  checkGraphConEdgeList(adaptor, 2);
-
-  checkGraphIncEdgeArcLists(adaptor, n2, 1);
-  checkGraphIncEdgeArcLists(adaptor, n3, 2);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide all nodes and edges
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = false;
-  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = false;
-
-  checkGraphNodeList(adaptor, 0);
-  checkGraphArcList(adaptor, 0);
-  checkGraphEdgeList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-  checkGraphConEdgeList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Check the conversion of nodes and edges
-  Graph::Node ng = n3;
-  ng = n4;
-  Adaptor::Node na = n1;
-  na = n2;
-  Graph::Edge eg = e3;
-  eg = e4;
-  Adaptor::Edge ea = e1;
-  ea = e2;
-}
-
-void checkFilterNodes2() {
-  // Check concepts
-  checkConcept<concepts::Graph, FilterNodes<concepts::Graph> >();
-  checkConcept<concepts::Graph, FilterNodes<ListGraph> >();
-  checkConcept<concepts::AlterableGraphComponent<>,
-               FilterNodes<ListGraph> >();
-  checkConcept<concepts::ExtendableGraphComponent<>,
-               FilterNodes<ListGraph> >();
-  checkConcept<concepts::ErasableGraphComponent<>,
-               FilterNodes<ListGraph> >();
-  checkConcept<concepts::ClearableGraphComponent<>,
-               FilterNodes<ListGraph> >();
-
-  // Create a graph and an adaptor
-  typedef ListGraph Graph;
-  typedef Graph::NodeMap<bool> NodeFilter;
-  typedef FilterNodes<Graph, NodeFilter> Adaptor;
-
-  // Add nodes and edges to the original graph and the adaptor
-  Graph graph;
-  NodeFilter node_filter(graph);
-  Adaptor adaptor(graph, node_filter);
-
-  Graph::Node n1 = graph.addNode();
-  Graph::Node n2 = graph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-  Adaptor::Node n4 = adaptor.addNode();
-
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
-
-  Graph::Edge e1 = graph.addEdge(n1, n2);
-  Graph::Edge e2 = graph.addEdge(n1, n3);
-  Adaptor::Edge e3 = adaptor.addEdge(n2, n3);
-  Adaptor::Edge e4 = adaptor.addEdge(n3, n4);
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 8);
-  checkGraphEdgeList(adaptor, 4);
-  checkGraphConArcList(adaptor, 8);
-  checkGraphConEdgeList(adaptor, 4);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 2);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 3);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide a node
-  adaptor.status(n1, false);
-  adaptor.disable(n3);
-  if (!adaptor.status(n3)) adaptor.enable(n3);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 4);
-  checkGraphEdgeList(adaptor, 2);
-  checkGraphConArcList(adaptor, 4);
-  checkGraphConEdgeList(adaptor, 2);
-
-  checkGraphIncEdgeArcLists(adaptor, n2, 1);
-  checkGraphIncEdgeArcLists(adaptor, n3, 2);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide all nodes
-  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = false;
-
-  checkGraphNodeList(adaptor, 0);
-  checkGraphArcList(adaptor, 0);
-  checkGraphEdgeList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-  checkGraphConEdgeList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Check the conversion of nodes and edges
-  Graph::Node ng = n3;
-  ng = n4;
-  Adaptor::Node na = n1;
-  na = n2;
-  Graph::Edge eg = e3;
-  eg = e4;
-  Adaptor::Edge ea = e1;
-  ea = e2;
-}
-
-void checkFilterEdges() {
-  // Check concepts
-  checkConcept<concepts::Graph, FilterEdges<concepts::Graph> >();
-  checkConcept<concepts::Graph, FilterEdges<ListGraph> >();
-  checkConcept<concepts::AlterableGraphComponent<>,
-               FilterEdges<ListGraph> >();
-  checkConcept<concepts::ExtendableGraphComponent<>,
-               FilterEdges<ListGraph> >();
-  checkConcept<concepts::ErasableGraphComponent<>,
-               FilterEdges<ListGraph> >();
-  checkConcept<concepts::ClearableGraphComponent<>,
-               FilterEdges<ListGraph> >();
-
-  // Create a graph and an adaptor
-  typedef ListGraph Graph;
-  typedef Graph::EdgeMap<bool> EdgeFilter;
-  typedef FilterEdges<Graph, EdgeFilter> Adaptor;
-
-  Graph graph;
-  EdgeFilter edge_filter(graph);
-  Adaptor adaptor(graph, edge_filter);
-
-  // Add nodes and edges to the original graph and the adaptor
-  Graph::Node n1 = graph.addNode();
-  Graph::Node n2 = graph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-  Adaptor::Node n4 = adaptor.addNode();
-
-  Graph::Edge e1 = graph.addEdge(n1, n2);
-  Graph::Edge e2 = graph.addEdge(n1, n3);
-  Adaptor::Edge e3 = adaptor.addEdge(n2, n3);
-  Adaptor::Edge e4 = adaptor.addEdge(n3, n4);
-
-  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 8);
-  checkGraphEdgeList(adaptor, 4);
-  checkGraphConArcList(adaptor, 8);
-  checkGraphConEdgeList(adaptor, 4);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 2);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 3);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide an edge
-  adaptor.status(e2, false);
-  adaptor.disable(e3);
-  if (!adaptor.status(e3)) adaptor.enable(e3);
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 6);
-  checkGraphEdgeList(adaptor, 3);
-  checkGraphConArcList(adaptor, 6);
-  checkGraphConEdgeList(adaptor, 3);
-
-  checkGraphIncEdgeArcLists(adaptor, n1, 1);
-  checkGraphIncEdgeArcLists(adaptor, n2, 2);
-  checkGraphIncEdgeArcLists(adaptor, n3, 2);
-  checkGraphIncEdgeArcLists(adaptor, n4, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Hide all edges
-  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = false;
-
-  checkGraphNodeList(adaptor, 4);
-  checkGraphArcList(adaptor, 0);
-  checkGraphEdgeList(adaptor, 0);
-  checkGraphConArcList(adaptor, 0);
-  checkGraphConEdgeList(adaptor, 0);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-  checkEdgeIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-  checkGraphEdgeMap(adaptor);
-
-  // Check the conversion of nodes and edges
-  Graph::Node ng = n3;
-  ng = n4;
-  Adaptor::Node na = n1;
-  na = n2;
-  Graph::Edge eg = e3;
-  eg = e4;
-  Adaptor::Edge ea = e1;
-  ea = e2;
-}
-
-void checkOrienter() {
-  // Check concepts
-  checkConcept<concepts::Digraph, Orienter<concepts::Graph> >();
-  checkConcept<concepts::Digraph, Orienter<ListGraph> >();
-  checkConcept<concepts::AlterableDigraphComponent<>,
-               Orienter<ListGraph> >();
-  checkConcept<concepts::ExtendableDigraphComponent<>,
-               Orienter<ListGraph> >();
-  checkConcept<concepts::ErasableDigraphComponent<>,
-               Orienter<ListGraph> >();
-  checkConcept<concepts::ClearableDigraphComponent<>,
-               Orienter<ListGraph> >();
-
-  // Create a graph and an adaptor
-  typedef ListGraph Graph;
-  typedef ListGraph::EdgeMap<bool> DirMap;
-  typedef Orienter<Graph> Adaptor;
-
-  Graph graph;
-  DirMap dir(graph);
-  Adaptor adaptor(graph, dir);
-
-  // Add nodes and edges to the original graph and the adaptor
-  Graph::Node n1 = graph.addNode();
-  Graph::Node n2 = graph.addNode();
-  Adaptor::Node n3 = adaptor.addNode();
-
-  Graph::Edge e1 = graph.addEdge(n1, n2);
-  Graph::Edge e2 = graph.addEdge(n1, n3);
-  Adaptor::Arc e3 = adaptor.addArc(n2, n3);
-
-  dir[e1] = dir[e2] = dir[e3] = true;
-
-  // Check the original graph
-  checkGraphNodeList(graph, 3);
-  checkGraphArcList(graph, 6);
-  checkGraphConArcList(graph, 6);
-  checkGraphEdgeList(graph, 3);
-  checkGraphConEdgeList(graph, 3);
-
-  checkGraphIncEdgeArcLists(graph, n1, 2);
-  checkGraphIncEdgeArcLists(graph, n2, 2);
-  checkGraphIncEdgeArcLists(graph, n3, 2);
-
-  checkNodeIds(graph);
-  checkArcIds(graph);
-  checkEdgeIds(graph);
-
-  checkGraphNodeMap(graph);
-  checkGraphArcMap(graph);
-  checkGraphEdgeMap(graph);
-
-  // Check the adaptor
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 2);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 0);
-
-  checkGraphInArcList(adaptor, n1, 0);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check direction changing
-  {
-    dir[e1] = true;
-    Adaptor::Node u = adaptor.source(e1);
-    Adaptor::Node v = adaptor.target(e1);
-
-    dir[e1] = false;
-    check (u == adaptor.target(e1), "Wrong dir");
-    check (v == adaptor.source(e1), "Wrong dir");
-
-    check ((u == n1 && v == n2) || (u == n2 && v == n1), "Wrong dir");
-    dir[e1] = n1 == u;
-  }
-
-  {
-    dir[e2] = true;
-    Adaptor::Node u = adaptor.source(e2);
-    Adaptor::Node v = adaptor.target(e2);
-
-    dir[e2] = false;
-    check (u == adaptor.target(e2), "Wrong dir");
-    check (v == adaptor.source(e2), "Wrong dir");
-
-    check ((u == n1 && v == n3) || (u == n3 && v == n1), "Wrong dir");
-    dir[e2] = n3 == u;
-  }
-
-  {
-    dir[e3] = true;
-    Adaptor::Node u = adaptor.source(e3);
-    Adaptor::Node v = adaptor.target(e3);
-
-    dir[e3] = false;
-    check (u == adaptor.target(e3), "Wrong dir");
-    check (v == adaptor.source(e3), "Wrong dir");
-
-    check ((u == n2 && v == n3) || (u == n3 && v == n2), "Wrong dir");
-    dir[e3] = n2 == u;
-  }
-
-  // Check the adaptor again
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 1);
-  checkGraphOutArcList(adaptor, n2, 1);
-  checkGraphOutArcList(adaptor, n3, 1);
-
-  checkGraphInArcList(adaptor, n1, 1);
-  checkGraphInArcList(adaptor, n2, 1);
-  checkGraphInArcList(adaptor, n3, 1);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check reverseArc()
-  adaptor.reverseArc(e2);
-  adaptor.reverseArc(e3);
-  adaptor.reverseArc(e2);
-
-  checkGraphNodeList(adaptor, 3);
-  checkGraphArcList(adaptor, 3);
-  checkGraphConArcList(adaptor, 3);
-
-  checkGraphOutArcList(adaptor, n1, 1);
-  checkGraphOutArcList(adaptor, n2, 0);
-  checkGraphOutArcList(adaptor, n3, 2);
-
-  checkGraphInArcList(adaptor, n1, 1);
-  checkGraphInArcList(adaptor, n2, 2);
-  checkGraphInArcList(adaptor, n3, 0);
-
-  // Check the conversion of nodes and arcs/edges
-  Graph::Node ng = n3;
-  ng = n3;
-  Adaptor::Node na = n1;
-  na = n2;
-  Graph::Edge eg = e3;
-  eg = e3;
-  Adaptor::Arc aa = e1;
-  aa = e2;
-}
-
-void checkCombiningAdaptors() {
-  // Create a grid graph
-  GridGraph graph(2,2);
-  GridGraph::Node n1 = graph(0,0);
-  GridGraph::Node n2 = graph(0,1);
-  GridGraph::Node n3 = graph(1,0);
-  GridGraph::Node n4 = graph(1,1);
-
-  GridGraph::EdgeMap<bool> dir_map(graph);
-  dir_map[graph.right(n1)] = graph.u(graph.right(n1)) == n1;
-  dir_map[graph.up(n1)] = graph.u(graph.up(n1)) != n1;
-  dir_map[graph.left(n4)] = graph.u(graph.left(n4)) != n4;
-  dir_map[graph.down(n4)] = graph.u(graph.down(n4)) != n4;
-
-  // Apply several adaptors on the grid graph
-  typedef SplitNodes< ReverseDigraph< const Orienter<
-            const GridGraph, GridGraph::EdgeMap<bool> > > >
-    RevSplitGridGraph;
-  typedef ReverseDigraph<const RevSplitGridGraph> SplitGridGraph;
-  typedef Undirector<const SplitGridGraph> USplitGridGraph;
-  typedef Undirector<const USplitGridGraph> UUSplitGridGraph;
-  checkConcept<concepts::Digraph, RevSplitGridGraph>();
-  checkConcept<concepts::Digraph, SplitGridGraph>();
-  checkConcept<concepts::Graph, USplitGridGraph>();
-  checkConcept<concepts::Graph, UUSplitGridGraph>();
-
-  RevSplitGridGraph rev_adaptor =
-    splitNodes(reverseDigraph(orienter(graph, dir_map)));
-  SplitGridGraph adaptor = reverseDigraph(rev_adaptor);
-  USplitGridGraph uadaptor = undirector(adaptor);
-  UUSplitGridGraph uuadaptor = undirector(uadaptor);
-
-  // Check adaptor
-  checkGraphNodeList(adaptor, 8);
-  checkGraphArcList(adaptor, 8);
-  checkGraphConArcList(adaptor, 8);
-
-  checkGraphOutArcList(adaptor, rev_adaptor.inNode(n1), 1);
-  checkGraphOutArcList(adaptor, rev_adaptor.outNode(n1), 1);
-  checkGraphOutArcList(adaptor, rev_adaptor.inNode(n2), 2);
-  checkGraphOutArcList(adaptor, rev_adaptor.outNode(n2), 1);
-  checkGraphOutArcList(adaptor, rev_adaptor.inNode(n3), 1);
-  checkGraphOutArcList(adaptor, rev_adaptor.outNode(n3), 1);
-  checkGraphOutArcList(adaptor, rev_adaptor.inNode(n4), 0);
-  checkGraphOutArcList(adaptor, rev_adaptor.outNode(n4), 1);
-
-  checkGraphInArcList(adaptor, rev_adaptor.inNode(n1), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.outNode(n1), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.inNode(n2), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.outNode(n2), 0);
-  checkGraphInArcList(adaptor, rev_adaptor.inNode(n3), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.outNode(n3), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.inNode(n4), 1);
-  checkGraphInArcList(adaptor, rev_adaptor.outNode(n4), 2);
-
-  checkNodeIds(adaptor);
-  checkArcIds(adaptor);
-
-  checkGraphNodeMap(adaptor);
-  checkGraphArcMap(adaptor);
-
-  // Check uadaptor
-  checkGraphNodeList(uadaptor, 8);
-  checkGraphEdgeList(uadaptor, 8);
-  checkGraphArcList(uadaptor, 16);
-  checkGraphConEdgeList(uadaptor, 8);
-  checkGraphConArcList(uadaptor, 16);
-
-  checkNodeIds(uadaptor);
-  checkEdgeIds(uadaptor);
-  checkArcIds(uadaptor);
-
-  checkGraphNodeMap(uadaptor);
-  checkGraphEdgeMap(uadaptor);
-  checkGraphArcMap(uadaptor);
-
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n1), 2);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n1), 2);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n2), 3);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n2), 1);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n3), 2);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n3), 2);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.inNode(n4), 1);
-  checkGraphIncEdgeArcLists(uadaptor, rev_adaptor.outNode(n4), 3);
-
-  // Check uuadaptor
-  checkGraphNodeList(uuadaptor, 8);
-  checkGraphEdgeList(uuadaptor, 16);
-  checkGraphArcList(uuadaptor, 32);
-  checkGraphConEdgeList(uuadaptor, 16);
-  checkGraphConArcList(uuadaptor, 32);
-
-  checkNodeIds(uuadaptor);
-  checkEdgeIds(uuadaptor);
-  checkArcIds(uuadaptor);
-
-  checkGraphNodeMap(uuadaptor);
-  checkGraphEdgeMap(uuadaptor);
-  checkGraphArcMap(uuadaptor);
-}
-
-int main(int, const char **) {
-  // Check the digraph adaptors (using ListDigraph)
-  checkReverseDigraph();
-  checkSubDigraph();
-  checkFilterNodes1();
-  checkFilterArcs();
-  checkUndirector();
-  checkResidualDigraph();
-  checkSplitNodes();
-
-  // Check the graph adaptors (using ListGraph)
-  checkSubGraph();
-  checkFilterNodes2();
-  checkFilterEdges();
-  checkOrienter();
-
-  // Combine adaptors (using GridGraph)
-  checkCombiningAdaptors();
-
-  return 0;
-}
Index: test/bfs_test.cc
===================================================================
--- test/bfs_test.cc	(revision 440)
+++ test/bfs_test.cc	(revision 293)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/circulation_test.cc
===================================================================
--- test/circulation_test.cc	(revision 440)
+++ test/circulation_test.cc	(revision 403)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/counter_test.cc
===================================================================
--- test/counter_test.cc	(revision 440)
+++ test/counter_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/dfs_test.cc
===================================================================
--- test/dfs_test.cc	(revision 440)
+++ test/dfs_test.cc	(revision 293)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/digraph_test.cc
===================================================================
--- test/digraph_test.cc	(revision 440)
+++ test/digraph_test.cc	(revision 375)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/dijkstra_test.cc
===================================================================
--- test/dijkstra_test.cc	(revision 440)
+++ test/dijkstra_test.cc	(revision 397)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/dim_test.cc
===================================================================
--- test/dim_test.cc	(revision 440)
+++ test/dim_test.cc	(revision 253)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/edge_set_test.cc
===================================================================
--- test/edge_set_test.cc	(revision 468)
+++ test/edge_set_test.cc	(revision 468)
@@ -0,0 +1,380 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#include <iostream>
+#include <vector>
+
+#include <lemon/concepts/digraph.h>
+#include <lemon/concepts/graph.h>
+#include <lemon/concept_check.h>
+
+#include <lemon/list_graph.h>
+
+#include <lemon/edge_set.h>
+
+#include "graph_test.h"
+#include "test_tools.h"
+
+using namespace lemon;
+
+void checkSmartArcSet() {
+  checkConcept<concepts::Digraph, SmartArcSet<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef SmartArcSet<Digraph> ArcSet;
+
+  Digraph digraph;
+  Digraph::Node
+    n1 = digraph.addNode(),
+    n2 = digraph.addNode();
+
+  Digraph::Arc ga1 = digraph.addArc(n1, n2);
+
+  ArcSet arc_set(digraph);
+
+  Digraph::Arc ga2 = digraph.addArc(n2, n1);
+
+  checkGraphNodeList(arc_set, 2);
+  checkGraphArcList(arc_set, 0);
+
+  Digraph::Node
+    n3 = digraph.addNode();
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 0);
+
+  ArcSet::Arc a1 = arc_set.addArc(n1, n2);
+  check(arc_set.source(a1) == n1 && arc_set.target(a1) == n2, "Wrong arc");
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 1);
+
+  checkGraphOutArcList(arc_set, n1, 1);
+  checkGraphOutArcList(arc_set, n2, 0);
+  checkGraphOutArcList(arc_set, n3, 0);
+
+  checkGraphInArcList(arc_set, n1, 0);
+  checkGraphInArcList(arc_set, n2, 1);
+  checkGraphInArcList(arc_set, n3, 0);
+
+  checkGraphConArcList(arc_set, 1);
+
+  ArcSet::Arc a2 = arc_set.addArc(n2, n1),
+    a3 = arc_set.addArc(n2, n3),
+    a4 = arc_set.addArc(n2, n3);
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 4);
+
+  checkGraphOutArcList(arc_set, n1, 1);
+  checkGraphOutArcList(arc_set, n2, 3);
+  checkGraphOutArcList(arc_set, n3, 0);
+
+  checkGraphInArcList(arc_set, n1, 1);
+  checkGraphInArcList(arc_set, n2, 1);
+  checkGraphInArcList(arc_set, n3, 2);
+
+  checkGraphConArcList(arc_set, 4);
+
+  checkNodeIds(arc_set);
+  checkArcIds(arc_set);
+  checkGraphNodeMap(arc_set);
+  checkGraphArcMap(arc_set);
+
+  check(arc_set.valid(), "Wrong validity");
+  digraph.erase(n1);
+  check(!arc_set.valid(), "Wrong validity");
+}
+
+void checkListArcSet() {
+  checkConcept<concepts::Digraph, SmartArcSet<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef ListArcSet<Digraph> ArcSet;
+
+  Digraph digraph;
+  Digraph::Node
+    n1 = digraph.addNode(),
+    n2 = digraph.addNode();
+
+  Digraph::Arc ga1 = digraph.addArc(n1, n2);
+
+  ArcSet arc_set(digraph);
+
+  Digraph::Arc ga2 = digraph.addArc(n2, n1);
+
+  checkGraphNodeList(arc_set, 2);
+  checkGraphArcList(arc_set, 0);
+
+  Digraph::Node
+    n3 = digraph.addNode();
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 0);
+
+  ArcSet::Arc a1 = arc_set.addArc(n1, n2);
+  check(arc_set.source(a1) == n1 && arc_set.target(a1) == n2, "Wrong arc");
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 1);
+
+  checkGraphOutArcList(arc_set, n1, 1);
+  checkGraphOutArcList(arc_set, n2, 0);
+  checkGraphOutArcList(arc_set, n3, 0);
+
+  checkGraphInArcList(arc_set, n1, 0);
+  checkGraphInArcList(arc_set, n2, 1);
+  checkGraphInArcList(arc_set, n3, 0);
+
+  checkGraphConArcList(arc_set, 1);
+
+  ArcSet::Arc a2 = arc_set.addArc(n2, n1),
+    a3 = arc_set.addArc(n2, n3),
+    a4 = arc_set.addArc(n2, n3);
+  checkGraphNodeList(arc_set, 3);
+  checkGraphArcList(arc_set, 4);
+
+  checkGraphOutArcList(arc_set, n1, 1);
+  checkGraphOutArcList(arc_set, n2, 3);
+  checkGraphOutArcList(arc_set, n3, 0);
+
+  checkGraphInArcList(arc_set, n1, 1);
+  checkGraphInArcList(arc_set, n2, 1);
+  checkGraphInArcList(arc_set, n3, 2);
+
+  checkGraphConArcList(arc_set, 4);
+
+  checkNodeIds(arc_set);
+  checkArcIds(arc_set);
+  checkGraphNodeMap(arc_set);
+  checkGraphArcMap(arc_set);
+
+  digraph.erase(n1);
+
+  checkGraphNodeList(arc_set, 2);
+  checkGraphArcList(arc_set, 2);
+
+  checkGraphOutArcList(arc_set, n2, 2);
+  checkGraphOutArcList(arc_set, n3, 0);
+
+  checkGraphInArcList(arc_set, n2, 0);
+  checkGraphInArcList(arc_set, n3, 2);
+
+  checkNodeIds(arc_set);
+  checkArcIds(arc_set);
+  checkGraphNodeMap(arc_set);
+  checkGraphArcMap(arc_set);
+
+  checkGraphConArcList(arc_set, 2);
+}
+
+void checkSmartEdgeSet() {
+  checkConcept<concepts::Digraph, SmartEdgeSet<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef SmartEdgeSet<Digraph> EdgeSet;
+
+  Digraph digraph;
+  Digraph::Node
+    n1 = digraph.addNode(),
+    n2 = digraph.addNode();
+
+  Digraph::Arc ga1 = digraph.addArc(n1, n2);
+
+  EdgeSet edge_set(digraph);
+
+  Digraph::Arc ga2 = digraph.addArc(n2, n1);
+
+  checkGraphNodeList(edge_set, 2);
+  checkGraphArcList(edge_set, 0);
+  checkGraphEdgeList(edge_set, 0);
+
+  Digraph::Node
+    n3 = digraph.addNode();
+  checkGraphNodeList(edge_set, 3);
+  checkGraphArcList(edge_set, 0);
+  checkGraphEdgeList(edge_set, 0);
+
+  EdgeSet::Edge e1 = edge_set.addEdge(n1, n2);
+  check((edge_set.u(e1) == n1 && edge_set.v(e1) == n2) ||
+        (edge_set.v(e1) == n1 && edge_set.u(e1) == n2), "Wrong edge");
+  checkGraphNodeList(edge_set, 3);
+  checkGraphArcList(edge_set, 2);
+  checkGraphEdgeList(edge_set, 1);
+
+  checkGraphOutArcList(edge_set, n1, 1);
+  checkGraphOutArcList(edge_set, n2, 1);
+  checkGraphOutArcList(edge_set, n3, 0);
+
+  checkGraphInArcList(edge_set, n1, 1);
+  checkGraphInArcList(edge_set, n2, 1);
+  checkGraphInArcList(edge_set, n3, 0);
+
+  checkGraphIncEdgeList(edge_set, n1, 1);
+  checkGraphIncEdgeList(edge_set, n2, 1);
+  checkGraphIncEdgeList(edge_set, n3, 0);
+
+  checkGraphConEdgeList(edge_set, 1);
+  checkGraphConArcList(edge_set, 2);
+
+  EdgeSet::Edge e2 = edge_set.addEdge(n2, n1),
+    e3 = edge_set.addEdge(n2, n3),
+    e4 = edge_set.addEdge(n2, n3);
+  checkGraphNodeList(edge_set, 3);
+  checkGraphEdgeList(edge_set, 4);
+
+  checkGraphOutArcList(edge_set, n1, 2);
+  checkGraphOutArcList(edge_set, n2, 4);
+  checkGraphOutArcList(edge_set, n3, 2);
+
+  checkGraphInArcList(edge_set, n1, 2);
+  checkGraphInArcList(edge_set, n2, 4);
+  checkGraphInArcList(edge_set, n3, 2);
+
+  checkGraphIncEdgeList(edge_set, n1, 2);
+  checkGraphIncEdgeList(edge_set, n2, 4);
+  checkGraphIncEdgeList(edge_set, n3, 2);
+
+  checkGraphConEdgeList(edge_set, 4);
+  checkGraphConArcList(edge_set, 8);
+
+  checkArcDirections(edge_set);
+
+  checkNodeIds(edge_set);
+  checkArcIds(edge_set);
+  checkEdgeIds(edge_set);
+  checkGraphNodeMap(edge_set);
+  checkGraphArcMap(edge_set);
+  checkGraphEdgeMap(edge_set);
+
+  check(edge_set.valid(), "Wrong validity");
+  digraph.erase(n1);
+  check(!edge_set.valid(), "Wrong validity");
+}
+
+void checkListEdgeSet() {
+  checkConcept<concepts::Digraph, ListEdgeSet<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef ListEdgeSet<Digraph> EdgeSet;
+
+  Digraph digraph;
+  Digraph::Node
+    n1 = digraph.addNode(),
+    n2 = digraph.addNode();
+
+  Digraph::Arc ga1 = digraph.addArc(n1, n2);
+
+  EdgeSet edge_set(digraph);
+
+  Digraph::Arc ga2 = digraph.addArc(n2, n1);
+
+  checkGraphNodeList(edge_set, 2);
+  checkGraphArcList(edge_set, 0);
+  checkGraphEdgeList(edge_set, 0);
+
+  Digraph::Node
+    n3 = digraph.addNode();
+  checkGraphNodeList(edge_set, 3);
+  checkGraphArcList(edge_set, 0);
+  checkGraphEdgeList(edge_set, 0);
+
+  EdgeSet::Edge e1 = edge_set.addEdge(n1, n2);
+  check((edge_set.u(e1) == n1 && edge_set.v(e1) == n2) ||
+        (edge_set.v(e1) == n1 && edge_set.u(e1) == n2), "Wrong edge");
+  checkGraphNodeList(edge_set, 3);
+  checkGraphArcList(edge_set, 2);
+  checkGraphEdgeList(edge_set, 1);
+
+  checkGraphOutArcList(edge_set, n1, 1);
+  checkGraphOutArcList(edge_set, n2, 1);
+  checkGraphOutArcList(edge_set, n3, 0);
+
+  checkGraphInArcList(edge_set, n1, 1);
+  checkGraphInArcList(edge_set, n2, 1);
+  checkGraphInArcList(edge_set, n3, 0);
+
+  checkGraphIncEdgeList(edge_set, n1, 1);
+  checkGraphIncEdgeList(edge_set, n2, 1);
+  checkGraphIncEdgeList(edge_set, n3, 0);
+
+  checkGraphConEdgeList(edge_set, 1);
+  checkGraphConArcList(edge_set, 2);
+
+  EdgeSet::Edge e2 = edge_set.addEdge(n2, n1),
+    e3 = edge_set.addEdge(n2, n3),
+    e4 = edge_set.addEdge(n2, n3);
+  checkGraphNodeList(edge_set, 3);
+  checkGraphEdgeList(edge_set, 4);
+
+  checkGraphOutArcList(edge_set, n1, 2);
+  checkGraphOutArcList(edge_set, n2, 4);
+  checkGraphOutArcList(edge_set, n3, 2);
+
+  checkGraphInArcList(edge_set, n1, 2);
+  checkGraphInArcList(edge_set, n2, 4);
+  checkGraphInArcList(edge_set, n3, 2);
+
+  checkGraphIncEdgeList(edge_set, n1, 2);
+  checkGraphIncEdgeList(edge_set, n2, 4);
+  checkGraphIncEdgeList(edge_set, n3, 2);
+
+  checkGraphConEdgeList(edge_set, 4);
+  checkGraphConArcList(edge_set, 8);
+
+  checkArcDirections(edge_set);
+
+  checkNodeIds(edge_set);
+  checkArcIds(edge_set);
+  checkEdgeIds(edge_set);
+  checkGraphNodeMap(edge_set);
+  checkGraphArcMap(edge_set);
+  checkGraphEdgeMap(edge_set);
+
+  digraph.erase(n1);
+
+  checkGraphNodeList(edge_set, 2);
+  checkGraphArcList(edge_set, 4);
+  checkGraphEdgeList(edge_set, 2);
+
+  checkGraphOutArcList(edge_set, n2, 2);
+  checkGraphOutArcList(edge_set, n3, 2);
+
+  checkGraphInArcList(edge_set, n2, 2);
+  checkGraphInArcList(edge_set, n3, 2);
+
+  checkGraphIncEdgeList(edge_set, n2, 2);
+  checkGraphIncEdgeList(edge_set, n3, 2);
+
+  checkNodeIds(edge_set);
+  checkArcIds(edge_set);
+  checkEdgeIds(edge_set);
+  checkGraphNodeMap(edge_set);
+  checkGraphArcMap(edge_set);
+  checkGraphEdgeMap(edge_set);
+
+  checkGraphConEdgeList(edge_set, 2);
+  checkGraphConArcList(edge_set, 4);
+
+}
+
+
+int main() {
+
+  checkSmartArcSet();
+  checkListArcSet();
+  checkSmartEdgeSet();
+  checkListEdgeSet();
+
+  return 0;
+}
Index: test/error_test.cc
===================================================================
--- test/error_test.cc	(revision 440)
+++ test/error_test.cc	(revision 277)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/graph_adaptor_test.cc
===================================================================
--- test/graph_adaptor_test.cc	(revision 416)
+++ test/graph_adaptor_test.cc	(revision 416)
@@ -0,0 +1,984 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#include<iostream>
+#include<lemon/concept_check.h>
+
+#include<lemon/list_graph.h>
+#include<lemon/smart_graph.h>
+
+#include<lemon/concepts/digraph.h>
+#include<lemon/concepts/graph.h>
+
+#include<lemon/adaptors.h>
+
+#include <limits>
+#include <lemon/bfs.h>
+#include <lemon/path.h>
+
+#include"test/test_tools.h"
+#include"test/graph_test.h"
+
+using namespace lemon;
+
+void checkReverseDigraph() {
+  checkConcept<concepts::Digraph, ReverseDigraph<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef ReverseDigraph<Digraph> Adaptor;
+
+  Digraph digraph;
+  Adaptor adaptor(digraph);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 3);
+  checkGraphConArcList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 0);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 2);
+
+  checkGraphInArcList(adaptor, n1, 2);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    check(adaptor.source(a) == digraph.target(a), "Wrong reverse");
+    check(adaptor.target(a) == digraph.source(a), "Wrong reverse");
+  }
+}
+
+void checkSubDigraph() {
+  checkConcept<concepts::Digraph,
+    SubDigraph<concepts::Digraph,
+    concepts::Digraph::NodeMap<bool>,
+    concepts::Digraph::ArcMap<bool> > >();
+
+  typedef ListDigraph Digraph;
+  typedef Digraph::NodeMap<bool> NodeFilter;
+  typedef Digraph::ArcMap<bool> ArcFilter;
+  typedef SubDigraph<Digraph, NodeFilter, ArcFilter> Adaptor;
+
+  Digraph digraph;
+  NodeFilter node_filter(digraph);
+  ArcFilter arc_filter(digraph);
+  Adaptor adaptor(digraph, node_filter, arc_filter);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
+  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
+  
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 3);
+  checkGraphConArcList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  arc_filter[a2] = false;
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 2);
+  checkGraphConArcList(adaptor, 2);
+
+  checkGraphOutArcList(adaptor, n1, 1);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  node_filter[n1] = false;
+
+  checkGraphNodeList(adaptor, 2);
+  checkGraphArcList(adaptor, 1);
+  checkGraphConArcList(adaptor, 1);
+
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n2, 0);
+  checkGraphInArcList(adaptor, n3, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = false;
+  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = false;
+
+  checkGraphNodeList(adaptor, 0);
+  checkGraphArcList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+}
+
+void checkFilterNodes1() {
+  checkConcept<concepts::Digraph,
+    FilterNodes<concepts::Digraph,
+      concepts::Digraph::NodeMap<bool> > >();
+
+  typedef ListDigraph Digraph;
+  typedef Digraph::NodeMap<bool> NodeFilter;
+  typedef FilterNodes<Digraph, NodeFilter> Adaptor;
+
+  Digraph digraph;
+  NodeFilter node_filter(digraph);
+  Adaptor adaptor(digraph, node_filter);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = true;
+  
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 3);
+  checkGraphConArcList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  node_filter[n1] = false;
+
+  checkGraphNodeList(adaptor, 2);
+  checkGraphArcList(adaptor, 1);
+  checkGraphConArcList(adaptor, 1);
+
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n2, 0);
+  checkGraphInArcList(adaptor, n3, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = false;
+
+  checkGraphNodeList(adaptor, 0);
+  checkGraphArcList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+}
+
+void checkFilterArcs() {
+  checkConcept<concepts::Digraph,
+    FilterArcs<concepts::Digraph,
+    concepts::Digraph::ArcMap<bool> > >();
+
+  typedef ListDigraph Digraph;
+  typedef Digraph::ArcMap<bool> ArcFilter;
+  typedef FilterArcs<Digraph, ArcFilter> Adaptor;
+
+  Digraph digraph;
+  ArcFilter arc_filter(digraph);
+  Adaptor adaptor(digraph, arc_filter);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = true;
+  
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 3);
+  checkGraphConArcList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  arc_filter[a2] = false;
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 2);
+  checkGraphConArcList(adaptor, 2);
+
+  checkGraphOutArcList(adaptor, n1, 1);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  arc_filter[a1] = arc_filter[a2] = arc_filter[a3] = false;
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+}
+
+void checkUndirector() {
+  checkConcept<concepts::Graph, Undirector<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef Undirector<Digraph> Adaptor;
+
+  Digraph digraph;
+  Adaptor adaptor(digraph);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 6);
+  checkGraphEdgeList(adaptor, 3);
+  checkGraphConArcList(adaptor, 6);
+  checkGraphConEdgeList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 2);
+
+  checkGraphInArcList(adaptor, n1, 2);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 2);
+
+  checkGraphIncEdgeList(adaptor, n1, 2);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 2);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  for (Adaptor::EdgeIt e(adaptor); e != INVALID; ++e) {
+    check(adaptor.u(e) == digraph.source(e), "Wrong undir");
+    check(adaptor.v(e) == digraph.target(e), "Wrong undir");
+  }
+
+}
+
+void checkResidual() {
+  checkConcept<concepts::Digraph,
+    Residual<concepts::Digraph,
+    concepts::Digraph::ArcMap<int>,
+    concepts::Digraph::ArcMap<int> > >();
+
+  typedef ListDigraph Digraph;
+  typedef Digraph::ArcMap<int> IntArcMap;
+  typedef Residual<Digraph, IntArcMap> Adaptor;
+
+  Digraph digraph;
+  IntArcMap capacity(digraph), flow(digraph);
+  Adaptor adaptor(digraph, capacity, flow);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+  Digraph::Node n4 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n1, n4);
+  Digraph::Arc a4 = digraph.addArc(n2, n3);
+  Digraph::Arc a5 = digraph.addArc(n2, n4);
+  Digraph::Arc a6 = digraph.addArc(n3, n4);
+
+  capacity[a1] = 8;
+  capacity[a2] = 6;
+  capacity[a3] = 4;
+  capacity[a4] = 4;
+  capacity[a5] = 6;
+  capacity[a6] = 10;
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    flow[a] = 0;
+  }
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 6);
+  checkGraphConArcList(adaptor, 6);
+
+  checkGraphOutArcList(adaptor, n1, 3);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 1);
+  checkGraphOutArcList(adaptor, n4, 0);
+
+  checkGraphInArcList(adaptor, n1, 0);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+  checkGraphInArcList(adaptor, n4, 3);
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    flow[a] = capacity[a] / 2;
+  }
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 12);
+  checkGraphConArcList(adaptor, 12);
+
+  checkGraphOutArcList(adaptor, n1, 3);
+  checkGraphOutArcList(adaptor, n2, 3);
+  checkGraphOutArcList(adaptor, n3, 3);
+  checkGraphOutArcList(adaptor, n4, 3);
+
+  checkGraphInArcList(adaptor, n1, 3);
+  checkGraphInArcList(adaptor, n2, 3);
+  checkGraphInArcList(adaptor, n3, 3);
+  checkGraphInArcList(adaptor, n4, 3);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    flow[a] = capacity[a];
+  }
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 6);
+  checkGraphConArcList(adaptor, 6);
+
+  checkGraphOutArcList(adaptor, n1, 0);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 2);
+  checkGraphOutArcList(adaptor, n4, 3);
+
+  checkGraphInArcList(adaptor, n1, 3);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 1);
+  checkGraphInArcList(adaptor, n4, 0);
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    flow[a] = 0;
+  }
+
+  int flow_value = 0;
+  while (true) {
+
+    Bfs<Adaptor> bfs(adaptor);
+    bfs.run(n1, n4);
+
+    if (!bfs.reached(n4)) break;
+
+    Path<Adaptor> p = bfs.path(n4);
+
+    int min = std::numeric_limits<int>::max();
+    for (Path<Adaptor>::ArcIt a(p); a != INVALID; ++a) {
+      if (adaptor.residualCapacity(a) < min)
+        min = adaptor.residualCapacity(a);
+    }
+
+    for (Path<Adaptor>::ArcIt a(p); a != INVALID; ++a) {
+      adaptor.augment(a, min);
+    }
+    flow_value += min;
+  }
+
+  check(flow_value == 18, "Wrong flow with res graph adaptor");
+
+}
+
+void checkSplitNodes() {
+  checkConcept<concepts::Digraph, SplitNodes<concepts::Digraph> >();
+
+  typedef ListDigraph Digraph;
+  typedef SplitNodes<Digraph> Adaptor;
+
+  Digraph digraph;
+  Adaptor adaptor(digraph);
+
+  Digraph::Node n1 = digraph.addNode();
+  Digraph::Node n2 = digraph.addNode();
+  Digraph::Node n3 = digraph.addNode();
+
+  Digraph::Arc a1 = digraph.addArc(n1, n2);
+  Digraph::Arc a2 = digraph.addArc(n1, n3);
+  Digraph::Arc a3 = digraph.addArc(n2, n3);
+
+  checkGraphNodeList(adaptor, 6);
+  checkGraphArcList(adaptor, 6);
+  checkGraphConArcList(adaptor, 6);
+
+  checkGraphOutArcList(adaptor, adaptor.inNode(n1), 1);
+  checkGraphOutArcList(adaptor, adaptor.outNode(n1), 2);
+  checkGraphOutArcList(adaptor, adaptor.inNode(n2), 1);
+  checkGraphOutArcList(adaptor, adaptor.outNode(n2), 1);
+  checkGraphOutArcList(adaptor, adaptor.inNode(n3), 1);
+  checkGraphOutArcList(adaptor, adaptor.outNode(n3), 0);
+
+  checkGraphInArcList(adaptor, adaptor.inNode(n1), 0);
+  checkGraphInArcList(adaptor, adaptor.outNode(n1), 1);
+  checkGraphInArcList(adaptor, adaptor.inNode(n2), 1);
+  checkGraphInArcList(adaptor, adaptor.outNode(n2), 1);
+  checkGraphInArcList(adaptor, adaptor.inNode(n3), 2);
+  checkGraphInArcList(adaptor, adaptor.outNode(n3), 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+  for (Adaptor::ArcIt a(adaptor); a != INVALID; ++a) {
+    if (adaptor.origArc(a)) {
+      Digraph::Arc oa = a;
+      check(adaptor.source(a) == adaptor.outNode(digraph.source(oa)),
+            "Wrong split");
+      check(adaptor.target(a) == adaptor.inNode(digraph.target(oa)),
+            "Wrong split");
+    } else {
+      Digraph::Node on = a;
+      check(adaptor.source(a) == adaptor.inNode(on), "Wrong split");
+      check(adaptor.target(a) == adaptor.outNode(on), "Wrong split");
+    }
+  }
+}
+
+void checkSubGraph() {
+  checkConcept<concepts::Graph,
+    SubGraph<concepts::Graph,
+    concepts::Graph::NodeMap<bool>,
+    concepts::Graph::EdgeMap<bool> > >();
+
+  typedef ListGraph Graph;
+  typedef Graph::NodeMap<bool> NodeFilter;
+  typedef Graph::EdgeMap<bool> EdgeFilter;
+  typedef SubGraph<Graph, NodeFilter, EdgeFilter> Adaptor;
+
+  Graph graph;
+  NodeFilter node_filter(graph);
+  EdgeFilter edge_filter(graph);
+  Adaptor adaptor(graph, node_filter, edge_filter);
+
+  Graph::Node n1 = graph.addNode();
+  Graph::Node n2 = graph.addNode();
+  Graph::Node n3 = graph.addNode();
+  Graph::Node n4 = graph.addNode();
+
+  Graph::Edge e1 = graph.addEdge(n1, n2);
+  Graph::Edge e2 = graph.addEdge(n1, n3);
+  Graph::Edge e3 = graph.addEdge(n2, n3);
+  Graph::Edge e4 = graph.addEdge(n3, n4);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
+  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
+  
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 8);
+  checkGraphEdgeList(adaptor, 4);
+  checkGraphConArcList(adaptor, 8);
+  checkGraphConEdgeList(adaptor, 4);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 3);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n1, 2);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 3);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n1, 2);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 3);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  edge_filter[e2] = false;
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 6);
+  checkGraphEdgeList(adaptor, 3);
+  checkGraphConArcList(adaptor, 6);
+  checkGraphConEdgeList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 1);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 2);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n1, 1);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 2);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n1, 1);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 2);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  node_filter[n1] = false;
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 4);
+  checkGraphEdgeList(adaptor, 2);
+  checkGraphConArcList(adaptor, 4);
+  checkGraphConEdgeList(adaptor, 2);
+
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 2);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n2, 1);
+  checkGraphIncEdgeList(adaptor, n3, 2);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = false;
+  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = false;
+
+  checkGraphNodeList(adaptor, 0);
+  checkGraphArcList(adaptor, 0);
+  checkGraphEdgeList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+  checkGraphConEdgeList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+}
+
+void checkFilterNodes2() {
+  checkConcept<concepts::Graph,
+    FilterNodes<concepts::Graph,
+      concepts::Graph::NodeMap<bool> > >();
+
+  typedef ListGraph Graph;
+  typedef Graph::NodeMap<bool> NodeFilter;
+  typedef FilterNodes<Graph, NodeFilter> Adaptor;
+
+  Graph graph;
+  NodeFilter node_filter(graph);
+  Adaptor adaptor(graph, node_filter);
+
+  Graph::Node n1 = graph.addNode();
+  Graph::Node n2 = graph.addNode();
+  Graph::Node n3 = graph.addNode();
+  Graph::Node n4 = graph.addNode();
+
+  Graph::Edge e1 = graph.addEdge(n1, n2);
+  Graph::Edge e2 = graph.addEdge(n1, n3);
+  Graph::Edge e3 = graph.addEdge(n2, n3);
+  Graph::Edge e4 = graph.addEdge(n3, n4);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = true;
+  
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 8);
+  checkGraphEdgeList(adaptor, 4);
+  checkGraphConArcList(adaptor, 8);
+  checkGraphConEdgeList(adaptor, 4);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 3);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n1, 2);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 3);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n1, 2);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 3);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  node_filter[n1] = false;
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 4);
+  checkGraphEdgeList(adaptor, 2);
+  checkGraphConArcList(adaptor, 4);
+  checkGraphConEdgeList(adaptor, 2);
+
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 2);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 2);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n2, 1);
+  checkGraphIncEdgeList(adaptor, n3, 2);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  node_filter[n1] = node_filter[n2] = node_filter[n3] = node_filter[n4] = false;
+
+  checkGraphNodeList(adaptor, 0);
+  checkGraphArcList(adaptor, 0);
+  checkGraphEdgeList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+  checkGraphConEdgeList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+}
+
+void checkFilterEdges() {
+  checkConcept<concepts::Graph,
+    FilterEdges<concepts::Graph,
+    concepts::Graph::EdgeMap<bool> > >();
+
+  typedef ListGraph Graph;
+  typedef Graph::EdgeMap<bool> EdgeFilter;
+  typedef FilterEdges<Graph, EdgeFilter> Adaptor;
+
+  Graph graph;
+  EdgeFilter edge_filter(graph);
+  Adaptor adaptor(graph, edge_filter);
+
+  Graph::Node n1 = graph.addNode();
+  Graph::Node n2 = graph.addNode();
+  Graph::Node n3 = graph.addNode();
+  Graph::Node n4 = graph.addNode();
+
+  Graph::Edge e1 = graph.addEdge(n1, n2);
+  Graph::Edge e2 = graph.addEdge(n1, n3);
+  Graph::Edge e3 = graph.addEdge(n2, n3);
+  Graph::Edge e4 = graph.addEdge(n3, n4);
+
+  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = true;
+  
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 8);
+  checkGraphEdgeList(adaptor, 4);
+  checkGraphConArcList(adaptor, 8);
+  checkGraphConEdgeList(adaptor, 4);
+
+  checkGraphOutArcList(adaptor, n1, 2);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 3);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n1, 2);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 3);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n1, 2);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 3);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  edge_filter[e2] = false;
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 6);
+  checkGraphEdgeList(adaptor, 3);
+  checkGraphConArcList(adaptor, 6);
+  checkGraphConEdgeList(adaptor, 3);
+
+  checkGraphOutArcList(adaptor, n1, 1);
+  checkGraphOutArcList(adaptor, n2, 2);
+  checkGraphOutArcList(adaptor, n3, 2);
+  checkGraphOutArcList(adaptor, n4, 1);
+
+  checkGraphInArcList(adaptor, n1, 1);
+  checkGraphInArcList(adaptor, n2, 2);
+  checkGraphInArcList(adaptor, n3, 2);
+  checkGraphInArcList(adaptor, n4, 1);
+
+  checkGraphIncEdgeList(adaptor, n1, 1);
+  checkGraphIncEdgeList(adaptor, n2, 2);
+  checkGraphIncEdgeList(adaptor, n3, 2);
+  checkGraphIncEdgeList(adaptor, n4, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+
+  edge_filter[e1] = edge_filter[e2] = edge_filter[e3] = edge_filter[e4] = false;
+
+  checkGraphNodeList(adaptor, 4);
+  checkGraphArcList(adaptor, 0);
+  checkGraphEdgeList(adaptor, 0);
+  checkGraphConArcList(adaptor, 0);
+  checkGraphConEdgeList(adaptor, 0);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+  checkEdgeIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+  checkGraphEdgeMap(adaptor);
+}
+
+void checkOrienter() {
+  checkConcept<concepts::Digraph,
+    Orienter<concepts::Graph, concepts::Graph::EdgeMap<bool> > >();
+
+  typedef ListGraph Graph;
+  typedef ListGraph::EdgeMap<bool> DirMap;
+  typedef Orienter<Graph> Adaptor;
+
+  Graph graph;
+  DirMap dir(graph, true);
+  Adaptor adaptor(graph, dir);
+
+  Graph::Node n1 = graph.addNode();
+  Graph::Node n2 = graph.addNode();
+  Graph::Node n3 = graph.addNode();
+
+  Graph::Edge e1 = graph.addEdge(n1, n2);
+  Graph::Edge e2 = graph.addEdge(n1, n3);
+  Graph::Edge e3 = graph.addEdge(n2, n3);
+
+  checkGraphNodeList(adaptor, 3);
+  checkGraphArcList(adaptor, 3);
+  checkGraphConArcList(adaptor, 3);
+
+  {
+    dir[e1] = true;
+    Adaptor::Node u = adaptor.source(e1);
+    Adaptor::Node v = adaptor.target(e1);
+
+    dir[e1] = false;
+    check (u == adaptor.target(e1), "Wrong dir");
+    check (v == adaptor.source(e1), "Wrong dir");
+
+    check ((u == n1 && v == n2) || (u == n2 && v == n1), "Wrong dir");
+    dir[e1] = n1 == u;
+  }
+
+  {
+    dir[e2] = true;
+    Adaptor::Node u = adaptor.source(e2);
+    Adaptor::Node v = adaptor.target(e2);
+
+    dir[e2] = false;
+    check (u == adaptor.target(e2), "Wrong dir");
+    check (v == adaptor.source(e2), "Wrong dir");
+
+    check ((u == n1 && v == n3) || (u == n3 && v == n1), "Wrong dir");
+    dir[e2] = n3 == u;
+  }
+
+  {
+    dir[e3] = true;
+    Adaptor::Node u = adaptor.source(e3);
+    Adaptor::Node v = adaptor.target(e3);
+
+    dir[e3] = false;
+    check (u == adaptor.target(e3), "Wrong dir");
+    check (v == adaptor.source(e3), "Wrong dir");
+
+    check ((u == n2 && v == n3) || (u == n3 && v == n2), "Wrong dir");
+    dir[e3] = n2 == u;
+  }
+
+  checkGraphOutArcList(adaptor, n1, 1);
+  checkGraphOutArcList(adaptor, n2, 1);
+  checkGraphOutArcList(adaptor, n3, 1);
+
+  checkGraphInArcList(adaptor, n1, 1);
+  checkGraphInArcList(adaptor, n2, 1);
+  checkGraphInArcList(adaptor, n3, 1);
+
+  checkNodeIds(adaptor);
+  checkArcIds(adaptor);
+
+  checkGraphNodeMap(adaptor);
+  checkGraphArcMap(adaptor);
+
+}
+
+
+int main(int, const char **) {
+
+  checkReverseDigraph();
+  checkSubDigraph();
+  checkFilterNodes1();
+  checkFilterArcs();
+  checkUndirector();
+  checkResidual();
+  checkSplitNodes();
+
+  checkSubGraph();
+  checkFilterNodes2();
+  checkFilterEdges();
+  checkOrienter();
+
+  return 0;
+}
Index: test/graph_copy_test.cc
===================================================================
--- test/graph_copy_test.cc	(revision 440)
+++ test/graph_copy_test.cc	(revision 282)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/graph_test.cc
===================================================================
--- test/graph_test.cc	(revision 440)
+++ test/graph_test.cc	(revision 375)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/graph_test.h
===================================================================
--- test/graph_test.h	(revision 440)
+++ test/graph_test.h	(revision 374)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/graph_utils_test.cc
===================================================================
--- test/graph_utils_test.cc	(revision 440)
+++ test/graph_utils_test.cc	(revision 220)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/hao_orlin_test.cc
===================================================================
--- test/hao_orlin_test.cc	(revision 440)
+++ test/hao_orlin_test.cc	(revision 410)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/heap_test.cc
===================================================================
--- test/heap_test.cc	(revision 440)
+++ test/heap_test.cc	(revision 293)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/kruskal_test.cc
===================================================================
--- test/kruskal_test.cc	(revision 440)
+++ test/kruskal_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 462)
+++ 	(revision )
@@ -1,403 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include <sstream>
-#include <lemon/lp_skeleton.h>
-#include "test_tools.h"
-#include <lemon/tolerance.h>
-
-#ifdef HAVE_CONFIG_H
-#include <lemon/config.h>
-#endif
-
-#ifdef HAVE_GLPK
-#include <lemon/glpk.h>
-#endif
-
-#ifdef HAVE_CPLEX
-#include <lemon/cplex.h>
-#endif
-
-#ifdef HAVE_SOPLEX
-#include <lemon/soplex.h>
-#endif
-
-#ifdef HAVE_CLP
-#include <lemon/clp.h>
-#endif
-
-using namespace lemon;
-
-void lpTest(LpSolver& lp)
-{
-
-  typedef LpSolver LP;
-
-  std::vector<LP::Col> x(10);
-  //  for(int i=0;i<10;i++) x.push_back(lp.addCol());
-  lp.addColSet(x);
-  lp.colLowerBound(x,1);
-  lp.colUpperBound(x,1);
-  lp.colBounds(x,1,2);
-
-  std::vector<LP::Col> y(10);
-  lp.addColSet(y);
-
-  lp.colLowerBound(y,1);
-  lp.colUpperBound(y,1);
-  lp.colBounds(y,1,2);
-
-  std::map<int,LP::Col> z;
-
-  z.insert(std::make_pair(12,INVALID));
-  z.insert(std::make_pair(2,INVALID));
-  z.insert(std::make_pair(7,INVALID));
-  z.insert(std::make_pair(5,INVALID));
-
-  lp.addColSet(z);
-
-  lp.colLowerBound(z,1);
-  lp.colUpperBound(z,1);
-  lp.colBounds(z,1,2);
-
-  {
-    LP::Expr e,f,g;
-    LP::Col p1,p2,p3,p4,p5;
-    LP::Constr c;
-
-    p1=lp.addCol();
-    p2=lp.addCol();
-    p3=lp.addCol();
-    p4=lp.addCol();
-    p5=lp.addCol();
-
-    e[p1]=2;
-    *e=12;
-    e[p1]+=2;
-    *e+=12;
-    e[p1]-=2;
-    *e-=12;
-
-    e=2;
-    e=2.2;
-    e=p1;
-    e=f;
-
-    e+=2;
-    e+=2.2;
-    e+=p1;
-    e+=f;
-
-    e-=2;
-    e-=2.2;
-    e-=p1;
-    e-=f;
-
-    e*=2;
-    e*=2.2;
-    e/=2;
-    e/=2.2;
-
-    e=((p1+p2)+(p1-p2)+(p1+12)+(12+p1)+(p1-12)+(12-p1)+
-       (f+12)+(12+f)+(p1+f)+(f+p1)+(f+g)+
-       (f-12)+(12-f)+(p1-f)+(f-p1)+(f-g)+
-       2.2*f+f*2.2+f/2.2+
-       2*f+f*2+f/2+
-       2.2*p1+p1*2.2+p1/2.2+
-       2*p1+p1*2+p1/2
-       );
-
-
-    c = (e  <= f  );
-    c = (e  <= 2.2);
-    c = (e  <= 2  );
-    c = (e  <= p1 );
-    c = (2.2<= f  );
-    c = (2  <= f  );
-    c = (p1 <= f  );
-    c = (p1 <= p2 );
-    c = (p1 <= 2.2);
-    c = (p1 <= 2  );
-    c = (2.2<= p2 );
-    c = (2  <= p2 );
-
-    c = (e  >= f  );
-    c = (e  >= 2.2);
-    c = (e  >= 2  );
-    c = (e  >= p1 );
-    c = (2.2>= f  );
-    c = (2  >= f  );
-    c = (p1 >= f  );
-    c = (p1 >= p2 );
-    c = (p1 >= 2.2);
-    c = (p1 >= 2  );
-    c = (2.2>= p2 );
-    c = (2  >= p2 );
-
-    c = (e  == f  );
-    c = (e  == 2.2);
-    c = (e  == 2  );
-    c = (e  == p1 );
-    c = (2.2== f  );
-    c = (2  == f  );
-    c = (p1 == f  );
-    //c = (p1 == p2 );
-    c = (p1 == 2.2);
-    c = (p1 == 2  );
-    c = (2.2== p2 );
-    c = (2  == p2 );
-
-    c = ((2 <= e) <= 3);
-    c = ((2 <= p1) <= 3);
-
-    c = ((2 >= e) >= 3);
-    c = ((2 >= p1) >= 3);
-
-    e[x[3]]=2;
-    e[x[3]]=4;
-    e[x[3]]=1;
-    *e=12;
-
-    lp.addRow(-LP::INF,e,23);
-    lp.addRow(-LP::INF,3.0*(x[1]+x[2]/2)-x[3],23);
-    lp.addRow(-LP::INF,3.0*(x[1]+x[2]*2-5*x[3]+12-x[4]/3)+2*x[4]-4,23);
-
-    lp.addRow(x[1]+x[3]<=x[5]-3);
-    lp.addRow((-7<=x[1]+x[3]-12)<=3);
-    lp.addRow(x[1]<=x[5]);
-
-    std::ostringstream buf;
-
-
-    e=((p1+p2)+(p1-0.99*p2));
-    //e.prettyPrint(std::cout);
-    //(e<=2).prettyPrint(std::cout);
-    double tolerance=0.001;
-    e.simplify(tolerance);
-    buf << "Coeff. of p2 should be 0.01";
-    check(e[p2]>0, buf.str());
-
-    tolerance=0.02;
-    e.simplify(tolerance);
-    buf << "Coeff. of p2 should be 0";
-    check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
-
-
-  }
-
-  {
-    LP::DualExpr e,f,g;
-    LP::Row p1 = INVALID, p2 = INVALID, p3 = INVALID,
-      p4 = INVALID, p5 = INVALID;
-
-    e[p1]=2;
-    e[p1]+=2;
-    e[p1]-=2;
-
-    e=p1;
-    e=f;
-
-    e+=p1;
-    e+=f;
-
-    e-=p1;
-    e-=f;
-
-    e*=2;
-    e*=2.2;
-    e/=2;
-    e/=2.2;
-
-    e=((p1+p2)+(p1-p2)+
-       (p1+f)+(f+p1)+(f+g)+
-       (p1-f)+(f-p1)+(f-g)+
-       2.2*f+f*2.2+f/2.2+
-       2*f+f*2+f/2+
-       2.2*p1+p1*2.2+p1/2.2+
-       2*p1+p1*2+p1/2
-       );
-  }
-
-}
-
-void solveAndCheck(LpSolver& lp, LpSolver::ProblemType stat,
-                   double exp_opt) {
-  using std::string;
-  lp.solve();
-
-  std::ostringstream buf;
-  buf << "PrimalType should be: " << int(stat) << int(lp.primalType());
-
-  check(lp.primalType()==stat, buf.str());
-
-  if (stat ==  LpSolver::OPTIMAL) {
-    std::ostringstream sbuf;
-    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
-    check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
-  }
-}
-
-void aTest(LpSolver & lp)
-{
-  typedef LpSolver LP;
-
- //The following example is very simple
-
-  typedef LpSolver::Row Row;
-  typedef LpSolver::Col Col;
-
-
-  Col x1 = lp.addCol();
-  Col x2 = lp.addCol();
-
-
-  //Constraints
-  Row upright=lp.addRow(x1+2*x2 <=1);
-  lp.addRow(x1+x2 >=-1);
-  lp.addRow(x1-x2 <=1);
-  lp.addRow(x1-x2 >=-1);
-  //Nonnegativity of the variables
-  lp.colLowerBound(x1, 0);
-  lp.colLowerBound(x2, 0);
-  //Objective function
-  lp.obj(x1+x2);
-
-  lp.sense(lp.MAX);
-
-  //Testing the problem retrieving routines
-  check(lp.objCoeff(x1)==1,"First term should be 1 in the obj function!");
-  check(lp.sense() == lp.MAX,"This is a maximization!");
-  check(lp.coeff(upright,x1)==1,"The coefficient in question is 1!");
-  check(lp.colLowerBound(x1)==0,
-        "The lower bound for variable x1 should be 0.");
-  check(lp.colUpperBound(x1)==LpSolver::INF,
-        "The upper bound for variable x1 should be infty.");
-  check(lp.rowLowerBound(upright) == -LpSolver::INF,
-        "The lower bound for the first row should be -infty.");
-  check(lp.rowUpperBound(upright)==1,
-        "The upper bound for the first row should be 1.");
-  LpSolver::Expr e = lp.row(upright);
-  check(e[x1] == 1, "The first coefficient should 1.");
-  check(e[x2] == 2, "The second coefficient should 1.");
-
-  lp.row(upright, x1+x2 <=1);
-  e = lp.row(upright);
-  check(e[x1] == 1, "The first coefficient should 1.");
-  check(e[x2] == 1, "The second coefficient should 1.");
-
-  LpSolver::DualExpr de = lp.col(x1);
-  check(  de[upright] == 1, "The first coefficient should 1.");
-
-  LpSolver* clp = lp.cloneSolver();
-
-  //Testing the problem retrieving routines
-  check(clp->objCoeff(x1)==1,"First term should be 1 in the obj function!");
-  check(clp->sense() == clp->MAX,"This is a maximization!");
-  check(clp->coeff(upright,x1)==1,"The coefficient in question is 1!");
-  //  std::cout<<lp.colLowerBound(x1)<<std::endl;
-  check(clp->colLowerBound(x1)==0,
-        "The lower bound for variable x1 should be 0.");
-  check(clp->colUpperBound(x1)==LpSolver::INF,
-        "The upper bound for variable x1 should be infty.");
-
-  check(lp.rowLowerBound(upright)==-LpSolver::INF,
-        "The lower bound for the first row should be -infty.");
-  check(lp.rowUpperBound(upright)==1,
-        "The upper bound for the first row should be 1.");
-  e = clp->row(upright);
-  check(e[x1] == 1, "The first coefficient should 1.");
-  check(e[x2] == 1, "The second coefficient should 1.");
-
-  de = clp->col(x1);
-  check(de[upright] == 1, "The first coefficient should 1.");
-
-  delete clp;
-
-  //Maximization of x1+x2
-  //over the triangle with vertices (0,0) (0,1) (1,0)
-  double expected_opt=1;
-  solveAndCheck(lp, LpSolver::OPTIMAL, expected_opt);
-
-  //Minimization
-  lp.sense(lp.MIN);
-  expected_opt=0;
-  solveAndCheck(lp, LpSolver::OPTIMAL, expected_opt);
-
-  //Vertex (-1,0) instead of (0,0)
-  lp.colLowerBound(x1, -LpSolver::INF);
-  expected_opt=-1;
-  solveAndCheck(lp, LpSolver::OPTIMAL, expected_opt);
-
-  //Erase one constraint and return to maximization
-  lp.erase(upright);
-  lp.sense(lp.MAX);
-  expected_opt=LpSolver::INF;
-  solveAndCheck(lp, LpSolver::UNBOUNDED, expected_opt);
-
-  //Infeasibilty
-  lp.addRow(x1+x2 <=-2);
-  solveAndCheck(lp, LpSolver::INFEASIBLE, expected_opt);
-
-}
-
-int main()
-{
-  LpSkeleton lp_skel;
-  lpTest(lp_skel);
-
-#ifdef HAVE_GLPK
-  {
-    GlpkLp lp_glpk1,lp_glpk2;
-    lpTest(lp_glpk1);
-    aTest(lp_glpk2);
-  }
-#endif
-
-#ifdef HAVE_CPLEX
-  try {
-    CplexLp lp_cplex1,lp_cplex2;
-    lpTest(lp_cplex1);
-    aTest(lp_cplex2);
-  } catch (CplexEnv::LicenseError& error) {
-#ifdef LEMON_FORCE_CPLEX_CHECK
-    check(false, error.what());
-#else
-    std::cerr << error.what() << std::endl;
-    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
-#endif
-  }
-#endif
-
-#ifdef HAVE_SOPLEX
-  {
-    SoplexLp lp_soplex1,lp_soplex2;
-    lpTest(lp_soplex1);
-    aTest(lp_soplex2);
-  }
-#endif
-
-#ifdef HAVE_CLP
-  {
-    ClpLp lp_clp1,lp_clp2;
-    lpTest(lp_clp1);
-    aTest(lp_clp2);
-  }
-#endif
-
-  return 0;
-}
Index: test/maps_test.cc
===================================================================
--- test/maps_test.cc	(revision 440)
+++ test/maps_test.cc	(revision 210)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/max_matching_test.cc
===================================================================
--- test/max_matching_test.cc	(revision 440)
+++ test/max_matching_test.cc	(revision 327)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/min_cost_flow_test.lgf
===================================================================
--- test/min_cost_flow_test.lgf	(revision 345)
+++ test/min_cost_flow_test.lgf	(revision 345)
@@ -0,0 +1,44 @@
+@nodes
+label	supply1	supply2	supply3
+1	0	20	27	
+2	0	-4	0		
+3	0	0	0	
+4	0	0	0	
+5	0	9	0	
+6	0	-6	0	
+7	0	0	0	
+8	0	0	0	
+9	0	3	0	
+10	0	-2	0	
+11	0	0	0		
+12	0	-20	-27	
+               
+@arcs
+		cost	capacity	lower1	lower2
+1	2	70	11		0	8
+1	3	150	3		0	1
+1	4	80	15		0	2
+2	8	80	12		0	0
+3	5	140	5		0	3
+4	6	60	10		0	1
+4	7	80	2		0	0
+4	8	110	3		0	0
+5	7	60	14		0	0
+5	11	120	12		0	0
+6	3	0	3		0	0
+6	9	140	4		0	0
+6	10	90	8		0	0
+7	1	30	5		0	0
+8	12	60	16		0	4
+9	12	50	6		0	0
+10	12	70	13		0	5
+10	2	100	7		0	0
+10	7	60	10		0	0
+11	10	20	14		0	6
+12	11	30	10		0	0
+
+@attributes
+source	1
+target	12
+
+@end
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 462)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include "test_tools.h"
-
-
-#ifdef HAVE_CONFIG_H
-#include <lemon/config.h>
-#endif
-
-#ifdef HAVE_CPLEX
-#include <lemon/cplex.h>
-#endif
-
-#ifdef HAVE_GLPK
-#include <lemon/glpk.h>
-#endif
-
-
-using namespace lemon;
-
-void solveAndCheck(MipSolver& mip, MipSolver::ProblemType stat,
-                   double exp_opt) {
-  using std::string;
-
-  mip.solve();
-  //int decimal,sign;
-  std::ostringstream buf;
-  buf << "Type should be: " << int(stat)<<" and it is "<<int(mip.type());
-
-
-  //  itoa(stat,buf1, 10);
-  check(mip.type()==stat, buf.str());
-
-  if (stat ==  MipSolver::OPTIMAL) {
-    std::ostringstream sbuf;
-    buf << "Wrong optimal value: the right optimum is " << exp_opt;
-    check(std::abs(mip.solValue()-exp_opt) < 1e-3, sbuf.str());
-    //+ecvt(exp_opt,2)
-  }
-}
-
-void aTest(MipSolver& mip)
-{
- //The following example is very simple
-
-
-  typedef MipSolver::Row Row;
-  typedef MipSolver::Col Col;
-
-
-
-  Col x1 = mip.addCol();
-  Col x2 = mip.addCol();
-
-
-  //Objective function
-  mip.obj(x1);
-
-  mip.max();
-
-
-  //Unconstrained optimization
-  mip.solve();
-  //Check it out!
-
-  //Constraints
-  mip.addRow(2*x1+x2 <=2);
-  mip.addRow(x1-2*x2 <=0);
-
-  //Nonnegativity of the variable x1
-  mip.colLowerBound(x1, 0);
-
-  //Maximization of x1
-  //over the triangle with vertices (0,0),(4/5,2/5),(0,2)
-  double expected_opt=4.0/5.0;
-  solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
-
-  //Restrict x2 to integer
-  mip.colType(x2,MipSolver::INTEGER);
-  expected_opt=1.0/2.0;
-  solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
-
-
-  //Restrict both to integer
-  mip.colType(x1,MipSolver::INTEGER);
-  expected_opt=0;
-  solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
-
-
-
-}
-
-
-int main()
-{
-
-#ifdef HAVE_GLPK
-  {
-    GlpkMip mip1;
-    aTest(mip1);
-  }
-#endif
-
-#ifdef HAVE_CPLEX
-  try {
-    CplexMip mip2;
-    aTest(mip2);
-  } catch (CplexEnv::LicenseError& error) {
-#ifdef LEMON_FORCE_CPLEX_CHECK
-    check(false, error.what());
-#else
-    std::cerr << error.what() << std::endl;
-    std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
-#endif
-  }
-#endif
-
-  return 0;
-
-}
Index: test/path_test.cc
===================================================================
--- test/path_test.cc	(revision 440)
+++ test/path_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/preflow_graph.lgf
===================================================================
--- test/preflow_graph.lgf	(revision 394)
+++ test/preflow_graph.lgf	(revision 394)
@@ -0,0 +1,34 @@
+@nodes
+label
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+@arcs
+		label	capacity
+0	1	0	20
+0	2	1	0
+1	1	2	3
+1	2	3	8
+1	3	4	8
+2	5	5	5
+3	2	6	5
+3	5	7	5
+3	6	8	5
+4	3	9	3
+5	7	10	3
+5	6	11	10
+5	8	12	10
+6	8	13	8
+8	9	14	20
+8	1	15	5
+9	5	16	5
+@attributes
+source 1
+target 8
Index: test/preflow_test.cc
===================================================================
--- test/preflow_test.cc	(revision 440)
+++ test/preflow_test.cc	(revision 394)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -17,5 +17,6 @@
  */
 
-#include <iostream>
+#include <fstream>
+#include <string>
 
 #include "test_tools.h"
@@ -28,40 +29,4 @@
 
 using namespace lemon;
-
-char test_lgf[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "8\n"
-  "9\n"
-  "@arcs\n"
-  "    label capacity\n"
-  "0 1 0     20\n"
-  "0 2 1     0\n"
-  "1 1 2     3\n"
-  "1 2 3     8\n"
-  "1 3 4     8\n"
-  "2 5 5     5\n"
-  "3 2 6     5\n"
-  "3 5 7     5\n"
-  "3 6 8     5\n"
-  "4 3 9     3\n"
-  "5 7 10    3\n"
-  "5 6 11    10\n"
-  "5 8 12    10\n"
-  "6 8 13    8\n"
-  "8 9 14    20\n"
-  "8 1 15    5\n"
-  "9 5 16    5\n"
-  "@attributes\n"
-  "source 1\n"
-  "target 8\n";
 
 void checkPreflowCompile()
@@ -159,9 +124,18 @@
   typedef Preflow<Digraph, CapMap> PType;
 
+  std::string f_name;
+  if( getenv("srcdir") )
+    f_name = std::string(getenv("srcdir"));
+  else f_name = ".";
+  f_name += "/test/preflow_graph.lgf";
+
+  std::ifstream file(f_name.c_str());
+
+  check(file, "Input file '" << f_name << "' not found.");
+
   Digraph g;
   Node s, t;
   CapMap cap(g);
-  std::istringstream input(test_lgf);
-  DigraphReader<Digraph>(g,input).
+  DigraphReader<Digraph>(g,file).
     arcMap("capacity", cap).
     node("source",s).
Index: test/radix_sort_test.cc
===================================================================
--- test/radix_sort_test.cc	(revision 444)
+++ 	(revision )
@@ -1,147 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2009
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include <lemon/time_measure.h>
-#include <lemon/smart_graph.h>
-#include <lemon/maps.h>
-#include <lemon/radix_sort.h>
-#include <lemon/math.h>
-
-#include "test_tools.h"
-
-#include <vector>
-#include <algorithm>
-
-using namespace lemon;
-
-static const int n = 10000;
-
-struct Negate {
-  typedef int argument_type;
-  typedef int result_type;
-  int operator()(int a) { return - a; }
-};
-
-int negate(int a) { return - a; }
-
-
-void generateIntSequence(int n, std::vector<int>& data) {
-  int prime = 9973;
-  int root = 136, value = 1;
-  for (int i = 0; i < n; ++i) {
-    data.push_back(value - prime / 2);
-    value = (value * root) % prime;
-  }
-}
-
-void generateCharSequence(int n, std::vector<unsigned char>& data) {
-  int prime = 251;
-  int root = 3, value = root;
-  for (int i = 0; i < n; ++i) {
-    data.push_back(static_cast<unsigned char>(value));
-    value = (value * root) % prime;
-  }
-}
-
-void checkRadixSort() {
-  {
-    std::vector<int> data1;
-    generateIntSequence(n, data1);
-
-    std::vector<int> data2(data1);
-    std::sort(data1.begin(), data1.end());
-
-    radixSort(data2.begin(), data2.end());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[i], "Test failed");
-    }
-
-    radixSort(data2.begin(), data2.end(), Negate());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[n - 1 - i], "Test failed");
-    }
-
-    radixSort(data2.begin(), data2.end(), negate);
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[n - 1 - i], "Test failed");
-    }
-
-  }
-
-  {
-    std::vector<unsigned char> data1(n);
-    generateCharSequence(n, data1);
-
-    std::vector<unsigned char> data2(data1);
-    std::sort(data1.begin(), data1.end());
-
-    radixSort(data2.begin(), data2.end());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[i], "Test failed");
-    }
-
-  }
-}
-
-
-void checkStableRadixSort() {
-  {
-    std::vector<int> data1;
-    generateIntSequence(n, data1);
-
-    std::vector<int> data2(data1);
-    std::sort(data1.begin(), data1.end());
-
-    stableRadixSort(data2.begin(), data2.end());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[i], "Test failed");
-    }
-
-    stableRadixSort(data2.begin(), data2.end(), Negate());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[n - 1 - i], "Test failed");
-    }
-
-    stableRadixSort(data2.begin(), data2.end(), negate);
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[n - 1 - i], "Test failed");
-    }
-  }
-
-  {
-    std::vector<unsigned char> data1(n);
-    generateCharSequence(n, data1);
-
-    std::vector<unsigned char> data2(data1);
-    std::sort(data1.begin(), data1.end());
-
-    radixSort(data2.begin(), data2.end());
-    for (int i = 0; i < n; ++i) {
-      check(data1[i] == data2[i], "Test failed");
-    }
-
-  }
-}
-
-int main() {
-
-  checkRadixSort();
-  checkStableRadixSort();
-
-  return 0;
-}
Index: test/random_test.cc
===================================================================
--- test/random_test.cc	(revision 440)
+++ test/random_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/suurballe_test.cc
===================================================================
--- test/suurballe_test.cc	(revision 440)
+++ test/suurballe_test.cc	(revision 346)
@@ -1,7 +1,7 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
+/* -*- C++ -*-
  *
- * This file is a part of LEMON, a generic C++ optimization library.
+ * This file is a part of LEMON, a generic C++ optimization library
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -18,4 +18,5 @@
 
 #include <iostream>
+#include <fstream>
 
 #include <lemon/list_graph.h>
@@ -28,50 +29,7 @@
 using namespace lemon;
 
-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"
-  "@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"
-  "@attributes\n"
-  "source  1\n"
-  "target 12\n"
-  "@end\n";
-
 // Check the feasibility of the flow
 template <typename Digraph, typename FlowMap>
-bool checkFlow( const Digraph& gr, const FlowMap& flow,
+bool checkFlow( const Digraph& gr, const FlowMap& flow, 
                 typename Digraph::Node s, typename Digraph::Node t,
                 int value )
@@ -96,5 +54,5 @@
 
 // Check the optimalitiy of the flow
-template < typename Digraph, typename CostMap,
+template < typename Digraph, typename CostMap, 
            typename FlowMap, typename PotentialMap >
 bool checkOptimality( const Digraph& gr, const CostMap& cost,
@@ -139,5 +97,12 @@
   Node source, target;
 
-  std::istringstream input(test_lgf);
+  std::string fname;
+  if(getenv("srcdir"))
+    fname = std::string(getenv("srcdir"));
+  else fname = ".";
+  fname += "/test/min_cost_flow_test.lgf";
+
+  std::ifstream input(fname.c_str());
+  check(input, "Input file '" << fname << "' not found");
   DigraphReader<ListDigraph>(digraph, input).
     arcMap("cost", length).
@@ -145,5 +110,6 @@
     node("target", target).
     run();
-
+  input.close();
+  
   // Find 2 paths
   {
@@ -153,5 +119,5 @@
           "The flow is not feasible");
     check(suurballe.totalLength() == 510, "The flow is not optimal");
-    check(checkOptimality(digraph, length, suurballe.flowMap(),
+    check(checkOptimality(digraph, length, suurballe.flowMap(), 
                           suurballe.potentialMap()),
           "Wrong potentials");
@@ -168,5 +134,5 @@
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
-    check(checkOptimality(digraph, length, suurballe.flowMap(),
+    check(checkOptimality(digraph, length, suurballe.flowMap(), 
                           suurballe.potentialMap()),
           "Wrong potentials");
@@ -183,5 +149,5 @@
           "The flow is not feasible");
     check(suurballe.totalLength() == 1040, "The flow is not optimal");
-    check(checkOptimality(digraph, length, suurballe.flowMap(),
+    check(checkOptimality(digraph, length, suurballe.flowMap(), 
                           suurballe.potentialMap()),
           "Wrong potentials");
Index: test/test_tools.h
===================================================================
--- test/test_tools.h	(revision 440)
+++ test/test_tools.h	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/test_tools_fail.cc
===================================================================
--- test/test_tools_fail.cc	(revision 440)
+++ test/test_tools_fail.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/test_tools_pass.cc
===================================================================
--- test/test_tools_pass.cc	(revision 440)
+++ test/test_tools_pass.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/time_measure_test.cc
===================================================================
--- test/time_measure_test.cc	(revision 440)
+++ test/time_measure_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: test/unionfind_test.cc
===================================================================
--- test/unionfind_test.cc	(revision 440)
+++ test/unionfind_test.cc	(revision 209)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
