Index: demo/arg_parser_demo.cc
===================================================================
--- demo/arg_parser_demo.cc	(revision 204)
+++ demo/arg_parser_demo.cc	(revision 137)
@@ -30,60 +30,41 @@
 int main(int argc, const char **argv)
 {
-  // Initialize the argument parser
-  ArgParser ap(argc, argv);
+  ArgParser ap(argc,argv);
   int i;
   std::string s;
-  double d = 1.0;
-  bool b, nh;
-  bool g1, g2, g3;
-
-  // Add a mandatory integer option with storage reference
-  ap.refOption("n", "An integer input.", i, true);
-  // Add a double option with storage reference (the default value is 1.0)
-  ap.refOption("val", "A double input.", d);
-  // Add a double option without storage reference (the default value is 3.14)
-  ap.doubleOption("val2", "A double input.", 3.14);
-  // Set synonym for -val option
-  ap.synonym("vals", "val");
-  // Add a string option
-  ap.refOption("name", "A string input.", s);
-  // Add bool options
-  ap.refOption("f", "A switch.", b)
-    .refOption("nohelp", "", nh)
-    .refOption("gra", "Choice A", g1)
-    .refOption("grb", "Choice B", g2)
-    .refOption("grc", "Choice C", g3);
-  // Bundle -gr* options into a group
-  ap.optionGroup("gr", "gra")
-    .optionGroup("gr", "grb")
-    .optionGroup("gr", "grc");
-  // Set the group mandatory
-  ap.mandatoryGroup("gr");
-  // Set the options of the group exclusive (only one option can be given)
-  ap.onlyOneGroup("gr");
-  // Add non-parsed arguments (e.g. input files)
-  ap.other("infile", "The input file.")
+  double d;
+  bool b,sil;
+  bool g1,g2,g3;
+  ap.refOption("n", "An integer input.", i, true)
+    .refOption("val", "A double input.", d)
+    .doubleOption("val2", "A double input.", d)
+    .synonym("vals","val")
+    .refOption("name", "A string input.", s)
+    .refOption("f", "A switch.", b)
+    .refOption("nohelp", "", sil)
+    .refOption("gra","Choice A",g1)
+    .refOption("grb","Choice B",g2)
+    .refOption("grc","Choice C",g3)
+    .optionGroup("gr","gra")
+    .optionGroup("gr","grb")
+    .optionGroup("gr","grc")
+    .mandatoryGroup("gr")
+    .onlyOneGroup("gr")
+    .other("infile","The input file.")
     .other("...");
   
-  // Perform the parsing process
-  // (in case of any error it terminates the program)
   ap.parse();
 
-  // Check each option if it has been given and print its value
   std::cout << "Parameters of '" << ap.commandName() << "':\n";
 
-  std::cout << "  Value of -n: " << i << std::endl;
+  if(ap.given("n")) std::cout << "  Value of -n: " << i << std::endl;
   if(ap.given("val")) std::cout << "  Value of -val: " << d << std::endl;
-  if(ap.given("val2")) {
-    d = ap["val2"];
-    std::cout << "  Value of -val2: " << d << std::endl;
-  }
   if(ap.given("name")) std::cout << "  Value of -name: " << s << std::endl;
   if(ap.given("f")) std::cout << "  -f is given\n";
-  if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << nh << std::endl;
+  if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << sil << std::endl;
   if(ap.given("gra")) std::cout << "  -gra is given\n";
   if(ap.given("grb")) std::cout << "  -grb is given\n";
   if(ap.given("grc")) std::cout << "  -grc is given\n";
-  
+                                     
   switch(ap.files().size()) {
   case 0:
@@ -100,4 +81,3 @@
     std::cout << "    '" << ap.files()[i] << "'\n";
   
-  return 0;
 }
Index: demo/lgf_demo.cc
===================================================================
--- demo/lgf_demo.cc	(revision 193)
+++ demo/lgf_demo.cc	(revision 164)
@@ -21,13 +21,12 @@
 ///\brief Demonstrating graph input and output
 ///
-/// This program gives an example of how to read and write a digraph
-/// and additional maps from/to a stream or a file using the 
-/// \ref lgf-format "LGF" format.
+/// This program gives an example of how to load a directed graph from
+/// an \ref lgf-format "LGF" file with the \ref lemon::DigraphReader
+/// "DigraphReader" class.
 ///
 /// The \c "digraph.lgf" file:
 /// \include digraph.lgf
 ///
-/// And the program which reads it and prints the digraph to the
-/// standard output:
+/// And the program which reads it:
 /// \include lgf_demo.cc
 
@@ -36,4 +35,6 @@
 #include <lemon/lgf_reader.h>
 #include <lemon/lgf_writer.h>
+#include <lemon/random.h>
+
 
 using namespace lemon;
@@ -43,17 +44,12 @@
   SmartDigraph::ArcMap<int> cap(g);
   SmartDigraph::Node s, t;
-  
-  try {
-    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 (DataFormatError& error) { // check if there was any error
-    std::cerr << "Error: " << error.what() << std::endl;
-    return -1;
-  }
 
-  std::cout << "A digraph is read from 'digraph.lgf'." << std::endl;
+  digraphReader("digraph.lgf", g). // read the directeg 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();
+
+  std::cout << "Digraph read from 'digraph.lgf'" << std::endl;
   std::cout << "Number of nodes: " << countNodes(g) << std::endl;
   std::cout << "Number of arcs: " << countArcs(g) << std::endl;
Index: doc/groups.dox
===================================================================
--- doc/groups.dox	(revision 192)
+++ doc/groups.dox	(revision 156)
@@ -476,7 +476,9 @@
 @defgroup lemon_io Lemon Input-Output
 @ingroup io_group
-\brief Reading and writing \ref lgf-format "Lemon Graph Format".
-
-This group describes methods for reading and writing \ref lgf-format "Lemon Graph Format".
+\brief Reading and writing LEMON format
+
+This group describes methods for reading and writing LEMON format. 
+You can find more about this format on the \ref graph-io-page "Graph Input-Output"
+tutorial pages.
 */
 
Index: doc/lgf.dox
===================================================================
--- doc/lgf.dox	(revision 201)
+++ doc/lgf.dox	(revision 162)
@@ -47,5 +47,5 @@
 
 The \c \@nodes section describes a set of nodes and associated
-maps. The first is a header line, its columns are the names of the
+maps. The first is a header line, it columns are the names of the
 maps appearing in the following lines.
 One of the maps must be called \c
@@ -65,5 +65,5 @@
 
 The \c \@arcs section is very similar to the \c \@nodes section,
-it again starts with a header line describing the names of the maps,
+it again starts with a header line describing the names of the arc,
 but the \c "label" map is not obligatory here. The following lines
 describe the arcs. The first two tokens of each line are
@@ -79,16 +79,8 @@
 \endcode
 
-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
-has the same caption with \c '+' and \c '-' prefix, then these columns
-can be regarded as the values of an arc map.
+The \c \@edges is just a synonym of \c \@arcs.
 
 The \c \@attributes section contains key-value pairs, each line
-consists of two tokens, an attribute name, and then an attribute
-value. The value of the attribute could be also a label value of a
-node or an edge, or even an edge label prefixed with \c '+' or \c '-',
-which regards to the forward or backward directed arc of the
-corresponding edge.
+consists of two tokens, an attribute name, and then an attribute value.
 
 \code
Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 195)
+++ lemon/Makefile.am	(revision 166)
@@ -33,5 +33,4 @@
 	lemon/kruskal.h \
 	lemon/lgf_reader.h \
-	lemon/lgf_writer.h \
 	lemon/list_graph.h \
 	lemon/maps.h \
@@ -61,6 +60,6 @@
 	lemon/concepts/digraph.h \
 	lemon/concepts/graph.h \
-	lemon/concepts/graph_components.h \
 	lemon/concepts/heap.h \
 	lemon/concepts/maps.h \
-	lemon/concepts/path.h
+	lemon/concepts/path.h \
+	lemon/concepts/graph_components.h
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h	(revision 204)
+++ lemon/arg_parser.h	(revision 108)
@@ -119,17 +119,11 @@
   public:
 
-    ///Constructor
+    ///\e
     ArgParser(int argc, const char **argv);
 
     ~ArgParser();
 
-    ///\name Options
-    ///
-
-    ///@{
-
     ///Add a new integer type option
 
-    ///Add a new integer type option.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -142,5 +136,4 @@
     ///Add a new floating point type option
 
-    ///Add a new floating point type option.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -153,5 +146,4 @@
     ///Add a new bool type option
 
-    ///Add a new bool type option.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -165,5 +157,4 @@
     ///Add a new string type option
 
-    ///Add a new string type option.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -174,15 +165,5 @@
 		      std::string value="", bool obl=false);
 
-    ///Give help string for non-parsed arguments.
-
-    ///With this function you can give help string for non-parsed arguments.
-    ///The parameter \c name will be printed in the short usage line, while
-    ///\c help gives a more detailed description.
-    ArgParser &other(const std::string &name,
-		     const std::string &help="");
-    
-    ///@}
-
-    ///\name Options with External Storage
+    ///\name Options with external storage
     ///Using this functions, the value of the option will be directly written
     ///into a variable once the option appears in the command line.
@@ -192,5 +173,4 @@
     ///Add a new integer type option with a storage reference
 
-    ///Add a new integer type option with a storage reference.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -203,5 +183,4 @@
     ///Add a new floating type option with a storage reference
 
-    ///Add a new floating type option with a storage reference.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -214,5 +193,4 @@
     ///Add a new bool type option with a storage reference
 
-    ///Add a new bool type option with a storage reference.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -226,5 +204,4 @@
     ///Add a new string type option with a storage reference
 
-    ///Add a new string type option with a storage reference.
     ///\param name The name of the option. The leading '-' must be omitted.
     ///\param help A help string.
@@ -242,5 +219,5 @@
     ///@{
 
-    ///Bundle some options into a group
+    ///Boundle some options into a group
 
     /// You can group some option by calling this function repeatedly for each
@@ -254,5 +231,5 @@
 
     ///If you call this function for a group, than at most one of them can be
-    ///given at the same time.
+    ///given at the same time
     ArgParser &onlyOneGroup(const std::string &group);
   
@@ -271,4 +248,21 @@
     
     ///@}
+
+    ///Give help string for non-parsed arguments.
+
+    ///With this function you can give help string for non-parsed arguments.
+    ///The parameter \c name will be printed in the short usage line, while
+    ///\c help gives a more detailed description.
+    ArgParser &other(const std::string &name,
+		     const std::string &help="");
+    
+    ///Give back the non-option type arguments.
+
+    ///Give back a reference to a vector consisting of the program arguments
+    ///not starting with a '-' character.
+    std::vector<std::string> &files() { return _file_args; }
+
+    ///Give back the command name (the 0th argument)
+    const std::string &commandName() { return _command_name; }
 
     void show(std::ostream &os,Opts::iterator i);
@@ -293,7 +287,4 @@
     }
     
-    ///Give back the command name (the 0th argument)
-    const std::string &commandName() { return _command_name; }
-
     ///Check if an opion has been given to the command.
     bool given(std::string op) 
@@ -370,13 +361,9 @@
       return RefType(*this, n);
     }    
-
-    ///Give back the non-option type arguments.
-
-    ///Give back a reference to a vector consisting of the program arguments
-    ///not starting with a '-' character.
-    std::vector<std::string> &files() { return _file_args; }
  
   };
 }
 
-#endif // LEMON_ARG_PARSER
+    
+
+#endif // LEMON_MAIN_PARAMS
Index: lemon/concepts/heap.h
===================================================================
--- lemon/concepts/heap.h	(revision 203)
+++ lemon/concepts/heap.h	(revision 113)
@@ -182,8 +182,10 @@
 	  Item item;
 	  Prio prio;
+	  State state;
 	  item=Item();
 	  prio=Prio();
 	  ignore_unused_variable_warning(item);
 	  ignore_unused_variable_warning(prio);
+	  ignore_unused_variable_warning(state);
 
 	  OwnItem own_item;
@@ -202,7 +204,5 @@
 	  
 	  int s = heap.size();
-	  ignore_unused_variable_warning(s);
 	  bool e = heap.empty();
-	  ignore_unused_variable_warning(e);
 
 	  prio = heap.prio();
@@ -228,7 +228,12 @@
 	  heap.clear();
 
-	  own_state = heap.state(own_item);
+	  state = heap.state(item);
+	  heap.state(item, state);
+	  state = heap.state(own_item);
 	  heap.state(own_item, own_state);
 
+	  state = _Heap::PRE_HEAP;
+	  state = _Heap::IN_HEAP;
+	  state = _Heap::POST_HEAP;
 	  own_state = _Heap::PRE_HEAP;
 	  own_state = _Heap::IN_HEAP;
Index: lemon/graph_utils.h
===================================================================
--- lemon/graph_utils.h	(revision 199)
+++ lemon/graph_utils.h	(revision 169)
@@ -603,5 +603,5 @@
         for (typename From::ArcIt it(from); it != INVALID; ++it) {
           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)], 
-				    nodeRefMap[from.target(it)]);
+                                          nodeRefMap[from.target(it)]);
         }
       }
@@ -629,6 +629,6 @@
         }
         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
-          edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)], 
-				      nodeRefMap[from.v(it)]);
+          edgeRefMap[it] = to.addArc(nodeRefMap[from.source(it)], 
+				       nodeRefMap[from.target(it)]);
         }
       }
@@ -926,8 +926,7 @@
 
       Value operator[](const Key& key) const {
-        bool forward = _from.u(key) != _from.v(key) ?
-	  _node_ref[_from.source(key)] == 
-	  _to.source(_to.direct(_edge_ref[key], true)) :
-	  _from.direction(key);
+        bool forward = 
+          (_from.direction(key) == 
+	   (_node_ref[_from.source(key)] == _to.source(_edge_ref[key])));
 	return _to.direct(_edge_ref[key], forward); 
       }
Index: lemon/kruskal.h
===================================================================
--- lemon/kruskal.h	(revision 194)
+++ lemon/kruskal.h	(revision 167)
@@ -33,7 +33,7 @@
 ///\ingroup spantree
 ///\file
-///\brief Kruskal's algorithm to compute a minimum cost spanning tree
+///\brief Kruskal's algorithm to compute a minimum cost tree
 ///
-///Kruskal's algorithm to compute a minimum cost spanning tree.
+///Kruskal's algorithm to compute a minimum cost tree.
 ///
 
@@ -252,9 +252,7 @@
   /// \ingroup spantree
   ///
-  /// \brief Kruskal algorithm to find a minimum cost spanning tree of
-  /// a graph.
-  ///
-  /// This function runs Kruskal's algorithm to find a minimum cost 
-  /// spanning tree.
+  /// \brief Kruskal's algorithm to find a minimum cost tree of a graph.
+  ///
+  /// This function runs Kruskal's algorithm to find a minimum cost tree.
   /// Due to some C++ hacking, it accepts various input and output types.
   ///
@@ -265,23 +263,22 @@
   /// undirected by disregarding the direction of the arcs.
   ///
-  /// \param in This object is used to describe the arc/edge costs. 
-  /// It can be one of the following choices.
+  /// \param in This object is used to describe the arc costs. It can be one
+  /// of the following choices.
   /// - An STL compatible 'Forward Container' with
-  /// <tt>std::pair<GR::Arc,X></tt> or
-  /// <tt>std::pair<GR::Edge,X></tt> as its <tt>value_type</tt>, where
-  /// \c X is the type of the costs. The pairs indicates the arcs/edges
+  /// <tt>std::pair<GR::Edge,X></tt> or
+  /// <tt>std::pair<GR::Arc,X></tt> as its <tt>value_type</tt>, where
+  /// \c X is the type of the costs. The pairs indicates the arcs
   /// along with the assigned cost. <em>They must be in a
   /// cost-ascending order.</em>
-  /// - Any readable arc/edge map. The values of the map indicate the 
-  /// arc/edge costs.
-  ///
-  /// \retval out Here we also have a choice.
-  /// - It can be a writable \c bool arc/edge map. After running the
-  /// algorithm it will contain the found minimum cost spanning
-  /// tree: the value of an arc/edge will be set to \c true if it belongs
+  /// - Any readable Arc map. The values of the map indicate the arc costs.
+  ///
+  /// \retval out Here we also have a choise.
+  /// - It can be a writable \c bool arc map.  After running the
+  /// algorithm this will contain the found minimum cost spanning
+  /// tree: the value of an arc will be set to \c true if it belongs
   /// to the tree, otherwise it will be set to \c false. The value of
-  /// each arc/edge will be set exactly once.
+  /// each arc will be set exactly once.
   /// - It can also be an iteraror of an STL Container with
-  /// <tt>GR::Arc</tt> or <tt>GR::Edge</tt> as its
+  /// <tt>GR::Edge</tt> or <tt>GR::Arc</tt> as its
   /// <tt>value_type</tt>.  The algorithm copies the elements of the
   /// found tree into this sequence.  For example, if we know that the
@@ -294,12 +291,11 @@
   /// Or if we don't know in advance the size of the tree, we can
   /// write this.  
-  ///\code
-  /// std::vector<Arc> tree;
+  ///\code std::vector<Arc> tree;
   /// kruskal(g,cost,std::back_inserter(tree)); 
   ///\endcode
   ///
-  /// \return The total cost of the found spanning tree.
-  ///
-  /// \warning If Kruskal runs on an be consistent of using the same
+  /// \return The total cost of the found tree.
+  ///
+  /// \warning If kruskal runs on an be consistent of using the same
   /// Arc type for input and output.
   ///
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 201)
+++ lemon/lgf_reader.h	(revision 190)
@@ -19,5 +19,5 @@
 ///\ingroup lemon_io
 ///\file
-///\brief \ref lgf-format "Lemon Graph Format" reader.
+///\brief Lemon Graph Format reader.
 
 
@@ -196,19 +196,19 @@
     };
 
-    inline bool isWhiteSpace(char c) {
+    bool isWhiteSpace(char c) {
       return c == ' ' || c == '\t' || c == '\v' || 
         c == '\n' || c == '\r' || c == '\f'; 
     }
     
-    inline bool isOct(char c) {
+    bool isOct(char c) {
       return '0' <= c && c <='7'; 
     }
     
-    inline int valueOct(char c) {
+    int valueOct(char c) {
       LEMON_ASSERT(isOct(c), "The character is not octal.");
       return c - '0';
     }
 
-    inline bool isHex(char c) {
+    bool isHex(char c) {
       return ('0' <= c && c <= '9') || 
 	('a' <= c && c <= 'z') || 
@@ -216,5 +216,5 @@
     }
     
-    inline int valueHex(char c) {
+    int valueHex(char c) {
       LEMON_ASSERT(isHex(c), "The character is not hexadecimal.");
       if ('0' <= c && c <= '9') return c - '0';
@@ -223,15 +223,15 @@
     }
 
-    inline bool isIdentifierFirstChar(char c) {
+    bool isIdentifierFirstChar(char c) {
       return ('a' <= c && c <= 'z') ||
 	('A' <= c && c <= 'Z') || c == '_';
     }
 
-    inline bool isIdentifierChar(char c) {
+    bool isIdentifierChar(char c) {
       return isIdentifierFirstChar(c) ||
 	('0' <= c && c <= '9');
     }
 
-    inline char readEscape(std::istream& is) {
+    char readEscape(std::istream& is) {
       char c;
       if (!is.get(c))
@@ -285,5 +285,5 @@
     }
     
-    inline std::istream& readToken(std::istream& is, std::string& str) {
+    std::istream& readToken(std::istream& is, std::string& str) {
       std::ostringstream os;
 
@@ -401,5 +401,5 @@
   /// \ingroup lemon_io
   ///  
-  /// \brief \ref lgf-format "LGF" reader for directed graphs
+  /// \brief LGF reader for directed graphs
   ///
   /// This utility reads an \ref lgf-format "LGF" file.
@@ -411,7 +411,7 @@
   /// with the \c nodeMap() or \c arcMap() members. An optional
   /// converter parameter can also be added as a standard functor
-  /// converting from \c std::string to the value type of the map. If it
+  /// converting from std::string to the value type of the map. If it
   /// is set, it will determine how the tokens in the file should be
-  /// converted to the value type of the map. If the functor is not set,
+  /// is converted to the map's value type. If the functor is not set,
   /// then a default conversion will be used. One map can be read into
   /// multiple map objects at the same time. The \c attribute(), \c
@@ -420,11 +420,11 @@
   ///
   ///\code
-  /// DigraphReader<Digraph>(std::cin, digraph).
-  ///   nodeMap("coordinates", coord_map).
-  ///   arcMap("capacity", cap_map).
-  ///   node("source", src).
-  ///   node("target", trg).
-  ///   attribute("caption", caption).
-  ///   run();
+  ///     DigraphReader<Digraph>(std::cin, digraph).
+  ///       nodeMap("coordinates", coord_map).
+  ///       arcMap("capacity", cap_map).
+  ///       node("source", src).
+  ///       node("target", trg).
+  ///       attribute("caption", caption).
+  ///       run();
   ///\endcode
   ///
@@ -438,12 +438,12 @@
   /// graph) during the reading, but instead the label map of the items
   /// are given as a parameter of these functions. An
-  /// application of these functions is multipass reading, which is
-  /// important if two \c \@arcs sections must be read from the
-  /// file. In this case the first phase would read the node set and one
+  /// application of these function is multipass reading, which is
+  /// important if two \e \@arcs sections must be read from the
+  /// file. In this example the first phase would read the node set and one
   /// of the arc sets, while the second phase would read the second arc
   /// set into an \e ArcSet class (\c SmartArcSet or \c ListArcSet).
   /// The previously read label node map should be passed to the \c
   /// useNodes() functions. Another application of multipass reading when
-  /// paths are given as a node map or an arc map. It is impossible to read this in
+  /// paths are given as a node map or an arc map. It is impossible read this in
   /// a single pass, because the arcs are not constructed when the node
   /// maps are read.
@@ -736,5 +736,5 @@
     /// Use previously constructed node set, and specify the node
     /// label map and a functor which converts the label map values to
-    /// \c std::string.
+    /// std::string.
     template <typename Map, typename Converter>
     DigraphReader& useNodes(const Map& map, 
@@ -769,5 +769,5 @@
     /// Use previously constructed arc set, and specify the arc
     /// label map and a functor which converts the label map values to
-    /// \c std::string.
+    /// std::string.
     template <typename Map, typename Converter>
     DigraphReader& useArcs(const Map& map, 
@@ -785,9 +785,10 @@
     ///
     /// Omit the reading of the node section. This implies that each node
-    /// map reading rule will be abandoned, and the nodes of the graph
+    /// map reading rule will be abanoned, and the nodes of the graph
     /// will not be constructed, which usually cause that the arc set
-    /// could not be read due to lack of node name resolving.
-    /// Therefore \c skipArcs() function should also be used, or
-    /// \c useNodes() should be used to specify the label of the nodes.
+    /// could not be read due to lack of node name
+    /// resolving. Therefore, the \c skipArcs() should be used too, or
+    /// the useNodes() member function should be used to specify the
+    /// label of the nodes.
     DigraphReader& skipNodes() {
       LEMON_ASSERT(!_skip_nodes, "Skip nodes already set"); 
@@ -799,5 +800,5 @@
     ///
     /// Omit the reading of the arc section. This implies that each arc
-    /// map reading rule will be abandoned, and the arcs of the graph
+    /// map reading rule will be abanoned, and the arcs of the graph
     /// will not be constructed.
     DigraphReader& skipArcs() {
@@ -1175,7 +1176,4 @@
   };
 
-  /// \brief Return a \ref DigraphReader class
-  /// 
-  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
@@ -1185,7 +1183,4 @@
   }
 
-  /// \brief Return a \ref DigraphReader class
-  /// 
-  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
@@ -1196,7 +1191,4 @@
   }
 
-  /// \brief Return a \ref DigraphReader class
-  /// 
-  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
@@ -1220,17 +1212,7 @@
   /// \ingroup lemon_io
   ///  
-  /// \brief \ref lgf-format "LGF" reader for undirected graphs
+  /// \brief LGF reader for undirected graphs
   ///
   /// This utility reads an \ref lgf-format "LGF" file.
-  ///
-  /// It can be used almost the same way as \c DigraphReader.
-  /// The only difference is that this class can handle edges and
-  /// edge maps as well as arcs and arc maps.
-  ///
-  /// The columns in the \c \@edges (or \c \@arcs) section are the
-  /// edge maps. However, if there are two maps with the same name
-  /// prefixed with \c '+' and \c '-', then these can be read into an
-  /// arc map.  Similarly, an attribute can be read into an arc, if
-  /// it's value is an edge label prefixed with \c '+' or \c '-'.
   template <typename _Graph>
   class GraphReader {
@@ -1281,5 +1263,5 @@
     /// \brief Constructor
     ///
-    /// Construct an undirected graph reader, which reads from the given
+    /// Construct a undirected graph reader, which reads from the given
     /// input stream.
     GraphReader(std::istream& is, Graph& graph) 
@@ -1290,5 +1272,5 @@
     /// \brief Constructor
     ///
-    /// Construct an undirected graph reader, which reads from the given
+    /// Construct a undirected graph reader, which reads from the given
     /// file.
     GraphReader(const std::string& fn, Graph& graph) 
@@ -1299,5 +1281,5 @@
     /// \brief Constructor
     ///
-    /// Construct an undirected graph reader, which reads from the given
+    /// Construct a undirected graph reader, which reads from the given
     /// file.
     GraphReader(const char* fn, Graph& graph) 
@@ -1516,5 +1498,5 @@
     /// \brief Set \c \@nodes section to be read
     ///
-    /// Set \c \@nodes section to be read.
+    /// Set \c \@nodes section to be read
     GraphReader& nodes(const std::string& caption) {
       _nodes_caption = caption;
@@ -1524,5 +1506,5 @@
     /// \brief Set \c \@edges section to be read
     ///
-    /// Set \c \@edges section to be read.
+    /// Set \c \@edges section to be read
     GraphReader& edges(const std::string& caption) {
       _edges_caption = caption;
@@ -1532,5 +1514,5 @@
     /// \brief Set \c \@attributes section to be read
     ///
-    /// Set \c \@attributes section to be read.
+    /// Set \c \@attributes section to be read
     GraphReader& attributes(const std::string& caption) {
       _attributes_caption = caption;
@@ -1563,5 +1545,5 @@
     /// Use previously constructed node set, and specify the node
     /// label map and a functor which converts the label map values to
-    /// \c std::string.
+    /// std::string.
     template <typename Map, typename Converter>
     GraphReader& useNodes(const Map& map, 
@@ -1596,5 +1578,5 @@
     /// Use previously constructed edge set, and specify the edge
     /// label map and a functor which converts the label map values to
-    /// \c std::string.
+    /// std::string.
     template <typename Map, typename Converter>
     GraphReader& useEdges(const Map& map, 
@@ -1609,13 +1591,13 @@
     }
 
-    /// \brief Skip the reading of node section
+    /// \brief Skips the reading of node section
     ///
     /// Omit the reading of the node section. This implies that each node
-    /// map reading rule will be abandoned, and the nodes of the graph
+    /// map reading rule will be abanoned, and the nodes of the graph
     /// will not be constructed, which usually cause that the edge set
     /// could not be read due to lack of node name
-    /// could not be read due to lack of node name resolving.
-    /// Therefore \c skipEdges() function should also be used, or
-    /// \c useNodes() should be used to specify the label of the nodes.
+    /// resolving. Therefore, the \c skipEdges() should be used too, or
+    /// the useNodes() member function should be used to specify the
+    /// label of the nodes.
     GraphReader& skipNodes() {
       LEMON_ASSERT(!_skip_nodes, "Skip nodes already set"); 
@@ -1624,8 +1606,8 @@
     }
 
-    /// \brief Skip the reading of edge section
+    /// \brief Skips the reading of edge section
     ///
     /// Omit the reading of the edge section. This implies that each edge
-    /// map reading rule will be abandoned, and the edges of the graph
+    /// map reading rule will be abanoned, and the edges of the graph
     /// will not be constructed.
     GraphReader& skipEdges() {
@@ -2001,7 +1983,4 @@
   };
 
-  /// \brief Return a \ref GraphReader class
-  /// 
-  /// This function just returns a \ref GraphReader class.
   /// \relates GraphReader
   template <typename Graph>
@@ -2011,7 +1990,4 @@
   }
 
-  /// \brief Return a \ref GraphReader class
-  /// 
-  /// This function just returns a \ref GraphReader class.
   /// \relates GraphReader
   template <typename Graph>
@@ -2022,7 +1998,4 @@
   }
 
-  /// \brief Return a \ref GraphReader class
-  /// 
-  /// This function just returns a \ref GraphReader class.
   /// \relates GraphReader
   template <typename Graph>
@@ -2038,13 +2011,11 @@
   SectionReader sectionReader(const char* fn);
   
-  /// \ingroup lemon_io
-  ///
   /// \brief Section reader class
   ///
-  /// In the \ref lgf-format "LGF" file extra sections can be placed, 
-  /// which contain any data in arbitrary format. Such sections can be
-  /// read with this class. A reading rule can be added to the class 
-  /// with two different functions. With the \c sectionLines() function a
-  /// functor can process the section line-by-line, while with the \c
+  /// In the \e LGF file extra sections can be placed, which contain
+  /// any data in arbitrary format. Such sections can be read with
+  /// this class. A reading rule can be added with two different
+  /// functions, with the \c sectionLines() function a functor can
+  /// process the section line-by-line. While with the \c
   /// sectionStream() member the section can be read from an input
   /// stream.
@@ -2135,5 +2106,5 @@
     ///\endcode
     ///
-    /// The functor is implemented as a struct:
+    /// The functor is implemented as an struct:
     ///\code
     ///  struct NumberSection {
@@ -2153,5 +2124,5 @@
     template <typename Functor>
     SectionReader& sectionLines(const std::string& type, Functor functor) {
-      LEMON_ASSERT(!type.empty(), "Type is empty.");
+      LEMON_ASSERT(!type.empty(), "Type is not empty.");
       LEMON_ASSERT(_sections.find(type) == _sections.end(), 
 		   "Multiple reading of section.");
@@ -2165,5 +2136,5 @@
     ///
     /// The first parameter is the type of the section, the second is
-    /// a functor, which takes an \c std::istream& and an \c int&
+    /// a functor, which takes an \c std::istream& and an int&
     /// parameter, the latter regard to the line number of stream. The
     /// functor can read the input while the section go on, and the
@@ -2171,5 +2142,5 @@
     template <typename Functor>
     SectionReader& sectionStream(const std::string& type, Functor functor) {
-      LEMON_ASSERT(!type.empty(), "Type is empty.");
+      LEMON_ASSERT(!type.empty(), "Type is not empty.");
       LEMON_ASSERT(_sections.find(type) == _sections.end(), 
 		   "Multiple reading of section.");
@@ -2216,5 +2187,5 @@
     /// \brief Start the batch processing
     ///
-    /// This function starts the batch processing.
+    /// This function starts the batch processing
     void run() {
       
@@ -2269,7 +2240,4 @@
   };
 
-  /// \brief Return a \ref SectionReader class
-  /// 
-  /// This function just returns a \ref SectionReader class.
   /// \relates SectionReader
   inline SectionReader sectionReader(std::istream& is) {
@@ -2278,7 +2246,4 @@
   }
 
-  /// \brief Return a \ref SectionReader class
-  /// 
-  /// This function just returns a \ref SectionReader class.
   /// \relates SectionReader
   inline SectionReader sectionReader(const std::string& fn) {
@@ -2287,7 +2252,4 @@
   }
 
-  /// \brief Return a \ref SectionReader class
-  /// 
-  /// This function just returns a \ref SectionReader class.
   /// \relates SectionReader
   inline SectionReader sectionReader(const char* fn) {
@@ -2308,18 +2270,17 @@
   /// reading the graph.
   ///
-  ///\code 
-  /// LgfContents contents("graph.lgf"); 
+  ///\code LgfContents contents("graph.lgf"); 
   /// contents.run();
   ///
-  /// // Does it contain any node section and arc section?
+  /// // does it contain any node section and arc section
   /// if (contents.nodeSectionNum() == 0 || contents.arcSectionNum()) {
-  ///   std::cerr << "Failure, cannot find graph." << std::endl;
+  ///   std::cerr << "Failure, cannot find graph" << std::endl;
   ///   return -1;
   /// }
-  /// std::cout << "The name of the default node section: " 
+  /// std::cout << "The name of the default node section : " 
   ///           << contents.nodeSection(0) << std::endl;
-  /// std::cout << "The number of the arc maps: " 
+  /// std::cout << "The number of the arc maps : " 
   ///           << contents.arcMaps(0).size() << std::endl;
-  /// std::cout << "The name of second arc map: " 
+  /// std::cout << "The name of second arc map : " 
   ///           << contents.arcMaps(0)[1] << std::endl;
   ///\endcode
@@ -2392,7 +2353,7 @@
     }
 
-    /// \brief Returns the node section name at the given position. 
-    ///
-    /// Returns the node section name at the given position. 
+    /// \brief Returns the section name at the given position. 
+    ///
+    /// Returns the section name at the given position. 
     const std::string& nodeSection(int i) const {
       return _node_sections[i];
@@ -2419,7 +2380,7 @@
     }
 
-    /// \brief Returns the arc/edge section name at the given position. 
-    ///
-    /// Returns the arc/edge section name at the given position. 
+    /// \brief Returns the section name at the given position. 
+    ///
+    /// Returns the section name at the given position. 
     /// \note It is synonym of \c edgeSection().
     const std::string& arcSection(int i) const {
@@ -2476,7 +2437,7 @@
     }
 
-    /// \brief Returns the attribute section name at the given position. 
-    ///
-    /// Returns the attribute section name at the given position. 
+    /// \brief Returns the section name at the given position. 
+    ///
+    /// Returns the section name at the given position. 
     const std::string& attributeSectionNames(int i) const {
       return _attribute_sections[i];
@@ -2569,7 +2530,7 @@
     /// @{
 
-    /// \brief Starts the reading
-    ///
-    /// This function starts the reading.
+    /// \brief Start the reading
+    ///
+    /// This function starts the reading
     void run() {
 
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 201)
+++ lemon/lgf_writer.h	(revision 190)
@@ -19,5 +19,5 @@
 ///\ingroup lemon_io
 ///\file
-///\brief \ref lgf-format "Lemon Graph Format" writer.
+///\brief Lemon Graph Format writer.
 
 
@@ -226,15 +226,15 @@
     };
 
-    inline bool isWhiteSpace(char c) {
+    bool isWhiteSpace(char c) {
       return c == ' ' || c == '\t' || c == '\v' || 
         c == '\n' || c == '\r' || c == '\f'; 
     }
 
-    inline bool isEscaped(char c) {
+    bool isEscaped(char c) {
       return c == '\\' || c == '\"' || c == '\'' || 
 	c == '\a' || c == '\b';
     }
 
-    inline static void writeEscape(std::ostream& os, char c) {
+    static void writeEscape(std::ostream& os, char c) {
       switch (c) {
       case '\\':
@@ -277,5 +277,5 @@
     }
 
-    inline bool requireEscape(const std::string& str) {
+    bool requireEscape(const std::string& str) {
       if (str.empty() || str[0] == '@') return true;
       std::istringstream is(str);
@@ -289,5 +289,5 @@
     }
     
-    inline std::ostream& writeToken(std::ostream& os, const std::string& str) {
+    std::ostream& writeToken(std::ostream& os, const std::string& str) {
 
       if (requireEscape(str)) {
@@ -323,5 +323,5 @@
   /// \ingroup lemon_io
   ///  
-  /// \brief \ref lgf-format "LGF" writer for directed graphs
+  /// \brief LGF writer for directed graphs
   ///
   /// This utility writes an \ref lgf-format "LGF" file.
@@ -333,6 +333,6 @@
   /// with the \c nodeMap() or \c arcMap() members. An optional
   /// converter parameter can also be added as a standard functor
-  /// converting from the value type of the map to \c std::string. If it
-  /// is set, it will determine how the value type of the map is written to
+  /// converting from the value type of the map to std::string. If it
+  /// is set, it will determine how the map's value type is written to
   /// the output stream. If the functor is not set, then a default
   /// conversion will be used. The \c attribute(), \c node() and \c
@@ -340,13 +340,13 @@
   ///
   ///\code
-  /// DigraphWriter<Digraph>(std::cout, digraph).
-  ///   nodeMap("coordinates", coord_map).
-  ///   nodeMap("size", size).
-  ///   nodeMap("title", title).
-  ///   arcMap("capacity", cap_map).
-  ///   node("source", src).
-  ///   node("target", trg).
-  ///   attribute("caption", caption).
-  ///   run();
+  ///     DigraphWriter<Digraph>(std::cout, digraph).
+  ///       nodeMap("coordinates", coord_map).
+  ///       nodeMap("size", size).
+  ///       nodeMap("title", title).
+  ///       arcMap("capacity", cap_map).
+  ///       node("source", src).
+  ///       node("target", trg).
+  ///       attribute("caption", caption).
+  ///       run();
   ///\endcode
   ///
@@ -487,7 +487,7 @@
     /// @{
     
-    /// \brief Node map writing rule
-    ///
-    /// Add a node map writing rule to the writer.
+    /// \brief Node map reading rule
+    ///
+    /// Add a node map reading rule to the writer.
     template <typename Map>
     DigraphWriter& nodeMap(const std::string& caption, const Map& map) {
@@ -587,10 +587,10 @@
     }
 
-    /// \name Section captions
+    /// \name Select section by name
     /// @{
 
-    /// \brief Add an additional caption to the \c \@nodes section
-    ///
-    /// Add an additional caption to the \c \@nodes section.
+    /// \brief Set \c \@nodes section to be read
+    ///
+    /// Set \c \@nodes section to be read
     DigraphWriter& nodes(const std::string& caption) {
       _nodes_caption = caption;
@@ -598,7 +598,7 @@
     }
 
-    /// \brief Add an additional caption to the \c \@arcs section
-    ///
-    /// Add an additional caption to the \c \@arcs section.
+    /// \brief Set \c \@arcs section to be read
+    ///
+    /// Set \c \@arcs section to be read
     DigraphWriter& arcs(const std::string& caption) {
       _arcs_caption = caption;
@@ -606,7 +606,7 @@
     }
 
-    /// \brief Add an additional caption to the \c \@attributes section
-    ///
-    /// Add an additional caption to the \c \@attributes section.
+    /// \brief Set \c \@attributes section to be read
+    ///
+    /// Set \c \@attributes section to be read
     DigraphWriter& attributes(const std::string& caption) {
       _attributes_caption = caption;
@@ -619,5 +619,5 @@
     /// \brief Skip writing the node set
     ///
-    /// The \c \@nodes section will not be written to the stream.
+    /// The \c \@nodes section will be not written to the stream.
     DigraphWriter& skipNodes() {
       LEMON_ASSERT(!_skip_nodes, "Multiple usage of skipNodes() member");
@@ -628,5 +628,5 @@
     /// \brief Skip writing arc set
     ///
-    /// The \c \@arcs section will not be written to the stream.
+    /// The \c \@arcs section will be not written to the stream.
     DigraphWriter& skipArcs() {
       LEMON_ASSERT(!_skip_arcs, "Multiple usage of skipArcs() member");
@@ -836,5 +836,5 @@
     /// \brief Start the batch processing
     ///
-    /// This function starts the batch processing.
+    /// This function starts the batch processing
     void run() {
       if (!_skip_nodes) {
@@ -851,7 +851,7 @@
     }
 
-    /// \brief Give back the stream of the writer
-    ///
-    /// Give back the stream of the writer.
+    /// \brief Gives back the stream of the writer
+    ///
+    /// Gives back the stream of the writer
     std::ostream& ostream() {
       return *_os;
@@ -861,7 +861,4 @@
   };
 
-  /// \brief Return a \ref DigraphWriter class
-  /// 
-  /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
   template <typename Digraph>
@@ -872,7 +869,4 @@
   }
 
-  /// \brief Return a \ref DigraphWriter class
-  /// 
-  /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
   template <typename Digraph>
@@ -883,7 +877,4 @@
   }
 
-  /// \brief Return a \ref DigraphWriter class
-  /// 
-  /// This function just returns a \ref DigraphWriter class.
   /// \relates DigraphWriter
   template <typename Digraph>
@@ -908,17 +899,7 @@
   /// \ingroup lemon_io
   ///  
-  /// \brief \ref lgf-format "LGF" writer for directed graphs
+  /// \brief LGF writer for directed graphs
   ///
   /// This utility writes an \ref lgf-format "LGF" file.
-  ///
-  /// It can be used almost the same way as \c DigraphWriter.
-  /// The only difference is that this class can handle edges and
-  /// edge maps as well as arcs and arc maps.
-  ///
-  /// The arc maps are written into the file as two columns, the
-  /// caption of the columns are the name of the map prefixed with \c
-  /// '+' and \c '-'. The arcs are written into the \c \@attributes
-  /// section as a \c '+' or a \c '-' prefix (depends on the direction
-  /// of the arc) and the label of corresponding edge.
   template <typename _Graph>
   class GraphWriter {
@@ -1043,7 +1024,7 @@
     /// @{
     
-    /// \brief Node map writing rule
-    ///
-    /// Add a node map writing rule to the writer.
+    /// \brief Node map reading rule
+    ///
+    /// Add a node map reading rule to the writer.
     template <typename Map>
     GraphWriter& nodeMap(const std::string& caption, const Map& map) {
@@ -1189,10 +1170,10 @@
     }
 
-    /// \name Section captions
+    /// \name Select section by name
     /// @{
 
-    /// \brief Add an additional caption to the \c \@nodes section
-    ///
-    /// Add an additional caption to the \c \@nodes section.
+    /// \brief Set \c \@nodes section to be read
+    ///
+    /// Set \c \@nodes section to be read
     GraphWriter& nodes(const std::string& caption) {
       _nodes_caption = caption;
@@ -1200,7 +1181,7 @@
     }
 
-    /// \brief Add an additional caption to the \c \@arcs section
-    ///
-    /// Add an additional caption to the \c \@arcs section.
+    /// \brief Set \c \@edges section to be read
+    ///
+    /// Set \c \@edges section to be read
     GraphWriter& edges(const std::string& caption) {
       _edges_caption = caption;
@@ -1208,7 +1189,7 @@
     }
 
-    /// \brief Add an additional caption to the \c \@attributes section
-    ///
-    /// Add an additional caption to the \c \@attributes section.
+    /// \brief Set \c \@attributes section to be read
+    ///
+    /// Set \c \@attributes section to be read
     GraphWriter& attributes(const std::string& caption) {
       _attributes_caption = caption;
@@ -1221,5 +1202,5 @@
     /// \brief Skip writing the node set
     ///
-    /// The \c \@nodes section will not be written to the stream.
+    /// The \c \@nodes section will be not written to the stream.
     GraphWriter& skipNodes() {
       LEMON_ASSERT(!_skip_nodes, "Multiple usage of skipNodes() member");
@@ -1230,5 +1211,5 @@
     /// \brief Skip writing edge set
     ///
-    /// The \c \@edges section will not be written to the stream.
+    /// The \c \@edges section will be not written to the stream.
     GraphWriter& skipEdges() {
       LEMON_ASSERT(!_skip_edges, "Multiple usage of skipEdges() member");
@@ -1438,5 +1419,5 @@
     /// \brief Start the batch processing
     ///
-    /// This function starts the batch processing.
+    /// This function starts the batch processing
     void run() {
       if (!_skip_nodes) {
@@ -1453,7 +1434,7 @@
     }
 
-    /// \brief Give back the stream of the writer
-    ///
-    /// Give back the stream of the writer
+    /// \brief Gives back the stream of the writer
+    ///
+    /// Gives back the stream of the writer
     std::ostream& ostream() {
       return *_os;
@@ -1463,7 +1444,4 @@
   };
 
-  /// \brief Return a \ref GraphWriter class
-  /// 
-  /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
   template <typename Graph>
@@ -1473,7 +1451,4 @@
   }
 
-  /// \brief Return a \ref GraphWriter class
-  /// 
-  /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
   template <typename Graph>
@@ -1483,7 +1458,4 @@
   }
 
-  /// \brief Return a \ref GraphWriter class
-  /// 
-  /// This function just returns a \ref GraphWriter class.
   /// \relates GraphWriter
   template <typename Graph>
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 203)
+++ test/CMakeLists.txt	(revision 171)
@@ -11,8 +11,6 @@
   dim_test
   error_test
-  graph_copy_test
   graph_test
   graph_utils_test
-  heap_test
   kruskal_test
   maps_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 203)
+++ test/Makefile.am	(revision 171)
@@ -4,4 +4,5 @@
 noinst_HEADERS += \
 	test/graph_test.h \
+	test/heap_test.h \
 	test/graph_maps_test.h \
         test/test_tools.h
@@ -15,8 +16,6 @@
         test/dim_test \
 	test/error_test \
-	test/graph_copy_test \
 	test/graph_test \
 	test/graph_utils_test \
-	test/heap_test \
 	test/kruskal_test \
         test/maps_test \
@@ -38,8 +37,7 @@
 test_dim_test_SOURCES = test/dim_test.cc
 test_error_test_SOURCES = test/error_test.cc
-test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
 test_graph_utils_test_SOURCES = test/graph_utils_test.cc
-test_heap_test_SOURCES = test/heap_test.cc
+# test_heap_test_SOURCES = test/heap_test.cc
 test_kruskal_test_SOURCES = test/kruskal_test.cc
 test_maps_test_SOURCES = test/maps_test.cc
Index: st/graph_copy_test.cc
===================================================================
--- test/graph_copy_test.cc	(revision 200)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/* -*- C++ -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#include <lemon/smart_graph.h>
-#include <lemon/list_graph.h>
-#include <lemon/lgf_reader.h>
-#include <lemon/graph_utils.h>
-#include <lemon/error.h>
-
-#include "test_tools.h"
-
-using namespace std;
-using namespace lemon;
-
-void digraph_copy_test() {
-  const int nn = 10;
-
-  SmartDigraph from;
-  SmartDigraph::NodeMap<int> fnm(from);
-  SmartDigraph::ArcMap<int> fam(from);
-  SmartDigraph::Node fn = INVALID;
-  SmartDigraph::Arc fa = INVALID;
-
-  std::vector<SmartDigraph::Node> fnv;
-  for (int i = 0; i < nn; ++i) {
-    SmartDigraph::Node node = from.addNode();
-    fnv.push_back(node);
-    fnm[node] = i * i;
-    if (i == 0) fn = node;
-  }
-
-  for (int i = 0; i < nn; ++i) {
-    for (int j = 0; j < nn; ++j) {
-      SmartDigraph::Arc arc = from.addArc(fnv[i], fnv[j]);
-      fam[arc] = i + j * j;
-      if (i == 0 && j == 0) fa = arc;
-    }
-  }
-
-  ListDigraph to;
-  ListDigraph::NodeMap<int> tnm(to);
-  ListDigraph::ArcMap<int> tam(to);
-  ListDigraph::Node tn;
-  ListDigraph::Arc ta;
-
-  SmartDigraph::NodeMap<ListDigraph::Node> nr(from);
-  SmartDigraph::ArcMap<ListDigraph::Arc> er(from);
-
-  ListDigraph::NodeMap<SmartDigraph::Node> ncr(to);
-  ListDigraph::ArcMap<SmartDigraph::Arc> ecr(to);
-
-  DigraphCopy<ListDigraph, SmartDigraph>(to, from).
-    nodeMap(tnm, fnm).arcMap(tam, fam).
-    nodeRef(nr).arcRef(er).
-    nodeCrossRef(ncr).arcCrossRef(ecr).
-    node(tn, fn).arc(ta, fa).run();
-
-  for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) {
-    check(ncr[nr[it]] == it, "Wrong copy.");
-    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
-  }
-
-  for (SmartDigraph::ArcIt it(from); it != INVALID; ++it) {
-    check(ecr[er[it]] == it, "Wrong copy.");
-    check(fam[it] == tam[er[it]], "Wrong copy.");
-    check(nr[from.source(it)] == to.source(er[it]), "Wrong copy.");
-    check(nr[from.target(it)] == to.target(er[it]), "Wrong copy.");
-  }
-
-  for (ListDigraph::NodeIt it(to); it != INVALID; ++it) {
-    check(nr[ncr[it]] == it, "Wrong copy.");
-  }
-
-  for (ListDigraph::ArcIt it(to); it != INVALID; ++it) {
-    check(er[ecr[it]] == it, "Wrong copy.");
-  }
-  check(tn == nr[fn], "Wrong copy.");
-  check(ta == er[fa], "Wrong copy.");
-}
-
-void graph_copy_test() {
-  const int nn = 10;
-
-  SmartGraph from;
-  SmartGraph::NodeMap<int> fnm(from);
-  SmartGraph::ArcMap<int> fam(from);
-  SmartGraph::EdgeMap<int> fem(from);
-  SmartGraph::Node fn = INVALID;
-  SmartGraph::Arc fa = INVALID;
-  SmartGraph::Edge fe = INVALID;
-
-  std::vector<SmartGraph::Node> fnv;
-  for (int i = 0; i < nn; ++i) {
-    SmartGraph::Node node = from.addNode();
-    fnv.push_back(node);
-    fnm[node] = i * i;
-    if (i == 0) fn = node;
-  }
-
-  for (int i = 0; i < nn; ++i) {
-    for (int j = 0; j < nn; ++j) {
-      SmartGraph::Edge edge = from.addEdge(fnv[i], fnv[j]);
-      fem[edge] = i * i + j * j;
-      fam[from.direct(edge, true)] = i + j * j;
-      fam[from.direct(edge, false)] = i * i + j;
-      if (i == 0 && j == 0) fa = from.direct(edge, true);
-      if (i == 0 && j == 0) fe = edge;
-    }
-  }
-  
-  ListGraph to;
-  ListGraph::NodeMap<int> tnm(to);
-  ListGraph::ArcMap<int> tam(to);
-  ListGraph::EdgeMap<int> tem(to);
-  ListGraph::Node tn;
-  ListGraph::Arc ta;
-  ListGraph::Edge te;
-
-  SmartGraph::NodeMap<ListGraph::Node> nr(from);
-  SmartGraph::ArcMap<ListGraph::Arc> ar(from);
-  SmartGraph::EdgeMap<ListGraph::Edge> er(from);
-
-  ListGraph::NodeMap<SmartGraph::Node> ncr(to);
-  ListGraph::ArcMap<SmartGraph::Arc> acr(to);
-  ListGraph::EdgeMap<SmartGraph::Edge> ecr(to);
-
-  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(tn, fn).arc(ta, fa).edge(te, fe).run();
-
-  for (SmartGraph::NodeIt it(from); it != INVALID; ++it) {
-    check(ncr[nr[it]] == it, "Wrong copy.");
-    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
-  }
-
-  for (SmartGraph::ArcIt it(from); it != INVALID; ++it) {
-    check(acr[ar[it]] == it, "Wrong copy.");
-    check(fam[it] == tam[ar[it]], "Wrong copy.");
-    check(nr[from.source(it)] == to.source(ar[it]), "Wrong copy.");
-    check(nr[from.target(it)] == to.target(ar[it]), "Wrong copy.");
-  }
-
-  for (SmartGraph::EdgeIt it(from); it != INVALID; ++it) {
-    check(ecr[er[it]] == it, "Wrong copy.");
-    check(fem[it] == tem[er[it]], "Wrong copy.");
-    check(nr[from.u(it)] == to.u(er[it]) || nr[from.u(it)] == to.v(er[it]), 
-	  "Wrong copy.");
-    check(nr[from.v(it)] == to.u(er[it]) || nr[from.v(it)] == to.v(er[it]), 
-	  "Wrong copy.");
-    check((from.u(it) != from.v(it)) == (to.u(er[it]) != to.v(er[it])), 
-	  "Wrong copy.");
-  }
-
-  for (ListGraph::NodeIt it(to); it != INVALID; ++it) {
-    check(nr[ncr[it]] == it, "Wrong copy.");
-  }
-
-  for (ListGraph::ArcIt it(to); it != INVALID; ++it) {
-    check(ar[acr[it]] == it, "Wrong copy.");
-  }
-  for (ListGraph::EdgeIt it(to); it != INVALID; ++it) {
-    check(er[ecr[it]] == it, "Wrong copy.");
-  }
-  check(tn == nr[fn], "Wrong copy.");
-  check(ta == ar[fa], "Wrong copy.");
-  check(te == er[fe], "Wrong copy.");
-}
-
-
-int main() {
-  digraph_copy_test();
-  graph_copy_test();
-
-  return 0; 
-}
Index: test/heap_test.cc
===================================================================
--- test/heap_test.cc	(revision 203)
+++ test/heap_test.cc	(revision 171)
@@ -25,135 +25,21 @@
 #include <lemon/concepts/heap.h>
 
-#include <lemon/smart_graph.h>
+#include <lemon/list_graph.h>
 
-#include <lemon/lgf_reader.h>
-#include <lemon/dijkstra.h>
-#include <lemon/maps.h>
+#include <lemon/digraph_reader.h>
 
 #include <lemon/bin_heap.h>
+#include <lemon/fib_heap.h>
+#include <lemon/radix_heap.h>
+#include <lemon/bucket_heap.h>
 
 #include "test_tools.h"
 
+#include "heap_test.h"
+
+#include <lemon/time_measure.h>
+
 using namespace lemon;
 using namespace lemon::concepts;
-
-typedef ListDigraph Digraph;
-DIGRAPH_TYPEDEFS(Digraph);
-
-char test_lgf[] = 
-  "@nodes\n" 
-  "label\n"	
-  "0\n"	
-  "1\n"	
-  "2\n"	
-  "3\n"	
-  "4\n"	
-  "5\n"	
-  "6\n"	
-  "7\n"	
-  "8\n"	
-  "9\n"	
-  "@arcs\n" 
-  "		label	capacity\n"	
-  "0	5	0	94\n"	
-  "3	9	1	11\n"	
-  "8	7	2	83\n"	
-  "1	2	3	94\n"	
-  "5	7	4	35\n"	
-  "7	4	5	84\n"	
-  "9	5	6	38\n"	
-  "0	4	7	96\n"	
-  "6	7	8	6\n"	
-  "3	1	9	27\n"	
-  "5	2	10	77\n"	
-  "5	6	11	69\n"	
-  "6	5	12	41\n"	
-  "4	6	13	70\n"	
-  "3	2	14	45\n"	
-  "7	9	15	93\n"	
-  "5	9	16	50\n"	
-  "9	0	17	94\n"	
-  "9	6	18	67\n"	
-  "0	9	19	86\n"	
-  "@attributes\n" 
-  "source 3\n";
-
-int test_seq[] = { 2, 28, 19, 27, 33, 25, 13, 41, 10, 26,  1,  9,  4, 34};
-int test_inc[] = {20, 28, 34, 16,  0, 46, 44,  0, 42, 32, 14,  8,  6, 37};
-
-int test_len = sizeof(test_seq) / sizeof(test_seq[0]);
-
-template <typename Heap>
-void heapSortTest() {
-  RangeMap<int> map(test_len, -1);
-
-  Heap heap(map);
-  
-  std::vector<int> v(test_len);
-
-  for (int i = 0; i < test_len; ++i) {
-    v[i] = test_seq[i];
-    heap.push(i, v[i]);
-  }
-  std::sort(v.begin(), v.end());
-  for (int i = 0; i < test_len; ++i) {
-    check(v[i] == heap.prio() ,"Wrong order in heap sort.");
-    heap.pop();
-  }
-}
-
-template <typename Heap>
-void heapIncreaseTest() {
-  RangeMap<int> map(test_len, -1);
-
-  Heap heap(map);
-  
-  std::vector<int> v(test_len);
-
-  for (int i = 0; i < test_len; ++i) {
-    v[i] = test_seq[i];
-    heap.push(i, v[i]);
-  }
-  for (int i = 0; i < test_len; ++i) {
-    v[i] += test_inc[i];
-    heap.increase(i, v[i]);
-  }
-  std::sort(v.begin(), v.end());
-  for (int i = 0; i < test_len; ++i) {
-    check(v[i] == heap.prio() ,"Wrong order in heap increase test.");
-    heap.pop();
-  }
-}
-
-
-
-template <typename Heap>
-void dijkstraHeapTest(const Digraph& digraph, const IntArcMap& length, 
-		      Node source) {
-  
-  typename Dijkstra<Digraph, IntArcMap>::template DefStandardHeap<Heap>::
-    Create dijkstra(digraph, length);
-
-  dijkstra.run(source);
-
-  for(ArcIt a(digraph); a != INVALID; ++a) {
-    Node s = digraph.source(a); 
-    Node t = digraph.target(a);
-    if (dijkstra.reached(s)) {
-      check( dijkstra.dist(t) - dijkstra.dist(s) <= length[a],
-      	     "Error in a shortest path tree!");
-    }
-  }
-
-  for(NodeIt n(digraph); n != INVALID; ++n) {
-    if ( dijkstra.reached(n) && dijkstra.predArc(n) != INVALID ) {
-      Arc a = dijkstra.predArc(n);
-      Node s = digraph.source(a);
-      check( dijkstra.dist(n) - dijkstra.dist(s) == length[a],
-	     "Error in a shortest path tree!");
-    }
-  }
-
-}
 
 int main() {
@@ -161,25 +47,89 @@
   typedef int Item;
   typedef int Prio;
-  typedef RangeMap<int> ItemIntMap;
+  typedef IntIntMap ItemIntMap;
+
+  typedef ListDigraph Digraph;
+
+  typedef Digraph::Arc Arc;
+  typedef Digraph::Node Node;
+  typedef Digraph::ArcIt ArcIt;
+  typedef Digraph::NodeIt NodeIt;
+  typedef Digraph::ArcMap<int> LengthMap;
+
+  Digraph digraph;
+  LengthMap length(digraph);
+  Node start;
+
+  /// \todo create own test digraph
+
+  std::string f_name;
+  if( getenv("srcdir") )
+    f_name = std::string(getenv("srcdir"));
+  else f_name = ".";
+  f_name += "/test/dijkstra_test.lgf";
   
-  Digraph digraph;
-  IntArcMap length(digraph);
-  Node source;
-
-  std::istringstream input(test_lgf);
-  digraphReader(input, digraph).
-    arcMap("capacity", length).
-    node("source", source).
+  std::ifstream input(f_name.c_str());
+  check(input, "Input file '" << f_name << "' not found.");
+  DigraphReader<Digraph>(input, digraph).
+    readArcMap("capacity", length).
+    readNode("source", start).
     run();  
  
   {
+    std::cout << "Checking Bin Heap" << std::endl;
+
     typedef BinHeap<Prio, ItemIntMap> IntHeap;
     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
-    heapSortTest<IntHeap>();
-    heapIncreaseTest<IntHeap>();
+    heapSortTest<IntHeap>(100);
+    heapIncreaseTest<IntHeap>(100);
     
-    typedef BinHeap<Prio, IntNodeMap > NodeHeap;
-    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
-    dijkstraHeapTest<NodeHeap>(digraph, length, source);
+    typedef FibHeap<Prio, Digraph::NodeMap<int> > NodeHeap;
+    checkConcept<Heap<Prio, Digraph::NodeMap<int> >, NodeHeap>();
+    Timer timer;
+    dijkstraHeapTest<Digraph, LengthMap, NodeHeap>(digraph, length, start);
+    std::cout << timer << std::endl;
+  }
+  {
+    std::cout << "Checking Fib Heap" << std::endl;
+
+    typedef FibHeap<Prio, ItemIntMap> IntHeap;
+    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
+    heapSortTest<IntHeap>(100);
+    heapIncreaseTest<IntHeap>(100);
+
+    typedef FibHeap<Prio, Digraph::NodeMap<int> > NodeHeap;
+    checkConcept<Heap<Prio, Digraph::NodeMap<int> >, NodeHeap>();
+    Timer timer;
+    dijkstraHeapTest<Digraph, LengthMap, NodeHeap>(digraph, length, start);
+    std::cout << timer << std::endl;
+  }
+  {
+    std::cout << "Checking Radix Heap" << std::endl;
+
+    typedef RadixHeap<ItemIntMap> IntHeap;
+    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
+    heapSortTest<IntHeap>(100);
+    heapIncreaseTest<IntHeap>(100);
+
+    typedef RadixHeap<Digraph::NodeMap<int> > NodeHeap;
+    checkConcept<Heap<Prio, Digraph::NodeMap<int> >, NodeHeap>();
+    Timer timer;
+    dijkstraHeapTest<Digraph, LengthMap, NodeHeap>(digraph, length, start);
+    std::cout << timer << std::endl;
+  }
+
+  {
+    std::cout << "Checking Bucket Heap" << std::endl;
+
+    typedef BucketHeap<ItemIntMap> IntHeap;
+    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
+    heapSortTest<IntHeap>(100);
+    heapIncreaseTest<IntHeap>(100);
+
+    typedef BucketHeap<Digraph::NodeMap<int> > NodeHeap;
+    checkConcept<Heap<Prio, Digraph::NodeMap<int> >, NodeHeap>();
+    Timer timer;
+    dijkstraHeapTest<Digraph, LengthMap, NodeHeap>(digraph, length, start);
+    std::cout << timer << std::endl;
   }
 
Index: test/heap_test.h
===================================================================
--- test/heap_test.h	(revision 100)
+++ test/heap_test.h	(revision 100)
@@ -0,0 +1,123 @@
+/* -*- C++ -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#include <vector>
+#include <algorithm>
+
+#include <lemon/dijkstra.h>
+
+class IntIntMap : public std::vector<int> {
+public:
+  typedef std::vector<int> Parent;
+
+  typedef int Key;
+  typedef int Value;
+
+  IntIntMap() : Parent() {}
+  IntIntMap(int n) : Parent(n) {}
+  IntIntMap(int n, int v) : Parent(n, v) {}
+
+  void set(int key, int value) {
+    Parent::operator[](key) = value;
+  }
+};
+
+
+template <typename _Heap>
+void heapSortTest(int n) {
+  typedef _Heap Heap;
+  IntIntMap map(n, -1);
+
+  Heap heap(map);
+  
+  std::vector<int> v(n);
+
+  for (int i = 0; i < n; ++i) {
+    v[i] = rnd[1000];
+    heap.push(i, v[i]);
+  }
+  std::sort(v.begin(), v.end());
+  for (int i = 0; i < n; ++i) {
+    check(v[i] == heap.prio() ,"Wrong order in heap sort.");
+    heap.pop();
+  }
+}
+
+template <typename _Heap>
+void heapIncreaseTest(int n) {
+  typedef _Heap Heap;
+  IntIntMap map(n, -1);
+
+  Heap heap(map);
+  
+  std::vector<int> v(n);
+
+  for (int i = 0; i < n; ++i) {
+    v[i] = rnd[1000];
+    heap.push(i, v[i]);
+  }
+  for (int i = 0; i < n; ++i) {
+    v[i] += rnd[1000];
+    heap.increase(i, v[i]);
+  }
+  std::sort(v.begin(), v.end());
+  for (int i = 0; i < n; ++i) {
+    check(v[i] == heap.prio() ,"Wrong order in heap increase test.");
+    heap.pop();
+  }
+}
+
+
+
+template <typename _Digraph, typename _LengthMap, typename _Heap>
+void dijkstraHeapTest(_Digraph& digraph, _LengthMap& length,
+		      typename _Digraph::Node& start) {
+
+  typedef _Heap Heap;
+  typedef _Digraph Digraph;
+  typedef _LengthMap LengthMap;
+
+  typedef typename Digraph::Node Node;
+  typedef typename Digraph::Arc Arc;
+  typedef typename Digraph::NodeIt NodeIt;
+  typedef typename Digraph::ArcIt ArcIt;
+
+  typename Dijkstra<Digraph, LengthMap>::template DefStandardHeap<Heap>::
+    Create dijkstra(digraph, length);
+
+  dijkstra.run(start);
+
+  for(ArcIt e(digraph); e!=INVALID; ++e) {
+    Node u=digraph.source(e); 
+    Node v=digraph.target(e);
+    if (dijkstra.reached(u)) {
+      check( dijkstra.dist(v) - dijkstra.dist(u) <= length[e],
+      	     "Error in a shortest path tree arc!");
+    }
+  }
+
+  for(NodeIt v(digraph); v!=INVALID; ++v) {
+    if ( dijkstra.reached(v) && dijkstra.predArc(v) != INVALID ) {
+      Arc e=dijkstra.predArc(v);
+      Node u=digraph.source(e);
+      check( dijkstra.dist(v) - dijkstra .dist(u) == length[e],
+	     "Error in a shortest path tree arc!");
+    }
+  }
+
+}
