Index: .hgignore
===================================================================
--- .hgignore	(revision 563)
+++ .hgignore	(revision 517)
@@ -23,5 +23,5 @@
 lemon/stamp-h2
 doc/Doxyfile
-cmake/version.cmake
+cmake/cmake.version
 .dirstamp
 .libs/*
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 552)
+++ CMakeLists.txt	(revision 527)
@@ -10,5 +10,5 @@
 PROJECT(${PROJECT_NAME})
 
-SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
 INCLUDE(FindDoxygen)
@@ -39,77 +39,73 @@
 
 ADD_SUBDIRECTORY(lemon)
-IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
-  ADD_SUBDIRECTORY(demo)
-  ADD_SUBDIRECTORY(tools)
-  ADD_SUBDIRECTORY(doc)
-  ADD_SUBDIRECTORY(test)
-ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
+ADD_SUBDIRECTORY(demo)
+ADD_SUBDIRECTORY(tools)
+ADD_SUBDIRECTORY(doc)
+ADD_SUBDIRECTORY(test)
 
-IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
-  IF(WIN32)
-    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-    SET(CPACK_PACKAGE_VENDOR "EGRES")
-    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
-      "LEMON - Library of Efficient Models and Optimization in Networks")
-    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
+IF(WIN32)
+  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+  SET(CPACK_PACKAGE_VENDOR "EGRES")
+  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+    "LEMON - Library of Efficient Models and Optimization in Networks")
+  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
 
-    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 
-    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
-      "${PROJECT_NAME} ${PROJECT_VERSION}")
-    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
-      "${PROJECT_NAME} ${PROJECT_VERSION}")
+  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
+    "${PROJECT_NAME} ${PROJECT_VERSION}")
+  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
+    "${PROJECT_NAME} ${PROJECT_VERSION}")
 
-    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
+  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
 
-    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
-    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
-    SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
+  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
+  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
+  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
 
-    SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
-      "C++ header files")
-    SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
-      "DLL and import library")
-    SET(CPACK_COMPONENT_BIN_DESCRIPTION
-      "Command line utilities")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
-      "Doxygen generated documentation")
+  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
+    "C++ header files")
+  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
+    "DLL and import library")
+  SET(CPACK_COMPONENT_BIN_DESCRIPTION
+    "Command line utilities")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
+    "Doxygen generated documentation")
 
-    SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
+  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
 
-    SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
-    SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
+  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
+  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
 
-    SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
-      "Components needed to develop software using LEMON")
-    SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
-      "Documentation of LEMON")
+  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
+    "Components needed to develop software using LEMON")
+  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
+    "Documentation of LEMON")
 
-    SET(CPACK_ALL_INSTALL_TYPES Full Developer)
+  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
 
-    SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
-    SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
-    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
+  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
+  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
+  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
 
-    SET(CPACK_GENERATOR "NSIS")
-    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
-    SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
-    #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
-    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
-    SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
-    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
-    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
-    SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
-    SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
-      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
-      ")
-    SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
-      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
-      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
-      ")
+  SET(CPACK_GENERATOR "NSIS")
+  SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
+  SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
+  #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
+  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
+  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
+  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
+  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
+  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
+  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
+    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
+    ")
+  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
+    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
+    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
+    ")
 
-    INCLUDE(CPack)
-  ENDIF(WIN32)
-ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
+  INCLUDE(CPack)
+ENDIF(WIN32)
Index: INSTALL
===================================================================
--- INSTALL	(revision 568)
+++ INSTALL	(revision 318)
@@ -5,10 +5,4 @@
 tarballs and successfully extracted it. The latest version of LEMON is
 available at our web page (http://lemon.cs.elte.hu/).
-
-LEMON provides two different build environments, one is based on "autotool",
-while the other is based on "cmake". This file contains instructions only for
-the former one, which is the recommended build environment on Linux, Mac OSX
-and other unices or if you use Cygwin on Windows. For cmake installation
-instructions visit http://lemon.cs.elte.hu.
 
 In order to install LEMON from the extracted source tarball you have to
@@ -28,6 +22,6 @@
 
       This command compiles the non-template part of LEMON into libemon.a
-      file. It also compiles the programs in the tools subdirectory by
-      default.
+      file. It also compiles the programs in the tools and demo subdirectories
+      when enabled.
 
    4. `make check'
@@ -75,4 +69,12 @@
 
   Set the installation prefix to PREFIX. By default it is /usr/local.
+
+--enable-demo
+
+   Build the examples in the demo subdirectory.
+
+--disable-demo
+
+   Do not build the examples in the demo subdirectory (default).
 
 --enable-tools
@@ -151,25 +153,2 @@
 
    Disable SoPlex support.
-
---with-coin[=PREFIX]
-
-   Enable support for COIN-OR solvers (CLP and CBC). You should
-   specify the prefix too. (by default, COIN-OR tools install
-   themselves to the source code directory). This command enables the
-   solvers that are actually found.
-
---with-coin-includedir=DIR
-
-   The directory where the COIN-OR header files are located. This is
-   only useful when the COIN-OR headers and libraries are not under
-   the same prefix (which is unlikely).
-
---with-coin-libdir=DIR
-
-   The directory where the COIN-OR libraries are located. This is only
-   useful when the COIN-OR headers and libraries are not under the
-   same prefix (which is unlikely).
-
---without-coin
-
-   Disable COIN-OR support.
Index: LICENSE
===================================================================
--- LICENSE	(revision 553)
+++ LICENSE	(revision 440)
@@ -1,3 +1,3 @@
-LEMON code without an explicit copyright notice is covered by the following
+LEMON code without an explicit copyright is covered by the following
 copyright/license.
 
@@ -5,8 +5,4 @@
 Kutatocsoport (Egervary Combinatorial Optimization Research Group,
 EGRES).
-
-===========================================================================
-Boost Software License, Version 1.0
-===========================================================================
 
 Permission is hereby granted, free of charge, to any person or organization
@@ -31,2 +27,7 @@
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
+
+===========================================================================
+This license is a verbatim copy of the Boost Software License, Version 1.0.
+
+
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 567)
+++ Makefile.am	(revision 508)
@@ -12,6 +12,4 @@
 	m4/lx_check_glpk.m4 \
 	m4/lx_check_soplex.m4 \
-	m4/lx_check_clp.m4 \
-	m4/lx_check_cbc.m4 \
 	CMakeLists.txt \
 	cmake/FindGhostscript.cmake \
@@ -42,10 +40,6 @@
 include test/Makefile.am
 include doc/Makefile.am
+include demo/Makefile.am
 include tools/Makefile.am
-
-DIST_SUBDIRS = demo
-
-demo:
-	$(MAKE) $(AM_MAKEFLAGS) -C demo
 
 MRPROPERFILES = \
@@ -75,3 +69,3 @@
 	bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
 
-.PHONY: demo mrproper dist-bz2 distcheck-bz2
+.PHONY: mrproper dist-bz2 distcheck-bz2
Index: NEWS
===================================================================
--- NEWS	(revision 496)
+++ NEWS	(revision 322)
@@ -1,9 +1,2 @@
-2009-03-27 LEMON joins to the COIN-OR initiative
-
-        COIN-OR (Computational Infrastructure for Operations Research,
-        http://www.coin-or.org) project is an initiative to spur the
-        development of open-source software for the operations research
-        community.
-
 2008-10-13 Version 1.0 released
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 568)
+++ configure.ac	(revision 517)
@@ -60,8 +60,21 @@
 LX_CHECK_CPLEX
 LX_CHECK_SOPLEX
-LX_CHECK_COIN
+LX_CHECK_CLP
 
 AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
 AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
+
+dnl Disable/enable building the demo programs.
+AC_ARG_ENABLE([demo],
+AS_HELP_STRING([--enable-demo], [build the demo programs])
+AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
+              [], [enable_demo=no])
+AC_MSG_CHECKING([whether to build the demo programs])
+if test x"$enable_demo" != x"no"; then
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
 
 dnl Disable/enable building the binary tools.
@@ -98,5 +111,4 @@
 AC_CONFIG_FILES([
 Makefile
-demo/Makefile
 cmake/version.cmake
 doc/Doxyfile
@@ -120,6 +132,6 @@
 echo SOPLEX support................ : $lx_soplex_found
 echo CLP support................... : $lx_clp_found
-echo CBC support................... : $lx_cbc_found
 echo
+echo Build demo programs........... : $enable_demo
 echo Build additional tools........ : $enable_tools
 echo
Index: demo/CMakeLists.txt
===================================================================
--- demo/CMakeLists.txt	(revision 549)
+++ demo/CMakeLists.txt	(revision 475)
@@ -1,8 +1,8 @@
 INCLUDE_DIRECTORIES(
-  ${PROJECT_SOURCE_DIR}
-  ${PROJECT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}
 )
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
 
 SET(DEMOS
Index: demo/Makefile.am
===================================================================
--- demo/Makefile.am	(revision 564)
+++ demo/Makefile.am	(revision 400)
@@ -1,17 +1,16 @@
-AM_CXXFLAGS = $(WARNINGCXXFLAGS)
+EXTRA_DIST += \
+	demo/CMakeLists.txt \
+	demo/digraph.lgf
 
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
-LDADD = $(top_builddir)/lemon/libemon.la
+if WANT_DEMO
 
-EXTRA_DIST = \
-	CMakeLists.txt \
-	digraph.lgf
+noinst_PROGRAMS += \
+	demo/arg_parser_demo \
+	demo/graph_to_eps_demo \
+	demo/lgf_demo
 
-noinst_PROGRAMS = \
-	arg_parser_demo \
-	graph_to_eps_demo \
-	lgf_demo
+endif WANT_DEMO
 
-arg_parser_demo_SOURCES = arg_parser_demo.cc
-graph_to_eps_demo_SOURCES = graph_to_eps_demo.cc
-lgf_demo_SOURCES = lgf_demo.cc
+demo_arg_parser_demo_SOURCES = demo/arg_parser_demo.cc
+demo_graph_to_eps_demo_SOURCES = demo/graph_to_eps_demo.cc
+demo_lgf_demo_SOURCES = demo/lgf_demo.cc
Index: doc/CMakeLists.txt
===================================================================
--- doc/CMakeLists.txt	(revision 586)
+++ doc/CMakeLists.txt	(revision 518)
@@ -1,10 +1,10 @@
 SET(PACKAGE_NAME ${PROJECT_NAME})
 SET(PACKAGE_VERSION ${PROJECT_VERSION})
-SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
-SET(abs_top_builddir ${PROJECT_BINARY_DIR})
+SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
+SET(abs_top_builddir ${CMAKE_BINARY_DIR})
 
 CONFIGURE_FILE(
-  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
-  ${PROJECT_BINARY_DIR}/doc/Doxyfile
+  ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
+  ${CMAKE_BINARY_DIR}/doc/Doxyfile
   @ONLY)
 
@@ -15,10 +15,5 @@
       COMMAND rm -rf gen-images
       COMMAND mkdir gen-images
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
@@ -26,5 +21,4 @@
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
       COMMAND rm -rf html
       COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
@@ -34,10 +28,4 @@
       COMMAND if exist gen-images rmdir /s /q gen-images
       COMMAND mkdir gen-images
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
@@ -45,5 +33,4 @@
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
       COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
       COMMAND if exist html rmdir /s /q html
       COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
Index: doc/Makefile.am
===================================================================
--- doc/Makefile.am	(revision 587)
+++ doc/Makefile.am	(revision 337)
@@ -22,15 +22,6 @@
 	nodeshape_4.eps
 
-DOC_EPS_IMAGES27 = \
-	bipartite_matching.eps \
-	bipartite_partitions.eps \
-	connected_components.eps \
-	edge_biconnected_components.eps \
-	node_biconnected_components.eps \
-	strongly_connected_components.eps
-
 DOC_EPS_IMAGES = \
-	$(DOC_EPS_IMAGES18) \
-	$(DOC_EPS_IMAGES27)
+	$(DOC_EPS_IMAGES18)
 
 DOC_PNG_IMAGES = \
@@ -48,15 +39,4 @@
 	if test ${gs_found} = yes; then \
 	  $(GS_COMMAND) -sDEVICE=pngalpha -r18 -sOutputFile=$@ $<; \
-	else \
-	  echo; \
-	  echo "Ghostscript not found."; \
-	  echo; \
-	  exit 1; \
-	fi
-
-$(DOC_EPS_IMAGES27:%.eps=doc/gen-images/%.png): doc/gen-images/%.png: doc/images/%.eps
-	-mkdir doc/gen-images
-	if test ${gs_found} = yes; then \
-	  $(GS_COMMAND) -sDEVICE=pngalpha -r27 -sOutputFile=$@ $<; \
 	else \
 	  echo; \
Index: doc/groups.dox
===================================================================
--- doc/groups.dox	(revision 590)
+++ doc/groups.dox	(revision 455)
@@ -21,5 +21,5 @@
 /**
 @defgroup datas Data Structures
-This group contains the several data structures implemented in LEMON.
+This group describes the several data structures implemented in LEMON.
 */
 
@@ -143,5 +143,5 @@
 \brief Graph types between real graphs and graph adaptors.
 
-This group contains some graph types between real graphs and graph adaptors.
+This group describes some graph types between real graphs and graph adaptors.
 These classes wrap graphs to give new functionality as the adaptors do it.
 On the other hand they are not light-weight structures as the adaptors.
@@ -153,5 +153,5 @@
 \brief Map structures implemented in LEMON.
 
-This group contains the map structures implemented in LEMON.
+This group describes the map structures implemented in LEMON.
 
 LEMON provides several special purpose maps and map adaptors that e.g. combine
@@ -166,5 +166,5 @@
 \brief Special graph-related maps.
 
-This group contains maps that are specifically designed to assign
+This group describes maps that are specifically designed to assign
 values to the nodes and arcs/edges of graphs.
 
@@ -178,5 +178,5 @@
 \brief Tools to create new maps from existing ones
 
-This group contains map adaptors that are used to create "implicit"
+This group describes map adaptors that are used to create "implicit"
 maps from other maps.
 
@@ -241,5 +241,5 @@
 \brief Two dimensional data storages implemented in LEMON.
 
-This group contains two dimensional data storages implemented in LEMON.
+This group describes two dimensional data storages implemented in LEMON.
 */
 
@@ -249,5 +249,5 @@
 \brief %Path structures implemented in LEMON.
 
-This group contains the path structures implemented in LEMON.
+This group describes the path structures implemented in LEMON.
 
 LEMON provides flexible data structures to work with paths.
@@ -265,5 +265,5 @@
 \brief Auxiliary data structures implemented in LEMON.
 
-This group contains some data structures implemented in LEMON in
+This group describes some data structures implemented in LEMON in
 order to make it easier to implement combinatorial algorithms.
 */
@@ -271,8 +271,8 @@
 /**
 @defgroup algs Algorithms
-\brief This group contains the several algorithms
+\brief This group describes the several algorithms
 implemented in LEMON.
 
-This group contains the several algorithms
+This group describes the several algorithms
 implemented in LEMON.
 */
@@ -283,5 +283,5 @@
 \brief Common graph search algorithms.
 
-This group contains the common graph search algorithms, namely
+This group describes the common graph search algorithms, namely
 \e breadth-first \e search (BFS) and \e depth-first \e search (DFS).
 */
@@ -292,5 +292,5 @@
 \brief Algorithms for finding shortest paths.
 
-This group contains the algorithms for finding shortest paths in digraphs.
+This group describes the algorithms for finding shortest paths in digraphs.
 
  - \ref Dijkstra algorithm for finding shortest paths from a source node
@@ -313,5 +313,5 @@
 \brief Algorithms for finding maximum flows.
 
-This group contains the algorithms for finding maximum flows and
+This group describes the algorithms for finding maximum flows and
 feasible circulations.
 
@@ -346,5 +346,5 @@
 \brief Algorithms for finding minimum cost flows and circulations.
 
-This group contains the algorithms for finding minimum cost flows and
+This group describes the algorithms for finding minimum cost flows and
 circulations.
 
@@ -383,5 +383,5 @@
 \brief Algorithms for finding minimum cut in graphs.
 
-This group contains the algorithms for finding minimum cut in graphs.
+This group describes the algorithms for finding minimum cut in graphs.
 
 The \e minimum \e cut \e problem is to find a non-empty and non-complete
@@ -400,5 +400,5 @@
 - \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
   calculating minimum cut in undirected graphs.
-- \ref GomoryHu "Gomory-Hu tree computation" for calculating
+- \ref GomoryHuTree "Gomory-Hu tree computation" for calculating
   all-pairs minimum cut in undirected graphs.
 
@@ -408,9 +408,9 @@
 
 /**
-@defgroup graph_properties Connectivity and Other Graph Properties
+@defgroup graph_prop Connectivity and Other Graph Properties
 @ingroup algs
 \brief Algorithms for discovering the graph properties
 
-This group contains the algorithms for discovering the graph properties
+This group describes the algorithms for discovering the graph properties
 like connectivity, bipartiteness, euler property, simplicity etc.
 
@@ -424,5 +424,5 @@
 \brief Algorithms for planarity checking, embedding and drawing
 
-This group contains the algorithms for planarity checking,
+This group describes the algorithms for planarity checking,
 embedding and drawing.
 
@@ -436,8 +436,7 @@
 \brief Algorithms for finding matchings in graphs and bipartite graphs.
 
-This group contains the algorithms for calculating
+This group contains algorithm objects and functions to calculate
 matchings in graphs and bipartite graphs. The general matching problem is
-finding a subset of the edges for which each node has at most one incident
-edge.
+finding a subset of the arcs which does not shares common endpoints.
 
 There are several different algorithms for calculate matchings in
@@ -476,5 +475,5 @@
 \brief Algorithms for finding a minimum cost spanning tree in a graph.
 
-This group contains the algorithms for finding a minimum cost spanning
+This group describes the algorithms for finding a minimum cost spanning
 tree in a graph.
 */
@@ -485,5 +484,5 @@
 \brief Auxiliary algorithms implemented in LEMON.
 
-This group contains some algorithms implemented in LEMON
+This group describes some algorithms implemented in LEMON
 in order to make it easier to implement complex algorithms.
 */
@@ -494,5 +493,5 @@
 \brief Approximation algorithms.
 
-This group contains the approximation and heuristic algorithms
+This group describes the approximation and heuristic algorithms
 implemented in LEMON.
 */
@@ -500,8 +499,8 @@
 /**
 @defgroup gen_opt_group General Optimization Tools
-\brief This group contains some general optimization frameworks
+\brief This group describes some general optimization frameworks
 implemented in LEMON.
 
-This group contains some general optimization frameworks
+This group describes some general optimization frameworks
 implemented in LEMON.
 */
@@ -512,5 +511,5 @@
 \brief Lp and Mip solver interfaces for LEMON.
 
-This group contains Lp and Mip solver interfaces for LEMON. The
+This group describes Lp and Mip solver interfaces for LEMON. The
 various LP solvers could be used in the same manner with this
 interface.
@@ -531,5 +530,5 @@
 \brief Metaheuristics for LEMON library.
 
-This group contains some metaheuristic optimization tools.
+This group describes some metaheuristic optimization tools.
 */
 
@@ -546,5 +545,5 @@
 \brief Simple basic graph utilities.
 
-This group contains some simple basic graph utilities.
+This group describes some simple basic graph utilities.
 */
 
@@ -554,5 +553,5 @@
 \brief Tools for development, debugging and testing.
 
-This group contains several useful tools for development,
+This group describes several useful tools for development,
 debugging and testing.
 */
@@ -563,5 +562,5 @@
 \brief Simple tools for measuring the performance of algorithms.
 
-This group contains simple tools for measuring the performance
+This group describes simple tools for measuring the performance
 of algorithms.
 */
@@ -572,5 +571,5 @@
 \brief Exceptions defined in LEMON.
 
-This group contains the exceptions defined in LEMON.
+This group describes the exceptions defined in LEMON.
 */
 
@@ -579,5 +578,5 @@
 \brief Graph Input-Output methods
 
-This group contains the tools for importing and exporting graphs
+This group describes the tools for importing and exporting graphs
 and graph related data. Now it supports the \ref lgf-format
 "LEMON Graph Format", the \c DIMACS format and the encapsulated
@@ -590,5 +589,5 @@
 \brief Reading and writing LEMON Graph Format.
 
-This group contains methods for reading and writing
+This group describes methods for reading and writing
 \ref lgf-format "LEMON Graph Format".
 */
@@ -599,5 +598,5 @@
 \brief General \c EPS drawer and graph exporter
 
-This group contains general \c EPS drawing methods and special
+This group describes general \c EPS drawing methods and special
 graph exporting tools.
 */
@@ -623,5 +622,5 @@
 \brief Skeleton classes and concept checking classes
 
-This group contains the data/algorithm skeletons and concept checking
+This group describes the data/algorithm skeletons and concept checking
 classes implemented in LEMON.
 
@@ -653,5 +652,5 @@
 \brief Skeleton and concept checking classes for graph structures
 
-This group contains the skeletons and concept checking classes of LEMON's
+This group describes the skeletons and concept checking classes of LEMON's
 graph structures and helper classes used to implement these.
 */
@@ -662,5 +661,5 @@
 \brief Skeleton and concept checking classes for maps
 
-This group contains the skeletons and concept checking classes of maps.
+This group describes the skeletons and concept checking classes of maps.
 */
 
@@ -673,6 +672,6 @@
 the \c demo subdirectory of the source tree.
 
-In order to compile them, use the <tt>make demo</tt> or the
-<tt>make check</tt> commands.
+It order to compile them, use <tt>--enable-demo</tt> configure option when
+build the library.
 */
 
Index: c/images/bipartite_matching.eps
===================================================================
--- doc/images/bipartite_matching.eps	(revision 586)
+++ 	(revision )
@@ -1,586 +1,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%BoundingBox: 15 18 829 570
-%%HiResBoundingBox: 15.1913 18.4493 828.078 569.438
-%%Creator: Karbon14 EPS Exportfilter 0.5
-%%CreationDate: (04/15/06 15:20:26)
-%%For: (Balazs Dezso) ()
-%%Title: ()
-
-/N {newpath} def
-/C {closepath} def
-/m {moveto} def
-/c {curveto} def
-/l {lineto} def
-/s {stroke} def
-/f {fill} def
-/w {setlinewidth} def
-/d {setdash} def
-/r {setrgbcolor} def
-/S {gsave} def
-/R {grestore} def
-
-N
-251.402 32.047 m
-532.945 293.946 814.484 555.844 814.484 555.844 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-749.012 32.047 m
-742.465 293.946 735.918 555.844 735.918 555.844 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-539.492 32.047 m
-637.703 293.946 735.918 555.844 735.918 555.844 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-172.832 32.047 m
-454.375 293.946 735.918 555.844 735.918 555.844 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-107.355 32.047 m
-421.637 293.946 735.918 555.844 735.918 555.844 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-644.25 555.844 m
-696.633 293.946 749.012 32.047 749.012 32.047 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-474.016 555.844 m
-611.516 293.946 749.012 32.047 749.012 32.047 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-683.535 32.047 m
-663.894 293.946 644.25 555.844 644.25 555.844 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-120.453 555.844 m
-401.992 293.946 683.535 32.047 683.535 32.047 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-28.7853 555.844 m
-356.16 293.946 683.535 32.047 683.535 32.047 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-539.492 32.047 m
-546.039 293.946 552.586 555.844 552.586 555.844 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-316.875 32.047 m
-349.613 293.946 382.351 555.844 382.351 555.844 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-107.355 32.047 m
-244.855 293.946 382.351 555.844 382.351 555.844 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-290.687 555.844 m
-375.805 293.946 460.922 32.047 460.922 32.047 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-120.453 555.844 m
-290.687 293.946 460.922 32.047 460.922 32.047 c
-[] 0 d 0 0 0 r 1.96407 w s
-
-N
-172.832 32.047 m
-146.64 293.946 120.453 555.844 120.453 555.844 c
-[] 0 d 1 0 0 r 3.92814 w s
-
-N
-15.6913 555.844 m
-15.6913 555.844 l
-15.6913 548.614 21.5553 542.75 28.7853 542.75 c
-36.0163 542.75 41.8833 548.614 41.8833 555.844 c
-41.8833 563.075 36.0163 568.938 28.7853 568.938 c
-21.5553 568.938 15.6913 563.075 15.6913 555.844 c
-15.6913 555.844 l
-C
-S 0 0 0 r f R
-
-N
-16.8833 555.844 m
-16.8833 555.844 l
-16.8833 549.27 22.2113 543.942 28.7853 543.942 c
-35.3593 543.942 40.6913 549.27 40.6913 555.844 c
-40.6913 562.418 35.3593 567.747 28.7853 567.747 c
-22.2113 567.747 16.8833 562.418 16.8833 555.844 c
-16.8833 555.844 l
-C
-S 1 0.5 1 r f R
-
-N
-107.355 555.844 m
-107.355 555.844 l
-107.355 548.614 113.223 542.75 120.453 542.75 c
-127.683 542.75 133.547 548.614 133.547 555.844 c
-133.547 563.075 127.683 568.938 120.453 568.938 c
-113.223 568.938 107.355 563.075 107.355 555.844 c
-107.355 555.844 l
-C
-S 0 0 0 r f R
-
-N
-108.547 555.844 m
-108.547 555.844 l
-108.547 549.27 113.879 543.942 120.453 543.942 c
-127.027 543.942 132.355 549.27 132.355 555.844 c
-132.355 562.418 127.027 567.747 120.453 567.747 c
-113.879 567.747 108.547 562.418 108.547 555.844 c
-108.547 555.844 l
-C
-S 1 0 1 r f R
-
-N
-199.019 555.844 m
-199.019 555.844 l
-199.019 548.614 204.887 542.75 212.117 542.75 c
-219.348 542.75 225.211 548.614 225.211 555.844 c
-225.211 563.075 219.348 568.938 212.117 568.938 c
-204.887 568.938 199.019 563.075 199.019 555.844 c
-199.019 555.844 l
-C
-S 0 0 0 r f R
-
-N
-200.211 555.844 m
-200.211 555.844 l
-200.211 549.27 205.543 543.942 212.117 543.942 c
-218.691 543.942 224.019 549.27 224.019 555.844 c
-224.019 562.418 218.691 567.747 212.117 567.747 c
-205.543 567.747 200.211 562.418 200.211 555.844 c
-200.211 555.844 l
-C
-S 1 0.5 1 r f R
-
-N
-277.59 555.844 m
-277.59 555.844 l
-277.59 548.614 283.457 542.75 290.687 542.75 c
-297.918 542.75 303.781 548.614 303.781 555.844 c
-303.781 563.075 297.918 568.938 290.687 568.938 c
-283.457 568.938 277.59 563.075 277.59 555.844 c
-277.59 555.844 l
-C
-S 0 0 0 r f R
-
-N
-278.781 555.844 m
-278.781 555.844 l
-278.781 549.27 284.113 543.942 290.687 543.942 c
-297.262 543.942 302.59 549.27 302.59 555.844 c
-302.59 562.418 297.262 567.747 290.687 567.747 c
-284.113 567.747 278.781 562.418 278.781 555.844 c
-278.781 555.844 l
-C
-S 1 0 1 r f R
-
-N
-369.258 555.844 m
-369.258 555.844 l
-369.258 548.614 375.121 542.75 382.351 542.75 c
-389.582 542.75 395.445 548.614 395.445 555.844 c
-395.445 563.075 389.582 568.938 382.351 568.938 c
-375.121 568.938 369.258 563.075 369.258 555.844 c
-369.258 555.844 l
-C
-S 0 0 0 r f R
-
-N
-370.445 555.844 m
-370.445 555.844 l
-370.445 549.27 375.777 543.942 382.351 543.942 c
-388.926 543.942 394.258 549.27 394.258 555.844 c
-394.258 562.418 388.926 567.747 382.351 567.747 c
-375.777 567.747 370.445 562.418 370.445 555.844 c
-370.445 555.844 l
-C
-S 1 0 1 r f R
-
-N
-460.922 555.844 m
-460.922 555.844 l
-460.922 548.614 466.785 542.75 474.016 542.75 c
-481.246 542.75 487.109 548.614 487.109 555.844 c
-487.109 563.075 481.246 568.938 474.016 568.938 c
-466.785 568.938 460.922 563.075 460.922 555.844 c
-460.922 555.844 l
-C
-S 0 0 0 r f R
-
-N
-462.113 555.844 m
-462.113 555.844 l
-462.113 549.27 467.441 543.942 474.016 543.942 c
-480.59 543.942 485.922 549.27 485.922 555.844 c
-485.922 562.418 480.59 567.747 474.016 567.747 c
-467.441 567.747 462.113 562.418 462.113 555.844 c
-462.113 555.844 l
-C
-S 1 0.5 1 r f R
-
-N
-539.492 555.844 m
-539.492 555.844 l
-539.492 548.614 545.355 542.75 552.586 542.75 c
-559.816 542.75 565.68 548.614 565.68 555.844 c
-565.68 563.075 559.816 568.938 552.586 568.938 c
-545.355 568.938 539.492 563.075 539.492 555.844 c
-539.492 555.844 l
-C
-S 0 0 0 r f R
-
-N
-540.683 555.844 m
-540.683 555.844 l
-540.683 549.27 546.012 543.942 552.586 543.942 c
-559.16 543.942 564.492 549.27 564.492 555.844 c
-564.492 562.418 559.16 567.747 552.586 567.747 c
-546.012 567.747 540.683 562.418 540.683 555.844 c
-540.683 555.844 l
-C
-S 1 0 1 r f R
-
-N
-631.156 555.844 m
-631.156 555.844 l
-631.156 548.614 637.019 542.75 644.25 542.75 c
-651.48 542.75 657.348 548.614 657.348 555.844 c
-657.348 563.075 651.48 568.938 644.25 568.938 c
-637.019 568.938 631.156 563.075 631.156 555.844 c
-631.156 555.844 l
-C
-S 0 0 0 r f R
-
-N
-632.348 555.844 m
-632.348 555.844 l
-632.348 549.27 637.676 543.942 644.25 543.942 c
-650.824 543.942 656.156 549.27 656.156 555.844 c
-656.156 562.418 650.824 567.747 644.25 567.747 c
-637.676 567.747 632.348 562.418 632.348 555.844 c
-632.348 555.844 l
-C
-S 1 0.5 1 r f R
-
-N
-722.82 555.844 m
-722.82 555.844 l
-722.82 548.614 728.687 542.75 735.918 542.75 c
-743.149 542.75 749.012 548.614 749.012 555.844 c
-749.012 563.075 743.149 568.938 735.918 568.938 c
-728.687 568.938 722.82 563.075 722.82 555.844 c
-722.82 555.844 l
-C
-S 0 0 0 r f R
-
-N
-724.012 555.844 m
-724.012 555.844 l
-724.012 549.27 729.344 543.942 735.918 543.942 c
-742.492 543.942 747.82 549.27 747.82 555.844 c
-747.82 562.418 742.492 567.747 735.918 567.747 c
-729.344 567.747 724.012 562.418 724.012 555.844 c
-724.012 555.844 l
-C
-S 1 0 1 r f R
-
-N
-801.391 555.844 m
-801.391 555.844 l
-801.391 548.614 807.254 542.75 814.484 542.75 c
-821.715 542.75 827.578 548.614 827.578 555.844 c
-827.578 563.075 821.715 568.938 814.484 568.938 c
-807.254 568.938 801.391 563.075 801.391 555.844 c
-801.391 555.844 l
-C
-S 0 0 0 r f R
-
-N
-802.582 555.844 m
-802.582 555.844 l
-802.582 549.27 807.91 543.942 814.484 543.942 c
-821.059 543.942 826.387 549.27 826.387 555.844 c
-826.387 562.418 821.059 567.747 814.484 567.747 c
-807.91 567.747 802.582 562.418 802.582 555.844 c
-802.582 555.844 l
-C
-S 1 0 1 r f R
-
-N
-15.6913 32.047 m
-15.6913 32.047 l
-15.6913 24.8165 21.5553 18.9493 28.7853 18.9493 c
-36.0163 18.9493 41.8833 24.8165 41.8833 32.047 c
-41.8833 39.2775 36.0163 45.1407 28.7853 45.1407 c
-21.5553 45.1407 15.6913 39.2775 15.6913 32.047 c
-15.6913 32.047 l
-C
-S 0 0 0 r f R
-
-N
-16.8833 32.047 m
-16.8833 32.047 l
-16.8833 25.4728 22.2113 20.1407 28.7853 20.1407 c
-35.3593 20.1407 40.6913 25.4728 40.6913 32.047 c
-40.6913 38.6212 35.3593 43.9493 28.7853 43.9493 c
-22.2113 43.9493 16.8833 38.6212 16.8833 32.047 c
-16.8833 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-94.2623 32.047 m
-94.2623 32.047 l
-94.2623 24.8165 100.125 18.9493 107.355 18.9493 c
-114.586 18.9493 120.453 24.8165 120.453 32.047 c
-120.453 39.2775 114.586 45.1407 107.355 45.1407 c
-100.125 45.1407 94.2623 39.2775 94.2623 32.047 c
-94.2623 32.047 l
-C
-S 0 0 0 r f R
-
-N
-95.4533 32.047 m
-95.4533 32.047 l
-95.4533 25.4728 100.781 20.1407 107.355 20.1407 c
-113.93 20.1407 119.262 25.4728 119.262 32.047 c
-119.262 38.6212 113.93 43.9493 107.355 43.9493 c
-100.781 43.9493 95.4533 38.6212 95.4533 32.047 c
-95.4533 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-159.734 32.047 m
-159.734 32.047 l
-159.734 24.8165 165.601 18.9493 172.832 18.9493 c
-180.062 18.9493 185.926 24.8165 185.926 32.047 c
-185.926 39.2775 180.062 45.1407 172.832 45.1407 c
-165.601 45.1407 159.734 39.2775 159.734 32.047 c
-159.734 32.047 l
-C
-S 0 0 0 r f R
-
-N
-160.926 32.047 m
-160.926 32.047 l
-160.926 25.4728 166.258 20.1407 172.832 20.1407 c
-179.406 20.1407 184.734 25.4728 184.734 32.047 c
-184.734 38.6212 179.406 43.9493 172.832 43.9493 c
-166.258 43.9493 160.926 38.6212 160.926 32.047 c
-160.926 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-238.305 32.047 m
-238.305 32.047 l
-238.305 24.8165 244.172 18.9493 251.402 18.9493 c
-258.633 18.9493 264.496 24.8165 264.496 32.047 c
-264.496 39.2775 258.633 45.1407 251.402 45.1407 c
-244.172 45.1407 238.305 39.2775 238.305 32.047 c
-238.305 32.047 l
-C
-S 0 0 0 r f R
-
-N
-239.496 32.047 m
-239.496 32.047 l
-239.496 25.4728 244.828 20.1407 251.402 20.1407 c
-257.976 20.1407 263.305 25.4728 263.305 32.047 c
-263.305 38.6212 257.976 43.9493 251.402 43.9493 c
-244.828 43.9493 239.496 38.6212 239.496 32.047 c
-239.496 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-303.781 32.047 m
-303.781 32.047 l
-303.781 24.8165 309.644 18.9493 316.875 18.9493 c
-324.105 18.9493 329.973 24.8165 329.973 32.047 c
-329.973 39.2775 324.105 45.1407 316.875 45.1407 c
-309.644 45.1407 303.781 39.2775 303.781 32.047 c
-303.781 32.047 l
-C
-S 0 0 0 r f R
-
-N
-304.973 32.047 m
-304.973 32.047 l
-304.973 25.4728 310.301 20.1407 316.875 20.1407 c
-323.449 20.1407 328.781 25.4728 328.781 32.047 c
-328.781 38.6212 323.449 43.9493 316.875 43.9493 c
-310.301 43.9493 304.973 38.6212 304.973 32.047 c
-304.973 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-382.351 32.047 m
-382.351 32.047 l
-382.351 24.8165 388.215 18.9493 395.445 18.9493 c
-402.676 18.9493 408.543 24.8165 408.543 32.047 c
-408.543 39.2775 402.676 45.1407 395.445 45.1407 c
-388.215 45.1407 382.351 39.2775 382.351 32.047 c
-382.351 32.047 l
-C
-S 0 0 0 r f R
-
-N
-383.543 32.047 m
-383.543 32.047 l
-383.543 25.4728 388.871 20.1407 395.445 20.1407 c
-402.019 20.1407 407.351 25.4728 407.351 32.047 c
-407.351 38.6212 402.019 43.9493 395.445 43.9493 c
-388.871 43.9493 383.543 38.6212 383.543 32.047 c
-383.543 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-447.828 32.047 m
-447.828 32.047 l
-447.828 24.8165 453.691 18.9493 460.922 18.9493 c
-468.152 18.9493 474.016 24.8165 474.016 32.047 c
-474.016 39.2775 468.152 45.1407 460.922 45.1407 c
-453.691 45.1407 447.828 39.2775 447.828 32.047 c
-447.828 32.047 l
-C
-S 0 0 0 r f R
-
-N
-449.016 32.047 m
-449.016 32.047 l
-449.016 25.4728 454.348 20.1407 460.922 20.1407 c
-467.496 20.1407 472.824 25.4728 472.824 32.047 c
-472.824 38.6212 467.496 43.9493 460.922 43.9493 c
-454.348 43.9493 449.016 38.6212 449.016 32.047 c
-449.016 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-526.394 32.047 m
-526.394 32.047 l
-526.394 24.8165 532.262 18.9493 539.492 18.9493 c
-546.723 18.9493 552.586 24.8165 552.586 32.047 c
-552.586 39.2775 546.723 45.1407 539.492 45.1407 c
-532.262 45.1407 526.394 39.2775 526.394 32.047 c
-526.394 32.047 l
-C
-S 0 0 0 r f R
-
-N
-527.586 32.047 m
-527.586 32.047 l
-527.586 25.4728 532.918 20.1407 539.492 20.1407 c
-546.066 20.1407 551.394 25.4728 551.394 32.047 c
-551.394 38.6212 546.066 43.9493 539.492 43.9493 c
-532.918 43.9493 527.586 38.6212 527.586 32.047 c
-527.586 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-591.871 32.047 m
-591.871 32.047 l
-591.871 24.8165 597.734 18.9493 604.965 18.9493 c
-612.195 18.9493 618.062 24.8165 618.062 32.047 c
-618.062 39.2775 612.195 45.1407 604.965 45.1407 c
-597.734 45.1407 591.871 39.2775 591.871 32.047 c
-591.871 32.047 l
-C
-S 0 0 0 r f R
-
-N
-593.062 32.047 m
-593.062 32.047 l
-593.062 25.4728 598.39 20.1407 604.965 20.1407 c
-611.539 20.1407 616.871 25.4728 616.871 32.047 c
-616.871 38.6212 611.539 43.9493 604.965 43.9493 c
-598.39 43.9493 593.062 38.6212 593.062 32.047 c
-593.062 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-N
-670.441 32.047 m
-670.441 32.047 l
-670.441 24.8165 676.305 18.9493 683.535 18.9493 c
-690.766 18.9493 696.633 24.8165 696.633 32.047 c
-696.633 39.2775 690.766 45.1407 683.535 45.1407 c
-676.305 45.1407 670.441 39.2775 670.441 32.047 c
-670.441 32.047 l
-C
-S 0 0 0 r f R
-
-N
-671.633 32.047 m
-671.633 32.047 l
-671.633 25.4728 676.961 20.1407 683.535 20.1407 c
-690.109 20.1407 695.441 25.4728 695.441 32.047 c
-695.441 38.6212 690.109 43.9493 683.535 43.9493 c
-676.961 43.9493 671.633 38.6212 671.633 32.047 c
-671.633 32.047 l
-C
-S 0 0 1 r f R
-
-N
-735.918 32.047 m
-735.918 32.047 l
-735.918 24.8165 741.781 18.9493 749.012 18.9493 c
-756.242 18.9493 762.106 24.8165 762.106 32.047 c
-762.106 39.2775 756.242 45.1407 749.012 45.1407 c
-741.781 45.1407 735.918 39.2775 735.918 32.047 c
-735.918 32.047 l
-C
-S 0 0 0 r f R
-
-N
-737.105 32.047 m
-737.105 32.047 l
-737.105 25.4728 742.437 20.1407 749.012 20.1407 c
-755.586 20.1407 760.914 25.4728 760.914 32.047 c
-760.914 38.6212 755.586 43.9493 749.012 43.9493 c
-742.437 43.9493 737.105 38.6212 737.105 32.047 c
-737.105 32.047 l
-C
-S 0 0 1 r f R
-
-N
-801.391 32.047 m
-801.391 32.047 l
-801.391 24.8165 807.254 18.9493 814.484 18.9493 c
-821.715 18.9493 827.578 24.8165 827.578 32.047 c
-827.578 39.2775 821.715 45.1407 814.484 45.1407 c
-807.254 45.1407 801.391 39.2775 801.391 32.047 c
-801.391 32.047 l
-C
-S 0 0 0 r f R
-
-N
-802.582 32.047 m
-802.582 32.047 l
-802.582 25.4728 807.91 20.1407 814.484 20.1407 c
-821.059 20.1407 826.387 25.4728 826.387 32.047 c
-826.387 38.6212 821.059 43.9493 814.484 43.9493 c
-807.91 43.9493 802.582 38.6212 802.582 32.047 c
-802.582 32.047 l
-C
-S 0.5 0.5 1 r f R
-
-%%EOF
Index: c/images/bipartite_partitions.eps
===================================================================
--- doc/images/bipartite_partitions.eps	(revision 587)
+++ 	(revision )
@@ -1,114 +1,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Creator: LEMON, graphToEps()
-%%CreationDate: Tue Nov 15 16:51:43 2005
-%%BoundingBox: 0 0 842 596
-%%EndComments
-/lb { setlinewidth setrgbcolor newpath moveto
-      4 2 roll 1 index 1 index curveto stroke } bind def
-/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
-/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
-/sq { newpath 2 index 1 index add 2 index 2 index add moveto
-      2 index 1 index sub 2 index 2 index add lineto
-      2 index 1 index sub 2 index 2 index sub lineto
-      2 index 1 index add 2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/di { newpath 2 index 1 index add 2 index moveto
-      2 index             2 index 2 index add lineto
-      2 index 1 index sub 2 index             lineto
-      2 index             2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
-     setrgbcolor 1.1 div c fill
-   } bind def
-/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
-     setrgbcolor 1.1 div sq fill
-   } bind def
-/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
-     setrgbcolor 1.1 div di fill
-   } bind def
-/arrl 1 def
-/arrw 0.3 def
-/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
-/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
-       /w exch def /len exch def
-       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
-       len w sub arrl sub dx dy lrl
-       arrw dy dx neg lrl
-       dx arrl w add mul dy w 2 div arrw add mul sub
-       dy arrl w add mul dx w 2 div arrw add mul add rlineto
-       dx arrl w add mul neg dy w 2 div arrw add mul sub
-       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
-       arrw dy dx neg lrl
-       len w sub arrl sub neg dx dy lrl
-       closepath fill } bind def
-/cshow { 2 index 2 index moveto dup stringwidth pop
-         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
-
-gsave
-90 rotate
-0 -842 translate
-71.6378 15 translate
-0.389093 dup scale
-90 rotate
-1197.47 -613.138 translate
-%Edges:
-gsave
-513.857 -446.322 296.569 -487.43 79.2808 -528.539 0 0 0 2 lb
-513.857 -446.322 575.52 -315.655 637.183 -184.989 0 0 0 2 lb
-393.468 566.711 494.771 434.577 596.074 302.442 0 0 0 2 lb
-393.468 566.711 155.625 579.925 -82.2171 593.138 0 0 0 2 lb
-393.468 566.711 251.056 450.726 108.644 334.741 0 0 0 2 lb
-869.153 52.8539 732.613 177.648 596.074 302.442 0 0 0 2 lb
-869.153 52.8539 753.168 -66.0676 637.183 -184.989 0 0 0 2 lb
--82.2171 593.138 -91.0261 346.487 -99.8351 99.8351 0 0 0 2 lb
--663.61 546.157 -753.168 394.936 -842.726 243.715 0 0 0 2 lb
--663.61 546.157 -574.052 437.513 -484.494 328.869 0 0 0 2 lb
--1077.63 161.498 -960.178 202.606 -842.726 243.715 0 0 0 2 lb
--1077.63 161.498 -968.987 66.0674 -860.344 -29.3633 0 0 0 2 lb
--1177.47 -234.906 -1029.18 -381.722 -880.898 -528.539 0 0 0 2 lb
--1177.47 -234.906 -1018.91 -132.135 -860.344 -29.3633 0 0 0 2 lb
--880.898 -528.539 -744.359 -387.595 -607.82 -246.651 0 0 0 2 lb
--499.175 -499.175 -355.295 -475.685 -211.415 -452.194 0 0 0 2 lb
--499.175 -499.175 -553.498 -372.913 -607.82 -246.651 0 0 0 2 lb
--499.175 -499.175 -386.587 -315.087 -274 -131 0 0 0 2 lb
-79.2808 -528.539 -66.0671 -490.366 -211.415 -452.194 0 0 0 2 lb
-637.183 -184.989 421.363 -253.993 205.543 -322.996 0 0 0 2 lb
-205.543 -322.996 162.966 -226.097 120.389 -129.198 0 0 0 2 lb
-399.34 88.0898 259.865 -20.5541 120.389 -129.198 0 0 0 2 lb
-399.34 88.0898 253.992 211.415 108.644 334.741 0 0 0 2 lb
--842.726 243.715 -471.281 171.775 -99.8351 99.8351 0 0 0 2 lb
--842.726 243.715 -558.363 56.3575 -274 -131 0 0 0 2 lb
--860.344 -29.3633 -734.082 -138.007 -607.82 -246.651 0 0 0 2 lb
--211.415 -452.194 -45.513 -290.696 120.389 -129.198 0 0 0 2 lb
--99.8351 99.8351 4.40445 217.288 108.644 334.741 0 0 0 2 lb
--99.8351 99.8351 -292.165 214.352 -484.494 328.869 0 0 0 2 lb
-120.389 -129.198 -76.8055 -130.099 -274 -131 0 0 0 2 lb
-grestore
-%Nodes:
-gsave
--274 -131 20 1 0 0 nc
--607.82 -246.651 20 1 0 0 nc
--484.494 328.869 20 0 0 1 nc
-108.644 334.741 20 0 0 1 nc
-120.389 -129.198 20 0 0 1 nc
--99.8351 99.8351 20 1 0 0 nc
--211.415 -452.194 20 1 0 0 nc
--860.344 -29.3633 20 0 0 1 nc
--842.726 243.715 20 0 0 1 nc
-399.34 88.0898 20 1 0 0 nc
-205.543 -322.996 20 1 0 0 nc
-637.183 -184.989 20 0 0 1 nc
-79.2808 -528.539 20 0 0 1 nc
--499.175 -499.175 20 0 0 1 nc
--880.898 -528.539 20 0 0 1 nc
--1177.47 -234.906 20 1 0 0 nc
--1077.63 161.498 20 1 0 0 nc
--663.61 546.157 20 1 0 0 nc
--82.2171 593.138 20 0 0 1 nc
-596.074 302.442 20 0 0 1 nc
-869.153 52.8539 20 1 0 0 nc
-393.468 566.711 20 1 0 0 nc
-513.857 -446.322 20 1 0 0 nc
-grestore
-grestore
-showpage
Index: c/images/connected_components.eps
===================================================================
--- doc/images/connected_components.eps	(revision 587)
+++ 	(revision )
@@ -1,159 +1,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Creator: LEMON, graphToEps()
-%%CreationDate: Fri Nov  4 13:47:12 2005
-%%BoundingBox: 0 0 842 596
-%%EndComments
-/lb { setlinewidth setrgbcolor newpath moveto
-      4 2 roll 1 index 1 index curveto stroke } bind def
-/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
-/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
-/sq { newpath 2 index 1 index add 2 index 2 index add moveto
-      2 index 1 index sub 2 index 2 index add lineto
-      2 index 1 index sub 2 index 2 index sub lineto
-      2 index 1 index add 2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/di { newpath 2 index 1 index add 2 index moveto
-      2 index             2 index 2 index add lineto
-      2 index 1 index sub 2 index             lineto
-      2 index             2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
-     setrgbcolor 1.1 div c fill
-   } bind def
-/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
-     setrgbcolor 1.1 div sq fill
-   } bind def
-/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
-     setrgbcolor 1.1 div di fill
-   } bind def
-/arrl 1 def
-/arrw 0.3 def
-/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
-/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
-       /w exch def /len exch def
-       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
-       len w sub arrl sub dx dy lrl
-       arrw dy dx neg lrl
-       dx arrl w add mul dy w 2 div arrw add mul sub
-       dy arrl w add mul dx w 2 div arrw add mul add rlineto
-       dx arrl w add mul neg dy w 2 div arrw add mul sub
-       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
-       arrw dy dx neg lrl
-       len w sub arrl sub neg dx dy lrl
-       closepath fill } bind def
-/cshow { 2 index 2 index moveto dup stringwidth pop
-         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
-
-gsave
-90 rotate
-0 -842 translate
-71.0944 15 translate
-0.434694 dup scale
-90 rotate
-860.856 -588.349 translate
-%Edges:
-gsave
-574.035 177.301 622.149 225.748 670.264 274.195 0 0 0 2 lb
-694.579 115.483 682.421 194.839 670.264 274.195 0 0 0 2 lb
-280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 0 2 lb
-280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 0 2 lb
-212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 0 2 lb
-286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 0 2 lb
-286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 0 2 lb
-438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 0 2 lb
-438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 0 2 lb
-397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 0 2 lb
-366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 0 2 lb
-271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 0 2 lb
-271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 0 2 lb
-277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 0 2 lb
--840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0 0 2 lb
--579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0 2 lb
--579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0 2 lb
--767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0 2 lb
-906.312 201.403 946.592 42.798 986.873 -115.807 0 0 0 2 lb
-906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 0 2 lb
-986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 0 2 lb
--470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0 0 0 2 lb
-422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 0 2 lb
-422.945 521.129 376.371 417.911 329.797 314.692 0 0 0 2 lb
-422.945 521.129 474.554 276.928 526.164 32.7279 0 0 0 2 lb
--5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 0 2 lb
-329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 0 2 lb
--67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 0 2 lb
-762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 0 2 lb
-762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 0 2 lb
-526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 0 2 lb
-730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 0 2 lb
-415.393 -289.516 173.71 -318.468 -67.9734 -347.42 0 0 0 2 lb
--67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 0 2 lb
--67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 0 2 lb
--309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 0 2 lb
--323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 0 2 lb
--26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 0 2 lb
--26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 0 2 lb
--26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 0 2 lb
--26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 0 2 lb
-116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 0 2 lb
--262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 0 2 lb
--262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 0 2 lb
--13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 0 2 lb
--180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 0 2 lb
--180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 0 2 lb
--416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 0 2 lb
--416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 0 2 lb
--132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 0 2 lb
-670.264 274.195 629.188 409.347 588.113 544.499 0 0 0 2 lb
-670.264 274.195 797.466 341.771 924.667 409.347 0 0 0 2 lb
-588.113 544.499 756.39 476.923 924.667 409.347 0 0 0 2 lb
--689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 0 2 lb
--689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 0 2 lb
-grestore
-%Nodes:
-gsave
--567.302 43.6423 20 0 0 0 nc
--689.204 -237.261 20 0 0 0 nc
-924.667 409.347 20 1 0 0 nc
-588.113 544.499 20 1 0 0 nc
-670.264 274.195 20 1 0 0 nc
--371.2 568.349 20 0 1 0 nc
--132.697 451.748 20 0 1 0 nc
--416.25 345.746 20 0 1 0 nc
--180.397 245.045 20 0 1 0 nc
--13.4452 133.743 20 0 1 0 nc
--262.548 107.243 20 0 1 0 nc
-201.208 38.3422 20 0 1 0 nc
-116.407 -173.66 20 0 1 0 nc
--26.6953 -19.9585 20 0 1 0 nc
--539.894 -262.64 20 0 0 1 nc
--323.543 -433.964 20 0 0 1 nc
--309.657 -57.9033 20 0 0 1 nc
--67.9734 -347.42 20 0 0 1 nc
-415.393 -289.516 20 0 0 1 nc
-730.084 -307.139 20 0 0 1 nc
-526.164 32.7279 20 0 0 1 nc
-762.812 -17.6227 20 0 0 1 nc
--67.9734 319.727 20 0 0 1 nc
-329.797 314.692 20 0 0 1 nc
--5.03507 561.41 20 0 0 1 nc
-422.945 521.129 20 0 0 1 nc
--470.779 158.605 20 0 0 1 nc
-986.873 -115.807 20 0 0 1 nc
-906.312 201.403 20 0 0 1 nc
--767.847 113.289 20 0 0 1 nc
--579.033 445.603 20 0 0 1 nc
--840.856 -246.718 20 0 0 1 nc
-206.221 -205.967 20 1 1 0 nc
-277.311 -252.33 20 1 1 0 nc
-271.13 -175.058 20 1 1 0 nc
-366.947 -110.15 20 1 1 0 nc
-397.855 -196.694 20 1 1 0 nc
-438.037 -88.514 20 1 1 0 nc
-286.584 -48.3327 20 1 1 0 nc
-212.403 -23.6057 20 1 1 0 nc
-280.402 10.3938 20 1 1 0 nc
-694.579 115.483 20 1 0 0 nc
-574.035 177.301 20 1 0 0 nc
-grestore
-grestore
-showpage
Index: c/images/edge_biconnected_components.eps
===================================================================
--- doc/images/edge_biconnected_components.eps	(revision 587)
+++ 	(revision )
@@ -1,159 +1,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Creator: LEMON, graphToEps()
-%%CreationDate: Fri Nov  4 13:47:12 2005
-%%BoundingBox: 0 0 842 596
-%%EndComments
-/lb { setlinewidth setrgbcolor newpath moveto
-      4 2 roll 1 index 1 index curveto stroke } bind def
-/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
-/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
-/sq { newpath 2 index 1 index add 2 index 2 index add moveto
-      2 index 1 index sub 2 index 2 index add lineto
-      2 index 1 index sub 2 index 2 index sub lineto
-      2 index 1 index add 2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/di { newpath 2 index 1 index add 2 index moveto
-      2 index             2 index 2 index add lineto
-      2 index 1 index sub 2 index             lineto
-      2 index             2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
-     setrgbcolor 1.1 div c fill
-   } bind def
-/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
-     setrgbcolor 1.1 div sq fill
-   } bind def
-/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
-     setrgbcolor 1.1 div di fill
-   } bind def
-/arrl 1 def
-/arrw 0.3 def
-/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
-/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
-       /w exch def /len exch def
-       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
-       len w sub arrl sub dx dy lrl
-       arrw dy dx neg lrl
-       dx arrl w add mul dy w 2 div arrw add mul sub
-       dy arrl w add mul dx w 2 div arrw add mul add rlineto
-       dx arrl w add mul neg dy w 2 div arrw add mul sub
-       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
-       arrw dy dx neg lrl
-       len w sub arrl sub neg dx dy lrl
-       closepath fill } bind def
-/cshow { 2 index 2 index moveto dup stringwidth pop
-         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
-
-gsave
-90 rotate
-0 -842 translate
-71.0944 15 translate
-0.434694 dup scale
-90 rotate
-860.856 -588.349 translate
-%Edges:
-gsave
-574.035 177.301 622.149 225.748 670.264 274.195 1 0 0 2 lb
-694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 2 lb
-280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 1 2 lb
-280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 1 2 lb
-212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 1 2 lb
-286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 1 2 lb
-286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 1 2 lb
-438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 1 2 lb
-438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 1 2 lb
-397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 1 2 lb
-366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 1 2 lb
-271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 1 2 lb
-271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 1 2 lb
-277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 1 2 lb
--840.856 -246.718 -804.351 -66.7145 -767.847 113.289 1 0 0 2 lb
--579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 1 2 lb
--579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 1 2 lb
--767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 1 2 lb
-906.312 201.403 946.592 42.798 986.873 -115.807 0 0 1 2 lb
-906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 1 2 lb
-986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 1 2 lb
--470.779 158.605 -390.218 50.3508 -309.657 -57.9033 1 0 0 2 lb
-422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 1 2 lb
-422.945 521.129 376.371 417.911 329.797 314.692 0 0 1 2 lb
-422.945 521.129 474.554 276.928 526.164 32.7279 0 0 1 2 lb
--5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 1 2 lb
-329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 1 2 lb
--67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 1 2 lb
-762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 1 2 lb
-762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 1 2 lb
-526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 1 2 lb
-730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 1 2 lb
-415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0 0 2 lb
--67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 1 2 lb
--67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 1 2 lb
--309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 1 2 lb
--323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 1 2 lb
--26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 1 2 lb
--26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 1 2 lb
--26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 1 2 lb
--26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 1 2 lb
-116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 1 2 lb
--262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 1 2 lb
--262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 1 2 lb
--13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 1 2 lb
--180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 1 2 lb
--180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 1 2 lb
--416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 1 2 lb
--416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 1 2 lb
--132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 1 2 lb
-670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 2 lb
-670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 2 lb
-588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 2 lb
--689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 1 2 lb
--689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 1 2 lb
-grestore
-%Nodes:
-gsave
--567.302 43.6423 20 0 0 0 nc
--689.204 -237.261 20 0 0 0 nc
-924.667 409.347 20 0 0 1 nc
-588.113 544.499 20 0 0 1 nc
-670.264 274.195 20 0 0 1 nc
--371.2 568.349 20 1 1 0 nc
--132.697 451.748 20 1 1 0 nc
--416.25 345.746 20 1 1 0 nc
--180.397 245.045 20 1 1 0 nc
--13.4452 133.743 20 1 1 0 nc
--262.548 107.243 20 1 1 0 nc
-201.208 38.3422 20 1 1 0 nc
-116.407 -173.66 20 1 1 0 nc
--26.6953 -19.9585 20 1 1 0 nc
--539.894 -262.64 20 0 0.5 0 nc
--323.543 -433.964 20 0 0.5 0 nc
--309.657 -57.9033 20 0 0.5 0 nc
--67.9734 -347.42 20 0 0.5 0 nc
-415.393 -289.516 20 0.5 0 0 nc
-730.084 -307.139 20 0.5 0 0 nc
-526.164 32.7279 20 0.5 0 0 nc
-762.812 -17.6227 20 0.5 0 0 nc
--67.9734 319.727 20 0.5 0 0 nc
-329.797 314.692 20 0.5 0 0 nc
--5.03507 561.41 20 0.5 0 0 nc
-422.945 521.129 20 0.5 0 0 nc
--470.779 158.605 20 0 1 1 nc
-986.873 -115.807 20 0.5 0 0 nc
-906.312 201.403 20 0.5 0 0 nc
--767.847 113.289 20 0 1 1 nc
--579.033 445.603 20 0 1 1 nc
--840.856 -246.718 20 1 0 1 nc
-206.221 -205.967 20 0 0 0.5 nc
-277.311 -252.33 20 0 0 0.5 nc
-271.13 -175.058 20 0 0 0.5 nc
-366.947 -110.15 20 0 0 0.5 nc
-397.855 -196.694 20 0 0 0.5 nc
-438.037 -88.514 20 0 0 0.5 nc
-286.584 -48.3327 20 0 0 0.5 nc
-212.403 -23.6057 20 0 0 0.5 nc
-280.402 10.3938 20 0 0 0.5 nc
-694.579 115.483 20 1 0 0 nc
-574.035 177.301 20 0 1 0 nc
-grestore
-grestore
-showpage
Index: c/images/node_biconnected_components.eps
===================================================================
--- doc/images/node_biconnected_components.eps	(revision 587)
+++ 	(revision )
@@ -1,159 +1,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Creator: LEMON, graphToEps()
-%%CreationDate: Fri Nov  4 13:47:12 2005
-%%BoundingBox: 0 0 842 596
-%%EndComments
-/lb { setlinewidth setrgbcolor newpath moveto
-      4 2 roll 1 index 1 index curveto stroke } bind def
-/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
-/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
-/sq { newpath 2 index 1 index add 2 index 2 index add moveto
-      2 index 1 index sub 2 index 2 index add lineto
-      2 index 1 index sub 2 index 2 index sub lineto
-      2 index 1 index add 2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/di { newpath 2 index 1 index add 2 index moveto
-      2 index             2 index 2 index add lineto
-      2 index 1 index sub 2 index             lineto
-      2 index             2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
-     setrgbcolor 1.1 div c fill
-   } bind def
-/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
-     setrgbcolor 1.1 div sq fill
-   } bind def
-/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
-     setrgbcolor 1.1 div di fill
-   } bind def
-/arrl 1 def
-/arrw 0.3 def
-/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
-/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
-       /w exch def /len exch def
-       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
-       len w sub arrl sub dx dy lrl
-       arrw dy dx neg lrl
-       dx arrl w add mul dy w 2 div arrw add mul sub
-       dy arrl w add mul dx w 2 div arrw add mul add rlineto
-       dx arrl w add mul neg dy w 2 div arrw add mul sub
-       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
-       arrw dy dx neg lrl
-       len w sub arrl sub neg dx dy lrl
-       closepath fill } bind def
-/cshow { 2 index 2 index moveto dup stringwidth pop
-         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
-
-gsave
-90 rotate
-0 -842 translate
-71.0944 15 translate
-0.434694 dup scale
-90 rotate
-860.856 -588.349 translate
-%Edges:
-gsave
-574.035 177.301 622.149 225.748 670.264 274.195 0 1 0 5 lb
-694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 5 lb
-280.402 10.3938 246.402 -6.60595 212.403 -23.6057 1 1 0.5 5 lb
-280.402 10.3938 283.493 -18.9695 286.584 -48.3327 1 1 0.5 5 lb
-212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 1 1 0.5 5 lb
-286.584 -48.3327 326.765 -79.2414 366.947 -110.15 1 0.5 1 5 lb
-286.584 -48.3327 278.857 -111.695 271.13 -175.058 1 0.5 1 5 lb
-438.037 -88.514 417.946 -142.604 397.855 -196.694 0.5 0.5 1 5 lb
-438.037 -88.514 402.492 -99.332 366.947 -110.15 0.5 0.5 1 5 lb
-397.855 -196.694 382.401 -153.422 366.947 -110.15 0.5 0.5 1 5 lb
-366.947 -110.15 319.038 -142.604 271.13 -175.058 1 0.5 1 5 lb
-271.13 -175.058 274.221 -213.694 277.311 -252.33 0.5 1 1 5 lb
-271.13 -175.058 238.675 -190.512 206.221 -205.967 0.5 1 1 5 lb
-277.311 -252.33 241.766 -229.149 206.221 -205.967 0.5 1 1 5 lb
--840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0.5 0 5 lb
--579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0.5 5 lb
--579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0.5 5 lb
--767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0.5 5 lb
-906.312 201.403 946.592 42.798 986.873 -115.807 0 0.5 0.5 5 lb
-906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0.5 0.5 5 lb
-986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0.5 0.5 5 lb
--470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0.5 0.5 0 5 lb
-422.945 521.129 208.955 541.269 -5.03507 561.41 0.5 0 0.5 5 lb
-422.945 521.129 376.371 417.911 329.797 314.692 0.5 0 0.5 5 lb
-422.945 521.129 474.554 276.928 526.164 32.7279 0.5 0 0.5 5 lb
--5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0.5 0 0.5 5 lb
-329.797 314.692 130.912 317.209 -67.9734 319.727 0.5 0 0.5 5 lb
--67.9734 319.727 229.095 176.227 526.164 32.7279 0.5 0 0.5 5 lb
-762.812 -17.6227 644.488 7.5526 526.164 32.7279 0.5 0.5 0.5 5 lb
-762.812 -17.6227 746.448 -162.381 730.084 -307.139 0.5 0.5 0.5 5 lb
-526.164 32.7279 470.779 -128.394 415.393 -289.516 0.5 0.5 0.5 5 lb
-730.084 -307.139 572.738 -298.327 415.393 -289.516 0.5 0.5 0.5 5 lb
-415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0.5 0.5 5 lb
--67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0.5 1 0.5 5 lb
--67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0.5 1 0.5 5 lb
--309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0.5 1 0.5 5 lb
--323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0.5 1 0.5 5 lb
--26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 1 1 0 5 lb
--26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 1 1 0 5 lb
--26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 1 0 1 5 lb
--26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 1 0 1 5 lb
-116.407 -173.66 158.808 -67.6589 201.208 38.3422 1 1 0 5 lb
--262.548 107.243 -137.997 120.493 -13.4452 133.743 1 0 1 5 lb
--262.548 107.243 -221.472 176.144 -180.397 245.045 1 0 1 5 lb
--13.4452 133.743 -96.9211 189.394 -180.397 245.045 1 0 1 5 lb
--180.397 245.045 -140.307 344.649 -132.697 451.748 0 1 1 5 lb
--180.397 245.045 -172.787 352.144 -132.697 451.748 0 1 1 5 lb
--416.25 345.746 -274.474 398.747 -132.697 451.748 0.5 0 0 5 lb
--416.25 345.746 -393.725 457.048 -371.2 568.349 0.5 0 0 5 lb
--132.697 451.748 -251.948 510.048 -371.2 568.349 0.5 0 0 5 lb
-670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 5 lb
-670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 5 lb
-588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 5 lb
--689.204 -237.261 -612.964 -103.444 -567.302 43.6423 0 0 0 5 lb
--689.204 -237.261 -643.542 -90.1744 -567.302 43.6423 0 0 0 5 lb
-grestore
-%Nodes:
-gsave
--567.302 43.6423 20 0 0 1 nc
--689.204 -237.261 20 0 0 1 nc
-924.667 409.347 20 0 0 1 nc
-588.113 544.499 20 0 0 1 nc
-670.264 274.195 20 1 0 0 nc
--371.2 568.349 20 0 0 1 nc
--132.697 451.748 20 1 0 0 nc
--416.25 345.746 20 0 0 1 nc
--180.397 245.045 20 1 0 0 nc
--13.4452 133.743 20 0 0 1 nc
--262.548 107.243 20 0 0 1 nc
-201.208 38.3422 20 0 0 1 nc
-116.407 -173.66 20 0 0 1 nc
--26.6953 -19.9585 20 1 0 0 nc
--539.894 -262.64 20 0 0 1 nc
--323.543 -433.964 20 0 0 1 nc
--309.657 -57.9033 20 1 0 0 nc
--67.9734 -347.42 20 1 0 0 nc
-415.393 -289.516 20 1 0 0 nc
-730.084 -307.139 20 0 0 1 nc
-526.164 32.7279 20 1 0 0 nc
-762.812 -17.6227 20 1 0 0 nc
--67.9734 319.727 20 0 0 1 nc
-329.797 314.692 20 0 0 1 nc
--5.03507 561.41 20 0 0 1 nc
-422.945 521.129 20 0 0 1 nc
--470.779 158.605 20 1 0 0 nc
-986.873 -115.807 20 0 0 1 nc
-906.312 201.403 20 0 0 1 nc
--767.847 113.289 20 1 0 0 nc
--579.033 445.603 20 0 0 1 nc
--840.856 -246.718 20 0 0 1 nc
-206.221 -205.967 20 0 0 1 nc
-277.311 -252.33 20 0 0 1 nc
-271.13 -175.058 20 1 0 0 nc
-366.947 -110.15 20 1 0 0 nc
-397.855 -196.694 20 0 0 1 nc
-438.037 -88.514 20 0 0 1 nc
-286.584 -48.3327 20 1 0 0 nc
-212.403 -23.6057 20 0 0 1 nc
-280.402 10.3938 20 0 0 1 nc
-694.579 115.483 20 0 0 1 nc
-574.035 177.301 20 0 0 1 nc
-grestore
-grestore
-showpage
Index: c/images/strongly_connected_components.eps
===================================================================
--- doc/images/strongly_connected_components.eps	(revision 587)
+++ 	(revision )
@@ -1,180 +1,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Creator: LEMON, graphToEps()
-%%CreationDate: Fri Nov  4 13:47:12 2005
-%%BoundingBox: 0 0 842 596
-%%EndComments
-/lb { setlinewidth setrgbcolor newpath moveto
-      4 2 roll 1 index 1 index curveto stroke } bind def
-/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
-/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
-/sq { newpath 2 index 1 index add 2 index 2 index add moveto
-      2 index 1 index sub 2 index 2 index add lineto
-      2 index 1 index sub 2 index 2 index sub lineto
-      2 index 1 index add 2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/di { newpath 2 index 1 index add 2 index moveto
-      2 index             2 index 2 index add lineto
-      2 index 1 index sub 2 index             lineto
-      2 index             2 index 2 index sub lineto
-      closepath pop pop pop} bind def
-/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
-     setrgbcolor 1.1 div c fill
-   } bind def
-/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
-     setrgbcolor 1.1 div sq fill
-   } bind def
-/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
-     setrgbcolor 1.1 div di fill
-   } bind def
-/arrl 10 def
-/arrw 3 def
-/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
-/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
-       /w exch def /len exch def
-       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
-       len w sub arrl sub dx dy lrl
-       arrw dy dx neg lrl
-       dx arrl w add mul dy w 2 div arrw add mul sub
-       dy arrl w add mul dx w 2 div arrw add mul add rlineto
-       dx arrl w add mul neg dy w 2 div arrw add mul sub
-       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
-       arrw dy dx neg lrl
-       len w sub arrl sub neg dx dy lrl
-       closepath fill } bind def
-/cshow { 2 index 2 index moveto dup stringwidth pop
-         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
-
-gsave
-90 rotate
-0 -842 translate
-77.1122 15 translate
-0.585745 dup scale
-90 rotate
-695.963 -397.916 translate
-%Edges:
-gsave
-2 setlinewidth 0 0 1 setrgbcolor newpath
-218.178 27.2723 moveto
-192.373 -40.1551 188.622 -49.9556 169.228 -100.631 curveto stroke
-newpath 164.939 -111.838 moveto 165.492 -99.2013 lineto 172.964 -102.061 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-44.8044 15.5841 moveto
-119.293 20.6059 129.775 21.3125 186.25 25.1199 curveto stroke
-newpath 198.223 25.927 moveto 186.519 21.1289 lineto 185.981 29.1108 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
-218.178 27.2723 moveto
-285.395 -87.4449 290.763 -96.6058 348.102 -194.464 curveto stroke
-newpath 354.169 -204.818 moveto 344.651 -196.487 lineto 351.554 -192.442 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-157.79 -130.517 moveto
-108.71 -67.0521 102.27 -58.7243 64.3804 -9.72954 curveto stroke
-newpath 57.0394 -0.236898 moveto 67.5446 -7.28254 lineto 61.2162 -12.1765 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
--105.193 -261.035 moveto
--35.6576 -132.801 -30.5923 -123.459 29.5506 -12.5464 curveto stroke
-newpath 35.2708 -1.99743 moveto 33.0669 -14.4531 lineto 26.0343 -10.6397 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--465.576 -42.8564 moveto
--559.078 -25.5413 -569.47 -23.6169 -644.498 -9.72286 curveto stroke
-newpath -656.297 -7.5378 moveto -643.77 -5.78973 lineto -645.226 -13.656 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--574.666 -153.893 moveto
--528.842 -107.252 -521.515 -99.794 -488.002 -65.683 curveto stroke
-newpath -479.592 -57.123 moveto -485.149 -68.4863 lineto -490.856 -62.8797 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
--490.901 120.777 moveto
--480.122 51.1328 -478.519 40.7713 -470.47 -11.2329 curveto stroke
-newpath -468.635 -23.0917 moveto -474.423 -11.8447 lineto -466.517 -10.6212 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--675.963 -3.89604 moveto
--632.116 -68.8235 -626.228 -77.5422 -592.575 -127.374 curveto stroke
-newpath -585.859 -137.319 moveto -595.89 -129.612 lineto -589.26 -125.135 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--490.901 120.777 moveto
--435.445 215.844 -430.107 224.995 -384.3 303.522 curveto stroke
-newpath -378.253 313.887 moveto -380.845 301.507 lineto -387.755 305.537 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--266.879 114.933 moveto
--367.067 117.547 -377.642 117.822 -458.912 119.943 curveto stroke
-newpath -470.908 120.255 moveto -458.807 123.941 lineto -459.016 115.944 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--368.176 331.163 moveto
--322.511 233.685 -318.018 224.095 -280.454 143.911 curveto stroke
-newpath -275.364 133.044 moveto -284.076 142.214 lineto -276.832 145.608 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
--266.879 114.933 moveto
--224.004 235.52 -220.448 245.52 -184.094 347.765 curveto stroke
-newpath -180.074 359.072 moveto -180.325 346.425 lineto -187.863 349.105 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--251.294 -335.059 moveto
--189.25 -303.624 -179.902 -298.887 -133.738 -275.498 curveto stroke
-newpath -123.034 -270.074 moveto -131.93 -279.066 lineto -135.546 -271.93 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--389.604 -136.361 moveto
--327.15 -226.083 -321.098 -234.777 -269.576 -308.795 curveto stroke
-newpath -262.72 -318.644 moveto -272.859 -311.081 lineto -266.293 -306.51 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
-5.84406 175.322 moveto
--76.0754 267.926 -83.1051 275.873 -152.172 353.948 curveto stroke
-newpath -160.122 362.936 moveto -149.176 356.598 lineto -155.168 351.298 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-169.478 311.683 moveto
-96.8003 251.119 88.6819 244.353 30.4273 195.808 curveto stroke
-newpath 21.2086 188.126 moveto 27.8666 198.881 lineto 32.988 192.735 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-342.851 111.037 moveto
-263.766 202.563 256.831 210.589 190.4 287.47 curveto stroke
-newpath 182.554 296.55 moveto 193.427 290.085 lineto 187.373 284.855 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-5.84406 175.322 moveto
-163.16 145.314 173.605 143.321 311.418 117.033 curveto stroke
-newpath 323.205 114.784 moveto 310.668 113.104 lineto 312.167 120.962 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-342.851 111.037 moveto
-497.255 2.58683 505.964 -3.53033 643.932 -100.436 curveto stroke
-newpath 653.752 -107.334 moveto 641.633 -103.71 lineto 646.231 -97.163 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-364.28 -222.074 moveto
-354.298 -66.9063 353.616 -56.2971 344.905 79.1029 curveto stroke
-newpath 344.135 91.0781 moveto 348.897 79.3597 lineto 340.914 78.8461 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
-670.118 -118.829 moveto
-528.037 -166.793 517.967 -170.192 394.599 -211.839 curveto stroke
-newpath 383.229 -215.677 moveto 393.32 -208.049 lineto 395.878 -215.629 lineto closepath fill
-2 setlinewidth 1 0 0 setrgbcolor newpath
--105.193 -261.035 moveto
-118.401 -242.479 129.015 -241.598 332.39 -224.721 curveto stroke
-newpath 344.348 -223.728 moveto 332.72 -228.707 lineto 332.059 -220.734 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--105.193 -261.035 moveto
--160.867 -161.176 -166.028 -151.918 -212.336 -68.858 curveto stroke
-newpath -218.179 -58.3769 moveto -208.842 -66.9102 lineto -215.829 -70.8058 lineto closepath fill
-2 setlinewidth 0 0 1 setrgbcolor newpath
--227.918 -40.9084 moveto
--298.35 -82.4884 -307.42 -87.8432 -362.048 -120.093 curveto stroke
-newpath -372.381 -126.193 moveto -364.081 -116.648 lineto -360.014 -123.537 lineto closepath fill
-grestore
-%Nodes:
-gsave
--389.604 -136.361 20 0 1 0 nc
--227.918 -40.9084 20 0 1 0 nc
--105.193 -261.035 20 0 1 0 nc
-364.28 -222.074 20 1 1 0 nc
-670.118 -118.829 20 1 1 0 nc
-342.851 111.037 20 1 1 0 nc
-5.84406 175.322 20 1 1 0 nc
-169.478 311.683 20 1 1 0 nc
--173.374 377.916 20 1 0 1 nc
--251.294 -335.059 20 0 1 0 nc
--266.879 114.933 20 0 0 0 nc
--368.176 331.163 20 0 0 0 nc
--490.901 120.777 20 0 0 0 nc
--574.666 -153.893 20 1 0 0 nc
--675.963 -3.89604 20 1 0 0 nc
--465.576 -42.8564 20 1 0 0 nc
-44.8044 15.5841 20 0 0 1 nc
-157.79 -130.517 20 0 0 1 nc
-218.178 27.2723 20 0 0 1 nc
-grestore
-grestore
-showpage
Index: doc/mainpage.dox
===================================================================
--- doc/mainpage.dox	(revision 559)
+++ doc/mainpage.dox	(revision 440)
@@ -46,9 +46,14 @@
 "Quick Tour to LEMON" which will guide you along.
 
-If you already feel like using our library, see the
-<a class="el" href="http://lemon.cs.elte.hu/pub/tutorial/">LEMON Tutorial</a>.
+If you already feel like using our library, see the page that tells you
+\ref getstart "How to start using LEMON".
+
+If you
+want to see how LEMON works, see
+some \ref demoprograms "demo programs".
 
 If you know what you are looking for then try to find it under the
-<a class="el" href="modules.html">Modules</a> section.
+<a class="el" href="modules.html">Modules</a>
+section.
 
 If you are a user of the old (0.x) series of LEMON, please check out the
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 549)
+++ lemon/CMakeLists.txt	(revision 515)
@@ -1,5 +1,5 @@
 INCLUDE_DIRECTORIES(
-  ${PROJECT_SOURCE_DIR}
-  ${PROJECT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}
 )
 
Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 594)
+++ lemon/Makefile.am	(revision 601)
@@ -13,15 +13,13 @@
 	lemon/lp_base.cc \
 	lemon/lp_skeleton.cc \
-	lemon/random.cc \
+        lemon/random.cc \
 	lemon/bits/windows.cc
 
 
 lemon_libemon_la_CXXFLAGS = \
-	$(AM_CXXFLAGS) \
 	$(GLPK_CFLAGS) \
 	$(CPLEX_CFLAGS) \
 	$(SOPLEX_CXXFLAGS) \
-	$(CLP_CXXFLAGS) \
-	$(CBC_CXXFLAGS)
+	$(CLP_CXXFLAGS)
 
 lemon_libemon_la_LDFLAGS = \
@@ -29,6 +27,5 @@
 	$(CPLEX_LIBS) \
 	$(SOPLEX_LIBS) \
-	$(CLP_LIBS) \
-	$(CBC_LIBS)
+	$(CLP_LIBS)
 
 if HAVE_GLPK
@@ -46,8 +43,4 @@
 if HAVE_CLP
 lemon_libemon_la_SOURCES += lemon/clp.cc
-endif
-
-if HAVE_CBC
-lemon_libemon_la_SOURCES += lemon/cbc.cc
 endif
 
@@ -76,5 +69,4 @@
 	lemon/full_graph.h \
 	lemon/glpk.h \
-	lemon/gomory_hu.h \
 	lemon/graph_to_eps.h \
 	lemon/grid_graph.h \
@@ -90,8 +82,9 @@
 	lemon/list_graph.h \
 	lemon/maps.h \
-	lemon/matching.h \
 	lemon/math.h \
+	lemon/max_matching.h \
 	lemon/min_cost_arborescence.h \
 	lemon/nauty_reader.h \
+	lemon/network_simplex.h \
 	lemon/path.h \
 	lemon/preflow.h \
Index: lemon/adaptors.h
===================================================================
--- lemon/adaptors.h	(revision 579)
+++ lemon/adaptors.h	(revision 519)
@@ -2193,7 +2193,4 @@
     typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
     EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
-    
-    typedef EdgeNotifier ArcNotifier;
-    ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
 
   protected:
@@ -2258,8 +2255,7 @@
     /// This map adaptor class adapts two arc maps of the underlying
     /// digraph to get an arc map of the undirected graph.
-    /// Its value type is inherited from the first arc map type (\c FW).
-    /// \tparam FW The type of the "foward" arc map.
-    /// \tparam BK The type of the "backward" arc map.
-    template <typename FW, typename BK>
+    /// Its value type is inherited from the first arc map type
+    /// (\c %ForwardMap).
+    template <typename ForwardMap, typename BackwardMap>
     class CombinedArcMap {
     public:
@@ -2268,15 +2264,15 @@
       typedef typename Parent::Arc Key;
       /// The value type of the map
-      typedef typename FW::Value Value;
-
-      typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag;
-
-      typedef typename MapTraits<FW>::ReturnValue ReturnValue;
-      typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue;
-      typedef typename MapTraits<FW>::ReturnValue Reference;
-      typedef typename MapTraits<FW>::ConstReturnValue ConstReference;
+      typedef typename ForwardMap::Value Value;
+
+      typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
+
+      typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue;
+      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue;
+      typedef typename MapTraits<ForwardMap>::ReturnValue Reference;
+      typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReference;
 
       /// Constructor
-      CombinedArcMap(FW& forward, BK& backward)
+      CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
         : _forward(&forward), _backward(&backward) {}
 
@@ -2310,6 +2306,6 @@
     protected:
 
-      FW* _forward;
-      BK* _backward;
+      ForwardMap* _forward;
+      BackwardMap* _backward;
 
     };
@@ -2318,26 +2314,29 @@
     ///
     /// This function just returns a combined arc map.
-    template <typename FW, typename BK>
-    static CombinedArcMap<FW, BK>
-    combinedArcMap(FW& forward, BK& backward) {
-      return CombinedArcMap<FW, BK>(forward, backward);
-    }
-
-    template <typename FW, typename BK>
-    static CombinedArcMap<const FW, BK>
-    combinedArcMap(const FW& forward, BK& backward) {
-      return CombinedArcMap<const FW, BK>(forward, backward);
-    }
-
-    template <typename FW, typename BK>
-    static CombinedArcMap<FW, const BK>
-    combinedArcMap(FW& forward, const BK& backward) {
-      return CombinedArcMap<FW, const BK>(forward, backward);
-    }
-
-    template <typename FW, typename BK>
-    static CombinedArcMap<const FW, const BK>
-    combinedArcMap(const FW& forward, const BK& backward) {
-      return CombinedArcMap<const FW, const BK>(forward, backward);
+    template <typename ForwardMap, typename BackwardMap>
+    static CombinedArcMap<ForwardMap, BackwardMap>
+    combinedArcMap(ForwardMap& forward, BackwardMap& backward) {
+      return CombinedArcMap<ForwardMap, BackwardMap>(forward, backward);
+    }
+
+    template <typename ForwardMap, typename BackwardMap>
+    static CombinedArcMap<const ForwardMap, BackwardMap>
+    combinedArcMap(const ForwardMap& forward, BackwardMap& backward) {
+      return CombinedArcMap<const ForwardMap,
+        BackwardMap>(forward, backward);
+    }
+
+    template <typename ForwardMap, typename BackwardMap>
+    static CombinedArcMap<ForwardMap, const BackwardMap>
+    combinedArcMap(ForwardMap& forward, const BackwardMap& backward) {
+      return CombinedArcMap<ForwardMap,
+        const BackwardMap>(forward, backward);
+    }
+
+    template <typename ForwardMap, typename BackwardMap>
+    static CombinedArcMap<const ForwardMap, const BackwardMap>
+    combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) {
+      return CombinedArcMap<const ForwardMap,
+        const BackwardMap>(forward, backward);
     }
 
@@ -3408,8 +3407,7 @@
     /// This map adaptor class adapts two node maps of the original digraph
     /// to get a node map of the split digraph.
-    /// Its value type is inherited from the first node map type (\c IN).
-    /// \tparam IN The type of the node map for the in-nodes. 
-    /// \tparam OUT The type of the node map for the out-nodes.
-    template <typename IN, typename OUT>
+    /// Its value type is inherited from the first node map type
+    /// (\c InNodeMap).
+    template <typename InNodeMap, typename OutNodeMap>
     class CombinedNodeMap {
     public:
@@ -3418,14 +3416,14 @@
       typedef Node Key;
       /// The value type of the map
-      typedef typename IN::Value Value;
-
-      typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag;
-      typedef typename MapTraits<IN>::ReturnValue ReturnValue;
-      typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue;
-      typedef typename MapTraits<IN>::ReturnValue Reference;
-      typedef typename MapTraits<IN>::ConstReturnValue ConstReference;
+      typedef typename InNodeMap::Value Value;
+
+      typedef typename MapTraits<InNodeMap>::ReferenceMapTag ReferenceMapTag;
+      typedef typename MapTraits<InNodeMap>::ReturnValue ReturnValue;
+      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReturnValue;
+      typedef typename MapTraits<InNodeMap>::ReturnValue Reference;
+      typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReference;
 
       /// Constructor
-      CombinedNodeMap(IN& in_map, OUT& out_map)
+      CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
         : _in_map(in_map), _out_map(out_map) {}
 
@@ -3459,6 +3457,6 @@
     private:
 
-      IN& _in_map;
-      OUT& _out_map;
+      InNodeMap& _in_map;
+      OutNodeMap& _out_map;
 
     };
@@ -3468,26 +3466,27 @@
     ///
     /// This function just returns a combined node map.
-    template <typename IN, typename OUT>
-    static CombinedNodeMap<IN, OUT>
-    combinedNodeMap(IN& in_map, OUT& out_map) {
-      return CombinedNodeMap<IN, OUT>(in_map, out_map);
-    }
-
-    template <typename IN, typename OUT>
-    static CombinedNodeMap<const IN, OUT>
-    combinedNodeMap(const IN& in_map, OUT& out_map) {
-      return CombinedNodeMap<const IN, OUT>(in_map, out_map);
-    }
-
-    template <typename IN, typename OUT>
-    static CombinedNodeMap<IN, const OUT>
-    combinedNodeMap(IN& in_map, const OUT& out_map) {
-      return CombinedNodeMap<IN, const OUT>(in_map, out_map);
-    }
-
-    template <typename IN, typename OUT>
-    static CombinedNodeMap<const IN, const OUT>
-    combinedNodeMap(const IN& in_map, const OUT& out_map) {
-      return CombinedNodeMap<const IN, const OUT>(in_map, out_map);
+    template <typename InNodeMap, typename OutNodeMap>
+    static CombinedNodeMap<InNodeMap, OutNodeMap>
+    combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) {
+      return CombinedNodeMap<InNodeMap, OutNodeMap>(in_map, out_map);
+    }
+
+    template <typename InNodeMap, typename OutNodeMap>
+    static CombinedNodeMap<const InNodeMap, OutNodeMap>
+    combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) {
+      return CombinedNodeMap<const InNodeMap, OutNodeMap>(in_map, out_map);
+    }
+
+    template <typename InNodeMap, typename OutNodeMap>
+    static CombinedNodeMap<InNodeMap, const OutNodeMap>
+    combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) {
+      return CombinedNodeMap<InNodeMap, const OutNodeMap>(in_map, out_map);
+    }
+
+    template <typename InNodeMap, typename OutNodeMap>
+    static CombinedNodeMap<const InNodeMap, const OutNodeMap>
+    combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) {
+      return CombinedNodeMap<const InNodeMap,
+        const OutNodeMap>(in_map, out_map);
     }
 
@@ -3497,8 +3496,7 @@
     /// This map adaptor class adapts an arc map and a node map of the
     /// original digraph to get an arc map of the split digraph.
-    /// Its value type is inherited from the original arc map type (\c AM).
-    /// \tparam AM The type of the arc map.
-    /// \tparam NM the type of the node map.
-    template <typename AM, typename NM>
+    /// Its value type is inherited from the original arc map type
+    /// (\c ArcMap).
+    template <typename ArcMap, typename NodeMap>
     class CombinedArcMap {
     public:
@@ -3507,14 +3505,14 @@
       typedef Arc Key;
       /// The value type of the map
-      typedef typename AM::Value Value;
-
-      typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag;
-      typedef typename MapTraits<AM>::ReturnValue ReturnValue;
-      typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue;
-      typedef typename MapTraits<AM>::ReturnValue Reference;
-      typedef typename MapTraits<AM>::ConstReturnValue ConstReference;
+      typedef typename ArcMap::Value Value;
+
+      typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag;
+      typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue;
+      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue;
+      typedef typename MapTraits<ArcMap>::ReturnValue Reference;
+      typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReference;
 
       /// Constructor
-      CombinedArcMap(AM& arc_map, NM& node_map)
+      CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
         : _arc_map(arc_map), _node_map(node_map) {}
 
@@ -3547,8 +3545,6 @@
 
     private:
-
-      AM& _arc_map;
-      NM& _node_map;
-
+      ArcMap& _arc_map;
+      NodeMap& _node_map;
     };
 
Index: lemon/bin_heap.h
===================================================================
--- lemon/bin_heap.h	(revision 584)
+++ lemon/bin_heap.h	(revision 440)
@@ -34,28 +34,27 @@
   ///\brief A Binary Heap implementation.
   ///
-  ///This class implements the \e binary \e heap data structure. 
-  /// 
-  ///A \e heap is a data structure for storing items with specified values
-  ///called \e priorities in such a way that finding the item with minimum
-  ///priority is efficient. \c Comp specifies the ordering of the priorities.
-  ///In a heap one can change the priority of an item, add or erase an
-  ///item, etc.
+  ///This class implements the \e binary \e heap data structure. A \e heap
+  ///is a data structure for storing items with specified values called \e
+  ///priorities in such a way that finding the item with minimum priority is
+  ///efficient. \c Compare specifies the ordering of the priorities. In a heap
+  ///one can change the priority of an item, add or erase an item, etc.
   ///
-  ///\tparam PR Type of the priority of the items.
-  ///\tparam IM A read and writable item map with int values, used internally
+  ///\tparam _Prio Type of the priority of the items.
+  ///\tparam _ItemIntMap A read and writable Item int map, used internally
   ///to handle the cross references.
-  ///\tparam Comp A functor class for the ordering of the priorities.
-  ///The default is \c std::less<PR>.
+  ///\tparam _Compare A class for the ordering of the priorities. The
+  ///default is \c std::less<_Prio>.
   ///
   ///\sa FibHeap
   ///\sa Dijkstra
-  template <typename PR, typename IM, typename Comp = std::less<PR> >
+  template <typename _Prio, typename _ItemIntMap,
+            typename _Compare = std::less<_Prio> >
   class BinHeap {
 
   public:
     ///\e
-    typedef IM ItemIntMap;
-    ///\e
-    typedef PR Prio;
+    typedef _ItemIntMap ItemIntMap;
+    ///\e
+    typedef _Prio Prio;
     ///\e
     typedef typename ItemIntMap::Key Item;
@@ -63,5 +62,5 @@
     typedef std::pair<Item,Prio> Pair;
     ///\e
-    typedef Comp Compare;
+    typedef _Compare Compare;
 
     /// \brief Type to represent the items states.
@@ -71,16 +70,16 @@
     /// heap's point of view, but may be useful to the user.
     ///
-    /// The item-int map must be initialized in such way that it assigns
-    /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.
+    /// The ItemIntMap \e should be initialized in such way that it maps
+    /// PRE_HEAP (-1) to any element to be put in the heap...
     enum State {
-      IN_HEAP = 0,    ///< = 0.
-      PRE_HEAP = -1,  ///< = -1.
-      POST_HEAP = -2  ///< = -2.
+      IN_HEAP = 0,
+      PRE_HEAP = -1,
+      POST_HEAP = -2
     };
 
   private:
-    std::vector<Pair> _data;
-    Compare _comp;
-    ItemIntMap &_iim;
+    std::vector<Pair> data;
+    Compare comp;
+    ItemIntMap &iim;
 
   public:
@@ -88,19 +87,19 @@
     ///
     /// The constructor.
-    /// \param map should be given to the constructor, since it is used
-    /// internally to handle the cross references. The value of the map
-    /// must be \c PRE_HEAP (<tt>-1</tt>) for every item.
-    explicit BinHeap(ItemIntMap &map) : _iim(map) {}
-
-    /// \brief The constructor.
-    ///
-    /// The constructor.
-    /// \param map should be given to the constructor, since it is used
+    /// \param _iim should be given to the constructor, since it is used
     /// internally to handle the cross references. The value of the map
     /// should be PRE_HEAP (-1) for each element.
-    ///
-    /// \param comp The comparator function object.
-    BinHeap(ItemIntMap &map, const Compare &comp)
-      : _iim(map), _comp(comp) {}
+    explicit BinHeap(ItemIntMap &_iim) : iim(_iim) {}
+
+    /// \brief The constructor.
+    ///
+    /// The constructor.
+    /// \param _iim should be given to the constructor, since it is used
+    /// internally to handle the cross references. The value of the map
+    /// should be PRE_HEAP (-1) for each element.
+    ///
+    /// \param _comp The comparator function object.
+    BinHeap(ItemIntMap &_iim, const Compare &_comp)
+      : iim(_iim), comp(_comp) {}
 
 
@@ -108,10 +107,10 @@
     ///
     /// \brief Returns the number of items stored in the heap.
-    int size() const { return _data.size(); }
+    int size() const { return data.size(); }
 
     /// \brief Checks if the heap stores no items.
     ///
     /// Returns \c true if and only if the heap stores no items.
-    bool empty() const { return _data.empty(); }
+    bool empty() const { return data.empty(); }
 
     /// \brief Make empty this heap.
@@ -122,5 +121,5 @@
     /// each item to \c PRE_HEAP.
     void clear() {
-      _data.clear();
+      data.clear();
     }
 
@@ -130,11 +129,11 @@
     static int second_child(int i) { return 2*i+2; }
     bool less(const Pair &p1, const Pair &p2) const {
-      return _comp(p1.second, p2.second);
+      return comp(p1.second, p2.second);
     }
 
     int bubble_up(int hole, Pair p) {
       int par = parent(hole);
-      while( hole>0 && less(p,_data[par]) ) {
-        move(_data[par],hole);
+      while( hole>0 && less(p,data[par]) ) {
+        move(data[par],hole);
         hole = par;
         par = parent(hole);
@@ -147,16 +146,16 @@
       int child = second_child(hole);
       while(child < length) {
-        if( less(_data[child-1], _data[child]) ) {
+        if( less(data[child-1], data[child]) ) {
           --child;
         }
-        if( !less(_data[child], p) )
+        if( !less(data[child], p) )
           goto ok;
-        move(_data[child], hole);
+        move(data[child], hole);
         hole = child;
         child = second_child(hole);
       }
       child--;
-      if( child<length && less(_data[child], p) ) {
-        move(_data[child], hole);
+      if( child<length && less(data[child], p) ) {
+        move(data[child], hole);
         hole=child;
       }
@@ -167,6 +166,6 @@
 
     void move(const Pair &p, int i) {
-      _data[i] = p;
-      _iim.set(p.first, i);
+      data[i] = p;
+      iim.set(p.first, i);
     }
 
@@ -177,6 +176,6 @@
     /// \param p The pair to insert.
     void push(const Pair &p) {
-      int n = _data.size();
-      _data.resize(n+1);
+      int n = data.size();
+      data.resize(n+1);
       bubble_up(n, p);
     }
@@ -195,5 +194,5 @@
     /// \pre The heap must be nonempty.
     Item top() const {
-      return _data[0].first;
+      return data[0].first;
     }
 
@@ -203,5 +202,5 @@
     /// \pre The heap must be nonempty.
     Prio prio() const {
-      return _data[0].second;
+      return data[0].second;
     }
 
@@ -212,10 +211,10 @@
     /// \pre The heap must be non-empty.
     void pop() {
-      int n = _data.size()-1;
-      _iim.set(_data[0].first, POST_HEAP);
+      int n = data.size()-1;
+      iim.set(data[0].first, POST_HEAP);
       if (n > 0) {
-        bubble_down(0, _data[n], n);
-      }
-      _data.pop_back();
+        bubble_down(0, data[n], n);
+      }
+      data.pop_back();
     }
 
@@ -226,13 +225,13 @@
     /// \pre The item should be in the heap.
     void erase(const Item &i) {
-      int h = _iim[i];
-      int n = _data.size()-1;
-      _iim.set(_data[h].first, POST_HEAP);
+      int h = iim[i];
+      int n = data.size()-1;
+      iim.set(data[h].first, POST_HEAP);
       if( h < n ) {
-        if ( bubble_up(h, _data[n]) == h) {
-          bubble_down(h, _data[n], n);
+        if ( bubble_up(h, data[n]) == h) {
+          bubble_down(h, data[n], n);
         }
       }
-      _data.pop_back();
+      data.pop_back();
     }
 
@@ -241,9 +240,9 @@
     ///
     /// This function returns the priority of item \c i.
-    /// \param i The item.
     /// \pre \c i must be in the heap.
+    /// \param i The item.
     Prio operator[](const Item &i) const {
-      int idx = _iim[i];
-      return _data[idx].second;
+      int idx = iim[i];
+      return data[idx].second;
     }
 
@@ -256,13 +255,13 @@
     /// \param p The priority.
     void set(const Item &i, const Prio &p) {
-      int idx = _iim[i];
+      int idx = iim[i];
       if( idx < 0 ) {
         push(i,p);
       }
-      else if( _comp(p, _data[idx].second) ) {
+      else if( comp(p, data[idx].second) ) {
         bubble_up(idx, Pair(i,p));
       }
       else {
-        bubble_down(idx, Pair(i,p), _data.size());
+        bubble_down(idx, Pair(i,p), data.size());
       }
     }
@@ -271,10 +270,10 @@
     ///
     /// This method decreases the priority of item \c i to \c p.
-    /// \param i The item.
-    /// \param p The priority.
     /// \pre \c i must be stored in the heap with priority at least \c
     /// p relative to \c Compare.
+    /// \param i The item.
+    /// \param p The priority.
     void decrease(const Item &i, const Prio &p) {
-      int idx = _iim[i];
+      int idx = iim[i];
       bubble_up(idx, Pair(i,p));
     }
@@ -283,11 +282,11 @@
     ///
     /// This method sets the priority of item \c i to \c p.
-    /// \param i The item.
-    /// \param p The priority.
     /// \pre \c i must be stored in the heap with priority at most \c
     /// p relative to \c Compare.
+    /// \param i The item.
+    /// \param p The priority.
     void increase(const Item &i, const Prio &p) {
-      int idx = _iim[i];
-      bubble_down(idx, Pair(i,p), _data.size());
+      int idx = iim[i];
+      bubble_down(idx, Pair(i,p), data.size());
     }
 
@@ -301,5 +300,5 @@
     /// \param i The item.
     State state(const Item &i) const {
-      int s = _iim[i];
+      int s = iim[i];
       if( s>=0 )
         s=0;
@@ -321,5 +320,5 @@
           erase(i);
         }
-        _iim[i] = st;
+        iim[i] = st;
         break;
       case IN_HEAP:
@@ -335,8 +334,8 @@
     /// with the same prioriority as prevoiusly the \c i item.
     void replace(const Item& i, const Item& j) {
-      int idx = _iim[i];
-      _iim.set(i, _iim[j]);
-      _iim.set(j, idx);
-      _data[idx].first = j;
+      int idx = iim[i];
+      iim.set(i, iim[j]);
+      iim.set(j, idx);
+      data[idx].first = j;
     }
 
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 559)
+++ lemon/bits/edge_set_extender.h	(revision 519)
@@ -25,12 +25,12 @@
 #include <lemon/bits/map_extender.h>
 
-//\ingroup digraphbits
-//\file
-//\brief Extenders for the arc set types
+///\ingroup digraphbits
+///\file
+///\brief Extenders for the arc set types
 namespace lemon {
 
-  // \ingroup digraphbits
-  //
-  // \brief Extender for the ArcSets
+  /// \ingroup digraphbits
+  ///
+  /// \brief Extender for the ArcSets
   template <typename Base>
   class ArcSetExtender : public Base {
@@ -73,5 +73,5 @@
     // Alteration notifier extensions
 
-    // The arc observer registry.
+    /// The arc observer registry.
     typedef AlterationNotifier<ArcSetExtender, Arc> ArcNotifier;
 
@@ -84,5 +84,7 @@
     using Parent::notifier;
 
-    // Gives back the arc alteration notifier.
+    /// \brief Gives back the arc alteration notifier.
+    ///
+    /// Gives back the arc alteration notifier.
     ArcNotifier& notifier(Arc) const {
       return arc_notifier;
@@ -184,28 +186,28 @@
     };
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the source in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the source in this case) of the iterator
     Node baseNode(const OutArcIt &e) const {
       return Parent::source(static_cast<const Arc&>(e));
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the target in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the target in this case) of the
+    /// iterator
     Node runningNode(const OutArcIt &e) const {
       return Parent::target(static_cast<const Arc&>(e));
     }
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the target in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the target in this case) of the iterator
     Node baseNode(const InArcIt &e) const {
       return Parent::target(static_cast<const Arc&>(e));
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the source in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the source in this case) of the
+    /// iterator
     Node runningNode(const InArcIt &e) const {
       return Parent::source(static_cast<const Arc&>(e));
@@ -270,7 +272,7 @@
 
 
-  // \ingroup digraphbits
-  //
-  // \brief Extender for the EdgeSets
+  /// \ingroup digraphbits
+  ///
+  /// \brief Extender for the EdgeSets
   template <typename Base>
   class EdgeSetExtender : public Base {
@@ -491,41 +493,41 @@
     };
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the source in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the source in this case) of the iterator
     Node baseNode(const OutArcIt &e) const {
       return Parent::source(static_cast<const Arc&>(e));
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the target in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the target in this case) of the
+    /// iterator
     Node runningNode(const OutArcIt &e) const {
       return Parent::target(static_cast<const Arc&>(e));
     }
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the target in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the target in this case) of the iterator
     Node baseNode(const InArcIt &e) const {
       return Parent::target(static_cast<const Arc&>(e));
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the source in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the source in this case) of the
+    /// iterator
     Node runningNode(const InArcIt &e) const {
       return Parent::source(static_cast<const Arc&>(e));
     }
 
-    // Base node of the iterator
-    //
-    // Returns the base node of the iterator
+    /// Base node of the iterator
+    ///
+    /// Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &e) const {
       return e.direction ? u(e) : v(e);
     }
-    // Running node of the iterator
-    //
-    // Returns the running node of the iterator
+    /// Running node of the iterator
+    ///
+    /// Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &e) const {
       return e.direction ? v(e) : u(e);
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h	(revision 580)
+++ lemon/bits/graph_adaptor_extender.h	(revision 455)
@@ -22,4 +22,6 @@
 #include <lemon/core.h>
 #include <lemon/error.h>
+
+#include <lemon/bits/default_map.h>
 
 namespace lemon {
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 580)
+++ lemon/bits/map_extender.h	(revision 440)
@@ -48,6 +48,4 @@
     typedef typename Parent::Key Key;
     typedef typename Parent::Value Value;
-    typedef typename Parent::Reference Reference;
-    typedef typename Parent::ConstReference ConstReference;
 
     class MapIt;
@@ -190,6 +188,4 @@
     typedef typename Parent::Key Key;
     typedef typename Parent::Value Value;
-    typedef typename Parent::Reference Reference;
-    typedef typename Parent::ConstReference ConstReference;
 
     class MapIt;
Index: mon/cbc.cc
===================================================================
--- lemon/cbc.cc	(revision 576)
+++ 	(revision )
@@ -1,463 +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.
- *
- */
-
-///\file
-///\brief Implementation of the CBC MIP solver interface.
-
-#include "cbc.h"
-
-#include <coin/CoinModel.hpp>
-#include <coin/CbcModel.hpp>
-#include <coin/OsiSolverInterface.hpp>
-
-#ifdef COIN_HAS_CLP
-#include "coin/OsiClpSolverInterface.hpp"
-#endif
-#ifdef COIN_HAS_OSL
-#include "coin/OsiOslSolverInterface.hpp"
-#endif
-
-#include "coin/CbcCutGenerator.hpp"
-#include "coin/CbcHeuristicLocal.hpp"
-#include "coin/CbcHeuristicGreedy.hpp"
-#include "coin/CbcHeuristicFPump.hpp"
-#include "coin/CbcHeuristicRINS.hpp"
-
-#include "coin/CglGomory.hpp"
-#include "coin/CglProbing.hpp"
-#include "coin/CglKnapsackCover.hpp"
-#include "coin/CglOddHole.hpp"
-#include "coin/CglClique.hpp"
-#include "coin/CglFlowCover.hpp"
-#include "coin/CglMixedIntegerRounding.hpp"
-
-#include "coin/CbcHeuristic.hpp"
-
-namespace lemon {
-
-  CbcMip::CbcMip() {
-    _prob = new CoinModel();
-    _prob->setProblemName("LEMON");
-    _osi_solver = 0;
-    _cbc_model = 0;
-    messageLevel(MESSAGE_NOTHING);
-  }
-
-  CbcMip::CbcMip(const CbcMip& other) {
-    _prob = new CoinModel(*other._prob);
-    _prob->setProblemName("LEMON");
-    _osi_solver = 0;
-    _cbc_model = 0;
-    messageLevel(MESSAGE_NOTHING);
-  }
-
-  CbcMip::~CbcMip() {
-    delete _prob;
-    if (_osi_solver) delete _osi_solver;
-    if (_cbc_model) delete _cbc_model;
-  }
-
-  const char* CbcMip::_solverName() const { return "CbcMip"; }
-
-  int CbcMip::_addCol() {
-    _prob->addColumn(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX, 0.0, 0, false);
-    return _prob->numberColumns() - 1;
-  }
-
-  CbcMip* CbcMip::newSolver() const {
-    CbcMip* newlp = new CbcMip;
-    return newlp;
-  }
-
-  CbcMip* CbcMip::cloneSolver() const {
-    CbcMip* copylp = new CbcMip(*this);
-    return copylp;
-  }
-
-  int CbcMip::_addRow() {
-    _prob->addRow(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX);
-    return _prob->numberRows() - 1;
-  }
-
-
-  void CbcMip::_eraseCol(int i) {
-    _prob->deleteColumn(i);
-  }
-
-  void CbcMip::_eraseRow(int i) {
-    _prob->deleteRow(i);
-  }
-
-  void CbcMip::_eraseColId(int i) {
-    cols.eraseIndex(i);
-  }
-
-  void CbcMip::_eraseRowId(int i) {
-    rows.eraseIndex(i);
-  }
-
-  void CbcMip::_getColName(int c, std::string& name) const {
-    name = _prob->getColumnName(c);
-  }
-
-  void CbcMip::_setColName(int c, const std::string& name) {
-    _prob->setColumnName(c, name.c_str());
-  }
-
-  int CbcMip::_colByName(const std::string& name) const {
-    return _prob->column(name.c_str());
-  }
-
-  void CbcMip::_getRowName(int r, std::string& name) const {
-    name = _prob->getRowName(r);
-  }
-
-  void CbcMip::_setRowName(int r, const std::string& name) {
-    _prob->setRowName(r, name.c_str());
-  }
-
-  int CbcMip::_rowByName(const std::string& name) const {
-    return _prob->row(name.c_str());
-  }
-
-  void CbcMip::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
-    for (ExprIterator it = b; it != e; ++it) {
-      _prob->setElement(i, it->first, it->second);
-    }
-  }
-
-  void CbcMip::_getRowCoeffs(int ix, InsertIterator b) const {
-    int length = _prob->numberRows();
-
-    std::vector<int> indices(length);
-    std::vector<Value> values(length);
-
-    length = _prob->getRow(ix, &indices[0], &values[0]);
-
-    for (int i = 0; i < length; ++i) {
-      *b = std::make_pair(indices[i], values[i]);
-      ++b;
-    }
-  }
-
-  void CbcMip::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
-    for (ExprIterator it = b; it != e; ++it) {
-      _prob->setElement(it->first, ix, it->second);
-    }
-  }
-
-  void CbcMip::_getColCoeffs(int ix, InsertIterator b) const {
-    int length = _prob->numberColumns();
-
-    std::vector<int> indices(length);
-    std::vector<Value> values(length);
-
-    length = _prob->getColumn(ix, &indices[0], &values[0]);
-
-    for (int i = 0; i < length; ++i) {
-      *b = std::make_pair(indices[i], values[i]);
-      ++b;
-    }
-  }
-
-  void CbcMip::_setCoeff(int ix, int jx, Value value) {
-    _prob->setElement(ix, jx, value);
-  }
-
-  CbcMip::Value CbcMip::_getCoeff(int ix, int jx) const {
-    return _prob->getElement(ix, jx);
-  }
-
-
-  void CbcMip::_setColLowerBound(int i, Value lo) {
-    LEMON_ASSERT(lo != INF, "Invalid bound");
-    _prob->setColumnLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
-  }
-
-  CbcMip::Value CbcMip::_getColLowerBound(int i) const {
-    double val = _prob->getColumnLower(i);
-    return val == - COIN_DBL_MAX ? - INF : val;
-  }
-
-  void CbcMip::_setColUpperBound(int i, Value up) {
-    LEMON_ASSERT(up != -INF, "Invalid bound");
-    _prob->setColumnUpper(i, up == INF ? COIN_DBL_MAX : up);
-  }
-
-  CbcMip::Value CbcMip::_getColUpperBound(int i) const {
-    double val = _prob->getColumnUpper(i);
-    return val == COIN_DBL_MAX ? INF : val;
-  }
-
-  void CbcMip::_setRowLowerBound(int i, Value lo) {
-    LEMON_ASSERT(lo != INF, "Invalid bound");
-    _prob->setRowLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
-  }
-
-  CbcMip::Value CbcMip::_getRowLowerBound(int i) const {
-    double val = _prob->getRowLower(i);
-    return val == - COIN_DBL_MAX ? - INF : val;
-  }
-
-  void CbcMip::_setRowUpperBound(int i, Value up) {
-    LEMON_ASSERT(up != -INF, "Invalid bound");
-    _prob->setRowUpper(i, up == INF ? COIN_DBL_MAX : up);
-  }
-
-  CbcMip::Value CbcMip::_getRowUpperBound(int i) const {
-    double val = _prob->getRowUpper(i);
-    return val == COIN_DBL_MAX ? INF : val;
-  }
-
-  void CbcMip::_setObjCoeffs(ExprIterator b, ExprIterator e) {
-    int num = _prob->numberColumns();
-    for (int i = 0; i < num; ++i) {
-      _prob->setColumnObjective(i, 0.0);
-    }
-    for (ExprIterator it = b; it != e; ++it) {
-      _prob->setColumnObjective(it->first, it->second);
-    }
-  }
-
-  void CbcMip::_getObjCoeffs(InsertIterator b) const {
-    int num = _prob->numberColumns();
-    for (int i = 0; i < num; ++i) {
-      Value coef = _prob->getColumnObjective(i);
-      if (coef != 0.0) {
-        *b = std::make_pair(i, coef);
-        ++b;
-      }
-    }
-  }
-
-  void CbcMip::_setObjCoeff(int i, Value obj_coef) {
-    _prob->setColumnObjective(i, obj_coef);
-  }
-
-  CbcMip::Value CbcMip::_getObjCoeff(int i) const {
-    return _prob->getColumnObjective(i);
-  }
-
-  CbcMip::SolveExitStatus CbcMip::_solve() {
-
-    if (_osi_solver) {
-      delete _osi_solver;
-    }
-#ifdef COIN_HAS_CLP
-    _osi_solver = new OsiClpSolverInterface();
-#elif COIN_HAS_OSL
-    _osi_solver = new OsiOslSolverInterface();
-#else
-#error Cannot instantiate Osi solver
-#endif
-
-    _osi_solver->loadFromCoinModel(*_prob);
-
-    if (_cbc_model) {
-      delete _cbc_model;
-    }
-    _cbc_model= new CbcModel(*_osi_solver);
-
-    _osi_solver->messageHandler()->setLogLevel(_message_level);
-    _cbc_model->setLogLevel(_message_level);
-
-    _cbc_model->initialSolve();
-    _cbc_model->solver()->setHintParam(OsiDoReducePrint, true, OsiHintTry);
-
-    if (!_cbc_model->isInitialSolveAbandoned() &&
-        _cbc_model->isInitialSolveProvenOptimal() &&
-        !_cbc_model->isInitialSolveProvenPrimalInfeasible() &&
-        !_cbc_model->isInitialSolveProvenDualInfeasible()) {
-
-      CglProbing generator1;
-      generator1.setUsingObjective(true);
-      generator1.setMaxPass(3);
-      generator1.setMaxProbe(100);
-      generator1.setMaxLook(50);
-      generator1.setRowCuts(3);
-      _cbc_model->addCutGenerator(&generator1, -1, "Probing");
-
-      CglGomory generator2;
-      generator2.setLimit(300);
-      _cbc_model->addCutGenerator(&generator2, -1, "Gomory");
-
-      CglKnapsackCover generator3;
-      _cbc_model->addCutGenerator(&generator3, -1, "Knapsack");
-
-      CglOddHole generator4;
-      generator4.setMinimumViolation(0.005);
-      generator4.setMinimumViolationPer(0.00002);
-      generator4.setMaximumEntries(200);
-      _cbc_model->addCutGenerator(&generator4, -1, "OddHole");
-
-      CglClique generator5;
-      generator5.setStarCliqueReport(false);
-      generator5.setRowCliqueReport(false);
-      _cbc_model->addCutGenerator(&generator5, -1, "Clique");
-
-      CglMixedIntegerRounding mixedGen;
-      _cbc_model->addCutGenerator(&mixedGen, -1, "MixedIntegerRounding");
-
-      CglFlowCover flowGen;
-      _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover");
-
-#ifdef COIN_HAS_CLP
-      OsiClpSolverInterface* osiclp =
-        dynamic_cast<OsiClpSolverInterface*>(_cbc_model->solver());
-      if (osiclp->getNumRows() < 300 && osiclp->getNumCols() < 500) {
-        osiclp->setupForRepeatedUse(2, 0);
-      }
-#endif
-
-      CbcRounding heuristic1(*_cbc_model);
-      heuristic1.setWhen(3);
-      _cbc_model->addHeuristic(&heuristic1);
-
-      CbcHeuristicLocal heuristic2(*_cbc_model);
-      heuristic2.setWhen(3);
-      _cbc_model->addHeuristic(&heuristic2);
-
-      CbcHeuristicGreedyCover heuristic3(*_cbc_model);
-      heuristic3.setAlgorithm(11);
-      heuristic3.setWhen(3);
-      _cbc_model->addHeuristic(&heuristic3);
-
-      CbcHeuristicFPump heuristic4(*_cbc_model);
-      heuristic4.setWhen(3);
-      _cbc_model->addHeuristic(&heuristic4);
-
-      CbcHeuristicRINS heuristic5(*_cbc_model);
-      heuristic5.setWhen(3);
-      _cbc_model->addHeuristic(&heuristic5);
-
-      if (_cbc_model->getNumCols() < 500) {
-        _cbc_model->setMaximumCutPassesAtRoot(-100);
-      } else if (_cbc_model->getNumCols() < 5000) {
-        _cbc_model->setMaximumCutPassesAtRoot(100);
-      } else {
-        _cbc_model->setMaximumCutPassesAtRoot(20);
-      }
-
-      if (_cbc_model->getNumCols() < 5000) {
-        _cbc_model->setNumberStrong(10);
-      }
-
-      _cbc_model->solver()->setIntParam(OsiMaxNumIterationHotStart, 100);
-      _cbc_model->branchAndBound();
-    }
-
-    if (_cbc_model->isAbandoned()) {
-      return UNSOLVED;
-    } else {
-      return SOLVED;
-    }
-  }
-
-  CbcMip::Value CbcMip::_getSol(int i) const {
-    return _cbc_model->getColSolution()[i];
-  }
-
-  CbcMip::Value CbcMip::_getSolValue() const {
-    return _cbc_model->getObjValue();
-  }
-
-  CbcMip::ProblemType CbcMip::_getType() const {
-    if (_cbc_model->isProvenOptimal()) {
-      return OPTIMAL;
-    } else if (_cbc_model->isContinuousUnbounded()) {
-      return UNBOUNDED;
-    }
-    return FEASIBLE;
-  }
-
-  void CbcMip::_setSense(Sense sense) {
-    switch (sense) {
-    case MIN:
-      _prob->setOptimizationDirection(1.0);
-      break;
-    case MAX:
-      _prob->setOptimizationDirection(- 1.0);
-      break;
-    }
-  }
-
-  CbcMip::Sense CbcMip::_getSense() const {
-    if (_prob->optimizationDirection() > 0.0) {
-      return MIN;
-    } else if (_prob->optimizationDirection() < 0.0) {
-      return MAX;
-    } else {
-      LEMON_ASSERT(false, "Wrong sense");
-      return CbcMip::Sense();
-    }
-  }
-
-  void CbcMip::_setColType(int i, CbcMip::ColTypes col_type) {
-    switch (col_type){
-    case INTEGER:
-      _prob->setInteger(i);
-      break;
-    case REAL:
-      _prob->setContinuous(i);
-      break;
-    default:;
-      LEMON_ASSERT(false, "Wrong sense");
-    }
-  }
-
-  CbcMip::ColTypes CbcMip::_getColType(int i) const {
-    return _prob->getColumnIsInteger(i) ? INTEGER : REAL;
-  }
-
-  void CbcMip::_clear() {
-    delete _prob;
-    if (_osi_solver) {
-      delete _osi_solver;
-      _osi_solver = 0;
-    }
-    if (_cbc_model) {
-      delete _cbc_model;
-      _cbc_model = 0;
-    }
-
-    _prob = new CoinModel();
-    rows.clear();
-    cols.clear();
-  }
-
-  void CbcMip::_messageLevel(MessageLevel level) {
-    switch (level) {
-    case MESSAGE_NOTHING:
-      _message_level = 0;
-      break;
-    case MESSAGE_ERROR:
-      _message_level = 1;
-      break;
-    case MESSAGE_WARNING:
-      _message_level = 1;
-      break;
-    case MESSAGE_NORMAL:
-      _message_level = 2;
-      break;
-    case MESSAGE_VERBOSE:
-      _message_level = 3;
-      break;
-    }
-  }
-
-} //END OF NAMESPACE LEMON
Index: mon/cbc.h
===================================================================
--- lemon/cbc.h	(revision 576)
+++ 	(revision )
@@ -1,129 +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.
- *
- */
-
-// -*- C++ -*-
-#ifndef LEMON_CBC_H
-#define LEMON_CBC_H
-
-///\file
-///\brief Header of the LEMON-CBC mip solver interface.
-///\ingroup lp_group
-
-#include <lemon/lp_base.h>
-
-class CoinModel;
-class OsiSolverInterface;
-class CbcModel;
-
-namespace lemon {
-
-  /// \brief Interface for the CBC MIP solver
-  ///
-  /// This class implements an interface for the CBC MIP solver.
-  ///\ingroup lp_group
-  class CbcMip : public MipSolver {
-  protected:
-
-    CoinModel *_prob;
-    OsiSolverInterface *_osi_solver;
-    CbcModel *_cbc_model;
-
-  public:
-
-    /// \e
-    CbcMip();
-    /// \e
-    CbcMip(const CbcMip&);
-    /// \e
-    ~CbcMip();
-    /// \e
-    virtual CbcMip* newSolver() const;
-    /// \e
-    virtual CbcMip* cloneSolver() const;
-
-  protected:
-
-    virtual const char* _solverName() const;
-
-    virtual int _addCol();
-    virtual int _addRow();
-
-    virtual void _eraseCol(int i);
-    virtual void _eraseRow(int i);
-
-    virtual void _eraseColId(int i);
-    virtual void _eraseRowId(int i);
-
-    virtual void _getColName(int col, std::string& name) const;
-    virtual void _setColName(int col, const std::string& name);
-    virtual int _colByName(const std::string& name) const;
-
-    virtual void _getRowName(int row, std::string& name) const;
-    virtual void _setRowName(int row, const std::string& name);
-    virtual int _rowByName(const std::string& name) const;
-
-    virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
-    virtual void _getRowCoeffs(int i, InsertIterator b) const;
-
-    virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
-    virtual void _getColCoeffs(int i, InsertIterator b) const;
-
-    virtual void _setCoeff(int row, int col, Value value);
-    virtual Value _getCoeff(int row, int col) const;
-
-    virtual void _setColLowerBound(int i, Value value);
-    virtual Value _getColLowerBound(int i) const;
-    virtual void _setColUpperBound(int i, Value value);
-    virtual Value _getColUpperBound(int i) const;
-
-    virtual void _setRowLowerBound(int i, Value value);
-    virtual Value _getRowLowerBound(int i) const;
-    virtual void _setRowUpperBound(int i, Value value);
-    virtual Value _getRowUpperBound(int i) const;
-
-    virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
-    virtual void _getObjCoeffs(InsertIterator b) const;
-
-    virtual void _setObjCoeff(int i, Value obj_coef);
-    virtual Value _getObjCoeff(int i) const;
-
-    virtual void _setSense(Sense sense);
-    virtual Sense _getSense() const;
-
-    virtual ColTypes _getColType(int col) const;
-    virtual void _setColType(int col, ColTypes col_type);
-
-    virtual SolveExitStatus _solve();
-    virtual ProblemType _getType() const;
-    virtual Value _getSol(int i) const;
-    virtual Value _getSolValue() const;
-
-    virtual void _clear();
-
-    virtual void _messageLevel(MessageLevel level);
-    void _applyMessageLevel();
-
-    int _message_level;
-
-    
-
-  };
-
-}
-
-#endif
Index: lemon/circulation.h
===================================================================
--- lemon/circulation.h	(revision 581)
+++ lemon/circulation.h	(revision 492)
@@ -216,7 +216,7 @@
     ///@{
 
-    template <typename T>
+    template <typename _FlowMap>
     struct SetFlowMapTraits : public Traits {
-      typedef T FlowMap;
+      typedef _FlowMap FlowMap;
       static FlowMap *createFlowMap(const Digraph&) {
         LEMON_ASSERT(false, "FlowMap is not initialized");
@@ -230,15 +230,15 @@
     /// \ref named-templ-param "Named parameter" for setting FlowMap
     /// type.
-    template <typename T>
+    template <typename _FlowMap>
     struct SetFlowMap
       : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                           SetFlowMapTraits<T> > {
+                           SetFlowMapTraits<_FlowMap> > {
       typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                          SetFlowMapTraits<T> > Create;
+                          SetFlowMapTraits<_FlowMap> > Create;
     };
 
-    template <typename T>
+    template <typename _Elevator>
     struct SetElevatorTraits : public Traits {
-      typedef T Elevator;
+      typedef _Elevator Elevator;
       static Elevator *createElevator(const Digraph&, int) {
         LEMON_ASSERT(false, "Elevator is not initialized");
@@ -256,15 +256,15 @@
     /// \ref run() or \ref init().
     /// \sa SetStandardElevator
-    template <typename T>
+    template <typename _Elevator>
     struct SetElevator
       : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                           SetElevatorTraits<T> > {
+                           SetElevatorTraits<_Elevator> > {
       typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                          SetElevatorTraits<T> > Create;
+                          SetElevatorTraits<_Elevator> > Create;
     };
 
-    template <typename T>
+    template <typename _Elevator>
     struct SetStandardElevatorTraits : public Traits {
-      typedef T Elevator;
+      typedef _Elevator Elevator;
       static Elevator *createElevator(const Digraph& digraph, int max_level) {
         return new Elevator(digraph, max_level);
@@ -284,10 +284,10 @@
     /// before calling \ref run() or \ref init().
     /// \sa SetElevator
-    template <typename T>
+    template <typename _Elevator>
     struct SetStandardElevator
       : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                       SetStandardElevatorTraits<T> > {
+                       SetStandardElevatorTraits<_Elevator> > {
       typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap,
-                      SetStandardElevatorTraits<T> > Create;
+                      SetStandardElevatorTraits<_Elevator> > Create;
     };
 
@@ -454,11 +454,11 @@
 
       for(NodeIt n(_g);n!=INVALID;++n) {
-        (*_excess)[n] = (*_delta)[n];
+        _excess->set(n, (*_delta)[n]);
       }
 
       for (ArcIt e(_g);e!=INVALID;++e) {
         _flow->set(e, (*_lo)[e]);
-        (*_excess)[_g.target(e)] += (*_flow)[e];
-        (*_excess)[_g.source(e)] -= (*_flow)[e];
+        _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_flow)[e]);
+        _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_flow)[e]);
       }
 
@@ -483,5 +483,5 @@
 
       for(NodeIt n(_g);n!=INVALID;++n) {
-        (*_excess)[n] = (*_delta)[n];
+        _excess->set(n, (*_delta)[n]);
       }
 
@@ -489,15 +489,15 @@
         if (!_tol.positive((*_excess)[_g.target(e)] + (*_up)[e])) {
           _flow->set(e, (*_up)[e]);
-          (*_excess)[_g.target(e)] += (*_up)[e];
-          (*_excess)[_g.source(e)] -= (*_up)[e];
+          _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_up)[e]);
+          _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_up)[e]);
         } else if (_tol.positive((*_excess)[_g.target(e)] + (*_lo)[e])) {
           _flow->set(e, (*_lo)[e]);
-          (*_excess)[_g.target(e)] += (*_lo)[e];
-          (*_excess)[_g.source(e)] -= (*_lo)[e];
+          _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_lo)[e]);
+          _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_lo)[e]);
         } else {
           Value fc = -(*_excess)[_g.target(e)];
           _flow->set(e, fc);
-          (*_excess)[_g.target(e)] = 0;
-          (*_excess)[_g.source(e)] -= fc;
+          _excess->set(_g.target(e), 0);
+          _excess->set(_g.source(e), (*_excess)[_g.source(e)] - fc);
         }
       }
@@ -538,8 +538,8 @@
             if(!_tol.less(fc, exc)) {
               _flow->set(e, (*_flow)[e] + exc);
-              (*_excess)[v] += exc;
+              _excess->set(v, (*_excess)[v] + exc);
               if(!_level->active(v) && _tol.positive((*_excess)[v]))
                 _level->activate(v);
-              (*_excess)[act] = 0;
+              _excess->set(act,0);
               _level->deactivate(act);
               goto next_l;
@@ -547,5 +547,5 @@
             else {
               _flow->set(e, (*_up)[e]);
-              (*_excess)[v] += fc;
+              _excess->set(v, (*_excess)[v] + fc);
               if(!_level->active(v) && _tol.positive((*_excess)[v]))
                 _level->activate(v);
@@ -562,8 +562,8 @@
             if(!_tol.less(fc, exc)) {
               _flow->set(e, (*_flow)[e] - exc);
-              (*_excess)[v] += exc;
+              _excess->set(v, (*_excess)[v] + exc);
               if(!_level->active(v) && _tol.positive((*_excess)[v]))
                 _level->activate(v);
-              (*_excess)[act] = 0;
+              _excess->set(act,0);
               _level->deactivate(act);
               goto next_l;
@@ -571,5 +571,5 @@
             else {
               _flow->set(e, (*_lo)[e]);
-              (*_excess)[v] += fc;
+              _excess->set(v, (*_excess)[v] + fc);
               if(!_level->active(v) && _tol.positive((*_excess)[v]))
                 _level->activate(v);
@@ -580,5 +580,5 @@
         }
 
-        (*_excess)[act] = exc;
+        _excess->set(act, exc);
         if(!_tol.positive(exc)) _level->deactivate(act);
         else if(mlevel==_node_num) {
@@ -683,5 +683,5 @@
     ///
     /// \note This function calls \ref barrier() for each node,
-    /// so it runs in O(n) time.
+    /// so it runs in \f$O(n)\f$ time.
     ///
     /// \pre Either \ref run() or \ref init() must be called before
Index: lemon/clp.cc
===================================================================
--- lemon/clp.cc	(revision 576)
+++ lemon/clp.cc	(revision 462)
@@ -25,5 +25,5 @@
     _prob = new ClpSimplex();
     _init_temporals();
-    messageLevel(MESSAGE_NOTHING);
+    messageLevel(MESSAGE_NO_OUTPUT);
   }
 
@@ -33,5 +33,5 @@
     cols = other.cols;
     _init_temporals();
-    messageLevel(MESSAGE_NOTHING);
+    messageLevel(MESSAGE_NO_OUTPUT);
   }
 
@@ -57,10 +57,10 @@
   }
 
-  ClpLp* ClpLp::newSolver() const {
+  ClpLp* ClpLp::_newSolver() const {
     ClpLp* newlp = new ClpLp;
     return newlp;
   }
 
-  ClpLp* ClpLp::cloneSolver() const {
+  ClpLp* ClpLp::_cloneSolver() const {
     ClpLp* copylp = new ClpLp(*this);
     return copylp;
@@ -431,22 +431,6 @@
   }
 
-  void ClpLp::_messageLevel(MessageLevel level) {
-    switch (level) {
-    case MESSAGE_NOTHING:
-      _prob->setLogLevel(0);
-      break;
-    case MESSAGE_ERROR:
-      _prob->setLogLevel(1);
-      break;
-    case MESSAGE_WARNING:
-      _prob->setLogLevel(2);
-      break;
-    case MESSAGE_NORMAL:
-      _prob->setLogLevel(3);
-      break;
-    case MESSAGE_VERBOSE:
-      _prob->setLogLevel(4);
-      break;
-    }
+  void ClpLp::messageLevel(MessageLevel m) {
+    _prob->setLogLevel(static_cast<int>(m));
   }
 
Index: lemon/clp.h
===================================================================
--- lemon/clp.h	(revision 576)
+++ lemon/clp.h	(revision 462)
@@ -57,9 +57,4 @@
     ~ClpLp();
 
-    /// \e
-    virtual ClpLp* newSolver() const;
-    /// \e
-    virtual ClpLp* cloneSolver() const;
-
   protected:
 
@@ -71,4 +66,7 @@
 
   protected:
+
+    virtual ClpLp* _newSolver() const;
+    virtual ClpLp* _cloneSolver() const;
 
     virtual const char* _solverName() const;
@@ -137,6 +135,4 @@
     virtual void _clear();
 
-    virtual void _messageLevel(MessageLevel);
-    
   public:
 
@@ -156,4 +152,24 @@
     int clpCol(Col c) const { return cols(id(c)); }
 
+    ///Enum for \c messageLevel() parameter
+    enum MessageLevel {
+      /// no output (default value)
+      MESSAGE_NO_OUTPUT = 0,
+      /// print final solution
+      MESSAGE_FINAL_SOLUTION = 1,
+      /// print factorization
+      MESSAGE_FACTORIZATION = 2,
+      /// normal output
+      MESSAGE_NORMAL_OUTPUT = 3,
+      /// verbose output
+      MESSAGE_VERBOSE_OUTPUT = 4
+    };
+    ///Set the verbosity of the messages
+
+    ///Set the verbosity of the messages
+    ///
+    ///\param m is the level of the messages output by the solver routines.
+    void messageLevel(MessageLevel m);
+
   };
 
Index: lemon/concepts/digraph.h
===================================================================
--- lemon/concepts/digraph.h	(revision 580)
+++ lemon/concepts/digraph.h	(revision 529)
@@ -422,9 +422,10 @@
       Node oppositeNode(const Node&, const Arc&) const { return INVALID; }
 
-      /// \brief Reference map of the nodes to type \c T.
-      ///
-      /// Reference map of the nodes to type \c T.
+      /// \brief Read write map of the nodes to type \c T.
+      ///
+      /// ReadWrite map of the nodes to type \c T.
+      /// \sa Reference
       template<class T>
-      class NodeMap : public ReferenceMap<Node, T, T&, const T&> {
+      class NodeMap : public ReadWriteMap< Node, T > {
       public:
 
@@ -436,6 +437,5 @@
       private:
         ///Copy constructor
-        NodeMap(const NodeMap& nm) : 
-          ReferenceMap<Node, T, T&, const T&>(nm) { }
+        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
         ///Assignment operator
         template <typename CMap>
@@ -446,9 +446,10 @@
       };
 
-      /// \brief Reference map of the arcs to type \c T.
+      /// \brief Read write map of the arcs to type \c T.
       ///
       /// Reference map of the arcs to type \c T.
+      /// \sa Reference
       template<class T>
-      class ArcMap : public ReferenceMap<Arc, T, T&, const T&> {
+      class ArcMap : public ReadWriteMap<Arc,T> {
       public:
 
@@ -459,6 +460,5 @@
       private:
         ///Copy constructor
-        ArcMap(const ArcMap& em) :
-          ReferenceMap<Arc, T, T&, const T&>(em) { }
+        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
         ///Assignment operator
         template <typename CMap>
@@ -472,5 +472,4 @@
       struct Constraints {
         void constraints() {
-          checkConcept<BaseDigraphComponent, _Digraph>();
           checkConcept<IterableDigraphComponent<>, _Digraph>();
           checkConcept<IDableDigraphComponent<>, _Digraph>();
Index: lemon/concepts/graph.h
===================================================================
--- lemon/concepts/graph.h	(revision 580)
+++ lemon/concepts/graph.h	(revision 529)
@@ -498,9 +498,10 @@
       };
 
-      /// \brief Reference map of the nodes to type \c T.
-      ///
-      /// Reference map of the nodes to type \c T.
+      /// \brief Read write map of the nodes to type \c T.
+      ///
+      /// ReadWrite map of the nodes to type \c T.
+      /// \sa Reference
       template<class T>
-      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
+      class NodeMap : public ReadWriteMap< Node, T >
       {
       public:
@@ -513,6 +514,5 @@
       private:
         ///Copy constructor
-        NodeMap(const NodeMap& nm) :
-          ReferenceMap<Node, T, T&, const T&>(nm) { }
+        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
         ///Assignment operator
         template <typename CMap>
@@ -523,9 +523,10 @@
       };
 
-      /// \brief Reference map of the arcs to type \c T.
-      ///
-      /// Reference map of the arcs to type \c T.
+      /// \brief Read write map of the directed arcs to type \c T.
+      ///
+      /// Reference map of the directed arcs to type \c T.
+      /// \sa Reference
       template<class T>
-      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
+      class ArcMap : public ReadWriteMap<Arc,T>
       {
       public:
@@ -537,6 +538,5 @@
       private:
         ///Copy constructor
-        ArcMap(const ArcMap& em) :
-          ReferenceMap<Arc, T, T&, const T&>(em) { }
+        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
         ///Assignment operator
         template <typename CMap>
@@ -547,9 +547,10 @@
       };
 
-      /// Reference map of the edges to type \c T.
-
-      /// Reference map of the edges to type \c T.
+      /// Read write map of the edges to type \c T.
+
+      /// Reference map of the arcs to type \c T.
+      /// \sa Reference
       template<class T>
-      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
+      class EdgeMap : public ReadWriteMap<Edge,T>
       {
       public:
@@ -561,6 +562,5 @@
       private:
         ///Copy constructor
-        EdgeMap(const EdgeMap& em) :
-          ReferenceMap<Edge, T, T&, const T&>(em) {}
+        EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
         ///Assignment operator
         template <typename CMap>
@@ -602,33 +602,21 @@
       /// \brief Opposite node on an arc
       ///
-      /// \return The opposite of the given node on the given edge.
+      /// \return the opposite of the given Node on the given Edge
       Node oppositeNode(Node, Edge) const { return INVALID; }
 
       /// \brief First node of the edge.
       ///
-      /// \return The first node of the given edge.
+      /// \return the first node of the given Edge.
       ///
       /// Naturally edges don't have direction and thus
-      /// don't have source and target node. However we use \c u() and \c v()
-      /// methods to query the two nodes of the arc. The direction of the
-      /// arc which arises this way is called the inherent direction of the
+      /// don't have source and target node. But we use these two methods
+      /// to query the two nodes of the arc. The direction of the arc
+      /// which arises this way is called the inherent direction of the
       /// edge, and is used to define the "default" direction
       /// of the directed versions of the arcs.
-      /// \sa v()
-      /// \sa direction()
+      /// \sa direction
       Node u(Edge) const { return INVALID; }
 
       /// \brief Second node of the edge.
-      ///
-      /// \return The second node of the given edge.
-      ///
-      /// Naturally edges don't have direction and thus
-      /// don't have source and target node. However we use \c u() and \c v()
-      /// methods to query the two nodes of the arc. The direction of the
-      /// arc which arises this way is called the inherent direction of the
-      /// edge, and is used to define the "default" direction
-      /// of the directed versions of the arcs.
-      /// \sa u()
-      /// \sa direction()
       Node v(Edge) const { return INVALID; }
 
@@ -749,5 +737,4 @@
       struct Constraints {
         void constraints() {
-          checkConcept<BaseGraphComponent, _Graph>();
           checkConcept<IterableGraphComponent<>, _Graph>();
           checkConcept<IDableGraphComponent<>, _Graph>();
Index: lemon/concepts/graph_components.h
===================================================================
--- lemon/concepts/graph_components.h	(revision 584)
+++ lemon/concepts/graph_components.h	(revision 534)
@@ -21,4 +21,5 @@
 ///\brief The concept of graph components.
 
+
 #ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H
 #define LEMON_CONCEPTS_GRAPH_COMPONENTS_H
@@ -32,16 +33,17 @@
   namespace concepts {
 
-    /// \brief Concept class for \c Node, \c Arc and \c Edge types.
-    ///
-    /// This class describes the concept of \c Node, \c Arc and \c Edge
-    /// subtypes of digraph and graph types.
+    /// \brief Skeleton class for graph Node and Arc types
+    ///
+    /// This class describes the interface of Node and Arc (and Edge
+    /// in undirected graphs) subtypes of graph types.
     ///
     /// \note This class is a template class so that we can use it to
-    /// create graph skeleton classes. The reason for this is that \c Node
-    /// and \c Arc (or \c Edge) types should \e not derive from the same 
-    /// base class. For \c Node you should instantiate it with character
-    /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'.
+    /// create graph skeleton classes. The reason for this is than Node
+    /// and Arc types should \em not derive from the same base class.
+    /// For Node you should instantiate it with character 'n' and for Arc
+    /// with 'a'.
+
 #ifndef DOXYGEN
-    template <char sel = '0'>
+    template <char _selector = '0'>
 #endif
     class GraphItem {
@@ -49,47 +51,43 @@
       /// \brief Default constructor.
       ///
-      /// Default constructor.
       /// \warning The default constructor is not required to set
       /// the item to some well-defined value. So you should consider it
       /// as uninitialized.
       GraphItem() {}
-
       /// \brief Copy constructor.
       ///
       /// Copy constructor.
+      ///
       GraphItem(const GraphItem &) {}
-
-      /// \brief Constructor for conversion from \c INVALID.
-      ///
-      /// Constructor for conversion from \c INVALID.
-      /// It initializes the item to be invalid.
+      /// \brief Invalid constructor \& conversion.
+      ///
+      /// This constructor initializes the item to be invalid.
       /// \sa Invalid for more details.
       GraphItem(Invalid) {}
-
-      /// \brief Assignment operator.
-      ///
-      /// Assignment operator for the item.
-      GraphItem& operator=(const GraphItem&) { return *this; }
-
+      /// \brief Assign operator for nodes.
+      ///
+      /// The nodes are assignable.
+      ///
+      GraphItem& operator=(GraphItem const&) { return *this; }
       /// \brief Equality operator.
       ///
-      /// Equality operator.
-      bool operator==(const GraphItem&) const { return false; }
-
+      /// Two iterators are equal if and only if they represents the
+      /// same node in the graph or both are invalid.
+      bool operator==(GraphItem) const { return false; }
       /// \brief Inequality operator.
       ///
-      /// Inequality operator.
-      bool operator!=(const GraphItem&) const { return false; }
-
-      /// \brief Ordering operator.
-      ///
-      /// This operator defines an ordering of the items.
-      /// It makes possible to use graph item types as key types in 
-      /// associative containers (e.g. \c std::map).
+      /// \sa operator==(const Node& n)
+      ///
+      bool operator!=(GraphItem) const { return false; }
+
+      /// \brief Artificial ordering operator.
+      ///
+      /// To allow the use of graph descriptors as key type in std::map or
+      /// similar associative container we require this.
       ///
       /// \note This operator only have to define some strict ordering of
       /// the items; this order has nothing to do with the iteration
       /// ordering of the items.
-      bool operator<(const GraphItem&) const { return false; }
+      bool operator<(GraphItem) const { return false; }
 
       template<typename _GraphItem>
@@ -103,4 +101,5 @@
 
           bool b;
+          //          b = (ia == ib) && (ia != ib) && (ia < ib);
           b = (ia == ib) && (ia != ib);
           b = (ia == INVALID) && (ib != INVALID);
@@ -113,10 +112,11 @@
     };
 
-    /// \brief Base skeleton class for directed graphs.
-    ///
-    /// This class describes the base interface of directed graph types.
-    /// All digraph %concepts have to conform to this class.
-    /// It just provides types for nodes and arcs and functions 
-    /// to get the source and the target nodes of arcs.
+    /// \brief An empty base directed graph class.
+    ///
+    /// This class provides the minimal set of features needed for a
+    /// directed graph structure. All digraph concepts have to
+    /// conform to this base directed graph. It just provides types
+    /// for nodes and arcs and functions to get the source and the
+    /// target of the arcs.
     class BaseDigraphComponent {
     public:
@@ -126,25 +126,29 @@
       /// \brief Node class of the digraph.
       ///
-      /// This class represents the nodes of the digraph.
+      /// This class represents the Nodes of the digraph.
+      ///
       typedef GraphItem<'n'> Node;
 
       /// \brief Arc class of the digraph.
       ///
-      /// This class represents the arcs of the digraph.
-      typedef GraphItem<'a'> Arc;
-
-      /// \brief Return the source node of an arc.
-      ///
-      /// This function returns the source node of an arc.
-      Node source(const Arc&) const { return INVALID; }
-
-      /// \brief Return the target node of an arc.
-      ///
-      /// This function returns the target node of an arc.
-      Node target(const Arc&) const { return INVALID; }
-
-      /// \brief Return the opposite node on the given arc.
-      ///
-      /// This function returns the opposite node on the given arc.
+      /// This class represents the Arcs of the digraph.
+      ///
+      typedef GraphItem<'e'> Arc;
+
+      /// \brief Gives back the target node of an arc.
+      ///
+      /// Gives back the target node of an arc.
+      ///
+      Node target(const Arc&) const { return INVALID;}
+
+      /// \brief Gives back the source node of an arc.
+      ///
+      /// Gives back the source node of an arc.
+      ///
+      Node source(const Arc&) const { return INVALID;}
+
+      /// \brief Gives back the opposite node on the given arc.
+      ///
+      /// Gives back the opposite node on the given arc.
       Node oppositeNode(const Node&, const Arc&) const {
         return INVALID;
@@ -172,55 +176,50 @@
     };
 
-    /// \brief Base skeleton class for undirected graphs.
-    ///
-    /// This class describes the base interface of undirected graph types.
-    /// All graph %concepts have to conform to this class.
-    /// It extends the interface of \ref BaseDigraphComponent with an
-    /// \c Edge type and functions to get the end nodes of edges,
-    /// to convert from arcs to edges and to get both direction of edges.
+    /// \brief An empty base undirected graph class.
+    ///
+    /// This class provides the minimal set of features needed for an
+    /// undirected graph structure. All undirected graph concepts have
+    /// to conform to this base graph. It just provides types for
+    /// nodes, arcs and edges and functions to get the
+    /// source and the target of the arcs and edges,
+    /// conversion from arcs to edges and function to get
+    /// both direction of the edges.
     class BaseGraphComponent : public BaseDigraphComponent {
     public:
       typedef BaseDigraphComponent::Node Node;
       typedef BaseDigraphComponent::Arc Arc;
-
-      /// \brief Undirected edge class of the graph.
-      ///
-      /// This class represents the undirected edges of the graph.
-      /// Undirected graphs can be used as directed graphs, each edge is
-      /// represented by two opposite directed arcs.
-      class Edge : public GraphItem<'e'> {
+      /// \brief Undirected arc class of the graph.
+      ///
+      /// This class represents the edges of the graph.
+      /// The undirected graphs can be used as a directed graph which
+      /// for each arc contains the opposite arc too so the graph is
+      /// bidirected. The edge represents two opposite
+      /// directed arcs.
+      class Edge : public GraphItem<'u'> {
       public:
-        typedef GraphItem<'e'> Parent;
-
+        typedef GraphItem<'u'> Parent;
         /// \brief Default constructor.
         ///
-        /// Default constructor.
         /// \warning The default constructor is not required to set
         /// the item to some well-defined value. So you should consider it
         /// as uninitialized.
         Edge() {}
-
         /// \brief Copy constructor.
         ///
         /// Copy constructor.
+        ///
         Edge(const Edge &) : Parent() {}
-
-        /// \brief Constructor for conversion from \c INVALID.
-        ///
-        /// Constructor for conversion from \c INVALID.
-        /// It initializes the item to be invalid.
+        /// \brief Invalid constructor \& conversion.
+        ///
+        /// This constructor initializes the item to be invalid.
         /// \sa Invalid for more details.
         Edge(Invalid) {}
-
-        /// \brief Constructor for conversion from an arc.
-        ///
-        /// Constructor for conversion from an arc.
+        /// \brief Converter from arc to edge.
+        ///
         /// Besides the core graph item functionality each arc should
         /// be convertible to the represented edge.
         Edge(const Arc&) {}
-
-        /// \brief Assign an arc to an edge.
-        ///
-        /// This function assigns an arc to an edge.
+        /// \brief Assign arc to edge.
+        ///
         /// Besides the core graph item functionality each arc should
         /// be convertible to the represented edge.
@@ -228,27 +227,5 @@
       };
 
-      /// \brief Return one end node of an edge.
-      ///
-      /// This function returns one end node of an edge.
-      Node u(const Edge&) const { return INVALID; }
-
-      /// \brief Return the other end node of an edge.
-      ///
-      /// This function returns the other end node of an edge.
-      Node v(const Edge&) const { return INVALID; }
-
-      /// \brief Return a directed arc related to an edge.
-      ///
-      /// This function returns a directed arc from its direction and the
-      /// represented edge.
-      Arc direct(const Edge&, bool) const { return INVALID; }
-
-      /// \brief Return a directed arc related to an edge.
-      ///
-      /// This function returns a directed arc from its source node and the
-      /// represented edge.
-      Arc direct(const Edge&, const Node&) const { return INVALID; }
-
-      /// \brief Return the direction of the arc.
+      /// \brief Returns the direction of the arc.
       ///
       /// Returns the direction of the arc. Each arc represents an
@@ -257,9 +234,31 @@
       bool direction(const Arc&) const { return true; }
 
-      /// \brief Return the opposite arc.
-      ///
-      /// This function returns the opposite arc, i.e. the arc representing
-      /// the same edge and has opposite direction.
-      Arc oppositeArc(const Arc&) const { return INVALID; }
+      /// \brief Returns the directed arc.
+      ///
+      /// Returns the directed arc from its direction and the
+      /// represented edge.
+      Arc direct(const Edge&, bool) const { return INVALID;}
+
+      /// \brief Returns the directed arc.
+      ///
+      /// Returns the directed arc from its source and the
+      /// represented edge.
+      Arc direct(const Edge&, const Node&) const { return INVALID;}
+
+      /// \brief Returns the opposite arc.
+      ///
+      /// Returns the opposite arc. It is the arc representing the
+      /// same edge and has opposite direction.
+      Arc oppositeArc(const Arc&) const { return INVALID;}
+
+      /// \brief Gives back one ending of an edge.
+      ///
+      /// Gives back one ending of an edge.
+      Node u(const Edge&) const { return INVALID;}
+
+      /// \brief Gives back the other ending of an edge.
+      ///
+      /// Gives back the other ending of an edge.
+      Node v(const Edge&) const { return INVALID;}
 
       template <typename _Graph>
@@ -271,5 +270,5 @@
         void constraints() {
           checkConcept<BaseDigraphComponent, _Graph>();
-          checkConcept<GraphItem<'e'>, Edge>();
+          checkConcept<GraphItem<'u'>, Edge>();
           {
             Node n;
@@ -279,5 +278,4 @@
             n = graph.v(ue);
             e = graph.direct(ue, true);
-            e = graph.direct(ue, false);
             e = graph.direct(ue, n);
             e = graph.oppositeArc(e);
@@ -293,55 +291,57 @@
     };
 
-    /// \brief Skeleton class for \e idable directed graphs.
-    ///
-    /// This class describes the interface of \e idable directed graphs.
-    /// It extends \ref BaseDigraphComponent with the core ID functions.
-    /// The ids of the items must be unique and immutable.
-    /// This concept is part of the Digraph concept.
-    template <typename BAS = BaseDigraphComponent>
-    class IDableDigraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
+    /// \brief An empty idable base digraph class.
+    ///
+    /// This class provides beside the core digraph features
+    /// core id functions for the digraph structure.
+    /// The most of the base digraphs should conform to this concept.
+    /// The id's are unique and immutable.
+    template <typename _Base = BaseDigraphComponent>
+    class IDableDigraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
 
-      /// \brief Return a unique integer id for the given node.
-      ///
-      /// This function returns a unique integer id for the given node.
-      int id(const Node&) const { return -1; }
-
-      /// \brief Return the node by its unique id.
-      ///
-      /// This function returns the node by its unique id.
-      /// If the digraph does not contain a node with the given id,
-      /// then the result of the function is undefined.
-      Node nodeFromId(int) const { return INVALID; }
-
-      /// \brief Return a unique integer id for the given arc.
-      ///
-      /// This function returns a unique integer id for the given arc.
-      int id(const Arc&) const { return -1; }
-
-      /// \brief Return the arc by its unique id.
-      ///
-      /// This function returns the arc by its unique id.
-      /// If the digraph does not contain an arc with the given id,
-      /// then the result of the function is undefined.
-      Arc arcFromId(int) const { return INVALID; }
-
-      /// \brief Return an integer greater or equal to the maximum
-      /// node id.
-      ///
-      /// This function returns an integer greater or equal to the
-      /// maximum node id.
-      int maxNodeId() const { return -1; }
-
-      /// \brief Return an integer greater or equal to the maximum
-      /// arc id.
-      ///
-      /// This function returns an integer greater or equal to the
-      /// maximum arc id.
-      int maxArcId() const { return -1; }
+      /// \brief Gives back an unique integer id for the Node.
+      ///
+      /// Gives back an unique integer id for the Node.
+      ///
+      int id(const Node&) const { return -1;}
+
+      /// \brief Gives back the node by the unique id.
+      ///
+      /// Gives back the node by the unique id.
+      /// If the digraph does not contain node with the given id
+      /// then the result of the function is undetermined.
+      Node nodeFromId(int) const { return INVALID;}
+
+      /// \brief Gives back an unique integer id for the Arc.
+      ///
+      /// Gives back an unique integer id for the Arc.
+      ///
+      int id(const Arc&) const { return -1;}
+
+      /// \brief Gives back the arc by the unique id.
+      ///
+      /// Gives back the arc by the unique id.
+      /// If the digraph does not contain arc with the given id
+      /// then the result of the function is undetermined.
+      Arc arcFromId(int) const { return INVALID;}
+
+      /// \brief Gives back an integer greater or equal to the maximum
+      /// Node id.
+      ///
+      /// Gives back an integer greater or equal to the maximum Node
+      /// id.
+      int maxNodeId() const { return -1;}
+
+      /// \brief Gives back an integer greater or equal to the maximum
+      /// Arc id.
+      ///
+      /// Gives back an integer greater or equal to the maximum Arc
+      /// id.
+      int maxArcId() const { return -1;}
 
       template <typename _Digraph>
@@ -369,38 +369,38 @@
     };
 
-    /// \brief Skeleton class for \e idable undirected graphs.
-    ///
-    /// This class describes the interface of \e idable undirected
-    /// graphs. It extends \ref IDableDigraphComponent with the core ID
-    /// functions of undirected graphs.
-    /// The ids of the items must be unique and immutable.
-    /// This concept is part of the Graph concept.
-    template <typename BAS = BaseGraphComponent>
-    class IDableGraphComponent : public IDableDigraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
+    /// \brief An empty idable base undirected graph class.
+    ///
+    /// This class provides beside the core undirected graph features
+    /// core id functions for the undirected graph structure.  The
+    /// most of the base undirected graphs should conform to this
+    /// concept.  The id's are unique and immutable.
+    template <typename _Base = BaseGraphComponent>
+    class IDableGraphComponent : public IDableDigraphComponent<_Base> {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Edge Edge;
 
-      using IDableDigraphComponent<Base>::id;
-
-      /// \brief Return a unique integer id for the given edge.
-      ///
-      /// This function returns a unique integer id for the given edge.
-      int id(const Edge&) const { return -1; }
-
-      /// \brief Return the edge by its unique id.
-      ///
-      /// This function returns the edge by its unique id.
-      /// If the graph does not contain an edge with the given id,
-      /// then the result of the function is undefined.
-      Edge edgeFromId(int) const { return INVALID; }
-
-      /// \brief Return an integer greater or equal to the maximum
-      /// edge id.
-      ///
-      /// This function returns an integer greater or equal to the
-      /// maximum edge id.
-      int maxEdgeId() const { return -1; }
+      using IDableDigraphComponent<_Base>::id;
+
+      /// \brief Gives back an unique integer id for the Edge.
+      ///
+      /// Gives back an unique integer id for the Edge.
+      ///
+      int id(const Edge&) const { return -1;}
+
+      /// \brief Gives back the edge by the unique id.
+      ///
+      /// Gives back the edge by the unique id.  If the
+      /// graph does not contain arc with the given id then the
+      /// result of the function is undetermined.
+      Edge edgeFromId(int) const { return INVALID;}
+
+      /// \brief Gives back an integer greater or equal to the maximum
+      /// Edge id.
+      ///
+      /// Gives back an integer greater or equal to the maximum Edge
+      /// id.
+      int maxEdgeId() const { return -1;}
 
       template <typename _Graph>
@@ -408,4 +408,5 @@
 
         void constraints() {
+          checkConcept<Base, _Graph >();
           checkConcept<IDableDigraphComponent<Base>, _Graph >();
           typename _Graph::Edge edge;
@@ -421,59 +422,50 @@
     };
 
-    /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
-    ///
-    /// This class describes the concept of \c NodeIt, \c ArcIt and 
-    /// \c EdgeIt subtypes of digraph and graph types.
-    template <typename GR, typename Item>
-    class GraphItemIt : public Item {
+    /// \brief Skeleton class for graph NodeIt and ArcIt
+    ///
+    /// Skeleton class for graph NodeIt and ArcIt.
+    ///
+    template <typename _Graph, typename _Item>
+    class GraphItemIt : public _Item {
     public:
       /// \brief Default constructor.
       ///
-      /// Default constructor.
-      /// \warning The default constructor is not required to set
-      /// the iterator to some well-defined value. So you should consider it
-      /// as uninitialized.
+      /// @warning The default constructor sets the iterator
+      /// to an undefined value.
       GraphItemIt() {}
-
       /// \brief Copy constructor.
       ///
       /// Copy constructor.
-      GraphItemIt(const GraphItemIt& it) : Item(it) {}
-
-      /// \brief Constructor that sets the iterator to the first item.
-      ///
-      /// Constructor that sets the iterator to the first item.
-      explicit GraphItemIt(const GR&) {}
-
-      /// \brief Constructor for conversion from \c INVALID.
-      ///
-      /// Constructor for conversion from \c INVALID.
-      /// It initializes the iterator to be invalid.
+      ///
+      GraphItemIt(const GraphItemIt& ) {}
+      /// \brief Sets the iterator to the first item.
+      ///
+      /// Sets the iterator to the first item of \c the graph.
+      ///
+      explicit GraphItemIt(const _Graph&) {}
+      /// \brief Invalid constructor \& conversion.
+      ///
+      /// This constructor initializes the item to be invalid.
       /// \sa Invalid for more details.
       GraphItemIt(Invalid) {}
-
-      /// \brief Assignment operator.
-      ///
-      /// Assignment operator for the iterator.
+      /// \brief Assign operator for items.
+      ///
+      /// The items are assignable.
+      ///
       GraphItemIt& operator=(const GraphItemIt&) { return *this; }
-
-      /// \brief Increment the iterator.
-      ///
-      /// This operator increments the iterator, i.e. assigns it to the
-      /// next item.
+      /// \brief Next item.
+      ///
+      /// Assign the iterator to the next item.
+      ///
       GraphItemIt& operator++() { return *this; }
- 
       /// \brief Equality operator
       ///
-      /// Equality operator.
       /// Two iterators are equal if and only if they point to the
       /// same object or both are invalid.
       bool operator==(const GraphItemIt&) const { return true;}
-
       /// \brief Inequality operator
       ///
-      /// Inequality operator.
-      /// Two iterators are equal if and only if they point to the
-      /// same object or both are invalid.
+      /// \sa operator==(Node n)
+      ///
       bool operator!=(const GraphItemIt&) const { return true;}
 
@@ -481,9 +473,6 @@
       struct Constraints {
         void constraints() {
-          checkConcept<GraphItem<>, _GraphItemIt>();
           _GraphItemIt it1(g);
           _GraphItemIt it2;
-          _GraphItemIt it3 = it1;
-          _GraphItemIt it4 = INVALID;
 
           it2 = ++it1;
@@ -491,68 +480,58 @@
           ++(++it1);
 
-          Item bi = it1;
+          _Item bi = it1;
           bi = it2;
         }
-        const GR& g;
-      };
-    };
-
-    /// \brief Concept class for \c InArcIt, \c OutArcIt and 
-    /// \c IncEdgeIt types.
-    ///
-    /// This class describes the concept of \c InArcIt, \c OutArcIt 
-    /// and \c IncEdgeIt subtypes of digraph and graph types.
-    ///
-    /// \note Since these iterator classes do not inherit from the same
-    /// base class, there is an additional template parameter (selector)
-    /// \c sel. For \c InArcIt you should instantiate it with character 
-    /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'.
-    template <typename GR,
-              typename Item = typename GR::Arc,
-              typename Base = typename GR::Node,
-              char sel = '0'>
-    class GraphIncIt : public Item {
+        _Graph& g;
+      };
+    };
+
+    /// \brief Skeleton class for graph InArcIt and OutArcIt
+    ///
+    /// \note Because InArcIt and OutArcIt may not inherit from the same
+    /// base class, the _selector is a additional template parameter. For
+    /// InArcIt you should instantiate it with character 'i' and for
+    /// OutArcIt with 'o'.
+    template <typename _Graph,
+              typename _Item = typename _Graph::Arc,
+              typename _Base = typename _Graph::Node,
+              char _selector = '0'>
+    class GraphIncIt : public _Item {
     public:
       /// \brief Default constructor.
       ///
-      /// Default constructor.
-      /// \warning The default constructor is not required to set
-      /// the iterator to some well-defined value. So you should consider it
-      /// as uninitialized.
+      /// @warning The default constructor sets the iterator
+      /// to an undefined value.
       GraphIncIt() {}
-
       /// \brief Copy constructor.
       ///
       /// Copy constructor.
-      GraphIncIt(const GraphIncIt& it) : Item(it) {}
-
-      /// \brief Constructor that sets the iterator to the first 
-      /// incoming or outgoing arc.
-      ///
-      /// Constructor that sets the iterator to the first arc 
-      /// incoming to or outgoing from the given node.
-      explicit GraphIncIt(const GR&, const Base&) {}
-
-      /// \brief Constructor for conversion from \c INVALID.
-      ///
-      /// Constructor for conversion from \c INVALID.
-      /// It initializes the iterator to be invalid.
+      ///
+      GraphIncIt(GraphIncIt const& gi) : _Item(gi) {}
+      /// \brief Sets the iterator to the first arc incoming into or outgoing
+      /// from the node.
+      ///
+      /// Sets the iterator to the first arc incoming into or outgoing
+      /// from the node.
+      ///
+      explicit GraphIncIt(const _Graph&, const _Base&) {}
+      /// \brief Invalid constructor \& conversion.
+      ///
+      /// This constructor initializes the item to be invalid.
       /// \sa Invalid for more details.
       GraphIncIt(Invalid) {}
-
-      /// \brief Assignment operator.
-      ///
-      /// Assignment operator for the iterator.
-      GraphIncIt& operator=(const GraphIncIt&) { return *this; }
-
-      /// \brief Increment the iterator.
-      ///
-      /// This operator increments the iterator, i.e. assigns it to the
-      /// next arc incoming to or outgoing from the given node.
+      /// \brief Assign operator for iterators.
+      ///
+      /// The iterators are assignable.
+      ///
+      GraphIncIt& operator=(GraphIncIt const&) { return *this; }
+      /// \brief Next item.
+      ///
+      /// Assign the iterator to the next item.
+      ///
       GraphIncIt& operator++() { return *this; }
 
       /// \brief Equality operator
       ///
-      /// Equality operator.
       /// Two iterators are equal if and only if they point to the
       /// same object or both are invalid.
@@ -561,7 +540,6 @@
       /// \brief Inequality operator
       ///
-      /// Inequality operator.
-      /// Two iterators are equal if and only if they point to the
-      /// same object or both are invalid.
+      /// \sa operator==(Node n)
+      ///
       bool operator!=(const GraphIncIt&) const { return true;}
 
@@ -569,33 +547,35 @@
       struct Constraints {
         void constraints() {
-          checkConcept<GraphItem<sel>, _GraphIncIt>();
+          checkConcept<GraphItem<_selector>, _GraphIncIt>();
           _GraphIncIt it1(graph, node);
           _GraphIncIt it2;
-          _GraphIncIt it3 = it1;
-          _GraphIncIt it4 = INVALID;
 
           it2 = ++it1;
           ++it2 = it1;
           ++(++it1);
-          Item e = it1;
+          _Item e = it1;
           e = it2;
-        }
-        const Base& node;
-        const GR& graph;
-      };
-    };
-
-    /// \brief Skeleton class for iterable directed graphs.
-    ///
-    /// This class describes the interface of iterable directed
-    /// graphs. It extends \ref BaseDigraphComponent with the core
-    /// iterable interface.
+
+        }
+
+        _Item arc;
+        _Base node;
+        _Graph graph;
+        _GraphIncIt it;
+      };
+    };
+
+
+    /// \brief An empty iterable digraph class.
+    ///
+    /// This class provides beside the core digraph features
+    /// iterator based iterable interface for the digraph structure.
     /// This concept is part of the Digraph concept.
-    template <typename BAS = BaseDigraphComponent>
-    class IterableDigraphComponent : public BAS {
-
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseDigraphComponent>
+    class IterableDigraphComponent : public _Base {
+
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
@@ -603,59 +583,68 @@
       typedef IterableDigraphComponent Digraph;
 
-      /// \name Base Iteration
-      ///
-      /// This interface provides functions for iteration on digraph items.
+      /// \name Base iteration
+      ///
+      /// This interface provides functions for iteration on digraph items
       ///
       /// @{
 
-      /// \brief Return the first node.
-      ///
-      /// This function gives back the first node in the iteration order.
+      /// \brief Gives back the first node in the iterating order.
+      ///
+      /// Gives back the first node in the iterating order.
+      ///
       void first(Node&) const {}
 
-      /// \brief Return the next node.
-      ///
-      /// This function gives back the next node in the iteration order.
+      /// \brief Gives back the next node in the iterating order.
+      ///
+      /// Gives back the next node in the iterating order.
+      ///
       void next(Node&) const {}
 
-      /// \brief Return the first arc.
-      ///
-      /// This function gives back the first arc in the iteration order.
+      /// \brief Gives back the first arc in the iterating order.
+      ///
+      /// Gives back the first arc in the iterating order.
+      ///
       void first(Arc&) const {}
 
-      /// \brief Return the next arc.
-      ///
-      /// This function gives back the next arc in the iteration order.
+      /// \brief Gives back the next arc in the iterating order.
+      ///
+      /// Gives back the next arc in the iterating order.
+      ///
       void next(Arc&) const {}
 
-      /// \brief Return the first arc incomming to the given node.
-      ///
-      /// This function gives back the first arc incomming to the
+
+      /// \brief Gives back the first of the arcs point to the given
+      /// node.
+      ///
+      /// Gives back the first of the arcs point to the given node.
+      ///
+      void firstIn(Arc&, const Node&) const {}
+
+      /// \brief Gives back the next of the arcs points to the given
+      /// node.
+      ///
+      /// Gives back the next of the arcs points to the given node.
+      ///
+      void nextIn(Arc&) const {}
+
+      /// \brief Gives back the first of the arcs start from the
       /// given node.
-      void firstIn(Arc&, const Node&) const {}
-
-      /// \brief Return the next arc incomming to the given node.
-      ///
-      /// This function gives back the next arc incomming to the
-      /// given node.
-      void nextIn(Arc&) const {}
-
-      /// \brief Return the first arc outgoing form the given node.
-      ///
-      /// This function gives back the first arc outgoing form the
-      /// given node.
+      ///
+      /// Gives back the first of the arcs start from the given node.
+      ///
       void firstOut(Arc&, const Node&) const {}
 
-      /// \brief Return the next arc outgoing form the given node.
-      ///
-      /// This function gives back the next arc outgoing form the
-      /// given node.
+      /// \brief Gives back the next of the arcs start from the given
+      /// node.
+      ///
+      /// Gives back the next of the arcs start from the given node.
+      ///
       void nextOut(Arc&) const {}
 
       /// @}
 
-      /// \name Class Based Iteration
-      ///
-      /// This interface provides iterator classes for digraph items.
+      /// \name Class based iteration
+      ///
+      /// This interface provides functions for iteration on digraph items
       ///
       /// @{
@@ -667,7 +656,7 @@
       typedef GraphItemIt<Digraph, Node> NodeIt;
 
-      /// \brief This iterator goes through each arc.
-      ///
-      /// This iterator goes through each arc.
+      /// \brief This iterator goes through each node.
+      ///
+      /// This iterator goes through each node.
       ///
       typedef GraphItemIt<Digraph, Arc> ArcIt;
@@ -675,5 +664,5 @@
       /// \brief This iterator goes trough the incoming arcs of a node.
       ///
-      /// This iterator goes trough the \e incoming arcs of a certain node
+      /// This iterator goes trough the \e inccoming arcs of a certain node
       /// of a digraph.
       typedef GraphIncIt<Digraph, Arc, Node, 'i'> InArcIt;
@@ -687,24 +676,24 @@
       /// \brief The base node of the iterator.
       ///
-      /// This function gives back the base node of the iterator.
-      /// It is always the target node of the pointed arc.
+      /// Gives back the base node of the iterator.
+      /// It is always the target of the pointed arc.
       Node baseNode(const InArcIt&) const { return INVALID; }
 
       /// \brief The running node of the iterator.
       ///
-      /// This function gives back the running node of the iterator.
-      /// It is always the source node of the pointed arc.
+      /// Gives back the running node of the iterator.
+      /// It is always the source of the pointed arc.
       Node runningNode(const InArcIt&) const { return INVALID; }
 
       /// \brief The base node of the iterator.
       ///
-      /// This function gives back the base node of the iterator.
-      /// It is always the source node of the pointed arc.
+      /// Gives back the base node of the iterator.
+      /// It is always the source of the pointed arc.
       Node baseNode(const OutArcIt&) const { return INVALID; }
 
       /// \brief The running node of the iterator.
       ///
-      /// This function gives back the running node of the iterator.
-      /// It is always the target node of the pointed arc.
+      /// Gives back the running node of the iterator.
+      /// It is always the target of the pointed arc.
       Node runningNode(const OutArcIt&) const { return INVALID; }
 
@@ -748,10 +737,10 @@
 
             typename _Digraph::Node n;
-            const typename _Digraph::InArcIt iait(INVALID);
-            const typename _Digraph::OutArcIt oait(INVALID);
-            n = digraph.baseNode(iait);
-            n = digraph.runningNode(iait);
-            n = digraph.baseNode(oait);
-            n = digraph.runningNode(oait);
+            typename _Digraph::InArcIt ieit(INVALID);
+            typename _Digraph::OutArcIt oeit(INVALID);
+            n = digraph.baseNode(ieit);
+            n = digraph.runningNode(ieit);
+            n = digraph.baseNode(oeit);
+            n = digraph.runningNode(oeit);
             ignore_unused_variable_warning(n);
           }
@@ -759,18 +748,18 @@
 
         const _Digraph& digraph;
-      };
-    };
-
-    /// \brief Skeleton class for iterable undirected graphs.
-    ///
-    /// This class describes the interface of iterable undirected
-    /// graphs. It extends \ref IterableDigraphComponent with the core
-    /// iterable interface of undirected graphs.
+
+      };
+    };
+
+    /// \brief An empty iterable undirected graph class.
+    ///
+    /// This class provides beside the core graph features iterator
+    /// based iterable interface for the undirected graph structure.
     /// This concept is part of the Graph concept.
-    template <typename BAS = BaseGraphComponent>
-    class IterableGraphComponent : public IterableDigraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseGraphComponent>
+    class IterableGraphComponent : public IterableDigraphComponent<_Base> {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
@@ -780,29 +769,34 @@
       typedef IterableGraphComponent Graph;
 
-      /// \name Base Iteration
-      ///
-      /// This interface provides functions for iteration on edges.
-      ///
+      /// \name Base iteration
+      ///
+      /// This interface provides functions for iteration on graph items
       /// @{
 
-      using IterableDigraphComponent<Base>::first;
-      using IterableDigraphComponent<Base>::next;
-
-      /// \brief Return the first edge.
-      ///
-      /// This function gives back the first edge in the iteration order.
+      using IterableDigraphComponent<_Base>::first;
+      using IterableDigraphComponent<_Base>::next;
+
+      /// \brief Gives back the first edge in the iterating
+      /// order.
+      ///
+      /// Gives back the first edge in the iterating order.
+      ///
       void first(Edge&) const {}
 
-      /// \brief Return the next edge.
-      ///
-      /// This function gives back the next edge in the iteration order.
+      /// \brief Gives back the next edge in the iterating
+      /// order.
+      ///
+      /// Gives back the next edge in the iterating order.
+      ///
       void next(Edge&) const {}
 
-      /// \brief Return the first edge incident to the given node.
-      ///
-      /// This function gives back the first edge incident to the given 
-      /// node. The bool parameter gives back the direction for which the
-      /// source node of the directed arc representing the edge is the 
+
+      /// \brief Gives back the first of the edges from the
       /// given node.
+      ///
+      /// Gives back the first of the edges from the given
+      /// node. The bool parameter gives back that direction which
+      /// gives a good direction of the edge so the source of the
+      /// directed arc is the given node.
       void firstInc(Edge&, bool&, const Node&) const {}
 
@@ -810,39 +804,38 @@
       /// given node.
       ///
-      /// This function gives back the next edge incident to the given 
-      /// node. The bool parameter should be used as \c firstInc() use it.
+      /// Gives back the next of the edges from the given
+      /// node. The bool parameter should be used as the \c firstInc()
+      /// use it.
       void nextInc(Edge&, bool&) const {}
 
-      using IterableDigraphComponent<Base>::baseNode;
-      using IterableDigraphComponent<Base>::runningNode;
+      using IterableDigraphComponent<_Base>::baseNode;
+      using IterableDigraphComponent<_Base>::runningNode;
 
       /// @}
 
-      /// \name Class Based Iteration
-      ///
-      /// This interface provides iterator classes for edges.
+      /// \name Class based iteration
+      ///
+      /// This interface provides functions for iteration on graph items
       ///
       /// @{
 
-      /// \brief This iterator goes through each edge.
-      ///
-      /// This iterator goes through each edge.
+      /// \brief This iterator goes through each node.
+      ///
+      /// This iterator goes through each node.
       typedef GraphItemIt<Graph, Edge> EdgeIt;
-
-      /// \brief This iterator goes trough the incident edges of a
+      /// \brief This iterator goes trough the incident arcs of a
       /// node.
       ///
-      /// This iterator goes trough the incident edges of a certain
+      /// This iterator goes trough the incident arcs of a certain
       /// node of a graph.
-      typedef GraphIncIt<Graph, Edge, Node, 'e'> IncEdgeIt;
-
+      typedef GraphIncIt<Graph, Edge, Node, 'u'> IncEdgeIt;
       /// \brief The base node of the iterator.
       ///
-      /// This function gives back the base node of the iterator.
+      /// Gives back the base node of the iterator.
       Node baseNode(const IncEdgeIt&) const { return INVALID; }
 
       /// \brief The running node of the iterator.
       ///
-      /// This function gives back the running node of the iterator.
+      /// Gives back the running node of the iterator.
       Node runningNode(const IncEdgeIt&) const { return INVALID; }
 
@@ -873,52 +866,52 @@
               typename _Graph::EdgeIt >();
             checkConcept<GraphIncIt<_Graph, typename _Graph::Edge,
-              typename _Graph::Node, 'e'>, typename _Graph::IncEdgeIt>();
+              typename _Graph::Node, 'u'>, typename _Graph::IncEdgeIt>();
 
             typename _Graph::Node n;
-            const typename _Graph::IncEdgeIt ieit(INVALID);
-            n = graph.baseNode(ieit);
-            n = graph.runningNode(ieit);
+            typename _Graph::IncEdgeIt ueit(INVALID);
+            n = graph.baseNode(ueit);
+            n = graph.runningNode(ueit);
           }
         }
 
         const _Graph& graph;
-      };
-    };
-
-    /// \brief Skeleton class for alterable directed graphs.
-    ///
-    /// This class describes the interface of alterable directed
-    /// graphs. It extends \ref BaseDigraphComponent with the alteration
-    /// notifier interface. It implements
+
+      };
+    };
+
+    /// \brief An empty alteration notifier digraph class.
+    ///
+    /// This class provides beside the core digraph features alteration
+    /// notifier interface for the digraph structure.  This implements
     /// an observer-notifier pattern for each digraph item. More
     /// obsevers can be registered into the notifier and whenever an
-    /// alteration occured in the digraph all the observers will be
+    /// alteration occured in the digraph all the observers will
     /// notified about it.
-    template <typename BAS = BaseDigraphComponent>
-    class AlterableDigraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseDigraphComponent>
+    class AlterableDigraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
 
 
-      /// Node alteration notifier class.
+      /// The node observer registry.
       typedef AlterationNotifier<AlterableDigraphComponent, Node>
       NodeNotifier;
-      /// Arc alteration notifier class.
+      /// The arc observer registry.
       typedef AlterationNotifier<AlterableDigraphComponent, Arc>
       ArcNotifier;
 
-      /// \brief Return the node alteration notifier.
-      ///
-      /// This function gives back the node alteration notifier.
+      /// \brief Gives back the node alteration notifier.
+      ///
+      /// Gives back the node alteration notifier.
       NodeNotifier& notifier(Node) const {
-         return NodeNotifier();
+        return NodeNotifier();
       }
 
-      /// \brief Return the arc alteration notifier.
-      ///
-      /// This function gives back the arc alteration notifier.
+      /// \brief Gives back the arc alteration notifier.
+      ///
+      /// Gives back the arc alteration notifier.
       ArcNotifier& notifier(Arc) const {
         return ArcNotifier();
@@ -940,31 +933,32 @@
 
         const _Digraph& digraph;
-      };
-    };
-
-    /// \brief Skeleton class for alterable undirected graphs.
-    ///
-    /// This class describes the interface of alterable undirected
-    /// graphs. It extends \ref AlterableDigraphComponent with the alteration
-    /// notifier interface of undirected graphs. It implements
-    /// an observer-notifier pattern for the edges. More
+
+      };
+
+    };
+
+    /// \brief An empty alteration notifier undirected graph class.
+    ///
+    /// This class provides beside the core graph features alteration
+    /// notifier interface for the graph structure.  This implements
+    /// an observer-notifier pattern for each graph item. More
     /// obsevers can be registered into the notifier and whenever an
-    /// alteration occured in the graph all the observers will be
+    /// alteration occured in the graph all the observers will
     /// notified about it.
-    template <typename BAS = BaseGraphComponent>
-    class AlterableGraphComponent : public AlterableDigraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseGraphComponent>
+    class AlterableGraphComponent : public AlterableDigraphComponent<_Base> {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Edge Edge;
 
 
-      /// Edge alteration notifier class.
+      /// The arc observer registry.
       typedef AlterationNotifier<AlterableGraphComponent, Edge>
       EdgeNotifier;
 
-      /// \brief Return the edge alteration notifier.
-      ///
-      /// This function gives back the edge alteration notifier.
+      /// \brief Gives back the arc alteration notifier.
+      ///
+      /// Gives back the arc alteration notifier.
       EdgeNotifier& notifier(Edge) const {
         return EdgeNotifier();
@@ -974,5 +968,5 @@
       struct Constraints {
         void constraints() {
-          checkConcept<AlterableDigraphComponent<Base>, _Graph>();
+          checkConcept<AlterableGraphComponent<Base>, _Graph>();
           typename _Graph::EdgeNotifier& uen
             = graph.notifier(typename _Graph::Edge());
@@ -981,32 +975,26 @@
 
         const _Graph& graph;
-      };
-    };
-
-    /// \brief Concept class for standard graph maps.
-    ///
-    /// This class describes the concept of standard graph maps, i.e.
-    /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 
-    /// graph types, which can be used for associating data to graph items.
-    /// The standard graph maps must conform to the ReferenceMap concept.
-    template <typename GR, typename K, typename V>
-    class GraphMap : public ReferenceMap<K, V, V&, const V&> {
-    public:
-
-      typedef ReadWriteMap<K, V> Parent;
+
+      };
+
+    };
+
+    /// \brief Class describing the concept of graph maps
+    ///
+    /// This class describes the common interface of the graph maps
+    /// (NodeMap, ArcMap), that is maps that can be used to
+    /// associate data to graph descriptors (nodes or arcs).
+    template <typename _Graph, typename _Item, typename _Value>
+    class GraphMap : public ReadWriteMap<_Item, _Value> {
+    public:
+
+      typedef ReadWriteMap<_Item, _Value> Parent;
 
       /// The graph type of the map.
-      typedef GR Graph;
+      typedef _Graph Graph;
       /// The key type of the map.
-      typedef K Key;
+      typedef _Item Key;
       /// The value type of the map.
-      typedef V Value;
-      /// The reference type of the map.
-      typedef Value& Reference;
-      /// The const reference type of the map.
-      typedef const Value& ConstReference;
-
-      // The reference map tag.
-      typedef True ReferenceMapTag;
+      typedef _Value Value;
 
       /// \brief Construct a new map.
@@ -1016,5 +1004,5 @@
       /// \brief Construct a new map with default value.
       ///
-      /// Construct a new map for the graph and initalize the values.
+      /// Construct a new map for the graph and initalise the values.
       GraphMap(const Graph&, const Value&) {}
 
@@ -1025,7 +1013,7 @@
       GraphMap(const GraphMap&) : Parent() {}
 
-      /// \brief Assignment operator.
-      ///
-      /// Assignment operator. It does not mofify the underlying graph,
+      /// \brief Assign operator.
+      ///
+      /// Assign operator. It does not mofify the underlying graph,
       /// it just iterates on the current item set and set the  map
       /// with the value returned by the assigned map.
@@ -1040,22 +1028,21 @@
       struct Constraints {
         void constraints() {
-          checkConcept
-            <ReferenceMap<Key, Value, Value&, const Value&>, _Map>();
-          _Map m1(g);
-          _Map m2(g,t);
-          
-          // Copy constructor
-          // _Map m3(m);
-
-          // Assignment operator
+          checkConcept<ReadWriteMap<Key, Value>, _Map >();
+          // Construction with a graph parameter
+          _Map a(g);
+          // Constructor with a graph and a default value parameter
+          _Map a2(g,t);
+          // Copy constructor.
+          // _Map b(c);
+
           // ReadMap<Key, Value> cmap;
-          // m3 = cmap;
-
-          ignore_unused_variable_warning(m1);
-          ignore_unused_variable_warning(m2);
-          // ignore_unused_variable_warning(m3);
-        }
-
-        const _Map &m;
+          // b = cmap;
+
+          ignore_unused_variable_warning(a);
+          ignore_unused_variable_warning(a2);
+          // ignore_unused_variable_warning(b);
+        }
+
+        const _Map &c;
         const Graph &g;
         const typename GraphMap::Value &t;
@@ -1064,15 +1051,14 @@
     };
 
-    /// \brief Skeleton class for mappable directed graphs.
-    ///
-    /// This class describes the interface of mappable directed graphs.
-    /// It extends \ref BaseDigraphComponent with the standard digraph 
-    /// map classes, namely \c NodeMap and \c ArcMap.
+    /// \brief An empty mappable digraph class.
+    ///
+    /// This class provides beside the core digraph features
+    /// map interface for the digraph structure.
     /// This concept is part of the Digraph concept.
-    template <typename BAS = BaseDigraphComponent>
-    class MappableDigraphComponent : public BAS  {
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseDigraphComponent>
+    class MappableDigraphComponent : public _Base  {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
@@ -1080,12 +1066,12 @@
       typedef MappableDigraphComponent Digraph;
 
-      /// \brief Standard graph map for the nodes.
-      ///
-      /// Standard graph map for the nodes.
-      /// It conforms to the ReferenceMap concept.
-      template <typename V>
-      class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
+      /// \brief ReadWrite map of the nodes.
+      ///
+      /// ReadWrite map of the nodes.
+      ///
+      template <typename _Value>
+      class NodeMap : public GraphMap<Digraph, Node, _Value> {
       public:
-        typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
+        typedef GraphMap<MappableDigraphComponent, Node, _Value> Parent;
 
         /// \brief Construct a new map.
@@ -1097,6 +1083,6 @@
         /// \brief Construct a new map with default value.
         ///
-        /// Construct a new map for the digraph and initalize the values.
-        NodeMap(const MappableDigraphComponent& digraph, const V& value)
+        /// Construct a new map for the digraph and initalise the values.
+        NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
           : Parent(digraph, value) {}
 
@@ -1107,10 +1093,10 @@
         NodeMap(const NodeMap& nm) : Parent(nm) {}
 
-        /// \brief Assignment operator.
-        ///
-        /// Assignment operator.
+        /// \brief Assign operator.
+        ///
+        /// Assign operator.
         template <typename CMap>
         NodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, V>, CMap>();
+          checkConcept<ReadMap<Node, _Value>, CMap>();
           return *this;
         }
@@ -1118,12 +1104,12 @@
       };
 
-      /// \brief Standard graph map for the arcs.
-      ///
-      /// Standard graph map for the arcs.
-      /// It conforms to the ReferenceMap concept.
-      template <typename V>
-      class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
+      /// \brief ReadWrite map of the arcs.
+      ///
+      /// ReadWrite map of the arcs.
+      ///
+      template <typename _Value>
+      class ArcMap : public GraphMap<Digraph, Arc, _Value> {
       public:
-        typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
+        typedef GraphMap<MappableDigraphComponent, Arc, _Value> Parent;
 
         /// \brief Construct a new map.
@@ -1135,6 +1121,6 @@
         /// \brief Construct a new map with default value.
         ///
-        /// Construct a new map for the digraph and initalize the values.
-        ArcMap(const MappableDigraphComponent& digraph, const V& value)
+        /// Construct a new map for the digraph and initalise the values.
+        ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
           : Parent(digraph, value) {}
 
@@ -1145,10 +1131,10 @@
         ArcMap(const ArcMap& nm) : Parent(nm) {}
 
-        /// \brief Assignment operator.
-        ///
-        /// Assignment operator.
+        /// \brief Assign operator.
+        ///
+        /// Assign operator.
         template <typename CMap>
         ArcMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Arc, V>, CMap>();
+          checkConcept<ReadMap<Arc, _Value>, CMap>();
           return *this;
         }
@@ -1197,31 +1183,30 @@
         }
 
-        const _Digraph& digraph;
-      };
-    };
-
-    /// \brief Skeleton class for mappable undirected graphs.
-    ///
-    /// This class describes the interface of mappable undirected graphs.
-    /// It extends \ref MappableDigraphComponent with the standard graph 
-    /// map class for edges (\c EdgeMap).
+        _Digraph& digraph;
+      };
+    };
+
+    /// \brief An empty mappable base bipartite graph class.
+    ///
+    /// This class provides beside the core graph features
+    /// map interface for the graph structure.
     /// This concept is part of the Graph concept.
-    template <typename BAS = BaseGraphComponent>
-    class MappableGraphComponent : public MappableDigraphComponent<BAS>  {
-    public:
-
-      typedef BAS Base;
+    template <typename _Base = BaseGraphComponent>
+    class MappableGraphComponent : public MappableDigraphComponent<_Base>  {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Edge Edge;
 
       typedef MappableGraphComponent Graph;
 
-      /// \brief Standard graph map for the edges.
-      ///
-      /// Standard graph map for the edges.
-      /// It conforms to the ReferenceMap concept.
-      template <typename V>
-      class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
+      /// \brief ReadWrite map of the edges.
+      ///
+      /// ReadWrite map of the edges.
+      ///
+      template <typename _Value>
+      class EdgeMap : public GraphMap<Graph, Edge, _Value> {
       public:
-        typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
+        typedef GraphMap<MappableGraphComponent, Edge, _Value> Parent;
 
         /// \brief Construct a new map.
@@ -1233,6 +1218,6 @@
         /// \brief Construct a new map with default value.
         ///
-        /// Construct a new map for the graph and initalize the values.
-        EdgeMap(const MappableGraphComponent& graph, const V& value)
+        /// Construct a new map for the graph and initalise the values.
+        EdgeMap(const MappableGraphComponent& graph, const _Value& value)
           : Parent(graph, value) {}
 
@@ -1243,10 +1228,10 @@
         EdgeMap(const EdgeMap& nm) : Parent(nm) {}
 
-        /// \brief Assignment operator.
-        ///
-        /// Assignment operator.
+        /// \brief Assign operator.
+        ///
+        /// Assign operator.
         template <typename CMap>
         EdgeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Edge, V>, CMap>();
+          checkConcept<ReadMap<Edge, _Value>, CMap>();
           return *this;
         }
@@ -1265,5 +1250,5 @@
 
         void constraints() {
-          checkConcept<MappableDigraphComponent<Base>, _Graph>();
+          checkConcept<MappableGraphComponent<Base>, _Graph>();
 
           { // int map test
@@ -1282,33 +1267,33 @@
         }
 
-        const _Graph& graph;
-      };
-    };
-
-    /// \brief Skeleton class for extendable directed graphs.
-    ///
-    /// This class describes the interface of extendable directed graphs.
-    /// It extends \ref BaseDigraphComponent with functions for adding 
-    /// nodes and arcs to the digraph.
-    /// This concept requires \ref AlterableDigraphComponent.
-    template <typename BAS = BaseDigraphComponent>
-    class ExtendableDigraphComponent : public BAS {
-    public:
-      typedef BAS Base;
-
-      typedef typename Base::Node Node;
-      typedef typename Base::Arc Arc;
-
-      /// \brief Add a new node to the digraph.
-      ///
-      /// This function adds a new node to the digraph.
+        _Graph& graph;
+      };
+    };
+
+    /// \brief An empty extendable digraph class.
+    ///
+    /// This class provides beside the core digraph features digraph
+    /// extendable interface for the digraph structure.  The main
+    /// difference between the base and this interface is that the
+    /// digraph alterations should handled already on this level.
+    template <typename _Base = BaseDigraphComponent>
+    class ExtendableDigraphComponent : public _Base {
+    public:
+      typedef _Base Base;
+
+      typedef typename _Base::Node Node;
+      typedef typename _Base::Arc Arc;
+
+      /// \brief Adds a new node to the digraph.
+      ///
+      /// Adds a new node to the digraph.
+      ///
       Node addNode() {
         return INVALID;
       }
 
-      /// \brief Add a new arc connecting the given two nodes.
-      ///
-      /// This function adds a new arc connecting the given two nodes
-      /// of the digraph.
+      /// \brief Adds a new arc connects the given two nodes.
+      ///
+      /// Adds a new arc connects the the given two nodes.
       Arc addArc(const Node&, const Node&) {
         return INVALID;
@@ -1330,30 +1315,31 @@
     };
 
-    /// \brief Skeleton class for extendable undirected graphs.
-    ///
-    /// This class describes the interface of extendable undirected graphs.
-    /// It extends \ref BaseGraphComponent with functions for adding 
-    /// nodes and edges to the graph.
-    /// This concept requires \ref AlterableGraphComponent.
-    template <typename BAS = BaseGraphComponent>
-    class ExtendableGraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
-      typedef typename Base::Node Node;
-      typedef typename Base::Edge Edge;
-
-      /// \brief Add a new node to the digraph.
-      ///
-      /// This function adds a new node to the digraph.
+    /// \brief An empty extendable base undirected graph class.
+    ///
+    /// This class provides beside the core undirected graph features
+    /// core undircted graph extend interface for the graph structure.
+    /// The main difference between the base and this interface is
+    /// that the graph alterations should handled already on this
+    /// level.
+    template <typename _Base = BaseGraphComponent>
+    class ExtendableGraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
+      typedef typename _Base::Node Node;
+      typedef typename _Base::Edge Edge;
+
+      /// \brief Adds a new node to the graph.
+      ///
+      /// Adds a new node to the graph.
+      ///
       Node addNode() {
         return INVALID;
       }
 
-      /// \brief Add a new edge connecting the given two nodes.
-      ///
-      /// This function adds a new edge connecting the given two nodes
-      /// of the graph.
-      Edge addEdge(const Node&, const Node&) {
+      /// \brief Adds a new arc connects the given two nodes.
+      ///
+      /// Adds a new arc connects the the given two nodes.
+      Edge addArc(const Node&, const Node&) {
         return INVALID;
       }
@@ -1374,15 +1360,15 @@
     };
 
-    /// \brief Skeleton class for erasable directed graphs.
-    ///
-    /// This class describes the interface of erasable directed graphs.
-    /// It extends \ref BaseDigraphComponent with functions for removing 
-    /// nodes and arcs from the digraph.
-    /// This concept requires \ref AlterableDigraphComponent.
-    template <typename BAS = BaseDigraphComponent>
-    class ErasableDigraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
+    /// \brief An empty erasable digraph class.
+    ///
+    /// This class provides beside the core digraph features core erase
+    /// functions for the digraph structure. The main difference between
+    /// the base and this interface is that the digraph alterations
+    /// should handled already on this level.
+    template <typename _Base = BaseDigraphComponent>
+    class ErasableDigraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Arc Arc;
@@ -1390,11 +1376,12 @@
       /// \brief Erase a node from the digraph.
       ///
-      /// This function erases the given node from the digraph and all arcs 
-      /// connected to the node.
+      /// Erase a node from the digraph. This function should
+      /// erase all arcs connecting to the node.
       void erase(const Node&) {}
 
       /// \brief Erase an arc from the digraph.
       ///
-      /// This function erases the given arc from the digraph.
+      /// Erase an arc from the digraph.
+      ///
       void erase(const Arc&) {}
 
@@ -1403,7 +1390,7 @@
         void constraints() {
           checkConcept<Base, _Digraph>();
-          const typename _Digraph::Node node(INVALID);
+          typename _Digraph::Node node;
           digraph.erase(node);
-          const typename _Digraph::Arc arc(INVALID);
+          typename _Digraph::Arc arc;
           digraph.erase(arc);
         }
@@ -1413,15 +1400,15 @@
     };
 
-    /// \brief Skeleton class for erasable undirected graphs.
-    ///
-    /// This class describes the interface of erasable undirected graphs.
-    /// It extends \ref BaseGraphComponent with functions for removing 
-    /// nodes and edges from the graph.
-    /// This concept requires \ref AlterableGraphComponent.
-    template <typename BAS = BaseGraphComponent>
-    class ErasableGraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
+    /// \brief An empty erasable base undirected graph class.
+    ///
+    /// This class provides beside the core undirected graph features
+    /// core erase functions for the undirceted graph structure. The
+    /// main difference between the base and this interface is that
+    /// the graph alterations should handled already on this level.
+    template <typename _Base = BaseGraphComponent>
+    class ErasableGraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
       typedef typename Base::Node Node;
       typedef typename Base::Edge Edge;
@@ -1429,11 +1416,12 @@
       /// \brief Erase a node from the graph.
       ///
-      /// This function erases the given node from the graph and all edges
-      /// connected to the node.
+      /// Erase a node from the graph. This function should erase
+      /// arcs connecting to the node.
       void erase(const Node&) {}
 
-      /// \brief Erase an edge from the digraph.
-      ///
-      /// This function erases the given edge from the digraph.
+      /// \brief Erase an arc from the graph.
+      ///
+      /// Erase an arc from the graph.
+      ///
       void erase(const Edge&) {}
 
@@ -1442,7 +1430,7 @@
         void constraints() {
           checkConcept<Base, _Graph>();
-          const typename _Graph::Node node(INVALID);
+          typename _Graph::Node node;
           graph.erase(node);
-          const typename _Graph::Edge edge(INVALID);
+          typename _Graph::Edge edge;
           graph.erase(edge);
         }
@@ -1452,19 +1440,20 @@
     };
 
-    /// \brief Skeleton class for clearable directed graphs.
-    ///
-    /// This class describes the interface of clearable directed graphs.
-    /// It extends \ref BaseDigraphComponent with a function for clearing
-    /// the digraph.
-    /// This concept requires \ref AlterableDigraphComponent.
-    template <typename BAS = BaseDigraphComponent>
-    class ClearableDigraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
+    /// \brief An empty clearable base digraph class.
+    ///
+    /// This class provides beside the core digraph features core clear
+    /// functions for the digraph structure. The main difference between
+    /// the base and this interface is that the digraph alterations
+    /// should handled already on this level.
+    template <typename _Base = BaseDigraphComponent>
+    class ClearableDigraphComponent : public _Base {
+    public:
+
+      typedef _Base Base;
 
       /// \brief Erase all nodes and arcs from the digraph.
       ///
-      /// This function erases all nodes and arcs from the digraph.
+      /// Erase all nodes and arcs from the digraph.
+      ///
       void clear() {}
 
@@ -1476,33 +1465,27 @@
         }
 
-        _Digraph& digraph;
-      };
-    };
-
-    /// \brief Skeleton class for clearable undirected graphs.
-    ///
-    /// This class describes the interface of clearable undirected graphs.
-    /// It extends \ref BaseGraphComponent with a function for clearing
-    /// the graph.
-    /// This concept requires \ref AlterableGraphComponent.
-    template <typename BAS = BaseGraphComponent>
-    class ClearableGraphComponent : public ClearableDigraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
-
-      /// \brief Erase all nodes and edges from the graph.
-      ///
-      /// This function erases all nodes and edges from the graph.
-      void clear() {}
+        _Digraph digraph;
+      };
+    };
+
+    /// \brief An empty clearable base undirected graph class.
+    ///
+    /// This class provides beside the core undirected graph features
+    /// core clear functions for the undirected graph structure. The
+    /// main difference between the base and this interface is that
+    /// the graph alterations should handled already on this level.
+    template <typename _Base = BaseGraphComponent>
+    class ClearableGraphComponent : public ClearableDigraphComponent<_Base> {
+    public:
+
+      typedef _Base Base;
 
       template <typename _Graph>
       struct Constraints {
         void constraints() {
-          checkConcept<Base, _Graph>();
-          graph.clear();
-        }
-
-        _Graph& graph;
+          checkConcept<ClearableGraphComponent<Base>, _Graph>();
+        }
+
+        _Graph graph;
       };
     };
Index: lemon/concepts/heap.h
===================================================================
--- lemon/concepts/heap.h	(revision 584)
+++ lemon/concepts/heap.h	(revision 529)
@@ -36,29 +36,14 @@
     /// \brief The heap concept.
     ///
-    /// Concept class describing the main interface of heaps. A \e heap
-    /// is a data structure for storing items with specified values called
-    /// \e priorities in such a way that finding the item with minimum
-    /// priority is efficient. In a heap one can change the priority of an
-    /// item, add or erase an item, etc.
-    ///
-    /// \tparam PR Type of the priority of the items.
-    /// \tparam IM A read and writable item map with int values, used
-    /// internally to handle the cross references.
-    /// \tparam Comp A functor class for the ordering of the priorities.
-    /// The default is \c std::less<PR>.
-#ifdef DOXYGEN
-    template <typename PR, typename IM, typename Comp = std::less<PR> >
-#else
-    template <typename PR, typename IM>
-#endif
+    /// Concept class describing the main interface of heaps.
+    template <typename Priority, typename ItemIntMap>
     class Heap {
     public:
 
-      /// Type of the item-int map.
-      typedef IM ItemIntMap;
-      /// Type of the priorities.
-      typedef PR Prio;
       /// Type of the items stored in the heap.
       typedef typename ItemIntMap::Key Item;
+
+      /// Type of the priorities.
+      typedef Priority Prio;
 
       /// \brief Type to represent the states of the items.
@@ -69,10 +54,10 @@
       /// the user.
       ///
-      /// The item-int map must be initialized in such way that it assigns
-      /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.
+      /// The \c ItemIntMap must be initialized in such a way, that it
+      /// assigns \c PRE_HEAP (<tt>-1</tt>) to every item.
       enum State {
-        IN_HEAP = 0,    ///< = 0. The "in heap" state constant.
-        PRE_HEAP = -1,  ///< = -1. The "pre heap" state constant.
-        POST_HEAP = -2  ///< = -2. The "post heap" state constant.
+        IN_HEAP = 0,
+        PRE_HEAP = -1,
+        POST_HEAP = -2
       };
 
@@ -135,6 +120,6 @@
       ///
       /// Returns the priority of the given item.
-      /// \param i The item.
       /// \pre \c i must be in the heap.
+      /// \param i The item.
       Prio operator[](const Item &i) const {}
 
@@ -153,7 +138,7 @@
       ///
       /// Decreases the priority of an item to the given value.
+      /// \pre \c i must be stored in the heap with priority at least \c p.
       /// \param i The item.
       /// \param p The priority.
-      /// \pre \c i must be stored in the heap with priority at least \c p.
       void decrease(const Item &i, const Prio &p) {}
 
@@ -161,7 +146,7 @@
       ///
       /// Increases the priority of an item to the given value.
+      /// \pre \c i must be stored in the heap with priority at most \c p.
       /// \param i The item.
       /// \param p The priority.
-      /// \pre \c i must be stored in the heap with priority at most \c p.
       void increase(const Item &i, const Prio &p) {}
 
Index: lemon/concepts/path.h
===================================================================
--- lemon/concepts/path.h	(revision 559)
+++ lemon/concepts/path.h	(revision 529)
@@ -39,5 +39,5 @@
     /// A skeleton structure for representing directed paths in a
     /// digraph.
-    /// \tparam GR The digraph type in which the path is.
+    /// \tparam _Digraph The digraph type in which the path is.
     ///
     /// In a sense, the path can be treated as a list of arcs. The
@@ -46,10 +46,10 @@
     /// paths cannot store the source.
     ///
-    template <typename GR>
+    template <typename _Digraph>
     class Path {
     public:
 
       /// Type of the underlying digraph.
-      typedef GR Digraph;
+      typedef _Digraph Digraph;
       /// Arc type of the underlying digraph.
       typedef typename Digraph::Arc Arc;
@@ -206,15 +206,16 @@
     /// assigned to a real path and the dumpers can be implemented as
     /// an adaptor class to the predecessor map.
-    ///
-    /// \tparam GR The digraph type in which the path is.
+
+    /// \tparam _Digraph  The digraph type in which the path is.
     ///
     /// The paths can be constructed from any path type by a
     /// template constructor or a template assignment operator.
-    template <typename GR>
+    ///
+    template <typename _Digraph>
     class PathDumper {
     public:
 
       /// Type of the underlying digraph.
-      typedef GR Digraph;
+      typedef _Digraph Digraph;
       /// Arc type of the underlying digraph.
       typedef typename Digraph::Arc Arc;
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 567)
+++ lemon/config.h.in	(revision 517)
@@ -19,5 +19,2 @@
 /* Define to 1 if you have CLP */
 #undef HAVE_CLP
-
-/* Define to 1 if you have CBC */
-#undef HAVE_CBC
Index: lemon/connectivity.h
===================================================================
--- lemon/connectivity.h	(revision 586)
+++ lemon/connectivity.h	(revision 440)
@@ -33,5 +33,5 @@
 #include <functional>
 
-/// \ingroup graph_properties
+/// \ingroup connectivity
 /// \file
 /// \brief Connectivity algorithms
@@ -41,5 +41,5 @@
 namespace lemon {
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check whether the given undirected graph is connected.
@@ -47,5 +47,5 @@
   /// Check whether the given undirected graph is connected.
   /// \param graph The undirected graph.
-  /// \return \c true when there is path between any two nodes in the graph.
+  /// \return %True when there is path between any two nodes in the graph.
   /// \note By definition, the empty graph is connected.
   template <typename Graph>
@@ -64,5 +64,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Count the number of connected components of an undirected graph
@@ -106,12 +106,9 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the connected components of an undirected graph
   ///
   /// Find the connected components of an undirected graph.
-  ///
-  /// \image html connected_components.png
-  /// \image latex connected_components.eps "Connected components" width=\textwidth
   ///
   /// \param graph The graph. It must be undirected.
@@ -121,4 +118,5 @@
   /// set continuously.
   /// \return The number of components
+  ///
   template <class Graph, class NodeMap>
   int connectedComponents(const Graph &graph, NodeMap &compMap) {
@@ -230,5 +228,5 @@
 
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check whether the given directed graph is strongly connected.
@@ -237,5 +235,5 @@
   /// graph is strongly connected when any two nodes of the graph are
   /// connected with directed paths in both direction.
-  /// \return \c false when the graph is not strongly connected.
+  /// \return %False when the graph is not strongly connected.
   /// \see connected
   ///
@@ -288,5 +286,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Count the strongly connected components of a directed graph
@@ -352,5 +350,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the strongly connected components of a directed graph
@@ -364,7 +362,4 @@
   /// a lower.
   ///
-  /// \image html strongly_connected_components.png
-  /// \image latex strongly_connected_components.eps "Strongly connected components" width=\textwidth
-  ///
   /// \param digraph The digraph.
   /// \retval compMap A writable node map. The values will be set from 0 to
@@ -373,4 +368,5 @@
   /// will be set continuously.
   /// \return The number of components
+  ///
   template <typename Digraph, typename NodeMap>
   int stronglyConnectedComponents(const Digraph& digraph, NodeMap& compMap) {
@@ -421,5 +417,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the cut arcs of the strongly connected components.
@@ -705,5 +701,5 @@
   int countBiNodeConnectedComponents(const Graph& graph);
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Checks the graph is bi-node-connected.
@@ -714,5 +710,5 @@
   ///
   /// \param graph The graph.
-  /// \return \c true when the graph bi-node-connected.
+  /// \return %True when the graph bi-node-connected.
   template <typename Graph>
   bool biNodeConnected(const Graph& graph) {
@@ -720,5 +716,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Count the biconnected components.
@@ -755,5 +751,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the bi-node-connected components.
@@ -763,7 +759,4 @@
   /// relation on the undirected edges. Two undirected edge are in relationship
   /// when they are on same circle.
-  ///
-  /// \image html node_biconnected_components.png
-  /// \image latex node_biconnected_components.eps "bi-node-connected components" width=\textwidth
   ///
   /// \param graph The graph.
@@ -773,4 +766,5 @@
   /// will be set continuously.
   /// \return The number of components.
+  ///
   template <typename Graph, typename EdgeMap>
   int biNodeConnectedComponents(const Graph& graph,
@@ -800,5 +794,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the bi-node-connected cut nodes.
@@ -1030,5 +1024,5 @@
   int countBiEdgeConnectedComponents(const Graph& graph);
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Checks that the graph is bi-edge-connected.
@@ -1045,5 +1039,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Count the bi-edge-connected components.
@@ -1080,5 +1074,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the bi-edge-connected components.
@@ -1088,7 +1082,4 @@
   /// relation on the nodes. Two nodes are in relationship when they are
   /// connected at least two edge-disjoint paths.
-  ///
-  /// \image html edge_biconnected_components.png
-  /// \image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth
   ///
   /// \param graph The graph.
@@ -1098,4 +1089,5 @@
   /// will be set continuously.
   /// \return The number of components.
+  ///
   template <typename Graph, typename NodeMap>
   int biEdgeConnectedComponents(const Graph& graph, NodeMap& compMap) {
@@ -1124,5 +1116,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Find the bi-edge-connected cut edges.
@@ -1188,5 +1180,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Sort the nodes of a DAG into topolgical order.
@@ -1227,5 +1219,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Sort the nodes of a DAG into topolgical order.
@@ -1239,5 +1231,5 @@
   /// of the map will be set exactly once, the values will be set descending
   /// order.
-  /// \return \c false when the graph is not DAG.
+  /// \return %False when the graph is not DAG.
   ///
   /// \see topologicalSort
@@ -1282,5 +1274,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check that the given directed graph is a DAG.
@@ -1288,5 +1280,5 @@
   /// Check that the given directed graph is a DAG. The DAG is
   /// an Directed Acyclic Digraph.
-  /// \return \c false when the graph is not DAG.
+  /// \return %False when the graph is not DAG.
   /// \see acyclic
   template <typename Digraph>
@@ -1324,5 +1316,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check that the given undirected graph is acyclic.
@@ -1330,5 +1322,5 @@
   /// Check that the given undirected graph acyclic.
   /// \param graph The undirected graph.
-  /// \return \c true when there is no circle in the graph.
+  /// \return %True when there is no circle in the graph.
   /// \see dag
   template <typename Graph>
@@ -1358,5 +1350,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check that the given undirected graph is tree.
@@ -1364,5 +1356,5 @@
   /// Check that the given undirected graph is tree.
   /// \param graph The undirected graph.
-  /// \return \c true when the graph is acyclic and connected.
+  /// \return %True when the graph is acyclic and connected.
   template <typename Graph>
   bool tree(const Graph& graph) {
@@ -1450,5 +1442,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check if the given undirected graph is bipartite or not
@@ -1457,5 +1449,5 @@
   /// or not. The \ref Bfs algorithm is used to calculate the result.
   /// \param graph The undirected graph.
-  /// \return \c true if \c graph is bipartite, \c false otherwise.
+  /// \return %True if \c graph is bipartite, %false otherwise.
   /// \sa bipartitePartitions
   template<typename Graph>
@@ -1487,5 +1479,5 @@
   }
 
-  /// \ingroup graph_properties
+  /// \ingroup connectivity
   ///
   /// \brief Check if the given undirected graph is bipartite or not
@@ -1495,12 +1487,8 @@
   /// During the execution, the \c partMap will be set as the two
   /// partitions of the graph.
-  ///
-  /// \image html bipartite_partitions.png
-  /// \image latex bipartite_partitions.eps "Bipartite partititions" width=\textwidth
-  ///
   /// \param graph The undirected graph.
   /// \retval partMap A writable bool map of nodes. It will be set as the
   /// two partitions of the graph.
-  /// \return \c true if \c graph is bipartite, \c false otherwise.
+  /// \return %True if \c graph is bipartite, %false otherwise.
   template<typename Graph, typename NodeMap>
   inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 581)
+++ lemon/core.h	(revision 535)
@@ -1035,9 +1035,9 @@
   ///\sa findArc()
   ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
-  template <typename GR>
-  class ConArcIt : public GR::Arc {
+  template <typename _Graph>
+  class ConArcIt : public _Graph::Arc {
   public:
 
-    typedef GR Graph;
+    typedef _Graph Graph;
     typedef typename Graph::Arc Parent;
 
@@ -1158,9 +1158,9 @@
   ///
   ///\sa findEdge()
-  template <typename GR>
-  class ConEdgeIt : public GR::Edge {
+  template <typename _Graph>
+  class ConEdgeIt : public _Graph::Edge {
   public:
 
-    typedef GR Graph;
+    typedef _Graph Graph;
     typedef typename Graph::Edge Parent;
 
@@ -1212,27 +1212,27 @@
   ///queries.
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa ArcLookUp
   ///\sa AllArcLookUp
-  template <typename GR>
+  template<class G>
   class DynArcLookUp
-    : protected ItemSetTraits<GR, typename GR::Arc>::ItemNotifier::ObserverBase
+    : protected ItemSetTraits<G, typename G::Arc>::ItemNotifier::ObserverBase
   {
   public:
-    typedef typename ItemSetTraits<GR, typename GR::Arc>
+    typedef typename ItemSetTraits<G, typename G::Arc>
     ::ItemNotifier::ObserverBase Parent;
 
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-    typedef GR Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
 
   protected:
 
-    class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
+    class AutoNodeMap : public ItemSetTraits<G, Node>::template Map<Arc>::Type {
     public:
 
-      typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
-
-      AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
+      typedef typename ItemSetTraits<G, Node>::template Map<Arc>::Type Parent;
+
+      AutoNodeMap(const G& digraph) : Parent(digraph, INVALID) {}
 
       virtual void add(const Node& node) {
@@ -1316,5 +1316,5 @@
     virtual void clear() {
       for(NodeIt n(_g);n!=INVALID;++n) {
-        _head[n] = INVALID;
+        _head.set(n, INVALID);
       }
     }
@@ -1323,11 +1323,11 @@
       Node s = _g.source(arc);
       Node t = _g.target(arc);
-      _left[arc] = INVALID;
-      _right[arc] = INVALID;
+      _left.set(arc, INVALID);
+      _right.set(arc, INVALID);
 
       Arc e = _head[s];
       if (e == INVALID) {
-        _head[s] = arc;
-        _parent[arc] = INVALID;
+        _head.set(s, arc);
+        _parent.set(arc, INVALID);
         return;
       }
@@ -1335,6 +1335,6 @@
         if (t < _g.target(e)) {
           if (_left[e] == INVALID) {
-            _left[e] = arc;
-            _parent[arc] = e;
+            _left.set(e, arc);
+            _parent.set(arc, e);
             splay(arc);
             return;
@@ -1344,6 +1344,6 @@
         } else {
           if (_right[e] == INVALID) {
-            _right[e] = arc;
-            _parent[arc] = e;
+            _right.set(e, arc);
+            _parent.set(arc, e);
             splay(arc);
             return;
@@ -1358,25 +1358,25 @@
       if (_left[arc] == INVALID) {
         if (_right[arc] != INVALID) {
-          _parent[_right[arc]] = _parent[arc];
+          _parent.set(_right[arc], _parent[arc]);
         }
         if (_parent[arc] != INVALID) {
           if (_left[_parent[arc]] == arc) {
-            _left[_parent[arc]] = _right[arc];
+            _left.set(_parent[arc], _right[arc]);
           } else {
-            _right[_parent[arc]] = _right[arc];
+            _right.set(_parent[arc], _right[arc]);
           }
         } else {
-          _head[_g.source(arc)] = _right[arc];
+          _head.set(_g.source(arc), _right[arc]);
         }
       } else if (_right[arc] == INVALID) {
-        _parent[_left[arc]] = _parent[arc];
+        _parent.set(_left[arc], _parent[arc]);
         if (_parent[arc] != INVALID) {
           if (_left[_parent[arc]] == arc) {
-            _left[_parent[arc]] = _left[arc];
+            _left.set(_parent[arc], _left[arc]);
           } else {
-            _right[_parent[arc]] = _left[arc];
+            _right.set(_parent[arc], _left[arc]);
           }
         } else {
-          _head[_g.source(arc)] = _left[arc];
+          _head.set(_g.source(arc), _left[arc]);
         }
       } else {
@@ -1388,36 +1388,36 @@
           }
           Arc s = _parent[e];
-          _right[_parent[e]] = _left[e];
+          _right.set(_parent[e], _left[e]);
           if (_left[e] != INVALID) {
-            _parent[_left[e]] = _parent[e];
+            _parent.set(_left[e], _parent[e]);
           }
 
-          _left[e] = _left[arc];
-          _parent[_left[arc]] = e;
-          _right[e] = _right[arc];
-          _parent[_right[arc]] = e;
-
-          _parent[e] = _parent[arc];
+          _left.set(e, _left[arc]);
+          _parent.set(_left[arc], e);
+          _right.set(e, _right[arc]);
+          _parent.set(_right[arc], e);
+
+          _parent.set(e, _parent[arc]);
           if (_parent[arc] != INVALID) {
             if (_left[_parent[arc]] == arc) {
-              _left[_parent[arc]] = e;
+              _left.set(_parent[arc], e);
             } else {
-              _right[_parent[arc]] = e;
+              _right.set(_parent[arc], e);
             }
           }
           splay(s);
         } else {
-          _right[e] = _right[arc];
-          _parent[_right[arc]] = e;
-          _parent[e] = _parent[arc];
+          _right.set(e, _right[arc]);
+          _parent.set(_right[arc], e);
+          _parent.set(e, _parent[arc]);
 
           if (_parent[arc] != INVALID) {
             if (_left[_parent[arc]] == arc) {
-              _left[_parent[arc]] = e;
+              _left.set(_parent[arc], e);
             } else {
-              _right[_parent[arc]] = e;
+              _right.set(_parent[arc], e);
             }
           } else {
-            _head[_g.source(arc)] = e;
+            _head.set(_g.source(arc), e);
           }
         }
@@ -1431,15 +1431,15 @@
       if (a < m) {
         Arc left = refreshRec(v,a,m-1);
-        _left[me] = left;
-        _parent[left] = me;
+        _left.set(me, left);
+        _parent.set(left, me);
       } else {
-        _left[me] = INVALID;
+        _left.set(me, INVALID);
       }
       if (m < b) {
         Arc right = refreshRec(v,m+1,b);
-        _right[me] = right;
-        _parent[right] = me;
+        _right.set(me, right);
+        _parent.set(right, me);
       } else {
-        _right[me] = INVALID;
+        _right.set(me, INVALID);
       }
       return me;
@@ -1453,8 +1453,8 @@
           std::sort(v.begin(),v.end(),ArcLess(_g));
           Arc head = refreshRec(v,0,v.size()-1);
-          _head[n] = head;
-          _parent[head] = INVALID;
-        }
-        else _head[n] = INVALID;
+          _head.set(n, head);
+          _parent.set(head, INVALID);
+        }
+        else _head.set(n, INVALID);
       }
     }
@@ -1462,17 +1462,17 @@
     void zig(Arc v) {
       Arc w = _parent[v];
-      _parent[v] = _parent[w];
-      _parent[w] = v;
-      _left[w] = _right[v];
-      _right[v] = w;
+      _parent.set(v, _parent[w]);
+      _parent.set(w, v);
+      _left.set(w, _right[v]);
+      _right.set(v, w);
       if (_parent[v] != INVALID) {
         if (_right[_parent[v]] == w) {
-          _right[_parent[v]] = v;
+          _right.set(_parent[v], v);
         } else {
-          _left[_parent[v]] = v;
+          _left.set(_parent[v], v);
         }
       }
       if (_left[w] != INVALID){
-        _parent[_left[w]] = w;
+        _parent.set(_left[w], w);
       }
     }
@@ -1480,17 +1480,17 @@
     void zag(Arc v) {
       Arc w = _parent[v];
-      _parent[v] = _parent[w];
-      _parent[w] = v;
-      _right[w] = _left[v];
-      _left[v] = w;
+      _parent.set(v, _parent[w]);
+      _parent.set(w, v);
+      _right.set(w, _left[v]);
+      _left.set(v, w);
       if (_parent[v] != INVALID){
         if (_left[_parent[v]] == w) {
-          _left[_parent[v]] = v;
+          _left.set(_parent[v], v);
         } else {
-          _right[_parent[v]] = v;
+          _right.set(_parent[v], v);
         }
       }
       if (_right[w] != INVALID){
-        _parent[_right[w]] = w;
+        _parent.set(_right[w], w);
       }
     }
@@ -1624,14 +1624,14 @@
   ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa DynArcLookUp
   ///\sa AllArcLookUp
-  template<class GR>
+  template<class G>
   class ArcLookUp
   {
   public:
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-    typedef GR Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
 
   protected:
@@ -1734,18 +1734,18 @@
   ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
   ///
-  ///\tparam GR The type of the underlying digraph.
+  ///\tparam G The type of the underlying digraph.
   ///
   ///\sa DynArcLookUp
   ///\sa ArcLookUp
-  template<class GR>
-  class AllArcLookUp : public ArcLookUp<GR>
+  template<class G>
+  class AllArcLookUp : public ArcLookUp<G>
   {
-    using ArcLookUp<GR>::_g;
-    using ArcLookUp<GR>::_right;
-    using ArcLookUp<GR>::_left;
-    using ArcLookUp<GR>::_head;
-
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-    typedef GR Digraph;
+    using ArcLookUp<G>::_g;
+    using ArcLookUp<G>::_right;
+    using ArcLookUp<G>::_left;
+    using ArcLookUp<G>::_head;
+
+    TEMPLATE_DIGRAPH_TYPEDEFS(G);
+    typedef G Digraph;
 
     typename Digraph::template ArcMap<Arc> _next;
@@ -1774,5 +1774,5 @@
     ///It builds up the search database, which remains valid until the digraph
     ///changes.
-    AllArcLookUp(const Digraph &g) : ArcLookUp<GR>(g), _next(g) {refreshNext();}
+    AllArcLookUp(const Digraph &g) : ArcLookUp<G>(g), _next(g) {refreshNext();}
 
     ///Refresh the data structure at a node.
@@ -1784,5 +1784,5 @@
     void refresh(Node n)
     {
-      ArcLookUp<GR>::refresh(n);
+      ArcLookUp<G>::refresh(n);
       refreshNext(_head[n]);
     }
@@ -1831,5 +1831,5 @@
     Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
 #else
-    using ArcLookUp<GR>::operator() ;
+    using ArcLookUp<G>::operator() ;
     Arc operator()(Node s, Node t, Arc prev) const
     {
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 576)
+++ lemon/cplex.cc	(revision 462)
@@ -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).
@@ -73,5 +73,4 @@
     int status;
     _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -80,5 +79,4 @@
     int status;
     _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -89,5 +87,4 @@
     rows = cplex.rows;
     cols = cplex.cols;
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -442,38 +439,19 @@
   }
 
-  void CplexBase::_messageLevel(MessageLevel level) {
-    switch (level) {
-    case MESSAGE_NOTHING:
-      _message_enabled = false;
-      break;
-    case MESSAGE_ERROR:
-    case MESSAGE_WARNING:
-    case MESSAGE_NORMAL:
-    case MESSAGE_VERBOSE:
-      _message_enabled = true;
-      break;
-    }
-  }
-
-  void CplexBase::_applyMessageLevel() {
-    CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, 
-                   _message_enabled ? CPX_ON : CPX_OFF);
-  }
-
   // CplexLp members
 
   CplexLp::CplexLp()
-    : LpBase(), LpSolver(), CplexBase() {}
+    : LpBase(), CplexBase(), LpSolver() {}
 
   CplexLp::CplexLp(const CplexEnv& env)
-    : LpBase(), LpSolver(), CplexBase(env) {}
+    : LpBase(), CplexBase(env), LpSolver() {}
 
   CplexLp::CplexLp(const CplexLp& other)
-    : LpBase(), LpSolver(), CplexBase(other) {}
+    : LpBase(), CplexBase(other), LpSolver() {}
 
   CplexLp::~CplexLp() {}
 
-  CplexLp* CplexLp::newSolver() const { return new CplexLp; }
-  CplexLp* CplexLp::cloneSolver() const {return new CplexLp(*this); }
+  CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
+  CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
 
   const char* CplexLp::_solverName() const { return "CplexLp"; }
@@ -530,5 +508,4 @@
   CplexLp::SolveExitStatus CplexLp::_solve() {
     _clear_temporals();
-    _applyMessageLevel();
     return convertStatus(CPXlpopt(cplexEnv(), _prob));
   }
@@ -536,5 +513,4 @@
   CplexLp::SolveExitStatus CplexLp::solvePrimal() {
     _clear_temporals();
-    _applyMessageLevel();
     return convertStatus(CPXprimopt(cplexEnv(), _prob));
   }
@@ -542,5 +518,4 @@
   CplexLp::SolveExitStatus CplexLp::solveDual() {
     _clear_temporals();
-    _applyMessageLevel();
     return convertStatus(CPXdualopt(cplexEnv(), _prob));
   }
@@ -548,5 +523,4 @@
   CplexLp::SolveExitStatus CplexLp::solveBarrier() {
     _clear_temporals();
-    _applyMessageLevel();
     return convertStatus(CPXbaropt(cplexEnv(), _prob));
   }
@@ -627,5 +601,5 @@
   }
 
-  // Cplex 7.0 status values
+  //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)
   // This table lists the statuses, returned by the CPXgetstat()
   // routine, for solutions to LP problems or mixed integer problems. If
@@ -674,5 +648,5 @@
   //       User pivot used
   //
-  // Pending return values
+  //     Ezeket hova tegyem:
   // ??case CPX_ABORT_DUAL_INFEAS
   // ??case CPX_ABORT_CROSSOVER
@@ -745,4 +719,5 @@
     statusSwitch(cplexEnv(),stat);
     //CPXgetstat(cplexEnv(), _prob);
+    //printf("A primal status: %d, CPX_OPTIMAL=%d \n",stat,CPX_OPTIMAL);
     switch (stat) {
     case 0:
@@ -777,5 +752,5 @@
   }
 
-  // Cplex 9.0 status values
+  //9.0-as cplex verzio statusai
   // CPX_STAT_ABORT_DUAL_OBJ_LIM
   // CPX_STAT_ABORT_IT_LIM
@@ -824,5 +799,5 @@
 
   CplexMip::CplexMip()
-    : LpBase(), MipSolver(), CplexBase() {
+    : LpBase(), CplexBase(), MipSolver() {
 
 #if CPX_VERSION < 800
@@ -834,5 +809,5 @@
 
   CplexMip::CplexMip(const CplexEnv& env)
-    : LpBase(), MipSolver(), CplexBase(env) {
+    : LpBase(), CplexBase(env), MipSolver() {
 
 #if CPX_VERSION < 800
@@ -845,10 +820,10 @@
 
   CplexMip::CplexMip(const CplexMip& other)
-    : LpBase(), MipSolver(), CplexBase(other) {}
+    : LpBase(), CplexBase(other), MipSolver() {}
 
   CplexMip::~CplexMip() {}
 
-  CplexMip* CplexMip::newSolver() const { return new CplexMip; }
-  CplexMip* CplexMip::cloneSolver() const {return new CplexMip(*this); }
+  CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
+  CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
 
   const char* CplexMip::_solverName() const { return "CplexMip"; }
@@ -890,5 +865,4 @@
   CplexMip::SolveExitStatus CplexMip::_solve() {
     int status;
-    _applyMessageLevel();
     status = CPXmipopt (cplexEnv(), _prob);
     if (status==0)
Index: lemon/cplex.h
===================================================================
--- lemon/cplex.h	(revision 576)
+++ lemon/cplex.h	(revision 462)
@@ -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).
@@ -79,5 +79,5 @@
   ///
   /// This class implements the common interface of the CPLEX LP and
-  /// MIP solvers.
+  /// MIP solvers.  
   /// \ingroup lp_group
   class CplexBase : virtual public LpBase {
@@ -145,27 +145,12 @@
     virtual void _clear();
 
-    virtual void _messageLevel(MessageLevel level);
-    void _applyMessageLevel();
-
-    bool _message_enabled;
-
   public:
 
     /// Returns the used \c CplexEnv instance
     const CplexEnv& env() const { return _env; }
-
-    /// \brief Returns the const cpxenv pointer
     ///
-    /// \note The cpxenv might be destructed with the solver.
     const cpxenv* cplexEnv() const { return _env.cplexEnv(); }
 
-    /// \brief Returns the const cpxenv pointer
-    ///
-    /// \note The cpxenv might be destructed with the solver.
-    cpxenv* cplexEnv() { return _env.cplexEnv(); }
-
-    /// Returns the cplex problem object
     cpxlp* cplexLp() { return _prob; }
-    /// Returns the cplex problem object
     const cpxlp* cplexLp() const { return _prob; }
 
@@ -176,5 +161,5 @@
   /// This class implements an interface for the CPLEX LP solver.
   ///\ingroup lp_group
-  class CplexLp : public LpSolver, public CplexBase {
+  class CplexLp : public CplexBase, public LpSolver {
   public:
     /// \e
@@ -186,9 +171,4 @@
     /// \e
     virtual ~CplexLp();
-
-    /// \e
-    virtual CplexLp* cloneSolver() const;
-    /// \e
-    virtual CplexLp* newSolver() const;
 
   private:
@@ -206,4 +186,7 @@
 
   protected:
+
+    virtual CplexLp* _cloneSolver() const;
+    virtual CplexLp* _newSolver() const;
 
     virtual const char* _solverName() const;
@@ -240,5 +223,5 @@
   /// This class implements an interface for the CPLEX MIP solver.
   ///\ingroup lp_group
-  class CplexMip : public MipSolver, public CplexBase {
+  class CplexMip : public CplexBase, public MipSolver {
   public:
     /// \e
@@ -251,11 +234,8 @@
     virtual ~CplexMip();
 
-    /// \e
-    virtual CplexMip* cloneSolver() const;
-    /// \e
-    virtual CplexMip* newSolver() const;
-
-  protected:
-
+  protected:
+
+    virtual CplexMip* _cloneSolver() const;
+    virtual CplexMip* _newSolver() const;
 
     virtual const char* _solverName() const;
Index: lemon/dfs.h
===================================================================
--- lemon/dfs.h	(revision 584)
+++ lemon/dfs.h	(revision 492)
@@ -207,5 +207,5 @@
     typedef Dfs Create;
 
-    ///\name Named Template Parameters
+    ///\name Named template parameters
 
     ///@{
Index: lemon/dijkstra.h
===================================================================
--- lemon/dijkstra.h	(revision 584)
+++ lemon/dijkstra.h	(revision 492)
@@ -39,8 +39,6 @@
   /// This operation traits class defines all computational operations and
   /// constants which are used in the Dijkstra algorithm.
-  template <typename V>
+  template <typename Value>
   struct DijkstraDefaultOperationTraits {
-    /// \e
-    typedef V Value;
     /// \brief Gives back the zero value of the type.
     static Value zero() {
@@ -61,6 +59,6 @@
   ///Default traits class of Dijkstra class.
   ///\tparam GR The type of the digraph.
-  ///\tparam LEN The type of the length map.
-  template<typename GR, typename LEN>
+  ///\tparam LM The type of the length map.
+  template<class GR, class LM>
   struct DijkstraDefaultTraits
   {
@@ -72,7 +70,7 @@
     ///The type of the map that stores the arc lengths.
     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef LEN LengthMap;
+    typedef LM LengthMap;
     ///The type of the length of the arcs.
-    typedef typename LEN::Value Value;
+    typedef typename LM::Value Value;
 
     /// Operation traits for %Dijkstra algorithm.
@@ -103,5 +101,5 @@
     ///\sa BinHeap
     ///\sa Dijkstra
-    typedef BinHeap<typename LEN::Value, HeapCrossRef, std::less<Value> > Heap;
+    typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
     ///Instantiates a \c Heap.
 
@@ -153,5 +151,5 @@
     ///The type of the map that stores the distances of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
+    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
     ///Instantiates a \c DistMap.
 
@@ -183,5 +181,5 @@
   ///\tparam GR The type of the digraph the algorithm runs on.
   ///The default type is \ref ListDigraph.
-  ///\tparam LEN A \ref concepts::ReadMap "readable" arc map that specifies
+  ///\tparam LM A \ref concepts::ReadMap "readable" arc map that specifies
   ///the lengths of the arcs.
   ///It is read once for each arc, so the map may involve in
@@ -190,9 +188,9 @@
   ///concepts::Digraph::ArcMap "GR::ArcMap<int>".
 #ifdef DOXYGEN
-  template <typename GR, typename LEN, typename TR>
+  template <typename GR, typename LM, typename TR>
 #else
   template <typename GR=ListDigraph,
-            typename LEN=typename GR::template ArcMap<int>,
-            typename TR=DijkstraDefaultTraits<GR,LEN> >
+            typename LM=typename GR::template ArcMap<int>,
+            typename TR=DijkstraDefaultTraits<GR,LM> >
 #endif
   class Dijkstra {
@@ -287,5 +285,5 @@
     typedef Dijkstra Create;
 
-    ///\name Named Template Parameters
+    ///\name Named template parameters
 
     ///@{
@@ -916,6 +914,6 @@
   ///Default traits class of dijkstra() function.
   ///\tparam GR The type of the digraph.
-  ///\tparam LEN The type of the length map.
-  template<class GR, class LEN>
+  ///\tparam LM The type of the length map.
+  template<class GR, class LM>
   struct DijkstraWizardDefaultTraits
   {
@@ -926,7 +924,7 @@
     ///The type of the map that stores the arc lengths.
     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef LEN LengthMap;
+    typedef LM LengthMap;
     ///The type of the length of the arcs.
-    typedef typename LEN::Value Value;
+    typedef typename LM::Value Value;
 
     /// Operation traits for Dijkstra algorithm.
@@ -1010,5 +1008,5 @@
     ///The type of the map that stores the distances of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
+    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
     ///Instantiates a DistMap.
 
@@ -1036,8 +1034,8 @@
   /// The \ref DijkstraWizardBase is a class to be the default traits of the
   /// \ref DijkstraWizard class.
-  template<typename GR, typename LEN>
-  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN>
+  template<class GR,class LM>
+  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
   {
-    typedef DijkstraWizardDefaultTraits<GR,LEN> Base;
+    typedef DijkstraWizardDefaultTraits<GR,LM> Base;
   protected:
     //The type of the nodes in the digraph.
@@ -1073,7 +1071,7 @@
     /// \param g The digraph the algorithm runs on.
     /// \param l The length map.
-    DijkstraWizardBase(const GR &g,const LEN &l) :
+    DijkstraWizardBase(const GR &g,const LM &l) :
       _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
-      _length(reinterpret_cast<void*>(const_cast<LEN*>(&l))),
+      _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
       _processed(0), _pred(0), _dist(0), _path(0), _di(0) {}
 
@@ -1284,9 +1282,9 @@
   ///\sa DijkstraWizard
   ///\sa Dijkstra
-  template<typename GR, typename LEN>
-  DijkstraWizard<DijkstraWizardBase<GR,LEN> >
-  dijkstra(const GR &digraph, const LEN &length)
+  template<class GR, class LM>
+  DijkstraWizard<DijkstraWizardBase<GR,LM> >
+  dijkstra(const GR &digraph, const LM &length)
   {
-    return DijkstraWizard<DijkstraWizardBase<GR,LEN> >(digraph,length);
+    return DijkstraWizard<DijkstraWizardBase<GR,LM> >(digraph,length);
   }
 
Index: lemon/dimacs.h
===================================================================
--- lemon/dimacs.h	(revision 584)
+++ lemon/dimacs.h	(revision 525)
@@ -23,7 +23,7 @@
 #include <string>
 #include <vector>
-#include <limits>
 #include <lemon/maps.h>
 #include <lemon/error.h>
+
 /// \ingroup dimacs_group
 /// \file
@@ -38,14 +38,9 @@
   struct DimacsDescriptor
   {
-    ///\brief DIMACS file type enum
-    ///
-    ///DIMACS file type enum.
-    enum Type {
-      NONE,  ///< Undefined type.
-      MIN,   ///< DIMACS file type for minimum cost flow problems.
-      MAX,   ///< DIMACS file type for maximum flow problems.
-      SP,    ///< DIMACS file type for shostest path problems.
-      MAT    ///< DIMACS file type for plain graphs and matching problems.
-    };
+    ///File type enum
+    enum Type
+      {
+        NONE, MIN, MAX, SP, MAT
+      };
     ///The file type
     Type type;
@@ -55,5 +50,5 @@
     int edgeNum;
     int lineShift;
-    ///Constructor. It sets the type to \c NONE.
+    /// Constructor. Sets the type to NONE.
     DimacsDescriptor() : type(NONE) {}
   };
@@ -61,8 +56,8 @@
   ///Discover the type of a DIMACS file
 
-  ///This function starts seeking the beginning of the given file for the
-  ///problem type and size info. 
-  ///The found data is returned in a special struct that can be evaluated
-  ///and passed to the appropriate reader function.
+  ///It starts seeking the begining of the file for the problem type
+  ///and size info. The found data is returned in a special struct
+  ///that can be evaluated and passed to the appropriate reader
+  ///function.
   DimacsDescriptor dimacsType(std::istream& is)
   {
@@ -102,5 +97,6 @@
 
 
-  /// \brief DIMACS minimum cost flow reader function.
+
+  /// DIMACS minimum cost flow reader function.
   ///
   /// This function reads a minimum cost flow instance from DIMACS format,
@@ -110,15 +106,7 @@
   /// \endcode
   /// At the beginning, \c g is cleared by \c g.clear(). The supply
-  /// amount of the nodes are written to the \c supply node map
-  /// (they are signed values). The lower bounds, capacities and costs
-  /// of the arcs are written to the \c lower, \c capacity and \c cost
-  /// arc maps.
-  ///
-  /// If the capacity of an arc is less than the lower bound, it will
-  /// be set to "infinite" instead. The actual value of "infinite" is
-  /// contolled by the \c infty parameter. If it is 0 (the default value),
-  /// \c std::numeric_limits<Capacity>::infinity() will be used if available,
-  /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to
-  /// a non-zero value, that value will be used as "infinite".
+  /// amount of the nodes are written to \c supply (signed). The
+  /// lower bounds, capacities and costs of the arcs are written to
+  /// \c lower, \c capacity and \c cost.
   ///
   /// If the file type was previously evaluated by dimacsType(), then
@@ -133,5 +121,4 @@
                      CostMap& cost,
                      SupplyMap& supply,
-                     typename CapacityMap::Value infty = 0,
                      DimacsDescriptor desc=DimacsDescriptor())
   {
@@ -156,10 +143,4 @@
     typename CapacityMap::Value cap;
     typename CostMap::Value co;
-    typedef typename CapacityMap::Value Capacity;
-    if(infty==0)
-      infty = std::numeric_limits<Capacity>::has_infinity ?
-        std::numeric_limits<Capacity>::infinity() :
-        std::numeric_limits<Capacity>::max();
-
     while (is >> c) {
       switch (c) {
@@ -172,13 +153,13 @@
         supply.set(nodes[i], sup);
         break;
-      case 'a': // arc definition line
+      case 'a': // arc (arc) definition line
         is >> i >> j >> low >> cap >> co;
         getline(is, str);
         e = g.addArc(nodes[i], nodes[j]);
         lower.set(e, low);
-        if (cap >= low)
+        if (cap >= 0)
           capacity.set(e, cap);
         else
-          capacity.set(e, infty);
+          capacity.set(e, -1);
         cost.set(e, co);
         break;
@@ -193,5 +174,4 @@
                    typename Digraph::Node &s,
                    typename Digraph::Node &t,
-                   typename CapacityMap::Value infty = 0,
                    DimacsDescriptor desc=DimacsDescriptor()) {
     g.clear();
@@ -207,11 +187,5 @@
       nodes[k] = g.addNode();
     }
-    typedef typename CapacityMap::Value Capacity;
-
-    if(infty==0)
-      infty = std::numeric_limits<Capacity>::has_infinity ?
-        std::numeric_limits<Capacity>::infinity() :
-        std::numeric_limits<Capacity>::max();
- 
+
     while (is >> c) {
       switch (c) {
@@ -232,21 +206,12 @@
         }
         break;
-      case 'a': // arc definition line
-        if (desc.type==DimacsDescriptor::SP) {
+      case 'a': // arc (arc) definition line
+        if (desc.type==DimacsDescriptor::SP ||
+            desc.type==DimacsDescriptor::MAX) {
           is >> i >> j >> _cap;
           getline(is, str);
           e = g.addArc(nodes[i], nodes[j]);
           capacity.set(e, _cap);
-        } 
-        else if (desc.type==DimacsDescriptor::MAX) {
-          is >> i >> j >> _cap;
-          getline(is, str);
-          e = g.addArc(nodes[i], nodes[j]);
-          if (_cap >= 0)
-            capacity.set(e, _cap);
-          else
-            capacity.set(e, infty);
-        }
-        else {
+        } else {
           is >> i >> j;
           getline(is, str);
@@ -258,5 +223,5 @@
   }
 
-  /// \brief DIMACS maximum flow reader function.
+  /// DIMACS maximum flow reader function.
   ///
   /// This function reads a maximum flow instance from DIMACS format,
@@ -266,13 +231,6 @@
   /// \endcode
   /// At the beginning, \c g is cleared by \c g.clear(). The arc
-  /// capacities are written to the \c capacity arc map and \c s and
-  /// \c t are set to the source and the target nodes.
-  ///
-  /// If the capacity of an arc is negative, it will
-  /// be set to "infinite" instead. The actual value of "infinite" is
-  /// contolled by the \c infty parameter. If it is 0 (the default value),
-  /// \c std::numeric_limits<Capacity>::infinity() will be used if available,
-  /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to
-  /// a non-zero value, that value will be used as "infinite".
+  /// capacities are written to \c capacity and \c s and \c t are
+  /// set to the source and the target nodes.
   ///
   /// If the file type was previously evaluated by dimacsType(), then
@@ -284,13 +242,12 @@
                      typename Digraph::Node &s,
                      typename Digraph::Node &t,
-                     typename CapacityMap::Value infty = 0,
                      DimacsDescriptor desc=DimacsDescriptor()) {
     if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is);
     if(desc.type!=DimacsDescriptor::MAX)
       throw FormatError("Problem type mismatch");
-    _readDimacs(is,g,capacity,s,t,infty,desc);
-  }
-
-  /// \brief DIMACS shortest path reader function.
+    _readDimacs(is,g,capacity,s,t,desc);
+  }
+
+  /// DIMACS shortest path reader function.
   ///
   /// This function reads a shortest path instance from DIMACS format,
@@ -300,5 +257,5 @@
   /// \endcode
   /// At the beginning, \c g is cleared by \c g.clear(). The arc
-  /// lengths are written to the \c length arc map and \c s is set to the
+  /// lengths are written to \c length and \c s is set to the
   /// source node.
   ///
@@ -315,22 +272,13 @@
     if(desc.type!=DimacsDescriptor::SP)
       throw FormatError("Problem type mismatch");
-    _readDimacs(is, g, length, s, t, 0, desc);
-  }
-
-  /// \brief DIMACS capacitated digraph reader function.
+    _readDimacs(is, g, length, s, t,desc);
+  }
+
+  /// DIMACS capacitated digraph reader function.
   ///
   /// This function reads an arc capacitated digraph instance from
-  /// DIMACS 'max' or 'sp' format.
+  /// DIMACS 'mat' or 'sp' format.
   /// At the beginning, \c g is cleared by \c g.clear()
-  /// and the arc capacities/lengths are written to the \c capacity
-  /// arc map.
-  ///
-  /// In case of the 'max' format, if the capacity of an arc is negative,
-  /// it will
-  /// be set to "infinite" instead. The actual value of "infinite" is
-  /// contolled by the \c infty parameter. If it is 0 (the default value),
-  /// \c std::numeric_limits<Capacity>::infinity() will be used if available,
-  /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to
-  /// a non-zero value, that value will be used as "infinite".
+  /// and the arc capacities/lengths are written to \c capacity.
   ///
   /// If the file type was previously evaluated by dimacsType(), then
@@ -340,5 +288,4 @@
                      Digraph &g,
                      CapacityMap& capacity,
-                     typename CapacityMap::Value infty = 0,
                      DimacsDescriptor desc=DimacsDescriptor()) {
     typename Digraph::Node u,v;
@@ -346,5 +293,5 @@
     if(desc.type!=DimacsDescriptor::MAX || desc.type!=DimacsDescriptor::SP)
       throw FormatError("Problem type mismatch");
-    _readDimacs(is, g, capacity, u, v, infty, desc);
+    _readDimacs(is, g, capacity, u, v, desc);
   }
 
@@ -364,9 +311,9 @@
   }
   
-  /// \brief DIMACS plain (di)graph reader function.
-  ///
-  /// This function reads a plain (di)graph without any designated nodes
-  /// and maps (e.g. a matching instance) from DIMACS format, i.e. from 
-  /// DIMACS files having a line starting with
+  /// DIMACS plain (di)graph reader function.
+  ///
+  /// This function reads a (di)graph without any designated nodes and
+  /// maps from DIMACS format, i.e. from DIMACS files having a line
+  /// starting with
   /// \code
   ///   p mat
@@ -401,5 +348,5 @@
       case 'n': // node definition line
         break;
-      case 'a': // arc definition line
+      case 'a': // arc (arc) definition line
         is >> i >> j;
         getline(is, str);
Index: lemon/edge_set.h
===================================================================
--- lemon/edge_set.h	(revision 559)
+++ lemon/edge_set.h	(revision 512)
@@ -256,5 +256,5 @@
   /// concept.
   ///
-  /// This class fully conforms to the \ref concepts::Digraph
+  /// This class is fully conform to the \ref concepts::Digraph
   /// "Digraph" concept.
   template <typename GR>
@@ -337,5 +337,5 @@
     /// Add a new arc to the digraph with source node \c s
     /// and target node \c t.
-    /// \return The new arc.
+    /// \return the new arc.
     Arc addArc(const Node& s, const Node& t) {
       return Parent::addArc(s, t);
@@ -685,5 +685,5 @@
   /// concept.
   ///
-  /// This class fully conforms to the \ref concepts::Graph "Graph"
+  /// This class is fully conform to the \ref concepts::Graph "Graph"
   /// concept.
   template <typename GR>
@@ -762,5 +762,5 @@
     /// Add a new edge to the graph with node \c u
     /// and node \c v endpoints.
-    /// \return The new edge.
+    /// \return the new edge.
     Edge addEdge(const Node& u, const Node& v) {
       return Parent::addEdge(u, v);
@@ -953,5 +953,5 @@
   /// validity can be checked with the \c valid() member function.
   ///
-  /// This class fully conforms to the \ref concepts::Digraph
+  /// This class is fully conform to the \ref concepts::Digraph
   /// "Digraph" concept.
   template <typename GR>
@@ -1042,5 +1042,5 @@
     /// Add a new arc to the digraph with source node \c s
     /// and target node \c t.
-    /// \return The new arc.
+    /// \return the new arc.
     Arc addArc(const Node& s, const Node& t) {
       return Parent::addArc(s, t);
@@ -1301,5 +1301,5 @@
   /// be checked with the \c valid() member function.
   ///
-  /// This class fully conforms to the \ref concepts::Graph
+  /// This class is fully conform to the \ref concepts::Graph
   /// "Graph" concept.
   template <typename GR>
@@ -1390,5 +1390,5 @@
     /// Add a new edge to the graph with node \c u
     /// and node \c v endpoints.
-    /// \return The new edge.
+    /// \return the new edge.
     Edge addEdge(const Node& u, const Node& v) {
       return Parent::addEdge(u, v);
Index: lemon/elevator.h
===================================================================
--- lemon/elevator.h	(revision 581)
+++ lemon/elevator.h	(revision 519)
@@ -47,8 +47,8 @@
   ///\sa LinkedElevator
   ///
-  ///\param GR Type of the underlying graph.
-  ///\param Item Type of the items the data is assigned to (\c GR::Node,
-  ///\c GR::Arc or \c GR::Edge).
-  template<class GR, class Item>
+  ///\param Graph Type of the underlying graph.
+  ///\param Item Type of the items the data is assigned to (Graph::Node,
+  ///Graph::Arc, Graph::Edge).
+  template<class Graph, class Item>
   class Elevator
   {
@@ -61,8 +61,8 @@
 
     typedef Item *Vit;
-    typedef typename ItemSetTraits<GR,Item>::template Map<Vit>::Type VitMap;
-    typedef typename ItemSetTraits<GR,Item>::template Map<int>::Type IntMap;
-
-    const GR &_g;
+    typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap;
+    typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap;
+
+    const Graph &_g;
     int _max_level;
     int _item_num;
@@ -77,5 +77,5 @@
     void copy(Item i, Vit p)
     {
-      _where[*p=i] = p;
+      _where.set(*p=i,p);
     }
     void copy(Vit s, Vit p)
@@ -85,5 +85,5 @@
           Item i=*s;
           *p=i;
-          _where[i] = p;
+          _where.set(i,p);
         }
     }
@@ -92,6 +92,6 @@
       Item ti=*i;
       Vit ct = _where[ti];
-      _where[ti] = _where[*i=*j];
-      _where[*j] = ct;
+      _where.set(ti,_where[*i=*j]);
+      _where.set(*j,ct);
       *j=ti;
     }
@@ -106,5 +106,5 @@
     ///\param max_level The maximum allowed level.
     ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
-    Elevator(const GR &graph,int max_level) :
+    Elevator(const Graph &graph,int max_level) :
       _g(graph),
       _max_level(max_level),
@@ -123,7 +123,7 @@
     ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
     ///where \c max_level is equal to the number of labeled items in the graph.
-    Elevator(const GR &graph) :
+    Elevator(const Graph &graph) :
       _g(graph),
-      _max_level(countItems<GR, Item>(graph)),
+      _max_level(countItems<Graph, Item>(graph)),
       _item_num(_max_level),
       _where(graph),
@@ -227,5 +227,5 @@
     {
       Item it = *_last_active[_highest_active];
-      ++_level[it];
+      _level.set(it,_level[it]+1);
       swap(_last_active[_highest_active]--,_last_active[_highest_active+1]);
       --_first[++_highest_active];
@@ -250,5 +250,5 @@
         }
       copy(li,_first[new_level]);
-      _level[li] = new_level;
+      _level.set(li,new_level);
       _highest_active=new_level;
     }
@@ -270,5 +270,5 @@
       copy(li,_first[_max_level]);
       --_last_active[_max_level];
-      _level[li] = _max_level;
+      _level.set(li,_max_level);
 
       while(_highest_active>=0 &&
@@ -300,5 +300,5 @@
     {
       Item it =*_last_active[level];
-      ++_level[it];
+      _level.set(it,_level[it]+1);
       swap(_last_active[level]--, --_first[level+1]);
       if (level+1>_highest_active) ++_highest_active;
@@ -320,5 +320,5 @@
         }
       copy(ai,_first[new_level]);
-      _level[ai] = new_level;
+      _level.set(ai,new_level);
       if (new_level>_highest_active) _highest_active=new_level;
     }
@@ -340,5 +340,5 @@
       copy(ai,_first[_max_level]);
       --_last_active[_max_level];
-      _level[ai] = _max_level;
+      _level.set(ai,_max_level);
 
       if (_highest_active==level) {
@@ -371,5 +371,5 @@
         }
       copy(i,_first[new_level]);
-      _level[i] = new_level;
+      _level.set(i,new_level);
       if(new_level>_highest_active) _highest_active=new_level;
     }
@@ -383,5 +383,5 @@
     ///\pre The item is on the top level.
     void dirtyTopButOne(Item i) {
-      _level[i] = _max_level - 1;
+      _level.set(i,_max_level - 1);
     }
 
@@ -395,5 +395,5 @@
       const Vit tl=_first[_max_level];
       for(Vit i=f;i!=tl;++i)
-        _level[*i] = _max_level;
+        _level.set(*i,_max_level);
       for(int i=l;i<=_max_level;i++)
         {
@@ -431,9 +431,9 @@
       _last_active[0]=&_items[0]-1;
       Vit n=&_items[0];
-      for(typename ItemSetTraits<GR,Item>::ItemIt i(_g);i!=INVALID;++i)
+      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i)
         {
           *n=i;
-          _where[i] = n;
-          _level[i] = _max_level;
+          _where.set(i,n);
+          _level.set(i,_max_level);
           ++n;
         }
@@ -444,5 +444,5 @@
     {
       swap(_where[i],_init_num);
-      _level[i] = _init_lev;
+      _level.set(i,_init_lev);
       ++_init_num;
     }
@@ -490,8 +490,8 @@
   ///\sa Elevator
   ///
-  ///\param GR Type of the underlying graph.
-  ///\param Item Type of the items the data is assigned to (\c GR::Node,
-  ///\c GR::Arc or \c GR::Edge).
-  template <class GR, class Item>
+  ///\param Graph Type of the underlying graph.
+  ///\param Item Type of the items the data is assigned to (Graph::Node,
+  ///Graph::Arc, Graph::Edge).
+  template <class Graph, class Item>
   class LinkedElevator {
   public:
@@ -502,12 +502,12 @@
   private:
 
-    typedef typename ItemSetTraits<GR,Item>::
+    typedef typename ItemSetTraits<Graph,Item>::
     template Map<Item>::Type ItemMap;
-    typedef typename ItemSetTraits<GR,Item>::
+    typedef typename ItemSetTraits<Graph,Item>::
     template Map<int>::Type IntMap;
-    typedef typename ItemSetTraits<GR,Item>::
+    typedef typename ItemSetTraits<Graph,Item>::
     template Map<bool>::Type BoolMap;
 
-    const GR &_graph;
+    const Graph &_graph;
     int _max_level;
     int _item_num;
@@ -526,5 +526,5 @@
     ///\param max_level The maximum allowed level.
     ///Set the range of the possible labels to <tt>[0..max_level]</tt>.
-    LinkedElevator(const GR& graph, int max_level)
+    LinkedElevator(const Graph& graph, int max_level)
       : _graph(graph), _max_level(max_level), _item_num(_max_level),
         _first(_max_level + 1), _last(_max_level + 1),
@@ -539,6 +539,6 @@
     ///Set the range of the possible labels to <tt>[0..max_level]</tt>,
     ///where \c max_level is equal to the number of labeled items in the graph.
-    LinkedElevator(const GR& graph)
-      : _graph(graph), _max_level(countItems<GR, Item>(graph)),
+    LinkedElevator(const Graph& graph)
+      : _graph(graph), _max_level(countItems<Graph, Item>(graph)),
         _item_num(_max_level),
         _first(_max_level + 1), _last(_max_level + 1),
@@ -552,5 +552,5 @@
     ///\pre Item \c i shouldn't be active before.
     void activate(Item i) {
-      _active[i] = true;
+      _active.set(i, true);
 
       int level = _level[i];
@@ -561,14 +561,14 @@
       if (_prev[i] == INVALID || _active[_prev[i]]) return;
       //unlace
-      _next[_prev[i]] = _next[i];
+      _next.set(_prev[i], _next[i]);
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = _prev[i];
+        _prev.set(_next[i], _prev[i]);
       } else {
         _last[level] = _prev[i];
       }
       //lace
-      _next[i] = _first[level];
-      _prev[_first[level]] = i;
-      _prev[i] = INVALID;
+      _next.set(i, _first[level]);
+      _prev.set(_first[level], i);
+      _prev.set(i, INVALID);
       _first[level] = i;
 
@@ -580,5 +580,5 @@
     ///\pre Item \c i must be active before.
     void deactivate(Item i) {
-      _active[i] = false;
+      _active.set(i, false);
       int level = _level[i];
 
@@ -587,14 +587,14 @@
 
       //unlace
-      _prev[_next[i]] = _prev[i];
+      _prev.set(_next[i], _prev[i]);
       if (_prev[i] != INVALID) {
-        _next[_prev[i]] = _next[i];
+        _next.set(_prev[i], _next[i]);
       } else {
         _first[_level[i]] = _next[i];
       }
       //lace
-      _prev[i] = _last[level];
-      _next[_last[level]] = i;
-      _next[i] = INVALID;
+      _prev.set(i, _last[level]);
+      _next.set(_last[level], i);
+      _next.set(i, INVALID);
       _last[level] = i;
 
@@ -686,5 +686,5 @@
       Item i = _first[_highest_active];
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[_highest_active] = _next[i];
       } else {
@@ -692,13 +692,13 @@
         _last[_highest_active] = INVALID;
       }
-      _level[i] = ++_highest_active;
+      _level.set(i, ++_highest_active);
       if (_first[_highest_active] == INVALID) {
         _first[_highest_active] = i;
         _last[_highest_active] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[_first[_highest_active]] = i;
-        _next[i] = _first[_highest_active];
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(_first[_highest_active], i);
+        _next.set(i, _first[_highest_active]);
         _first[_highest_active] = i;
       }
@@ -715,5 +715,5 @@
       Item i = _first[_highest_active];
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[_highest_active] = _next[i];
       } else {
@@ -721,12 +721,12 @@
         _last[_highest_active] = INVALID;
       }
-      _level[i] = _highest_active = new_level;
+      _level.set(i, _highest_active = new_level);
       if (_first[_highest_active] == INVALID) {
         _first[_highest_active] = _last[_highest_active] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[_first[_highest_active]] = i;
-        _next[i] = _first[_highest_active];
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(_first[_highest_active], i);
+        _next.set(i, _first[_highest_active]);
         _first[_highest_active] = i;
       }
@@ -739,7 +739,7 @@
     void liftHighestActiveToTop() {
       Item i = _first[_highest_active];
-      _level[i] = _max_level;
+      _level.set(i, _max_level);
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[_highest_active] = _next[i];
       } else {
@@ -775,5 +775,5 @@
       Item i = _first[l];
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[l] = _next[i];
       } else {
@@ -781,12 +781,12 @@
         _last[l] = INVALID;
       }
-      _level[i] = ++l;
+      _level.set(i, ++l);
       if (_first[l] == INVALID) {
         _first[l] = _last[l] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[_first[l]] = i;
-        _next[i] = _first[l];
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(_first[l], i);
+        _next.set(i, _first[l]);
         _first[l] = i;
       }
@@ -804,5 +804,5 @@
       Item i = _first[l];
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[l] = _next[i];
       } else {
@@ -810,12 +810,12 @@
         _last[l] = INVALID;
       }
-      _level[i] = l = new_level;
+      _level.set(i, l = new_level);
       if (_first[l] == INVALID) {
         _first[l] = _last[l] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[_first[l]] = i;
-        _next[i] = _first[l];
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(_first[l], i);
+        _next.set(i, _first[l]);
         _first[l] = i;
       }
@@ -833,5 +833,5 @@
       Item i = _first[l];
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = INVALID;
+        _prev.set(_next[i], INVALID);
         _first[l] = _next[i];
       } else {
@@ -839,5 +839,5 @@
         _last[l] = INVALID;
       }
-      _level[i] = _max_level;
+      _level.set(i, _max_level);
       if (l == _highest_active) {
         while (_highest_active >= 0 && activeFree(_highest_active))
@@ -857,21 +857,21 @@
     void lift(Item i, int new_level) {
       if (_next[i] != INVALID) {
-        _prev[_next[i]] = _prev[i];
+        _prev.set(_next[i], _prev[i]);
       } else {
         _last[new_level] = _prev[i];
       }
       if (_prev[i] != INVALID) {
-        _next[_prev[i]] = _next[i];
+        _next.set(_prev[i], _next[i]);
       } else {
         _first[new_level] = _next[i];
       }
-      _level[i] = new_level;
+      _level.set(i, new_level);
       if (_first[new_level] == INVALID) {
         _first[new_level] = _last[new_level] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[_first[new_level]] = i;
-        _next[i] = _first[new_level];
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(_first[new_level], i);
+        _next.set(i, _first[new_level]);
         _first[new_level] = i;
       }
@@ -889,5 +889,5 @@
     ///\pre The item is on the top level.
     void dirtyTopButOne(Item i) {
-      _level[i] = _max_level - 1;
+      _level.set(i, _max_level - 1);
     }
 
@@ -900,5 +900,5 @@
         Item n = _first[i];
         while (n != INVALID) {
-          _level[n] = _max_level;
+          _level.set(n, _max_level);
           n = _next[n];
         }
@@ -936,8 +936,8 @@
       }
       _init_level = 0;
-      for(typename ItemSetTraits<GR,Item>::ItemIt i(_graph);
+      for(typename ItemSetTraits<Graph,Item>::ItemIt i(_graph);
           i != INVALID; ++i) {
-        _level[i] = _max_level;
-        _active[i] = false;
+        _level.set(i, _max_level);
+        _active.set(i, false);
       }
     }
@@ -945,14 +945,14 @@
     ///Add an item to the current level.
     void initAddItem(Item i) {
-      _level[i] = _init_level;
+      _level.set(i, _init_level);
       if (_last[_init_level] == INVALID) {
         _first[_init_level] = i;
         _last[_init_level] = i;
-        _prev[i] = INVALID;
-        _next[i] = INVALID;
-      } else {
-        _prev[i] = _last[_init_level];
-        _next[i] = INVALID;
-        _next[_last[_init_level]] = i;
+        _prev.set(i, INVALID);
+        _next.set(i, INVALID);
+      } else {
+        _prev.set(i, _last[_init_level]);
+        _next.set(i, INVALID);
+        _next.set(_last[_init_level], i);
         _last[_init_level] = i;
       }
Index: lemon/euler.h
===================================================================
--- lemon/euler.h	(revision 592)
+++ lemon/euler.h	(revision 522)
@@ -25,44 +25,46 @@
 #include <list>
 
-/// \ingroup graph_properties
+/// \ingroup graph_prop
 /// \file
-/// \brief Euler tour iterators and a function for checking the \e Eulerian 
-/// property.
+/// \brief Euler tour
 ///
-///This file provides Euler tour iterators and a function to check
-///if a (di)graph is \e Eulerian.
+///This file provides an Euler tour iterator and ways to check
+///if a digraph is euler.
+
 
 namespace lemon {
 
-  ///Euler tour iterator for digraphs.
+  ///Euler iterator for digraphs.
 
   /// \ingroup graph_prop
-  ///This iterator provides an Euler tour (Eulerian circuit) of a \e directed
-  ///graph (if there exists) and it converts to the \c Arc type of the digraph.
+  ///This iterator converts to the \c Arc type of the digraph and using
+  ///operator ++, it provides an Euler tour of a \e directed
+  ///graph (if there exists).
   ///
-  ///For example, if the given digraph has an Euler tour (i.e it has only one
-  ///non-trivial component and the in-degree is equal to the out-degree 
-  ///for all nodes), then the following code will put the arcs of \c g
-  ///to the vector \c et according to an Euler tour of \c g.
+  ///For example
+  ///if the given digraph is Euler (i.e it has only one nontrivial component
+  ///and the in-degree is equal to the out-degree for all nodes),
+  ///the following code will put the arcs of \c g
+  ///to the vector \c et according to an
+  ///Euler tour of \c g.
   ///\code
   ///  std::vector<ListDigraph::Arc> et;
-  ///  for(DiEulerIt<ListDigraph> e(g); e!=INVALID; ++e)
+  ///  for(DiEulerIt<ListDigraph> e(g),e!=INVALID;++e)
   ///    et.push_back(e);
   ///\endcode
-  ///If \c g has no Euler tour, then the resulted walk will not be closed
-  ///or not contain all arcs.
+  ///If \c g is not Euler then the resulted tour will not be full or closed.
   ///\sa EulerIt
-  template<typename GR>
+  template<class Digraph>
   class DiEulerIt
   {
-    typedef typename GR::Node Node;
-    typedef typename GR::NodeIt NodeIt;
-    typedef typename GR::Arc Arc;
-    typedef typename GR::ArcIt ArcIt;
-    typedef typename GR::OutArcIt OutArcIt;
-    typedef typename GR::InArcIt InArcIt;
-
-    const GR &g;
-    typename GR::template NodeMap<OutArcIt> narc;
+    typedef typename Digraph::Node Node;
+    typedef typename Digraph::NodeIt NodeIt;
+    typedef typename Digraph::Arc Arc;
+    typedef typename Digraph::ArcIt ArcIt;
+    typedef typename Digraph::OutArcIt OutArcIt;
+    typedef typename Digraph::InArcIt InArcIt;
+
+    const Digraph &g;
+    typename Digraph::template NodeMap<OutArcIt> nedge;
     std::list<Arc> euler;
 
@@ -71,46 +73,36 @@
     ///Constructor
 
-    ///Constructor.
-    ///\param gr A digraph.
-    ///\param start The starting point of the tour. If it is not given,
-    ///the tour will start from the first node that has an outgoing arc.
-    DiEulerIt(const GR &gr, typename GR::Node start = INVALID)
-      : g(gr), narc(g)
-    {
-      if (start==INVALID) {
-        NodeIt n(g);
-        while (n!=INVALID && OutArcIt(g,n)==INVALID) ++n;
-        start=n;
-      }
-      if (start!=INVALID) {
-        for (NodeIt n(g); n!=INVALID; ++n) narc[n]=OutArcIt(g,n);
-        while (narc[start]!=INVALID) {
-          euler.push_back(narc[start]);
-          Node next=g.target(narc[start]);
-          ++narc[start];
-          start=next;
-        }
-      }
-    }
-
-    ///Arc conversion
+    ///\param _g A digraph.
+    ///\param start The starting point of the tour. If it is not given
+    ///       the tour will start from the first node.
+    DiEulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
+      : g(_g), nedge(g)
+    {
+      if(start==INVALID) start=NodeIt(g);
+      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
+      while(nedge[start]!=INVALID) {
+        euler.push_back(nedge[start]);
+        Node next=g.target(nedge[start]);
+        ++nedge[start];
+        start=next;
+      }
+    }
+
+    ///Arc Conversion
     operator Arc() { return euler.empty()?INVALID:euler.front(); }
-    ///Compare with \c INVALID
     bool operator==(Invalid) { return euler.empty(); }
-    ///Compare with \c INVALID
     bool operator!=(Invalid) { return !euler.empty(); }
 
     ///Next arc of the tour
-
-    ///Next arc of the tour
-    ///
     DiEulerIt &operator++() {
       Node s=g.target(euler.front());
       euler.pop_front();
+      //This produces a warning.Strange.
+      //std::list<Arc>::iterator next=euler.begin();
       typename std::list<Arc>::iterator next=euler.begin();
-      while(narc[s]!=INVALID) {
-        euler.insert(next,narc[s]);
-        Node n=g.target(narc[s]);
-        ++narc[s];
+      while(nedge[s]!=INVALID) {
+        euler.insert(next,nedge[s]);
+        Node n=g.target(nedge[s]);
+        ++nedge[s];
         s=n;
       }
@@ -119,8 +111,6 @@
     ///Postfix incrementation
 
-    /// Postfix incrementation.
-    ///
     ///\warning This incrementation
-    ///returns an \c Arc, not a \ref DiEulerIt, as one may
+    ///returns an \c Arc, not an \ref DiEulerIt, as one may
     ///expect.
     Arc operator++(int)
@@ -132,40 +122,42 @@
   };
 
-  ///Euler tour iterator for graphs.
-
-  /// \ingroup graph_properties
-  ///This iterator provides an Euler tour (Eulerian circuit) of an
-  ///\e undirected graph (if there exists) and it converts to the \c Arc
-  ///and \c Edge types of the graph.
+  ///Euler iterator for graphs.
+
+  /// \ingroup graph_prop
+  ///This iterator converts to the \c Arc (or \c Edge)
+  ///type of the digraph and using
+  ///operator ++, it provides an Euler tour of an undirected
+  ///digraph (if there exists).
   ///
-  ///For example, if the given graph has an Euler tour (i.e it has only one 
-  ///non-trivial component and the degree of each node is even),
+  ///For example
+  ///if the given digraph if Euler (i.e it has only one nontrivial component
+  ///and the degree of each node is even),
   ///the following code will print the arc IDs according to an
   ///Euler tour of \c g.
   ///\code
-  ///  for(EulerIt<ListGraph> e(g); e!=INVALID; ++e) {
+  ///  for(EulerIt<ListGraph> e(g),e!=INVALID;++e) {
   ///    std::cout << g.id(Edge(e)) << std::eol;
   ///  }
   ///\endcode
-  ///Although this iterator is for undirected graphs, it still returns 
-  ///arcs in order to indicate the direction of the tour.
-  ///(But arcs convert to edges, of course.)
+  ///Although the iterator provides an Euler tour of an graph,
+  ///it still returns Arcs in order to indicate the direction of the tour.
+  ///(But Arc will convert to Edges, of course).
   ///
-  ///If \c g has no Euler tour, then the resulted walk will not be closed
-  ///or not contain all edges.
-  template<typename GR>
+  ///If \c g is not Euler then the resulted tour will not be full or closed.
+  ///\sa EulerIt
+  template<class Digraph>
   class EulerIt
   {
-    typedef typename GR::Node Node;
-    typedef typename GR::NodeIt NodeIt;
-    typedef typename GR::Arc Arc;
-    typedef typename GR::Edge Edge;
-    typedef typename GR::ArcIt ArcIt;
-    typedef typename GR::OutArcIt OutArcIt;
-    typedef typename GR::InArcIt InArcIt;
-
-    const GR &g;
-    typename GR::template NodeMap<OutArcIt> narc;
-    typename GR::template EdgeMap<bool> visited;
+    typedef typename Digraph::Node Node;
+    typedef typename Digraph::NodeIt NodeIt;
+    typedef typename Digraph::Arc Arc;
+    typedef typename Digraph::Edge Edge;
+    typedef typename Digraph::ArcIt ArcIt;
+    typedef typename Digraph::OutArcIt OutArcIt;
+    typedef typename Digraph::InArcIt InArcIt;
+
+    const Digraph &g;
+    typename Digraph::template NodeMap<OutArcIt> nedge;
+    typename Digraph::template EdgeMap<bool> visited;
     std::list<Arc> euler;
 
@@ -174,54 +166,45 @@
     ///Constructor
 
-    ///Constructor.
-    ///\param gr A graph.
-    ///\param start The starting point of the tour. If it is not given,
-    ///the tour will start from the first node that has an incident edge.
-    EulerIt(const GR &gr, typename GR::Node start = INVALID)
-      : g(gr), narc(g), visited(g, false)
-    {
-      if (start==INVALID) {
-        NodeIt n(g);
-        while (n!=INVALID && OutArcIt(g,n)==INVALID) ++n;
-        start=n;
-      }
-      if (start!=INVALID) {
-        for (NodeIt n(g); n!=INVALID; ++n) narc[n]=OutArcIt(g,n);
-        while(narc[start]!=INVALID) {
-          euler.push_back(narc[start]);
-          visited[narc[start]]=true;
-          Node next=g.target(narc[start]);
-          ++narc[start];
-          start=next;
-          while(narc[start]!=INVALID && visited[narc[start]]) ++narc[start];
-        }
-      }
-    }
-
-    ///Arc conversion
+    ///\param _g An graph.
+    ///\param start The starting point of the tour. If it is not given
+    ///       the tour will start from the first node.
+    EulerIt(const Digraph &_g,typename Digraph::Node start=INVALID)
+      : g(_g), nedge(g), visited(g,false)
+    {
+      if(start==INVALID) start=NodeIt(g);
+      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
+      while(nedge[start]!=INVALID) {
+        euler.push_back(nedge[start]);
+        visited[nedge[start]]=true;
+        Node next=g.target(nedge[start]);
+        ++nedge[start];
+        start=next;
+        while(nedge[start]!=INVALID && visited[nedge[start]]) ++nedge[start];
+      }
+    }
+
+    ///Arc Conversion
     operator Arc() const { return euler.empty()?INVALID:euler.front(); }
-    ///Edge conversion
+    ///Arc Conversion
     operator Edge() const { return euler.empty()?INVALID:euler.front(); }
-    ///Compare with \c INVALID
+    ///\e
     bool operator==(Invalid) const { return euler.empty(); }
-    ///Compare with \c INVALID
+    ///\e
     bool operator!=(Invalid) const { return !euler.empty(); }
 
     ///Next arc of the tour
-
-    ///Next arc of the tour
-    ///
     EulerIt &operator++() {
       Node s=g.target(euler.front());
       euler.pop_front();
       typename std::list<Arc>::iterator next=euler.begin();
-      while(narc[s]!=INVALID) {
-        while(narc[s]!=INVALID && visited[narc[s]]) ++narc[s];
-        if(narc[s]==INVALID) break;
+
+      while(nedge[s]!=INVALID) {
+        while(nedge[s]!=INVALID && visited[nedge[s]]) ++nedge[s];
+        if(nedge[s]==INVALID) break;
         else {
-          euler.insert(next,narc[s]);
-          visited[narc[s]]=true;
-          Node n=g.target(narc[s]);
-          ++narc[s];
+          euler.insert(next,nedge[s]);
+          visited[nedge[s]]=true;
+          Node n=g.target(nedge[s]);
+          ++nedge[s];
           s=n;
         }
@@ -232,8 +215,7 @@
     ///Postfix incrementation
 
-    /// Postfix incrementation.
-    ///
-    ///\warning This incrementation returns an \c Arc (which converts to 
-    ///an \c Edge), not an \ref EulerIt, as one may expect.
+    ///\warning This incrementation
+    ///returns an \c Arc, not an \ref EulerIt, as one may
+    ///expect.
     Arc operator++(int)
     {
@@ -245,40 +227,35 @@
 
 
-  ///Check if the given graph is \e Eulerian
-
-  /// \ingroup graph_properties
-  ///This function checks if the given graph is \e Eulerian.
-  ///It works for both directed and undirected graphs.
-  ///
-  ///By definition, a digraph is called \e Eulerian if
-  ///and only if it is connected and the number of incoming and outgoing
+  ///Checks if the graph is Eulerian
+
+  /// \ingroup graph_prop
+  ///Checks if the graph is Eulerian. It works for both directed and undirected
+  ///graphs.
+  ///\note By definition, a digraph is called \e Eulerian if
+  ///and only if it is connected and the number of its incoming and outgoing
   ///arcs are the same for each node.
   ///Similarly, an undirected graph is called \e Eulerian if
-  ///and only if it is connected and the number of incident edges is even
-  ///for each node.
-  ///
-  ///\note There are (di)graphs that are not Eulerian, but still have an
-  /// Euler tour, since they may contain isolated nodes.
-  ///
-  ///\sa DiEulerIt, EulerIt
-  template<typename GR>
+  ///and only if it is connected and the number of incident arcs is even
+  ///for each node. <em>Therefore, there are digraphs which are not Eulerian,
+  ///but still have an Euler tour</em>.
+  template<class Digraph>
 #ifdef DOXYGEN
   bool
 #else
-  typename enable_if<UndirectedTagIndicator<GR>,bool>::type
-  eulerian(const GR &g)
-  {
-    for(typename GR::NodeIt n(g);n!=INVALID;++n)
+  typename enable_if<UndirectedTagIndicator<Digraph>,bool>::type
+  eulerian(const Digraph &g)
+  {
+    for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
       if(countIncEdges(g,n)%2) return false;
     return connected(g);
   }
-  template<class GR>
-  typename disable_if<UndirectedTagIndicator<GR>,bool>::type
+  template<class Digraph>
+  typename disable_if<UndirectedTagIndicator<Digraph>,bool>::type
 #endif
-  eulerian(const GR &g)
-  {
-    for(typename GR::NodeIt n(g);n!=INVALID;++n)
+  eulerian(const Digraph &g)
+  {
+    for(typename Digraph::NodeIt n(g);n!=INVALID;++n)
       if(countInArcs(g,n)!=countOutArcs(g,n)) return false;
-    return connected(undirector(g));
+    return connected(Undirector<const Digraph>(g));
   }
 
Index: lemon/full_graph.h
===================================================================
--- lemon/full_graph.h	(revision 582)
+++ lemon/full_graph.h	(revision 440)
@@ -158,6 +158,7 @@
   /// constant space in memory.
   ///
-  /// This class fully conforms to the \ref concepts::Digraph
-  /// "Digraph concept".
+  /// This class conforms to the \ref concepts::Digraph "Digraph" concept
+  /// and it also has an important extra feature that its maps are
+  /// real \ref concepts::ReferenceMap "reference map"s.
   ///
   /// The \c FullDigraph and \c FullGraph classes are very similar,
@@ -527,5 +528,7 @@
   /// space in memory.
   ///
-  /// This class fully conforms to the \ref concepts::Graph "Graph concept".
+  /// This class conforms to the \ref concepts::Graph "Graph" concept
+  /// and it also has an important extra feature that its maps are
+  /// real \ref concepts::ReferenceMap "reference map"s.
   ///
   /// The \c FullGraph and \c FullDigraph classes are very similar,
Index: lemon/glpk.cc
===================================================================
--- lemon/glpk.cc	(revision 576)
+++ lemon/glpk.cc	(revision 462)
@@ -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).
@@ -32,5 +32,4 @@
     lp = glp_create_prob();
     glp_create_index(lp);
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -41,5 +40,4 @@
     rows = other.rows;
     cols = other.cols;
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -525,44 +523,18 @@
   }
 
-  void GlpkBase::freeEnv() {
-    glp_free_env();
-  }
-
-  void GlpkBase::_messageLevel(MessageLevel level) {
-    switch (level) {
-    case MESSAGE_NOTHING:
-      _message_level = GLP_MSG_OFF;
-      break;
-    case MESSAGE_ERROR:
-      _message_level = GLP_MSG_ERR;
-      break;
-    case MESSAGE_WARNING:
-      _message_level = GLP_MSG_ERR;
-      break;
-    case MESSAGE_NORMAL:
-      _message_level = GLP_MSG_ON;
-      break;
-    case MESSAGE_VERBOSE:
-      _message_level = GLP_MSG_ALL;
-      break;
-    }
-  }
-
-  GlpkBase::FreeEnvHelper GlpkBase::freeEnvHelper;
-
   // GlpkLp members
 
   GlpkLp::GlpkLp()
-    : LpBase(), LpSolver(), GlpkBase() {
-    presolver(false);
+    : LpBase(), GlpkBase(), LpSolver() {
+    messageLevel(MESSAGE_NO_OUTPUT);
   }
 
   GlpkLp::GlpkLp(const GlpkLp& other)
-    : LpBase(other), LpSolver(other), GlpkBase(other) {
-    presolver(false);
-  }
-
-  GlpkLp* GlpkLp::newSolver() const { return new GlpkLp; }
-  GlpkLp* GlpkLp::cloneSolver() const { return new GlpkLp(*this); }
+    : LpBase(other), GlpkBase(other), LpSolver(other) {
+    messageLevel(MESSAGE_NO_OUTPUT);
+  }
+
+  GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
+  GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
 
   const char* GlpkLp::_solverName() const { return "GlpkLp"; }
@@ -583,24 +555,20 @@
     glp_init_smcp(&smcp);
 
-    smcp.msg_lev = _message_level;
-    smcp.presolve = _presolve;
-
-    // If the basis is not valid we get an error return value.
-    // In this case we can try to create a new basis.
-    switch (glp_simplex(lp, &smcp)) {
-    case 0:
-      break;
-    case GLP_EBADB:
-    case GLP_ESING:
-    case GLP_ECOND:
-      glp_term_out(false);
-      glp_adv_basis(lp, 0);
-      glp_term_out(true);
-      if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
-      break;
-    default:
-      return UNSOLVED;
-    }
-
+    switch (_message_level) {
+    case MESSAGE_NO_OUTPUT:
+      smcp.msg_lev = GLP_MSG_OFF;
+      break;
+    case MESSAGE_ERROR_MESSAGE:
+      smcp.msg_lev = GLP_MSG_ERR;
+      break;
+    case MESSAGE_NORMAL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ON;
+      break;
+    case MESSAGE_FULL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ALL;
+      break;
+    }
+
+    if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
     return SOLVED;
   }
@@ -612,24 +580,21 @@
     glp_init_smcp(&smcp);
 
-    smcp.msg_lev = _message_level;
+    switch (_message_level) {
+    case MESSAGE_NO_OUTPUT:
+      smcp.msg_lev = GLP_MSG_OFF;
+      break;
+    case MESSAGE_ERROR_MESSAGE:
+      smcp.msg_lev = GLP_MSG_ERR;
+      break;
+    case MESSAGE_NORMAL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ON;
+      break;
+    case MESSAGE_FULL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ALL;
+      break;
+    }
     smcp.meth = GLP_DUAL;
-    smcp.presolve = _presolve;
-
-    // If the basis is not valid we get an error return value.
-    // In this case we can try to create a new basis.
-    switch (glp_simplex(lp, &smcp)) {
-    case 0:
-      break;
-    case GLP_EBADB:
-    case GLP_ESING:
-    case GLP_ECOND:
-      glp_term_out(false);
-      glp_adv_basis(lp, 0);
-      glp_term_out(true);
-      if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
-      break;
-    default:
-      return UNSOLVED;
-    }
+
+    if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
     return SOLVED;
   }
@@ -849,6 +814,10 @@
   }
 
-  void GlpkLp::presolver(bool presolve) {
-    _presolve = presolve;
+  void GlpkLp::presolver(bool b) {
+    lpx_set_int_parm(lp, LPX_K_PRESOL, b ? 1 : 0);
+  }
+
+  void GlpkLp::messageLevel(MessageLevel m) {
+    _message_level = m;
   }
 
@@ -856,9 +825,11 @@
 
   GlpkMip::GlpkMip()
-    : LpBase(), MipSolver(), GlpkBase() {
+    : LpBase(), GlpkBase(), MipSolver() {
+    messageLevel(MESSAGE_NO_OUTPUT);
   }
 
   GlpkMip::GlpkMip(const GlpkMip& other)
-    : LpBase(), MipSolver(), GlpkBase(other) {
+    : LpBase(), GlpkBase(other), MipSolver() {
+    messageLevel(MESSAGE_NO_OUTPUT);
   }
 
@@ -889,24 +860,21 @@
     glp_init_smcp(&smcp);
 
-    smcp.msg_lev = _message_level;
+    switch (_message_level) {
+    case MESSAGE_NO_OUTPUT:
+      smcp.msg_lev = GLP_MSG_OFF;
+      break;
+    case MESSAGE_ERROR_MESSAGE:
+      smcp.msg_lev = GLP_MSG_ERR;
+      break;
+    case MESSAGE_NORMAL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ON;
+      break;
+    case MESSAGE_FULL_OUTPUT:
+      smcp.msg_lev = GLP_MSG_ALL;
+      break;
+    }
     smcp.meth = GLP_DUAL;
 
-    // If the basis is not valid we get an error return value.
-    // In this case we can try to create a new basis.
-    switch (glp_simplex(lp, &smcp)) {
-    case 0:
-      break;
-    case GLP_EBADB:
-    case GLP_ESING:
-    case GLP_ECOND:
-      glp_term_out(false);
-      glp_adv_basis(lp, 0);
-      glp_term_out(true);
-      if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
-      break;
-    default:
-      return UNSOLVED;
-    }
-
+    if (glp_simplex(lp, &smcp) != 0) return UNSOLVED;
     if (glp_get_status(lp) != GLP_OPT) return SOLVED;
 
@@ -914,5 +882,18 @@
     glp_init_iocp(&iocp);
 
-    iocp.msg_lev = _message_level;
+    switch (_message_level) {
+    case MESSAGE_NO_OUTPUT:
+      iocp.msg_lev = GLP_MSG_OFF;
+      break;
+    case MESSAGE_ERROR_MESSAGE:
+      iocp.msg_lev = GLP_MSG_ERR;
+      break;
+    case MESSAGE_NORMAL_OUTPUT:
+      iocp.msg_lev = GLP_MSG_ON;
+      break;
+    case MESSAGE_FULL_OUTPUT:
+      iocp.msg_lev = GLP_MSG_ALL;
+      break;
+    }
 
     if (glp_intopt(lp, &iocp) != 0) return UNSOLVED;
@@ -960,8 +941,12 @@
   }
 
-  GlpkMip* GlpkMip::newSolver() const { return new GlpkMip; }
-  GlpkMip* GlpkMip::cloneSolver() const {return new GlpkMip(*this); }
+  GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
+  GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
 
   const char* GlpkMip::_solverName() const { return "GlpkMip"; }
 
+  void GlpkMip::messageLevel(MessageLevel m) {
+    _message_level = m;
+  }
+
 } //END OF NAMESPACE LEMON
Index: lemon/glpk.h
===================================================================
--- lemon/glpk.h	(revision 576)
+++ lemon/glpk.h	(revision 462)
@@ -101,22 +101,4 @@
     virtual void _clear();
 
-    virtual void _messageLevel(MessageLevel level);
-
-  private:
-
-    static void freeEnv();
-
-    struct FreeEnvHelper {
-      ~FreeEnvHelper() {
-        freeEnv();
-      }
-    };
-    
-    static FreeEnvHelper freeEnvHelper;
-
-  protected:
-    
-    int _message_level;
-    
   public:
 
@@ -138,5 +120,5 @@
   /// This class implements an interface for the GLPK LP solver.
   ///\ingroup lp_group
-  class GlpkLp : public LpSolver, public GlpkBase {
+  class GlpkLp : public GlpkBase, public LpSolver {
   public:
 
@@ -145,9 +127,4 @@
     ///\e
     GlpkLp(const GlpkLp&);
-
-    ///\e
-    virtual GlpkLp* cloneSolver() const;
-    ///\e
-    virtual GlpkLp* newSolver() const;
 
   private:
@@ -159,4 +136,7 @@
 
   protected:
+
+    virtual GlpkLp* _cloneSolver() const;
+    virtual GlpkLp* _newSolver() const;
 
     virtual const char* _solverName() const;
@@ -174,4 +154,6 @@
     virtual Value _getDualRay(int i) const;
 
+    ///\todo It should be clarified
+    ///
     virtual ProblemType _getPrimalType() const;
     virtual ProblemType _getDualType() const;
@@ -185,17 +167,35 @@
     SolveExitStatus solveDual();
 
+    ///Turns on or off the presolver
+
+    ///Turns on (\c b is \c true) or off (\c b is \c false) the presolver
+    ///
+    ///The presolver is off by default.
+    void presolver(bool b);
+
+    ///Enum for \c messageLevel() parameter
+    enum MessageLevel {
+      /// no output (default value)
+      MESSAGE_NO_OUTPUT = 0,
+      /// error messages only
+      MESSAGE_ERROR_MESSAGE = 1,
+      /// normal output
+      MESSAGE_NORMAL_OUTPUT = 2,
+      /// full output (includes informational messages)
+      MESSAGE_FULL_OUTPUT = 3
+    };
+
   private:
 
-    bool _presolve;
-
-  public:
-
-    ///Turns on or off the presolver
-
-    ///Turns on (\c b is \c true) or off (\c b is \c false) the presolver
-    ///
-    ///The presolver is off by default.
-    void presolver(bool presolve);
-
+    MessageLevel _message_level;
+
+  public:
+
+    ///Set the verbosity of the messages
+
+    ///Set the verbosity of the messages
+    ///
+    ///\param m is the level of the messages output by the solver routines.
+    void messageLevel(MessageLevel m);
   };
 
@@ -204,5 +204,5 @@
   /// This class implements an interface for the GLPK MIP solver.
   ///\ingroup lp_group
-  class GlpkMip : public MipSolver, public GlpkBase {
+  class GlpkMip : public GlpkBase, public MipSolver {
   public:
 
@@ -212,8 +212,8 @@
     GlpkMip(const GlpkMip&);
 
-    virtual GlpkMip* cloneSolver() const;
-    virtual GlpkMip* newSolver() const;
-
-  protected:
+  protected:
+
+    virtual GlpkMip* _cloneSolver() const;
+    virtual GlpkMip* _newSolver() const;
 
     virtual const char* _solverName() const;
@@ -227,4 +227,28 @@
     virtual Value _getSolValue() const;
 
+    ///Enum for \c messageLevel() parameter
+    enum MessageLevel {
+      /// no output (default value)
+      MESSAGE_NO_OUTPUT = 0,
+      /// error messages only
+      MESSAGE_ERROR_MESSAGE = 1,
+      /// normal output
+      MESSAGE_NORMAL_OUTPUT = 2,
+      /// full output (includes informational messages)
+      MESSAGE_FULL_OUTPUT = 3
+    };
+
+  private:
+
+    MessageLevel _message_level;
+
+  public:
+
+    ///Set the verbosity of the messages
+
+    ///Set the verbosity of the messages
+    ///
+    ///\param m is the level of the messages output by the solver routines.
+    void messageLevel(MessageLevel m);
   };
 
Index: mon/gomory_hu.h
===================================================================
--- lemon/gomory_hu.h	(revision 596)
+++ 	(revision )
@@ -1,570 +1,0 @@
-/* -*- C++ -*-
- *
- * 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.
- *
- */
-
-#ifndef LEMON_GOMORY_HU_TREE_H
-#define LEMON_GOMORY_HU_TREE_H
-
-#include <limits>
-
-#include <lemon/core.h>
-#include <lemon/preflow.h>
-#include <lemon/concept_check.h>
-#include <lemon/concepts/maps.h>
-
-/// \ingroup min_cut
-/// \file 
-/// \brief Gomory-Hu cut tree in graphs.
-
-namespace lemon {
-
-  /// \ingroup min_cut
-  ///
-  /// \brief Gomory-Hu cut tree algorithm
-  ///
-  /// The Gomory-Hu tree is a tree on the node set of a given graph, but it
-  /// may contain edges which are not in the original graph. It has the
-  /// property that the minimum capacity edge of the path between two nodes 
-  /// in this tree has the same weight as the minimum cut in the graph
-  /// between these nodes. Moreover the components obtained by removing
-  /// this edge from the tree determine the corresponding minimum cut.
-  /// Therefore once this tree is computed, the minimum cut between any pair
-  /// of nodes can easily be obtained.
-  /// 
-  /// The algorithm calculates \e n-1 distinct minimum cuts (currently with
-  /// the \ref Preflow algorithm), thus it has \f$O(n^3\sqrt{e})\f$ overall
-  /// time complexity. It calculates a rooted Gomory-Hu tree.
-  /// The structure of the tree and the edge weights can be
-  /// obtained using \c predNode(), \c predValue() and \c rootDist().
-  /// The functions \c minCutMap() and \c minCutValue() calculate
-  /// the minimum cut and the minimum cut value between any two nodes
-  /// in the graph. You can also list (iterate on) the nodes and the
-  /// edges of the cuts using \c MinCutNodeIt and \c MinCutEdgeIt.
-  ///
-  /// \tparam GR The type of the undirected graph the algorithm runs on.
-  /// \tparam CAP The type of the edge map containing the capacities.
-  /// The default map type is \ref concepts::Graph::EdgeMap "GR::EdgeMap<int>".
-#ifdef DOXYGEN
-  template <typename GR,
-	    typename CAP>
-#else
-  template <typename GR,
-	    typename CAP = typename GR::template EdgeMap<int> >
-#endif
-  class GomoryHu {
-  public:
-
-    /// The graph type of the algorithm
-    typedef GR Graph;
-    /// The capacity map type of the algorithm
-    typedef CAP Capacity;
-    /// The value type of capacities
-    typedef typename Capacity::Value Value;
-    
-  private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(Graph);
-
-    const Graph& _graph;
-    const Capacity& _capacity;
-
-    Node _root;
-    typename Graph::template NodeMap<Node>* _pred;
-    typename Graph::template NodeMap<Value>* _weight;
-    typename Graph::template NodeMap<int>* _order;
-
-    void createStructures() {
-      if (!_pred) {
-	_pred = new typename Graph::template NodeMap<Node>(_graph);
-      }
-      if (!_weight) {
-	_weight = new typename Graph::template NodeMap<Value>(_graph);
-      }
-      if (!_order) {
-	_order = new typename Graph::template NodeMap<int>(_graph);
-      }
-    }
-
-    void destroyStructures() {
-      if (_pred) {
-	delete _pred;
-      }
-      if (_weight) {
-	delete _weight;
-      }
-      if (_order) {
-	delete _order;
-      }
-    }
-  
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Constructor.
-    /// \param graph The undirected graph the algorithm runs on.
-    /// \param capacity The edge capacity map.
-    GomoryHu(const Graph& graph, const Capacity& capacity) 
-      : _graph(graph), _capacity(capacity),
-	_pred(0), _weight(0), _order(0) 
-    {
-      checkConcept<concepts::ReadMap<Edge, Value>, Capacity>();
-    }
-
-
-    /// \brief Destructor
-    ///
-    /// Destructor.
-    ~GomoryHu() {
-      destroyStructures();
-    }
-
-  private:
-  
-    // Initialize the internal data structures
-    void init() {
-      createStructures();
-
-      _root = NodeIt(_graph);
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_pred)[n] = _root;
-        (*_order)[n] = -1;
-      }
-      (*_pred)[_root] = INVALID;
-      (*_weight)[_root] = std::numeric_limits<Value>::max(); 
-    }
-
-
-    // Start the algorithm
-    void start() {
-      Preflow<Graph, Capacity> fa(_graph, _capacity, _root, INVALID);
-
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-	if (n == _root) continue;
-
-	Node pn = (*_pred)[n];
-	fa.source(n);
-	fa.target(pn);
-
-	fa.runMinCut();
-
-	(*_weight)[n] = fa.flowValue();
-
-	for (NodeIt nn(_graph); nn != INVALID; ++nn) {
-	  if (nn != n && fa.minCut(nn) && (*_pred)[nn] == pn) {
-	    (*_pred)[nn] = n;
-	  }
-	}
-	if ((*_pred)[pn] != INVALID && fa.minCut((*_pred)[pn])) {
-	  (*_pred)[n] = (*_pred)[pn];
-	  (*_pred)[pn] = n;
-	  (*_weight)[n] = (*_weight)[pn];
-	  (*_weight)[pn] = fa.flowValue();
-	}
-      }
-
-      (*_order)[_root] = 0;
-      int index = 1;
-
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-	std::vector<Node> st;
-	Node nn = n;
-	while ((*_order)[nn] == -1) {
-	  st.push_back(nn);
-	  nn = (*_pred)[nn];
-	}
-	while (!st.empty()) {
-	  (*_order)[st.back()] = index++;
-	  st.pop_back();
-	}
-      }
-    }
-
-  public:
-
-    ///\name Execution Control
- 
-    ///@{
-
-    /// \brief Run the Gomory-Hu algorithm.
-    ///
-    /// This function runs the Gomory-Hu algorithm.
-    void run() {
-      init();
-      start();
-    }
-    
-    /// @}
-
-    ///\name Query Functions
-    ///The results of the algorithm can be obtained using these
-    ///functions.\n
-    ///\ref run() should be called before using them.\n
-    ///See also \ref MinCutNodeIt and \ref MinCutEdgeIt.
-
-    ///@{
-
-    /// \brief Return the predecessor node in the Gomory-Hu tree.
-    ///
-    /// This function returns the predecessor node of the given node
-    /// in the Gomory-Hu tree.
-    /// If \c node is the root of the tree, then it returns \c INVALID.
-    ///
-    /// \pre \ref run() must be called before using this function.
-    Node predNode(const Node& node) const {
-      return (*_pred)[node];
-    }
-
-    /// \brief Return the weight of the predecessor edge in the
-    /// Gomory-Hu tree.
-    ///
-    /// This function returns the weight of the predecessor edge of the 
-    /// given node in the Gomory-Hu tree.
-    /// If \c node is the root of the tree, the result is undefined.
-    ///
-    /// \pre \ref run() must be called before using this function.
-    Value predValue(const Node& node) const {
-      return (*_weight)[node];
-    }
-
-    /// \brief Return the distance from the root node in the Gomory-Hu tree.
-    ///
-    /// This function returns the distance of the given node from the root
-    /// node in the Gomory-Hu tree.
-    ///
-    /// \pre \ref run() must be called before using this function.
-    int rootDist(const Node& node) const {
-      return (*_order)[node];
-    }
-
-    /// \brief Return the minimum cut value between two nodes
-    ///
-    /// This function returns the minimum cut value between the nodes
-    /// \c s and \c t. 
-    /// It finds the nearest common ancestor of the given nodes in the
-    /// Gomory-Hu tree and calculates the minimum weight edge on the
-    /// paths to the ancestor.
-    ///
-    /// \pre \ref run() must be called before using this function.
-    Value minCutValue(const Node& s, const Node& t) const {
-      Node sn = s, tn = t;
-      Value value = std::numeric_limits<Value>::max();
-      
-      while (sn != tn) {
-	if ((*_order)[sn] < (*_order)[tn]) {
-	  if ((*_weight)[tn] <= value) value = (*_weight)[tn];
-	  tn = (*_pred)[tn];
-	} else {
-	  if ((*_weight)[sn] <= value) value = (*_weight)[sn];
-	  sn = (*_pred)[sn];
-	}
-      }
-      return value;
-    }
-
-    /// \brief Return the minimum cut between two nodes
-    ///
-    /// This function returns the minimum cut between the nodes \c s and \c t
-    /// in the \c cutMap parameter by setting the nodes in the component of
-    /// \c s to \c true and the other nodes to \c false.
-    ///
-    /// For higher level interfaces see MinCutNodeIt and MinCutEdgeIt.
-    ///
-    /// \param s The base node.
-    /// \param t The node you want to separate from node \c s.
-    /// \param cutMap The cut will be returned in this map.
-    /// It must be a \c bool (or convertible) \ref concepts::ReadWriteMap
-    /// "ReadWriteMap" on the graph nodes.
-    ///
-    /// \return The value of the minimum cut between \c s and \c t.
-    ///
-    /// \pre \ref run() must be called before using this function.
-    template <typename CutMap>
-    Value minCutMap(const Node& s, ///< 
-                    const Node& t,
-                    ///< 
-                    CutMap& cutMap
-                    ///< 
-                    ) const {
-      Node sn = s, tn = t;
-      bool s_root=false;
-      Node rn = INVALID;
-      Value value = std::numeric_limits<Value>::max();
-      
-      while (sn != tn) {
-	if ((*_order)[sn] < (*_order)[tn]) {
-	  if ((*_weight)[tn] <= value) {
-	    rn = tn;
-            s_root = false;
-	    value = (*_weight)[tn];
-	  }
-	  tn = (*_pred)[tn];
-	} else {
-	  if ((*_weight)[sn] <= value) {
-	    rn = sn;
-            s_root = true;
-	    value = (*_weight)[sn];
-	  }
-	  sn = (*_pred)[sn];
-	}
-      }
-
-      typename Graph::template NodeMap<bool> reached(_graph, false);
-      reached[_root] = true;
-      cutMap.set(_root, !s_root);
-      reached[rn] = true;
-      cutMap.set(rn, s_root);
-
-      std::vector<Node> st;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-	st.clear();
-        Node nn = n;
-	while (!reached[nn]) {
-	  st.push_back(nn);
-	  nn = (*_pred)[nn];
-	}
-	while (!st.empty()) {
-	  cutMap.set(st.back(), cutMap[nn]);
-	  st.pop_back();
-	}
-      }
-      
-      return value;
-    }
-
-    ///@}
-
-    friend class MinCutNodeIt;
-
-    /// Iterate on the nodes of a minimum cut
-    
-    /// This iterator class lists the nodes of a minimum cut found by
-    /// GomoryHu. Before using it, you must allocate a GomoryHu class
-    /// and call its \ref GomoryHu::run() "run()" method.
-    ///
-    /// This example counts the nodes in the minimum cut separating \c s from
-    /// \c t.
-    /// \code
-    /// GomoruHu<Graph> gom(g, capacities);
-    /// gom.run();
-    /// int cnt=0;
-    /// for(GomoruHu<Graph>::MinCutNodeIt n(gom,s,t); n!=INVALID; ++n) ++cnt;
-    /// \endcode
-    class MinCutNodeIt
-    {
-      bool _side;
-      typename Graph::NodeIt _node_it;
-      typename Graph::template NodeMap<bool> _cut;
-    public:
-      /// Constructor
-
-      /// Constructor.
-      ///
-      MinCutNodeIt(GomoryHu const &gomory,
-                   ///< The GomoryHu class. You must call its
-                   ///  run() method
-                   ///  before initializing this iterator.
-                   const Node& s, ///< The base node.
-                   const Node& t,
-                   ///< The node you want to separate from node \c s.
-                   bool side=true
-                   ///< If it is \c true (default) then the iterator lists
-                   ///  the nodes of the component containing \c s,
-                   ///  otherwise it lists the other component.
-                   /// \note As the minimum cut is not always unique,
-                   /// \code
-                   /// MinCutNodeIt(gomory, s, t, true);
-                   /// \endcode
-                   /// and
-                   /// \code
-                   /// MinCutNodeIt(gomory, t, s, false);
-                   /// \endcode
-                   /// does not necessarily give the same set of nodes.
-                   /// However it is ensured that
-                   /// \code
-                   /// MinCutNodeIt(gomory, s, t, true);
-                   /// \endcode
-                   /// and
-                   /// \code
-                   /// MinCutNodeIt(gomory, s, t, false);
-                   /// \endcode
-                   /// together list each node exactly once.
-                   )
-        : _side(side), _cut(gomory._graph)
-      {
-        gomory.minCutMap(s,t,_cut);
-        for(_node_it=typename Graph::NodeIt(gomory._graph);
-            _node_it!=INVALID && _cut[_node_it]!=_side;
-            ++_node_it) {}
-      }
-      /// Conversion to \c Node
-
-      /// Conversion to \c Node.
-      ///
-      operator typename Graph::Node() const
-      {
-        return _node_it;
-      }
-      bool operator==(Invalid) { return _node_it==INVALID; }
-      bool operator!=(Invalid) { return _node_it!=INVALID; }
-      /// Next node
-
-      /// Next node.
-      ///
-      MinCutNodeIt &operator++()
-      {
-        for(++_node_it;_node_it!=INVALID&&_cut[_node_it]!=_side;++_node_it) {}
-        return *this;
-      }
-      /// Postfix incrementation
-
-      /// Postfix incrementation.
-      ///
-      /// \warning This incrementation
-      /// returns a \c Node, not a \c MinCutNodeIt, as one may
-      /// expect.
-      typename Graph::Node operator++(int)
-      {
-        typename Graph::Node n=*this;
-        ++(*this);
-        return n;
-      }
-    };
-    
-    friend class MinCutEdgeIt;
-    
-    /// Iterate on the edges of a minimum cut
-    
-    /// This iterator class lists the edges of a minimum cut found by
-    /// GomoryHu. Before using it, you must allocate a GomoryHu class
-    /// and call its \ref GomoryHu::run() "run()" method.
-    ///
-    /// This example computes the value of the minimum cut separating \c s from
-    /// \c t.
-    /// \code
-    /// GomoruHu<Graph> gom(g, capacities);
-    /// gom.run();
-    /// int value=0;
-    /// for(GomoruHu<Graph>::MinCutEdgeIt e(gom,s,t); e!=INVALID; ++e)
-    ///   value+=capacities[e];
-    /// \endcode
-    /// The result will be the same as the value returned by
-    /// \ref GomoryHu::minCutValue() "gom.minCutValue(s,t)".
-    class MinCutEdgeIt
-    {
-      bool _side;
-      const Graph &_graph;
-      typename Graph::NodeIt _node_it;
-      typename Graph::OutArcIt _arc_it;
-      typename Graph::template NodeMap<bool> _cut;
-      void step()
-      {
-        ++_arc_it;
-        while(_node_it!=INVALID && _arc_it==INVALID)
-          {
-            for(++_node_it;_node_it!=INVALID&&!_cut[_node_it];++_node_it) {}
-            if(_node_it!=INVALID)
-              _arc_it=typename Graph::OutArcIt(_graph,_node_it);
-          }
-      }
-      
-    public:
-      /// Constructor
-
-      /// Constructor.
-      ///
-      MinCutEdgeIt(GomoryHu const &gomory,
-                   ///< The GomoryHu class. You must call its
-                   ///  run() method
-                   ///  before initializing this iterator.
-                   const Node& s,  ///< The base node.
-                   const Node& t,
-                   ///< The node you want to separate from node \c s.
-                   bool side=true
-                   ///< If it is \c true (default) then the listed arcs
-                   ///  will be oriented from the
-                   ///  nodes of the component containing \c s,
-                   ///  otherwise they will be oriented in the opposite
-                   ///  direction.
-                   )
-        : _graph(gomory._graph), _cut(_graph)
-      {
-        gomory.minCutMap(s,t,_cut);
-        if(!side)
-          for(typename Graph::NodeIt n(_graph);n!=INVALID;++n)
-            _cut[n]=!_cut[n];
-
-        for(_node_it=typename Graph::NodeIt(_graph);
-            _node_it!=INVALID && !_cut[_node_it];
-            ++_node_it) {}
-        _arc_it = _node_it!=INVALID ?
-          typename Graph::OutArcIt(_graph,_node_it) : INVALID;
-        while(_node_it!=INVALID && _arc_it == INVALID)
-          {
-            for(++_node_it; _node_it!=INVALID&&!_cut[_node_it]; ++_node_it) {}
-            if(_node_it!=INVALID)
-              _arc_it= typename Graph::OutArcIt(_graph,_node_it);
-          }
-        while(_arc_it!=INVALID && _cut[_graph.target(_arc_it)]) step();
-      }
-      /// Conversion to \c Arc
-
-      /// Conversion to \c Arc.
-      ///
-      operator typename Graph::Arc() const
-      {
-        return _arc_it;
-      }
-      /// Conversion to \c Edge
-
-      /// Conversion to \c Edge.
-      ///
-      operator typename Graph::Edge() const
-      {
-        return _arc_it;
-      }
-      bool operator==(Invalid) { return _node_it==INVALID; }
-      bool operator!=(Invalid) { return _node_it!=INVALID; }
-      /// Next edge
-
-      /// Next edge.
-      ///
-      MinCutEdgeIt &operator++()
-      {
-        step();
-        while(_arc_it!=INVALID && _cut[_graph.target(_arc_it)]) step();
-        return *this;
-      }
-      /// Postfix incrementation
-      
-      /// Postfix incrementation.
-      ///
-      /// \warning This incrementation
-      /// returns an \c Arc, not a \c MinCutEdgeIt, as one may expect.
-      typename Graph::Arc operator++(int)
-      {
-        typename Graph::Arc e=*this;
-        ++(*this);
-        return e;
-      }
-    };
-
-  };
-
-}
-
-#endif
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 584)
+++ lemon/graph_to_eps.h	(revision 515)
@@ -65,9 +65,9 @@
 ///Default traits class of \ref GraphToEps.
 ///
-///\param GR is the type of the underlying graph.
-template<class GR>
+///\c G is the type of the underlying graph.
+template<class G>
 struct DefaultGraphToEpsTraits
 {
-  typedef GR Graph;
+  typedef G Graph;
   typedef typename Graph::Node Node;
   typedef typename Graph::NodeIt NodeIt;
@@ -140,12 +140,13 @@
 
   ///Constructor
-  ///\param gr  Reference to the graph to be printed.
-  ///\param ost Reference to the output stream.
+  ///\param _g  Reference to the graph to be printed.
+  ///\param _os Reference to the output stream.
+  ///\param _os Reference to the output stream.
   ///By default it is <tt>std::cout</tt>.
-  ///\param pros If it is \c true, then the \c ostream referenced by \c os
+  ///\param _pros If it is \c true, then the \c ostream referenced by \c _os
   ///will be explicitly deallocated by the destructor.
-  DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout,
-                          bool pros = false) :
-    g(gr), os(ost),
+  DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
+                          bool _pros=false) :
+    g(_g), os(_os),
     _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
     _nodeColors(WHITE), _arcColors(BLACK),
@@ -158,6 +159,6 @@
     _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
     _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0),
-    _undirected(lemon::UndirectedTagIndicator<GR>::value),
-    _pleaseRemoveOsStream(pros), _scaleToA4(false),
+    _undirected(lemon::UndirectedTagIndicator<G>::value),
+    _pleaseRemoveOsStream(_pros), _scaleToA4(false),
     _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
     _autoNodeScale(false),
@@ -269,16 +270,20 @@
     ///\image html nodeshape_1.png
     ///\image latex nodeshape_1.eps "SQUARE shape (1)" width=2cm
+    ///
     SQUARE=1,
     /// = 2
     ///\image html nodeshape_2.png
     ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm
+    ///
     DIAMOND=2,
     /// = 3
     ///\image html nodeshape_3.png
-    ///\image latex nodeshape_3.eps "MALE shape (3)" width=2cm
+    ///\image latex nodeshape_2.eps "MALE shape (4)" width=2cm
+    ///
     MALE=3,
     /// = 4
     ///\image html nodeshape_4.png
-    ///\image latex nodeshape_4.eps "FEMALE shape (4)" width=2cm
+    ///\image latex nodeshape_2.eps "FEMALE shape (4)" width=2cm
+    ///
     FEMALE=4
   };
@@ -1130,11 +1135,11 @@
 ///to the end of the parameter list.
 ///\sa GraphToEps
-///\sa graphToEps(GR &g, const char *file_name)
-template<class GR>
-GraphToEps<DefaultGraphToEpsTraits<GR> >
-graphToEps(GR &g, std::ostream& os=std::cout)
+///\sa graphToEps(G &g, const char *file_name)
+template<class G>
+GraphToEps<DefaultGraphToEpsTraits<G> >
+graphToEps(G &g, std::ostream& os=std::cout)
 {
   return
-    GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os));
+    GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os));
 }
 
@@ -1143,11 +1148,11 @@
 ///\ingroup eps_io
 ///This function does the same as
-///\ref graphToEps(GR &g,std::ostream& os)
+///\ref graphToEps(G &g,std::ostream& os)
 ///but it writes its output into the file \c file_name
 ///instead of a stream.
-///\sa graphToEps(GR &g, std::ostream& os)
-template<class GR>
-GraphToEps<DefaultGraphToEpsTraits<GR> >
-graphToEps(GR &g,const char *file_name)
+///\sa graphToEps(G &g, std::ostream& os)
+template<class G>
+GraphToEps<DefaultGraphToEpsTraits<G> >
+graphToEps(G &g,const char *file_name)
 {
   std::ostream* os = new std::ofstream(file_name);
@@ -1156,6 +1161,6 @@
     throw IoError("Cannot write file", file_name);
   }
-  return GraphToEps<DefaultGraphToEpsTraits<GR> >
-    (DefaultGraphToEpsTraits<GR>(g,*os,true));
+  return GraphToEps<DefaultGraphToEpsTraits<G> >
+    (DefaultGraphToEpsTraits<G>(g,*os,true));
 }
 
@@ -1164,11 +1169,11 @@
 ///\ingroup eps_io
 ///This function does the same as
-///\ref graphToEps(GR &g,std::ostream& os)
+///\ref graphToEps(G &g,std::ostream& os)
 ///but it writes its output into the file \c file_name
 ///instead of a stream.
-///\sa graphToEps(GR &g, std::ostream& os)
-template<class GR>
-GraphToEps<DefaultGraphToEpsTraits<GR> >
-graphToEps(GR &g,const std::string& file_name)
+///\sa graphToEps(G &g, std::ostream& os)
+template<class G>
+GraphToEps<DefaultGraphToEpsTraits<G> >
+graphToEps(G &g,const std::string& file_name)
 {
   std::ostream* os = new std::ofstream(file_name.c_str());
@@ -1177,6 +1182,6 @@
     throw IoError("Cannot write file", file_name);
   }
-  return GraphToEps<DefaultGraphToEpsTraits<GR> >
-    (DefaultGraphToEpsTraits<GR>(g,*os,true));
+  return GraphToEps<DefaultGraphToEpsTraits<G> >
+    (DefaultGraphToEpsTraits<G>(g,*os,true));
 }
 
Index: lemon/grid_graph.h
===================================================================
--- lemon/grid_graph.h	(revision 582)
+++ lemon/grid_graph.h	(revision 440)
@@ -497,6 +497,8 @@
   ///\endcode
   ///
-  /// This graph type fully conforms to the \ref concepts::Graph
-  /// "Graph concept".
+  /// This graph type is fully conform to the \ref concepts::Graph
+  /// "Graph" concept, and it also has an important extra feature
+  /// that its maps are real \ref concepts::ReferenceMap
+  /// "reference map"s.
   class GridGraph : public ExtendedGridGraphBase {
   public:
Index: lemon/hao_orlin.h
===================================================================
--- lemon/hao_orlin.h	(revision 597)
+++ lemon/hao_orlin.h	(revision 440)
@@ -32,6 +32,6 @@
 /// \brief Implementation of the Hao-Orlin algorithm.
 ///
-/// Implementation of the Hao-Orlin algorithm for finding a minimum cut 
-/// in a digraph.
+/// Implementation of the Hao-Orlin algorithm class for testing network
+/// reliability.
 
 namespace lemon {
@@ -39,55 +39,48 @@
   /// \ingroup min_cut
   ///
-  /// \brief Hao-Orlin algorithm for finding a minimum cut in a digraph.
+  /// \brief %Hao-Orlin algorithm to find a minimum cut in directed graphs.
   ///
-  /// This class implements the Hao-Orlin algorithm for finding a minimum
-  /// value cut in a directed graph \f$D=(V,A)\f$. 
-  /// It takes a fixed node \f$ source \in V \f$ and
+  /// Hao-Orlin calculates a minimum cut in a directed graph
+  /// \f$D=(V,A)\f$. It takes a fixed node \f$ source \in V \f$ and
   /// consists of two phases: in the first phase it determines a
   /// minimum cut with \f$ source \f$ on the source-side (i.e. a set
-  /// \f$ X\subsetneq V \f$ with \f$ source \in X \f$ and minimal outgoing
-  /// capacity) and in the second phase it determines a minimum cut
+  /// \f$ X\subsetneq V \f$ with \f$ source \in X \f$ and minimal
+  /// out-degree) and in the second phase it determines a minimum cut
   /// with \f$ source \f$ on the sink-side (i.e. a set
-  /// \f$ X\subsetneq V \f$ with \f$ source \notin X \f$ and minimal outgoing
-  /// capacity). Obviously, the smaller of these two cuts will be a
+  /// \f$ X\subsetneq V \f$ with \f$ source \notin X \f$ and minimal
+  /// out-degree). Obviously, the smaller of these two cuts will be a
   /// minimum cut of \f$ D \f$. The algorithm is a modified
-  /// preflow push-relabel algorithm. Our implementation calculates
+  /// push-relabel preflow algorithm and our implementation calculates
   /// the minimum cut in \f$ O(n^2\sqrt{m}) \f$ time (we use the
   /// highest-label rule), or in \f$O(nm)\f$ for unit capacities. The
-  /// purpose of such algorithm is e.g. testing network reliability.
+  /// purpose of such algorithm is testing network reliability. For an
+  /// undirected graph you can run just the first phase of the
+  /// algorithm or you can use the algorithm of Nagamochi and Ibaraki
+  /// which solves the undirected problem in
+  /// \f$ O(nm + n^2 \log(n)) \f$ time: it is implemented in the
+  /// NagamochiIbaraki algorithm class.
   ///
-  /// For an undirected graph you can run just the first phase of the
-  /// algorithm or you can use the algorithm of Nagamochi and Ibaraki,
-  /// which solves the undirected problem in \f$ O(nm + n^2 \log n) \f$ 
-  /// time. It is implemented in the NagamochiIbaraki algorithm class.
-  ///
-  /// \tparam GR The type of the digraph the algorithm runs on.
-  /// \tparam CAP The type of the arc map containing the capacities,
-  /// which can be any numreric type. The default map type is
-  /// \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
-  /// \tparam TOL Tolerance class for handling inexact computations. The
-  /// default tolerance type is \ref Tolerance "Tolerance<CAP::Value>".
+  /// \param _Digraph is the graph type of the algorithm.
+  /// \param _CapacityMap is an edge map of capacities which should
+  /// be any numreric type. The default type is _Digraph::ArcMap<int>.
+  /// \param _Tolerance is the handler of the inexact computation. The
+  /// default type for this is Tolerance<CapacityMap::Value>.
 #ifdef DOXYGEN
-  template <typename GR, typename CAP, typename TOL>
+  template <typename _Digraph, typename _CapacityMap, typename _Tolerance>
 #else
-  template <typename GR,
-            typename CAP = typename GR::template ArcMap<int>,
-            typename TOL = Tolerance<typename CAP::Value> >
+  template <typename _Digraph,
+            typename _CapacityMap = typename _Digraph::template ArcMap<int>,
+            typename _Tolerance = Tolerance<typename _CapacityMap::Value> >
 #endif
   class HaoOrlin {
-  public:
-   
-    /// The digraph type of the algorithm
-    typedef GR Digraph;
-    /// The capacity map type of the algorithm
-    typedef CAP CapacityMap;
-    /// The tolerance type of the algorithm
-    typedef TOL Tolerance;
-
   private:
 
+    typedef _Digraph Digraph;
+    typedef _CapacityMap CapacityMap;
+    typedef _Tolerance Tolerance;
+
     typedef typename CapacityMap::Value Value;
 
-    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
+    TEMPLATE_GRAPH_TYPEDEFS(Digraph);
 
     const Digraph& _graph;
@@ -169,5 +162,5 @@
 
     void activate(const Node& i) {
-      (*_active)[i] = true;
+      _active->set(i, true);
 
       int bucket = (*_bucket)[i];
@@ -175,19 +168,19 @@
       if ((*_prev)[i] == INVALID || (*_active)[(*_prev)[i]]) return;
       //unlace
-      (*_next)[(*_prev)[i]] = (*_next)[i];
+      _next->set((*_prev)[i], (*_next)[i]);
       if ((*_next)[i] != INVALID) {
-        (*_prev)[(*_next)[i]] = (*_prev)[i];
+        _prev->set((*_next)[i], (*_prev)[i]);
       } else {
         _last[bucket] = (*_prev)[i];
       }
       //lace
-      (*_next)[i] = _first[bucket];
-      (*_prev)[_first[bucket]] = i;
-      (*_prev)[i] = INVALID;
+      _next->set(i, _first[bucket]);
+      _prev->set(_first[bucket], i);
+      _prev->set(i, INVALID);
       _first[bucket] = i;
     }
 
     void deactivate(const Node& i) {
-      (*_active)[i] = false;
+      _active->set(i, false);
       int bucket = (*_bucket)[i];
 
@@ -195,14 +188,14 @@
 
       //unlace
-      (*_prev)[(*_next)[i]] = (*_prev)[i];
+      _prev->set((*_next)[i], (*_prev)[i]);
       if ((*_prev)[i] != INVALID) {
-        (*_next)[(*_prev)[i]] = (*_next)[i];
+        _next->set((*_prev)[i], (*_next)[i]);
       } else {
         _first[bucket] = (*_next)[i];
       }
       //lace
-      (*_prev)[i] = _last[bucket];
-      (*_next)[_last[bucket]] = i;
-      (*_next)[i] = INVALID;
+      _prev->set(i, _last[bucket]);
+      _next->set(_last[bucket], i);
+      _next->set(i, INVALID);
       _last[bucket] = i;
     }
@@ -211,12 +204,12 @@
       (*_bucket)[i] = bucket;
       if (_last[bucket] != INVALID) {
-        (*_prev)[i] = _last[bucket];
-        (*_next)[_last[bucket]] = i;
-        (*_next)[i] = INVALID;
+        _prev->set(i, _last[bucket]);
+        _next->set(_last[bucket], i);
+        _next->set(i, INVALID);
         _last[bucket] = i;
       } else {
-        (*_prev)[i] = INVALID;
+        _prev->set(i, INVALID);
         _first[bucket] = i;
-        (*_next)[i] = INVALID;
+        _next->set(i, INVALID);
         _last[bucket] = i;
       }
@@ -226,10 +219,9 @@
 
       for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_excess)[n] = 0;
-        (*_source_set)[n] = false;
+        _excess->set(n, 0);
       }
 
       for (ArcIt a(_graph); a != INVALID; ++a) {
-        (*_flow)[a] = 0;
+        _flow->set(a, 0);
       }
 
@@ -241,5 +233,5 @@
         typename Digraph::template NodeMap<bool> reached(_graph, false);
 
-        reached[_source] = true;
+        reached.set(_source, true);
         bool first_set = true;
 
@@ -249,5 +241,5 @@
 
           queue[qlast++] = t;
-          reached[t] = true;
+          reached.set(t, true);
 
           while (qfirst != qlast) {
@@ -266,5 +258,5 @@
               Node u = _graph.source(a);
               if (!reached[u] && _tolerance.positive((*_capacity)[a])) {
-                reached[u] = true;
+                reached.set(u, true);
                 queue[qlast++] = u;
               }
@@ -275,8 +267,8 @@
 
         ++bucket_num;
-        (*_bucket)[_source] = 0;
+        _bucket->set(_source, 0);
         _dormant[0] = true;
       }
-      (*_source_set)[_source] = true;
+      _source_set->set(_source, true);
 
       Node target = _last[_sets.back().back()];
@@ -285,6 +277,6 @@
           if (_tolerance.positive((*_capacity)[a])) {
             Node u = _graph.target(a);
-            (*_flow)[a] = (*_capacity)[a];
-            (*_excess)[u] += (*_capacity)[a];
+            _flow->set(a, (*_capacity)[a]);
+            _excess->set(u, (*_excess)[u] + (*_capacity)[a]);
             if (!(*_active)[u] && u != _source) {
               activate(u);
@@ -327,12 +319,12 @@
               }
               if (!_tolerance.less(rem, excess)) {
-                (*_flow)[a] += excess;
-                (*_excess)[v] += excess;
+                _flow->set(a, (*_flow)[a] + excess);
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
-                (*_flow)[a] = (*_capacity)[a];
+                _excess->set(v, (*_excess)[v] + rem);
+                _flow->set(a, (*_capacity)[a]);
               }
             } else if (next_bucket > (*_bucket)[v]) {
@@ -351,12 +343,12 @@
               }
               if (!_tolerance.less(rem, excess)) {
-                (*_flow)[a] -= excess;
-                (*_excess)[v] += excess;
+                _flow->set(a, (*_flow)[a] - excess);
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
-                (*_flow)[a] = 0;
+                _excess->set(v, (*_excess)[v] + rem);
+                _flow->set(a, 0);
               }
             } else if (next_bucket > (*_bucket)[v]) {
@@ -367,5 +359,5 @@
         no_more_push:
 
-          (*_excess)[n] = excess;
+          _excess->set(n, excess);
 
           if (excess != 0) {
@@ -385,5 +377,5 @@
             } else if (next_bucket == _node_num) {
               _first[(*_bucket)[n]] = (*_next)[n];
-              (*_prev)[(*_next)[n]] = INVALID;
+              _prev->set((*_next)[n], INVALID);
 
               std::list<std::list<int> >::iterator new_set =
@@ -391,8 +383,8 @@
 
               new_set->push_front(bucket_num);
-              (*_bucket)[n] = bucket_num;
+              _bucket->set(n, bucket_num);
               _first[bucket_num] = _last[bucket_num] = n;
-              (*_next)[n] = INVALID;
-              (*_prev)[n] = INVALID;
+              _next->set(n, INVALID);
+              _prev->set(n, INVALID);
               _dormant[bucket_num] = true;
               ++bucket_num;
@@ -404,5 +396,5 @@
             } else {
               _first[*_highest] = (*_next)[n];
-              (*_prev)[(*_next)[n]] = INVALID;
+              _prev->set((*_next)[n], INVALID);
 
               while (next_bucket != *_highest) {
@@ -418,8 +410,8 @@
               --_highest;
 
-              (*_bucket)[n] = *_highest;
-              (*_next)[n] = _first[*_highest];
+              _bucket->set(n, *_highest);
+              _next->set(n, _first[*_highest]);
               if (_first[*_highest] != INVALID) {
-                (*_prev)[_first[*_highest]] = n;
+                _prev->set(_first[*_highest], n);
               } else {
                 _last[*_highest] = n;
@@ -443,5 +435,5 @@
           _min_cut = (*_excess)[target];
           for (NodeIt i(_graph); i != INVALID; ++i) {
-            (*_min_cut_map)[i] = true;
+            _min_cut_map->set(i, true);
           }
           for (std::list<int>::iterator it = _sets.back().begin();
@@ -449,5 +441,5 @@
             Node n = _first[*it];
             while (n != INVALID) {
-              (*_min_cut_map)[n] = false;
+              _min_cut_map->set(n, false);
               n = (*_next)[n];
             }
@@ -462,5 +454,5 @@
               new_target = (*_prev)[target];
             } else {
-              (*_prev)[(*_next)[target]] = (*_prev)[target];
+              _prev->set((*_next)[target], (*_prev)[target]);
               new_target = (*_next)[target];
             }
@@ -468,5 +460,5 @@
               _first[(*_bucket)[target]] = (*_next)[target];
             } else {
-              (*_next)[(*_prev)[target]] = (*_next)[target];
+              _next->set((*_prev)[target], (*_next)[target]);
             }
           } else {
@@ -484,7 +476,7 @@
           }
 
-          (*_bucket)[target] = 0;
-
-          (*_source_set)[target] = true;
+          _bucket->set(target, 0);
+
+          _source_set->set(target, true);
           for (OutArcIt a(_graph, target); a != INVALID; ++a) {
             Value rem = (*_capacity)[a] - (*_flow)[a];
@@ -494,6 +486,6 @@
               activate(v);
             }
-            (*_excess)[v] += rem;
-            (*_flow)[a] = (*_capacity)[a];
+            _excess->set(v, (*_excess)[v] + rem);
+            _flow->set(a, (*_capacity)[a]);
           }
 
@@ -505,6 +497,6 @@
               activate(v);
             }
-            (*_excess)[v] += rem;
-            (*_flow)[a] = 0;
+            _excess->set(v, (*_excess)[v] + rem);
+            _flow->set(a, 0);
           }
 
@@ -526,10 +518,9 @@
 
       for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_excess)[n] = 0;
-        (*_source_set)[n] = false;
+        _excess->set(n, 0);
       }
 
       for (ArcIt a(_graph); a != INVALID; ++a) {
-        (*_flow)[a] = 0;
+        _flow->set(a, 0);
       }
 
@@ -541,5 +532,5 @@
         typename Digraph::template NodeMap<bool> reached(_graph, false);
 
-        reached[_source] = true;
+        reached.set(_source, true);
 
         bool first_set = true;
@@ -550,5 +541,5 @@
 
           queue[qlast++] = t;
-          reached[t] = true;
+          reached.set(t, true);
 
           while (qfirst != qlast) {
@@ -567,5 +558,5 @@
               Node u = _graph.target(a);
               if (!reached[u] && _tolerance.positive((*_capacity)[a])) {
-                reached[u] = true;
+                reached.set(u, true);
                 queue[qlast++] = u;
               }
@@ -576,8 +567,8 @@
 
         ++bucket_num;
-        (*_bucket)[_source] = 0;
+        _bucket->set(_source, 0);
         _dormant[0] = true;
       }
-      (*_source_set)[_source] = true;
+      _source_set->set(_source, true);
 
       Node target = _last[_sets.back().back()];
@@ -586,6 +577,6 @@
           if (_tolerance.positive((*_capacity)[a])) {
             Node u = _graph.source(a);
-            (*_flow)[a] = (*_capacity)[a];
-            (*_excess)[u] += (*_capacity)[a];
+            _flow->set(a, (*_capacity)[a]);
+            _excess->set(u, (*_excess)[u] + (*_capacity)[a]);
             if (!(*_active)[u] && u != _source) {
               activate(u);
@@ -628,12 +619,12 @@
               }
               if (!_tolerance.less(rem, excess)) {
-                (*_flow)[a] += excess;
-                (*_excess)[v] += excess;
+                _flow->set(a, (*_flow)[a] + excess);
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
-                (*_flow)[a] = (*_capacity)[a];
+                _excess->set(v, (*_excess)[v] + rem);
+                _flow->set(a, (*_capacity)[a]);
               }
             } else if (next_bucket > (*_bucket)[v]) {
@@ -652,12 +643,12 @@
               }
               if (!_tolerance.less(rem, excess)) {
-                (*_flow)[a] -= excess;
-                (*_excess)[v] += excess;
+                _flow->set(a, (*_flow)[a] - excess);
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
-                (*_flow)[a] = 0;
+                _excess->set(v, (*_excess)[v] + rem);
+                _flow->set(a, 0);
               }
             } else if (next_bucket > (*_bucket)[v]) {
@@ -668,5 +659,5 @@
         no_more_push:
 
-          (*_excess)[n] = excess;
+          _excess->set(n, excess);
 
           if (excess != 0) {
@@ -686,5 +677,5 @@
             } else if (next_bucket == _node_num) {
               _first[(*_bucket)[n]] = (*_next)[n];
-              (*_prev)[(*_next)[n]] = INVALID;
+              _prev->set((*_next)[n], INVALID);
 
               std::list<std::list<int> >::iterator new_set =
@@ -692,8 +683,8 @@
 
               new_set->push_front(bucket_num);
-              (*_bucket)[n] = bucket_num;
+              _bucket->set(n, bucket_num);
               _first[bucket_num] = _last[bucket_num] = n;
-              (*_next)[n] = INVALID;
-              (*_prev)[n] = INVALID;
+              _next->set(n, INVALID);
+              _prev->set(n, INVALID);
               _dormant[bucket_num] = true;
               ++bucket_num;
@@ -705,5 +696,5 @@
             } else {
               _first[*_highest] = (*_next)[n];
-              (*_prev)[(*_next)[n]] = INVALID;
+              _prev->set((*_next)[n], INVALID);
 
               while (next_bucket != *_highest) {
@@ -718,8 +709,8 @@
               --_highest;
 
-              (*_bucket)[n] = *_highest;
-              (*_next)[n] = _first[*_highest];
+              _bucket->set(n, *_highest);
+              _next->set(n, _first[*_highest]);
               if (_first[*_highest] != INVALID) {
-                (*_prev)[_first[*_highest]] = n;
+                _prev->set(_first[*_highest], n);
               } else {
                 _last[*_highest] = n;
@@ -743,5 +734,5 @@
           _min_cut = (*_excess)[target];
           for (NodeIt i(_graph); i != INVALID; ++i) {
-            (*_min_cut_map)[i] = false;
+            _min_cut_map->set(i, false);
           }
           for (std::list<int>::iterator it = _sets.back().begin();
@@ -749,5 +740,5 @@
             Node n = _first[*it];
             while (n != INVALID) {
-              (*_min_cut_map)[n] = true;
+              _min_cut_map->set(n, true);
               n = (*_next)[n];
             }
@@ -762,5 +753,5 @@
               new_target = (*_prev)[target];
             } else {
-              (*_prev)[(*_next)[target]] = (*_prev)[target];
+              _prev->set((*_next)[target], (*_prev)[target]);
               new_target = (*_next)[target];
             }
@@ -768,5 +759,5 @@
               _first[(*_bucket)[target]] = (*_next)[target];
             } else {
-              (*_next)[(*_prev)[target]] = (*_next)[target];
+              _next->set((*_prev)[target], (*_next)[target]);
             }
           } else {
@@ -784,7 +775,7 @@
           }
 
-          (*_bucket)[target] = 0;
-
-          (*_source_set)[target] = true;
+          _bucket->set(target, 0);
+
+          _source_set->set(target, true);
           for (InArcIt a(_graph, target); a != INVALID; ++a) {
             Value rem = (*_capacity)[a] - (*_flow)[a];
@@ -794,6 +785,6 @@
               activate(v);
             }
-            (*_excess)[v] += rem;
-            (*_flow)[a] = (*_capacity)[a];
+            _excess->set(v, (*_excess)[v] + rem);
+            _flow->set(a, (*_capacity)[a]);
           }
 
@@ -805,6 +796,6 @@
               activate(v);
             }
-            (*_excess)[v] += rem;
-            (*_flow)[a] = 0;
+            _excess->set(v, (*_excess)[v] + rem);
+            _flow->set(a, 0);
           }
 
@@ -825,30 +816,29 @@
   public:
 
-    /// \name Execution Control
+    /// \name Execution control
     /// The simplest way to execute the algorithm is to use
-    /// one of the member functions called \ref run().
+    /// one of the member functions called \c run(...).
     /// \n
-    /// If you need better control on the execution,
-    /// you have to call one of the \ref init() functions first, then
-    /// \ref calculateOut() and/or \ref calculateIn().
+    /// If you need more control on the execution,
+    /// first you must call \ref init(), then the \ref calculateIn() or
+    /// \ref calculateOut() functions.
 
     /// @{
 
-    /// \brief Initialize the internal data structures.
+    /// \brief Initializes the internal data structures.
     ///
-    /// This function initializes the internal data structures. It creates
-    /// the maps and some bucket structures for the algorithm.
-    /// The first node is used as the source node for the push-relabel
-    /// algorithm.
+    /// Initializes the internal data structures. It creates
+    /// the maps, residual graph adaptors and some bucket structures
+    /// for the algorithm.
     void init() {
       init(NodeIt(_graph));
     }
 
-    /// \brief Initialize the internal data structures.
+    /// \brief Initializes the internal data structures.
     ///
-    /// This function initializes the internal data structures. It creates
-    /// the maps and some bucket structures for the algorithm. 
-    /// The given node is used as the source node for the push-relabel
-    /// algorithm.
+    /// Initializes the internal data structures. It creates
+    /// the maps, residual graph adaptor and some bucket structures
+    /// for the algorithm. Node \c source  is used as the push-relabel
+    /// algorithm's source.
     void init(const Node& source) {
       _source = source;
@@ -890,24 +880,20 @@
 
 
-    /// \brief Calculate a minimum cut with \f$ source \f$ on the
+    /// \brief Calculates a minimum cut with \f$ source \f$ on the
     /// source-side.
     ///
-    /// This function calculates a minimum cut with \f$ source \f$ on the
+    /// Calculates a minimum cut with \f$ source \f$ on the
     /// source-side (i.e. a set \f$ X\subsetneq V \f$ with
-    /// \f$ source \in X \f$ and minimal outgoing capacity).
-    ///
-    /// \pre \ref init() must be called before using this function.
+    /// \f$ source \in X \f$ and minimal out-degree).
     void calculateOut() {
       findMinCutOut();
     }
 
-    /// \brief Calculate a minimum cut with \f$ source \f$ on the
-    /// sink-side.
+    /// \brief Calculates a minimum cut with \f$ source \f$ on the
+    /// target-side.
     ///
-    /// This function calculates a minimum cut with \f$ source \f$ on the
-    /// sink-side (i.e. a set \f$ X\subsetneq V \f$ with
-    /// \f$ source \notin X \f$ and minimal outgoing capacity).
-    ///
-    /// \pre \ref init() must be called before using this function.
+    /// Calculates a minimum cut with \f$ source \f$ on the
+    /// target-side (i.e. a set \f$ X\subsetneq V \f$ with
+    /// \f$ source \in X \f$ and minimal out-degree).
     void calculateIn() {
       findMinCutIn();
@@ -915,8 +901,8 @@
 
 
-    /// \brief Run the algorithm.
+    /// \brief Runs the algorithm.
     ///
-    /// This function runs the algorithm. It finds nodes \c source and
-    /// \c target arbitrarily and then calls \ref init(), \ref calculateOut()
+    /// Runs the algorithm. It finds nodes \c source and \c target
+    /// arbitrarily and then calls \ref init(), \ref calculateOut()
     /// and \ref calculateIn().
     void run() {
@@ -926,9 +912,9 @@
     }
 
-    /// \brief Run the algorithm.
+    /// \brief Runs the algorithm.
     ///
-    /// This function runs the algorithm. It uses the given \c source node, 
-    /// finds a proper \c target node and then calls the \ref init(),
-    /// \ref calculateOut() and \ref calculateIn().
+    /// Runs the algorithm. It uses the given \c source node, finds a
+    /// proper \c target and then calls the \ref init(), \ref
+    /// calculateOut() and \ref calculateIn().
     void run(const Node& s) {
       init(s);
@@ -941,16 +927,14 @@
     /// \name Query Functions
     /// The result of the %HaoOrlin algorithm
-    /// can be obtained using these functions.\n
-    /// \ref run(), \ref calculateOut() or \ref calculateIn() 
-    /// should be called before using them.
+    /// can be obtained using these functions.
+    /// \n
+    /// Before using these functions, either \ref run(), \ref
+    /// calculateOut() or \ref calculateIn() must be called.
 
     /// @{
 
-    /// \brief Return the value of the minimum cut.
+    /// \brief Returns the value of the minimum value cut.
     ///
-    /// This function returns the value of the minimum cut.
-    ///
-    /// \pre \ref run(), \ref calculateOut() or \ref calculateIn() 
-    /// must be called before using this function.
+    /// Returns the value of the minimum value cut.
     Value minCutValue() const {
       return _min_cut;
@@ -958,22 +942,15 @@
 
 
-    /// \brief Return a minimum cut.
+    /// \brief Returns a minimum cut.
     ///
-    /// This function sets \c cutMap to the characteristic vector of a
-    /// minimum value cut: it will give a non-empty set \f$ X\subsetneq V \f$
-    /// with minimal outgoing capacity (i.e. \c cutMap will be \c true exactly
-    /// for the nodes of \f$ X \f$).
-    ///
-    /// \param cutMap A \ref concepts::WriteMap "writable" node map with
-    /// \c bool (or convertible) value type.
-    ///
-    /// \return The value of the minimum cut.
-    ///
-    /// \pre \ref run(), \ref calculateOut() or \ref calculateIn() 
-    /// must be called before using this function.
-    template <typename CutMap>
-    Value minCutMap(CutMap& cutMap) const {
+    /// Sets \c nodeMap to the characteristic vector of a minimum
+    /// value cut: it will give a nonempty set \f$ X\subsetneq V \f$
+    /// with minimal out-degree (i.e. \c nodeMap will be true exactly
+    /// for the nodes of \f$ X \f$).  \pre nodeMap should be a
+    /// bool-valued node-map.
+    template <typename NodeMap>
+    Value minCutMap(NodeMap& nodeMap) const {
       for (NodeIt it(_graph); it != INVALID; ++it) {
-        cutMap.set(it, (*_min_cut_map)[it]);
+        nodeMap.set(it, (*_min_cut_map)[it]);
       }
       return _min_cut;
@@ -984,4 +961,5 @@
   }; //class HaoOrlin
 
+
 } //namespace lemon
 
Index: lemon/hypercube_graph.h
===================================================================
--- lemon/hypercube_graph.h	(revision 582)
+++ lemon/hypercube_graph.h	(revision 440)
@@ -292,6 +292,8 @@
   /// (assuming that the size of \c int is 32 bit).
   ///
-  /// This graph type fully conforms to the \ref concepts::Graph
-  /// "Graph concept".
+  /// This graph type is fully conform to the \ref concepts::Graph
+  /// "Graph" concept, and it also has an important extra feature
+  /// that its maps are real \ref concepts::ReferenceMap
+  /// "reference map"s.
   class HypercubeGraph : public ExtendedHypercubeGraphBase {
   public:
Index: lemon/kruskal.h
===================================================================
--- lemon/kruskal.h	(revision 584)
+++ lemon/kruskal.h	(revision 440)
@@ -249,9 +249,9 @@
   /// \ingroup spantree
   ///
-  /// \brief Kruskal's algorithm for finding a minimum cost spanning tree of
+  /// \brief Kruskal algorithm to find a minimum cost spanning tree of
   /// a graph.
   ///
   /// This function runs Kruskal's algorithm to find a minimum cost
-  /// spanning tree of a graph.
+  /// spanning tree.
   /// Due to some C++ hacking, it accepts various input and output types.
   ///
@@ -265,7 +265,7 @@
   /// It can be one of the following choices.
   /// - An STL compatible 'Forward Container' with
-  /// <tt>std::pair<GR::Arc,C></tt> or
-  /// <tt>std::pair<GR::Edge,C></tt> as its <tt>value_type</tt>, where
-  /// \c C is the type of the costs. The pairs indicates the arcs/edges
+  /// <tt>std::pair<GR::Arc,X></tt> or
+  /// <tt>std::pair<GR::Edge,X></tt> as its <tt>value_type</tt>, where
+  /// \c X is the type of the costs. The pairs indicates the arcs/edges
   /// along with the assigned cost. <em>They must be in a
   /// cost-ascending order.</em>
@@ -274,6 +274,6 @@
   ///
   /// \retval out Here we also have a choice.
-  /// - It can be a writable arc/edge map with \c bool value type. After
-  /// running the algorithm it will contain the found minimum cost spanning
+  /// - It can be a writable \c bool arc/edge map. After running the
+  /// algorithm it will contain the found minimum cost spanning
   /// tree: the value of an arc/edge will be set to \c true if it belongs
   /// to the tree, otherwise it will be set to \c false. The value of
@@ -302,6 +302,6 @@
 
 #ifdef DOXYGEN
-  template <typename Graph, typename In, typename Out>
-  Value kruskal(const Graph& g, const In& in, Out& out)
+  template <class Graph, class In, class Out>
+  Value kruskal(GR const& g, const In& in, Out& out)
 #else
   template <class Graph, class In, class Out>
@@ -315,4 +315,6 @@
 
 
+
+
   template <class Graph, class In, class Out>
   inline typename _kruskal_bits::KruskalValueSelector<In>::Value
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 599)
+++ lemon/lgf_reader.h	(revision 517)
@@ -102,21 +102,21 @@
     };
 
-    template <typename _GR, bool _dir, typename _Map,
+    template <typename _Graph, bool _dir, typename _Map,
               typename _Converter = DefaultConverter<typename _Map::Value> >
-    class GraphArcMapStorage : public MapStorageBase<typename _GR::Edge> {
+    class GraphArcMapStorage : public MapStorageBase<typename _Graph::Edge> {
     public:
       typedef _Map Map;
       typedef _Converter Converter;
-      typedef _GR GR;
-      typedef typename GR::Edge Item;
+      typedef _Graph Graph;
+      typedef typename Graph::Edge Item;
       static const bool dir = _dir;
 
     private:
-      const GR& _graph;
+      const Graph& _graph;
       Map& _map;
       Converter _converter;
 
     public:
-      GraphArcMapStorage(const GR& graph, Map& map,
+      GraphArcMapStorage(const Graph& graph, Map& map,
                          const Converter& converter = Converter())
         : _graph(graph), _map(map), _converter(converter) {}
@@ -174,19 +174,19 @@
     };
 
-    template <typename GR>
+    template <typename Graph>
     struct GraphArcLookUpConverter {
-      const GR& _graph;
-      const std::map<std::string, typename GR::Edge>& _map;
-
-      GraphArcLookUpConverter(const GR& graph,
+      const Graph& _graph;
+      const std::map<std::string, typename Graph::Edge>& _map;
+
+      GraphArcLookUpConverter(const Graph& graph,
                               const std::map<std::string,
-                                             typename GR::Edge>& map)
+                                             typename Graph::Edge>& map)
         : _graph(graph), _map(map) {}
 
-      typename GR::Arc operator()(const std::string& str) {
+      typename Graph::Arc operator()(const std::string& str) {
         if (str.empty() || (str[0] != '+' && str[0] != '-')) {
           throw FormatError("Item must start with '+' or '-'");
         }
-        typename std::map<std::string, typename GR::Edge>
+        typename std::map<std::string, typename Graph::Edge>
           ::const_iterator it = _map.find(str.substr(1));
         if (it == _map.end()) {
@@ -388,13 +388,14 @@
   }
 
-  template <typename DGR>
+  template <typename Digraph>
   class DigraphReader;
 
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is = std::cin);
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, const std::string& fn);
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, const char *fn);
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, 
+                                       std::istream& is = std::cin);
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const std::string& fn);
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char *fn);
 
   /// \ingroup lemon_io
@@ -419,5 +420,5 @@
   ///
   ///\code
-  /// DigraphReader<DGR>(digraph, std::cin).
+  /// DigraphReader<Digraph>(digraph, std::cin).
   ///   nodeMap("coordinates", coord_map).
   ///   arcMap("capacity", cap_map).
@@ -448,13 +449,13 @@
   /// a single pass, because the arcs are not constructed when the node
   /// maps are read.
-  template <typename DGR>
+  template <typename _Digraph>
   class DigraphReader {
   public:
 
-    typedef DGR Digraph;
+    typedef _Digraph Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
 
   private:
 
-    TEMPLATE_DIGRAPH_TYPEDEFS(DGR);
 
     std::istream* _is;
@@ -462,5 +463,5 @@
     std::string _filename;
 
-    DGR& _digraph;
+    Digraph& _digraph;
 
     std::string _nodes_caption;
@@ -500,5 +501,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// input stream.
-    DigraphReader(DGR& digraph, std::istream& is = std::cin)
+    DigraphReader(Digraph& digraph, std::istream& is = std::cin)
       : _is(&is), local_is(false), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
@@ -509,5 +510,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(DGR& digraph, const std::string& fn)
+    DigraphReader(Digraph& digraph, const std::string& fn)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -524,5 +525,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(DGR& digraph, const char* fn)
+    DigraphReader(Digraph& digraph, const char* fn)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _digraph(digraph),
@@ -560,11 +561,11 @@
   private:
 
-    template <typename TDGR>
-    friend DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is);
-    template <typename TDGR>
-    friend DigraphReader<TDGR> digraphReader(TDGR& digraph, 
-                                             const std::string& fn);
-    template <typename TDGR>
-    friend DigraphReader<TDGR> digraphReader(TDGR& digraph, const char *fn);
+    template <typename DGR>
+    friend DigraphReader<DGR> digraphReader(DGR& digraph, std::istream& is);
+    template <typename DGR>
+    friend DigraphReader<DGR> digraphReader(DGR& digraph, 
+                                            const std::string& fn);
+    template <typename DGR>
+    friend DigraphReader<DGR> digraphReader(DGR& digraph, const char *fn);
 
     DigraphReader(DigraphReader& other)
@@ -593,5 +594,5 @@
   public:
 
-    /// \name Reading Rules
+    /// \name Reading rules
     /// @{
 
@@ -698,5 +699,5 @@
     /// @}
 
-    /// \name Select Section by Name
+    /// \name Select section by name
     /// @{
 
@@ -727,5 +728,5 @@
     /// @}
 
-    /// \name Using Previously Constructed Node or Arc Set
+    /// \name Using previously constructed node or arc set
     /// @{
 
@@ -1116,5 +1117,5 @@
   public:
 
-    /// \name Execution of the Reader
+    /// \name Execution of the reader
     /// @{
 
@@ -1188,41 +1189,4 @@
 
   };
-  
-  /// \ingroup lemon_io
-  ///
-  /// \brief Return a \ref DigraphReader class
-  ///
-  /// This function just returns a \ref DigraphReader class.
-  ///
-  /// With this function a digraph can be read from an 
-  /// \ref lgf-format "LGF" file or input stream with several maps and
-  /// attributes. For example, there is network flow problem on a
-  /// digraph, i.e. a digraph with a \e capacity map on the arcs and
-  /// \e source and \e target nodes. This digraph can be read with the
-  /// following code:
-  ///
-  ///\code
-  ///ListDigraph digraph;
-  ///ListDigraph::ArcMap<int> cm(digraph);
-  ///ListDigraph::Node src, trg;
-  ///digraphReader(digraph, std::cin).
-  ///  arcMap("capacity", cap).
-  ///  node("source", src).
-  ///  node("target", trg).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the \ref DigraphReader
-  /// class documentation.
-  /// \warning Don't forget to put the \ref DigraphReader::run() "run()"
-  /// to the end of the parameter list.
-  /// \relates DigraphReader
-  /// \sa digraphReader(TDGR& digraph, const std::string& fn)
-  /// \sa digraphReader(TDGR& digraph, const char* fn)
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is) {
-    DigraphReader<TDGR> tmp(digraph, is);
-    return tmp;
-  }
 
   /// \brief Return a \ref DigraphReader class
@@ -1230,8 +1194,7 @@
   /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
-  /// \sa digraphReader(TDGR& digraph, std::istream& is)
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, const std::string& fn) {
-    DigraphReader<TDGR> tmp(digraph, fn);
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, std::istream& is) {
+    DigraphReader<Digraph> tmp(digraph, is);
     return tmp;
   }
@@ -1241,20 +1204,31 @@
   /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
-  /// \sa digraphReader(TDGR& digraph, std::istream& is)
-  template <typename TDGR>
-  DigraphReader<TDGR> digraphReader(TDGR& digraph, const char* fn) {
-    DigraphReader<TDGR> tmp(digraph, fn);
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph,
+                                       const std::string& fn) {
+    DigraphReader<Digraph> tmp(digraph, fn);
     return tmp;
   }
 
-  template <typename GR>
+  /// \brief Return a \ref DigraphReader class
+  ///
+  /// This function just returns a \ref DigraphReader class.
+  /// \relates DigraphReader
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
+    DigraphReader<Digraph> tmp(digraph, fn);
+    return tmp;
+  }
+
+  template <typename Graph>
   class GraphReader;
  
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin);
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, const std::string& fn);
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, const char *fn);
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, 
+                                 std::istream& is = std::cin);
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn);
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, const char *fn);
 
   /// \ingroup lemon_io
@@ -1273,13 +1247,12 @@
   /// arc map.  Similarly, an attribute can be read into an arc, if
   /// it's value is an edge label prefixed with \c '+' or \c '-'.
-  template <typename GR>
+  template <typename _Graph>
   class GraphReader {
   public:
 
-    typedef GR Graph;
+    typedef _Graph Graph;
+    TEMPLATE_GRAPH_TYPEDEFS(Graph);
 
   private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(GR);
 
     std::istream* _is;
@@ -1287,5 +1260,5 @@
     std::string _filename;
 
-    GR& _graph;
+    Graph& _graph;
 
     std::string _nodes_caption;
@@ -1325,5 +1298,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// input stream.
-    GraphReader(GR& graph, std::istream& is = std::cin)
+    GraphReader(Graph& graph, std::istream& is = std::cin)
       : _is(&is), local_is(false), _graph(graph),
         _use_nodes(false), _use_edges(false),
@@ -1334,5 +1307,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(GR& graph, const std::string& fn)
+    GraphReader(Graph& graph, const std::string& fn)
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn), _graph(graph),
@@ -1349,5 +1322,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(GR& graph, const char* fn)
+    GraphReader(Graph& graph, const char* fn)
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn), _graph(graph),
@@ -1384,10 +1357,10 @@
 
   private:
-    template <typename TGR>
-    friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is);
-    template <typename TGR>
-    friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 
-    template <typename TGR>
-    friend GraphReader<TGR> graphReader(TGR& graph, const char *fn);
+    template <typename GR>
+    friend GraphReader<GR> graphReader(GR& graph, std::istream& is);
+    template <typename GR>
+    friend GraphReader<GR> graphReader(GR& graph, const std::string& fn); 
+    template <typename GR>
+    friend GraphReader<GR> graphReader(GR& graph, const char *fn);
 
     GraphReader(GraphReader& other)
@@ -1416,5 +1389,5 @@
   public:
 
-    /// \name Reading Rules
+    /// \name Reading rules
     /// @{
 
@@ -1481,5 +1454,5 @@
       _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
       _reader_bits::MapStorageBase<Edge>* backward_storage =
-        new _reader_bits::GraphArcMapStorage<GR, false, Map>(_graph, map);
+        new _reader_bits::GraphArcMapStorage<Graph, false, Map>(_graph, map);
       _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
       return *this;
@@ -1495,9 +1468,9 @@
       checkConcept<concepts::WriteMap<Arc, typename Map::Value>, Map>();
       _reader_bits::MapStorageBase<Edge>* forward_storage =
-        new _reader_bits::GraphArcMapStorage<GR, true, Map, Converter>
+        new _reader_bits::GraphArcMapStorage<Graph, true, Map, Converter>
         (_graph, map, converter);
       _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
       _reader_bits::MapStorageBase<Edge>* backward_storage =
-        new _reader_bits::GraphArcMapStorage<GR, false, Map, Converter>
+        new _reader_bits::GraphArcMapStorage<Graph, false, Map, Converter>
         (_graph, map, converter);
       _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
@@ -1557,5 +1530,5 @@
     /// Add an arc reading rule to reader.
     GraphReader& arc(const std::string& caption, Arc& arc) {
-      typedef _reader_bits::GraphArcLookUpConverter<GR> Converter;
+      typedef _reader_bits::GraphArcLookUpConverter<Graph> Converter;
       Converter converter(_graph, _edge_index);
       _reader_bits::ValueStorageBase* storage =
@@ -1567,5 +1540,5 @@
     /// @}
 
-    /// \name Select Section by Name
+    /// \name Select section by name
     /// @{
 
@@ -1596,5 +1569,5 @@
     /// @}
 
-    /// \name Using Previously Constructed Node or Edge Set
+    /// \name Using previously constructed node or edge set
     /// @{
 
@@ -1986,5 +1959,5 @@
   public:
 
-    /// \name Execution of the Reader
+    /// \name Execution of the reader
     /// @{
 
@@ -2060,45 +2033,11 @@
   };
 
-  /// \ingroup lemon_io
-  ///
-  /// \brief Return a \ref GraphReader class
-  ///
-  /// This function just returns a \ref GraphReader class. 
-  ///
-  /// With this function a graph can be read from an 
-  /// \ref lgf-format "LGF" file or input stream with several maps and
-  /// attributes. For example, there is weighted matching problem on a
-  /// graph, i.e. a graph with a \e weight map on the edges. This
-  /// graph can be read with the following code:
-  ///
-  ///\code
-  ///ListGraph graph;
-  ///ListGraph::EdgeMap<int> weight(graph);
-  ///graphReader(graph, std::cin).
-  ///  edgeMap("weight", weight).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the \ref GraphReader
-  /// class documentation.
-  /// \warning Don't forget to put the \ref GraphReader::run() "run()"
-  /// to the end of the parameter list.
-  /// \relates GraphReader
-  /// \sa graphReader(TGR& graph, const std::string& fn)
-  /// \sa graphReader(TGR& graph, const char* fn)
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, std::istream& is) {
-    GraphReader<TGR> tmp(graph, is);
-    return tmp;
-  }
-
   /// \brief Return a \ref GraphReader class
   ///
   /// This function just returns a \ref GraphReader class.
   /// \relates GraphReader
-  /// \sa graphReader(TGR& graph, std::istream& is)
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, const std::string& fn) {
-    GraphReader<TGR> tmp(graph, fn);
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, std::istream& is) {
+    GraphReader<Graph> tmp(graph, is);
     return tmp;
   }
@@ -2108,8 +2047,17 @@
   /// This function just returns a \ref GraphReader class.
   /// \relates GraphReader
-  /// \sa graphReader(TGR& graph, std::istream& is)
-  template <typename TGR>
-  GraphReader<TGR> graphReader(TGR& graph, const char* fn) {
-    GraphReader<TGR> tmp(graph, fn);
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) {
+    GraphReader<Graph> tmp(graph, fn);
+    return tmp;
+  }
+
+  /// \brief Return a \ref GraphReader class
+  ///
+  /// This function just returns a \ref GraphReader class.
+  /// \relates GraphReader
+  template <typename Graph>
+  GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
+    GraphReader<Graph> tmp(graph, fn);
     return tmp;
   }
@@ -2210,5 +2158,5 @@
   public:
 
-    /// \name Section Readers
+    /// \name Section readers
     /// @{
 
@@ -2309,5 +2257,5 @@
 
 
-    /// \name Execution of the Reader
+    /// \name Execution of the reader
     /// @{
 
@@ -2368,16 +2316,8 @@
   };
 
-  /// \ingroup lemon_io
-  ///
   /// \brief Return a \ref SectionReader class
   ///
   /// This function just returns a \ref SectionReader class.
-  ///
-  /// Please see SectionReader documentation about the custom section
-  /// input.
-  ///
   /// \relates SectionReader
-  /// \sa sectionReader(const std::string& fn)
-  /// \sa sectionReader(const char *fn)
   inline SectionReader sectionReader(std::istream& is) {
     SectionReader tmp(is);
@@ -2389,5 +2329,4 @@
   /// This function just returns a \ref SectionReader class.
   /// \relates SectionReader
-  /// \sa sectionReader(std::istream& is)
   inline SectionReader sectionReader(const std::string& fn) {
     SectionReader tmp(fn);
@@ -2399,5 +2338,4 @@
   /// This function just returns a \ref SectionReader class.
   /// \relates SectionReader
-  /// \sa sectionReader(std::istream& is)
   inline SectionReader sectionReader(const char* fn) {
     SectionReader tmp(fn);
@@ -2501,5 +2439,5 @@
 
 
-    /// \name Node Sections
+    /// \name Node sections
     /// @{
 
@@ -2527,5 +2465,5 @@
     /// @}
 
-    /// \name Arc/Edge Sections
+    /// \name Arc/Edge sections
     /// @{
 
@@ -2585,5 +2523,5 @@
     /// @}
 
-    /// \name Attribute Sections
+    /// \name Attribute sections
     /// @{
 
@@ -2611,5 +2549,5 @@
     /// @}
 
-    /// \name Extra Sections
+    /// \name Extra sections
     /// @{
 
@@ -2687,5 +2625,5 @@
   public:
 
-    /// \name Execution of the Contents Reader
+    /// \name Execution of the contents reader
     /// @{
 
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 599)
+++ lemon/lgf_writer.h	(revision 517)
@@ -348,15 +348,17 @@
   }
 
-  template <typename DGR>
+  template <typename Digraph>
   class DigraphWriter;
 
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, 
-                                   std::ostream& os = std::cout);
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, const std::string& fn);
-
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, const char* fn);
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       std::ostream& os = std::cout);
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       const std::string& fn);
+
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       const char* fn);
 
 
@@ -380,5 +382,5 @@
   ///
   ///\code
-  /// DigraphWriter<DGR>(digraph, std::cout).
+  /// DigraphWriter<Digraph>(digraph, std::cout).
   ///   nodeMap("coordinates", coord_map).
   ///   nodeMap("size", size).
@@ -405,10 +407,10 @@
   /// the \c ostream() function, hence the second pass can append its
   /// output to the output of the first pass.
-  template <typename DGR>
+  template <typename _Digraph>
   class DigraphWriter {
   public:
 
-    typedef DGR Digraph;
-    TEMPLATE_DIGRAPH_TYPEDEFS(DGR);
+    typedef _Digraph Digraph;
+    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
 
   private:
@@ -418,5 +420,5 @@
     bool local_os;
 
-    const DGR& _digraph;
+    const Digraph& _digraph;
 
     std::string _nodes_caption;
@@ -450,5 +452,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    DigraphWriter(const DGR& digraph, std::ostream& os = std::cout)
+    DigraphWriter(const Digraph& digraph, std::ostream& os = std::cout)
       : _os(&os), local_os(false), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {}
@@ -458,5 +460,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const DGR& digraph, const std::string& fn)
+    DigraphWriter(const Digraph& digraph, const std::string& fn)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {
@@ -471,5 +473,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const DGR& digraph, const char* fn)
+    DigraphWriter(const Digraph& digraph, const char* fn)
       : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {
@@ -504,13 +506,13 @@
   private:
 
-    template <typename TDGR>
-    friend DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, 
-                                             std::ostream& os);
-    template <typename TDGR>
-    friend DigraphWriter<TDGR> digraphWriter(const TDGR& digraph,
-                                             const std::string& fn);
-    template <typename TDGR>
-    friend DigraphWriter<TDGR> digraphWriter(const TDGR& digraph,
-                                             const char *fn);
+    template <typename DGR>
+    friend DigraphWriter<DGR> digraphWriter(const DGR& digraph, 
+                                            std::ostream& os);
+    template <typename DGR>
+    friend DigraphWriter<DGR> digraphWriter(const DGR& digraph,
+                                            const std::string& fn);
+    template <typename DGR>
+    friend DigraphWriter<DGR> digraphWriter(const DGR& digraph,
+                                            const char *fn);
 
     DigraphWriter(DigraphWriter& other)
@@ -537,5 +539,5 @@
   public:
 
-    /// \name Writing Rules
+    /// \name Writing rules
     /// @{
 
@@ -640,5 +642,5 @@
     }
 
-    /// \name Section Captions
+    /// \name Section captions
     /// @{
 
@@ -667,5 +669,5 @@
     }
 
-    /// \name Skipping Section
+    /// \name Skipping section
     /// @{
 
@@ -723,6 +725,6 @@
 
       if (label == 0) {
-        IdMap<DGR, Node> id_map(_digraph);
-        _writer_bits::MapLess<IdMap<DGR, Node> > id_less(id_map);
+        IdMap<Digraph, Node> id_map(_digraph);
+        _writer_bits::MapLess<IdMap<Digraph, Node> > id_less(id_map);
         std::sort(nodes.begin(), nodes.end(), id_less);
       } else {
@@ -808,6 +810,6 @@
 
       if (label == 0) {
-        IdMap<DGR, Arc> id_map(_digraph);
-        _writer_bits::MapLess<IdMap<DGR, Arc> > id_less(id_map);
+        IdMap<Digraph, Arc> id_map(_digraph);
+        _writer_bits::MapLess<IdMap<Digraph, Arc> > id_less(id_map);
         std::sort(arcs.begin(), arcs.end(), id_less);
       } else {
@@ -884,5 +886,5 @@
   public:
 
-    /// \name Execution of the Writer
+    /// \name Execution of the writer
     /// @{
 
@@ -914,39 +916,12 @@
   };
 
-  /// \ingroup lemon_io
-  ///
   /// \brief Return a \ref DigraphWriter class
   ///
-  /// This function just returns a \ref DigraphWriter class. 
-  ///
-  /// With this function a digraph can be write to a file or output
-  /// stream in \ref lgf-format "LGF" format with several maps and
-  /// attributes. For example, with the following code a network flow
-  /// problem can be written to the standard output, i.e. a digraph
-  /// with a \e capacity map on the arcs and \e source and \e target
-  /// nodes:
-  ///
-  ///\code
-  ///ListDigraph digraph;
-  ///ListDigraph::ArcMap<int> cap(digraph);
-  ///ListDigraph::Node src, trg;
-  ///  // Setting the capacity map and source and target nodes
-  ///digraphWriter(digraph, std::cout).
-  ///  arcMap("capacity", cap).
-  ///  node("source", src).
-  ///  node("target", trg).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the \ref DigraphWriter
-  /// class documentation.
-  /// \warning Don't forget to put the \ref DigraphWriter::run() "run()"
-  /// to the end of the parameter list.
+  /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
-  /// \sa digraphWriter(const TDGR& digraph, const std::string& fn)
-  /// \sa digraphWriter(const TDGR& digraph, const char* fn)
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, std::ostream& os) {
-    DigraphWriter<TDGR> tmp(digraph, os);
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       std::ostream& os) {
+    DigraphWriter<Digraph> tmp(digraph, os);
     return tmp;
   }
@@ -956,9 +931,8 @@
   /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
-  /// \sa digraphWriter(const TDGR& digraph, std::ostream& os)
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, 
-                                    const std::string& fn) {
-    DigraphWriter<TDGR> tmp(digraph, fn);
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       const std::string& fn) {
+    DigraphWriter<Digraph> tmp(digraph, fn);
     return tmp;
   }
@@ -968,20 +942,21 @@
   /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
-  /// \sa digraphWriter(const TDGR& digraph, std::ostream& os)
-  template <typename TDGR>
-  DigraphWriter<TDGR> digraphWriter(const TDGR& digraph, const char* fn) {
-    DigraphWriter<TDGR> tmp(digraph, fn);
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
+                                       const char* fn) {
+    DigraphWriter<Digraph> tmp(digraph, fn);
     return tmp;
   }
 
-  template <typename GR>
+  template <typename Graph>
   class GraphWriter;
 
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, std::ostream& os = std::cout);
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, const std::string& fn);
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, const char* fn);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph,
+                                 std::ostream& os = std::cout);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn);
 
   /// \ingroup lemon_io
@@ -1000,10 +975,10 @@
   /// section as a \c '+' or a \c '-' prefix (depends on the direction
   /// of the arc) and the label of corresponding edge.
-  template <typename GR>
+  template <typename _Graph>
   class GraphWriter {
   public:
 
-    typedef GR Graph;
-    TEMPLATE_GRAPH_TYPEDEFS(GR);
+    typedef _Graph Graph;
+    TEMPLATE_GRAPH_TYPEDEFS(Graph);
 
   private:
@@ -1013,5 +988,5 @@
     bool local_os;
 
-    const GR& _graph;
+    const Graph& _graph;
 
     std::string _nodes_caption;
@@ -1045,5 +1020,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    GraphWriter(const GR& graph, std::ostream& os = std::cout)
+    GraphWriter(const Graph& graph, std::ostream& os = std::cout)
       : _os(&os), local_os(false), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {}
@@ -1053,5 +1028,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const GR& graph, const std::string& fn)
+    GraphWriter(const Graph& graph, const std::string& fn)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {
@@ -1066,5 +1041,5 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const GR& graph, const char* fn)
+    GraphWriter(const Graph& graph, const char* fn)
       : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {
@@ -1099,11 +1074,13 @@
   private:
 
-    template <typename TGR>
-    friend GraphWriter<TGR> graphWriter(const TGR& graph, std::ostream& os);
-    template <typename TGR>
-    friend GraphWriter<TGR> graphWriter(const TGR& graph, 
-                                        const std::string& fn);
-    template <typename TGR>
-    friend GraphWriter<TGR> graphWriter(const TGR& graph, const char *fn);
+    template <typename GR>
+    friend GraphWriter<GR> graphWriter(const GR& graph,
+                                       std::ostream& os);
+    template <typename GR>
+    friend GraphWriter<GR> graphWriter(const GR& graph,
+                                       const std::string& fn);
+    template <typename GR>
+    friend GraphWriter<GR> graphWriter(const GR& graph,
+                                       const char *fn);
     
     GraphWriter(GraphWriter& other)
@@ -1130,5 +1107,5 @@
   public:
 
-    /// \name Writing Rules
+    /// \name Writing rules
     /// @{
 
@@ -1192,8 +1169,8 @@
       checkConcept<concepts::ReadMap<Arc, typename Map::Value>, Map>();
       _writer_bits::MapStorageBase<Edge>* forward_storage =
-        new _writer_bits::GraphArcMapStorage<GR, true, Map>(_graph, map);
+        new _writer_bits::GraphArcMapStorage<Graph, true, Map>(_graph, map);
       _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
       _writer_bits::MapStorageBase<Edge>* backward_storage =
-        new _writer_bits::GraphArcMapStorage<GR, false, Map>(_graph, map);
+        new _writer_bits::GraphArcMapStorage<Graph, false, Map>(_graph, map);
       _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
       return *this;
@@ -1209,9 +1186,9 @@
       checkConcept<concepts::ReadMap<Arc, typename Map::Value>, Map>();
       _writer_bits::MapStorageBase<Edge>* forward_storage =
-        new _writer_bits::GraphArcMapStorage<GR, true, Map, Converter>
+        new _writer_bits::GraphArcMapStorage<Graph, true, Map, Converter>
         (_graph, map, converter);
       _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
       _writer_bits::MapStorageBase<Edge>* backward_storage =
-        new _writer_bits::GraphArcMapStorage<GR, false, Map, Converter>
+        new _writer_bits::GraphArcMapStorage<Graph, false, Map, Converter>
         (_graph, map, converter);
       _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
@@ -1271,5 +1248,5 @@
     /// Add an arc writing rule to writer.
     GraphWriter& arc(const std::string& caption, const Arc& arc) {
-      typedef _writer_bits::GraphArcLookUpConverter<GR> Converter;
+      typedef _writer_bits::GraphArcLookUpConverter<Graph> Converter;
       Converter converter(_graph, _edge_index);
       _writer_bits::ValueStorageBase* storage =
@@ -1279,5 +1256,5 @@
     }
 
-    /// \name Section Captions
+    /// \name Section captions
     /// @{
 
@@ -1306,5 +1283,5 @@
     }
 
-    /// \name Skipping Section
+    /// \name Skipping section
     /// @{
 
@@ -1362,6 +1339,6 @@
 
       if (label == 0) {
-        IdMap<GR, Node> id_map(_graph);
-        _writer_bits::MapLess<IdMap<GR, Node> > id_less(id_map);
+        IdMap<Graph, Node> id_map(_graph);
+        _writer_bits::MapLess<IdMap<Graph, Node> > id_less(id_map);
         std::sort(nodes.begin(), nodes.end(), id_less);
       } else {
@@ -1447,6 +1424,6 @@
 
       if (label == 0) {
-        IdMap<GR, Edge> id_map(_graph);
-        _writer_bits::MapLess<IdMap<GR, Edge> > id_less(id_map);
+        IdMap<Graph, Edge> id_map(_graph);
+        _writer_bits::MapLess<IdMap<Graph, Edge> > id_less(id_map);
         std::sort(edges.begin(), edges.end(), id_less);
       } else {
@@ -1523,5 +1500,5 @@
   public:
 
-    /// \name Execution of the Writer
+    /// \name Execution of the writer
     /// @{
 
@@ -1553,35 +1530,12 @@
   };
 
-  /// \ingroup lemon_io
-  ///
   /// \brief Return a \ref GraphWriter class
   ///
-  /// This function just returns a \ref GraphWriter class. 
-  ///
-  /// With this function a graph can be write to a file or output
-  /// stream in \ref lgf-format "LGF" format with several maps and
-  /// attributes. For example, with the following code a weighted
-  /// matching problem can be written to the standard output, i.e. a
-  /// graph with a \e weight map on the edges:
-  ///
-  ///\code
-  ///ListGraph graph;
-  ///ListGraph::EdgeMap<int> weight(graph);
-  ///  // Setting the weight map
-  ///graphWriter(graph, std::cout).
-  ///  edgeMap("weight", weight).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the \ref GraphWriter
-  /// class documentation.
-  /// \warning Don't forget to put the \ref GraphWriter::run() "run()"
-  /// to the end of the parameter list.
+  /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
-  /// \sa graphWriter(const TGR& graph, const std::string& fn)
-  /// \sa graphWriter(const TGR& graph, const char* fn)
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, std::ostream& os) {
-    GraphWriter<TGR> tmp(graph, os);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph,
+                                 std::ostream& os) {
+    GraphWriter<Graph> tmp(graph, os);
     return tmp;
   }
@@ -1591,8 +1545,7 @@
   /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
-  /// \sa graphWriter(const TGR& graph, std::ostream& os)
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, const std::string& fn) {
-    GraphWriter<TGR> tmp(graph, fn);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
+    GraphWriter<Graph> tmp(graph, fn);
     return tmp;
   }
@@ -1602,8 +1555,7 @@
   /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
-  /// \sa graphWriter(const TGR& graph, std::ostream& os)
-  template <typename TGR>
-  GraphWriter<TGR> graphWriter(const TGR& graph, const char* fn) {
-    GraphWriter<TGR> tmp(graph, fn);
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
+    GraphWriter<Graph> tmp(graph, fn);
     return tmp;
   }
@@ -1700,5 +1652,5 @@
   public:
 
-    /// \name Section Writers
+    /// \name Section writers
     /// @{
 
@@ -1767,5 +1719,5 @@
 
 
-    /// \name Execution of the Writer
+    /// \name Execution of the writer
     /// @{
 
@@ -1795,16 +1747,8 @@
   };
 
-  /// \ingroup lemon_io
-  ///
   /// \brief Return a \ref SectionWriter class
   ///
   /// This function just returns a \ref SectionWriter class.
-  ///
-  /// Please see SectionWriter documentation about the custom section
-  /// output.
-  ///
   /// \relates SectionWriter
-  /// \sa sectionWriter(const std::string& fn)
-  /// \sa sectionWriter(const char *fn)
   inline SectionWriter sectionWriter(std::ostream& os) {
     SectionWriter tmp(os);
@@ -1816,5 +1760,4 @@
   /// This function just returns a \ref SectionWriter class.
   /// \relates SectionWriter
-  /// \sa sectionWriter(std::ostream& os)
   inline SectionWriter sectionWriter(const std::string& fn) {
     SectionWriter tmp(fn);
@@ -1826,5 +1769,4 @@
   /// This function just returns a \ref SectionWriter class.
   /// \relates SectionWriter
-  /// \sa sectionWriter(std::ostream& os)
   inline SectionWriter sectionWriter(const char* fn) {
     SectionWriter tmp(fn);
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 582)
+++ lemon/list_graph.h	(revision 440)
@@ -321,4 +321,7 @@
   ///only in the concept class.
   ///
+  ///An important extra feature of this digraph implementation is that
+  ///its maps are real \ref concepts::ReferenceMap "reference map"s.
+  ///
   ///\sa concepts::Digraph
 
@@ -349,5 +352,5 @@
 
     ///Add a new node to the digraph.
-    ///\return The new node.
+    ///\return the new node.
     Node addNode() { return Parent::addNode(); }
 
@@ -356,5 +359,5 @@
     ///Add a new arc to the digraph with source node \c s
     ///and target node \c t.
-    ///\return The new arc.
+    ///\return the new arc.
     Arc addArc(const Node& s, const Node& t) {
       return Parent::addArc(s, t);
@@ -1174,4 +1177,7 @@
   ///only in the concept class.
   ///
+  ///An important extra feature of this graph implementation is that
+  ///its maps are real \ref concepts::ReferenceMap "reference map"s.
+  ///
   ///\sa concepts::Graph
 
@@ -1203,5 +1209,5 @@
     ///
     /// Add a new node to the graph.
-    /// \return The new node.
+    /// \return the new node.
     Node addNode() { return Parent::addNode(); }
 
@@ -1210,5 +1216,5 @@
     /// Add a new edge to the graph with source node \c s
     /// and target node \c t.
-    /// \return The new edge.
+    /// \return the new edge.
     Edge addEdge(const Node& s, const Node& t) {
       return Parent::addEdge(s, t);
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 584)
+++ lemon/lp_base.h	(revision 514)
@@ -53,10 +53,10 @@
     ///Possible outcomes of an LP solving procedure
     enum SolveExitStatus {
-      /// = 0. It means that the problem has been successfully solved: either
+      ///This means that the problem has been successfully solved: either
       ///an optimal solution has been found or infeasibility/unboundedness
       ///has been proved.
       SOLVED = 0,
-      /// = 1. Any other case (including the case when some user specified
-      ///limit has been exceeded).
+      ///Any other case (including the case when some user specified
+      ///limit has been exceeded)
       UNSOLVED = 1
     };
@@ -69,19 +69,4 @@
       MAX
     };
-
-    ///Enum for \c messageLevel() parameter
-    enum MessageLevel {
-      /// No output (default value).
-      MESSAGE_NOTHING,
-      /// Error messages only.
-      MESSAGE_ERROR,
-      /// Warnings.
-      MESSAGE_WARNING,
-      /// Normal output.
-      MESSAGE_NORMAL,
-      /// Verbose output.
-      MESSAGE_VERBOSE
-    };
-    
 
     ///The floating point type used by the solver
@@ -934,4 +919,6 @@
 
     //Abstract virtual functions
+    virtual LpBase* _newSolver() const = 0;
+    virtual LpBase* _cloneSolver() const = 0;
 
     virtual int _addColId(int col) { return cols.addIndex(col); }
@@ -989,6 +976,4 @@
     virtual const char* _solverName() const = 0;
 
-    virtual void _messageLevel(MessageLevel level) = 0;
-
     //Own protected stuff
 
@@ -1003,8 +988,13 @@
     virtual ~LpBase() {}
 
+    ///Creates a new LP problem
+    LpBase* newSolver() {return _newSolver();}
+    ///Makes a copy of the LP problem
+    LpBase* cloneSolver() {return _cloneSolver();}
+
     ///Gives back the name of the solver.
     const char* solverName() const {return _solverName();}
 
-    ///\name Build Up and Modify the LP
+    ///\name Build up and modify the LP
 
     ///@{
@@ -1545,7 +1535,4 @@
     void clear() { _clear(); }
 
-    /// Sets the message level of the solver
-    void messageLevel(MessageLevel level) { _messageLevel(level); }
-
     ///@}
 
@@ -1789,13 +1776,13 @@
     /// The problem types for primal and dual problems
     enum ProblemType {
-      /// = 0. Feasible solution hasn't been found (but may exist).
+      ///Feasible solution hasn't been found (but may exist).
       UNDEFINED = 0,
-      /// = 1. The problem has no feasible solution.
+      ///The problem has no feasible solution
       INFEASIBLE = 1,
-      /// = 2. Feasible solution found.
+      ///Feasible solution found
       FEASIBLE = 2,
-      /// = 3. Optimal solution exists and found.
+      ///Optimal solution exists and found
       OPTIMAL = 3,
-      /// = 4. The cost function is unbounded.
+      ///The cost function is unbounded
       UNBOUNDED = 4
     };
@@ -1835,9 +1822,4 @@
   public:
 
-    ///Allocate a new LP problem instance
-    virtual LpSolver* newSolver() const = 0;
-    ///Make a copy of the LP problem
-    virtual LpSolver* cloneSolver() const = 0;
-
     ///\name Solve the LP
 
@@ -1853,5 +1835,5 @@
     ///@}
 
-    ///\name Obtain the Solution
+    ///\name Obtain the solution
 
     ///@{
@@ -1954,6 +1936,11 @@
     ///@}
 
+    LpSolver* newSolver() {return _newSolver();}
+    LpSolver* cloneSolver() {return _cloneSolver();}
+
   protected:
 
+    virtual LpSolver* _newSolver() const = 0;
+    virtual LpSolver* _cloneSolver() const = 0;
   };
 
@@ -1975,21 +1962,17 @@
     /// The problem types for MIP problems
     enum ProblemType {
-      /// = 0. Feasible solution hasn't been found (but may exist).
+      ///Feasible solution hasn't been found (but may exist).
       UNDEFINED = 0,
-      /// = 1. The problem has no feasible solution.
+      ///The problem has no feasible solution
       INFEASIBLE = 1,
-      /// = 2. Feasible solution found.
+      ///Feasible solution found
       FEASIBLE = 2,
-      /// = 3. Optimal solution exists and found.
+      ///Optimal solution exists and found
       OPTIMAL = 3,
-      /// = 4. The cost function is unbounded.
-      ///The Mip or at least the relaxed problem is unbounded.
+      ///The cost function is unbounded
+      ///
+      ///The Mip or at least the relaxed problem is unbounded
       UNBOUNDED = 4
     };
-
-    ///Allocate a new MIP problem instance
-    virtual MipSolver* newSolver() const = 0;
-    ///Make a copy of the MIP problem
-    virtual MipSolver* cloneSolver() const = 0;
 
     ///\name Solve the MIP
@@ -2006,12 +1989,12 @@
     ///@}
 
-    ///\name Set Column Type
+    ///\name Setting column type
     ///@{
 
     ///Possible variable (column) types (e.g. real, integer, binary etc.)
     enum ColTypes {
-      /// = 0. Continuous variable (default).
+      ///Continuous variable (default)
       REAL = 0,
-      /// = 1. Integer variable.
+      ///Integer variable
       INTEGER = 1
     };
@@ -2034,5 +2017,5 @@
     ///@}
 
-    ///\name Obtain the Solution
+    ///\name Obtain the solution
 
     ///@{
@@ -2080,4 +2063,13 @@
     virtual Value _getSolValue() const = 0;
 
+  public:
+
+    MipSolver* newSolver() {return _newSolver();}
+    MipSolver* cloneSolver() {return _cloneSolver();}
+
+  protected:
+
+    virtual MipSolver* _newSolver() const = 0;
+    virtual MipSolver* _cloneSolver() const = 0;
   };
 
Index: lemon/lp_skeleton.cc
===================================================================
--- lemon/lp_skeleton.cc	(revision 576)
+++ lemon/lp_skeleton.cc	(revision 459)
@@ -85,6 +85,4 @@
   }
 
-  void SkeletonSolverBase::_messageLevel(MessageLevel) {}
-
   LpSkeleton::SolveExitStatus LpSkeleton::_solve() { return SOLVED; }
 
@@ -108,8 +106,8 @@
   { return BASIC; }
 
-  LpSkeleton* LpSkeleton::newSolver() const
+  LpSkeleton* LpSkeleton::_newSolver() const
   { return static_cast<LpSkeleton*>(0); }
 
-  LpSkeleton* LpSkeleton::cloneSolver() const
+  LpSkeleton* LpSkeleton::_cloneSolver() const
   { return static_cast<LpSkeleton*>(0); }
 
@@ -125,8 +123,8 @@
   { return UNDEFINED; }
 
-  MipSkeleton* MipSkeleton::newSolver() const
+  MipSkeleton* MipSkeleton::_newSolver() const
   { return static_cast<MipSkeleton*>(0); }
 
-  MipSkeleton* MipSkeleton::cloneSolver() const
+  MipSkeleton* MipSkeleton::_cloneSolver() const
   { return static_cast<MipSkeleton*>(0); }
 
Index: lemon/lp_skeleton.h
===================================================================
--- lemon/lp_skeleton.h	(revision 576)
+++ lemon/lp_skeleton.h	(revision 529)
@@ -23,14 +23,8 @@
 
 ///\file
-///\brief Skeleton file to implement LP/MIP solver interfaces
-///  
-///The classes in this file do nothing, but they can serve as skeletons when
-///implementing an interface to new solvers.
+///\brief A skeleton file to implement LP solver interfaces
 namespace lemon {
 
-  ///A skeleton class to implement LP/MIP solver base interface
-  
-  ///This class does nothing, but it can serve as a skeleton when
-  ///implementing an interface to new solvers.
+  ///A skeleton class to implement LP solver interfaces
   class SkeletonSolverBase : public virtual LpBase {
     int col_num,row_num;
@@ -141,22 +135,14 @@
     virtual void _clear();
 
-    ///\e
-    virtual void _messageLevel(MessageLevel);
   };
 
-  /// \brief Skeleton class for an LP solver interface
+  /// \brief Interface for a skeleton LP solver
   ///
-  ///This class does nothing, but it can serve as a skeleton when
-  ///implementing an interface to new solvers.
-
+  /// This class implements an interface for a skeleton LP solver.
   ///\ingroup lp_group
-  class LpSkeleton : public LpSolver, public SkeletonSolverBase {
+  class LpSkeleton : public SkeletonSolverBase, public LpSolver {
   public:
-    ///\e
-    LpSkeleton() : LpSolver(), SkeletonSolverBase() {}
-    ///\e
-    virtual LpSkeleton* newSolver() const;
-    ///\e
-    virtual LpSkeleton* cloneSolver() const;
+    LpSkeleton() : SkeletonSolverBase(), LpSolver() {}
+
   protected:
 
@@ -188,37 +174,53 @@
 
     ///\e
+    virtual LpSkeleton* _newSolver() const;
+    ///\e
+    virtual LpSkeleton* _cloneSolver() const;
+    ///\e
     virtual const char* _solverName() const;
 
   };
 
-  /// \brief Skeleton class for a MIP solver interface
+  /// \brief Interface for a skeleton MIP solver
   ///
-  ///This class does nothing, but it can serve as a skeleton when
-  ///implementing an interface to new solvers.
+  /// This class implements an interface for a skeleton MIP solver.
   ///\ingroup lp_group
-  class MipSkeleton : public MipSolver, public SkeletonSolverBase {
+  class MipSkeleton : public SkeletonSolverBase, public MipSolver {
   public:
-    ///\e
-    MipSkeleton() : MipSolver(), SkeletonSolverBase() {}
-    ///\e
-    virtual MipSkeleton* newSolver() const;
-    ///\e
-    virtual MipSkeleton* cloneSolver() const;
+    MipSkeleton() : SkeletonSolverBase(), MipSolver() {}
 
   protected:
     ///\e
+
+    ///\bug Wrong interface
+    ///
     virtual SolveExitStatus _solve();
 
     ///\e
+
+    ///\bug Wrong interface
+    ///
     virtual Value _getSol(int i) const;
 
     ///\e
+
+    ///\bug Wrong interface
+    ///
     virtual Value _getSolValue() const;
 
     ///\e
+
+    ///\bug Wrong interface
+    ///
     virtual ProblemType _getType() const;
 
     ///\e
+    virtual MipSkeleton* _newSolver() const;
+
+    ///\e
+    virtual MipSkeleton* _cloneSolver() const;
+    ///\e
     virtual const char* _solverName() const;
+
   };
 
Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 584)
+++ lemon/maps.h	(revision 440)
@@ -64,8 +64,7 @@
   class NullMap : public MapBase<K, V> {
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<K, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Gives back a default constructed element.
@@ -104,8 +103,7 @@
     V _value;
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<K, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Default constructor
@@ -171,8 +169,7 @@
   class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<K, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor.
@@ -206,8 +203,7 @@
   class IdentityMap : public MapBase<T, T> {
   public:
-    ///\e
-    typedef T Key;
-    ///\e
-    typedef T Value;
+    typedef MapBase<T, T> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Gives back the given value without any modification.
@@ -250,8 +246,9 @@
   public:
 
+    typedef MapBase<int, V> Parent;
     /// Key type
-    typedef int Key;
+    typedef typename Parent::Key Key;
     /// Value type
-    typedef V Value;
+    typedef typename Parent::Value Value;
     /// Reference type
     typedef typename Vector::reference Reference;
@@ -357,5 +354,5 @@
   /// The simplest way of using this map is through the sparseMap()
   /// function.
-  template <typename K, typename V, typename Comp = std::less<K> >
+  template <typename K, typename V, typename Compare = std::less<K> >
   class SparseMap : public MapBase<K, V> {
     template <typename K1, typename V1, typename C1>
@@ -363,8 +360,9 @@
   public:
 
+    typedef MapBase<K, V> Parent;
     /// Key type
-    typedef K Key;
+    typedef typename Parent::Key Key;
     /// Value type
-    typedef V Value;
+    typedef typename Parent::Value Value;
     /// Reference type
     typedef Value& Reference;
@@ -376,5 +374,5 @@
   private:
 
-    typedef std::map<K, V, Comp> Map;
+    typedef std::map<K, V, Compare> Map;
     Map _map;
     Value _value;
@@ -492,13 +490,12 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M2::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M2::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     ComposeMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
 
-    ///\e
+    /// \e
     typename MapTraits<M1>::ConstReturnValue
     operator[](const Key &k) const { return _m1[_m2[k]]; }
@@ -549,13 +546,12 @@
     F _f;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<typename M1::Key, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     CombineMap(const M1 &m1, const M2 &m2, const F &f = F())
       : _m1(m1), _m2(m2), _f(f) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _f(_m1[k],_m2[k]); }
   };
@@ -620,12 +616,11 @@
     F _f;
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<K, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     FunctorToMap(const F &f = F()) : _f(f) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _f(k); }
   };
@@ -675,17 +670,16 @@
     const M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
-
-    typedef typename M::Key argument_type;
-    typedef typename M::Value result_type;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
+
+    typedef typename Parent::Key argument_type;
+    typedef typename Parent::Value result_type;
 
     /// Constructor
     MapToFunctor(const M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator()(const Key &k) const { return _m[k]; }
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m[k]; }
   };
@@ -716,8 +710,7 @@
     const M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef V Value;
+    typedef MapBase<typename M::Key, V> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -727,5 +720,5 @@
     ConvertMap(const M &m) : _m(m) {}
 
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m[k]; }
   };
@@ -759,8 +752,7 @@
     M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -806,12 +798,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     AddMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]+_m2[k]; }
   };
@@ -855,12 +846,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     SubMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]-_m2[k]; }
   };
@@ -905,12 +895,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     MulMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]*_m2[k]; }
   };
@@ -954,12 +943,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef typename M1::Value Value;
+    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     DivMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]/_m2[k]; }
   };
@@ -1005,8 +993,7 @@
     C _v;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -1016,5 +1003,5 @@
     /// \param v The constant value.
     ShiftMap(const M &m, const C &v) : _m(m), _v(v) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m[k]+_v; }
   };
@@ -1036,8 +1023,7 @@
     C _v;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -1047,7 +1033,7 @@
     /// \param v The constant value.
     ShiftWriteMap(M &m, const C &v) : _m(m), _v(v) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m[k]+_v; }
-    ///\e
+    /// \e
     void set(const Key &k, const Value &v) { _m.set(k, v-_v); }
   };
@@ -1108,8 +1094,7 @@
     C _v;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -1119,5 +1104,5 @@
     /// \param v The constant value.
     ScaleMap(const M &m, const C &v) : _m(m), _v(v) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _v*_m[k]; }
   };
@@ -1140,8 +1125,7 @@
     C _v;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
@@ -1151,7 +1135,7 @@
     /// \param v The constant value.
     ScaleWriteMap(M &m, const C &v) : _m(m), _v(v) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _v*_m[k]; }
-    ///\e
+    /// \e
     void set(const Key &k, const Value &v) { _m.set(k, v/_v); }
   };
@@ -1210,12 +1194,11 @@
     const M& _m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     NegMap(const M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return -_m[k]; }
   };
@@ -1246,14 +1229,13 @@
     M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     NegWriteMap(M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return -_m[k]; }
-    ///\e
+    /// \e
     void set(const Key &k, const Value &v) { _m.set(k, -v); }
   };
@@ -1301,12 +1283,11 @@
     const M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef typename M::Value Value;
+    typedef MapBase<typename M::Key, typename M::Value> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     AbsMap(const M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const {
       Value tmp = _m[k];
@@ -1357,8 +1338,7 @@
   class TrueMap : public MapBase<K, bool> {
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<K, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Gives back \c true.
@@ -1395,8 +1375,7 @@
   class FalseMap : public MapBase<K, bool> {
   public:
-    ///\e
-    typedef K Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<K, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Gives back \c false.
@@ -1441,12 +1420,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M1::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     AndMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]&&_m2[k]; }
   };
@@ -1490,12 +1468,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M1::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     OrMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]||_m2[k]; }
   };
@@ -1530,12 +1507,11 @@
     const M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     NotMap(const M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return !_m[k]; }
   };
@@ -1557,14 +1533,13 @@
     M &_m;
   public:
-    ///\e
-    typedef typename M::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     NotWriteMap(M &m) : _m(m) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return !_m[k]; }
-    ///\e
+    /// \e
     void set(const Key &k, bool v) { _m.set(k, !v); }
   };
@@ -1621,12 +1596,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M1::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     EqualMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]==_m2[k]; }
   };
@@ -1670,12 +1644,11 @@
     const M2 &_m2;
   public:
-    ///\e
-    typedef typename M1::Key Key;
-    ///\e
-    typedef bool Value;
+    typedef MapBase<typename M1::Key, bool> Parent;
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
 
     /// Constructor
     LessMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    ///\e
+    /// \e
     Value operator[](const Key &k) const { return _m1[k]<_m2[k]; }
   };
@@ -1733,6 +1706,6 @@
   /// function.
   ///
-  /// \tparam IT The type of the iterator.
-  /// \tparam KEY The key type of the map. The default value set
+  /// \tparam It The type of the iterator.
+  /// \tparam Ke The key type of the map. The default value set
   /// according to the iterator type should work in most cases.
   ///
@@ -1740,18 +1713,15 @@
   /// for the elements or the iterator should be an inserter iterator.
 #ifdef DOXYGEN
-  template <typename IT, typename KEY>
+  template <typename It, typename Ke>
 #else
-  template <typename IT,
-            typename KEY = typename _maps_bits::IteratorTraits<IT>::Value>
+  template <typename It,
+            typename Ke=typename _maps_bits::IteratorTraits<It>::Value>
 #endif
-  class LoggerBoolMap : public MapBase<KEY, bool> {
-  public:
-
-    ///\e
-    typedef KEY Key;
-    ///\e
+  class LoggerBoolMap {
+  public:
+    typedef It Iterator;
+
+    typedef Ke Key;
     typedef bool Value;
-    ///\e
-    typedef IT Iterator;
 
     /// Constructor
@@ -1816,33 +1786,21 @@
   /// @{
 
-  /// \brief Provides an immutable and unique id for each item in a graph.
-  ///
-  /// IdMap provides a unique and immutable id for each item of the
-  /// same type (\c Node, \c Arc or \c Edge) in a graph. This id is 
-  ///  - \b unique: different items get different ids,
-  ///  - \b immutable: the id of an item does not change (even if you
-  ///    delete other nodes).
-  ///
-  /// Using this map you get access (i.e. can read) the inner id values of
-  /// the items stored in the graph, which is returned by the \c id()
-  /// function of the graph. This map can be inverted with its member
+  /// Provides an immutable and unique id for each item in the graph.
+
+  /// The IdMap class provides a unique and immutable id for each item of the
+  /// same type (e.g. node) in the graph. This id is <ul><li>\b unique:
+  /// different items (nodes) get different ids <li>\b immutable: the id of an
+  /// item (node) does not change (even if you delete other nodes).  </ul>
+  /// Through this map you get access (i.e. can read) the inner id values of
+  /// the items stored in the graph. This map can be inverted with its member
   /// class \c InverseMap or with the \c operator() member.
   ///
-  /// \tparam GR The graph type.
-  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
-  /// \c GR::Edge).
-  ///
-  /// \see RangeIdMap
-  template <typename GR, typename K>
-  class IdMap : public MapBase<K, int> {
-  public:
-    /// The graph type of IdMap.
-    typedef GR Graph;
-    /// The key type of IdMap (\c Node, \c Arc or \c Edge).
-    typedef K Item;
-    /// The key type of IdMap (\c Node, \c Arc or \c Edge).
-    typedef K Key;
-    /// The value type of IdMap.
+  template <typename _Graph, typename _Item>
+  class IdMap {
+  public:
+    typedef _Graph Graph;
     typedef int Value;
+    typedef _Item Item;
+    typedef _Item Key;
 
     /// \brief Constructor.
@@ -1856,7 +1814,7 @@
     int operator[](const Item& item) const { return _graph->id(item);}
 
-    /// \brief Gives back the \e item by its id.
-    ///
-    /// Gives back the \e item by its id.
+    /// \brief Gives back the item by its id.
+    ///
+    /// Gives back the item by its id.
     Item operator()(int id) { return _graph->fromId(id, Item()); }
 
@@ -1866,7 +1824,7 @@
   public:
 
-    /// \brief This class represents the inverse of its owner (IdMap).
-    ///
-    /// This class represents the inverse of its owner (IdMap).
+    /// \brief The class represents the inverse of its owner (IdMap).
+    ///
+    /// The class represents the inverse of its owner (IdMap).
     /// \see inverse()
     class InverseMap {
@@ -1886,4 +1844,5 @@
       ///
       /// Gives back the given item from its id.
+      ///
       Item operator[](int id) const { return _graph->fromId(id, Item());}
 
@@ -1896,11 +1855,12 @@
     /// Gives back the inverse of the IdMap.
     InverseMap inverse() const { return InverseMap(*_graph);}
-  };
-
-
-  /// \brief General cross reference graph map type.
-
-  /// This class provides simple invertable graph maps.
-  /// It wraps an arbitrary \ref concepts::ReadWriteMap "ReadWriteMap"
+
+  };
+
+
+  /// \brief General invertable graph-map type.
+
+  /// This type provides simple invertable graph-maps.
+  /// The InvertableMap wraps an arbitrary ReadWriteMap
   /// and if a key is set to a new value then store it
   /// in the inverse map.
@@ -1909,36 +1869,33 @@
   /// with stl compatible forward iterator.
   ///
-  /// \tparam GR The graph type.
-  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
-  /// \c GR::Edge).
-  /// \tparam V The value type of the map.
+  /// \tparam _Graph The graph type.
+  /// \tparam _Item The item type of the graph.
+  /// \tparam _Value The value type of the map.
   ///
   /// \see IterableValueMap
-  template <typename GR, typename K, typename V>
-  class CrossRefMap
-    : protected ItemSetTraits<GR, K>::template Map<V>::Type {
+  template <typename _Graph, typename _Item, typename _Value>
+  class InvertableMap
+    : protected ItemSetTraits<_Graph, _Item>::template Map<_Value>::Type {
   private:
 
-    typedef typename ItemSetTraits<GR, K>::
-      template Map<V>::Type Map;
-
-    typedef std::map<V, K> Container;
+    typedef typename ItemSetTraits<_Graph, _Item>::
+    template Map<_Value>::Type Map;
+    typedef _Graph Graph;
+
+    typedef std::map<_Value, _Item> Container;
     Container _inv_map;
 
   public:
 
-    /// The graph type of CrossRefMap.
-    typedef GR Graph;
-    /// The key type of CrossRefMap (\c Node, \c Arc or \c Edge).
-    typedef K Item;
-    /// The key type of CrossRefMap (\c Node, \c Arc or \c Edge).
-    typedef K Key;
-    /// The value type of CrossRefMap.
-    typedef V Value;
+    /// The key type of InvertableMap (Node, Arc, Edge).
+    typedef typename Map::Key Key;
+    /// The value type of the InvertableMap.
+    typedef typename Map::Value Value;
 
     /// \brief Constructor.
     ///
-    /// Construct a new CrossRefMap for the given graph.
-    explicit CrossRefMap(const Graph& graph) : Map(graph) {}
+    /// Construct a new InvertableMap for the graph.
+    ///
+    explicit InvertableMap(const Graph& graph) : Map(graph) {}
 
     /// \brief Forward iterator for values.
@@ -1946,8 +1903,9 @@
     /// This iterator is an stl compatible forward
     /// iterator on the values of the map. The values can
-    /// be accessed in the <tt>[beginValue, endValue)</tt> range.
+    /// be accessed in the [beginValue, endValue) range.
+    ///
     class ValueIterator
       : public std::iterator<std::forward_iterator_tag, Value> {
-      friend class CrossRefMap;
+      friend class InvertableMap;
     private:
       ValueIterator(typename Container::const_iterator _it)
@@ -1978,5 +1936,5 @@
     /// Returns an stl compatible iterator to the
     /// first value of the map. The values of the
-    /// map can be accessed in the <tt>[beginValue, endValue)</tt>
+    /// map can be accessed in the [beginValue, endValue)
     /// range.
     ValueIterator beginValue() const {
@@ -1988,5 +1946,5 @@
     /// Returns an stl compatible iterator after the
     /// last value of the map. The values of the
-    /// map can be accessed in the <tt>[beginValue, endValue)</tt>
+    /// map can be accessed in the [beginValue, endValue)
     /// range.
     ValueIterator endValue() const {
@@ -1994,7 +1952,7 @@
     }
 
-    /// \brief Sets the value associated with the given key.
-    ///
-    /// Sets the value associated with the given key.
+    /// \brief The setter function of the map.
+    ///
+    /// Sets the mapped value.
     void set(const Key& key, const Value& val) {
       Value oldval = Map::operator[](key);
@@ -2007,7 +1965,7 @@
     }
 
-    /// \brief Returns the value associated with the given key.
-    ///
-    /// Returns the value associated with the given key.
+    /// \brief The getter function of the map.
+    ///
+    /// It gives back the value associated with the key.
     typename MapTraits<Map>::ConstReturnValue
     operator[](const Key& key) const {
@@ -2025,7 +1983,7 @@
   protected:
 
-    /// \brief Erase the key from the map and the inverse map.
-    ///
-    /// Erase the key from the map and the inverse map. It is called by the
+    /// \brief Erase the key from the map.
+    ///
+    /// Erase the key to the map. It is called by the
     /// \c AlterationNotifier.
     virtual void erase(const Key& key) {
@@ -2038,7 +1996,7 @@
     }
 
-    /// \brief Erase more keys from the map and the inverse map.
-    ///
-    /// Erase more keys from the map and the inverse map. It is called by the
+    /// \brief Erase more keys from the map.
+    ///
+    /// Erase more keys from the map. It is called by the
     /// \c AlterationNotifier.
     virtual void erase(const std::vector<Key>& keys) {
@@ -2053,7 +2011,7 @@
     }
 
-    /// \brief Clear the keys from the map and the inverse map.
-    ///
-    /// Clear the keys from the map and the inverse map. It is called by the
+    /// \brief Clear the keys from the map and inverse map.
+    ///
+    /// Clear the keys from the map and inverse map. It is called by the
     /// \c AlterationNotifier.
     virtual void clear() {
@@ -2067,22 +2025,22 @@
     ///
     /// The inverse of this map. The subscript operator of the map
-    /// gives back the item that was last assigned to the value.
+    /// gives back always the item what was last assigned to the value.
     class InverseMap {
     public:
-      /// \brief Constructor
+      /// \brief Constructor of the InverseMap.
       ///
       /// Constructor of the InverseMap.
-      explicit InverseMap(const CrossRefMap& inverted)
+      explicit InverseMap(const InvertableMap& inverted)
         : _inverted(inverted) {}
 
       /// The value type of the InverseMap.
-      typedef typename CrossRefMap::Key Value;
+      typedef typename InvertableMap::Key Value;
       /// The key type of the InverseMap.
-      typedef typename CrossRefMap::Value Key;
+      typedef typename InvertableMap::Value Key;
 
       /// \brief Subscript operator.
       ///
-      /// Subscript operator. It gives back the item
-      /// that was last assigned to the given value.
+      /// Subscript operator. It gives back always the item
+      /// what was last assigned to the value.
       Value operator[](const Key& key) const {
         return _inverted(key);
@@ -2090,10 +2048,10 @@
 
     private:
-      const CrossRefMap& _inverted;
+      const InvertableMap& _inverted;
     };
 
-    /// \brief It gives back the read-only inverse map.
-    ///
-    /// It gives back the read-only inverse map.
+    /// \brief It gives back the just readable inverse map.
+    ///
+    /// It gives back the just readable inverse map.
     InverseMap inverse() const {
       return InverseMap(*this);
@@ -2102,46 +2060,39 @@
   };
 
-  /// \brief Provides continuous and unique ID for the
-  /// items of a graph.
-  ///
-  /// RangeIdMap provides a unique and continuous
-  /// ID for each item of a given type (\c Node, \c Arc or
-  /// \c Edge) in a graph. This id is
-  ///  - \b unique: different items get different ids,
-  ///  - \b continuous: the range of the ids is the set of integers
-  ///    between 0 and \c n-1, where \c n is the number of the items of
-  ///    this type (\c Node, \c Arc or \c Edge).
-  ///  - So, the ids can change when deleting an item of the same type.
-  ///
-  /// Thus this id is not (necessarily) the same as what can get using
-  /// the \c id() function of the graph or \ref IdMap.
-  /// This map can be inverted with its member class \c InverseMap,
-  /// or with the \c operator() member.
-  ///
-  /// \tparam GR The graph type.
-  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
-  /// \c GR::Edge).
-  ///
-  /// \see IdMap
-  template <typename GR, typename K>
-  class RangeIdMap
-    : protected ItemSetTraits<GR, K>::template Map<int>::Type {
-
-    typedef typename ItemSetTraits<GR, K>::template Map<int>::Type Map;
-
-  public:
-    /// The graph type of RangeIdMap.
-    typedef GR Graph;
-    /// The key type of RangeIdMap (\c Node, \c Arc or \c Edge).
-    typedef K Item;
-    /// The key type of RangeIdMap (\c Node, \c Arc or \c Edge).
-    typedef K Key;
-    /// The value type of RangeIdMap.
-    typedef int Value;
+  /// \brief Provides a mutable, continuous and unique descriptor for each
+  /// item in the graph.
+  ///
+  /// The DescriptorMap class provides a unique and continuous (but mutable)
+  /// descriptor (id) for each item of the same type (e.g. node) in the
+  /// graph. This id is <ul><li>\b unique: different items (nodes) get
+  /// different ids <li>\b continuous: the range of the ids is the set of
+  /// integers between 0 and \c n-1, where \c n is the number of the items of
+  /// this type (e.g. nodes) (so the id of a node can change if you delete an
+  /// other node, i.e. this id is mutable).  </ul> This map can be inverted
+  /// with its member class \c InverseMap, or with the \c operator() member.
+  ///
+  /// \tparam _Graph The graph class the \c DescriptorMap belongs to.
+  /// \tparam _Item The Item is the Key of the Map. It may be Node, Arc or
+  /// Edge.
+  template <typename _Graph, typename _Item>
+  class DescriptorMap
+    : protected ItemSetTraits<_Graph, _Item>::template Map<int>::Type {
+
+    typedef _Item Item;
+    typedef typename ItemSetTraits<_Graph, _Item>::template Map<int>::Type Map;
+
+  public:
+    /// The graph class of DescriptorMap.
+    typedef _Graph Graph;
+
+    /// The key type of DescriptorMap (Node, Arc, Edge).
+    typedef typename Map::Key Key;
+    /// The value type of DescriptorMap.
+    typedef typename Map::Value Value;
 
     /// \brief Constructor.
     ///
-    /// Constructor.
-    explicit RangeIdMap(const Graph& gr) : Map(gr) {
+    /// Constructor for descriptor map.
+    explicit DescriptorMap(const Graph& _graph) : Map(_graph) {
       Item it;
       const typename Map::Notifier* nf = Map::notifier();
@@ -2154,5 +2105,5 @@
   protected:
 
-    /// \brief Adds a new key to the map.
+    /// \brief Add a new key to the map.
     ///
     /// Add a new key to the map. It is called by the
@@ -2244,14 +2195,14 @@
     }
 
-    /// \brief Gives back the \e RangeId of the item
-    ///
-    /// Gives back the \e RangeId of the item.
+    /// \brief Gives back the \e descriptor of the item.
+    ///
+    /// Gives back the mutable and unique \e descriptor of the map.
     int operator[](const Item& item) const {
       return Map::operator[](item);
     }
 
-    /// \brief Gives back the item belonging to a \e RangeId
-    /// 
-    /// Gives back the item belonging to a \e RangeId.
+    /// \brief Gives back the item by its descriptor.
+    ///
+    /// Gives back th item by its descriptor.
     Item operator()(int id) const {
       return _inv_map[id];
@@ -2264,26 +2215,25 @@
 
   public:
-
-    /// \brief The inverse map type of RangeIdMap.
-    ///
-    /// The inverse map type of RangeIdMap.
+    /// \brief The inverse map type of DescriptorMap.
+    ///
+    /// The inverse map type of DescriptorMap.
     class InverseMap {
     public:
-      /// \brief Constructor
+      /// \brief Constructor of the InverseMap.
       ///
       /// Constructor of the InverseMap.
-      explicit InverseMap(const RangeIdMap& inverted)
+      explicit InverseMap(const DescriptorMap& inverted)
         : _inverted(inverted) {}
 
 
       /// The value type of the InverseMap.
-      typedef typename RangeIdMap::Key Value;
+      typedef typename DescriptorMap::Key Value;
       /// The key type of the InverseMap.
-      typedef typename RangeIdMap::Value Key;
+      typedef typename DescriptorMap::Value Key;
 
       /// \brief Subscript operator.
       ///
       /// Subscript operator. It gives back the item
-      /// that the descriptor currently belongs to.
+      /// that the descriptor belongs to currently.
       Value operator[](const Key& key) const {
         return _inverted(key);
@@ -2298,5 +2248,5 @@
 
     private:
-      const RangeIdMap& _inverted;
+      const DescriptorMap& _inverted;
     };
 
@@ -2309,34 +2259,32 @@
   };
 
-  /// \brief Map of the source nodes of arcs in a digraph.
-  ///
-  /// SourceMap provides access for the source node of each arc in a digraph,
-  /// which is returned by the \c source() function of the digraph.
-  /// \tparam GR The digraph type.
+  /// \brief Returns the source of the given arc.
+  ///
+  /// The SourceMap gives back the source Node of the given arc.
   /// \see TargetMap
-  template <typename GR>
+  template <typename Digraph>
   class SourceMap {
   public:
 
-    ///\e
-    typedef typename GR::Arc Key;
-    ///\e
-    typedef typename GR::Node Value;
+    typedef typename Digraph::Node Value;
+    typedef typename Digraph::Arc Key;
 
     /// \brief Constructor
     ///
-    /// Constructor.
+    /// Constructor
     /// \param digraph The digraph that the map belongs to.
-    explicit SourceMap(const GR& digraph) : _graph(digraph) {}
-
-    /// \brief Returns the source node of the given arc.
-    ///
-    /// Returns the source node of the given arc.
+    explicit SourceMap(const Digraph& digraph) : _digraph(digraph) {}
+
+    /// \brief The subscript operator.
+    ///
+    /// The subscript operator.
+    /// \param arc The arc
+    /// \return The source of the arc
     Value operator[](const Key& arc) const {
-      return _graph.source(arc);
+      return _digraph.source(arc);
     }
 
   private:
-    const GR& _graph;
+    const Digraph& _digraph;
   };
 
@@ -2345,39 +2293,37 @@
   /// This function just returns an \c SourceMap class.
   /// \relates SourceMap
-  template <typename GR>
-  inline SourceMap<GR> sourceMap(const GR& graph) {
-    return SourceMap<GR>(graph);
-  }
-
-  /// \brief Map of the target nodes of arcs in a digraph.
-  ///
-  /// TargetMap provides access for the target node of each arc in a digraph,
-  /// which is returned by the \c target() function of the digraph.
-  /// \tparam GR The digraph type.
+  template <typename Digraph>
+  inline SourceMap<Digraph> sourceMap(const Digraph& digraph) {
+    return SourceMap<Digraph>(digraph);
+  }
+
+  /// \brief Returns the target of the given arc.
+  ///
+  /// The TargetMap gives back the target Node of the given arc.
   /// \see SourceMap
-  template <typename GR>
+  template <typename Digraph>
   class TargetMap {
   public:
 
-    ///\e
-    typedef typename GR::Arc Key;
-    ///\e
-    typedef typename GR::Node Value;
+    typedef typename Digraph::Node Value;
+    typedef typename Digraph::Arc Key;
 
     /// \brief Constructor
     ///
-    /// Constructor.
+    /// Constructor
     /// \param digraph The digraph that the map belongs to.
-    explicit TargetMap(const GR& digraph) : _graph(digraph) {}
-
-    /// \brief Returns the target node of the given arc.
-    ///
-    /// Returns the target node of the given arc.
+    explicit TargetMap(const Digraph& digraph) : _digraph(digraph) {}
+
+    /// \brief The subscript operator.
+    ///
+    /// The subscript operator.
+    /// \param e The arc
+    /// \return The target of the arc
     Value operator[](const Key& e) const {
-      return _graph.target(e);
+      return _digraph.target(e);
     }
 
   private:
-    const GR& _graph;
+    const Digraph& _digraph;
   };
 
@@ -2386,32 +2332,31 @@
   /// This function just returns a \c TargetMap class.
   /// \relates TargetMap
-  template <typename GR>
-  inline TargetMap<GR> targetMap(const GR& graph) {
-    return TargetMap<GR>(graph);
-  }
-
-  /// \brief Map of the "forward" directed arc view of edges in a graph.
-  ///
-  /// ForwardMap provides access for the "forward" directed arc view of
-  /// each edge in a graph, which is returned by the \c direct() function
-  /// of the graph with \c true parameter.
-  /// \tparam GR The graph type.
+  template <typename Digraph>
+  inline TargetMap<Digraph> targetMap(const Digraph& digraph) {
+    return TargetMap<Digraph>(digraph);
+  }
+
+  /// \brief Returns the "forward" directed arc view of an edge.
+  ///
+  /// Returns the "forward" directed arc view of an edge.
   /// \see BackwardMap
-  template <typename GR>
+  template <typename Graph>
   class ForwardMap {
   public:
 
-    typedef typename GR::Arc Value;
-    typedef typename GR::Edge Key;
+    typedef typename Graph::Arc Value;
+    typedef typename Graph::Edge Key;
 
     /// \brief Constructor
     ///
-    /// Constructor.
+    /// Constructor
     /// \param graph The graph that the map belongs to.
-    explicit ForwardMap(const GR& graph) : _graph(graph) {}
-
-    /// \brief Returns the "forward" directed arc view of the given edge.
-    ///
-    /// Returns the "forward" directed arc view of the given edge.
+    explicit ForwardMap(const Graph& graph) : _graph(graph) {}
+
+    /// \brief The subscript operator.
+    ///
+    /// The subscript operator.
+    /// \param key An edge
+    /// \return The "forward" directed arc view of edge
     Value operator[](const Key& key) const {
       return _graph.direct(key, true);
@@ -2419,5 +2364,5 @@
 
   private:
-    const GR& _graph;
+    const Graph& _graph;
   };
 
@@ -2426,32 +2371,31 @@
   /// This function just returns an \c ForwardMap class.
   /// \relates ForwardMap
-  template <typename GR>
-  inline ForwardMap<GR> forwardMap(const GR& graph) {
-    return ForwardMap<GR>(graph);
-  }
-
-  /// \brief Map of the "backward" directed arc view of edges in a graph.
-  ///
-  /// BackwardMap provides access for the "backward" directed arc view of
-  /// each edge in a graph, which is returned by the \c direct() function
-  /// of the graph with \c false parameter.
-  /// \tparam GR The graph type.
+  template <typename Graph>
+  inline ForwardMap<Graph> forwardMap(const Graph& graph) {
+    return ForwardMap<Graph>(graph);
+  }
+
+  /// \brief Returns the "backward" directed arc view of an edge.
+  ///
+  /// Returns the "backward" directed arc view of an edge.
   /// \see ForwardMap
-  template <typename GR>
+  template <typename Graph>
   class BackwardMap {
   public:
 
-    typedef typename GR::Arc Value;
-    typedef typename GR::Edge Key;
+    typedef typename Graph::Arc Value;
+    typedef typename Graph::Edge Key;
 
     /// \brief Constructor
     ///
-    /// Constructor.
+    /// Constructor
     /// \param graph The graph that the map belongs to.
-    explicit BackwardMap(const GR& graph) : _graph(graph) {}
-
-    /// \brief Returns the "backward" directed arc view of the given edge.
-    ///
-    /// Returns the "backward" directed arc view of the given edge.
+    explicit BackwardMap(const Graph& graph) : _graph(graph) {}
+
+    /// \brief The subscript operator.
+    ///
+    /// The subscript operator.
+    /// \param key An edge
+    /// \return The "backward" directed arc view of edge
     Value operator[](const Key& key) const {
       return _graph.direct(key, false);
@@ -2459,5 +2403,5 @@
 
   private:
-    const GR& _graph;
+    const Graph& _graph;
   };
 
@@ -2466,21 +2410,61 @@
   /// This function just returns a \c BackwardMap class.
   /// \relates BackwardMap
-  template <typename GR>
-  inline BackwardMap<GR> backwardMap(const GR& graph) {
-    return BackwardMap<GR>(graph);
-  }
-
-  /// \brief Map of the in-degrees of nodes in a digraph.
+  template <typename Graph>
+  inline BackwardMap<Graph> backwardMap(const Graph& graph) {
+    return BackwardMap<Graph>(graph);
+  }
+
+  /// \brief Potential difference map
+  ///
+  /// If there is an potential map on the nodes then we
+  /// can get an arc map as we get the substraction of the
+  /// values of the target and source.
+  template <typename Digraph, typename NodeMap>
+  class PotentialDifferenceMap {
+  public:
+    typedef typename Digraph::Arc Key;
+    typedef typename NodeMap::Value Value;
+
+    /// \brief Constructor
+    ///
+    /// Contructor of the map
+    explicit PotentialDifferenceMap(const Digraph& digraph,
+                                    const NodeMap& potential)
+      : _digraph(digraph), _potential(potential) {}
+
+    /// \brief Const subscription operator
+    ///
+    /// Const subscription operator
+    Value operator[](const Key& arc) const {
+      return _potential[_digraph.target(arc)] -
+        _potential[_digraph.source(arc)];
+    }
+
+  private:
+    const Digraph& _digraph;
+    const NodeMap& _potential;
+  };
+
+  /// \brief Returns a PotentialDifferenceMap.
+  ///
+  /// This function just returns a PotentialDifferenceMap.
+  /// \relates PotentialDifferenceMap
+  template <typename Digraph, typename NodeMap>
+  PotentialDifferenceMap<Digraph, NodeMap>
+  potentialDifferenceMap(const Digraph& digraph, const NodeMap& potential) {
+    return PotentialDifferenceMap<Digraph, NodeMap>(digraph, potential);
+  }
+
+  /// \brief Map of the node in-degrees.
   ///
   /// This map returns the in-degree of a node. Once it is constructed,
-  /// the degrees are stored in a standard \c NodeMap, so each query is done
+  /// the degrees are stored in a standard NodeMap, so each query is done
   /// in constant time. On the other hand, the values are updated automatically
   /// whenever the digraph changes.
   ///
-  /// \warning Besides \c addNode() and \c addArc(), a digraph structure 
-  /// may provide alternative ways to modify the digraph.
-  /// The correct behavior of InDegMap is not guarantied if these additional
-  /// features are used. For example the functions
-  /// \ref ListDigraph::changeSource() "changeSource()",
+  /// \warning Besides addNode() and addArc(), a digraph structure may provide
+  /// alternative ways to modify the digraph. The correct behavior of InDegMap
+  /// is not guarantied if these additional features are used. For example
+  /// the functions \ref ListDigraph::changeSource() "changeSource()",
   /// \ref ListDigraph::changeTarget() "changeTarget()" and
   /// \ref ListDigraph::reverseArc() "reverseArc()"
@@ -2488,17 +2472,15 @@
   ///
   /// \sa OutDegMap
-  template <typename GR>
+
+  template <typename _Digraph>
   class InDegMap
-    : protected ItemSetTraits<GR, typename GR::Arc>
+    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
       ::ItemNotifier::ObserverBase {
 
   public:
-    
-    /// The digraph type
-    typedef GR Digraph;
-    /// The key type
+
+    typedef _Digraph Digraph;
+    typedef int Value;
     typedef typename Digraph::Node Key;
-    /// The value type
-    typedef int Value;
 
     typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
@@ -2542,7 +2524,7 @@
     /// \brief Constructor.
     ///
-    /// Constructor for creating an in-degree map.
-    explicit InDegMap(const Digraph& graph)
-      : _digraph(graph), _deg(graph) {
+    /// Constructor for creating in-degree map.
+    explicit InDegMap(const Digraph& digraph)
+      : _digraph(digraph), _deg(digraph) {
       Parent::attach(_digraph.notifier(typename Digraph::Arc()));
 
@@ -2552,6 +2534,4 @@
     }
 
-    /// \brief Gives back the in-degree of a Node.
-    ///
     /// Gives back the in-degree of a Node.
     int operator[](const Key& key) const {
@@ -2600,16 +2580,15 @@
   };
 
-  /// \brief Map of the out-degrees of nodes in a digraph.
+  /// \brief Map of the node out-degrees.
   ///
   /// This map returns the out-degree of a node. Once it is constructed,
-  /// the degrees are stored in a standard \c NodeMap, so each query is done
+  /// the degrees are stored in a standard NodeMap, so each query is done
   /// in constant time. On the other hand, the values are updated automatically
   /// whenever the digraph changes.
   ///
-  /// \warning Besides \c addNode() and \c addArc(), a digraph structure 
-  /// may provide alternative ways to modify the digraph.
-  /// The correct behavior of OutDegMap is not guarantied if these additional
-  /// features are used. For example the functions
-  /// \ref ListDigraph::changeSource() "changeSource()",
+  /// \warning Besides addNode() and addArc(), a digraph structure may provide
+  /// alternative ways to modify the digraph. The correct behavior of OutDegMap
+  /// is not guarantied if these additional features are used. For example
+  /// the functions \ref ListDigraph::changeSource() "changeSource()",
   /// \ref ListDigraph::changeTarget() "changeTarget()" and
   /// \ref ListDigraph::reverseArc() "reverseArc()"
@@ -2617,17 +2596,15 @@
   ///
   /// \sa InDegMap
-  template <typename GR>
+
+  template <typename _Digraph>
   class OutDegMap
-    : protected ItemSetTraits<GR, typename GR::Arc>
+    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
       ::ItemNotifier::ObserverBase {
 
   public:
 
-    /// The digraph type
-    typedef GR Digraph;
-    /// The key type
+    typedef _Digraph Digraph;
+    typedef int Value;
     typedef typename Digraph::Node Key;
-    /// The value type
-    typedef int Value;
 
     typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
@@ -2669,7 +2646,7 @@
     /// \brief Constructor.
     ///
-    /// Constructor for creating an out-degree map.
-    explicit OutDegMap(const Digraph& graph)
-      : _digraph(graph), _deg(graph) {
+    /// Constructor for creating out-degree map.
+    explicit OutDegMap(const Digraph& digraph)
+      : _digraph(digraph), _deg(digraph) {
       Parent::attach(_digraph.notifier(typename Digraph::Arc()));
 
@@ -2679,6 +2656,4 @@
     }
 
-    /// \brief Gives back the out-degree of a Node.
-    ///
     /// Gives back the out-degree of a Node.
     int operator[](const Key& key) const {
@@ -2727,54 +2702,4 @@
   };
 
-  /// \brief Potential difference map
-  ///
-  /// PotentialDifferenceMap returns the difference between the potentials of
-  /// the source and target nodes of each arc in a digraph, i.e. it returns
-  /// \code
-  ///   potential[gr.target(arc)] - potential[gr.source(arc)].
-  /// \endcode
-  /// \tparam GR The digraph type.
-  /// \tparam POT A node map storing the potentials.
-  template <typename GR, typename POT>
-  class PotentialDifferenceMap {
-  public:
-    /// Key type
-    typedef typename GR::Arc Key;
-    /// Value type
-    typedef typename POT::Value Value;
-
-    /// \brief Constructor
-    ///
-    /// Contructor of the map.
-    explicit PotentialDifferenceMap(const GR& gr,
-                                    const POT& potential)
-      : _digraph(gr), _potential(potential) {}
-
-    /// \brief Returns the potential difference for the given arc.
-    ///
-    /// Returns the potential difference for the given arc, i.e.
-    /// \code
-    ///   potential[gr.target(arc)] - potential[gr.source(arc)].
-    /// \endcode
-    Value operator[](const Key& arc) const {
-      return _potential[_digraph.target(arc)] -
-        _potential[_digraph.source(arc)];
-    }
-
-  private:
-    const GR& _digraph;
-    const POT& _potential;
-  };
-
-  /// \brief Returns a PotentialDifferenceMap.
-  ///
-  /// This function just returns a PotentialDifferenceMap.
-  /// \relates PotentialDifferenceMap
-  template <typename GR, typename POT>
-  PotentialDifferenceMap<GR, POT>
-  potentialDifferenceMap(const GR& gr, const POT& potential) {
-    return PotentialDifferenceMap<GR, POT>(gr, potential);
-  }
-
   /// @}
 }
Index: mon/matching.h
===================================================================
--- lemon/matching.h	(revision 594)
+++ 	(revision )
@@ -1,3244 +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.
- *
- */
-
-#ifndef LEMON_MAX_MATCHING_H
-#define LEMON_MAX_MATCHING_H
-
-#include <vector>
-#include <queue>
-#include <set>
-#include <limits>
-
-#include <lemon/core.h>
-#include <lemon/unionfind.h>
-#include <lemon/bin_heap.h>
-#include <lemon/maps.h>
-
-///\ingroup matching
-///\file
-///\brief Maximum matching algorithms in general graphs.
-
-namespace lemon {
-
-  /// \ingroup matching
-  ///
-  /// \brief Maximum cardinality matching in general graphs
-  ///
-  /// This class implements Edmonds' alternating forest matching algorithm
-  /// for finding a maximum cardinality matching in a general undirected graph.
-  /// It can be started from an arbitrary initial matching 
-  /// (the default is the empty one).
-  ///
-  /// The dual solution of the problem is a map of the nodes to
-  /// \ref MaxMatching::Status "Status", having values \c EVEN (or \c D),
-  /// \c ODD (or \c A) and \c MATCHED (or \c C) defining the Gallai-Edmonds
-  /// decomposition of the graph. The nodes in \c EVEN/D induce a subgraph
-  /// with factor-critical components, the nodes in \c ODD/A form the
-  /// canonical barrier, and the nodes in \c MATCHED/C induce a graph having
-  /// a perfect matching. The number of the factor-critical components
-  /// minus the number of barrier nodes is a lower bound on the
-  /// unmatched nodes, and the matching is optimal if and only if this bound is
-  /// tight. This decomposition can be obtained using \ref status() or
-  /// \ref statusMap() after running the algorithm.
-  ///
-  /// \tparam GR The undirected graph type the algorithm runs on.
-  template <typename GR>
-  class MaxMatching {
-  public:
-
-    /// The graph type of the algorithm
-    typedef GR Graph;
-    /// The type of the matching map
-    typedef typename Graph::template NodeMap<typename Graph::Arc>
-    MatchingMap;
-
-    ///\brief Status constants for Gallai-Edmonds decomposition.
-    ///
-    ///These constants are used for indicating the Gallai-Edmonds 
-    ///decomposition of a graph. The nodes with status \c EVEN (or \c D)
-    ///induce a subgraph with factor-critical components, the nodes with
-    ///status \c ODD (or \c A) form the canonical barrier, and the nodes
-    ///with status \c MATCHED (or \c C) induce a subgraph having a 
-    ///perfect matching.
-    enum Status {
-      EVEN = 1,       ///< = 1. (\c D is an alias for \c EVEN.)
-      D = 1,
-      MATCHED = 0,    ///< = 0. (\c C is an alias for \c MATCHED.)
-      C = 0,
-      ODD = -1,       ///< = -1. (\c A is an alias for \c ODD.)
-      A = -1,
-      UNMATCHED = -2  ///< = -2.
-    };
-
-    /// The type of the status map
-    typedef typename Graph::template NodeMap<Status> StatusMap;
-
-  private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(Graph);
-
-    typedef UnionFindEnum<IntNodeMap> BlossomSet;
-    typedef ExtendFindEnum<IntNodeMap> TreeSet;
-    typedef RangeMap<Node> NodeIntMap;
-    typedef MatchingMap EarMap;
-    typedef std::vector<Node> NodeQueue;
-
-    const Graph& _graph;
-    MatchingMap* _matching;
-    StatusMap* _status;
-
-    EarMap* _ear;
-
-    IntNodeMap* _blossom_set_index;
-    BlossomSet* _blossom_set;
-    NodeIntMap* _blossom_rep;
-
-    IntNodeMap* _tree_set_index;
-    TreeSet* _tree_set;
-
-    NodeQueue _node_queue;
-    int _process, _postpone, _last;
-
-    int _node_num;
-
-  private:
-
-    void createStructures() {
-      _node_num = countNodes(_graph);
-      if (!_matching) {
-        _matching = new MatchingMap(_graph);
-      }
-      if (!_status) {
-        _status = new StatusMap(_graph);
-      }
-      if (!_ear) {
-        _ear = new EarMap(_graph);
-      }
-      if (!_blossom_set) {
-        _blossom_set_index = new IntNodeMap(_graph);
-        _blossom_set = new BlossomSet(*_blossom_set_index);
-      }
-      if (!_blossom_rep) {
-        _blossom_rep = new NodeIntMap(_node_num);
-      }
-      if (!_tree_set) {
-        _tree_set_index = new IntNodeMap(_graph);
-        _tree_set = new TreeSet(*_tree_set_index);
-      }
-      _node_queue.resize(_node_num);
-    }
-
-    void destroyStructures() {
-      if (_matching) {
-        delete _matching;
-      }
-      if (_status) {
-        delete _status;
-      }
-      if (_ear) {
-        delete _ear;
-      }
-      if (_blossom_set) {
-        delete _blossom_set;
-        delete _blossom_set_index;
-      }
-      if (_blossom_rep) {
-        delete _blossom_rep;
-      }
-      if (_tree_set) {
-        delete _tree_set_index;
-        delete _tree_set;
-      }
-    }
-
-    void processDense(const Node& n) {
-      _process = _postpone = _last = 0;
-      _node_queue[_last++] = n;
-
-      while (_process != _last) {
-        Node u = _node_queue[_process++];
-        for (OutArcIt a(_graph, u); a != INVALID; ++a) {
-          Node v = _graph.target(a);
-          if ((*_status)[v] == MATCHED) {
-            extendOnArc(a);
-          } else if ((*_status)[v] == UNMATCHED) {
-            augmentOnArc(a);
-            return;
-          }
-        }
-      }
-
-      while (_postpone != _last) {
-        Node u = _node_queue[_postpone++];
-
-        for (OutArcIt a(_graph, u); a != INVALID ; ++a) {
-          Node v = _graph.target(a);
-
-          if ((*_status)[v] == EVEN) {
-            if (_blossom_set->find(u) != _blossom_set->find(v)) {
-              shrinkOnEdge(a);
-            }
-          }
-
-          while (_process != _last) {
-            Node w = _node_queue[_process++];
-            for (OutArcIt b(_graph, w); b != INVALID; ++b) {
-              Node x = _graph.target(b);
-              if ((*_status)[x] == MATCHED) {
-                extendOnArc(b);
-              } else if ((*_status)[x] == UNMATCHED) {
-                augmentOnArc(b);
-                return;
-              }
-            }
-          }
-        }
-      }
-    }
-
-    void processSparse(const Node& n) {
-      _process = _last = 0;
-      _node_queue[_last++] = n;
-      while (_process != _last) {
-        Node u = _node_queue[_process++];
-        for (OutArcIt a(_graph, u); a != INVALID; ++a) {
-          Node v = _graph.target(a);
-
-          if ((*_status)[v] == EVEN) {
-            if (_blossom_set->find(u) != _blossom_set->find(v)) {
-              shrinkOnEdge(a);
-            }
-          } else if ((*_status)[v] == MATCHED) {
-            extendOnArc(a);
-          } else if ((*_status)[v] == UNMATCHED) {
-            augmentOnArc(a);
-            return;
-          }
-        }
-      }
-    }
-
-    void shrinkOnEdge(const Edge& e) {
-      Node nca = INVALID;
-
-      {
-        std::set<Node> left_set, right_set;
-
-        Node left = (*_blossom_rep)[_blossom_set->find(_graph.u(e))];
-        left_set.insert(left);
-
-        Node right = (*_blossom_rep)[_blossom_set->find(_graph.v(e))];
-        right_set.insert(right);
-
-        while (true) {
-          if ((*_matching)[left] == INVALID) break;
-          left = _graph.target((*_matching)[left]);
-          left = (*_blossom_rep)[_blossom_set->
-                                 find(_graph.target((*_ear)[left]))];
-          if (right_set.find(left) != right_set.end()) {
-            nca = left;
-            break;
-          }
-          left_set.insert(left);
-
-          if ((*_matching)[right] == INVALID) break;
-          right = _graph.target((*_matching)[right]);
-          right = (*_blossom_rep)[_blossom_set->
-                                  find(_graph.target((*_ear)[right]))];
-          if (left_set.find(right) != left_set.end()) {
-            nca = right;
-            break;
-          }
-          right_set.insert(right);
-        }
-
-        if (nca == INVALID) {
-          if ((*_matching)[left] == INVALID) {
-            nca = right;
-            while (left_set.find(nca) == left_set.end()) {
-              nca = _graph.target((*_matching)[nca]);
-              nca =(*_blossom_rep)[_blossom_set->
-                                   find(_graph.target((*_ear)[nca]))];
-            }
-          } else {
-            nca = left;
-            while (right_set.find(nca) == right_set.end()) {
-              nca = _graph.target((*_matching)[nca]);
-              nca = (*_blossom_rep)[_blossom_set->
-                                   find(_graph.target((*_ear)[nca]))];
-            }
-          }
-        }
-      }
-
-      {
-
-        Node node = _graph.u(e);
-        Arc arc = _graph.direct(e, true);
-        Node base = (*_blossom_rep)[_blossom_set->find(node)];
-
-        while (base != nca) {
-          (*_ear)[node] = arc;
-
-          Node n = node;
-          while (n != base) {
-            n = _graph.target((*_matching)[n]);
-            Arc a = (*_ear)[n];
-            n = _graph.target(a);
-            (*_ear)[n] = _graph.oppositeArc(a);
-          }
-          node = _graph.target((*_matching)[base]);
-          _tree_set->erase(base);
-          _tree_set->erase(node);
-          _blossom_set->insert(node, _blossom_set->find(base));
-          (*_status)[node] = EVEN;
-          _node_queue[_last++] = node;
-          arc = _graph.oppositeArc((*_ear)[node]);
-          node = _graph.target((*_ear)[node]);
-          base = (*_blossom_rep)[_blossom_set->find(node)];
-          _blossom_set->join(_graph.target(arc), base);
-        }
-      }
-
-      (*_blossom_rep)[_blossom_set->find(nca)] = nca;
-
-      {
-
-        Node node = _graph.v(e);
-        Arc arc = _graph.direct(e, false);
-        Node base = (*_blossom_rep)[_blossom_set->find(node)];
-
-        while (base != nca) {
-          (*_ear)[node] = arc;
-
-          Node n = node;
-          while (n != base) {
-            n = _graph.target((*_matching)[n]);
-            Arc a = (*_ear)[n];
-            n = _graph.target(a);
-            (*_ear)[n] = _graph.oppositeArc(a);
-          }
-          node = _graph.target((*_matching)[base]);
-          _tree_set->erase(base);
-          _tree_set->erase(node);
-          _blossom_set->insert(node, _blossom_set->find(base));
-          (*_status)[node] = EVEN;
-          _node_queue[_last++] = node;
-          arc = _graph.oppositeArc((*_ear)[node]);
-          node = _graph.target((*_ear)[node]);
-          base = (*_blossom_rep)[_blossom_set->find(node)];
-          _blossom_set->join(_graph.target(arc), base);
-        }
-      }
-
-      (*_blossom_rep)[_blossom_set->find(nca)] = nca;
-    }
-
-    void extendOnArc(const Arc& a) {
-      Node base = _graph.source(a);
-      Node odd = _graph.target(a);
-
-      (*_ear)[odd] = _graph.oppositeArc(a);
-      Node even = _graph.target((*_matching)[odd]);
-      (*_blossom_rep)[_blossom_set->insert(even)] = even;
-      (*_status)[odd] = ODD;
-      (*_status)[even] = EVEN;
-      int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(base)]);
-      _tree_set->insert(odd, tree);
-      _tree_set->insert(even, tree);
-      _node_queue[_last++] = even;
-
-    }
-
-    void augmentOnArc(const Arc& a) {
-      Node even = _graph.source(a);
-      Node odd = _graph.target(a);
-
-      int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(even)]);
-
-      (*_matching)[odd] = _graph.oppositeArc(a);
-      (*_status)[odd] = MATCHED;
-
-      Arc arc = (*_matching)[even];
-      (*_matching)[even] = a;
-
-      while (arc != INVALID) {
-        odd = _graph.target(arc);
-        arc = (*_ear)[odd];
-        even = _graph.target(arc);
-        (*_matching)[odd] = arc;
-        arc = (*_matching)[even];
-        (*_matching)[even] = _graph.oppositeArc((*_matching)[odd]);
-      }
-
-      for (typename TreeSet::ItemIt it(*_tree_set, tree);
-           it != INVALID; ++it) {
-        if ((*_status)[it] == ODD) {
-          (*_status)[it] = MATCHED;
-        } else {
-          int blossom = _blossom_set->find(it);
-          for (typename BlossomSet::ItemIt jt(*_blossom_set, blossom);
-               jt != INVALID; ++jt) {
-            (*_status)[jt] = MATCHED;
-          }
-          _blossom_set->eraseClass(blossom);
-        }
-      }
-      _tree_set->eraseClass(tree);
-
-    }
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Constructor.
-    MaxMatching(const Graph& graph)
-      : _graph(graph), _matching(0), _status(0), _ear(0),
-        _blossom_set_index(0), _blossom_set(0), _blossom_rep(0),
-        _tree_set_index(0), _tree_set(0) {}
-
-    ~MaxMatching() {
-      destroyStructures();
-    }
-
-    /// \name Execution Control
-    /// The simplest way to execute the algorithm is to use the
-    /// \c run() member function.\n
-    /// If you need better control on the execution, you have to call
-    /// one of the functions \ref init(), \ref greedyInit() or
-    /// \ref matchingInit() first, then you can start the algorithm with
-    /// \ref startSparse() or \ref startDense().
-
-    ///@{
-
-    /// \brief Set the initial matching to the empty matching.
-    ///
-    /// This function sets the initial matching to the empty matching.
-    void init() {
-      createStructures();
-      for(NodeIt n(_graph); n != INVALID; ++n) {
-        (*_matching)[n] = INVALID;
-        (*_status)[n] = UNMATCHED;
-      }
-    }
-
-    /// \brief Find an initial matching in a greedy way.
-    ///
-    /// This function finds an initial matching in a greedy way.
-    void greedyInit() {
-      createStructures();
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_matching)[n] = INVALID;
-        (*_status)[n] = UNMATCHED;
-      }
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_matching)[n] == INVALID) {
-          for (OutArcIt a(_graph, n); a != INVALID ; ++a) {
-            Node v = _graph.target(a);
-            if ((*_matching)[v] == INVALID && v != n) {
-              (*_matching)[n] = a;
-              (*_status)[n] = MATCHED;
-              (*_matching)[v] = _graph.oppositeArc(a);
-              (*_status)[v] = MATCHED;
-              break;
-            }
-          }
-        }
-      }
-    }
-
-
-    /// \brief Initialize the matching from a map.
-    ///
-    /// This function initializes the matching from a \c bool valued edge
-    /// map. This map should have the property that there are no two incident
-    /// edges with \c true value, i.e. it really contains a matching.
-    /// \return \c true if the map contains a matching.
-    template <typename MatchingMap>
-    bool matchingInit(const MatchingMap& matching) {
-      createStructures();
-
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_matching)[n] = INVALID;
-        (*_status)[n] = UNMATCHED;
-      }
-      for(EdgeIt e(_graph); e!=INVALID; ++e) {
-        if (matching[e]) {
-
-          Node u = _graph.u(e);
-          if ((*_matching)[u] != INVALID) return false;
-          (*_matching)[u] = _graph.direct(e, true);
-          (*_status)[u] = MATCHED;
-
-          Node v = _graph.v(e);
-          if ((*_matching)[v] != INVALID) return false;
-          (*_matching)[v] = _graph.direct(e, false);
-          (*_status)[v] = MATCHED;
-        }
-      }
-      return true;
-    }
-
-    /// \brief Start Edmonds' algorithm
-    ///
-    /// This function runs the original Edmonds' algorithm.
-    ///
-    /// \pre \ref Init(), \ref greedyInit() or \ref matchingInit() must be
-    /// called before using this function.
-    void startSparse() {
-      for(NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_status)[n] == UNMATCHED) {
-          (*_blossom_rep)[_blossom_set->insert(n)] = n;
-          _tree_set->insert(n);
-          (*_status)[n] = EVEN;
-          processSparse(n);
-        }
-      }
-    }
-
-    /// \brief Start Edmonds' algorithm with a heuristic improvement 
-    /// for dense graphs
-    ///
-    /// This function runs Edmonds' algorithm with a heuristic of postponing
-    /// shrinks, therefore resulting in a faster algorithm for dense graphs.
-    ///
-    /// \pre \ref Init(), \ref greedyInit() or \ref matchingInit() must be
-    /// called before using this function.
-    void startDense() {
-      for(NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_status)[n] == UNMATCHED) {
-          (*_blossom_rep)[_blossom_set->insert(n)] = n;
-          _tree_set->insert(n);
-          (*_status)[n] = EVEN;
-          processDense(n);
-        }
-      }
-    }
-
-
-    /// \brief Run Edmonds' algorithm
-    ///
-    /// This function runs Edmonds' algorithm. An additional heuristic of 
-    /// postponing shrinks is used for relatively dense graphs 
-    /// (for which <tt>m>=2*n</tt> holds).
-    void run() {
-      if (countEdges(_graph) < 2 * countNodes(_graph)) {
-        greedyInit();
-        startSparse();
-      } else {
-        init();
-        startDense();
-      }
-    }
-
-    /// @}
-
-    /// \name Primal Solution
-    /// Functions to get the primal solution, i.e. the maximum matching.
-
-    /// @{
-
-    /// \brief Return the size (cardinality) of the matching.
-    ///
-    /// This function returns the size (cardinality) of the current matching. 
-    /// After run() it returns the size of the maximum matching in the graph.
-    int matchingSize() const {
-      int size = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_matching)[n] != INVALID) {
-          ++size;
-        }
-      }
-      return size / 2;
-    }
-
-    /// \brief Return \c true if the given edge is in the matching.
-    ///
-    /// This function returns \c true if the given edge is in the current 
-    /// matching.
-    bool matching(const Edge& edge) const {
-      return edge == (*_matching)[_graph.u(edge)];
-    }
-
-    /// \brief Return the matching arc (or edge) incident to the given node.
-    ///
-    /// This function returns the matching arc (or edge) incident to the
-    /// given node in the current matching or \c INVALID if the node is 
-    /// not covered by the matching.
-    Arc matching(const Node& n) const {
-      return (*_matching)[n];
-    }
-
-    /// \brief Return a const reference to the matching map.
-    ///
-    /// This function returns a const reference to a node map that stores
-    /// the matching arc (or edge) incident to each node.
-    const MatchingMap& matchingMap() const {
-      return *_matching;
-    }
-
-    /// \brief Return the mate of the given node.
-    ///
-    /// This function returns the mate of the given node in the current 
-    /// matching or \c INVALID if the node is not covered by the matching.
-    Node mate(const Node& n) const {
-      return (*_matching)[n] != INVALID ?
-        _graph.target((*_matching)[n]) : INVALID;
-    }
-
-    /// @}
-
-    /// \name Dual Solution
-    /// Functions to get the dual solution, i.e. the Gallai-Edmonds 
-    /// decomposition.
-
-    /// @{
-
-    /// \brief Return the status of the given node in the Edmonds-Gallai
-    /// decomposition.
-    ///
-    /// This function returns the \ref Status "status" of the given node
-    /// in the Edmonds-Gallai decomposition.
-    Status status(const Node& n) const {
-      return (*_status)[n];
-    }
-
-    /// \brief Return a const reference to the status map, which stores
-    /// the Edmonds-Gallai decomposition.
-    ///
-    /// This function returns a const reference to a node map that stores the
-    /// \ref Status "status" of each node in the Edmonds-Gallai decomposition.
-    const StatusMap& statusMap() const {
-      return *_status;
-    }
-
-    /// \brief Return \c true if the given node is in the barrier.
-    ///
-    /// This function returns \c true if the given node is in the barrier.
-    bool barrier(const Node& n) const {
-      return (*_status)[n] == ODD;
-    }
-
-    /// @}
-
-  };
-
-  /// \ingroup matching
-  ///
-  /// \brief Weighted matching in general graphs
-  ///
-  /// This class provides an efficient implementation of Edmond's
-  /// maximum weighted matching algorithm. The implementation is based
-  /// on extensive use of priority queues and provides
-  /// \f$O(nm\log n)\f$ time complexity.
-  ///
-  /// The maximum weighted matching problem is to find a subset of the 
-  /// edges in an undirected graph with maximum overall weight for which 
-  /// each node has at most one incident edge.
-  /// It can be formulated with the following linear program.
-  /// \f[ \sum_{e \in \delta(u)}x_e \le 1 \quad \forall u\in V\f]
-  /** \f[ \sum_{e \in \gamma(B)}x_e \le \frac{\vert B \vert - 1}{2}
-      \quad \forall B\in\mathcal{O}\f] */
-  /// \f[x_e \ge 0\quad \forall e\in E\f]
-  /// \f[\max \sum_{e\in E}x_ew_e\f]
-  /// where \f$\delta(X)\f$ is the set of edges incident to a node in
-  /// \f$X\f$, \f$\gamma(X)\f$ is the set of edges with both ends in
-  /// \f$X\f$ and \f$\mathcal{O}\f$ is the set of odd cardinality
-  /// subsets of the nodes.
-  ///
-  /// The algorithm calculates an optimal matching and a proof of the
-  /// optimality. The solution of the dual problem can be used to check
-  /// the result of the algorithm. The dual linear problem is the
-  /// following.
-  /** \f[ y_u + y_v + \sum_{B \in \mathcal{O}, uv \in \gamma(B)}
-      z_B \ge w_{uv} \quad \forall uv\in E\f] */
-  /// \f[y_u \ge 0 \quad \forall u \in V\f]
-  /// \f[z_B \ge 0 \quad \forall B \in \mathcal{O}\f]
-  /** \f[\min \sum_{u \in V}y_u + \sum_{B \in \mathcal{O}}
-      \frac{\vert B \vert - 1}{2}z_B\f] */
-  ///
-  /// The algorithm can be executed with the run() function. 
-  /// After it the matching (the primal solution) and the dual solution
-  /// can be obtained using the query functions and the 
-  /// \ref MaxWeightedMatching::BlossomIt "BlossomIt" nested class, 
-  /// which is able to iterate on the nodes of a blossom. 
-  /// If the value type is integer, then the dual solution is multiplied
-  /// by \ref MaxWeightedMatching::dualScale "4".
-  ///
-  /// \tparam GR The undirected graph type the algorithm runs on.
-  /// \tparam WM The type edge weight map. The default type is 
-  /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<int>".
-#ifdef DOXYGEN
-  template <typename GR, typename WM>
-#else
-  template <typename GR,
-            typename WM = typename GR::template EdgeMap<int> >
-#endif
-  class MaxWeightedMatching {
-  public:
-
-    /// The graph type of the algorithm
-    typedef GR Graph;
-    /// The type of the edge weight map
-    typedef WM WeightMap;
-    /// The value type of the edge weights
-    typedef typename WeightMap::Value Value;
-
-    /// The type of the matching map
-    typedef typename Graph::template NodeMap<typename Graph::Arc>
-    MatchingMap;
-
-    /// \brief Scaling factor for dual solution
-    ///
-    /// Scaling factor for dual solution. It is equal to 4 or 1
-    /// according to the value type.
-    static const int dualScale =
-      std::numeric_limits<Value>::is_integer ? 4 : 1;
-
-  private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(Graph);
-
-    typedef typename Graph::template NodeMap<Value> NodePotential;
-    typedef std::vector<Node> BlossomNodeList;
-
-    struct BlossomVariable {
-      int begin, end;
-      Value value;
-
-      BlossomVariable(int _begin, int _end, Value _value)
-        : begin(_begin), end(_end), value(_value) {}
-
-    };
-
-    typedef std::vector<BlossomVariable> BlossomPotential;
-
-    const Graph& _graph;
-    const WeightMap& _weight;
-
-    MatchingMap* _matching;
-
-    NodePotential* _node_potential;
-
-    BlossomPotential _blossom_potential;
-    BlossomNodeList _blossom_node_list;
-
-    int _node_num;
-    int _blossom_num;
-
-    typedef RangeMap<int> IntIntMap;
-
-    enum Status {
-      EVEN = -1, MATCHED = 0, ODD = 1, UNMATCHED = -2
-    };
-
-    typedef HeapUnionFind<Value, IntNodeMap> BlossomSet;
-    struct BlossomData {
-      int tree;
-      Status status;
-      Arc pred, next;
-      Value pot, offset;
-      Node base;
-    };
-
-    IntNodeMap *_blossom_index;
-    BlossomSet *_blossom_set;
-    RangeMap<BlossomData>* _blossom_data;
-
-    IntNodeMap *_node_index;
-    IntArcMap *_node_heap_index;
-
-    struct NodeData {
-
-      NodeData(IntArcMap& node_heap_index)
-        : heap(node_heap_index) {}
-
-      int blossom;
-      Value pot;
-      BinHeap<Value, IntArcMap> heap;
-      std::map<int, Arc> heap_index;
-
-      int tree;
-    };
-
-    RangeMap<NodeData>* _node_data;
-
-    typedef ExtendFindEnum<IntIntMap> TreeSet;
-
-    IntIntMap *_tree_set_index;
-    TreeSet *_tree_set;
-
-    IntNodeMap *_delta1_index;
-    BinHeap<Value, IntNodeMap> *_delta1;
-
-    IntIntMap *_delta2_index;
-    BinHeap<Value, IntIntMap> *_delta2;
-
-    IntEdgeMap *_delta3_index;
-    BinHeap<Value, IntEdgeMap> *_delta3;
-
-    IntIntMap *_delta4_index;
-    BinHeap<Value, IntIntMap> *_delta4;
-
-    Value _delta_sum;
-
-    void createStructures() {
-      _node_num = countNodes(_graph);
-      _blossom_num = _node_num * 3 / 2;
-
-      if (!_matching) {
-        _matching = new MatchingMap(_graph);
-      }
-      if (!_node_potential) {
-        _node_potential = new NodePotential(_graph);
-      }
-      if (!_blossom_set) {
-        _blossom_index = new IntNodeMap(_graph);
-        _blossom_set = new BlossomSet(*_blossom_index);
-        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
-      }
-
-      if (!_node_index) {
-        _node_index = new IntNodeMap(_graph);
-        _node_heap_index = new IntArcMap(_graph);
-        _node_data = new RangeMap<NodeData>(_node_num,
-                                              NodeData(*_node_heap_index));
-      }
-
-      if (!_tree_set) {
-        _tree_set_index = new IntIntMap(_blossom_num);
-        _tree_set = new TreeSet(*_tree_set_index);
-      }
-      if (!_delta1) {
-        _delta1_index = new IntNodeMap(_graph);
-        _delta1 = new BinHeap<Value, IntNodeMap>(*_delta1_index);
-      }
-      if (!_delta2) {
-        _delta2_index = new IntIntMap(_blossom_num);
-        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
-      }
-      if (!_delta3) {
-        _delta3_index = new IntEdgeMap(_graph);
-        _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index);
-      }
-      if (!_delta4) {
-        _delta4_index = new IntIntMap(_blossom_num);
-        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
-      }
-    }
-
-    void destroyStructures() {
-      _node_num = countNodes(_graph);
-      _blossom_num = _node_num * 3 / 2;
-
-      if (_matching) {
-        delete _matching;
-      }
-      if (_node_potential) {
-        delete _node_potential;
-      }
-      if (_blossom_set) {
-        delete _blossom_index;
-        delete _blossom_set;
-        delete _blossom_data;
-      }
-
-      if (_node_index) {
-        delete _node_index;
-        delete _node_heap_index;
-        delete _node_data;
-      }
-
-      if (_tree_set) {
-        delete _tree_set_index;
-        delete _tree_set;
-      }
-      if (_delta1) {
-        delete _delta1_index;
-        delete _delta1;
-      }
-      if (_delta2) {
-        delete _delta2_index;
-        delete _delta2;
-      }
-      if (_delta3) {
-        delete _delta3_index;
-        delete _delta3;
-      }
-      if (_delta4) {
-        delete _delta4_index;
-        delete _delta4;
-      }
-    }
-
-    void matchedToEven(int blossom, int tree) {
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-
-      if (!_blossom_set->trivial(blossom)) {
-        (*_blossom_data)[blossom].pot -=
-          2 * (_delta_sum - (*_blossom_data)[blossom].offset);
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-
-        _blossom_set->increase(n, std::numeric_limits<Value>::max());
-        int ni = (*_node_index)[n];
-
-        (*_node_data)[ni].heap.clear();
-        (*_node_data)[ni].heap_index.clear();
-
-        (*_node_data)[ni].pot += _delta_sum - (*_blossom_data)[blossom].offset;
-
-        _delta1->push(n, (*_node_data)[ni].pot);
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if ((*_blossom_data)[vb].status == EVEN) {
-            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
-              _delta3->push(e, rw / 2);
-            }
-          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
-            if (_delta3->state(e) != _delta3->IN_HEAP) {
-              _delta3->push(e, rw);
-            }
-          } else {
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              if ((*_node_data)[vi].heap[it->second] > rw) {
-                (*_node_data)[vi].heap.replace(it->second, e);
-                (*_node_data)[vi].heap.decrease(e, rw);
-                it->second = e;
-              }
-            } else {
-              (*_node_data)[vi].heap.push(e, rw);
-              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
-            }
-
-            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
-              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_delta2->state(vb) != _delta2->IN_HEAP) {
-                  _delta2->push(vb, _blossom_set->classPrio(vb) -
-                               (*_blossom_data)[vb].offset);
-                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset){
-                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-      (*_blossom_data)[blossom].offset = 0;
-    }
-
-    void matchedToOdd(int blossom) {
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-      (*_blossom_data)[blossom].offset += _delta_sum;
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->push(blossom, (*_blossom_data)[blossom].pot / 2 +
-                     (*_blossom_data)[blossom].offset);
-      }
-    }
-
-    void evenToMatched(int blossom, int tree) {
-      if (!_blossom_set->trivial(blossom)) {
-        (*_blossom_data)[blossom].pot += 2 * _delta_sum;
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-        (*_node_data)[ni].pot -= _delta_sum;
-
-        _delta1->erase(n);
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if (vb == blossom) {
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-          } else if ((*_blossom_data)[vb].status == EVEN) {
-
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-
-            int vt = _tree_set->find(vb);
-
-            if (vt != tree) {
-
-              Arc r = _graph.oppositeArc(e);
-
-              typename std::map<int, Arc>::iterator it =
-                (*_node_data)[ni].heap_index.find(vt);
-
-              if (it != (*_node_data)[ni].heap_index.end()) {
-                if ((*_node_data)[ni].heap[it->second] > rw) {
-                  (*_node_data)[ni].heap.replace(it->second, r);
-                  (*_node_data)[ni].heap.decrease(r, rw);
-                  it->second = r;
-                }
-              } else {
-                (*_node_data)[ni].heap.push(r, rw);
-                (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
-              }
-
-              if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
-                _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
-
-                if (_delta2->state(blossom) != _delta2->IN_HEAP) {
-                  _delta2->push(blossom, _blossom_set->classPrio(blossom) -
-                               (*_blossom_data)[blossom].offset);
-                } else if ((*_delta2)[blossom] >
-                           _blossom_set->classPrio(blossom) -
-                           (*_blossom_data)[blossom].offset){
-                  _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
-                                   (*_blossom_data)[blossom].offset);
-                }
-              }
-            }
-
-          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-          } else {
-
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              (*_node_data)[vi].heap.erase(it->second);
-              (*_node_data)[vi].heap_index.erase(it);
-              if ((*_node_data)[vi].heap.empty()) {
-                _blossom_set->increase(v, std::numeric_limits<Value>::max());
-              } else if ((*_blossom_set)[v] < (*_node_data)[vi].heap.prio()) {
-                _blossom_set->increase(v, (*_node_data)[vi].heap.prio());
-              }
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_blossom_set->classPrio(vb) ==
-                    std::numeric_limits<Value>::max()) {
-                  _delta2->erase(vb);
-                } else if ((*_delta2)[vb] < _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset) {
-                  _delta2->increase(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-
-    void oddToMatched(int blossom) {
-      (*_blossom_data)[blossom].offset -= _delta_sum;
-
-      if (_blossom_set->classPrio(blossom) !=
-          std::numeric_limits<Value>::max()) {
-        _delta2->push(blossom, _blossom_set->classPrio(blossom) -
-                       (*_blossom_data)[blossom].offset);
-      }
-
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->erase(blossom);
-      }
-    }
-
-    void oddToEven(int blossom, int tree) {
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->erase(blossom);
-        (*_blossom_data)[blossom].pot -=
-          2 * (2 * _delta_sum - (*_blossom_data)[blossom].offset);
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-
-        _blossom_set->increase(n, std::numeric_limits<Value>::max());
-
-        (*_node_data)[ni].heap.clear();
-        (*_node_data)[ni].heap_index.clear();
-        (*_node_data)[ni].pot +=
-          2 * _delta_sum - (*_blossom_data)[blossom].offset;
-
-        _delta1->push(n, (*_node_data)[ni].pot);
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if ((*_blossom_data)[vb].status == EVEN) {
-            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
-              _delta3->push(e, rw / 2);
-            }
-          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
-            if (_delta3->state(e) != _delta3->IN_HEAP) {
-              _delta3->push(e, rw);
-            }
-          } else {
-
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              if ((*_node_data)[vi].heap[it->second] > rw) {
-                (*_node_data)[vi].heap.replace(it->second, e);
-                (*_node_data)[vi].heap.decrease(e, rw);
-                it->second = e;
-              }
-            } else {
-              (*_node_data)[vi].heap.push(e, rw);
-              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
-            }
-
-            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
-              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_delta2->state(vb) != _delta2->IN_HEAP) {
-                  _delta2->push(vb, _blossom_set->classPrio(vb) -
-                               (*_blossom_data)[vb].offset);
-                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset) {
-                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-      (*_blossom_data)[blossom].offset = 0;
-    }
-
-
-    void matchedToUnmatched(int blossom) {
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-
-        _blossom_set->increase(n, std::numeric_limits<Value>::max());
-
-        (*_node_data)[ni].heap.clear();
-        (*_node_data)[ni].heap_index.clear();
-
-        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.target(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if ((*_blossom_data)[vb].status == EVEN) {
-            if (_delta3->state(e) != _delta3->IN_HEAP) {
-              _delta3->push(e, rw);
-            }
-          }
-        }
-      }
-    }
-
-    void unmatchedToMatched(int blossom) {
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if (vb == blossom) {
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-          } else if ((*_blossom_data)[vb].status == EVEN) {
-
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-
-            int vt = _tree_set->find(vb);
-
-            Arc r = _graph.oppositeArc(e);
-
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[ni].heap_index.find(vt);
-
-            if (it != (*_node_data)[ni].heap_index.end()) {
-              if ((*_node_data)[ni].heap[it->second] > rw) {
-                (*_node_data)[ni].heap.replace(it->second, r);
-                (*_node_data)[ni].heap.decrease(r, rw);
-                it->second = r;
-              }
-            } else {
-              (*_node_data)[ni].heap.push(r, rw);
-              (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
-            }
-
-            if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
-              _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
-
-              if (_delta2->state(blossom) != _delta2->IN_HEAP) {
-                _delta2->push(blossom, _blossom_set->classPrio(blossom) -
-                             (*_blossom_data)[blossom].offset);
-              } else if ((*_delta2)[blossom] > _blossom_set->classPrio(blossom)-
-                         (*_blossom_data)[blossom].offset){
-                _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
-                                 (*_blossom_data)[blossom].offset);
-              }
-            }
-
-          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-          }
-        }
-      }
-    }
-
-    void alternatePath(int even, int tree) {
-      int odd;
-
-      evenToMatched(even, tree);
-      (*_blossom_data)[even].status = MATCHED;
-
-      while ((*_blossom_data)[even].pred != INVALID) {
-        odd = _blossom_set->find(_graph.target((*_blossom_data)[even].pred));
-        (*_blossom_data)[odd].status = MATCHED;
-        oddToMatched(odd);
-        (*_blossom_data)[odd].next = (*_blossom_data)[odd].pred;
-
-        even = _blossom_set->find(_graph.target((*_blossom_data)[odd].pred));
-        (*_blossom_data)[even].status = MATCHED;
-        evenToMatched(even, tree);
-        (*_blossom_data)[even].next =
-          _graph.oppositeArc((*_blossom_data)[odd].pred);
-      }
-
-    }
-
-    void destroyTree(int tree) {
-      for (TreeSet::ItemIt b(*_tree_set, tree); b != INVALID; ++b) {
-        if ((*_blossom_data)[b].status == EVEN) {
-          (*_blossom_data)[b].status = MATCHED;
-          evenToMatched(b, tree);
-        } else if ((*_blossom_data)[b].status == ODD) {
-          (*_blossom_data)[b].status = MATCHED;
-          oddToMatched(b);
-        }
-      }
-      _tree_set->eraseClass(tree);
-    }
-
-
-    void unmatchNode(const Node& node) {
-      int blossom = _blossom_set->find(node);
-      int tree = _tree_set->find(blossom);
-
-      alternatePath(blossom, tree);
-      destroyTree(tree);
-
-      (*_blossom_data)[blossom].status = UNMATCHED;
-      (*_blossom_data)[blossom].base = node;
-      matchedToUnmatched(blossom);
-    }
-
-
-    void augmentOnEdge(const Edge& edge) {
-
-      int left = _blossom_set->find(_graph.u(edge));
-      int right = _blossom_set->find(_graph.v(edge));
-
-      if ((*_blossom_data)[left].status == EVEN) {
-        int left_tree = _tree_set->find(left);
-        alternatePath(left, left_tree);
-        destroyTree(left_tree);
-      } else {
-        (*_blossom_data)[left].status = MATCHED;
-        unmatchedToMatched(left);
-      }
-
-      if ((*_blossom_data)[right].status == EVEN) {
-        int right_tree = _tree_set->find(right);
-        alternatePath(right, right_tree);
-        destroyTree(right_tree);
-      } else {
-        (*_blossom_data)[right].status = MATCHED;
-        unmatchedToMatched(right);
-      }
-
-      (*_blossom_data)[left].next = _graph.direct(edge, true);
-      (*_blossom_data)[right].next = _graph.direct(edge, false);
-    }
-
-    void extendOnArc(const Arc& arc) {
-      int base = _blossom_set->find(_graph.target(arc));
-      int tree = _tree_set->find(base);
-
-      int odd = _blossom_set->find(_graph.source(arc));
-      _tree_set->insert(odd, tree);
-      (*_blossom_data)[odd].status = ODD;
-      matchedToOdd(odd);
-      (*_blossom_data)[odd].pred = arc;
-
-      int even = _blossom_set->find(_graph.target((*_blossom_data)[odd].next));
-      (*_blossom_data)[even].pred = (*_blossom_data)[even].next;
-      _tree_set->insert(even, tree);
-      (*_blossom_data)[even].status = EVEN;
-      matchedToEven(even, tree);
-    }
-
-    void shrinkOnEdge(const Edge& edge, int tree) {
-      int nca = -1;
-      std::vector<int> left_path, right_path;
-
-      {
-        std::set<int> left_set, right_set;
-        int left = _blossom_set->find(_graph.u(edge));
-        left_path.push_back(left);
-        left_set.insert(left);
-
-        int right = _blossom_set->find(_graph.v(edge));
-        right_path.push_back(right);
-        right_set.insert(right);
-
-        while (true) {
-
-          if ((*_blossom_data)[left].pred == INVALID) break;
-
-          left =
-            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
-          left_path.push_back(left);
-          left =
-            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
-          left_path.push_back(left);
-
-          left_set.insert(left);
-
-          if (right_set.find(left) != right_set.end()) {
-            nca = left;
-            break;
-          }
-
-          if ((*_blossom_data)[right].pred == INVALID) break;
-
-          right =
-            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
-          right_path.push_back(right);
-          right =
-            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
-          right_path.push_back(right);
-
-          right_set.insert(right);
-
-          if (left_set.find(right) != left_set.end()) {
-            nca = right;
-            break;
-          }
-
-        }
-
-        if (nca == -1) {
-          if ((*_blossom_data)[left].pred == INVALID) {
-            nca = right;
-            while (left_set.find(nca) == left_set.end()) {
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              right_path.push_back(nca);
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              right_path.push_back(nca);
-            }
-          } else {
-            nca = left;
-            while (right_set.find(nca) == right_set.end()) {
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              left_path.push_back(nca);
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              left_path.push_back(nca);
-            }
-          }
-        }
-      }
-
-      std::vector<int> subblossoms;
-      Arc prev;
-
-      prev = _graph.direct(edge, true);
-      for (int i = 0; left_path[i] != nca; i += 2) {
-        subblossoms.push_back(left_path[i]);
-        (*_blossom_data)[left_path[i]].next = prev;
-        _tree_set->erase(left_path[i]);
-
-        subblossoms.push_back(left_path[i + 1]);
-        (*_blossom_data)[left_path[i + 1]].status = EVEN;
-        oddToEven(left_path[i + 1], tree);
-        _tree_set->erase(left_path[i + 1]);
-        prev = _graph.oppositeArc((*_blossom_data)[left_path[i + 1]].pred);
-      }
-
-      int k = 0;
-      while (right_path[k] != nca) ++k;
-
-      subblossoms.push_back(nca);
-      (*_blossom_data)[nca].next = prev;
-
-      for (int i = k - 2; i >= 0; i -= 2) {
-        subblossoms.push_back(right_path[i + 1]);
-        (*_blossom_data)[right_path[i + 1]].status = EVEN;
-        oddToEven(right_path[i + 1], tree);
-        _tree_set->erase(right_path[i + 1]);
-
-        (*_blossom_data)[right_path[i + 1]].next =
-          (*_blossom_data)[right_path[i + 1]].pred;
-
-        subblossoms.push_back(right_path[i]);
-        _tree_set->erase(right_path[i]);
-      }
-
-      int surface =
-        _blossom_set->join(subblossoms.begin(), subblossoms.end());
-
-      for (int i = 0; i < int(subblossoms.size()); ++i) {
-        if (!_blossom_set->trivial(subblossoms[i])) {
-          (*_blossom_data)[subblossoms[i]].pot += 2 * _delta_sum;
-        }
-        (*_blossom_data)[subblossoms[i]].status = MATCHED;
-      }
-
-      (*_blossom_data)[surface].pot = -2 * _delta_sum;
-      (*_blossom_data)[surface].offset = 0;
-      (*_blossom_data)[surface].status = EVEN;
-      (*_blossom_data)[surface].pred = (*_blossom_data)[nca].pred;
-      (*_blossom_data)[surface].next = (*_blossom_data)[nca].pred;
-
-      _tree_set->insert(surface, tree);
-      _tree_set->erase(nca);
-    }
-
-    void splitBlossom(int blossom) {
-      Arc next = (*_blossom_data)[blossom].next;
-      Arc pred = (*_blossom_data)[blossom].pred;
-
-      int tree = _tree_set->find(blossom);
-
-      (*_blossom_data)[blossom].status = MATCHED;
-      oddToMatched(blossom);
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-
-      std::vector<int> subblossoms;
-      _blossom_set->split(blossom, std::back_inserter(subblossoms));
-
-      Value offset = (*_blossom_data)[blossom].offset;
-      int b = _blossom_set->find(_graph.source(pred));
-      int d = _blossom_set->find(_graph.source(next));
-
-      int ib = -1, id = -1;
-      for (int i = 0; i < int(subblossoms.size()); ++i) {
-        if (subblossoms[i] == b) ib = i;
-        if (subblossoms[i] == d) id = i;
-
-        (*_blossom_data)[subblossoms[i]].offset = offset;
-        if (!_blossom_set->trivial(subblossoms[i])) {
-          (*_blossom_data)[subblossoms[i]].pot -= 2 * offset;
-        }
-        if (_blossom_set->classPrio(subblossoms[i]) !=
-            std::numeric_limits<Value>::max()) {
-          _delta2->push(subblossoms[i],
-                        _blossom_set->classPrio(subblossoms[i]) -
-                        (*_blossom_data)[subblossoms[i]].offset);
-        }
-      }
-
-      if (id > ib ? ((id - ib) % 2 == 0) : ((ib - id) % 2 == 1)) {
-        for (int i = (id + 1) % subblossoms.size();
-             i != ib; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          (*_blossom_data)[sb].next =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-        }
-
-        for (int i = ib; i != id; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          int ub = subblossoms[(i + 2) % subblossoms.size()];
-
-          (*_blossom_data)[sb].status = ODD;
-          matchedToOdd(sb);
-          _tree_set->insert(sb, tree);
-          (*_blossom_data)[sb].pred = pred;
-          (*_blossom_data)[sb].next =
-                           _graph.oppositeArc((*_blossom_data)[tb].next);
-
-          pred = (*_blossom_data)[ub].next;
-
-          (*_blossom_data)[tb].status = EVEN;
-          matchedToEven(tb, tree);
-          _tree_set->insert(tb, tree);
-          (*_blossom_data)[tb].pred = (*_blossom_data)[tb].next;
-        }
-
-        (*_blossom_data)[subblossoms[id]].status = ODD;
-        matchedToOdd(subblossoms[id]);
-        _tree_set->insert(subblossoms[id], tree);
-        (*_blossom_data)[subblossoms[id]].next = next;
-        (*_blossom_data)[subblossoms[id]].pred = pred;
-
-      } else {
-
-        for (int i = (ib + 1) % subblossoms.size();
-             i != id; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          (*_blossom_data)[sb].next =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-        }
-
-        for (int i = id; i != ib; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          int ub = subblossoms[(i + 2) % subblossoms.size()];
-
-          (*_blossom_data)[sb].status = ODD;
-          matchedToOdd(sb);
-          _tree_set->insert(sb, tree);
-          (*_blossom_data)[sb].next = next;
-          (*_blossom_data)[sb].pred =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-
-          (*_blossom_data)[tb].status = EVEN;
-          matchedToEven(tb, tree);
-          _tree_set->insert(tb, tree);
-          (*_blossom_data)[tb].pred =
-            (*_blossom_data)[tb].next =
-            _graph.oppositeArc((*_blossom_data)[ub].next);
-          next = (*_blossom_data)[ub].next;
-        }
-
-        (*_blossom_data)[subblossoms[ib]].status = ODD;
-        matchedToOdd(subblossoms[ib]);
-        _tree_set->insert(subblossoms[ib], tree);
-        (*_blossom_data)[subblossoms[ib]].next = next;
-        (*_blossom_data)[subblossoms[ib]].pred = pred;
-      }
-      _tree_set->erase(blossom);
-    }
-
-    void extractBlossom(int blossom, const Node& base, const Arc& matching) {
-      if (_blossom_set->trivial(blossom)) {
-        int bi = (*_node_index)[base];
-        Value pot = (*_node_data)[bi].pot;
-
-        (*_matching)[base] = matching;
-        _blossom_node_list.push_back(base);
-        (*_node_potential)[base] = pot;
-      } else {
-
-        Value pot = (*_blossom_data)[blossom].pot;
-        int bn = _blossom_node_list.size();
-
-        std::vector<int> subblossoms;
-        _blossom_set->split(blossom, std::back_inserter(subblossoms));
-        int b = _blossom_set->find(base);
-        int ib = -1;
-        for (int i = 0; i < int(subblossoms.size()); ++i) {
-          if (subblossoms[i] == b) { ib = i; break; }
-        }
-
-        for (int i = 1; i < int(subblossoms.size()); i += 2) {
-          int sb = subblossoms[(ib + i) % subblossoms.size()];
-          int tb = subblossoms[(ib + i + 1) % subblossoms.size()];
-
-          Arc m = (*_blossom_data)[tb].next;
-          extractBlossom(sb, _graph.target(m), _graph.oppositeArc(m));
-          extractBlossom(tb, _graph.source(m), m);
-        }
-        extractBlossom(subblossoms[ib], base, matching);
-
-        int en = _blossom_node_list.size();
-
-        _blossom_potential.push_back(BlossomVariable(bn, en, pot));
-      }
-    }
-
-    void extractMatching() {
-      std::vector<int> blossoms;
-      for (typename BlossomSet::ClassIt c(*_blossom_set); c != INVALID; ++c) {
-        blossoms.push_back(c);
-      }
-
-      for (int i = 0; i < int(blossoms.size()); ++i) {
-        if ((*_blossom_data)[blossoms[i]].status == MATCHED) {
-
-          Value offset = (*_blossom_data)[blossoms[i]].offset;
-          (*_blossom_data)[blossoms[i]].pot += 2 * offset;
-          for (typename BlossomSet::ItemIt n(*_blossom_set, blossoms[i]);
-               n != INVALID; ++n) {
-            (*_node_data)[(*_node_index)[n]].pot -= offset;
-          }
-
-          Arc matching = (*_blossom_data)[blossoms[i]].next;
-          Node base = _graph.source(matching);
-          extractBlossom(blossoms[i], base, matching);
-        } else {
-          Node base = (*_blossom_data)[blossoms[i]].base;
-          extractBlossom(blossoms[i], base, INVALID);
-        }
-      }
-    }
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Constructor.
-    MaxWeightedMatching(const Graph& graph, const WeightMap& weight)
-      : _graph(graph), _weight(weight), _matching(0),
-        _node_potential(0), _blossom_potential(), _blossom_node_list(),
-        _node_num(0), _blossom_num(0),
-
-        _blossom_index(0), _blossom_set(0), _blossom_data(0),
-        _node_index(0), _node_heap_index(0), _node_data(0),
-        _tree_set_index(0), _tree_set(0),
-
-        _delta1_index(0), _delta1(0),
-        _delta2_index(0), _delta2(0),
-        _delta3_index(0), _delta3(0),
-        _delta4_index(0), _delta4(0),
-
-        _delta_sum() {}
-
-    ~MaxWeightedMatching() {
-      destroyStructures();
-    }
-
-    /// \name Execution Control
-    /// The simplest way to execute the algorithm is to use the
-    /// \ref run() member function.
-
-    ///@{
-
-    /// \brief Initialize the algorithm
-    ///
-    /// This function initializes the algorithm.
-    void init() {
-      createStructures();
-
-      for (ArcIt e(_graph); e != INVALID; ++e) {
-        (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP;
-      }
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_delta1_index)[n] = _delta1->PRE_HEAP;
-      }
-      for (EdgeIt e(_graph); e != INVALID; ++e) {
-        (*_delta3_index)[e] = _delta3->PRE_HEAP;
-      }
-      for (int i = 0; i < _blossom_num; ++i) {
-        (*_delta2_index)[i] = _delta2->PRE_HEAP;
-        (*_delta4_index)[i] = _delta4->PRE_HEAP;
-      }
-
-      int index = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        Value max = 0;
-        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
-          if (_graph.target(e) == n) continue;
-          if ((dualScale * _weight[e]) / 2 > max) {
-            max = (dualScale * _weight[e]) / 2;
-          }
-        }
-        (*_node_index)[n] = index;
-        (*_node_data)[index].pot = max;
-        _delta1->push(n, max);
-        int blossom =
-          _blossom_set->insert(n, std::numeric_limits<Value>::max());
-
-        _tree_set->insert(blossom);
-
-        (*_blossom_data)[blossom].status = EVEN;
-        (*_blossom_data)[blossom].pred = INVALID;
-        (*_blossom_data)[blossom].next = INVALID;
-        (*_blossom_data)[blossom].pot = 0;
-        (*_blossom_data)[blossom].offset = 0;
-        ++index;
-      }
-      for (EdgeIt e(_graph); e != INVALID; ++e) {
-        int si = (*_node_index)[_graph.u(e)];
-        int ti = (*_node_index)[_graph.v(e)];
-        if (_graph.u(e) != _graph.v(e)) {
-          _delta3->push(e, ((*_node_data)[si].pot + (*_node_data)[ti].pot -
-                            dualScale * _weight[e]) / 2);
-        }
-      }
-    }
-
-    /// \brief Start the algorithm
-    ///
-    /// This function starts the algorithm.
-    ///
-    /// \pre \ref init() must be called before using this function.
-    void start() {
-      enum OpType {
-        D1, D2, D3, D4
-      };
-
-      int unmatched = _node_num;
-      while (unmatched > 0) {
-        Value d1 = !_delta1->empty() ?
-          _delta1->prio() : std::numeric_limits<Value>::max();
-
-        Value d2 = !_delta2->empty() ?
-          _delta2->prio() : std::numeric_limits<Value>::max();
-
-        Value d3 = !_delta3->empty() ?
-          _delta3->prio() : std::numeric_limits<Value>::max();
-
-        Value d4 = !_delta4->empty() ?
-          _delta4->prio() : std::numeric_limits<Value>::max();
-
-        _delta_sum = d1; OpType ot = D1;
-        if (d2 < _delta_sum) { _delta_sum = d2; ot = D2; }
-        if (d3 < _delta_sum) { _delta_sum = d3; ot = D3; }
-        if (d4 < _delta_sum) { _delta_sum = d4; ot = D4; }
-
-
-        switch (ot) {
-        case D1:
-          {
-            Node n = _delta1->top();
-            unmatchNode(n);
-            --unmatched;
-          }
-          break;
-        case D2:
-          {
-            int blossom = _delta2->top();
-            Node n = _blossom_set->classTop(blossom);
-            Arc e = (*_node_data)[(*_node_index)[n]].heap.top();
-            extendOnArc(e);
-          }
-          break;
-        case D3:
-          {
-            Edge e = _delta3->top();
-
-            int left_blossom = _blossom_set->find(_graph.u(e));
-            int right_blossom = _blossom_set->find(_graph.v(e));
-
-            if (left_blossom == right_blossom) {
-              _delta3->pop();
-            } else {
-              int left_tree;
-              if ((*_blossom_data)[left_blossom].status == EVEN) {
-                left_tree = _tree_set->find(left_blossom);
-              } else {
-                left_tree = -1;
-                ++unmatched;
-              }
-              int right_tree;
-              if ((*_blossom_data)[right_blossom].status == EVEN) {
-                right_tree = _tree_set->find(right_blossom);
-              } else {
-                right_tree = -1;
-                ++unmatched;
-              }
-
-              if (left_tree == right_tree) {
-                shrinkOnEdge(e, left_tree);
-              } else {
-                augmentOnEdge(e);
-                unmatched -= 2;
-              }
-            }
-          } break;
-        case D4:
-          splitBlossom(_delta4->top());
-          break;
-        }
-      }
-      extractMatching();
-    }
-
-    /// \brief Run the algorithm.
-    ///
-    /// This method runs the \c %MaxWeightedMatching algorithm.
-    ///
-    /// \note mwm.run() is just a shortcut of the following code.
-    /// \code
-    ///   mwm.init();
-    ///   mwm.start();
-    /// \endcode
-    void run() {
-      init();
-      start();
-    }
-
-    /// @}
-
-    /// \name Primal Solution
-    /// Functions to get the primal solution, i.e. the maximum weighted 
-    /// matching.\n
-    /// Either \ref run() or \ref start() function should be called before
-    /// using them.
-
-    /// @{
-
-    /// \brief Return the weight of the matching.
-    ///
-    /// This function returns the weight of the found matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value matchingWeight() const {
-      Value sum = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_matching)[n] != INVALID) {
-          sum += _weight[(*_matching)[n]];
-        }
-      }
-      return sum /= 2;
-    }
-
-    /// \brief Return the size (cardinality) of the matching.
-    ///
-    /// This function returns the size (cardinality) of the found matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    int matchingSize() const {
-      int num = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_matching)[n] != INVALID) {
-          ++num;
-        }
-      }
-      return num /= 2;
-    }
-
-    /// \brief Return \c true if the given edge is in the matching.
-    ///
-    /// This function returns \c true if the given edge is in the found 
-    /// matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    bool matching(const Edge& edge) const {
-      return edge == (*_matching)[_graph.u(edge)];
-    }
-
-    /// \brief Return the matching arc (or edge) incident to the given node.
-    ///
-    /// This function returns the matching arc (or edge) incident to the
-    /// given node in the found matching or \c INVALID if the node is 
-    /// not covered by the matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Arc matching(const Node& node) const {
-      return (*_matching)[node];
-    }
-
-    /// \brief Return a const reference to the matching map.
-    ///
-    /// This function returns a const reference to a node map that stores
-    /// the matching arc (or edge) incident to each node.
-    const MatchingMap& matchingMap() const {
-      return *_matching;
-    }
-
-    /// \brief Return the mate of the given node.
-    ///
-    /// This function returns the mate of the given node in the found 
-    /// matching or \c INVALID if the node is not covered by the matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Node mate(const Node& node) const {
-      return (*_matching)[node] != INVALID ?
-        _graph.target((*_matching)[node]) : INVALID;
-    }
-
-    /// @}
-
-    /// \name Dual Solution
-    /// Functions to get the dual solution.\n
-    /// Either \ref run() or \ref start() function should be called before
-    /// using them.
-
-    /// @{
-
-    /// \brief Return the value of the dual solution.
-    ///
-    /// This function returns the value of the dual solution. 
-    /// It should be equal to the primal value scaled by \ref dualScale 
-    /// "dual scale".
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value dualValue() const {
-      Value sum = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        sum += nodeValue(n);
-      }
-      for (int i = 0; i < blossomNum(); ++i) {
-        sum += blossomValue(i) * (blossomSize(i) / 2);
-      }
-      return sum;
-    }
-
-    /// \brief Return the dual value (potential) of the given node.
-    ///
-    /// This function returns the dual value (potential) of the given node.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value nodeValue(const Node& n) const {
-      return (*_node_potential)[n];
-    }
-
-    /// \brief Return the number of the blossoms in the basis.
-    ///
-    /// This function returns the number of the blossoms in the basis.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    /// \see BlossomIt
-    int blossomNum() const {
-      return _blossom_potential.size();
-    }
-
-    /// \brief Return the number of the nodes in the given blossom.
-    ///
-    /// This function returns the number of the nodes in the given blossom.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    /// \see BlossomIt
-    int blossomSize(int k) const {
-      return _blossom_potential[k].end - _blossom_potential[k].begin;
-    }
-
-    /// \brief Return the dual value (ptential) of the given blossom.
-    ///
-    /// This function returns the dual value (ptential) of the given blossom.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value blossomValue(int k) const {
-      return _blossom_potential[k].value;
-    }
-
-    /// \brief Iterator for obtaining the nodes of a blossom.
-    ///
-    /// This class provides an iterator for obtaining the nodes of the 
-    /// given blossom. It lists a subset of the nodes.
-    /// Before using this iterator, you must allocate a 
-    /// MaxWeightedMatching class and execute it.
-    class BlossomIt {
-    public:
-
-      /// \brief Constructor.
-      ///
-      /// Constructor to get the nodes of the given variable.
-      ///
-      /// \pre Either \ref MaxWeightedMatching::run() "algorithm.run()" or 
-      /// \ref MaxWeightedMatching::start() "algorithm.start()" must be 
-      /// called before initializing this iterator.
-      BlossomIt(const MaxWeightedMatching& algorithm, int variable)
-        : _algorithm(&algorithm)
-      {
-        _index = _algorithm->_blossom_potential[variable].begin;
-        _last = _algorithm->_blossom_potential[variable].end;
-      }
-
-      /// \brief Conversion to \c Node.
-      ///
-      /// Conversion to \c Node.
-      operator Node() const {
-        return _algorithm->_blossom_node_list[_index];
-      }
-
-      /// \brief Increment operator.
-      ///
-      /// Increment operator.
-      BlossomIt& operator++() {
-        ++_index;
-        return *this;
-      }
-
-      /// \brief Validity checking
-      ///
-      /// Checks whether the iterator is invalid.
-      bool operator==(Invalid) const { return _index == _last; }
-
-      /// \brief Validity checking
-      ///
-      /// Checks whether the iterator is valid.
-      bool operator!=(Invalid) const { return _index != _last; }
-
-    private:
-      const MaxWeightedMatching* _algorithm;
-      int _last;
-      int _index;
-    };
-
-    /// @}
-
-  };
-
-  /// \ingroup matching
-  ///
-  /// \brief Weighted perfect matching in general graphs
-  ///
-  /// This class provides an efficient implementation of Edmond's
-  /// maximum weighted perfect matching algorithm. The implementation
-  /// is based on extensive use of priority queues and provides
-  /// \f$O(nm\log n)\f$ time complexity.
-  ///
-  /// The maximum weighted perfect matching problem is to find a subset of 
-  /// the edges in an undirected graph with maximum overall weight for which 
-  /// each node has exactly one incident edge.
-  /// It can be formulated with the following linear program.
-  /// \f[ \sum_{e \in \delta(u)}x_e = 1 \quad \forall u\in V\f]
-  /** \f[ \sum_{e \in \gamma(B)}x_e \le \frac{\vert B \vert - 1}{2}
-      \quad \forall B\in\mathcal{O}\f] */
-  /// \f[x_e \ge 0\quad \forall e\in E\f]
-  /// \f[\max \sum_{e\in E}x_ew_e\f]
-  /// where \f$\delta(X)\f$ is the set of edges incident to a node in
-  /// \f$X\f$, \f$\gamma(X)\f$ is the set of edges with both ends in
-  /// \f$X\f$ and \f$\mathcal{O}\f$ is the set of odd cardinality
-  /// subsets of the nodes.
-  ///
-  /// The algorithm calculates an optimal matching and a proof of the
-  /// optimality. The solution of the dual problem can be used to check
-  /// the result of the algorithm. The dual linear problem is the
-  /// following.
-  /** \f[ y_u + y_v + \sum_{B \in \mathcal{O}, uv \in \gamma(B)}z_B \ge
-      w_{uv} \quad \forall uv\in E\f] */
-  /// \f[z_B \ge 0 \quad \forall B \in \mathcal{O}\f]
-  /** \f[\min \sum_{u \in V}y_u + \sum_{B \in \mathcal{O}}
-      \frac{\vert B \vert - 1}{2}z_B\f] */
-  ///
-  /// The algorithm can be executed with the run() function. 
-  /// After it the matching (the primal solution) and the dual solution
-  /// can be obtained using the query functions and the 
-  /// \ref MaxWeightedPerfectMatching::BlossomIt "BlossomIt" nested class, 
-  /// which is able to iterate on the nodes of a blossom. 
-  /// If the value type is integer, then the dual solution is multiplied
-  /// by \ref MaxWeightedMatching::dualScale "4".
-  ///
-  /// \tparam GR The undirected graph type the algorithm runs on.
-  /// \tparam WM The type edge weight map. The default type is 
-  /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<int>".
-#ifdef DOXYGEN
-  template <typename GR, typename WM>
-#else
-  template <typename GR,
-            typename WM = typename GR::template EdgeMap<int> >
-#endif
-  class MaxWeightedPerfectMatching {
-  public:
-
-    /// The graph type of the algorithm
-    typedef GR Graph;
-    /// The type of the edge weight map
-    typedef WM WeightMap;
-    /// The value type of the edge weights
-    typedef typename WeightMap::Value Value;
-
-    /// \brief Scaling factor for dual solution
-    ///
-    /// Scaling factor for dual solution, it is equal to 4 or 1
-    /// according to the value type.
-    static const int dualScale =
-      std::numeric_limits<Value>::is_integer ? 4 : 1;
-
-    /// The type of the matching map
-    typedef typename Graph::template NodeMap<typename Graph::Arc>
-    MatchingMap;
-
-  private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(Graph);
-
-    typedef typename Graph::template NodeMap<Value> NodePotential;
-    typedef std::vector<Node> BlossomNodeList;
-
-    struct BlossomVariable {
-      int begin, end;
-      Value value;
-
-      BlossomVariable(int _begin, int _end, Value _value)
-        : begin(_begin), end(_end), value(_value) {}
-
-    };
-
-    typedef std::vector<BlossomVariable> BlossomPotential;
-
-    const Graph& _graph;
-    const WeightMap& _weight;
-
-    MatchingMap* _matching;
-
-    NodePotential* _node_potential;
-
-    BlossomPotential _blossom_potential;
-    BlossomNodeList _blossom_node_list;
-
-    int _node_num;
-    int _blossom_num;
-
-    typedef RangeMap<int> IntIntMap;
-
-    enum Status {
-      EVEN = -1, MATCHED = 0, ODD = 1
-    };
-
-    typedef HeapUnionFind<Value, IntNodeMap> BlossomSet;
-    struct BlossomData {
-      int tree;
-      Status status;
-      Arc pred, next;
-      Value pot, offset;
-    };
-
-    IntNodeMap *_blossom_index;
-    BlossomSet *_blossom_set;
-    RangeMap<BlossomData>* _blossom_data;
-
-    IntNodeMap *_node_index;
-    IntArcMap *_node_heap_index;
-
-    struct NodeData {
-
-      NodeData(IntArcMap& node_heap_index)
-        : heap(node_heap_index) {}
-
-      int blossom;
-      Value pot;
-      BinHeap<Value, IntArcMap> heap;
-      std::map<int, Arc> heap_index;
-
-      int tree;
-    };
-
-    RangeMap<NodeData>* _node_data;
-
-    typedef ExtendFindEnum<IntIntMap> TreeSet;
-
-    IntIntMap *_tree_set_index;
-    TreeSet *_tree_set;
-
-    IntIntMap *_delta2_index;
-    BinHeap<Value, IntIntMap> *_delta2;
-
-    IntEdgeMap *_delta3_index;
-    BinHeap<Value, IntEdgeMap> *_delta3;
-
-    IntIntMap *_delta4_index;
-    BinHeap<Value, IntIntMap> *_delta4;
-
-    Value _delta_sum;
-
-    void createStructures() {
-      _node_num = countNodes(_graph);
-      _blossom_num = _node_num * 3 / 2;
-
-      if (!_matching) {
-        _matching = new MatchingMap(_graph);
-      }
-      if (!_node_potential) {
-        _node_potential = new NodePotential(_graph);
-      }
-      if (!_blossom_set) {
-        _blossom_index = new IntNodeMap(_graph);
-        _blossom_set = new BlossomSet(*_blossom_index);
-        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
-      }
-
-      if (!_node_index) {
-        _node_index = new IntNodeMap(_graph);
-        _node_heap_index = new IntArcMap(_graph);
-        _node_data = new RangeMap<NodeData>(_node_num,
-                                            NodeData(*_node_heap_index));
-      }
-
-      if (!_tree_set) {
-        _tree_set_index = new IntIntMap(_blossom_num);
-        _tree_set = new TreeSet(*_tree_set_index);
-      }
-      if (!_delta2) {
-        _delta2_index = new IntIntMap(_blossom_num);
-        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
-      }
-      if (!_delta3) {
-        _delta3_index = new IntEdgeMap(_graph);
-        _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index);
-      }
-      if (!_delta4) {
-        _delta4_index = new IntIntMap(_blossom_num);
-        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
-      }
-    }
-
-    void destroyStructures() {
-      _node_num = countNodes(_graph);
-      _blossom_num = _node_num * 3 / 2;
-
-      if (_matching) {
-        delete _matching;
-      }
-      if (_node_potential) {
-        delete _node_potential;
-      }
-      if (_blossom_set) {
-        delete _blossom_index;
-        delete _blossom_set;
-        delete _blossom_data;
-      }
-
-      if (_node_index) {
-        delete _node_index;
-        delete _node_heap_index;
-        delete _node_data;
-      }
-
-      if (_tree_set) {
-        delete _tree_set_index;
-        delete _tree_set;
-      }
-      if (_delta2) {
-        delete _delta2_index;
-        delete _delta2;
-      }
-      if (_delta3) {
-        delete _delta3_index;
-        delete _delta3;
-      }
-      if (_delta4) {
-        delete _delta4_index;
-        delete _delta4;
-      }
-    }
-
-    void matchedToEven(int blossom, int tree) {
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-
-      if (!_blossom_set->trivial(blossom)) {
-        (*_blossom_data)[blossom].pot -=
-          2 * (_delta_sum - (*_blossom_data)[blossom].offset);
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-
-        _blossom_set->increase(n, std::numeric_limits<Value>::max());
-        int ni = (*_node_index)[n];
-
-        (*_node_data)[ni].heap.clear();
-        (*_node_data)[ni].heap_index.clear();
-
-        (*_node_data)[ni].pot += _delta_sum - (*_blossom_data)[blossom].offset;
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if ((*_blossom_data)[vb].status == EVEN) {
-            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
-              _delta3->push(e, rw / 2);
-            }
-          } else {
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              if ((*_node_data)[vi].heap[it->second] > rw) {
-                (*_node_data)[vi].heap.replace(it->second, e);
-                (*_node_data)[vi].heap.decrease(e, rw);
-                it->second = e;
-              }
-            } else {
-              (*_node_data)[vi].heap.push(e, rw);
-              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
-            }
-
-            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
-              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_delta2->state(vb) != _delta2->IN_HEAP) {
-                  _delta2->push(vb, _blossom_set->classPrio(vb) -
-                               (*_blossom_data)[vb].offset);
-                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset){
-                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-      (*_blossom_data)[blossom].offset = 0;
-    }
-
-    void matchedToOdd(int blossom) {
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-      (*_blossom_data)[blossom].offset += _delta_sum;
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->push(blossom, (*_blossom_data)[blossom].pot / 2 +
-                     (*_blossom_data)[blossom].offset);
-      }
-    }
-
-    void evenToMatched(int blossom, int tree) {
-      if (!_blossom_set->trivial(blossom)) {
-        (*_blossom_data)[blossom].pot += 2 * _delta_sum;
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-        (*_node_data)[ni].pot -= _delta_sum;
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if (vb == blossom) {
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-          } else if ((*_blossom_data)[vb].status == EVEN) {
-
-            if (_delta3->state(e) == _delta3->IN_HEAP) {
-              _delta3->erase(e);
-            }
-
-            int vt = _tree_set->find(vb);
-
-            if (vt != tree) {
-
-              Arc r = _graph.oppositeArc(e);
-
-              typename std::map<int, Arc>::iterator it =
-                (*_node_data)[ni].heap_index.find(vt);
-
-              if (it != (*_node_data)[ni].heap_index.end()) {
-                if ((*_node_data)[ni].heap[it->second] > rw) {
-                  (*_node_data)[ni].heap.replace(it->second, r);
-                  (*_node_data)[ni].heap.decrease(r, rw);
-                  it->second = r;
-                }
-              } else {
-                (*_node_data)[ni].heap.push(r, rw);
-                (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
-              }
-
-              if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
-                _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
-
-                if (_delta2->state(blossom) != _delta2->IN_HEAP) {
-                  _delta2->push(blossom, _blossom_set->classPrio(blossom) -
-                               (*_blossom_data)[blossom].offset);
-                } else if ((*_delta2)[blossom] >
-                           _blossom_set->classPrio(blossom) -
-                           (*_blossom_data)[blossom].offset){
-                  _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
-                                   (*_blossom_data)[blossom].offset);
-                }
-              }
-            }
-          } else {
-
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              (*_node_data)[vi].heap.erase(it->second);
-              (*_node_data)[vi].heap_index.erase(it);
-              if ((*_node_data)[vi].heap.empty()) {
-                _blossom_set->increase(v, std::numeric_limits<Value>::max());
-              } else if ((*_blossom_set)[v] < (*_node_data)[vi].heap.prio()) {
-                _blossom_set->increase(v, (*_node_data)[vi].heap.prio());
-              }
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_blossom_set->classPrio(vb) ==
-                    std::numeric_limits<Value>::max()) {
-                  _delta2->erase(vb);
-                } else if ((*_delta2)[vb] < _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset) {
-                  _delta2->increase(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-
-    void oddToMatched(int blossom) {
-      (*_blossom_data)[blossom].offset -= _delta_sum;
-
-      if (_blossom_set->classPrio(blossom) !=
-          std::numeric_limits<Value>::max()) {
-        _delta2->push(blossom, _blossom_set->classPrio(blossom) -
-                       (*_blossom_data)[blossom].offset);
-      }
-
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->erase(blossom);
-      }
-    }
-
-    void oddToEven(int blossom, int tree) {
-      if (!_blossom_set->trivial(blossom)) {
-        _delta4->erase(blossom);
-        (*_blossom_data)[blossom].pot -=
-          2 * (2 * _delta_sum - (*_blossom_data)[blossom].offset);
-      }
-
-      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
-           n != INVALID; ++n) {
-        int ni = (*_node_index)[n];
-
-        _blossom_set->increase(n, std::numeric_limits<Value>::max());
-
-        (*_node_data)[ni].heap.clear();
-        (*_node_data)[ni].heap_index.clear();
-        (*_node_data)[ni].pot +=
-          2 * _delta_sum - (*_blossom_data)[blossom].offset;
-
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Node v = _graph.source(e);
-          int vb = _blossom_set->find(v);
-          int vi = (*_node_index)[v];
-
-          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
-            dualScale * _weight[e];
-
-          if ((*_blossom_data)[vb].status == EVEN) {
-            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
-              _delta3->push(e, rw / 2);
-            }
-          } else {
-
-            typename std::map<int, Arc>::iterator it =
-              (*_node_data)[vi].heap_index.find(tree);
-
-            if (it != (*_node_data)[vi].heap_index.end()) {
-              if ((*_node_data)[vi].heap[it->second] > rw) {
-                (*_node_data)[vi].heap.replace(it->second, e);
-                (*_node_data)[vi].heap.decrease(e, rw);
-                it->second = e;
-              }
-            } else {
-              (*_node_data)[vi].heap.push(e, rw);
-              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
-            }
-
-            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
-              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
-
-              if ((*_blossom_data)[vb].status == MATCHED) {
-                if (_delta2->state(vb) != _delta2->IN_HEAP) {
-                  _delta2->push(vb, _blossom_set->classPrio(vb) -
-                               (*_blossom_data)[vb].offset);
-                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
-                           (*_blossom_data)[vb].offset) {
-                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
-                                   (*_blossom_data)[vb].offset);
-                }
-              }
-            }
-          }
-        }
-      }
-      (*_blossom_data)[blossom].offset = 0;
-    }
-
-    void alternatePath(int even, int tree) {
-      int odd;
-
-      evenToMatched(even, tree);
-      (*_blossom_data)[even].status = MATCHED;
-
-      while ((*_blossom_data)[even].pred != INVALID) {
-        odd = _blossom_set->find(_graph.target((*_blossom_data)[even].pred));
-        (*_blossom_data)[odd].status = MATCHED;
-        oddToMatched(odd);
-        (*_blossom_data)[odd].next = (*_blossom_data)[odd].pred;
-
-        even = _blossom_set->find(_graph.target((*_blossom_data)[odd].pred));
-        (*_blossom_data)[even].status = MATCHED;
-        evenToMatched(even, tree);
-        (*_blossom_data)[even].next =
-          _graph.oppositeArc((*_blossom_data)[odd].pred);
-      }
-
-    }
-
-    void destroyTree(int tree) {
-      for (TreeSet::ItemIt b(*_tree_set, tree); b != INVALID; ++b) {
-        if ((*_blossom_data)[b].status == EVEN) {
-          (*_blossom_data)[b].status = MATCHED;
-          evenToMatched(b, tree);
-        } else if ((*_blossom_data)[b].status == ODD) {
-          (*_blossom_data)[b].status = MATCHED;
-          oddToMatched(b);
-        }
-      }
-      _tree_set->eraseClass(tree);
-    }
-
-    void augmentOnEdge(const Edge& edge) {
-
-      int left = _blossom_set->find(_graph.u(edge));
-      int right = _blossom_set->find(_graph.v(edge));
-
-      int left_tree = _tree_set->find(left);
-      alternatePath(left, left_tree);
-      destroyTree(left_tree);
-
-      int right_tree = _tree_set->find(right);
-      alternatePath(right, right_tree);
-      destroyTree(right_tree);
-
-      (*_blossom_data)[left].next = _graph.direct(edge, true);
-      (*_blossom_data)[right].next = _graph.direct(edge, false);
-    }
-
-    void extendOnArc(const Arc& arc) {
-      int base = _blossom_set->find(_graph.target(arc));
-      int tree = _tree_set->find(base);
-
-      int odd = _blossom_set->find(_graph.source(arc));
-      _tree_set->insert(odd, tree);
-      (*_blossom_data)[odd].status = ODD;
-      matchedToOdd(odd);
-      (*_blossom_data)[odd].pred = arc;
-
-      int even = _blossom_set->find(_graph.target((*_blossom_data)[odd].next));
-      (*_blossom_data)[even].pred = (*_blossom_data)[even].next;
-      _tree_set->insert(even, tree);
-      (*_blossom_data)[even].status = EVEN;
-      matchedToEven(even, tree);
-    }
-
-    void shrinkOnEdge(const Edge& edge, int tree) {
-      int nca = -1;
-      std::vector<int> left_path, right_path;
-
-      {
-        std::set<int> left_set, right_set;
-        int left = _blossom_set->find(_graph.u(edge));
-        left_path.push_back(left);
-        left_set.insert(left);
-
-        int right = _blossom_set->find(_graph.v(edge));
-        right_path.push_back(right);
-        right_set.insert(right);
-
-        while (true) {
-
-          if ((*_blossom_data)[left].pred == INVALID) break;
-
-          left =
-            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
-          left_path.push_back(left);
-          left =
-            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
-          left_path.push_back(left);
-
-          left_set.insert(left);
-
-          if (right_set.find(left) != right_set.end()) {
-            nca = left;
-            break;
-          }
-
-          if ((*_blossom_data)[right].pred == INVALID) break;
-
-          right =
-            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
-          right_path.push_back(right);
-          right =
-            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
-          right_path.push_back(right);
-
-          right_set.insert(right);
-
-          if (left_set.find(right) != left_set.end()) {
-            nca = right;
-            break;
-          }
-
-        }
-
-        if (nca == -1) {
-          if ((*_blossom_data)[left].pred == INVALID) {
-            nca = right;
-            while (left_set.find(nca) == left_set.end()) {
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              right_path.push_back(nca);
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              right_path.push_back(nca);
-            }
-          } else {
-            nca = left;
-            while (right_set.find(nca) == right_set.end()) {
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              left_path.push_back(nca);
-              nca =
-                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
-              left_path.push_back(nca);
-            }
-          }
-        }
-      }
-
-      std::vector<int> subblossoms;
-      Arc prev;
-
-      prev = _graph.direct(edge, true);
-      for (int i = 0; left_path[i] != nca; i += 2) {
-        subblossoms.push_back(left_path[i]);
-        (*_blossom_data)[left_path[i]].next = prev;
-        _tree_set->erase(left_path[i]);
-
-        subblossoms.push_back(left_path[i + 1]);
-        (*_blossom_data)[left_path[i + 1]].status = EVEN;
-        oddToEven(left_path[i + 1], tree);
-        _tree_set->erase(left_path[i + 1]);
-        prev = _graph.oppositeArc((*_blossom_data)[left_path[i + 1]].pred);
-      }
-
-      int k = 0;
-      while (right_path[k] != nca) ++k;
-
-      subblossoms.push_back(nca);
-      (*_blossom_data)[nca].next = prev;
-
-      for (int i = k - 2; i >= 0; i -= 2) {
-        subblossoms.push_back(right_path[i + 1]);
-        (*_blossom_data)[right_path[i + 1]].status = EVEN;
-        oddToEven(right_path[i + 1], tree);
-        _tree_set->erase(right_path[i + 1]);
-
-        (*_blossom_data)[right_path[i + 1]].next =
-          (*_blossom_data)[right_path[i + 1]].pred;
-
-        subblossoms.push_back(right_path[i]);
-        _tree_set->erase(right_path[i]);
-      }
-
-      int surface =
-        _blossom_set->join(subblossoms.begin(), subblossoms.end());
-
-      for (int i = 0; i < int(subblossoms.size()); ++i) {
-        if (!_blossom_set->trivial(subblossoms[i])) {
-          (*_blossom_data)[subblossoms[i]].pot += 2 * _delta_sum;
-        }
-        (*_blossom_data)[subblossoms[i]].status = MATCHED;
-      }
-
-      (*_blossom_data)[surface].pot = -2 * _delta_sum;
-      (*_blossom_data)[surface].offset = 0;
-      (*_blossom_data)[surface].status = EVEN;
-      (*_blossom_data)[surface].pred = (*_blossom_data)[nca].pred;
-      (*_blossom_data)[surface].next = (*_blossom_data)[nca].pred;
-
-      _tree_set->insert(surface, tree);
-      _tree_set->erase(nca);
-    }
-
-    void splitBlossom(int blossom) {
-      Arc next = (*_blossom_data)[blossom].next;
-      Arc pred = (*_blossom_data)[blossom].pred;
-
-      int tree = _tree_set->find(blossom);
-
-      (*_blossom_data)[blossom].status = MATCHED;
-      oddToMatched(blossom);
-      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
-        _delta2->erase(blossom);
-      }
-
-      std::vector<int> subblossoms;
-      _blossom_set->split(blossom, std::back_inserter(subblossoms));
-
-      Value offset = (*_blossom_data)[blossom].offset;
-      int b = _blossom_set->find(_graph.source(pred));
-      int d = _blossom_set->find(_graph.source(next));
-
-      int ib = -1, id = -1;
-      for (int i = 0; i < int(subblossoms.size()); ++i) {
-        if (subblossoms[i] == b) ib = i;
-        if (subblossoms[i] == d) id = i;
-
-        (*_blossom_data)[subblossoms[i]].offset = offset;
-        if (!_blossom_set->trivial(subblossoms[i])) {
-          (*_blossom_data)[subblossoms[i]].pot -= 2 * offset;
-        }
-        if (_blossom_set->classPrio(subblossoms[i]) !=
-            std::numeric_limits<Value>::max()) {
-          _delta2->push(subblossoms[i],
-                        _blossom_set->classPrio(subblossoms[i]) -
-                        (*_blossom_data)[subblossoms[i]].offset);
-        }
-      }
-
-      if (id > ib ? ((id - ib) % 2 == 0) : ((ib - id) % 2 == 1)) {
-        for (int i = (id + 1) % subblossoms.size();
-             i != ib; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          (*_blossom_data)[sb].next =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-        }
-
-        for (int i = ib; i != id; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          int ub = subblossoms[(i + 2) % subblossoms.size()];
-
-          (*_blossom_data)[sb].status = ODD;
-          matchedToOdd(sb);
-          _tree_set->insert(sb, tree);
-          (*_blossom_data)[sb].pred = pred;
-          (*_blossom_data)[sb].next =
-                           _graph.oppositeArc((*_blossom_data)[tb].next);
-
-          pred = (*_blossom_data)[ub].next;
-
-          (*_blossom_data)[tb].status = EVEN;
-          matchedToEven(tb, tree);
-          _tree_set->insert(tb, tree);
-          (*_blossom_data)[tb].pred = (*_blossom_data)[tb].next;
-        }
-
-        (*_blossom_data)[subblossoms[id]].status = ODD;
-        matchedToOdd(subblossoms[id]);
-        _tree_set->insert(subblossoms[id], tree);
-        (*_blossom_data)[subblossoms[id]].next = next;
-        (*_blossom_data)[subblossoms[id]].pred = pred;
-
-      } else {
-
-        for (int i = (ib + 1) % subblossoms.size();
-             i != id; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          (*_blossom_data)[sb].next =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-        }
-
-        for (int i = id; i != ib; i = (i + 2) % subblossoms.size()) {
-          int sb = subblossoms[i];
-          int tb = subblossoms[(i + 1) % subblossoms.size()];
-          int ub = subblossoms[(i + 2) % subblossoms.size()];
-
-          (*_blossom_data)[sb].status = ODD;
-          matchedToOdd(sb);
-          _tree_set->insert(sb, tree);
-          (*_blossom_data)[sb].next = next;
-          (*_blossom_data)[sb].pred =
-            _graph.oppositeArc((*_blossom_data)[tb].next);
-
-          (*_blossom_data)[tb].status = EVEN;
-          matchedToEven(tb, tree);
-          _tree_set->insert(tb, tree);
-          (*_blossom_data)[tb].pred =
-            (*_blossom_data)[tb].next =
-            _graph.oppositeArc((*_blossom_data)[ub].next);
-          next = (*_blossom_data)[ub].next;
-        }
-
-        (*_blossom_data)[subblossoms[ib]].status = ODD;
-        matchedToOdd(subblossoms[ib]);
-        _tree_set->insert(subblossoms[ib], tree);
-        (*_blossom_data)[subblossoms[ib]].next = next;
-        (*_blossom_data)[subblossoms[ib]].pred = pred;
-      }
-      _tree_set->erase(blossom);
-    }
-
-    void extractBlossom(int blossom, const Node& base, const Arc& matching) {
-      if (_blossom_set->trivial(blossom)) {
-        int bi = (*_node_index)[base];
-        Value pot = (*_node_data)[bi].pot;
-
-        (*_matching)[base] = matching;
-        _blossom_node_list.push_back(base);
-        (*_node_potential)[base] = pot;
-      } else {
-
-        Value pot = (*_blossom_data)[blossom].pot;
-        int bn = _blossom_node_list.size();
-
-        std::vector<int> subblossoms;
-        _blossom_set->split(blossom, std::back_inserter(subblossoms));
-        int b = _blossom_set->find(base);
-        int ib = -1;
-        for (int i = 0; i < int(subblossoms.size()); ++i) {
-          if (subblossoms[i] == b) { ib = i; break; }
-        }
-
-        for (int i = 1; i < int(subblossoms.size()); i += 2) {
-          int sb = subblossoms[(ib + i) % subblossoms.size()];
-          int tb = subblossoms[(ib + i + 1) % subblossoms.size()];
-
-          Arc m = (*_blossom_data)[tb].next;
-          extractBlossom(sb, _graph.target(m), _graph.oppositeArc(m));
-          extractBlossom(tb, _graph.source(m), m);
-        }
-        extractBlossom(subblossoms[ib], base, matching);
-
-        int en = _blossom_node_list.size();
-
-        _blossom_potential.push_back(BlossomVariable(bn, en, pot));
-      }
-    }
-
-    void extractMatching() {
-      std::vector<int> blossoms;
-      for (typename BlossomSet::ClassIt c(*_blossom_set); c != INVALID; ++c) {
-        blossoms.push_back(c);
-      }
-
-      for (int i = 0; i < int(blossoms.size()); ++i) {
-
-        Value offset = (*_blossom_data)[blossoms[i]].offset;
-        (*_blossom_data)[blossoms[i]].pot += 2 * offset;
-        for (typename BlossomSet::ItemIt n(*_blossom_set, blossoms[i]);
-             n != INVALID; ++n) {
-          (*_node_data)[(*_node_index)[n]].pot -= offset;
-        }
-
-        Arc matching = (*_blossom_data)[blossoms[i]].next;
-        Node base = _graph.source(matching);
-        extractBlossom(blossoms[i], base, matching);
-      }
-    }
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Constructor.
-    MaxWeightedPerfectMatching(const Graph& graph, const WeightMap& weight)
-      : _graph(graph), _weight(weight), _matching(0),
-        _node_potential(0), _blossom_potential(), _blossom_node_list(),
-        _node_num(0), _blossom_num(0),
-
-        _blossom_index(0), _blossom_set(0), _blossom_data(0),
-        _node_index(0), _node_heap_index(0), _node_data(0),
-        _tree_set_index(0), _tree_set(0),
-
-        _delta2_index(0), _delta2(0),
-        _delta3_index(0), _delta3(0),
-        _delta4_index(0), _delta4(0),
-
-        _delta_sum() {}
-
-    ~MaxWeightedPerfectMatching() {
-      destroyStructures();
-    }
-
-    /// \name Execution Control
-    /// The simplest way to execute the algorithm is to use the
-    /// \ref run() member function.
-
-    ///@{
-
-    /// \brief Initialize the algorithm
-    ///
-    /// This function initializes the algorithm.
-    void init() {
-      createStructures();
-
-      for (ArcIt e(_graph); e != INVALID; ++e) {
-        (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP;
-      }
-      for (EdgeIt e(_graph); e != INVALID; ++e) {
-        (*_delta3_index)[e] = _delta3->PRE_HEAP;
-      }
-      for (int i = 0; i < _blossom_num; ++i) {
-        (*_delta2_index)[i] = _delta2->PRE_HEAP;
-        (*_delta4_index)[i] = _delta4->PRE_HEAP;
-      }
-
-      int index = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        Value max = - std::numeric_limits<Value>::max();
-        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
-          if (_graph.target(e) == n) continue;
-          if ((dualScale * _weight[e]) / 2 > max) {
-            max = (dualScale * _weight[e]) / 2;
-          }
-        }
-        (*_node_index)[n] = index;
-        (*_node_data)[index].pot = max;
-        int blossom =
-          _blossom_set->insert(n, std::numeric_limits<Value>::max());
-
-        _tree_set->insert(blossom);
-
-        (*_blossom_data)[blossom].status = EVEN;
-        (*_blossom_data)[blossom].pred = INVALID;
-        (*_blossom_data)[blossom].next = INVALID;
-        (*_blossom_data)[blossom].pot = 0;
-        (*_blossom_data)[blossom].offset = 0;
-        ++index;
-      }
-      for (EdgeIt e(_graph); e != INVALID; ++e) {
-        int si = (*_node_index)[_graph.u(e)];
-        int ti = (*_node_index)[_graph.v(e)];
-        if (_graph.u(e) != _graph.v(e)) {
-          _delta3->push(e, ((*_node_data)[si].pot + (*_node_data)[ti].pot -
-                            dualScale * _weight[e]) / 2);
-        }
-      }
-    }
-
-    /// \brief Start the algorithm
-    ///
-    /// This function starts the algorithm.
-    ///
-    /// \pre \ref init() must be called before using this function.
-    bool start() {
-      enum OpType {
-        D2, D3, D4
-      };
-
-      int unmatched = _node_num;
-      while (unmatched > 0) {
-        Value d2 = !_delta2->empty() ?
-          _delta2->prio() : std::numeric_limits<Value>::max();
-
-        Value d3 = !_delta3->empty() ?
-          _delta3->prio() : std::numeric_limits<Value>::max();
-
-        Value d4 = !_delta4->empty() ?
-          _delta4->prio() : std::numeric_limits<Value>::max();
-
-        _delta_sum = d2; OpType ot = D2;
-        if (d3 < _delta_sum) { _delta_sum = d3; ot = D3; }
-        if (d4 < _delta_sum) { _delta_sum = d4; ot = D4; }
-
-        if (_delta_sum == std::numeric_limits<Value>::max()) {
-          return false;
-        }
-
-        switch (ot) {
-        case D2:
-          {
-            int blossom = _delta2->top();
-            Node n = _blossom_set->classTop(blossom);
-            Arc e = (*_node_data)[(*_node_index)[n]].heap.top();
-            extendOnArc(e);
-          }
-          break;
-        case D3:
-          {
-            Edge e = _delta3->top();
-
-            int left_blossom = _blossom_set->find(_graph.u(e));
-            int right_blossom = _blossom_set->find(_graph.v(e));
-
-            if (left_blossom == right_blossom) {
-              _delta3->pop();
-            } else {
-              int left_tree = _tree_set->find(left_blossom);
-              int right_tree = _tree_set->find(right_blossom);
-
-              if (left_tree == right_tree) {
-                shrinkOnEdge(e, left_tree);
-              } else {
-                augmentOnEdge(e);
-                unmatched -= 2;
-              }
-            }
-          } break;
-        case D4:
-          splitBlossom(_delta4->top());
-          break;
-        }
-      }
-      extractMatching();
-      return true;
-    }
-
-    /// \brief Run the algorithm.
-    ///
-    /// This method runs the \c %MaxWeightedPerfectMatching algorithm.
-    ///
-    /// \note mwpm.run() is just a shortcut of the following code.
-    /// \code
-    ///   mwpm.init();
-    ///   mwpm.start();
-    /// \endcode
-    bool run() {
-      init();
-      return start();
-    }
-
-    /// @}
-
-    /// \name Primal Solution
-    /// Functions to get the primal solution, i.e. the maximum weighted 
-    /// perfect matching.\n
-    /// Either \ref run() or \ref start() function should be called before
-    /// using them.
-
-    /// @{
-
-    /// \brief Return the weight of the matching.
-    ///
-    /// This function returns the weight of the found matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value matchingWeight() const {
-      Value sum = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        if ((*_matching)[n] != INVALID) {
-          sum += _weight[(*_matching)[n]];
-        }
-      }
-      return sum /= 2;
-    }
-
-    /// \brief Return \c true if the given edge is in the matching.
-    ///
-    /// This function returns \c true if the given edge is in the found 
-    /// matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    bool matching(const Edge& edge) const {
-      return static_cast<const Edge&>((*_matching)[_graph.u(edge)]) == edge;
-    }
-
-    /// \brief Return the matching arc (or edge) incident to the given node.
-    ///
-    /// This function returns the matching arc (or edge) incident to the
-    /// given node in the found matching or \c INVALID if the node is 
-    /// not covered by the matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Arc matching(const Node& node) const {
-      return (*_matching)[node];
-    }
-
-    /// \brief Return a const reference to the matching map.
-    ///
-    /// This function returns a const reference to a node map that stores
-    /// the matching arc (or edge) incident to each node.
-    const MatchingMap& matchingMap() const {
-      return *_matching;
-    }
-
-    /// \brief Return the mate of the given node.
-    ///
-    /// This function returns the mate of the given node in the found 
-    /// matching or \c INVALID if the node is not covered by the matching.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Node mate(const Node& node) const {
-      return _graph.target((*_matching)[node]);
-    }
-
-    /// @}
-
-    /// \name Dual Solution
-    /// Functions to get the dual solution.\n
-    /// Either \ref run() or \ref start() function should be called before
-    /// using them.
-
-    /// @{
-
-    /// \brief Return the value of the dual solution.
-    ///
-    /// This function returns the value of the dual solution. 
-    /// It should be equal to the primal value scaled by \ref dualScale 
-    /// "dual scale".
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value dualValue() const {
-      Value sum = 0;
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        sum += nodeValue(n);
-      }
-      for (int i = 0; i < blossomNum(); ++i) {
-        sum += blossomValue(i) * (blossomSize(i) / 2);
-      }
-      return sum;
-    }
-
-    /// \brief Return the dual value (potential) of the given node.
-    ///
-    /// This function returns the dual value (potential) of the given node.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value nodeValue(const Node& n) const {
-      return (*_node_potential)[n];
-    }
-
-    /// \brief Return the number of the blossoms in the basis.
-    ///
-    /// This function returns the number of the blossoms in the basis.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    /// \see BlossomIt
-    int blossomNum() const {
-      return _blossom_potential.size();
-    }
-
-    /// \brief Return the number of the nodes in the given blossom.
-    ///
-    /// This function returns the number of the nodes in the given blossom.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    /// \see BlossomIt
-    int blossomSize(int k) const {
-      return _blossom_potential[k].end - _blossom_potential[k].begin;
-    }
-
-    /// \brief Return the dual value (ptential) of the given blossom.
-    ///
-    /// This function returns the dual value (ptential) of the given blossom.
-    ///
-    /// \pre Either run() or start() must be called before using this function.
-    Value blossomValue(int k) const {
-      return _blossom_potential[k].value;
-    }
-
-    /// \brief Iterator for obtaining the nodes of a blossom.
-    ///
-    /// This class provides an iterator for obtaining the nodes of the 
-    /// given blossom. It lists a subset of the nodes.
-    /// Before using this iterator, you must allocate a 
-    /// MaxWeightedPerfectMatching class and execute it.
-    class BlossomIt {
-    public:
-
-      /// \brief Constructor.
-      ///
-      /// Constructor to get the nodes of the given variable.
-      ///
-      /// \pre Either \ref MaxWeightedPerfectMatching::run() "algorithm.run()" 
-      /// or \ref MaxWeightedPerfectMatching::start() "algorithm.start()" 
-      /// must be called before initializing this iterator.
-      BlossomIt(const MaxWeightedPerfectMatching& algorithm, int variable)
-        : _algorithm(&algorithm)
-      {
-        _index = _algorithm->_blossom_potential[variable].begin;
-        _last = _algorithm->_blossom_potential[variable].end;
-      }
-
-      /// \brief Conversion to \c Node.
-      ///
-      /// Conversion to \c Node.
-      operator Node() const {
-        return _algorithm->_blossom_node_list[_index];
-      }
-
-      /// \brief Increment operator.
-      ///
-      /// Increment operator.
-      BlossomIt& operator++() {
-        ++_index;
-        return *this;
-      }
-
-      /// \brief Validity checking
-      ///
-      /// This function checks whether the iterator is invalid.
-      bool operator==(Invalid) const { return _index == _last; }
-
-      /// \brief Validity checking
-      ///
-      /// This function checks whether the iterator is valid.
-      bool operator!=(Invalid) const { return _index != _last; }
-
-    private:
-      const MaxWeightedPerfectMatching* _algorithm;
-      int _last;
-      int _index;
-    };
-
-    /// @}
-
-  };
-
-} //END OF NAMESPACE LEMON
-
-#endif //LEMON_MAX_MATCHING_H
Index: lemon/max_matching.h
===================================================================
--- lemon/max_matching.h	(revision 440)
+++ lemon/max_matching.h	(revision 440)
@@ -0,0 +1,3104 @@
+/* -*- 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.
+ *
+ */
+
+#ifndef LEMON_MAX_MATCHING_H
+#define LEMON_MAX_MATCHING_H
+
+#include <vector>
+#include <queue>
+#include <set>
+#include <limits>
+
+#include <lemon/core.h>
+#include <lemon/unionfind.h>
+#include <lemon/bin_heap.h>
+#include <lemon/maps.h>
+
+///\ingroup matching
+///\file
+///\brief Maximum matching algorithms in general graphs.
+
+namespace lemon {
+
+  /// \ingroup matching
+  ///
+  /// \brief Edmonds' alternating forest maximum matching algorithm.
+  ///
+  /// This class implements Edmonds' alternating forest matching
+  /// algorithm. The algorithm can be started from an arbitrary initial
+  /// matching (the default is the empty one)
+  ///
+  /// The dual solution of the problem is a map of the nodes to
+  /// MaxMatching::Status, having values \c EVEN/D, \c ODD/A and \c
+  /// MATCHED/C showing the Gallai-Edmonds decomposition of the
+  /// graph. The nodes in \c EVEN/D induce a graph with
+  /// factor-critical components, the nodes in \c ODD/A form the
+  /// barrier, and the nodes in \c MATCHED/C induce a graph having a
+  /// perfect matching. The number of the factor-critical components
+  /// minus the number of barrier nodes is a lower bound on the
+  /// unmatched nodes, and the matching is optimal if and only if this bound is
+  /// tight. This decomposition can be attained by calling \c
+  /// decomposition() after running the algorithm.
+  ///
+  /// \param _Graph The graph type the algorithm runs on.
+  template <typename _Graph>
+  class MaxMatching {
+  public:
+
+    typedef _Graph Graph;
+    typedef typename Graph::template NodeMap<typename Graph::Arc>
+    MatchingMap;
+
+    ///\brief Indicates the Gallai-Edmonds decomposition of the graph.
+    ///
+    ///Indicates the Gallai-Edmonds decomposition of the graph. The
+    ///nodes with Status \c EVEN/D induce a graph with factor-critical
+    ///components, the nodes in \c ODD/A form the canonical barrier,
+    ///and the nodes in \c MATCHED/C induce a graph having a perfect
+    ///matching.
+    enum Status {
+      EVEN = 1, D = 1, MATCHED = 0, C = 0, ODD = -1, A = -1, UNMATCHED = -2
+    };
+
+    typedef typename Graph::template NodeMap<Status> StatusMap;
+
+  private:
+
+    TEMPLATE_GRAPH_TYPEDEFS(Graph);
+
+    typedef UnionFindEnum<IntNodeMap> BlossomSet;
+    typedef ExtendFindEnum<IntNodeMap> TreeSet;
+    typedef RangeMap<Node> NodeIntMap;
+    typedef MatchingMap EarMap;
+    typedef std::vector<Node> NodeQueue;
+
+    const Graph& _graph;
+    MatchingMap* _matching;
+    StatusMap* _status;
+
+    EarMap* _ear;
+
+    IntNodeMap* _blossom_set_index;
+    BlossomSet* _blossom_set;
+    NodeIntMap* _blossom_rep;
+
+    IntNodeMap* _tree_set_index;
+    TreeSet* _tree_set;
+
+    NodeQueue _node_queue;
+    int _process, _postpone, _last;
+
+    int _node_num;
+
+  private:
+
+    void createStructures() {
+      _node_num = countNodes(_graph);
+      if (!_matching) {
+        _matching = new MatchingMap(_graph);
+      }
+      if (!_status) {
+        _status = new StatusMap(_graph);
+      }
+      if (!_ear) {
+        _ear = new EarMap(_graph);
+      }
+      if (!_blossom_set) {
+        _blossom_set_index = new IntNodeMap(_graph);
+        _blossom_set = new BlossomSet(*_blossom_set_index);
+      }
+      if (!_blossom_rep) {
+        _blossom_rep = new NodeIntMap(_node_num);
+      }
+      if (!_tree_set) {
+        _tree_set_index = new IntNodeMap(_graph);
+        _tree_set = new TreeSet(*_tree_set_index);
+      }
+      _node_queue.resize(_node_num);
+    }
+
+    void destroyStructures() {
+      if (_matching) {
+        delete _matching;
+      }
+      if (_status) {
+        delete _status;
+      }
+      if (_ear) {
+        delete _ear;
+      }
+      if (_blossom_set) {
+        delete _blossom_set;
+        delete _blossom_set_index;
+      }
+      if (_blossom_rep) {
+        delete _blossom_rep;
+      }
+      if (_tree_set) {
+        delete _tree_set_index;
+        delete _tree_set;
+      }
+    }
+
+    void processDense(const Node& n) {
+      _process = _postpone = _last = 0;
+      _node_queue[_last++] = n;
+
+      while (_process != _last) {
+        Node u = _node_queue[_process++];
+        for (OutArcIt a(_graph, u); a != INVALID; ++a) {
+          Node v = _graph.target(a);
+          if ((*_status)[v] == MATCHED) {
+            extendOnArc(a);
+          } else if ((*_status)[v] == UNMATCHED) {
+            augmentOnArc(a);
+            return;
+          }
+        }
+      }
+
+      while (_postpone != _last) {
+        Node u = _node_queue[_postpone++];
+
+        for (OutArcIt a(_graph, u); a != INVALID ; ++a) {
+          Node v = _graph.target(a);
+
+          if ((*_status)[v] == EVEN) {
+            if (_blossom_set->find(u) != _blossom_set->find(v)) {
+              shrinkOnEdge(a);
+            }
+          }
+
+          while (_process != _last) {
+            Node w = _node_queue[_process++];
+            for (OutArcIt b(_graph, w); b != INVALID; ++b) {
+              Node x = _graph.target(b);
+              if ((*_status)[x] == MATCHED) {
+                extendOnArc(b);
+              } else if ((*_status)[x] == UNMATCHED) {
+                augmentOnArc(b);
+                return;
+              }
+            }
+          }
+        }
+      }
+    }
+
+    void processSparse(const Node& n) {
+      _process = _last = 0;
+      _node_queue[_last++] = n;
+      while (_process != _last) {
+        Node u = _node_queue[_process++];
+        for (OutArcIt a(_graph, u); a != INVALID; ++a) {
+          Node v = _graph.target(a);
+
+          if ((*_status)[v] == EVEN) {
+            if (_blossom_set->find(u) != _blossom_set->find(v)) {
+              shrinkOnEdge(a);
+            }
+          } else if ((*_status)[v] == MATCHED) {
+            extendOnArc(a);
+          } else if ((*_status)[v] == UNMATCHED) {
+            augmentOnArc(a);
+            return;
+          }
+        }
+      }
+    }
+
+    void shrinkOnEdge(const Edge& e) {
+      Node nca = INVALID;
+
+      {
+        std::set<Node> left_set, right_set;
+
+        Node left = (*_blossom_rep)[_blossom_set->find(_graph.u(e))];
+        left_set.insert(left);
+
+        Node right = (*_blossom_rep)[_blossom_set->find(_graph.v(e))];
+        right_set.insert(right);
+
+        while (true) {
+          if ((*_matching)[left] == INVALID) break;
+          left = _graph.target((*_matching)[left]);
+          left = (*_blossom_rep)[_blossom_set->
+                                 find(_graph.target((*_ear)[left]))];
+          if (right_set.find(left) != right_set.end()) {
+            nca = left;
+            break;
+          }
+          left_set.insert(left);
+
+          if ((*_matching)[right] == INVALID) break;
+          right = _graph.target((*_matching)[right]);
+          right = (*_blossom_rep)[_blossom_set->
+                                  find(_graph.target((*_ear)[right]))];
+          if (left_set.find(right) != left_set.end()) {
+            nca = right;
+            break;
+          }
+          right_set.insert(right);
+        }
+
+        if (nca == INVALID) {
+          if ((*_matching)[left] == INVALID) {
+            nca = right;
+            while (left_set.find(nca) == left_set.end()) {
+              nca = _graph.target((*_matching)[nca]);
+              nca =(*_blossom_rep)[_blossom_set->
+                                   find(_graph.target((*_ear)[nca]))];
+            }
+          } else {
+            nca = left;
+            while (right_set.find(nca) == right_set.end()) {
+              nca = _graph.target((*_matching)[nca]);
+              nca = (*_blossom_rep)[_blossom_set->
+                                   find(_graph.target((*_ear)[nca]))];
+            }
+          }
+        }
+      }
+
+      {
+
+        Node node = _graph.u(e);
+        Arc arc = _graph.direct(e, true);
+        Node base = (*_blossom_rep)[_blossom_set->find(node)];
+
+        while (base != nca) {
+          _ear->set(node, arc);
+
+          Node n = node;
+          while (n != base) {
+            n = _graph.target((*_matching)[n]);
+            Arc a = (*_ear)[n];
+            n = _graph.target(a);
+            _ear->set(n, _graph.oppositeArc(a));
+          }
+          node = _graph.target((*_matching)[base]);
+          _tree_set->erase(base);
+          _tree_set->erase(node);
+          _blossom_set->insert(node, _blossom_set->find(base));
+          _status->set(node, EVEN);
+          _node_queue[_last++] = node;
+          arc = _graph.oppositeArc((*_ear)[node]);
+          node = _graph.target((*_ear)[node]);
+          base = (*_blossom_rep)[_blossom_set->find(node)];
+          _blossom_set->join(_graph.target(arc), base);
+        }
+      }
+
+      _blossom_rep->set(_blossom_set->find(nca), nca);
+
+      {
+
+        Node node = _graph.v(e);
+        Arc arc = _graph.direct(e, false);
+        Node base = (*_blossom_rep)[_blossom_set->find(node)];
+
+        while (base != nca) {
+          _ear->set(node, arc);
+
+          Node n = node;
+          while (n != base) {
+            n = _graph.target((*_matching)[n]);
+            Arc a = (*_ear)[n];
+            n = _graph.target(a);
+            _ear->set(n, _graph.oppositeArc(a));
+          }
+          node = _graph.target((*_matching)[base]);
+          _tree_set->erase(base);
+          _tree_set->erase(node);
+          _blossom_set->insert(node, _blossom_set->find(base));
+          _status->set(node, EVEN);
+          _node_queue[_last++] = node;
+          arc = _graph.oppositeArc((*_ear)[node]);
+          node = _graph.target((*_ear)[node]);
+          base = (*_blossom_rep)[_blossom_set->find(node)];
+          _blossom_set->join(_graph.target(arc), base);
+        }
+      }
+
+      _blossom_rep->set(_blossom_set->find(nca), nca);
+    }
+
+
+
+    void extendOnArc(const Arc& a) {
+      Node base = _graph.source(a);
+      Node odd = _graph.target(a);
+
+      _ear->set(odd, _graph.oppositeArc(a));
+      Node even = _graph.target((*_matching)[odd]);
+      _blossom_rep->set(_blossom_set->insert(even), even);
+      _status->set(odd, ODD);
+      _status->set(even, EVEN);
+      int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(base)]);
+      _tree_set->insert(odd, tree);
+      _tree_set->insert(even, tree);
+      _node_queue[_last++] = even;
+
+    }
+
+    void augmentOnArc(const Arc& a) {
+      Node even = _graph.source(a);
+      Node odd = _graph.target(a);
+
+      int tree = _tree_set->find((*_blossom_rep)[_blossom_set->find(even)]);
+
+      _matching->set(odd, _graph.oppositeArc(a));
+      _status->set(odd, MATCHED);
+
+      Arc arc = (*_matching)[even];
+      _matching->set(even, a);
+
+      while (arc != INVALID) {
+        odd = _graph.target(arc);
+        arc = (*_ear)[odd];
+        even = _graph.target(arc);
+        _matching->set(odd, arc);
+        arc = (*_matching)[even];
+        _matching->set(even, _graph.oppositeArc((*_matching)[odd]));
+      }
+
+      for (typename TreeSet::ItemIt it(*_tree_set, tree);
+           it != INVALID; ++it) {
+        if ((*_status)[it] == ODD) {
+          _status->set(it, MATCHED);
+        } else {
+          int blossom = _blossom_set->find(it);
+          for (typename BlossomSet::ItemIt jt(*_blossom_set, blossom);
+               jt != INVALID; ++jt) {
+            _status->set(jt, MATCHED);
+          }
+          _blossom_set->eraseClass(blossom);
+        }
+      }
+      _tree_set->eraseClass(tree);
+
+    }
+
+  public:
+
+    /// \brief Constructor
+    ///
+    /// Constructor.
+    MaxMatching(const Graph& graph)
+      : _graph(graph), _matching(0), _status(0), _ear(0),
+        _blossom_set_index(0), _blossom_set(0), _blossom_rep(0),
+        _tree_set_index(0), _tree_set(0) {}
+
+    ~MaxMatching() {
+      destroyStructures();
+    }
+
+    /// \name Execution control
+    /// The simplest way to execute the algorithm is to use the
+    /// \c run() member function.
+    /// \n
+
+    /// If you need better control on the execution, you must call
+    /// \ref init(), \ref greedyInit() or \ref matchingInit()
+    /// functions first, then you can start the algorithm with the \ref
+    /// startSparse() or startDense() functions.
+
+    ///@{
+
+    /// \brief Sets the actual matching to the empty matching.
+    ///
+    /// Sets the actual matching to the empty matching.
+    ///
+    void init() {
+      createStructures();
+      for(NodeIt n(_graph); n != INVALID; ++n) {
+        _matching->set(n, INVALID);
+        _status->set(n, UNMATCHED);
+      }
+    }
+
+    ///\brief Finds an initial matching in a greedy way
+    ///
+    ///It finds an initial matching in a greedy way.
+    void greedyInit() {
+      createStructures();
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        _matching->set(n, INVALID);
+        _status->set(n, UNMATCHED);
+      }
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_matching)[n] == INVALID) {
+          for (OutArcIt a(_graph, n); a != INVALID ; ++a) {
+            Node v = _graph.target(a);
+            if ((*_matching)[v] == INVALID && v != n) {
+              _matching->set(n, a);
+              _status->set(n, MATCHED);
+              _matching->set(v, _graph.oppositeArc(a));
+              _status->set(v, MATCHED);
+              break;
+            }
+          }
+        }
+      }
+    }
+
+
+    /// \brief Initialize the matching from a map containing.
+    ///
+    /// Initialize the matching from a \c bool valued \c Edge map. This
+    /// map must have the property that there are no two incident edges
+    /// with true value, ie. it contains a matching.
+    /// \return %True if the map contains a matching.
+    template <typename MatchingMap>
+    bool matchingInit(const MatchingMap& matching) {
+      createStructures();
+
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        _matching->set(n, INVALID);
+        _status->set(n, UNMATCHED);
+      }
+      for(EdgeIt e(_graph); e!=INVALID; ++e) {
+        if (matching[e]) {
+
+          Node u = _graph.u(e);
+          if ((*_matching)[u] != INVALID) return false;
+          _matching->set(u, _graph.direct(e, true));
+          _status->set(u, MATCHED);
+
+          Node v = _graph.v(e);
+          if ((*_matching)[v] != INVALID) return false;
+          _matching->set(v, _graph.direct(e, false));
+          _status->set(v, MATCHED);
+        }
+      }
+      return true;
+    }
+
+    /// \brief Starts Edmonds' algorithm
+    ///
+    /// If runs the original Edmonds' algorithm.
+    void startSparse() {
+      for(NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_status)[n] == UNMATCHED) {
+          (*_blossom_rep)[_blossom_set->insert(n)] = n;
+          _tree_set->insert(n);
+          _status->set(n, EVEN);
+          processSparse(n);
+        }
+      }
+    }
+
+    /// \brief Starts Edmonds' algorithm.
+    ///
+    /// It runs Edmonds' algorithm with a heuristic of postponing
+    /// shrinks, therefore resulting in a faster algorithm for dense graphs.
+    void startDense() {
+      for(NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_status)[n] == UNMATCHED) {
+          (*_blossom_rep)[_blossom_set->insert(n)] = n;
+          _tree_set->insert(n);
+          _status->set(n, EVEN);
+          processDense(n);
+        }
+      }
+    }
+
+
+    /// \brief Runs Edmonds' algorithm
+    ///
+    /// Runs Edmonds' algorithm for sparse graphs (<tt>m<2*n</tt>)
+    /// or Edmonds' algorithm with a heuristic of
+    /// postponing shrinks for dense graphs.
+    void run() {
+      if (countEdges(_graph) < 2 * countNodes(_graph)) {
+        greedyInit();
+        startSparse();
+      } else {
+        init();
+        startDense();
+      }
+    }
+
+    /// @}
+
+    /// \name Primal solution
+    /// Functions to get the primal solution, ie. the matching.
+
+    /// @{
+
+    ///\brief Returns the size of the current matching.
+    ///
+    ///Returns the size of the current matching. After \ref
+    ///run() it returns the size of the maximum matching in the graph.
+    int matchingSize() const {
+      int size = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_matching)[n] != INVALID) {
+          ++size;
+        }
+      }
+      return size / 2;
+    }
+
+    /// \brief Returns true when the edge is in the matching.
+    ///
+    /// Returns true when the edge is in the matching.
+    bool matching(const Edge& edge) const {
+      return edge == (*_matching)[_graph.u(edge)];
+    }
+
+    /// \brief Returns the matching edge incident to the given node.
+    ///
+    /// Returns the matching edge of a \c node in the actual matching or
+    /// INVALID if the \c node is not covered by the actual matching.
+    Arc matching(const Node& n) const {
+      return (*_matching)[n];
+    }
+
+    ///\brief Returns the mate of a node in the actual matching.
+    ///
+    ///Returns the mate of a \c node in the actual matching or
+    ///INVALID if the \c node is not covered by the actual matching.
+    Node mate(const Node& n) const {
+      return (*_matching)[n] != INVALID ?
+        _graph.target((*_matching)[n]) : INVALID;
+    }
+
+    /// @}
+
+    /// \name Dual solution
+    /// Functions to get the dual solution, ie. the decomposition.
+
+    /// @{
+
+    /// \brief Returns the class of the node in the Edmonds-Gallai
+    /// decomposition.
+    ///
+    /// Returns the class of the node in the Edmonds-Gallai
+    /// decomposition.
+    Status decomposition(const Node& n) const {
+      return (*_status)[n];
+    }
+
+    /// \brief Returns true when the node is in the barrier.
+    ///
+    /// Returns true when the node is in the barrier.
+    bool barrier(const Node& n) const {
+      return (*_status)[n] == ODD;
+    }
+
+    /// @}
+
+  };
+
+  /// \ingroup matching
+  ///
+  /// \brief Weighted matching in general graphs
+  ///
+  /// This class provides an efficient implementation of Edmond's
+  /// maximum weighted matching algorithm. The implementation is based
+  /// on extensive use of priority queues and provides
+  /// \f$O(nm\log(n))\f$ time complexity.
+  ///
+  /// The maximum weighted matching problem is to find undirected
+  /// edges in the graph with maximum overall weight and no two of
+  /// them shares their ends. The problem can be formulated with the
+  /// following linear program.
+  /// \f[ \sum_{e \in \delta(u)}x_e \le 1 \quad \forall u\in V\f]
+  /** \f[ \sum_{e \in \gamma(B)}x_e \le \frac{\vert B \vert - 1}{2}
+      \quad \forall B\in\mathcal{O}\f] */
+  /// \f[x_e \ge 0\quad \forall e\in E\f]
+  /// \f[\max \sum_{e\in E}x_ew_e\f]
+  /// where \f$\delta(X)\f$ is the set of edges incident to a node in
+  /// \f$X\f$, \f$\gamma(X)\f$ is the set of edges with both ends in
+  /// \f$X\f$ and \f$\mathcal{O}\f$ is the set of odd cardinality
+  /// subsets of the nodes.
+  ///
+  /// The algorithm calculates an optimal matching and a proof of the
+  /// optimality. The solution of the dual problem can be used to check
+  /// the result of the algorithm. The dual linear problem is the
+  /** \f[ y_u + y_v + \sum_{B \in \mathcal{O}, uv \in \gamma(B)}
+      z_B \ge w_{uv} \quad \forall uv\in E\f] */
+  /// \f[y_u \ge 0 \quad \forall u \in V\f]
+  /// \f[z_B \ge 0 \quad \forall B \in \mathcal{O}\f]
+  /** \f[\min \sum_{u \in V}y_u + \sum_{B \in \mathcal{O}}
+      \frac{\vert B \vert - 1}{2}z_B\f] */
+  ///
+  /// The algorithm can be executed with \c run() or the \c init() and
+  /// then the \c start() member functions. After it the matching can
+  /// be asked with \c matching() or mate() functions. The dual
+  /// solution can be get with \c nodeValue(), \c blossomNum() and \c
+  /// blossomValue() members and \ref MaxWeightedMatching::BlossomIt
+  /// "BlossomIt" nested class, which is able to iterate on the nodes
+  /// of a blossom. If the value type is integral then the dual
+  /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4".
+  template <typename _Graph,
+            typename _WeightMap = typename _Graph::template EdgeMap<int> >
+  class MaxWeightedMatching {
+  public:
+
+    typedef _Graph Graph;
+    typedef _WeightMap WeightMap;
+    typedef typename WeightMap::Value Value;
+
+    /// \brief Scaling factor for dual solution
+    ///
+    /// Scaling factor for dual solution, it is equal to 4 or 1
+    /// according to the value type.
+    static const int dualScale =
+      std::numeric_limits<Value>::is_integer ? 4 : 1;
+
+    typedef typename Graph::template NodeMap<typename Graph::Arc>
+    MatchingMap;
+
+  private:
+
+    TEMPLATE_GRAPH_TYPEDEFS(Graph);
+
+    typedef typename Graph::template NodeMap<Value> NodePotential;
+    typedef std::vector<Node> BlossomNodeList;
+
+    struct BlossomVariable {
+      int begin, end;
+      Value value;
+
+      BlossomVariable(int _begin, int _end, Value _value)
+        : begin(_begin), end(_end), value(_value) {}
+
+    };
+
+    typedef std::vector<BlossomVariable> BlossomPotential;
+
+    const Graph& _graph;
+    const WeightMap& _weight;
+
+    MatchingMap* _matching;
+
+    NodePotential* _node_potential;
+
+    BlossomPotential _blossom_potential;
+    BlossomNodeList _blossom_node_list;
+
+    int _node_num;
+    int _blossom_num;
+
+    typedef RangeMap<int> IntIntMap;
+
+    enum Status {
+      EVEN = -1, MATCHED = 0, ODD = 1, UNMATCHED = -2
+    };
+
+    typedef HeapUnionFind<Value, IntNodeMap> BlossomSet;
+    struct BlossomData {
+      int tree;
+      Status status;
+      Arc pred, next;
+      Value pot, offset;
+      Node base;
+    };
+
+    IntNodeMap *_blossom_index;
+    BlossomSet *_blossom_set;
+    RangeMap<BlossomData>* _blossom_data;
+
+    IntNodeMap *_node_index;
+    IntArcMap *_node_heap_index;
+
+    struct NodeData {
+
+      NodeData(IntArcMap& node_heap_index)
+        : heap(node_heap_index) {}
+
+      int blossom;
+      Value pot;
+      BinHeap<Value, IntArcMap> heap;
+      std::map<int, Arc> heap_index;
+
+      int tree;
+    };
+
+    RangeMap<NodeData>* _node_data;
+
+    typedef ExtendFindEnum<IntIntMap> TreeSet;
+
+    IntIntMap *_tree_set_index;
+    TreeSet *_tree_set;
+
+    IntNodeMap *_delta1_index;
+    BinHeap<Value, IntNodeMap> *_delta1;
+
+    IntIntMap *_delta2_index;
+    BinHeap<Value, IntIntMap> *_delta2;
+
+    IntEdgeMap *_delta3_index;
+    BinHeap<Value, IntEdgeMap> *_delta3;
+
+    IntIntMap *_delta4_index;
+    BinHeap<Value, IntIntMap> *_delta4;
+
+    Value _delta_sum;
+
+    void createStructures() {
+      _node_num = countNodes(_graph);
+      _blossom_num = _node_num * 3 / 2;
+
+      if (!_matching) {
+        _matching = new MatchingMap(_graph);
+      }
+      if (!_node_potential) {
+        _node_potential = new NodePotential(_graph);
+      }
+      if (!_blossom_set) {
+        _blossom_index = new IntNodeMap(_graph);
+        _blossom_set = new BlossomSet(*_blossom_index);
+        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
+      }
+
+      if (!_node_index) {
+        _node_index = new IntNodeMap(_graph);
+        _node_heap_index = new IntArcMap(_graph);
+        _node_data = new RangeMap<NodeData>(_node_num,
+                                              NodeData(*_node_heap_index));
+      }
+
+      if (!_tree_set) {
+        _tree_set_index = new IntIntMap(_blossom_num);
+        _tree_set = new TreeSet(*_tree_set_index);
+      }
+      if (!_delta1) {
+        _delta1_index = new IntNodeMap(_graph);
+        _delta1 = new BinHeap<Value, IntNodeMap>(*_delta1_index);
+      }
+      if (!_delta2) {
+        _delta2_index = new IntIntMap(_blossom_num);
+        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
+      }
+      if (!_delta3) {
+        _delta3_index = new IntEdgeMap(_graph);
+        _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index);
+      }
+      if (!_delta4) {
+        _delta4_index = new IntIntMap(_blossom_num);
+        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
+      }
+    }
+
+    void destroyStructures() {
+      _node_num = countNodes(_graph);
+      _blossom_num = _node_num * 3 / 2;
+
+      if (_matching) {
+        delete _matching;
+      }
+      if (_node_potential) {
+        delete _node_potential;
+      }
+      if (_blossom_set) {
+        delete _blossom_index;
+        delete _blossom_set;
+        delete _blossom_data;
+      }
+
+      if (_node_index) {
+        delete _node_index;
+        delete _node_heap_index;
+        delete _node_data;
+      }
+
+      if (_tree_set) {
+        delete _tree_set_index;
+        delete _tree_set;
+      }
+      if (_delta1) {
+        delete _delta1_index;
+        delete _delta1;
+      }
+      if (_delta2) {
+        delete _delta2_index;
+        delete _delta2;
+      }
+      if (_delta3) {
+        delete _delta3_index;
+        delete _delta3;
+      }
+      if (_delta4) {
+        delete _delta4_index;
+        delete _delta4;
+      }
+    }
+
+    void matchedToEven(int blossom, int tree) {
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+
+      if (!_blossom_set->trivial(blossom)) {
+        (*_blossom_data)[blossom].pot -=
+          2 * (_delta_sum - (*_blossom_data)[blossom].offset);
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+
+        _blossom_set->increase(n, std::numeric_limits<Value>::max());
+        int ni = (*_node_index)[n];
+
+        (*_node_data)[ni].heap.clear();
+        (*_node_data)[ni].heap_index.clear();
+
+        (*_node_data)[ni].pot += _delta_sum - (*_blossom_data)[blossom].offset;
+
+        _delta1->push(n, (*_node_data)[ni].pot);
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if ((*_blossom_data)[vb].status == EVEN) {
+            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
+              _delta3->push(e, rw / 2);
+            }
+          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
+            if (_delta3->state(e) != _delta3->IN_HEAP) {
+              _delta3->push(e, rw);
+            }
+          } else {
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              if ((*_node_data)[vi].heap[it->second] > rw) {
+                (*_node_data)[vi].heap.replace(it->second, e);
+                (*_node_data)[vi].heap.decrease(e, rw);
+                it->second = e;
+              }
+            } else {
+              (*_node_data)[vi].heap.push(e, rw);
+              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
+            }
+
+            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
+              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_delta2->state(vb) != _delta2->IN_HEAP) {
+                  _delta2->push(vb, _blossom_set->classPrio(vb) -
+                               (*_blossom_data)[vb].offset);
+                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset){
+                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+      (*_blossom_data)[blossom].offset = 0;
+    }
+
+    void matchedToOdd(int blossom) {
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+      (*_blossom_data)[blossom].offset += _delta_sum;
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->push(blossom, (*_blossom_data)[blossom].pot / 2 +
+                     (*_blossom_data)[blossom].offset);
+      }
+    }
+
+    void evenToMatched(int blossom, int tree) {
+      if (!_blossom_set->trivial(blossom)) {
+        (*_blossom_data)[blossom].pot += 2 * _delta_sum;
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+        (*_node_data)[ni].pot -= _delta_sum;
+
+        _delta1->erase(n);
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if (vb == blossom) {
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+          } else if ((*_blossom_data)[vb].status == EVEN) {
+
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+
+            int vt = _tree_set->find(vb);
+
+            if (vt != tree) {
+
+              Arc r = _graph.oppositeArc(e);
+
+              typename std::map<int, Arc>::iterator it =
+                (*_node_data)[ni].heap_index.find(vt);
+
+              if (it != (*_node_data)[ni].heap_index.end()) {
+                if ((*_node_data)[ni].heap[it->second] > rw) {
+                  (*_node_data)[ni].heap.replace(it->second, r);
+                  (*_node_data)[ni].heap.decrease(r, rw);
+                  it->second = r;
+                }
+              } else {
+                (*_node_data)[ni].heap.push(r, rw);
+                (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
+              }
+
+              if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
+                _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
+
+                if (_delta2->state(blossom) != _delta2->IN_HEAP) {
+                  _delta2->push(blossom, _blossom_set->classPrio(blossom) -
+                               (*_blossom_data)[blossom].offset);
+                } else if ((*_delta2)[blossom] >
+                           _blossom_set->classPrio(blossom) -
+                           (*_blossom_data)[blossom].offset){
+                  _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
+                                   (*_blossom_data)[blossom].offset);
+                }
+              }
+            }
+
+          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+          } else {
+
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              (*_node_data)[vi].heap.erase(it->second);
+              (*_node_data)[vi].heap_index.erase(it);
+              if ((*_node_data)[vi].heap.empty()) {
+                _blossom_set->increase(v, std::numeric_limits<Value>::max());
+              } else if ((*_blossom_set)[v] < (*_node_data)[vi].heap.prio()) {
+                _blossom_set->increase(v, (*_node_data)[vi].heap.prio());
+              }
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_blossom_set->classPrio(vb) ==
+                    std::numeric_limits<Value>::max()) {
+                  _delta2->erase(vb);
+                } else if ((*_delta2)[vb] < _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset) {
+                  _delta2->increase(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+
+    void oddToMatched(int blossom) {
+      (*_blossom_data)[blossom].offset -= _delta_sum;
+
+      if (_blossom_set->classPrio(blossom) !=
+          std::numeric_limits<Value>::max()) {
+        _delta2->push(blossom, _blossom_set->classPrio(blossom) -
+                       (*_blossom_data)[blossom].offset);
+      }
+
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->erase(blossom);
+      }
+    }
+
+    void oddToEven(int blossom, int tree) {
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->erase(blossom);
+        (*_blossom_data)[blossom].pot -=
+          2 * (2 * _delta_sum - (*_blossom_data)[blossom].offset);
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+
+        _blossom_set->increase(n, std::numeric_limits<Value>::max());
+
+        (*_node_data)[ni].heap.clear();
+        (*_node_data)[ni].heap_index.clear();
+        (*_node_data)[ni].pot +=
+          2 * _delta_sum - (*_blossom_data)[blossom].offset;
+
+        _delta1->push(n, (*_node_data)[ni].pot);
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if ((*_blossom_data)[vb].status == EVEN) {
+            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
+              _delta3->push(e, rw / 2);
+            }
+          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
+            if (_delta3->state(e) != _delta3->IN_HEAP) {
+              _delta3->push(e, rw);
+            }
+          } else {
+
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              if ((*_node_data)[vi].heap[it->second] > rw) {
+                (*_node_data)[vi].heap.replace(it->second, e);
+                (*_node_data)[vi].heap.decrease(e, rw);
+                it->second = e;
+              }
+            } else {
+              (*_node_data)[vi].heap.push(e, rw);
+              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
+            }
+
+            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
+              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_delta2->state(vb) != _delta2->IN_HEAP) {
+                  _delta2->push(vb, _blossom_set->classPrio(vb) -
+                               (*_blossom_data)[vb].offset);
+                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset) {
+                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+      (*_blossom_data)[blossom].offset = 0;
+    }
+
+
+    void matchedToUnmatched(int blossom) {
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+
+        _blossom_set->increase(n, std::numeric_limits<Value>::max());
+
+        (*_node_data)[ni].heap.clear();
+        (*_node_data)[ni].heap_index.clear();
+
+        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.target(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if ((*_blossom_data)[vb].status == EVEN) {
+            if (_delta3->state(e) != _delta3->IN_HEAP) {
+              _delta3->push(e, rw);
+            }
+          }
+        }
+      }
+    }
+
+    void unmatchedToMatched(int blossom) {
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if (vb == blossom) {
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+          } else if ((*_blossom_data)[vb].status == EVEN) {
+
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+
+            int vt = _tree_set->find(vb);
+
+            Arc r = _graph.oppositeArc(e);
+
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[ni].heap_index.find(vt);
+
+            if (it != (*_node_data)[ni].heap_index.end()) {
+              if ((*_node_data)[ni].heap[it->second] > rw) {
+                (*_node_data)[ni].heap.replace(it->second, r);
+                (*_node_data)[ni].heap.decrease(r, rw);
+                it->second = r;
+              }
+            } else {
+              (*_node_data)[ni].heap.push(r, rw);
+              (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
+            }
+
+            if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
+              _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
+
+              if (_delta2->state(blossom) != _delta2->IN_HEAP) {
+                _delta2->push(blossom, _blossom_set->classPrio(blossom) -
+                             (*_blossom_data)[blossom].offset);
+              } else if ((*_delta2)[blossom] > _blossom_set->classPrio(blossom)-
+                         (*_blossom_data)[blossom].offset){
+                _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
+                                 (*_blossom_data)[blossom].offset);
+              }
+            }
+
+          } else if ((*_blossom_data)[vb].status == UNMATCHED) {
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+          }
+        }
+      }
+    }
+
+    void alternatePath(int even, int tree) {
+      int odd;
+
+      evenToMatched(even, tree);
+      (*_blossom_data)[even].status = MATCHED;
+
+      while ((*_blossom_data)[even].pred != INVALID) {
+        odd = _blossom_set->find(_graph.target((*_blossom_data)[even].pred));
+        (*_blossom_data)[odd].status = MATCHED;
+        oddToMatched(odd);
+        (*_blossom_data)[odd].next = (*_blossom_data)[odd].pred;
+
+        even = _blossom_set->find(_graph.target((*_blossom_data)[odd].pred));
+        (*_blossom_data)[even].status = MATCHED;
+        evenToMatched(even, tree);
+        (*_blossom_data)[even].next =
+          _graph.oppositeArc((*_blossom_data)[odd].pred);
+      }
+
+    }
+
+    void destroyTree(int tree) {
+      for (TreeSet::ItemIt b(*_tree_set, tree); b != INVALID; ++b) {
+        if ((*_blossom_data)[b].status == EVEN) {
+          (*_blossom_data)[b].status = MATCHED;
+          evenToMatched(b, tree);
+        } else if ((*_blossom_data)[b].status == ODD) {
+          (*_blossom_data)[b].status = MATCHED;
+          oddToMatched(b);
+        }
+      }
+      _tree_set->eraseClass(tree);
+    }
+
+
+    void unmatchNode(const Node& node) {
+      int blossom = _blossom_set->find(node);
+      int tree = _tree_set->find(blossom);
+
+      alternatePath(blossom, tree);
+      destroyTree(tree);
+
+      (*_blossom_data)[blossom].status = UNMATCHED;
+      (*_blossom_data)[blossom].base = node;
+      matchedToUnmatched(blossom);
+    }
+
+
+    void augmentOnEdge(const Edge& edge) {
+
+      int left = _blossom_set->find(_graph.u(edge));
+      int right = _blossom_set->find(_graph.v(edge));
+
+      if ((*_blossom_data)[left].status == EVEN) {
+        int left_tree = _tree_set->find(left);
+        alternatePath(left, left_tree);
+        destroyTree(left_tree);
+      } else {
+        (*_blossom_data)[left].status = MATCHED;
+        unmatchedToMatched(left);
+      }
+
+      if ((*_blossom_data)[right].status == EVEN) {
+        int right_tree = _tree_set->find(right);
+        alternatePath(right, right_tree);
+        destroyTree(right_tree);
+      } else {
+        (*_blossom_data)[right].status = MATCHED;
+        unmatchedToMatched(right);
+      }
+
+      (*_blossom_data)[left].next = _graph.direct(edge, true);
+      (*_blossom_data)[right].next = _graph.direct(edge, false);
+    }
+
+    void extendOnArc(const Arc& arc) {
+      int base = _blossom_set->find(_graph.target(arc));
+      int tree = _tree_set->find(base);
+
+      int odd = _blossom_set->find(_graph.source(arc));
+      _tree_set->insert(odd, tree);
+      (*_blossom_data)[odd].status = ODD;
+      matchedToOdd(odd);
+      (*_blossom_data)[odd].pred = arc;
+
+      int even = _blossom_set->find(_graph.target((*_blossom_data)[odd].next));
+      (*_blossom_data)[even].pred = (*_blossom_data)[even].next;
+      _tree_set->insert(even, tree);
+      (*_blossom_data)[even].status = EVEN;
+      matchedToEven(even, tree);
+    }
+
+    void shrinkOnEdge(const Edge& edge, int tree) {
+      int nca = -1;
+      std::vector<int> left_path, right_path;
+
+      {
+        std::set<int> left_set, right_set;
+        int left = _blossom_set->find(_graph.u(edge));
+        left_path.push_back(left);
+        left_set.insert(left);
+
+        int right = _blossom_set->find(_graph.v(edge));
+        right_path.push_back(right);
+        right_set.insert(right);
+
+        while (true) {
+
+          if ((*_blossom_data)[left].pred == INVALID) break;
+
+          left =
+            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
+          left_path.push_back(left);
+          left =
+            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
+          left_path.push_back(left);
+
+          left_set.insert(left);
+
+          if (right_set.find(left) != right_set.end()) {
+            nca = left;
+            break;
+          }
+
+          if ((*_blossom_data)[right].pred == INVALID) break;
+
+          right =
+            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
+          right_path.push_back(right);
+          right =
+            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
+          right_path.push_back(right);
+
+          right_set.insert(right);
+
+          if (left_set.find(right) != left_set.end()) {
+            nca = right;
+            break;
+          }
+
+        }
+
+        if (nca == -1) {
+          if ((*_blossom_data)[left].pred == INVALID) {
+            nca = right;
+            while (left_set.find(nca) == left_set.end()) {
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              right_path.push_back(nca);
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              right_path.push_back(nca);
+            }
+          } else {
+            nca = left;
+            while (right_set.find(nca) == right_set.end()) {
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              left_path.push_back(nca);
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              left_path.push_back(nca);
+            }
+          }
+        }
+      }
+
+      std::vector<int> subblossoms;
+      Arc prev;
+
+      prev = _graph.direct(edge, true);
+      for (int i = 0; left_path[i] != nca; i += 2) {
+        subblossoms.push_back(left_path[i]);
+        (*_blossom_data)[left_path[i]].next = prev;
+        _tree_set->erase(left_path[i]);
+
+        subblossoms.push_back(left_path[i + 1]);
+        (*_blossom_data)[left_path[i + 1]].status = EVEN;
+        oddToEven(left_path[i + 1], tree);
+        _tree_set->erase(left_path[i + 1]);
+        prev = _graph.oppositeArc((*_blossom_data)[left_path[i + 1]].pred);
+      }
+
+      int k = 0;
+      while (right_path[k] != nca) ++k;
+
+      subblossoms.push_back(nca);
+      (*_blossom_data)[nca].next = prev;
+
+      for (int i = k - 2; i >= 0; i -= 2) {
+        subblossoms.push_back(right_path[i + 1]);
+        (*_blossom_data)[right_path[i + 1]].status = EVEN;
+        oddToEven(right_path[i + 1], tree);
+        _tree_set->erase(right_path[i + 1]);
+
+        (*_blossom_data)[right_path[i + 1]].next =
+          (*_blossom_data)[right_path[i + 1]].pred;
+
+        subblossoms.push_back(right_path[i]);
+        _tree_set->erase(right_path[i]);
+      }
+
+      int surface =
+        _blossom_set->join(subblossoms.begin(), subblossoms.end());
+
+      for (int i = 0; i < int(subblossoms.size()); ++i) {
+        if (!_blossom_set->trivial(subblossoms[i])) {
+          (*_blossom_data)[subblossoms[i]].pot += 2 * _delta_sum;
+        }
+        (*_blossom_data)[subblossoms[i]].status = MATCHED;
+      }
+
+      (*_blossom_data)[surface].pot = -2 * _delta_sum;
+      (*_blossom_data)[surface].offset = 0;
+      (*_blossom_data)[surface].status = EVEN;
+      (*_blossom_data)[surface].pred = (*_blossom_data)[nca].pred;
+      (*_blossom_data)[surface].next = (*_blossom_data)[nca].pred;
+
+      _tree_set->insert(surface, tree);
+      _tree_set->erase(nca);
+    }
+
+    void splitBlossom(int blossom) {
+      Arc next = (*_blossom_data)[blossom].next;
+      Arc pred = (*_blossom_data)[blossom].pred;
+
+      int tree = _tree_set->find(blossom);
+
+      (*_blossom_data)[blossom].status = MATCHED;
+      oddToMatched(blossom);
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+
+      std::vector<int> subblossoms;
+      _blossom_set->split(blossom, std::back_inserter(subblossoms));
+
+      Value offset = (*_blossom_data)[blossom].offset;
+      int b = _blossom_set->find(_graph.source(pred));
+      int d = _blossom_set->find(_graph.source(next));
+
+      int ib = -1, id = -1;
+      for (int i = 0; i < int(subblossoms.size()); ++i) {
+        if (subblossoms[i] == b) ib = i;
+        if (subblossoms[i] == d) id = i;
+
+        (*_blossom_data)[subblossoms[i]].offset = offset;
+        if (!_blossom_set->trivial(subblossoms[i])) {
+          (*_blossom_data)[subblossoms[i]].pot -= 2 * offset;
+        }
+        if (_blossom_set->classPrio(subblossoms[i]) !=
+            std::numeric_limits<Value>::max()) {
+          _delta2->push(subblossoms[i],
+                        _blossom_set->classPrio(subblossoms[i]) -
+                        (*_blossom_data)[subblossoms[i]].offset);
+        }
+      }
+
+      if (id > ib ? ((id - ib) % 2 == 0) : ((ib - id) % 2 == 1)) {
+        for (int i = (id + 1) % subblossoms.size();
+             i != ib; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          (*_blossom_data)[sb].next =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+        }
+
+        for (int i = ib; i != id; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          int ub = subblossoms[(i + 2) % subblossoms.size()];
+
+          (*_blossom_data)[sb].status = ODD;
+          matchedToOdd(sb);
+          _tree_set->insert(sb, tree);
+          (*_blossom_data)[sb].pred = pred;
+          (*_blossom_data)[sb].next =
+                           _graph.oppositeArc((*_blossom_data)[tb].next);
+
+          pred = (*_blossom_data)[ub].next;
+
+          (*_blossom_data)[tb].status = EVEN;
+          matchedToEven(tb, tree);
+          _tree_set->insert(tb, tree);
+          (*_blossom_data)[tb].pred = (*_blossom_data)[tb].next;
+        }
+
+        (*_blossom_data)[subblossoms[id]].status = ODD;
+        matchedToOdd(subblossoms[id]);
+        _tree_set->insert(subblossoms[id], tree);
+        (*_blossom_data)[subblossoms[id]].next = next;
+        (*_blossom_data)[subblossoms[id]].pred = pred;
+
+      } else {
+
+        for (int i = (ib + 1) % subblossoms.size();
+             i != id; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          (*_blossom_data)[sb].next =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+        }
+
+        for (int i = id; i != ib; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          int ub = subblossoms[(i + 2) % subblossoms.size()];
+
+          (*_blossom_data)[sb].status = ODD;
+          matchedToOdd(sb);
+          _tree_set->insert(sb, tree);
+          (*_blossom_data)[sb].next = next;
+          (*_blossom_data)[sb].pred =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+
+          (*_blossom_data)[tb].status = EVEN;
+          matchedToEven(tb, tree);
+          _tree_set->insert(tb, tree);
+          (*_blossom_data)[tb].pred =
+            (*_blossom_data)[tb].next =
+            _graph.oppositeArc((*_blossom_data)[ub].next);
+          next = (*_blossom_data)[ub].next;
+        }
+
+        (*_blossom_data)[subblossoms[ib]].status = ODD;
+        matchedToOdd(subblossoms[ib]);
+        _tree_set->insert(subblossoms[ib], tree);
+        (*_blossom_data)[subblossoms[ib]].next = next;
+        (*_blossom_data)[subblossoms[ib]].pred = pred;
+      }
+      _tree_set->erase(blossom);
+    }
+
+    void extractBlossom(int blossom, const Node& base, const Arc& matching) {
+      if (_blossom_set->trivial(blossom)) {
+        int bi = (*_node_index)[base];
+        Value pot = (*_node_data)[bi].pot;
+
+        _matching->set(base, matching);
+        _blossom_node_list.push_back(base);
+        _node_potential->set(base, pot);
+      } else {
+
+        Value pot = (*_blossom_data)[blossom].pot;
+        int bn = _blossom_node_list.size();
+
+        std::vector<int> subblossoms;
+        _blossom_set->split(blossom, std::back_inserter(subblossoms));
+        int b = _blossom_set->find(base);
+        int ib = -1;
+        for (int i = 0; i < int(subblossoms.size()); ++i) {
+          if (subblossoms[i] == b) { ib = i; break; }
+        }
+
+        for (int i = 1; i < int(subblossoms.size()); i += 2) {
+          int sb = subblossoms[(ib + i) % subblossoms.size()];
+          int tb = subblossoms[(ib + i + 1) % subblossoms.size()];
+
+          Arc m = (*_blossom_data)[tb].next;
+          extractBlossom(sb, _graph.target(m), _graph.oppositeArc(m));
+          extractBlossom(tb, _graph.source(m), m);
+        }
+        extractBlossom(subblossoms[ib], base, matching);
+
+        int en = _blossom_node_list.size();
+
+        _blossom_potential.push_back(BlossomVariable(bn, en, pot));
+      }
+    }
+
+    void extractMatching() {
+      std::vector<int> blossoms;
+      for (typename BlossomSet::ClassIt c(*_blossom_set); c != INVALID; ++c) {
+        blossoms.push_back(c);
+      }
+
+      for (int i = 0; i < int(blossoms.size()); ++i) {
+        if ((*_blossom_data)[blossoms[i]].status == MATCHED) {
+
+          Value offset = (*_blossom_data)[blossoms[i]].offset;
+          (*_blossom_data)[blossoms[i]].pot += 2 * offset;
+          for (typename BlossomSet::ItemIt n(*_blossom_set, blossoms[i]);
+               n != INVALID; ++n) {
+            (*_node_data)[(*_node_index)[n]].pot -= offset;
+          }
+
+          Arc matching = (*_blossom_data)[blossoms[i]].next;
+          Node base = _graph.source(matching);
+          extractBlossom(blossoms[i], base, matching);
+        } else {
+          Node base = (*_blossom_data)[blossoms[i]].base;
+          extractBlossom(blossoms[i], base, INVALID);
+        }
+      }
+    }
+
+  public:
+
+    /// \brief Constructor
+    ///
+    /// Constructor.
+    MaxWeightedMatching(const Graph& graph, const WeightMap& weight)
+      : _graph(graph), _weight(weight), _matching(0),
+        _node_potential(0), _blossom_potential(), _blossom_node_list(),
+        _node_num(0), _blossom_num(0),
+
+        _blossom_index(0), _blossom_set(0), _blossom_data(0),
+        _node_index(0), _node_heap_index(0), _node_data(0),
+        _tree_set_index(0), _tree_set(0),
+
+        _delta1_index(0), _delta1(0),
+        _delta2_index(0), _delta2(0),
+        _delta3_index(0), _delta3(0),
+        _delta4_index(0), _delta4(0),
+
+        _delta_sum() {}
+
+    ~MaxWeightedMatching() {
+      destroyStructures();
+    }
+
+    /// \name Execution control
+    /// The simplest way to execute the algorithm is to use the
+    /// \c run() member function.
+
+    ///@{
+
+    /// \brief Initialize the algorithm
+    ///
+    /// Initialize the algorithm
+    void init() {
+      createStructures();
+
+      for (ArcIt e(_graph); e != INVALID; ++e) {
+        _node_heap_index->set(e, BinHeap<Value, IntArcMap>::PRE_HEAP);
+      }
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        _delta1_index->set(n, _delta1->PRE_HEAP);
+      }
+      for (EdgeIt e(_graph); e != INVALID; ++e) {
+        _delta3_index->set(e, _delta3->PRE_HEAP);
+      }
+      for (int i = 0; i < _blossom_num; ++i) {
+        _delta2_index->set(i, _delta2->PRE_HEAP);
+        _delta4_index->set(i, _delta4->PRE_HEAP);
+      }
+
+      int index = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        Value max = 0;
+        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
+          if (_graph.target(e) == n) continue;
+          if ((dualScale * _weight[e]) / 2 > max) {
+            max = (dualScale * _weight[e]) / 2;
+          }
+        }
+        _node_index->set(n, index);
+        (*_node_data)[index].pot = max;
+        _delta1->push(n, max);
+        int blossom =
+          _blossom_set->insert(n, std::numeric_limits<Value>::max());
+
+        _tree_set->insert(blossom);
+
+        (*_blossom_data)[blossom].status = EVEN;
+        (*_blossom_data)[blossom].pred = INVALID;
+        (*_blossom_data)[blossom].next = INVALID;
+        (*_blossom_data)[blossom].pot = 0;
+        (*_blossom_data)[blossom].offset = 0;
+        ++index;
+      }
+      for (EdgeIt e(_graph); e != INVALID; ++e) {
+        int si = (*_node_index)[_graph.u(e)];
+        int ti = (*_node_index)[_graph.v(e)];
+        if (_graph.u(e) != _graph.v(e)) {
+          _delta3->push(e, ((*_node_data)[si].pot + (*_node_data)[ti].pot -
+                            dualScale * _weight[e]) / 2);
+        }
+      }
+    }
+
+    /// \brief Starts the algorithm
+    ///
+    /// Starts the algorithm
+    void start() {
+      enum OpType {
+        D1, D2, D3, D4
+      };
+
+      int unmatched = _node_num;
+      while (unmatched > 0) {
+        Value d1 = !_delta1->empty() ?
+          _delta1->prio() : std::numeric_limits<Value>::max();
+
+        Value d2 = !_delta2->empty() ?
+          _delta2->prio() : std::numeric_limits<Value>::max();
+
+        Value d3 = !_delta3->empty() ?
+          _delta3->prio() : std::numeric_limits<Value>::max();
+
+        Value d4 = !_delta4->empty() ?
+          _delta4->prio() : std::numeric_limits<Value>::max();
+
+        _delta_sum = d1; OpType ot = D1;
+        if (d2 < _delta_sum) { _delta_sum = d2; ot = D2; }
+        if (d3 < _delta_sum) { _delta_sum = d3; ot = D3; }
+        if (d4 < _delta_sum) { _delta_sum = d4; ot = D4; }
+
+
+        switch (ot) {
+        case D1:
+          {
+            Node n = _delta1->top();
+            unmatchNode(n);
+            --unmatched;
+          }
+          break;
+        case D2:
+          {
+            int blossom = _delta2->top();
+            Node n = _blossom_set->classTop(blossom);
+            Arc e = (*_node_data)[(*_node_index)[n]].heap.top();
+            extendOnArc(e);
+          }
+          break;
+        case D3:
+          {
+            Edge e = _delta3->top();
+
+            int left_blossom = _blossom_set->find(_graph.u(e));
+            int right_blossom = _blossom_set->find(_graph.v(e));
+
+            if (left_blossom == right_blossom) {
+              _delta3->pop();
+            } else {
+              int left_tree;
+              if ((*_blossom_data)[left_blossom].status == EVEN) {
+                left_tree = _tree_set->find(left_blossom);
+              } else {
+                left_tree = -1;
+                ++unmatched;
+              }
+              int right_tree;
+              if ((*_blossom_data)[right_blossom].status == EVEN) {
+                right_tree = _tree_set->find(right_blossom);
+              } else {
+                right_tree = -1;
+                ++unmatched;
+              }
+
+              if (left_tree == right_tree) {
+                shrinkOnEdge(e, left_tree);
+              } else {
+                augmentOnEdge(e);
+                unmatched -= 2;
+              }
+            }
+          } break;
+        case D4:
+          splitBlossom(_delta4->top());
+          break;
+        }
+      }
+      extractMatching();
+    }
+
+    /// \brief Runs %MaxWeightedMatching algorithm.
+    ///
+    /// This method runs the %MaxWeightedMatching algorithm.
+    ///
+    /// \note mwm.run() is just a shortcut of the following code.
+    /// \code
+    ///   mwm.init();
+    ///   mwm.start();
+    /// \endcode
+    void run() {
+      init();
+      start();
+    }
+
+    /// @}
+
+    /// \name Primal solution
+    /// Functions to get the primal solution, ie. the matching.
+
+    /// @{
+
+    /// \brief Returns the weight of the matching.
+    ///
+    /// Returns the weight of the matching.
+    Value matchingValue() const {
+      Value sum = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_matching)[n] != INVALID) {
+          sum += _weight[(*_matching)[n]];
+        }
+      }
+      return sum /= 2;
+    }
+
+    /// \brief Returns the cardinality of the matching.
+    ///
+    /// Returns the cardinality of the matching.
+    int matchingSize() const {
+      int num = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_matching)[n] != INVALID) {
+          ++num;
+        }
+      }
+      return num /= 2;
+    }
+
+    /// \brief Returns true when the edge is in the matching.
+    ///
+    /// Returns true when the edge is in the matching.
+    bool matching(const Edge& edge) const {
+      return edge == (*_matching)[_graph.u(edge)];
+    }
+
+    /// \brief Returns the incident matching arc.
+    ///
+    /// Returns the incident matching arc from given node. If the
+    /// node is not matched then it gives back \c INVALID.
+    Arc matching(const Node& node) const {
+      return (*_matching)[node];
+    }
+
+    /// \brief Returns the mate of the node.
+    ///
+    /// Returns the adjancent node in a mathcing arc. If the node is
+    /// not matched then it gives back \c INVALID.
+    Node mate(const Node& node) const {
+      return (*_matching)[node] != INVALID ?
+        _graph.target((*_matching)[node]) : INVALID;
+    }
+
+    /// @}
+
+    /// \name Dual solution
+    /// Functions to get the dual solution.
+
+    /// @{
+
+    /// \brief Returns the value of the dual solution.
+    ///
+    /// Returns the value of the dual solution. It should be equal to
+    /// the primal value scaled by \ref dualScale "dual scale".
+    Value dualValue() const {
+      Value sum = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        sum += nodeValue(n);
+      }
+      for (int i = 0; i < blossomNum(); ++i) {
+        sum += blossomValue(i) * (blossomSize(i) / 2);
+      }
+      return sum;
+    }
+
+    /// \brief Returns the value of the node.
+    ///
+    /// Returns the the value of the node.
+    Value nodeValue(const Node& n) const {
+      return (*_node_potential)[n];
+    }
+
+    /// \brief Returns the number of the blossoms in the basis.
+    ///
+    /// Returns the number of the blossoms in the basis.
+    /// \see BlossomIt
+    int blossomNum() const {
+      return _blossom_potential.size();
+    }
+
+
+    /// \brief Returns the number of the nodes in the blossom.
+    ///
+    /// Returns the number of the nodes in the blossom.
+    int blossomSize(int k) const {
+      return _blossom_potential[k].end - _blossom_potential[k].begin;
+    }
+
+    /// \brief Returns the value of the blossom.
+    ///
+    /// Returns the the value of the blossom.
+    /// \see BlossomIt
+    Value blossomValue(int k) const {
+      return _blossom_potential[k].value;
+    }
+
+    /// \brief Iterator for obtaining the nodes of the blossom.
+    ///
+    /// Iterator for obtaining the nodes of the blossom. This class
+    /// provides a common lemon style iterator for listing a
+    /// subset of the nodes.
+    class BlossomIt {
+    public:
+
+      /// \brief Constructor.
+      ///
+      /// Constructor to get the nodes of the variable.
+      BlossomIt(const MaxWeightedMatching& algorithm, int variable)
+        : _algorithm(&algorithm)
+      {
+        _index = _algorithm->_blossom_potential[variable].begin;
+        _last = _algorithm->_blossom_potential[variable].end;
+      }
+
+      /// \brief Conversion to node.
+      ///
+      /// Conversion to node.
+      operator Node() const {
+        return _algorithm->_blossom_node_list[_index];
+      }
+
+      /// \brief Increment operator.
+      ///
+      /// Increment operator.
+      BlossomIt& operator++() {
+        ++_index;
+        return *this;
+      }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is invalid.
+      bool operator==(Invalid) const { return _index == _last; }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is valid.
+      bool operator!=(Invalid) const { return _index != _last; }
+
+    private:
+      const MaxWeightedMatching* _algorithm;
+      int _last;
+      int _index;
+    };
+
+    /// @}
+
+  };
+
+  /// \ingroup matching
+  ///
+  /// \brief Weighted perfect matching in general graphs
+  ///
+  /// This class provides an efficient implementation of Edmond's
+  /// maximum weighted perfect matching algorithm. The implementation
+  /// is based on extensive use of priority queues and provides
+  /// \f$O(nm\log(n))\f$ time complexity.
+  ///
+  /// The maximum weighted matching problem is to find undirected
+  /// edges in the graph with maximum overall weight and no two of
+  /// them shares their ends and covers all nodes. The problem can be
+  /// formulated with the following linear program.
+  /// \f[ \sum_{e \in \delta(u)}x_e = 1 \quad \forall u\in V\f]
+  /** \f[ \sum_{e \in \gamma(B)}x_e \le \frac{\vert B \vert - 1}{2}
+      \quad \forall B\in\mathcal{O}\f] */
+  /// \f[x_e \ge 0\quad \forall e\in E\f]
+  /// \f[\max \sum_{e\in E}x_ew_e\f]
+  /// where \f$\delta(X)\f$ is the set of edges incident to a node in
+  /// \f$X\f$, \f$\gamma(X)\f$ is the set of edges with both ends in
+  /// \f$X\f$ and \f$\mathcal{O}\f$ is the set of odd cardinality
+  /// subsets of the nodes.
+  ///
+  /// The algorithm calculates an optimal matching and a proof of the
+  /// optimality. The solution of the dual problem can be used to check
+  /// the result of the algorithm. The dual linear problem is the
+  /** \f[ y_u + y_v + \sum_{B \in \mathcal{O}, uv \in \gamma(B)}z_B \ge
+      w_{uv} \quad \forall uv\in E\f] */
+  /// \f[z_B \ge 0 \quad \forall B \in \mathcal{O}\f]
+  /** \f[\min \sum_{u \in V}y_u + \sum_{B \in \mathcal{O}}
+      \frac{\vert B \vert - 1}{2}z_B\f] */
+  ///
+  /// The algorithm can be executed with \c run() or the \c init() and
+  /// then the \c start() member functions. After it the matching can
+  /// be asked with \c matching() or mate() functions. The dual
+  /// solution can be get with \c nodeValue(), \c blossomNum() and \c
+  /// blossomValue() members and \ref MaxWeightedMatching::BlossomIt
+  /// "BlossomIt" nested class which is able to iterate on the nodes
+  /// of a blossom. If the value type is integral then the dual
+  /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4".
+  template <typename _Graph,
+            typename _WeightMap = typename _Graph::template EdgeMap<int> >
+  class MaxWeightedPerfectMatching {
+  public:
+
+    typedef _Graph Graph;
+    typedef _WeightMap WeightMap;
+    typedef typename WeightMap::Value Value;
+
+    /// \brief Scaling factor for dual solution
+    ///
+    /// Scaling factor for dual solution, it is equal to 4 or 1
+    /// according to the value type.
+    static const int dualScale =
+      std::numeric_limits<Value>::is_integer ? 4 : 1;
+
+    typedef typename Graph::template NodeMap<typename Graph::Arc>
+    MatchingMap;
+
+  private:
+
+    TEMPLATE_GRAPH_TYPEDEFS(Graph);
+
+    typedef typename Graph::template NodeMap<Value> NodePotential;
+    typedef std::vector<Node> BlossomNodeList;
+
+    struct BlossomVariable {
+      int begin, end;
+      Value value;
+
+      BlossomVariable(int _begin, int _end, Value _value)
+        : begin(_begin), end(_end), value(_value) {}
+
+    };
+
+    typedef std::vector<BlossomVariable> BlossomPotential;
+
+    const Graph& _graph;
+    const WeightMap& _weight;
+
+    MatchingMap* _matching;
+
+    NodePotential* _node_potential;
+
+    BlossomPotential _blossom_potential;
+    BlossomNodeList _blossom_node_list;
+
+    int _node_num;
+    int _blossom_num;
+
+    typedef RangeMap<int> IntIntMap;
+
+    enum Status {
+      EVEN = -1, MATCHED = 0, ODD = 1
+    };
+
+    typedef HeapUnionFind<Value, IntNodeMap> BlossomSet;
+    struct BlossomData {
+      int tree;
+      Status status;
+      Arc pred, next;
+      Value pot, offset;
+    };
+
+    IntNodeMap *_blossom_index;
+    BlossomSet *_blossom_set;
+    RangeMap<BlossomData>* _blossom_data;
+
+    IntNodeMap *_node_index;
+    IntArcMap *_node_heap_index;
+
+    struct NodeData {
+
+      NodeData(IntArcMap& node_heap_index)
+        : heap(node_heap_index) {}
+
+      int blossom;
+      Value pot;
+      BinHeap<Value, IntArcMap> heap;
+      std::map<int, Arc> heap_index;
+
+      int tree;
+    };
+
+    RangeMap<NodeData>* _node_data;
+
+    typedef ExtendFindEnum<IntIntMap> TreeSet;
+
+    IntIntMap *_tree_set_index;
+    TreeSet *_tree_set;
+
+    IntIntMap *_delta2_index;
+    BinHeap<Value, IntIntMap> *_delta2;
+
+    IntEdgeMap *_delta3_index;
+    BinHeap<Value, IntEdgeMap> *_delta3;
+
+    IntIntMap *_delta4_index;
+    BinHeap<Value, IntIntMap> *_delta4;
+
+    Value _delta_sum;
+
+    void createStructures() {
+      _node_num = countNodes(_graph);
+      _blossom_num = _node_num * 3 / 2;
+
+      if (!_matching) {
+        _matching = new MatchingMap(_graph);
+      }
+      if (!_node_potential) {
+        _node_potential = new NodePotential(_graph);
+      }
+      if (!_blossom_set) {
+        _blossom_index = new IntNodeMap(_graph);
+        _blossom_set = new BlossomSet(*_blossom_index);
+        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
+      }
+
+      if (!_node_index) {
+        _node_index = new IntNodeMap(_graph);
+        _node_heap_index = new IntArcMap(_graph);
+        _node_data = new RangeMap<NodeData>(_node_num,
+                                            NodeData(*_node_heap_index));
+      }
+
+      if (!_tree_set) {
+        _tree_set_index = new IntIntMap(_blossom_num);
+        _tree_set = new TreeSet(*_tree_set_index);
+      }
+      if (!_delta2) {
+        _delta2_index = new IntIntMap(_blossom_num);
+        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
+      }
+      if (!_delta3) {
+        _delta3_index = new IntEdgeMap(_graph);
+        _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index);
+      }
+      if (!_delta4) {
+        _delta4_index = new IntIntMap(_blossom_num);
+        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
+      }
+    }
+
+    void destroyStructures() {
+      _node_num = countNodes(_graph);
+      _blossom_num = _node_num * 3 / 2;
+
+      if (_matching) {
+        delete _matching;
+      }
+      if (_node_potential) {
+        delete _node_potential;
+      }
+      if (_blossom_set) {
+        delete _blossom_index;
+        delete _blossom_set;
+        delete _blossom_data;
+      }
+
+      if (_node_index) {
+        delete _node_index;
+        delete _node_heap_index;
+        delete _node_data;
+      }
+
+      if (_tree_set) {
+        delete _tree_set_index;
+        delete _tree_set;
+      }
+      if (_delta2) {
+        delete _delta2_index;
+        delete _delta2;
+      }
+      if (_delta3) {
+        delete _delta3_index;
+        delete _delta3;
+      }
+      if (_delta4) {
+        delete _delta4_index;
+        delete _delta4;
+      }
+    }
+
+    void matchedToEven(int blossom, int tree) {
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+
+      if (!_blossom_set->trivial(blossom)) {
+        (*_blossom_data)[blossom].pot -=
+          2 * (_delta_sum - (*_blossom_data)[blossom].offset);
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+
+        _blossom_set->increase(n, std::numeric_limits<Value>::max());
+        int ni = (*_node_index)[n];
+
+        (*_node_data)[ni].heap.clear();
+        (*_node_data)[ni].heap_index.clear();
+
+        (*_node_data)[ni].pot += _delta_sum - (*_blossom_data)[blossom].offset;
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if ((*_blossom_data)[vb].status == EVEN) {
+            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
+              _delta3->push(e, rw / 2);
+            }
+          } else {
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              if ((*_node_data)[vi].heap[it->second] > rw) {
+                (*_node_data)[vi].heap.replace(it->second, e);
+                (*_node_data)[vi].heap.decrease(e, rw);
+                it->second = e;
+              }
+            } else {
+              (*_node_data)[vi].heap.push(e, rw);
+              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
+            }
+
+            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
+              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_delta2->state(vb) != _delta2->IN_HEAP) {
+                  _delta2->push(vb, _blossom_set->classPrio(vb) -
+                               (*_blossom_data)[vb].offset);
+                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset){
+                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+      (*_blossom_data)[blossom].offset = 0;
+    }
+
+    void matchedToOdd(int blossom) {
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+      (*_blossom_data)[blossom].offset += _delta_sum;
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->push(blossom, (*_blossom_data)[blossom].pot / 2 +
+                     (*_blossom_data)[blossom].offset);
+      }
+    }
+
+    void evenToMatched(int blossom, int tree) {
+      if (!_blossom_set->trivial(blossom)) {
+        (*_blossom_data)[blossom].pot += 2 * _delta_sum;
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+        (*_node_data)[ni].pot -= _delta_sum;
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if (vb == blossom) {
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+          } else if ((*_blossom_data)[vb].status == EVEN) {
+
+            if (_delta3->state(e) == _delta3->IN_HEAP) {
+              _delta3->erase(e);
+            }
+
+            int vt = _tree_set->find(vb);
+
+            if (vt != tree) {
+
+              Arc r = _graph.oppositeArc(e);
+
+              typename std::map<int, Arc>::iterator it =
+                (*_node_data)[ni].heap_index.find(vt);
+
+              if (it != (*_node_data)[ni].heap_index.end()) {
+                if ((*_node_data)[ni].heap[it->second] > rw) {
+                  (*_node_data)[ni].heap.replace(it->second, r);
+                  (*_node_data)[ni].heap.decrease(r, rw);
+                  it->second = r;
+                }
+              } else {
+                (*_node_data)[ni].heap.push(r, rw);
+                (*_node_data)[ni].heap_index.insert(std::make_pair(vt, r));
+              }
+
+              if ((*_blossom_set)[n] > (*_node_data)[ni].heap.prio()) {
+                _blossom_set->decrease(n, (*_node_data)[ni].heap.prio());
+
+                if (_delta2->state(blossom) != _delta2->IN_HEAP) {
+                  _delta2->push(blossom, _blossom_set->classPrio(blossom) -
+                               (*_blossom_data)[blossom].offset);
+                } else if ((*_delta2)[blossom] >
+                           _blossom_set->classPrio(blossom) -
+                           (*_blossom_data)[blossom].offset){
+                  _delta2->decrease(blossom, _blossom_set->classPrio(blossom) -
+                                   (*_blossom_data)[blossom].offset);
+                }
+              }
+            }
+          } else {
+
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              (*_node_data)[vi].heap.erase(it->second);
+              (*_node_data)[vi].heap_index.erase(it);
+              if ((*_node_data)[vi].heap.empty()) {
+                _blossom_set->increase(v, std::numeric_limits<Value>::max());
+              } else if ((*_blossom_set)[v] < (*_node_data)[vi].heap.prio()) {
+                _blossom_set->increase(v, (*_node_data)[vi].heap.prio());
+              }
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_blossom_set->classPrio(vb) ==
+                    std::numeric_limits<Value>::max()) {
+                  _delta2->erase(vb);
+                } else if ((*_delta2)[vb] < _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset) {
+                  _delta2->increase(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+
+    void oddToMatched(int blossom) {
+      (*_blossom_data)[blossom].offset -= _delta_sum;
+
+      if (_blossom_set->classPrio(blossom) !=
+          std::numeric_limits<Value>::max()) {
+        _delta2->push(blossom, _blossom_set->classPrio(blossom) -
+                       (*_blossom_data)[blossom].offset);
+      }
+
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->erase(blossom);
+      }
+    }
+
+    void oddToEven(int blossom, int tree) {
+      if (!_blossom_set->trivial(blossom)) {
+        _delta4->erase(blossom);
+        (*_blossom_data)[blossom].pot -=
+          2 * (2 * _delta_sum - (*_blossom_data)[blossom].offset);
+      }
+
+      for (typename BlossomSet::ItemIt n(*_blossom_set, blossom);
+           n != INVALID; ++n) {
+        int ni = (*_node_index)[n];
+
+        _blossom_set->increase(n, std::numeric_limits<Value>::max());
+
+        (*_node_data)[ni].heap.clear();
+        (*_node_data)[ni].heap_index.clear();
+        (*_node_data)[ni].pot +=
+          2 * _delta_sum - (*_blossom_data)[blossom].offset;
+
+        for (InArcIt e(_graph, n); e != INVALID; ++e) {
+          Node v = _graph.source(e);
+          int vb = _blossom_set->find(v);
+          int vi = (*_node_index)[v];
+
+          Value rw = (*_node_data)[ni].pot + (*_node_data)[vi].pot -
+            dualScale * _weight[e];
+
+          if ((*_blossom_data)[vb].status == EVEN) {
+            if (_delta3->state(e) != _delta3->IN_HEAP && blossom != vb) {
+              _delta3->push(e, rw / 2);
+            }
+          } else {
+
+            typename std::map<int, Arc>::iterator it =
+              (*_node_data)[vi].heap_index.find(tree);
+
+            if (it != (*_node_data)[vi].heap_index.end()) {
+              if ((*_node_data)[vi].heap[it->second] > rw) {
+                (*_node_data)[vi].heap.replace(it->second, e);
+                (*_node_data)[vi].heap.decrease(e, rw);
+                it->second = e;
+              }
+            } else {
+              (*_node_data)[vi].heap.push(e, rw);
+              (*_node_data)[vi].heap_index.insert(std::make_pair(tree, e));
+            }
+
+            if ((*_blossom_set)[v] > (*_node_data)[vi].heap.prio()) {
+              _blossom_set->decrease(v, (*_node_data)[vi].heap.prio());
+
+              if ((*_blossom_data)[vb].status == MATCHED) {
+                if (_delta2->state(vb) != _delta2->IN_HEAP) {
+                  _delta2->push(vb, _blossom_set->classPrio(vb) -
+                               (*_blossom_data)[vb].offset);
+                } else if ((*_delta2)[vb] > _blossom_set->classPrio(vb) -
+                           (*_blossom_data)[vb].offset) {
+                  _delta2->decrease(vb, _blossom_set->classPrio(vb) -
+                                   (*_blossom_data)[vb].offset);
+                }
+              }
+            }
+          }
+        }
+      }
+      (*_blossom_data)[blossom].offset = 0;
+    }
+
+    void alternatePath(int even, int tree) {
+      int odd;
+
+      evenToMatched(even, tree);
+      (*_blossom_data)[even].status = MATCHED;
+
+      while ((*_blossom_data)[even].pred != INVALID) {
+        odd = _blossom_set->find(_graph.target((*_blossom_data)[even].pred));
+        (*_blossom_data)[odd].status = MATCHED;
+        oddToMatched(odd);
+        (*_blossom_data)[odd].next = (*_blossom_data)[odd].pred;
+
+        even = _blossom_set->find(_graph.target((*_blossom_data)[odd].pred));
+        (*_blossom_data)[even].status = MATCHED;
+        evenToMatched(even, tree);
+        (*_blossom_data)[even].next =
+          _graph.oppositeArc((*_blossom_data)[odd].pred);
+      }
+
+    }
+
+    void destroyTree(int tree) {
+      for (TreeSet::ItemIt b(*_tree_set, tree); b != INVALID; ++b) {
+        if ((*_blossom_data)[b].status == EVEN) {
+          (*_blossom_data)[b].status = MATCHED;
+          evenToMatched(b, tree);
+        } else if ((*_blossom_data)[b].status == ODD) {
+          (*_blossom_data)[b].status = MATCHED;
+          oddToMatched(b);
+        }
+      }
+      _tree_set->eraseClass(tree);
+    }
+
+    void augmentOnEdge(const Edge& edge) {
+
+      int left = _blossom_set->find(_graph.u(edge));
+      int right = _blossom_set->find(_graph.v(edge));
+
+      int left_tree = _tree_set->find(left);
+      alternatePath(left, left_tree);
+      destroyTree(left_tree);
+
+      int right_tree = _tree_set->find(right);
+      alternatePath(right, right_tree);
+      destroyTree(right_tree);
+
+      (*_blossom_data)[left].next = _graph.direct(edge, true);
+      (*_blossom_data)[right].next = _graph.direct(edge, false);
+    }
+
+    void extendOnArc(const Arc& arc) {
+      int base = _blossom_set->find(_graph.target(arc));
+      int tree = _tree_set->find(base);
+
+      int odd = _blossom_set->find(_graph.source(arc));
+      _tree_set->insert(odd, tree);
+      (*_blossom_data)[odd].status = ODD;
+      matchedToOdd(odd);
+      (*_blossom_data)[odd].pred = arc;
+
+      int even = _blossom_set->find(_graph.target((*_blossom_data)[odd].next));
+      (*_blossom_data)[even].pred = (*_blossom_data)[even].next;
+      _tree_set->insert(even, tree);
+      (*_blossom_data)[even].status = EVEN;
+      matchedToEven(even, tree);
+    }
+
+    void shrinkOnEdge(const Edge& edge, int tree) {
+      int nca = -1;
+      std::vector<int> left_path, right_path;
+
+      {
+        std::set<int> left_set, right_set;
+        int left = _blossom_set->find(_graph.u(edge));
+        left_path.push_back(left);
+        left_set.insert(left);
+
+        int right = _blossom_set->find(_graph.v(edge));
+        right_path.push_back(right);
+        right_set.insert(right);
+
+        while (true) {
+
+          if ((*_blossom_data)[left].pred == INVALID) break;
+
+          left =
+            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
+          left_path.push_back(left);
+          left =
+            _blossom_set->find(_graph.target((*_blossom_data)[left].pred));
+          left_path.push_back(left);
+
+          left_set.insert(left);
+
+          if (right_set.find(left) != right_set.end()) {
+            nca = left;
+            break;
+          }
+
+          if ((*_blossom_data)[right].pred == INVALID) break;
+
+          right =
+            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
+          right_path.push_back(right);
+          right =
+            _blossom_set->find(_graph.target((*_blossom_data)[right].pred));
+          right_path.push_back(right);
+
+          right_set.insert(right);
+
+          if (left_set.find(right) != left_set.end()) {
+            nca = right;
+            break;
+          }
+
+        }
+
+        if (nca == -1) {
+          if ((*_blossom_data)[left].pred == INVALID) {
+            nca = right;
+            while (left_set.find(nca) == left_set.end()) {
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              right_path.push_back(nca);
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              right_path.push_back(nca);
+            }
+          } else {
+            nca = left;
+            while (right_set.find(nca) == right_set.end()) {
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              left_path.push_back(nca);
+              nca =
+                _blossom_set->find(_graph.target((*_blossom_data)[nca].pred));
+              left_path.push_back(nca);
+            }
+          }
+        }
+      }
+
+      std::vector<int> subblossoms;
+      Arc prev;
+
+      prev = _graph.direct(edge, true);
+      for (int i = 0; left_path[i] != nca; i += 2) {
+        subblossoms.push_back(left_path[i]);
+        (*_blossom_data)[left_path[i]].next = prev;
+        _tree_set->erase(left_path[i]);
+
+        subblossoms.push_back(left_path[i + 1]);
+        (*_blossom_data)[left_path[i + 1]].status = EVEN;
+        oddToEven(left_path[i + 1], tree);
+        _tree_set->erase(left_path[i + 1]);
+        prev = _graph.oppositeArc((*_blossom_data)[left_path[i + 1]].pred);
+      }
+
+      int k = 0;
+      while (right_path[k] != nca) ++k;
+
+      subblossoms.push_back(nca);
+      (*_blossom_data)[nca].next = prev;
+
+      for (int i = k - 2; i >= 0; i -= 2) {
+        subblossoms.push_back(right_path[i + 1]);
+        (*_blossom_data)[right_path[i + 1]].status = EVEN;
+        oddToEven(right_path[i + 1], tree);
+        _tree_set->erase(right_path[i + 1]);
+
+        (*_blossom_data)[right_path[i + 1]].next =
+          (*_blossom_data)[right_path[i + 1]].pred;
+
+        subblossoms.push_back(right_path[i]);
+        _tree_set->erase(right_path[i]);
+      }
+
+      int surface =
+        _blossom_set->join(subblossoms.begin(), subblossoms.end());
+
+      for (int i = 0; i < int(subblossoms.size()); ++i) {
+        if (!_blossom_set->trivial(subblossoms[i])) {
+          (*_blossom_data)[subblossoms[i]].pot += 2 * _delta_sum;
+        }
+        (*_blossom_data)[subblossoms[i]].status = MATCHED;
+      }
+
+      (*_blossom_data)[surface].pot = -2 * _delta_sum;
+      (*_blossom_data)[surface].offset = 0;
+      (*_blossom_data)[surface].status = EVEN;
+      (*_blossom_data)[surface].pred = (*_blossom_data)[nca].pred;
+      (*_blossom_data)[surface].next = (*_blossom_data)[nca].pred;
+
+      _tree_set->insert(surface, tree);
+      _tree_set->erase(nca);
+    }
+
+    void splitBlossom(int blossom) {
+      Arc next = (*_blossom_data)[blossom].next;
+      Arc pred = (*_blossom_data)[blossom].pred;
+
+      int tree = _tree_set->find(blossom);
+
+      (*_blossom_data)[blossom].status = MATCHED;
+      oddToMatched(blossom);
+      if (_delta2->state(blossom) == _delta2->IN_HEAP) {
+        _delta2->erase(blossom);
+      }
+
+      std::vector<int> subblossoms;
+      _blossom_set->split(blossom, std::back_inserter(subblossoms));
+
+      Value offset = (*_blossom_data)[blossom].offset;
+      int b = _blossom_set->find(_graph.source(pred));
+      int d = _blossom_set->find(_graph.source(next));
+
+      int ib = -1, id = -1;
+      for (int i = 0; i < int(subblossoms.size()); ++i) {
+        if (subblossoms[i] == b) ib = i;
+        if (subblossoms[i] == d) id = i;
+
+        (*_blossom_data)[subblossoms[i]].offset = offset;
+        if (!_blossom_set->trivial(subblossoms[i])) {
+          (*_blossom_data)[subblossoms[i]].pot -= 2 * offset;
+        }
+        if (_blossom_set->classPrio(subblossoms[i]) !=
+            std::numeric_limits<Value>::max()) {
+          _delta2->push(subblossoms[i],
+                        _blossom_set->classPrio(subblossoms[i]) -
+                        (*_blossom_data)[subblossoms[i]].offset);
+        }
+      }
+
+      if (id > ib ? ((id - ib) % 2 == 0) : ((ib - id) % 2 == 1)) {
+        for (int i = (id + 1) % subblossoms.size();
+             i != ib; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          (*_blossom_data)[sb].next =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+        }
+
+        for (int i = ib; i != id; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          int ub = subblossoms[(i + 2) % subblossoms.size()];
+
+          (*_blossom_data)[sb].status = ODD;
+          matchedToOdd(sb);
+          _tree_set->insert(sb, tree);
+          (*_blossom_data)[sb].pred = pred;
+          (*_blossom_data)[sb].next =
+                           _graph.oppositeArc((*_blossom_data)[tb].next);
+
+          pred = (*_blossom_data)[ub].next;
+
+          (*_blossom_data)[tb].status = EVEN;
+          matchedToEven(tb, tree);
+          _tree_set->insert(tb, tree);
+          (*_blossom_data)[tb].pred = (*_blossom_data)[tb].next;
+        }
+
+        (*_blossom_data)[subblossoms[id]].status = ODD;
+        matchedToOdd(subblossoms[id]);
+        _tree_set->insert(subblossoms[id], tree);
+        (*_blossom_data)[subblossoms[id]].next = next;
+        (*_blossom_data)[subblossoms[id]].pred = pred;
+
+      } else {
+
+        for (int i = (ib + 1) % subblossoms.size();
+             i != id; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          (*_blossom_data)[sb].next =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+        }
+
+        for (int i = id; i != ib; i = (i + 2) % subblossoms.size()) {
+          int sb = subblossoms[i];
+          int tb = subblossoms[(i + 1) % subblossoms.size()];
+          int ub = subblossoms[(i + 2) % subblossoms.size()];
+
+          (*_blossom_data)[sb].status = ODD;
+          matchedToOdd(sb);
+          _tree_set->insert(sb, tree);
+          (*_blossom_data)[sb].next = next;
+          (*_blossom_data)[sb].pred =
+            _graph.oppositeArc((*_blossom_data)[tb].next);
+
+          (*_blossom_data)[tb].status = EVEN;
+          matchedToEven(tb, tree);
+          _tree_set->insert(tb, tree);
+          (*_blossom_data)[tb].pred =
+            (*_blossom_data)[tb].next =
+            _graph.oppositeArc((*_blossom_data)[ub].next);
+          next = (*_blossom_data)[ub].next;
+        }
+
+        (*_blossom_data)[subblossoms[ib]].status = ODD;
+        matchedToOdd(subblossoms[ib]);
+        _tree_set->insert(subblossoms[ib], tree);
+        (*_blossom_data)[subblossoms[ib]].next = next;
+        (*_blossom_data)[subblossoms[ib]].pred = pred;
+      }
+      _tree_set->erase(blossom);
+    }
+
+    void extractBlossom(int blossom, const Node& base, const Arc& matching) {
+      if (_blossom_set->trivial(blossom)) {
+        int bi = (*_node_index)[base];
+        Value pot = (*_node_data)[bi].pot;
+
+        _matching->set(base, matching);
+        _blossom_node_list.push_back(base);
+        _node_potential->set(base, pot);
+      } else {
+
+        Value pot = (*_blossom_data)[blossom].pot;
+        int bn = _blossom_node_list.size();
+
+        std::vector<int> subblossoms;
+        _blossom_set->split(blossom, std::back_inserter(subblossoms));
+        int b = _blossom_set->find(base);
+        int ib = -1;
+        for (int i = 0; i < int(subblossoms.size()); ++i) {
+          if (subblossoms[i] == b) { ib = i; break; }
+        }
+
+        for (int i = 1; i < int(subblossoms.size()); i += 2) {
+          int sb = subblossoms[(ib + i) % subblossoms.size()];
+          int tb = subblossoms[(ib + i + 1) % subblossoms.size()];
+
+          Arc m = (*_blossom_data)[tb].next;
+          extractBlossom(sb, _graph.target(m), _graph.oppositeArc(m));
+          extractBlossom(tb, _graph.source(m), m);
+        }
+        extractBlossom(subblossoms[ib], base, matching);
+
+        int en = _blossom_node_list.size();
+
+        _blossom_potential.push_back(BlossomVariable(bn, en, pot));
+      }
+    }
+
+    void extractMatching() {
+      std::vector<int> blossoms;
+      for (typename BlossomSet::ClassIt c(*_blossom_set); c != INVALID; ++c) {
+        blossoms.push_back(c);
+      }
+
+      for (int i = 0; i < int(blossoms.size()); ++i) {
+
+        Value offset = (*_blossom_data)[blossoms[i]].offset;
+        (*_blossom_data)[blossoms[i]].pot += 2 * offset;
+        for (typename BlossomSet::ItemIt n(*_blossom_set, blossoms[i]);
+             n != INVALID; ++n) {
+          (*_node_data)[(*_node_index)[n]].pot -= offset;
+        }
+
+        Arc matching = (*_blossom_data)[blossoms[i]].next;
+        Node base = _graph.source(matching);
+        extractBlossom(blossoms[i], base, matching);
+      }
+    }
+
+  public:
+
+    /// \brief Constructor
+    ///
+    /// Constructor.
+    MaxWeightedPerfectMatching(const Graph& graph, const WeightMap& weight)
+      : _graph(graph), _weight(weight), _matching(0),
+        _node_potential(0), _blossom_potential(), _blossom_node_list(),
+        _node_num(0), _blossom_num(0),
+
+        _blossom_index(0), _blossom_set(0), _blossom_data(0),
+        _node_index(0), _node_heap_index(0), _node_data(0),
+        _tree_set_index(0), _tree_set(0),
+
+        _delta2_index(0), _delta2(0),
+        _delta3_index(0), _delta3(0),
+        _delta4_index(0), _delta4(0),
+
+        _delta_sum() {}
+
+    ~MaxWeightedPerfectMatching() {
+      destroyStructures();
+    }
+
+    /// \name Execution control
+    /// The simplest way to execute the algorithm is to use the
+    /// \c run() member function.
+
+    ///@{
+
+    /// \brief Initialize the algorithm
+    ///
+    /// Initialize the algorithm
+    void init() {
+      createStructures();
+
+      for (ArcIt e(_graph); e != INVALID; ++e) {
+        _node_heap_index->set(e, BinHeap<Value, IntArcMap>::PRE_HEAP);
+      }
+      for (EdgeIt e(_graph); e != INVALID; ++e) {
+        _delta3_index->set(e, _delta3->PRE_HEAP);
+      }
+      for (int i = 0; i < _blossom_num; ++i) {
+        _delta2_index->set(i, _delta2->PRE_HEAP);
+        _delta4_index->set(i, _delta4->PRE_HEAP);
+      }
+
+      int index = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        Value max = - std::numeric_limits<Value>::max();
+        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
+          if (_graph.target(e) == n) continue;
+          if ((dualScale * _weight[e]) / 2 > max) {
+            max = (dualScale * _weight[e]) / 2;
+          }
+        }
+        _node_index->set(n, index);
+        (*_node_data)[index].pot = max;
+        int blossom =
+          _blossom_set->insert(n, std::numeric_limits<Value>::max());
+
+        _tree_set->insert(blossom);
+
+        (*_blossom_data)[blossom].status = EVEN;
+        (*_blossom_data)[blossom].pred = INVALID;
+        (*_blossom_data)[blossom].next = INVALID;
+        (*_blossom_data)[blossom].pot = 0;
+        (*_blossom_data)[blossom].offset = 0;
+        ++index;
+      }
+      for (EdgeIt e(_graph); e != INVALID; ++e) {
+        int si = (*_node_index)[_graph.u(e)];
+        int ti = (*_node_index)[_graph.v(e)];
+        if (_graph.u(e) != _graph.v(e)) {
+          _delta3->push(e, ((*_node_data)[si].pot + (*_node_data)[ti].pot -
+                            dualScale * _weight[e]) / 2);
+        }
+      }
+    }
+
+    /// \brief Starts the algorithm
+    ///
+    /// Starts the algorithm
+    bool start() {
+      enum OpType {
+        D2, D3, D4
+      };
+
+      int unmatched = _node_num;
+      while (unmatched > 0) {
+        Value d2 = !_delta2->empty() ?
+          _delta2->prio() : std::numeric_limits<Value>::max();
+
+        Value d3 = !_delta3->empty() ?
+          _delta3->prio() : std::numeric_limits<Value>::max();
+
+        Value d4 = !_delta4->empty() ?
+          _delta4->prio() : std::numeric_limits<Value>::max();
+
+        _delta_sum = d2; OpType ot = D2;
+        if (d3 < _delta_sum) { _delta_sum = d3; ot = D3; }
+        if (d4 < _delta_sum) { _delta_sum = d4; ot = D4; }
+
+        if (_delta_sum == std::numeric_limits<Value>::max()) {
+          return false;
+        }
+
+        switch (ot) {
+        case D2:
+          {
+            int blossom = _delta2->top();
+            Node n = _blossom_set->classTop(blossom);
+            Arc e = (*_node_data)[(*_node_index)[n]].heap.top();
+            extendOnArc(e);
+          }
+          break;
+        case D3:
+          {
+            Edge e = _delta3->top();
+
+            int left_blossom = _blossom_set->find(_graph.u(e));
+            int right_blossom = _blossom_set->find(_graph.v(e));
+
+            if (left_blossom == right_blossom) {
+              _delta3->pop();
+            } else {
+              int left_tree = _tree_set->find(left_blossom);
+              int right_tree = _tree_set->find(right_blossom);
+
+              if (left_tree == right_tree) {
+                shrinkOnEdge(e, left_tree);
+              } else {
+                augmentOnEdge(e);
+                unmatched -= 2;
+              }
+            }
+          } break;
+        case D4:
+          splitBlossom(_delta4->top());
+          break;
+        }
+      }
+      extractMatching();
+      return true;
+    }
+
+    /// \brief Runs %MaxWeightedPerfectMatching algorithm.
+    ///
+    /// This method runs the %MaxWeightedPerfectMatching algorithm.
+    ///
+    /// \note mwm.run() is just a shortcut of the following code.
+    /// \code
+    ///   mwm.init();
+    ///   mwm.start();
+    /// \endcode
+    bool run() {
+      init();
+      return start();
+    }
+
+    /// @}
+
+    /// \name Primal solution
+    /// Functions to get the primal solution, ie. the matching.
+
+    /// @{
+
+    /// \brief Returns the matching value.
+    ///
+    /// Returns the matching value.
+    Value matchingValue() const {
+      Value sum = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        if ((*_matching)[n] != INVALID) {
+          sum += _weight[(*_matching)[n]];
+        }
+      }
+      return sum /= 2;
+    }
+
+    /// \brief Returns true when the edge is in the matching.
+    ///
+    /// Returns true when the edge is in the matching.
+    bool matching(const Edge& edge) const {
+      return static_cast<const Edge&>((*_matching)[_graph.u(edge)]) == edge;
+    }
+
+    /// \brief Returns the incident matching edge.
+    ///
+    /// Returns the incident matching arc from given edge.
+    Arc matching(const Node& node) const {
+      return (*_matching)[node];
+    }
+
+    /// \brief Returns the mate of the node.
+    ///
+    /// Returns the adjancent node in a mathcing arc.
+    Node mate(const Node& node) const {
+      return _graph.target((*_matching)[node]);
+    }
+
+    /// @}
+
+    /// \name Dual solution
+    /// Functions to get the dual solution.
+
+    /// @{
+
+    /// \brief Returns the value of the dual solution.
+    ///
+    /// Returns the value of the dual solution. It should be equal to
+    /// the primal value scaled by \ref dualScale "dual scale".
+    Value dualValue() const {
+      Value sum = 0;
+      for (NodeIt n(_graph); n != INVALID; ++n) {
+        sum += nodeValue(n);
+      }
+      for (int i = 0; i < blossomNum(); ++i) {
+        sum += blossomValue(i) * (blossomSize(i) / 2);
+      }
+      return sum;
+    }
+
+    /// \brief Returns the value of the node.
+    ///
+    /// Returns the the value of the node.
+    Value nodeValue(const Node& n) const {
+      return (*_node_potential)[n];
+    }
+
+    /// \brief Returns the number of the blossoms in the basis.
+    ///
+    /// Returns the number of the blossoms in the basis.
+    /// \see BlossomIt
+    int blossomNum() const {
+      return _blossom_potential.size();
+    }
+
+
+    /// \brief Returns the number of the nodes in the blossom.
+    ///
+    /// Returns the number of the nodes in the blossom.
+    int blossomSize(int k) const {
+      return _blossom_potential[k].end - _blossom_potential[k].begin;
+    }
+
+    /// \brief Returns the value of the blossom.
+    ///
+    /// Returns the the value of the blossom.
+    /// \see BlossomIt
+    Value blossomValue(int k) const {
+      return _blossom_potential[k].value;
+    }
+
+    /// \brief Iterator for obtaining the nodes of the blossom.
+    ///
+    /// Iterator for obtaining the nodes of the blossom. This class
+    /// provides a common lemon style iterator for listing a
+    /// subset of the nodes.
+    class BlossomIt {
+    public:
+
+      /// \brief Constructor.
+      ///
+      /// Constructor to get the nodes of the variable.
+      BlossomIt(const MaxWeightedPerfectMatching& algorithm, int variable)
+        : _algorithm(&algorithm)
+      {
+        _index = _algorithm->_blossom_potential[variable].begin;
+        _last = _algorithm->_blossom_potential[variable].end;
+      }
+
+      /// \brief Conversion to node.
+      ///
+      /// Conversion to node.
+      operator Node() const {
+        return _algorithm->_blossom_node_list[_index];
+      }
+
+      /// \brief Increment operator.
+      ///
+      /// Increment operator.
+      BlossomIt& operator++() {
+        ++_index;
+        return *this;
+      }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is invalid.
+      bool operator==(Invalid) const { return _index == _last; }
+
+      /// \brief Validity checking
+      ///
+      /// Checks whether the iterator is valid.
+      bool operator!=(Invalid) const { return _index != _last; }
+
+    private:
+      const MaxWeightedPerfectMatching* _algorithm;
+      int _last;
+      int _index;
+    };
+
+    /// @}
+
+  };
+
+
+} //END OF NAMESPACE LEMON
+
+#endif //LEMON_MAX_MATCHING_H
Index: lemon/min_cost_arborescence.h
===================================================================
--- lemon/min_cost_arborescence.h	(revision 584)
+++ lemon/min_cost_arborescence.h	(revision 490)
@@ -36,11 +36,11 @@
   ///
   /// Default traits class for MinCostArborescence class.
-  /// \param GR Digraph type.
-  /// \param CM Type of cost map.
-  template <class GR, class CM>
+  /// \param _Digraph Digraph type.
+  /// \param _CostMap Type of cost map.
+  template <class _Digraph, class _CostMap>
   struct MinCostArborescenceDefaultTraits{
 
     /// \brief The digraph type the algorithm runs on.
-    typedef GR Digraph;
+    typedef _Digraph Digraph;
 
     /// \brief The type of the map that stores the arc costs.
@@ -48,5 +48,5 @@
     /// The type of the map that stores the arc costs.
     /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef CM CostMap;
+    typedef _CostMap CostMap;
 
     /// \brief The value type of the costs.
@@ -64,23 +64,23 @@
     typedef typename Digraph::template ArcMap<bool> ArborescenceMap;
 
-    /// \brief Instantiates a \c ArborescenceMap.
-    ///
-    /// This function instantiates a \c ArborescenceMap.
+    /// \brief Instantiates a ArborescenceMap.
+    ///
+    /// This function instantiates a \ref ArborescenceMap.
     /// \param digraph is the graph, to which we would like to
-    /// calculate the \c ArborescenceMap.
+    /// calculate the ArborescenceMap.
     static ArborescenceMap *createArborescenceMap(const Digraph &digraph){
       return new ArborescenceMap(digraph);
     }
 
-    /// \brief The type of the \c PredMap
-    ///
-    /// The type of the \c PredMap. It is a node map with an arc value type.
+    /// \brief The type of the PredMap
+    ///
+    /// The type of the PredMap. It is a node map with an arc value type.
     typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
 
-    /// \brief Instantiates a \c PredMap.
-    ///
-    /// This function instantiates a \c PredMap.
-    /// \param digraph The digraph to which we would like to define the
-    /// \c PredMap.
+    /// \brief Instantiates a PredMap.
+    ///
+    /// This function instantiates a \ref PredMap.
+    /// \param _digraph is the digraph, to which we would like to define the
+    /// PredMap.
     static PredMap *createPredMap(const Digraph &digraph){
       return new PredMap(digraph);
@@ -91,37 +91,39 @@
   /// \ingroup spantree
   ///
-  /// \brief Minimum Cost Arborescence algorithm class.
+  /// \brief %MinCostArborescence algorithm class.
   ///
   /// This class provides an efficient implementation of
-  /// Minimum Cost Arborescence algorithm. The arborescence is a tree
+  /// %MinCostArborescence algorithm. The arborescence is a tree
   /// which is directed from a given source node of the digraph. One or
   /// more sources should be given for the algorithm and it will calculate
   /// the minimum cost subgraph which are union of arborescences with the
   /// given sources and spans all the nodes which are reachable from the
-  /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+e).
+  /// sources. The time complexity of the algorithm is \f$ O(n^2+e) \f$.
   ///
   /// The algorithm provides also an optimal dual solution, therefore
   /// the optimality of the solution can be checked.
   ///
-  /// \param GR The digraph type the algorithm runs on. The default value
+  /// \param _Digraph The digraph type the algorithm runs on. The default value
   /// is \ref ListDigraph.
-  /// \param CM This read-only ArcMap determines the costs of the
+  /// \param _CostMap This read-only ArcMap determines the costs of the
   /// arcs. It is read once for each arc, so the map may involve in
   /// relatively time consuming process to compute the arc cost if
   /// it is necessary. The default map type is \ref
   /// concepts::Digraph::ArcMap "Digraph::ArcMap<int>".
-  /// \param TR Traits class to set various data types used
+  /// \param _Traits Traits class to set various data types used
   /// by the algorithm. The default traits class is
   /// \ref MinCostArborescenceDefaultTraits
-  /// "MinCostArborescenceDefaultTraits<GR, CM>".  See \ref
+  /// "MinCostArborescenceDefaultTraits<_Digraph, _CostMap>".  See \ref
   /// MinCostArborescenceDefaultTraits for the documentation of a
   /// MinCostArborescence traits class.
+  ///
+  /// \author Balazs Dezso
 #ifndef DOXYGEN
-  template <typename GR = ListDigraph,
-            typename CM = typename GR::template ArcMap<int>,
-            typename TR =
-              MinCostArborescenceDefaultTraits<GR, CM> >
+  template <typename _Digraph = ListDigraph,
+            typename _CostMap = typename _Digraph::template ArcMap<int>,
+            typename _Traits =
+            MinCostArborescenceDefaultTraits<_Digraph, _CostMap> >
 #else
-  template <typename GR, typename CM, typedef TR>
+  template <typename _Digraph, typename _CostMap, typedef _Traits>
 #endif
   class MinCostArborescence {
@@ -129,5 +131,5 @@
 
     /// The traits.
-    typedef TR Traits;
+    typedef _Traits Traits;
     /// The type of the underlying digraph.
     typedef typename Traits::Digraph Digraph;
@@ -294,5 +296,5 @@
         }
       }
-      (*_arc_order)[minimum.arc] = _dual_variables.size();
+      _arc_order->set(minimum.arc, _dual_variables.size());
       DualVariable var(_dual_node_list.size() - 1,
                        _dual_node_list.size(), minimum.value);
@@ -336,5 +338,5 @@
         }
       }
-      (*_arc_order)[minimum.arc] = _dual_variables.size();
+      _arc_order->set(minimum.arc, _dual_variables.size());
       DualVariable var(node_bottom, _dual_node_list.size(), minimum.value);
       _dual_variables.push_back(var);
@@ -365,5 +367,5 @@
         Node source = _heap->top();
         _heap->pop();
-        (*_node_order)[source] = -1;
+        _node_order->set(source, -1);
         for (OutArcIt it(*_digraph, source); it != INVALID; ++it) {
           if ((*_arc_order)[it] < 0) continue;
@@ -391,5 +393,5 @@
   public:
 
-    /// \name Named Template Parameters
+    /// \name Named template parameters
 
     /// @{
@@ -439,6 +441,6 @@
     /// \brief Constructor.
     ///
-    /// \param digraph The digraph the algorithm will run on.
-    /// \param cost The cost map used by the algorithm.
+    /// \param _digraph The digraph the algorithm will run on.
+    /// \param _cost The cost map used by the algorithm.
     MinCostArborescence(const Digraph& digraph, const CostMap& cost)
       : _digraph(&digraph), _cost(&cost), _pred(0), local_pred(false),
@@ -455,5 +457,5 @@
     ///
     /// Sets the arborescence map.
-    /// \return <tt>(*this)</tt>
+    /// \return \c (*this)
     MinCostArborescence& arborescenceMap(ArborescenceMap& m) {
       if (local_arborescence) {
@@ -468,5 +470,5 @@
     ///
     /// Sets the arborescence map.
-    /// \return <tt>(*this)</tt>
+    /// \return \c (*this)
     MinCostArborescence& predMap(PredMap& m) {
       if (local_pred) {
@@ -631,5 +633,5 @@
     /// @}
 
-    /// \name Execution Control
+    /// \name Execution control
     /// The simplest way to execute the algorithm is to use
     /// one of the member functions called \c run(...). \n
@@ -651,11 +653,11 @@
       for (NodeIt it(*_digraph); it != INVALID; ++it) {
         (*_cost_arcs)[it].arc = INVALID;
-        (*_node_order)[it] = -3;
-        (*_heap_cross_ref)[it] = Heap::PRE_HEAP;
+        _node_order->set(it, -3);
+        _heap_cross_ref->set(it, Heap::PRE_HEAP);
         _pred->set(it, INVALID);
       }
       for (ArcIt it(*_digraph); it != INVALID; ++it) {
         _arborescence->set(it, false);
-        (*_arc_order)[it] = -1;
+        _arc_order->set(it, -1);
       }
       _dual_node_list.clear();
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 601)
+++ lemon/network_simplex.h	(revision 601)
@@ -0,0 +1,1191 @@
+/* -*- 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.
+ *
+ */
+
+#ifndef LEMON_NETWORK_SIMPLEX_H
+#define LEMON_NETWORK_SIMPLEX_H
+
+/// \ingroup min_cost_flow
+///
+/// \file
+/// \brief Network simplex algorithm for finding a minimum cost flow.
+
+#include <vector>
+#include <limits>
+#include <algorithm>
+
+#include <lemon/math.h>
+
+namespace lemon {
+
+  /// \addtogroup min_cost_flow
+  /// @{
+
+  /// \brief Implementation of the primal network simplex algorithm
+  /// for finding a \ref min_cost_flow "minimum cost flow".
+  ///
+  /// \ref NetworkSimplex implements the primal network simplex algorithm
+  /// for finding a \ref min_cost_flow "minimum cost flow".
+  ///
+  /// \tparam Digraph The digraph type the algorithm runs on.
+  /// \tparam LowerMap The type of the lower bound map.
+  /// \tparam CapacityMap The type of the capacity (upper bound) map.
+  /// \tparam CostMap The type of the cost (length) map.
+  /// \tparam SupplyMap The type of the supply map.
+  ///
+  /// \warning
+  /// - Arc capacities and costs should be \e non-negative \e integers.
+  /// - Supply values should be \e signed \e integers.
+  /// - The value types of the maps should be convertible to each other.
+  /// - \c CostMap::Value must be signed type.
+  ///
+  /// \note \ref NetworkSimplex provides five different pivot rule
+  /// implementations that significantly affect the efficiency of the
+  /// algorithm.
+  /// By default "Block Search" pivot rule is used, which proved to be
+  /// by far the most efficient according to our benchmark tests.
+  /// However another pivot rule can be selected using \ref run()
+  /// function with the proper parameter.
+#ifdef DOXYGEN
+  template < typename Digraph,
+             typename LowerMap,
+             typename CapacityMap,
+             typename CostMap,
+             typename SupplyMap >
+
+#else
+  template < typename Digraph,
+             typename LowerMap = typename Digraph::template ArcMap<int>,
+             typename CapacityMap = typename Digraph::template ArcMap<int>,
+             typename CostMap = typename Digraph::template ArcMap<int>,
+             typename SupplyMap = typename Digraph::template NodeMap<int> >
+#endif
+  class NetworkSimplex
+  {
+    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
+
+    typedef typename CapacityMap::Value Capacity;
+    typedef typename CostMap::Value Cost;
+    typedef typename SupplyMap::Value Supply;
+
+    typedef std::vector<Arc> ArcVector;
+    typedef std::vector<Node> NodeVector;
+    typedef std::vector<int> IntVector;
+    typedef std::vector<bool> BoolVector;
+    typedef std::vector<Capacity> CapacityVector;
+    typedef std::vector<Cost> CostVector;
+    typedef std::vector<Supply> SupplyVector;
+
+  public:
+
+    /// The type of the flow map
+    typedef typename Digraph::template ArcMap<Capacity> FlowMap;
+    /// The type of the potential map
+    typedef typename Digraph::template NodeMap<Cost> PotentialMap;
+
+  public:
+
+    /// Enum type for selecting the pivot rule used by \ref run()
+    enum PivotRuleEnum {
+      FIRST_ELIGIBLE_PIVOT,
+      BEST_ELIGIBLE_PIVOT,
+      BLOCK_SEARCH_PIVOT,
+      CANDIDATE_LIST_PIVOT,
+      ALTERING_LIST_PIVOT
+    };
+
+  private:
+
+    // State constants for arcs
+    enum ArcStateEnum {
+      STATE_UPPER = -1,
+      STATE_TREE  =  0,
+      STATE_LOWER =  1
+    };
+
+  private:
+
+    // References for the original data
+    const Digraph &_orig_graph;
+    const LowerMap *_orig_lower;
+    const CapacityMap &_orig_cap;
+    const CostMap &_orig_cost;
+    const SupplyMap *_orig_supply;
+    Node _orig_source;
+    Node _orig_target;
+    Capacity _orig_flow_value;
+
+    // Result maps
+    FlowMap *_flow_result;
+    PotentialMap *_potential_result;
+    bool _local_flow;
+    bool _local_potential;
+
+    // Data structures for storing the graph
+    ArcVector _arc;
+    NodeVector _node;
+    IntNodeMap _node_id;
+    IntVector _source;
+    IntVector _target;
+
+    // The number of nodes and arcs in the original graph
+    int _node_num;
+    int _arc_num;
+
+    // Node and arc maps
+    CapacityVector _cap;
+    CostVector _cost;
+    CostVector _supply;
+    CapacityVector _flow;
+    CostVector _pi;
+
+    // Node and arc maps for the spanning tree structure
+    IntVector _depth;
+    IntVector _parent;
+    IntVector _pred;
+    IntVector _thread;
+    BoolVector _forward;
+    IntVector _state;
+
+    // The root node
+    int _root;
+
+    // The entering arc in the current pivot iteration
+    int _in_arc;
+
+    // Temporary data used in the current pivot iteration
+    int join, u_in, v_in, u_out, v_out;
+    int right, first, second, last;
+    int stem, par_stem, new_stem;
+    Capacity delta;
+
+  private:
+
+    /// \brief Implementation of the "First Eligible" pivot rule for the
+    /// \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// This class implements the "First Eligible" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// For more information see \ref NetworkSimplex::run().
+    class FirstEligiblePivotRule
+    {
+    private:
+
+      // References to the NetworkSimplex class
+      const ArcVector &_arc;
+      const IntVector  &_source;
+      const IntVector  &_target;
+      const CostVector &_cost;
+      const IntVector  &_state;
+      const CostVector &_pi;
+      int &_in_arc;
+      int _arc_num;
+
+      // Pivot rule data
+      int _next_arc;
+
+    public:
+
+      /// Constructor
+      FirstEligiblePivotRule(NetworkSimplex &ns) :
+        _arc(ns._arc), _source(ns._source), _target(ns._target),
+        _cost(ns._cost), _state(ns._state), _pi(ns._pi),
+        _in_arc(ns._in_arc), _arc_num(ns._arc_num), _next_arc(0)
+      {}
+
+      /// Find next entering arc
+      bool findEnteringArc() {
+        Cost c;
+        for (int e = _next_arc; e < _arc_num; ++e) {
+          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (c < 0) {
+            _in_arc = e;
+            _next_arc = e + 1;
+            return true;
+          }
+        }
+        for (int e = 0; e < _next_arc; ++e) {
+          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (c < 0) {
+            _in_arc = e;
+            _next_arc = e + 1;
+            return true;
+          }
+        }
+        return false;
+      }
+
+    }; //class FirstEligiblePivotRule
+
+
+    /// \brief Implementation of the "Best Eligible" pivot rule for the
+    /// \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// This class implements the "Best Eligible" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// For more information see \ref NetworkSimplex::run().
+    class BestEligiblePivotRule
+    {
+    private:
+
+      // References to the NetworkSimplex class
+      const ArcVector &_arc;
+      const IntVector  &_source;
+      const IntVector  &_target;
+      const CostVector &_cost;
+      const IntVector  &_state;
+      const CostVector &_pi;
+      int &_in_arc;
+      int _arc_num;
+
+    public:
+
+      /// Constructor
+      BestEligiblePivotRule(NetworkSimplex &ns) :
+        _arc(ns._arc), _source(ns._source), _target(ns._target),
+        _cost(ns._cost), _state(ns._state), _pi(ns._pi),
+        _in_arc(ns._in_arc), _arc_num(ns._arc_num)
+      {}
+
+      /// Find next entering arc
+      bool findEnteringArc() {
+        Cost c, min = 0;
+        for (int e = 0; e < _arc_num; ++e) {
+          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (c < min) {
+            min = c;
+            _in_arc = e;
+          }
+        }
+        return min < 0;
+      }
+
+    }; //class BestEligiblePivotRule
+
+
+    /// \brief Implementation of the "Block Search" pivot rule for the
+    /// \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// This class implements the "Block Search" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// For more information see \ref NetworkSimplex::run().
+    class BlockSearchPivotRule
+    {
+    private:
+
+      // References to the NetworkSimplex class
+      const ArcVector &_arc;
+      const IntVector  &_source;
+      const IntVector  &_target;
+      const CostVector &_cost;
+      const IntVector  &_state;
+      const CostVector &_pi;
+      int &_in_arc;
+      int _arc_num;
+
+      // Pivot rule data
+      int _block_size;
+      int _next_arc;
+
+    public:
+
+      /// Constructor
+      BlockSearchPivotRule(NetworkSimplex &ns) :
+        _arc(ns._arc), _source(ns._source), _target(ns._target),
+        _cost(ns._cost), _state(ns._state), _pi(ns._pi),
+        _in_arc(ns._in_arc), _arc_num(ns._arc_num), _next_arc(0)
+      {
+        // The main parameters of the pivot rule
+        const double BLOCK_SIZE_FACTOR = 2.0;
+        const int MIN_BLOCK_SIZE = 10;
+
+        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
+                                MIN_BLOCK_SIZE );
+      }
+
+      /// Find next entering arc
+      bool findEnteringArc() {
+        Cost c, min = 0;
+        int cnt = _block_size;
+        int e, min_arc = _next_arc;
+        for (e = _next_arc; e < _arc_num; ++e) {
+          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (c < min) {
+            min = c;
+            min_arc = e;
+          }
+          if (--cnt == 0) {
+            if (min < 0) break;
+            cnt = _block_size;
+          }
+        }
+        if (min == 0 || cnt > 0) {
+          for (e = 0; e < _next_arc; ++e) {
+            c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+            if (c < min) {
+              min = c;
+              min_arc = e;
+            }
+            if (--cnt == 0) {
+              if (min < 0) break;
+              cnt = _block_size;
+            }
+          }
+        }
+        if (min >= 0) return false;
+        _in_arc = min_arc;
+        _next_arc = e;
+        return true;
+      }
+
+    }; //class BlockSearchPivotRule
+
+
+    /// \brief Implementation of the "Candidate List" pivot rule for the
+    /// \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// This class implements the "Candidate List" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// For more information see \ref NetworkSimplex::run().
+    class CandidateListPivotRule
+    {
+    private:
+
+      // References to the NetworkSimplex class
+      const ArcVector &_arc;
+      const IntVector  &_source;
+      const IntVector  &_target;
+      const CostVector &_cost;
+      const IntVector  &_state;
+      const CostVector &_pi;
+      int &_in_arc;
+      int _arc_num;
+
+      // Pivot rule data
+      IntVector _candidates;
+      int _list_length, _minor_limit;
+      int _curr_length, _minor_count;
+      int _next_arc;
+
+    public:
+
+      /// Constructor
+      CandidateListPivotRule(NetworkSimplex &ns) :
+        _arc(ns._arc), _source(ns._source), _target(ns._target),
+        _cost(ns._cost), _state(ns._state), _pi(ns._pi),
+        _in_arc(ns._in_arc), _arc_num(ns._arc_num), _next_arc(0)
+      {
+        // The main parameters of the pivot rule
+        const double LIST_LENGTH_FACTOR = 1.0;
+        const int MIN_LIST_LENGTH = 10;
+        const double MINOR_LIMIT_FACTOR = 0.1;
+        const int MIN_MINOR_LIMIT = 3;
+
+        _list_length = std::max( int(LIST_LENGTH_FACTOR * sqrt(_arc_num)),
+                                 MIN_LIST_LENGTH );
+        _minor_limit = std::max( int(MINOR_LIMIT_FACTOR * _list_length),
+                                 MIN_MINOR_LIMIT );
+        _curr_length = _minor_count = 0;
+        _candidates.resize(_list_length);
+      }
+
+      /// Find next entering arc
+      bool findEnteringArc() {
+        Cost min, c;
+        int e, min_arc = _next_arc;
+        if (_curr_length > 0 && _minor_count < _minor_limit) {
+          // Minor iteration: select the best eligible arc from the
+          // current candidate list
+          ++_minor_count;
+          min = 0;
+          for (int i = 0; i < _curr_length; ++i) {
+            e = _candidates[i];
+            c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+            if (c < min) {
+              min = c;
+              min_arc = e;
+            }
+            if (c >= 0) {
+              _candidates[i--] = _candidates[--_curr_length];
+            }
+          }
+          if (min < 0) {
+            _in_arc = min_arc;
+            return true;
+          }
+        }
+
+        // Major iteration: build a new candidate list
+        min = 0;
+        _curr_length = 0;
+        for (e = _next_arc; e < _arc_num; ++e) {
+          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (c < 0) {
+            _candidates[_curr_length++] = e;
+            if (c < min) {
+              min = c;
+              min_arc = e;
+            }
+            if (_curr_length == _list_length) break;
+          }
+        }
+        if (_curr_length < _list_length) {
+          for (e = 0; e < _next_arc; ++e) {
+            c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+            if (c < 0) {
+              _candidates[_curr_length++] = e;
+              if (c < min) {
+                min = c;
+                min_arc = e;
+              }
+              if (_curr_length == _list_length) break;
+            }
+          }
+        }
+        if (_curr_length == 0) return false;
+        _minor_count = 1;
+        _in_arc = min_arc;
+        _next_arc = e;
+        return true;
+      }
+
+    }; //class CandidateListPivotRule
+
+
+    /// \brief Implementation of the "Altering Candidate List" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// This class implements the "Altering Candidate List" pivot rule
+    /// for the \ref NetworkSimplex "network simplex" algorithm.
+    ///
+    /// For more information see \ref NetworkSimplex::run().
+    class AlteringListPivotRule
+    {
+    private:
+
+      // References to the NetworkSimplex class
+      const ArcVector &_arc;
+      const IntVector  &_source;
+      const IntVector  &_target;
+      const CostVector &_cost;
+      const IntVector  &_state;
+      const CostVector &_pi;
+      int &_in_arc;
+      int _arc_num;
+
+      // Pivot rule data
+      int _block_size, _head_length, _curr_length;
+      int _next_arc;
+      IntVector _candidates;
+      CostVector _cand_cost;
+
+      // Functor class to compare arcs during sort of the candidate list
+      class SortFunc
+      {
+      private:
+        const CostVector &_map;
+      public:
+        SortFunc(const CostVector &map) : _map(map) {}
+        bool operator()(int left, int right) {
+          return _map[left] > _map[right];
+        }
+      };
+
+      SortFunc _sort_func;
+
+    public:
+
+      /// Constructor
+      AlteringListPivotRule(NetworkSimplex &ns) :
+        _arc(ns._arc), _source(ns._source), _target(ns._target),
+        _cost(ns._cost), _state(ns._state), _pi(ns._pi),
+        _in_arc(ns._in_arc), _arc_num(ns._arc_num),
+        _next_arc(0), _cand_cost(ns._arc_num), _sort_func(_cand_cost)
+      {
+        // The main parameters of the pivot rule
+        const double BLOCK_SIZE_FACTOR = 1.5;
+        const int MIN_BLOCK_SIZE = 10;
+        const double HEAD_LENGTH_FACTOR = 0.1;
+        const int MIN_HEAD_LENGTH = 3;
+
+        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
+                                MIN_BLOCK_SIZE );
+        _head_length = std::max( int(HEAD_LENGTH_FACTOR * _block_size),
+                                 MIN_HEAD_LENGTH );
+        _candidates.resize(_head_length + _block_size);
+        _curr_length = 0;
+      }
+
+      /// Find next entering arc
+      bool findEnteringArc() {
+        // Check the current candidate list
+        int e;
+        for (int i = 0; i < _curr_length; ++i) {
+          e = _candidates[i];
+          _cand_cost[e] = _state[e] *
+            (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (_cand_cost[e] >= 0) {
+            _candidates[i--] = _candidates[--_curr_length];
+          }
+        }
+
+        // Extend the list
+        int cnt = _block_size;
+        int last_edge = 0;
+        int limit = _head_length;
+
+        for (int e = _next_arc; e < _arc_num; ++e) {
+          _cand_cost[e] = _state[e] *
+            (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (_cand_cost[e] < 0) {
+            _candidates[_curr_length++] = e;
+            last_edge = e;
+          }
+          if (--cnt == 0) {
+            if (_curr_length > limit) break;
+            limit = 0;
+            cnt = _block_size;
+          }
+        }
+        if (_curr_length <= limit) {
+          for (int e = 0; e < _next_arc; ++e) {
+            _cand_cost[e] = _state[e] *
+              (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+            if (_cand_cost[e] < 0) {
+              _candidates[_curr_length++] = e;
+              last_edge = e;
+            }
+            if (--cnt == 0) {
+              if (_curr_length > limit) break;
+              limit = 0;
+              cnt = _block_size;
+            }
+          }
+        }
+        if (_curr_length == 0) return false;
+        _next_arc = last_edge + 1;
+
+        // Make heap of the candidate list (approximating a partial sort)
+        make_heap( _candidates.begin(), _candidates.begin() + _curr_length,
+                   _sort_func );
+
+        // Pop the first element of the heap
+        _in_arc = _candidates[0];
+        pop_heap( _candidates.begin(), _candidates.begin() + _curr_length,
+                  _sort_func );
+        _curr_length = std::min(_head_length, _curr_length - 1);
+        return true;
+      }
+
+    }; //class AlteringListPivotRule
+
+  public:
+
+    /// \brief General constructor (with lower bounds).
+    ///
+    /// General constructor (with lower bounds).
+    ///
+    /// \param digraph The digraph the algorithm runs on.
+    /// \param lower The lower bounds of the arcs.
+    /// \param capacity The capacities (upper bounds) of the arcs.
+    /// \param cost The cost (length) values of the arcs.
+    /// \param supply The supply values of the nodes (signed).
+    NetworkSimplex( const Digraph &digraph,
+                    const LowerMap &lower,
+                    const CapacityMap &capacity,
+                    const CostMap &cost,
+                    const SupplyMap &supply ) :
+      _orig_graph(digraph), _orig_lower(&lower), _orig_cap(capacity),
+      _orig_cost(cost), _orig_supply(&supply),
+      _flow_result(NULL), _potential_result(NULL),
+      _local_flow(false), _local_potential(false),
+      _node_id(digraph)
+    {}
+
+    /// \brief General constructor (without lower bounds).
+    ///
+    /// General constructor (without lower bounds).
+    ///
+    /// \param digraph The digraph the algorithm runs on.
+    /// \param capacity The capacities (upper bounds) of the arcs.
+    /// \param cost The cost (length) values of the arcs.
+    /// \param supply The supply values of the nodes (signed).
+    NetworkSimplex( const Digraph &digraph,
+                    const CapacityMap &capacity,
+                    const CostMap &cost,
+                    const SupplyMap &supply ) :
+      _orig_graph(digraph), _orig_lower(NULL), _orig_cap(capacity),
+      _orig_cost(cost), _orig_supply(&supply),
+      _flow_result(NULL), _potential_result(NULL),
+      _local_flow(false), _local_potential(false),
+      _node_id(digraph)
+    {}
+
+    /// \brief Simple constructor (with lower bounds).
+    ///
+    /// Simple constructor (with lower bounds).
+    ///
+    /// \param digraph The digraph the algorithm runs on.
+    /// \param lower The lower bounds of the arcs.
+    /// \param capacity The capacities (upper bounds) of the arcs.
+    /// \param cost The cost (length) values of the arcs.
+    /// \param s The source node.
+    /// \param t The target node.
+    /// \param flow_value The required amount of flow from node \c s
+    /// to node \c t (i.e. the supply of \c s and the demand of \c t).
+    NetworkSimplex( const Digraph &digraph,
+                    const LowerMap &lower,
+                    const CapacityMap &capacity,
+                    const CostMap &cost,
+                    Node s, Node t,
+                    Capacity flow_value ) :
+      _orig_graph(digraph), _orig_lower(&lower), _orig_cap(capacity),
+      _orig_cost(cost), _orig_supply(NULL),
+      _orig_source(s), _orig_target(t), _orig_flow_value(flow_value),
+      _flow_result(NULL), _potential_result(NULL),
+      _local_flow(false), _local_potential(false),
+      _node_id(digraph)
+    {}
+
+    /// \brief Simple constructor (without lower bounds).
+    ///
+    /// Simple constructor (without lower bounds).
+    ///
+    /// \param digraph The digraph the algorithm runs on.
+    /// \param capacity The capacities (upper bounds) of the arcs.
+    /// \param cost The cost (length) values of the arcs.
+    /// \param s The source node.
+    /// \param t The target node.
+    /// \param flow_value The required amount of flow from node \c s
+    /// to node \c t (i.e. the supply of \c s and the demand of \c t).
+    NetworkSimplex( const Digraph &digraph,
+                    const CapacityMap &capacity,
+                    const CostMap &cost,
+                    Node s, Node t,
+                    Capacity flow_value ) :
+      _orig_graph(digraph), _orig_lower(NULL), _orig_cap(capacity),
+      _orig_cost(cost), _orig_supply(NULL),
+      _orig_source(s), _orig_target(t), _orig_flow_value(flow_value),
+      _flow_result(NULL), _potential_result(NULL),
+      _local_flow(false), _local_potential(false),
+      _node_id(digraph)
+    {}
+
+    /// Destructor.
+    ~NetworkSimplex() {
+      if (_local_flow) delete _flow_result;
+      if (_local_potential) delete _potential_result;
+    }
+
+    /// \brief Set the flow map.
+    ///
+    /// This function sets the flow map.
+    ///
+    /// \return <tt>(*this)</tt>
+    NetworkSimplex& flowMap(FlowMap &map) {
+      if (_local_flow) {
+        delete _flow_result;
+        _local_flow = false;
+      }
+      _flow_result = &map;
+      return *this;
+    }
+
+    /// \brief Set the potential map.
+    ///
+    /// This function sets the potential map.
+    ///
+    /// \return <tt>(*this)</tt>
+    NetworkSimplex& potentialMap(PotentialMap &map) {
+      if (_local_potential) {
+        delete _potential_result;
+        _local_potential = false;
+      }
+      _potential_result = &map;
+      return *this;
+    }
+
+    /// \name Execution control
+    /// The algorithm can be executed using the
+    /// \ref lemon::NetworkSimplex::run() "run()" function.
+    /// @{
+
+    /// \brief Run the algorithm.
+    ///
+    /// This function runs the algorithm.
+    ///
+    /// \param pivot_rule The pivot rule that is used during the
+    /// algorithm.
+    ///
+    /// The available pivot rules:
+    ///
+    /// - FIRST_ELIGIBLE_PIVOT The next eligible arc is selected in
+    /// a wraparound fashion in every iteration
+    /// (\ref FirstEligiblePivotRule).
+    ///
+    /// - BEST_ELIGIBLE_PIVOT The best eligible arc is selected in
+    /// every iteration (\ref BestEligiblePivotRule).
+    ///
+    /// - BLOCK_SEARCH_PIVOT A specified number of arcs are examined in
+    /// every iteration in a wraparound fashion and the best eligible
+    /// arc is selected from this block (\ref BlockSearchPivotRule).
+    ///
+    /// - CANDIDATE_LIST_PIVOT In a major iteration a candidate list is
+    /// built from eligible arcs in a wraparound fashion and in the
+    /// following minor iterations the best eligible arc is selected
+    /// from this list (\ref CandidateListPivotRule).
+    ///
+    /// - ALTERING_LIST_PIVOT It is a modified version of the
+    /// "Candidate List" pivot rule. It keeps only the several best
+    /// eligible arcs from the former candidate list and extends this
+    /// list in every iteration (\ref AlteringListPivotRule).
+    ///
+    /// According to our comprehensive benchmark tests the "Block Search"
+    /// pivot rule proved to be the fastest and the most robust on
+    /// various test inputs. Thus it is the default option.
+    ///
+    /// \return \c true if a feasible flow can be found.
+    bool run(PivotRuleEnum pivot_rule = BLOCK_SEARCH_PIVOT) {
+      return init() && start(pivot_rule);
+    }
+
+    /// @}
+
+    /// \name Query Functions
+    /// The results of the algorithm can be obtained using these
+    /// functions.\n
+    /// \ref lemon::NetworkSimplex::run() "run()" must be called before
+    /// using them.
+    /// @{
+
+    /// \brief Return a const reference to the flow map.
+    ///
+    /// This function returns a const reference to an arc map storing
+    /// the found flow.
+    ///
+    /// \pre \ref run() must be called before using this function.
+    const FlowMap& flowMap() const {
+      return *_flow_result;
+    }
+
+    /// \brief Return a const reference to the potential map
+    /// (the dual solution).
+    ///
+    /// This function returns a const reference to a node map storing
+    /// the found potentials (the dual solution).
+    ///
+    /// \pre \ref run() must be called before using this function.
+    const PotentialMap& potentialMap() const {
+      return *_potential_result;
+    }
+
+    /// \brief Return the flow on the given arc.
+    ///
+    /// This function returns the flow on the given arc.
+    ///
+    /// \pre \ref run() must be called before using this function.
+    Capacity flow(const Arc& arc) const {
+      return (*_flow_result)[arc];
+    }
+
+    /// \brief Return the potential of the given node.
+    ///
+    /// This function returns the potential of the given node.
+    ///
+    /// \pre \ref run() must be called before using this function.
+    Cost potential(const Node& node) const {
+      return (*_potential_result)[node];
+    }
+
+    /// \brief Return the total cost of the found flow.
+    ///
+    /// This function returns the total cost of the found flow.
+    /// The complexity of the function is \f$ O(e) \f$.
+    ///
+    /// \pre \ref run() must be called before using this function.
+    Cost totalCost() const {
+      Cost c = 0;
+      for (ArcIt e(_orig_graph); e != INVALID; ++e)
+        c += (*_flow_result)[e] * _orig_cost[e];
+      return c;
+    }
+
+    /// @}
+
+  private:
+
+    // Initialize internal data structures
+    bool init() {
+      // Initialize result maps
+      if (!_flow_result) {
+        _flow_result = new FlowMap(_orig_graph);
+        _local_flow = true;
+      }
+      if (!_potential_result) {
+        _potential_result = new PotentialMap(_orig_graph);
+        _local_potential = true;
+      }
+
+      // Initialize vectors
+      _node_num = countNodes(_orig_graph);
+      _arc_num = countArcs(_orig_graph);
+      int all_node_num = _node_num + 1;
+      int all_edge_num = _arc_num + _node_num;
+
+      _arc.resize(_arc_num);
+      _node.reserve(_node_num);
+      _source.resize(all_edge_num);
+      _target.resize(all_edge_num);
+
+      _cap.resize(all_edge_num);
+      _cost.resize(all_edge_num);
+      _supply.resize(all_node_num);
+      _flow.resize(all_edge_num, 0);
+      _pi.resize(all_node_num, 0);
+
+      _depth.resize(all_node_num);
+      _parent.resize(all_node_num);
+      _pred.resize(all_node_num);
+      _thread.resize(all_node_num);
+      _forward.resize(all_node_num);
+      _state.resize(all_edge_num, STATE_LOWER);
+
+      // Initialize node related data
+      bool valid_supply = true;
+      if (_orig_supply) {
+        Supply sum = 0;
+        int i = 0;
+        for (NodeIt n(_orig_graph); n != INVALID; ++n, ++i) {
+          _node.push_back(n);
+          _node_id[n] = i;
+          _supply[i] = (*_orig_supply)[n];
+          sum += _supply[i];
+        }
+        valid_supply = (sum == 0);
+      } else {
+        int i = 0;
+        for (NodeIt n(_orig_graph); n != INVALID; ++n, ++i) {
+          _node.push_back(n);
+          _node_id[n] = i;
+          _supply[i] = 0;
+        }
+        _supply[_node_id[_orig_source]] =  _orig_flow_value;
+        _supply[_node_id[_orig_target]] = -_orig_flow_value;
+      }
+      if (!valid_supply) return false;
+
+      // Set data for the artificial root node
+      _root = _node_num;
+      _depth[_root] = 0;
+      _parent[_root] = -1;
+      _pred[_root] = -1;
+      _thread[_root] = 0;
+      _supply[_root] = 0;
+      _pi[_root] = 0;
+
+      // Store the arcs in a mixed order
+      int k = std::max(int(sqrt(_arc_num)), 10);
+      int i = 0;
+      for (ArcIt e(_orig_graph); e != INVALID; ++e) {
+        _arc[i] = e;
+        if ((i += k) >= _arc_num) i = (i % k) + 1;
+      }
+
+      // Initialize arc maps
+      for (int i = 0; i != _arc_num; ++i) {
+        Arc e = _arc[i];
+        _source[i] = _node_id[_orig_graph.source(e)];
+        _target[i] = _node_id[_orig_graph.target(e)];
+        _cost[i] = _orig_cost[e];
+        _cap[i] = _orig_cap[e];
+      }
+
+      // Remove non-zero lower bounds
+      if (_orig_lower) {
+        for (int i = 0; i != _arc_num; ++i) {
+          Capacity c = (*_orig_lower)[_arc[i]];
+          if (c != 0) {
+            _cap[i] -= c;
+            _supply[_source[i]] -= c;
+            _supply[_target[i]] += c;
+          }
+        }
+      }
+
+      // Add artificial arcs and initialize the spanning tree data structure
+      Cost max_cost = std::numeric_limits<Cost>::max() / 4;
+      Capacity max_cap = std::numeric_limits<Capacity>::max();
+      for (int u = 0, e = _arc_num; u != _node_num; ++u, ++e) {
+        _thread[u] = u + 1;
+        _depth[u] = 1;
+        _parent[u] = _root;
+        _pred[u] = e;
+        if (_supply[u] >= 0) {
+          _flow[e] = _supply[u];
+          _forward[u] = true;
+          _pi[u] = -max_cost;
+        } else {
+          _flow[e] = -_supply[u];
+          _forward[u] = false;
+          _pi[u] = max_cost;
+        }
+        _cost[e] = max_cost;
+        _cap[e] = max_cap;
+        _state[e] = STATE_TREE;
+      }
+
+      return true;
+    }
+
+    // Find the join node
+    void findJoinNode() {
+      int u = _source[_in_arc];
+      int v = _target[_in_arc];
+      while (_depth[u] > _depth[v]) u = _parent[u];
+      while (_depth[v] > _depth[u]) v = _parent[v];
+      while (u != v) {
+        u = _parent[u];
+        v = _parent[v];
+      }
+      join = u;
+    }
+
+    // Find the leaving arc of the cycle and returns true if the
+    // leaving arc is not the same as the entering arc
+    bool findLeavingArc() {
+      // Initialize first and second nodes according to the direction
+      // of the cycle
+      if (_state[_in_arc] == STATE_LOWER) {
+        first  = _source[_in_arc];
+        second = _target[_in_arc];
+      } else {
+        first  = _target[_in_arc];
+        second = _source[_in_arc];
+      }
+      delta = _cap[_in_arc];
+      int result = 0;
+      Capacity d;
+      int e;
+
+      // Search the cycle along the path form the first node to the root
+      for (int u = first; u != join; u = _parent[u]) {
+        e = _pred[u];
+        d = _forward[u] ? _flow[e] : _cap[e] - _flow[e];
+        if (d < delta) {
+          delta = d;
+          u_out = u;
+          result = 1;
+        }
+      }
+      // Search the cycle along the path form the second node to the root
+      for (int u = second; u != join; u = _parent[u]) {
+        e = _pred[u];
+        d = _forward[u] ? _cap[e] - _flow[e] : _flow[e];
+        if (d <= delta) {
+          delta = d;
+          u_out = u;
+          result = 2;
+        }
+      }
+
+      if (result == 1) {
+        u_in = first;
+        v_in = second;
+      } else {
+        u_in = second;
+        v_in = first;
+      }
+      return result != 0;
+    }
+
+    // Change _flow and _state vectors
+    void changeFlow(bool change) {
+      // Augment along the cycle
+      if (delta > 0) {
+        Capacity val = _state[_in_arc] * delta;
+        _flow[_in_arc] += val;
+        for (int u = _source[_in_arc]; u != join; u = _parent[u]) {
+          _flow[_pred[u]] += _forward[u] ? -val : val;
+        }
+        for (int u = _target[_in_arc]; u != join; u = _parent[u]) {
+          _flow[_pred[u]] += _forward[u] ? val : -val;
+        }
+      }
+      // Update the state of the entering and leaving arcs
+      if (change) {
+        _state[_in_arc] = STATE_TREE;
+        _state[_pred[u_out]] =
+          (_flow[_pred[u_out]] == 0) ? STATE_LOWER : STATE_UPPER;
+      } else {
+        _state[_in_arc] = -_state[_in_arc];
+      }
+    }
+
+    // Update _thread and _parent vectors
+    void updateThreadParent() {
+      int u;
+      v_out = _parent[u_out];
+
+      // Handle the case when join and v_out coincide
+      bool par_first = false;
+      if (join == v_out) {
+        for (u = join; u != u_in && u != v_in; u = _thread[u]) ;
+        if (u == v_in) {
+          par_first = true;
+          while (_thread[u] != u_out) u = _thread[u];
+          first = u;
+        }
+      }
+
+      // Find the last successor of u_in (u) and the node after it (right)
+      // according to the thread index
+      for (u = u_in; _depth[_thread[u]] > _depth[u_in]; u = _thread[u]) ;
+      right = _thread[u];
+      if (_thread[v_in] == u_out) {
+        for (last = u; _depth[last] > _depth[u_out]; last = _thread[last]) ;
+        if (last == u_out) last = _thread[last];
+      }
+      else last = _thread[v_in];
+
+      // Update stem nodes
+      _thread[v_in] = stem = u_in;
+      par_stem = v_in;
+      while (stem != u_out) {
+        _thread[u] = new_stem = _parent[stem];
+
+        // Find the node just before the stem node (u) according to
+        // the original thread index
+        for (u = new_stem; _thread[u] != stem; u = _thread[u]) ;
+        _thread[u] = right;
+
+        // Change the parent node of stem and shift stem and par_stem nodes
+        _parent[stem] = par_stem;
+        par_stem = stem;
+        stem = new_stem;
+
+        // Find the last successor of stem (u) and the node after it (right)
+        // according to the thread index
+        for (u = stem; _depth[_thread[u]] > _depth[stem]; u = _thread[u]) ;
+        right = _thread[u];
+      }
+      _parent[u_out] = par_stem;
+      _thread[u] = last;
+
+      if (join == v_out && par_first) {
+        if (first != v_in) _thread[first] = right;
+      } else {
+        for (u = v_out; _thread[u] != u_out; u = _thread[u]) ;
+        _thread[u] = right;
+      }
+    }
+
+    // Update _pred and _forward vectors
+    void updatePredArc() {
+      int u = u_out, v;
+      while (u != u_in) {
+        v = _parent[u];
+        _pred[u] = _pred[v];
+        _forward[u] = !_forward[v];
+        u = v;
+      }
+      _pred[u_in] = _in_arc;
+      _forward[u_in] = (u_in == _source[_in_arc]);
+    }
+
+    // Update _depth and _potential vectors
+    void updateDepthPotential() {
+      _depth[u_in] = _depth[v_in] + 1;
+      Cost sigma = _forward[u_in] ?
+        _pi[v_in] - _pi[u_in] - _cost[_pred[u_in]] :
+        _pi[v_in] - _pi[u_in] + _cost[_pred[u_in]];
+      _pi[u_in] += sigma;
+      for(int u = _thread[u_in]; _parent[u] != -1; u = _thread[u]) {
+        _depth[u] = _depth[_parent[u]] + 1;
+        if (_depth[u] <= _depth[u_in]) break;
+        _pi[u] += sigma;
+      }
+    }
+
+    // Execute the algorithm
+    bool start(PivotRuleEnum pivot_rule) {
+      // Select the pivot rule implementation
+      switch (pivot_rule) {
+        case FIRST_ELIGIBLE_PIVOT:
+          return start<FirstEligiblePivotRule>();
+        case BEST_ELIGIBLE_PIVOT:
+          return start<BestEligiblePivotRule>();
+        case BLOCK_SEARCH_PIVOT:
+          return start<BlockSearchPivotRule>();
+        case CANDIDATE_LIST_PIVOT:
+          return start<CandidateListPivotRule>();
+        case ALTERING_LIST_PIVOT:
+          return start<AlteringListPivotRule>();
+      }
+      return false;
+    }
+
+    template<class PivotRuleImplementation>
+    bool start() {
+      PivotRuleImplementation pivot(*this);
+
+      // Execute the network simplex algorithm
+      while (pivot.findEnteringArc()) {
+        findJoinNode();
+        bool change = findLeavingArc();
+        changeFlow(change);
+        if (change) {
+          updateThreadParent();
+          updatePredArc();
+          updateDepthPotential();
+        }
+      }
+
+      // Check if the flow amount equals zero on all the artificial arcs
+      for (int e = _arc_num; e != _arc_num + _node_num; ++e) {
+        if (_flow[e] > 0) return false;
+      }
+
+      // Copy flow values to _flow_result
+      if (_orig_lower) {
+        for (int i = 0; i != _arc_num; ++i) {
+          Arc e = _arc[i];
+          (*_flow_result)[e] = (*_orig_lower)[e] + _flow[i];
+        }
+      } else {
+        for (int i = 0; i != _arc_num; ++i) {
+          (*_flow_result)[_arc[i]] = _flow[i];
+        }
+      }
+      // Copy potential values to _potential_result
+      for (int i = 0; i != _node_num; ++i) {
+        (*_potential_result)[_node[i]] = _pi[i];
+      }
+
+      return true;
+    }
+
+  }; //class NetworkSimplex
+
+  ///@}
+
+} //namespace lemon
+
+#endif //LEMON_NETWORK_SIMPLEX_H
Index: lemon/path.h
===================================================================
--- lemon/path.h	(revision 559)
+++ lemon/path.h	(revision 517)
@@ -41,5 +41,5 @@
   ///
   /// A structure for representing directed path in a digraph.
-  /// \tparam GR The digraph type in which the path is.
+  /// \tparam _Digraph The digraph type in which the path is.
   ///
   /// In a sense, the path can be treated as a list of arcs. The
@@ -53,9 +53,9 @@
   /// implementation uses two vectors for storing the front and back
   /// insertions.
-  template <typename GR>
+  template <typename _Digraph>
   class Path {
   public:
 
-    typedef GR Digraph;
+    typedef _Digraph Digraph;
     typedef typename Digraph::Arc Arc;
 
@@ -138,5 +138,5 @@
     /// \brief The nth arc.
     ///
-    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
+    /// \pre n is in the [0..length() - 1] range
     const Arc& nth(int n) const {
       return n < int(head.size()) ? *(head.rbegin() + n) :
@@ -146,5 +146,5 @@
     /// \brief Initialize arc iterator to point to the nth arc
     ///
-    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
+    /// \pre n is in the [0..length() - 1] range
     ArcIt nthIt(int n) const {
       return ArcIt(*this, n);
@@ -229,5 +229,5 @@
   ///
   /// A structure for representing directed path in a digraph.
-  /// \tparam GR The digraph type in which the path is.
+  /// \tparam _Digraph The digraph type in which the path is.
   ///
   /// In a sense, the path can be treated as a list of arcs. The
@@ -241,9 +241,9 @@
   /// then the \c Path type because it use just one vector for the
   /// arcs.
-  template <typename GR>
+  template <typename _Digraph>
   class SimplePath {
   public:
 
-    typedef GR Digraph;
+    typedef _Digraph Digraph;
     typedef typename Digraph::Arc Arc;
 
@@ -330,5 +330,5 @@
     /// \brief The nth arc.
     ///
-    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
+    /// \pre n is in the [0..length() - 1] range
     const Arc& nth(int n) const {
       return data[n];
@@ -393,5 +393,5 @@
   ///
   /// A structure for representing directed path in a digraph.
-  /// \tparam GR The digraph type in which the path is.
+  /// \tparam _Digraph The digraph type in which the path is.
   ///
   /// In a sense, the path can be treated as a list of arcs. The
@@ -405,9 +405,9 @@
   /// time. The front and back insertion and erasure is O(1) time
   /// and it can be splited and spliced in O(1) time.
-  template <typename GR>
+  template <typename _Digraph>
   class ListPath {
   public:
 
-    typedef GR Digraph;
+    typedef _Digraph Digraph;
     typedef typename Digraph::Arc Arc;
 
@@ -508,5 +508,5 @@
     ///
     /// This function looks for the nth arc in O(n) time.
-    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
+    /// \pre n is in the [0..length() - 1] range
     const Arc& nth(int n) const {
       Node *node = first;
@@ -733,5 +733,5 @@
   ///
   /// A structure for representing directed path in a digraph.
-  /// \tparam GR The digraph type in which the path is.
+  /// \tparam _Digraph The digraph type in which the path is.
   ///
   /// In a sense, the path can be treated as a list of arcs. The
@@ -747,9 +747,9 @@
   /// it is intented to be
   /// used when you want to store a large number of paths.
-  template <typename GR>
+  template <typename _Digraph>
   class StaticPath {
   public:
 
-    typedef GR Digraph;
+    typedef _Digraph Digraph;
     typedef typename Digraph::Arc Arc;
 
@@ -834,5 +834,5 @@
     /// \brief The nth arc.
     ///
-    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
+    /// \pre n is in the [0..length() - 1] range
     const Arc& nth(int n) const {
       return arcs[n];
Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 581)
+++ lemon/preflow.h	(revision 492)
@@ -33,6 +33,6 @@
   /// Default traits class of Preflow class.
   /// \tparam GR Digraph type.
-  /// \tparam CAP Capacity map type.
-  template <typename GR, typename CAP>
+  /// \tparam CM Capacity map type.
+  template <typename GR, typename CM>
   struct PreflowDefaultTraits {
 
@@ -44,5 +44,5 @@
     /// The type of the map that stores the arc capacities.
     /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef CAP CapacityMap;
+    typedef CM CapacityMap;
 
     /// \brief The type of the flow values.
@@ -95,7 +95,6 @@
   ///
   /// This class provides an implementation of Goldberg-Tarjan's \e preflow
-  /// \e push-relabel algorithm producing a \ref max_flow
-  /// "flow of maximum value" in a digraph.
-  /// The preflow algorithms are the fastest known maximum
+  /// \e push-relabel algorithm producing a flow of maximum value in a
+  /// digraph. The preflow algorithms are the fastest known maximum
   /// flow algorithms. The current implementation use a mixture of the
   /// \e "highest label" and the \e "bound decrease" heuristics.
@@ -107,12 +106,12 @@
   ///
   /// \tparam GR The type of the digraph the algorithm runs on.
-  /// \tparam CAP The type of the capacity map. The default map
+  /// \tparam CM The type of the capacity map. The default map
   /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
 #ifdef DOXYGEN
-  template <typename GR, typename CAP, typename TR>
+  template <typename GR, typename CM, typename TR>
 #else
   template <typename GR,
-            typename CAP = typename GR::template ArcMap<int>,
-            typename TR = PreflowDefaultTraits<GR, CAP> >
+            typename CM = typename GR::template ArcMap<int>,
+            typename TR = PreflowDefaultTraits<GR, CM> >
 #endif
   class Preflow {
@@ -196,7 +195,7 @@
     ///@{
 
-    template <typename T>
+    template <typename _FlowMap>
     struct SetFlowMapTraits : public Traits {
-      typedef T FlowMap;
+      typedef _FlowMap FlowMap;
       static FlowMap *createFlowMap(const Digraph&) {
         LEMON_ASSERT(false, "FlowMap is not initialized");
@@ -210,14 +209,14 @@
     /// \ref named-templ-param "Named parameter" for setting FlowMap
     /// type.
-    template <typename T>
+    template <typename _FlowMap>
     struct SetFlowMap
-      : public Preflow<Digraph, CapacityMap, SetFlowMapTraits<T> > {
+      : public Preflow<Digraph, CapacityMap, SetFlowMapTraits<_FlowMap> > {
       typedef Preflow<Digraph, CapacityMap,
-                      SetFlowMapTraits<T> > Create;
+                      SetFlowMapTraits<_FlowMap> > Create;
     };
 
-    template <typename T>
+    template <typename _Elevator>
     struct SetElevatorTraits : public Traits {
-      typedef T Elevator;
+      typedef _Elevator Elevator;
       static Elevator *createElevator(const Digraph&, int) {
         LEMON_ASSERT(false, "Elevator is not initialized");
@@ -235,14 +234,14 @@
     /// \ref run() or \ref init().
     /// \sa SetStandardElevator
-    template <typename T>
+    template <typename _Elevator>
     struct SetElevator
-      : public Preflow<Digraph, CapacityMap, SetElevatorTraits<T> > {
+      : public Preflow<Digraph, CapacityMap, SetElevatorTraits<_Elevator> > {
       typedef Preflow<Digraph, CapacityMap,
-                      SetElevatorTraits<T> > Create;
+                      SetElevatorTraits<_Elevator> > Create;
     };
 
-    template <typename T>
+    template <typename _Elevator>
     struct SetStandardElevatorTraits : public Traits {
-      typedef T Elevator;
+      typedef _Elevator Elevator;
       static Elevator *createElevator(const Digraph& digraph, int max_level) {
         return new Elevator(digraph, max_level);
@@ -262,10 +261,10 @@
     /// before calling \ref run() or \ref init().
     /// \sa SetElevator
-    template <typename T>
+    template <typename _Elevator>
     struct SetStandardElevator
       : public Preflow<Digraph, CapacityMap,
-                       SetStandardElevatorTraits<T> > {
+                       SetStandardElevatorTraits<_Elevator> > {
       typedef Preflow<Digraph, CapacityMap,
-                      SetStandardElevatorTraits<T> > Create;
+                      SetStandardElevatorTraits<_Elevator> > Create;
     };
 
@@ -405,5 +404,5 @@
       _phase = true;
       for (NodeIt n(_graph); n != INVALID; ++n) {
-        (*_excess)[n] = 0;
+        _excess->set(n, 0);
       }
 
@@ -418,8 +417,8 @@
 
       std::vector<Node> queue;
-      reached[_source] = true;
+      reached.set(_source, true);
 
       queue.push_back(_target);
-      reached[_target] = true;
+      reached.set(_target, true);
       while (!queue.empty()) {
         _level->initNewLevel();
@@ -430,5 +429,5 @@
             Node u = _graph.source(e);
             if (!reached[u] && _tolerance.positive((*_capacity)[e])) {
-              reached[u] = true;
+              reached.set(u, true);
               _level->initAddItem(u);
               nqueue.push_back(u);
@@ -445,5 +444,5 @@
           if ((*_level)[u] == _level->maxLevel()) continue;
           _flow->set(e, (*_capacity)[e]);
-          (*_excess)[u] += (*_capacity)[e];
+          _excess->set(u, (*_excess)[u] + (*_capacity)[e]);
           if (u != _target && !_level->active(u)) {
             _level->activate(u);
@@ -479,5 +478,5 @@
         }
         if (excess < 0 && n != _source) return false;
-        (*_excess)[n] = excess;
+        _excess->set(n, excess);
       }
 
@@ -488,8 +487,8 @@
 
       std::vector<Node> queue;
-      reached[_source] = true;
+      reached.set(_source, true);
 
       queue.push_back(_target);
-      reached[_target] = true;
+      reached.set(_target, true);
       while (!queue.empty()) {
         _level->initNewLevel();
@@ -501,5 +500,5 @@
             if (!reached[u] &&
                 _tolerance.positive((*_capacity)[e] - (*_flow)[e])) {
-              reached[u] = true;
+              reached.set(u, true);
               _level->initAddItem(u);
               nqueue.push_back(u);
@@ -509,5 +508,5 @@
             Node v = _graph.target(e);
             if (!reached[v] && _tolerance.positive((*_flow)[e])) {
-              reached[v] = true;
+              reached.set(v, true);
               _level->initAddItem(v);
               nqueue.push_back(v);
@@ -525,5 +524,5 @@
           if ((*_level)[u] == _level->maxLevel()) continue;
           _flow->set(e, (*_capacity)[e]);
-          (*_excess)[u] += rem;
+          _excess->set(u, (*_excess)[u] + rem);
           if (u != _target && !_level->active(u)) {
             _level->activate(u);
@@ -537,5 +536,5 @@
           if ((*_level)[v] == _level->maxLevel()) continue;
           _flow->set(e, 0);
-          (*_excess)[v] += rem;
+          _excess->set(v, (*_excess)[v] + rem);
           if (v != _target && !_level->active(v)) {
             _level->activate(v);
@@ -578,10 +577,10 @@
               if (!_tolerance.less(rem, excess)) {
                 _flow->set(e, (*_flow)[e] + excess);
-                (*_excess)[v] += excess;
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push_1;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
+                _excess->set(v, (*_excess)[v] + rem);
                 _flow->set(e, (*_capacity)[e]);
               }
@@ -601,10 +600,10 @@
               if (!_tolerance.less(rem, excess)) {
                 _flow->set(e, (*_flow)[e] - excess);
-                (*_excess)[v] += excess;
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push_1;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
+                _excess->set(v, (*_excess)[v] + rem);
                 _flow->set(e, 0);
               }
@@ -616,5 +615,5 @@
         no_more_push_1:
 
-          (*_excess)[n] = excess;
+          _excess->set(n, excess);
 
           if (excess != 0) {
@@ -651,10 +650,10 @@
               if (!_tolerance.less(rem, excess)) {
                 _flow->set(e, (*_flow)[e] + excess);
-                (*_excess)[v] += excess;
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push_2;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
+                _excess->set(v, (*_excess)[v] + rem);
                 _flow->set(e, (*_capacity)[e]);
               }
@@ -674,10 +673,10 @@
               if (!_tolerance.less(rem, excess)) {
                 _flow->set(e, (*_flow)[e] - excess);
-                (*_excess)[v] += excess;
+                _excess->set(v, (*_excess)[v] + excess);
                 excess = 0;
                 goto no_more_push_2;
               } else {
                 excess -= rem;
-                (*_excess)[v] += rem;
+                _excess->set(v, (*_excess)[v] + rem);
                 _flow->set(e, 0);
               }
@@ -689,5 +688,5 @@
         no_more_push_2:
 
-          (*_excess)[n] = excess;
+          _excess->set(n, excess);
 
           if (excess != 0) {
@@ -732,5 +731,5 @@
       typename Digraph::template NodeMap<bool> reached(_graph);
       for (NodeIt n(_graph); n != INVALID; ++n) {
-        reached[n] = (*_level)[n] < _level->maxLevel();
+        reached.set(n, (*_level)[n] < _level->maxLevel());
       }
 
@@ -740,5 +739,5 @@
       std::vector<Node> queue;
       queue.push_back(_source);
-      reached[_source] = true;
+      reached.set(_source, true);
 
       while (!queue.empty()) {
@@ -750,5 +749,5 @@
             Node v = _graph.target(e);
             if (!reached[v] && _tolerance.positive((*_flow)[e])) {
-              reached[v] = true;
+              reached.set(v, true);
               _level->initAddItem(v);
               nqueue.push_back(v);
@@ -759,5 +758,5 @@
             if (!reached[u] &&
                 _tolerance.positive((*_capacity)[e] - (*_flow)[e])) {
-              reached[u] = true;
+              reached.set(u, true);
               _level->initAddItem(u);
               nqueue.push_back(u);
@@ -793,10 +792,10 @@
             if (!_tolerance.less(rem, excess)) {
               _flow->set(e, (*_flow)[e] + excess);
-              (*_excess)[v] += excess;
+              _excess->set(v, (*_excess)[v] + excess);
               excess = 0;
               goto no_more_push;
             } else {
               excess -= rem;
-              (*_excess)[v] += rem;
+              _excess->set(v, (*_excess)[v] + rem);
               _flow->set(e, (*_capacity)[e]);
             }
@@ -816,10 +815,10 @@
             if (!_tolerance.less(rem, excess)) {
               _flow->set(e, (*_flow)[e] - excess);
-              (*_excess)[v] += excess;
+              _excess->set(v, (*_excess)[v] + excess);
               excess = 0;
               goto no_more_push;
             } else {
               excess -= rem;
-              (*_excess)[v] += rem;
+              _excess->set(v, (*_excess)[v] + rem);
               _flow->set(e, 0);
             }
@@ -831,5 +830,5 @@
       no_more_push:
 
-        (*_excess)[n] = excess;
+        _excess->set(n, excess);
 
         if (excess != 0) {
@@ -948,5 +947,5 @@
     ///
     /// \note This function calls \ref minCut() for each node, so it runs in
-    /// O(n) time.
+    /// \f$O(n)\f$ time.
     ///
     /// \pre Either \ref run() or \ref init() must be called before
Index: lemon/radix_sort.h
===================================================================
--- lemon/radix_sort.h	(revision 559)
+++ lemon/radix_sort.h	(revision 444)
@@ -206,9 +206,9 @@
   ///
   /// This is a special quick sort algorithm where the pivot
-  /// values to split the items are choosen to be 2<sup>k</sup>
-  /// for each \c k.
-  /// Therefore, the time complexity of the algorithm is O(log(c)*n) and
-  /// it uses O(log(c)) additional space, where \c c is the maximal value
-  /// and \c n is the number of the items in the container.
+  /// values to split the items are choosen to be \f$ 2^k \f$ for each \c k.
+  /// Therefore, the time complexity of the
+  /// algorithm is \f$ O(\log(c)n) \f$ and it uses \f$ O(\log(c)) \f$,
+  /// additional space, where \c c is the maximal value and \c n is the
+  /// number of the items in the container.
   ///
   /// \param first The begin of the given range.
@@ -431,8 +431,8 @@
   /// byte-by-byte. First, it counts how many times a byte value occurs
   /// in the container, then it copies the corresponding items to
-  /// another container in asceding order in O(n) time.
-  ///
-  /// The time complexity of the algorithm is O(log(c)*n) and
-  /// it uses O(n) additional space, where \c c is the
+  /// another container in asceding order in \c O(n) time.
+  ///
+  /// The time complexity of the algorithm is \f$ O(\log(c)n) \f$ and
+  /// it uses \f$ O(n) \f$, additional space, where \c c is the
   /// maximal value and \c n is the number of the items in the
   /// container.
Index: lemon/random.h
===================================================================
--- lemon/random.h	(revision 584)
+++ lemon/random.h	(revision 517)
@@ -604,5 +604,5 @@
     /// function with the <tt>/dev/urandom</tt> file. If it does not success,
     /// it uses the \c seedFromTime().
-    /// \return Currently always \c true.
+    /// \return Currently always true.
     bool seed() {
 #ifndef WIN32
@@ -625,5 +625,5 @@
     /// \param file The source file
     /// \param offset The offset, from the file read.
-    /// \return \c true when the seeding successes.
+    /// \return True when the seeding successes.
 #ifndef WIN32
     bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0)
@@ -646,5 +646,5 @@
     /// current process id and the current time for initialize the
     /// random sequence.
-    /// \return Currently always \c true.
+    /// \return Currently always true.
     bool seedFromTime() {
 #ifndef WIN32
@@ -660,5 +660,5 @@
     /// @}
 
-    ///\name Uniform Distributions
+    ///\name Uniform distributions
     ///
     /// @{
@@ -763,5 +763,5 @@
     /// @}
 
-    ///\name Non-uniform Distributions
+    ///\name Non-uniform distributions
     ///
     ///@{
@@ -939,5 +939,5 @@
     ///@}
 
-    ///\name Two Dimensional Distributions
+    ///\name Two dimensional distributions
     ///
     ///@{
Index: lemon/smart_graph.h
===================================================================
--- lemon/smart_graph.h	(revision 582)
+++ lemon/smart_graph.h	(revision 440)
@@ -192,5 +192,7 @@
   ///that <b> it does support only limited (only stack-like)
   ///node and arc deletions</b>.
-  ///It fully conforms to the \ref concepts::Digraph "Digraph concept".
+  ///It conforms to the \ref concepts::Digraph "Digraph concept" with
+  ///an important extra feature that its maps are real \ref
+  ///concepts::ReferenceMap "reference map"s.
   ///
   ///\sa concepts::Digraph.
@@ -224,6 +226,6 @@
     ///Add a new node to the digraph.
 
-    /// Add a new node to the digraph.
-    /// \return The new node.
+    /// \return the new node.
+    ///
     Node addNode() { return Parent::addNode(); }
 
@@ -232,5 +234,5 @@
     ///Add a new arc to the digraph with source node \c s
     ///and target node \c t.
-    ///\return The new arc.
+    ///\return the new arc.
     Arc addArc(const Node& s, const Node& t) {
       return Parent::addArc(s, t);
@@ -628,7 +630,13 @@
   /// that <b> it does support only limited (only stack-like)
   /// node and arc deletions</b>.
-  /// It fully conforms to the \ref concepts::Graph "Graph concept".
+  /// Except from this it conforms to
+  /// the \ref concepts::Graph "Graph concept".
+  ///
+  /// It also has an
+  /// important extra feature that
+  /// its maps are real \ref concepts::ReferenceMap "reference map"s.
   ///
   /// \sa concepts::Graph.
+  ///
   class SmartGraph : public ExtendedSmartGraphBase {
   private:
@@ -659,6 +667,6 @@
     ///Add a new node to the graph.
 
-    /// Add a new node to the graph.
-    /// \return The new node.
+    /// \return the new node.
+    ///
     Node addNode() { return Parent::addNode(); }
 
@@ -667,5 +675,5 @@
     ///Add a new edge to the graph with node \c s
     ///and \c t.
-    ///\return The new edge.
+    ///\return the new edge.
     Edge addEdge(const Node& s, const Node& t) {
       return Parent::addEdge(s, t);
Index: lemon/soplex.cc
===================================================================
--- lemon/soplex.cc	(revision 576)
+++ lemon/soplex.cc	(revision 462)
@@ -20,6 +20,5 @@
 #include <lemon/soplex.h>
 
-#include <soplex.h>
-#include <spxout.h>
+#include <soplex/soplex.h>
 
 
@@ -30,5 +29,4 @@
   SoplexLp::SoplexLp() {
     soplex = new soplex::SoPlex;
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -50,5 +48,4 @@
     _row_names_ref = lp._row_names_ref;
 
-    messageLevel(MESSAGE_NOTHING);
   }
 
@@ -58,10 +55,10 @@
   }
 
-  SoplexLp* SoplexLp::newSolver() const {
+  SoplexLp* SoplexLp::_newSolver() const {
     SoplexLp* newlp = new SoplexLp();
     return newlp;
   }
 
-  SoplexLp* SoplexLp::cloneSolver() const {
+  SoplexLp* SoplexLp::_cloneSolver() const {
     SoplexLp* newlp = new SoplexLp(*this);
     return newlp;
@@ -275,6 +272,4 @@
 
     _clear_temporals();
-    
-    _applyMessageLevel();
 
     soplex::SPxSolver::Status status = soplex->solve();
@@ -425,28 +420,4 @@
   }
 
-  void SoplexLp::_messageLevel(MessageLevel level) {
-    switch (level) {
-    case MESSAGE_NOTHING:
-      _message_level = -1;
-      break;
-    case MESSAGE_ERROR:
-      _message_level = soplex::SPxOut::ERROR;
-      break;
-    case MESSAGE_WARNING:
-      _message_level = soplex::SPxOut::WARNING;
-      break;
-    case MESSAGE_NORMAL:
-      _message_level = soplex::SPxOut::INFO2;
-      break;
-    case MESSAGE_VERBOSE:
-      _message_level = soplex::SPxOut::DEBUG;
-      break;
-    }
-  }
-
-  void SoplexLp::_applyMessageLevel() {
-    soplex::Param::setVerbose(_message_level);
-  }
-
 } //namespace lemon
 
Index: lemon/soplex.h
===================================================================
--- lemon/soplex.h	(revision 576)
+++ lemon/soplex.h	(revision 462)
@@ -74,10 +74,9 @@
     /// \e
     ~SoplexLp();
-    /// \e
-    virtual SoplexLp* newSolver() const;
-    /// \e
-    virtual SoplexLp* cloneSolver() const;
 
   protected:
+
+    virtual SoplexLp* _newSolver() const;
+    virtual SoplexLp* _cloneSolver() const;
 
     virtual const char* _solverName() const;
@@ -145,9 +144,4 @@
     virtual void _clear();
 
-    void _messageLevel(MessageLevel m);
-    void _applyMessageLevel();
-
-    int _message_level;
-
   };
 
Index: lemon/suurballe.h
===================================================================
--- lemon/suurballe.h	(revision 584)
+++ lemon/suurballe.h	(revision 519)
@@ -46,7 +46,7 @@
   /// \ref CapacityScaling "successive shortest path" algorithm.
   ///
-  /// \tparam GR The digraph type the algorithm runs on.
+  /// \tparam Digraph The digraph type the algorithm runs on.
   /// The default value is \c ListDigraph.
-  /// \tparam LEN The type of the length (cost) map.
+  /// \tparam LengthMap The type of the length (cost) map.
   /// The default value is <tt>Digraph::ArcMap<int></tt>.
   ///
@@ -56,24 +56,19 @@
   /// with \ref SplitNodes.
 #ifdef DOXYGEN
-  template <typename GR, typename LEN>
+  template <typename Digraph, typename LengthMap>
 #else
-  template < typename GR = ListDigraph,
-             typename LEN = typename GR::template ArcMap<int> >
+  template < typename Digraph = ListDigraph,
+             typename LengthMap = typename Digraph::template ArcMap<int> >
 #endif
   class Suurballe
   {
-    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
+    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
+
+    typedef typename LengthMap::Value Length;
     typedef ConstMap<Arc, int> ConstArcMap;
-    typedef typename GR::template NodeMap<Arc> PredMap;
+    typedef typename Digraph::template NodeMap<Arc> PredMap;
 
   public:
 
-    /// The type of the digraph the algorithm runs on.
-    typedef GR Digraph;
-    /// The type of the length map.
-    typedef LEN LengthMap;
-    /// The type of the lengths.
-    typedef typename LengthMap::Value Length;
     /// The type of the flow map.
     typedef typename Digraph::template ArcMap<int> FlowMap;
@@ -262,5 +257,5 @@
     /// the found arc-disjoint paths.
     ///
-    /// \return <tt>(*this)</tt>
+    /// \return \c (*this)
     Suurballe& flowMap(FlowMap &map) {
       if (_local_flow) {
@@ -279,5 +274,5 @@
     /// minimum cost flow problem.
     ///
-    /// \return <tt>(*this)</tt>
+    /// \return \c (*this)
     Suurballe& potentialMap(PotentialMap &map) {
       if (_local_potential) {
@@ -289,5 +284,5 @@
     }
 
-    /// \name Execution Control
+    /// \name Execution control
     /// The simplest way to execute the algorithm is to call the run()
     /// function.
@@ -464,5 +459,5 @@
     ///
     /// This function returns the total length (cost) of the found paths
-    /// (flow). The complexity of the function is O(e).
+    /// (flow). The complexity of the function is \f$ O(e) \f$.
     ///
     /// \pre \ref run() or \ref findFlow() must be called before using
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 584)
+++ lemon/time_measure.h	(revision 515)
@@ -203,5 +203,5 @@
   };
 
-  inline TimeStamp operator*(double b,const TimeStamp &t)
+  TimeStamp operator*(double b,const TimeStamp &t)
   {
     return t*b;
@@ -288,5 +288,5 @@
     Timer(bool run=true) :_running(run) {_reset();}
 
-    ///\name Control the State of the Timer
+    ///\name Control the state of the timer
     ///Basically a Timer can be either running or stopped,
     ///but it provides a bit finer control on the execution.
@@ -396,5 +396,5 @@
     ///@}
 
-    ///\name Query Functions for the Ellapsed Time
+    ///\name Query Functions for the ellapsed time
 
     ///@{
Index: lemon/unionfind.h
===================================================================
--- lemon/unionfind.h	(revision 559)
+++ lemon/unionfind.h	(revision 440)
@@ -52,11 +52,9 @@
   /// \pre You need to add all the elements by the \ref insert()
   /// method.
-  template <typename IM>
+  template <typename _ItemIntMap>
   class UnionFind {
   public:
 
-    ///\e
-    typedef IM ItemIntMap;
-    ///\e
+    typedef _ItemIntMap ItemIntMap;
     typedef typename ItemIntMap::Key Item;
 
@@ -173,11 +171,9 @@
   /// method.
   ///
-  template <typename IM>
+  template <typename _ItemIntMap>
   class UnionFindEnum {
   public:
 
-    ///\e
-    typedef IM ItemIntMap;
-    ///\e
+    typedef _ItemIntMap ItemIntMap;
     typedef typename ItemIntMap::Key Item;
 
@@ -632,11 +628,9 @@
   /// \pre You need to add all the elements by the \ref insert()
   /// method.
-  template <typename IM>
+  template <typename _ItemIntMap>
   class ExtendFindEnum {
   public:
 
-    ///\e
-    typedef IM ItemIntMap;
-    ///\e
+    typedef _ItemIntMap ItemIntMap;
     typedef typename ItemIntMap::Key Item;
 
@@ -955,16 +949,16 @@
   /// \pre You need to add all the elements by the \ref insert()
   /// method.
-  template <typename V, typename IM, typename Comp = std::less<V> >
+  ///
+  template <typename _Value, typename _ItemIntMap,
+            typename _Comp = std::less<_Value> >
   class HeapUnionFind {
   public:
 
-    ///\e
-    typedef V Value;
-    ///\e
-    typedef typename IM::Key Item;
-    ///\e
-    typedef IM ItemIntMap;
-    ///\e
-    typedef Comp Compare;
+    typedef _Value Value;
+    typedef typename _ItemIntMap::Key Item;
+
+    typedef _ItemIntMap ItemIntMap;
+
+    typedef _Comp Comp;
 
   private:
@@ -1608,5 +1602,5 @@
     /// \brief Gives back the priority of the current item.
     ///
-    /// Gives back the priority of the current item.
+    /// \return Gives back the priority of the current item.
     const Value& operator[](const Item& item) const {
       return nodes[index[item]].prio;
@@ -1653,5 +1647,5 @@
     /// \brief Gives back the minimum priority of the class.
     ///
-    /// Gives back the minimum priority of the class.
+    /// \return Gives back the minimum priority of the class.
     const Value& classPrio(int cls) const {
       return nodes[~(classes[cls].parent)].prio;
@@ -1667,7 +1661,7 @@
     /// \brief Gives back a representant item of the class.
     ///
-    /// Gives back a representant item of the class.
     /// The representant is indpendent from the priorities of the
     /// items.
+    /// \return Gives back a representant item of the class.
     const Item& classRep(int id) const {
       int parent = classes[id].parent;
Index: m4/lx_check_clp.m4
===================================================================
--- m4/lx_check_clp.m4	(revision 459)
+++ m4/lx_check_clp.m4	(revision 459)
@@ -0,0 +1,73 @@
+AC_DEFUN([LX_CHECK_CLP],
+[
+  AC_ARG_WITH([clp],
+AS_HELP_STRING([--with-clp@<:@=PREFIX@:>@], [search for CLP under PREFIX or under the default search paths if PREFIX is not given @<:@default@:>@])
+AS_HELP_STRING([--without-clp], [disable checking for CLP]),
+              [], [with_clp=yes])
+
+  AC_ARG_WITH([clp-includedir],
+AS_HELP_STRING([--with-clp-includedir=DIR], [search for CLP headers in DIR]),
+              [], [with_clp_includedir=no])
+
+  AC_ARG_WITH([clp-libdir],
+AS_HELP_STRING([--with-clp-libdir=DIR], [search for CLP libraries in DIR]),
+              [], [with_clp_libdir=no])
+
+  lx_clp_found=no
+  if test x"$with_clp" != x"no"; then
+    AC_MSG_CHECKING([for CLP])
+
+    if test x"$with_clp_includedir" != x"no"; then
+      CLP_CXXFLAGS="-I$with_clp_includedir"
+    elif test x"$with_clp" != x"yes"; then
+      CLP_CXXFLAGS="-I$with_clp/include"
+    fi
+
+    if test x"$with_clp_libdir" != x"no"; then
+      CLP_LDFLAGS="-L$with_clp_libdir"
+    elif test x"$with_clp" != x"yes"; then
+      CLP_LDFLAGS="-L$with_clp/lib"
+    fi
+    CLP_LIBS="-lClp -lCoinUtils -lm"
+
+    lx_save_cxxflags="$CXXFLAGS"
+    lx_save_ldflags="$LDFLAGS"
+    lx_save_libs="$LIBS"
+    CXXFLAGS="$CLP_CXXFLAGS"
+    LDFLAGS="$CLP_LDFLAGS"
+    LIBS="$CLP_LIBS"
+
+    lx_clp_test_prog='
+      #include <coin/ClpModel.hpp>
+
+      int main(int argc, char** argv)
+      {
+        ClpModel clp;
+        return 0;
+      }'
+
+    AC_LANG_PUSH(C++)
+    AC_LINK_IFELSE([$lx_clp_test_prog], [lx_clp_found=yes], [lx_clp_found=no])
+    AC_LANG_POP(C++)
+
+    CXXFLAGS="$lx_save_cxxflags"
+    LDFLAGS="$lx_save_ldflags"
+    LIBS="$lx_save_libs"
+
+    if test x"$lx_clp_found" = x"yes"; then
+      AC_DEFINE([HAVE_CLP], [1], [Define to 1 if you have CLP.])
+      lx_lp_found=yes
+      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
+      AC_MSG_RESULT([yes])
+    else
+      CLP_CXXFLAGS=""
+      CLP_LDFLAGS=""
+      CLP_LIBS=""
+      AC_MSG_RESULT([no])
+    fi
+  fi
+  CLP_LIBS="$CLP_LDFLAGS $CLP_LIBS"
+  AC_SUBST(CLP_CXXFLAGS)
+  AC_SUBST(CLP_LIBS)
+  AM_CONDITIONAL([HAVE_CLP], [test x"$lx_clp_found" = x"yes"])
+])
Index: lx_check_coin.m4
===================================================================
--- m4/lx_check_coin.m4	(revision 568)
+++ 	(revision )
@@ -1,136 +1,0 @@
-AC_DEFUN([LX_CHECK_COIN],
-[
-  AC_ARG_WITH([coin],
-AS_HELP_STRING([--with-coin@<:@=PREFIX@:>@], [search for CLP under PREFIX or under the default search paths if PREFIX is not given @<:@default@:>@])
-AS_HELP_STRING([--without-coin], [disable checking for CLP]),
-              [], [with_coin=yes])
-
-  AC_ARG_WITH([coin-includedir],
-AS_HELP_STRING([--with-coin-includedir=DIR], [search for CLP headers in DIR]),
-              [], [with_coin_includedir=no])
-
-  AC_ARG_WITH([coin-libdir],
-AS_HELP_STRING([--with-coin-libdir=DIR], [search for CLP libraries in DIR]),
-              [], [with_coin_libdir=no])
-
-  lx_clp_found=no
-  if test x"$with_coin" != x"no"; then
-    AC_MSG_CHECKING([for CLP])
-
-    if test x"$with_coin_includedir" != x"no"; then
-      CLP_CXXFLAGS="-I$with_coin_includedir"
-    elif test x"$with_coin" != x"yes"; then
-      CLP_CXXFLAGS="-I$with_coin/include"
-    fi
-
-    if test x"$with_coin_libdir" != x"no"; then
-      CLP_LDFLAGS="-L$with_coin_libdir"
-    elif test x"$with_coin" != x"yes"; then
-      CLP_LDFLAGS="-L$with_coin/lib"
-    fi
-    CLP_LIBS="-lClp -lCoinUtils -lm"
-
-    lx_save_cxxflags="$CXXFLAGS"
-    lx_save_ldflags="$LDFLAGS"
-    lx_save_libs="$LIBS"
-    CXXFLAGS="$CLP_CXXFLAGS"
-    LDFLAGS="$CLP_LDFLAGS"
-    LIBS="$CLP_LIBS"
-
-    lx_clp_test_prog='
-      #include <coin/ClpModel.hpp>
-
-      int main(int argc, char** argv)
-      {
-        ClpModel clp;
-        return 0;
-      }'
-
-    AC_LANG_PUSH(C++)
-    AC_LINK_IFELSE([$lx_clp_test_prog], [lx_clp_found=yes], [lx_clp_found=no])
-    AC_LANG_POP(C++)
-
-    CXXFLAGS="$lx_save_cxxflags"
-    LDFLAGS="$lx_save_ldflags"
-    LIBS="$lx_save_libs"
-
-    if test x"$lx_clp_found" = x"yes"; then
-      AC_DEFINE([HAVE_CLP], [1], [Define to 1 if you have CLP.])
-      lx_lp_found=yes
-      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
-      AC_MSG_RESULT([yes])
-    else
-      CLP_CXXFLAGS=""
-      CLP_LDFLAGS=""
-      CLP_LIBS=""
-      AC_MSG_RESULT([no])
-    fi
-  fi
-  CLP_LIBS="$CLP_LDFLAGS $CLP_LIBS"
-  AC_SUBST(CLP_CXXFLAGS)
-  AC_SUBST(CLP_LIBS)
-  AM_CONDITIONAL([HAVE_CLP], [test x"$lx_clp_found" = x"yes"])
-
-
-  lx_cbc_found=no
-  if test x"$lx_clp_found" = x"yes"; then
-    if test x"$with_coin" != x"no"; then
-      AC_MSG_CHECKING([for CBC])
-
-      if test x"$with_coin_includedir" != x"no"; then
-        CBC_CXXFLAGS="-I$with_coin_includedir"
-      elif test x"$with_coin" != x"yes"; then
-        CBC_CXXFLAGS="-I$with_coin/include"
-      fi
-
-      if test x"$with_coin_libdir" != x"no"; then
-        CBC_LDFLAGS="-L$with_coin_libdir"
-      elif test x"$with_coin" != x"yes"; then
-        CBC_LDFLAGS="-L$with_coin/lib"
-      fi
-      CBC_LIBS="-lOsi -lCbc -lOsiCbc -lCbcSolver -lClp -lOsiClp -lCoinUtils -lVol -lOsiVol -lCgl -lm -llapack -lblas"
-
-      lx_save_cxxflags="$CXXFLAGS"
-      lx_save_ldflags="$LDFLAGS"
-      lx_save_libs="$LIBS"
-      CXXFLAGS="$CBC_CXXFLAGS"
-      LDFLAGS="$CBC_LDFLAGS"
-      LIBS="$CBC_LIBS"
-
-      lx_cbc_test_prog='
-        #include <coin/CbcModel.hpp>
-
-        int main(int argc, char** argv)
-        {
-          CbcModel cbc;
-          return 0;
-        }'
-
-      AC_LANG_PUSH(C++)
-      AC_LINK_IFELSE([$lx_cbc_test_prog], [lx_cbc_found=yes], [lx_cbc_found=no])
-      AC_LANG_POP(C++)
-
-      CXXFLAGS="$lx_save_cxxflags"
-      LDFLAGS="$lx_save_ldflags"
-      LIBS="$lx_save_libs"
-
-      if test x"$lx_cbc_found" = x"yes"; then
-        AC_DEFINE([HAVE_CBC], [1], [Define to 1 if you have CBC.])
-        lx_lp_found=yes
-        AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
-        lx_mip_found=yes
-        AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
-        AC_MSG_RESULT([yes])
-      else
-        CBC_CXXFLAGS=""
-        CBC_LDFLAGS=""
-        CBC_LIBS=""
-        AC_MSG_RESULT([no])
-      fi
-    fi
-  fi
-  CBC_LIBS="$CBC_LDFLAGS $CBC_LIBS"
-  AC_SUBST(CBC_CXXFLAGS)
-  AC_SUBST(CBC_LIBS)
-  AM_CONDITIONAL([HAVE_CBC], [test x"$lx_cbc_found" = x"yes"])
-])
Index: m4/lx_check_soplex.m4
===================================================================
--- m4/lx_check_soplex.m4	(revision 539)
+++ m4/lx_check_soplex.m4	(revision 457)
@@ -21,5 +21,5 @@
       SOPLEX_CXXFLAGS="-I$with_soplex_includedir"
     elif test x"$with_soplex" != x"yes"; then
-      SOPLEX_CXXFLAGS="-I$with_soplex/src"
+      SOPLEX_CXXFLAGS="-I$with_soplex/include"
     fi
 
@@ -39,5 +39,5 @@
 
     lx_soplex_test_prog='
-      #include <soplex.h>
+      #include <soplex/soplex.h>
 
       int main(int argc, char** argv)
Index: ripts/mk-release.sh
===================================================================
--- scripts/mk-release.sh	(revision 564)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#!/bin/bash
-
-set -e
-
-if [ $# = 0 ]; then
-    echo "Usage: $0 release-id"
-    exit 1
-else
-    export LEMON_VERSION=$1
-fi
-
-echo '*****************************************************************'
-echo ' Start making release tarballs for version '${LEMON_VERSION}
-echo '*****************************************************************'
-
-autoreconf -vif
-./configure
-
-make
-make html
-make distcheck
-tar xf lemon-${LEMON_VERSION}.tar.gz
-zip -r lemon-${LEMON_VERSION}.zip lemon-${LEMON_VERSION}
-mv lemon-${LEMON_VERSION}/doc/html lemon-doc-${LEMON_VERSION}
-tar czf lemon-doc-${LEMON_VERSION}.tar.gz lemon-doc-${LEMON_VERSION}
-zip -r lemon-doc-${LEMON_VERSION}.zip lemon-doc-${LEMON_VERSION}
-tar czf lemon-nodoc-${LEMON_VERSION}.tar.gz lemon-${LEMON_VERSION}
-zip -r lemon-nodoc-${LEMON_VERSION}.zip lemon-${LEMON_VERSION}
-hg tag -m 'LEMON '${LEMON_VERSION}' released ('$(hg par --template="{node|short}")' tagged as r'${LEMON_VERSION}')' r${LEMON_VERSION}
-
-rm -rf lemon-${LEMON_VERSION} lemon-doc-${LEMON_VERSION}
-
-echo '*****************************************************************'
-echo '  Release '${LEMON_VERSION}' has been created' 
-echo '*****************************************************************'
Index: scripts/unify-sources.sh
===================================================================
--- scripts/unify-sources.sh	(revision 554)
+++ scripts/unify-sources.sh	(revision 396)
@@ -89,10 +89,5 @@
     if [ "$3" == 'tabs' ]
     then
-        if echo $2 | grep -q -v -E 'Makefile\.am$'
-        then
-            PATTERN=$(echo -e '\t')
-        else
-            PATTERN='        '
-        fi
+        PATTERN=$(echo -e '\t')
     elif [ "$3" == 'trailing spaces' ]
     then
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 594)
+++ test/CMakeLists.txt	(revision 601)
@@ -1,5 +1,5 @@
 INCLUDE_DIRECTORIES(
-  ${PROJECT_SOURCE_DIR}
-  ${PROJECT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}
 )
 
@@ -8,5 +8,5 @@
 ENDIF(HAVE_GLPK)
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
 
 SET(TESTS
@@ -22,5 +22,4 @@
   error_test
   euler_test
-  gomory_hu_test
   graph_copy_test
   graph_test
@@ -30,6 +29,7 @@
   kruskal_test
   maps_test
-  matching_test
+  max_matching_test
   min_cost_arborescence_test
+  min_cost_flow_test
   path_test
   preflow_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 594)
+++ test/Makefile.am	(revision 601)
@@ -18,5 +18,4 @@
 	test/error_test \
 	test/euler_test \
-	test/gomory_hu_test \
 	test/graph_copy_test \
 	test/graph_test \
@@ -26,6 +25,7 @@
 	test/kruskal_test \
 	test/maps_test \
-	test/matching_test \
+	test/max_matching_test \
 	test/min_cost_arborescence_test \
+	test/min_cost_flow_test \
 	test/path_test \
 	test/preflow_test \
@@ -37,6 +37,4 @@
 	test/time_measure_test \
 	test/unionfind_test
-
-test_test_tools_pass_DEPENDENCIES = demo
 
 if HAVE_LP
@@ -61,5 +59,4 @@
 test_error_test_SOURCES = test/error_test.cc
 test_euler_test_SOURCES = test/euler_test.cc
-test_gomory_hu_test_SOURCES = test/gomory_hu_test.cc
 test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
@@ -71,6 +68,7 @@
 test_maps_test_SOURCES = test/maps_test.cc
 test_mip_test_SOURCES = test/mip_test.cc
-test_matching_test_SOURCES = test/matching_test.cc
+test_max_matching_test_SOURCES = test/max_matching_test.cc
 test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc
+test_min_cost_flow_test_SOURCES = test/min_cost_flow_test.cc
 test_path_test_SOURCES = test/path_test.cc
 test_preflow_test_SOURCES = test/preflow_test.cc
Index: test/bfs_test.cc
===================================================================
--- test/bfs_test.cc	(revision 585)
+++ test/bfs_test.cc	(revision 440)
@@ -59,16 +59,14 @@
 
   Digraph G;
-  Node s, t, n;
+  Node s, t;
   Arc e;
-  int l, i;
+  int l;
   bool b;
   BType::DistMap d(G);
   BType::PredMap p(G);
   Path<Digraph> pp;
-  concepts::ReadMap<Node,bool> nm;
 
   {
     BType bfs_test(G);
-    const BType& const_bfs_test = bfs_test;
 
     bfs_test.run(s);
@@ -76,24 +74,11 @@
     bfs_test.run();
 
-    bfs_test.init();
-    bfs_test.addSource(s);
-    n = bfs_test.processNextNode();
-    n = bfs_test.processNextNode(t, b);
-    n = bfs_test.processNextNode(nm, n);
-    n = const_bfs_test.nextNode();
-    b = const_bfs_test.emptyQueue();
-    i = const_bfs_test.queueSize();
-    
-    bfs_test.start();
-    bfs_test.start(t);
-    bfs_test.start(nm);
-
-    l  = const_bfs_test.dist(t);
-    e  = const_bfs_test.predArc(t);
-    s  = const_bfs_test.predNode(t);
-    b  = const_bfs_test.reached(t);
-    d  = const_bfs_test.distMap();
-    p  = const_bfs_test.predMap();
-    pp = const_bfs_test.path(t);
+    l  = bfs_test.dist(t);
+    e  = bfs_test.predArc(t);
+    s  = bfs_test.predNode(t);
+    b  = bfs_test.reached(t);
+    d  = bfs_test.distMap();
+    p  = bfs_test.predMap();
+    pp = bfs_test.path(t);
   }
   {
@@ -102,35 +87,11 @@
       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
+      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::SetStandardProcessedMap
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::Create bfs_test(G);
-      
-    concepts::ReadWriteMap<Node,Arc> pred_map;
-    concepts::ReadWriteMap<Node,int> dist_map;
-    concepts::ReadWriteMap<Node,bool> reached_map;
-    concepts::WriteMap<Node,bool> processed_map;
-    
-    bfs_test
-      .predMap(pred_map)
-      .distMap(dist_map)
-      .reachedMap(reached_map)
-      .processedMap(processed_map);
 
     bfs_test.run(s);
     bfs_test.run(s,t);
     bfs_test.run();
-    
-    bfs_test.init();
-    bfs_test.addSource(s);
-    n = bfs_test.processNextNode();
-    n = bfs_test.processNextNode(t, b);
-    n = bfs_test.processNextNode(nm, n);
-    n = bfs_test.nextNode();
-    b = bfs_test.emptyQueue();
-    i = bfs_test.queueSize();
-    
-    bfs_test.start();
-    bfs_test.start(t);
-    bfs_test.start(nm);
 
     l  = bfs_test.dist(t);
Index: test/circulation_test.cc
===================================================================
--- test/circulation_test.cc	(revision 585)
+++ test/circulation_test.cc	(revision 440)
@@ -72,20 +72,16 @@
   FlowMap flow;
   BarrierMap bar;
-  VType v;
-  bool b;
 
-  typedef Circulation<Digraph, CapMap, CapMap, DeltaMap>
-            ::SetFlowMap<FlowMap>
-            ::SetElevator<Elev>
-            ::SetStandardElevator<LinkedElev>
-            ::Create CirculationType;
-  CirculationType circ_test(g, lcap, ucap, delta);
-  const CirculationType& const_circ_test = circ_test;
-   
-  circ_test
-    .lowerCapMap(lcap)
-    .upperCapMap(ucap)
-    .deltaMap(delta)
-    .flowMap(flow);
+  Circulation<Digraph, CapMap, CapMap, DeltaMap>
+    ::SetFlowMap<FlowMap>
+    ::SetElevator<Elev>
+    ::SetStandardElevator<LinkedElev>
+    ::Create circ_test(g,lcap,ucap,delta);
+
+  circ_test.lowerCapMap(lcap);
+  circ_test.upperCapMap(ucap);
+  circ_test.deltaMap(delta);
+  flow = circ_test.flowMap();
+  circ_test.flowMap(flow);
 
   circ_test.init();
@@ -94,10 +90,7 @@
   circ_test.run();
 
-  v = const_circ_test.flow(a);
-  const FlowMap& fm = const_circ_test.flowMap();
-  b = const_circ_test.barrier(n);
-  const_circ_test.barrierMap(bar);
-  
-  ignore_unused_variable_warning(fm);
+  circ_test.barrier(n);
+  circ_test.barrierMap(bar);
+  circ_test.flow(a);
 }
 
Index: test/counter_test.cc
===================================================================
--- test/counter_test.cc	(revision 558)
+++ test/counter_test.cc	(revision 440)
@@ -19,7 +19,4 @@
 #include <lemon/counter.h>
 #include <vector>
-#include <sstream>
-
-#include "test/test_tools.h"
 
 using namespace lemon;
@@ -27,76 +24,52 @@
 template <typename T>
 void bubbleSort(std::vector<T>& v) {
-  std::stringstream s1, s2, s3;
-  {
-    Counter op("Bubble Sort - Operations: ", s1);
-    Counter::SubCounter as(op, "Assignments: ", s2);
-    Counter::SubCounter co(op, "Comparisons: ", s3);
-    for (int i = v.size()-1; i > 0; --i) {
-      for (int j = 0; j < i; ++j) {
-        if (v[j] > v[j+1]) {
-          T tmp = v[j];
-          v[j] = v[j+1];
-          v[j+1] = tmp;
-          as += 3;
-        }
-        ++co;
+  Counter op("Bubble Sort - Operations: ");
+  Counter::NoSubCounter as(op, "Assignments: ");
+  Counter::NoSubCounter co(op, "Comparisons: ");
+  for (int i = v.size()-1; i > 0; --i) {
+    for (int j = 0; j < i; ++j) {
+      if (v[j] > v[j+1]) {
+        T tmp = v[j];
+        v[j] = v[j+1];
+        v[j+1] = tmp;
+        as += 3;
       }
+      ++co;
     }
   }
-  check(s1.str() == "Bubble Sort - Operations: 102\n", "Wrong counter");
-  check(s2.str() == "Assignments: 57\n", "Wrong subcounter");
-  check(s3.str() == "Comparisons: 45\n", "Wrong subcounter");
 }
 
 template <typename T>
 void insertionSort(std::vector<T>& v) {
-  std::stringstream s1, s2, s3;
-  {
-    Counter op("Insertion Sort - Operations: ", s1);
-    Counter::SubCounter as(op, "Assignments: ", s2);
-    Counter::SubCounter co(op, "Comparisons: ", s3);
-    for (int i = 1; i < int(v.size()); ++i) {
-      T value = v[i];
-      ++as;
-      int j = i;
-      while (j > 0 && v[j-1] > value) {
-        v[j] = v[j-1];
-        --j;
-        ++co; ++as;
-      }
-      v[j] = value;
-      ++as;
+  Counter op("Insertion Sort - Operations: ");
+  Counter::NoSubCounter as(op, "Assignments: ");
+  Counter::NoSubCounter co(op, "Comparisons: ");
+  for (int i = 1; i < int(v.size()); ++i) {
+    T value = v[i];
+    ++as;
+    int j = i;
+    while (j > 0 && v[j-1] > value) {
+      v[j] = v[j-1];
+      --j;
+      ++co; ++as;
     }
+    v[j] = value;
+    ++as;
   }
-  check(s1.str() == "Insertion Sort - Operations: 56\n", "Wrong counter");
-  check(s2.str() == "Assignments: 37\n", "Wrong subcounter");
-  check(s3.str() == "Comparisons: 19\n", "Wrong subcounter");
 }
 
 template <typename MyCounter>
-void counterTest(bool output) {
-  std::stringstream s1, s2, s3;
-  {
-    MyCounter c("Main Counter: ", s1);
-    c++;
-    typename MyCounter::SubCounter d(c, "SubCounter: ", s2);
-    d++;
-    typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ", s3);
-    e++;
-    d+=3;
-    c-=4;
-    e-=2;
-    c.reset(2);
-    c.reset();
-  }
-  if (output) {
-    check(s1.str() == "Main Counter: 3\n", "Wrong Counter");
-    check(s2.str() == "SubCounter: 3\n", "Wrong SubCounter");
-    check(s3.str() == "", "Wrong NoSubCounter");
-  } else {
-    check(s1.str() == "", "Wrong NoCounter");
-    check(s2.str() == "", "Wrong SubCounter");
-    check(s3.str() == "", "Wrong NoSubCounter");
-  }
+void counterTest() {
+  MyCounter c("Main Counter: ");
+  c++;
+  typename MyCounter::SubCounter d(c, "SubCounter: ");
+  d++;
+  typename MyCounter::SubCounter::NoSubCounter e(d, "SubSubCounter: ");
+  e++;
+  d+=3;
+  c-=4;
+  e-=2;
+  c.reset(2);
+  c.reset();
 }
 
@@ -108,6 +81,6 @@
 int main()
 {
-  counterTest<Counter>(true);
-  counterTest<NoCounter>(false);
+  counterTest<Counter>();
+  counterTest<NoCounter>();
 
   std::vector<int> x(10);
Index: test/dfs_test.cc
===================================================================
--- test/dfs_test.cc	(revision 585)
+++ test/dfs_test.cc	(revision 440)
@@ -63,14 +63,12 @@
   Node s, t;
   Arc e;
-  int l, i;
+  int l;
   bool b;
   DType::DistMap d(G);
   DType::PredMap p(G);
   Path<Digraph> pp;
-  concepts::ReadMap<Arc,bool> am;
 
   {
     DType dfs_test(G);
-    const DType& const_dfs_test = dfs_test;
 
     dfs_test.run(s);
@@ -78,22 +76,11 @@
     dfs_test.run();
 
-    dfs_test.init();
-    dfs_test.addSource(s);
-    e = dfs_test.processNextArc();
-    e = const_dfs_test.nextArc();
-    b = const_dfs_test.emptyQueue();
-    i = const_dfs_test.queueSize();
-    
-    dfs_test.start();
-    dfs_test.start(t);
-    dfs_test.start(am);
-
-    l  = const_dfs_test.dist(t);
-    e  = const_dfs_test.predArc(t);
-    s  = const_dfs_test.predNode(t);
-    b  = const_dfs_test.reached(t);
-    d  = const_dfs_test.distMap();
-    p  = const_dfs_test.predMap();
-    pp = const_dfs_test.path(t);
+    l  = dfs_test.dist(t);
+    e  = dfs_test.predArc(t);
+    s  = dfs_test.predNode(t);
+    b  = dfs_test.reached(t);
+    d  = dfs_test.distMap();
+    p  = dfs_test.predMap();
+    pp = dfs_test.path(t);
   }
   {
@@ -102,33 +89,11 @@
       ::SetDistMap<concepts::ReadWriteMap<Node,int> >
       ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
+      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::SetStandardProcessedMap
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::Create dfs_test(G);
-
-    concepts::ReadWriteMap<Node,Arc> pred_map;
-    concepts::ReadWriteMap<Node,int> dist_map;
-    concepts::ReadWriteMap<Node,bool> reached_map;
-    concepts::WriteMap<Node,bool> processed_map;
-    
-    dfs_test
-      .predMap(pred_map)
-      .distMap(dist_map)
-      .reachedMap(reached_map)
-      .processedMap(processed_map);
 
     dfs_test.run(s);
     dfs_test.run(s,t);
     dfs_test.run();
-    dfs_test.init();
-
-    dfs_test.addSource(s);
-    e = dfs_test.processNextArc();
-    e = dfs_test.nextArc();
-    b = dfs_test.emptyQueue();
-    i = dfs_test.queueSize();
-    
-    dfs_test.start();
-    dfs_test.start(t);
-    dfs_test.start(am);
 
     l  = dfs_test.dist(t);
Index: test/dijkstra_test.cc
===================================================================
--- test/dijkstra_test.cc	(revision 585)
+++ test/dijkstra_test.cc	(revision 440)
@@ -61,8 +61,7 @@
 
   Digraph G;
-  Node s, t, n;
+  Node s, t;
   Arc e;
   VType l;
-  int i;
   bool b;
   DType::DistMap d(G);
@@ -70,34 +69,18 @@
   LengthMap length;
   Path<Digraph> pp;
-  concepts::ReadMap<Node,bool> nm;
 
   {
     DType dijkstra_test(G,length);
-    const DType& const_dijkstra_test = dijkstra_test;
 
     dijkstra_test.run(s);
     dijkstra_test.run(s,t);
 
-    dijkstra_test.init();
-    dijkstra_test.addSource(s);
-    dijkstra_test.addSource(s, 1);
-    n = dijkstra_test.processNextNode();
-    n = const_dijkstra_test.nextNode();
-    b = const_dijkstra_test.emptyQueue();
-    i = const_dijkstra_test.queueSize();
-    
-    dijkstra_test.start();
-    dijkstra_test.start(t);
-    dijkstra_test.start(nm);
-
-    l  = const_dijkstra_test.dist(t);
-    e  = const_dijkstra_test.predArc(t);
-    s  = const_dijkstra_test.predNode(t);
-    b  = const_dijkstra_test.reached(t);
-    b  = const_dijkstra_test.processed(t);
-    d  = const_dijkstra_test.distMap();
-    p  = const_dijkstra_test.predMap();
-    pp = const_dijkstra_test.path(t);
-    l  = const_dijkstra_test.currentDist(t);
+    l  = dijkstra_test.dist(t);
+    e  = dijkstra_test.predArc(t);
+    s  = dijkstra_test.predNode(t);
+    b  = dijkstra_test.reached(t);
+    d  = dijkstra_test.distMap();
+    p  = dijkstra_test.predMap();
+    pp = dijkstra_test.path(t);
   }
   {
@@ -105,40 +88,13 @@
       ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
       ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
+      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::SetStandardProcessedMap
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
       ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
       ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
-      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 
-                concepts::ReadWriteMap<Node,int> >
       ::Create dijkstra_test(G,length);
-
-    LengthMap length_map;
-    concepts::ReadWriteMap<Node,Arc> pred_map;
-    concepts::ReadWriteMap<Node,VType> dist_map;
-    concepts::WriteMap<Node,bool> processed_map;
-    concepts::ReadWriteMap<Node,int> heap_cross_ref;
-    BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
-    
-    dijkstra_test
-      .lengthMap(length_map)
-      .predMap(pred_map)
-      .distMap(dist_map)
-      .processedMap(processed_map)
-      .heap(heap, heap_cross_ref);
 
     dijkstra_test.run(s);
     dijkstra_test.run(s,t);
-
-    dijkstra_test.addSource(s);
-    dijkstra_test.addSource(s, 1);
-    n = dijkstra_test.processNextNode();
-    n = dijkstra_test.nextNode();
-    b = dijkstra_test.emptyQueue();
-    i = dijkstra_test.queueSize();
-    
-    dijkstra_test.start();
-    dijkstra_test.start(t);
-    dijkstra_test.start(nm);
 
     l  = dijkstra_test.dist(t);
@@ -146,7 +102,5 @@
     s  = dijkstra_test.predNode(t);
     b  = dijkstra_test.reached(t);
-    b  = dijkstra_test.processed(t);
     pp = dijkstra_test.path(t);
-    l  = dijkstra_test.currentDist(t);
   }
 
Index: test/euler_test.cc
===================================================================
--- test/euler_test.cc	(revision 592)
+++ test/euler_test.cc	(revision 531)
@@ -19,64 +19,61 @@
 #include <lemon/euler.h>
 #include <lemon/list_graph.h>
-#include <lemon/adaptors.h>
-#include "test_tools.h"
+#include <test/test_tools.h>
 
 using namespace lemon;
 
 template <typename Digraph>
-void checkDiEulerIt(const Digraph& g,
-                    const typename Digraph::Node& start = INVALID)
+void checkDiEulerIt(const Digraph& g)
 {
   typename Digraph::template ArcMap<int> visitationNumber(g, 0);
 
-  DiEulerIt<Digraph> e(g, start);
-  if (e == INVALID) return;
+  DiEulerIt<Digraph> e(g);
   typename Digraph::Node firstNode = g.source(e);
   typename Digraph::Node lastNode = g.target(e);
-  if (start != INVALID) {
-    check(firstNode == start, "checkDiEulerIt: Wrong first node");
-  }
 
-  for (; e != INVALID; ++e) {
-    if (e != INVALID) lastNode = g.target(e);
+  for (; e != INVALID; ++e)
+  {
+    if (e != INVALID)
+    {
+      lastNode = g.target(e);
+    }
     ++visitationNumber[e];
   }
 
   check(firstNode == lastNode,
-      "checkDiEulerIt: First and last nodes are not the same");
+      "checkDiEulerIt: first and last node are not the same");
 
   for (typename Digraph::ArcIt a(g); a != INVALID; ++a)
   {
     check(visitationNumber[a] == 1,
-        "checkDiEulerIt: Not visited or multiple times visited arc found");
+        "checkDiEulerIt: not visited or multiple times visited arc found");
   }
 }
 
 template <typename Graph>
-void checkEulerIt(const Graph& g,
-                  const typename Graph::Node& start = INVALID)
+void checkEulerIt(const Graph& g)
 {
   typename Graph::template EdgeMap<int> visitationNumber(g, 0);
 
-  EulerIt<Graph> e(g, start);
-  if (e == INVALID) return;
-  typename Graph::Node firstNode = g.source(typename Graph::Arc(e));
-  typename Graph::Node lastNode = g.target(typename Graph::Arc(e));
-  if (start != INVALID) {
-    check(firstNode == start, "checkEulerIt: Wrong first node");
-  }
+  EulerIt<Graph> e(g);
+  typename Graph::Node firstNode = g.u(e);
+  typename Graph::Node lastNode = g.v(e);
 
-  for (; e != INVALID; ++e) {
-    if (e != INVALID) lastNode = g.target(typename Graph::Arc(e));
+  for (; e != INVALID; ++e)
+  {
+    if (e != INVALID)
+    {
+      lastNode = g.v(e);
+    }
     ++visitationNumber[e];
   }
 
   check(firstNode == lastNode,
-      "checkEulerIt: First and last nodes are not the same");
+      "checkEulerIt: first and last node are not the same");
 
   for (typename Graph::EdgeIt e(g); e != INVALID; ++e)
   {
     check(visitationNumber[e] == 1,
-        "checkEulerIt: Not visited or multiple times visited edge found");
+        "checkEulerIt: not visited or multiple times visited edge found");
   }
 }
@@ -85,138 +82,71 @@
 {
   typedef ListDigraph Digraph;
-  typedef Undirector<Digraph> Graph;
-  
+  typedef ListGraph Graph;
+
+  Digraph digraphWithEulerianCircuit;
   {
-    Digraph d;
-    Graph g(d);
-    
-    checkDiEulerIt(d);
-    checkDiEulerIt(g);
-    checkEulerIt(g);
+    Digraph& g = digraphWithEulerianCircuit;
 
-    check(eulerian(d), "This graph is Eulerian");
-    check(eulerian(g), "This graph is Eulerian");
+    Digraph::Node n0 = g.addNode();
+    Digraph::Node n1 = g.addNode();
+    Digraph::Node n2 = g.addNode();
+
+    g.addArc(n0, n1);
+    g.addArc(n1, n0);
+    g.addArc(n1, n2);
+    g.addArc(n2, n1);
   }
+
+  Digraph digraphWithoutEulerianCircuit;
   {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n = d.addNode();
+    Digraph& g = digraphWithoutEulerianCircuit;
 
-    checkDiEulerIt(d);
-    checkDiEulerIt(g);
-    checkEulerIt(g);
+    Digraph::Node n0 = g.addNode();
+    Digraph::Node n1 = g.addNode();
+    Digraph::Node n2 = g.addNode();
 
-    check(eulerian(d), "This graph is Eulerian");
-    check(eulerian(g), "This graph is Eulerian");
+    g.addArc(n0, n1);
+    g.addArc(n1, n0);
+    g.addArc(n1, n2);
   }
+
+  Graph graphWithEulerianCircuit;
   {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n = d.addNode();
-    d.addArc(n, n);
+    Graph& g = graphWithEulerianCircuit;
 
-    checkDiEulerIt(d);
-    checkDiEulerIt(g);
-    checkEulerIt(g);
+    Graph::Node n0 = g.addNode();
+    Graph::Node n1 = g.addNode();
+    Graph::Node n2 = g.addNode();
 
-    check(eulerian(d), "This graph is Eulerian");
-    check(eulerian(g), "This graph is Eulerian");
+    g.addEdge(n0, n1);
+    g.addEdge(n1, n2);
+    g.addEdge(n2, n0);
   }
+
+  Graph graphWithoutEulerianCircuit;
   {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n1 = d.addNode();
-    Digraph::Node n2 = d.addNode();
-    Digraph::Node n3 = d.addNode();
-    
-    d.addArc(n1, n2);
-    d.addArc(n2, n1);
-    d.addArc(n2, n3);
-    d.addArc(n3, n2);
+    Graph& g = graphWithoutEulerianCircuit;
 
-    checkDiEulerIt(d);
-    checkDiEulerIt(d, n2);
-    checkDiEulerIt(g);
-    checkDiEulerIt(g, n2);
-    checkEulerIt(g);
-    checkEulerIt(g, n2);
+    Graph::Node n0 = g.addNode();
+    Graph::Node n1 = g.addNode();
+    Graph::Node n2 = g.addNode();
 
-    check(eulerian(d), "This graph is Eulerian");
-    check(eulerian(g), "This graph is Eulerian");
+    g.addEdge(n0, n1);
+    g.addEdge(n1, n2);
   }
-  {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n1 = d.addNode();
-    Digraph::Node n2 = d.addNode();
-    Digraph::Node n3 = d.addNode();
-    Digraph::Node n4 = d.addNode();
-    Digraph::Node n5 = d.addNode();
-    Digraph::Node n6 = d.addNode();
-    
-    d.addArc(n1, n2);
-    d.addArc(n2, n4);
-    d.addArc(n1, n3);
-    d.addArc(n3, n4);
-    d.addArc(n4, n1);
-    d.addArc(n3, n5);
-    d.addArc(n5, n2);
-    d.addArc(n4, n6);
-    d.addArc(n2, n6);
-    d.addArc(n6, n1);
-    d.addArc(n6, n3);
 
-    checkDiEulerIt(d);
-    checkDiEulerIt(d, n1);
-    checkDiEulerIt(d, n5);
+  checkDiEulerIt(digraphWithEulerianCircuit);
 
-    checkDiEulerIt(g);
-    checkDiEulerIt(g, n1);
-    checkDiEulerIt(g, n5);
-    checkEulerIt(g);
-    checkEulerIt(g, n1);
-    checkEulerIt(g, n5);
+  checkEulerIt(graphWithEulerianCircuit);
 
-    check(eulerian(d), "This graph is Eulerian");
-    check(eulerian(g), "This graph is Eulerian");
-  }
-  {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n0 = d.addNode();
-    Digraph::Node n1 = d.addNode();
-    Digraph::Node n2 = d.addNode();
-    Digraph::Node n3 = d.addNode();
-    Digraph::Node n4 = d.addNode();
-    Digraph::Node n5 = d.addNode();
-    
-    d.addArc(n1, n2);
-    d.addArc(n2, n3);
-    d.addArc(n3, n1);
+  check(eulerian(digraphWithEulerianCircuit),
+      "this graph should have an Eulerian circuit");
+  check(!eulerian(digraphWithoutEulerianCircuit),
+      "this graph should not have an Eulerian circuit");
 
-    checkDiEulerIt(d);
-    checkDiEulerIt(d, n2);
-
-    checkDiEulerIt(g);
-    checkDiEulerIt(g, n2);
-    checkEulerIt(g);
-    checkEulerIt(g, n2);
-
-    check(!eulerian(d), "This graph is not Eulerian");
-    check(!eulerian(g), "This graph is not Eulerian");
-  }
-  {
-    Digraph d;
-    Graph g(d);
-    Digraph::Node n1 = d.addNode();
-    Digraph::Node n2 = d.addNode();
-    Digraph::Node n3 = d.addNode();
-    
-    d.addArc(n1, n2);
-    d.addArc(n2, n3);
-
-    check(!eulerian(d), "This graph is not Eulerian");
-    check(!eulerian(g), "This graph is not Eulerian");
-  }
+  check(eulerian(graphWithEulerianCircuit),
+      "this graph should have an Eulerian circuit");
+  check(!eulerian(graphWithoutEulerianCircuit),
+      "this graph should have an Eulerian circuit");
 
   return 0;
Index: st/gomory_hu_test.cc
===================================================================
--- test/gomory_hu_test.cc	(revision 596)
+++ 	(revision )
@@ -1,123 +1,0 @@
-#include <iostream>
-
-#include "test_tools.h"
-#include <lemon/smart_graph.h>
-#include <lemon/concepts/graph.h>
-#include <lemon/concepts/maps.h>
-#include <lemon/lgf_reader.h>
-#include <lemon/gomory_hu.h>
-#include <cstdlib>
-
-using namespace std;
-using namespace lemon;
-
-typedef SmartGraph Graph;
-
-char test_lgf[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "@arcs\n"
-  "     label capacity\n"
-  "0 1  0     1\n"
-  "1 2  1     1\n"
-  "2 3  2     1\n"
-  "0 3  4     5\n"
-  "0 3  5     10\n"
-  "0 3  6     7\n"
-  "4 2  7     1\n"
-  "@attributes\n"
-  "source 0\n"
-  "target 3\n";
-  
-void checkGomoryHuCompile()
-{
-  typedef int Value;
-  typedef concepts::Graph Graph;
-
-  typedef Graph::Node Node;
-  typedef Graph::Edge Edge;
-  typedef concepts::ReadMap<Edge, Value> CapMap;
-  typedef concepts::ReadWriteMap<Node, bool> CutMap;
-
-  Graph g;
-  Node n;
-  CapMap cap;
-  CutMap cut;
-  Value v;
-  int d;
-
-  GomoryHu<Graph, CapMap> gh_test(g, cap);
-  const GomoryHu<Graph, CapMap>&
-    const_gh_test = gh_test;
-
-  gh_test.run();
-
-  n = const_gh_test.predNode(n);
-  v = const_gh_test.predValue(n);
-  d = const_gh_test.rootDist(n);
-  v = const_gh_test.minCutValue(n, n);
-  v = const_gh_test.minCutMap(n, n, cut);
-}
-
-GRAPH_TYPEDEFS(Graph);
-typedef Graph::EdgeMap<int> IntEdgeMap;
-typedef Graph::NodeMap<bool> BoolNodeMap;
-
-int cutValue(const Graph& graph, const BoolNodeMap& cut,
-	     const IntEdgeMap& capacity) {
-
-  int sum = 0;
-  for (EdgeIt e(graph); e != INVALID; ++e) {
-    Node s = graph.u(e);
-    Node t = graph.v(e);
-
-    if (cut[s] != cut[t]) {
-      sum += capacity[e];
-    }
-  }
-  return sum;
-}
-
-
-int main() {
-  Graph graph;
-  IntEdgeMap capacity(graph);
-
-  std::istringstream input(test_lgf);
-  GraphReader<Graph>(graph, input).
-    edgeMap("capacity", capacity).run();
-
-  GomoryHu<Graph> ght(graph, capacity);
-  ght.run();
-
-  for (NodeIt u(graph); u != INVALID; ++u) {
-    for (NodeIt v(graph); v != u; ++v) {
-      Preflow<Graph, IntEdgeMap> pf(graph, capacity, u, v);
-      pf.runMinCut();
-      BoolNodeMap cm(graph);
-      ght.minCutMap(u, v, cm);
-      check(pf.flowValue() == ght.minCutValue(u, v), "Wrong cut 1");
-      check(cm[u] != cm[v], "Wrong cut 2");
-      check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 3");
-
-      int sum=0;
-      for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
-        sum+=capacity[a]; 
-      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
-
-      sum=0;
-      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
-        sum++;
-      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
-        sum++;
-      check(sum == countNodes(graph), "Problem with MinCutNodeIt");
-    }
-  }
-  
-  return 0;
-}
Index: test/graph_utils_test.cc
===================================================================
--- test/graph_utils_test.cc	(revision 572)
+++ test/graph_utils_test.cc	(revision 440)
@@ -39,6 +39,6 @@
       digraph.addNode();
     }
-    RangeIdMap<Digraph, Node> nodes(digraph);
-    typename RangeIdMap<Digraph, Node>::InverseMap invNodes(nodes);
+    DescriptorMap<Digraph, Node> nodes(digraph);
+    typename DescriptorMap<Digraph, Node>::InverseMap invNodes(nodes);
     for (int i = 0; i < 100; ++i) {
       int src = rnd[invNodes.size()];
@@ -47,5 +47,5 @@
     }
     typename Digraph::template ArcMap<bool> found(digraph, false);
-    RangeIdMap<Digraph, Arc> arcs(digraph);
+    DescriptorMap<Digraph, Arc> arcs(digraph);
     for (NodeIt src(digraph); src != INVALID; ++src) {
       for (NodeIt trg(digraph); trg != INVALID; ++trg) {
@@ -114,6 +114,6 @@
     graph.addNode();
   }
-  RangeIdMap<Graph, Node> nodes(graph);
-  typename RangeIdMap<Graph, Node>::InverseMap invNodes(nodes);
+  DescriptorMap<Graph, Node> nodes(graph);
+  typename DescriptorMap<Graph, Node>::InverseMap invNodes(nodes);
   for (int i = 0; i < 100; ++i) {
     int src = rnd[invNodes.size()];
@@ -122,5 +122,5 @@
   }
   typename Graph::template EdgeMap<int> found(graph, 0);
-  RangeIdMap<Graph, Edge> edges(graph);
+  DescriptorMap<Graph, Edge> edges(graph);
   for (NodeIt src(graph); src != INVALID; ++src) {
     for (NodeIt trg(graph); trg != INVALID; ++trg) {
Index: test/hao_orlin_test.cc
===================================================================
--- test/hao_orlin_test.cc	(revision 597)
+++ test/hao_orlin_test.cc	(revision 440)
@@ -20,10 +20,7 @@
 
 #include <lemon/smart_graph.h>
-#include <lemon/adaptors.h>
-#include <lemon/concepts/digraph.h>
-#include <lemon/concepts/maps.h>
-#include <lemon/lgf_reader.h>
 #include <lemon/hao_orlin.h>
 
+#include <lemon/lgf_reader.h>
 #include "test_tools.h"
 
@@ -41,122 +38,25 @@
   "5\n"
   "@edges\n"
-  "     cap1 cap2 cap3\n"
-  "0 1  1    1    1   \n"
-  "0 2  2    2    4   \n"
-  "1 2  4    4    4   \n"
-  "3 4  1    1    1   \n"
-  "3 5  2    2    4   \n"
-  "4 5  4    4    4   \n"
-  "5 4  4    4    4   \n"
-  "2 3  1    6    6   \n"
-  "4 0  1    6    6   \n";
-
-void checkHaoOrlinCompile()
-{
-  typedef int Value;
-  typedef concepts::Digraph Digraph;
-
-  typedef Digraph::Node Node;
-  typedef Digraph::Arc Arc;
-  typedef concepts::ReadMap<Arc, Value> CapMap;
-  typedef concepts::WriteMap<Node, bool> CutMap;
-
-  Digraph g;
-  Node n;
-  CapMap cap;
-  CutMap cut;
-  Value v;
-
-  HaoOrlin<Digraph, CapMap> ho_test(g, cap);
-  const HaoOrlin<Digraph, CapMap>&
-    const_ho_test = ho_test;
-
-  ho_test.init();
-  ho_test.init(n);
-  ho_test.calculateOut();
-  ho_test.calculateIn();
-  ho_test.run();
-  ho_test.run(n);
-
-  v = const_ho_test.minCutValue();
-  v = const_ho_test.minCutMap(cut);
-}
-
-template <typename Graph, typename CapMap, typename CutMap>
-typename CapMap::Value 
-  cutValue(const Graph& graph, const CapMap& cap, const CutMap& cut)
-{
-  typename CapMap::Value sum = 0;
-  for (typename Graph::ArcIt a(graph); a != INVALID; ++a) {
-    if (cut[graph.source(a)] && !cut[graph.target(a)])
-      sum += cap[a];
-  }
-  return sum;
-}
+  "     label  capacity\n"
+  "0 1  0      2\n"
+  "1 2  1      2\n"
+  "2 0  2      2\n"
+  "3 4  3      2\n"
+  "4 5  4      2\n"
+  "5 3  5      2\n"
+  "2 3  6      3\n";
 
 int main() {
-  SmartDigraph graph;
-  SmartDigraph::ArcMap<int> cap1(graph), cap2(graph), cap3(graph);
-  SmartDigraph::NodeMap<bool> cut(graph);
+  SmartGraph graph;
+  SmartGraph::EdgeMap<int> capacity(graph);
 
-  istringstream input(lgf);
-  digraphReader(graph, input)
-    .arcMap("cap1", cap1)
-    .arcMap("cap2", cap2)
-    .arcMap("cap3", cap3)
-    .run();
+  istringstream lgfs(lgf);
+  graphReader(graph, lgfs).
+    edgeMap("capacity", capacity).run();
 
-  {
-    HaoOrlin<SmartDigraph> ho(graph, cap1);
-    ho.run();
-    ho.minCutMap(cut);
-    
-    check(ho.minCutValue() == 1, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
-  }
-  {
-    HaoOrlin<SmartDigraph> ho(graph, cap2);
-    ho.run();
-    ho.minCutMap(cut);
+  HaoOrlin<SmartGraph, SmartGraph::EdgeMap<int> > ho(graph, capacity);
+  ho.run();
 
-    check(ho.minCutValue() == 1, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
-  }
-  {
-    HaoOrlin<SmartDigraph> ho(graph, cap3);
-    ho.run();
-    ho.minCutMap(cut);
-    
-    check(ho.minCutValue() == 1, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
-  }
-  
-  typedef Undirector<SmartDigraph> UGraph;
-  UGraph ugraph(graph);
-  
-  {
-    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
-    ho.run();
-    ho.minCutMap(cut);
-    
-    check(ho.minCutValue() == 2, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
-  }
-  {
-    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
-    ho.run();
-    ho.minCutMap(cut);
-    
-    check(ho.minCutValue() == 5, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
-  }
-  {
-    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
-    ho.run();
-    ho.minCutMap(cut);
-    
-    check(ho.minCutValue() == 5, "Wrong cut value");
-    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
-  }
+  check(ho.minCutValue() == 3, "Wrong cut value");
 
   return 0;
Index: test/kruskal_test.cc
===================================================================
--- test/kruskal_test.cc	(revision 581)
+++ test/kruskal_test.cc	(revision 440)
@@ -100,14 +100,14 @@
         "Total cost should be 10");
 
-  edge_cost_map[e1] = -10;
-  edge_cost_map[e2] = -9;
-  edge_cost_map[e3] = -8;
-  edge_cost_map[e4] = -7;
-  edge_cost_map[e5] = -6;
-  edge_cost_map[e6] = -5;
-  edge_cost_map[e7] = -4;
-  edge_cost_map[e8] = -3;
-  edge_cost_map[e9] = -2;
-  edge_cost_map[e10] = -1;
+  edge_cost_map.set(e1, -10);
+  edge_cost_map.set(e2, -9);
+  edge_cost_map.set(e3, -8);
+  edge_cost_map.set(e4, -7);
+  edge_cost_map.set(e5, -6);
+  edge_cost_map.set(e6, -5);
+  edge_cost_map.set(e7, -4);
+  edge_cost_map.set(e8, -3);
+  edge_cost_map.set(e9, -2);
+  edge_cost_map.set(e10, -1);
 
   vector<Edge> tree_edge_vec(5);
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 575)
+++ test/lp_test.cc	(revision 462)
@@ -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).
@@ -198,9 +198,4 @@
     check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
 
-    //Test for clone/new
-    LP* lpnew = lp.newSolver();
-    LP* lpclone = lp.cloneSolver();
-    delete lpnew;
-    delete lpclone;
 
   }
@@ -253,6 +248,5 @@
   if (stat ==  LpSolver::OPTIMAL) {
     std::ostringstream sbuf;
-    sbuf << "Wrong optimal value (" << lp.primal() <<") with "
-         << lp.solverName() <<"\n     the right optimum is " << exp_opt;
+    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
     check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
   }
@@ -362,17 +356,4 @@
 }
 
-template<class LP>
-void cloneTest()
-{
-  //Test for clone/new
-
-  LP* lp = new LP();
-  LP* lpnew = lp->newSolver();
-  LP* lpclone = lp->cloneSolver();
-  delete lp;
-  delete lpnew;
-  delete lpclone;
-}
-
 int main()
 {
@@ -385,5 +366,4 @@
     lpTest(lp_glpk1);
     aTest(lp_glpk2);
-    cloneTest<GlpkLp>();
   }
 #endif
@@ -394,7 +374,11 @@
     lpTest(lp_cplex1);
     aTest(lp_cplex2);
-    cloneTest<CplexLp>();
   } 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
@@ -405,5 +389,4 @@
     lpTest(lp_soplex1);
     aTest(lp_soplex2);
-    cloneTest<SoplexLp>();
   }
 #endif
@@ -414,5 +397,4 @@
     lpTest(lp_clp1);
     aTest(lp_clp2);
-    cloneTest<ClpLp>();
   }
 #endif
Index: st/matching_test.cc
===================================================================
--- test/matching_test.cc	(revision 594)
+++ 	(revision )
@@ -1,424 +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 <sstream>
-#include <vector>
-#include <queue>
-#include <cstdlib>
-
-#include <lemon/matching.h>
-#include <lemon/smart_graph.h>
-#include <lemon/concepts/graph.h>
-#include <lemon/concepts/maps.h>
-#include <lemon/lgf_reader.h>
-#include <lemon/math.h>
-
-#include "test_tools.h"
-
-using namespace std;
-using namespace lemon;
-
-GRAPH_TYPEDEFS(SmartGraph);
-
-
-const int lgfn = 3;
-const std::string lgf[lgfn] = {
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "7 4  0      984\n"
-  "0 7  1      73\n"
-  "7 1  2      204\n"
-  "2 3  3      583\n"
-  "2 7  4      565\n"
-  "2 1  5      582\n"
-  "0 4  6      551\n"
-  "2 5  7      385\n"
-  "1 5  8      561\n"
-  "5 3  9      484\n"
-  "7 5  10     904\n"
-  "3 6  11     47\n"
-  "7 6  12     888\n"
-  "3 0  13     747\n"
-  "6 1  14     310\n",
-
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "2 5  0      710\n"
-  "0 5  1      241\n"
-  "2 4  2      856\n"
-  "2 6  3      762\n"
-  "4 1  4      747\n"
-  "6 1  5      962\n"
-  "4 7  6      723\n"
-  "1 7  7      661\n"
-  "2 3  8      376\n"
-  "1 0  9      416\n"
-  "6 7  10     391\n",
-
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "@edges\n"
-  "     label  weight\n"
-  "6 2  0      553\n"
-  "0 7  1      653\n"
-  "6 3  2      22\n"
-  "4 7  3      846\n"
-  "7 2  4      981\n"
-  "7 6  5      250\n"
-  "5 2  6      539\n",
-};
-
-void checkMaxMatchingCompile()
-{
-  typedef concepts::Graph Graph;
-  typedef Graph::Node Node;
-  typedef Graph::Edge Edge;
-  typedef Graph::EdgeMap<bool> MatMap;
-
-  Graph g;
-  Node n;
-  Edge e;
-  MatMap mat(g);
-
-  MaxMatching<Graph> mat_test(g);
-  const MaxMatching<Graph>&
-    const_mat_test = mat_test;
-
-  mat_test.init();
-  mat_test.greedyInit();
-  mat_test.matchingInit(mat);
-  mat_test.startSparse();
-  mat_test.startDense();
-  mat_test.run();
-  
-  const_mat_test.matchingSize();
-  const_mat_test.matching(e);
-  const_mat_test.matching(n);
-  const MaxMatching<Graph>::MatchingMap& mmap =
-    const_mat_test.matchingMap();
-  e = mmap[n];
-  const_mat_test.mate(n);
-
-  MaxMatching<Graph>::Status stat = 
-    const_mat_test.status(n);
-  const MaxMatching<Graph>::StatusMap& smap =
-    const_mat_test.statusMap();
-  stat = smap[n];
-  const_mat_test.barrier(n);
-}
-
-void checkMaxWeightedMatchingCompile()
-{
-  typedef concepts::Graph Graph;
-  typedef Graph::Node Node;
-  typedef Graph::Edge Edge;
-  typedef Graph::EdgeMap<int> WeightMap;
-
-  Graph g;
-  Node n;
-  Edge e;
-  WeightMap w(g);
-
-  MaxWeightedMatching<Graph> mat_test(g, w);
-  const MaxWeightedMatching<Graph>&
-    const_mat_test = mat_test;
-
-  mat_test.init();
-  mat_test.start();
-  mat_test.run();
-  
-  const_mat_test.matchingWeight();
-  const_mat_test.matchingSize();
-  const_mat_test.matching(e);
-  const_mat_test.matching(n);
-  const MaxWeightedMatching<Graph>::MatchingMap& mmap =
-    const_mat_test.matchingMap();
-  e = mmap[n];
-  const_mat_test.mate(n);
-  
-  int k = 0;
-  const_mat_test.dualValue();
-  const_mat_test.nodeValue(n);
-  const_mat_test.blossomNum();
-  const_mat_test.blossomSize(k);
-  const_mat_test.blossomValue(k);
-}
-
-void checkMaxWeightedPerfectMatchingCompile()
-{
-  typedef concepts::Graph Graph;
-  typedef Graph::Node Node;
-  typedef Graph::Edge Edge;
-  typedef Graph::EdgeMap<int> WeightMap;
-
-  Graph g;
-  Node n;
-  Edge e;
-  WeightMap w(g);
-
-  MaxWeightedPerfectMatching<Graph> mat_test(g, w);
-  const MaxWeightedPerfectMatching<Graph>&
-    const_mat_test = mat_test;
-
-  mat_test.init();
-  mat_test.start();
-  mat_test.run();
-  
-  const_mat_test.matchingWeight();
-  const_mat_test.matching(e);
-  const_mat_test.matching(n);
-  const MaxWeightedPerfectMatching<Graph>::MatchingMap& mmap =
-    const_mat_test.matchingMap();
-  e = mmap[n];
-  const_mat_test.mate(n);
-  
-  int k = 0;
-  const_mat_test.dualValue();
-  const_mat_test.nodeValue(n);
-  const_mat_test.blossomNum();
-  const_mat_test.blossomSize(k);
-  const_mat_test.blossomValue(k);
-}
-
-void checkMatching(const SmartGraph& graph,
-                   const MaxMatching<SmartGraph>& mm) {
-  int num = 0;
-
-  IntNodeMap comp_index(graph);
-  UnionFind<IntNodeMap> comp(comp_index);
-
-  int barrier_num = 0;
-
-  for (NodeIt n(graph); n != INVALID; ++n) {
-    check(mm.status(n) == MaxMatching<SmartGraph>::EVEN ||
-          mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
-    if (mm.status(n) == MaxMatching<SmartGraph>::ODD) {
-      ++barrier_num;
-    } else {
-      comp.insert(n);
-    }
-  }
-
-  for (EdgeIt e(graph); e != INVALID; ++e) {
-    if (mm.matching(e)) {
-      check(e == mm.matching(graph.u(e)), "Wrong matching");
-      check(e == mm.matching(graph.v(e)), "Wrong matching");
-      ++num;
-    }
-    check(mm.status(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
-          mm.status(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
-          "Wrong Gallai-Edmonds decomposition");
-
-    check(mm.status(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
-          mm.status(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
-          "Wrong Gallai-Edmonds decomposition");
-
-    if (mm.status(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
-        mm.status(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
-      comp.join(graph.u(e), graph.v(e));
-    }
-  }
-
-  std::set<int> comp_root;
-  int odd_comp_num = 0;
-  for (NodeIt n(graph); n != INVALID; ++n) {
-    if (mm.status(n) != MaxMatching<SmartGraph>::ODD) {
-      int root = comp.find(n);
-      if (comp_root.find(root) == comp_root.end()) {
-        comp_root.insert(root);
-        if (comp.size(n) % 2 == 1) {
-          ++odd_comp_num;
-        }
-      }
-    }
-  }
-
-  check(mm.matchingSize() == num, "Wrong matching");
-  check(2 * num == countNodes(graph) - (odd_comp_num - barrier_num),
-         "Wrong matching");
-  return;
-}
-
-void checkWeightedMatching(const SmartGraph& graph,
-                   const SmartGraph::EdgeMap<int>& weight,
-                   const MaxWeightedMatching<SmartGraph>& mwm) {
-  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
-    if (graph.u(e) == graph.v(e)) continue;
-    int rw = mwm.nodeValue(graph.u(e)) + mwm.nodeValue(graph.v(e));
-
-    for (int i = 0; i < mwm.blossomNum(); ++i) {
-      bool s = false, t = false;
-      for (MaxWeightedMatching<SmartGraph>::BlossomIt n(mwm, i);
-           n != INVALID; ++n) {
-        if (graph.u(e) == n) s = true;
-        if (graph.v(e) == n) t = true;
-      }
-      if (s == true && t == true) {
-        rw += mwm.blossomValue(i);
-      }
-    }
-    rw -= weight[e] * mwm.dualScale;
-
-    check(rw >= 0, "Negative reduced weight");
-    check(rw == 0 || !mwm.matching(e),
-          "Non-zero reduced weight on matching edge");
-  }
-
-  int pv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    if (mwm.matching(n) != INVALID) {
-      check(mwm.nodeValue(n) >= 0, "Invalid node value");
-      pv += weight[mwm.matching(n)];
-      SmartGraph::Node o = graph.target(mwm.matching(n));
-      check(mwm.mate(n) == o, "Invalid matching");
-      check(mwm.matching(n) == graph.oppositeArc(mwm.matching(o)),
-            "Invalid matching");
-    } else {
-      check(mwm.mate(n) == INVALID, "Invalid matching");
-      check(mwm.nodeValue(n) == 0, "Invalid matching");
-    }
-  }
-
-  int dv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    dv += mwm.nodeValue(n);
-  }
-
-  for (int i = 0; i < mwm.blossomNum(); ++i) {
-    check(mwm.blossomValue(i) >= 0, "Invalid blossom value");
-    check(mwm.blossomSize(i) % 2 == 1, "Even blossom size");
-    dv += mwm.blossomValue(i) * ((mwm.blossomSize(i) - 1) / 2);
-  }
-
-  check(pv * mwm.dualScale == dv * 2, "Wrong duality");
-
-  return;
-}
-
-void checkWeightedPerfectMatching(const SmartGraph& graph,
-                          const SmartGraph::EdgeMap<int>& weight,
-                          const MaxWeightedPerfectMatching<SmartGraph>& mwpm) {
-  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
-    if (graph.u(e) == graph.v(e)) continue;
-    int rw = mwpm.nodeValue(graph.u(e)) + mwpm.nodeValue(graph.v(e));
-
-    for (int i = 0; i < mwpm.blossomNum(); ++i) {
-      bool s = false, t = false;
-      for (MaxWeightedPerfectMatching<SmartGraph>::BlossomIt n(mwpm, i);
-           n != INVALID; ++n) {
-        if (graph.u(e) == n) s = true;
-        if (graph.v(e) == n) t = true;
-      }
-      if (s == true && t == true) {
-        rw += mwpm.blossomValue(i);
-      }
-    }
-    rw -= weight[e] * mwpm.dualScale;
-
-    check(rw >= 0, "Negative reduced weight");
-    check(rw == 0 || !mwpm.matching(e),
-          "Non-zero reduced weight on matching edge");
-  }
-
-  int pv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    check(mwpm.matching(n) != INVALID, "Non perfect");
-    pv += weight[mwpm.matching(n)];
-    SmartGraph::Node o = graph.target(mwpm.matching(n));
-    check(mwpm.mate(n) == o, "Invalid matching");
-    check(mwpm.matching(n) == graph.oppositeArc(mwpm.matching(o)),
-          "Invalid matching");
-  }
-
-  int dv = 0;
-  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
-    dv += mwpm.nodeValue(n);
-  }
-
-  for (int i = 0; i < mwpm.blossomNum(); ++i) {
-    check(mwpm.blossomValue(i) >= 0, "Invalid blossom value");
-    check(mwpm.blossomSize(i) % 2 == 1, "Even blossom size");
-    dv += mwpm.blossomValue(i) * ((mwpm.blossomSize(i) - 1) / 2);
-  }
-
-  check(pv * mwpm.dualScale == dv * 2, "Wrong duality");
-
-  return;
-}
-
-
-int main() {
-
-  for (int i = 0; i < lgfn; ++i) {
-    SmartGraph graph;
-    SmartGraph::EdgeMap<int> weight(graph);
-
-    istringstream lgfs(lgf[i]);
-    graphReader(graph, lgfs).
-      edgeMap("weight", weight).run();
-
-    MaxMatching<SmartGraph> mm(graph);
-    mm.run();
-    checkMatching(graph, mm);
-
-    MaxWeightedMatching<SmartGraph> mwm(graph, weight);
-    mwm.run();
-    checkWeightedMatching(graph, weight, mwm);
-
-    MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
-    bool perfect = mwpm.run();
-
-    check(perfect == (mm.matchingSize() * 2 == countNodes(graph)),
-          "Perfect matching found");
-
-    if (perfect) {
-      checkWeightedPerfectMatching(graph, weight, mwpm);
-    }
-  }
-
-  return 0;
-}
Index: test/max_matching_test.cc
===================================================================
--- test/max_matching_test.cc	(revision 440)
+++ test/max_matching_test.cc	(revision 440)
@@ -0,0 +1,310 @@
+/* -*- 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 <sstream>
+#include <vector>
+#include <queue>
+#include <lemon/math.h>
+#include <cstdlib>
+
+#include <lemon/max_matching.h>
+#include <lemon/smart_graph.h>
+#include <lemon/lgf_reader.h>
+
+#include "test_tools.h"
+
+using namespace std;
+using namespace lemon;
+
+GRAPH_TYPEDEFS(SmartGraph);
+
+
+const int lgfn = 3;
+const std::string lgf[lgfn] = {
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "7 4  0      984\n"
+  "0 7  1      73\n"
+  "7 1  2      204\n"
+  "2 3  3      583\n"
+  "2 7  4      565\n"
+  "2 1  5      582\n"
+  "0 4  6      551\n"
+  "2 5  7      385\n"
+  "1 5  8      561\n"
+  "5 3  9      484\n"
+  "7 5  10     904\n"
+  "3 6  11     47\n"
+  "7 6  12     888\n"
+  "3 0  13     747\n"
+  "6 1  14     310\n",
+
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "2 5  0      710\n"
+  "0 5  1      241\n"
+  "2 4  2      856\n"
+  "2 6  3      762\n"
+  "4 1  4      747\n"
+  "6 1  5      962\n"
+  "4 7  6      723\n"
+  "1 7  7      661\n"
+  "2 3  8      376\n"
+  "1 0  9      416\n"
+  "6 7  10     391\n",
+
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "@edges\n"
+  "     label  weight\n"
+  "6 2  0      553\n"
+  "0 7  1      653\n"
+  "6 3  2      22\n"
+  "4 7  3      846\n"
+  "7 2  4      981\n"
+  "7 6  5      250\n"
+  "5 2  6      539\n",
+};
+
+void checkMatching(const SmartGraph& graph,
+                   const MaxMatching<SmartGraph>& mm) {
+  int num = 0;
+
+  IntNodeMap comp_index(graph);
+  UnionFind<IntNodeMap> comp(comp_index);
+
+  int barrier_num = 0;
+
+  for (NodeIt n(graph); n != INVALID; ++n) {
+    check(mm.decomposition(n) == MaxMatching<SmartGraph>::EVEN ||
+          mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
+    if (mm.decomposition(n) == MaxMatching<SmartGraph>::ODD) {
+      ++barrier_num;
+    } else {
+      comp.insert(n);
+    }
+  }
+
+  for (EdgeIt e(graph); e != INVALID; ++e) {
+    if (mm.matching(e)) {
+      check(e == mm.matching(graph.u(e)), "Wrong matching");
+      check(e == mm.matching(graph.v(e)), "Wrong matching");
+      ++num;
+    }
+    check(mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
+          mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
+          "Wrong Gallai-Edmonds decomposition");
+
+    check(mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
+          mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
+          "Wrong Gallai-Edmonds decomposition");
+
+    if (mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
+        mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
+      comp.join(graph.u(e), graph.v(e));
+    }
+  }
+
+  std::set<int> comp_root;
+  int odd_comp_num = 0;
+  for (NodeIt n(graph); n != INVALID; ++n) {
+    if (mm.decomposition(n) != MaxMatching<SmartGraph>::ODD) {
+      int root = comp.find(n);
+      if (comp_root.find(root) == comp_root.end()) {
+        comp_root.insert(root);
+        if (comp.size(n) % 2 == 1) {
+          ++odd_comp_num;
+        }
+      }
+    }
+  }
+
+  check(mm.matchingSize() == num, "Wrong matching");
+  check(2 * num == countNodes(graph) - (odd_comp_num - barrier_num),
+         "Wrong matching");
+  return;
+}
+
+void checkWeightedMatching(const SmartGraph& graph,
+                   const SmartGraph::EdgeMap<int>& weight,
+                   const MaxWeightedMatching<SmartGraph>& mwm) {
+  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
+    if (graph.u(e) == graph.v(e)) continue;
+    int rw = mwm.nodeValue(graph.u(e)) + mwm.nodeValue(graph.v(e));
+
+    for (int i = 0; i < mwm.blossomNum(); ++i) {
+      bool s = false, t = false;
+      for (MaxWeightedMatching<SmartGraph>::BlossomIt n(mwm, i);
+           n != INVALID; ++n) {
+        if (graph.u(e) == n) s = true;
+        if (graph.v(e) == n) t = true;
+      }
+      if (s == true && t == true) {
+        rw += mwm.blossomValue(i);
+      }
+    }
+    rw -= weight[e] * mwm.dualScale;
+
+    check(rw >= 0, "Negative reduced weight");
+    check(rw == 0 || !mwm.matching(e),
+          "Non-zero reduced weight on matching edge");
+  }
+
+  int pv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    if (mwm.matching(n) != INVALID) {
+      check(mwm.nodeValue(n) >= 0, "Invalid node value");
+      pv += weight[mwm.matching(n)];
+      SmartGraph::Node o = graph.target(mwm.matching(n));
+      check(mwm.mate(n) == o, "Invalid matching");
+      check(mwm.matching(n) == graph.oppositeArc(mwm.matching(o)),
+            "Invalid matching");
+    } else {
+      check(mwm.mate(n) == INVALID, "Invalid matching");
+      check(mwm.nodeValue(n) == 0, "Invalid matching");
+    }
+  }
+
+  int dv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    dv += mwm.nodeValue(n);
+  }
+
+  for (int i = 0; i < mwm.blossomNum(); ++i) {
+    check(mwm.blossomValue(i) >= 0, "Invalid blossom value");
+    check(mwm.blossomSize(i) % 2 == 1, "Even blossom size");
+    dv += mwm.blossomValue(i) * ((mwm.blossomSize(i) - 1) / 2);
+  }
+
+  check(pv * mwm.dualScale == dv * 2, "Wrong duality");
+
+  return;
+}
+
+void checkWeightedPerfectMatching(const SmartGraph& graph,
+                          const SmartGraph::EdgeMap<int>& weight,
+                          const MaxWeightedPerfectMatching<SmartGraph>& mwpm) {
+  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
+    if (graph.u(e) == graph.v(e)) continue;
+    int rw = mwpm.nodeValue(graph.u(e)) + mwpm.nodeValue(graph.v(e));
+
+    for (int i = 0; i < mwpm.blossomNum(); ++i) {
+      bool s = false, t = false;
+      for (MaxWeightedPerfectMatching<SmartGraph>::BlossomIt n(mwpm, i);
+           n != INVALID; ++n) {
+        if (graph.u(e) == n) s = true;
+        if (graph.v(e) == n) t = true;
+      }
+      if (s == true && t == true) {
+        rw += mwpm.blossomValue(i);
+      }
+    }
+    rw -= weight[e] * mwpm.dualScale;
+
+    check(rw >= 0, "Negative reduced weight");
+    check(rw == 0 || !mwpm.matching(e),
+          "Non-zero reduced weight on matching edge");
+  }
+
+  int pv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    check(mwpm.matching(n) != INVALID, "Non perfect");
+    pv += weight[mwpm.matching(n)];
+    SmartGraph::Node o = graph.target(mwpm.matching(n));
+    check(mwpm.mate(n) == o, "Invalid matching");
+    check(mwpm.matching(n) == graph.oppositeArc(mwpm.matching(o)),
+          "Invalid matching");
+  }
+
+  int dv = 0;
+  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
+    dv += mwpm.nodeValue(n);
+  }
+
+  for (int i = 0; i < mwpm.blossomNum(); ++i) {
+    check(mwpm.blossomValue(i) >= 0, "Invalid blossom value");
+    check(mwpm.blossomSize(i) % 2 == 1, "Even blossom size");
+    dv += mwpm.blossomValue(i) * ((mwpm.blossomSize(i) - 1) / 2);
+  }
+
+  check(pv * mwpm.dualScale == dv * 2, "Wrong duality");
+
+  return;
+}
+
+
+int main() {
+
+  for (int i = 0; i < lgfn; ++i) {
+    SmartGraph graph;
+    SmartGraph::EdgeMap<int> weight(graph);
+
+    istringstream lgfs(lgf[i]);
+    graphReader(graph, lgfs).
+      edgeMap("weight", weight).run();
+
+    MaxMatching<SmartGraph> mm(graph);
+    mm.run();
+    checkMatching(graph, mm);
+
+    MaxWeightedMatching<SmartGraph> mwm(graph, weight);
+    mwm.run();
+    checkWeightedMatching(graph, weight, mwm);
+
+    MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
+    bool perfect = mwpm.run();
+
+    check(perfect == (mm.matchingSize() * 2 == countNodes(graph)),
+          "Perfect matching found");
+
+    if (perfect) {
+      checkWeightedPerfectMatching(graph, weight, mwpm);
+    }
+  }
+
+  return 0;
+}
Index: test/min_cost_flow_test.cc
===================================================================
--- test/min_cost_flow_test.cc	(revision 601)
+++ test/min_cost_flow_test.cc	(revision 601)
@@ -0,0 +1,455 @@
+/* -*- 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 <fstream>
+
+#include <lemon/list_graph.h>
+#include <lemon/smart_graph.h>
+#include <lemon/lgf_reader.h>
+
+//#include <lemon/cycle_canceling.h>
+//#include <lemon/capacity_scaling.h>
+//#include <lemon/cost_scaling.h>
+#include <lemon/network_simplex.h>
+//#include <lemon/min_cost_flow.h>
+//#include <lemon/min_cost_max_flow.h>
+
+#include <lemon/concepts/digraph.h>
+#include <lemon/concept_check.h>
+
+#include "test_tools.h"
+
+using namespace lemon;
+
+char test_lgf[] =
+  "@nodes\n"
+  "label  sup1 sup2 sup3\n"
+  "    1    20   27    0\n"
+  "    2    -4    0    0\n"
+  "    3     0    0    0\n"
+  "    4     0    0    0\n"
+  "    5     9    0    0\n"
+  "    6    -6    0    0\n"
+  "    7     0    0    0\n"
+  "    8     0    0    0\n"
+  "    9     3    0    0\n"
+  "   10    -2    0    0\n"
+  "   11     0    0    0\n"
+  "   12   -20  -27    0\n"
+  "\n"
+  "@arcs\n"
+  "       cost  cap low1 low2\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"
+  "\n"
+  "@attributes\n"
+  "source 1\n"
+  "target 12\n";
+
+
+// Check the interface of an MCF algorithm
+template <typename GR, typename Value>
+class McfClassConcept
+{
+public:
+
+  template <typename MCF>
+  struct Constraints {
+    void constraints() {
+      checkConcept<concepts::Digraph, GR>();
+
+      MCF mcf_test1(g, lower, upper, cost, sup);
+      MCF mcf_test2(g, upper, cost, sup);
+      MCF mcf_test3(g, lower, upper, cost, n, n, k);
+      MCF mcf_test4(g, upper, cost, n, n, k);
+
+      // TODO: This part should be enabled and the next part
+      // should be removed if map copying is supported
+/*
+      flow = mcf_test1.flowMap();
+      mcf_test1.flowMap(flow);
+
+      pot = mcf_test1.potentialMap();
+      mcf_test1.potentialMap(pot);
+*/
+/**/
+      const typename MCF::FlowMap &fm =
+        mcf_test1.flowMap();
+      mcf_test1.flowMap(flow);
+      const typename MCF::PotentialMap &pm =
+        mcf_test1.potentialMap();
+      mcf_test1.potentialMap(pot);
+      ignore_unused_variable_warning(fm);
+      ignore_unused_variable_warning(pm);
+/**/
+
+      mcf_test1.run();
+
+      v = mcf_test1.totalCost();
+      v = mcf_test1.flow(a);
+      v = mcf_test1.potential(n);
+    }
+
+    typedef typename GR::Node Node;
+    typedef typename GR::Arc Arc;
+    typedef concepts::ReadMap<Node, Value> NM;
+    typedef concepts::ReadMap<Arc, Value> AM;
+
+    const GR &g;
+    const AM &lower;
+    const AM &upper;
+    const AM &cost;
+    const NM &sup;
+    const Node &n;
+    const Arc &a;
+    const Value &k;
+    Value v;
+
+    typename MCF::FlowMap &flow;
+    typename MCF::PotentialMap &pot;
+  };
+
+};
+
+
+// Check the feasibility of the given flow (primal soluiton)
+template < typename GR, typename LM, typename UM,
+           typename SM, typename FM >
+bool checkFlow( const GR& gr, const LM& lower, const UM& upper,
+                const SM& supply, const FM& flow )
+{
+  TEMPLATE_DIGRAPH_TYPEDEFS(GR);
+
+  for (ArcIt e(gr); e != INVALID; ++e) {
+    if (flow[e] < lower[e] || flow[e] > upper[e]) return false;
+  }
+
+  for (NodeIt n(gr); n != INVALID; ++n) {
+    typename SM::Value sum = 0;
+    for (OutArcIt e(gr, n); e != INVALID; ++e)
+      sum += flow[e];
+    for (InArcIt e(gr, n); e != INVALID; ++e)
+      sum -= flow[e];
+    if (sum != supply[n]) return false;
+  }
+
+  return true;
+}
+
+// Check the feasibility of the given potentials (dual soluiton)
+// using the Complementary Slackness optimality condition
+template < typename GR, typename LM, typename UM,
+           typename CM, typename FM, typename PM >
+bool checkPotential( const GR& gr, const LM& lower, const UM& upper,
+                     const CM& cost, const FM& flow, const PM& pi )
+{
+  TEMPLATE_DIGRAPH_TYPEDEFS(GR);
+
+  bool opt = true;
+  for (ArcIt e(gr); opt && e != INVALID; ++e) {
+    typename CM::Value red_cost =
+      cost[e] + pi[gr.source(e)] - pi[gr.target(e)];
+    opt = red_cost == 0 ||
+          (red_cost > 0 && flow[e] == lower[e]) ||
+          (red_cost < 0 && flow[e] == upper[e]);
+  }
+  return opt;
+}
+
+// Run a minimum cost flow algorithm and check the results
+template < typename MCF, typename GR,
+           typename LM, typename UM,
+           typename CM, typename SM >
+void checkMcf( const MCF& mcf, bool mcf_result,
+               const GR& gr, const LM& lower, const UM& upper,
+               const CM& cost, const SM& supply,
+               bool result, typename CM::Value total,
+               const std::string &test_id = "" )
+{
+  check(mcf_result == result, "Wrong result " + test_id);
+  if (result) {
+    check(checkFlow(gr, lower, upper, supply, mcf.flowMap()),
+          "The flow is not feasible " + test_id);
+    check(mcf.totalCost() == total, "The flow is not optimal " + test_id);
+    check(checkPotential(gr, lower, upper, cost, mcf.flowMap(),
+                         mcf.potentialMap()),
+          "Wrong potentials " + test_id);
+  }
+}
+
+int main()
+{
+  // Check the interfaces
+  {
+    typedef int Value;
+    // This typedef should be enabled if the standard maps are
+    // reference maps in the graph concepts
+    //typedef concepts::Digraph GR;
+    typedef ListDigraph GR;
+    typedef concepts::ReadMap<GR::Node, Value> NM;
+    typedef concepts::ReadMap<GR::Arc, Value> AM;
+
+    //checkConcept< McfClassConcept<GR, Value>,
+    //              CycleCanceling<GR, AM, AM, AM, NM> >();
+    //checkConcept< McfClassConcept<GR, Value>,
+    //              CapacityScaling<GR, AM, AM, AM, NM> >();
+    //checkConcept< McfClassConcept<GR, Value>,
+    //              CostScaling<GR, AM, AM, AM, NM> >();
+    checkConcept< McfClassConcept<GR, Value>,
+                  NetworkSimplex<GR, AM, AM, AM, NM> >();
+    //checkConcept< MinCostFlow<GR, Value>,
+    //              NetworkSimplex<GR, AM, AM, AM, NM> >();
+  }
+
+  // Run various MCF tests
+  typedef ListDigraph Digraph;
+  DIGRAPH_TYPEDEFS(ListDigraph);
+
+  // Read the test digraph
+  Digraph gr;
+  Digraph::ArcMap<int> c(gr), l1(gr), l2(gr), u(gr);
+  Digraph::NodeMap<int> s1(gr), s2(gr), s3(gr);
+  Node v, w;
+
+  std::istringstream input(test_lgf);
+  DigraphReader<Digraph>(gr, input)
+    .arcMap("cost", c)
+    .arcMap("cap", u)
+    .arcMap("low1", l1)
+    .arcMap("low2", l2)
+    .nodeMap("sup1", s1)
+    .nodeMap("sup2", s2)
+    .nodeMap("sup3", s3)
+    .node("source", v)
+    .node("target", w)
+    .run();
+
+/*
+  // A. Test CapacityScaling with scaling
+  {
+    CapacityScaling<Digraph> mcf1(gr, u, c, s1);
+    CapacityScaling<Digraph> mcf2(gr, u, c, v, w, 27);
+    CapacityScaling<Digraph> mcf3(gr, u, c, s3);
+    CapacityScaling<Digraph> mcf4(gr, l2, u, c, s1);
+    CapacityScaling<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    CapacityScaling<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(), gr, l1, u, c, s1, true,  5240, "#A1");
+    checkMcf(mcf2, mcf2.run(), gr, l1, u, c, s2, true,  7620, "#A2");
+    checkMcf(mcf3, mcf3.run(), gr, l1, u, c, s3, true,     0, "#A3");
+    checkMcf(mcf4, mcf4.run(), gr, l2, u, c, s1, true,  5970, "#A4");
+    checkMcf(mcf5, mcf5.run(), gr, l2, u, c, s2, true,  8010, "#A5");
+    checkMcf(mcf6, mcf6.run(), gr, l2, u, c, s3, false,    0, "#A6");
+  }
+
+  // B. Test CapacityScaling without scaling
+  {
+    CapacityScaling<Digraph> mcf1(gr, u, c, s1);
+    CapacityScaling<Digraph> mcf2(gr, u, c, v, w, 27);
+    CapacityScaling<Digraph> mcf3(gr, u, c, s3);
+    CapacityScaling<Digraph> mcf4(gr, l2, u, c, s1);
+    CapacityScaling<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    CapacityScaling<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(false), gr, l1, u, c, s1, true,  5240, "#B1");
+    checkMcf(mcf2, mcf2.run(false), gr, l1, u, c, s2, true,  7620, "#B2");
+    checkMcf(mcf3, mcf3.run(false), gr, l1, u, c, s3, true,     0, "#B3");
+    checkMcf(mcf4, mcf4.run(false), gr, l2, u, c, s1, true,  5970, "#B4");
+    checkMcf(mcf5, mcf5.run(false), gr, l2, u, c, s2, true,  8010, "#B5");
+    checkMcf(mcf6, mcf6.run(false), gr, l2, u, c, s3, false,    0, "#B6");
+  }
+
+  // C. Test CostScaling using partial augment-relabel method
+  {
+    CostScaling<Digraph> mcf1(gr, u, c, s1);
+    CostScaling<Digraph> mcf2(gr, u, c, v, w, 27);
+    CostScaling<Digraph> mcf3(gr, u, c, s3);
+    CostScaling<Digraph> mcf4(gr, l2, u, c, s1);
+    CostScaling<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    CostScaling<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(), gr, l1, u, c, s1, true,  5240, "#C1");
+    checkMcf(mcf2, mcf2.run(), gr, l1, u, c, s2, true,  7620, "#C2");
+    checkMcf(mcf3, mcf3.run(), gr, l1, u, c, s3, true,     0, "#C3");
+    checkMcf(mcf4, mcf4.run(), gr, l2, u, c, s1, true,  5970, "#C4");
+    checkMcf(mcf5, mcf5.run(), gr, l2, u, c, s2, true,  8010, "#C5");
+    checkMcf(mcf6, mcf6.run(), gr, l2, u, c, s3, false,    0, "#C6");
+  }
+
+  // D. Test CostScaling using push-relabel method
+  {
+    CostScaling<Digraph> mcf1(gr, u, c, s1);
+    CostScaling<Digraph> mcf2(gr, u, c, v, w, 27);
+    CostScaling<Digraph> mcf3(gr, u, c, s3);
+    CostScaling<Digraph> mcf4(gr, l2, u, c, s1);
+    CostScaling<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    CostScaling<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(false), gr, l1, u, c, s1, true,  5240, "#D1");
+    checkMcf(mcf2, mcf2.run(false), gr, l1, u, c, s2, true,  7620, "#D2");
+    checkMcf(mcf3, mcf3.run(false), gr, l1, u, c, s3, true,     0, "#D3");
+    checkMcf(mcf4, mcf4.run(false), gr, l2, u, c, s1, true,  5970, "#D4");
+    checkMcf(mcf5, mcf5.run(false), gr, l2, u, c, s2, true,  8010, "#D5");
+    checkMcf(mcf6, mcf6.run(false), gr, l2, u, c, s3, false,    0, "#D6");
+  }
+*/
+
+  // E. Test NetworkSimplex with FIRST_ELIGIBLE_PIVOT
+  {
+    NetworkSimplex<Digraph>::PivotRuleEnum pr =
+      NetworkSimplex<Digraph>::FIRST_ELIGIBLE_PIVOT;
+    NetworkSimplex<Digraph> mcf1(gr, u, c, s1);
+    NetworkSimplex<Digraph> mcf2(gr, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf3(gr, u, c, s3);
+    NetworkSimplex<Digraph> mcf4(gr, l2, u, c, s1);
+    NetworkSimplex<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(pr), gr, l1, u, c, s1, true,  5240, "#E1");
+    checkMcf(mcf2, mcf2.run(pr), gr, l1, u, c, s2, true,  7620, "#E2");
+    checkMcf(mcf3, mcf3.run(pr), gr, l1, u, c, s3, true,     0, "#E3");
+    checkMcf(mcf4, mcf4.run(pr), gr, l2, u, c, s1, true,  5970, "#E4");
+    checkMcf(mcf5, mcf5.run(pr), gr, l2, u, c, s2, true,  8010, "#E5");
+    checkMcf(mcf6, mcf6.run(pr), gr, l2, u, c, s3, false,    0, "#E6");
+  }
+
+  // F. Test NetworkSimplex with BEST_ELIGIBLE_PIVOT
+  {
+    NetworkSimplex<Digraph>::PivotRuleEnum pr =
+      NetworkSimplex<Digraph>::BEST_ELIGIBLE_PIVOT;
+    NetworkSimplex<Digraph> mcf1(gr, u, c, s1);
+    NetworkSimplex<Digraph> mcf2(gr, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf3(gr, u, c, s3);
+    NetworkSimplex<Digraph> mcf4(gr, l2, u, c, s1);
+    NetworkSimplex<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(pr), gr, l1, u, c, s1, true,  5240, "#F1");
+    checkMcf(mcf2, mcf2.run(pr), gr, l1, u, c, s2, true,  7620, "#F2");
+    checkMcf(mcf3, mcf3.run(pr), gr, l1, u, c, s3, true,     0, "#F3");
+    checkMcf(mcf4, mcf4.run(pr), gr, l2, u, c, s1, true,  5970, "#F4");
+    checkMcf(mcf5, mcf5.run(pr), gr, l2, u, c, s2, true,  8010, "#F5");
+    checkMcf(mcf6, mcf6.run(pr), gr, l2, u, c, s3, false,    0, "#F6");
+  }
+
+  // G. Test NetworkSimplex with BLOCK_SEARCH_PIVOT
+  {
+    NetworkSimplex<Digraph>::PivotRuleEnum pr =
+      NetworkSimplex<Digraph>::BLOCK_SEARCH_PIVOT;
+    NetworkSimplex<Digraph> mcf1(gr, u, c, s1);
+    NetworkSimplex<Digraph> mcf2(gr, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf3(gr, u, c, s3);
+    NetworkSimplex<Digraph> mcf4(gr, l2, u, c, s1);
+    NetworkSimplex<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(pr), gr, l1, u, c, s1, true,  5240, "#G1");
+    checkMcf(mcf2, mcf2.run(pr), gr, l1, u, c, s2, true,  7620, "#G2");
+    checkMcf(mcf3, mcf3.run(pr), gr, l1, u, c, s3, true,     0, "#G3");
+    checkMcf(mcf4, mcf4.run(pr), gr, l2, u, c, s1, true,  5970, "#G4");
+    checkMcf(mcf5, mcf5.run(pr), gr, l2, u, c, s2, true,  8010, "#G5");
+    checkMcf(mcf6, mcf6.run(pr), gr, l2, u, c, s3, false,    0, "#G6");
+  }
+
+  // H. Test NetworkSimplex with CANDIDATE_LIST_PIVOT
+  {
+    NetworkSimplex<Digraph>::PivotRuleEnum pr =
+      NetworkSimplex<Digraph>::CANDIDATE_LIST_PIVOT;
+    NetworkSimplex<Digraph> mcf1(gr, u, c, s1);
+    NetworkSimplex<Digraph> mcf2(gr, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf3(gr, u, c, s3);
+    NetworkSimplex<Digraph> mcf4(gr, l2, u, c, s1);
+    NetworkSimplex<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(pr), gr, l1, u, c, s1, true,  5240, "#H1");
+    checkMcf(mcf2, mcf2.run(pr), gr, l1, u, c, s2, true,  7620, "#H2");
+    checkMcf(mcf3, mcf3.run(pr), gr, l1, u, c, s3, true,     0, "#H3");
+    checkMcf(mcf4, mcf4.run(pr), gr, l2, u, c, s1, true,  5970, "#H4");
+    checkMcf(mcf5, mcf5.run(pr), gr, l2, u, c, s2, true,  8010, "#H5");
+    checkMcf(mcf6, mcf6.run(pr), gr, l2, u, c, s3, false,    0, "#H6");
+  }
+
+  // I. Test NetworkSimplex with ALTERING_LIST_PIVOT
+  {
+    NetworkSimplex<Digraph>::PivotRuleEnum pr =
+      NetworkSimplex<Digraph>::ALTERING_LIST_PIVOT;
+    NetworkSimplex<Digraph> mcf1(gr, u, c, s1);
+    NetworkSimplex<Digraph> mcf2(gr, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf3(gr, u, c, s3);
+    NetworkSimplex<Digraph> mcf4(gr, l2, u, c, s1);
+    NetworkSimplex<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    NetworkSimplex<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(pr), gr, l1, u, c, s1, true,  5240, "#I1");
+    checkMcf(mcf2, mcf2.run(pr), gr, l1, u, c, s2, true,  7620, "#I2");
+    checkMcf(mcf3, mcf3.run(pr), gr, l1, u, c, s3, true,     0, "#I3");
+    checkMcf(mcf4, mcf4.run(pr), gr, l2, u, c, s1, true,  5970, "#I4");
+    checkMcf(mcf5, mcf5.run(pr), gr, l2, u, c, s2, true,  8010, "#I5");
+    checkMcf(mcf6, mcf6.run(pr), gr, l2, u, c, s3, false,    0, "#I6");
+  }
+
+/*
+  // J. Test MinCostFlow
+  {
+    MinCostFlow<Digraph> mcf1(gr, u, c, s1);
+    MinCostFlow<Digraph> mcf2(gr, u, c, v, w, 27);
+    MinCostFlow<Digraph> mcf3(gr, u, c, s3);
+    MinCostFlow<Digraph> mcf4(gr, l2, u, c, s1);
+    MinCostFlow<Digraph> mcf5(gr, l2, u, c, v, w, 27);
+    MinCostFlow<Digraph> mcf6(gr, l2, u, c, s3);
+
+    checkMcf(mcf1, mcf1.run(), gr, l1, u, c, s1, true,  5240, "#J1");
+    checkMcf(mcf2, mcf2.run(), gr, l1, u, c, s2, true,  7620, "#J2");
+    checkMcf(mcf3, mcf3.run(), gr, l1, u, c, s3, true,     0, "#J3");
+    checkMcf(mcf4, mcf4.run(), gr, l2, u, c, s1, true,  5970, "#J4");
+    checkMcf(mcf5, mcf5.run(), gr, l2, u, c, s2, true,  8010, "#J5");
+    checkMcf(mcf6, mcf6.run(), gr, l2, u, c, s3, false,    0, "#J6");
+  }
+*/
+/*
+  // K. Test MinCostMaxFlow
+  {
+    MinCostMaxFlow<Digraph> mcmf(gr, u, c, v, w);
+    mcmf.run();
+    checkMcf(mcmf, true, gr, l1, u, c, s3, true, 7620, "#K1");
+  }
+*/
+
+  return 0;
+}
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 575)
+++ test/mip_test.cc	(revision 462)
@@ -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).
@@ -19,4 +19,5 @@
 #include "test_tools.h"
 
+
 #ifdef HAVE_CONFIG_H
 #include <lemon/config.h>
@@ -29,8 +30,4 @@
 #ifdef HAVE_GLPK
 #include <lemon/glpk.h>
-#endif
-
-#ifdef HAVE_CBC
-#include <lemon/cbc.h>
 #endif
 
@@ -61,9 +58,10 @@
 void aTest(MipSolver& mip)
 {
-  //The following example is very simple
+ //The following example is very simple
 
 
   typedef MipSolver::Row Row;
   typedef MipSolver::Col Col;
+
 
 
@@ -77,4 +75,5 @@
   mip.max();
 
+
   //Unconstrained optimization
   mip.solve();
@@ -82,10 +81,9 @@
 
   //Constraints
-  mip.addRow(2 * x1 + x2 <= 2);
-  Row y2 = mip.addRow(x1 - 2 * x2 <= 0);
+  mip.addRow(2*x1+x2 <=2);
+  mip.addRow(x1-2*x2 <=0);
 
   //Nonnegativity of the variable x1
   mip.colLowerBound(x1, 0);
-
 
   //Maximization of x1
@@ -93,5 +91,4 @@
   double expected_opt=4.0/5.0;
   solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
-
 
   //Restrict x2 to integer
@@ -106,24 +103,8 @@
   solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
 
-  //Erase a variable
-  mip.erase(x2);
-  mip.rowUpperBound(y2, 8);
-  expected_opt=1;
-  solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt);
+
 
 }
 
-
-template<class MIP>
-void cloneTest()
-{
-
-  MIP* mip = new MIP();
-  MIP* mipnew = mip->newSolver();
-  MIP* mipclone = mip->cloneSolver();
-  delete mip;
-  delete mipnew;
-  delete mipclone;
-}
 
 int main()
@@ -134,5 +115,4 @@
     GlpkMip mip1;
     aTest(mip1);
-    cloneTest<GlpkMip>();
   }
 #endif
@@ -142,15 +122,11 @@
     CplexMip mip2;
     aTest(mip2);
-    cloneTest<CplexMip>();
   } 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
-
-#ifdef HAVE_CBC
-  {
-    CbcMip mip1;
-    aTest(mip1);
-    cloneTest<CbcMip>();
   }
 #endif
Index: test/preflow_test.cc
===================================================================
--- test/preflow_test.cc	(revision 585)
+++ test/preflow_test.cc	(revision 440)
@@ -85,20 +85,16 @@
   FlowMap flow;
   CutMap cut;
-  VType v;
-  bool b;
-
-  typedef Preflow<Digraph, CapMap>
-            ::SetFlowMap<FlowMap>
-            ::SetElevator<Elev>
-            ::SetStandardElevator<LinkedElev>
-            ::Create PreflowType;
-  PreflowType preflow_test(g, cap, n, n);
-  const PreflowType& const_preflow_test = preflow_test;
-
-  preflow_test
-    .capacityMap(cap)
-    .flowMap(flow)
-    .source(n)
-    .target(n);
+
+  Preflow<Digraph, CapMap>
+    ::SetFlowMap<FlowMap>
+    ::SetElevator<Elev>
+    ::SetStandardElevator<LinkedElev>
+    ::Create preflow_test(g,cap,n,n);
+
+  preflow_test.capacityMap(cap);
+  flow = preflow_test.flowMap();
+  preflow_test.flowMap(flow);
+  preflow_test.source(n);
+  preflow_test.target(n);
 
   preflow_test.init();
@@ -109,11 +105,9 @@
   preflow_test.runMinCut();
 
-  v = const_preflow_test.flowValue();
-  v = const_preflow_test.flow(e);
-  const FlowMap& fm = const_preflow_test.flowMap();
-  b = const_preflow_test.minCut(n);
-  const_preflow_test.minCutMap(cut);
-  
-  ignore_unused_variable_warning(fm);
+  preflow_test.flowValue();
+  preflow_test.minCut(n);
+  preflow_test.minCutMap(cut);
+  preflow_test.flow(e);
+
 }
 
Index: test/time_measure_test.cc
===================================================================
--- test/time_measure_test.cc	(revision 558)
+++ test/time_measure_test.cc	(revision 440)
@@ -40,14 +40,16 @@
   Timer T;
   unsigned int n;
-  for(n=0;T.realTime()<0.1;n++) ;
+  for(n=0;T.realTime()<1.0;n++) ;
   std::cout << T << " (" << n << " time queries)\n";
-
+  T.restart();
+  while(T.realTime()<2.0) ;
+  std::cout << T << '\n';
   TimeStamp full;
   TimeStamp t;
-  t=runningTimeTest(f,0.1,&n,&full);
+  t=runningTimeTest(f,1,&n,&full);
   std::cout << t << " (" << n << " tests)\n";
   std::cout << "Total: " << full << "\n";
 
-  t=runningTimeTest(g,0.1,&n,&full);
+  t=runningTimeTest(g,1,&n,&full);
   std::cout << t << " (" << n << " tests)\n";
   std::cout << "Total: " << full << "\n";
Index: tools/CMakeLists.txt
===================================================================
--- tools/CMakeLists.txt	(revision 549)
+++ tools/CMakeLists.txt	(revision 527)
@@ -1,8 +1,8 @@
 INCLUDE_DIRECTORIES(
-  ${PROJECT_SOURCE_DIR}
-  ${PROJECT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}
 )
 
-LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
 
 ADD_EXECUTABLE(lgf-gen lgf-gen.cc)
@@ -23,6 +23,6 @@
 IF(NOT WIN32)
   INSTALL(
-    PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
-    DESTINATION bin
+    FILES ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
+    RUNTIME DESTINATION bin
     COMPONENT bin)
 ENDIF(NOT WIN32)
Index: tools/dimacs-solver.cc
===================================================================
--- tools/dimacs-solver.cc	(revision 594)
+++ tools/dimacs-solver.cc	(revision 532)
@@ -24,8 +24,9 @@
 ///
 /// See
-/// \code
-///   dimacs-solver --help
-/// \endcode
+/// \verbatim
+///  dimacs-solver --help
+/// \endverbatim
 /// for more info on usage.
+///
 
 #include <iostream>
@@ -43,5 +44,5 @@
 #include <lemon/dijkstra.h>
 #include <lemon/preflow.h>
-#include <lemon/matching.h>
+#include <lemon/max_matching.h>
 
 using namespace lemon;
@@ -72,5 +73,5 @@
 template<class Value>
 void solve_max(ArgParser &ap, std::istream &is, std::ostream &,
-               Value infty, DimacsDescriptor &desc)
+              DimacsDescriptor &desc)
 {
   bool report = !ap.given("q");
@@ -80,5 +81,5 @@
   Timer ti;
   ti.restart();
-  readDimacsMax(is, g, cap, s, t, infty, desc);
+  readDimacsMax(is, g, cap, s, t, desc);
   if(report) std::cerr << "Read the file: " << ti << '\n';
   ti.restart();
@@ -115,15 +116,4 @@
            DimacsDescriptor &desc)
 {
-  std::stringstream iss(static_cast<std::string>(ap["infcap"]));
-  Value infty;
-  iss >> infty;
-  if(iss.fail())
-    {
-      std::cerr << "Cannot interpret '"
-                << static_cast<std::string>(ap["infcap"]) << "' as infinite"
-                << std::endl;
-      exit(1);
-    }
-  
   switch(desc.type)
     {
@@ -133,5 +123,5 @@
       break;
     case DimacsDescriptor::MAX:
-      solve_max<Value>(ap,is,os,infty,desc);
+      solve_max<Value>(ap,is,os,desc);
       break;
     case DimacsDescriptor::SP:
@@ -170,5 +160,4 @@
     .optionGroup("datatype","ldouble")
     .onlyOneGroup("datatype")
-    .stringOption("infcap","Value used for 'very high' capacities","0")
     .run();
 
Index: tools/dimacs-to-lgf.cc
===================================================================
--- tools/dimacs-to-lgf.cc	(revision 584)
+++ tools/dimacs-to-lgf.cc	(revision 440)
@@ -25,8 +25,9 @@
 ///
 /// See
-/// \code
-///   dimacs-to-lgf --help
-/// \endcode
-/// for more info on the usage.
+/// \verbatim
+///  dimacs-to-lgf --help
+/// \endverbatim
+/// for more info on usage.
+///
 
 #include <iostream>
@@ -96,5 +97,5 @@
         DoubleArcMap lower(digraph), capacity(digraph), cost(digraph);
         DoubleNodeMap supply(digraph);
-        readDimacsMin(is, digraph, lower, capacity, cost, supply, 0, desc);
+        readDimacsMin(is, digraph, lower, capacity, cost, supply, desc);
         DigraphWriter<Digraph>(digraph, os).
           nodeMap("supply", supply).
@@ -111,5 +112,5 @@
         Node s, t;
         DoubleArcMap capacity(digraph);
-        readDimacsMax(is, digraph, capacity, s, t, 0, desc);
+        readDimacsMax(is, digraph, capacity, s, t, desc);
         DigraphWriter<Digraph>(digraph, os).
           arcMap("capacity", capacity).
Index: tools/lemon-0.x-to-1.x.sh
===================================================================
--- tools/lemon-0.x-to-1.x.sh	(revision 574)
+++ tools/lemon-0.x-to-1.x.sh	(revision 466)
@@ -23,9 +23,10 @@
         -e "s/UGraph/_Gr_aph_label_/g"\
         -e "s/u[Gg]raph/_gr_aph_label_/g"\
-        -e "s/Graph\>/_Digr_aph_label_/g"\
+        -e "s/\<Graph\>/_Digr_aph_label_/g"\
         -e "s/\<graph\>/_digr_aph_label_/g"\
-        -e "s/Graphs\>/_Digr_aph_label_s/g"\
+        -e "s/\<Graphs\>/_Digr_aph_label_s/g"\
         -e "s/\<graphs\>/_digr_aph_label_s/g"\
-        -e "s/\([Gg]\)raph\([a-z]\)/_\1r_aph_label_\2/g"\
+        -e "s/_Graph/__Gr_aph_label_/g"\
+        -e "s/\([Gg]\)raph\([a-z_]\)/_\1r_aph_label_\2/g"\
         -e "s/\([a-z_]\)graph/\1_gr_aph_label_/g"\
         -e "s/Graph/_Digr_aph_label_/g"\
@@ -34,12 +35,12 @@
         -e "s/u[Ee]dge/_ed_ge_label_/g"\
         -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
-        -e "s/Edge\>/_Ar_c_label_/g"\
+        -e "s/\<Edge\>/_Ar_c_label_/g"\
         -e "s/\<edge\>/_ar_c_label_/g"\
-        -e "s/_edge\>/_ar_c_label_/g"\
-        -e "s/Edges\>/_Ar_c_label_s/g"\
+        -e "s/\<Edges\>/_Ar_c_label_s/g"\
         -e "s/\<edges\>/_ar_c_label_s/g"\
-        -e "s/_edges\>/_ar_c_label_s/g"\
-        -e "s/\([Ee]\)dge\([a-z]\)/_\1d_ge_label_\2/g"\
-        -e "s/\([a-z]\)edge/\1_ed_ge_label_/g"\
+        -e "s/_Edge/__Ed_ge_label_/g"\
+        -e "s/Edge\([a-z_]\)/_Ed_ge_label_\1/g"\
+        -e "s/edge\([a-z_]\)/_ed_ge_label_\1/g"\
+        -e "s/\([a-z_]\)edge/\1_ed_ge_label_/g"\
         -e "s/Edge/_Ar_c_label_/g"\
         -e "s/edge/_ar_c_label_/g"\
@@ -90,8 +91,4 @@
         -e "s/\<StoreBoolMap\>/LoggerBoolMap/g"\
         -e "s/\<storeBoolMap\>/loggerBoolMap/g"\
-        -e "s/\<InvertableMap\>/CrossRefMap/g"\
-        -e "s/\<invertableMap\>/crossRefMap/g"\
-        -e "s/\<DescriptorMap\>/RangeIdMap/g"\
-        -e "s/\<descriptorMap\>/rangeIdMap/g"\
         -e "s/\<BoundingBox\>/Box/g"\
         -e "s/\<readNauty\>/readNautyGraph/g"\
@@ -120,9 +117,4 @@
         -e "s/\<DirGraphAdaptor\>/Orienter/g"\
         -e "s/\<dirGraphAdaptor\>/orienter/g"\
-        -e "s/\<LpCplex\>/CplexLp/g"\
-        -e "s/\<MipCplex\>/CplexMip/g"\
-        -e "s/\<LpGlpk\>/GlpkLp/g"\
-        -e "s/\<MipGlpk\>/GlpkMip/g"\
-        -e "s/\<LpSoplex\>/SoplexLp/g"\
     <$i > $TMP
     mv $TMP $i
Index: tools/lgf-gen.cc
===================================================================
--- tools/lgf-gen.cc	(revision 584)
+++ tools/lgf-gen.cc	(revision 524)
@@ -24,12 +24,13 @@
 ///
 /// See
-/// \code
-///   lgf-gen --help
-/// \endcode
+/// \verbatim
+///  lgf-gen --help
+/// \endverbatim
 /// for more info on the usage.
+///
+
 
 #include <algorithm>
 #include <set>
-#include <ctime>
 #include <lemon/list_graph.h>
 #include <lemon/random.h>
