Index: .hgignore
===================================================================
--- .hgignore	(revision 298)
+++ .hgignore	(revision 155)
@@ -30,7 +30,5 @@
 syntax: regexp
 (.*/)?\#[^/]*\#$
-(.*/)?\.\#[^/]*$
 ^doc/html/.*
-^doc/.*\.tag
 ^autom4te.cache/.*
 ^build-aux/.*
Index: AUTHORS
===================================================================
--- AUTHORS	(revision 330)
+++ AUTHORS	(revision 330)
@@ -0,0 +1,26 @@
+The authors of the 1.x series are
+
+ * Balazs Dezso <deba@inf.elte.hu>
+ * Alpar Juttner <alpar@cs.elte.hu>
+ * Peter Kovacs <kpeter@inf.elte.hu>
+ * Akos Ladanyi <ladanyi@tmit.bme.hu>
+
+For more details on the actual contribution, please visit the history
+of the main LEMON source repository: http://lemon.cs.elte.hu/hg/lemon
+
+Moreover, this version is heavily based on the 0.x series of
+LEMON. Here is the list of people who contributed to those versions.
+
+ * Mihaly Barasz <klao@cs.elte.hu>
+ * Johanna Becker <beckerjc@cs.elte.hu>
+ * Attila Bernath <athos@cs.elte.hu>
+ * Balazs Dezso <deba@inf.elte.hu>
+ * Peter Hegyi <hegyi@tmit.bme.hu>
+ * Alpar Juttner <alpar@cs.elte.hu>
+ * Peter Kovacs <kpeter@inf.elte.hu>
+ * Akos Ladanyi <ladanyi@tmit.bme.hu>
+ * Marton Makai <marci@cs.elte.hu>
+ * Jacint Szabo <jacint@cs.elte.hu>
+
+Again, please visit the history of the old LEMON repository for more
+details: http://lemon.cs.elte.hu/svn/lemon/trunk
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 274)
+++ CMakeLists.txt	(revision 141)
@@ -1,89 +1,5 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-SET(PROJECT_NAME "LEMON")
-SET(PROJECT_VERSION "hg-tip" CACHE STRING "The version string.")
-
-PROJECT(${PROJECT_NAME})
-
-SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
-
-INCLUDE(FindDoxygen)
-INCLUDE(FindGhostscript)
-
-ENABLE_TESTING()
-
-ADD_SUBDIRECTORY(lemon)
-ADD_SUBDIRECTORY(demo)
-ADD_SUBDIRECTORY(doc)
-ADD_SUBDIRECTORY(test)
-
-IF(WIN32)
-  INSTALL(FILES ${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico
-    DESTINATION bin)
-ENDIF(WIN32)
-
-IF(WIN32)
-  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-  SET(CPACK_PACKAGE_VENDOR
-    "EGRES - Egervary Research Group on Combinatorial Optimization")
-  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_INSTALL_DIRECTORY
-    "${PROJECT_NAME} ${PROJECT_VERSION}")
-  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
-    "${PROJECT_NAME} ${PROJECT_VERSION}")
-
-  # Variables to generate a component-based installer.
-  #SET(CPACK_COMPONENTS_ALL headers library html_documentation)
-
-  #SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
-  #SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Static library")
-  #SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
-
-  #SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
-  #  "C++ header files for use with the LEMON library")
-  #SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
-  #  "Static library used to build programs with LEMON")
-  #SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
-  #  "Doxygen generated documentation")
-
-  #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_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_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 "${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\\\\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)
+project (LEMON)
+enable_testing ()
+add_subdirectory (lemon)
+add_subdirectory (demo)
+add_subdirectory (test)
Index: INSTALL
===================================================================
--- INSTALL	(revision 325)
+++ INSTALL	(revision 5)
@@ -2,60 +2,47 @@
 =========================
 
-Since you are reading this I assume you already obtained one of the release
+   Since you are reading this I assume you already obtained one of the release
 tarballs and successfully extracted it. The latest version of LEMON is
-available at our web page (http://lemon.cs.elte.hu/).
+available at our webpage (http://lemon.cs.elte.hu/).
 
-In order to install LEMON from the extracted source tarball you have to
+   In order to install LEMON from the extracted source tarball you have to
 issue the following commands:
 
-   1. `cd lemon-x.y.z'
+  1. `cd lemon-x.y.z'
 
-      This command changes to the directory which was created when you
-      extracted the sources. The x.y.z part is a version number.
+     This changes to the directory which was created when you extracted the
+     sources. The x.y.z part is a version number.
 
-   2. `./configure'
+  2. `./configure'
 
-      This command runs the configure shell script, which does some checks and
-      creates the makefiles.
+     This runs the configure shell script, which does some checks and
+     configuration (creates makefiles etc).
 
-   3. `make'
+  3. `make'
 
-      This command compiles the non-template part of LEMON into libemon.a
-      file. It also compiles the programs in the tools and demo subdirectories
-      when enabled.
+     This command compiles the non-template part of LEMON into libemon.a file.
+     It also compiles the benchmark and demo programs when enabled.
 
-   4. `make check'
+  4. `make check'
 
-      This step is optional, but recommended. It runs the test programs that
-      we developed for LEMON to check whether the library works properly on
-      your platform.
+     This step is optional, but recommended. It runs the test programs that we
+     developed for LEMON to check whether the library works properly on your
+     platform.
 
-   5. `make install'
+  5. `make install'
 
-      This command installs LEMON under /usr/local (you will need root
-      privileges to be able to do that). If you want to install it to some
-      other location, then pass the --prefix=DIRECTORY flag to configure in
-      step 2. For example: `./configure --prefix=/home/username/lemon'.
-
-   6. `make install-html'
-
-      This command installs the documentation under share/doc/lemon/docs. The
-      generated documentation is included in the tarball. If you want to
-      generate it yourself, then run `make html'. Note that for this you need
-      to have the following programs installed: Doxygen, Graphviz, Ghostscript,
-      Latex.
+     This command installs LEMON under /usr/local (you will need root
+     privileges to be able to do that). If you want to install it to some
+     other location, then pass the --prefix=DIRECTORY flag to configure in
+     step 1. For example: `./configure --prefix=/home/username/lemon'
 
 
-Configure Options and Variables
-===============================
+Configure Flags
+===============
 
-In step 2 you can customize the actions of configure by setting variables
-and passing options to it. This can be done like this:
-`./configure [OPTION]... [VARIABLE=VALUE]...'
+   You can pass the following flags to configure in step 1
+(see ./configure --help for more):
 
-Below you will find some useful variables and options (see `./configure --help'
-for more):
-
-CXX='comp'
+CXX=comp
 
   Change the C++ compiler to 'comp'.
@@ -63,26 +50,24 @@
 CXXFLAGS='flags'
 
-  Pass the 'flags' to the compiler. For example CXXFLAGS='-O3 -march=pentium-m'
-  turns on generation of aggressively optimized Pentium-M specific code.
-
---prefix=PREFIX
-
-  Set the installation prefix to PREFIX. By default it is /usr/local.
+  Pass the 'flags' to the compiler. For example
+  CXXFLAGS='-O3 -march=pentium-m'
+  turns  on generation of aggressively optimized
+  Pentium-M specific code.
 
 --enable-demo
 
-   Build the examples in the demo subdirectory.
+   Build the demo programs too.
 
 --disable-demo
 
-   Do not build the examples in the demo subdirectory (default).
+   Do not build the demo programs (default).
 
---enable-tools
+--enable-benchmark
 
-   Build the programs in the tools subdirectory (default).
+   Build the benchmark programs too.
 
---disable-tools
+--disable-benchmark
 
-   Do not build the programs in the tools subdirectory.
+   Do not build the benchmark programs (default).
 
 --with-glpk[=PREFIX]
@@ -131,24 +116,2 @@
 
    Disable CPLEX support.
-
---with-soplex[=PREFIX]
-
-   Enable SoPlex support (default). You should specify the prefix too if
-   you installed SoPlex to some non-standard location (e.g. your home
-   directory). If it is not found, SoPlex support will be disabled.
-
---with-soplex-includedir=DIR
-
-   The directory where the SoPlex header files are located. This is only
-   useful when the SoPlex headers and libraries are not under the same
-   prefix (which is unlikely).
-
---with-soplex-libdir=DIR
-
-   The directory where the SoPlex libraries are located. This is only
-   useful when the SoPlex headers and libraries are not under the same
-   prefix (which is unlikely).
-
---without-soplex
-
-   Disable SoPlex support.
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 314)
+++ Makefile.am	(revision 330)
@@ -5,10 +5,10 @@
 
 EXTRA_DIST = \
+	AUTHORS \
 	LICENSE \
 	m4/lx_check_cplex.m4 \
 	m4/lx_check_glpk.m4 \
 	m4/lx_check_soplex.m4 \
-	CMakeLists.txt \
-	cmake
+	CMakeLists.txt
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -25,5 +25,4 @@
 bin_PROGRAMS =
 check_PROGRAMS =
-dist_bin_SCRIPTS =
 TESTS =
 XFAIL_TESTS =
@@ -33,4 +32,5 @@
 include doc/Makefile.am
 include demo/Makefile.am
+include benchmark/Makefile.am
 include tools/Makefile.am
 
Index: NEWS
===================================================================
--- NEWS	(revision 262)
+++ NEWS	(revision 5)
@@ -1,49 +1,0 @@
-20XX-XX-XX Version 1.0 released
-
-	This is the first stable release of LEMON. Compared to the 0.x
-	release series, it features a considerably smaller but more
-	matured set of tools. The API has also completely revised and
-	changed in several places.
-
-	* The major name changes compared to the 0.x series
-          * Graph -> Digraph, UGraph -> Graph
-          * Edge -> Arc, UEdge -> Edge
-	  * source(UEdge)/target(UEdge) -> u(Edge)/v(Edge)
-	* Other improvements
-	  * Better documentation
-	  * Reviewed and cleaned up codebase
-	  * CMake based build system (along with the autotools based one)
-	* Contents of the library (ported from 0.x)
-	  * Algorithms
-       	    * breadth-first search (bfs.h)
-       	    * depth-first search (dfs.h)
-       	    * Dijkstra's algorithm (dijkstra.h)
-       	    * Kruskal's algorithm (kruskal.h)
-    	  * Data structures
-       	    * graph data structures (list_graph.h, smart_graph.h)
-       	    * path data structures (path.h)
-       	    * binary heap data structure (bin_heap.h)
-       	    * union-find data structures (unionfind.h)
-       	    * miscellaneous property maps (maps.h)
-       	    * two dimensional vector and bounding box (dim2.h)
-          * Concepts
-       	    * graph structure concepts (concepts/digraph.h, concepts/graph.h,
-              concepts/graph_components.h)
-       	    * concepts for other structures (concepts/heap.h, concepts/maps.h,
-	      concepts/path.h)
-    	  * Tools
-       	    * Mersenne twister random number generator (random.h)
-       	    * tools for measuring cpu and wall clock time (time_measure.h)
-       	    * tools for counting steps and events (counter.h)
-       	    * tool for parsing command line arguments (arg_parser.h)
-       	    * tool for visualizing graphs (graph_to_eps.h)
-       	    * tools for reading and writing data in LEMON Graph Format
-              (lgf_reader.h, lgf_writer.h)
-            * tools to handle the anomalies of calculations with
-	      floating point numbers (tolerance.h)
-            * tools to manage RGB colors (color.h)
-    	  * Infrastructure
-       	    * extended assertion handling (assert.h)
-       	    * exception classes and error handling (error.h)
-      	    * concept checking (concept_check.h)
-       	    * commonly used mathematical constants (math.h)
Index: README
===================================================================
--- README	(revision 325)
+++ README	(revision 24)
@@ -1,42 +1,60 @@
-==================================================================
+------------------------------------------------------------------
 LEMON - a Library of Efficient Models and Optimization in Networks
-==================================================================
+------------------------------------------------------------------
 
-LEMON is an open source library written in C++. It provides
-easy-to-use implementations of common data structures and algorithms
-in the area of optimization and helps implementing new ones. The main
-focus is on graphs and graph algorithms, thus it is especially
-suitable for solving design and optimization problems of
-telecommunication networks. To achieve wide usability its data
-structures and algorithms provide generic interfaces.
+LEMON is the abbreviation of Library of Efficient Models and
+Optimization in Networks. It is an open source library written in
+C++. It provides a set of easy-to-use implementation of common data
+structures and algorithms in the area of optimization and helps
+implementing new ones. It is an especially suitable tool to solve the
+design and optimization problems of telecommunications networks. To
+achieve wide usability, a fundamental design requirement is the
+genericity of interface of data structures and algorithms. LEMON is an
+open source library end invites people all around the world in its
+development.
 
+--------
 Contents
-========
+--------
 
-LICENSE
+COPYING, LICENSE
 
-   Copying, distribution and modification conditions and terms.
+  Copying, distribution and modification conditions and terms.
 
 INSTALL
 
-   General building and installation instructions.
+  For general building and installation instructions, see the file.
 
 lemon/
 
-   Source code of LEMON library.
+  Source code of LEMON itself.
 
 doc/
 
-   Documentation of LEMON. The starting page is doc/html/index.html.
+  Documentation of LEMON. The starting page is doc/html/index.html.
+  The documentation installs into the directory
+
+    /usr/local/share/doc/lemon/html
+
+  or -- if you use different prefix -- into
+
+    ${prefix}/share/doc/lemon/html
+
+  (see also INSTALL).
 
 demo/
 
-   Some example programs to make you easier to get familiar with LEMON.
+  Some demonstration programs to make you easier to get familiar with
+  LEMON. Use --enable-demo configure option to also compile these codes
+  (see also INSTALL).
 
 test/
 
-   Programs to check the integrity and correctness of LEMON.
+  Contains programs to check the integrity and correctness of
+  LEMON. The command 'make check' performs these tests.
 
-tools/
-
-   Various utilities related to LEMON.
+benchmark/
+  
+  Contains programs measuring the performance of LEMON. Use
+  --enable-benchmark configure option to also compile these codes (see
+  also INSTALL).
Index: benchmark/Makefile.am
===================================================================
--- benchmark/Makefile.am	(revision 146)
+++ benchmark/Makefile.am	(revision 146)
@@ -0,0 +1,7 @@
+if WANT_BENCHMARK
+
+noinst_HEADERS +=
+
+noinst_PROGRAMS +=
+
+endif WANT_BENCHMARK
Index: ake/FindGhostscript.cmake
===================================================================
--- cmake/FindGhostscript.cmake	(revision 225)
+++ 	(revision )
@@ -1,10 +1,0 @@
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PROGRAM(GHOSTSCRIPT_EXECUTABLE
-  NAMES gs gswin32c
-  PATHS "$ENV{ProgramFiles}/gs"
-  PATH_SUFFIXES gs8.61/bin gs8.62/bin
-  DOC "Ghostscript: PostScript and PDF language interpreter and previewer."
-)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ghostscript DEFAULT_MSG GHOSTSCRIPT_EXECUTABLE)
Index: configure.ac
===================================================================
--- configure.ac	(revision 314)
+++ configure.ac	(revision 219)
@@ -2,16 +2,10 @@
 
 dnl Version information.
-m4_define([lemon_version_number],
-	[m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
-dnl m4_define([lemon_version_number], [])
-m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
+m4_define([lemon_version_number], [])
 m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
-m4_define([lemon_version], [ifelse(lemon_version_number(),
-			   [],
-			   [lemon_hg_path().lemon_hg_revision()],
-			   [lemon_version_number()])])
+m4_define([lemon_version], [ifelse(lemon_version_number(), [], [lemon_hg_revision()], [lemon_version_number()])])
 
 AC_PREREQ([2.59])
-AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
+AC_INIT([LEMON], [lemon_version()], [lemon-devel@lemon.cs.elte.hu], [lemon])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
@@ -21,7 +15,4 @@
 
 lx_cmdline_cxxflags_set=${CXXFLAGS+set}
-
-dnl Do compilation tests using the C++ compiler.
-AC_LANG([C++])
 
 dnl Checks for programs.
@@ -35,26 +26,14 @@
 AC_CHECK_PROG([gs_found],[gs],[yes],[no])
 
-dnl Detect Intel compiler.
-AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
-AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
-choke me
-#endif], [ICC=[yes]], [ICC=[no]])
-if test x"$ICC" = x"yes"; then
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
-
-dnl Set custom compiler flags when using g++.
-if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then
+if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes; then
   CXXFLAGS="$CXXFLAGS -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
 fi
 
 dnl Checks for libraries.
-#LX_CHECK_GLPK
-#LX_CHECK_CPLEX
-#LX_CHECK_SOPLEX
+LX_CHECK_GLPK
+LX_CHECK_CPLEX
+LX_CHECK_SOPLEX
 
-dnl Disable/enable building the demo programs.
+dnl Disable/enable building the demo programs
 AC_ARG_ENABLE([demo],
 AS_HELP_STRING([--enable-demo], [build the demo programs])
@@ -69,5 +48,5 @@
 AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
 
-dnl Disable/enable building the binary tools.
+dnl Disable/enable building the binary tools
 AC_ARG_ENABLE([tools],
 AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
@@ -81,4 +60,17 @@
 fi
 AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
+
+dnl Disable/enable building the benchmarks
+AC_ARG_ENABLE([benchmark],
+AS_HELP_STRING([--enable-benchmark], [build the benchmarks])
+AS_HELP_STRING([--disable-benchmark], [do not build the benchmarks @<:@default@:>@]),
+              [], [enable_benchmark=no])
+AC_MSG_CHECKING([whether to build the benchmarks])
+if test x"$enable_benchmark" != x"no"; then
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+AM_CONDITIONAL([WANT_BENCHMARK], [test x"$enable_benchmark" != x"no"])
 
 dnl Checks for header files.
@@ -116,8 +108,9 @@
 echo C++ compiles flags............ : $CXXFLAGS
 echo
-#echo GLPK support.................. : $lx_glpk_found
-#echo CPLEX support................. : $lx_cplex_found
-#echo SOPLEX support................ : $lx_soplex_found
-#echo
+echo GLPK support.................. : $lx_glpk_found
+echo CPLEX support................. : $lx_cplex_found
+echo SOPLEX support................ : $lx_soplex_found
+echo
+echo Build benchmarks.............. : $enable_benchmark
 echo Build demo programs........... : $enable_demo
 echo Build additional tools........ : $enable_tools
Index: demo/CMakeLists.txt
===================================================================
--- demo/CMakeLists.txt	(revision 225)
+++ demo/CMakeLists.txt	(revision 141)
@@ -1,13 +1,13 @@
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+include_directories (${LEMON_SOURCE_DIR})
 
-LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
+link_directories (${LEMON_BINARY_DIR}/lemon)
 
-SET(DEMOS
+set (DEMOS
   arg_parser_demo
   graph_to_eps_demo
   lgf_demo)
 
-FOREACH(DEMO_NAME ${DEMOS})
-  ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc)
-  TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
-ENDFOREACH(DEMO_NAME)
+foreach (DEMO_NAME ${DEMOS})
+  add_executable (${DEMO_NAME} ${DEMO_NAME}.cc)
+  target_link_libraries (${DEMO_NAME} lemon)
+  endforeach (DEMO_NAME)
Index: demo/arg_parser_demo.cc
===================================================================
--- demo/arg_parser_demo.cc	(revision 315)
+++ demo/arg_parser_demo.cc	(revision 209)
@@ -28,5 +28,5 @@
 
 using namespace lemon;
-int main(int argc, char **argv)
+int main(int argc, const char **argv)
 {
   // Initialize the argument parser
Index: demo/graph_to_eps_demo.cc
===================================================================
--- demo/graph_to_eps_demo.cc	(revision 317)
+++ demo/graph_to_eps_demo.cc	(revision 220)
@@ -27,5 +27,5 @@
 /// how to handle parallel egdes, how to change the properties (like
 /// color, shape, size, title etc.) of nodes and arcs individually
-/// using appropriate graph maps.
+/// using appropriate \ref maps-page "graph maps".
 ///
 /// \include graph_to_eps_demo.cc
Index: demo/lgf_demo.cc
===================================================================
--- demo/lgf_demo.cc	(revision 294)
+++ demo/lgf_demo.cc	(revision 209)
@@ -45,10 +45,10 @@
 
   try {
-    digraphReader(g, "digraph.lgf"). // read the directed graph into g
+    digraphReader("digraph.lgf", g). // read the directed graph into g
       arcMap("capacity", cap).       // read the 'capacity' arc map into cap
       node("source", s).             // read 'source' node to s
       node("target", t).             // read 'target' node to t
       run();
-  } catch (Exception& error) { // check if there was any error
+  } catch (DataFormatError& error) { // check if there was any error
     std::cerr << "Error: " << error.what() << std::endl;
     return -1;
@@ -61,5 +61,5 @@
   std::cout << "We can write it to the standard output:" << std::endl;
 
-  digraphWriter(g).                // write g to the standard output
+  digraphWriter(std::cout, g).     // write g to the standard output
     arcMap("capacity", cap).       // write cap into 'capacity'
     node("source", s).             // write s to 'source'
Index: c/CMakeLists.txt
===================================================================
--- doc/CMakeLists.txt	(revision 225)
+++ 	(revision )
@@ -1,42 +1,0 @@
-SET(PACKAGE_NAME ${PROJECT_NAME})
-SET(PACKAGE_VERSION ${PROJECT_VERSION})
-SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
-SET(abs_top_builddir ${CMAKE_BINARY_DIR})
-
-CONFIGURE_FILE(
-  ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
-  ${CMAKE_BINARY_DIR}/doc/Doxyfile
-  @ONLY)
-
-IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
-  IF(UNIX)
-    ADD_CUSTOM_TARGET(html
-      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/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
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
-      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 rm -rf html
-      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-  ELSEIF(WIN32)
-    ADD_CUSTOM_TARGET(html
-      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/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
-      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
-      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 if exist html rmdir /s /q html
-      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-  ENDIF(UNIX)
-ENDIF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
-
-INSTALL(
-  DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
-  DESTINATION doc
-  COMPONENT html_documentation)
Index: doc/Doxyfile.in
===================================================================
--- doc/Doxyfile.in	(revision 321)
+++ doc/Doxyfile.in	(revision 219)
@@ -1,3 +1,3 @@
-# Doxyfile 1.5.7.1
+# Doxyfile 1.5.5
 
 #---------------------------------------------------------------------------
@@ -16,6 +16,6 @@
 INLINE_INHERITED_MEMB  = NO
 FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = "@abs_top_srcdir@"
-STRIP_FROM_INC_PATH    = "@abs_top_srcdir@"
+STRIP_FROM_PATH        = @abs_top_srcdir@
+STRIP_FROM_INC_PATH    = @abs_top_srcdir@
 SHORT_NAMES            = YES
 JAVADOC_AUTOBRIEF      = NO
@@ -34,9 +34,7 @@
 CPP_CLI_SUPPORT        = NO
 SIP_SUPPORT            = NO
-IDL_PROPERTY_SUPPORT   = YES
 DISTRIBUTE_GROUP_DOC   = NO
 SUBGROUPING            = YES
 TYPEDEF_HIDES_STRUCT   = NO
-SYMBOL_CACHE_SIZE      = 0
 #---------------------------------------------------------------------------
 # Build related configuration options
@@ -69,8 +67,5 @@
 SHOW_USED_FILES        = YES
 SHOW_DIRECTORIES       = YES
-SHOW_FILES             = YES
-SHOW_NAMESPACES        = YES
 FILE_VERSION_FILTER    = 
-LAYOUT_FILE            = DoxygenLayout.xml
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
@@ -81,16 +76,16 @@
 WARN_IF_DOC_ERROR      = YES
 WARN_NO_PARAMDOC       = NO
-WARN_FORMAT            = "$file:$line: $text"
+WARN_FORMAT            = "$file:$line: $text  "
 WARN_LOGFILE           = doxygen.log
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = "@abs_top_srcdir@/doc" \
-                         "@abs_top_srcdir@/lemon" \
-                         "@abs_top_srcdir@/lemon/bits" \
-                         "@abs_top_srcdir@/lemon/concepts" \
-                         "@abs_top_srcdir@/demo" \
-                         "@abs_top_srcdir@/tools" \
-                         "@abs_top_srcdir@/test/test_tools.h"
+INPUT                  = @abs_top_srcdir@/doc \
+                         @abs_top_srcdir@/lemon \
+                         @abs_top_srcdir@/lemon/bits \
+                         @abs_top_srcdir@/lemon/concepts \
+                         @abs_top_srcdir@/demo \
+                         @abs_top_srcdir@/tools \
+                         @abs_top_srcdir@/test/test_tools.h
 INPUT_ENCODING         = UTF-8
 FILE_PATTERNS          = *.h \
@@ -102,11 +97,11 @@
 EXCLUDE_PATTERNS       = 
 EXCLUDE_SYMBOLS        = 
-EXAMPLE_PATH           = "@abs_top_srcdir@/demo" \
-                         "@abs_top_srcdir@/LICENSE" \
-                         "@abs_top_srcdir@/doc"
+EXAMPLE_PATH           = @abs_top_srcdir@/demo \
+                         @abs_top_srcdir@/LICENSE \
+                         @abs_top_srcdir@/doc
 EXAMPLE_PATTERNS       = 
 EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = "@abs_top_srcdir@/doc/images" \
-                         "@abs_top_builddir@/doc/gen-images"
+IMAGE_PATH             = @abs_top_srcdir@/doc/images \
+                         @abs_top_builddir@/doc/gen-images
 INPUT_FILTER           = 
 FILTER_PATTERNS        = 
@@ -139,25 +134,18 @@
 HTML_STYLESHEET        = 
 HTML_ALIGN_MEMBERS     = YES
-HTML_DYNAMIC_SECTIONS  = NO
+GENERATE_HTMLHELP      = NO
 GENERATE_DOCSET        = NO
 DOCSET_FEEDNAME        = "Doxygen generated docs"
 DOCSET_BUNDLE_ID       = org.doxygen.Project
-GENERATE_HTMLHELP      = NO
+HTML_DYNAMIC_SECTIONS  = NO
 CHM_FILE               = 
 HHC_LOCATION           = 
 GENERATE_CHI           = NO
-CHM_INDEX_ENCODING     = 
 BINARY_TOC             = NO
 TOC_EXPAND             = NO
-GENERATE_QHP           = NO
-QCH_FILE               = 
-QHP_NAMESPACE          = org.doxygen.Project
-QHP_VIRTUAL_FOLDER     = doc
-QHG_LOCATION           = 
 DISABLE_INDEX          = NO
 ENUM_VALUES_PER_LINE   = 4
 GENERATE_TREEVIEW      = NO
 TREEVIEW_WIDTH         = 250
-FORMULA_FONTSIZE       = 10
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
@@ -234,11 +222,8 @@
 # Configuration options related to the dot tool   
 #---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = YES
+CLASS_DIAGRAMS         = NO
 MSCGEN_PATH            = 
 HIDE_UNDOC_RELATIONS   = YES
 HAVE_DOT               = YES
-DOT_FONTNAME           = FreeSans
-DOT_FONTSIZE           = 10
-DOT_FONTPATH           = 
 CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = NO
Index: c/DoxygenLayout.xml
===================================================================
--- doc/DoxygenLayout.xml	(revision 321)
+++ 	(revision )
@@ -1,182 +1,0 @@
-<doxygenlayout version="1.0">
-  <!-- Navigation index tabs for HTML output -->
-  <navindex>
-    <tab type="mainpage" visible="yes" title=""/>
-    <tab type="modules" visible="yes" title=""/>
-    <tab type="classes" visible="yes" title="">
-      <tab type="classes" visible="yes" title=""/>
-      <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 
-      <tab type="hierarchy" visible="yes" title=""/>
-      <tab type="classmembers" visible="yes" title=""/>
-    </tab>
-    <tab type="namespaces" visible="yes" title="">
-      <tab type="namespaces" visible="yes" title=""/>
-      <tab type="namespacemembers" visible="yes" title=""/>
-    </tab>
-    <tab type="files" visible="yes" title="">
-      <tab type="files" visible="yes" title=""/>
-      <tab type="globals" visible="yes" title=""/>
-    </tab>
-    <tab type="dirs" visible="yes" title=""/>
-    <tab type="examples" visible="yes" title=""/>  
-    <tab type="pages" visible="yes" title=""/>
-  </navindex>
-
-  <!-- Layout definition for a class page -->
-  <class>
-    <briefdescription visible="no"/>
-    <detaileddescription title=""/>
-    <includes visible="$SHOW_INCLUDE_FILES"/>
-    <inheritancegraph visible="$CLASS_GRAPH"/>
-    <collaborationgraph visible="$COLLABORATION_GRAPH"/>
-    <allmemberslink visible="yes"/>
-    <memberdecl>
-      <membergroups visible="yes"/>
-      <nestedclasses visible="yes" title=""/>
-      <publictypes title=""/>
-      <publicslots title=""/>
-      <signals title=""/>
-      <publicmethods title=""/>
-      <publicstaticmethods title=""/>
-      <publicattributes title=""/>
-      <publicstaticattributes title=""/>
-      <protectedtypes title=""/>
-      <protectedslots title=""/>
-      <protectedmethods title=""/>
-      <protectedstaticmethods title=""/>
-      <protectedattributes title=""/>
-      <protectedstaticattributes title=""/>
-      <packagetypes title=""/>
-      <packagemethods title=""/>
-      <packagestaticmethods title=""/>
-      <packageattributes title=""/>
-      <packagestaticattributes title=""/>
-      <properties title=""/>
-      <events title=""/>
-      <privatetypes title=""/>
-      <privateslots title=""/>
-      <privatemethods title=""/>
-      <privatestaticmethods title=""/>
-      <privateattributes title=""/>
-      <privatestaticattributes title=""/>
-      <friends title=""/>
-      <related title="" subtitle=""/>
-    </memberdecl>
-    <memberdef>
-      <typedefs title=""/>
-      <enums title=""/>
-      <constructors title=""/>
-      <functions title=""/>
-      <related title=""/>
-      <variables title=""/>
-      <properties title=""/>
-      <events title=""/>
-    </memberdef>
-    <usedfiles visible="$SHOW_USED_FILES"/>
-    <authorsection visible="yes"/>
-  </class>
-
-  <!-- Layout definition for a namespace page -->
-  <namespace>
-    <briefdescription visible="no"/>
-    <detaileddescription title=""/>
-    <memberdecl>
-      <nestednamespaces visible="yes" title=""/>
-      <classes visible="yes" title=""/>
-      <membergroups visible="yes"/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdecl>
-    <memberdef>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdef>
-    <authorsection visible="yes"/>
-  </namespace>
-
-  <!-- Layout definition for a file page -->
-  <file>
-    <briefdescription visible="no"/>
-    <detaileddescription title=""/>
-    <includes visible="$SHOW_INCLUDE_FILES"/>
-    <includegraph visible="$INCLUDE_GRAPH"/>
-    <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
-    <sourcelink visible="yes"/>
-    <memberdecl>
-      <classes visible="yes" title=""/>
-      <namespaces visible="yes" title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdecl>
-    <memberdef>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <functions title=""/>
-      <variables title=""/>
-    </memberdef>
-    <authorsection/>
-  </file>
-
-  <!-- Layout definition for a group page -->
-  <group>
-    <briefdescription visible="no"/>
-    <detaileddescription title=""/>
-    <groupgraph visible="$GROUP_GRAPHS"/>
-    <memberdecl>
-      <classes visible="yes" title=""/>
-      <namespaces visible="yes" title=""/>
-      <dirs visible="yes" title=""/>
-      <nestedgroups visible="yes" title=""/>
-      <files visible="yes" title=""/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <enumvalues title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <signals title=""/>
-      <publicslots title=""/>
-      <protectedslots title=""/>
-      <privateslots title=""/>
-      <events title=""/>
-      <properties title=""/>
-      <friends title=""/>
-    </memberdecl>
-    <memberdef>
-      <pagedocs/>
-      <defines title=""/>
-      <typedefs title=""/>
-      <enums title=""/>
-      <enumvalues title=""/>
-      <functions title=""/>
-      <variables title=""/>
-      <signals title=""/>
-      <publicslots title=""/>
-      <protectedslots title=""/>
-      <privateslots title=""/>
-      <events title=""/>
-      <properties title=""/>
-      <friends title=""/>
-    </memberdef>
-    <authorsection visible="yes"/>
-  </group>
-
-  <!-- Layout definition for a directory page -->
-  <directory>
-    <briefdescription visible="no"/>
-    <detaileddescription title=""/>
-    <directorygraph visible="yes"/>
-    <memberdecl>
-      <dirs visible="yes"/>
-      <files visible="yes"/>
-    </memberdecl>
-  </directory>
-</doxygenlayout>
Index: doc/Makefile.am
===================================================================
--- doc/Makefile.am	(revision 322)
+++ doc/Makefile.am	(revision 156)
@@ -1,5 +1,4 @@
 EXTRA_DIST += \
 	doc/Doxyfile.in \
-	doc/DoxygenLayout.xml \
 	doc/coding_style.dox \
 	doc/dirs.dox \
@@ -8,9 +7,6 @@
 	doc/license.dox \
 	doc/mainpage.dox \
-	doc/migration.dox \
-	doc/named-param.dox \
 	doc/namespaces.dox \
-	doc/html \
-	doc/CMakeLists.txt
+	doc/html
 
 DOC_EPS_IMAGES18 = \
Index: doc/dirs.dox
===================================================================
--- doc/dirs.dox	(revision 325)
+++ doc/dirs.dox	(revision 209)
@@ -19,7 +19,7 @@
 /**
 \dir demo
-\brief A collection of demo applications.
+\brief A collection of demo application.
 
-This directory contains several simple demo applications, mainly
+This directory contains several simple demo application, mainly
 for educational purposes.
 */
@@ -29,6 +29,5 @@
 \brief Auxiliary (and the whole generated) documentation.
 
-This directory contains some auxiliary pages and the whole generated
-documentation.
+Auxiliary (and the whole generated) documentation.
 */
 
@@ -43,14 +42,17 @@
 /**
 \dir tools
-\brief Some useful executables.
+\brief Some useful executables
 
 This directory contains the sources of some useful complete executables.
+
 */
+
+
 
 /**
 \dir lemon
-\brief Base include directory of LEMON.
+\brief Base include directory of LEMON
 
-This is the base directory of LEMON includes, so each include file must be
+This is the base directory of lemon includes, so each include file must be
 prefixed with this, e.g.
 \code
@@ -62,16 +64,16 @@
 /**
 \dir concepts
-\brief Concept descriptors and checking classes.
+\brief Concept descriptors and checking classes
 
-This directory contains the concept descriptors and concept checking tools.
-For more information see the \ref concept "Concepts" module.
+This directory contains the concept descriptors and concept checkers. As a user
+you typically don't have to deal with these files.
 */
 
 /**
 \dir bits
-\brief Auxiliary tools for implementation.
+\brief Implementation helper files
 
-This directory contains some auxiliary classes for implementing graphs, 
-maps and some other classes.
-As a user you typically don't have to deal with these files.
+This directory contains some helper classes to implement graphs, maps and
+some other classes. As a user you typically don't have to deal with these
+files.
 */
Index: doc/groups.dox
===================================================================
--- doc/groups.dox	(revision 326)
+++ doc/groups.dox	(revision 210)
@@ -41,9 +41,29 @@
 some graph features like arc/edge or node deletion.
 
+Alteration of standard containers need a very limited number of
+operations, these together satisfy the everyday requirements.
+In the case of graph structures, different operations are needed which do
+not alter the physical graph, but gives another view. If some nodes or
+arcs have to be hidden or the reverse oriented graph have to be used, then
+this is the case. It also may happen that in a flow implementation
+the residual graph can be accessed by another algorithm, or a node-set
+is to be shrunk for another algorithm.
+LEMON also provides a variety of graphs for these requirements called
+\ref graph_adaptors "graph adaptors". Adaptors cannot be used alone but only
+in conjunction with other graph representations.
+
 You are free to use the graph structure that fit your requirements
 the best, most graph algorithms and auxiliary data structures can be used
-with any graph structure.
-
-<b>See also:</b> \ref graph_concepts "Graph Structure Concepts".
+with any graph structures.
+*/
+
+/**
+@defgroup semi_adaptors Semi-Adaptor Classes for Graphs
+@ingroup graphs
+\brief 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.
 */
 
@@ -55,8 +75,6 @@
 This group describes the map structures implemented in LEMON.
 
-LEMON provides several special purpose maps and map adaptors that e.g. combine
+LEMON provides several special purpose maps that e.g. combine
 new maps from existing ones.
-
-<b>See also:</b> \ref map_concepts "Map Concepts".
 */
 
@@ -69,4 +87,5 @@
 values to the nodes and arcs of graphs.
 */
+
 
 /**
@@ -86,5 +105,5 @@
 algorithms.  If a function type algorithm is called then the function
 type map adaptors can be used comfortable. For example let's see the
-usage of map adaptors with the \c graphToEps() function.
+usage of map adaptors with the \c digraphToEps() function.
 \code
   Color nodeColor(int deg) {
@@ -100,5 +119,5 @@
   Digraph::NodeMap<int> degree_map(graph);
 
-  graphToEps(graph, "graph.eps")
+  digraphToEps(graph, "graph.eps")
     .coords(coords).scaleToA4().undirected()
     .nodeColors(composeMap(functorToMap(nodeColor), degree_map))
@@ -106,5 +125,5 @@
 \endcode
 The \c functorToMap() function makes an \c int to \c Color map from the
-\c nodeColor() function. The \c composeMap() compose the \c degree_map
+\e nodeColor() function. The \c composeMap() compose the \e degree_map
 and the previously created map. The composed map is a proper function to
 get the color of each node.
@@ -134,7 +153,15 @@
 
 /**
+@defgroup matrices Matrices
+@ingroup datas
+\brief Two dimensional data storages implemented in LEMON.
+
+This group describes two dimensional data storages implemented in LEMON.
+*/
+
+/**
 @defgroup paths Path Structures
 @ingroup datas
-\brief %Path structures implemented in LEMON.
+\brief Path structures implemented in LEMON.
 
 This group describes the path structures implemented in LEMON.
@@ -147,4 +174,5 @@
 
 \sa lemon::concepts::Path
+
 */
 
@@ -158,4 +186,5 @@
 */
 
+
 /**
 @defgroup algs Algorithms
@@ -173,9 +202,9 @@
 
 This group describes the common graph search algorithms like
-Breadth-First Search (BFS) and Depth-First Search (DFS).
-*/
-
-/**
-@defgroup shortest_path Shortest Path Algorithms
+Breadth-first search (Bfs) and Depth-first search (Dfs).
+*/
+
+/**
+@defgroup shortest_path Shortest Path algorithms
 @ingroup algs
 \brief Algorithms for finding shortest paths.
@@ -185,5 +214,144 @@
 
 /**
-@defgroup spantree Minimum Spanning Tree Algorithms
+@defgroup max_flow Maximum Flow algorithms
+@ingroup algs
+\brief Algorithms for finding maximum flows.
+
+This group describes the algorithms for finding maximum flows and
+feasible circulations.
+
+The maximum flow problem is to find a flow between a single source and
+a single target that is maximum. Formally, there is a \f$G=(V,A)\f$
+directed graph, an \f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity
+function and given \f$s, t \in V\f$ source and target node. The
+maximum flow is the \f$f_a\f$ solution of the next optimization problem:
+
+\f[ 0 \le f_a \le c_a \f]
+\f[ \sum_{v\in\delta^{-}(u)}f_{vu}=\sum_{v\in\delta^{+}(u)}f_{uv}
+\qquad \forall u \in V \setminus \{s,t\}\f]
+\f[ \max \sum_{v\in\delta^{+}(s)}f_{uv} - \sum_{v\in\delta^{-}(s)}f_{vu}\f]
+
+LEMON contains several algorithms for solving maximum flow problems:
+- \ref lemon::EdmondsKarp "Edmonds-Karp"
+- \ref lemon::Preflow "Goldberg's Preflow algorithm"
+- \ref lemon::DinitzSleatorTarjan "Dinitz's blocking flow algorithm with dynamic trees"
+- \ref lemon::GoldbergTarjan "Preflow algorithm with dynamic trees"
+
+In most cases the \ref lemon::Preflow "Preflow" algorithm provides the
+fastest method to compute the maximum flow. All impelementations
+provides functions to query the minimum cut, which is the dual linear
+programming problem of the maximum flow.
+
+*/
+
+/**
+@defgroup min_cost_flow Minimum Cost Flow algorithms
+@ingroup algs
+
+\brief Algorithms for finding minimum cost flows and circulations.
+
+This group describes the algorithms for finding minimum cost flows and
+circulations.
+*/
+
+/**
+@defgroup min_cut Minimum Cut algorithms
+@ingroup algs
+
+\brief Algorithms for finding minimum cut in graphs.
+
+This group describes the algorithms for finding minimum cut in graphs.
+
+The minimum cut problem is to find a non-empty and non-complete
+\f$X\f$ subset of the vertices with minimum overall capacity on
+outgoing arcs. Formally, there is \f$G=(V,A)\f$ directed graph, an
+\f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
+cut is the \f$X\f$ solution of the next optimization problem:
+
+\f[ \min_{X \subset V, X\not\in \{\emptyset, V\}}
+\sum_{uv\in A, u\in X, v\not\in X}c_{uv}\f]
+
+LEMON contains several algorithms related to minimum cut problems:
+
+- \ref lemon::HaoOrlin "Hao-Orlin algorithm" to calculate minimum cut
+  in directed graphs
+- \ref lemon::NagamochiIbaraki "Nagamochi-Ibaraki algorithm" to
+  calculate minimum cut in undirected graphs
+- \ref lemon::GomoryHuTree "Gomory-Hu tree computation" to calculate all
+  pairs minimum cut in undirected graphs
+
+If you want to find minimum cut just between two distinict nodes,
+please see the \ref max_flow "Maximum Flow page".
+
+*/
+
+/**
+@defgroup graph_prop Connectivity and other graph properties
+@ingroup algs
+\brief Algorithms for discovering the graph properties
+
+This group describes the algorithms for discovering the graph properties
+like connectivity, bipartiteness, euler property, simplicity etc.
+
+\image html edge_biconnected_components.png
+\image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth
+*/
+
+/**
+@defgroup planar Planarity embedding and drawing
+@ingroup algs
+\brief Algorithms for planarity checking, embedding and drawing
+
+This group describes the algorithms for planarity checking,
+embedding and drawing.
+
+\image html planar.png
+\image latex planar.eps "Plane graph" width=\textwidth
+*/
+
+/**
+@defgroup matching Matching algorithms
+@ingroup algs
+\brief Algorithms for finding matchings in graphs and bipartite graphs.
+
+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 arcs which does not shares common endpoints.
+
+There are several different algorithms for calculate matchings in
+graphs.  The matching problems in bipartite graphs are generally
+easier than in general graphs. The goal of the matching optimization
+can be the finding maximum cardinality, maximum weight or minimum cost
+matching. The search can be constrained to find perfect or
+maximum cardinality matching.
+
+Lemon contains the next algorithms:
+- \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp
+  augmenting path algorithm for calculate maximum cardinality matching in
+  bipartite graphs
+- \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel
+  algorithm for calculate maximum cardinality matching in bipartite graphs
+- \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching"
+  Successive shortest path algorithm for calculate maximum weighted matching
+  and maximum weighted bipartite matching in bipartite graph
+- \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching"
+  Successive shortest path algorithm for calculate minimum cost maximum
+  matching in bipartite graph
+- \ref lemon::MaxMatching "MaxMatching" Edmond's blossom shrinking algorithm
+  for calculate maximum cardinality matching in general graph
+- \ref lemon::MaxWeightedMatching "MaxWeightedMatching" Edmond's blossom
+  shrinking algorithm for calculate maximum weighted matching in general
+  graph
+- \ref lemon::MaxWeightedPerfectMatching "MaxWeightedPerfectMatching"
+  Edmond's blossom shrinking algorithm for calculate maximum weighted
+  perfect matching in general graph
+
+\image html bipartite_matching.png
+\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth
+
+*/
+
+/**
+@defgroup spantree Minimum Spanning Tree algorithms
 @ingroup algs
 \brief Algorithms for finding a minimum cost spanning tree in a graph.
@@ -191,4 +359,60 @@
 This group describes the algorithms for finding a minimum cost spanning
 tree in a graph
+*/
+
+
+/**
+@defgroup auxalg Auxiliary algorithms
+@ingroup algs
+\brief Auxiliary algorithms implemented in LEMON.
+
+This group describes some algorithms implemented in LEMON
+in order to make it easier to implement complex algorithms.
+*/
+
+/**
+@defgroup approx Approximation algorithms
+\brief Approximation algorithms.
+
+This group describes the approximation and heuristic algorithms
+implemented in LEMON.
+*/
+
+/**
+@defgroup gen_opt_group General Optimization Tools
+\brief This group describes some general optimization frameworks
+implemented in LEMON.
+
+This group describes some general optimization frameworks
+implemented in LEMON.
+
+*/
+
+/**
+@defgroup lp_group Lp and Mip solvers
+@ingroup gen_opt_group
+\brief Lp and Mip solver interfaces for LEMON.
+
+This group describes Lp and Mip solver interfaces for LEMON. The
+various LP solvers could be used in the same manner with this
+interface.
+
+*/
+
+/**
+@defgroup lp_utils Tools for Lp and Mip solvers
+@ingroup lp_group
+\brief Helper tools to the Lp and Mip solvers.
+
+This group adds some helper tools to general optimization framework
+implemented in LEMON.
+*/
+
+/**
+@defgroup metah Metaheuristics
+@ingroup gen_opt_group
+\brief Metaheuristics for LEMON library.
+
+This group describes some metaheuristic optimization tools.
 */
 
@@ -218,5 +442,5 @@
 
 /**
-@defgroup timecount Time Measuring and Counting
+@defgroup timecount Time measuring and Counting
 @ingroup misc
 \brief Simple tools for measuring the performance of algorithms.
@@ -224,4 +448,13 @@
 This group describes simple tools for measuring the performance
 of algorithms.
+*/
+
+/**
+@defgroup graphbits Tools for Graph Implementation
+@ingroup utils
+\brief Tools to make it easier to create graphs.
+
+This group describes the tools that makes it easier to create graphs and
+the maps that dynamically update with the graph changes.
 */
 
@@ -239,20 +472,19 @@
 
 This group describes the tools for importing and exporting graphs
-and graph related data. Now it supports the LEMON format
-and the encapsulated postscript (EPS) format.
-postscript (EPS) format.
-*/
-
-/**
-@defgroup lemon_io LEMON Input-Output
+and graph related data. Now it supports the LEMON format, the
+\c DIMACS format and the encapsulated postscript (EPS) format.
+*/
+
+/**
+@defgroup lemon_io Lemon Input-Output
 @ingroup io_group
-\brief Reading and writing LEMON Graph Format.
+\brief Reading and writing \ref lgf-format "Lemon Graph Format".
 
 This group describes methods for reading and writing
-\ref lgf-format "LEMON Graph Format".
-*/
-
-/**
-@defgroup eps_io Postscript Exporting
+\ref lgf-format "Lemon Graph Format".
+*/
+
+/**
+@defgroup eps_io Postscript exporting
 @ingroup io_group
 \brief General \c EPS drawer and graph exporter
@@ -262,4 +494,5 @@
 */
 
+
 /**
 @defgroup concept Concepts
@@ -271,10 +504,10 @@
 The purpose of the classes in this group is fourfold.
 
-- These classes contain the documentations of the %concepts. In order
+- These classes contain the documentations of the concepts. In order
   to avoid document multiplications, an implementation of a concept
   simply refers to the corresponding concept class.
 
 - These classes declare every functions, <tt>typedef</tt>s etc. an
-  implementation of the %concepts should provide, however completely
+  implementation of the concepts should provide, however completely
   without implementations and real data structures behind the
   interface. On the other hand they should provide nothing else. All
@@ -289,5 +522,7 @@
 
 - Finally, They can serve as a skeleton of a new implementation of a concept.
-*/
+
+*/
+
 
 /**
@@ -300,10 +535,8 @@
 */
 
-/**
-@defgroup map_concepts Map Concepts
-@ingroup concept
-\brief Skeleton and concept checking classes for maps
- 
-This group describes the skeletons and concept checking classes of maps.
+/* --- Unused group
+@defgroup experimental Experimental Structures and Algorithms
+This group describes some Experimental structures and algorithms.
+The stuff here is subject to change.
 */
 
@@ -319,2 +552,12 @@
 build the library.
 */
+
+/**
+@defgroup tools Standalone utility applications
+
+Some utility applications are listed here.
+
+The standard compilation procedure (<tt>./configure;make</tt>) will compile
+them, as well.
+*/
+
Index: doc/lgf.dox
===================================================================
--- doc/lgf.dox	(revision 317)
+++ doc/lgf.dox	(revision 212)
@@ -22,5 +22,5 @@
 
 
-\page lgf-format LEMON Graph Format (LGF)
+\page lgf-format Lemon Graph Format (LGF)
 
 The \e LGF is a <em>column oriented</em>
@@ -79,5 +79,5 @@
 \endcode
 
-The \c \@edges is just a synonym of \c \@arcs. The \@arcs section can
+The \c \@edges is just a synonym of \c \@arcs. The @arcs section can
 also store the edge set of an undirected graph. In such case there is
 a conventional method for store arc maps in the file, if two columns
Index: doc/mainpage.dox
===================================================================
--- doc/mainpage.dox	(revision 329)
+++ doc/mainpage.dox	(revision 209)
@@ -42,9 +42,19 @@
 \subsection howtoread How to read the documentation
 
+If you want to get a quick start and see the most important features then
+take a look at our \ref quicktour
+"Quick Tour to LEMON" which will guide you along.
+
+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.
 
-If you are a user of the old (0.x) series of LEMON, please check out the
-\ref migration "Migration Guide" for the backward incompatibilities.
+
 */
Index: c/migration.dox
===================================================================
--- doc/migration.dox	(revision 318)
+++ 	(revision )
@@ -1,143 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-namespace lemon {
-/*!
-
-\page migration Migration from the 0.x Series
-
-This guide gives an in depth description on what has changed compared
-to the 0.x release series.
-
-Many of these changes adjusted automatically by the
-<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
-update are typeset <b>boldface</b>.
-
-\section migration-graph Graph Related Name Changes
-
-- \ref concepts::Digraph "Directed graphs" are called \c Digraph and
-  they have <tt>Arc</tt>s (instead of <tt>Edge</tt>s), while
-  \ref concepts::Graph "undirected graphs" are called \c Graph
-  (instead of \c UGraph) and they have <tt>Edge</tt>s (instead of
-  <tt>UEdge</tt>s). These changes reflected thoroughly everywhere in
-  the library. Namely,
-  - \c Graph -> \c Digraph
-    - \c %ListGraph -> \c ListDigraph, \c %SmartGraph -> \c SmartDigraph etc.
-  - \c UGraph -> \c Graph
-    - \c ListUGraph -> \c ListGraph, \c SmartUGraph -> \c SmartGraph etc.
-  - \c Edge -> \c Arc, \c UEdge -> \c Edge
-  - \c EdgeMap -> \c ArcMap, \c UEdgeMap -> \c EdgeMap
-  - \c EdgeIt -> \c ArcIt, \c UEdgeIt -> \c EdgeIt
-  - Class names and function names containing the words \c graph,
-    \c ugraph, \e edge or \e arc should also be updated.
-- <b>The two endpoints of an (\e undirected) \c Edge can be obtained by the
-  <tt>u()</tt> and <tt>v()</tt> member function of the graph
-  (instead of <tt>source()</tt> and <tt>target()</tt>). This change
-  must be done by hand.</b>
-  \n Of course, you can still use <tt>source()</tt> and <tt>target()</tt>
-  for <tt>Arc</tt>s (directed edges).
-
-\warning
-<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of
-the words \c graph, \c digraph, \c edge and \c arc, so it replaces them
-in strings, comments etc. as well as in all identifiers.</b>
-
-\section migration-lgf LGF tools
- - The \ref lgf-format "LGF file format" has changed,
-   <tt>\@nodeset</tt> has changed to <tt>\@nodes</tt>,
-   <tt>\@edgeset</tt> and <tt>\@uedgeset</tt> to <tt>\@arcs</tt> or
-   <tt>\@edges</tt>, which become completely equivalents. The
-   <tt>\@nodes</tt>, <tt>\@edges</tt> and <tt>\@uedges</tt> sections are
-   removed from the format, the content of them should be
-   the part of <tt>\@attributes</tt> section. The data fields in
-   the sections must follow a strict format, they must be either character
-   sequences without whitespaces or quoted strings.
- - The <tt>LemonReader</tt> and <tt>LemonWriter</tt> core interfaces
-   are no longer available.
- - The implementation of the general section readers and writers has changed
-   they are simple functors now. Beside the old
-   stream based section handling, currently line oriented section
-   reading and writing are also supported. In the
-   section readers the lines must be counted manually. The sections
-   should be read and written with the SectionWriter and SectionReader
-   classes.
- - Instead of the item readers and writers, item converters should be
-   used. The converters are functors, which map the type to
-   std::string or std::string to the type. The converters for standard
-   containers hasn't yet been implemented in the new LEMON. The converters
-   can return strings in any format, because if it is necessary, the LGF
-   writer and reader will quote and unquote the given value.
- - The DigraphReader and DigraphWriter can used similarly to the
-   0.x series, however the <tt>read</tt> or <tt>write</tt> prefix of
-   the member functions are removed.
- - The new LEMON supports the function like interface, the \c
-   digraphReader and \c digraphWriter functions are more convenient than
-   using the classes directly.
-
-\section migration-search BFS, DFS and Dijkstra
-- <b>Using the function interface of BFS, DFS and %Dijkstra both source and
-  target nodes can be given as parameters of the <tt>run()</tt> function
-  (instead of \c bfs(), \c dfs() or \c dijkstra() itself).</b>
-- \ref named-templ-param "Named class template parameters" of \c Bfs,
-  \c Dfs, \c Dijkstra, \c BfsVisit, \c DfsVisit are renamed to start
-  with "Set" instead of "Def". Namely,
-  - \c DefPredMap -> \c SetPredMap
-  - \c DefDistMap -> \c SetDistMap
-  - \c DefReachedMap -> \c SetReachedMap
-  - \c DefProcessedMap -> \c SetProcessedMap
-  - \c DefHeap -> \c SetHeap
-  - \c DefStandardHeap -> \c SetStandardHeap
-  - \c DefOperationTraits -> \c SetOperationTraits
-  - \c DefProcessedMapToBeDefaultMap -> \c SetStandardProcessedMap
-
-\section migration-error Exceptions and Debug tools
-
-<b>The class hierarchy of exceptions has largely been simplified. Now,
-only the i/o related tools may throw exceptions. All other exceptions
-have been replaced with either the \c LEMON_ASSERT or the \c LEMON_DEBUG
-macros.</b>
-
-<b>On the other hand, the parameter order of constructors of the
-exceptions has been changed. See \ref IoError and \ref FormatError for
-more details.</b>
-
-\section migration-other Others
-- <b>The contents of <tt>graph_utils.h</tt> are moved to <tt>core.h</tt>
-  and <tt>maps.h</tt>. <tt>core.h</tt> is included by all graph types,
-  therefore it usually do not have to be included directly.</b>
-- <b><tt>path_utils.h</tt> is merged to \c path.h.</b>
-- <b>The semantic of the assignment operations and copy constructors of maps
-  are still under discussion. So, you must copy them by hand (i.e. copy
-  each entry one-by-one)</b>
-- <b>The parameters of the graph copying tools (i.e. \c GraphCopy,
-  \c DigraphCopy) have to be given in the from-to order.</b>
-- \c copyDigraph() and \c copyGraph() are renamed to \c digraphCopy()
-  and \c graphCopy(), respectively.
-- <b>The interface of \ref DynArcLookUp has changed. It is now the same as
-  of \ref ArcLookUp and \ref AllArcLookUp</b>
-- Some map types should also been renamed. Namely,
-  - \c IntegerMap -> \c RangeMap
-  - \c StdMap -> \c SparseMap
-  - \c FunctorMap -> \c FunctorToMap
-  - \c MapFunctor -> \c MapToFunctor
-  - \c ForkWriteMap -> \c ForkMap
-  - \c StoreBoolMap -> \c LoggerBoolMap
-- \c dim2::BoundingBox -> \c dim2::Box
-
-*/
-}
Index: c/named-param.dox
===================================================================
--- doc/named-param.dox	(revision 269)
+++ 	(revision )
@@ -1,119 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-/*!
-
-\page named-param Named Parameters
-
-\section named-func-param Named Function Parameters
-
-Several modern languages provide a convenient way to refer the
-function parameters by name also when you call the function. It is
-especially comfortable in case of a function having tons of parameters
-with natural default values. Sadly, C++ lack this amenity.
-
-However, with a crafty trick and with some little
-inconvenience, it is possible to emulate is.
-The example below shows how to do it.
-
-\code
-class namedFn
-{
-  int _id;
-  double _val;
-  int _dim;
-
-  public:
-  namedFn() : _id(0), _val(1), _dim(2) {}
-  namedFn& id(int p)     { _id  = p ; return *this; }
-  namedFn& val(double p) { _val = p ; return *this; }
-  namedFn& dim(int p)    { _dim = p ; return *this; }
-
-  run() {
-    std::cout << "Here comes the function itself\n" <<
-              << "With parameters "
-              << _id << ", " << _val << ", " << _dim << std::endl;
-  }
-};
-\endcode
-
-Then you can use it like this.
-
-\code
-namedFn().id(3).val(2).run();
-\endcode
-
-The trick is obvious, each "named parameter" changes one component of
-the underlying class, then gives back a reference to it. Finally,
-<tt>run()</tt> executes the algorithm itself.
-
-\note Although it is a class, namedFn is used pretty much like as it were
-a function. That it why we called it namedFn instead of \c NamedFn.
-
-\note In fact, the final <tt>.run()</tt> could be made unnecessary,
-because the algorithm could also be implemented in the destructor of
-\c namedFn instead. This however would make it impossible to implement
-functions with return values, and would also cause serious problems when
-implementing \ref named-templ-func-param "named template parameters".
-<b>Therefore, by convention, <tt>.run()</tt> must be used
-explicitly to execute a function having named parameters
-everywhere in LEMON.</b>
-
-\section named-templ-func-param Named Function Template Parameters
-
-A named parameter can also be a template function. The usage is
-exactly the same, but the implementation behind is a kind of black
-magic and they are the dirtiest part of the LEMON code.
-
-You will probably never need to know how it works, but if you really
-committed, have a look at \ref lemon/graph_to_eps.h for an example.
-
-\section traits-classes Traits Classes
-
-A similar game can also be played when defining classes. In this case
-the type of the class attributes can be changed. Initially we have to
-define a special class called <em>Traits Class</em> defining the
-default type of the attributes. Then the types of these attributes can
-be changed in the same way as described in the next section.
-
-See \ref lemon::DijkstraDefaultTraits for an
-example how a traits class implementation looks like.
-
-\section named-templ-param Named Class Template Parameters
-
-If we would like to change the type of an attribute in a class that
-was instantiated by using a traits class as a template parameter, and
-the class contains named parameters, we do not have to instantiate again
-the class with new traits class, but instead adaptor classes can
-be used as shown in the following example.
-
-\code
-Dijkstra<>::SetPredMap<NullMap<Node,Arc> >::Create
-\endcode
-
-It can also be used in conjunction with other named template
-parameters in arbitrary order.
-
-\code
-Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Arc> >::Create
-\endcode
-
-The result will be an instantiated Dijkstra class, in which the
-DistMap and the PredMap is modified.
-
-*/
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 225)
+++ lemon/CMakeLists.txt	(revision 141)
@@ -1,18 +1,2 @@
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
-
-ADD_LIBRARY(lemon
-  arg_parser.cc
-  base.cc
-  color.cc
-  random.cc)
-
-INSTALL(
-  TARGETS lemon
-  ARCHIVE DESTINATION lib
-  COMPONENT library)
-
-INSTALL(
-  DIRECTORY . bits concepts
-  DESTINATION include/lemon
-  COMPONENT headers
-  FILES_MATCHING PATTERN "*.h")
+include_directories (${LEMON_SOURCE_DIR})
+add_library (lemon arg_parser.cc base.cc color.cc random.cc)
Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 259)
+++ lemon/Makefile.am	(revision 220)
@@ -13,6 +13,7 @@
         lemon/random.cc
 
-#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS)
-#lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS)
+
+lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS)
+lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS)
 
 lemon_HEADERS += \
Index: lemon/arg_parser.cc
===================================================================
--- lemon/arg_parser.cc	(revision 315)
+++ lemon/arg_parser.cc	(revision 214)
@@ -27,9 +27,10 @@
   }
 
-  ArgParser::ArgParser(int argc, const char * const *argv)
-    :_argc(argc), _argv(argv), _command_name(argv[0]) {
+  ArgParser::ArgParser(int argc, const char **argv) :_argc(argc), _argv(argv),
+                                                     _command_name(argv[0]) {
     funcOption("-help","Print a short help message",_showHelp,this);
     synonym("help","-help");
     synonym("h","-help");
+
   }
 
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h	(revision 315)
+++ lemon/arg_parser.h	(revision 214)
@@ -17,6 +17,6 @@
  */
 
-#ifndef LEMON_ARG_PARSER_H
-#define LEMON_ARG_PARSER_H
+#ifndef LEMON_ARG_PARSER
+#define LEMON_ARG_PARSER
 
 #include <vector>
@@ -47,5 +47,5 @@
 
     int _argc;
-    const char * const *_argv;
+    const char **_argv;
 
     enum OptType { UNKNOWN=0, BOOL=1, STRING=2, DOUBLE=3, INTEGER=4, FUNC=5 };
@@ -120,5 +120,5 @@
 
     ///Constructor
-    ArgParser(int argc, const char * const *argv);
+    ArgParser(int argc, const char **argv);
 
     ~ArgParser();
@@ -311,7 +311,6 @@
     ///This is the type of the return value of ArgParser::operator[]().
     ///It automatically converts to \c int, \c double, \c bool or
-    ///\c std::string if the type of the option matches, which is checked
-    ///with an \ref LEMON_ASSERT "assertion" (i.e. it performs runtime
-    ///type checking).
+    ///\c std::string if the type of the option matches, otherwise it
+    ///throws an exception (i.e. it performs runtime type checking).
     class RefType
     {
@@ -384,3 +383,3 @@
 }
 
-#endif // LEMON_ARG_PARSER_H
+#endif // LEMON_ARG_PARSER
Index: lemon/assert.h
===================================================================
--- lemon/assert.h	(revision 290)
+++ lemon/assert.h	(revision 218)
@@ -28,7 +28,6 @@
 namespace lemon {
 
-  inline void assert_fail_abort(const char *file, int line,
-                                const char *function, const char* message,
-                                const char *assertion)
+  inline void assert_fail_log(const char *file, int line, const char *function,
+                              const char *message, const char *assertion)
   {
     std::cerr << file << ":" << line << ": ";
@@ -39,4 +38,11 @@
       std::cerr << " (assertion '" << assertion << "' failed)";
     std::cerr << std::endl;
+  }
+
+  inline void assert_fail_abort(const char *file, int line,
+                                const char *function, const char* message,
+                                const char *assertion)
+  {
+    assert_fail_log(file, line, function, message, assertion);
     std::abort();
   }
@@ -58,12 +64,15 @@
 
 #undef LEMON_ASSERT
+#undef LEMON_FIXME
 #undef LEMON_DEBUG
 
-#if (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +               \
+#if (defined(LEMON_ASSERT_LOG) ? 1 : 0) +               \
+  (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +               \
   (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) > 1
 #error "LEMON assertion system is not set properly"
 #endif
 
-#if ((defined(LEMON_ASSERT_ABORT) ? 1 : 0) +            \
+#if ((defined(LEMON_ASSERT_LOG) ? 1 : 0) +              \
+     (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +            \
      (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) == 1 ||     \
      defined(LEMON_ENABLE_ASSERTS)) &&                  \
@@ -74,5 +83,8 @@
 
 
-#if defined LEMON_ASSERT_ABORT
+#if defined LEMON_ASSERT_LOG
+#  undef LEMON_ASSERT_HANDLER
+#  define LEMON_ASSERT_HANDLER ::lemon::assert_fail_log
+#elif defined LEMON_ASSERT_ABORT
 #  undef LEMON_ASSERT_HANDLER
 #  define LEMON_ASSERT_HANDLER ::lemon::assert_fail_abort
@@ -96,8 +108,6 @@
 #  elif defined _MSC_VER
 #    define LEMON_FUNCTION_NAME (__FUNCSIG__)
-#  elif __STDC_VERSION__ >= 199901L
+#  else
 #    define LEMON_FUNCTION_NAME (__func__)
-#  else
-#    define LEMON_FUNCTION_NAME ("<unknown>")
 #  endif
 #endif
@@ -109,10 +119,10 @@
 /// \brief Macro for assertion with customizable message
 ///
-/// Macro for assertion with customizable message.
-/// \param exp An expression that must be convertible to \c bool.  If it is \c
-/// false, then an assertion is raised. The concrete behaviour depends on the
-/// settings of the assertion system.
-/// \param msg A <tt>const char*</tt> parameter, which can be used to provide
-/// information about the circumstances of the failed assertion.
+/// Macro for assertion with customizable message.  \param exp An
+/// expression that must be convertible to \c bool.  If it is \c
+/// false, then an assertion is raised. The concrete behaviour depends
+/// on the settings of the assertion system.  \param msg A <tt>const
+/// char*</tt> parameter, which can be used to provide information
+/// about the circumstances of the failed assertion.
 ///
 /// The assertions are enabled in the default behaviour.
@@ -128,10 +138,15 @@
 /// The checking is also disabled when the standard macro \c NDEBUG is defined.
 ///
-/// As a default behaviour the failed assertion prints a short log message to
-/// the standard error and aborts the execution.
-///
-/// However, the following modes can be used in the assertion system:
-/// - \c LEMON_ASSERT_ABORT The failed assertion prints a short log message to
-///   the standard error and aborts the program. It is the default behaviour.
+/// The LEMON assertion system has a wide range of customization
+/// properties. As a default behaviour the failed assertion prints a
+/// short log message to the standard error and aborts the execution.
+///
+/// The following modes can be used in the assertion system:
+///
+/// - \c LEMON_ASSERT_LOG The failed assertion prints a short log
+///   message to the standard error and continues the execution.
+/// - \c LEMON_ASSERT_ABORT This mode is similar to the \c
+///   LEMON_ASSERT_LOG, but it aborts the program. It is the default
+///   behaviour.
 /// - \c LEMON_ASSERT_CUSTOM The user can define own assertion handler
 ///   function.
@@ -161,4 +176,20 @@
 /// \ingroup exceptions
 ///
+/// \brief Macro for mark not yet implemented features.
+///
+/// Macro for mark not yet implemented features and outstanding bugs.
+/// It is close to be the shortcut of the following code:
+/// \code
+///   LEMON_ASSERT(false, msg);
+/// \endcode
+///
+/// \see LEMON_ASSERT
+#  define LEMON_FIXME(msg)                                              \
+  (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,        \
+                        ::lemon::_assert_bits::cstringify(msg),         \
+                        static_cast<const char*>(0)))
+
+/// \ingroup exceptions
+///
 /// \brief Macro for internal assertions
 ///
@@ -192,4 +223,5 @@
 #  ifndef LEMON_ASSERT_HANDLER
 #    define LEMON_ASSERT(exp, msg)  (static_cast<void>(0))
+#    define LEMON_FIXME(msg) (static_cast<void>(0))
 #    define LEMON_DEBUG(exp, msg) (static_cast<void>(0))
 #  else
@@ -200,4 +232,9 @@
                              ::lemon::_assert_bits::cstringify(msg),    \
                              #exp), 0)))
+#    define LEMON_FIXME(msg)                                            \
+       (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,   \
+                             ::lemon::_assert_bits::cstringify(msg),    \
+                             static_cast<const char*>(0)))
+
 #    if LEMON_ENABLE_DEBUG
 #      define LEMON_DEBUG(exp, msg)                                     \
Index: lemon/bfs.h
===================================================================
--- lemon/bfs.h	(revision 305)
+++ lemon/bfs.h	(revision 220)
@@ -22,5 +22,5 @@
 ///\ingroup search
 ///\file
-///\brief BFS algorithm.
+///\brief Bfs algorithm.
 
 #include <lemon/list_graph.h>
@@ -29,7 +29,8 @@
 #include <lemon/error.h>
 #include <lemon/maps.h>
-#include <lemon/path.h>
 
 namespace lemon {
+
+
 
   ///Default traits class of Bfs class.
@@ -40,71 +41,71 @@
   struct BfsDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
-
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the shortest paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef typename Digraph::template NodeMap<typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
-    }
-
+    ///This function instantiates a \ref PredMap.
+    ///\param G is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient to initialize
+    static PredMap *createPredMap(const GR &G)
+    {
+      return new PredMap(G);
+    }
     ///The type of the map that indicates which nodes are processed.
 
     ///The type of the map that indicates which nodes are processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \ref ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap
+    ///we would like to define the \ref ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
     ///The type of the map that indicates which nodes are reached.
 
     ///The type of the map that indicates which nodes are reached.
-    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
     ///Instantiates a ReachedMap.
 
-    ///This function instantiates a ReachedMap.
-    ///\param g is the digraph, to which
-    ///we would like to define the ReachedMap.
-    static ReachedMap *createReachedMap(const Digraph &g)
-    {
-      return new ReachedMap(g);
-    }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///This function instantiates a \ref ReachedMap.
+    ///\param G is the digraph, to which
+    ///we would like to define the \ref ReachedMap.
+    static ReachedMap *createReachedMap(const GR &G)
+    {
+      return new ReachedMap(G);
+    }
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///
     typedef typename Digraph::template NodeMap<int> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///DistMap.
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
+    ///This function instantiates a \ref DistMap.
+    ///\param G is the digraph, to which we would like to define
+    ///the \ref DistMap
+    static DistMap *createDistMap(const GR &G)
+    {
+      return new DistMap(G);
     }
   };
@@ -115,11 +116,7 @@
   ///This class provides an efficient implementation of the %BFS algorithm.
   ///
-  ///There is also a \ref bfs() "function-type interface" for the BFS
-  ///algorithm, which is convenient in the simplier cases and it can be
-  ///used easier.
-  ///
-  ///\tparam GR The type of the digraph the algorithm runs on.
-  ///The default value is \ref ListDigraph. The value of GR is not used
-  ///directly by \ref Bfs, it is only passed to \ref BfsDefaultTraits.
+  ///\tparam GR The digraph type the algorithm runs on. The default value is
+  ///\ref ListDigraph. The value of GR is not used directly by Bfs, it
+  ///is only passed to \ref BfsDefaultTraits.
   ///\tparam TR Traits class to set various data types used by the algorithm.
   ///The default traits class is
@@ -127,4 +124,5 @@
   ///See \ref BfsDefaultTraits for the documentation of
   ///a Bfs traits class.
+
 #ifdef DOXYGEN
   template <typename GR,
@@ -136,23 +134,30 @@
   class Bfs {
   public:
-
-    ///The type of the digraph the algorithm runs on.
+    /**
+     * \brief \ref Exception for uninitialized parameters.
+     *
+     * This error represents problems in the initialization
+     * of the parameters of the algorithms.
+     */
+    class UninitializedParameter : public lemon::UninitializedParameter {
+    public:
+      virtual const char* what() const throw() {
+        return "lemon::Bfs::UninitializedParameter";
+      }
+    };
+
+    typedef TR Traits;
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
 
-    ///\brief The type of the map that stores the predecessor arcs of the
-    ///shortest paths.
+    ///\brief The type of the map that stores the last
+    ///arcs of the shortest paths.
     typedef typename TR::PredMap PredMap;
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map indicating which nodes are reached.
+    typedef typename TR::ReachedMap ReachedMap;
+    ///The type of the map indicating which nodes are processed.
+    typedef typename TR::ProcessedMap ProcessedMap;
+    ///The type of the map that stores the dists of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///The type of the map that indicates which nodes are reached.
-    typedef typename TR::ReachedMap ReachedMap;
-    ///The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the paths.
-    typedef PredMapPath<Digraph, PredMap> Path;
-
-    ///The traits class.
-    typedef TR Traits;
-
   private:
 
@@ -162,21 +167,21 @@
     typedef typename Digraph::OutArcIt OutArcIt;
 
-    //Pointer to the underlying digraph.
+    /// Pointer to the underlying digraph.
     const Digraph *G;
-    //Pointer to the map of predecessor arcs.
+    ///Pointer to the map of predecessors arcs.
     PredMap *_pred;
-    //Indicates if _pred is locally allocated (true) or not.
+    ///Indicates if \ref _pred is locally allocated (\c true) or not.
     bool local_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     DistMap *_dist;
-    //Indicates if _dist is locally allocated (true) or not.
+    ///Indicates if \ref _dist is locally allocated (\c true) or not.
     bool local_dist;
-    //Pointer to the map of reached status of the nodes.
+    ///Pointer to the map of reached status of the nodes.
     ReachedMap *_reached;
-    //Indicates if _reached is locally allocated (true) or not.
+    ///Indicates if \ref _reached is locally allocated (\c true) or not.
     bool local_reached;
-    //Pointer to the map of processed status of the nodes.
+    ///Pointer to the map of processed status of the nodes.
     ProcessedMap *_processed;
-    //Indicates if _processed is locally allocated (true) or not.
+    ///Indicates if \ref _processed is locally allocated (\c true) or not.
     bool local_processed;
 
@@ -185,5 +190,7 @@
     int _curr_dist;
 
-    //Creates the maps if necessary.
+    ///Creates the maps if necessary.
+
+    ///\todo Better memory allocation (instead of new).
     void create_maps()
     {
@@ -219,96 +226,92 @@
 
     template <class T>
-    struct SetPredMapTraits : public Traits {
+    struct DefPredMapTraits : public Traits {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "PredMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
+    ///PredMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting PredMap type
+    ///
     template <class T>
-    struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
-      typedef Bfs< Digraph, SetPredMapTraits<T> > Create;
+    struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > {
+      typedef Bfs< Digraph, DefPredMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetDistMapTraits : public Traits {
+    struct DefDistMapTraits : public Traits {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "DistMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
+    ///DistMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting DistMap type
+    ///
     template <class T>
-    struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
-      typedef Bfs< Digraph, SetDistMapTraits<T> > Create;
+    struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > {
+      typedef Bfs< Digraph, DefDistMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetReachedMapTraits : public Traits {
+    struct DefReachedMapTraits : public Traits {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "ReachedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ReachedMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ReachedMap type.
+    ///ReachedMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting ReachedMap type
+    ///
     template <class T>
-    struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
-      typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;
+    struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > {
+      typedef Bfs< Digraph, DefReachedMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetProcessedMapTraits : public Traits {
+    struct DefProcessedMapTraits : public Traits {
       typedef T ProcessedMap;
       static ProcessedMap *createProcessedMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "ProcessedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
+    ///ProcessedMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting ProcessedMap type
+    ///
     template <class T>
-    struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
-      typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;
-    };
-
-    struct SetStandardProcessedMapTraits : public Traits {
+    struct DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits<T> > {
+      typedef Bfs< Digraph, DefProcessedMapTraits<T> > Create;
+    };
+
+    struct DefDigraphProcessedMapTraits : public Traits {
       typedef typename Digraph::template NodeMap<bool> ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &g)
+      static ProcessedMap *createProcessedMap(const Digraph &G)
       {
-        return new ProcessedMap(g);
-        return 0; // ignore warnings
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
+        return new ProcessedMap(G);
+      }
+    };
+    ///\brief \ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
+    ///
+    ///\ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
     ///If you don't set it explicitly, it will be automatically allocated.
-    struct SetStandardProcessedMap :
-      public Bfs< Digraph, SetStandardProcessedMapTraits > {
-      typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create;
+    template <class T>
+    struct DefProcessedMapToBeDefaultMap :
+      public Bfs< Digraph, DefDigraphProcessedMapTraits> {
+      typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create;
     };
 
@@ -319,8 +322,8 @@
     ///Constructor.
 
-    ///Constructor.
-    ///\param g The digraph the algorithm runs on.
-    Bfs(const Digraph &g) :
-      G(&g),
+    ///\param _G the digraph the algorithm will run on.
+    ///
+    Bfs(const Digraph& _G) :
+      G(&_G),
       _pred(NULL), local_pred(false),
       _dist(NULL), local_dist(false),
@@ -338,7 +341,7 @@
     }
 
-    ///Sets the map that stores the predecessor arcs.
-
-    ///Sets the map that stores the predecessor arcs.
+    ///Sets the map storing the predecessor arcs.
+
+    ///Sets the map storing the predecessor arcs.
     ///If you don't use this function before calling \ref run(),
     ///it will allocate one. The destructor deallocates this
@@ -355,7 +358,7 @@
     }
 
-    ///Sets the map that indicates which nodes are reached.
-
-    ///Sets the map that indicates which nodes are reached.
+    ///Sets the map indicating the reached nodes.
+
+    ///Sets the map indicating the reached nodes.
     ///If you don't use this function before calling \ref run(),
     ///it will allocate one. The destructor deallocates this
@@ -372,7 +375,7 @@
     }
 
-    ///Sets the map that indicates which nodes are processed.
-
-    ///Sets the map that indicates which nodes are processed.
+    ///Sets the map indicating the processed nodes.
+
+    ///Sets the map indicating the processed nodes.
     ///If you don't use this function before calling \ref run(),
     ///it will allocate one. The destructor deallocates this
@@ -389,8 +392,7 @@
     }
 
-    ///Sets the map that stores the distances of the nodes.
-
-    ///Sets the map that stores the distances of the nodes calculated by
-    ///the algorithm.
+    ///Sets the map storing the distances calculated by the algorithm.
+
+    ///Sets the map storing the distances calculated by the algorithm.
     ///If you don't use this function before calling \ref run(),
     ///it will allocate one. The destructor deallocates this
@@ -408,19 +410,18 @@
 
   public:
-
     ///\name Execution control
     ///The simplest way to execute the algorithm is to use
-    ///one of the member functions called \ref lemon::Bfs::run() "run()".
+    ///one of the member functions called \c run(...).
     ///\n
-    ///If you need more control on the execution, first you must call
-    ///\ref lemon::Bfs::init() "init()", then you can add several source
-    ///nodes with \ref lemon::Bfs::addSource() "addSource()".
-    ///Finally \ref lemon::Bfs::start() "start()" will perform the
-    ///actual path computation.
+    ///If you need more control on the execution,
+    ///first you must call \ref init(), then you can add several source nodes
+    ///with \ref addSource().
+    ///Finally \ref start() will perform the actual path
+    ///computation.
 
     ///@{
 
-    ///Initializes the internal data structures.
-
+    ///\brief Initializes the internal data structures.
+    ///
     ///Initializes the internal data structures.
     ///
@@ -460,5 +461,5 @@
     ///\return The processed node.
     ///
-    ///\pre The queue must not be empty.
+    ///\warning The queue must not be empty!
     Node processNextNode()
     {
@@ -482,15 +483,14 @@
     ///Processes the next node.
 
-    ///Processes the next node and checks if the given target node
+    ///Processes the next node. And checks that the given target node
     ///is reached. If the target node is reachable from the processed
-    ///node, then the \c reach parameter will be set to \c true.
+    ///node then the reached parameter will be set true. The reached
+    ///parameter should be initially false.
     ///
     ///\param target The target node.
-    ///\retval reach Indicates if the target node is reached.
-    ///It should be initially \c false.
-    ///
+    ///\retval reach Indicates that the target node is reached.
     ///\return The processed node.
     ///
-    ///\pre The queue must not be empty.
+    ///\warning The queue must not be empty!
     Node processNextNode(Node target, bool& reach)
     {
@@ -515,17 +515,14 @@
     ///Processes the next node.
 
-    ///Processes the next node and checks if at least one of reached
-    ///nodes has \c true value in the \c nm node map. If one node
-    ///with \c true value is reachable from the processed node, then the
-    ///\c rnode parameter will be set to the first of such nodes.
-    ///
-    ///\param nm A \c bool (or convertible) node map that indicates the
-    ///possible targets.
+    ///Processes the next node. And checks that at least one of
+    ///reached node has true value in the \c nm node map. If one node
+    ///with true value is reachable from the processed node then the
+    ///rnode parameter will be set to the first of such nodes.
+    ///
+    ///\param nm The node map of possible targets.
     ///\retval rnode The reached target node.
-    ///It should be initially \c INVALID.
-    ///
     ///\return The processed node.
     ///
-    ///\pre The queue must not be empty.
+    ///\warning The queue must not be empty!
     template<class NM>
     Node processNextNode(const NM& nm, Node& rnode)
@@ -549,9 +546,11 @@
     }
 
-    ///The next node to be processed.
-
-    ///Returns the next node to be processed or \c INVALID if the queue
-    ///is empty.
-    Node nextNode() const
+    ///Next node to be processed.
+
+    ///Next node to be processed.
+    ///
+    ///\return The next node to be processed or INVALID if the queue is
+    /// empty.
+    Node nextNode()
     {
       return _queue_tail<_queue_head?_queue[_queue_tail]:INVALID;
@@ -559,14 +558,13 @@
 
     ///\brief Returns \c false if there are nodes
-    ///to be processed.
+    ///to be processed in the queue
     ///
     ///Returns \c false if there are nodes
-    ///to be processed in the queue.
-    bool emptyQueue() const { return _queue_tail==_queue_head; }
-
+    ///to be processed in the queue
+    bool emptyQueue() { return _queue_tail==_queue_head; }
     ///Returns the number of the nodes to be processed.
 
     ///Returns the number of the nodes to be processed in the queue.
-    int queueSize() const { return _queue_head-_queue_tail; }
+    int queueSize() { return _queue_head-_queue_tail; }
 
     ///Executes the algorithm.
@@ -574,50 +572,34 @@
     ///Executes the algorithm.
     ///
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
     ///This method runs the %BFS algorithm from the root node(s)
-    ///in order to compute the shortest path to each node.
-    ///
+    ///in order to
+    ///compute the
+    ///shortest path to each node. The algorithm computes
+    ///- The shortest path tree.
+    ///- The distance of each node from the root(s).
+    void start()
+    {
+      while ( !emptyQueue() ) processNextNode();
+    }
+
+    ///Executes the algorithm until \c dest is reached.
+
+    ///Executes the algorithm until \c dest is reached.
+    ///
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///This method runs the %BFS algorithm from the root node(s)
+    ///in order to compute the shortest path to \c dest.
     ///The algorithm computes
-    ///- the shortest path tree (forest),
-    ///- the distance of each node from the root(s).
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\note <tt>b.start()</tt> is just a shortcut of the following code.
-    ///\code
-    ///  while ( !b.emptyQueue() ) {
-    ///    b.processNextNode();
-    ///  }
-    ///\endcode
-    void start()
-    {
-      while ( !emptyQueue() ) processNextNode();
-    }
-
-    ///Executes the algorithm until the given target node is reached.
-
-    ///Executes the algorithm until the given target node is reached.
-    ///
-    ///This method runs the %BFS algorithm from the root node(s)
-    ///in order to compute the shortest path to \c t.
-    ///
-    ///The algorithm computes
-    ///- the shortest path to \c t,
-    ///- the distance of \c t from the root(s).
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\note <tt>b.start(t)</tt> is just a shortcut of the following code.
-    ///\code
-    ///  bool reach = false;
-    ///  while ( !b.emptyQueue() && !reach ) {
-    ///    b.processNextNode(t, reach);
-    ///  }
-    ///\endcode
-    void start(Node t)
+    ///- The shortest path to \c  dest.
+    ///- The distance of \c dest from the root(s).
+    void start(Node dest)
     {
       bool reach = false;
-      while ( !emptyQueue() && !reach ) processNextNode(t, reach);
+      while ( !emptyQueue() && !reach ) processNextNode(dest, reach);
     }
 
@@ -626,27 +608,15 @@
     ///Executes the algorithm until a condition is met.
     ///
-    ///This method runs the %BFS algorithm from the root node(s) in
-    ///order to compute the shortest path to a node \c v with
-    /// <tt>nm[v]</tt> true, if such a node can be found.
-    ///
-    ///\param nm A \c bool (or convertible) node map. The algorithm
-    ///will stop when it reaches a node \c v with <tt>nm[v]</tt> true.
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///\param nm must be a bool (or convertible) node map. The
+    ///algorithm will stop when it reaches a node \c v with
+    /// <tt>nm[v]</tt> true.
     ///
     ///\return The reached node \c v with <tt>nm[v]</tt> true or
     ///\c INVALID if no such node was found.
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\note <tt>b.start(nm)</tt> is just a shortcut of the following code.
-    ///\code
-    ///  Node rnode = INVALID;
-    ///  while ( !b.emptyQueue() && rnode == INVALID ) {
-    ///    b.processNextNode(nm, rnode);
-    ///  }
-    ///  return rnode;
-    ///\endcode
-    template<class NodeBoolMap>
-    Node start(const NodeBoolMap &nm)
+    template<class NM>
+    Node start(const NM &nm)
     {
       Node rnode = INVALID;
@@ -657,14 +627,14 @@
     }
 
-    ///Runs the algorithm from the given source node.
-
-    ///This method runs the %BFS algorithm from node \c s
-    ///in order to compute the shortest path to each node.
-    ///
-    ///The algorithm computes
-    ///- the shortest path tree,
-    ///- the distance of each node from the root.
-    ///
-    ///\note <tt>b.run(s)</tt> is just a shortcut of the following code.
+    ///Runs %BFS algorithm from node \c s.
+
+    ///This method runs the %BFS algorithm from a root node \c s
+    ///in order to
+    ///compute the
+    ///shortest path to each node. The algorithm computes
+    ///- The shortest path tree.
+    ///- The distance of each node from the root.
+    ///
+    ///\note b.run(s) is just a shortcut of the following code.
     ///\code
     ///  b.init();
@@ -680,12 +650,10 @@
     ///Finds the shortest path between \c s and \c t.
 
-    ///This method runs the %BFS algorithm from node \c s
-    ///in order to compute the shortest path to node \c t
-    ///(it stops searching when \c t is processed).
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    ///
-    ///\note Apart from the return value, <tt>b.run(s,t)</tt> is just a
-    ///shortcut of the following code.
+    ///Finds the shortest path between \c s and \c t.
+    ///
+    ///\return The length of the shortest s---t path if there exists one,
+    ///0 otherwise.
+    ///\note Apart from the return value, b.run(s) is
+    ///just a shortcut of the following code.
     ///\code
     ///  b.init();
@@ -693,38 +661,9 @@
     ///  b.start(t);
     ///\endcode
-    bool run(Node s,Node t) {
+    int run(Node s,Node t) {
       init();
       addSource(s);
       start(t);
-      return reached(t);
-    }
-
-    ///Runs the algorithm to visit all nodes in the digraph.
-
-    ///This method runs the %BFS algorithm in order to
-    ///compute the shortest path to each node.
-    ///
-    ///The algorithm computes
-    ///- the shortest path tree (forest),
-    ///- the distance of each node from the root(s).
-    ///
-    ///\note <tt>b.run(s)</tt> is just a shortcut of the following code.
-    ///\code
-    ///  b.init();
-    ///  for (NodeIt n(gr); n != INVALID; ++n) {
-    ///    if (!b.reached(n)) {
-    ///      b.addSource(n);
-    ///      b.start();
-    ///    }
-    ///  }
-    ///\endcode
-    void run() {
-      init();
-      for (NodeIt n(*G); n != INVALID; ++n) {
-        if (!reached(n)) {
-          addSource(n);
-          start();
-        }
-      }
+      return reached(t) ? _curr_dist : 0;
     }
 
@@ -734,54 +673,51 @@
     ///The result of the %BFS algorithm can be obtained using these
     ///functions.\n
-    ///Either \ref lemon::Bfs::run() "run()" or \ref lemon::Bfs::start()
-    ///"start()" must be called before using them.
+    ///Before the use of these functions,
+    ///either run() or start() must be calleb.
 
     ///@{
 
-    ///The shortest path to a node.
-
-    ///Returns the shortest path to a node.
-    ///
-    ///\warning \c t should be reachable from the root(s).
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
-    Path path(Node t) const { return Path(*G, *_pred, t); }
+    typedef PredMapPath<Digraph, PredMap> Path;
+
+    ///Gives back the shortest path.
+
+    ///Gives back the shortest path.
+    ///\pre The \c t should be reachable from the source.
+    Path path(Node t)
+    {
+      return Path(*G, *_pred, t);
+    }
 
     ///The distance of a node from the root(s).
 
     ///Returns the distance of a node from the root(s).
-    ///
-    ///\warning If node \c v is not reachable from the root(s), then
-    ///the return value of this function is undefined.
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
+    ///\pre \ref run() must be called before using this function.
+    ///\warning If node \c v in unreachable from the root(s) the return value
+    ///of this function is undefined.
     int dist(Node v) const { return (*_dist)[v]; }
 
-    ///Returns the 'previous arc' of the shortest path tree for a node.
-
-    ///This function returns the 'previous arc' of the shortest path
-    ///tree for the node \c v, i.e. it returns the last arc of a
-    ///shortest path from the root(s) to \c v. It is \c INVALID if \c v
-    ///is not reachable from the root(s) or if \c v is a root.
-    ///
-    ///The shortest path tree used here is equal to the shortest path
-    ///tree used in \ref predNode().
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
+    ///Returns the 'previous arc' of the shortest path tree.
+
+    ///For a node \c v it returns the 'previous arc'
+    ///of the shortest path tree,
+    ///i.e. it returns the last arc of a shortest path from the root(s) to \c
+    ///v. It is \ref INVALID
+    ///if \c v is unreachable from the root(s) or \c v is a root. The
+    ///shortest path tree used here is equal to the shortest path tree used in
+    ///\ref predNode().
+    ///\pre Either \ref run() or \ref start() must be called before using
+    ///this function.
     Arc predArc(Node v) const { return (*_pred)[v];}
 
-    ///Returns the 'previous node' of the shortest path tree for a node.
-
-    ///This function returns the 'previous node' of the shortest path
-    ///tree for the node \c v, i.e. it returns the last but one node
-    ///from a shortest path from the root(s) to \c v. It is \c INVALID
-    ///if \c v is not reachable from the root(s) or if \c v is a root.
-    ///
+    ///Returns the 'previous node' of the shortest path tree.
+
+    ///For a node \c v it returns the 'previous node'
+    ///of the shortest path tree,
+    ///i.e. it returns the last but one node from a shortest path from the
+    ///root(a) to \c /v.
+    ///It is INVALID if \c v is unreachable from the root(s) or
+    ///if \c v itself a root.
     ///The shortest path tree used here is equal to the shortest path
     ///tree used in \ref predArc().
-    ///
     ///\pre Either \ref run() or \ref start() must be called before
     ///using this function.
@@ -789,59 +725,60 @@
                                   G->source((*_pred)[v]); }
 
-    ///\brief Returns a const reference to the node map that stores the
-    /// distances of the nodes.
-    ///
-    ///Returns a const reference to the node map that stores the distances
-    ///of the nodes calculated by the algorithm.
-    ///
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function.
+    ///Returns a reference to the NodeMap of distances.
+
+    ///Returns a reference to the NodeMap of distances.
+    ///\pre Either \ref run() or \ref init() must
+    ///be called before using this function.
     const DistMap &distMap() const { return *_dist;}
 
-    ///\brief Returns a const reference to the node map that stores the
-    ///predecessor arcs.
-    ///
-    ///Returns a const reference to the node map that stores the predecessor
-    ///arcs, which form the shortest path tree.
-    ///
+    ///Returns a reference to the shortest path tree map.
+
+    ///Returns a reference to the NodeMap of the arcs of the
+    ///shortest path tree.
     ///\pre Either \ref run() or \ref init()
     ///must be called before using this function.
     const PredMap &predMap() const { return *_pred;}
 
-    ///Checks if a node is reachable from the root(s).
-
-    ///Returns \c true if \c v is reachable from the root(s).
+    ///Checks if a node is reachable from the root.
+
+    ///Returns \c true if \c v is reachable from the root.
+    ///\warning The source nodes are indicated as unreached.
     ///\pre Either \ref run() or \ref start()
     ///must be called before using this function.
-    bool reached(Node v) const { return (*_reached)[v]; }
+    ///
+    bool reached(Node v) { return (*_reached)[v]; }
 
     ///@}
   };
 
-  ///Default traits class of bfs() function.
-
-  ///Default traits class of bfs() function.
+  ///Default traits class of Bfs function.
+
+  ///Default traits class of Bfs function.
   ///\tparam GR Digraph type.
   template<class GR>
   struct BfsWizardDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
-
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the shortest paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef NullMap<typename Digraph::Node,typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
+    ///This function instantiates a \ref PredMap.
+    ///\param g is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient to initialize
+#ifdef DOXYGEN
+    static PredMap *createPredMap(const GR &g)
+#else
+    static PredMap *createPredMap(const GR &)
+#endif
+    {
+      return new PredMap();
     }
 
@@ -850,63 +787,61 @@
     ///The type of the map that indicates which nodes are processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    ///By default it is a NullMap.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \ref ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap.
+    ///we would like to define the \ref ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
     ///The type of the map that indicates which nodes are reached.
 
     ///The type of the map that indicates which nodes are reached.
-    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
     ///Instantiates a ReachedMap.
 
-    ///This function instantiates a ReachedMap.
-    ///\param g is the digraph, to which
-    ///we would like to define the ReachedMap.
-    static ReachedMap *createReachedMap(const Digraph &g)
-    {
-      return new ReachedMap(g);
-    }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///This function instantiates a \ref ReachedMap.
+    ///\param G is the digraph, to which
+    ///we would like to define the \ref ReachedMap.
+    static ReachedMap *createReachedMap(const GR &G)
+    {
+      return new ReachedMap(G);
+    }
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<int> DistMap;
+    ///
+    typedef NullMap<typename Digraph::Node,int> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
+    ///This function instantiates a \ref DistMap.
     ///\param g is the digraph, to which we would like to define
-    ///the DistMap
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
-    }
-
-    ///The type of the shortest paths.
-
-    ///The type of the shortest paths.
-    ///It must meet the \ref concepts::Path "Path" concept.
-    typedef lemon::Path<Digraph> Path;
+    ///the \ref DistMap
+#ifdef DOXYGEN
+    static DistMap *createDistMap(const GR &g)
+#else
+    static DistMap *createDistMap(const GR &)
+#endif
+    {
+      return new DistMap();
+    }
   };
 
-  /// Default traits class used by BfsWizard
+  /// Default traits used by \ref BfsWizard
 
   /// To make it easier to use Bfs algorithm
-  /// we have created a wizard class.
+  ///we have created a wizard class.
   /// This \ref BfsWizard class needs default traits,
-  /// as well as the \ref Bfs class.
+  ///as well as the \ref Bfs class.
   /// The \ref BfsWizardBase is a class to be the default traits of the
   /// \ref BfsWizard class.
@@ -917,21 +852,19 @@
     typedef BfsWizardDefaultTraits<GR> Base;
   protected:
-    //The type of the nodes in the digraph.
+    /// Type of the nodes in the digraph.
     typedef typename Base::Digraph::Node Node;
 
-    //Pointer to the digraph the algorithm runs on.
+    /// Pointer to the underlying digraph.
     void *_g;
-    //Pointer to the map of reached nodes.
+    ///Pointer to the map of reached nodes.
     void *_reached;
-    //Pointer to the map of processed nodes.
+    ///Pointer to the map of processed nodes.
     void *_processed;
-    //Pointer to the map of predecessors arcs.
+    ///Pointer to the map of predecessors arcs.
     void *_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     void *_dist;
-    //Pointer to the shortest path to the target node.
-    void *_path;
-    //Pointer to the distance of the target node.
-    int *_di;
+    ///Pointer to the source node.
+    Node _source;
 
     public:
@@ -939,28 +872,40 @@
 
     /// This constructor does not require parameters, therefore it initiates
-    /// all of the attributes to \c 0.
+    /// all of the attributes to default values (0, INVALID).
     BfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
-                      _dist(0), _path(0), _di(0) {}
+                           _dist(0), _source(INVALID) {}
 
     /// Constructor.
 
-    /// This constructor requires one parameter,
-    /// others are initiated to \c 0.
-    /// \param g The digraph the algorithm runs on.
-    BfsWizardBase(const GR &g) :
+    /// This constructor requires some parameters,
+    /// listed in the parameters list.
+    /// Others are initiated to 0.
+    /// \param g is the initial value of  \ref _g
+    /// \param s is the initial value of  \ref _source
+    BfsWizardBase(const GR &g, Node s=INVALID) :
       _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
-      _reached(0), _processed(0), _pred(0), _dist(0),  _path(0), _di(0) {}
+      _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {}
 
   };
 
-  /// Auxiliary class for the function-type interface of BFS algorithm.
-
-  /// This auxiliary class is created to implement the
-  /// \ref bfs() "function-type interface" of \ref Bfs algorithm.
-  /// It does not have own \ref run() method, it uses the functions
-  /// and features of the plain \ref Bfs.
+  /// A class to make the usage of Bfs algorithm easier
+
+  /// This class is created to make it easier to use Bfs algorithm.
+  /// It uses the functions and features of the plain \ref Bfs,
+  /// but it is much simpler to use it.
   ///
-  /// This class should only be used through the \ref bfs() function,
-  /// which makes it easier to use the algorithm.
+  /// Simplicity means that the way to change the types defined
+  /// in the traits class is based on functions that returns the new class
+  /// and not on templatable built-in classes.
+  /// When using the plain \ref Bfs
+  /// the new class with the modified type comes from
+  /// the original class by using the ::
+  /// operator. In the case of \ref BfsWizard only
+  /// a function have to be called and it will
+  /// return the needed class.
+  ///
+  /// It does not have own \ref run method. When its \ref run method is called
+  /// it initiates a plain \ref Bfs class, and calls the \ref Bfs::run
+  /// method of it.
   template<class TR>
   class BfsWizard : public TR
@@ -968,26 +913,28 @@
     typedef TR Base;
 
-    ///The type of the digraph the algorithm runs on.
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
-
+    //\e
     typedef typename Digraph::Node Node;
+    //\e
     typedef typename Digraph::NodeIt NodeIt;
+    //\e
     typedef typename Digraph::Arc Arc;
+    //\e
     typedef typename Digraph::OutArcIt OutArcIt;
 
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores
+    ///the reached nodes
+    typedef typename TR::ReachedMap ReachedMap;
+    ///\brief The type of the map that stores
+    ///the processed nodes
+    typedef typename TR::ProcessedMap ProcessedMap;
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     typedef typename TR::PredMap PredMap;
-    ///\brief The type of the map that stores the distances of the nodes.
+    ///The type of the map that stores the dists of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///\brief The type of the map that indicates which nodes are reached.
-    typedef typename TR::ReachedMap ReachedMap;
-    ///\brief The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the shortest paths
-    typedef typename TR::Path Path;
 
   public:
-
     /// Constructor.
     BfsWizard() : TR() {}
@@ -997,7 +944,6 @@
     /// Constructor that requires parameters.
     /// These parameters will be the default values for the traits class.
-    /// \param g The digraph the algorithm runs on.
-    BfsWizard(const Digraph &g) :
-      TR(g) {}
+    BfsWizard(const Digraph &g, Node s=INVALID) :
+      TR(g,s) {}
 
     ///Copy constructor
@@ -1006,157 +952,123 @@
     ~BfsWizard() {}
 
-    ///Runs BFS algorithm from the given source node.
-
-    ///This method runs BFS algorithm from node \c s
-    ///in order to compute the shortest path to each node.
+    ///Runs Bfs algorithm from a given node.
+
+    ///Runs Bfs algorithm from a given node.
+    ///The node can be given by the \ref source function.
+    void run()
+    {
+      if(Base::_source==INVALID) throw UninitializedParameter();
+      Bfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
+      if(Base::_reached)
+        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
+      if(Base::_processed)
+        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
+      if(Base::_pred)
+        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
+      if(Base::_dist)
+        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
+      alg.run(Base::_source);
+    }
+
+    ///Runs Bfs algorithm from the given node.
+
+    ///Runs Bfs algorithm from the given node.
+    ///\param s is the given source.
     void run(Node s)
     {
-      Bfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
-      if (Base::_pred)
-        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_reached)
-        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
-      if (Base::_processed)
-        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      if (s!=INVALID)
-        alg.run(s);
-      else
-        alg.run();
-    }
-
-    ///Finds the shortest path between \c s and \c t.
-
-    ///This method runs BFS algorithm from node \c s
-    ///in order to compute the shortest path to node \c t
-    ///(it stops searching when \c t is processed).
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    bool run(Node s, Node t)
-    {
-      Bfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
-      if (Base::_pred)
-        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_reached)
-        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
-      if (Base::_processed)
-        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      alg.run(s,t);
-      if (Base::_path)
-        *reinterpret_cast<Path*>(Base::_path) = alg.path(t);
-      if (Base::_di)
-        *Base::_di = alg.dist(t);
-      return alg.reached(t);
-    }
-
-    ///Runs BFS algorithm to visit all nodes in the digraph.
-
-    ///This method runs BFS algorithm in order to compute
-    ///the shortest path to each node.
-    void run()
-    {
-      run(INVALID);
+      Base::_source=s;
+      run();
     }
 
     template<class T>
-    struct SetPredMapBase : public Base {
+    struct DefPredMapBase : public Base {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &) { return 0; };
-      SetPredMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting PredMap object.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for setting PredMap object.
+      DefPredMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting PredMap
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting PredMap
+    ///
     template<class T>
-    BfsWizard<SetPredMapBase<T> > predMap(const T &t)
+    BfsWizard<DefPredMapBase<T> > predMap(const T &t)
     {
       Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return BfsWizard<SetPredMapBase<T> >(*this);
-    }
+      return BfsWizard<DefPredMapBase<T> >(*this);
+    }
+
 
     template<class T>
-    struct SetReachedMapBase : public Base {
+    struct DefReachedMapBase : public Base {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &) { return 0; };
-      SetReachedMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting ReachedMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting ReachedMap object.
+      DefReachedMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting ReachedMap
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting ReachedMap
+    ///
     template<class T>
-    BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
+    BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
     {
       Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return BfsWizard<SetReachedMapBase<T> >(*this);
-    }
+      return BfsWizard<DefReachedMapBase<T> >(*this);
+    }
+
 
     template<class T>
-    struct SetDistMapBase : public Base {
+    struct DefProcessedMapBase : public Base {
+      typedef T ProcessedMap;
+      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
+      DefProcessedMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting ProcessedMap
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting ProcessedMap
+    ///
+    template<class T>
+    BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
+    {
+      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
+      return BfsWizard<DefProcessedMapBase<T> >(*this);
+    }
+
+
+    template<class T>
+    struct DefDistMapBase : public Base {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &) { return 0; };
-      SetDistMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting DistMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting DistMap object.
+      DefDistMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
     template<class T>
-    BfsWizard<SetDistMapBase<T> > distMap(const T &t)
+    BfsWizard<DefDistMapBase<T> > distMap(const T &t)
     {
       Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return BfsWizard<SetDistMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetProcessedMapBase : public Base {
-      typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
-      SetProcessedMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    template<class T>
-    BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
-    {
-      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return BfsWizard<SetProcessedMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetPathBase : public Base {
-      typedef T Path;
-      SetPathBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the shortest path to the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the shortest path to the target node.
-    template<class T>
-    BfsWizard<SetPathBase<T> > path(const T &t)
-    {
-      Base::_path=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return BfsWizard<SetPathBase<T> >(*this);
-    }
-
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    BfsWizard dist(const int &d)
-    {
-      Base::_di=const_cast<int*>(&d);
+      return BfsWizard<DefDistMapBase<T> >(*this);
+    }
+
+    /// Sets the source node, from which the Bfs algorithm runs.
+
+    /// Sets the source node, from which the Bfs algorithm runs.
+    /// \param s is the source node.
+    BfsWizard<TR> &source(Node s)
+    {
+      Base::_source=s;
       return *this;
     }
@@ -1164,18 +1076,16 @@
   };
 
-  ///Function-type interface for BFS algorithm.
+  ///Function type interface for Bfs algorithm.
 
   /// \ingroup search
-  ///Function-type interface for BFS algorithm.
+  ///Function type interface for Bfs algorithm.
   ///
-  ///This function also has several \ref named-func-param "named parameters",
+  ///This function also has several
+  ///\ref named-templ-func-param "named parameters",
   ///they are declared as the members of class \ref BfsWizard.
-  ///The following examples show how to use these parameters.
+  ///The following
+  ///example shows how to use these parameters.
   ///\code
-  ///  // Compute shortest path from node s to each node
-  ///  bfs(g).predMap(preds).distMap(dists).run(s);
-  ///
-  ///  // Compute shortest path from s to t
-  ///  bool reached = bfs(g).path(p).dist(d).run(s,t);
+  ///  bfs(g,source).predMap(preds).run();
   ///\endcode
   ///\warning Don't forget to put the \ref BfsWizard::run() "run()"
@@ -1185,14 +1095,14 @@
   template<class GR>
   BfsWizard<BfsWizardBase<GR> >
-  bfs(const GR &digraph)
+  bfs(const GR &g,typename GR::Node s=INVALID)
   {
-    return BfsWizard<BfsWizardBase<GR> >(digraph);
+    return BfsWizard<BfsWizardBase<GR> >(g,s);
   }
 
 #ifdef DOXYGEN
-  /// \brief Visitor class for BFS.
+  /// \brief Visitor class for bfs.
   ///
   /// This class defines the interface of the BfsVisit events, and
-  /// it could be the base of a real visitor class.
+  /// it could be the base of a real Visitor class.
   template <typename _Digraph>
   struct BfsVisitor {
@@ -1200,27 +1110,27 @@
     typedef typename Digraph::Arc Arc;
     typedef typename Digraph::Node Node;
-    /// \brief Called for the source node(s) of the BFS.
-    ///
-    /// This function is called for the source node(s) of the BFS.
-    void start(const Node& node) {}
-    /// \brief Called when a node is reached first time.
-    ///
-    /// This function is called when a node is reached first time.
+    /// \brief Called when the arc reach a node.
+    ///
+    /// It is called when the bfs find an arc which target is not
+    /// reached yet.
+    void discover(const Arc& arc) {}
+    /// \brief Called when the node reached first time.
+    ///
+    /// It is Called when the node reached first time.
     void reach(const Node& node) {}
-    /// \brief Called when a node is processed.
-    ///
-    /// This function is called when a node is processed.
-    void process(const Node& node) {}
-    /// \brief Called when an arc reaches a new node.
-    ///
-    /// This function is called when the BFS finds an arc whose target node
-    /// is not reached yet.
-    void discover(const Arc& arc) {}
-    /// \brief Called when an arc is examined but its target node is
+    /// \brief Called when the arc examined but target of the arc
     /// already discovered.
     ///
-    /// This function is called when an arc is examined but its target node is
+    /// It called when the arc examined but the target of the arc
     /// already discovered.
     void examine(const Arc& arc) {}
+    /// \brief Called for the source node of the bfs.
+    ///
+    /// It is called for the source node of the bfs.
+    void start(const Node& node) {}
+    /// \brief Called when the node processed.
+    ///
+    /// It is Called when the node processed.
+    void process(const Node& node) {}
   };
 #else
@@ -1230,9 +1140,9 @@
     typedef typename Digraph::Arc Arc;
     typedef typename Digraph::Node Node;
+    void discover(const Arc&) {}
+    void reach(const Node&) {}
+    void examine(const Arc&) {}
     void start(const Node&) {}
-    void reach(const Node&) {}
     void process(const Node&) {}
-    void discover(const Arc&) {}
-    void examine(const Arc&) {}
 
     template <typename _Visitor>
@@ -1241,9 +1151,9 @@
         Arc arc;
         Node node;
+        visitor.discover(arc);
+        visitor.reach(node);
+        visitor.examine(arc);
         visitor.start(node);
-        visitor.reach(node);
         visitor.process(node);
-        visitor.discover(arc);
-        visitor.examine(arc);
       }
       _Visitor& visitor;
@@ -1255,9 +1165,9 @@
   ///
   /// Default traits class of BfsVisit class.
-  /// \tparam _Digraph The type of the digraph the algorithm runs on.
+  /// \tparam _Digraph Digraph type.
   template<class _Digraph>
   struct BfsVisitDefaultTraits {
 
-    /// \brief The type of the digraph the algorithm runs on.
+    /// \brief The digraph type the algorithm runs on.
     typedef _Digraph Digraph;
 
@@ -1265,12 +1175,13 @@
     ///
     /// The type of the map that indicates which nodes are reached.
-    /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    /// It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    /// \todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
 
     /// \brief Instantiates a ReachedMap.
     ///
-    /// This function instantiates a ReachedMap.
+    /// This function instantiates a \ref ReachedMap.
     /// \param digraph is the digraph, to which
-    /// we would like to define the ReachedMap.
+    /// we would like to define the \ref ReachedMap.
     static ReachedMap *createReachedMap(const Digraph &digraph) {
       return new ReachedMap(digraph);
@@ -1281,5 +1192,5 @@
   /// \ingroup search
   ///
-  /// \brief %BFS algorithm class with visitor interface.
+  /// \brief %BFS Visit algorithm class.
   ///
   /// This class provides an efficient implementation of the %BFS algorithm
@@ -1288,24 +1199,19 @@
   /// The %BfsVisit class provides an alternative interface to the Bfs
   /// class. It works with callback mechanism, the BfsVisit object calls
-  /// the member functions of the \c Visitor class on every BFS event.
+  /// on every bfs event the \c Visitor class member functions.
   ///
-  /// This interface of the BFS algorithm should be used in special cases
-  /// when extra actions have to be performed in connection with certain
-  /// events of the BFS algorithm. Otherwise consider to use Bfs or bfs()
-  /// instead.
-  ///
-  /// \tparam _Digraph The type of the digraph the algorithm runs on.
+  /// \tparam _Digraph The digraph type the algorithm runs on.
   /// The default value is
-  /// \ref ListDigraph. The value of _Digraph is not used directly by
-  /// \ref BfsVisit, it is only passed to \ref BfsVisitDefaultTraits.
-  /// \tparam _Visitor The Visitor type that is used by the algorithm.
-  /// \ref BfsVisitor "BfsVisitor<_Digraph>" is an empty visitor, which
-  /// does not observe the BFS events. If you want to observe the BFS
-  /// events, you should implement your own visitor class.
+  /// \ref ListDigraph. The value of _Digraph is not used directly by Bfs, it
+  /// is only passed to \ref BfsDefaultTraits.
+  /// \tparam _Visitor The Visitor object for the algorithm. The
+  /// \ref BfsVisitor "BfsVisitor<_Digraph>" is an empty Visitor which
+  /// does not observe the Bfs events. If you want to observe the bfs
+  /// events you should implement your own Visitor class.
   /// \tparam _Traits Traits class to set various data types used by the
   /// algorithm. The default traits class is
   /// \ref BfsVisitDefaultTraits "BfsVisitDefaultTraits<_Digraph>".
   /// See \ref BfsVisitDefaultTraits for the documentation of
-  /// a BFS visit traits class.
+  /// a Bfs visit traits class.
 #ifdef DOXYGEN
   template <typename _Digraph, typename _Visitor, typename _Traits>
@@ -1313,19 +1219,28 @@
   template <typename _Digraph = ListDigraph,
             typename _Visitor = BfsVisitor<_Digraph>,
-            typename _Traits = BfsVisitDefaultTraits<_Digraph> >
+            typename _Traits = BfsDefaultTraits<_Digraph> >
 #endif
   class BfsVisit {
   public:
 
-    ///The traits class.
+    /// \brief \ref Exception for uninitialized parameters.
+    ///
+    /// This error represents problems in the initialization
+    /// of the parameters of the algorithms.
+    class UninitializedParameter : public lemon::UninitializedParameter {
+    public:
+      virtual const char* what() const throw()
+      {
+        return "lemon::BfsVisit::UninitializedParameter";
+      }
+    };
+
     typedef _Traits Traits;
 
-    ///The type of the digraph the algorithm runs on.
     typedef typename Traits::Digraph Digraph;
 
-    ///The visitor type used by the algorithm.
     typedef _Visitor Visitor;
 
-    ///The type of the map that indicates which nodes are reached.
+    ///The type of the map indicating which nodes are reached.
     typedef typename Traits::ReachedMap ReachedMap;
 
@@ -1337,11 +1252,11 @@
     typedef typename Digraph::OutArcIt OutArcIt;
 
-    //Pointer to the underlying digraph.
+    /// Pointer to the underlying digraph.
     const Digraph *_digraph;
-    //Pointer to the visitor object.
+    /// Pointer to the visitor object.
     Visitor *_visitor;
-    //Pointer to the map of reached status of the nodes.
+    ///Pointer to the map of reached status of the nodes.
     ReachedMap *_reached;
-    //Indicates if _reached is locally allocated (true) or not.
+    ///Indicates if \ref _reached is locally allocated (\c true) or not.
     bool local_reached;
 
@@ -1349,5 +1264,7 @@
     int _list_front, _list_back;
 
-    //Creates the maps if necessary.
+    /// \brief Creates the maps if necessary.
+    ///
+    /// Creates the maps if necessary.
     void create_maps() {
       if(!_reached) {
@@ -1369,19 +1286,18 @@
     ///@{
     template <class T>
-    struct SetReachedMapTraits : public Traits {
+    struct DefReachedMapTraits : public Traits {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &digraph) {
-        LEMON_ASSERT(false, "ReachedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     /// \brief \ref named-templ-param "Named parameter" for setting
-    /// ReachedMap type.
-    ///
-    /// \ref named-templ-param "Named parameter" for setting ReachedMap type.
+    /// ReachedMap type
+    ///
+    /// \ref named-templ-param "Named parameter" for setting ReachedMap type
     template <class T>
-    struct SetReachedMap : public BfsVisit< Digraph, Visitor,
-                                            SetReachedMapTraits<T> > {
-      typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create;
+    struct DefReachedMap : public BfsVisit< Digraph, Visitor,
+                                            DefReachedMapTraits<T> > {
+      typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
     };
     ///@}
@@ -1393,6 +1309,7 @@
     /// Constructor.
     ///
-    /// \param digraph The digraph the algorithm runs on.
-    /// \param visitor The visitor object of the algorithm.
+    /// \param digraph the digraph the algorithm will run on.
+    /// \param visitor The visitor of the algorithm.
+    ///
     BfsVisit(const Digraph& digraph, Visitor& visitor)
       : _digraph(&digraph), _visitor(&visitor),
@@ -1400,13 +1317,15 @@
 
     /// \brief Destructor.
+    ///
+    /// Destructor.
     ~BfsVisit() {
       if(local_reached) delete _reached;
     }
 
-    /// \brief Sets the map that indicates which nodes are reached.
-    ///
-    /// Sets the map that indicates which nodes are reached.
+    /// \brief Sets the map indicating if a node is reached.
+    ///
+    /// Sets the map indicating if a node is reached.
     /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destructor deallocates this
+    /// it will allocate one. The destuctor deallocates this
     /// automatically allocated map, of course.
     /// \return <tt> (*this) </tt>
@@ -1421,21 +1340,19 @@
 
   public:
-
     /// \name Execution control
     /// The simplest way to execute the algorithm is to use
-    /// one of the member functions called \ref lemon::BfsVisit::run()
-    /// "run()".
+    /// one of the member functions called \c run(...).
     /// \n
-    /// If you need more control on the execution, first you must call
-    /// \ref lemon::BfsVisit::init() "init()", then you can add several
-    /// source nodes with \ref lemon::BfsVisit::addSource() "addSource()".
-    /// Finally \ref lemon::BfsVisit::start() "start()" will perform the
-    /// actual path computation.
+    /// If you need more control on the execution,
+    /// first you must call \ref init(), then you can adda source node
+    /// with \ref addSource().
+    /// Finally \ref start() will perform the actual path
+    /// computation.
 
     /// @{
-
     /// \brief Initializes the internal data structures.
     ///
     /// Initializes the internal data structures.
+    ///
     void init() {
       create_maps();
@@ -1465,5 +1382,5 @@
     /// \return The processed node.
     ///
-    /// \pre The queue must not be empty.
+    /// \pre The queue must not be empty!
     Node processNextNode() {
       Node n = _list[++_list_front];
@@ -1486,15 +1403,14 @@
     /// \brief Processes the next node.
     ///
-    /// Processes the next node and checks if the given target node
+    /// Processes the next node. And checks that the given target node
     /// is reached. If the target node is reachable from the processed
-    /// node, then the \c reach parameter will be set to \c true.
+    /// node then the reached parameter will be set true. The reached
+    /// parameter should be initially false.
     ///
     /// \param target The target node.
-    /// \retval reach Indicates if the target node is reached.
-    /// It should be initially \c false.
-    ///
+    /// \retval reach Indicates that the target node is reached.
     /// \return The processed node.
     ///
-    /// \pre The queue must not be empty.
+    /// \warning The queue must not be empty!
     Node processNextNode(Node target, bool& reach) {
       Node n = _list[++_list_front];
@@ -1518,17 +1434,14 @@
     /// \brief Processes the next node.
     ///
-    /// Processes the next node and checks if at least one of reached
-    /// nodes has \c true value in the \c nm node map. If one node
-    /// with \c true value is reachable from the processed node, then the
-    /// \c rnode parameter will be set to the first of such nodes.
-    ///
-    /// \param nm A \c bool (or convertible) node map that indicates the
-    /// possible targets.
+    /// Processes the next node. And checks that at least one of
+    /// reached node has true value in the \c nm node map. If one node
+    /// with true value is reachable from the processed node then the
+    /// rnode parameter will be set to the first of such nodes.
+    ///
+    /// \param nm The node map of possible targets.
     /// \retval rnode The reached target node.
-    /// It should be initially \c INVALID.
-    ///
     /// \return The processed node.
     ///
-    /// \pre The queue must not be empty.
+    /// \warning The queue must not be empty!
     template <typename NM>
     Node processNextNode(const NM& nm, Node& rnode) {
@@ -1551,23 +1464,25 @@
     }
 
-    /// \brief The next node to be processed.
-    ///
-    /// Returns the next node to be processed or \c INVALID if the queue
-    /// is empty.
-    Node nextNode() const {
+    /// \brief Next node to be processed.
+    ///
+    /// Next node to be processed.
+    ///
+    /// \return The next node to be processed or INVALID if the stack is
+    /// empty.
+    Node nextNode() {
       return _list_front != _list_back ? _list[_list_front + 1] : INVALID;
     }
 
     /// \brief Returns \c false if there are nodes
-    /// to be processed.
+    /// to be processed in the queue
     ///
     /// Returns \c false if there are nodes
-    /// to be processed in the queue.
-    bool emptyQueue() const { return _list_front == _list_back; }
+    /// to be processed in the queue
+    bool emptyQueue() { return _list_front == _list_back; }
 
     /// \brief Returns the number of the nodes to be processed.
     ///
     /// Returns the number of the nodes to be processed in the queue.
-    int queueSize() const { return _list_back - _list_front; }
+    int queueSize() { return _list_back - _list_front; }
 
     /// \brief Executes the algorithm.
@@ -1575,48 +1490,19 @@
     /// Executes the algorithm.
     ///
-    /// This method runs the %BFS algorithm from the root node(s)
-    /// in order to compute the shortest path to each node.
-    ///
-    /// The algorithm computes
-    /// - the shortest path tree (forest),
-    /// - the distance of each node from the root(s).
-    ///
-    /// \pre init() must be called and at least one root node should be added
+    /// \pre init() must be called and at least one node should be added
     /// with addSource() before using this function.
-    ///
-    /// \note <tt>b.start()</tt> is just a shortcut of the following code.
-    /// \code
-    ///   while ( !b.emptyQueue() ) {
-    ///     b.processNextNode();
-    ///   }
-    /// \endcode
     void start() {
       while ( !emptyQueue() ) processNextNode();
     }
 
-    /// \brief Executes the algorithm until the given target node is reached.
-    ///
-    /// Executes the algorithm until the given target node is reached.
-    ///
-    /// This method runs the %BFS algorithm from the root node(s)
-    /// in order to compute the shortest path to \c t.
-    ///
-    /// The algorithm computes
-    /// - the shortest path to \c t,
-    /// - the distance of \c t from the root(s).
-    ///
-    /// \pre init() must be called and at least one root node should be
-    /// added with addSource() before using this function.
-    ///
-    /// \note <tt>b.start(t)</tt> is just a shortcut of the following code.
-    /// \code
-    ///   bool reach = false;
-    ///   while ( !b.emptyQueue() && !reach ) {
-    ///     b.processNextNode(t, reach);
-    ///   }
-    /// \endcode
-    void start(Node t) {
+    /// \brief Executes the algorithm until \c dest is reached.
+    ///
+    /// Executes the algorithm until \c dest is reached.
+    ///
+    /// \pre init() must be called and at least one node should be added
+    /// with addSource() before using this function.
+    void start(Node dest) {
       bool reach = false;
-      while ( !emptyQueue() && !reach ) processNextNode(t, reach);
+      while ( !emptyQueue() && !reach ) processNextNode(dest, reach);
     }
 
@@ -1625,26 +1511,13 @@
     /// Executes the algorithm until a condition is met.
     ///
-    /// This method runs the %BFS algorithm from the root node(s) in
-    /// order to compute the shortest path to a node \c v with
-    /// <tt>nm[v]</tt> true, if such a node can be found.
-    ///
-    /// \param nm must be a bool (or convertible) node map. The
-    /// algorithm will stop when it reaches a node \c v with
+    /// \pre init() must be called and at least one node should be added
+    /// with addSource() before using this function.
+    ///
+    ///\param nm must be a bool (or convertible) node map. The
+    ///algorithm will stop when it reaches a node \c v with
     /// <tt>nm[v]</tt> true.
     ///
-    /// \return The reached node \c v with <tt>nm[v]</tt> true or
-    /// \c INVALID if no such node was found.
-    ///
-    /// \pre init() must be called and at least one root node should be
-    /// added with addSource() before using this function.
-    ///
-    /// \note <tt>b.start(nm)</tt> is just a shortcut of the following code.
-    /// \code
-    ///   Node rnode = INVALID;
-    ///   while ( !b.emptyQueue() && rnode == INVALID ) {
-    ///     b.processNextNode(nm, rnode);
-    ///   }
-    ///   return rnode;
-    /// \endcode
+    ///\return The reached node \c v with <tt>nm[v]</tt> true or
+    ///\c INVALID if no such node was found.
     template <typename NM>
     Node start(const NM &nm) {
@@ -1656,14 +1529,8 @@
     }
 
-    /// \brief Runs the algorithm from the given source node.
-    ///
-    /// This method runs the %BFS algorithm from node \c s
-    /// in order to compute the shortest path to each node.
-    ///
-    /// The algorithm computes
-    /// - the shortest path tree,
-    /// - the distance of each node from the root.
-    ///
-    /// \note <tt>b.run(s)</tt> is just a shortcut of the following code.
+    /// \brief Runs %BFSVisit algorithm from node \c s.
+    ///
+    /// This method runs the %BFS algorithm from a root node \c s.
+    /// \note b.run(s) is just a shortcut of the following code.
     ///\code
     ///   b.init();
@@ -1677,41 +1544,17 @@
     }
 
-    /// \brief Finds the shortest path between \c s and \c t.
-    ///
-    /// This method runs the %BFS algorithm from node \c s
-    /// in order to compute the shortest path to node \c t
-    /// (it stops searching when \c t is processed).
-    ///
-    /// \return \c true if \c t is reachable form \c s.
-    ///
-    /// \note Apart from the return value, <tt>b.run(s,t)</tt> is just a
-    /// shortcut of the following code.
-    ///\code
-    ///   b.init();
-    ///   b.addSource(s);
-    ///   b.start(t);
-    ///\endcode
-    bool run(Node s,Node t) {
-      init();
-      addSource(s);
-      start(t);
-      return reached(t);
-    }
-
-    /// \brief Runs the algorithm to visit all nodes in the digraph.
+    /// \brief Runs %BFSVisit algorithm to visit all nodes in the digraph.
     ///
     /// This method runs the %BFS algorithm in order to
-    /// compute the shortest path to each node.
-    ///
-    /// The algorithm computes
-    /// - the shortest path tree (forest),
-    /// - the distance of each node from the root(s).
-    ///
-    /// \note <tt>b.run(s)</tt> is just a shortcut of the following code.
+    /// compute the %BFS path to each node. The algorithm computes
+    /// - The %BFS tree.
+    /// - The distance of each node from the root in the %BFS tree.
+    ///
+    ///\note b.run() is just a shortcut of the following code.
     ///\code
     ///  b.init();
-    ///  for (NodeIt n(gr); n != INVALID; ++n) {
-    ///    if (!b.reached(n)) {
-    ///      b.addSource(n);
+    ///  for (NodeIt it(digraph); it != INVALID; ++it) {
+    ///    if (!b.reached(it)) {
+    ///      b.addSource(it);
     ///      b.start();
     ///    }
@@ -1727,5 +1570,4 @@
       }
     }
-
     ///@}
 
@@ -1733,18 +1575,17 @@
     /// The result of the %BFS algorithm can be obtained using these
     /// functions.\n
-    /// Either \ref lemon::BfsVisit::run() "run()" or
-    /// \ref lemon::BfsVisit::start() "start()" must be called before
-    /// using them.
+    /// Before the use of these functions,
+    /// either run() or start() must be called.
     ///@{
 
-    /// \brief Checks if a node is reachable from the root(s).
+    /// \brief Checks if a node is reachable from the root.
     ///
     /// Returns \c true if \c v is reachable from the root(s).
+    /// \warning The source nodes are inditated as unreachable.
     /// \pre Either \ref run() or \ref start()
     /// must be called before using this function.
+    ///
     bool reached(Node v) { return (*_reached)[v]; }
-
     ///@}
-
   };
 
@@ -1752,2 +1593,3 @@
 
 #endif
+
Index: lemon/bits/alteration_notifier.h
===================================================================
--- lemon/bits/alteration_notifier.h	(revision 318)
+++ lemon/bits/alteration_notifier.h	(revision 220)
@@ -25,73 +25,74 @@
 #include <lemon/core.h>
 
-//\ingroup graphbits
-//\file
-//\brief Observer notifier for graph alteration observers.
+///\ingroup graphbits
+///\file
+///\brief Observer notifier for graph alteration observers.
 
 namespace lemon {
 
-  // \ingroup graphbits
-  //
-  // \brief Notifier class to notify observes about alterations in
-  // a container.
-  //
-  // The simple graph's can be refered as two containers, one node container
-  // and one edge container. But they are not standard containers they
-  // does not store values directly they are just key continars for more
-  // value containers which are the node and edge maps.
-  //
-  // The graph's node and edge sets can be changed as we add or erase
-  // nodes and edges in the graph. LEMON would like to handle easily
-  // that the node and edge maps should contain values for all nodes or
-  // edges. If we want to check on every indicing if the map contains
-  // the current indicing key that cause a drawback in the performance
-  // in the library. We use another solution we notify all maps about
-  // an alteration in the graph, which cause only drawback on the
-  // alteration of the graph.
-  //
-  // This class provides an interface to the container. The \e first() and \e
-  // next() member functions make possible to iterate on the keys of the
-  // container. The \e id() function returns an integer id for each key.
-  // The \e maxId() function gives back an upper bound of the ids.
-  //
-  // For the proper functonality of this class, we should notify it
-  // about each alteration in the container. The alterations have four type
-  // as \e add(), \e erase(), \e build() and \e clear(). The \e add() and
-  // \e erase() signals that only one or few items added or erased to or
-  // from the graph. If all items are erased from the graph or from an empty
-  // graph a new graph is builded then it can be signaled with the
-  // clear() and build() members. Important rule that if we erase items
-  // from graph we should first signal the alteration and after that erase
-  // them from the container, on the other way on item addition we should
-  // first extend the container and just after that signal the alteration.
-  //
-  // The alteration can be observed with a class inherited from the
-  // \e ObserverBase nested class. The signals can be handled with
-  // overriding the virtual functions defined in the base class.  The
-  // observer base can be attached to the notifier with the
-  // \e attach() member and can be detached with detach() function. The
-  // alteration handlers should not call any function which signals
-  // an other alteration in the same notifier and should not
-  // detach any observer from the notifier.
-  //
-  // Alteration observers try to be exception safe. If an \e add() or
-  // a \e clear() function throws an exception then the remaining
-  // observeres will not be notified and the fulfilled additions will
-  // be rolled back by calling the \e erase() or \e clear()
-  // functions. Thence the \e erase() and \e clear() should not throw
-  // exception. Actullay, it can be throw only \ref ImmediateDetach
-  // exception which detach the observer from the notifier.
-  //
-  // There are some place when the alteration observing is not completly
-  // reliable. If we want to carry out the node degree in the graph
-  // as in the \ref InDegMap and we use the reverseEdge that cause
-  // unreliable functionality. Because the alteration observing signals
-  // only erasing and adding but not the reversing it will stores bad
-  // degrees. The sub graph adaptors cannot signal the alterations because
-  // just a setting in the filter map can modify the graph and this cannot
-  // be watched in any way.
-  //
-  // \param _Container The container which is observed.
-  // \param _Item The item type which is obserbved.
+  /// \ingroup graphbits
+  ///
+  /// \brief Notifier class to notify observes about alterations in
+  /// a container.
+  ///
+  /// The simple graph's can be refered as two containers, one node container
+  /// and one edge container. But they are not standard containers they
+  /// does not store values directly they are just key continars for more
+  /// value containers which are the node and edge maps.
+  ///
+  /// The graph's node and edge sets can be changed as we add or erase
+  /// nodes and edges in the graph. Lemon would like to handle easily
+  /// that the node and edge maps should contain values for all nodes or
+  /// edges. If we want to check on every indicing if the map contains
+  /// the current indicing key that cause a drawback in the performance
+  /// in the library. We use another solution we notify all maps about
+  /// an alteration in the graph, which cause only drawback on the
+  /// alteration of the graph.
+  ///
+  /// This class provides an interface to the container. The \e first() and \e
+  /// next() member functions make possible to iterate on the keys of the
+  /// container. The \e id() function returns an integer id for each key.
+  /// The \e maxId() function gives back an upper bound of the ids.
+  ///
+  /// For the proper functonality of this class, we should notify it
+  /// about each alteration in the container. The alterations have four type
+  /// as \e add(), \e erase(), \e build() and \e clear(). The \e add() and
+  /// \e erase() signals that only one or few items added or erased to or
+  /// from the graph. If all items are erased from the graph or from an empty
+  /// graph a new graph is builded then it can be signaled with the
+  /// clear() and build() members. Important rule that if we erase items
+  /// from graph we should first signal the alteration and after that erase
+  /// them from the container, on the other way on item addition we should
+  /// first extend the container and just after that signal the alteration.
+  ///
+  /// The alteration can be observed with a class inherited from the
+  /// \e ObserverBase nested class. The signals can be handled with
+  /// overriding the virtual functions defined in the base class.  The
+  /// observer base can be attached to the notifier with the
+  /// \e attach() member and can be detached with detach() function. The
+  /// alteration handlers should not call any function which signals
+  /// an other alteration in the same notifier and should not
+  /// detach any observer from the notifier.
+  ///
+  /// Alteration observers try to be exception safe. If an \e add() or
+  /// a \e clear() function throws an exception then the remaining
+  /// observeres will not be notified and the fulfilled additions will
+  /// be rolled back by calling the \e erase() or \e clear()
+  /// functions. Thence the \e erase() and \e clear() should not throw
+  /// exception. Actullay, it can be throw only
+  /// \ref AlterationObserver::ImmediateDetach ImmediateDetach
+  /// exception which detach the observer from the notifier.
+  ///
+  /// There are some place when the alteration observing is not completly
+  /// reliable. If we want to carry out the node degree in the graph
+  /// as in the \ref InDegMap and we use the reverseEdge that cause
+  /// unreliable functionality. Because the alteration observing signals
+  /// only erasing and adding but not the reversing it will stores bad
+  /// degrees. The sub graph adaptors cannot signal the alterations because
+  /// just a setting in the filter map can modify the graph and this cannot
+  /// be watched in any way.
+  ///
+  /// \param _Container The container which is observed.
+  /// \param _Item The item type which is obserbved.
 
   template <typename _Container, typename _Item>
@@ -104,28 +105,29 @@
     typedef _Item Item;
 
-    // \brief Exception which can be called from \e clear() and
-    // \e erase().
-    //
-    // From the \e clear() and \e erase() function only this
-    // exception is allowed to throw. The exception immediatly
-    // detaches the current observer from the notifier. Because the
-    // \e clear() and \e erase() should not throw other exceptions
-    // it can be used to invalidate the observer.
+    /// \brief Exception which can be called from \e clear() and
+    /// \e erase().
+    ///
+    /// From the \e clear() and \e erase() function only this
+    /// exception is allowed to throw. The exception immediatly
+    /// detaches the current observer from the notifier. Because the
+    /// \e clear() and \e erase() should not throw other exceptions
+    /// it can be used to invalidate the observer.
     struct ImmediateDetach {};
 
-    // \brief ObserverBase is the base class for the observers.
-    //
-    // ObserverBase is the abstract base class for the observers.
-    // It will be notified about an item was inserted into or
-    // erased from the graph.
-    //
-    // The observer interface contains some pure virtual functions
-    // to override. The add() and erase() functions are
-    // to notify the oberver when one item is added or
-    // erased.
-    //
-    // The build() and clear() members are to notify the observer
-    // about the container is built from an empty container or
-    // is cleared to an empty container.
+    /// \brief ObserverBase is the base class for the observers.
+    ///
+    /// ObserverBase is the abstract base class for the observers.
+    /// It will be notified about an item was inserted into or
+    /// erased from the graph.
+    ///
+    /// The observer interface contains some pure virtual functions
+    /// to override. The add() and erase() functions are
+    /// to notify the oberver when one item is added or
+    /// erased.
+    ///
+    /// The build() and clear() members are to notify the observer
+    /// about the container is built from an empty container or
+    /// is cleared to an empty container.
+
     class ObserverBase {
     protected:
@@ -134,20 +136,21 @@
       friend class AlterationNotifier;
 
-      // \brief Default constructor.
-      //
-      // Default constructor for ObserverBase.
+      /// \brief Default constructor.
+      ///
+      /// Default constructor for ObserverBase.
+      ///
       ObserverBase() : _notifier(0) {}
 
-      // \brief Constructor which attach the observer into notifier.
-      //
-      // Constructor which attach the observer into notifier.
+      /// \brief Constructor which attach the observer into notifier.
+      ///
+      /// Constructor which attach the observer into notifier.
       ObserverBase(AlterationNotifier& nf) {
         attach(nf);
       }
 
-      // \brief Constructor which attach the obserever to the same notifier.
-      //
-      // Constructor which attach the obserever to the same notifier as
-      // the other observer is attached to.
+      /// \brief Constructor which attach the obserever to the same notifier.
+      ///
+      /// Constructor which attach the obserever to the same notifier as
+      /// the other observer is attached to.
       ObserverBase(const ObserverBase& copy) {
         if (copy.attached()) {
@@ -156,5 +159,5 @@
       }
 
-      // \brief Destructor
+      /// \brief Destructor
       virtual ~ObserverBase() {
         if (attached()) {
@@ -163,26 +166,29 @@
       }
 
-      // \brief Attaches the observer into an AlterationNotifier.
-      //
-      // This member attaches the observer into an AlterationNotifier.
+      /// \brief Attaches the observer into an AlterationNotifier.
+      ///
+      /// This member attaches the observer into an AlterationNotifier.
+      ///
       void attach(AlterationNotifier& nf) {
         nf.attach(*this);
       }
 
-      // \brief Detaches the observer into an AlterationNotifier.
-      //
-      // This member detaches the observer from an AlterationNotifier.
+      /// \brief Detaches the observer into an AlterationNotifier.
+      ///
+      /// This member detaches the observer from an AlterationNotifier.
+      ///
       void detach() {
         _notifier->detach(*this);
       }
 
-      // \brief Gives back a pointer to the notifier which the map
-      // attached into.
-      //
-      // This function gives back a pointer to the notifier which the map
-      // attached into.
+      /// \brief Gives back a pointer to the notifier which the map
+      /// attached into.
+      ///
+      /// This function gives back a pointer to the notifier which the map
+      /// attached into.
+      ///
       Notifier* notifier() const { return const_cast<Notifier*>(_notifier); }
 
-      // Gives back true when the observer is attached into a notifier.
+      /// Gives back true when the observer is attached into a notifier.
       bool attached() const { return _notifier != 0; }
 
@@ -196,50 +202,51 @@
       typename std::list<ObserverBase*>::iterator _index;
 
-      // \brief The member function to notificate the observer about an
-      // item is added to the container.
-      //
-      // The add() member function notificates the observer about an item
-      // is added to the container. It have to be overrided in the
-      // subclasses.
+      /// \brief The member function to notificate the observer about an
+      /// item is added to the container.
+      ///
+      /// The add() member function notificates the observer about an item
+      /// is added to the container. It have to be overrided in the
+      /// subclasses.
       virtual void add(const Item&) = 0;
 
-      // \brief The member function to notificate the observer about
-      // more item is added to the container.
-      //
-      // The add() member function notificates the observer about more item
-      // is added to the container. It have to be overrided in the
-      // subclasses.
+      /// \brief The member function to notificate the observer about
+      /// more item is added to the container.
+      ///
+      /// The add() member function notificates the observer about more item
+      /// is added to the container. It have to be overrided in the
+      /// subclasses.
       virtual void add(const std::vector<Item>& items) = 0;
 
-      // \brief The member function to notificate the observer about an
-      // item is erased from the container.
-      //
-      // The erase() member function notificates the observer about an
-      // item is erased from the container. It have to be overrided in
-      // the subclasses.
+      /// \brief The member function to notificate the observer about an
+      /// item is erased from the container.
+      ///
+      /// The erase() member function notificates the observer about an
+      /// item is erased from the container. It have to be overrided in
+      /// the subclasses.
       virtual void erase(const Item&) = 0;
 
-      // \brief The member function to notificate the observer about
-      // more item is erased from the container.
-      //
-      // The erase() member function notificates the observer about more item
-      // is erased from the container. It have to be overrided in the
-      // subclasses.
+      /// \brief The member function to notificate the observer about
+      /// more item is erased from the container.
+      ///
+      /// The erase() member function notificates the observer about more item
+      /// is erased from the container. It have to be overrided in the
+      /// subclasses.
       virtual void erase(const std::vector<Item>& items) = 0;
 
-      // \brief The member function to notificate the observer about the
-      // container is built.
-      //
-      // The build() member function notificates the observer about the
-      // container is built from an empty container. It have to be
-      // overrided in the subclasses.
+      /// \brief The member function to notificate the observer about the
+      /// container is built.
+      ///
+      /// The build() member function notificates the observer about the
+      /// container is built from an empty container. It have to be
+      /// overrided in the subclasses.
+
       virtual void build() = 0;
 
-      // \brief The member function to notificate the observer about all
-      // items are erased from the container.
-      //
-      // The clear() member function notificates the observer about all
-      // items are erased from the container. It have to be overrided in
-      // the subclasses.
+      /// \brief The member function to notificate the observer about all
+      /// items are erased from the container.
+      ///
+      /// The clear() member function notificates the observer about all
+      /// items are erased from the container. It have to be overrided in
+      /// the subclasses.
       virtual void clear() = 0;
 
@@ -256,28 +263,29 @@
   public:
 
-    // \brief Default constructor.
-    //
-    // The default constructor of the AlterationNotifier.
-    // It creates an empty notifier.
+    /// \brief Default constructor.
+    ///
+    /// The default constructor of the AlterationNotifier.
+    /// It creates an empty notifier.
     AlterationNotifier()
       : container(0) {}
 
-    // \brief Constructor.
-    //
-    // Constructor with the observed container parameter.
+    /// \brief Constructor.
+    ///
+    /// Constructor with the observed container parameter.
     AlterationNotifier(const Container& _container)
       : container(&_container) {}
 
-    // \brief Copy Constructor of the AlterationNotifier.
-    //
-    // Copy constructor of the AlterationNotifier.
-    // It creates only an empty notifier because the copiable
-    // notifier's observers have to be registered still into that notifier.
+    /// \brief Copy Constructor of the AlterationNotifier.
+    ///
+    /// Copy constructor of the AlterationNotifier.
+    /// It creates only an empty notifier because the copiable
+    /// notifier's observers have to be registered still into that notifier.
     AlterationNotifier(const AlterationNotifier& _notifier)
       : container(_notifier.container) {}
 
-    // \brief Destructor.
-    //
-    // Destructor of the AlterationNotifier.
+    /// \brief Destructor.
+    ///
+    /// Destructor of the AlterationNotifier.
+    ///
     ~AlterationNotifier() {
       typename Observers::iterator it;
@@ -287,7 +295,7 @@
     }
 
-    // \brief Sets the container.
-    //
-    // Sets the container.
+    /// \brief Sets the container.
+    ///
+    /// Sets the container.
     void setContainer(const Container& _container) {
       container = &_container;
@@ -300,30 +308,32 @@
   public:
 
-    // \brief First item in the container.
-    //
-    // Returns the first item in the container. It is
-    // for start the iteration on the container.
+
+
+    /// \brief First item in the container.
+    ///
+    /// Returns the first item in the container. It is
+    /// for start the iteration on the container.
     void first(Item& item) const {
       container->first(item);
     }
 
-    // \brief Next item in the container.
-    //
-    // Returns the next item in the container. It is
-    // for iterate on the container.
+    /// \brief Next item in the container.
+    ///
+    /// Returns the next item in the container. It is
+    /// for iterate on the container.
     void next(Item& item) const {
       container->next(item);
     }
 
-    // \brief Returns the id of the item.
-    //
-    // Returns the id of the item provided by the container.
+    /// \brief Returns the id of the item.
+    ///
+    /// Returns the id of the item provided by the container.
     int id(const Item& item) const {
       return container->id(item);
     }
 
-    // \brief Returns the maximum id of the container.
-    //
-    // Returns the maximum id of the container.
+    /// \brief Returns the maximum id of the container.
+    ///
+    /// Returns the maximum id of the container.
     int maxId() const {
       return container->maxId(Item());
@@ -345,9 +355,10 @@
   public:
 
-    // \brief Notifies all the registed observers about an item added to
-    // the container.
-    //
-    // It notifies all the registed observers about an item added to
-    // the container.
+    /// \brief Notifies all the registed observers about an item added to
+    /// the container.
+    ///
+    /// It notifies all the registed observers about an item added to
+    /// the container.
+    ///
     void add(const Item& item) {
       typename Observers::reverse_iterator it;
@@ -365,9 +376,10 @@
     }
 
-    // \brief Notifies all the registed observers about more item added to
-    // the container.
-    //
-    // It notifies all the registed observers about more item added to
-    // the container.
+    /// \brief Notifies all the registed observers about more item added to
+    /// the container.
+    ///
+    /// It notifies all the registed observers about more item added to
+    /// the container.
+    ///
     void add(const std::vector<Item>& items) {
       typename Observers::reverse_iterator it;
@@ -385,9 +397,10 @@
     }
 
-    // \brief Notifies all the registed observers about an item erased from
-    // the container.
-    //
-    // It notifies all the registed observers about an item erased from
-    // the container.
+    /// \brief Notifies all the registed observers about an item erased from
+    /// the container.
+    ///
+    /// It notifies all the registed observers about an item erased from
+    /// the container.
+    ///
     void erase(const Item& item) throw() {
       typename Observers::iterator it = _observers.begin();
@@ -397,16 +410,17 @@
           ++it;
         } catch (const ImmediateDetach&) {
+          it = _observers.erase(it);
           (*it)->_index = _observers.end();
           (*it)->_notifier = 0;
-          it = _observers.erase(it);
-        }
-      }
-    }
-
-    // \brief Notifies all the registed observers about more item erased
-    // from the container.
-    //
-    // It notifies all the registed observers about more item erased from
-    // the container.
+        }
+      }
+    }
+
+    /// \brief Notifies all the registed observers about more item erased
+    /// from the container.
+    ///
+    /// It notifies all the registed observers about more item erased from
+    /// the container.
+    ///
     void erase(const std::vector<Item>& items) {
       typename Observers::iterator it = _observers.begin();
@@ -416,16 +430,16 @@
           ++it;
         } catch (const ImmediateDetach&) {
+          it = _observers.erase(it);
           (*it)->_index = _observers.end();
           (*it)->_notifier = 0;
-          it = _observers.erase(it);
-        }
-      }
-    }
-
-    // \brief Notifies all the registed observers about the container is
-    // built.
-    //
-    // Notifies all the registed observers about the container is built
-    // from an empty container.
+        }
+      }
+    }
+
+    /// \brief Notifies all the registed observers about the container is
+    /// built.
+    ///
+    /// Notifies all the registed observers about the container is built
+    /// from an empty container.
     void build() {
       typename Observers::reverse_iterator it;
@@ -443,9 +457,9 @@
     }
 
-    // \brief Notifies all the registed observers about all items are
-    // erased.
-    //
-    // Notifies all the registed observers about all items are erased
-    // from the container.
+    /// \brief Notifies all the registed observers about all items are
+    /// erased.
+    ///
+    /// Notifies all the registed observers about all items are erased
+    /// from the container.
     void clear() {
       typename Observers::iterator it = _observers.begin();
@@ -455,7 +469,7 @@
           ++it;
         } catch (const ImmediateDetach&) {
+          it = _observers.erase(it);
           (*it)->_index = _observers.end();
           (*it)->_notifier = 0;
-          it = _observers.erase(it);
         }
       }
Index: lemon/bits/array_map.h
===================================================================
--- lemon/bits/array_map.h	(revision 318)
+++ lemon/bits/array_map.h	(revision 209)
@@ -27,46 +27,46 @@
 #include <lemon/concepts/maps.h>
 
-// \ingroup graphbits
-// \file
-// \brief Graph map based on the array storage.
+/// \ingroup graphbits
+/// \file
+/// \brief Graph map based on the array storage.
 
 namespace lemon {
 
-  // \ingroup graphbits
-  //
-  // \brief Graph map based on the array storage.
-  //
-  // The ArrayMap template class is graph map structure what
-  // automatically updates the map when a key is added to or erased from
-  // the map. This map uses the allocators to implement
-  // the container functionality.
-  //
-  // The template parameters are the Graph the current Item type and
-  // the Value type of the map.
+  /// \ingroup graphbits
+  ///
+  /// \brief Graph map based on the array storage.
+  ///
+  /// The ArrayMap template class is graph map structure what
+  /// automatically updates the map when a key is added to or erased from
+  /// the map. This map uses the allocators to implement
+  /// the container functionality.
+  ///
+  /// The template parameters are the Graph the current Item type and
+  /// the Value type of the map.
   template <typename _Graph, typename _Item, typename _Value>
   class ArrayMap
     : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase {
   public:
-    // The graph type of the maps.
+    /// The graph type of the maps.
     typedef _Graph Graph;
-    // The item type of the map.
+    /// The item type of the map.
     typedef _Item Item;
-    // The reference map tag.
+    /// The reference map tag.
     typedef True ReferenceMapTag;
 
-    // The key type of the maps.
+    /// The key type of the maps.
     typedef _Item Key;
-    // The value type of the map.
+    /// The value type of the map.
     typedef _Value Value;
 
-    // The const reference type of the map.
+    /// The const reference type of the map.
     typedef const _Value& ConstReference;
-    // The reference type of the map.
+    /// The reference type of the map.
     typedef _Value& Reference;
 
-    // The notifier type.
+    /// The notifier type.
     typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
 
-    // The MapBase of the Map which imlements the core regisitry function.
+    /// The MapBase of the Map which imlements the core regisitry function.
     typedef typename Notifier::ObserverBase Parent;
 
@@ -76,7 +76,7 @@
   public:
 
-    // \brief Graph initialized map constructor.
-    //
-    // Graph initialized map constructor.
+    /// \brief Graph initialized map constructor.
+    ///
+    /// Graph initialized map constructor.
     explicit ArrayMap(const Graph& graph) {
       Parent::attach(graph.notifier(Item()));
@@ -90,7 +90,7 @@
     }
 
-    // \brief Constructor to use default value to initialize the map.
-    //
-    // It constructs a map and initialize all of the the map.
+    /// \brief Constructor to use default value to initialize the map.
+    ///
+    /// It constructs a map and initialize all of the the map.
     ArrayMap(const Graph& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
@@ -104,8 +104,7 @@
     }
 
-  private:
-    // \brief Constructor to copy a map of the same map type.
-    //
-    // Constructor to copy a map of the same map type.
+    /// \brief Constructor to copy a map of the same map type.
+    ///
+    /// Constructor to copy a map of the same map type.
     ArrayMap(const ArrayMap& copy) : Parent() {
       if (copy.attached()) {
@@ -123,11 +122,11 @@
     }
 
-    // \brief Assign operator.
-    //
-    // This operator assigns for each item in the map the
-    // value mapped to the same item in the copied map.
-    // The parameter map should be indiced with the same
-    // itemset because this assign operator does not change
-    // the container of the map.
+    /// \brief Assign operator.
+    ///
+    /// This operator assigns for each item in the map the
+    /// value mapped to the same item in the copied map.
+    /// The parameter map should be indiced with the same
+    /// itemset because this assign operator does not change
+    /// the container of the map.
     ArrayMap& operator=(const ArrayMap& cmap) {
       return operator=<ArrayMap>(cmap);
@@ -135,10 +134,10 @@
 
 
-    // \brief Template assign operator.
-    //
-    // The given parameter should be conform to the ReadMap
-    // concecpt and could be indiced by the current item set of
-    // the NodeMap. In this case the value for each item
-    // is assigned by the value of the given ReadMap.
+    /// \brief Template assign operator.
+    ///
+    /// The given parameter should be conform to the ReadMap
+    /// concecpt and could be indiced by the current item set of
+    /// the NodeMap. In this case the value for each item
+    /// is assigned by the value of the given ReadMap.
     template <typename CMap>
     ArrayMap& operator=(const CMap& cmap) {
@@ -152,8 +151,7 @@
     }
 
-  public:
-    // \brief The destructor of the map.
-    //
-    // The destructor of the map.
+    /// \brief The destructor of the map.
+    ///
+    /// The destructor of the map.
     virtual ~ArrayMap() {
       if (attached()) {
@@ -171,8 +169,8 @@
   public:
 
-    // \brief The subscript operator.
-    //
-    // The subscript operator. The map can be subscripted by the
-    // actual keys of the graph.
+    /// \brief The subscript operator.
+    ///
+    /// The subscript operator. The map can be subscripted by the
+    /// actual keys of the graph.
     Value& operator[](const Key& key) {
       int id = Parent::notifier()->id(key);
@@ -180,8 +178,8 @@
     }
 
-    // \brief The const subscript operator.
-    //
-    // The const subscript operator. The map can be subscripted by the
-    // actual keys of the graph.
+    /// \brief The const subscript operator.
+    ///
+    /// The const subscript operator. The map can be subscripted by the
+    /// actual keys of the graph.
     const Value& operator[](const Key& key) const {
       int id = Parent::notifier()->id(key);
@@ -189,8 +187,8 @@
     }
 
-    // \brief Setter function of the map.
-    //
-    // Setter function of the map. Equivalent with map[key] = val.
-    // This is a compatibility feature with the not dereferable maps.
+    /// \brief Setter function of the map.
+    ///
+    /// Setter function of the map. Equivalent with map[key] = val.
+    /// This is a compatibility feature with the not dereferable maps.
     void set(const Key& key, const Value& val) {
       (*this)[key] = val;
@@ -199,8 +197,8 @@
   protected:
 
-    // \brief Adds a new key to the map.
-    //
-    // It adds a new key to the map. It called by the observer notifier
-    // and it overrides the add() member function of the observer base.
+    /// \brief Adds a new key to the map.
+    ///
+    /// It adds a new key to the map. It called by the observer notifier
+    /// and it overrides the add() member function of the observer base.
     virtual void add(const Key& key) {
       Notifier* nf = Parent::notifier();
@@ -227,8 +225,8 @@
     }
 
-    // \brief Adds more new keys to the map.
-    //
-    // It adds more new keys to the map. It called by the observer notifier
-    // and it overrides the add() member function of the observer base.
+    /// \brief Adds more new keys to the map.
+    ///
+    /// It adds more new keys to the map. It called by the observer notifier
+    /// and it overrides the add() member function of the observer base.
     virtual void add(const std::vector<Key>& keys) {
       Notifier* nf = Parent::notifier();
@@ -271,8 +269,8 @@
     }
 
-    // \brief Erase a key from the map.
-    //
-    // Erase a key from the map. It called by the observer notifier
-    // and it overrides the erase() member function of the observer base.
+    /// \brief Erase a key from the map.
+    ///
+    /// Erase a key from the map. It called by the observer notifier
+    /// and it overrides the erase() member function of the observer base.
     virtual void erase(const Key& key) {
       int id = Parent::notifier()->id(key);
@@ -280,8 +278,8 @@
     }
 
-    // \brief Erase more keys from the map.
-    //
-    // Erase more keys from the map. It called by the observer notifier
-    // and it overrides the erase() member function of the observer base.
+    /// \brief Erase more keys from the map.
+    ///
+    /// Erase more keys from the map. It called by the observer notifier
+    /// and it overrides the erase() member function of the observer base.
     virtual void erase(const std::vector<Key>& keys) {
       for (int i = 0; i < int(keys.size()); ++i) {
@@ -291,8 +289,8 @@
     }
 
-    // \brief Buildes the map.
-    //
-    // It buildes the map. It called by the observer notifier
-    // and it overrides the build() member function of the observer base.
+    /// \brief Buildes the map.
+    ///
+    /// It buildes the map. It called by the observer notifier
+    /// and it overrides the build() member function of the observer base.
     virtual void build() {
       Notifier* nf = Parent::notifier();
@@ -305,8 +303,8 @@
     }
 
-    // \brief Clear the map.
-    //
-    // It erase all items from the map. It called by the observer notifier
-    // and it overrides the clear() member function of the observer base.
+    /// \brief Clear the map.
+    ///
+    /// It erase all items from the map. It called by the observer notifier
+    /// and it overrides the clear() member function of the observer base.
     virtual void clear() {
       Notifier* nf = Parent::notifier();
Index: lemon/bits/base_extender.h
===================================================================
--- lemon/bits/base_extender.h	(revision 318)
+++ lemon/bits/base_extender.h	(revision 220)
@@ -29,12 +29,12 @@
 #include <lemon/concepts/maps.h>
 
-//\ingroup digraphbits
-//\file
-//\brief Extenders for the digraph types
+///\ingroup digraphbits
+///\file
+///\brief Extenders for the digraph types
 namespace lemon {
 
-  // \ingroup digraphbits
-  //
-  // \brief BaseDigraph to BaseGraph extender
+  /// \ingroup digraphbits
+  ///
+  /// \brief BaseDigraph to BaseGraph extender
   template <typename Base>
   class UndirDigraphExtender : public Base {
@@ -60,5 +60,5 @@
       Arc() {}
 
-      // Invalid arc constructor
+      /// Invalid arc constructor
       Arc(Invalid i) : Edge(i), forward(true) {}
 
@@ -75,36 +75,36 @@
     };
 
-    // First node of the edge
-    Node u(const Edge &e) const {
-      return Parent::source(e);
-    }
-
-    // Source of the given arc
+
+
+    using Parent::source;
+
+    /// Source of the given Arc.
     Node source(const Arc &e) const {
       return e.forward ? Parent::source(e) : Parent::target(e);
     }
 
-    // Second node of the edge
-    Node v(const Edge &e) const {
-      return Parent::target(e);
-    }
-
-    // Target of the given arc
+    using Parent::target;
+
+    /// Target of the given Arc.
     Node target(const Arc &e) const {
       return e.forward ? Parent::target(e) : Parent::source(e);
     }
 
-    // \brief Directed arc from an edge.
-    //
-    // Returns a directed arc corresponding to the specified edge.
-    // If the given bool is true, the first node of the given edge and
-    // the source node of the returned arc are the same.
-    static Arc direct(const Edge &e, bool d) {
-      return Arc(e, d);
-    }
-
-    // Returns whether the given directed arc has the same orientation
-    // as the corresponding edge.
-    static bool direction(const Arc &a) { return a.forward; }
+    /// \brief Directed arc from an edge.
+    ///
+    /// Returns a directed arc corresponding to the specified Edge.
+    /// If the given bool is true the given edge and the
+    /// returned arc have the same source node.
+    static Arc direct(const Edge &ue, bool d) {
+      return Arc(ue, d);
+    }
+
+    /// Returns whether the given directed arc is same orientation as the
+    /// corresponding edge.
+    ///
+    /// \todo reference to the corresponding point of the undirected digraph
+    /// concept. "What does the direction of an edge mean?"
+    static bool direction(const Arc &e) { return e.forward; }
+
 
     using Parent::first;
@@ -229,4 +229,5 @@
       return Parent::maxArcId();
     }
+
 
     int arcNum() const {
@@ -299,10 +300,10 @@
       Red() {}
       Red(const Node& node) : Node(node) {
-        LEMON_DEBUG(Parent::red(node) || node == INVALID,
-                    typename Parent::NodeSetError());
+        LEMON_ASSERT(Parent::red(node) || node == INVALID,
+                     typename Parent::NodeSetError());
       }
       Red& operator=(const Node& node) {
-        LEMON_DEBUG(Parent::red(node) || node == INVALID,
-                    typename Parent::NodeSetError());
+        LEMON_ASSERT(Parent::red(node) || node == INVALID,
+                     typename Parent::NodeSetError());
         Node::operator=(node);
         return *this;
@@ -331,10 +332,10 @@
       Blue() {}
       Blue(const Node& node) : Node(node) {
-        LEMON_DEBUG(Parent::blue(node) || node == INVALID,
-                    typename Parent::NodeSetError());
+        LEMON_ASSERT(Parent::blue(node) || node == INVALID,
+                     typename Parent::NodeSetError());
       }
       Blue& operator=(const Node& node) {
-        LEMON_DEBUG(Parent::blue(node) || node == INVALID,
-                    typename Parent::NodeSetError());
+        LEMON_ASSERT(Parent::blue(node) || node == INVALID,
+                     typename Parent::NodeSetError());
         Node::operator=(node);
         return *this;
Index: lemon/bits/bezier.h
===================================================================
--- lemon/bits/bezier.h	(revision 318)
+++ lemon/bits/bezier.h	(revision 209)
@@ -20,9 +20,9 @@
 #define LEMON_BEZIER_H
 
-//\ingroup misc
-//\file
-//\brief Classes to compute with Bezier curves.
-//
-//Up to now this file is used internally by \ref graph_to_eps.h
+///\ingroup misc
+///\file
+///\brief Classes to compute with Bezier curves.
+///
+///Up to now this file is used internally by \ref graph_to_eps.h
 
 #include<lemon/dim2.h>
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 318)
+++ lemon/bits/default_map.h	(revision 209)
@@ -20,11 +20,12 @@
 #define LEMON_BITS_DEFAULT_MAP_H
 
+
 #include <lemon/bits/array_map.h>
 #include <lemon/bits/vector_map.h>
 //#include <lemon/bits/debug_map.h>
 
-//\ingroup graphbits
-//\file
-//\brief Graph maps that construct and destruct their elements dynamically.
+///\ingroup graphbits
+///\file
+///\brief Graph maps that construct and destruct their elements dynamically.
 
 namespace lemon {
@@ -149,5 +150,5 @@
 // #endif
 
-  // DefaultMap class
+  /// \e
   template <typename _Graph, typename _Item, typename _Value>
   class DefaultMap
Index: lemon/bits/enable_if.h
===================================================================
--- lemon/bits/enable_if.h	(revision 318)
+++ lemon/bits/enable_if.h	(revision 220)
@@ -36,27 +36,27 @@
 #define LEMON_BITS_ENABLE_IF_H
 
-//\file
-//\brief Miscellaneous basic utilities
+///\file
+///\brief Miscellaneous basic utilities
 
 namespace lemon
 {
 
-  // Basic type for defining "tags". A "YES" condition for \c enable_if.
+  /// Basic type for defining "tags". A "YES" condition for \c enable_if.
 
-  // Basic type for defining "tags". A "YES" condition for \c enable_if.
-  //
-  //\sa False
+  /// Basic type for defining "tags". A "YES" condition for \c enable_if.
+  ///
+  ///\sa False
   struct True {
-    //\e
+    ///\e
     static const bool value = true;
   };
 
-  // Basic type for defining "tags". A "NO" condition for \c enable_if.
+  /// Basic type for defining "tags". A "NO" condition for \c enable_if.
 
-  // Basic type for defining "tags". A "NO" condition for \c enable_if.
-  //
-  //\sa True
+  /// Basic type for defining "tags". A "NO" condition for \c enable_if.
+  ///
+  ///\sa True
   struct False {
-    //\e
+    ///\e
     static const bool value = false;
   };
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 318)
+++ lemon/bits/graph_extender.h	(revision 220)
@@ -28,12 +28,12 @@
 #include <lemon/concepts/maps.h>
 
-//\ingroup graphbits
-//\file
-//\brief Extenders for the digraph types
+///\ingroup graphbits
+///\file
+///\brief Extenders for the digraph types
 namespace lemon {
 
-  // \ingroup graphbits
-  //
-  // \brief Extender for the Digraphs
+  /// \ingroup graphbits
+  ///
+  /// \brief Extender for the Digraphs
   template <typename Base>
   class DigraphExtender : public Base {
@@ -187,28 +187,28 @@
     };
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (i.e. the source in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (i.e. the source in this case) of the iterator
     Node baseNode(const OutArcIt &arc) const {
       return Parent::source(arc);
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (i.e. the target in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (i.e. the target in this case) of the
+    /// iterator
     Node runningNode(const OutArcIt &arc) const {
       return Parent::target(arc);
     }
 
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (i.e. the target in this case) of the iterator
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (i.e. the target in this case) of the iterator
     Node baseNode(const InArcIt &arc) const {
       return Parent::target(arc);
     }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (i.e. the source in this case) of the
-    // iterator
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (i.e. the source in this case) of the
+    /// iterator
     Node runningNode(const InArcIt &arc) const {
       return Parent::source(arc);
@@ -228,5 +228,4 @@
         : Parent(digraph, value) {}
 
-    private:
       NodeMap& operator=(const NodeMap& cmap) {
         return operator=<NodeMap>(cmap);
@@ -253,5 +252,4 @@
         : Parent(digraph, value) {}
 
-    private:
       ArcMap& operator=(const ArcMap& cmap) {
         return operator=<ArcMap>(cmap);
@@ -326,7 +324,7 @@
   };
 
-  // \ingroup _graphbits
-  //
-  // \brief Extender for the Graphs
+  /// \ingroup _graphbits
+  ///
+  /// \brief Extender for the Graphs
   template <typename Base>
   class GraphExtender : public Base {
@@ -556,41 +554,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 &arc) const {
       return Parent::source(static_cast<const Arc&>(arc));
     }
-    // \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 &arc) const {
       return Parent::target(static_cast<const Arc&>(arc));
     }
 
-    // \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 &arc) const {
       return Parent::target(static_cast<const Arc&>(arc));
     }
-    // \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 &arc) const {
       return Parent::source(static_cast<const Arc&>(arc));
     }
 
-    // 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 &edge) const {
       return edge._direction ? u(edge) : v(edge);
     }
-    // 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 &edge) const {
       return edge._direction ? v(edge) : u(edge);
@@ -611,5 +609,4 @@
         : Parent(graph, value) {}
 
-    private:
       NodeMap& operator=(const NodeMap& cmap) {
         return operator=<NodeMap>(cmap);
@@ -636,5 +633,4 @@
         : Parent(graph, value) {}
 
-    private:
       ArcMap& operator=(const ArcMap& cmap) {
         return operator=<ArcMap>(cmap);
@@ -662,5 +658,4 @@
         : Parent(graph, value) {}
 
-    private:
       EdgeMap& operator=(const EdgeMap& cmap) {
         return operator=<EdgeMap>(cmap);
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 318)
+++ lemon/bits/map_extender.h	(revision 209)
@@ -27,12 +27,12 @@
 #include <lemon/concepts/maps.h>
 
-//\file
-//\brief Extenders for iterable maps.
+///\file
+///\brief Extenders for iterable maps.
 
 namespace lemon {
 
-  // \ingroup graphbits
-  //
-  // \brief Extender for maps
+  /// \ingroup graphbits
+  ///
+  /// \brief Extender for maps
   template <typename _Map>
   class MapExtender : public _Map {
@@ -63,5 +63,4 @@
       : Parent(graph, value) {}
 
-  private:
     MapExtender& operator=(const MapExtender& cmap) {
       return operator=<MapExtender>(cmap);
@@ -74,5 +73,4 @@
     }
 
-  public:
     class MapIt : public Item {
     public:
@@ -172,7 +170,7 @@
   };
 
-  // \ingroup graphbits
-  //
-  // \brief Extender for maps which use a subset of the items.
+  /// \ingroup graphbits
+  ///
+  /// \brief Extender for maps which use a subset of the items.
   template <typename _Graph, typename _Map>
   class SubMapExtender : public _Map {
@@ -203,5 +201,4 @@
       : Parent(_graph, _value), graph(_graph) {}
 
-  private:
     SubMapExtender& operator=(const SubMapExtender& cmap) {
       return operator=<MapExtender>(cmap);
@@ -218,5 +215,4 @@
     }
 
-  public:
     class MapIt : public Item {
     public:
Index: lemon/bits/traits.h
===================================================================
--- lemon/bits/traits.h	(revision 318)
+++ lemon/bits/traits.h	(revision 220)
@@ -20,7 +20,7 @@
 #define LEMON_BITS_TRAITS_H
 
-//\file
-//\brief Traits for graphs and maps
-//
+///\file
+///\brief Traits for graphs and maps
+///
 
 #include <lemon/bits/enable_if.h>
Index: lemon/bits/vector_map.h
===================================================================
--- lemon/bits/vector_map.h	(revision 318)
+++ lemon/bits/vector_map.h	(revision 220)
@@ -29,21 +29,22 @@
 #include <lemon/concepts/maps.h>
 
-//\ingroup graphbits
-//
-//\file
-//\brief Vector based graph maps.
+///\ingroup graphbits
+///
+///\file
+///\brief Vector based graph maps.
 namespace lemon {
 
-  // \ingroup graphbits
-  //
-  // \brief Graph map based on the std::vector storage.
-  //
-  // The VectorMap template class is graph map structure what
-  // automatically updates the map when a key is added to or erased from
-  // the map. This map type uses the std::vector to store the values.
-  //
-  // \tparam _Graph The graph this map is attached to.
-  // \tparam _Item The item type of the graph items.
-  // \tparam _Value The value type of the map.
+  /// \ingroup graphbits
+  ///
+  /// \brief Graph map based on the std::vector storage.
+  ///
+  /// The VectorMap template class is graph map structure what
+  /// automatically updates the map when a key is added to or erased from
+  /// the map. This map type uses the std::vector to store the values.
+  ///
+  /// \tparam _Notifier The AlterationNotifier that will notify this map.
+  /// \tparam _Item The item type of the graph items.
+  /// \tparam _Value The value type of the map.
+  /// \todo Fix the doc: there is _Graph parameter instead of _Notifier.
   template <typename _Graph, typename _Item, typename _Value>
   class VectorMap
@@ -51,39 +52,39 @@
   private:
 
-    // The container type of the map.
+    /// The container type of the map.
     typedef std::vector<_Value> Container;
 
   public:
 
-    // The graph type of the map.
+    /// The graph type of the map.
     typedef _Graph Graph;
-    // The item type of the map.
+    /// The item type of the map.
     typedef _Item Item;
-    // The reference map tag.
+    /// The reference map tag.
     typedef True ReferenceMapTag;
 
-    // The key type of the map.
+    /// The key type of the map.
     typedef _Item Key;
-    // The value type of the map.
+    /// The value type of the map.
     typedef _Value Value;
 
-    // The notifier type.
+    /// The notifier type.
     typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
 
-    // The map type.
+    /// The map type.
     typedef VectorMap Map;
-    // The base class of the map.
+    /// The base class of the map.
     typedef typename Notifier::ObserverBase Parent;
 
-    // The reference type of the map;
+    /// The reference type of the map;
     typedef typename Container::reference Reference;
-    // The const reference type of the map;
+    /// The const reference type of the map;
     typedef typename Container::const_reference ConstReference;
 
 
-    // \brief Constructor to attach the new map into the notifier.
-    //
-    // It constructs a map and attachs it into the notifier.
-    // It adds all the items of the graph to the map.
+    /// \brief Constructor to attach the new map into the notifier.
+    ///
+    /// It constructs a map and attachs it into the notifier.
+    /// It adds all the items of the graph to the map.
     VectorMap(const Graph& graph) {
       Parent::attach(graph.notifier(Item()));
@@ -91,8 +92,8 @@
     }
 
-    // \brief Constructor uses given value to initialize the map.
-    //
-    // It constructs a map uses a given value to initialize the map.
-    // It adds all the items of the graph to the map.
+    /// \brief Constructor uses given value to initialize the map.
+    ///
+    /// It constructs a map uses a given value to initialize the map.
+    /// It adds all the items of the graph to the map.
     VectorMap(const Graph& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
@@ -100,8 +101,7 @@
     }
 
-  private:
-    // \brief Copy constructor
-    //
-    // Copy constructor.
+    /// \brief Copy constructor
+    ///
+    /// Copy constructor.
     VectorMap(const VectorMap& _copy) : Parent() {
       if (_copy.attached()) {
@@ -111,11 +111,11 @@
     }
 
-    // \brief Assign operator.
-    //
-    // This operator assigns for each item in the map the
-    // value mapped to the same item in the copied map.
-    // The parameter map should be indiced with the same
-    // itemset because this assign operator does not change
-    // the container of the map.
+    /// \brief Assign operator.
+    ///
+    /// This operator assigns for each item in the map the
+    /// value mapped to the same item in the copied map.
+    /// The parameter map should be indiced with the same
+    /// itemset because this assign operator does not change
+    /// the container of the map.
     VectorMap& operator=(const VectorMap& cmap) {
       return operator=<VectorMap>(cmap);
@@ -123,10 +123,10 @@
 
 
-    // \brief Template assign operator.
-    //
-    // The given parameter should be conform to the ReadMap
-    // concecpt and could be indiced by the current item set of
-    // the NodeMap. In this case the value for each item
-    // is assigned by the value of the given ReadMap.
+    /// \brief Template assign operator.
+    ///
+    /// The given parameter should be conform to the ReadMap
+    /// concecpt and could be indiced by the current item set of
+    /// the NodeMap. In this case the value for each item
+    /// is assigned by the value of the given ReadMap.
     template <typename CMap>
     VectorMap& operator=(const CMap& cmap) {
@@ -142,16 +142,16 @@
   public:
 
-    // \brief The subcript operator.
-    //
-    // The subscript operator. The map can be subscripted by the
-    // actual items of the graph.
+    /// \brief The subcript operator.
+    ///
+    /// The subscript operator. The map can be subscripted by the
+    /// actual items of the graph.
     Reference operator[](const Key& key) {
       return container[Parent::notifier()->id(key)];
     }
 
-    // \brief The const subcript operator.
-    //
-    // The const subscript operator. The map can be subscripted by the
-    // actual items of the graph.
+    /// \brief The const subcript operator.
+    ///
+    /// The const subscript operator. The map can be subscripted by the
+    /// actual items of the graph.
     ConstReference operator[](const Key& key) const {
       return container[Parent::notifier()->id(key)];
@@ -159,7 +159,7 @@
 
 
-    // \brief The setter function of the map.
-    //
-    // It the same as operator[](key) = value expression.
+    /// \brief The setter function of the map.
+    ///
+    /// It the same as operator[](key) = value expression.
     void set(const Key& key, const Value& value) {
       (*this)[key] = value;
@@ -168,8 +168,8 @@
   protected:
 
-    // \brief Adds a new key to the map.
-    //
-    // It adds a new key to the map. It called by the observer notifier
-    // and it overrides the add() member function of the observer base.
+    /// \brief Adds a new key to the map.
+    ///
+    /// It adds a new key to the map. It called by the observer notifier
+    /// and it overrides the add() member function of the observer base.
     virtual void add(const Key& key) {
       int id = Parent::notifier()->id(key);
@@ -179,8 +179,8 @@
     }
 
-    // \brief Adds more new keys to the map.
-    //
-    // It adds more new keys to the map. It called by the observer notifier
-    // and it overrides the add() member function of the observer base.
+    /// \brief Adds more new keys to the map.
+    ///
+    /// It adds more new keys to the map. It called by the observer notifier
+    /// and it overrides the add() member function of the observer base.
     virtual void add(const std::vector<Key>& keys) {
       int max = container.size() - 1;
@@ -194,16 +194,16 @@
     }
 
-    // \brief Erase a key from the map.
-    //
-    // Erase a key from the map. It called by the observer notifier
-    // and it overrides the erase() member function of the observer base.
+    /// \brief Erase a key from the map.
+    ///
+    /// Erase a key from the map. It called by the observer notifier
+    /// and it overrides the erase() member function of the observer base.
     virtual void erase(const Key& key) {
       container[Parent::notifier()->id(key)] = Value();
     }
 
-    // \brief Erase more keys from the map.
-    //
-    // Erase more keys from the map. It called by the observer notifier
-    // and it overrides the erase() member function of the observer base.
+    /// \brief Erase more keys from the map.
+    ///
+    /// Erase more keys from the map. It called by the observer notifier
+    /// and it overrides the erase() member function of the observer base.
     virtual void erase(const std::vector<Key>& keys) {
       for (int i = 0; i < int(keys.size()); ++i) {
@@ -212,8 +212,8 @@
     }
 
-    // \brief Buildes the map.
-    //
-    // It buildes the map. It called by the observer notifier
-    // and it overrides the build() member function of the observer base.
+    /// \brief Buildes the map.
+    ///
+    /// It buildes the map. It called by the observer notifier
+    /// and it overrides the build() member function of the observer base.
     virtual void build() {
       int size = Parent::notifier()->maxId() + 1;
@@ -222,8 +222,8 @@
     }
 
-    // \brief Clear the map.
-    //
-    // It erase all items from the map. It called by the observer notifier
-    // and it overrides the clear() member function of the observer base.
+    /// \brief Clear the map.
+    ///
+    /// It erase all items from the map. It called by the observer notifier
+    /// and it overrides the clear() member function of the observer base.
     virtual void clear() {
       container.clear();
Index: lemon/color.h
===================================================================
--- lemon/color.h	(revision 317)
+++ lemon/color.h	(revision 209)
@@ -93,5 +93,5 @@
   extern const Color DARK_CYAN;
 
-  ///Map <tt>int</tt>s to different <tt>Color</tt>s
+  ///Map <tt>int</tt>s to different \ref Color "Color"s
 
   ///This map assigns one of the predefined \ref Color "Color"s to
Index: lemon/concept_check.h
===================================================================
--- lemon/concept_check.h	(revision 285)
+++ lemon/concept_check.h	(revision 209)
@@ -17,10 +17,26 @@
  */
 
-// The contents of this file was inspired by the concept checking
-// utility of the BOOST library (http://www.boost.org).
+// This file contains a modified version of the concept checking
+// utility from BOOST.
+// See the appropriate copyright notice below.
+
+// (C) Copyright Jeremy Siek 2000.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Revision History:
+//   05 May   2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
+//   02 April 2001: Removed limits header altogether. (Jeremy Siek)
+//   01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock)
+//
+
+// See http://www.boost.org/libs/concept_check for documentation.
 
 ///\file
 ///\brief Basic utilities for concept checking.
 ///
+///\todo Are we still using BOOST concept checking utility?
+///Is the BOOST copyright notice necessary?
 
 #ifndef LEMON_CONCEPT_CHECK_H
Index: lemon/concepts/digraph.h
===================================================================
--- lemon/concepts/digraph.h	(revision 263)
+++ lemon/concepts/digraph.h	(revision 220)
@@ -435,5 +435,4 @@
         NodeMap(const Digraph&, T) { }
 
-      private:
         ///Copy constructor
         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
@@ -458,5 +457,4 @@
         ///\e
         ArcMap(const Digraph&, T) { }
-      private:
         ///Copy constructor
         ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
Index: lemon/concepts/graph.h
===================================================================
--- lemon/concepts/graph.h	(revision 263)
+++ lemon/concepts/graph.h	(revision 220)
@@ -513,5 +513,4 @@
         NodeMap(const Graph&, T) { }
 
-      private:
         ///Copy constructor
         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
@@ -537,5 +536,4 @@
         ///\e
         ArcMap(const Graph&, T) { }
-      private:
         ///Copy constructor
         ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
@@ -561,5 +559,4 @@
         ///\e
         EdgeMap(const Graph&, T) { }
-      private:
         ///Copy constructor
         EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
Index: lemon/concepts/graph_components.h
===================================================================
--- lemon/concepts/graph_components.h	(revision 317)
+++ lemon/concepts/graph_components.h	(revision 220)
@@ -983,5 +983,5 @@
     ///
     /// This class describes the common interface of the graph maps
-    /// (NodeMap, ArcMap), that is maps that can be used to
+    /// (NodeMap, ArcMap), that is \ref maps-page "maps" which can be used to
     /// associate data to graph descriptors (nodes or arcs).
     template <typename _Graph, typename _Item, typename _Value>
@@ -1006,6 +1006,4 @@
       /// Construct a new map for the graph and initalise the values.
       GraphMap(const Graph&, const Value&) {}
-
-    private:
       /// \brief Copy constructor.
       ///
@@ -1024,5 +1022,4 @@
       }
 
-    public:
       template<typename _Map>
       struct Constraints {
@@ -1034,12 +1031,11 @@
           _Map a2(g,t);
           // Copy constructor.
-          // _Map b(c);
-
-          // ReadMap<Key, Value> cmap;
-          // b = cmap;
-
-          ignore_unused_variable_warning(a);
+          _Map b(c);
+
+          ReadMap<Key, Value> cmap;
+          b = cmap;
+
           ignore_unused_variable_warning(a2);
-          // ignore_unused_variable_warning(b);
+          ignore_unused_variable_warning(b);
         }
 
@@ -1087,5 +1083,4 @@
           : Parent(digraph, value) {}
 
-      private:
         /// \brief Copy constructor.
         ///
@@ -1125,5 +1120,4 @@
           : Parent(digraph, value) {}
 
-      private:
         /// \brief Copy constructor.
         ///
@@ -1222,5 +1216,4 @@
           : Parent(graph, value) {}
 
-      private:
         /// \brief Copy constructor.
         ///
Index: lemon/concepts/heap.h
===================================================================
--- lemon/concepts/heap.h	(revision 290)
+++ lemon/concepts/heap.h	(revision 220)
@@ -130,4 +130,5 @@
       /// Otherwise it inserts the given item with the given priority.
       ///
+      /// It may throw an \ref UnderflowPriorityException.
       /// \param i The item.
       /// \param p The priority.
Index: lemon/concepts/maps.h
===================================================================
--- lemon/concepts/maps.h	(revision 318)
+++ lemon/concepts/maps.h	(revision 220)
@@ -23,5 +23,5 @@
 #include <lemon/concept_check.h>
 
-///\ingroup map_concepts
+///\ingroup concept
 ///\file
 ///\brief The concept of maps.
@@ -31,5 +31,5 @@
   namespace concepts {
 
-    /// \addtogroup map_concepts
+    /// \addtogroup concept
     /// @{
 
Index: lemon/concepts/path.h
===================================================================
--- lemon/concepts/path.h	(revision 281)
+++ lemon/concepts/path.h	(revision 220)
@@ -21,4 +21,5 @@
 ///\brief Classes for representing paths in digraphs.
 ///
+///\todo Iterators have obsolete style
 
 #ifndef LEMON_CONCEPT_PATH_H
@@ -66,8 +67,5 @@
       /// \brief Template assigment
       template <typename CPath>
-      Path& operator=(const CPath& cpath) {
-        ignore_unused_variable_warning(cpath);
-        return *this;
-      }
+      Path& operator=(const CPath& cpath) {}
 
       /// Length of the path ie. the number of arcs in the path.
@@ -80,5 +78,5 @@
       void clear() {}
 
-      /// \brief LEMON style iterator for path arcs
+      /// \brief Lemon style iterator for path arcs
       ///
       /// This class is used to iterate on the arcs of the paths.
@@ -203,5 +201,5 @@
     /// If we would like to give back a real path from these
     /// algorithms then we should create a temporarly path object. In
-    /// LEMON such algorithms gives back a path dumper what can
+    /// Lemon such algorithms gives back a path dumper what can
     /// assigned to a real path and the dumpers can be implemented as
     /// an adaptor class to the predecessor map.
@@ -235,5 +233,5 @@
       typedef False RevPathTag;
 
-      /// \brief LEMON style iterator for path arcs
+      /// \brief Lemon style iterator for path arcs
       ///
       /// This class is used to iterate on the arcs of the paths.
@@ -262,5 +260,5 @@
       };
 
-      /// \brief LEMON style iterator for path arcs
+      /// \brief Lemon style iterator for path arcs
       ///
       /// This class is used to iterate on the arcs of the paths in
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 327)
+++ lemon/core.h	(revision 220)
@@ -25,12 +25,7 @@
 #include <lemon/bits/enable_if.h>
 #include <lemon/bits/traits.h>
-#include <lemon/assert.h>
 
 ///\file
 ///\brief LEMON core utilities.
-///
-///This header file contains core utilities for LEMON.
-///It is automatically included by all graph types, therefore it usually
-///do not have to be included directly.
 
 namespace lemon {
@@ -60,8 +55,8 @@
   /// @{
 
-  ///Create convenience typedefs for the digraph types and iterators
-
-  ///This \c \#define creates convenient type definitions for the following
-  ///types of \c Digraph: \c Node,  \c NodeIt, \c Arc, \c ArcIt, \c InArcIt,
+  ///Creates convenience typedefs for the digraph types and iterators
+
+  ///This \c \#define creates convenience typedefs for the following types
+  ///of \c Digraph: \c Node,  \c NodeIt, \c Arc, \c ArcIt, \c InArcIt,
   ///\c OutArcIt, \c BoolNodeMap, \c IntNodeMap, \c DoubleNodeMap,
   ///\c BoolArcMap, \c IntArcMap, \c DoubleArcMap.
@@ -84,5 +79,5 @@
   typedef Digraph::ArcMap<double> DoubleArcMap
 
-  ///Create convenience typedefs for the digraph types and iterators
+  ///Creates convenience typedefs for the digraph types and iterators
 
   ///\see DIGRAPH_TYPEDEFS
@@ -104,7 +99,7 @@
   typedef typename Digraph::template ArcMap<double> DoubleArcMap
 
-  ///Create convenience typedefs for the graph types and iterators
-
-  ///This \c \#define creates the same convenient type definitions as defined
+  ///Creates convenience typedefs for the graph types and iterators
+
+  ///This \c \#define creates the same convenience typedefs as defined
   ///by \ref DIGRAPH_TYPEDEFS(Graph) and six more, namely it creates
   ///\c Edge, \c EdgeIt, \c IncEdgeIt, \c BoolEdgeMap, \c IntEdgeMap,
@@ -112,5 +107,5 @@
   ///
   ///\note If the graph type is a dependent type, ie. the graph type depend
-  ///on a template parameter, then use \c TEMPLATE_GRAPH_TYPEDEFS()
+  ///on a template parameter, then use \c TEMPLATE_DIGRAPH_TYPEDEFS()
   ///macro.
 #define GRAPH_TYPEDEFS(Graph)                                           \
@@ -123,5 +118,5 @@
   typedef Graph::EdgeMap<double> DoubleEdgeMap
 
-  ///Create convenience typedefs for the graph types and iterators
+  ///Creates convenience typedefs for the graph types and iterators
 
   ///\see GRAPH_TYPEDEFS
@@ -138,8 +133,8 @@
   typedef typename Graph::template EdgeMap<double> DoubleEdgeMap
 
-  /// \brief Function to count the items in a graph.
-  ///
-  /// This function counts the items (nodes, arcs etc.) in a graph.
-  /// The complexity of the function is linear because
+  /// \brief Function to count the items in the graph.
+  ///
+  /// This function counts the items (nodes, arcs etc) in the graph.
+  /// The complexity of the function is O(n) because
   /// it iterates on all of the items.
   template <typename Graph, typename Item>
@@ -178,9 +173,9 @@
   ///
   /// This function counts the nodes in the graph.
-  /// The complexity of the function is <em>O</em>(<em>n</em>), but for some
-  /// graph structures it is specialized to run in <em>O</em>(1).
-  ///
-  /// \note If the graph contains a \c nodeNum() member function and a
-  /// \c NodeNumTag tag then this function calls directly the member
+  /// The complexity of the function is O(n) but for some
+  /// graph structures it is specialized to run in O(1).
+  ///
+  /// If the graph contains a \e nodeNum() member function and a
+  /// \e NodeNumTag tag then this function calls directly the member
   /// function to query the cardinality of the node set.
   template <typename Graph>
@@ -214,9 +209,9 @@
   ///
   /// This function counts the arcs in the graph.
-  /// The complexity of the function is <em>O</em>(<em>m</em>), but for some
-  /// graph structures it is specialized to run in <em>O</em>(1).
-  ///
-  /// \note If the graph contains a \c arcNum() member function and a
-  /// \c ArcNumTag tag then this function calls directly the member
+  /// The complexity of the function is O(e) but for some
+  /// graph structures it is specialized to run in O(1).
+  ///
+  /// If the graph contains a \e arcNum() member function and a
+  /// \e EdgeNumTag tag then this function calls directly the member
   /// function to query the cardinality of the arc set.
   template <typename Graph>
@@ -226,5 +221,4 @@
 
   // Edge counting:
-
   namespace _core_bits {
 
@@ -250,9 +244,9 @@
   ///
   /// This function counts the edges in the graph.
-  /// The complexity of the function is <em>O</em>(<em>m</em>), but for some
-  /// graph structures it is specialized to run in <em>O</em>(1).
-  ///
-  /// \note If the graph contains a \c edgeNum() member function and a
-  /// \c EdgeNumTag tag then this function calls directly the member
+  /// The complexity of the function is O(m) but for some
+  /// graph structures it is specialized to run in O(1).
+  ///
+  /// If the graph contains a \e edgeNum() member function and a
+  /// \e EdgeNumTag tag then this function calls directly the member
   /// function to query the cardinality of the edge set.
   template <typename Graph>
@@ -275,8 +269,8 @@
   ///
   /// This function counts the number of the out-arcs from node \c n
-  /// in the graph \c g.
+  /// in the graph.
   template <typename Graph>
-  inline int countOutArcs(const Graph& g,  const typename Graph::Node& n) {
-    return countNodeDegree<Graph, typename Graph::OutArcIt>(g, n);
+  inline int countOutArcs(const Graph& _g,  const typename Graph::Node& _n) {
+    return countNodeDegree<Graph, typename Graph::OutArcIt>(_g, _n);
   }
 
@@ -284,8 +278,8 @@
   ///
   /// This function counts the number of the in-arcs to node \c n
-  /// in the graph \c g.
+  /// in the graph.
   template <typename Graph>
-  inline int countInArcs(const Graph& g,  const typename Graph::Node& n) {
-    return countNodeDegree<Graph, typename Graph::InArcIt>(g, n);
+  inline int countInArcs(const Graph& _g,  const typename Graph::Node& _n) {
+    return countNodeDegree<Graph, typename Graph::InArcIt>(_g, _n);
   }
 
@@ -293,8 +287,8 @@
   ///
   /// This function counts the number of the inc-edges to node \c n
-  /// in the undirected graph \c g.
+  /// in the graph.
   template <typename Graph>
-  inline int countIncEdges(const Graph& g,  const typename Graph::Node& n) {
-    return countNodeDegree<Graph, typename Graph::IncEdgeIt>(g, n);
+  inline int countIncEdges(const Graph& _g,  const typename Graph::Node& _n) {
+    return countNodeDegree<Graph, typename Graph::IncEdgeIt>(_g, _n);
   }
 
@@ -310,10 +304,10 @@
 
     template <typename Digraph, typename Item, typename RefMap,
-              typename FromMap, typename ToMap>
+              typename ToMap, typename FromMap>
     class MapCopy : public MapCopyBase<Digraph, Item, RefMap> {
     public:
 
-      MapCopy(const FromMap& map, ToMap& tmap)
-        : _map(map), _tmap(tmap) {}
+      MapCopy(ToMap& tmap, const FromMap& map)
+        : _tmap(tmap), _map(map) {}
 
       virtual void copy(const Digraph& digraph, const RefMap& refMap) {
@@ -325,6 +319,6 @@
 
     private:
+      ToMap& _tmap;
       const FromMap& _map;
-      ToMap& _tmap;
     };
 
@@ -333,5 +327,5 @@
     public:
 
-      ItemCopy(const Item& item, It& it) : _item(item), _it(it) {}
+      ItemCopy(It& it, const Item& item) : _it(it), _item(item) {}
 
       virtual void copy(const Digraph&, const RefMap& refMap) {
@@ -340,6 +334,6 @@
 
     private:
+      It& _it;
       Item _item;
-      It& _it;
     };
 
@@ -382,5 +376,5 @@
     struct DigraphCopySelector {
       template <typename From, typename NodeRefMap, typename ArcRefMap>
-      static void copy(const From& from, Digraph &to,
+      static void copy(Digraph &to, const From& from,
                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
         for (typename From::NodeIt it(from); it != INVALID; ++it) {
@@ -400,5 +394,5 @@
     {
       template <typename From, typename NodeRefMap, typename ArcRefMap>
-      static void copy(const From& from, Digraph &to,
+      static void copy(Digraph &to, const From& from,
                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
         to.build(from, nodeRefMap, arcRefMap);
@@ -409,5 +403,5 @@
     struct GraphCopySelector {
       template <typename From, typename NodeRefMap, typename EdgeRefMap>
-      static void copy(const From& from, Graph &to,
+      static void copy(Graph &to, const From& from,
                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
         for (typename From::NodeIt it(from); it != INVALID; ++it) {
@@ -427,5 +421,5 @@
     {
       template <typename From, typename NodeRefMap, typename EdgeRefMap>
-      static void copy(const From& from, Graph &to,
+      static void copy(Graph &to, const From& from,
                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
         to.build(from, nodeRefMap, edgeRefMap);
@@ -438,37 +432,37 @@
   ///
   /// Class to copy a digraph to another digraph (duplicate a digraph). The
-  /// simplest way of using it is through the \c digraphCopy() function.
-  ///
-  /// This class not only make a copy of a digraph, but it can create
+  /// simplest way of using it is through the \c copyDigraph() function.
+  ///
+  /// This class not just make a copy of a graph, but it can create
   /// references and cross references between the nodes and arcs of
-  /// the two digraphs, and it can copy maps to use with the newly created
-  /// digraph.
-  ///
-  /// To make a copy from a digraph, first an instance of DigraphCopy
-  /// should be created, then the data belongs to the digraph should
+  /// the two graphs, it can copy maps for use with the newly created
+  /// graph and copy nodes and arcs.
+  ///
+  /// To make a copy from a graph, first an instance of DigraphCopy
+  /// should be created, then the data belongs to the graph should
   /// assigned to copy. In the end, the \c run() member should be
   /// called.
   ///
-  /// The next code copies a digraph with several data:
+  /// The next code copies a graph with several data:
   ///\code
-  ///  DigraphCopy<OrigGraph, NewGraph> cg(orig_graph, new_graph);
-  ///  // Create references for the nodes
+  ///  DigraphCopy<NewGraph, OrigGraph> dc(new_graph, orig_graph);
+  ///  // create a reference for the nodes
   ///  OrigGraph::NodeMap<NewGraph::Node> nr(orig_graph);
-  ///  cg.nodeRef(nr);
-  ///  // Create cross references (inverse) for the arcs
+  ///  dc.nodeRef(nr);
+  ///  // create a cross reference (inverse) for the arcs
   ///  NewGraph::ArcMap<OrigGraph::Arc> acr(new_graph);
-  ///  cg.arcCrossRef(acr);
-  ///  // Copy an arc map
+  ///  dc.arcCrossRef(acr);
+  ///  // copy an arc map
   ///  OrigGraph::ArcMap<double> oamap(orig_graph);
   ///  NewGraph::ArcMap<double> namap(new_graph);
-  ///  cg.arcMap(oamap, namap);
-  ///  // Copy a node
+  ///  dc.arcMap(namap, oamap);
+  ///  // copy a node
   ///  OrigGraph::Node on;
   ///  NewGraph::Node nn;
-  ///  cg.node(on, nn);
-  ///  // Execute copying
-  ///  cg.run();
+  ///  dc.node(nn, on);
+  ///  // Executions of copy
+  ///  dc.run();
   ///\endcode
-  template <typename From, typename To>
+  template <typename To, typename From>
   class DigraphCopy {
   private:
@@ -485,16 +479,18 @@
     typedef typename From::template ArcMap<TArc> ArcRefMap;
 
+
   public:
 
-    /// \brief Constructor of DigraphCopy.
-    ///
-    /// Constructor of DigraphCopy for copying the content of the
-    /// \c from digraph into the \c to digraph.
-    DigraphCopy(const From& from, To& to)
+
+    /// \brief Constructor for the DigraphCopy.
+    ///
+    /// It copies the content of the \c _from digraph into the
+    /// \c _to digraph.
+    DigraphCopy(To& to, const From& from)
       : _from(from), _to(to) {}
 
-    /// \brief Destructor of DigraphCopy
-    ///
-    /// Destructor of DigraphCopy.
+    /// \brief Destructor of the DigraphCopy
+    ///
+    /// Destructor of the DigraphCopy
     ~DigraphCopy() {
       for (int i = 0; i < int(_node_maps.size()); ++i) {
@@ -507,10 +503,10 @@
     }
 
-    /// \brief Copy the node references into the given map.
-    ///
-    /// This function copies the node references into the given map.
-    /// The parameter should be a map, whose key type is the Node type of
-    /// the source digraph, while the value type is the Node type of the
-    /// destination digraph.
+    /// \brief Copies the node references into the given map.
+    ///
+    /// Copies the node references into the given map. The parameter
+    /// should be a map, which key type is the Node type of the source
+    /// graph, while the value type is the Node type of the
+    /// destination graph.
     template <typename NodeRef>
     DigraphCopy& nodeRef(NodeRef& map) {
@@ -520,10 +516,10 @@
     }
 
-    /// \brief Copy the node cross references into the given map.
-    ///
-    /// This function copies the node cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Node type of the destination digraph, while the value type is
-    /// the Node type of the source digraph.
+    /// \brief Copies the node cross references into the given map.
+    ///
+    ///  Copies the node cross references (reverse references) into
+    ///  the given map. The parameter should be a map, which key type
+    ///  is the Node type of the destination graph, while the value type is
+    ///  the Node type of the source graph.
     template <typename NodeCrossRef>
     DigraphCopy& nodeCrossRef(NodeCrossRef& map) {
@@ -533,15 +529,13 @@
     }
 
-    /// \brief Make a copy of the given node map.
-    ///
-    /// This function makes a copy of the given node map for the newly
-    /// created digraph.
-    /// The key type of the new map \c tmap should be the Node type of the
-    /// destination digraph, and the key type of the original map \c map
-    /// should be the Node type of the source digraph.
-    template <typename FromMap, typename ToMap>
-    DigraphCopy& nodeMap(const FromMap& map, ToMap& tmap) {
+    /// \brief Make copy of the given map.
+    ///
+    /// Makes copy of the given map for the newly created digraph.
+    /// The new map's key type is the destination graph's node type,
+    /// and the copied map's key type is the source graph's node type.
+    template <typename ToMap, typename FromMap>
+    DigraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
       _node_maps.push_back(new _core_bits::MapCopy<From, Node,
-                           NodeRefMap, FromMap, ToMap>(map, tmap));
+                           NodeRefMap, ToMap, FromMap>(tmap, map));
       return *this;
     }
@@ -549,17 +543,14 @@
     /// \brief Make a copy of the given node.
     ///
-    /// This function makes a copy of the given node.
-    DigraphCopy& node(const Node& node, TNode& tnode) {
+    /// Make a copy of the given node.
+    DigraphCopy& node(TNode& tnode, const Node& snode) {
       _node_maps.push_back(new _core_bits::ItemCopy<From, Node,
-                           NodeRefMap, TNode>(node, tnode));
-      return *this;
-    }
-
-    /// \brief Copy the arc references into the given map.
-    ///
-    /// This function copies the arc references into the given map.
-    /// The parameter should be a map, whose key type is the Arc type of
-    /// the source digraph, while the value type is the Arc type of the
-    /// destination digraph.
+                           NodeRefMap, TNode>(tnode, snode));
+      return *this;
+    }
+
+    /// \brief Copies the arc references into the given map.
+    ///
+    /// Copies the arc references into the given map.
     template <typename ArcRef>
     DigraphCopy& arcRef(ArcRef& map) {
@@ -569,10 +560,8 @@
     }
 
-    /// \brief Copy the arc cross references into the given map.
-    ///
-    /// This function copies the arc cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Arc type of the destination digraph, while the value type is
-    /// the Arc type of the source digraph.
+    /// \brief Copies the arc cross references into the given map.
+    ///
+    ///  Copies the arc cross references (reverse references) into
+    ///  the given map.
     template <typename ArcCrossRef>
     DigraphCopy& arcCrossRef(ArcCrossRef& map) {
@@ -582,15 +571,14 @@
     }
 
-    /// \brief Make a copy of the given arc map.
-    ///
-    /// This function makes a copy of the given arc map for the newly
-    /// created digraph.
-    /// The key type of the new map \c tmap should be the Arc type of the
-    /// destination digraph, and the key type of the original map \c map
-    /// should be the Arc type of the source digraph.
-    template <typename FromMap, typename ToMap>
-    DigraphCopy& arcMap(const FromMap& map, ToMap& tmap) {
+    /// \brief Make copy of the given map.
+    ///
+    /// Makes copy of the given map for the newly created digraph.
+    /// The new map's key type is the to digraph's arc type,
+    /// and the copied map's key type is the from digraph's arc
+    /// type.
+    template <typename ToMap, typename FromMap>
+    DigraphCopy& arcMap(ToMap& tmap, const FromMap& map) {
       _arc_maps.push_back(new _core_bits::MapCopy<From, Arc,
-                          ArcRefMap, FromMap, ToMap>(map, tmap));
+                          ArcRefMap, ToMap, FromMap>(tmap, map));
       return *this;
     }
@@ -598,20 +586,19 @@
     /// \brief Make a copy of the given arc.
     ///
-    /// This function makes a copy of the given arc.
-    DigraphCopy& arc(const Arc& arc, TArc& tarc) {
+    /// Make a copy of the given arc.
+    DigraphCopy& arc(TArc& tarc, const Arc& sarc) {
       _arc_maps.push_back(new _core_bits::ItemCopy<From, Arc,
-                          ArcRefMap, TArc>(arc, tarc));
-      return *this;
-    }
-
-    /// \brief Execute copying.
-    ///
-    /// This function executes the copying of the digraph along with the
-    /// copying of the assigned data.
+                          ArcRefMap, TArc>(tarc, sarc));
+      return *this;
+    }
+
+    /// \brief Executes the copies.
+    ///
+    /// Executes the copies.
     void run() {
       NodeRefMap nodeRefMap(_from);
       ArcRefMap arcRefMap(_from);
       _core_bits::DigraphCopySelector<To>::
-        copy(_from, _to, nodeRefMap, arcRefMap);
+        copy(_to, _from, nodeRefMap, arcRefMap);
       for (int i = 0; i < int(_node_maps.size()); ++i) {
         _node_maps[i]->copy(_from, nodeRefMap);
@@ -624,12 +611,13 @@
   protected:
 
+
     const From& _from;
     To& _to;
 
     std::vector<_core_bits::MapCopyBase<From, Node, NodeRefMap>* >
-      _node_maps;
+    _node_maps;
 
     std::vector<_core_bits::MapCopyBase<From, Arc, ArcRefMap>* >
-      _arc_maps;
+    _arc_maps;
 
   };
@@ -637,20 +625,20 @@
   /// \brief Copy a digraph to another digraph.
   ///
-  /// This function copies a digraph to another digraph.
-  /// The complete usage of it is detailed in the DigraphCopy class, but
-  /// a short example shows a basic work:
+  /// Copy a digraph to another digraph. The complete usage of the
+  /// function is detailed in the DigraphCopy class, but a short
+  /// example shows a basic work:
   ///\code
-  /// digraphCopy(src, trg).nodeRef(nr).arcCrossRef(acr).run();
+  /// copyDigraph(trg, src).nodeRef(nr).arcCrossRef(ecr).run();
   ///\endcode
   ///
   /// After the copy the \c nr map will contain the mapping from the
   /// nodes of the \c from digraph to the nodes of the \c to digraph and
-  /// \c acr will contain the mapping from the arcs of the \c to digraph
+  /// \c ecr will contain the mapping from the arcs of the \c to digraph
   /// to the arcs of the \c from digraph.
   ///
   /// \see DigraphCopy
-  template <typename From, typename To>
-  DigraphCopy<From, To> digraphCopy(const From& from, To& to) {
-    return DigraphCopy<From, To>(from, to);
+  template <typename To, typename From>
+  DigraphCopy<To, From> copyDigraph(To& to, const From& from) {
+    return DigraphCopy<To, From>(to, from);
   }
 
@@ -658,10 +646,10 @@
   ///
   /// Class to copy a graph to another graph (duplicate a graph). The
-  /// simplest way of using it is through the \c graphCopy() function.
-  ///
-  /// This class not only make a copy of a graph, but it can create
+  /// simplest way of using it is through the \c copyGraph() function.
+  ///
+  /// This class not just make a copy of a graph, but it can create
   /// references and cross references between the nodes, edges and arcs of
-  /// the two graphs, and it can copy maps for using with the newly created
-  /// graph.
+  /// the two graphs, it can copy maps for use with the newly created
+  /// graph and copy nodes, edges and arcs.
   ///
   /// To make a copy from a graph, first an instance of GraphCopy
@@ -672,23 +660,23 @@
   /// The next code copies a graph with several data:
   ///\code
-  ///  GraphCopy<OrigGraph, NewGraph> cg(orig_graph, new_graph);
-  ///  // Create references for the nodes
+  ///  GraphCopy<NewGraph, OrigGraph> dc(new_graph, orig_graph);
+  ///  // create a reference for the nodes
   ///  OrigGraph::NodeMap<NewGraph::Node> nr(orig_graph);
-  ///  cg.nodeRef(nr);
-  ///  // Create cross references (inverse) for the edges
-  ///  NewGraph::EdgeMap<OrigGraph::Edge> ecr(new_graph);
-  ///  cg.edgeCrossRef(ecr);
-  ///  // Copy an edge map
-  ///  OrigGraph::EdgeMap<double> oemap(orig_graph);
-  ///  NewGraph::EdgeMap<double> nemap(new_graph);
-  ///  cg.edgeMap(oemap, nemap);
-  ///  // Copy a node
+  ///  dc.nodeRef(nr);
+  ///  // create a cross reference (inverse) for the edges
+  ///  NewGraph::EdgeMap<OrigGraph::Arc> ecr(new_graph);
+  ///  dc.edgeCrossRef(ecr);
+  ///  // copy an arc map
+  ///  OrigGraph::ArcMap<double> oamap(orig_graph);
+  ///  NewGraph::ArcMap<double> namap(new_graph);
+  ///  dc.arcMap(namap, oamap);
+  ///  // copy a node
   ///  OrigGraph::Node on;
   ///  NewGraph::Node nn;
-  ///  cg.node(on, nn);
-  ///  // Execute copying
-  ///  cg.run();
+  ///  dc.node(nn, on);
+  ///  // Executions of copy
+  ///  dc.run();
   ///\endcode
-  template <typename From, typename To>
+  template <typename To, typename From>
   class GraphCopy {
   private:
@@ -709,7 +697,7 @@
 
     struct ArcRefMap {
-      ArcRefMap(const From& from, const To& to,
+      ArcRefMap(const To& to, const From& from,
                 const EdgeRefMap& edge_ref, const NodeRefMap& node_ref)
-        : _from(from), _to(to),
+        : _to(to), _from(from),
           _edge_ref(edge_ref), _node_ref(node_ref) {}
 
@@ -725,22 +713,24 @@
       }
 
+      const To& _to;
       const From& _from;
-      const To& _to;
       const EdgeRefMap& _edge_ref;
       const NodeRefMap& _node_ref;
     };
 
+
   public:
 
-    /// \brief Constructor of GraphCopy.
-    ///
-    /// Constructor of GraphCopy for copying the content of the
-    /// \c from graph into the \c to graph.
-    GraphCopy(const From& from, To& to)
+
+    /// \brief Constructor for the GraphCopy.
+    ///
+    /// It copies the content of the \c _from graph into the
+    /// \c _to graph.
+    GraphCopy(To& to, const From& from)
       : _from(from), _to(to) {}
 
-    /// \brief Destructor of GraphCopy
-    ///
-    /// Destructor of GraphCopy.
+    /// \brief Destructor of the GraphCopy
+    ///
+    /// Destructor of the GraphCopy
     ~GraphCopy() {
       for (int i = 0; i < int(_node_maps.size()); ++i) {
@@ -753,12 +743,10 @@
         delete _edge_maps[i];
       }
-    }
-
-    /// \brief Copy the node references into the given map.
-    ///
-    /// This function copies the node references into the given map.
-    /// The parameter should be a map, whose key type is the Node type of
-    /// the source graph, while the value type is the Node type of the
-    /// destination graph.
+
+    }
+
+    /// \brief Copies the node references into the given map.
+    ///
+    /// Copies the node references into the given map.
     template <typename NodeRef>
     GraphCopy& nodeRef(NodeRef& map) {
@@ -768,10 +756,8 @@
     }
 
-    /// \brief Copy the node cross references into the given map.
-    ///
-    /// This function copies the node cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Node type of the destination graph, while the value type is
-    /// the Node type of the source graph.
+    /// \brief Copies the node cross references into the given map.
+    ///
+    ///  Copies the node cross references (reverse references) into
+    ///  the given map.
     template <typename NodeCrossRef>
     GraphCopy& nodeCrossRef(NodeCrossRef& map) {
@@ -781,15 +767,14 @@
     }
 
-    /// \brief Make a copy of the given node map.
-    ///
-    /// This function makes a copy of the given node map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Node type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Node type of the source graph.
-    template <typename FromMap, typename ToMap>
-    GraphCopy& nodeMap(const FromMap& map, ToMap& tmap) {
+    /// \brief Make copy of the given map.
+    ///
+    /// Makes copy of the given map for the newly created graph.
+    /// The new map's key type is the to graph's node type,
+    /// and the copied map's key type is the from graph's node
+    /// type.
+    template <typename ToMap, typename FromMap>
+    GraphCopy& nodeMap(ToMap& tmap, const FromMap& map) {
       _node_maps.push_back(new _core_bits::MapCopy<From, Node,
-                           NodeRefMap, FromMap, ToMap>(map, tmap));
+                           NodeRefMap, ToMap, FromMap>(tmap, map));
       return *this;
     }
@@ -797,17 +782,14 @@
     /// \brief Make a copy of the given node.
     ///
-    /// This function makes a copy of the given node.
-    GraphCopy& node(const Node& node, TNode& tnode) {
+    /// Make a copy of the given node.
+    GraphCopy& node(TNode& tnode, const Node& snode) {
       _node_maps.push_back(new _core_bits::ItemCopy<From, Node,
-                           NodeRefMap, TNode>(node, tnode));
-      return *this;
-    }
-
-    /// \brief Copy the arc references into the given map.
-    ///
-    /// This function copies the arc references into the given map.
-    /// The parameter should be a map, whose key type is the Arc type of
-    /// the source graph, while the value type is the Arc type of the
-    /// destination graph.
+                           NodeRefMap, TNode>(tnode, snode));
+      return *this;
+    }
+
+    /// \brief Copies the arc references into the given map.
+    ///
+    /// Copies the arc references into the given map.
     template <typename ArcRef>
     GraphCopy& arcRef(ArcRef& map) {
@@ -817,10 +799,8 @@
     }
 
-    /// \brief Copy the arc cross references into the given map.
-    ///
-    /// This function copies the arc cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Arc type of the destination graph, while the value type is
-    /// the Arc type of the source graph.
+    /// \brief Copies the arc cross references into the given map.
+    ///
+    ///  Copies the arc cross references (reverse references) into
+    ///  the given map.
     template <typename ArcCrossRef>
     GraphCopy& arcCrossRef(ArcCrossRef& map) {
@@ -830,15 +810,14 @@
     }
 
-    /// \brief Make a copy of the given arc map.
-    ///
-    /// This function makes a copy of the given arc map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Arc type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Arc type of the source graph.
-    template <typename FromMap, typename ToMap>
-    GraphCopy& arcMap(const FromMap& map, ToMap& tmap) {
+    /// \brief Make copy of the given map.
+    ///
+    /// Makes copy of the given map for the newly created graph.
+    /// The new map's key type is the to graph's arc type,
+    /// and the copied map's key type is the from graph's arc
+    /// type.
+    template <typename ToMap, typename FromMap>
+    GraphCopy& arcMap(ToMap& tmap, const FromMap& map) {
       _arc_maps.push_back(new _core_bits::MapCopy<From, Arc,
-                          ArcRefMap, FromMap, ToMap>(map, tmap));
+                          ArcRefMap, ToMap, FromMap>(tmap, map));
       return *this;
     }
@@ -846,17 +825,14 @@
     /// \brief Make a copy of the given arc.
     ///
-    /// This function makes a copy of the given arc.
-    GraphCopy& arc(const Arc& arc, TArc& tarc) {
+    /// Make a copy of the given arc.
+    GraphCopy& arc(TArc& tarc, const Arc& sarc) {
       _arc_maps.push_back(new _core_bits::ItemCopy<From, Arc,
-                          ArcRefMap, TArc>(arc, tarc));
-      return *this;
-    }
-
-    /// \brief Copy the edge references into the given map.
-    ///
-    /// This function copies the edge references into the given map.
-    /// The parameter should be a map, whose key type is the Edge type of
-    /// the source graph, while the value type is the Edge type of the
-    /// destination graph.
+                          ArcRefMap, TArc>(tarc, sarc));
+      return *this;
+    }
+
+    /// \brief Copies the edge references into the given map.
+    ///
+    /// Copies the edge references into the given map.
     template <typename EdgeRef>
     GraphCopy& edgeRef(EdgeRef& map) {
@@ -866,10 +842,8 @@
     }
 
-    /// \brief Copy the edge cross references into the given map.
-    ///
-    /// This function copies the edge cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Edge type of the destination graph, while the value type is
-    /// the Edge type of the source graph.
+    /// \brief Copies the edge cross references into the given map.
+    ///
+    /// Copies the edge cross references (reverse
+    /// references) into the given map.
     template <typename EdgeCrossRef>
     GraphCopy& edgeCrossRef(EdgeCrossRef& map) {
@@ -879,15 +853,14 @@
     }
 
-    /// \brief Make a copy of the given edge map.
-    ///
-    /// This function makes a copy of the given edge map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Edge type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Edge type of the source graph.
-    template <typename FromMap, typename ToMap>
-    GraphCopy& edgeMap(const FromMap& map, ToMap& tmap) {
+    /// \brief Make copy of the given map.
+    ///
+    /// Makes copy of the given map for the newly created graph.
+    /// The new map's key type is the to graph's edge type,
+    /// and the copied map's key type is the from graph's edge
+    /// type.
+    template <typename ToMap, typename FromMap>
+    GraphCopy& edgeMap(ToMap& tmap, const FromMap& map) {
       _edge_maps.push_back(new _core_bits::MapCopy<From, Edge,
-                           EdgeRefMap, FromMap, ToMap>(map, tmap));
+                           EdgeRefMap, ToMap, FromMap>(tmap, map));
       return *this;
     }
@@ -895,21 +868,20 @@
     /// \brief Make a copy of the given edge.
     ///
-    /// This function makes a copy of the given edge.
-    GraphCopy& edge(const Edge& edge, TEdge& tedge) {
+    /// Make a copy of the given edge.
+    GraphCopy& edge(TEdge& tedge, const Edge& sedge) {
       _edge_maps.push_back(new _core_bits::ItemCopy<From, Edge,
-                           EdgeRefMap, TEdge>(edge, tedge));
-      return *this;
-    }
-
-    /// \brief Execute copying.
-    ///
-    /// This function executes the copying of the graph along with the
-    /// copying of the assigned data.
+                           EdgeRefMap, TEdge>(tedge, sedge));
+      return *this;
+    }
+
+    /// \brief Executes the copies.
+    ///
+    /// Executes the copies.
     void run() {
       NodeRefMap nodeRefMap(_from);
       EdgeRefMap edgeRefMap(_from);
-      ArcRefMap arcRefMap(_from, _to, edgeRefMap, nodeRefMap);
+      ArcRefMap arcRefMap(_to, _from, edgeRefMap, nodeRefMap);
       _core_bits::GraphCopySelector<To>::
-        copy(_from, _to, nodeRefMap, edgeRefMap);
+        copy(_to, _from, nodeRefMap, edgeRefMap);
       for (int i = 0; i < int(_node_maps.size()); ++i) {
         _node_maps[i]->copy(_from, nodeRefMap);
@@ -929,11 +901,11 @@
 
     std::vector<_core_bits::MapCopyBase<From, Node, NodeRefMap>* >
-      _node_maps;
+    _node_maps;
 
     std::vector<_core_bits::MapCopyBase<From, Arc, ArcRefMap>* >
-      _arc_maps;
+    _arc_maps;
 
     std::vector<_core_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
-      _edge_maps;
+    _edge_maps;
 
   };
@@ -941,21 +913,21 @@
   /// \brief Copy a graph to another graph.
   ///
-  /// This function copies a graph to another graph.
-  /// The complete usage of it is detailed in the GraphCopy class,
-  /// but a short example shows a basic work:
+  /// Copy a graph to another graph. The complete usage of the
+  /// function is detailed in the GraphCopy class, but a short
+  /// example shows a basic work:
   ///\code
-  /// graphCopy(src, trg).nodeRef(nr).edgeCrossRef(ecr).run();
+  /// copyGraph(trg, src).nodeRef(nr).arcCrossRef(ecr).run();
   ///\endcode
   ///
   /// After the copy the \c nr map will contain the mapping from the
   /// nodes of the \c from graph to the nodes of the \c to graph and
-  /// \c ecr will contain the mapping from the edges of the \c to graph
-  /// to the edges of the \c from graph.
+  /// \c ecr will contain the mapping from the arcs of the \c to graph
+  /// to the arcs of the \c from graph.
   ///
   /// \see GraphCopy
-  template <typename From, typename To>
-  GraphCopy<From, To>
-  graphCopy(const From& from, To& to) {
-    return GraphCopy<From, To>(from, to);
+  template <typename To, typename From>
+  GraphCopy<To, From>
+  copyGraph(To& to, const From& from) {
+    return GraphCopy<To, From>(to, from);
   }
 
@@ -982,5 +954,5 @@
     struct FindArcSelector<
       Graph,
-      typename enable_if<typename Graph::FindArcTag, void>::type>
+      typename enable_if<typename Graph::FindEdgeTag, void>::type>
     {
       typedef typename Graph::Node Node;
@@ -992,8 +964,7 @@
   }
 
-  /// \brief Find an arc between two nodes of a digraph.
-  ///
-  /// This function finds an arc from node \c u to node \c v in the
-  /// digraph \c g.
+  /// \brief Finds an arc between two nodes of a graph.
+  ///
+  /// Finds an arc from node \c u to node \c v in graph \c g.
   ///
   /// If \c prev is \ref INVALID (this is the default value), then
@@ -1004,14 +975,13 @@
   /// Thus you can iterate through each arc from \c u to \c v as it follows.
   ///\code
-  /// for(Arc e = findArc(g,u,v); e != INVALID; e = findArc(g,u,v,e)) {
+  /// for(Arc e=findArc(g,u,v);e!=INVALID;e=findArc(g,u,v,e)) {
   ///   ...
   /// }
   ///\endcode
   ///
-  /// \note \ref ConArcIt provides iterator interface for the same
-  /// functionality.
-  ///
+  ///\sa ArcLookUp
+  ///\sa AllArcLookUp
+  ///\sa DynArcLookUp
   ///\sa ConArcIt
-  ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
   template <typename Graph>
   inline typename Graph::Arc
@@ -1021,8 +991,8 @@
   }
 
-  /// \brief Iterator for iterating on parallel arcs connecting the same nodes.
-  ///
-  /// Iterator for iterating on parallel arcs connecting the same nodes. It is
-  /// a higher level interface for the \ref findArc() function. You can
+  /// \brief Iterator for iterating on arcs connected the same nodes.
+  ///
+  /// Iterator for iterating on arcs connected the same nodes. It is
+  /// higher level interface for the findArc() function. You can
   /// use it the following way:
   ///\code
@@ -1033,5 +1003,7 @@
   ///
   ///\sa findArc()
-  ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
+  ///\sa ArcLookUp
+  ///\sa AllArcLookUp
+  ///\sa DynArcLookUp
   template <typename _Graph>
   class ConArcIt : public _Graph::Arc {
@@ -1046,6 +1018,6 @@
     /// \brief Constructor.
     ///
-    /// Construct a new ConArcIt iterating on the arcs that
-    /// connects nodes \c u and \c v.
+    /// Construct a new ConArcIt iterating on the arcs which
+    /// connects the \c u and \c v node.
     ConArcIt(const Graph& g, Node u, Node v) : _graph(g) {
       Parent::operator=(findArc(_graph, u, v));
@@ -1054,5 +1026,6 @@
     /// \brief Constructor.
     ///
-    /// Construct a new ConArcIt that continues the iterating from arc \c a.
+    /// Construct a new ConArcIt which continues the iterating from
+    /// the \c e arc.
     ConArcIt(const Graph& g, Arc a) : Parent(a), _graph(g) {}
 
@@ -1115,27 +1088,25 @@
   }
 
-  /// \brief Find an edge between two nodes of a graph.
-  ///
-  /// This function finds an edge from node \c u to node \c v in graph \c g.
-  /// If node \c u and node \c v is equal then each loop edge
+  /// \brief Finds an edge between two nodes of a graph.
+  ///
+  /// Finds an edge from node \c u to node \c v in graph \c g.
+  /// If the node \c u and node \c v is equal then each loop edge
   /// will be enumerated once.
   ///
   /// If \c prev is \ref INVALID (this is the default value), then
-  /// it finds the first edge from \c u to \c v. Otherwise it looks for
-  /// the next edge from \c u to \c v after \c prev.
-  /// \return The found edge or \ref INVALID if there is no such an edge.
-  ///
-  /// Thus you can iterate through each edge between \c u and \c v
-  /// as it follows.
+  /// it finds the first arc from \c u to \c v. Otherwise it looks for
+  /// the next arc from \c u to \c v after \c prev.
+  /// \return The found arc or \ref INVALID if there is no such an arc.
+  ///
+  /// Thus you can iterate through each arc from \c u to \c v as it follows.
   ///\code
-  /// for(Edge e = findEdge(g,u,v); e != INVALID; e = findEdge(g,u,v,e)) {
+  /// for(Edge e = findEdge(g,u,v); e != INVALID;
+  ///     e = findEdge(g,u,v,e)) {
   ///   ...
   /// }
   ///\endcode
   ///
-  /// \note \ref ConEdgeIt provides iterator interface for the same
-  /// functionality.
-  ///
   ///\sa ConEdgeIt
+
   template <typename Graph>
   inline typename Graph::Edge
@@ -1145,11 +1116,11 @@
   }
 
-  /// \brief Iterator for iterating on parallel edges connecting the same nodes.
-  ///
-  /// Iterator for iterating on parallel edges connecting the same nodes.
-  /// It is a higher level interface for the findEdge() function. You can
+  /// \brief Iterator for iterating on edges connected the same nodes.
+  ///
+  /// Iterator for iterating on edges connected the same nodes. It is
+  /// higher level interface for the findEdge() function. You can
   /// use it the following way:
   ///\code
-  /// for (ConEdgeIt<Graph> it(g, u, v); it != INVALID; ++it) {
+  /// for (ConEdgeIt<Graph> it(g, src, trg); it != INVALID; ++it) {
   ///   ...
   /// }
@@ -1169,6 +1140,6 @@
     /// \brief Constructor.
     ///
-    /// Construct a new ConEdgeIt iterating on the edges that
-    /// connects nodes \c u and \c v.
+    /// Construct a new ConEdgeIt iterating on the edges which
+    /// connects the \c u and \c v node.
     ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g) {
       Parent::operator=(findEdge(_graph, u, v));
@@ -1177,5 +1148,6 @@
     /// \brief Constructor.
     ///
-    /// Construct a new ConEdgeIt that continues iterating from edge \c e.
+    /// Construct a new ConEdgeIt which continues the iterating from
+    /// the \c e edge.
     ConEdgeIt(const Graph& g, Edge e) : Parent(e), _graph(g) {}
 
@@ -1193,19 +1165,19 @@
 
 
-  ///Dynamic arc look-up between given endpoints.
+  ///Dynamic arc look up between given endpoints.
 
   ///Using this class, you can find an arc in a digraph from a given
-  ///source to a given target in amortized time <em>O</em>(log<em>d</em>),
+  ///source to a given target in amortized time <em>O(log d)</em>,
   ///where <em>d</em> is the out-degree of the source node.
   ///
   ///It is possible to find \e all parallel arcs between two nodes with
-  ///the \c operator() member.
-  ///
-  ///This is a dynamic data structure. Consider to use \ref ArcLookUp or
-  ///\ref AllArcLookUp if your digraph is not changed so frequently.
-  ///
-  ///This class uses a self-adjusting binary search tree, the Splay tree
-  ///of Sleator and Tarjan to guarantee the logarithmic amortized
-  ///time bound for arc look-ups. This class also guarantees the
+  ///the \c findFirst() and \c findNext() members.
+  ///
+  ///See the \ref ArcLookUp and \ref AllArcLookUp classes if your
+  ///digraph is not changed so frequently.
+  ///
+  ///This class uses a self-adjusting binary search tree, Sleator's
+  ///and Tarjan's Splay tree for guarantee the logarithmic amortized
+  ///time bound for arc lookups. This class also guarantees the
   ///optimal time bound in a constant factor for any distribution of
   ///queries.
@@ -1409,5 +1381,4 @@
           _right.set(e, _right[arc]);
           _parent.set(_right[arc], e);
-          _parent.set(e, _parent[arc]);
 
           if (_parent[arc] != INVALID) {
@@ -1448,6 +1419,6 @@
       for(NodeIt n(_g);n!=INVALID;++n) {
         std::vector<Arc> v;
-        for(OutArcIt a(_g,n);a!=INVALID;++a) v.push_back(a);
-        if (!v.empty()) {
+        for(OutArcIt e(_g,n);e!=INVALID;++e) v.push_back(e);
+        if(v.size()) {
           std::sort(v.begin(),v.end(),ArcLess(_g));
           Arc head = refreshRec(v,0,v.size()-1);
@@ -1531,86 +1502,115 @@
     ///Find an arc between two nodes.
 
-    ///Find an arc between two nodes.
-    ///\param s The source node.
-    ///\param t The target node.
-    ///\param p The previous arc between \c s and \c t. It it is INVALID or
-    ///not given, the operator finds the first appropriate arc.
-    ///\return An arc from \c s to \c t after \c p or
-    ///\ref INVALID if there is no more.
-    ///
-    ///For example, you can count the number of arcs from \c u to \c v in the
-    ///following way.
-    ///\code
-    ///DynArcLookUp<ListDigraph> ae(g);
-    ///...
-    ///int n = 0;
-    ///for(Arc a = ae(u,v); a != INVALID; a = ae(u,v,a)) n++;
-    ///\endcode
-    ///
-    ///Finding the arcs take at most <em>O</em>(log<em>d</em>)
-    ///amortized time, specifically, the time complexity of the lookups
-    ///is equal to the optimal search tree implementation for the
-    ///current query distribution in a constant factor.
-    ///
-    ///\note This is a dynamic data structure, therefore the data
-    ///structure is updated after each graph alteration. Thus although
-    ///this data structure is theoretically faster than \ref ArcLookUp
-    ///and \ref AllArcLookUp, it often provides worse performance than
-    ///them.
-    Arc operator()(Node s, Node t, Arc p = INVALID) const  {
-      if (p == INVALID) {
-        Arc a = _head[s];
-        if (a == INVALID) return INVALID;
-        Arc r = INVALID;
-        while (true) {
-          if (_g.target(a) < t) {
-            if (_right[a] == INVALID) {
-              const_cast<DynArcLookUp&>(*this).splay(a);
-              return r;
-            } else {
-              a = _right[a];
-            }
+    ///Find an arc between two nodes in time <em>O(</em>log<em>d)</em>, where
+    /// <em>d</em> is the number of outgoing arcs of \c s.
+    ///\param s The source node
+    ///\param t The target node
+    ///\return An arc from \c s to \c t if there exists,
+    ///\ref INVALID otherwise.
+    Arc operator()(Node s, Node t) const
+    {
+      Arc a = _head[s];
+      while (true) {
+        if (_g.target(a) == t) {
+          const_cast<DynArcLookUp&>(*this).splay(a);
+          return a;
+        } else if (t < _g.target(a)) {
+          if (_left[a] == INVALID) {
+            const_cast<DynArcLookUp&>(*this).splay(a);
+            return INVALID;
           } else {
-            if (_g.target(a) == t) {
-              r = a;
-            }
-            if (_left[a] == INVALID) {
-              const_cast<DynArcLookUp&>(*this).splay(a);
-              return r;
-            } else {
-              a = _left[a];
-            }
-          }
-        }
-      } else {
-        Arc a = p;
-        if (_right[a] != INVALID) {
-          a = _right[a];
-          while (_left[a] != INVALID) {
             a = _left[a];
           }
-          const_cast<DynArcLookUp&>(*this).splay(a);
-        } else {
-          while (_parent[a] != INVALID && _right[_parent[a]] ==  a) {
-            a = _parent[a];
-          }
-          if (_parent[a] == INVALID) {
+        } else  {
+          if (_right[a] == INVALID) {
+            const_cast<DynArcLookUp&>(*this).splay(a);
             return INVALID;
           } else {
-            a = _parent[a];
+            a = _right[a];
+          }
+        }
+      }
+    }
+
+    ///Find the first arc between two nodes.
+
+    ///Find the first arc between two nodes in time
+    /// <em>O(</em>log<em>d)</em>, where <em>d</em> is the number of
+    /// outgoing arcs of \c s.
+    ///\param s The source node
+    ///\param t The target node
+    ///\return An arc from \c s to \c t if there exists, \ref INVALID
+    /// otherwise.
+    Arc findFirst(Node s, Node t) const
+    {
+      Arc a = _head[s];
+      Arc r = INVALID;
+      while (true) {
+        if (_g.target(a) < t) {
+          if (_right[a] == INVALID) {
             const_cast<DynArcLookUp&>(*this).splay(a);
+            return r;
+          } else {
+            a = _right[a];
           }
-        }
-        if (_g.target(a) == t) return a;
-        else return INVALID;
-      }
+        } else {
+          if (_g.target(a) == t) {
+            r = a;
+          }
+          if (_left[a] == INVALID) {
+            const_cast<DynArcLookUp&>(*this).splay(a);
+            return r;
+          } else {
+            a = _left[a];
+          }
+        }
+      }
+    }
+
+    ///Find the next arc between two nodes.
+
+    ///Find the next arc between two nodes in time
+    /// <em>O(</em>log<em>d)</em>, where <em>d</em> is the number of
+    /// outgoing arcs of \c s.
+    ///\param s The source node
+    ///\param t The target node
+    ///\return An arc from \c s to \c t if there exists, \ref INVALID
+    /// otherwise.
+
+    ///\note If \c e is not the result of the previous \c findFirst()
+    ///operation then the amorized time bound can not be guaranteed.
+#ifdef DOXYGEN
+    Arc findNext(Node s, Node t, Arc a) const
+#else
+    Arc findNext(Node, Node t, Arc a) const
+#endif
+    {
+      if (_right[a] != INVALID) {
+        a = _right[a];
+        while (_left[a] != INVALID) {
+          a = _left[a];
+        }
+        const_cast<DynArcLookUp&>(*this).splay(a);
+      } else {
+        while (_parent[a] != INVALID && _right[_parent[a]] ==  a) {
+          a = _parent[a];
+        }
+        if (_parent[a] == INVALID) {
+          return INVALID;
+        } else {
+          a = _parent[a];
+          const_cast<DynArcLookUp&>(*this).splay(a);
+        }
+      }
+      if (_g.target(a) == t) return a;
+      else return INVALID;
     }
 
   };
 
-  ///Fast arc look-up between given endpoints.
+  ///Fast arc look up between given endpoints.
 
   ///Using this class, you can find an arc in a digraph from a given
-  ///source to a given target in time <em>O</em>(log<em>d</em>),
+  ///source to a given target in time <em>O(log d)</em>,
   ///where <em>d</em> is the out-degree of the source node.
   ///
@@ -1618,8 +1618,8 @@
   ///Use \ref AllArcLookUp for this purpose.
   ///
-  ///\warning This class is static, so you should call refresh() (or at
-  ///least refresh(Node)) to refresh this data structure whenever the
-  ///digraph changes. This is a time consuming (superlinearly proportional
-  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
+  ///\warning This class is static, so you should refresh() (or at least
+  ///refresh(Node)) this data structure
+  ///whenever the digraph changes. This is a time consuming (superlinearly
+  ///proportional (<em>O(m</em>log<em>m)</em>) to the number of arcs).
   ///
   ///\tparam G The type of the underlying digraph.
@@ -1670,10 +1670,10 @@
     }
   public:
-    ///Refresh the search data structure at a node.
+    ///Refresh the data structure at a node.
 
     ///Build up the search database of node \c n.
     ///
-    ///It runs in time <em>O</em>(<em>d</em> log<em>d</em>), where <em>d</em>
-    ///is the number of the outgoing arcs of \c n.
+    ///It runs in time <em>O(d</em>log<em>d)</em>, where <em>d</em> is
+    ///the number of the outgoing arcs of \c n.
     void refresh(Node n)
     {
@@ -1691,7 +1691,8 @@
     ///\ref refresh(Node) "refresh(n)" for each node \c n.
     ///
-    ///It runs in time <em>O</em>(<em>m</em> log<em>D</em>), where <em>m</em> is
-    ///the number of the arcs in the digraph and <em>D</em> is the maximum
+    ///It runs in time <em>O(m</em>log<em>D)</em>, where <em>m</em> is
+    ///the number of the arcs of \c n and <em>D</em> is the maximum
     ///out-degree of the digraph.
+
     void refresh()
     {
@@ -1701,8 +1702,8 @@
     ///Find an arc between two nodes.
 
-    ///Find an arc between two nodes in time <em>O</em>(log<em>d</em>),
-    ///where <em>d</em> is the number of outgoing arcs of \c s.
-    ///\param s The source node.
-    ///\param t The target node.
+    ///Find an arc between two nodes in time <em>O(</em>log<em>d)</em>, where
+    /// <em>d</em> is the number of outgoing arcs of \c s.
+    ///\param s The source node
+    ///\param t The target node
     ///\return An arc from \c s to \c t if there exists,
     ///\ref INVALID otherwise.
@@ -1710,5 +1711,7 @@
     ///\warning If you change the digraph, refresh() must be called before using
     ///this operator. If you change the outgoing arcs of
-    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
+    ///a single node \c n, then
+    ///\ref refresh(Node) "refresh(n)" is enough.
+    ///
     Arc operator()(Node s, Node t) const
     {
@@ -1722,14 +1725,13 @@
   };
 
-  ///Fast look-up of all arcs between given endpoints.
+  ///Fast look up of all arcs between given endpoints.
 
   ///This class is the same as \ref ArcLookUp, with the addition
-  ///that it makes it possible to find all parallel arcs between given
-  ///endpoints.
-  ///
-  ///\warning This class is static, so you should call refresh() (or at
-  ///least refresh(Node)) to refresh this data structure whenever the
-  ///digraph changes. This is a time consuming (superlinearly proportional
-  ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs).
+  ///that it makes it possible to find all arcs between given endpoints.
+  ///
+  ///\warning This class is static, so you should refresh() (or at least
+  ///refresh(Node)) this data structure
+  ///whenever the digraph changes. This is a time consuming (superlinearly
+  ///proportional (<em>O(m</em>log<em>m)</em>) to the number of arcs).
   ///
   ///\tparam G The type of the underlying digraph.
@@ -1755,4 +1757,5 @@
       else {
         next=refreshNext(_right[head],next);
+//         _next[head]=next;
         _next[head]=( next!=INVALID && _g.target(next)==_g.target(head))
           ? next : INVALID;
@@ -1779,6 +1782,7 @@
     ///Build up the search database of node \c n.
     ///
-    ///It runs in time <em>O</em>(<em>d</em> log<em>d</em>), where <em>d</em> is
+    ///It runs in time <em>O(d</em>log<em>d)</em>, where <em>d</em> is
     ///the number of the outgoing arcs of \c n.
+
     void refresh(Node n)
     {
@@ -1792,7 +1796,8 @@
     ///\ref refresh(Node) "refresh(n)" for each node \c n.
     ///
-    ///It runs in time <em>O</em>(<em>m</em> log<em>D</em>), where <em>m</em> is
-    ///the number of the arcs in the digraph and <em>D</em> is the maximum
+    ///It runs in time <em>O(m</em>log<em>D)</em>, where <em>m</em> is
+    ///the number of the arcs of \c n and <em>D</em> is the maximum
     ///out-degree of the digraph.
+
     void refresh()
     {
@@ -1803,6 +1808,6 @@
 
     ///Find an arc between two nodes.
-    ///\param s The source node.
-    ///\param t The target node.
+    ///\param s The source node
+    ///\param t The target node
     ///\param prev The previous arc between \c s and \c t. It it is INVALID or
     ///not given, the operator finds the first appropriate arc.
@@ -1815,15 +1820,16 @@
     ///AllArcLookUp<ListDigraph> ae(g);
     ///...
-    ///int n = 0;
-    ///for(Arc a = ae(u,v); a != INVALID; a=ae(u,v,a)) n++;
+    ///int n=0;
+    ///for(Arc e=ae(u,v);e!=INVALID;e=ae(u,v,e)) n++;
     ///\endcode
     ///
-    ///Finding the first arc take <em>O</em>(log<em>d</em>) time,
-    ///where <em>d</em> is the number of outgoing arcs of \c s. Then the
+    ///Finding the first arc take <em>O(</em>log<em>d)</em> time, where
+    /// <em>d</em> is the number of outgoing arcs of \c s. Then, the
     ///consecutive arcs are found in constant time.
     ///
     ///\warning If you change the digraph, refresh() must be called before using
     ///this operator. If you change the outgoing arcs of
-    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
+    ///a single node \c n, then
+    ///\ref refresh(Node) "refresh(n)" is enough.
     ///
 #ifdef DOXYGEN
Index: lemon/dfs.h
===================================================================
--- lemon/dfs.h	(revision 327)
+++ lemon/dfs.h	(revision 220)
@@ -22,5 +22,5 @@
 ///\ingroup search
 ///\file
-///\brief DFS algorithm.
+///\brief Dfs algorithm.
 
 #include <lemon/list_graph.h>
@@ -29,7 +29,9 @@
 #include <lemon/error.h>
 #include <lemon/maps.h>
-#include <lemon/path.h>
+
+#include <lemon/concept_check.h>
 
 namespace lemon {
+
 
   ///Default traits class of Dfs class.
@@ -40,22 +42,22 @@
   struct DfsDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
-
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores the last
     ///arcs of the %DFS paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the %DFS paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef typename Digraph::template NodeMap<typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
+    ///This function instantiates a \ref PredMap.
+    ///\param G is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient to initialize
+    static PredMap *createPredMap(const GR &G)
+    {
+      return new PredMap(G);
     }
 
@@ -64,47 +66,48 @@
     ///The type of the map that indicates which nodes are processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \ref ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap
+    ///we would like to define the \ref ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
     ///The type of the map that indicates which nodes are reached.
 
     ///The type of the map that indicates which nodes are reached.
-    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
     ///Instantiates a ReachedMap.
 
-    ///This function instantiates a ReachedMap.
-    ///\param g is the digraph, to which
-    ///we would like to define the ReachedMap.
-    static ReachedMap *createReachedMap(const Digraph &g)
-    {
-      return new ReachedMap(g);
-    }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///This function instantiates a \ref ReachedMap.
+    ///\param G is the digraph, to which
+    ///we would like to define the \ref ReachedMap.
+    static ReachedMap *createReachedMap(const GR &G)
+    {
+      return new ReachedMap(G);
+    }
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///
     typedef typename Digraph::template NodeMap<int> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///DistMap.
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
+    ///This function instantiates a \ref DistMap.
+    ///\param G is the digraph, to which we would like to define
+    ///the \ref DistMap
+    static DistMap *createDistMap(const GR &G)
+    {
+      return new DistMap(G);
     }
   };
@@ -115,11 +118,7 @@
   ///This class provides an efficient implementation of the %DFS algorithm.
   ///
-  ///There is also a \ref dfs() "function-type interface" for the DFS
-  ///algorithm, which is convenient in the simplier cases and it can be
-  ///used easier.
-  ///
-  ///\tparam GR The type of the digraph the algorithm runs on.
-  ///The default value is \ref ListDigraph. The value of GR is not used
-  ///directly by \ref Dfs, it is only passed to \ref DfsDefaultTraits.
+  ///\tparam GR The digraph type the algorithm runs on. The default value is
+  ///\ref ListDigraph. The value of GR is not used directly by Dfs, it
+  ///is only passed to \ref DfsDefaultTraits.
   ///\tparam TR Traits class to set various data types used by the algorithm.
   ///The default traits class is
@@ -136,47 +135,56 @@
   class Dfs {
   public:
-
-    ///The type of the digraph the algorithm runs on.
+    /**
+     * \brief \ref Exception for uninitialized parameters.
+     *
+     * This error represents problems in the initialization
+     * of the parameters of the algorithms.
+     */
+    class UninitializedParameter : public lemon::UninitializedParameter {
+    public:
+      virtual const char* what() const throw() {
+        return "lemon::Dfs::UninitializedParameter";
+      }
+    };
+
+    typedef TR Traits;
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
-
-    ///\brief The type of the map that stores the predecessor arcs of the
-    ///DFS paths.
+    ///\e
+    typedef typename Digraph::Node Node;
+    ///\e
+    typedef typename Digraph::NodeIt NodeIt;
+    ///\e
+    typedef typename Digraph::Arc Arc;
+    ///\e
+    typedef typename Digraph::OutArcIt OutArcIt;
+
+    ///\brief The type of the map that stores the last
+    ///arcs of the %DFS paths.
     typedef typename TR::PredMap PredMap;
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map indicating which nodes are reached.
+    typedef typename TR::ReachedMap ReachedMap;
+    ///The type of the map indicating which nodes are processed.
+    typedef typename TR::ProcessedMap ProcessedMap;
+    ///The type of the map that stores the dists of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///The type of the map that indicates which nodes are reached.
-    typedef typename TR::ReachedMap ReachedMap;
-    ///The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the paths.
-    typedef PredMapPath<Digraph, PredMap> Path;
-
-    ///The traits class.
-    typedef TR Traits;
-
   private:
-
-    typedef typename Digraph::Node Node;
-    typedef typename Digraph::NodeIt NodeIt;
-    typedef typename Digraph::Arc Arc;
-    typedef typename Digraph::OutArcIt OutArcIt;
-
-    //Pointer to the underlying digraph.
+    /// Pointer to the underlying digraph.
     const Digraph *G;
-    //Pointer to the map of predecessor arcs.
+    ///Pointer to the map of predecessors arcs.
     PredMap *_pred;
-    //Indicates if _pred is locally allocated (true) or not.
+    ///Indicates if \ref _pred is locally allocated (\c true) or not.
     bool local_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     DistMap *_dist;
-    //Indicates if _dist is locally allocated (true) or not.
+    ///Indicates if \ref _dist is locally allocated (\c true) or not.
     bool local_dist;
-    //Pointer to the map of reached status of the nodes.
+    ///Pointer to the map of reached status of the nodes.
     ReachedMap *_reached;
-    //Indicates if _reached is locally allocated (true) or not.
+    ///Indicates if \ref _reached is locally allocated (\c true) or not.
     bool local_reached;
-    //Pointer to the map of processed status of the nodes.
+    ///Pointer to the map of processed status of the nodes.
     ProcessedMap *_processed;
-    //Indicates if _processed is locally allocated (true) or not.
+    ///Indicates if \ref _processed is locally allocated (\c true) or not.
     bool local_processed;
 
@@ -184,5 +192,7 @@
     int _stack_head;
 
-    //Creates the maps if necessary.
+    ///Creates the maps if necessary.
+
+    ///\todo Better memory allocation (instead of new).
     void create_maps()
     {
@@ -218,95 +228,93 @@
 
     template <class T>
-    struct SetPredMapTraits : public Traits {
+    struct DefPredMapTraits : public Traits {
       typedef T PredMap;
-      static PredMap *createPredMap(const Digraph &)
+      static PredMap *createPredMap(const Digraph &G)
       {
-        LEMON_ASSERT(false, "PredMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
+    ///PredMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting PredMap type
+    ///
     template <class T>
-    struct SetPredMap : public Dfs<Digraph, SetPredMapTraits<T> > {
-      typedef Dfs<Digraph, SetPredMapTraits<T> > Create;
-    };
+    struct DefPredMap : public Dfs<Digraph, DefPredMapTraits<T> > {
+      typedef Dfs<Digraph, DefPredMapTraits<T> > Create;
+    };
+
 
     template <class T>
-    struct SetDistMapTraits : public Traits {
+    struct DefDistMapTraits : public Traits {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "DistMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
+    ///DistMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting DistMap
+    ///type
     template <class T>
-    struct SetDistMap : public Dfs< Digraph, SetDistMapTraits<T> > {
-      typedef Dfs<Digraph, SetDistMapTraits<T> > Create;
+    struct DefDistMap {
+      typedef Dfs<Digraph, DefDistMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetReachedMapTraits : public Traits {
+    struct DefReachedMapTraits : public Traits {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "ReachedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ReachedMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ReachedMap type.
+    ///ReachedMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting ReachedMap type
+    ///
     template <class T>
-    struct SetReachedMap : public Dfs< Digraph, SetReachedMapTraits<T> > {
-      typedef Dfs< Digraph, SetReachedMapTraits<T> > Create;
+    struct DefReachedMap : public Dfs< Digraph, DefReachedMapTraits<T> > {
+      typedef Dfs< Digraph, DefReachedMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetProcessedMapTraits : public Traits {
+    struct DefProcessedMapTraits : public Traits {
       typedef T ProcessedMap;
       static ProcessedMap *createProcessedMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "ProcessedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
+    ///ProcessedMap type
+    ///
+    ///\ref named-templ-param "Named parameter" for setting ProcessedMap type
+    ///
     template <class T>
-    struct SetProcessedMap : public Dfs< Digraph, SetProcessedMapTraits<T> > {
-      typedef Dfs< Digraph, SetProcessedMapTraits<T> > Create;
-    };
-
-    struct SetStandardProcessedMapTraits : public Traits {
+    struct DefProcessedMap : public Dfs< Digraph, DefProcessedMapTraits<T> > {
+      typedef Dfs< Digraph, DefProcessedMapTraits<T> > Create;
+    };
+
+    struct DefDigraphProcessedMapTraits : public Traits {
       typedef typename Digraph::template NodeMap<bool> ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &g)
+      static ProcessedMap *createProcessedMap(const Digraph &G)
       {
-        return new ProcessedMap(g);
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
-    ///If you don't set it explicitly, it will be automatically allocated.
-    struct SetStandardProcessedMap :
-      public Dfs< Digraph, SetStandardProcessedMapTraits > {
-      typedef Dfs< Digraph, SetStandardProcessedMapTraits > Create;
+        return new ProcessedMap(G);
+      }
+    };
+    ///\brief \ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
+    ///
+    ///\ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
+    ///If you don't set it explicitely, it will be automatically allocated.
+    template <class T>
+    class DefProcessedMapToBeDefaultMap :
+      public Dfs< Digraph, DefDigraphProcessedMapTraits> {
+      typedef Dfs< Digraph, DefDigraphProcessedMapTraits> Create;
     };
 
@@ -317,8 +325,8 @@
     ///Constructor.
 
-    ///Constructor.
-    ///\param g The digraph the algorithm runs on.
-    Dfs(const Digraph &g) :
-      G(&g),
+    ///\param _G the digraph the algorithm will run on.
+    ///
+    Dfs(const Digraph& _G) :
+      G(&_G),
       _pred(NULL), local_pred(false),
       _dist(NULL), local_dist(false),
@@ -336,9 +344,9 @@
     }
 
-    ///Sets the map that stores the predecessor arcs.
-
-    ///Sets the map that stores the predecessor arcs.
+    ///Sets the map storing the predecessor arcs.
+
+    ///Sets the map storing the predecessor arcs.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated map, of course.
     ///\return <tt> (*this) </tt>
@@ -353,9 +361,26 @@
     }
 
-    ///Sets the map that indicates which nodes are reached.
-
-    ///Sets the map that indicates which nodes are reached.
+    ///Sets the map storing the distances calculated by the algorithm.
+
+    ///Sets the map storing the distances calculated by the algorithm.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
+    ///automatically allocated map, of course.
+    ///\return <tt> (*this) </tt>
+    Dfs &distMap(DistMap &m)
+    {
+      if(local_dist) {
+        delete _dist;
+        local_dist=false;
+      }
+      _dist = &m;
+      return *this;
+    }
+
+    ///Sets the map indicating if a node is reached.
+
+    ///Sets the map indicating if a node is reached.
+    ///If you don't use this function before calling \ref run(),
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated map, of course.
     ///\return <tt> (*this) </tt>
@@ -370,9 +395,9 @@
     }
 
-    ///Sets the map that indicates which nodes are processed.
-
-    ///Sets the map that indicates which nodes are processed.
+    ///Sets the map indicating if a node is processed.
+
+    ///Sets the map indicating if a node is processed.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated map, of course.
     ///\return <tt> (*this) </tt>
@@ -387,33 +412,14 @@
     }
 
-    ///Sets the map that stores the distances of the nodes.
-
-    ///Sets the map that stores the distances of the nodes calculated by
-    ///the algorithm.
-    ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
-    ///automatically allocated map, of course.
-    ///\return <tt> (*this) </tt>
-    Dfs &distMap(DistMap &m)
-    {
-      if(local_dist) {
-        delete _dist;
-        local_dist=false;
-      }
-      _dist = &m;
-      return *this;
-    }
-
   public:
-
     ///\name Execution control
     ///The simplest way to execute the algorithm is to use
-    ///one of the member functions called \ref lemon::Dfs::run() "run()".
+    ///one of the member functions called \c run(...).
     ///\n
-    ///If you need more control on the execution, first you must call
-    ///\ref lemon::Dfs::init() "init()", then you can add a source node
-    ///with \ref lemon::Dfs::addSource() "addSource()".
-    ///Finally \ref lemon::Dfs::start() "start()" will perform the
-    ///actual path computation.
+    ///If you need more control on the execution,
+    ///first you must call \ref init(), then you can add a source node
+    ///with \ref addSource().
+    ///Finally \ref start() will perform the actual path
+    ///computation.
 
     ///@{
@@ -430,4 +436,5 @@
       for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
         _pred->set(u,INVALID);
+        // _predNode->set(u,INVALID);
         _reached->set(u,false);
         _processed->set(u,false);
@@ -439,12 +446,8 @@
     ///Adds a new source node to the set of nodes to be processed.
     ///
-    ///\pre The stack must be empty. (Otherwise the algorithm gives
-    ///false results.)
-    ///
-    ///\warning Distances will be wrong (or at least strange) in case of
-    ///multiple sources.
+    ///\warning dists are wrong (or at least strange)
+    ///in case of multiple sources.
     void addSource(Node s)
     {
-      LEMON_DEBUG(emptyQueue(), "The stack is not empty.");
       if(!(*_reached)[s])
         {
@@ -469,5 +472,5 @@
     ///\return The processed arc.
     ///
-    ///\pre The stack must not be empty.
+    ///\pre The stack must not be empty!
     Arc processNextArc()
     {
@@ -495,12 +498,11 @@
       return e;
     }
-
     ///Next arc to be processed.
 
     ///Next arc to be processed.
     ///
-    ///\return The next arc to be processed or \c INVALID if the stack
-    ///is empty.
-    OutArcIt nextArc() const
+    ///\return The next arc to be processed or INVALID if the stack is
+    /// empty.
+    OutArcIt nextArc()
     {
       return _stack_head>=0?_stack[_stack_head]:INVALID;
@@ -508,14 +510,13 @@
 
     ///\brief Returns \c false if there are nodes
-    ///to be processed.
+    ///to be processed in the queue
     ///
     ///Returns \c false if there are nodes
-    ///to be processed in the queue (stack).
-    bool emptyQueue() const { return _stack_head<0; }
-
+    ///to be processed in the queue
+    bool emptyQueue() { return _stack_head<0; }
     ///Returns the number of the nodes to be processed.
 
-    ///Returns the number of the nodes to be processed in the queue (stack).
-    int queueSize() const { return _stack_head+1; }
+    ///Returns the number of the nodes to be processed in the queue.
+    int queueSize() { return _stack_head+1; }
 
     ///Executes the algorithm.
@@ -523,20 +524,14 @@
     ///Executes the algorithm.
     ///
-    ///This method runs the %DFS algorithm from the root node
-    ///in order to compute the DFS path to each node.
-    ///
-    /// The algorithm computes
-    ///- the %DFS tree,
-    ///- the distance of each node from the root in the %DFS tree.
-    ///
-    ///\pre init() must be called and a root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\note <tt>d.start()</tt> is just a shortcut of the following code.
-    ///\code
-    ///  while ( !d.emptyQueue() ) {
-    ///    d.processNextArc();
-    ///  }
-    ///\endcode
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///This method runs the %DFS algorithm from the root node(s)
+    ///in order to
+    ///compute the
+    ///%DFS path to each node. The algorithm computes
+    ///- The %DFS tree.
+    ///- The distance of each node from the root(s) in the %DFS tree.
+    ///
     void start()
     {
@@ -544,20 +539,21 @@
     }
 
-    ///Executes the algorithm until the given target node is reached.
-
-    ///Executes the algorithm until the given target node is reached.
-    ///
-    ///This method runs the %DFS algorithm from the root node
-    ///in order to compute the DFS path to \c t.
-    ///
-    ///The algorithm computes
-    ///- the %DFS path to \c t,
-    ///- the distance of \c t from the root in the %DFS tree.
-    ///
-    ///\pre init() must be called and a root node should be
-    ///added with addSource() before using this function.
-    void start(Node t)
-    {
-      while ( !emptyQueue() && G->target(_stack[_stack_head])!=t )
+    ///Executes the algorithm until \c dest is reached.
+
+    ///Executes the algorithm until \c dest is reached.
+    ///
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///This method runs the %DFS algorithm from the root node(s)
+    ///in order to
+    ///compute the
+    ///%DFS path to \c dest. The algorithm computes
+    ///- The %DFS path to \c  dest.
+    ///- The distance of \c dest from the root(s) in the %DFS tree.
+    ///
+    void start(Node dest)
+    {
+      while ( !emptyQueue() && G->target(_stack[_stack_head])!=dest )
         processNextArc();
     }
@@ -567,84 +563,37 @@
     ///Executes the algorithm until a condition is met.
     ///
-    ///This method runs the %DFS algorithm from the root node
-    ///until an arc \c a with <tt>am[a]</tt> true is found.
-    ///
-    ///\param am A \c bool (or convertible) arc map. The algorithm
-    ///will stop when it reaches an arc \c a with <tt>am[a]</tt> true.
-    ///
-    ///\return The reached arc \c a with <tt>am[a]</tt> true or
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///\param em must be a bool (or convertible) arc map. The algorithm
+    ///will stop when it reaches an arc \c e with <tt>em[e]</tt> true.
+    ///
+    ///\return The reached arc \c e with <tt>em[e]</tt> true or
     ///\c INVALID if no such arc was found.
     ///
-    ///\pre init() must be called and a root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\warning Contrary to \ref Bfs and \ref Dijkstra, \c am is an arc map,
+    ///\warning Contrary to \ref Bfs and \ref Dijkstra, \c em is an arc map,
     ///not a node map.
-    template<class ArcBoolMap>
-    Arc start(const ArcBoolMap &am)
-    {
-      while ( !emptyQueue() && !am[_stack[_stack_head]] )
+    template<class EM>
+    Arc start(const EM &em)
+    {
+      while ( !emptyQueue() && !em[_stack[_stack_head]] )
         processNextArc();
       return emptyQueue() ? INVALID : _stack[_stack_head];
     }
 
-    ///Runs the algorithm from the given source node.
-
-    ///This method runs the %DFS algorithm from node \c s
-    ///in order to compute the DFS path to each node.
-    ///
-    ///The algorithm computes
-    ///- the %DFS tree,
-    ///- the distance of each node from the root in the %DFS tree.
-    ///
-    ///\note <tt>d.run(s)</tt> is just a shortcut of the following code.
+    ///Runs %DFS algorithm to visit all nodes in the digraph.
+
+    ///This method runs the %DFS algorithm in order to
+    ///compute the
+    ///%DFS path to each node. The algorithm computes
+    ///- The %DFS tree.
+    ///- The distance of each node from the root in the %DFS tree.
+    ///
+    ///\note d.run() is just a shortcut of the following code.
     ///\code
     ///  d.init();
-    ///  d.addSource(s);
-    ///  d.start();
-    ///\endcode
-    void run(Node s) {
-      init();
-      addSource(s);
-      start();
-    }
-
-    ///Finds the %DFS path between \c s and \c t.
-
-    ///This method runs the %DFS algorithm from node \c s
-    ///in order to compute the DFS path to node \c t
-    ///(it stops searching when \c t is processed)
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    ///
-    ///\note Apart from the return value, <tt>d.run(s,t)</tt> is
-    ///just a shortcut of the following code.
-    ///\code
-    ///  d.init();
-    ///  d.addSource(s);
-    ///  d.start(t);
-    ///\endcode
-    bool run(Node s,Node t) {
-      init();
-      addSource(s);
-      start(t);
-      return reached(t);
-    }
-
-    ///Runs the algorithm to visit all nodes in the digraph.
-
-    ///This method runs the %DFS algorithm in order to compute the
-    ///%DFS path to each node.
-    ///
-    ///The algorithm computes
-    ///- the %DFS tree,
-    ///- the distance of each node from the root in the %DFS tree.
-    ///
-    ///\note <tt>d.run()</tt> is just a shortcut of the following code.
-    ///\code
-    ///  d.init();
-    ///  for (NodeIt n(digraph); n != INVALID; ++n) {
-    ///    if (!d.reached(n)) {
-    ///      d.addSource(n);
+    ///  for (NodeIt it(digraph); it != INVALID; ++it) {
+    ///    if (!d.reached(it)) {
+    ///      d.addSource(it);
     ///      d.start();
     ///    }
@@ -661,4 +610,45 @@
     }
 
+    ///Runs %DFS algorithm from node \c s.
+
+    ///This method runs the %DFS algorithm from a root node \c s
+    ///in order to
+    ///compute the
+    ///%DFS path to each node. The algorithm computes
+    ///- The %DFS tree.
+    ///- The distance of each node from the root in the %DFS tree.
+    ///
+    ///\note d.run(s) is just a shortcut of the following code.
+    ///\code
+    ///  d.init();
+    ///  d.addSource(s);
+    ///  d.start();
+    ///\endcode
+    void run(Node s) {
+      init();
+      addSource(s);
+      start();
+    }
+
+    ///Finds the %DFS path between \c s and \c t.
+
+    ///Finds the %DFS path between \c s and \c t.
+    ///
+    ///\return The length of the %DFS s---t path if there exists one,
+    ///0 otherwise.
+    ///\note Apart from the return value, d.run(s,t) is
+    ///just a shortcut of the following code.
+    ///\code
+    ///  d.init();
+    ///  d.addSource(s);
+    ///  d.start(t);
+    ///\endcode
+    int run(Node s,Node t) {
+      init();
+      addSource(s);
+      start(t);
+      return reached(t)?_stack_head+1:0;
+    }
+
     ///@}
 
@@ -666,40 +656,37 @@
     ///The result of the %DFS algorithm can be obtained using these
     ///functions.\n
-    ///Either \ref lemon::Dfs::run() "run()" or \ref lemon::Dfs::start()
-    ///"start()" must be called before using them.
+    ///Before the use of these functions,
+    ///either run() or start() must be called.
 
     ///@{
 
-    ///The DFS path to a node.
-
-    ///Returns the DFS path to a node.
-    ///
-    ///\warning \c t should be reachable from the root.
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
-    Path path(Node t) const { return Path(*G, *_pred, t); }
-
-    ///The distance of a node from the root.
-
-    ///Returns the distance of a node from the root.
-    ///
-    ///\warning If node \c v is not reachable from the root, then
-    ///the return value of this function is undefined.
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
+    typedef PredMapPath<Digraph, PredMap> Path;
+
+    ///Gives back the shortest path.
+
+    ///Gives back the shortest path.
+    ///\pre The \c t should be reachable from the source.
+    Path path(Node t)
+    {
+      return Path(*G, *_pred, t);
+    }
+
+    ///The distance of a node from the root(s).
+
+    ///Returns the distance of a node from the root(s).
+    ///\pre \ref run() must be called before using this function.
+    ///\warning If node \c v is unreachable from the root(s) then the return
+    ///value of this funcion is undefined.
     int dist(Node v) const { return (*_dist)[v]; }
 
-    ///Returns the 'previous arc' of the %DFS tree for a node.
-
-    ///This function returns the 'previous arc' of the %DFS tree for the
-    ///node \c v, i.e. it returns the last arc of a %DFS path from the
-    ///root to \c v. It is \c INVALID
-    ///if \c v is not reachable from the root(s) or if \c v is a root.
-    ///
-    ///The %DFS tree used here is equal to the %DFS tree used in
+    ///Returns the 'previous arc' of the %DFS tree.
+
+    ///For a node \c v it returns the 'previous arc'
+    ///of the %DFS path,
+    ///i.e. it returns the last arc of a %DFS path from the root(s) to \c
+    ///v. It is \ref INVALID
+    ///if \c v is unreachable from the root(s) or \c v is a root. The
+    ///%DFS tree used here is equal to the %DFS tree used in
     ///\ref predNode().
-    ///
     ///\pre Either \ref run() or \ref start() must be called before using
     ///this function.
@@ -708,12 +695,12 @@
     ///Returns the 'previous node' of the %DFS tree.
 
-    ///This function returns the 'previous node' of the %DFS
-    ///tree for the node \c v, i.e. it returns the last but one node
-    ///from a %DFS path from the root to \c v. It is \c INVALID
-    ///if \c v is not reachable from the root(s) or if \c v is a root.
-    ///
-    ///The %DFS tree used here is equal to the %DFS tree used in
-    ///\ref predArc().
-    ///
+    ///For a node \c v it returns the 'previous node'
+    ///of the %DFS tree,
+    ///i.e. it returns the last but one node from a %DFS path from the
+    ///root(s) to \c v.
+    ///It is INVALID if \c v is unreachable from the root(s) or
+    ///if \c v itself a root.
+    ///The %DFS tree used here is equal to the %DFS
+    ///tree used in \ref predArc().
     ///\pre Either \ref run() or \ref start() must be called before
     ///using this function.
@@ -721,59 +708,60 @@
                                   G->source((*_pred)[v]); }
 
-    ///\brief Returns a const reference to the node map that stores the
-    ///distances of the nodes.
-    ///
-    ///Returns a const reference to the node map that stores the
-    ///distances of the nodes calculated by the algorithm.
-    ///
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function.
+    ///Returns a reference to the NodeMap of distances.
+
+    ///Returns a reference to the NodeMap of distances.
+    ///\pre Either \ref run() or \ref init() must
+    ///be called before using this function.
     const DistMap &distMap() const { return *_dist;}
 
-    ///\brief Returns a const reference to the node map that stores the
-    ///predecessor arcs.
-    ///
-    ///Returns a const reference to the node map that stores the predecessor
-    ///arcs, which form the DFS tree.
-    ///
+    ///Returns a reference to the %DFS arc-tree map.
+
+    ///Returns a reference to the NodeMap of the arcs of the
+    ///%DFS tree.
     ///\pre Either \ref run() or \ref init()
     ///must be called before using this function.
     const PredMap &predMap() const { return *_pred;}
 
-    ///Checks if a node is reachable from the root(s).
+    ///Checks if a node is reachable from the root.
 
     ///Returns \c true if \c v is reachable from the root(s).
+    ///\warning The source nodes are inditated as unreachable.
     ///\pre Either \ref run() or \ref start()
     ///must be called before using this function.
-    bool reached(Node v) const { return (*_reached)[v]; }
+    ///
+    bool reached(Node v) { return (*_reached)[v]; }
 
     ///@}
   };
 
-  ///Default traits class of dfs() function.
-
-  ///Default traits class of dfs() function.
+  ///Default traits class of Dfs function.
+
+  ///Default traits class of Dfs function.
   ///\tparam GR Digraph type.
   template<class GR>
   struct DfsWizardDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
-
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores the last
     ///arcs of the %DFS paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the %DFS paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef NullMap<typename Digraph::Node,typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
+    ///This function instantiates a \ref PredMap.
+    ///\param g is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient to initialize
+#ifdef DOXYGEN
+    static PredMap *createPredMap(const GR &g)
+#else
+    static PredMap *createPredMap(const GR &)
+#endif
+    {
+      return new PredMap();
     }
 
@@ -782,63 +770,61 @@
     ///The type of the map that indicates which nodes are processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    ///By default it is a NullMap.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \ref ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap.
+    ///we would like to define the \ref ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
     ///The type of the map that indicates which nodes are reached.
 
     ///The type of the map that indicates which nodes are reached.
-    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///\todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
     ///Instantiates a ReachedMap.
 
-    ///This function instantiates a ReachedMap.
-    ///\param g is the digraph, to which
-    ///we would like to define the ReachedMap.
-    static ReachedMap *createReachedMap(const Digraph &g)
-    {
-      return new ReachedMap(g);
-    }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///This function instantiates a \ref ReachedMap.
+    ///\param G is the digraph, to which
+    ///we would like to define the \ref ReachedMap.
+    static ReachedMap *createReachedMap(const GR &G)
+    {
+      return new ReachedMap(G);
+    }
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<int> DistMap;
+    ///
+    typedef NullMap<typename Digraph::Node,int> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
+    ///This function instantiates a \ref DistMap.
     ///\param g is the digraph, to which we would like to define
-    ///the DistMap
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
-    }
-
-    ///The type of the DFS paths.
-
-    ///The type of the DFS paths.
-    ///It must meet the \ref concepts::Path "Path" concept.
-    typedef lemon::Path<Digraph> Path;
+    ///the \ref DistMap
+#ifdef DOXYGEN
+    static DistMap *createDistMap(const GR &g)
+#else
+    static DistMap *createDistMap(const GR &)
+#endif
+    {
+      return new DistMap();
+    }
   };
 
-  /// Default traits class used by DfsWizard
+  /// Default traits used by \ref DfsWizard
 
   /// To make it easier to use Dfs algorithm
-  /// we have created a wizard class.
+  ///we have created a wizard class.
   /// This \ref DfsWizard class needs default traits,
-  /// as well as the \ref Dfs class.
+  ///as well as the \ref Dfs class.
   /// The \ref DfsWizardBase is a class to be the default traits of the
   /// \ref DfsWizard class.
@@ -849,21 +835,19 @@
     typedef DfsWizardDefaultTraits<GR> Base;
   protected:
-    //The type of the nodes in the digraph.
+    /// Type of the nodes in the digraph.
     typedef typename Base::Digraph::Node Node;
 
-    //Pointer to the digraph the algorithm runs on.
+    /// Pointer to the underlying digraph.
     void *_g;
-    //Pointer to the map of reached nodes.
+    ///Pointer to the map of reached nodes.
     void *_reached;
-    //Pointer to the map of processed nodes.
+    ///Pointer to the map of processed nodes.
     void *_processed;
-    //Pointer to the map of predecessors arcs.
+    ///Pointer to the map of predecessors arcs.
     void *_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     void *_dist;
-    //Pointer to the DFS path to the target node.
-    void *_path;
-    //Pointer to the distance of the target node.
-    int *_di;
+    ///Pointer to the source node.
+    Node _source;
 
     public:
@@ -871,28 +855,40 @@
 
     /// This constructor does not require parameters, therefore it initiates
-    /// all of the attributes to \c 0.
+    /// all of the attributes to default values (0, INVALID).
     DfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
-                      _dist(0), _path(0), _di(0) {}
+                           _dist(0), _source(INVALID) {}
 
     /// Constructor.
 
-    /// This constructor requires one parameter,
-    /// others are initiated to \c 0.
-    /// \param g The digraph the algorithm runs on.
-    DfsWizardBase(const GR &g) :
+    /// This constructor requires some parameters,
+    /// listed in the parameters list.
+    /// Others are initiated to 0.
+    /// \param g is the initial value of  \ref _g
+    /// \param s is the initial value of  \ref _source
+    DfsWizardBase(const GR &g, Node s=INVALID) :
       _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
-      _reached(0), _processed(0), _pred(0), _dist(0),  _path(0), _di(0) {}
+      _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {}
 
   };
 
-  /// Auxiliary class for the function-type interface of DFS algorithm.
-
-  /// This auxiliary class is created to implement the
-  /// \ref dfs() "function-type interface" of \ref Dfs algorithm.
-  /// It does not have own \ref run() method, it uses the functions
-  /// and features of the plain \ref Dfs.
+  /// A class to make the usage of the Dfs algorithm easier
+
+  /// This class is created to make it easier to use the Dfs algorithm.
+  /// It uses the functions and features of the plain \ref Dfs,
+  /// but it is much simpler to use it.
   ///
-  /// This class should only be used through the \ref dfs() function,
-  /// which makes it easier to use the algorithm.
+  /// Simplicity means that the way to change the types defined
+  /// in the traits class is based on functions that returns the new class
+  /// and not on templatable built-in classes.
+  /// When using the plain \ref Dfs
+  /// the new class with the modified type comes from
+  /// the original class by using the ::
+  /// operator. In the case of \ref DfsWizard only
+  /// a function have to be called and it will
+  /// return the needed class.
+  ///
+  /// It does not have own \ref run method. When its \ref run method is called
+  /// it initiates a plain \ref Dfs object, and calls the \ref Dfs::run
+  /// method of it.
   template<class TR>
   class DfsWizard : public TR
@@ -900,26 +896,28 @@
     typedef TR Base;
 
-    ///The type of the digraph the algorithm runs on.
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
-
+    //\e
     typedef typename Digraph::Node Node;
+    //\e
     typedef typename Digraph::NodeIt NodeIt;
+    //\e
     typedef typename Digraph::Arc Arc;
+    //\e
     typedef typename Digraph::OutArcIt OutArcIt;
 
-    ///\brief The type of the map that stores the predecessor
-    ///arcs of the DFS paths.
+    ///\brief The type of the map that stores
+    ///the reached nodes
+    typedef typename TR::ReachedMap ReachedMap;
+    ///\brief The type of the map that stores
+    ///the processed nodes
+    typedef typename TR::ProcessedMap ProcessedMap;
+    ///\brief The type of the map that stores the last
+    ///arcs of the %DFS paths.
     typedef typename TR::PredMap PredMap;
-    ///\brief The type of the map that stores the distances of the nodes.
+    ///The type of the map that stores the distances of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///\brief The type of the map that indicates which nodes are reached.
-    typedef typename TR::ReachedMap ReachedMap;
-    ///\brief The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the DFS paths
-    typedef typename TR::Path Path;
 
   public:
-
     /// Constructor.
     DfsWizard() : TR() {}
@@ -929,7 +927,6 @@
     /// Constructor that requires parameters.
     /// These parameters will be the default values for the traits class.
-    /// \param g The digraph the algorithm runs on.
-    DfsWizard(const Digraph &g) :
-      TR(g) {}
+    DfsWizard(const Digraph &g, Node s=INVALID) :
+      TR(g,s) {}
 
     ///Copy constructor
@@ -938,157 +935,122 @@
     ~DfsWizard() {}
 
-    ///Runs DFS algorithm from the given source node.
-
-    ///This method runs DFS algorithm from node \c s
-    ///in order to compute the DFS path to each node.
+    ///Runs Dfs algorithm from a given node.
+
+    ///Runs Dfs algorithm from a given node.
+    ///The node can be given by the \ref source function.
+    void run()
+    {
+      if(Base::_source==INVALID) throw UninitializedParameter();
+      Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
+      if(Base::_reached)
+        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
+      if(Base::_processed)
+        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
+      if(Base::_pred)
+        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
+      if(Base::_dist)
+        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
+      alg.run(Base::_source);
+    }
+
+    ///Runs Dfs algorithm from the given node.
+
+    ///Runs Dfs algorithm from the given node.
+    ///\param s is the given source.
     void run(Node s)
     {
-      Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
-      if (Base::_pred)
-        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_reached)
-        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
-      if (Base::_processed)
-        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      if (s!=INVALID)
-        alg.run(s);
-      else
-        alg.run();
-    }
-
-    ///Finds the DFS path between \c s and \c t.
-
-    ///This method runs DFS algorithm from node \c s
-    ///in order to compute the DFS path to node \c t
-    ///(it stops searching when \c t is processed).
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    bool run(Node s, Node t)
-    {
-      Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
-      if (Base::_pred)
-        alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_reached)
-        alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached));
-      if (Base::_processed)
-        alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      alg.run(s,t);
-      if (Base::_path)
-        *reinterpret_cast<Path*>(Base::_path) = alg.path(t);
-      if (Base::_di)
-        *Base::_di = alg.dist(t);
-      return alg.reached(t);
-      }
-
-    ///Runs DFS algorithm to visit all nodes in the digraph.
-
-    ///This method runs DFS algorithm in order to compute
-    ///the DFS path to each node.
-    void run()
-    {
-      run(INVALID);
+      Base::_source=s;
+      run();
     }
 
     template<class T>
-    struct SetPredMapBase : public Base {
+    struct DefPredMapBase : public Base {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &) { return 0; };
-      SetPredMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting PredMap object.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for setting PredMap object.
+      DefPredMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting PredMap type
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting PredMap type
+    ///
     template<class T>
-    DfsWizard<SetPredMapBase<T> > predMap(const T &t)
+    DfsWizard<DefPredMapBase<T> > predMap(const T &t)
     {
       Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DfsWizard<SetPredMapBase<T> >(*this);
-    }
+      return DfsWizard<DefPredMapBase<T> >(*this);
+    }
+
 
     template<class T>
-    struct SetReachedMapBase : public Base {
+    struct DefReachedMapBase : public Base {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &) { return 0; };
-      SetReachedMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting ReachedMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting ReachedMap object.
+      DefReachedMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting ReachedMap
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting ReachedMap
+    ///
     template<class T>
-    DfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
+    DfsWizard<DefReachedMapBase<T> > reachedMap(const T &t)
     {
       Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DfsWizard<SetReachedMapBase<T> >(*this);
-    }
+      return DfsWizard<DefReachedMapBase<T> >(*this);
+    }
+
 
     template<class T>
-    struct SetDistMapBase : public Base {
+    struct DefProcessedMapBase : public Base {
+      typedef T ProcessedMap;
+      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
+      DefProcessedMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting ProcessedMap
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting ProcessedMap
+    ///
+    template<class T>
+    DfsWizard<DefProcessedMapBase<T> > processedMap(const T &t)
+    {
+      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
+      return DfsWizard<DefProcessedMapBase<T> >(*this);
+    }
+
+    template<class T>
+    struct DefDistMapBase : public Base {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &) { return 0; };
-      SetDistMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting DistMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting DistMap object.
+      DefDistMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
     template<class T>
-    DfsWizard<SetDistMapBase<T> > distMap(const T &t)
+    DfsWizard<DefDistMapBase<T> > distMap(const T &t)
     {
       Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DfsWizard<SetDistMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetProcessedMapBase : public Base {
-      typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
-      SetProcessedMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    template<class T>
-    DfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
-    {
-      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DfsWizard<SetProcessedMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetPathBase : public Base {
-      typedef T Path;
-      SetPathBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the DFS path to the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the DFS path to the target node.
-    template<class T>
-    DfsWizard<SetPathBase<T> > path(const T &t)
-    {
-      Base::_path=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DfsWizard<SetPathBase<T> >(*this);
-    }
-
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    DfsWizard dist(const int &d)
-    {
-      Base::_di=const_cast<int*>(&d);
+      return DfsWizard<DefDistMapBase<T> >(*this);
+    }
+
+    /// Sets the source node, from which the Dfs algorithm runs.
+
+    /// Sets the source node, from which the Dfs algorithm runs.
+    /// \param s is the source node.
+    DfsWizard<TR> &source(Node s)
+    {
+      Base::_source=s;
       return *this;
     }
@@ -1096,20 +1058,17 @@
   };
 
-  ///Function-type interface for DFS algorithm.
+  ///Function type interface for Dfs algorithm.
 
   ///\ingroup search
-  ///Function-type interface for DFS algorithm.
+  ///Function type interface for Dfs algorithm.
   ///
-  ///This function also has several \ref named-func-param "named parameters",
+  ///This function also has several
+  ///\ref named-templ-func-param "named parameters",
   ///they are declared as the members of class \ref DfsWizard.
-  ///The following examples show how to use these parameters.
+  ///The following
+  ///example shows how to use these parameters.
   ///\code
-  ///  // Compute the DFS tree
-  ///  dfs(g).predMap(preds).distMap(dists).run(s);
-  ///
-  ///  // Compute the DFS path from s to t
-  ///  bool reached = dfs(g).path(p).dist(d).run(s,t);
+  ///  dfs(g,source).predMap(preds).run();
   ///\endcode
-
   ///\warning Don't forget to put the \ref DfsWizard::run() "run()"
   ///to the end of the parameter list.
@@ -1118,14 +1077,14 @@
   template<class GR>
   DfsWizard<DfsWizardBase<GR> >
-  dfs(const GR &digraph)
+  dfs(const GR &g,typename GR::Node s=INVALID)
   {
-    return DfsWizard<DfsWizardBase<GR> >(digraph);
+    return DfsWizard<DfsWizardBase<GR> >(g,s);
   }
 
 #ifdef DOXYGEN
-  /// \brief Visitor class for DFS.
+  /// \brief Visitor class for dfs.
   ///
-  /// This class defines the interface of the DfsVisit events, and
-  /// it could be the base of a real visitor class.
+  /// It gives a simple interface for a functional interface for dfs
+  /// traversal. The traversal on a linear data structure.
   template <typename _Digraph>
   struct DfsVisitor {
@@ -1133,35 +1092,36 @@
     typedef typename Digraph::Arc Arc;
     typedef typename Digraph::Node Node;
-    /// \brief Called for the source node of the DFS.
-    ///
-    /// This function is called for the source node of the DFS.
-    void start(const Node& node) {}
-    /// \brief Called when the source node is leaved.
-    ///
-    /// This function is called when the source node is leaved.
-    void stop(const Node& node) {}
-    /// \brief Called when a node is reached first time.
-    ///
-    /// This function is called when a node is reached first time.
+    /// \brief Called when the arc reach a node.
+    ///
+    /// It is called when the dfs find an arc which target is not
+    /// reached yet.
+    void discover(const Arc& arc) {}
+    /// \brief Called when the node reached first time.
+    ///
+    /// It is Called when the node reached first time.
     void reach(const Node& node) {}
-    /// \brief Called when an arc reaches a new node.
-    ///
-    /// This function is called when the DFS finds an arc whose target node
-    /// is not reached yet.
-    void discover(const Arc& arc) {}
-    /// \brief Called when an arc is examined but its target node is
+    /// \brief Called when we step back on an arc.
+    ///
+    /// It is called when the dfs should step back on the arc.
+    void backtrack(const Arc& arc) {}
+    /// \brief Called when we step back from the node.
+    ///
+    /// It is called when we step back from the node.
+    void leave(const Node& node) {}
+    /// \brief Called when the arc examined but target of the arc
     /// already discovered.
     ///
-    /// This function is called when an arc is examined but its target node is
+    /// It called when the arc examined but the target of the arc
     /// already discovered.
     void examine(const Arc& arc) {}
-    /// \brief Called when the DFS steps back from a node.
-    ///
-    /// This function is called when the DFS steps back from a node.
-    void leave(const Node& node) {}
-    /// \brief Called when the DFS steps back on an arc.
-    ///
-    /// This function is called when the DFS steps back on an arc.
-    void backtrack(const Arc& arc) {}
+    /// \brief Called for the source node of the dfs.
+    ///
+    /// It is called for the source node of the dfs.
+    void start(const Node& node) {}
+    /// \brief Called when we leave the source node of the dfs.
+    ///
+    /// It is called when we leave the source node of the dfs.
+    void stop(const Node& node) {}
+
   };
 #else
@@ -1171,11 +1131,11 @@
     typedef typename Digraph::Arc Arc;
     typedef typename Digraph::Node Node;
+    void discover(const Arc&) {}
+    void reach(const Node&) {}
+    void backtrack(const Arc&) {}
+    void leave(const Node&) {}
+    void examine(const Arc&) {}
     void start(const Node&) {}
     void stop(const Node&) {}
-    void reach(const Node&) {}
-    void discover(const Arc&) {}
-    void examine(const Arc&) {}
-    void leave(const Node&) {}
-    void backtrack(const Arc&) {}
 
     template <typename _Visitor>
@@ -1184,11 +1144,11 @@
         Arc arc;
         Node node;
+        visitor.discover(arc);
+        visitor.reach(node);
+        visitor.backtrack(arc);
+        visitor.leave(node);
+        visitor.examine(arc);
         visitor.start(node);
         visitor.stop(arc);
-        visitor.reach(node);
-        visitor.discover(arc);
-        visitor.examine(arc);
-        visitor.leave(node);
-        visitor.backtrack(arc);
       }
       _Visitor& visitor;
@@ -1200,9 +1160,9 @@
   ///
   /// Default traits class of DfsVisit class.
-  /// \tparam _Digraph The type of the digraph the algorithm runs on.
+  /// \tparam _Digraph Digraph type.
   template<class _Digraph>
   struct DfsVisitDefaultTraits {
 
-    /// \brief The type of the digraph the algorithm runs on.
+    /// \brief The digraph type the algorithm runs on.
     typedef _Digraph Digraph;
 
@@ -1210,12 +1170,13 @@
     ///
     /// The type of the map that indicates which nodes are reached.
-    /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    /// It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    /// \todo named parameter to set this type, function to read and write.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
 
     /// \brief Instantiates a ReachedMap.
     ///
-    /// This function instantiates a ReachedMap.
+    /// This function instantiates a \ref ReachedMap.
     /// \param digraph is the digraph, to which
-    /// we would like to define the ReachedMap.
+    /// we would like to define the \ref ReachedMap.
     static ReachedMap *createReachedMap(const Digraph &digraph) {
       return new ReachedMap(digraph);
@@ -1224,8 +1185,7 @@
   };
 
+  /// %DFS Visit algorithm class.
+
   /// \ingroup search
-  ///
-  /// \brief %DFS algorithm class with visitor interface.
-  ///
   /// This class provides an efficient implementation of the %DFS algorithm
   /// with visitor interface.
@@ -1233,24 +1193,21 @@
   /// The %DfsVisit class provides an alternative interface to the Dfs
   /// class. It works with callback mechanism, the DfsVisit object calls
-  /// the member functions of the \c Visitor class on every DFS event.
+  /// on every dfs event the \c Visitor class member functions.
   ///
-  /// This interface of the DFS algorithm should be used in special cases
-  /// when extra actions have to be performed in connection with certain
-  /// events of the DFS algorithm. Otherwise consider to use Dfs or dfs()
-  /// instead.
-  ///
-  /// \tparam _Digraph The type of the digraph the algorithm runs on.
+  /// \tparam _Digraph The digraph type the algorithm runs on.
   /// The default value is
-  /// \ref ListDigraph. The value of _Digraph is not used directly by
-  /// \ref DfsVisit, it is only passed to \ref DfsVisitDefaultTraits.
-  /// \tparam _Visitor The Visitor type that is used by the algorithm.
-  /// \ref DfsVisitor "DfsVisitor<_Digraph>" is an empty visitor, which
-  /// does not observe the DFS events. If you want to observe the DFS
-  /// events, you should implement your own visitor class.
+  /// \ref ListDigraph. The value of _Digraph is not used directly by Dfs, it
+  /// is only passed to \ref DfsDefaultTraits.
+  /// \tparam _Visitor The Visitor object for the algorithm. The
+  /// \ref DfsVisitor "DfsVisitor<_Digraph>" is an empty Visitor which
+  /// does not observe the Dfs events. If you want to observe the dfs
+  /// events you should implement your own Visitor class.
   /// \tparam _Traits Traits class to set various data types used by the
   /// algorithm. The default traits class is
   /// \ref DfsVisitDefaultTraits "DfsVisitDefaultTraits<_Digraph>".
   /// See \ref DfsVisitDefaultTraits for the documentation of
-  /// a DFS visit traits class.
+  /// a Dfs visit traits class.
+  ///
+  /// \author Jacint Szabo, Alpar Juttner and Balazs Dezso
 #ifdef DOXYGEN
   template <typename _Digraph, typename _Visitor, typename _Traits>
@@ -1258,19 +1215,28 @@
   template <typename _Digraph = ListDigraph,
             typename _Visitor = DfsVisitor<_Digraph>,
-            typename _Traits = DfsVisitDefaultTraits<_Digraph> >
+            typename _Traits = DfsDefaultTraits<_Digraph> >
 #endif
   class DfsVisit {
   public:
 
-    ///The traits class.
+    /// \brief \ref Exception for uninitialized parameters.
+    ///
+    /// This error represents problems in the initialization
+    /// of the parameters of the algorithms.
+    class UninitializedParameter : public lemon::UninitializedParameter {
+    public:
+      virtual const char* what() const throw()
+      {
+        return "lemon::DfsVisit::UninitializedParameter";
+      }
+    };
+
     typedef _Traits Traits;
 
-    ///The type of the digraph the algorithm runs on.
     typedef typename Traits::Digraph Digraph;
 
-    ///The visitor type used by the algorithm.
     typedef _Visitor Visitor;
 
-    ///The type of the map that indicates which nodes are reached.
+    ///The type of the map indicating which nodes are reached.
     typedef typename Traits::ReachedMap ReachedMap;
 
@@ -1282,11 +1248,11 @@
     typedef typename Digraph::OutArcIt OutArcIt;
 
-    //Pointer to the underlying digraph.
+    /// Pointer to the underlying digraph.
     const Digraph *_digraph;
-    //Pointer to the visitor object.
+    /// Pointer to the visitor object.
     Visitor *_visitor;
-    //Pointer to the map of reached status of the nodes.
+    ///Pointer to the map of reached status of the nodes.
     ReachedMap *_reached;
-    //Indicates if _reached is locally allocated (true) or not.
+    ///Indicates if \ref _reached is locally allocated (\c true) or not.
     bool local_reached;
 
@@ -1294,5 +1260,7 @@
     int _stack_head;
 
-    //Creates the maps if necessary.
+    /// \brief Creates the maps if necessary.
+    ///
+    /// Creates the maps if necessary.
     void create_maps() {
       if(!_reached) {
@@ -1314,19 +1282,18 @@
     ///@{
     template <class T>
-    struct SetReachedMapTraits : public Traits {
+    struct DefReachedMapTraits : public Traits {
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &digraph) {
-        LEMON_ASSERT(false, "ReachedMap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
     /// \brief \ref named-templ-param "Named parameter" for setting
-    /// ReachedMap type.
-    ///
-    /// \ref named-templ-param "Named parameter" for setting ReachedMap type.
+    /// ReachedMap type
+    ///
+    /// \ref named-templ-param "Named parameter" for setting ReachedMap type
     template <class T>
-    struct SetReachedMap : public DfsVisit< Digraph, Visitor,
-                                            SetReachedMapTraits<T> > {
-      typedef DfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create;
+    struct DefReachedMap : public DfsVisit< Digraph, Visitor,
+                                            DefReachedMapTraits<T> > {
+      typedef DfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;
     };
     ///@}
@@ -1338,6 +1305,7 @@
     /// Constructor.
     ///
-    /// \param digraph The digraph the algorithm runs on.
-    /// \param visitor The visitor object of the algorithm.
+    /// \param digraph the digraph the algorithm will run on.
+    /// \param visitor The visitor of the algorithm.
+    ///
     DfsVisit(const Digraph& digraph, Visitor& visitor)
       : _digraph(&digraph), _visitor(&visitor),
@@ -1345,13 +1313,15 @@
 
     /// \brief Destructor.
+    ///
+    /// Destructor.
     ~DfsVisit() {
       if(local_reached) delete _reached;
     }
 
-    /// \brief Sets the map that indicates which nodes are reached.
-    ///
-    /// Sets the map that indicates which nodes are reached.
+    /// \brief Sets the map indicating if a node is reached.
+    ///
+    /// Sets the map indicating if a node is reached.
     /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destructor deallocates this
+    /// it will allocate one. The destuctor deallocates this
     /// automatically allocated map, of course.
     /// \return <tt> (*this) </tt>
@@ -1366,21 +1336,19 @@
 
   public:
-
     /// \name Execution control
     /// The simplest way to execute the algorithm is to use
-    /// one of the member functions called \ref lemon::DfsVisit::run()
-    /// "run()".
+    /// one of the member functions called \c run(...).
     /// \n
-    /// If you need more control on the execution, first you must call
-    /// \ref lemon::DfsVisit::init() "init()", then you can add several
-    /// source nodes with \ref lemon::DfsVisit::addSource() "addSource()".
-    /// Finally \ref lemon::DfsVisit::start() "start()" will perform the
-    /// actual path computation.
+    /// If you need more control on the execution,
+    /// first you must call \ref init(), then you can adda source node
+    /// with \ref addSource().
+    /// Finally \ref start() will perform the actual path
+    /// computation.
 
     /// @{
-
     /// \brief Initializes the internal data structures.
     ///
     /// Initializes the internal data structures.
+    ///
     void init() {
       create_maps();
@@ -1392,16 +1360,8 @@
     }
 
-    ///Adds a new source node.
-
-    ///Adds a new source node to the set of nodes to be processed.
-    ///
-    ///\pre The stack must be empty. (Otherwise the algorithm gives
-    ///false results.)
-    ///
-    ///\warning Distances will be wrong (or at least strange) in case of
-    ///multiple sources.
-    void addSource(Node s)
-    {
-      LEMON_DEBUG(emptyQueue(), "The stack is not empty.");
+    /// \brief Adds a new source node.
+    ///
+    /// Adds a new source node to the set of nodes to be processed.
+    void addSource(Node s) {
       if(!(*_reached)[s]) {
           _reached->set(s,true);
@@ -1424,5 +1384,5 @@
     /// \return The processed arc.
     ///
-    /// \pre The stack must not be empty.
+    /// \pre The stack must not be empty!
     Arc processNextArc() {
       Arc e = _stack[_stack_head];
@@ -1458,19 +1418,19 @@
     /// \return The next arc to be processed or INVALID if the stack is
     /// empty.
-    Arc nextArc() const {
+    Arc nextArc() {
       return _stack_head >= 0 ? _stack[_stack_head] : INVALID;
     }
 
     /// \brief Returns \c false if there are nodes
-    /// to be processed.
+    /// to be processed in the queue
     ///
     /// Returns \c false if there are nodes
-    /// to be processed in the queue (stack).
-    bool emptyQueue() const { return _stack_head < 0; }
+    /// to be processed in the queue
+    bool emptyQueue() { return _stack_head < 0; }
 
     /// \brief Returns the number of the nodes to be processed.
     ///
-    /// Returns the number of the nodes to be processed in the queue (stack).
-    int queueSize() const { return _stack_head + 1; }
+    /// Returns the number of the nodes to be processed in the queue.
+    int queueSize() { return _stack_head + 1; }
 
     /// \brief Executes the algorithm.
@@ -1478,39 +1438,18 @@
     /// Executes the algorithm.
     ///
-    /// This method runs the %DFS algorithm from the root node
-    /// in order to compute the %DFS path to each node.
-    ///
-    /// The algorithm computes
-    /// - the %DFS tree,
-    /// - the distance of each node from the root in the %DFS tree.
-    ///
-    /// \pre init() must be called and a root node should be
-    /// added with addSource() before using this function.
-    ///
-    /// \note <tt>d.start()</tt> is just a shortcut of the following code.
-    /// \code
-    ///   while ( !d.emptyQueue() ) {
-    ///     d.processNextArc();
-    ///   }
-    /// \endcode
+    /// \pre init() must be called and at least one node should be added
+    /// with addSource() before using this function.
     void start() {
       while ( !emptyQueue() ) processNextArc();
     }
 
-    /// \brief Executes the algorithm until the given target node is reached.
-    ///
-    /// Executes the algorithm until the given target node is reached.
-    ///
-    /// This method runs the %DFS algorithm from the root node
-    /// in order to compute the DFS path to \c t.
-    ///
-    /// The algorithm computes
-    /// - the %DFS path to \c t,
-    /// - the distance of \c t from the root in the %DFS tree.
-    ///
-    /// \pre init() must be called and a root node should be added
+    /// \brief Executes the algorithm until \c dest is reached.
+    ///
+    /// Executes the algorithm until \c dest is reached.
+    ///
+    /// \pre init() must be called and at least one node should be added
     /// with addSource() before using this function.
-    void start(Node t) {
-      while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != t )
+    void start(Node dest) {
+      while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != dest )
         processNextArc();
     }
@@ -1520,35 +1459,26 @@
     /// Executes the algorithm until a condition is met.
     ///
-    /// This method runs the %DFS algorithm from the root node
-    /// until an arc \c a with <tt>am[a]</tt> true is found.
-    ///
-    /// \param am A \c bool (or convertible) arc map. The algorithm
-    /// will stop when it reaches an arc \c a with <tt>am[a]</tt> true.
-    ///
-    /// \return The reached arc \c a with <tt>am[a]</tt> true or
-    /// \c INVALID if no such arc was found.
-    ///
-    /// \pre init() must be called and a root node should be added
+    /// \pre init() must be called and at least one node should be added
     /// with addSource() before using this function.
     ///
-    /// \warning Contrary to \ref Bfs and \ref Dijkstra, \c am is an arc map,
+    /// \param em must be a bool (or convertible) arc map. The algorithm
+    /// will stop when it reaches an arc \c e with <tt>em[e]</tt> true.
+    ///
+    ///\return The reached arc \c e with <tt>em[e]</tt> true or
+    ///\c INVALID if no such arc was found.
+    ///
+    /// \warning Contrary to \ref Bfs and \ref Dijkstra, \c em is an arc map,
     /// not a node map.
-    template <typename AM>
-    Arc start(const AM &am) {
-      while ( !emptyQueue() && !am[_stack[_stack_head]] )
+    template <typename EM>
+    Arc start(const EM &em) {
+      while ( !emptyQueue() && !em[_stack[_stack_head]] )
         processNextArc();
       return emptyQueue() ? INVALID : _stack[_stack_head];
     }
 
-    /// \brief Runs the algorithm from the given source node.
-    ///
-    /// This method runs the %DFS algorithm from node \c s.
-    /// in order to compute the DFS path to each node.
-    ///
-    /// The algorithm computes
-    /// - the %DFS tree,
-    /// - the distance of each node from the root in the %DFS tree.
-    ///
-    /// \note <tt>d.run(s)</tt> is just a shortcut of the following code.
+    /// \brief Runs %DFSVisit algorithm from node \c s.
+    ///
+    /// This method runs the %DFS algorithm from a root node \c s.
+    /// \note d.run(s) is just a shortcut of the following code.
     ///\code
     ///   d.init();
@@ -1562,44 +1492,20 @@
     }
 
-    /// \brief Finds the %DFS path between \c s and \c t.
-
-    /// This method runs the %DFS algorithm from node \c s
-    /// in order to compute the DFS path to node \c t
-    /// (it stops searching when \c t is processed).
-    ///
-    /// \return \c true if \c t is reachable form \c s.
-    ///
-    /// \note Apart from the return value, <tt>d.run(s,t)</tt> is
-    /// just a shortcut of the following code.
+    /// \brief Runs %DFSVisit algorithm to visit all nodes in the digraph.
+
+    /// This method runs the %DFS algorithm in order to
+    /// compute the %DFS path to each node. The algorithm computes
+    /// - The %DFS tree.
+    /// - The distance of each node from the root in the %DFS tree.
+    ///
+    ///\note d.run() is just a shortcut of the following code.
     ///\code
-    ///   d.init();
-    ///   d.addSource(s);
-    ///   d.start(t);
-    ///\endcode
-    bool run(Node s,Node t) {
-      init();
-      addSource(s);
-      start(t);
-      return reached(t);
-    }
-
-    /// \brief Runs the algorithm to visit all nodes in the digraph.
-
-    /// This method runs the %DFS algorithm in order to
-    /// compute the %DFS path to each node.
-    ///
-    /// The algorithm computes
-    /// - the %DFS tree,
-    /// - the distance of each node from the root in the %DFS tree.
-    ///
-    /// \note <tt>d.run()</tt> is just a shortcut of the following code.
-    ///\code
-    ///   d.init();
-    ///   for (NodeIt n(digraph); n != INVALID; ++n) {
-    ///     if (!d.reached(n)) {
-    ///       d.addSource(n);
-    ///       d.start();
-    ///     }
-    ///   }
+    ///  d.init();
+    ///  for (NodeIt it(digraph); it != INVALID; ++it) {
+    ///    if (!d.reached(it)) {
+    ///      d.addSource(it);
+    ///      d.start();
+    ///    }
+    ///  }
     ///\endcode
     void run() {
@@ -1612,5 +1518,4 @@
       }
     }
-
     ///@}
 
@@ -1618,21 +1523,21 @@
     /// The result of the %DFS algorithm can be obtained using these
     /// functions.\n
-    /// Either \ref lemon::DfsVisit::run() "run()" or
-    /// \ref lemon::DfsVisit::start() "start()" must be called before
-    /// using them.
+    /// Before the use of these functions,
+    /// either run() or start() must be called.
     ///@{
-
-    /// \brief Checks if a node is reachable from the root(s).
+    /// \brief Checks if a node is reachable from the root.
     ///
     /// Returns \c true if \c v is reachable from the root(s).
+    /// \warning The source nodes are inditated as unreachable.
     /// \pre Either \ref run() or \ref start()
     /// must be called before using this function.
+    ///
     bool reached(Node v) { return (*_reached)[v]; }
-
     ///@}
-
   };
 
+
 } //END OF NAMESPACE LEMON
 
 #endif
+
Index: lemon/dijkstra.h
===================================================================
--- lemon/dijkstra.h	(revision 317)
+++ lemon/dijkstra.h	(revision 220)
@@ -31,12 +31,11 @@
 #include <lemon/error.h>
 #include <lemon/maps.h>
-#include <lemon/path.h>
 
 namespace lemon {
 
-  /// \brief Default operation traits for the Dijkstra algorithm class.
+  /// \brief Default OperationTraits for the Dijkstra algorithm class.
   ///
-  /// This operation traits class defines all computational operations and
-  /// constants which are used in the Dijkstra algorithm.
+  /// It defines all computational operations and constants which are
+  /// used in the Dijkstra algorithm.
   template <typename Value>
   struct DijkstraDefaultOperationTraits {
@@ -49,5 +48,5 @@
       return left + right;
     }
-    /// \brief Gives back true only if the first value is less than the second.
+    /// \brief Gives back true only if the first value less than the second.
     static bool less(const Value& left, const Value& right) {
       return left < right;
@@ -55,11 +54,8 @@
   };
 
-  /// \brief Widest path operation traits for the Dijkstra algorithm class.
+  /// \brief Widest path OperationTraits for the Dijkstra algorithm class.
   ///
-  /// This operation traits class defines all computational operations and
-  /// constants which are used in the Dijkstra algorithm for widest path
-  /// computation.
-  ///
-  /// \see DijkstraDefaultOperationTraits
+  /// It defines all computational operations and constants which are
+  /// used in the Dijkstra algorithm for widest path computation.
   template <typename Value>
   struct DijkstraWidestPathOperationTraits {
@@ -72,5 +68,5 @@
       return std::min(left, right);
     }
-    /// \brief Gives back true only if the first value is less than the second.
+    /// \brief Gives back true only if the first value less than the second.
     static bool less(const Value& left, const Value& right) {
       return left < right;
@@ -81,12 +77,11 @@
 
   ///Default traits class of Dijkstra class.
-  ///\tparam GR The type of the digraph.
-  ///\tparam LM The type of the length map.
+  ///\tparam GR Digraph type.
+  ///\tparam LM Type of length map.
   template<class GR, class LM>
   struct DijkstraDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
-
     ///The type of the map that stores the arc lengths.
 
@@ -94,93 +89,94 @@
     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     typedef LM LengthMap;
-    ///The type of the length of the arcs.
+    //The type of the length of the arcs.
     typedef typename LM::Value Value;
-
     /// Operation traits for Dijkstra algorithm.
 
-    /// This class defines the operations that are used in the algorithm.
+    /// It defines the used operation by the algorithm.
     /// \see DijkstraDefaultOperationTraits
     typedef DijkstraDefaultOperationTraits<Value> OperationTraits;
-
-    /// The cross reference type used by the heap.
-
-    /// The cross reference type used by the heap.
+    /// The cross reference type used by heap.
+
+
+    /// The cross reference type used by heap.
     /// Usually it is \c Digraph::NodeMap<int>.
     typedef typename Digraph::template NodeMap<int> HeapCrossRef;
-    ///Instantiates a \ref HeapCrossRef.
-
-    ///This function instantiates a \ref HeapCrossRef.
-    /// \param g is the digraph, to which we would like to define the
-    /// \ref HeapCrossRef.
-    static HeapCrossRef *createHeapCrossRef(const Digraph &g)
-    {
-      return new HeapCrossRef(g);
-    }
-
-    ///The heap type used by the Dijkstra algorithm.
-
-    ///The heap type used by the Dijkstra algorithm.
+    ///Instantiates a HeapCrossRef.
+
+    ///This function instantiates a \c HeapCrossRef.
+    /// \param G is the digraph, to which we would like to define the
+    /// HeapCrossRef.
+    static HeapCrossRef *createHeapCrossRef(const GR &G)
+    {
+      return new HeapCrossRef(G);
+    }
+
+    ///The heap type used by Dijkstra algorithm.
+
+    ///The heap type used by Dijkstra algorithm.
     ///
     ///\sa BinHeap
     ///\sa Dijkstra
     typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
-    ///Instantiates a \ref Heap.
-
-    ///This function instantiates a \ref Heap.
-    static Heap *createHeap(HeapCrossRef& r)
-    {
-      return new Heap(r);
-    }
-
-    ///\brief The type of the map that stores the predecessor
+
+    static Heap *createHeap(HeapCrossRef& R)
+    {
+      return new Heap(R);
+    }
+
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the shortest paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef typename Digraph::template NodeMap<typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
-    }
-
-    ///The type of the map that indicates which nodes are processed.
-
-    ///The type of the map that indicates which nodes are processed.
+    ///This function instantiates a \c PredMap.
+    ///\param G is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient for the initialization
+    static PredMap *createPredMap(const GR &G)
+    {
+      return new PredMap(G);
+    }
+
+    ///The type of the map that stores whether a nodes is processed.
+
+    ///The type of the map that stores whether a nodes is processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     ///By default it is a NullMap.
+    ///\todo If it is set to a real map,
+    ///Dijkstra::processed() should read this.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \c ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap
+    ///we would like to define the \c ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+    ///
     typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
-    ///\param g is the digraph, to which we would like to define
-    ///the DistMap
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
+    ///This function instantiates a \ref DistMap.
+    ///\param G is the digraph, to which we would like to define
+    ///the \ref DistMap
+    static DistMap *createDistMap(const GR &G)
+    {
+      return new DistMap(G);
     }
   };
@@ -189,32 +185,31 @@
 
   /// \ingroup shortest_path
-  ///This class provides an efficient implementation of the %Dijkstra algorithm.
-  ///
+  ///This class provides an efficient implementation of %Dijkstra algorithm.
   ///The arc lengths are passed to the algorithm using a
   ///\ref concepts::ReadMap "ReadMap",
   ///so it is easy to change it to any kind of length.
+  ///
   ///The type of the length is determined by the
   ///\ref concepts::ReadMap::Value "Value" of the length map.
+  ///
   ///It is also possible to change the underlying priority heap.
   ///
-  ///There is also a \ref dijkstra() "function-type interface" for the
-  ///%Dijkstra algorithm, which is convenient in the simplier cases and
-  ///it can be used easier.
-  ///
-  ///\tparam GR The type of the digraph the algorithm runs on.
-  ///The default value is \ref ListDigraph.
-  ///The value of GR is not used directly by \ref Dijkstra, it is only
-  ///passed to \ref DijkstraDefaultTraits.
-  ///\tparam LM A readable arc map that determines the lengths of the
+  ///\tparam GR The digraph type the algorithm runs on. The default value
+  ///is \ref ListDigraph. The value of GR is not used directly by
+  ///Dijkstra, it is only passed to \ref DijkstraDefaultTraits.
+  ///\tparam LM This read-only ArcMap determines the lengths of the
   ///arcs. It is read once for each arc, so the map may involve in
-  ///relatively time consuming process to compute the arc lengths if
+  ///relatively time consuming process to compute the arc length if
   ///it is necessary. The default map type is \ref
-  ///concepts::Digraph::ArcMap "Digraph::ArcMap<int>".
-  ///The value of LM is not used directly by \ref Dijkstra, it is only
-  ///passed to \ref DijkstraDefaultTraits.
-  ///\tparam TR Traits class to set various data types used by the algorithm.
-  ///The default traits class is \ref DijkstraDefaultTraits
-  ///"DijkstraDefaultTraits<GR,LM>". See \ref DijkstraDefaultTraits
-  ///for the documentation of a Dijkstra traits class.
+  ///concepts::Digraph::ArcMap "Digraph::ArcMap<int>".  The value
+  ///of LM is not used directly by Dijkstra, it is only passed to \ref
+  ///DijkstraDefaultTraits.
+  ///\tparam TR Traits class to set
+  ///various data types used by the algorithm.  The default traits
+  ///class is \ref DijkstraDefaultTraits
+  ///"DijkstraDefaultTraits<GR,LM>".  See \ref
+  ///DijkstraDefaultTraits for the documentation of a Dijkstra traits
+  ///class.
+
 #ifdef DOXYGEN
   template <typename GR, typename LM, typename TR>
@@ -226,7 +221,28 @@
   class Dijkstra {
   public:
-
-    ///The type of the digraph the algorithm runs on.
+    /**
+     * \brief \ref Exception for uninitialized parameters.
+     *
+     * This error represents problems in the initialization
+     * of the parameters of the algorithms.
+     */
+    class UninitializedParameter : public lemon::UninitializedParameter {
+    public:
+      virtual const char* what() const throw() {
+        return "lemon::Dijkstra::UninitializedParameter";
+      }
+    };
+
+    typedef TR Traits;
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
+    ///\e
+    typedef typename Digraph::Node Node;
+    ///\e
+    typedef typename Digraph::NodeIt NodeIt;
+    ///\e
+    typedef typename Digraph::Arc Arc;
+    ///\e
+    typedef typename Digraph::OutArcIt OutArcIt;
 
     ///The type of the length of the arcs.
@@ -234,56 +250,46 @@
     ///The type of the map that stores the arc lengths.
     typedef typename TR::LengthMap LengthMap;
-    ///\brief The type of the map that stores the predecessor arcs of the
-    ///shortest paths.
+    ///\brief The type of the map that stores the last
+    ///arcs of the shortest paths.
     typedef typename TR::PredMap PredMap;
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map indicating if a node is processed.
+    typedef typename TR::ProcessedMap ProcessedMap;
+    ///The type of the map that stores the dists of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the paths.
-    typedef PredMapPath<Digraph, PredMap> Path;
     ///The cross reference type used for the current heap.
     typedef typename TR::HeapCrossRef HeapCrossRef;
-    ///The heap type used by the algorithm.
+    ///The heap type used by the dijkstra algorithm.
     typedef typename TR::Heap Heap;
-    ///The operation traits class.
+    ///The operation traits.
     typedef typename TR::OperationTraits OperationTraits;
-
-    ///The traits class.
-    typedef TR Traits;
-
   private:
-
-    typedef typename Digraph::Node Node;
-    typedef typename Digraph::NodeIt NodeIt;
-    typedef typename Digraph::Arc Arc;
-    typedef typename Digraph::OutArcIt OutArcIt;
-
-    //Pointer to the underlying digraph.
+    /// Pointer to the underlying digraph.
     const Digraph *G;
-    //Pointer to the length map.
+    /// Pointer to the length map
     const LengthMap *length;
-    //Pointer to the map of predecessors arcs.
+    ///Pointer to the map of predecessors arcs.
     PredMap *_pred;
-    //Indicates if _pred is locally allocated (true) or not.
+    ///Indicates if \ref _pred is locally allocated (\c true) or not.
     bool local_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     DistMap *_dist;
-    //Indicates if _dist is locally allocated (true) or not.
+    ///Indicates if \ref _dist is locally allocated (\c true) or not.
     bool local_dist;
-    //Pointer to the map of processed status of the nodes.
+    ///Pointer to the map of processed status of the nodes.
     ProcessedMap *_processed;
-    //Indicates if _processed is locally allocated (true) or not.
+    ///Indicates if \ref _processed is locally allocated (\c true) or not.
     bool local_processed;
-    //Pointer to the heap cross references.
+    ///Pointer to the heap cross references.
     HeapCrossRef *_heap_cross_ref;
-    //Indicates if _heap_cross_ref is locally allocated (true) or not.
+    ///Indicates if \ref _heap_cross_ref is locally allocated (\c true) or not.
     bool local_heap_cross_ref;
-    //Pointer to the heap.
+    ///Pointer to the heap.
     Heap *_heap;
-    //Indicates if _heap is locally allocated (true) or not.
+    ///Indicates if \ref _heap is locally allocated (\c true) or not.
     bool local_heap;
 
-    //Creates the maps if necessary.
+    ///Creates the maps if necessary.
+
+    ///\todo Better memory allocation (instead of new).
     void create_maps()
     {
@@ -310,5 +316,5 @@
     }
 
-  public:
+  public :
 
     typedef Dijkstra Create;
@@ -319,94 +325,87 @@
 
     template <class T>
-    struct SetPredMapTraits : public Traits {
+    struct DefPredMapTraits : public Traits {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "PredMap is not initialized");
-        return 0; // ignore warnings
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///PredMap type.
+        throw UninitializedParameter();
+      }
+    };
+    ///\ref named-templ-param "Named parameter" for setting PredMap type
+
+    ///\ref named-templ-param "Named parameter" for setting PredMap type
+    ///
     template <class T>
-    struct SetPredMap
-      : public Dijkstra< Digraph, LengthMap, SetPredMapTraits<T> > {
-      typedef Dijkstra< Digraph, LengthMap, SetPredMapTraits<T> > Create;
+    struct DefPredMap
+      : public Dijkstra< Digraph, LengthMap, DefPredMapTraits<T> > {
+      typedef Dijkstra< Digraph, LengthMap, DefPredMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetDistMapTraits : public Traits {
+    struct DefDistMapTraits : public Traits {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &)
       {
-        LEMON_ASSERT(false, "DistMap is not initialized");
-        return 0; // ignore warnings
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///DistMap type.
+        throw UninitializedParameter();
+      }
+    };
+    ///\ref named-templ-param "Named parameter" for setting DistMap type
+
+    ///\ref named-templ-param "Named parameter" for setting DistMap type
+    ///
     template <class T>
-    struct SetDistMap
-      : public Dijkstra< Digraph, LengthMap, SetDistMapTraits<T> > {
-      typedef Dijkstra< Digraph, LengthMap, SetDistMapTraits<T> > Create;
+    struct DefDistMap
+      : public Dijkstra< Digraph, LengthMap, DefDistMapTraits<T> > {
+      typedef Dijkstra< Digraph, LengthMap, DefDistMapTraits<T> > Create;
     };
 
     template <class T>
-    struct SetProcessedMapTraits : public Traits {
+    struct DefProcessedMapTraits : public Traits {
       typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &)
+      static ProcessedMap *createProcessedMap(const Digraph &G)
       {
-        LEMON_ASSERT(false, "ProcessedMap is not initialized");
-        return 0; // ignore warnings
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type.
+        throw UninitializedParameter();
+      }
+    };
+    ///\ref named-templ-param "Named parameter" for setting ProcessedMap type
+
+    ///\ref named-templ-param "Named parameter" for setting ProcessedMap type
+    ///
     template <class T>
-    struct SetProcessedMap
-      : public Dijkstra< Digraph, LengthMap, SetProcessedMapTraits<T> > {
-      typedef Dijkstra< Digraph, LengthMap, SetProcessedMapTraits<T> > Create;
-    };
-
-    struct SetStandardProcessedMapTraits : public Traits {
+    struct DefProcessedMap
+      : public Dijkstra< Digraph, LengthMap, DefProcessedMapTraits<T> > {
+      typedef Dijkstra< Digraph, LengthMap, DefProcessedMapTraits<T> > Create;
+    };
+
+    struct DefDigraphProcessedMapTraits : public Traits {
       typedef typename Digraph::template NodeMap<bool> ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &g)
+      static ProcessedMap *createProcessedMap(const Digraph &G)
       {
-        return new ProcessedMap(g);
-      }
-    };
-    ///\brief \ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
-    ///If you don't set it explicitly, it will be automatically allocated.
-    struct SetStandardProcessedMap
-      : public Dijkstra< Digraph, LengthMap, SetStandardProcessedMapTraits > {
-      typedef Dijkstra< Digraph, LengthMap, SetStandardProcessedMapTraits >
+        return new ProcessedMap(G);
+      }
+    };
+    ///\brief \ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
+    ///
+    ///\ref named-templ-param "Named parameter"
+    ///for setting the ProcessedMap type to be Digraph::NodeMap<bool>.
+    ///If you don't set it explicitely, it will be automatically allocated.
+    template <class T>
+    struct DefProcessedMapToBeDefaultMap
+      : public Dijkstra< Digraph, LengthMap, DefDigraphProcessedMapTraits> {
+      typedef Dijkstra< Digraph, LengthMap, DefDigraphProcessedMapTraits>
       Create;
     };
 
     template <class H, class CR>
-    struct SetHeapTraits : public Traits {
+    struct DefHeapTraits : public Traits {
       typedef CR HeapCrossRef;
       typedef H Heap;
       static HeapCrossRef *createHeapCrossRef(const Digraph &) {
-        LEMON_ASSERT(false, "HeapCrossRef is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
       static Heap *createHeap(HeapCrossRef &)
       {
-        LEMON_ASSERT(false, "Heap is not initialized");
-        return 0; // ignore warnings
+        throw UninitializedParameter();
       }
     };
@@ -415,13 +414,14 @@
     ///
     ///\ref named-templ-param "Named parameter" for setting heap and cross
-    ///reference type.
+    ///reference type
+    ///
     template <class H, class CR = typename Digraph::template NodeMap<int> >
-    struct SetHeap
-      : public Dijkstra< Digraph, LengthMap, SetHeapTraits<H, CR> > {
-      typedef Dijkstra< Digraph, LengthMap, SetHeapTraits<H, CR> > Create;
+    struct DefHeap
+      : public Dijkstra< Digraph, LengthMap, DefHeapTraits<H, CR> > {
+      typedef Dijkstra< Digraph, LengthMap, DefHeapTraits<H, CR> > Create;
     };
 
     template <class H, class CR>
-    struct SetStandardHeapTraits : public Traits {
+    struct DefStandardHeapTraits : public Traits {
       typedef CR HeapCrossRef;
       typedef H Heap;
@@ -442,24 +442,24 @@
     ///parameter and the heap's constructor waits for the cross reference.
     template <class H, class CR = typename Digraph::template NodeMap<int> >
-    struct SetStandardHeap
-      : public Dijkstra< Digraph, LengthMap, SetStandardHeapTraits<H, CR> > {
-      typedef Dijkstra< Digraph, LengthMap, SetStandardHeapTraits<H, CR> >
+    struct DefStandardHeap
+      : public Dijkstra< Digraph, LengthMap, DefStandardHeapTraits<H, CR> > {
+      typedef Dijkstra< Digraph, LengthMap, DefStandardHeapTraits<H, CR> >
       Create;
     };
 
     template <class T>
-    struct SetOperationTraitsTraits : public Traits {
+    struct DefOperationTraitsTraits : public Traits {
       typedef T OperationTraits;
     };
 
     /// \brief \ref named-templ-param "Named parameter" for setting
-    ///\c OperationTraits type
-    ///
-    ///\ref named-templ-param "Named parameter" for setting
-    ///\ref OperationTraits type.
+    /// OperationTraits type
+    ///
+    /// \ref named-templ-param "Named parameter" for setting OperationTraits
+    /// type
     template <class T>
-    struct SetOperationTraits
-      : public Dijkstra<Digraph, LengthMap, SetOperationTraitsTraits<T> > {
-      typedef Dijkstra<Digraph, LengthMap, SetOperationTraitsTraits<T> >
+    struct DefOperationTraits
+      : public Dijkstra<Digraph, LengthMap, DefOperationTraitsTraits<T> > {
+      typedef Dijkstra<Digraph, LengthMap, DefOperationTraitsTraits<T> >
       Create;
     };
@@ -467,4 +467,5 @@
     ///@}
 
+
   protected:
 
@@ -475,9 +476,8 @@
     ///Constructor.
 
-    ///Constructor.
-    ///\param _g The digraph the algorithm runs on.
-    ///\param _length The length map used by the algorithm.
-    Dijkstra(const Digraph& _g, const LengthMap& _length) :
-      G(&_g), length(&_length),
+    ///\param _G the digraph the algorithm will run on.
+    ///\param _length the length map used by the algorithm.
+    Dijkstra(const Digraph& _G, const LengthMap& _length) :
+      G(&_G), length(&_length),
       _pred(NULL), local_pred(false),
       _dist(NULL), local_dist(false),
@@ -507,9 +507,9 @@
     }
 
-    ///Sets the map that stores the predecessor arcs.
-
-    ///Sets the map that stores the predecessor arcs.
+    ///Sets the map storing the predecessor arcs.
+
+    ///Sets the map storing the predecessor arcs.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated map, of course.
     ///\return <tt> (*this) </tt>
@@ -524,27 +524,9 @@
     }
 
-    ///Sets the map that indicates which nodes are processed.
-
-    ///Sets the map that indicates which nodes are processed.
+    ///Sets the map storing the distances calculated by the algorithm.
+
+    ///Sets the map storing the distances calculated by the algorithm.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
-    ///automatically allocated map, of course.
-    ///\return <tt> (*this) </tt>
-    Dijkstra &processedMap(ProcessedMap &m)
-    {
-      if(local_processed) {
-        delete _processed;
-        local_processed=false;
-      }
-      _processed = &m;
-      return *this;
-    }
-
-    ///Sets the map that stores the distances of the nodes.
-
-    ///Sets the map that stores the distances of the nodes calculated by the
-    ///algorithm.
-    ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated map, of course.
     ///\return <tt> (*this) </tt>
@@ -563,5 +545,5 @@
     ///Sets the heap and the cross reference used by algorithm.
     ///If you don't use this function before calling \ref run(),
-    ///it will allocate one. The destructor deallocates this
+    ///it will allocate one. The destuctor deallocates this
     ///automatically allocated heap and cross reference, of course.
     ///\return <tt> (*this) </tt>
@@ -582,5 +564,4 @@
 
   private:
-
     void finalizeNodeData(Node v,Value dst)
     {
@@ -591,13 +572,15 @@
   public:
 
+    typedef PredMapPath<Digraph, PredMap> Path;
+
     ///\name Execution control
-    ///The simplest way to execute the algorithm is to use one of the
-    ///member functions called \ref lemon::Dijkstra::run() "run()".
+    ///The simplest way to execute the algorithm is to use
+    ///one of the member functions called \c run(...).
     ///\n
-    ///If you need more control on the execution, first you must call
-    ///\ref lemon::Dijkstra::init() "init()", then you can add several
-    ///source nodes with \ref lemon::Dijkstra::addSource() "addSource()".
-    ///Finally \ref lemon::Dijkstra::start() "start()" will perform the
-    ///actual path computation.
+    ///If you need more control on the execution,
+    ///first you must call \ref init(), then you can add several source nodes
+    ///with \ref addSource().
+    ///Finally \ref start() will perform the actual path
+    ///computation.
 
     ///@{
@@ -621,7 +604,8 @@
 
     ///Adds a new source node to the priority heap.
+    ///
     ///The optional second parameter is the initial distance of the node.
     ///
-    ///The function checks if the node has already been added to the heap and
+    ///It checks if the node has already been added to the heap and
     ///it is pushed to the heap only if either it was not in the heap
     ///or the shortest path found till then is shorter than \c dst.
@@ -642,5 +626,5 @@
     ///\return The processed node.
     ///
-    ///\warning The priority heap must not be empty.
+    ///\warning The priority heap must not be empty!
     Node processNextNode()
     {
@@ -673,9 +657,11 @@
     }
 
-    ///The next node to be processed.
-
-    ///Returns the next node to be processed or \c INVALID if the
-    ///priority heap is empty.
-    Node nextNode() const
+    ///Next node to be processed.
+
+    ///Next node to be processed.
+    ///
+    ///\return The next node to be processed or INVALID if the priority heap
+    /// is empty.
+    Node nextNode()
     {
       return !_heap->empty()?_heap->top():INVALID;
@@ -683,15 +669,14 @@
 
     ///\brief Returns \c false if there are nodes
-    ///to be processed.
+    ///to be processed in the priority heap
     ///
     ///Returns \c false if there are nodes
-    ///to be processed in the priority heap.
-    bool emptyQueue() const { return _heap->empty(); }
-
+    ///to be processed in the priority heap
+    bool emptyQueue() { return _heap->empty(); }
     ///Returns the number of the nodes to be processed in the priority heap
 
-    ///Returns the number of the nodes to be processed in the priority heap.
-    ///
-    int queueSize() const { return _heap->size(); }
+    ///Returns the number of the nodes to be processed in the priority heap
+    ///
+    int queueSize() { return _heap->size(); }
 
     ///Executes the algorithm.
@@ -699,45 +684,37 @@
     ///Executes the algorithm.
     ///
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
     ///This method runs the %Dijkstra algorithm from the root node(s)
-    ///in order to compute the shortest path to each node.
-    ///
-    ///The algorithm computes
-    ///- the shortest path tree (forest),
-    ///- the distance of each node from the root(s).
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
-    ///
-    ///\note <tt>d.start()</tt> is just a shortcut of the following code.
-    ///\code
-    ///  while ( !d.emptyQueue() ) {
-    ///    d.processNextNode();
-    ///  }
-    ///\endcode
+    ///in order to
+    ///compute the
+    ///shortest path to each node. The algorithm computes
+    ///- The shortest path tree.
+    ///- The distance of each node from the root(s).
+    ///
     void start()
     {
-      while ( !emptyQueue() ) processNextNode();
-    }
-
-    ///Executes the algorithm until the given target node is processed.
-
-    ///Executes the algorithm until the given target node is processed.
+      while ( !_heap->empty() ) processNextNode();
+    }
+
+    ///Executes the algorithm until \c dest is reached.
+
+    ///Executes the algorithm until \c dest is reached.
+    ///
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
     ///
     ///This method runs the %Dijkstra algorithm from the root node(s)
-    ///in order to compute the shortest path to \c t.
-    ///
-    ///The algorithm computes
-    ///- the shortest path to \c t,
-    ///- the distance of \c t from the root(s).
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
-    void start(Node t)
-    {
-      while ( !_heap->empty() && _heap->top()!=t ) processNextNode();
-      if ( !_heap->empty() ) {
-        finalizeNodeData(_heap->top(),_heap->prio());
-        _heap->pop();
-      }
+    ///in order to
+    ///compute the
+    ///shortest path to \c dest. The algorithm computes
+    ///- The shortest path to \c  dest.
+    ///- The distance of \c dest from the root(s).
+    ///
+    void start(Node dest)
+    {
+      while ( !_heap->empty() && _heap->top()!=dest ) processNextNode();
+      if ( !_heap->empty() ) finalizeNodeData(_heap->top(),_heap->prio());
     }
 
@@ -746,16 +723,12 @@
     ///Executes the algorithm until a condition is met.
     ///
-    ///This method runs the %Dijkstra algorithm from the root node(s) in
-    ///order to compute the shortest path to a node \c v with
-    /// <tt>nm[v]</tt> true, if such a node can be found.
-    ///
-    ///\param nm A \c bool (or convertible) node map. The algorithm
+    ///\pre init() must be called and at least one node should be added
+    ///with addSource() before using this function.
+    ///
+    ///\param nm must be a bool (or convertible) node map. The algorithm
     ///will stop when it reaches a node \c v with <tt>nm[v]</tt> true.
     ///
     ///\return The reached node \c v with <tt>nm[v]</tt> true or
     ///\c INVALID if no such node was found.
-    ///
-    ///\pre init() must be called and at least one root node should be
-    ///added with addSource() before using this function.
     template<class NodeBoolMap>
     Node start(const NodeBoolMap &nm)
@@ -767,14 +740,14 @@
     }
 
-    ///Runs the algorithm from the given source node.
-
-    ///This method runs the %Dijkstra algorithm from node \c s
-    ///in order to compute the shortest path to each node.
-    ///
-    ///The algorithm computes
-    ///- the shortest path tree,
-    ///- the distance of each node from the root.
-    ///
-    ///\note <tt>d.run(s)</tt> is just a shortcut of the following code.
+    ///Runs %Dijkstra algorithm from node \c s.
+
+    ///This method runs the %Dijkstra algorithm from a root node \c s
+    ///in order to
+    ///compute the
+    ///shortest path to each node. The algorithm computes
+    ///- The shortest path tree.
+    ///- The distance of each node from the root.
+    ///
+    ///\note d.run(s) is just a shortcut of the following code.
     ///\code
     ///  d.init();
@@ -790,12 +763,10 @@
     ///Finds the shortest path between \c s and \c t.
 
-    ///This method runs the %Dijkstra algorithm from node \c s
-    ///in order to compute the shortest path to node \c t
-    ///(it stops searching when \c t is processed).
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    ///
-    ///\note Apart from the return value, <tt>d.run(s,t)</tt> is just a
-    ///shortcut of the following code.
+    ///Finds the shortest path between \c s and \c t.
+    ///
+    ///\return The length of the shortest s---t path if there exists one,
+    ///0 otherwise.
+    ///\note Apart from the return value, d.run(s) is
+    ///just a shortcut of the following code.
     ///\code
     ///  d.init();
@@ -803,9 +774,9 @@
     ///  d.start(t);
     ///\endcode
-    bool run(Node s,Node t) {
+    Value run(Node s,Node t) {
       init();
       addSource(s);
       start(t);
-      return (*_heap_cross_ref)[t] == Heap::POST_HEAP;
+      return (*_pred)[t]==INVALID?OperationTraits::zero():(*_dist)[t];
     }
 
@@ -815,87 +786,75 @@
     ///The result of the %Dijkstra algorithm can be obtained using these
     ///functions.\n
-    ///Either \ref lemon::Dijkstra::run() "run()" or
-    ///\ref lemon::Dijkstra::start() "start()" must be called before
-    ///using them.
+    ///Before the use of these functions,
+    ///either run() or start() must be called.
 
     ///@{
 
-    ///The shortest path to a node.
-
-    ///Returns the shortest path to a node.
-    ///
-    ///\warning \c t should be reachable from the root(s).
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
-    Path path(Node t) const { return Path(*G, *_pred, t); }
-
-    ///The distance of a node from the root(s).
-
-    ///Returns the distance of a node from the root(s).
-    ///
-    ///\warning If node \c v is not reachable from the root(s), then
-    ///the return value of this function is undefined.
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
+    ///Gives back the shortest path.
+
+    ///Gives back the shortest path.
+    ///\pre The \c t should be reachable from the source.
+    Path path(Node t)
+    {
+      return Path(*G, *_pred, t);
+    }
+
+    ///The distance of a node from the root.
+
+    ///Returns the distance of a node from the root.
+    ///\pre \ref run() must be called before using this function.
+    ///\warning If node \c v in unreachable from the root the return value
+    ///of this funcion is undefined.
     Value dist(Node v) const { return (*_dist)[v]; }
 
-    ///Returns the 'previous arc' of the shortest path tree for a node.
-
-    ///This function returns the 'previous arc' of the shortest path
-    ///tree for the node \c v, i.e. it returns the last arc of a
-    ///shortest path from the root(s) to \c v. It is \c INVALID if \c v
-    ///is not reachable from the root(s) or if \c v is a root.
-    ///
-    ///The shortest path tree used here is equal to the shortest path
-    ///tree used in \ref predNode().
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
-    ///using this function.
+    ///The current distance of a node from the root.
+
+    ///Returns the current distance of a node from the root.
+    ///It may be decreased in the following processes.
+    ///\pre \c node should be reached but not processed
+    Value currentDist(Node v) const { return (*_heap)[v]; }
+
+    ///Returns the 'previous arc' of the shortest path tree.
+
+    ///For a node \c v it returns the 'previous arc' of the shortest path tree,
+    ///i.e. it returns the last arc of a shortest path from the root to \c
+    ///v. It is \ref INVALID
+    ///if \c v is unreachable from the root or if \c v=s. The
+    ///shortest path tree used here is equal to the shortest path tree used in
+    ///\ref predNode().  \pre \ref run() must be called before using
+    ///this function.
     Arc predArc(Node v) const { return (*_pred)[v]; }
 
-    ///Returns the 'previous node' of the shortest path tree for a node.
-
-    ///This function returns the 'previous node' of the shortest path
-    ///tree for the node \c v, i.e. it returns the last but one node
-    ///from a shortest path from the root(s) to \c v. It is \c INVALID
-    ///if \c v is not reachable from the root(s) or if \c v is a root.
-    ///
-    ///The shortest path tree used here is equal to the shortest path
-    ///tree used in \ref predArc().
-    ///
-    ///\pre Either \ref run() or \ref start() must be called before
+    ///Returns the 'previous node' of the shortest path tree.
+
+    ///For a node \c v it returns the 'previous node' of the shortest path tree,
+    ///i.e. it returns the last but one node from a shortest path from the
+    ///root to \c /v. It is INVALID if \c v is unreachable from the root or if
+    ///\c v=s. The shortest path tree used here is equal to the shortest path
+    ///tree used in \ref predArc().  \pre \ref run() must be called before
     ///using this function.
     Node predNode(Node v) const { return (*_pred)[v]==INVALID ? INVALID:
                                   G->source((*_pred)[v]); }
 
-    ///\brief Returns a const reference to the node map that stores the
-    ///distances of the nodes.
-    ///
-    ///Returns a const reference to the node map that stores the distances
-    ///of the nodes calculated by the algorithm.
-    ///
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function.
+    ///Returns a reference to the NodeMap of distances.
+
+    ///Returns a reference to the NodeMap of distances. \pre \ref run() must
+    ///be called before using this function.
     const DistMap &distMap() const { return *_dist;}
 
-    ///\brief Returns a const reference to the node map that stores the
-    ///predecessor arcs.
-    ///
-    ///Returns a const reference to the node map that stores the predecessor
-    ///arcs, which form the shortest path tree.
-    ///
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function.
+    ///Returns a reference to the shortest path tree map.
+
+    ///Returns a reference to the NodeMap of the arcs of the
+    ///shortest path tree.
+    ///\pre \ref run() must be called before using this function.
     const PredMap &predMap() const { return *_pred;}
 
-    ///Checks if a node is reachable from the root(s).
-
-    ///Returns \c true if \c v is reachable from the root(s).
-    ///\pre Either \ref run() or \ref start()
-    ///must be called before using this function.
-    bool reached(Node v) const { return (*_heap_cross_ref)[v] !=
-                                        Heap::PRE_HEAP; }
+    ///Checks if a node is reachable from the root.
+
+    ///Returns \c true if \c v is reachable from the root.
+    ///\warning The source nodes are inditated as unreached.
+    ///\pre \ref run() must be called before using this function.
+    ///
+    bool reached(Node v) { return (*_heap_cross_ref)[v] != Heap::PRE_HEAP; }
 
     ///Checks if a node is processed.
@@ -903,19 +862,7 @@
     ///Returns \c true if \c v is processed, i.e. the shortest
     ///path to \c v has already found.
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function.
-    bool processed(Node v) const { return (*_heap_cross_ref)[v] ==
-                                          Heap::POST_HEAP; }
-
-    ///The current distance of a node from the root(s).
-
-    ///Returns the current distance of a node from the root(s).
-    ///It may be decreased in the following processes.
-    ///\pre Either \ref run() or \ref init()
-    ///must be called before using this function and
-    ///node \c v must be reached but not necessarily processed.
-    Value currentDist(Node v) const {
-      return processed(v) ? (*_dist)[v] : (*_heap)[v];
-    }
+    ///\pre \ref run() must be called before using this function.
+    ///
+    bool processed(Node v) { return (*_heap_cross_ref)[v] == Heap::POST_HEAP; }
 
     ///@}
@@ -923,13 +870,16 @@
 
 
-  ///Default traits class of dijkstra() function.
-
-  ///Default traits class of dijkstra() function.
-  ///\tparam GR The type of the digraph.
-  ///\tparam LM The type of the length map.
+
+
+
+  ///Default traits class of Dijkstra function.
+
+  ///Default traits class of Dijkstra function.
+  ///\tparam GR Digraph type.
+  ///\tparam LM Type of length map.
   template<class GR, class LM>
   struct DijkstraWizardDefaultTraits
   {
-    ///The type of the digraph the algorithm runs on.
+    ///The digraph type the algorithm runs on.
     typedef GR Digraph;
     ///The type of the map that stores the arc lengths.
@@ -938,166 +888,178 @@
     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     typedef LM LengthMap;
-    ///The type of the length of the arcs.
+    //The type of the length of the arcs.
     typedef typename LM::Value Value;
-
     /// Operation traits for Dijkstra algorithm.
 
-    /// This class defines the operations that are used in the algorithm.
+    /// It defines the used operation by the algorithm.
     /// \see DijkstraDefaultOperationTraits
     typedef DijkstraDefaultOperationTraits<Value> OperationTraits;
-
-    /// The cross reference type used by the heap.
-
-    /// The cross reference type used by the heap.
+    ///The heap type used by Dijkstra algorithm.
+
+    /// The cross reference type used by heap.
+
+    /// The cross reference type used by heap.
     /// Usually it is \c Digraph::NodeMap<int>.
     typedef typename Digraph::template NodeMap<int> HeapCrossRef;
-    ///Instantiates a \ref HeapCrossRef.
+    ///Instantiates a HeapCrossRef.
 
     ///This function instantiates a \ref HeapCrossRef.
-    /// \param g is the digraph, to which we would like to define the
+    /// \param G is the digraph, to which we would like to define the
     /// HeapCrossRef.
-    static HeapCrossRef *createHeapCrossRef(const Digraph &g)
-    {
-      return new HeapCrossRef(g);
-    }
-
-    ///The heap type used by the Dijkstra algorithm.
-
-    ///The heap type used by the Dijkstra algorithm.
+    /// \todo The digraph alone may be insufficient for the initialization
+    static HeapCrossRef *createHeapCrossRef(const GR &G)
+    {
+      return new HeapCrossRef(G);
+    }
+
+    ///The heap type used by Dijkstra algorithm.
+
+    ///The heap type used by Dijkstra algorithm.
     ///
     ///\sa BinHeap
     ///\sa Dijkstra
-    typedef BinHeap<Value, typename Digraph::template NodeMap<int>,
+    typedef BinHeap<typename LM::Value, typename GR::template NodeMap<int>,
                     std::less<Value> > Heap;
 
-    ///Instantiates a \ref Heap.
-
-    ///This function instantiates a \ref Heap.
-    /// \param r is the HeapCrossRef which is used.
-    static Heap *createHeap(HeapCrossRef& r)
-    {
-      return new Heap(r);
-    }
-
-    ///\brief The type of the map that stores the predecessor
+    static Heap *createHeap(HeapCrossRef& R)
+    {
+      return new Heap(R);
+    }
+
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     ///
-    ///The type of the map that stores the predecessor
+    ///The type of the map that stores the last
     ///arcs of the shortest paths.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
+    ///
+    typedef NullMap <typename GR::Node,typename GR::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
-    ///\param g is the digraph, to which we would like to define the
-    ///PredMap.
-    static PredMap *createPredMap(const Digraph &g)
-    {
-      return new PredMap(g);
-    }
-
-    ///The type of the map that indicates which nodes are processed.
-
-    ///The type of the map that indicates which nodes are processed.
+    ///This function instantiates a \ref PredMap.
+    ///\param g is the digraph, to which we would like to define the PredMap.
+    ///\todo The digraph alone may be insufficient for the initialization
+#ifdef DOXYGEN
+    static PredMap *createPredMap(const GR &g)
+#else
+    static PredMap *createPredMap(const GR &)
+#endif
+    {
+      return new PredMap();
+    }
+    ///The type of the map that stores whether a nodes is processed.
+
+    ///The type of the map that stores whether a nodes is processed.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     ///By default it is a NullMap.
+    ///\todo If it is set to a real map,
+    ///Dijkstra::processed() should read this.
+    ///\todo named parameter to set this type, function to read and write.
     typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
     ///Instantiates a ProcessedMap.
 
-    ///This function instantiates a ProcessedMap.
+    ///This function instantiates a \ref ProcessedMap.
     ///\param g is the digraph, to which
-    ///we would like to define the ProcessedMap.
+    ///we would like to define the \ref ProcessedMap
 #ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &g)
+    static ProcessedMap *createProcessedMap(const GR &g)
 #else
-    static ProcessedMap *createProcessedMap(const Digraph &)
+    static ProcessedMap *createProcessedMap(const GR &)
 #endif
     {
       return new ProcessedMap();
     }
-
-    ///The type of the map that stores the distances of the nodes.
-
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map that stores the dists of the nodes.
+
+    ///The type of the map that stores the dists of the nodes.
     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
+    ///
+    typedef NullMap<typename Digraph::Node,typename LM::Value> DistMap;
     ///Instantiates a DistMap.
 
-    ///This function instantiates a DistMap.
+    ///This function instantiates a \ref DistMap.
     ///\param g is the digraph, to which we would like to define
-    ///the DistMap
-    static DistMap *createDistMap(const Digraph &g)
-    {
-      return new DistMap(g);
-    }
-
-    ///The type of the shortest paths.
-
-    ///The type of the shortest paths.
-    ///It must meet the \ref concepts::Path "Path" concept.
-    typedef lemon::Path<Digraph> Path;
+    ///the \ref DistMap
+#ifdef DOXYGEN
+    static DistMap *createDistMap(const GR &g)
+#else
+    static DistMap *createDistMap(const GR &)
+#endif
+    {
+      return new DistMap();
+    }
   };
 
-  /// Default traits class used by DijkstraWizard
+  /// Default traits used by \ref DijkstraWizard
 
   /// To make it easier to use Dijkstra algorithm
-  /// we have created a wizard class.
+  ///we have created a wizard class.
   /// This \ref DijkstraWizard class needs default traits,
-  /// as well as the \ref Dijkstra class.
+  ///as well as the \ref Dijkstra class.
   /// The \ref DijkstraWizardBase is a class to be the default traits of the
   /// \ref DijkstraWizard class.
+  /// \todo More named parameters are required...
   template<class GR,class LM>
   class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM>
   {
+
     typedef DijkstraWizardDefaultTraits<GR,LM> Base;
   protected:
-    //The type of the nodes in the digraph.
+    /// Type of the nodes in the digraph.
     typedef typename Base::Digraph::Node Node;
 
-    //Pointer to the digraph the algorithm runs on.
+    /// Pointer to the underlying digraph.
     void *_g;
-    //Pointer to the length map.
+    /// Pointer to the length map
     void *_length;
-    //Pointer to the map of processed nodes.
-    void *_processed;
-    //Pointer to the map of predecessors arcs.
+    ///Pointer to the map of predecessors arcs.
     void *_pred;
-    //Pointer to the map of distances.
+    ///Pointer to the map of distances.
     void *_dist;
-    //Pointer to the shortest path to the target node.
-    void *_path;
-    //Pointer to the distance of the target node.
-    void *_di;
-
-  public:
+    ///Pointer to the source node.
+    Node _source;
+
+    public:
     /// Constructor.
 
     /// This constructor does not require parameters, therefore it initiates
-    /// all of the attributes to \c 0.
-    DijkstraWizardBase() : _g(0), _length(0), _processed(0), _pred(0),
-                           _dist(0), _path(0), _di(0) {}
+    /// all of the attributes to default values (0, INVALID).
+    DijkstraWizardBase() : _g(0), _length(0), _pred(0),
+                           _dist(0), _source(INVALID) {}
 
     /// Constructor.
 
-    /// This constructor requires two parameters,
-    /// others are initiated to \c 0.
-    /// \param g The digraph the algorithm runs on.
-    /// \param l The length map.
-    DijkstraWizardBase(const GR &g,const LM &l) :
+    /// This constructor requires some parameters,
+    /// listed in the parameters list.
+    /// Others are initiated to 0.
+    /// \param g is the initial value of  \ref _g
+    /// \param l is the initial value of  \ref _length
+    /// \param s is the initial value of  \ref _source
+    DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
       _g(reinterpret_cast<void*>(const_cast<GR*>(&g))),
       _length(reinterpret_cast<void*>(const_cast<LM*>(&l))),
-      _processed(0), _pred(0), _dist(0), _path(0), _di(0) {}
+      _pred(0), _dist(0), _source(s) {}
 
   };
 
-  /// Auxiliary class for the function-type interface of Dijkstra algorithm.
-
-  /// This auxiliary class is created to implement the
-  /// \ref dijkstra() "function-type interface" of \ref Dijkstra algorithm.
-  /// It does not have own \ref run() method, it uses the functions
-  /// and features of the plain \ref Dijkstra.
+  /// A class to make the usage of Dijkstra algorithm easier
+
+  /// This class is created to make it easier to use Dijkstra algorithm.
+  /// It uses the functions and features of the plain \ref Dijkstra,
+  /// but it is much simpler to use it.
   ///
-  /// This class should only be used through the \ref dijkstra() function,
-  /// which makes it easier to use the algorithm.
+  /// Simplicity means that the way to change the types defined
+  /// in the traits class is based on functions that returns the new class
+  /// and not on templatable built-in classes.
+  /// When using the plain \ref Dijkstra
+  /// the new class with the modified type comes from
+  /// the original class by using the ::
+  /// operator. In the case of \ref DijkstraWizard only
+  /// a function have to be called and it will
+  /// return the needed class.
+  ///
+  /// It does not have own \ref run method. When its \ref run method is called
+  /// it initiates a plain \ref Dijkstra class, and calls the \ref
+  /// Dijkstra::run method of it.
   template<class TR>
   class DijkstraWizard : public TR
@@ -1105,10 +1067,13 @@
     typedef TR Base;
 
-    ///The type of the digraph the algorithm runs on.
+    ///The type of the underlying digraph.
     typedef typename TR::Digraph Digraph;
-
+    //\e
     typedef typename Digraph::Node Node;
+    //\e
     typedef typename Digraph::NodeIt NodeIt;
+    //\e
     typedef typename Digraph::Arc Arc;
+    //\e
     typedef typename Digraph::OutArcIt OutArcIt;
 
@@ -1117,18 +1082,12 @@
     ///The type of the length of the arcs.
     typedef typename LengthMap::Value Value;
-    ///\brief The type of the map that stores the predecessor
+    ///\brief The type of the map that stores the last
     ///arcs of the shortest paths.
     typedef typename TR::PredMap PredMap;
-    ///The type of the map that stores the distances of the nodes.
+    ///The type of the map that stores the dists of the nodes.
     typedef typename TR::DistMap DistMap;
-    ///The type of the map that indicates which nodes are processed.
-    typedef typename TR::ProcessedMap ProcessedMap;
-    ///The type of the shortest paths
-    typedef typename TR::Path Path;
     ///The heap type used by the dijkstra algorithm.
     typedef typename TR::Heap Heap;
-
   public:
-
     /// Constructor.
     DijkstraWizard() : TR() {}
@@ -1138,8 +1097,6 @@
     /// Constructor that requires parameters.
     /// These parameters will be the default values for the traits class.
-    /// \param g The digraph the algorithm runs on.
-    /// \param l The length map.
-    DijkstraWizard(const Digraph &g, const LengthMap &l) :
-      TR(g,l) {}
+    DijkstraWizard(const Digraph &g,const LengthMap &l, Node s=INVALID) :
+      TR(g,l,s) {}
 
     ///Copy constructor
@@ -1148,127 +1105,76 @@
     ~DijkstraWizard() {}
 
-    ///Runs Dijkstra algorithm from the given source node.
-
-    ///This method runs %Dijkstra algorithm from the given source node
-    ///in order to compute the shortest path to each node.
+    ///Runs Dijkstra algorithm from a given node.
+
+    ///Runs Dijkstra algorithm from a given node.
+    ///The node can be given by the \ref source function.
+    void run()
+    {
+      if(Base::_source==INVALID) throw UninitializedParameter();
+      Dijkstra<Digraph,LengthMap,TR>
+        dij(*reinterpret_cast<const Digraph*>(Base::_g),
+            *reinterpret_cast<const LengthMap*>(Base::_length));
+      if(Base::_pred) dij.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
+      if(Base::_dist) dij.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
+      dij.run(Base::_source);
+    }
+
+    ///Runs Dijkstra algorithm from the given node.
+
+    ///Runs Dijkstra algorithm from the given node.
+    ///\param s is the given source.
     void run(Node s)
     {
-      Dijkstra<Digraph,LengthMap,TR>
-        dijk(*reinterpret_cast<const Digraph*>(Base::_g),
-             *reinterpret_cast<const LengthMap*>(Base::_length));
-      if (Base::_pred)
-        dijk.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        dijk.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_processed)
-        dijk.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      dijk.run(s);
-    }
-
-    ///Finds the shortest path between \c s and \c t.
-
-    ///This method runs the %Dijkstra algorithm from node \c s
-    ///in order to compute the shortest path to node \c t
-    ///(it stops searching when \c t is processed).
-    ///
-    ///\return \c true if \c t is reachable form \c s.
-    bool run(Node s, Node t)
-    {
-      Dijkstra<Digraph,LengthMap,TR>
-        dijk(*reinterpret_cast<const Digraph*>(Base::_g),
-             *reinterpret_cast<const LengthMap*>(Base::_length));
-      if (Base::_pred)
-        dijk.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
-      if (Base::_dist)
-        dijk.distMap(*reinterpret_cast<DistMap*>(Base::_dist));
-      if (Base::_processed)
-        dijk.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed));
-      dijk.run(s,t);
-      if (Base::_path)
-        *reinterpret_cast<Path*>(Base::_path) = dijk.path(t);
-      if (Base::_di)
-        *reinterpret_cast<Value*>(Base::_di) = dijk.dist(t);
-      return dijk.reached(t);
+      Base::_source=s;
+      run();
     }
 
     template<class T>
-    struct SetPredMapBase : public Base {
+    struct DefPredMapBase : public Base {
       typedef T PredMap;
       static PredMap *createPredMap(const Digraph &) { return 0; };
-      SetPredMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting PredMap object.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for setting PredMap object.
+      DefPredMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting PredMap type
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting PredMap type
+    ///
     template<class T>
-    DijkstraWizard<SetPredMapBase<T> > predMap(const T &t)
+    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
     {
       Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DijkstraWizard<SetPredMapBase<T> >(*this);
+      return DijkstraWizard<DefPredMapBase<T> >(*this);
     }
 
     template<class T>
-    struct SetDistMapBase : public Base {
+    struct DefDistMapBase : public Base {
       typedef T DistMap;
       static DistMap *createDistMap(const Digraph &) { return 0; };
-      SetDistMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting DistMap object.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for setting DistMap object.
+      DefDistMapBase(const TR &b) : TR(b) {}
+    };
+
+    ///\brief \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
+    /// \ref named-templ-param "Named parameter"
+    ///function for setting DistMap type
+    ///
     template<class T>
-    DijkstraWizard<SetDistMapBase<T> > distMap(const T &t)
+    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
     {
       Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DijkstraWizard<SetDistMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetProcessedMapBase : public Base {
-      typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
-      SetProcessedMapBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    ///
-    /// \ref named-func-param "Named parameter"
-    ///for setting ProcessedMap object.
-    template<class T>
-    DijkstraWizard<SetProcessedMapBase<T> > processedMap(const T &t)
-    {
-      Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DijkstraWizard<SetProcessedMapBase<T> >(*this);
-    }
-
-    template<class T>
-    struct SetPathBase : public Base {
-      typedef T Path;
-      SetPathBase(const TR &b) : TR(b) {}
-    };
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the shortest path to the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the shortest path to the target node.
-    template<class T>
-    DijkstraWizard<SetPathBase<T> > path(const T &t)
-    {
-      Base::_path=reinterpret_cast<void*>(const_cast<T*>(&t));
-      return DijkstraWizard<SetPathBase<T> >(*this);
-    }
-
-    ///\brief \ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    ///
-    ///\ref named-func-param "Named parameter"
-    ///for getting the distance of the target node.
-    DijkstraWizard dist(const Value &d)
-    {
-      Base::_di=reinterpret_cast<void*>(const_cast<Value*>(&d));
+      return DijkstraWizard<DefDistMapBase<T> >(*this);
+    }
+
+    /// Sets the source node, from which the Dijkstra algorithm runs.
+
+    /// Sets the source node, from which the Dijkstra algorithm runs.
+    /// \param s is the source node.
+    DijkstraWizard<TR> &source(Node s)
+    {
+      Base::_source=s;
       return *this;
     }
@@ -1276,18 +1182,16 @@
   };
 
-  ///Function-type interface for Dijkstra algorithm.
+  ///Function type interface for Dijkstra algorithm.
 
   /// \ingroup shortest_path
-  ///Function-type interface for Dijkstra algorithm.
+  ///Function type interface for Dijkstra algorithm.
   ///
-  ///This function also has several \ref named-func-param "named parameters",
+  ///This function also has several
+  ///\ref named-templ-func-param "named parameters",
   ///they are declared as the members of class \ref DijkstraWizard.
-  ///The following examples show how to use these parameters.
+  ///The following
+  ///example shows how to use these parameters.
   ///\code
-  ///  // Compute shortest path from node s to each node
-  ///  dijkstra(g,length).predMap(preds).distMap(dists).run(s);
-  ///
-  ///  // Compute shortest path from s to t
-  ///  bool reached = dijkstra(g,length).path(p).dist(d).run(s,t);
+  ///  dijkstra(g,length,source).predMap(preds).run();
   ///\endcode
   ///\warning Don't forget to put the \ref DijkstraWizard::run() "run()"
@@ -1297,7 +1201,7 @@
   template<class GR, class LM>
   DijkstraWizard<DijkstraWizardBase<GR,LM> >
-  dijkstra(const GR &digraph, const LM &length)
+  dijkstra(const GR &g,const LM &l,typename GR::Node s=INVALID)
   {
-    return DijkstraWizard<DijkstraWizardBase<GR,LM> >(digraph,length);
+    return DijkstraWizard<DijkstraWizardBase<GR,LM> >(g,l,s);
   }
 
Index: lemon/dim2.h
===================================================================
--- lemon/dim2.h	(revision 318)
+++ lemon/dim2.h	(revision 220)
@@ -21,4 +21,5 @@
 
 #include <iostream>
+#include <lemon/core.h>
 
 ///\ingroup misc
@@ -29,5 +30,6 @@
 /// a two dimensional vector with the usual operations.
 ///
-/// The class \ref lemon::dim2::Box "dim2::Box" can be used to determine
+/// The class \ref lemon::dim2::BoundingBox "dim2::BoundingBox"
+/// can be used to determine
 /// the rectangular bounding box of a set of
 /// \ref lemon::dim2::Point "dim2::Point"'s.
@@ -44,7 +46,7 @@
   /// @{
 
-  /// Two dimensional vector (plain vector)
-
-  /// A simple two dimensional vector (plain vector) implementation
+  /// A simple two dimensional vector (plainvector) implementation
+
+  /// A simple two dimensional vector (plainvector) implementation
   /// with the usual vector operations.
   template<typename T>
@@ -185,7 +187,7 @@
   }
 
-  ///Read a plain vector from a stream
-
-  ///Read a plain vector from a stream.
+  ///Read a plainvector from a stream
+
+  ///Read a plainvector from a stream.
   ///\relates Point
   ///
@@ -213,7 +215,7 @@
   }
 
-  ///Write a plain vector to a stream
-
-  ///Write a plain vector to a stream.
+  ///Write a plainvector to a stream
+
+  ///Write a plainvector to a stream.
   ///\relates Point
   ///
@@ -221,5 +223,5 @@
   inline std::ostream& operator<<(std::ostream &os, const Point<T>& z)
   {
-    os << "(" << z.x << "," << z.y << ")";
+    os << "(" << z.x << ", " << z.y << ")";
     return os;
   }
@@ -260,40 +262,37 @@
 
 
-  /// Bounding box of plain vectors (points).
-
-  /// A class to calculate or store the bounding box of plain vectors
-  /// (\ref Point "points").
-  template<typename T>
-  class Box {
-      Point<T> _bottom_left, _top_right;
+  /// A class to calculate or store the bounding box of plainvectors.
+
+  /// A class to calculate or store the bounding box of plainvectors.
+  ///
+    template<typename T>
+    class BoundingBox {
+      Point<T> bottom_left, top_right;
       bool _empty;
     public:
 
-      ///Default constructor: creates an empty box
-      Box() { _empty = true; }
-
-      ///Construct a box from one point
-      Box(Point<T> a) {
-        _bottom_left = _top_right = a;
-        _empty = false;
-      }
-
-      ///Construct a box from two points
-
-      ///Construct a box from two points.
+      ///Default constructor: creates an empty bounding box
+      BoundingBox() { _empty = true; }
+
+      ///Construct an instance from one point
+      BoundingBox(Point<T> a) { bottom_left=top_right=a; _empty = false; }
+
+      ///Construct an instance from two points
+
+      ///Construct an instance from two points.
       ///\param a The bottom left corner.
       ///\param b The top right corner.
       ///\warning The coordinates of the bottom left corner must be no more
       ///than those of the top right one.
-      Box(Point<T> a,Point<T> b)
+      BoundingBox(Point<T> a,Point<T> b)
       {
-        _bottom_left = a;
-        _top_right = b;
+        bottom_left=a;
+        top_right=b;
         _empty = false;
       }
 
-      ///Construct a box from four numbers
-
-      ///Construct a box from four numbers.
+      ///Construct an instance from four numbers
+
+      ///Construct an instance from four numbers.
       ///\param l The left side of the box.
       ///\param b The bottom of the box.
@@ -302,25 +301,25 @@
       ///\warning The left side must be no more than the right side and
       ///bottom must be no more than the top.
-      Box(T l,T b,T r,T t)
+      BoundingBox(T l,T b,T r,T t)
       {
-        _bottom_left=Point<T>(l,b);
-        _top_right=Point<T>(r,t);
+        bottom_left=Point<T>(l,b);
+        top_right=Point<T>(r,t);
         _empty = false;
       }
 
-      ///Return \c true if the box is empty.
-
-      ///Return \c true if the box is empty (i.e. return \c false
+      ///Return \c true if the bounding box is empty.
+
+      ///Return \c true if the bounding box is empty (i.e. return \c false
       ///if at least one point was added to the box or the coordinates of
       ///the box were set).
       ///
-      ///The coordinates of an empty box are not defined.
+      ///The coordinates of an empty bounding box are not defined.
       bool empty() const {
         return _empty;
       }
 
-      ///Make the box empty
+      ///Make the BoundingBox empty
       void clear() {
-        _empty = true;
+        _empty=1;
       }
 
@@ -328,7 +327,7 @@
 
       ///Give back the bottom left corner of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       Point<T> bottomLeft() const {
-        return _bottom_left;
+        return bottom_left;
       }
 
@@ -336,7 +335,7 @@
 
       ///Set the bottom left corner of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void bottomLeft(Point<T> p) {
-        _bottom_left = p;
+        bottom_left = p;
       }
 
@@ -344,7 +343,7 @@
 
       ///Give back the top right corner of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       Point<T> topRight() const {
-        return _top_right;
+        return top_right;
       }
 
@@ -352,7 +351,7 @@
 
       ///Set the top right corner of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void topRight(Point<T> p) {
-        _top_right = p;
+        top_right = p;
       }
 
@@ -360,7 +359,7 @@
 
       ///Give back the bottom right corner of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       Point<T> bottomRight() const {
-        return Point<T>(_top_right.x,_bottom_left.y);
+        return Point<T>(top_right.x,bottom_left.y);
       }
 
@@ -368,8 +367,8 @@
 
       ///Set the bottom right corner of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void bottomRight(Point<T> p) {
-        _top_right.x = p.x;
-        _bottom_left.y = p.y;
+        top_right.x = p.x;
+        bottom_left.y = p.y;
       }
 
@@ -377,7 +376,7 @@
 
       ///Give back the top left corner of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       Point<T> topLeft() const {
-        return Point<T>(_bottom_left.x,_top_right.y);
+        return Point<T>(bottom_left.x,top_right.y);
       }
 
@@ -385,8 +384,8 @@
 
       ///Set the top left corner of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void topLeft(Point<T> p) {
-        _top_right.y = p.y;
-        _bottom_left.x = p.x;
+        top_right.y = p.y;
+        bottom_left.x = p.x;
       }
 
@@ -394,7 +393,7 @@
 
       ///Give back the bottom of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T bottom() const {
-        return _bottom_left.y;
+        return bottom_left.y;
       }
 
@@ -402,7 +401,7 @@
 
       ///Set the bottom of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void bottom(T t) {
-        _bottom_left.y = t;
+        bottom_left.y = t;
       }
 
@@ -410,7 +409,7 @@
 
       ///Give back the top of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T top() const {
-        return _top_right.y;
+        return top_right.y;
       }
 
@@ -418,7 +417,7 @@
 
       ///Set the top of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void top(T t) {
-        _top_right.y = t;
+        top_right.y = t;
       }
 
@@ -426,7 +425,7 @@
 
       ///Give back the left side of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T left() const {
-        return _bottom_left.x;
+        return bottom_left.x;
       }
 
@@ -434,7 +433,7 @@
 
       ///Set the left side of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void left(T t) {
-        _bottom_left.x = t;
+        bottom_left.x = t;
       }
 
@@ -442,7 +441,7 @@
 
       /// Give back the right side of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T right() const {
-        return _top_right.x;
+        return top_right.x;
       }
 
@@ -450,7 +449,7 @@
 
       ///Set the right side of the box.
-      ///\pre The box must not be empty.
+      ///It should only be used for non-empty box.
       void right(T t) {
-        _top_right.x = t;
+        top_right.x = t;
       }
 
@@ -458,7 +457,7 @@
 
       ///Give back the height of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T height() const {
-        return _top_right.y-_bottom_left.y;
+        return top_right.y-bottom_left.y;
       }
 
@@ -466,114 +465,74 @@
 
       ///Give back the width of the box.
-      ///If the box is empty, then the return value is not defined.
+      ///If the bounding box is empty, then the return value is not defined.
       T width() const {
-        return _top_right.x-_bottom_left.x;
-      }
-
-      ///Checks whether a point is inside the box
+        return top_right.x-bottom_left.x;
+      }
+
+      ///Checks whether a point is inside a bounding box
       bool inside(const Point<T>& u) const {
         if (_empty)
           return false;
-        else {
-          return ( (u.x-_bottom_left.x)*(_top_right.x-u.x) >= 0 &&
-                   (u.y-_bottom_left.y)*(_top_right.y-u.y) >= 0 );
+        else{
+          return ((u.x-bottom_left.x)*(top_right.x-u.x) >= 0 &&
+              (u.y-bottom_left.y)*(top_right.y-u.y) >= 0 );
         }
       }
 
-      ///Increments the box with a point
-
-      ///Increments the box with a point.
+      ///Increments a bounding box with a point
+
+      ///Increments a bounding box with a point.
       ///
-      Box& add(const Point<T>& u){
-        if (_empty) {
-          _bottom_left = _top_right = u;
+      BoundingBox& add(const Point<T>& u){
+        if (_empty){
+          bottom_left=top_right=u;
           _empty = false;
         }
-        else {
-          if (_bottom_left.x > u.x) _bottom_left.x = u.x;
-          if (_bottom_left.y > u.y) _bottom_left.y = u.y;
-          if (_top_right.x < u.x) _top_right.x = u.x;
-          if (_top_right.y < u.y) _top_right.y = u.y;
+        else{
+          if (bottom_left.x > u.x) bottom_left.x = u.x;
+          if (bottom_left.y > u.y) bottom_left.y = u.y;
+          if (top_right.x < u.x) top_right.x = u.x;
+          if (top_right.y < u.y) top_right.y = u.y;
         }
         return *this;
       }
 
-      ///Increments the box to contain another box
-
-      ///Increments the box to contain another box.
+      ///Increments a bounding box to contain another bounding box
+
+      ///Increments a bounding box to contain another bounding box.
       ///
-      Box& add(const Box &u){
+      BoundingBox& add(const BoundingBox &u){
         if ( !u.empty() ){
-          add(u._bottom_left);
-          add(u._top_right);
+          this->add(u.bottomLeft());
+          this->add(u.topRight());
         }
         return *this;
       }
 
-      ///Intersection of two boxes
-
-      ///Intersection of two boxes.
+      ///Intersection of two bounding boxes
+
+      ///Intersection of two bounding boxes.
       ///
-      Box operator&(const Box& u) const {
-        Box b;
-        if (_empty || u._empty) {
+      BoundingBox operator&(const BoundingBox& u) const {
+        BoundingBox b;
+        if (this->_empty || u._empty) {
           b._empty = true;
         } else {
-          b._bottom_left.x = std::max(_bottom_left.x, u._bottom_left.x);
-          b._bottom_left.y = std::max(_bottom_left.y, u._bottom_left.y);
-          b._top_right.x = std::min(_top_right.x, u._top_right.x);
-          b._top_right.y = std::min(_top_right.y, u._top_right.y);
-          b._empty = b._bottom_left.x > b._top_right.x ||
-                     b._bottom_left.y > b._top_right.y;
+          b.bottom_left.x = std::max(this->bottom_left.x,u.bottom_left.x);
+          b.bottom_left.y = std::max(this->bottom_left.y,u.bottom_left.y);
+          b.top_right.x = std::min(this->top_right.x,u.top_right.x);
+          b.top_right.y = std::min(this->top_right.y,u.top_right.y);
+          b._empty = b.bottom_left.x > b.top_right.x ||
+                     b.bottom_left.y > b.top_right.y;
         }
         return b;
       }
 
-  };//class Box
-
-
-  ///Read a box from a stream
-
-  ///Read a box from a stream.
-  ///\relates Box
-  template<typename T>
-  inline std::istream& operator>>(std::istream &is, Box<T>& b) {
-    char c;
-    Point<T> p;
-    if (is >> c) {
-      if (c != '(') is.putback(c);
-    } else {
-      is.clear();
-    }
-    if (!(is >> p)) return is;
-    b.bottomLeft(p);
-    if (is >> c) {
-      if (c != ',') is.putback(c);
-    } else {
-      is.clear();
-    }
-    if (!(is >> p)) return is;
-    b.topRight(p);
-    if (is >> c) {
-      if (c != ')') is.putback(c);
-    } else {
-      is.clear();
-    }
-    return is;
-  }
-
-  ///Write a box to a stream
-
-  ///Write a box to a stream.
-  ///\relates Box
-  template<typename T>
-  inline std::ostream& operator<<(std::ostream &os, const Box<T>& b)
-  {
-    os << "(" << b.bottomLeft() << "," << b.topRight() << ")";
-    return os;
-  }
-
-  ///Map of x-coordinates of a <tt>Point</tt>-map
-
+    };//class Boundingbox
+
+
+  ///Map of x-coordinates of a \ref Point "Point"-map
+
+  ///\ingroup maps
   ///Map of x-coordinates of a \ref Point "Point"-map.
   ///
@@ -592,7 +551,9 @@
   };
 
-  ///Returns an XMap class
-
-  ///This function just returns an XMap class.
+  ///Returns an \ref XMap class
+
+  ///This function just returns an \ref XMap class.
+  ///
+  ///\ingroup maps
   ///\relates XMap
   template<class M>
@@ -608,7 +569,8 @@
   }
 
-  ///Constant (read only) version of XMap
-
-  ///Constant (read only) version of XMap.
+  ///Constant (read only) version of \ref XMap
+
+  ///\ingroup maps
+  ///Constant (read only) version of \ref XMap
   ///
   template<class M>
@@ -625,7 +587,9 @@
   };
 
-  ///Returns a ConstXMap class
-
-  ///This function just returns a ConstXMap class.
+  ///Returns a \ref ConstXMap class
+
+  ///This function just returns a \ref ConstXMap class.
+  ///
+  ///\ingroup maps
   ///\relates ConstXMap
   template<class M>
@@ -635,6 +599,7 @@
   }
 
-  ///Map of y-coordinates of a <tt>Point</tt>-map
-
+  ///Map of y-coordinates of a \ref Point "Point"-map
+
+  ///\ingroup maps
   ///Map of y-coordinates of a \ref Point "Point"-map.
   ///
@@ -653,7 +618,9 @@
   };
 
-  ///Returns a YMap class
-
-  ///This function just returns a YMap class.
+  ///Returns a \ref YMap class
+
+  ///This function just returns a \ref YMap class.
+  ///
+  ///\ingroup maps
   ///\relates YMap
   template<class M>
@@ -669,7 +636,8 @@
   }
 
-  ///Constant (read only) version of YMap
-
-  ///Constant (read only) version of YMap.
+  ///Constant (read only) version of \ref YMap
+
+  ///\ingroup maps
+  ///Constant (read only) version of \ref YMap
   ///
   template<class M>
@@ -686,7 +654,9 @@
   };
 
-  ///Returns a ConstYMap class
-
-  ///This function just returns a ConstYMap class.
+  ///Returns a \ref ConstYMap class
+
+  ///This function just returns a \ref ConstYMap class.
+  ///
+  ///\ingroup maps
   ///\relates ConstYMap
   template<class M>
@@ -697,8 +667,10 @@
 
 
-  ///\brief Map of the normSquare() of a <tt>Point</tt>-map
+  ///\brief Map of the \ref Point::normSquare() "normSquare()"
+  ///of a \ref Point "Point"-map
   ///
   ///Map of the \ref Point::normSquare() "normSquare()"
   ///of a \ref Point "Point"-map.
+  ///\ingroup maps
   template<class M>
   class NormSquareMap
@@ -714,7 +686,9 @@
   };
 
-  ///Returns a NormSquareMap class
-
-  ///This function just returns a NormSquareMap class.
+  ///Returns a \ref NormSquareMap class
+
+  ///This function just returns a \ref NormSquareMap class.
+  ///
+  ///\ingroup maps
   ///\relates NormSquareMap
   template<class M>
Index: lemon/error.h
===================================================================
--- lemon/error.h	(revision 291)
+++ lemon/error.h	(revision 212)
@@ -36,15 +36,144 @@
   /// @{
 
-  /// \brief Generic exception class.
+  /// \brief Exception safe wrapper class.
   ///
+  /// Exception safe wrapper class to implement the members of exceptions.
+  template <typename _Type>
+  class ExceptionMember {
+  public:
+    typedef _Type Type;
+
+    ExceptionMember() throw() {
+      try {
+        ptr.reset(new Type());
+      } catch (...) {}
+    }
+
+    ExceptionMember(const Type& type) throw() {
+      try {
+        ptr.reset(new Type());
+        if (ptr.get() == 0) return;
+        *ptr = type;
+      } catch (...) {}
+    }
+
+    ExceptionMember(const ExceptionMember& copy) throw() {
+      try {
+        if (!copy.valid()) return;
+        ptr.reset(new Type());
+        if (ptr.get() == 0) return;
+        *ptr = copy.get();
+      } catch (...) {}
+    }
+
+    ExceptionMember& operator=(const ExceptionMember& copy) throw() {
+      if (ptr.get() == 0) return;
+      try {
+        if (!copy.valid()) return;
+        *ptr = copy.get();
+      } catch (...) {}
+    }
+
+    void set(const Type& type) throw() {
+      if (ptr.get() == 0) return;
+      try {
+        *ptr = type;
+      } catch (...) {}
+    }
+
+    const Type& get() const {
+      return *ptr;
+    }
+
+    bool valid() const throw() {
+      return ptr.get() != 0;
+    }
+
+  private:
+    std::auto_ptr<_Type> ptr;
+  };
+
+  /// Exception-safe convenient error message builder class.
+
+  /// Helper class which provides a convenient ostream-like (operator <<
+  /// based) interface to create a string message. Mostly useful in
+  /// exception classes (therefore the name).
+  class ErrorMessage {
+  protected:
+    ///\e
+
+    ///\todo The good solution is boost::shared_ptr...
+    ///
+    mutable std::auto_ptr<std::ostringstream> buf;
+
+    ///\e
+    bool init() throw() {
+      try {
+        buf.reset(new std::ostringstream);
+      }
+      catch(...) {
+        buf.reset();
+      }
+      return buf.get();
+    }
+
+  public:
+
+    ///\e
+    ErrorMessage() throw() { init(); }
+
+    ErrorMessage(const ErrorMessage& em) throw() : buf(em.buf) { }
+
+    ///\e
+    ErrorMessage(const char *msg) throw() {
+      init();
+      *this << msg;
+    }
+
+    ///\e
+    ErrorMessage(const std::string &msg) throw() {
+      init();
+      *this << msg;
+    }
+
+    ///\e
+    template <typename T>
+    ErrorMessage& operator<<(const T &t) throw() {
+      if( ! buf.get() ) return *this;
+
+      try {
+        *buf << t;
+      }
+      catch(...) {
+        buf.reset();
+      }
+      return *this;
+    }
+
+    ///\e
+    const char* message() throw() {
+      if( ! buf.get() ) return 0;
+
+      const char* mes = 0;
+      try {
+        mes = buf->str().c_str();
+      }
+      catch(...) {}
+      return mes;
+    }
+
+  };
+
+  /// Generic exception class.
+
   /// Base class for exceptions used in LEMON.
   ///
   class Exception : public std::exception {
   public:
-    ///Constructor
-    Exception() throw() {}
-    ///Virtual destructor
+    ///\e
+    Exception() {}
+    ///\e
     virtual ~Exception() throw() {}
-    ///A short description of the exception
+    ///\e
     virtual const char* what() const throw() {
       return "lemon::Exception";
@@ -52,220 +181,235 @@
   };
 
-  /// \brief Input-Output error
+  /// One of the two main subclasses of \ref Exception.
+
+  /// Logic errors represent problems in the internal logic of a program;
+  /// in theory, these are preventable, and even detectable before the
+  /// program runs (e.g. violations of class invariants).
   ///
-  /// This exception is thrown when a file operation cannot be
-  /// succeeded.
-  class IoError : public Exception {
+  /// A typical example for this is \ref UninitializedParameter.
+  class LogicError : public Exception {
+  public:
+    virtual const char* what() const throw() {
+      return "lemon::LogicError";
+    }
+  };
+
+  /// \ref Exception for uninitialized parameters.
+
+  /// This error represents problems in the initialization
+  /// of the parameters of the algorithms.
+  class UninitializedParameter : public LogicError {
+  public:
+    virtual const char* what() const throw() {
+      return "lemon::UninitializedParameter";
+    }
+  };
+
+
+  /// One of the two main subclasses of \ref Exception.
+
+  /// Runtime errors represent problems outside the scope of a program;
+  /// they cannot be easily predicted and can generally only be caught
+  /// as the program executes.
+  class RuntimeError : public Exception {
+  public:
+    virtual const char* what() const throw() {
+      return "lemon::RuntimeError";
+    }
+  };
+
+  ///\e
+  class RangeError : public RuntimeError {
+  public:
+    virtual const char* what() const throw() {
+      return "lemon::RangeError";
+    }
+  };
+
+  ///\e
+  class IoError : public RuntimeError {
+  public:
+    virtual const char* what() const throw() {
+      return "lemon::IoError";
+    }
+  };
+
+  ///\e
+  class DataFormatError : public IoError {
   protected:
-    std::string _message;
-    std::string _file;
-
-    mutable std::string _what;
-  public:
-
-    /// Copy constructor
-    IoError(const IoError &error) throw() : Exception() {
-      message(error._message);
-      file(error._file);
-    }
-
-    /// Constructor
-    explicit IoError(const char *message) throw() {
-      IoError::message(message);
-    }
-
-    /// Constructor
-    explicit IoError(const std::string &message) throw() {
-      IoError::message(message);
-    }
-
-    /// Constructor
-    explicit IoError(const char *message,
-                     const std::string &file) throw() {
-      IoError::message(message);
-      IoError::file(file);
-    }
-
-    /// Constructor
-    explicit IoError(const std::string &message,
-                     const std::string &file) throw() {
-      IoError::message(message);
-      IoError::file(file);
-    }
-
-    /// Virtual destructor
-    virtual ~IoError() throw() {}
-
-    /// Set the error message
-    void message(const char *message) throw() {
-      try {
-        _message = message;
-      } catch (...) {}
-    }
-
-    /// Set the error message
-    void message(const std::string& message) throw() {
-      try {
-        _message = message;
-      } catch (...) {}
-    }
-
-    /// Set the file name
-    void file(const std::string &file) throw() {
-      try {
-        _file = file;
-      } catch (...) {}
-    }
-
-    /// Returns the error message
-    const std::string& message() const throw() {
-      return _message;
-    }
-
-    /// \brief Returns the filename
+    ExceptionMember<std::string> _message;
+    ExceptionMember<std::string> _file;
+    int _line;
+
+    mutable ExceptionMember<std::string> _message_holder;
+  public:
+
+    DataFormatError(const DataFormatError &dfe) :
+      IoError(dfe), _message(dfe._message), _file(dfe._file),
+      _line(dfe._line) {}
+
+    ///\e
+    explicit DataFormatError(const char *the_message)
+      : _message(the_message), _line(0) {}
+
+    ///\e
+    DataFormatError(const std::string &file_name, int line_num,
+                    const char *the_message)
+      : _message(the_message), _line(line_num) { file(file_name); }
+
+    ///\e
+    void line(int ln) { _line = ln; }
+    ///\e
+    void message(const std::string& msg) { _message.set(msg); }
+    ///\e
+    void file(const std::string &fl) { _file.set(fl); }
+
+    ///\e
+    int line() const { return _line; }
+    ///\e
+    const char* message() const {
+      if (_message.valid() && !_message.get().empty()) {
+        return _message.get().c_str();
+      } else {
+        return 0;
+      }
+    }
+
+    /// \brief Returns the filename.
     ///
-    /// Returns the filename or an empty string if it was not specified.
-    const std::string& file() const throw() {
-      return _file;
-    }
-
-    /// \brief Returns a short error message
+    /// Returns \e null if the filename was not specified.
+    const char* file() const {
+      if (_file.valid() && !_file.get().empty()) {
+        return _file.get().c_str();
+      } else {
+        return 0;
+      }
+    }
+
+    ///\e
+    virtual const char* what() const throw() {
+      try {
+        std::ostringstream ostr;
+        ostr << "lemon:DataFormatError" << ": ";
+        if (message()) ostr << message();
+        if( file() || line() != 0 ) {
+          ostr << " (";
+          if( file() ) ostr << "in file '" << file() << "'";
+          if( file() && line() != 0 ) ostr << " ";
+          if( line() != 0 ) ostr << "at line " << line();
+          ostr << ")";
+        }
+        _message_holder.set(ostr.str());
+      }
+      catch (...) {}
+      if( _message_holder.valid()) return _message_holder.get().c_str();
+      return "lemon:DataFormatError";
+    }
+
+    virtual ~DataFormatError() throw() {}
+  };
+
+  ///\e
+  class FileOpenError : public IoError {
+  protected:
+    ExceptionMember<std::string> _file;
+
+    mutable ExceptionMember<std::string> _message_holder;
+  public:
+
+    FileOpenError(const FileOpenError &foe) :
+      IoError(foe), _file(foe._file) {}
+
+    ///\e
+    explicit FileOpenError(const std::string& fl)
+      : _file(fl) {}
+
+
+    ///\e
+    void file(const std::string &fl) { _file.set(fl); }
+
+    /// \brief Returns the filename.
     ///
-    /// Returns a short error message which contains the message and the
-    /// file name.
-    virtual const char* what() const throw() {
-      try {
-        _what.clear();
-        std::ostringstream oss;
-        oss << "lemon:IoError" << ": ";
-        oss << _message;
-        if (!_file.empty()) {
-          oss << " ('" << _file << "')";
-        }
-        _what = oss.str();
+    /// Returns \e null if the filename was not specified.
+    const char* file() const {
+      if (_file.valid() && !_file.get().empty()) {
+        return _file.get().c_str();
+      } else {
+        return 0;
+      }
+    }
+
+    ///\e
+    virtual const char* what() const throw() {
+      try {
+        std::ostringstream ostr;
+        ostr << "lemon::FileOpenError" << ": ";
+        ostr << "Cannot open file - " << file();
+        _message_holder.set(ostr.str());
       }
       catch (...) {}
-      if (!_what.empty()) return _what.c_str();
-      else return "lemon:IoError";
-    }
-
-  };
-
-  /// \brief Format error
-  ///
-  /// This exception is thrown when an input file has wrong
-  /// format or a data representation is not legal.
-  class FormatError : public Exception {
+      if( _message_holder.valid()) return _message_holder.get().c_str();
+      return "lemon::FileOpenError";
+    }
+    virtual ~FileOpenError() throw() {}
+  };
+
+  class IoParameterError : public IoError {
   protected:
-    std::string _message;
-    std::string _file;
-    int _line;
-
-    mutable std::string _what;
-  public:
-
-    /// Copy constructor
-    FormatError(const FormatError &error) throw() : Exception() {
-      message(error._message);
-      file(error._file);
-      line(error._line);
-    }
-
-    /// Constructor
-    explicit FormatError(const char *message) throw() {
-      FormatError::message(message);
-      _line = 0;
-    }
-
-    /// Constructor
-    explicit FormatError(const std::string &message) throw() {
-      FormatError::message(message);
-      _line = 0;
-    }
-
-    /// Constructor
-    explicit FormatError(const char *message,
-                         const std::string &file, int line = 0) throw() {
-      FormatError::message(message);
-      FormatError::file(file);
-      FormatError::line(line);
-    }
-
-    /// Constructor
-    explicit FormatError(const std::string &message,
-                         const std::string &file, int line = 0) throw() {
-      FormatError::message(message);
-      FormatError::file(file);
-      FormatError::line(line);
-    }
-
-    /// Virtual destructor
-    virtual ~FormatError() throw() {}
-
-    /// Set the line number
-    void line(int line) throw() { _line = line; }
-
-    /// Set the error message
-    void message(const char *message) throw() {
-      try {
-        _message = message;
-      } catch (...) {}
-    }
-
-    /// Set the error message
-    void message(const std::string& message) throw() {
-      try {
-        _message = message;
-      } catch (...) {}
-    }
-
-    /// Set the file name
-    void file(const std::string &file) throw() {
-      try {
-        _file = file;
-      } catch (...) {}
-    }
-
-    /// \brief Returns the line number
+    ExceptionMember<std::string> _message;
+    ExceptionMember<std::string> _file;
+
+    mutable ExceptionMember<std::string> _message_holder;
+  public:
+
+    IoParameterError(const IoParameterError &ile) :
+      IoError(ile), _message(ile._message), _file(ile._file) {}
+
+    ///\e
+    explicit IoParameterError(const char *the_message)
+      : _message(the_message) {}
+
+    ///\e
+    IoParameterError(const char *file_name, const char *the_message)
+      : _message(the_message), _file(file_name) {}
+
+     ///\e
+    void message(const std::string& msg) { _message.set(msg); }
+    ///\e
+    void file(const std::string &fl) { _file.set(fl); }
+
+     ///\e
+    const char* message() const {
+      if (_message.valid()) {
+        return _message.get().c_str();
+      } else {
+        return 0;
+      }
+    }
+
+    /// \brief Returns the filename.
     ///
-    /// Returns the line number or zero if it was not specified.
-    int line() const throw() { return _line; }
-
-    /// Returns the error message
-    const std::string& message() const throw() {
-      return _message;
-    }
-
-    /// \brief Returns the filename
-    ///
-    /// Returns the filename or an empty string if it was not specified.
-    const std::string& file() const throw() {
-      return _file;
-    }
-
-    /// \brief Returns a short error message
-    ///
-    /// Returns a short error message which contains the message, the
-    /// file name and the line number.
-    virtual const char* what() const throw() {
-      try {
-        _what.clear();
-        std::ostringstream oss;
-        oss << "lemon:FormatError" << ": ";
-        oss << _message;
-        if (!_file.empty() || _line != 0) {
-          oss << " (";
-          if (!_file.empty()) oss << "in file '" << _file << "'";
-          if (!_file.empty() && _line != 0) oss << " ";
-          if (_line != 0) oss << "at line " << _line;
-          oss << ")";
-        }
-        _what = oss.str();
+    /// Returns \c 0 if the filename was not specified.
+    const char* file() const {
+      if (_file.valid()) {
+        return _file.get().c_str();
+      } else {
+        return 0;
+      }
+    }
+
+    ///\e
+    virtual const char* what() const throw() {
+      try {
+        std::ostringstream ostr;
+        if (message()) ostr << message();
+        if (file()) ostr << "(when reading file '" << file() << "')";
+        _message_holder.set(ostr.str());
       }
       catch (...) {}
-      if (!_what.empty()) return _what.c_str();
-      else return "lemon:FormatError";
-    }
-
+      if( _message_holder.valid() ) return _message_holder.get().c_str();
+      return "lemon:IoParameterError";
+    }
+    virtual ~IoParameterError() throw() {}
   };
 
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 317)
+++ lemon/graph_to_eps.h	(revision 220)
@@ -41,5 +41,4 @@
 #include<lemon/color.h>
 #include<lemon/bits/bezier.h>
-#include<lemon/error.h>
 
 
@@ -63,5 +62,5 @@
   }
 
-///Default traits class of GraphToEps
+///Default traits class of \ref GraphToEps
 
 ///Default traits class of \ref GraphToEps.
@@ -668,4 +667,5 @@
   ///it draws the graph.
   void run() {
+    //\todo better 'epsilon' would be nice here.
     const double EPSILON=1e-9;
     if(dontPrint) return;
@@ -708,4 +708,5 @@
       for(ArcIt e(g);e!=INVALID;++e)
         max_w=std::max(double(_arcWidths[e]),max_w);
+      //\todo better 'epsilon' would be nice here.
       if(max_w>EPSILON) {
         _arcWidthScale/=max_w;
@@ -717,4 +718,5 @@
       for(NodeIt n(g);n!=INVALID;++n)
         max_s=std::max(double(_nodeSizes[n]),max_s);
+      //\todo better 'epsilon' would be nice here.
       if(max_s>EPSILON) {
         _nodeScale/=max_s;
@@ -724,8 +726,8 @@
     double diag_len = 1;
     if(!(_absoluteNodeSizes&&_absoluteArcWidths)) {
-      dim2::Box<double> bb;
+      dim2::BoundingBox<double> bb;
       for(NodeIt n(g);n!=INVALID;++n) bb.add(mycoords[n]);
       if (bb.empty()) {
-        bb = dim2::Box<double>(dim2::Point<double>(0,0));
+        bb = dim2::BoundingBox<double>(dim2::Point<double>(0,0));
       }
       diag_len = std::sqrt((bb.bottomLeft()-bb.topRight()).normSquare());
@@ -735,5 +737,5 @@
     }
 
-    dim2::Box<double> bb;
+    dim2::BoundingBox<double> bb;
     for(NodeIt n(g);n!=INVALID;++n) {
       double ns=_nodeSizes[n]*_nodeScale;
@@ -757,5 +759,5 @@
     }
     if (bb.empty()) {
-      bb = dim2::Box<double>(dim2::Point<double>(0,0));
+      bb = dim2::BoundingBox<double>(dim2::Point<double>(0,0));
     }
 
@@ -872,4 +874,5 @@
       }
       else {
+        //\todo Verify centering
         double sc= std::min((A4HEIGHT-2*A4BORDER)/bb.width(),
                   (A4WIDTH-2*A4BORDER)/bb.height());
@@ -904,4 +907,5 @@
             dvec(mycoords[g.target(*i)]-mycoords[g.source(*i)]);
           double l=std::sqrt(dvec.normSquare());
+          //\todo better 'epsilon' would be nice here.
           dim2::Point<double> d(dvec/std::max(l,EPSILON));
           dim2::Point<double> m;
@@ -1168,11 +1172,6 @@
 graphToEps(G &g,const char *file_name)
 {
-  std::ostream* os = new std::ofstream(file_name);
-  if (!(*os)) {
-    delete os;
-    throw IoError("Cannot write file", file_name);
-  }
   return GraphToEps<DefaultGraphToEpsTraits<G> >
-    (DefaultGraphToEpsTraits<G>(g,*os,true));
+    (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name),true));
 }
 
@@ -1189,11 +1188,6 @@
 graphToEps(G &g,const std::string& file_name)
 {
-  std::ostream* os = new std::ofstream(file_name.c_str());
-  if (!(*os)) {
-    delete os;
-    throw IoError("Cannot write file", file_name);
-  }
   return GraphToEps<DefaultGraphToEpsTraits<G> >
-    (DefaultGraphToEpsTraits<G>(g,*os,true));
+    (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name.c_str()),true));
 }
 
Index: lemon/lemon.pc.in
===================================================================
--- lemon/lemon.pc.in	(revision 259)
+++ lemon/lemon.pc.in	(revision 1)
@@ -7,4 +7,4 @@
 Description: Library of Efficient Models and Optimization in Networks
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lemon
-Cflags: -I${includedir}
+Libs: -L${libdir} -lemon @GLPK_LIBS@ @CPLEX_LIBS@
+Cflags: -I${includedir} @GLPK_CFLAGS@ @CPLEX_CFLAGS@
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 327)
+++ lemon/lgf_reader.h	(revision 220)
@@ -19,5 +19,5 @@
 ///\ingroup lemon_io
 ///\file
-///\brief \ref lgf-format "LEMON Graph Format" reader.
+///\brief \ref lgf-format "Lemon Graph Format" reader.
 
 
@@ -32,4 +32,5 @@
 #include <map>
 
+#include <lemon/assert.h>
 #include <lemon/core.h>
 
@@ -48,11 +49,9 @@
         std::istringstream is(str);
         Value value;
-        if (!(is >> value)) {
-          throw FormatError("Cannot read token");
-        }
+        is >> value;
 
         char c;
         if (is >> std::ws >> c) {
-          throw FormatError("Remaining characters in token");
+          throw DataFormatError("Remaining characters in token");
         }
         return value;
@@ -168,5 +167,5 @@
           std::ostringstream msg;
           msg << "Item not found: " << str;
-          throw FormatError(msg.str());
+          throw DataFormatError(msg.str().c_str());
         }
         return it->second;
@@ -186,10 +185,10 @@
       typename Graph::Arc operator()(const std::string& str) {
         if (str.empty() || (str[0] != '+' && str[0] != '-')) {
-          throw FormatError("Item must start with '+' or '-'");
+          throw DataFormatError("Item must start with '+' or '-'");
         }
         typename std::map<std::string, typename Graph::Edge>
           ::const_iterator it = _map.find(str.substr(1));
         if (it == _map.end()) {
-          throw FormatError("Item not found");
+          throw DataFormatError("Item not found");
         }
         return _graph.direct(it->second, str[0] == '+');
@@ -237,5 +236,5 @@
       char c;
       if (!is.get(c))
-        throw FormatError("Escape format error");
+        throw DataFormatError("Escape format error");
 
       switch (c) {
@@ -266,5 +265,5 @@
           int code;
           if (!is.get(c) || !isHex(c))
-            throw FormatError("Escape format error");
+            throw DataFormatError("Escape format error");
           else if (code = valueHex(c), !is.get(c) || !isHex(c)) is.putback(c);
           else code = code * 16 + valueHex(c);
@@ -275,5 +274,5 @@
           int code;
           if (!isOct(c))
-            throw FormatError("Escape format error");
+            throw DataFormatError("Escape format error");
           else if (code = valueOct(c), !is.get(c) || !isOct(c))
             is.putback(c);
@@ -302,5 +301,5 @@
         }
         if (!is)
-          throw FormatError("Quoted format error");
+          throw DataFormatError("Quoted format error");
       } else {
         is.putback(c);
@@ -391,35 +390,12 @@
   class DigraphReader;
 
-  /// \brief Return a \ref DigraphReader class
-  ///
-  /// This function just returns a \ref DigraphReader class.
-  /// \relates DigraphReader
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph,
-                                       std::istream& is = std::cin) {
-    DigraphReader<Digraph> tmp(digraph, is);
-    return tmp;
-  }
-
-  /// \brief Return a \ref DigraphReader class
-  ///
-  /// This function just returns a \ref DigraphReader class.
-  /// \relates DigraphReader
+  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph);
+
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph,
-                                       const std::string& fn) {
-    DigraphReader<Digraph> tmp(digraph, fn);
-    return tmp;
-  }
-
-  /// \brief Return a \ref DigraphReader class
-  ///
-  /// This function just returns a \ref DigraphReader class.
-  /// \relates DigraphReader
+  DigraphReader<Digraph> digraphReader(const std::string& fn, Digraph& digraph);
+
   template <typename Digraph>
-  DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
-    DigraphReader<Digraph> tmp(digraph, fn);
-    return tmp;
-  }
+  DigraphReader<Digraph> digraphReader(const char *fn, Digraph& digraph);
 
   /// \ingroup lemon_io
@@ -444,5 +420,5 @@
   ///
   ///\code
-  /// DigraphReader<Digraph>(digraph, std::cin).
+  /// DigraphReader<Digraph>(std::cin, digraph).
   ///   nodeMap("coordinates", coord_map).
   ///   arcMap("capacity", cap_map).
@@ -485,5 +461,4 @@
     std::istream* _is;
     bool local_is;
-    std::string _filename;
 
     Digraph& _digraph;
@@ -525,5 +500,5 @@
     /// Construct a directed graph reader, which reads from the given
     /// input stream.
-    DigraphReader(Digraph& digraph, std::istream& is = std::cin)
+    DigraphReader(std::istream& is, Digraph& digraph)
       : _is(&is), local_is(false), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
@@ -534,14 +509,8 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(Digraph& digraph, const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true),
-        _filename(fn), _digraph(digraph),
+    DigraphReader(const std::string& fn, Digraph& digraph)
+      : _is(new std::ifstream(fn.c_str())), local_is(true), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
-        _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_arcs(false) {}
 
     /// \brief Constructor
@@ -549,14 +518,8 @@
     /// Construct a directed graph reader, which reads from the given
     /// file.
-    DigraphReader(Digraph& digraph, const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true),
-        _filename(fn), _digraph(digraph),
+    DigraphReader(const char* fn, Digraph& digraph)
+      : _is(new std::ifstream(fn)), local_is(true), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
-        _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_arcs(false) {}
 
     /// \brief Destructor
@@ -585,10 +548,10 @@
   private:
 
-    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
-                                                  std::istream& is);
-    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
-                                                  const std::string& fn);
-    friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph,
-                                                  const char *fn);
+    friend DigraphReader<Digraph> digraphReader<>(std::istream& is,
+                                                  Digraph& digraph);
+    friend DigraphReader<Digraph> digraphReader<>(const std::string& fn,
+                                                  Digraph& digraph);
+    friend DigraphReader<Digraph> digraphReader<>(const char *fn,
+                                                  Digraph& digraph);
 
     DigraphReader(DigraphReader& other)
@@ -883,5 +846,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_node_maps.empty())
-          throw FormatError("Cannot find map names");
+          throw DataFormatError("Cannot find map names");
         return;
       }
@@ -897,5 +860,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of node map: " << map;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           maps.insert(std::make_pair(map, index));
@@ -908,6 +871,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found: " << _node_maps[i].first;
-            throw FormatError(msg.str());
+            msg << "Map not found in file: " << _node_maps[i].first;
+            throw DataFormatError(msg.str().c_str());
           }
           map_index[i] = jt->second;
@@ -933,9 +896,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         Node n;
@@ -946,5 +909,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found");
+            throw DataFormatError("Label map not found in file");
           typename std::map<std::string, Node>::iterator it =
             _node_index.find(tokens[label_index]);
@@ -952,5 +915,5 @@
             std::ostringstream msg;
             msg << "Node with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           n = it->second;
@@ -976,5 +939,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_arc_maps.empty())
-          throw FormatError("Cannot find map names");
+          throw DataFormatError("Cannot find map names");
         return;
       }
@@ -990,5 +953,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of arc map: " << map;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           maps.insert(std::make_pair(map, index));
@@ -1001,6 +964,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found: " << _arc_maps[i].first;
-            throw FormatError(msg.str());
+            msg << "Map not found in file: " << _arc_maps[i].first;
+            throw DataFormatError(msg.str().c_str());
           }
           map_index[i] = jt->second;
@@ -1025,8 +988,8 @@
 
         if (!_reader_bits::readToken(line, source_token))
-          throw FormatError("Source not found");
+          throw DataFormatError("Source not found");
 
         if (!_reader_bits::readToken(line, target_token))
-          throw FormatError("Target not found");
+          throw DataFormatError("Target not found");
 
         std::vector<std::string> tokens(map_num);
@@ -1035,9 +998,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         Arc a;
@@ -1050,5 +1013,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << source_token;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           Node source = it->second;
@@ -1058,5 +1021,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << target_token;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           Node target = it->second;
@@ -1067,5 +1030,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found");
+            throw DataFormatError("Label map not found in file");
           typename std::map<std::string, Arc>::iterator it =
             _arc_index.find(tokens[label_index]);
@@ -1073,5 +1036,5 @@
             std::ostringstream msg;
             msg << "Arc with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           a = it->second;
@@ -1098,9 +1061,9 @@
         std::string attr, token;
         if (!_reader_bits::readToken(line, attr))
-          throw FormatError("Attribute name not found");
+          throw DataFormatError("Attribute name not found");
         if (!_reader_bits::readToken(line, token))
-          throw FormatError("Attribute value not found");
+          throw DataFormatError("Attribute value not found");
         if (line >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         {
@@ -1108,6 +1071,6 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute: " << attr;
-            throw FormatError(msg.str());
+            msg << "Multiple occurence of attribute " << attr;
+            throw DataFormatError(msg.str().c_str());
           }
           read_attr.insert(attr);
@@ -1130,6 +1093,6 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found: " << it->first;
-          throw FormatError(msg.str());
+          msg << "Attribute not found in file: " << it->first;
+          throw DataFormatError(msg.str().c_str());
         }
       }
@@ -1146,4 +1109,7 @@
     void run() {
       LEMON_ASSERT(_is != 0, "This reader assigned to an other reader");
+      if (!*_is) {
+        throw DataFormatError("Cannot find file");
+      }
 
       bool nodes_done = _skip_nodes;
@@ -1164,5 +1130,5 @@
 
           if (line >> c)
-            throw FormatError("Extra character at the end of line");
+            throw DataFormatError("Extra character on the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -1186,7 +1152,6 @@
             skipSection();
           }
-        } catch (FormatError& error) {
+        } catch (DataFormatError& error) {
           error.line(line_num);
-          error.file(_filename);
           throw;
         }
@@ -1194,13 +1159,13 @@
 
       if (!nodes_done) {
-        throw FormatError("Section @nodes not found");
+        throw DataFormatError("Section @nodes not found");
       }
 
       if (!arcs_done) {
-        throw FormatError("Section @arcs not found");
+        throw DataFormatError("Section @arcs not found");
       }
 
       if (!attributes_done && !_attributes.empty()) {
-        throw FormatError("Section @attributes not found");
+        throw DataFormatError("Section @attributes not found");
       }
 
@@ -1210,37 +1175,47 @@
 
   };
+
+  /// \brief Return a \ref DigraphReader class
+  ///
+  /// This function just returns a \ref DigraphReader class.
+  /// \relates DigraphReader
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph) {
+    DigraphReader<Digraph> tmp(is, digraph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref DigraphReader class
+  ///
+  /// This function just returns a \ref DigraphReader class.
+  /// \relates DigraphReader
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(const std::string& fn,
+                                       Digraph& digraph) {
+    DigraphReader<Digraph> tmp(fn, digraph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref DigraphReader class
+  ///
+  /// This function just returns a \ref DigraphReader class.
+  /// \relates DigraphReader
+  template <typename Digraph>
+  DigraphReader<Digraph> digraphReader(const char* fn, Digraph& digraph) {
+    DigraphReader<Digraph> tmp(fn, digraph);
+    return tmp;
+  }
 
   template <typename Graph>
   class GraphReader;
 
-  /// \brief Return a \ref GraphReader class
-  ///
-  /// This function just returns a \ref GraphReader class.
-  /// \relates GraphReader
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) {
-    GraphReader<Graph> tmp(graph, is);
-    return tmp;
-  }
-
-  /// \brief Return a \ref GraphReader class
-  ///
-  /// This function just returns a \ref GraphReader class.
-  /// \relates GraphReader
+  GraphReader<Graph> graphReader(std::istream& is, Graph& graph);
+
   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
+  GraphReader<Graph> graphReader(const std::string& fn, Graph& graph);
+
   template <typename Graph>
-  GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
-    GraphReader<Graph> tmp(graph, fn);
-    return tmp;
-  }
+  GraphReader<Graph> graphReader(const char *fn, Graph& graph);
 
   /// \ingroup lemon_io
@@ -1270,5 +1245,4 @@
     std::istream* _is;
     bool local_is;
-    std::string _filename;
 
     Graph& _graph;
@@ -1310,5 +1284,5 @@
     /// Construct an undirected graph reader, which reads from the given
     /// input stream.
-    GraphReader(Graph& graph, std::istream& is = std::cin)
+    GraphReader(std::istream& is, Graph& graph)
       : _is(&is), local_is(false), _graph(graph),
         _use_nodes(false), _use_edges(false),
@@ -1319,14 +1293,8 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(Graph& graph, const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true),
-        _filename(fn), _graph(graph),
+    GraphReader(const std::string& fn, Graph& graph)
+      : _is(new std::ifstream(fn.c_str())), local_is(true), _graph(graph),
         _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_edges(false) {}
 
     /// \brief Constructor
@@ -1334,14 +1302,8 @@
     /// Construct an undirected graph reader, which reads from the given
     /// file.
-    GraphReader(Graph& graph, const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true),
-        _filename(fn), _graph(graph),
+    GraphReader(const char* fn, Graph& graph)
+      : _is(new std::ifstream(fn)), local_is(true), _graph(graph),
         _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_edges(false) {}
 
     /// \brief Destructor
@@ -1369,8 +1331,8 @@
 
   private:
-    friend GraphReader<Graph> graphReader<>(Graph& graph, std::istream& is);
-    friend GraphReader<Graph> graphReader<>(Graph& graph,
-                                            const std::string& fn);
-    friend GraphReader<Graph> graphReader<>(Graph& graph, const char *fn);
+    friend GraphReader<Graph> graphReader<>(std::istream& is, Graph& graph);
+    friend GraphReader<Graph> graphReader<>(const std::string& fn,
+                                            Graph& graph);
+    friend GraphReader<Graph> graphReader<>(const char *fn, Graph& graph);
 
     GraphReader(GraphReader& other)
@@ -1712,5 +1674,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_node_maps.empty())
-          throw FormatError("Cannot find map names");
+          throw DataFormatError("Cannot find map names");
         return;
       }
@@ -1726,5 +1688,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of node map: " << map;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           maps.insert(std::make_pair(map, index));
@@ -1737,6 +1699,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found: " << _node_maps[i].first;
-            throw FormatError(msg.str());
+            msg << "Map not found in file: " << _node_maps[i].first;
+            throw DataFormatError(msg.str().c_str());
           }
           map_index[i] = jt->second;
@@ -1762,9 +1724,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         Node n;
@@ -1775,5 +1737,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found");
+            throw DataFormatError("Label map not found in file");
           typename std::map<std::string, Node>::iterator it =
             _node_index.find(tokens[label_index]);
@@ -1781,5 +1743,5 @@
             std::ostringstream msg;
             msg << "Node with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           n = it->second;
@@ -1805,5 +1767,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_edge_maps.empty())
-          throw FormatError("Cannot find map names");
+          throw DataFormatError("Cannot find map names");
         return;
       }
@@ -1819,5 +1781,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of edge map: " << map;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           maps.insert(std::make_pair(map, index));
@@ -1830,6 +1792,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found: " << _edge_maps[i].first;
-            throw FormatError(msg.str());
+            msg << "Map not found in file: " << _edge_maps[i].first;
+            throw DataFormatError(msg.str().c_str());
           }
           map_index[i] = jt->second;
@@ -1854,8 +1816,8 @@
 
         if (!_reader_bits::readToken(line, source_token))
-          throw FormatError("Node u not found");
+          throw DataFormatError("Node u not found");
 
         if (!_reader_bits::readToken(line, target_token))
-          throw FormatError("Node v not found");
+          throw DataFormatError("Node v not found");
 
         std::vector<std::string> tokens(map_num);
@@ -1864,9 +1826,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         Edge e;
@@ -1879,5 +1841,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << source_token;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           Node source = it->second;
@@ -1887,5 +1849,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << target_token;
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           Node target = it->second;
@@ -1896,5 +1858,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found");
+            throw DataFormatError("Label map not found in file");
           typename std::map<std::string, Edge>::iterator it =
             _edge_index.find(tokens[label_index]);
@@ -1902,5 +1864,5 @@
             std::ostringstream msg;
             msg << "Edge with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
+            throw DataFormatError(msg.str().c_str());
           }
           e = it->second;
@@ -1927,9 +1889,9 @@
         std::string attr, token;
         if (!_reader_bits::readToken(line, attr))
-          throw FormatError("Attribute name not found");
+          throw DataFormatError("Attribute name not found");
         if (!_reader_bits::readToken(line, token))
-          throw FormatError("Attribute value not found");
+          throw DataFormatError("Attribute value not found");
         if (line >> c)
-          throw FormatError("Extra character at the end of line");
+          throw DataFormatError("Extra character on the end of line");
 
         {
@@ -1937,6 +1899,6 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute: " << attr;
-            throw FormatError(msg.str());
+            msg << "Multiple occurence of attribute " << attr;
+            throw DataFormatError(msg.str().c_str());
           }
           read_attr.insert(attr);
@@ -1959,6 +1921,6 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found: " << it->first;
-          throw FormatError(msg.str());
+          msg << "Attribute not found in file: " << it->first;
+          throw DataFormatError(msg.str().c_str());
         }
       }
@@ -1994,5 +1956,5 @@
 
           if (line >> c)
-            throw FormatError("Extra character at the end of line");
+            throw DataFormatError("Extra character on the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -2016,7 +1978,6 @@
             skipSection();
           }
-        } catch (FormatError& error) {
+        } catch (DataFormatError& error) {
           error.line(line_num);
-          error.file(_filename);
           throw;
         }
@@ -2024,13 +1985,13 @@
 
       if (!nodes_done) {
-        throw FormatError("Section @nodes not found");
+        throw DataFormatError("Section @nodes not found");
       }
 
       if (!edges_done) {
-        throw FormatError("Section @edges not found");
+        throw DataFormatError("Section @edges not found");
       }
 
       if (!attributes_done && !_attributes.empty()) {
-        throw FormatError("Section @attributes not found");
+        throw DataFormatError("Section @attributes not found");
       }
 
@@ -2040,4 +2001,35 @@
 
   };
+
+  /// \brief Return a \ref GraphReader class
+  ///
+  /// This function just returns a \ref GraphReader class.
+  /// \relates GraphReader
+  template <typename Graph>
+  GraphReader<Graph> graphReader(std::istream& is, Graph& graph) {
+    GraphReader<Graph> tmp(is, graph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref GraphReader class
+  ///
+  /// This function just returns a \ref GraphReader class.
+  /// \relates GraphReader
+  template <typename Graph>
+  GraphReader<Graph> graphReader(const std::string& fn,
+                                       Graph& graph) {
+    GraphReader<Graph> tmp(fn, graph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref GraphReader class
+  ///
+  /// This function just returns a \ref GraphReader class.
+  /// \relates GraphReader
+  template <typename Graph>
+  GraphReader<Graph> graphReader(const char* fn, Graph& graph) {
+    GraphReader<Graph> tmp(fn, graph);
+    return tmp;
+  }
 
   class SectionReader;
@@ -2063,5 +2055,4 @@
     std::istream* _is;
     bool local_is;
-    std::string _filename;
 
     typedef std::map<std::string, _reader_bits::Section*> Sections;
@@ -2084,11 +2075,5 @@
     /// Construct a section reader, which reads from the given file.
     SectionReader(const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true),
-        _filename(fn) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+      : _is(new std::ifstream(fn.c_str())), local_is(true) {}
 
     /// \brief Constructor
@@ -2096,11 +2081,5 @@
     /// Construct a section reader, which reads from the given file.
     SectionReader(const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true),
-        _filename(fn) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+      : _is(new std::ifstream(fn)), local_is(true) {}
 
     /// \brief Destructor
@@ -2258,10 +2237,10 @@
 
           if (line >> c)
-            throw FormatError("Extra character at the end of line");
+            throw DataFormatError("Extra character on the end of line");
 
           if (extra_sections.find(section) != extra_sections.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of section: " << section;
-            throw FormatError(msg.str());
+            msg << "Multiple occurence of section " << section;
+            throw DataFormatError(msg.str().c_str());
           }
           Sections::iterator it = _sections.find(section);
@@ -2272,7 +2251,6 @@
           readLine();
           skipSection();
-        } catch (FormatError& error) {
+        } catch (DataFormatError& error) {
           error.line(line_num);
-          error.file(_filename);
           throw;
         }
@@ -2283,5 +2261,5 @@
           std::ostringstream os;
           os << "Cannot find section: " << it->first;
-          throw FormatError(os.str());
+          throw DataFormatError(os.str().c_str());
         }
       }
@@ -2324,5 +2302,5 @@
   ///
   /// This class can be used to read the sections, the map names and
-  /// the attributes from a file. Usually, the LEMON programs know
+  /// the attributes from a file. Usually, the Lemon programs know
   /// that, which type of graph, which maps and which attributes
   /// should be read from a file, but in general tools (like glemon)
@@ -2383,10 +2361,5 @@
     /// file.
     LgfContents(const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+      : _is(new std::ifstream(fn.c_str())), local_is(true) {}
 
     /// \brief Constructor
@@ -2395,10 +2368,5 @@
     /// file.
     LgfContents(const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
+      : _is(new std::ifstream(fn)), local_is(true) {}
 
     /// \brief Destructor
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 327)
+++ lemon/lgf_writer.h	(revision 220)
@@ -19,5 +19,5 @@
 ///\ingroup lemon_io
 ///\file
-///\brief \ref lgf-format "LEMON Graph Format" writer.
+///\brief \ref lgf-format "Lemon Graph Format" writer.
 
 
@@ -34,9 +34,7 @@
 #include <functional>
 
+#include <lemon/assert.h>
 #include <lemon/core.h>
 #include <lemon/maps.h>
-
-#include <lemon/concept_check.h>
-#include <lemon/concepts/maps.h>
 
 namespace lemon {
@@ -55,5 +53,5 @@
     template <typename T>
     bool operator<(const T&, const T&) {
-      throw FormatError("Label map is not comparable");
+      throw DataFormatError("Label map is not comparable");
     }
 
@@ -203,5 +201,5 @@
           _map.find(str);
         if (it == _map.end()) {
-          throw FormatError("Item not found");
+          throw DataFormatError("Item not found");
         }
         return it->second;
@@ -223,5 +221,5 @@
           ::const_iterator it = _map.find(val);
         if (it == _map.end()) {
-          throw FormatError("Item not found");
+          throw DataFormatError("Item not found");
         }
         return (_graph.direction(val) ? '+' : '-') + it->second;
@@ -307,43 +305,4 @@
     }
 
-    class Section {
-    public:
-      virtual ~Section() {}
-      virtual void process(std::ostream& os) = 0;
-    };
-
-    template <typename Functor>
-    class LineSection : public Section {
-    private:
-
-      Functor _functor;
-
-    public:
-
-      LineSection(const Functor& functor) : _functor(functor) {}
-      virtual ~LineSection() {}
-
-      virtual void process(std::ostream& os) {
-        std::string line;
-        while (!(line = _functor()).empty()) os << line << std::endl;
-      }
-    };
-
-    template <typename Functor>
-    class StreamSection : public Section {
-    private:
-
-      Functor _functor;
-
-    public:
-
-      StreamSection(const Functor& functor) : _functor(functor) {}
-      virtual ~StreamSection() {}
-
-      virtual void process(std::ostream& os) {
-        _functor(os);
-      }
-    };
-
   }
 
@@ -351,36 +310,15 @@
   class DigraphWriter;
 
-  /// \brief Return a \ref DigraphWriter class
-  ///
-  /// This function just returns a \ref DigraphWriter class.
-  /// \relates DigraphWriter
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       std::ostream& os = std::cout) {
-    DigraphWriter<Digraph> tmp(digraph, os);
-    return tmp;
-  }
-
-  /// \brief Return a \ref DigraphWriter class
-  ///
-  /// This function just returns a \ref DigraphWriter class.
-  /// \relates DigraphWriter
+  DigraphWriter<Digraph> digraphWriter(std::ostream& os,
+                                       const Digraph& digraph);
+
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const std::string& fn) {
-    DigraphWriter<Digraph> tmp(digraph, fn);
-    return tmp;
-  }
-
-  /// \brief Return a \ref DigraphWriter class
-  ///
-  /// This function just returns a \ref DigraphWriter class.
-  /// \relates DigraphWriter
+  DigraphWriter<Digraph> digraphWriter(const std::string& fn,
+                                       const Digraph& digraph);
+
   template <typename Digraph>
-  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
-                                       const char* fn) {
-    DigraphWriter<Digraph> tmp(digraph, fn);
-    return tmp;
-  }
+  DigraphWriter<Digraph> digraphWriter(const char *fn,
+                                       const Digraph& digraph);
 
   /// \ingroup lemon_io
@@ -403,5 +341,5 @@
   ///
   ///\code
-  /// DigraphWriter<Digraph>(digraph, std::cout).
+  /// DigraphWriter<Digraph>(std::cout, digraph).
   ///   nodeMap("coordinates", coord_map).
   ///   nodeMap("size", size).
@@ -473,6 +411,6 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    DigraphWriter(const Digraph& digraph, std::ostream& os = std::cout)
-      : _os(&os), local_os(false), _digraph(digraph),
+    DigraphWriter(std::ostream& is, const Digraph& digraph)
+      : _os(&is), local_os(false), _digraph(digraph),
         _skip_nodes(false), _skip_arcs(false) {}
 
@@ -481,12 +419,7 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const Digraph& digraph, const std::string& fn)
+    DigraphWriter(const std::string& fn, const Digraph& digraph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph),
-        _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_arcs(false) {}
 
     /// \brief Constructor
@@ -494,12 +427,7 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    DigraphWriter(const Digraph& digraph, const char* fn)
+    DigraphWriter(const char* fn, const Digraph& digraph)
       : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph),
-        _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_arcs(false) {}
 
     /// \brief Destructor
@@ -527,10 +455,10 @@
   private:
 
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  std::ostream& os);
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  const std::string& fn);
-    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
-                                                  const char *fn);
+    friend DigraphWriter<Digraph> digraphWriter<>(std::ostream& os,
+                                                  const Digraph& digraph);
+    friend DigraphWriter<Digraph> digraphWriter<>(const std::string& fn,
+                                                  const Digraph& digraph);
+    friend DigraphWriter<Digraph> digraphWriter<>(const char *fn,
+                                                  const Digraph& digraph);
 
     DigraphWriter(DigraphWriter& other)
@@ -934,37 +862,48 @@
   };
 
+  /// \brief Return a \ref DigraphWriter class
+  ///
+  /// This function just returns a \ref DigraphWriter class.
+  /// \relates DigraphWriter
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(std::ostream& os,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(os, digraph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref DigraphWriter class
+  ///
+  /// This function just returns a \ref DigraphWriter class.
+  /// \relates DigraphWriter
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const std::string& fn,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(fn, digraph);
+    return tmp;
+  }
+
+  /// \brief Return a \ref DigraphWriter class
+  ///
+  /// This function just returns a \ref DigraphWriter class.
+  /// \relates DigraphWriter
+  template <typename Digraph>
+  DigraphWriter<Digraph> digraphWriter(const char* fn,
+                                       const Digraph& digraph) {
+    DigraphWriter<Digraph> tmp(fn, digraph);
+    return tmp;
+  }
+
   template <typename Graph>
   class GraphWriter;
 
-  /// \brief Return a \ref GraphWriter class
-  ///
-  /// This function just returns a \ref GraphWriter class.
-  /// \relates GraphWriter
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph,
-                                 std::ostream& os = std::cout) {
-    GraphWriter<Graph> tmp(graph, os);
-    return tmp;
-  }
-
-  /// \brief Return a \ref GraphWriter class
-  ///
-  /// This function just returns a \ref GraphWriter class.
-  /// \relates GraphWriter
+  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph& graph);
+
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
-    GraphWriter<Graph> tmp(graph, fn);
-    return tmp;
-  }
-
-  /// \brief Return a \ref GraphWriter class
-  ///
-  /// This function just returns a \ref GraphWriter class.
-  /// \relates GraphWriter
+  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph& graph);
+
   template <typename Graph>
-  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
-    GraphWriter<Graph> tmp(graph, fn);
-    return tmp;
-  }
+  GraphWriter<Graph> graphWriter(const char *fn, const Graph& graph);
 
   /// \ingroup lemon_io
@@ -996,5 +935,5 @@
     bool local_os;
 
-    const Graph& _graph;
+    Graph& _graph;
 
     std::string _nodes_caption;
@@ -1028,6 +967,6 @@
     /// Construct a directed graph writer, which writes to the given
     /// output stream.
-    GraphWriter(const Graph& graph, std::ostream& os = std::cout)
-      : _os(&os), local_os(false), _graph(graph),
+    GraphWriter(std::ostream& is, const Graph& graph)
+      : _os(&is), local_os(false), _graph(graph),
         _skip_nodes(false), _skip_edges(false) {}
 
@@ -1036,12 +975,7 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const Graph& graph, const std::string& fn)
+    GraphWriter(const std::string& fn, const Graph& graph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_edges(false) {}
 
     /// \brief Constructor
@@ -1049,12 +983,7 @@
     /// Construct a directed graph writer, which writes to the given
     /// output file.
-    GraphWriter(const Graph& graph, const char* fn)
+    GraphWriter(const char* fn, const Graph& graph)
       : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
+        _skip_nodes(false), _skip_edges(false) {}
 
     /// \brief Destructor
@@ -1082,10 +1011,10 @@
   private:
 
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            std::ostream& os);
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            const std::string& fn);
-    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
-                                            const char *fn);
+    friend GraphWriter<Graph> graphWriter<>(std::ostream& os,
+                                            const Graph& graph);
+    friend GraphWriter<Graph> graphWriter<>(const std::string& fn,
+                                            const Graph& graph);
+    friend GraphWriter<Graph> graphWriter<>(const char *fn,
+                                            const Graph& graph);
 
     GraphWriter(GraphWriter& other)
@@ -1535,214 +1464,31 @@
   };
 
-  class SectionWriter;
-
-  SectionWriter sectionWriter(std::istream& is);
-  SectionWriter sectionWriter(const std::string& fn);
-  SectionWriter sectionWriter(const char* fn);
-
-  /// \ingroup lemon_io
-  ///
-  /// \brief Section writer class
-  ///
-  /// In the \ref lgf-format "LGF" file extra sections can be placed,
-  /// which contain any data in arbitrary format. Such sections can be
-  /// written with this class. A writing rule can be added to the
-  /// class with two different functions. With the \c sectionLines()
-  /// function a generator can write the section line-by-line, while
-  /// with the \c sectionStream() member the section can be written to
-  /// an output stream.
-  class SectionWriter {
-  private:
-
-    std::ostream* _os;
-    bool local_os;
-
-    typedef std::vector<std::pair<std::string, _writer_bits::Section*> >
-    Sections;
-
-    Sections _sections;
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Construct a section writer, which writes to the given output
-    /// stream.
-    SectionWriter(std::ostream& os)
-      : _os(&os), local_os(false) {}
-
-    /// \brief Constructor
-    ///
-    /// Construct a section writer, which writes into the given file.
-    SectionWriter(const std::string& fn)
-      : _os(new std::ofstream(fn.c_str())), local_os(true) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
-
-    /// \brief Constructor
-    ///
-    /// Construct a section writer, which writes into the given file.
-    SectionWriter(const char* fn)
-      : _os(new std::ofstream(fn)), local_os(true) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
-
-    /// \brief Destructor
-    ~SectionWriter() {
-      for (Sections::iterator it = _sections.begin();
-           it != _sections.end(); ++it) {
-        delete it->second;
-      }
-
-      if (local_os) {
-        delete _os;
-      }
-
-    }
-
-  private:
-
-    friend SectionWriter sectionWriter(std::ostream& os);
-    friend SectionWriter sectionWriter(const std::string& fn);
-    friend SectionWriter sectionWriter(const char* fn);
-
-    SectionWriter(SectionWriter& other)
-      : _os(other._os), local_os(other.local_os) {
-
-      other._os = 0;
-      other.local_os = false;
-
-      _sections.swap(other._sections);
-    }
-
-    SectionWriter& operator=(const SectionWriter&);
-
-  public:
-
-    /// \name Section writers
-    /// @{
-
-    /// \brief Add a section writer with line oriented writing
-    ///
-    /// The first parameter is the type descriptor of the section, the
-    /// second is a generator with std::string values. At the writing
-    /// process, the returned \c std::string will be written into the
-    /// output file until it is an empty string.
-    ///
-    /// For example, an integer vector is written into a section.
-    ///\code
-    ///  @numbers
-    ///  12 45 23 78
-    ///  4 28 38 28
-    ///  23 6 16
-    ///\endcode
-    ///
-    /// The generator is implemented as a struct.
-    ///\code
-    ///  struct NumberSection {
-    ///    std::vector<int>::const_iterator _it, _end;
-    ///    NumberSection(const std::vector<int>& data)
-    ///      : _it(data.begin()), _end(data.end()) {}
-    ///    std::string operator()() {
-    ///      int rem_in_line = 4;
-    ///      std::ostringstream ls;
-    ///      while (rem_in_line > 0 && _it != _end) {
-    ///        ls << *(_it++) << ' ';
-    ///        --rem_in_line;
-    ///      }
-    ///      return ls.str();
-    ///    }
-    ///  };
-    ///
-    ///  // ...
-    ///
-    ///  writer.sectionLines("numbers", NumberSection(vec));
-    ///\endcode
-    template <typename Functor>
-    SectionWriter& sectionLines(const std::string& type, Functor functor) {
-      LEMON_ASSERT(!type.empty(), "Type is empty.");
-      _sections.push_back(std::make_pair(type,
-        new _writer_bits::LineSection<Functor>(functor)));
-      return *this;
-    }
-
-
-    /// \brief Add a section writer with stream oriented writing
-    ///
-    /// The first parameter is the type of the section, the second is
-    /// a functor, which takes a \c std::ostream& parameter. The
-    /// functor writes the section to the output stream.
-    /// \warning The last line must be closed with end-line character.
-    template <typename Functor>
-    SectionWriter& sectionStream(const std::string& type, Functor functor) {
-      LEMON_ASSERT(!type.empty(), "Type is empty.");
-      _sections.push_back(std::make_pair(type,
-         new _writer_bits::StreamSection<Functor>(functor)));
-      return *this;
-    }
-
-    /// @}
-
-  public:
-
-
-    /// \name Execution of the writer
-    /// @{
-
-    /// \brief Start the batch processing
-    ///
-    /// This function starts the batch processing.
-    void run() {
-
-      LEMON_ASSERT(_os != 0, "This writer is assigned to an other writer");
-
-      for (Sections::iterator it = _sections.begin();
-           it != _sections.end(); ++it) {
-        (*_os) << '@' << it->first << std::endl;
-        it->second->process(*_os);
-      }
-    }
-
-    /// \brief Give back the stream of the writer
-    ///
-    /// Returns the stream of the writer
-    std::ostream& ostream() {
-      return *_os;
-    }
-
-    /// @}
-
-  };
-
-  /// \brief Return a \ref SectionWriter class
-  ///
-  /// This function just returns a \ref SectionWriter class.
-  /// \relates SectionWriter
-  inline SectionWriter sectionWriter(std::ostream& os) {
-    SectionWriter tmp(os);
+  /// \brief Return a \ref GraphWriter class
+  ///
+  /// This function just returns a \ref GraphWriter class.
+  /// \relates GraphWriter
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph& graph) {
+    GraphWriter<Graph> tmp(os, graph);
     return tmp;
   }
 
-  /// \brief Return a \ref SectionWriter class
-  ///
-  /// This function just returns a \ref SectionWriter class.
-  /// \relates SectionWriter
-  inline SectionWriter sectionWriter(const std::string& fn) {
-    SectionWriter tmp(fn);
+  /// \brief Return a \ref GraphWriter class
+  ///
+  /// This function just returns a \ref GraphWriter class.
+  /// \relates GraphWriter
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph& graph) {
+    GraphWriter<Graph> tmp(fn, graph);
     return tmp;
   }
 
-  /// \brief Return a \ref SectionWriter class
-  ///
-  /// This function just returns a \ref SectionWriter class.
-  /// \relates SectionWriter
-  inline SectionWriter sectionWriter(const char* fn) {
-    SectionWriter tmp(fn);
+  /// \brief Return a \ref GraphWriter class
+  ///
+  /// This function just returns a \ref GraphWriter class.
+  /// \relates GraphWriter
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const char* fn, const Graph& graph) {
+    GraphWriter<Graph> tmp(fn, graph);
     return tmp;
   }
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 317)
+++ lemon/list_graph.h	(revision 220)
@@ -364,16 +364,4 @@
     }
 
-    ///\brief Erase a node from the digraph.
-    ///
-    ///Erase a node from the digraph.
-    ///
-    void erase(const Node& n) { Parent::erase(n); }
-
-    ///\brief Erase an arc from the digraph.
-    ///
-    ///Erase an arc from the digraph.
-    ///
-    void erase(const Arc& a) { Parent::erase(a); }
-
     /// Node validity check
 
@@ -396,7 +384,7 @@
     bool valid(Arc a) const { return Parent::valid(a); }
 
-    /// Change the target of \c a to \c n
-
-    /// Change the target of \c a to \c n
+    /// Change the target of \c e to \c n
+
+    /// Change the target of \c e to \c n
     ///
     ///\note The <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s referencing
@@ -406,19 +394,19 @@
     ///\warning This functionality cannot be used together with the Snapshot
     ///feature.
-    void changeTarget(Arc a, Node n) {
-      Parent::changeTarget(a,n);
-    }
-    /// Change the source of \c a to \c n
-
-    /// Change the source of \c a to \c n
-    ///
-    ///\note The <tt>InArcIt</tt>s referencing the changed arc remain
-    ///valid. However the <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s are
+    void changeTarget(Arc e, Node n) {
+      Parent::changeTarget(e,n);
+    }
+    /// Change the source of \c e to \c n
+
+    /// Change the source of \c e to \c n
+    ///
+    ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s referencing
+    ///the changed arc remain valid. However <tt>OutArcIt</tt>s are
     ///invalidated.
     ///
     ///\warning This functionality cannot be used together with the Snapshot
     ///feature.
-    void changeSource(Arc a, Node n) {
-      Parent::changeSource(a,n);
+    void changeSource(Arc e, Node n) {
+      Parent::changeSource(e,n);
     }
 
@@ -502,6 +490,8 @@
     ///be invalidated.
     ///
-    ///\warning This functionality cannot be used in conjunction with the
+    ///\warning This functionality cannot be used together with the
     ///Snapshot feature.
+    ///
+    ///\todo It could be implemented in a bit faster way.
     Node split(Node n, bool connect = true) {
       Node b = addNode();
@@ -841,7 +831,5 @@
 
     public:
-      operator Edge() const { 
-        return id != -1 ? edgeFromId(id / 2) : INVALID; 
-      }
+      operator Edge() const { return edgeFromId(id / 2); }
 
       Arc() {}
@@ -1115,5 +1103,5 @@
   protected:
 
-    void changeV(Edge e, Node n) {
+    void changeTarget(Edge e, Node n) {
       if(arcs[2 * e.id].next_out != -1) {
         arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
@@ -1136,5 +1124,5 @@
     }
 
-    void changeU(Edge e, Node n) {
+    void changeSource(Edge e, Node n) {
       if(arcs[(2 * e.id) | 1].next_out != -1) {
         arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
@@ -1220,16 +1208,4 @@
       return Parent::addEdge(s, t);
     }
-
-    /// \brief Erase a node from the graph.
-    ///
-    /// Erase a node from the graph.
-    ///
-    void erase(const Node& n) { Parent::erase(n); }
-
-    /// \brief Erase an edge from the graph.
-    ///
-    /// Erase an edge from the graph.
-    ///
-    void erase(const Edge& e) { Parent::erase(e); }
     /// Node validity check
 
@@ -1259,30 +1235,64 @@
     /// added to the graph.
     bool valid(Edge e) const { return Parent::valid(e); }
-    /// \brief Change the end \c u of \c e to \c n
-    ///
-    /// This function changes the end \c u of \c e to node \c n.
-    ///
-    ///\note The <tt>EdgeIt</tt>s and <tt>ArcIt</tt>s referencing the
-    ///changed edge are invalidated and if the changed node is the
-    ///base node of an iterator then this iterator is also
-    ///invalidated.
+    /// \brief Change the source of \c e to \c n
+    ///
+    /// This function changes the source of \c e to \c n.
+    ///
+    ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
+    ///referencing the changed arc remain
+    ///valid. However <tt>OutArcIt</tt>s are invalidated.
     ///
     ///\warning This functionality cannot be used together with the
     ///Snapshot feature.
-    void changeU(Edge e, Node n) {
-      Parent::changeU(e,n);
-    }
-    /// \brief Change the end \c v of \c e to \c n
-    ///
-    /// This function changes the end \c v of \c e to \c n.
-    ///
-    ///\note The <tt>EdgeIt</tt>s referencing the changed edge remain
-    ///valid, however <tt>ArcIt</tt>s and if the changed node is the
-    ///base node of an iterator then this iterator is invalidated.
+    void changeSource(Edge e, Node n) {
+      Parent::changeSource(e,n);
+    }
+    /// \brief Change the target of \c e to \c n
+    ///
+    /// This function changes the target of \c e to \c n.
+    ///
+    /// \note The <tt>ArcIt</tt>s referencing the changed arc remain
+    /// valid. However the other iterators may be invalidated.
     ///
     ///\warning This functionality cannot be used together with the
     ///Snapshot feature.
-    void changeV(Edge e, Node n) {
-      Parent::changeV(e,n);
+    void changeTarget(Edge e, Node n) {
+      Parent::changeTarget(e,n);
+    }
+    /// \brief Change the source of \c e to \c n
+    ///
+    /// This function changes the source of \c e to \c n.
+    /// It also changes the proper node of the represented edge.
+    ///
+    ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
+    ///referencing the changed arc remain
+    ///valid. However <tt>OutArcIt</tt>s are invalidated.
+    ///
+    ///\warning This functionality cannot be used together with the
+    ///Snapshot feature.
+    void changeSource(Arc e, Node n) {
+      if (Parent::direction(e)) {
+        Parent::changeSource(e,n);
+      } else {
+        Parent::changeTarget(e,n);
+      }
+    }
+    /// \brief Change the target of \c e to \c n
+    ///
+    /// This function changes the target of \c e to \c n.
+    /// It also changes the proper node of the represented edge.
+    ///
+    ///\note The <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s
+    ///referencing the changed arc remain
+    ///valid. However <tt>InArcIt</tt>s are invalidated.
+    ///
+    ///\warning This functionality cannot be used together with the
+    ///Snapshot feature.
+    void changeTarget(Arc e, Node n) {
+      if (Parent::direction(e)) {
+        Parent::changeTarget(e,n);
+      } else {
+        Parent::changeSource(e,n);
+      }
     }
     /// \brief Contract two nodes.
@@ -1304,8 +1314,8 @@
         if (r && runningNode(e) == a) {
           erase(e);
-        } else if (u(e) == b) {
-          changeU(e, a);
+        } else if (source(e) == b) {
+          changeSource(e, a);
         } else {
-          changeV(e, a);
+          changeTarget(e, a);
         }
         e = f;
Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 320)
+++ lemon/maps.h	(revision 220)
@@ -44,5 +44,5 @@
   class MapBase {
   public:
-    /// \brief The key type of the map.
+    /// \biref The key type of the map.
     typedef K Key;
     /// \brief The value type of the map.
@@ -74,7 +74,7 @@
   };
 
-  /// Returns a \c NullMap class
-
-  /// This function just returns a \c NullMap class.
+  /// Returns a \ref NullMap class
+
+  /// This function just returns a \ref NullMap class.
   /// \relates NullMap
   template <typename K, typename V>
@@ -89,5 +89,5 @@
   /// value to each key.
   ///
-  /// In other aspects it is equivalent to \c NullMap.
+  /// In other aspects it is equivalent to \ref NullMap.
   /// So it conforms the \ref concepts::ReadWriteMap "ReadWriteMap"
   /// concept, but it absorbs the data written to it.
@@ -134,7 +134,7 @@
   };
 
-  /// Returns a \c ConstMap class
-
-  /// This function just returns a \c ConstMap class.
+  /// Returns a \ref ConstMap class
+
+  /// This function just returns a \ref ConstMap class.
   /// \relates ConstMap
   template<typename K, typename V>
@@ -157,5 +157,5 @@
   /// value to each key.
   ///
-  /// In other aspects it is equivalent to \c NullMap.
+  /// In other aspects it is equivalent to \ref NullMap.
   /// So it conforms the \ref concepts::ReadWriteMap "ReadWriteMap"
   /// concept, but it absorbs the data written to it.
@@ -183,7 +183,7 @@
   };
 
-  /// Returns a \c ConstMap class with inlined constant value
-
-  /// This function just returns a \c ConstMap class with inlined
+  /// Returns a \ref ConstMap class with inlined constant value
+
+  /// This function just returns a \ref ConstMap class with inlined
   /// constant value.
   /// \relates ConstMap
@@ -213,7 +213,7 @@
   };
 
-  /// Returns an \c IdentityMap class
-
-  /// This function just returns an \c IdentityMap class.
+  /// Returns an \ref IdentityMap class
+
+  /// This function just returns an \ref IdentityMap class.
   /// \relates IdentityMap
   template<typename T>
@@ -229,5 +229,5 @@
   /// values to integer keys from the range <tt>[0..size-1]</tt>.
   /// It can be used with some data structures, for example
-  /// \c UnionFind, \c BinHeap, when the used items are small
+  /// \ref UnionFind, \ref BinHeap, when the used items are small
   /// integers. This map conforms the \ref concepts::ReferenceMap
   /// "ReferenceMap" concept.
@@ -269,5 +269,5 @@
       : _vector(vector.begin(), vector.end()) {}
 
-    /// Constructs the map from another \c RangeMap.
+    /// Constructs the map from another \ref RangeMap.
     template <typename V1>
     RangeMap(const RangeMap<V1> &c)
@@ -312,7 +312,7 @@
   };
 
-  /// Returns a \c RangeMap class
-
-  /// This function just returns a \c RangeMap class.
+  /// Returns a \ref RangeMap class
+
+  /// This function just returns a \ref RangeMap class.
   /// \relates RangeMap
   template<typename V>
@@ -321,8 +321,8 @@
   }
 
-  /// \brief Returns a \c RangeMap class created from an appropriate
+  /// \brief Returns a \ref RangeMap class created from an appropriate
   /// \c std::vector
 
-  /// This function just returns a \c RangeMap class created from an
+  /// This function just returns a \ref RangeMap class created from an
   /// appropriate \c std::vector.
   /// \relates RangeMap
@@ -389,5 +389,5 @@
       : _map(map.begin(), map.end()), _value(value) {}
 
-    /// \brief Constructs the map from another \c SparseMap.
+    /// \brief Constructs the map from another \ref SparseMap.
     template<typename V1, typename Comp1>
     SparseMap(const SparseMap<Key, V1, Comp1> &c)
@@ -434,7 +434,7 @@
   };
 
-  /// Returns a \c SparseMap class
-
-  /// This function just returns a \c SparseMap class with specified
+  /// Returns a \ref SparseMap class
+
+  /// This function just returns a \ref SparseMap class with specified
   /// default value.
   /// \relates SparseMap
@@ -449,8 +449,8 @@
   }
 
-  /// \brief Returns a \c SparseMap class created from an appropriate
+  /// \brief Returns a \ref SparseMap class created from an appropriate
   /// \c std::map
 
-  /// This function just returns a \c SparseMap class created from an
+  /// This function just returns a \ref SparseMap class created from an
   /// appropriate \c std::map.
   /// \relates SparseMap
@@ -485,4 +485,6 @@
   ///
   /// \sa CombineMap
+  ///
+  /// \todo Check the requirements.
   template <typename M1, typename M2>
   class ComposeMap : public MapBase<typename M2::Key, typename M1::Value> {
@@ -502,7 +504,7 @@
   };
 
-  /// Returns a \c ComposeMap class
-
-  /// This function just returns a \c ComposeMap class.
+  /// Returns a \ref ComposeMap class
+
+  /// This function just returns a \ref ComposeMap class.
   ///
   /// If \c m1 and \c m2 are maps and the \c Value type of \c m2 is
@@ -539,4 +541,6 @@
   ///
   /// \sa ComposeMap
+  ///
+  /// \todo Check the requirements.
   template<typename M1, typename M2, typename F,
            typename V = typename F::result_type>
@@ -557,7 +561,7 @@
   };
 
-  /// Returns a \c CombineMap class
-
-  /// This function just returns a \c CombineMap class.
+  /// Returns a \ref CombineMap class
+
+  /// This function just returns a \ref CombineMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c double
@@ -626,7 +630,7 @@
   };
 
-  /// Returns a \c FunctorToMap class
-
-  /// This function just returns a \c FunctorToMap class.
+  /// Returns a \ref FunctorToMap class
+
+  /// This function just returns a \ref FunctorToMap class.
   ///
   /// This function is specialized for adaptable binary function
@@ -685,7 +689,7 @@
   };
 
-  /// Returns a \c MapToFunctor class
-
-  /// This function just returns a \c MapToFunctor class.
+  /// Returns a \ref MapToFunctor class
+
+  /// This function just returns a \ref MapToFunctor class.
   /// \relates MapToFunctor
   template<typename M>
@@ -724,7 +728,7 @@
   };
 
-  /// Returns a \c ConvertMap class
-
-  /// This function just returns a \c ConvertMap class.
+  /// Returns a \ref ConvertMap class
+
+  /// This function just returns a \ref ConvertMap class.
   /// \relates ConvertMap
   template<typename V, typename M>
@@ -764,7 +768,7 @@
   };
 
-  /// Returns a \c ForkMap class
-
-  /// This function just returns a \c ForkMap class.
+  /// Returns a \ref ForkMap class
+
+  /// This function just returns a \ref ForkMap class.
   /// \relates ForkMap
   template <typename M1, typename M2>
@@ -808,7 +812,7 @@
   };
 
-  /// Returns an \c AddMap class
-
-  /// This function just returns an \c AddMap class.
+  /// Returns an \ref AddMap class
+
+  /// This function just returns an \ref AddMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c double
@@ -856,7 +860,7 @@
   };
 
-  /// Returns a \c SubMap class
-
-  /// This function just returns a \c SubMap class.
+  /// Returns a \ref SubMap class
+
+  /// This function just returns a \ref SubMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c double
@@ -905,7 +909,7 @@
   };
 
-  /// Returns a \c MulMap class
-
-  /// This function just returns a \c MulMap class.
+  /// Returns a \ref MulMap class
+
+  /// This function just returns a \ref MulMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c double
@@ -953,7 +957,7 @@
   };
 
-  /// Returns a \c DivMap class
-
-  /// This function just returns a \c DivMap class.
+  /// Returns a \ref DivMap class
+
+  /// This function just returns a \ref DivMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c double
@@ -1039,7 +1043,7 @@
   };
 
-  /// Returns a \c ShiftMap class
-
-  /// This function just returns a \c ShiftMap class.
+  /// Returns a \ref ShiftMap class
+
+  /// This function just returns a \ref ShiftMap class.
   ///
   /// For example, if \c m is a map with \c double values and \c v is
@@ -1053,7 +1057,7 @@
   }
 
-  /// Returns a \c ShiftWriteMap class
-
-  /// This function just returns a \c ShiftWriteMap class.
+  /// Returns a \ref ShiftWriteMap class
+
+  /// This function just returns a \ref ShiftWriteMap class.
   ///
   /// For example, if \c m is a map with \c double values and \c v is
@@ -1141,7 +1145,7 @@
   };
 
-  /// Returns a \c ScaleMap class
-
-  /// This function just returns a \c ScaleMap class.
+  /// Returns a \ref ScaleMap class
+
+  /// This function just returns a \ref ScaleMap class.
   ///
   /// For example, if \c m is a map with \c double values and \c v is
@@ -1155,7 +1159,7 @@
   }
 
-  /// Returns a \c ScaleWriteMap class
-
-  /// This function just returns a \c ScaleWriteMap class.
+  /// Returns a \ref ScaleWriteMap class
+
+  /// This function just returns a \ref ScaleWriteMap class.
   ///
   /// For example, if \c m is a map with \c double values and \c v is
@@ -1241,7 +1245,7 @@
   };
 
-  /// Returns a \c NegMap class
-
-  /// This function just returns a \c NegMap class.
+  /// Returns a \ref NegMap class
+
+  /// This function just returns a \ref NegMap class.
   ///
   /// For example, if \c m is a map with \c double values, then
@@ -1254,7 +1258,7 @@
   }
 
-  /// Returns a \c NegWriteMap class
-
-  /// This function just returns a \c NegWriteMap class.
+  /// Returns a \ref NegWriteMap class
+
+  /// This function just returns a \ref NegWriteMap class.
   ///
   /// For example, if \c m is a map with \c double values, then
@@ -1297,7 +1301,7 @@
   };
 
-  /// Returns an \c AbsMap class
-
-  /// This function just returns an \c AbsMap class.
+  /// Returns an \ref AbsMap class
+
+  /// This function just returns an \ref AbsMap class.
   ///
   /// For example, if \c m is a map with \c double values, then
@@ -1346,7 +1350,7 @@
   };
 
-  /// Returns a \c TrueMap class
-
-  /// This function just returns a \c TrueMap class.
+  /// Returns a \ref TrueMap class
+
+  /// This function just returns a \ref TrueMap class.
   /// \relates TrueMap
   template<typename K>
@@ -1383,7 +1387,7 @@
   };
 
-  /// Returns a \c FalseMap class
-
-  /// This function just returns a \c FalseMap class.
+  /// Returns a \ref FalseMap class
+
+  /// This function just returns a \ref FalseMap class.
   /// \relates FalseMap
   template<typename K>
@@ -1430,7 +1434,7 @@
   };
 
-  /// Returns an \c AndMap class
-
-  /// This function just returns an \c AndMap class.
+  /// Returns an \ref AndMap class
+
+  /// This function just returns an \ref AndMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c bool values,
@@ -1478,7 +1482,7 @@
   };
 
-  /// Returns an \c OrMap class
-
-  /// This function just returns an \c OrMap class.
+  /// Returns an \ref OrMap class
+
+  /// This function just returns an \ref OrMap class.
   ///
   /// For example, if \c m1 and \c m2 are both maps with \c bool values,
@@ -1545,7 +1549,7 @@
   };
 
-  /// Returns a \c NotMap class
-
-  /// This function just returns a \c NotMap class.
+  /// Returns a \ref NotMap class
+
+  /// This function just returns a \ref NotMap class.
   ///
   /// For example, if \c m is a map with \c bool values, then
@@ -1558,7 +1562,7 @@
   }
 
-  /// Returns a \c NotWriteMap class
-
-  /// This function just returns a \c NotWriteMap class.
+  /// Returns a \ref NotWriteMap class
+
+  /// This function just returns a \ref NotWriteMap class.
   ///
   /// For example, if \c m is a map with \c bool values, then
@@ -1606,7 +1610,7 @@
   };
 
-  /// Returns an \c EqualMap class
-
-  /// This function just returns an \c EqualMap class.
+  /// Returns an \ref EqualMap class
+
+  /// This function just returns an \ref EqualMap class.
   ///
   /// For example, if \c m1 and \c m2 are maps with keys and values of
@@ -1654,7 +1658,7 @@
   };
 
-  /// Returns an \c LessMap class
-
-  /// This function just returns an \c LessMap class.
+  /// Returns an \ref LessMap class
+
+  /// This function just returns an \ref LessMap class.
   ///
   /// For example, if \c m1 and \c m2 are maps with keys and values of
@@ -1683,9 +1687,4 @@
 
   }
-
-  /// @}
-
-  /// \addtogroup maps
-  /// @{
 
   /// \brief Writable bool map for logging each \c true assigned element
@@ -1751,7 +1750,7 @@
   };
 
-  /// Returns a \c LoggerBoolMap class
-
-  /// This function just returns a \c LoggerBoolMap class.
+  /// Returns a \ref LoggerBoolMap class
+
+  /// This function just returns a \ref LoggerBoolMap class.
   ///
   /// The most important usage of it is storing certain nodes or arcs
@@ -1773,5 +1772,5 @@
   /// \note LoggerBoolMap is just \ref concepts::WriteMap "writable", so
   /// it cannot be used when a readable map is needed, for example as
-  /// \c ReachedMap for \c Bfs, \c Dfs and \c Dijkstra algorithms.
+  /// \c ReachedMap for \ref Bfs, \ref Dfs and \ref Dijkstra algorithms.
   ///
   /// \relates LoggerBoolMap
@@ -1780,9 +1779,4 @@
     return LoggerBoolMap<Iterator>(it);
   }
-
-  /// @}
-
-  /// \addtogroup graph_maps
-  /// @{
 
   /// Provides an immutable and unique id for each item in the graph.
@@ -1858,4 +1852,409 @@
   };
 
+
+  /// \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.
+  ///
+  /// The values of the map can be accessed
+  /// with stl compatible forward iterator.
+  ///
+  /// \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 _Graph, typename _Item, typename _Value>
+  class InvertableMap
+    : protected ItemSetTraits<_Graph, _Item>::template Map<_Value>::Type {
+  private:
+
+    typedef typename ItemSetTraits<_Graph, _Item>::
+    template Map<_Value>::Type Map;
+    typedef _Graph Graph;
+
+    typedef std::map<_Value, _Item> Container;
+    Container _inv_map;
+
+  public:
+
+    /// 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 InvertableMap for the graph.
+    ///
+    explicit InvertableMap(const Graph& graph) : Map(graph) {}
+
+    /// \brief Forward iterator for values.
+    ///
+    /// This iterator is an stl compatible forward
+    /// iterator on the values of the map. The values can
+    /// be accessed in the [beginValue, endValue) range.
+    ///
+    class ValueIterator
+      : public std::iterator<std::forward_iterator_tag, Value> {
+      friend class InvertableMap;
+    private:
+      ValueIterator(typename Container::const_iterator _it)
+        : it(_it) {}
+    public:
+
+      ValueIterator() {}
+
+      ValueIterator& operator++() { ++it; return *this; }
+      ValueIterator operator++(int) {
+        ValueIterator tmp(*this);
+        operator++();
+        return tmp;
+      }
+
+      const Value& operator*() const { return it->first; }
+      const Value* operator->() const { return &(it->first); }
+
+      bool operator==(ValueIterator jt) const { return it == jt.it; }
+      bool operator!=(ValueIterator jt) const { return it != jt.it; }
+
+    private:
+      typename Container::const_iterator it;
+    };
+
+    /// \brief Returns an iterator to the first value.
+    ///
+    /// Returns an stl compatible iterator to the
+    /// first value of the map. The values of the
+    /// map can be accessed in the [beginValue, endValue)
+    /// range.
+    ValueIterator beginValue() const {
+      return ValueIterator(_inv_map.begin());
+    }
+
+    /// \brief Returns an iterator after the last value.
+    ///
+    /// Returns an stl compatible iterator after the
+    /// last value of the map. The values of the
+    /// map can be accessed in the [beginValue, endValue)
+    /// range.
+    ValueIterator endValue() const {
+      return ValueIterator(_inv_map.end());
+    }
+
+    /// \brief The setter function of the map.
+    ///
+    /// Sets the mapped value.
+    void set(const Key& key, const Value& val) {
+      Value oldval = Map::operator[](key);
+      typename Container::iterator it = _inv_map.find(oldval);
+      if (it != _inv_map.end() && it->second == key) {
+        _inv_map.erase(it);
+      }
+      _inv_map.insert(make_pair(val, key));
+      Map::set(key, val);
+    }
+
+    /// \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 {
+      return Map::operator[](key);
+    }
+
+    /// \brief Gives back the item by its value.
+    ///
+    /// Gives back the item by its value.
+    Key operator()(const Value& key) const {
+      typename Container::const_iterator it = _inv_map.find(key);
+      return it != _inv_map.end() ? it->second : INVALID;
+    }
+
+  protected:
+
+    /// \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) {
+      Value val = Map::operator[](key);
+      typename Container::iterator it = _inv_map.find(val);
+      if (it != _inv_map.end() && it->second == key) {
+        _inv_map.erase(it);
+      }
+      Map::erase(key);
+    }
+
+    /// \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) {
+      for (int i = 0; i < int(keys.size()); ++i) {
+        Value val = Map::operator[](keys[i]);
+        typename Container::iterator it = _inv_map.find(val);
+        if (it != _inv_map.end() && it->second == keys[i]) {
+          _inv_map.erase(it);
+        }
+      }
+      Map::erase(keys);
+    }
+
+    /// \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() {
+      _inv_map.clear();
+      Map::clear();
+    }
+
+  public:
+
+    /// \brief The inverse map type.
+    ///
+    /// The inverse of this map. The subscript operator of the map
+    /// gives back always the item what was last assigned to the value.
+    class InverseMap {
+    public:
+      /// \brief Constructor of the InverseMap.
+      ///
+      /// Constructor of the InverseMap.
+      explicit InverseMap(const InvertableMap& inverted)
+        : _inverted(inverted) {}
+
+      /// The value type of the InverseMap.
+      typedef typename InvertableMap::Key Value;
+      /// The key type of the InverseMap.
+      typedef typename InvertableMap::Value Key;
+
+      /// \brief Subscript operator.
+      ///
+      /// Subscript operator. It gives back always the item
+      /// what was last assigned to the value.
+      Value operator[](const Key& key) const {
+        return _inverted(key);
+      }
+
+    private:
+      const InvertableMap& _inverted;
+    };
+
+    /// \brief It gives back the just readable inverse map.
+    ///
+    /// It gives back the just readable inverse map.
+    InverseMap inverse() const {
+      return InverseMap(*this);
+    }
+
+
+
+  };
+
+  /// \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 for descriptor map.
+    explicit DescriptorMap(const Graph& _graph) : Map(_graph) {
+      Item it;
+      const typename Map::Notifier* nf = Map::notifier();
+      for (nf->first(it); it != INVALID; nf->next(it)) {
+        Map::set(it, _inv_map.size());
+        _inv_map.push_back(it);
+      }
+    }
+
+  protected:
+
+    /// \brief Add a new key to the map.
+    ///
+    /// Add a new key to the map. It is called by the
+    /// \c AlterationNotifier.
+    virtual void add(const Item& item) {
+      Map::add(item);
+      Map::set(item, _inv_map.size());
+      _inv_map.push_back(item);
+    }
+
+    /// \brief Add more new keys to the map.
+    ///
+    /// Add more new keys to the map. It is called by the
+    /// \c AlterationNotifier.
+    virtual void add(const std::vector<Item>& items) {
+      Map::add(items);
+      for (int i = 0; i < int(items.size()); ++i) {
+        Map::set(items[i], _inv_map.size());
+        _inv_map.push_back(items[i]);
+      }
+    }
+
+    /// \brief Erase the key from the map.
+    ///
+    /// Erase the key from the map. It is called by the
+    /// \c AlterationNotifier.
+    virtual void erase(const Item& item) {
+      Map::set(_inv_map.back(), Map::operator[](item));
+      _inv_map[Map::operator[](item)] = _inv_map.back();
+      _inv_map.pop_back();
+      Map::erase(item);
+    }
+
+    /// \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<Item>& items) {
+      for (int i = 0; i < int(items.size()); ++i) {
+        Map::set(_inv_map.back(), Map::operator[](items[i]));
+        _inv_map[Map::operator[](items[i])] = _inv_map.back();
+        _inv_map.pop_back();
+      }
+      Map::erase(items);
+    }
+
+    /// \brief Build the unique map.
+    ///
+    /// Build the unique map. It is called by the
+    /// \c AlterationNotifier.
+    virtual void build() {
+      Map::build();
+      Item it;
+      const typename Map::Notifier* nf = Map::notifier();
+      for (nf->first(it); it != INVALID; nf->next(it)) {
+        Map::set(it, _inv_map.size());
+        _inv_map.push_back(it);
+      }
+    }
+
+    /// \brief Clear the keys from the map.
+    ///
+    /// Clear the keys from the map. It is called by the
+    /// \c AlterationNotifier.
+    virtual void clear() {
+      _inv_map.clear();
+      Map::clear();
+    }
+
+  public:
+
+    /// \brief Returns the maximal value plus one.
+    ///
+    /// Returns the maximal value plus one in the map.
+    unsigned int size() const {
+      return _inv_map.size();
+    }
+
+    /// \brief Swaps the position of the two items in the map.
+    ///
+    /// Swaps the position of the two items in the map.
+    void swap(const Item& p, const Item& q) {
+      int pi = Map::operator[](p);
+      int qi = Map::operator[](q);
+      Map::set(p, qi);
+      _inv_map[qi] = p;
+      Map::set(q, pi);
+      _inv_map[pi] = q;
+    }
+
+    /// \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 by its descriptor.
+    ///
+    /// Gives back th item by its descriptor.
+    Item operator()(int id) const {
+      return _inv_map[id];
+    }
+
+  private:
+
+    typedef std::vector<Item> Container;
+    Container _inv_map;
+
+  public:
+    /// \brief The inverse map type of DescriptorMap.
+    ///
+    /// The inverse map type of DescriptorMap.
+    class InverseMap {
+    public:
+      /// \brief Constructor of the InverseMap.
+      ///
+      /// Constructor of the InverseMap.
+      explicit InverseMap(const DescriptorMap& inverted)
+        : _inverted(inverted) {}
+
+
+      /// The value type of the InverseMap.
+      typedef typename DescriptorMap::Key Value;
+      /// The key type of the InverseMap.
+      typedef typename DescriptorMap::Value Key;
+
+      /// \brief Subscript operator.
+      ///
+      /// Subscript operator. It gives back the item
+      /// that the descriptor belongs to currently.
+      Value operator[](const Key& key) const {
+        return _inverted(key);
+      }
+
+      /// \brief Size of the map.
+      ///
+      /// Returns the size of the map.
+      unsigned int size() const {
+        return _inverted.size();
+      }
+
+    private:
+      const DescriptorMap& _inverted;
+    };
+
+    /// \brief Gives back the inverse of the map.
+    ///
+    /// Gives back the inverse of the map.
+    const InverseMap inverse() const {
+      return InverseMap(*this);
+    }
+  };
+
   /// \brief Returns the source of the given arc.
   ///
@@ -1872,5 +2271,5 @@
     ///
     /// Constructor
-    /// \param digraph The digraph that the map belongs to.
+    /// \param _digraph The digraph that the map belongs to.
     explicit SourceMap(const Digraph& digraph) : _digraph(digraph) {}
 
@@ -1888,7 +2287,7 @@
   };
 
-  /// \brief Returns a \c SourceMap class.
-  ///
-  /// This function just returns an \c SourceMap class.
+  /// \brief Returns a \ref SourceMap class.
+  ///
+  /// This function just returns an \ref SourceMap class.
   /// \relates SourceMap
   template <typename Digraph>
@@ -1911,5 +2310,5 @@
     ///
     /// Constructor
-    /// \param digraph The digraph that the map belongs to.
+    /// \param _digraph The digraph that the map belongs to.
     explicit TargetMap(const Digraph& digraph) : _digraph(digraph) {}
 
@@ -1927,7 +2326,7 @@
   };
 
-  /// \brief Returns a \c TargetMap class.
-  ///
-  /// This function just returns a \c TargetMap class.
+  /// \brief Returns a \ref TargetMap class.
+  ///
+  /// This function just returns a \ref TargetMap class.
   /// \relates TargetMap
   template <typename Digraph>
@@ -1950,5 +2349,5 @@
     ///
     /// Constructor
-    /// \param graph The graph that the map belongs to.
+    /// \param _graph The graph that the map belongs to.
     explicit ForwardMap(const Graph& graph) : _graph(graph) {}
 
@@ -1966,7 +2365,7 @@
   };
 
-  /// \brief Returns a \c ForwardMap class.
-  ///
-  /// This function just returns an \c ForwardMap class.
+  /// \brief Returns a \ref ForwardMap class.
+  ///
+  /// This function just returns an \ref ForwardMap class.
   /// \relates ForwardMap
   template <typename Graph>
@@ -1989,5 +2388,5 @@
     ///
     /// Constructor
-    /// \param graph The graph that the map belongs to.
+    /// \param _graph The graph that the map belongs to.
     explicit BackwardMap(const Graph& graph) : _graph(graph) {}
 
@@ -2005,7 +2404,7 @@
   };
 
-  /// \brief Returns a \c BackwardMap class
-
-  /// This function just returns a \c BackwardMap class.
+  /// \brief Returns a \ref BackwardMap class
+
+  /// This function just returns a \ref BackwardMap class.
   /// \relates BackwardMap
   template <typename Graph>
Index: lemon/path.h
===================================================================
--- lemon/path.h	(revision 317)
+++ lemon/path.h	(revision 220)
@@ -83,5 +83,5 @@
     }
 
-    /// \brief LEMON style iterator for path arcs
+    /// \brief Lemon style iterator for path arcs
     ///
     /// This class is used to iterate on the arcs of the paths.
@@ -850,5 +850,5 @@
     int empty() const { return len == 0; }
 
-    /// \brief Erase all arcs in the digraph.
+    /// \break Erase all arcs in the digraph.
     void clear() {
       len = 0;
Index: lemon/random.h
===================================================================
--- lemon/random.h	(revision 280)
+++ lemon/random.h	(revision 209)
@@ -822,4 +822,5 @@
     /// \note The Cartesian form of the Box-Muller
     /// transformation is used to generate a random normal distribution.
+    /// \todo Consider using the "ziggurat" method instead.
     double gauss()
     {
Index: lemon/smart_graph.h
===================================================================
--- lemon/smart_graph.h	(revision 317)
+++ lemon/smart_graph.h	(revision 220)
@@ -301,4 +301,5 @@
     ///\warning This functionality cannot be used together with the Snapshot
     ///feature.
+    ///\todo It could be implemented in a bit faster way.
     Node split(Node n, bool connect = true)
     {
@@ -366,5 +367,5 @@
 
       ///This constructor immediately makes a snapshot of the digraph.
-      ///\param graph The digraph we make a snapshot of.
+      ///\param _g The digraph we make a snapshot of.
       Snapshot(SmartDigraph &graph) : _graph(&graph) {
         node_num=_graph->nodes.size();
@@ -378,5 +379,5 @@
       ///This function can be called more than once. In case of a repeated
       ///call, the previous snapshot gets lost.
-      ///\param graph The digraph we make the snapshot of.
+      ///\param _g The digraph we make the snapshot of.
       void save(SmartDigraph &graph)
       {
@@ -465,7 +466,5 @@
 
     public:
-      operator Edge() const { 
-        return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
-      }
+      operator Edge() const { return edgeFromId(_id / 2); }
 
       Arc() {}
@@ -776,5 +775,5 @@
 
       ///This constructor immediately makes a snapshot of the digraph.
-      ///\param graph The digraph we make a snapshot of.
+      ///\param g The digraph we make a snapshot of.
       Snapshot(SmartGraph &graph) {
         graph.saveSnapshot(*this);
@@ -787,5 +786,5 @@
       ///This function can be called more than once. In case of a repeated
       ///call, the previous snapshot gets lost.
-      ///\param graph The digraph we make the snapshot of.
+      ///\param g The digraph we make the snapshot of.
       void save(SmartGraph &graph)
       {
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 318)
+++ lemon/time_measure.h	(revision 210)
@@ -293,4 +293,5 @@
   ///function, consider the usage of \ref TimeReport instead.
   ///
+  ///\todo This shouldn't be Unix (Linux) specific.
   ///\sa TimeReport
   class Timer
@@ -312,9 +313,10 @@
     ///Basically a Timer can be either running or stopped,
     ///but it provides a bit finer control on the execution.
-    ///The \ref lemon::Timer "Timer" also counts the number of
-    ///\ref lemon::Timer::start() "start()" executions, and it stops
-    ///only after the same amount (or more) \ref lemon::Timer::stop()
-    ///"stop()"s. This can be useful e.g. to compute the running time
+    ///The \ref Timer also counts the number of \ref start()
+    ///executions, and is stops only after the same amount (or more)
+    ///\ref stop() "stop()"s. This can be useful e.g. to compute
+    ///the running time
     ///of recursive functions.
+    ///
 
     ///@{
@@ -472,5 +474,5 @@
   };
 
-  ///Same as Timer but prints a report on destruction.
+  ///Same as \ref Timer but prints a report on destruction.
 
   ///Same as \ref Timer but prints a report on destruction.
@@ -486,4 +488,5 @@
   ///\sa Timer
   ///\sa NoTimeReport
+  ///\todo There is no test case for this
   class TimeReport : public Timer
   {
@@ -491,13 +494,13 @@
     std::ostream &_os;
   public:
-    ///Constructor
-
-    ///Constructor.
+    ///\e
+
     ///\param title This text will be printed before the ellapsed time.
     ///\param os The stream to print the report to.
     ///\param run Sets whether the timer should start immediately.
+
     TimeReport(std::string title,std::ostream &os=std::cerr,bool run=true)
       : Timer(run), _title(title), _os(os){}
-    ///Destructor that prints the ellapsed time
+    ///\e Prints the ellapsed time on destruction.
     ~TimeReport()
     {
@@ -506,5 +509,5 @@
   };
 
-  ///'Do nothing' version of TimeReport
+  ///'Do nothing' version of \ref TimeReport
 
   ///\sa TimeReport
Index: lemon/tolerance.h
===================================================================
--- lemon/tolerance.h	(revision 280)
+++ lemon/tolerance.h	(revision 209)
@@ -25,4 +25,6 @@
 ///floating point numbers.
 ///
+///\todo It should be in a module like "Basic tools"
+
 
 namespace lemon {
Index: lemon/unionfind.h
===================================================================
--- lemon/unionfind.h	(revision 236)
+++ lemon/unionfind.h	(revision 220)
@@ -498,5 +498,5 @@
     }
 
-    /// \brief LEMON style iterator for the representant items.
+    /// \brief Lemon style iterator for the representant items.
     ///
     /// ClassIt is a lemon style iterator for the components. It iterates
@@ -550,5 +550,5 @@
     };
 
-    /// \brief LEMON style iterator for the items of a component.
+    /// \brief Lemon style iterator for the items of a component.
     ///
     /// ClassIt is a lemon style iterator for the components. It iterates
@@ -808,5 +808,5 @@
     }
 
-    /// \brief LEMON style iterator for the classes.
+    /// \brief Lemon style iterator for the classes.
     ///
     /// ClassIt is a lemon style iterator for the components. It iterates
@@ -860,5 +860,5 @@
     };
 
-    /// \brief LEMON style iterator for the items of a component.
+    /// \brief Lemon style iterator for the items of a component.
     ///
     /// ClassIt is a lemon style iterator for the components. It iterates
@@ -1656,5 +1656,5 @@
     }
 
-    /// \brief LEMON style iterator for the items of a class.
+    /// \brief Lemon style iterator for the items of a class.
     ///
     /// ClassIt is a lemon style iterator for the components. It iterates
Index: ripts/chg-len.py
===================================================================
--- scripts/chg-len.py	(revision 284)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#! /usr/bin/env python
-
-import sys
-import os
-
-if len(sys.argv)>1 and sys.argv[1] in ["-h","--help"]:
-    print """
-This utility just prints the length of the longest path
-in the revision graph from revison 0 to the current one.
-"""
-    exit(0)
-plist = os.popen("HGRCPATH='' hg parents --template='{rev}\n'").readlines()
-if len(plist)>1:
-    print "You are in the process of merging"
-    exit(1)
-PAR = int(plist[0])
-
-f = os.popen("HGRCPATH='' hg log -r 0:tip --template='{rev} {parents}\n'").\
-    readlines()
-REV = -1
-lengths=[]
-for l in f:
-    REV+=1
-    s = l.split()
-    rev = int(s[0])
-    if REV != rev:
-        print "Something is seriously wrong"
-        exit(1)
-    if len(s) == 1:
-        par1 = par2 = rev - 1
-    elif len(s) == 2:
-        par1 = par2 = int(s[1].split(":")[0])
-    else:
-        par1 = int(s[1].split(":")[0])
-        par2 = int(s[2].split(":")[0])
-    if rev == 0:
-        lengths.append(0)
-    else:
-        lengths.append(max(lengths[par1],lengths[par2])+1)
-print lengths[PAR]
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 225)
+++ test/CMakeLists.txt	(revision 203)
@@ -1,7 +1,7 @@
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+include_directories (${LEMON_SOURCE_DIR})
 
-LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
+link_directories (${LEMON_BINARY_DIR}/lemon)
 
-SET(TESTS
+set (TESTS
   bfs_test
   counter_test
@@ -17,12 +17,12 @@
   kruskal_test
   maps_test
+  path_test
   random_test
-  path_test
   time_measure_test
   unionfind_test)
 
-FOREACH(TEST_NAME ${TESTS})
-  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
-  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
-  ADD_TEST(${TEST_NAME} ${TEST_NAME})
-ENDFOREACH(TEST_NAME)
+foreach (TEST_NAME ${TESTS})
+  add_executable (${TEST_NAME} ${TEST_NAME}.cc)
+  target_link_libraries (${TEST_NAME} lemon)
+  add_test(${TEST_NAME} ${TEST_NAME})
+endforeach (TEST_NAME)
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 228)
+++ test/Makefile.am	(revision 203)
@@ -4,4 +4,5 @@
 noinst_HEADERS += \
 	test/graph_test.h \
+	test/graph_maps_test.h \
         test/test_tools.h
 
Index: test/bfs_test.cc
===================================================================
--- test/bfs_test.cc	(revision 293)
+++ test/bfs_test.cc	(revision 222)
@@ -20,5 +20,4 @@
 #include <lemon/smart_graph.h>
 #include <lemon/list_graph.h>
-#include <lemon/lgf_reader.h>
 #include <lemon/bfs.h>
 #include <lemon/path.h>
@@ -29,76 +28,31 @@
 using namespace lemon;
 
-char test_lgf[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "@arcs\n"
-  "     label\n"
-  "0 1  0\n"
-  "1 2  1\n"
-  "2 3  2\n"
-  "3 4  3\n"
-  "0 3  4\n"
-  "0 3  5\n"
-  "5 2  6\n"
-  "@attributes\n"
-  "source 0\n"
-  "target 4\n";
-
 void checkBfsCompile()
 {
   typedef concepts::Digraph Digraph;
   typedef Bfs<Digraph> BType;
-  typedef Digraph::Node Node;
-  typedef Digraph::Arc Arc;
 
   Digraph G;
-  Node s, t;
-  Arc e;
+  Digraph::Node n;
+  Digraph::Arc e;
   int l;
   bool b;
   BType::DistMap d(G);
   BType::PredMap p(G);
-  Path<Digraph> pp;
+  //  BType::PredNodeMap pn(G);
 
-  {
-    BType bfs_test(G);
+  BType bfs_test(G);
 
-    bfs_test.run(s);
-    bfs_test.run(s,t);
-    bfs_test.run();
+  bfs_test.run(n);
 
-    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);
-  }
-  {
-    BType
-      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
-      ::SetDistMap<concepts::ReadWriteMap<Node,int> >
-      ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
-      ::Create bfs_test(G);
+  l  = bfs_test.dist(n);
+  e  = bfs_test.predArc(n);
+  n  = bfs_test.predNode(n);
+  d  = bfs_test.distMap();
+  p  = bfs_test.predMap();
+  //  pn = bfs_test.predNodeMap();
+  b  = bfs_test.reached(n);
 
-    bfs_test.run(s);
-    bfs_test.run(s,t);
-    bfs_test.run();
-
-    l  = bfs_test.dist(t);
-    e  = bfs_test.predArc(t);
-    s  = bfs_test.predNode(t);
-    b  = bfs_test.reached(t);
-    pp = bfs_test.path(t);
-  }
+  Path<Digraph> pp = bfs_test.path(n);
 }
 
@@ -111,28 +65,12 @@
 
   Digraph g;
-  bool b;
-  bfs(g).run(Node());
-  b=bfs(g).run(Node(),Node());
-  bfs(g).run();
+  bfs(g,Node()).run();
+  bfs(g).source(Node()).run();
   bfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
+    .predMap(concepts::WriteMap<Node,Arc>())
+    .distMap(concepts::WriteMap<Node,VType>())
     .reachedMap(concepts::ReadWriteMap<Node,bool>())
     .processedMap(concepts::WriteMap<Node,bool>())
     .run(Node());
-  b=bfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .reachedMap(concepts::ReadWriteMap<Node,bool>())
-    .processedMap(concepts::WriteMap<Node,bool>())
-    .path(concepts::Path<Digraph>())
-    .dist(VType())
-    .run(Node(),Node());
-  bfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .reachedMap(concepts::ReadWriteMap<Node,bool>())
-    .processedMap(concepts::WriteMap<Node,bool>())
-    .run();
 }
 
@@ -143,18 +81,16 @@
   Digraph G;
   Node s, t;
+  PetStruct<Digraph> ps = addPetersen(G, 5);
 
-  std::istringstream input(test_lgf);
-  digraphReader(G, input).
-    node("source", s).
-    node("target", t).
-    run();
+  s=ps.outer[2];
+  t=ps.inner[0];
 
   Bfs<Digraph> bfs_test(G);
   bfs_test.run(s);
 
-  check(bfs_test.dist(t)==2,"Bfs found a wrong path.");
+  check(bfs_test.dist(t)==3,"Bfs found a wrong path." << bfs_test.dist(t));
 
   Path<Digraph> p = bfs_test.path(t);
-  check(p.length()==2,"path() found a wrong path.");
+  check(p.length()==3,"path() found a wrong path.");
   check(checkPath(G, p),"path() found a wrong path.");
   check(pathSource(G, p) == s,"path() found a wrong path.");
@@ -162,29 +98,23 @@
 
 
-  for(ArcIt a(G); a!=INVALID; ++a) {
-    Node u=G.source(a);
-    Node v=G.target(a);
+  for(ArcIt e(G); e!=INVALID; ++e) {
+    Node u=G.source(e);
+    Node v=G.target(e);
     check( !bfs_test.reached(u) ||
            (bfs_test.dist(v) <= bfs_test.dist(u)+1),
-           "Wrong output. " << G.id(u) << "->" << G.id(v));
+           "Wrong output.");
   }
 
   for(NodeIt v(G); v!=INVALID; ++v) {
-    if (bfs_test.reached(v)) {
-      check(v==s || bfs_test.predArc(v)!=INVALID, "Wrong tree.");
-      if (bfs_test.predArc(v)!=INVALID ) {
-        Arc a=bfs_test.predArc(v);
-        Node u=G.source(a);
-        check(u==bfs_test.predNode(v),"Wrong tree.");
-        check(bfs_test.dist(v) - bfs_test.dist(u) == 1,
-              "Wrong distance. Difference: "
-              << std::abs(bfs_test.dist(v) - bfs_test.dist(u) - 1));
-      }
+    check(bfs_test.reached(v),"Each node should be reached.");
+    if ( bfs_test.predArc(v)!=INVALID ) {
+      Arc e=bfs_test.predArc(v);
+      Node u=G.source(e);
+      check(u==bfs_test.predNode(v),"Wrong tree.");
+      check(bfs_test.dist(v) - bfs_test.dist(u) == 1,
+            "Wrong distance. Difference: "
+            << std::abs(bfs_test.dist(v) - bfs_test.dist(u)
+                        - 1));
     }
-  }
-
-  {
-    NullMap<Node,Arc> myPredMap;
-    bfs(G).predMap(myPredMap).run(s);
   }
 }
Index: test/dfs_test.cc
===================================================================
--- test/dfs_test.cc	(revision 293)
+++ test/dfs_test.cc	(revision 209)
@@ -20,5 +20,4 @@
 #include <lemon/smart_graph.h>
 #include <lemon/list_graph.h>
-#include <lemon/lgf_reader.h>
 #include <lemon/dfs.h>
 #include <lemon/path.h>
@@ -29,78 +28,31 @@
 using namespace lemon;
 
-char test_lgf[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "@arcs\n"
-  "     label\n"
-  "0 1  0\n"
-  "1 2  1\n"
-  "2 3  2\n"
-  "1 4  3\n"
-  "4 2  4\n"
-  "4 5  5\n"
-  "5 0  6\n"
-  "6 3  7\n"
-  "@attributes\n"
-  "source 0\n"
-  "target 5\n";
-
 void checkDfsCompile()
 {
   typedef concepts::Digraph Digraph;
   typedef Dfs<Digraph> DType;
-  typedef Digraph::Node Node;
-  typedef Digraph::Arc Arc;
 
   Digraph G;
-  Node s, t;
-  Arc e;
+  Digraph::Node n;
+  Digraph::Arc e;
   int l;
   bool b;
   DType::DistMap d(G);
   DType::PredMap p(G);
-  Path<Digraph> pp;
+  //  DType::PredNodeMap pn(G);
 
-  {
-    DType dfs_test(G);
+  DType dfs_test(G);
 
-    dfs_test.run(s);
-    dfs_test.run(s,t);
-    dfs_test.run();
+  dfs_test.run(n);
 
-    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);
-  }
-  {
-    DType
-      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
-      ::SetDistMap<concepts::ReadWriteMap<Node,int> >
-      ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
-      ::Create dfs_test(G);
+  l  = dfs_test.dist(n);
+  e  = dfs_test.predArc(n);
+  n  = dfs_test.predNode(n);
+  d  = dfs_test.distMap();
+  p  = dfs_test.predMap();
+  //  pn = dfs_test.predNodeMap();
+  b  = dfs_test.reached(n);
 
-    dfs_test.run(s);
-    dfs_test.run(s,t);
-    dfs_test.run();
-
-    l  = dfs_test.dist(t);
-    e  = dfs_test.predArc(t);
-    s  = dfs_test.predNode(t);
-    b  = dfs_test.reached(t);
-    pp = dfs_test.path(t);
-  }
+  Path<Digraph> pp = dfs_test.path(n);
 }
 
@@ -113,28 +65,12 @@
 
   Digraph g;
-  bool b;
-  dfs(g).run(Node());
-  b=dfs(g).run(Node(),Node());
-  dfs(g).run();
+  dfs(g,Node()).run();
+  dfs(g).source(Node()).run();
   dfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
+    .predMap(concepts::WriteMap<Node,Arc>())
+    .distMap(concepts::WriteMap<Node,VType>())
     .reachedMap(concepts::ReadWriteMap<Node,bool>())
     .processedMap(concepts::WriteMap<Node,bool>())
     .run(Node());
-  b=dfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .reachedMap(concepts::ReadWriteMap<Node,bool>())
-    .processedMap(concepts::WriteMap<Node,bool>())
-    .path(concepts::Path<Digraph>())
-    .dist(VType())
-    .run(Node(),Node());
-  dfs(g)
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .reachedMap(concepts::ReadWriteMap<Node,bool>())
-    .processedMap(concepts::WriteMap<Node,bool>())
-    .run();
 }
 
@@ -145,10 +81,8 @@
   Digraph G;
   Node s, t;
+  PetStruct<Digraph> ps = addPetersen(G, 5);
 
-  std::istringstream input(test_lgf);
-  digraphReader(G, input).
-    node("source", s).
-    node("target", t).
-    run();
+  s=ps.outer[2];
+  t=ps.inner[0];
 
   Dfs<Digraph> dfs_test(G);
@@ -162,20 +96,13 @@
 
   for(NodeIt v(G); v!=INVALID; ++v) {
-    if (dfs_test.reached(v)) {
-      check(v==s || dfs_test.predArc(v)!=INVALID, "Wrong tree.");
-      if (dfs_test.predArc(v)!=INVALID ) {
-        Arc e=dfs_test.predArc(v);
-        Node u=G.source(e);
-        check(u==dfs_test.predNode(v),"Wrong tree.");
-        check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
-              "Wrong distance. (" << dfs_test.dist(u) << "->"
-              << dfs_test.dist(v) << ")");
-      }
+    check(dfs_test.reached(v),"Each node should be reached.");
+    if ( dfs_test.predArc(v)!=INVALID ) {
+      Arc e=dfs_test.predArc(v);
+      Node u=G.source(e);
+      check(u==dfs_test.predNode(v),"Wrong tree.");
+      check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
+            "Wrong distance. (" << dfs_test.dist(u) << "->"
+            <<dfs_test.dist(v) << ')');
     }
-  }
-
-  {
-    NullMap<Node,Arc> myPredMap;
-    dfs(G).predMap(myPredMap).run(s);
   }
 }
Index: test/digraph_test.cc
===================================================================
--- test/digraph_test.cc	(revision 228)
+++ test/digraph_test.cc	(revision 209)
@@ -25,61 +25,10 @@
 #include "test_tools.h"
 #include "graph_test.h"
+#include "graph_maps_test.h"
 
 using namespace lemon;
 using namespace lemon::concepts;
 
-template <class Digraph>
-void checkDigraph() {
-  TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
-  Digraph G;
-
-  checkGraphNodeList(G, 0);
-  checkGraphArcList(G, 0);
-
-  Node
-    n1 = G.addNode(),
-    n2 = G.addNode(),
-    n3 = G.addNode();
-  checkGraphNodeList(G, 3);
-  checkGraphArcList(G, 0);
-
-  Arc a1 = G.addArc(n1, n2);
-  check(G.source(a1) == n1 && G.target(a1) == n2, "Wrong arc");
-  checkGraphNodeList(G, 3);
-  checkGraphArcList(G, 1);
-
-  checkGraphOutArcList(G, n1, 1);
-  checkGraphOutArcList(G, n2, 0);
-  checkGraphOutArcList(G, n3, 0);
-
-  checkGraphInArcList(G, n1, 0);
-  checkGraphInArcList(G, n2, 1);
-  checkGraphInArcList(G, n3, 0);
-
-  checkGraphConArcList(G, 1);
-
-  Arc a2 = G.addArc(n2, n1), a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
-  checkGraphNodeList(G, 3);
-  checkGraphArcList(G, 4);
-
-  checkGraphOutArcList(G, n1, 1);
-  checkGraphOutArcList(G, n2, 3);
-  checkGraphOutArcList(G, n3, 0);
-
-  checkGraphInArcList(G, n1, 1);
-  checkGraphInArcList(G, n2, 1);
-  checkGraphInArcList(G, n3, 2);
-
-  checkGraphConArcList(G, 4);
-
-  checkNodeIds(G);
-  checkArcIds(G);
-  checkGraphNodeMap(G);
-  checkGraphArcMap(G);
-
-}
-
-
-void checkConcepts() {
+void check_concepts() {
   { // Checking digraph components
     checkConcept<BaseDigraphComponent, BaseDigraphComponent >();
@@ -103,4 +52,5 @@
     checkConcept<ClearableDigraphComponent<>, ListDigraph>();
     checkConcept<ErasableDigraphComponent<>, ListDigraph>();
+    checkDigraphIterators<ListDigraph>();
   }
   { // Checking SmartDigraph
@@ -109,15 +59,18 @@
     checkConcept<ExtendableDigraphComponent<>, SmartDigraph>();
     checkConcept<ClearableDigraphComponent<>, SmartDigraph>();
+    checkDigraphIterators<SmartDigraph>();
   }
 //  { // Checking FullDigraph
 //    checkConcept<Digraph, FullDigraph>();
+//    checkDigraphIterators<FullDigraph>();
 //  }
 //  { // Checking HyperCubeDigraph
 //    checkConcept<Digraph, HyperCubeDigraph>();
+//    checkDigraphIterators<HyperCubeDigraph>();
 //  }
 }
 
 template <typename Digraph>
-void checkDigraphValidity() {
+void check_graph_validity() {
   TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   Digraph g;
@@ -140,5 +93,5 @@
 
 template <typename Digraph>
-void checkDigraphValidityErase() {
+void check_graph_validity_erase() {
   TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   Digraph g;
@@ -168,18 +121,24 @@
 }
 
-void checkDigraphs() {
+void check_digraphs() {
   { // Checking ListDigraph
     checkDigraph<ListDigraph>();
-    checkDigraphValidityErase<ListDigraph>();
+    checkGraphNodeMap<ListDigraph>();
+    checkGraphArcMap<ListDigraph>();
+
+    check_graph_validity_erase<ListDigraph>();
   }
   { // Checking SmartDigraph
     checkDigraph<SmartDigraph>();
-    checkDigraphValidity<SmartDigraph>();
+    checkGraphNodeMap<SmartDigraph>();
+    checkGraphArcMap<SmartDigraph>();
+
+    check_graph_validity<SmartDigraph>();
   }
 }
 
 int main() {
-  checkDigraphs();
-  checkConcepts();
+  check_concepts();
+  check_digraphs();
   return 0;
 }
Index: test/dijkstra_test.cc
===================================================================
--- test/dijkstra_test.cc	(revision 293)
+++ test/dijkstra_test.cc	(revision 220)
@@ -20,8 +20,6 @@
 #include <lemon/smart_graph.h>
 #include <lemon/list_graph.h>
-#include <lemon/lgf_reader.h>
 #include <lemon/dijkstra.h>
 #include <lemon/path.h>
-#include <lemon/bin_heap.h>
 
 #include "graph_test.h"
@@ -29,25 +27,4 @@
 
 using namespace lemon;
-
-char test_lgf[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "@arcs\n"
-  "     label length\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 checkDijkstraCompile()
@@ -57,52 +34,28 @@
   typedef concepts::ReadMap<Digraph::Arc,VType> LengthMap;
   typedef Dijkstra<Digraph, LengthMap> DType;
-  typedef Digraph::Node Node;
-  typedef Digraph::Arc Arc;
 
   Digraph G;
-  Node s, t;
-  Arc e;
+  Digraph::Node n;
+  Digraph::Arc e;
   VType l;
   bool b;
   DType::DistMap d(G);
   DType::PredMap p(G);
+  //  DType::PredNodeMap pn(G);
   LengthMap length;
-  Path<Digraph> pp;
 
-  {
-    DType dijkstra_test(G,length);
+  DType dijkstra_test(G,length);
 
-    dijkstra_test.run(s);
-    dijkstra_test.run(s,t);
+  dijkstra_test.run(n);
 
-    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);
-  }
-  {
-    DType
-      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
-      ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
-      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
-      ::SetStandardProcessedMap
-      ::SetOperationTraits<DijkstraWidestPathOperationTraits<VType> >
-      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
-      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
-      ::Create dijkstra_test(G,length);
+  l  = dijkstra_test.dist(n);
+  e  = dijkstra_test.predArc(n);
+  n  = dijkstra_test.predNode(n);
+  d  = dijkstra_test.distMap();
+  p  = dijkstra_test.predMap();
+  //  pn = dijkstra_test.predNodeMap();
+  b  = dijkstra_test.reached(n);
 
-    dijkstra_test.run(s);
-    dijkstra_test.run(s,t);
-
-    l  = dijkstra_test.dist(t);
-    e  = dijkstra_test.predArc(t);
-    s  = dijkstra_test.predNode(t);
-    b  = dijkstra_test.reached(t);
-    pp = dijkstra_test.path(t);
-  }
-
+  Path<Digraph> pp = dijkstra_test.path(n);
 }
 
@@ -116,19 +69,10 @@
 
   Digraph g;
-  bool b;
-  dijkstra(g,LengthMap()).run(Node());
-  b=dijkstra(g,LengthMap()).run(Node(),Node());
+  dijkstra(g,LengthMap(),Node()).run();
+  dijkstra(g,LengthMap()).source(Node()).run();
   dijkstra(g,LengthMap())
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .processedMap(concepts::WriteMap<Node,bool>())
+    .predMap(concepts::WriteMap<Node,Arc>())
+    .distMap(concepts::WriteMap<Node,VType>())
     .run(Node());
-  b=dijkstra(g,LengthMap())
-    .predMap(concepts::ReadWriteMap<Node,Arc>())
-    .distMap(concepts::ReadWriteMap<Node,VType>())
-    .processedMap(concepts::WriteMap<Node,bool>())
-    .path(concepts::Path<Digraph>())
-    .dist(VType())
-    .run(Node(),Node());
 }
 
@@ -141,11 +85,13 @@
   Node s, t;
   LengthMap length(G);
+  PetStruct<Digraph> ps = addPetersen(G, 5);
 
-  std::istringstream input(test_lgf);
-  digraphReader(G, input).
-    arcMap("length", length).
-    node("source", s).
-    node("target", t).
-    run();
+  for(int i=0;i<5;i++) {
+    length[ps.outcir[i]]=4;
+    length[ps.incir[i]]=1;
+    length[ps.chords[i]]=10;
+  }
+  s=ps.outer[0];
+  t=ps.inner[1];
 
   Dijkstra<Digraph, LengthMap>
@@ -153,8 +99,8 @@
   dijkstra_test.run(s);
 
-  check(dijkstra_test.dist(t)==3,"Dijkstra found a wrong path.");
+  check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
 
   Path<Digraph> p = dijkstra_test.path(t);
-  check(p.length()==3,"path() found a wrong path.");
+  check(p.length()==4,"getPath() found a wrong path.");
   check(checkPath(G, p),"path() found a wrong path.");
   check(pathSource(G, p) == s,"path() found a wrong path.");
@@ -166,19 +112,17 @@
     check( !dijkstra_test.reached(u) ||
            (dijkstra_test.dist(v) - dijkstra_test.dist(u) <= length[e]),
-           "Wrong output. dist(target)-dist(source)-arc_length=" <<
+           "dist(target)-dist(source)-arc_length= " <<
            dijkstra_test.dist(v) - dijkstra_test.dist(u) - length[e]);
   }
 
-  for(NodeIt v(G); v!=INVALID; ++v) {
-    if (dijkstra_test.reached(v)) {
-      check(v==s || dijkstra_test.predArc(v)!=INVALID, "Wrong tree.");
-      if (dijkstra_test.predArc(v)!=INVALID ) {
-        Arc e=dijkstra_test.predArc(v);
-        Node u=G.source(e);
-        check(u==dijkstra_test.predNode(v),"Wrong tree.");
-        check(dijkstra_test.dist(v) - dijkstra_test.dist(u) == length[e],
-              "Wrong distance! Difference: " <<
-              std::abs(dijkstra_test.dist(v)-dijkstra_test.dist(u)-length[e]));
-      }
+  for(NodeIt v(G); v!=INVALID; ++v){
+    check(dijkstra_test.reached(v),"Each node should be reached.");
+    if ( dijkstra_test.predArc(v)!=INVALID ) {
+      Arc e=dijkstra_test.predArc(v);
+      Node u=G.source(e);
+      check(u==dijkstra_test.predNode(v),"Wrong tree.");
+      check(dijkstra_test.dist(v) - dijkstra_test.dist(u) == length[e],
+            "Wrong distance! Difference: " <<
+            std::abs(dijkstra_test.dist(v)-dijkstra_test.dist(u)-length[e]));
     }
   }
Index: test/dim_test.cc
===================================================================
--- test/dim_test.cc	(revision 253)
+++ test/dim_test.cc	(revision 209)
@@ -51,36 +51,32 @@
   check(p.x==1 && p.y==2, "Wrong dim2::Point division by a scalar.");
 
-  typedef dim2::Box<int> Box;
-  Box box1;
-  check(box1.empty(), "Wrong empty() in dim2::Box.");
+  typedef dim2::BoundingBox<int> BB;
+  BB box1;
+  check(box1.empty(), "Wrong empty() in dim2::BoundingBox.");
 
   box1.add(a);
-  check(!box1.empty(), "Wrong empty() in dim2::Box.");
+  check(!box1.empty(), "Wrong empty() in dim2::BoundingBox.");
   box1.add(b);
 
-  check(box1.left()==1 && box1.bottom()==2 &&
-        box1.right()==3 && box1.top()==4,
-        "Wrong addition of points to dim2::Box.");
+  check(box1.bottomLeft().x==1 &&
+        box1.bottomLeft().y==2 &&
+        box1.topRight().x==3 &&
+        box1.topRight().y==4,
+        "Wrong addition of points to dim2::BoundingBox.");
 
-  check(box1.inside(Point(2,3)), "Wrong inside() in dim2::Box.");
-  check(box1.inside(Point(1,3)), "Wrong inside() in dim2::Box.");
-  check(!box1.inside(Point(0,3)), "Wrong inside() in dim2::Box.");
+  p.x=2; p.y=3;
+  check(box1.inside(p), "Wrong inside() in dim2::BoundingBox.");
 
-  Box box2(Point(2,2));
-  check(!box2.empty(), "Wrong empty() in dim2::Box.");
+  p.x=1; p.y=3;
+  check(box1.inside(p), "Wrong inside() in dim2::BoundingBox.");
 
-  box2.bottomLeft(Point(2,0));
-  box2.topRight(Point(5,3));
-  Box box3 = box1 & box2;
-  check(!box3.empty() &&
-        box3.left()==2 && box3.bottom()==2 &&
-        box3.right()==3 && box3.top()==3,
-        "Wrong intersection of two dim2::Box objects.");
+  p.x=0; p.y=3;
+  check(!box1.inside(p), "Wrong inside() in dim2::BoundingBox.");
 
-  box1.add(box2);
-  check(!box1.empty() &&
-        box1.left()==1 && box1.bottom()==0 &&
-        box1.right()==5 && box1.top()==4,
-        "Wrong addition of two dim2::Box objects.");
+  BB box2(p);
+  check(!box2.empty(), "Wrong empty() in dim2::BoundingBox.");
+
+  box2.add(box1);
+  check(box2.inside(p), "Wrong inside() in dim2::BoundingBox.");
 
   return 0;
Index: test/error_test.cc
===================================================================
--- test/error_test.cc	(revision 277)
+++ test/error_test.cc	(revision 209)
@@ -32,8 +32,4 @@
 #endif
 
-#ifdef NDEBUG
-#undef NDEBUG
-#endif
-
 //checking disabled asserts
 #define LEMON_DISABLE_ASSERTS
@@ -48,7 +44,12 @@
 }
 
+void fixme_disable() {
+  LEMON_FIXME("fixme_disable() is fixme!");
+}
+
 void check_assertion_disable() {
   no_assertion_text_disable();
   assertion_text_disable();
+  fixme_disable();
 }
 #undef LEMON_DISABLE_ASSERTS
@@ -74,8 +75,13 @@
 }
 
+void fixme_custom() {
+  LEMON_FIXME("fixme_custom() is fixme!");
+}
+
 void check_assertion_custom() {
   no_assertion_text_custom();
   assertion_text_custom();
-  check(cnt == 1, "The custom assert handler does not work");
+  fixme_custom();
+  check(cnt == 2, "The custom assert handler does not work");
 }
 
Index: test/graph_copy_test.cc
===================================================================
--- test/graph_copy_test.cc	(revision 282)
+++ test/graph_copy_test.cc	(revision 220)
@@ -64,9 +64,9 @@
   ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
 
-  digraphCopy(from, to).
-    nodeMap(fnm, tnm).arcMap(fam, tam).
+  DigraphCopy<ListDigraph, SmartDigraph>(to, from).
+    nodeMap(tnm, fnm).arcMap(tam, fam).
     nodeRef(nr).arcRef(er).
     nodeCrossRef(ncr).arcCrossRef(ecr).
-    node(fn, tn).arc(fa, ta).run();
+    node(tn, fn).arc(ta, fa).run();
 
   for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
@@ -139,9 +139,9 @@
   ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
 
-  graphCopy(from, to).
-    nodeMap(fnm, tnm).arcMap(fam, tam).edgeMap(fem, tem).
+  GraphCopy<ListGraph, SmartGraph>(to, from).
+    nodeMap(tnm, fnm).arcMap(tam, fam).edgeMap(tem, fem).
     nodeRef(nr).arcRef(ar).edgeRef(er).
     nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr).
-    node(fn, tn).arc(fa, ta).edge(fe, te).run();
+    node(tn, fn).arc(ta, fa).edge(te, fe).run();
 
   for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
Index: test/graph_maps_test.h
===================================================================
--- test/graph_maps_test.h	(revision 209)
+++ test/graph_maps_test.h	(revision 209)
@@ -0,0 +1,144 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#ifndef LEMON_TEST_MAP_TEST_H
+#define LEMON_TEST_MAP_TEST_H
+
+#include <vector>
+#include <lemon/maps.h>
+
+#include "test_tools.h"
+
+namespace lemon {
+
+  template <typename Graph>
+  void checkGraphNodeMap() {
+    Graph graph;
+    const int num = 16;
+
+    typedef typename Graph::Node Node;
+
+    std::vector<Node> nodes;
+    for (int i = 0; i < num; ++i) {
+      nodes.push_back(graph.addNode());
+    }
+    typedef typename Graph::template NodeMap<int> IntNodeMap;
+    IntNodeMap map(graph, 42);
+    for (int i = 0; i < int(nodes.size()); ++i) {
+      check(map[nodes[i]] == 42, "Wrong map constructor.");
+    }
+    for (int i = 0; i < num; ++i) {
+      nodes.push_back(graph.addNode());
+      map[nodes.back()] = 23;
+      check(map[nodes.back()] == 23, "Wrong operator[].");
+    }
+    map = constMap<Node>(12);
+    for (int i = 0; i < int(nodes.size()); ++i) {
+      check(map[nodes[i]] == 12, "Wrong map constructor.");
+    }
+    graph.clear();
+    nodes.clear();
+  }
+
+  template <typename Graph>
+  void checkGraphArcMap() {
+    Graph graph;
+    const int num = 16;
+
+    typedef typename Graph::Node Node;
+    typedef typename Graph::Arc Arc;
+
+    std::vector<Node> nodes;
+    for (int i = 0; i < num; ++i) {
+      nodes.push_back(graph.addNode());
+    }
+
+    std::vector<Arc> arcs;
+    for (int i = 0; i < num; ++i) {
+      for (int j = 0; j < i; ++j) {
+        arcs.push_back(graph.addArc(nodes[i], nodes[j]));
+      }
+    }
+
+    typedef typename Graph::template ArcMap<int> IntArcMap;
+    IntArcMap map(graph, 42);
+
+    for (int i = 0; i < int(arcs.size()); ++i) {
+      check(map[arcs[i]] == 42, "Wrong map constructor.");
+    }
+
+    for (int i = 0; i < num; ++i) {
+      for (int j = i + 1; j < num; ++j) {
+        arcs.push_back(graph.addArc(nodes[i], nodes[j]));
+        map[arcs.back()] = 23;
+        check(map[arcs.back()] == 23, "Wrong operator[].");
+      }
+    }
+    map = constMap<Arc>(12);
+    for (int i = 0; i < int(arcs.size()); ++i) {
+      check(map[arcs[i]] == 12, "Wrong map constructor.");
+    }
+    graph.clear();
+    arcs.clear();
+  }
+
+  template <typename Graph>
+  void checkGraphEdgeMap() {
+    Graph graph;
+    const int num = 16;
+
+    typedef typename Graph::Node Node;
+    typedef typename Graph::Edge Edge;
+
+    std::vector<Node> nodes;
+    for (int i = 0; i < num; ++i) {
+      nodes.push_back(graph.addNode());
+    }
+
+    std::vector<Edge> edges;
+    for (int i = 0; i < num; ++i) {
+      for (int j = 0; j < i; ++j) {
+        edges.push_back(graph.addEdge(nodes[i], nodes[j]));
+      }
+    }
+
+    typedef typename Graph::template EdgeMap<int> IntEdgeMap;
+    IntEdgeMap map(graph, 42);
+
+    for (int i = 0; i < int(edges.size()); ++i) {
+      check(map[edges[i]] == 42, "Wrong map constructor.");
+    }
+
+    for (int i = 0; i < num; ++i) {
+      for (int j = i + 1; j < num; ++j) {
+        edges.push_back(graph.addEdge(nodes[i], nodes[j]));
+        map[edges.back()] = 23;
+        check(map[edges.back()] == 23, "Wrong operator[].");
+      }
+    }
+    map = constMap<Edge>(12);
+    for (int i = 0; i < int(edges.size()); ++i) {
+      check(map[edges[i]] == 12, "Wrong map constructor.");
+    }
+    graph.clear();
+    edges.clear();
+  }
+
+}
+
+#endif
Index: test/graph_test.cc
===================================================================
--- test/graph_test.cc	(revision 228)
+++ test/graph_test.cc	(revision 209)
@@ -25,76 +25,10 @@
 #include "test_tools.h"
 #include "graph_test.h"
+#include "graph_maps_test.h"
 
 using namespace lemon;
 using namespace lemon::concepts;
 
-template <class Graph>
-void checkGraph() {
-  TEMPLATE_GRAPH_TYPEDEFS(Graph);
-
-  Graph G;
-  checkGraphNodeList(G, 0);
-  checkGraphEdgeList(G, 0);
-
-  Node
-    n1 = G.addNode(),
-    n2 = G.addNode(),
-    n3 = G.addNode();
-  checkGraphNodeList(G, 3);
-  checkGraphEdgeList(G, 0);
-
-  Edge e1 = G.addEdge(n1, n2);
-  check((G.u(e1) == n1 && G.v(e1) == n2) || (G.u(e1) == n2 && G.v(e1) == n1),
-        "Wrong edge");
-  checkGraphNodeList(G, 3);
-  checkGraphArcList(G, 2);
-  checkGraphEdgeList(G, 1);
-
-  checkGraphOutArcList(G, n1, 1);
-  checkGraphOutArcList(G, n2, 1);
-  checkGraphOutArcList(G, n3, 0);
-
-  checkGraphInArcList(G, n1, 1);
-  checkGraphInArcList(G, n2, 1);
-  checkGraphInArcList(G, n3, 0);
-
-  checkGraphIncEdgeList(G, n1, 1);
-  checkGraphIncEdgeList(G, n2, 1);
-  checkGraphIncEdgeList(G, n3, 0);
-
-  checkGraphConArcList(G, 2);
-  checkGraphConEdgeList(G, 1);
-
-  Edge e2 = G.addEdge(n2, n1), e3 = G.addEdge(n2, n3);
-  checkGraphNodeList(G, 3);
-  checkGraphArcList(G, 6);
-  checkGraphEdgeList(G, 3);
-
-  checkGraphOutArcList(G, n1, 2);
-  checkGraphOutArcList(G, n2, 3);
-  checkGraphOutArcList(G, n3, 1);
-
-  checkGraphInArcList(G, n1, 2);
-  checkGraphInArcList(G, n2, 3);
-  checkGraphInArcList(G, n3, 1);
-
-  checkGraphIncEdgeList(G, n1, 2);
-  checkGraphIncEdgeList(G, n2, 3);
-  checkGraphIncEdgeList(G, n3, 1);
-
-  checkGraphConArcList(G, 6);
-  checkGraphConEdgeList(G, 3);
-
-  checkArcDirections(G);
-
-  checkNodeIds(G);
-  checkArcIds(G);
-  checkEdgeIds(G);
-  checkGraphNodeMap(G);
-  checkGraphArcMap(G);
-  checkGraphEdgeMap(G);
-}
-
-void checkConcepts() {
+void check_concepts() {
   { // Checking graph components
     checkConcept<BaseGraphComponent, BaseGraphComponent >();
@@ -118,4 +52,5 @@
     checkConcept<ClearableGraphComponent<>, ListGraph>();
     checkConcept<ErasableGraphComponent<>, ListGraph>();
+    checkGraphIterators<ListGraph>();
   }
   { // Checking SmartGraph
@@ -124,4 +59,5 @@
     checkConcept<ExtendableGraphComponent<>, SmartGraph>();
     checkConcept<ClearableGraphComponent<>, SmartGraph>();
+    checkGraphIterators<SmartGraph>();
   }
 //  { // Checking FullGraph
@@ -136,5 +72,5 @@
 
 template <typename Graph>
-void checkGraphValidity() {
+void check_graph_validity() {
   TEMPLATE_GRAPH_TYPEDEFS(Graph);
   Graph g;
@@ -159,5 +95,5 @@
 
 template <typename Graph>
-void checkGraphValidityErase() {
+void check_graph_validity_erase() {
   TEMPLATE_GRAPH_TYPEDEFS(Graph);
   Graph g;
@@ -233,12 +169,18 @@
 // }
 
-void checkGraphs() {
+void check_graphs() {
   { // Checking ListGraph
     checkGraph<ListGraph>();
-    checkGraphValidityErase<ListGraph>();
+    checkGraphNodeMap<ListGraph>();
+    checkGraphEdgeMap<ListGraph>();
+
+    check_graph_validity_erase<ListGraph>();
   }
   { // Checking SmartGraph
     checkGraph<SmartGraph>();
-    checkGraphValidity<SmartGraph>();
+    checkGraphNodeMap<SmartGraph>();
+    checkGraphEdgeMap<SmartGraph>();
+
+    check_graph_validity<SmartGraph>();
   }
 //   { // Checking FullGraph
@@ -256,6 +198,6 @@
 
 int main() {
-  checkConcepts();
-  checkGraphs();
+  check_concepts();
+  check_graphs();
   return 0;
 }
Index: test/graph_test.h
===================================================================
--- test/graph_test.h	(revision 263)
+++ test/graph_test.h	(revision 220)
@@ -20,9 +20,5 @@
 #define LEMON_TEST_GRAPH_TEST_H
 
-#include <set>
-
 #include <lemon/core.h>
-#include <lemon/maps.h>
-
 #include "test_tools.h"
 
@@ -47,8 +43,4 @@
     for(int i=0;i<cnt;i++) {
       check(e!=INVALID,"Wrong Arc list linking.");
-      check(G.oppositeNode(G.source(e), e) == G.target(e),
-            "Wrong opposite node");
-      check(G.oppositeNode(G.target(e), e) == G.source(e),
-            "Wrong opposite node");
       ++e;
     }
@@ -64,6 +56,4 @@
       check(e!=INVALID,"Wrong OutArc list linking.");
       check(n==G.source(e),"Wrong OutArc list linking.");
-      check(n==G.baseNode(e),"Wrong OutArc list linking.");
-      check(G.target(e)==G.runningNode(e),"Wrong OutArc list linking.");
       ++e;
     }
@@ -79,6 +69,4 @@
       check(e!=INVALID,"Wrong InArc list linking.");
       check(n==G.target(e),"Wrong InArc list linking.");
-      check(n==G.baseNode(e),"Wrong OutArc list linking.");
-      check(G.source(e)==G.runningNode(e),"Wrong OutArc list linking.");
       ++e;
     }
@@ -93,6 +81,4 @@
     for(int i=0;i<cnt;i++) {
       check(e!=INVALID,"Wrong Edge list linking.");
-      check(G.oppositeNode(G.u(e), e) == G.v(e), "Wrong opposite node");
-      check(G.oppositeNode(G.v(e), e) == G.u(e), "Wrong opposite node");
       ++e;
     }
@@ -108,7 +94,4 @@
       check(e!=INVALID,"Wrong IncEdge list linking.");
       check(n==G.u(e) || n==G.v(e),"Wrong IncEdge list linking.");
-      check(n==G.baseNode(e),"Wrong OutArc list linking.");
-      check(G.u(e)==G.runningNode(e) || G.v(e)==G.runningNode(e),
-            "Wrong OutArc list linking.");
       ++e;
     }
@@ -117,166 +100,161 @@
   }
 
+  template <class Digraph>
+  void checkDigraphIterators() {
+    typedef typename Digraph::Node Node;
+    typedef typename Digraph::NodeIt NodeIt;
+    typedef typename Digraph::Arc Arc;
+    typedef typename Digraph::ArcIt ArcIt;
+    typedef typename Digraph::InArcIt InArcIt;
+    typedef typename Digraph::OutArcIt OutArcIt;
+  }
+
   template <class Graph>
-  void checkGraphConArcList(const Graph &G, int cnt) {
-    int i = 0;
-    for (typename Graph::NodeIt u(G); u != INVALID; ++u) {
-      for (typename Graph::NodeIt v(G); v != INVALID; ++v) {
-        for (ConArcIt<Graph> a(G, u, v); a != INVALID; ++a) {
-          check(G.source(a) == u, "Wrong iterator.");
-          check(G.target(a) == v, "Wrong iterator.");
-          ++i;
-        }
-      }
-    }
-    check(cnt == i, "Wrong iterator.");
-  }
-
-  template <class Graph>
-  void checkGraphConEdgeList(const Graph &G, int cnt) {
-    int i = 0;
-    for (typename Graph::NodeIt u(G); u != INVALID; ++u) {
-      for (typename Graph::NodeIt v(G); v != INVALID; ++v) {
-        for (ConEdgeIt<Graph> e(G, u, v); e != INVALID; ++e) {
-          check((G.u(e) == u && G.v(e) == v) ||
-                (G.u(e) == v && G.v(e) == u), "Wrong iterator.");
-          i += u == v ? 2 : 1;
-        }
-      }
-    }
-    check(2 * cnt == i, "Wrong iterator.");
-  }
-
-  template <typename Graph>
-  void checkArcDirections(const Graph& G) {
-    for (typename Graph::ArcIt a(G); a != INVALID; ++a) {
-      check(G.source(a) == G.target(G.oppositeArc(a)), "Wrong direction");
-      check(G.target(a) == G.source(G.oppositeArc(a)), "Wrong direction");
-      check(G.direct(a, G.direction(a)) == a, "Wrong direction");
-    }
-  }
-
-  template <typename Graph>
-  void checkNodeIds(const Graph& G) {
-    std::set<int> values;
-    for (typename Graph::NodeIt n(G); n != INVALID; ++n) {
-      check(G.nodeFromId(G.id(n)) == n, "Wrong id");
-      check(values.find(G.id(n)) == values.end(), "Wrong id");
-      check(G.id(n) <= G.maxNodeId(), "Wrong maximum id");
-      values.insert(G.id(n));
-    }
-  }
-
-  template <typename Graph>
-  void checkArcIds(const Graph& G) {
-    std::set<int> values;
-    for (typename Graph::ArcIt a(G); a != INVALID; ++a) {
-      check(G.arcFromId(G.id(a)) == a, "Wrong id");
-      check(values.find(G.id(a)) == values.end(), "Wrong id");
-      check(G.id(a) <= G.maxArcId(), "Wrong maximum id");
-      values.insert(G.id(a));
-    }
-  }
-
-  template <typename Graph>
-  void checkEdgeIds(const Graph& G) {
-    std::set<int> values;
-    for (typename Graph::EdgeIt e(G); e != INVALID; ++e) {
-      check(G.edgeFromId(G.id(e)) == e, "Wrong id");
-      check(values.find(G.id(e)) == values.end(), "Wrong id");
-      check(G.id(e) <= G.maxEdgeId(), "Wrong maximum id");
-      values.insert(G.id(e));
-    }
-  }
-
-  template <typename Graph>
-  void checkGraphNodeMap(const Graph& G) {
-    typedef typename Graph::Node Node;
-    typedef typename Graph::NodeIt NodeIt;
-
-    typedef typename Graph::template NodeMap<int> IntNodeMap;
-    IntNodeMap map(G, 42);
-    for (NodeIt it(G); it != INVALID; ++it) {
-      check(map[it] == 42, "Wrong map constructor.");
-    }
-    int s = 0;
-    for (NodeIt it(G); it != INVALID; ++it) {
-      map[it] = 0;
-      check(map[it] == 0, "Wrong operator[].");
-      map.set(it, s);
-      check(map[it] == s, "Wrong set.");
-      ++s;
-    }
-    s = s * (s - 1) / 2;
-    for (NodeIt it(G); it != INVALID; ++it) {
-      s -= map[it];
-    }
-    check(s == 0, "Wrong sum.");
-
-    // map = constMap<Node>(12);
-    // for (NodeIt it(G); it != INVALID; ++it) {
-    //   check(map[it] == 12, "Wrong operator[].");
-    // }
-  }
-
-  template <typename Graph>
-  void checkGraphArcMap(const Graph& G) {
-    typedef typename Graph::Arc Arc;
-    typedef typename Graph::ArcIt ArcIt;
-
-    typedef typename Graph::template ArcMap<int> IntArcMap;
-    IntArcMap map(G, 42);
-    for (ArcIt it(G); it != INVALID; ++it) {
-      check(map[it] == 42, "Wrong map constructor.");
-    }
-    int s = 0;
-    for (ArcIt it(G); it != INVALID; ++it) {
-      map[it] = 0;
-      check(map[it] == 0, "Wrong operator[].");
-      map.set(it, s);
-      check(map[it] == s, "Wrong set.");
-      ++s;
-    }
-    s = s * (s - 1) / 2;
-    for (ArcIt it(G); it != INVALID; ++it) {
-      s -= map[it];
-    }
-    check(s == 0, "Wrong sum.");
-
-    // map = constMap<Arc>(12);
-    // for (ArcIt it(G); it != INVALID; ++it) {
-    //   check(map[it] == 12, "Wrong operator[].");
-    // }
-  }
-
-  template <typename Graph>
-  void checkGraphEdgeMap(const Graph& G) {
+  void checkGraphIterators() {
+    checkDigraphIterators<Graph>();
     typedef typename Graph::Edge Edge;
     typedef typename Graph::EdgeIt EdgeIt;
-
-    typedef typename Graph::template EdgeMap<int> IntEdgeMap;
-    IntEdgeMap map(G, 42);
-    for (EdgeIt it(G); it != INVALID; ++it) {
-      check(map[it] == 42, "Wrong map constructor.");
-    }
-    int s = 0;
-    for (EdgeIt it(G); it != INVALID; ++it) {
-      map[it] = 0;
-      check(map[it] == 0, "Wrong operator[].");
-      map.set(it, s);
-      check(map[it] == s, "Wrong set.");
-      ++s;
-    }
-    s = s * (s - 1) / 2;
-    for (EdgeIt it(G); it != INVALID; ++it) {
-      s -= map[it];
-    }
-    check(s == 0, "Wrong sum.");
-
-    // map = constMap<Edge>(12);
-    // for (EdgeIt it(G); it != INVALID; ++it) {
-    //   check(map[it] == 12, "Wrong operator[].");
-    // }
-  }
-
+    typedef typename Graph::IncEdgeIt IncEdgeIt;
+  }
+
+  // Structure returned by addPetersen()
+  template<class Digraph>
+  struct PetStruct
+  {
+    // Vector containing the outer nodes
+    std::vector<typename Digraph::Node> outer;
+    // Vector containing the inner nodes
+    std::vector<typename Digraph::Node> inner;
+    // Vector containing the arcs of the inner circle
+    std::vector<typename Digraph::Arc> incir;
+    // Vector containing the arcs of the outer circle
+    std::vector<typename Digraph::Arc> outcir;
+    // Vector containing the chord arcs
+    std::vector<typename Digraph::Arc> chords;
+  };
+
+  // Adds the reverse pair of all arcs to a digraph
+  template<class Digraph>
+  void bidirDigraph(Digraph &G)
+  {
+    typedef typename Digraph::Arc Arc;
+    typedef typename Digraph::ArcIt ArcIt;
+
+    std::vector<Arc> ee;
+
+    for(ArcIt e(G);e!=INVALID;++e) ee.push_back(e);
+
+    for(int i=0;i<int(ee.size());++i)
+      G.addArc(G.target(ee[i]),G.source(ee[i]));
+  }
+
+  // Adds a Petersen digraph to G.
+  // Returns the nodes and arcs of the generated digraph.
+  template<typename Digraph>
+  PetStruct<Digraph> addPetersen(Digraph &G,int num = 5)
+  {
+    PetStruct<Digraph> n;
+
+    for(int i=0;i<num;i++) {
+      n.outer.push_back(G.addNode());
+      n.inner.push_back(G.addNode());
+    }
+
+    for(int i=0;i<num;i++) {
+      n.chords.push_back(G.addArc(n.outer[i],n.inner[i]));
+      n.outcir.push_back(G.addArc(n.outer[i],n.outer[(i+1) % num]));
+      n.incir.push_back(G.addArc(n.inner[i],n.inner[(i+2) % num]));
+    }
+
+    return n;
+  }
+
+  // Checks the bidirectioned Petersen digraph
+  template<class Digraph>
+  void checkBidirPetersen(const Digraph &G, int num = 5)
+  {
+    typedef typename Digraph::NodeIt NodeIt;
+
+    checkGraphNodeList(G, 2 * num);
+    checkGraphArcList(G, 6 * num);
+
+    for(NodeIt n(G);n!=INVALID;++n) {
+      checkGraphInArcList(G, n, 3);
+      checkGraphOutArcList(G, n, 3);
+    }
+  }
+
+  // Structure returned by addUPetersen()
+  template<class Graph>
+  struct UPetStruct
+  {
+    // Vector containing the outer nodes
+    std::vector<typename Graph::Node> outer;
+    // Vector containing the inner nodes
+    std::vector<typename Graph::Node> inner;
+    // Vector containing the edges of the inner circle
+    std::vector<typename Graph::Edge> incir;
+    // Vector containing the edges of the outer circle
+    std::vector<typename Graph::Edge> outcir;
+    // Vector containing the chord edges
+    std::vector<typename Graph::Edge> chords;
+  };
+
+  // Adds a Petersen graph to \c G.
+  // Returns the nodes and edges of the generated graph.
+  template<typename Graph>
+  UPetStruct<Graph> addUPetersen(Graph &G,int num=5)
+  {
+    UPetStruct<Graph> n;
+
+    for(int i=0;i<num;i++) {
+      n.outer.push_back(G.addNode());
+      n.inner.push_back(G.addNode());
+    }
+
+    for(int i=0;i<num;i++) {
+      n.chords.push_back(G.addEdge(n.outer[i],n.inner[i]));
+      n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%num]));
+      n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%num]));
+    }
+
+    return n;
+  }
+
+  // Checks the undirected Petersen graph
+  template<class Graph>
+  void checkUndirPetersen(const Graph &G, int num = 5)
+  {
+    typedef typename Graph::NodeIt NodeIt;
+
+    checkGraphNodeList(G, 2 * num);
+    checkGraphEdgeList(G, 3 * num);
+    checkGraphArcList(G, 6 * num);
+
+    for(NodeIt n(G);n!=INVALID;++n) {
+      checkGraphIncEdgeList(G, n, 3);
+    }
+  }
+
+  template <class Digraph>
+  void checkDigraph() {
+    const int num = 5;
+    Digraph G;
+    checkGraphNodeList(G, 0);
+    checkGraphArcList(G, 0);
+    addPetersen(G, num);
+    bidirDigraph(G);
+    checkBidirPetersen(G, num);
+  }
+
+  template <class Graph>
+  void checkGraph() {
+    const int num = 5;
+    Graph G;
+    checkGraphNodeList(G, 0);
+    checkGraphEdgeList(G, 0);
+    addUPetersen(G, num);
+    checkUndirPetersen(G, num);
+  }
 
 } //namespace lemon
Index: test/graph_utils_test.cc
===================================================================
--- test/graph_utils_test.cc	(revision 301)
+++ test/graph_utils_test.cc	(revision 220)
@@ -36,10 +36,9 @@
   {
     Digraph digraph;
-    typename Digraph::template NodeMap<int> nodes(digraph);
-    std::vector<Node> invNodes;
     for (int i = 0; i < 10; ++i) {
-      invNodes.push_back(digraph.addNode());
-      nodes[invNodes.back()]=invNodes.size()-1;
-    }
+      digraph.addNode();
+    }
+    DescriptorMap<Digraph, Node> nodes(digraph);
+    typename DescriptorMap<Digraph, Node>::InverseMap invNodes(nodes);
     for (int i = 0; i < 100; ++i) {
       int src = rnd[invNodes.size()];
@@ -48,4 +47,5 @@
     }
     typename Digraph::template ArcMap<bool> found(digraph, false);
+    DescriptorMap<Digraph, Arc> arcs(digraph);
     for (NodeIt src(digraph); src != INVALID; ++src) {
       for (NodeIt trg(digraph); trg != INVALID; ++trg) {
@@ -111,10 +111,9 @@
   TEMPLATE_GRAPH_TYPEDEFS(Graph);
   Graph graph;
-  typename Graph::template NodeMap<int> nodes(graph);
-  std::vector<Node> invNodes;
   for (int i = 0; i < 10; ++i) {
-    invNodes.push_back(graph.addNode());
-    nodes[invNodes.back()]=invNodes.size()-1;
-  }
+    graph.addNode();
+  }
+  DescriptorMap<Graph, Node> nodes(graph);
+  typename DescriptorMap<Graph, Node>::InverseMap invNodes(nodes);
   for (int i = 0; i < 100; ++i) {
     int src = rnd[invNodes.size()];
@@ -123,4 +122,5 @@
   }
   typename Graph::template EdgeMap<int> found(graph, 0);
+  DescriptorMap<Graph, Edge> edges(graph);
   for (NodeIt src(graph); src != INVALID; ++src) {
     for (NodeIt trg(graph); trg != INVALID; ++trg) {
Index: test/heap_test.cc
===================================================================
--- test/heap_test.cc	(revision 293)
+++ test/heap_test.cc	(revision 212)
@@ -132,5 +132,5 @@
                       Node source) {
 
-  typename Dijkstra<Digraph, IntArcMap>::template SetStandardHeap<Heap>::
+  typename Dijkstra<Digraph, IntArcMap>::template DefStandardHeap<Heap>::
     Create dijkstra(digraph, length);
 
@@ -168,5 +168,5 @@
 
   std::istringstream input(test_lgf);
-  digraphReader(digraph, input).
+  digraphReader(input, digraph).
     arcMap("capacity", length).
     node("source", source).
Index: tools/Makefile.am
===================================================================
--- tools/Makefile.am	(revision 314)
+++ tools/Makefile.am	(revision 146)
@@ -2,5 +2,4 @@
 
 bin_PROGRAMS +=
-dist_bin_SCRIPTS += tools/lemon-0.x-to-1.x.sh
 
 endif WANT_TOOLS
Index: ols/lemon-0.x-to-1.x.sh
===================================================================
--- tools/lemon-0.x-to-1.x.sh	(revision 314)
+++ 	(revision )
@@ -1,127 +1,0 @@
-#!/bin/bash
-
-set -e
-
-if [ $# -eq 0 -o x$1 = "x-h" -o x$1 = "x-help" -o x$1 = "x--help" ]; then
-	echo "Usage:"
-	echo "  $0 source-file"
-	exit
-fi
-
-TMP=`mktemp`
-
-sed	-e "s/undirected graph/_gr_aph_label_/g"\
-	-e "s/undirected edge/_ed_ge_label_/g"\
-	-e "s/graph_/_gr_aph_label__/g"\
-	-e "s/_graph/__gr_aph_label_/g"\
-	-e "s/UGraph/_Gr_aph_label_/g"\
-	-e "s/uGraph/_gr_aph_label_/g"\
-	-e "s/ugraph/_gr_aph_label_/g"\
-	-e "s/Graph/_Digr_aph_label_/g"\
-	-e "s/graph/_digr_aph_label_/g"\
-	-e "s/UEdge/_Ed_ge_label_/g"\
-	-e "s/uEdge/_ed_ge_label_/g"\
-	-e "s/uedge/_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/ANode/_Re_d_label_/g"\
-	-e "s/BNode/_Blu_e_label_/g"\
-	-e "s/A-Node/_Re_d_label_/g"\
-	-e "s/B-Node/_Blu_e_label_/g"\
-	-e "s/anode/_re_d_label_/g"\
-	-e "s/bnode/_blu_e_label_/g"\
-	-e "s/aNode/_re_d_label_/g"\
-	-e "s/bNode/_blu_e_label_/g"\
-	-e "s/_Digr_aph_label_/Digraph/g"\
-	-e "s/_digr_aph_label_/digraph/g"\
-	-e "s/_Gr_aph_label_/Graph/g"\
-	-e "s/_gr_aph_label_/graph/g"\
-	-e "s/_Ar_c_label_/Arc/g"\
-	-e "s/_ar_c_label_/arc/g"\
-	-e "s/_Ed_ge_label_/Edge/g"\
-	-e "s/_ed_ge_label_/edge/g"\
-	-e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\
-	-e "s/_Re_d_label_/Red/g"\
-	-e "s/_Blu_e_label_/Blue/g"\
-	-e "s/_re_d_label_/red/g"\
-	-e "s/_blu_e_label_/blue/g"\
-	-e "s/\(\W\)DefPredMap\(\W\)/\1SetPredMap\2/g"\
-	-e "s/\(\W\)DefPredMap$/\1SetPredMap/g"\
-	-e "s/^DefPredMap\(\W\)/SetPredMap\1/g"\
-	-e "s/^DefPredMap$/SetPredMap/g"\
-	-e "s/\(\W\)DefDistMap\(\W\)/\1SetDistMap\2/g"\
-	-e "s/\(\W\)DefDistMap$/\1SetDistMap/g"\
-	-e "s/^DefDistMap\(\W\)/SetDistMap\1/g"\
-	-e "s/^DefDistMap$/SetDistMap/g"\
-	-e "s/\(\W\)DefReachedMap\(\W\)/\1SetReachedMap\2/g"\
-	-e "s/\(\W\)DefReachedMap$/\1SetReachedMap/g"\
-	-e "s/^DefReachedMap\(\W\)/SetReachedMap\1/g"\
-	-e "s/^DefReachedMap$/SetReachedMap/g"\
-	-e "s/\(\W\)DefProcessedMap\(\W\)/\1SetProcessedMap\2/g"\
-	-e "s/\(\W\)DefProcessedMap$/\1SetProcessedMap/g"\
-	-e "s/^DefProcessedMap\(\W\)/SetProcessedMap\1/g"\
-	-e "s/^DefProcessedMap$/SetProcessedMap/g"\
-	-e "s/\(\W\)DefHeap\(\W\)/\1SetHeap\2/g"\
-	-e "s/\(\W\)DefHeap$/\1SetHeap/g"\
-	-e "s/^DefHeap\(\W\)/SetHeap\1/g"\
-	-e "s/^DefHeap$/SetHeap/g"\
-	-e "s/\(\W\)DefStandardHeap\(\W\)/\1SetStandradHeap\2/g"\
-	-e "s/\(\W\)DefStandardHeap$/\1SetStandradHeap/g"\
-	-e "s/^DefStandardHeap\(\W\)/SetStandradHeap\1/g"\
-	-e "s/^DefStandardHeap$/SetStandradHeap/g"\
-	-e "s/\(\W\)DefOperationTraits\(\W\)/\1SetOperationTraits\2/g"\
-	-e "s/\(\W\)DefOperationTraits$/\1SetOperationTraits/g"\
-	-e "s/^DefOperationTraits\(\W\)/SetOperationTraits\1/g"\
-	-e "s/^DefOperationTraits$/SetOperationTraits/g"\
-	-e "s/\(\W\)DefProcessedMapToBeDefaultMap\(\W\)/\1SetStandardProcessedMap\2/g"\
-	-e "s/\(\W\)DefProcessedMapToBeDefaultMap$/\1SetStandardProcessedMap/g"\
-	-e "s/^DefProcessedMapToBeDefaultMap\(\W\)/SetStandardProcessedMap\1/g"\
-	-e "s/^DefProcessedMapToBeDefaultMap$/SetStandardProcessedMap/g"\
-	-e "s/\(\W\)IntegerMap\(\W\)/\1RangeMap\2/g"\
-	-e "s/\(\W\)IntegerMap$/\1RangeMap/g"\
-	-e "s/^IntegerMap\(\W\)/RangeMap\1/g"\
-	-e "s/^IntegerMap$/RangeMap/g"\
-	-e "s/\(\W\)integerMap\(\W\)/\1rangeMap\2/g"\
-	-e "s/\(\W\)integerMap$/\1rangeMap/g"\
-	-e "s/^integerMap\(\W\)/rangeMap\1/g"\
-	-e "s/^integerMap$/rangeMap/g"\
-	-e "s/\(\W\)copyGraph\(\W\)/\1graphCopy\2/g"\
-	-e "s/\(\W\)copyGraph$/\1graphCopy/g"\
-	-e "s/^copyGraph\(\W\)/graphCopy\1/g"\
-	-e "s/^copyGraph$/graphCopy/g"\
-	-e "s/\(\W\)copyDigraph\(\W\)/\1digraphCopy\2/g"\
-	-e "s/\(\W\)copyDigraph$/\1digraphCopy/g"\
-	-e "s/^copyDigraph\(\W\)/digraphCopy\1/g"\
-	-e "s/^copyDigraph$/digraphCopy/g"\
-	-e "s/\(\W\)\([sS]\)tdMap\(\W\)/\1\2parseMap\3/g"\
-	-e "s/\(\W\)\([sS]\)tdMap$/\1\2parseMap/g"\
-	-e "s/^\([sS]\)tdMap\(\W\)/\1parseMap\2/g"\
-	-e "s/^\([sS]\)tdMap$/\1parseMap/g"\
-	-e "s/\(\W\)\([Ff]\)unctorMap\(\W\)/\1\2unctorToMap\3/g"\
-	-e "s/\(\W\)\([Ff]\)unctorMap$/\1\2unctorToMap/g"\
-	-e "s/^\([Ff]\)unctorMap\(\W\)/\1unctorToMap\2/g"\
-	-e "s/^\([Ff]\)unctorMap$/\1unctorToMap/g"\
-	-e "s/\(\W\)\([Mm]\)apFunctor\(\W\)/\1\2apToFunctor\3/g"\
-	-e "s/\(\W\)\([Mm]\)apFunctor$/\1\2apToFunctor/g"\
-	-e "s/^\([Mm]\)apFunctor\(\W\)/\1apToFunctor\2/g"\
-	-e "s/^\([Mm]\)apFunctor$/\1apToFunctor/g"\
-	-e "s/\(\W\)\([Ff]\)orkWriteMap\(\W\)/\1\2orkMap\3/g"\
-	-e "s/\(\W\)\([Ff]\)orkWriteMap$/\1\2orkMap/g"\
-	-e "s/^\([Ff]\)orkWriteMap\(\W\)/\1orkMap\2/g"\
-	-e "s/^\([Ff]\)orkWriteMap$/\1orkMap/g"\
-	-e "s/\(\W\)StoreBoolMap\(\W\)/\1LoggerBoolMap\2/g"\
-	-e "s/\(\W\)StoreBoolMap$/\1LoggerBoolMap/g"\
-	-e "s/^StoreBoolMap\(\W\)/LoggerBoolMap\1/g"\
-	-e "s/^StoreBoolMap$/LoggerBoolMap/g"\
-	-e "s/\(\W\)storeBoolMap\(\W\)/\1loggerBoolMap\2/g"\
-	-e "s/\(\W\)storeBoolMap$/\1loggerBoolMap/g"\
-	-e "s/^storeBoolMap\(\W\)/loggerBoolMap\1/g"\
-	-e "s/^storeBoolMap$/loggerBoolMap/g"\
-	-e "s/\(\W\)BoundingBox\(\W\)/\1Box\2/g"\
-	-e "s/\(\W\)BoundingBox$/\1Box/g"\
-	-e "s/^BoundingBox\(\W\)/Box\1/g"\
-	-e "s/^BoundingBox$/Box/g"\
-<$1 > $TMP
-
-mv $TMP $1
