Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 463)
+++ lemon/maps.h	(revision 606)
@@ -64,7 +64,8 @@
   class NullMap : public MapBase<K, V> {
   public:
-    typedef MapBase<K, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef V Value;
 
     /// Gives back a default constructed element.
@@ -103,7 +104,8 @@
     V _value;
   public:
-    typedef MapBase<K, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef V Value;
 
     /// Default constructor
@@ -169,7 +171,8 @@
   class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
   public:
-    typedef MapBase<K, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef V Value;
 
     /// Constructor.
@@ -203,7 +206,8 @@
   class IdentityMap : public MapBase<T, T> {
   public:
-    typedef MapBase<T, T> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef T Key;
+    ///\e
+    typedef T Value;
 
     /// Gives back the given value without any modification.
@@ -246,9 +250,8 @@
   public:
 
-    typedef MapBase<int, V> Parent;
     /// Key type
-    typedef typename Parent::Key Key;
+    typedef int Key;
     /// Value type
-    typedef typename Parent::Value Value;
+    typedef V Value;
     /// Reference type
     typedef typename Vector::reference Reference;
@@ -354,5 +357,5 @@
   /// The simplest way of using this map is through the sparseMap()
   /// function.
-  template <typename K, typename V, typename Compare = std::less<K> >
+  template <typename K, typename V, typename Comp = std::less<K> >
   class SparseMap : public MapBase<K, V> {
     template <typename K1, typename V1, typename C1>
@@ -360,9 +363,8 @@
   public:
 
-    typedef MapBase<K, V> Parent;
     /// Key type
-    typedef typename Parent::Key Key;
+    typedef K Key;
     /// Value type
-    typedef typename Parent::Value Value;
+    typedef V Value;
     /// Reference type
     typedef Value& Reference;
@@ -374,5 +376,5 @@
   private:
 
-    typedef std::map<K, V, Compare> Map;
+    typedef std::map<K, V, Comp> Map;
     Map _map;
     Value _value;
@@ -490,12 +492,13 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M2::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M2::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
     ComposeMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
 
-    /// \e
+    ///\e
     typename MapTraits<M1>::ConstReturnValue
     operator[](const Key &k) const { return _m1[_m2[k]]; }
@@ -546,12 +549,13 @@
     F _f;
   public:
-    typedef MapBase<typename M1::Key, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef V Value;
 
     /// Constructor
     CombineMap(const M1 &m1, const M2 &m2, const F &f = F())
       : _m1(m1), _m2(m2), _f(f) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _f(_m1[k],_m2[k]); }
   };
@@ -616,11 +620,12 @@
     F _f;
   public:
-    typedef MapBase<K, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef V Value;
 
     /// Constructor
     FunctorToMap(const F &f = F()) : _f(f) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _f(k); }
   };
@@ -670,16 +675,17 @@
     const M &_m;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
-
-    typedef typename Parent::Key argument_type;
-    typedef typename Parent::Value result_type;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
+
+    typedef typename M::Key argument_type;
+    typedef typename M::Value result_type;
 
     /// Constructor
     MapToFunctor(const M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator()(const Key &k) const { return _m[k]; }
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m[k]; }
   };
@@ -710,7 +716,8 @@
     const M &_m;
   public:
-    typedef MapBase<typename M::Key, V> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef V Value;
 
     /// Constructor
@@ -720,5 +727,5 @@
     ConvertMap(const M &m) : _m(m) {}
 
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m[k]; }
   };
@@ -752,7 +759,8 @@
     M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
@@ -798,11 +806,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
     AddMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]+_m2[k]; }
   };
@@ -846,11 +855,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
     SubMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]-_m2[k]; }
   };
@@ -895,11 +905,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
     MulMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]*_m2[k]; }
   };
@@ -943,11 +954,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef typename M1::Value Value;
 
     /// Constructor
     DivMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]/_m2[k]; }
   };
@@ -993,7 +1005,8 @@
     C _v;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
@@ -1003,5 +1016,5 @@
     /// \param v The constant value.
     ShiftMap(const M &m, const C &v) : _m(m), _v(v) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m[k]+_v; }
   };
@@ -1023,7 +1036,8 @@
     C _v;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
@@ -1033,7 +1047,7 @@
     /// \param v The constant value.
     ShiftWriteMap(M &m, const C &v) : _m(m), _v(v) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m[k]+_v; }
-    /// \e
+    ///\e
     void set(const Key &k, const Value &v) { _m.set(k, v-_v); }
   };
@@ -1094,7 +1108,8 @@
     C _v;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
@@ -1104,5 +1119,5 @@
     /// \param v The constant value.
     ScaleMap(const M &m, const C &v) : _m(m), _v(v) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _v*_m[k]; }
   };
@@ -1125,7 +1140,8 @@
     C _v;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
@@ -1135,7 +1151,7 @@
     /// \param v The constant value.
     ScaleWriteMap(M &m, const C &v) : _m(m), _v(v) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _v*_m[k]; }
-    /// \e
+    ///\e
     void set(const Key &k, const Value &v) { _m.set(k, v/_v); }
   };
@@ -1194,11 +1210,12 @@
     const M& _m;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
     NegMap(const M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return -_m[k]; }
   };
@@ -1229,13 +1246,14 @@
     M &_m;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
     NegWriteMap(M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return -_m[k]; }
-    /// \e
+    ///\e
     void set(const Key &k, const Value &v) { _m.set(k, -v); }
   };
@@ -1283,11 +1301,12 @@
     const M &_m;
   public:
-    typedef MapBase<typename M::Key, typename M::Value> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef typename M::Value Value;
 
     /// Constructor
     AbsMap(const M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const {
       Value tmp = _m[k];
@@ -1338,7 +1357,8 @@
   class TrueMap : public MapBase<K, bool> {
   public:
-    typedef MapBase<K, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef bool Value;
 
     /// Gives back \c true.
@@ -1375,7 +1395,8 @@
   class FalseMap : public MapBase<K, bool> {
   public:
-    typedef MapBase<K, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef K Key;
+    ///\e
+    typedef bool Value;
 
     /// Gives back \c false.
@@ -1420,11 +1441,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     AndMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]&&_m2[k]; }
   };
@@ -1468,11 +1490,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     OrMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]||_m2[k]; }
   };
@@ -1507,11 +1530,12 @@
     const M &_m;
   public:
-    typedef MapBase<typename M::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     NotMap(const M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return !_m[k]; }
   };
@@ -1533,13 +1557,14 @@
     M &_m;
   public:
-    typedef MapBase<typename M::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     NotWriteMap(M &m) : _m(m) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return !_m[k]; }
-    /// \e
+    ///\e
     void set(const Key &k, bool v) { _m.set(k, !v); }
   };
@@ -1596,11 +1621,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     EqualMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]==_m2[k]; }
   };
@@ -1644,11 +1670,12 @@
     const M2 &_m2;
   public:
-    typedef MapBase<typename M1::Key, bool> Parent;
-    typedef typename Parent::Key Key;
-    typedef typename Parent::Value Value;
+    ///\e
+    typedef typename M1::Key Key;
+    ///\e
+    typedef bool Value;
 
     /// Constructor
     LessMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {}
-    /// \e
+    ///\e
     Value operator[](const Key &k) const { return _m1[k]<_m2[k]; }
   };
@@ -1706,6 +1733,6 @@
   /// function.
   ///
-  /// \tparam It The type of the iterator.
-  /// \tparam Ke The key type of the map. The default value set
+  /// \tparam IT The type of the iterator.
+  /// \tparam KEY The key type of the map. The default value set
   /// according to the iterator type should work in most cases.
   ///
@@ -1713,15 +1740,18 @@
   /// for the elements or the iterator should be an inserter iterator.
 #ifdef DOXYGEN
-  template <typename It, typename Ke>
+  template <typename IT, typename KEY>
 #else
-  template <typename It,
-            typename Ke=typename _maps_bits::IteratorTraits<It>::Value>
+  template <typename IT,
+            typename KEY = typename _maps_bits::IteratorTraits<IT>::Value>
 #endif
-  class LoggerBoolMap {
-  public:
-    typedef It Iterator;
-
-    typedef Ke Key;
+  class LoggerBoolMap : public MapBase<KEY, bool> {
+  public:
+
+    ///\e
+    typedef KEY Key;
+    ///\e
     typedef bool Value;
+    ///\e
+    typedef IT Iterator;
 
     /// Constructor
@@ -1786,21 +1816,33 @@
   /// @{
 
-  /// Provides an immutable and unique id for each item in the graph.
-
-  /// The IdMap class provides a unique and immutable id for each item of the
-  /// same type (e.g. node) in the graph. This id is <ul><li>\b unique:
-  /// different items (nodes) get different ids <li>\b immutable: the id of an
-  /// item (node) does not change (even if you delete other nodes).  </ul>
-  /// Through this map you get access (i.e. can read) the inner id values of
-  /// the items stored in the graph. This map can be inverted with its member
+  /// \brief Provides an immutable and unique id for each item in a graph.
+  ///
+  /// IdMap provides a unique and immutable id for each item of the
+  /// same type (\c Node, \c Arc or \c Edge) in a graph. This id is 
+  ///  - \b unique: different items get different ids,
+  ///  - \b immutable: the id of an item does not change (even if you
+  ///    delete other nodes).
+  ///
+  /// Using this map you get access (i.e. can read) the inner id values of
+  /// the items stored in the graph, which is returned by the \c id()
+  /// function of the graph. This map can be inverted with its member
   /// class \c InverseMap or with the \c operator() member.
   ///
-  template <typename _Graph, typename _Item>
-  class IdMap {
-  public:
-    typedef _Graph Graph;
+  /// \tparam GR The graph type.
+  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
+  /// \c GR::Edge).
+  ///
+  /// \see DescriptorMap
+  template <typename GR, typename K>
+  class IdMap : public MapBase<K, int> {
+  public:
+    /// The graph type of IdMap.
+    typedef GR Graph;
+    /// The key type of IdMap (\c Node, \c Arc or \c Edge).
+    typedef K Item;
+    /// The key type of IdMap (\c Node, \c Arc or \c Edge).
+    typedef K Key;
+    /// The value type of IdMap.
     typedef int Value;
-    typedef _Item Item;
-    typedef _Item Key;
 
     /// \brief Constructor.
@@ -1814,7 +1856,7 @@
     int operator[](const Item& item) const { return _graph->id(item);}
 
-    /// \brief Gives back the item by its id.
-    ///
-    /// Gives back the item by its id.
+    /// \brief Gives back the \e item by its id.
+    ///
+    /// Gives back the \e item by its id.
     Item operator()(int id) { return _graph->fromId(id, Item()); }
 
@@ -1824,7 +1866,7 @@
   public:
 
-    /// \brief The class represents the inverse of its owner (IdMap).
-    ///
-    /// The class represents the inverse of its owner (IdMap).
+    /// \brief This class represents the inverse of its owner (IdMap).
+    ///
+    /// This class represents the inverse of its owner (IdMap).
     /// \see inverse()
     class InverseMap {
@@ -1844,5 +1886,4 @@
       ///
       /// Gives back the given item from its id.
-      ///
       Item operator[](int id) const { return _graph->fromId(id, Item());}
 
@@ -1855,12 +1896,11 @@
     /// Gives back the inverse of the IdMap.
     InverseMap inverse() const { return InverseMap(*_graph);}
-
-  };
-
-
-  /// \brief General invertable graph-map type.
-
-  /// This type provides simple invertable graph-maps.
-  /// The InvertableMap wraps an arbitrary ReadWriteMap
+  };
+
+
+  /// \brief General invertable graph map type.
+
+  /// This class provides simple invertable graph maps.
+  /// It wraps an arbitrary \ref concepts::ReadWriteMap "ReadWriteMap"
   /// and if a key is set to a new value then store it
   /// in the inverse map.
@@ -1869,32 +1909,35 @@
   /// 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.
+  /// \tparam GR The graph type.
+  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
+  /// \c GR::Edge).
+  /// \tparam V The value type of the map.
   ///
   /// \see IterableValueMap
-  template <typename _Graph, typename _Item, typename _Value>
+  template <typename GR, typename K, typename V>
   class InvertableMap
-    : protected ItemSetTraits<_Graph, _Item>::template Map<_Value>::Type {
+    : protected ItemSetTraits<GR, K>::template Map<V>::Type {
   private:
 
-    typedef typename ItemSetTraits<_Graph, _Item>::
-    template Map<_Value>::Type Map;
-    typedef _Graph Graph;
-
-    typedef std::map<_Value, _Item> Container;
+    typedef typename ItemSetTraits<GR, K>::
+      template Map<V>::Type Map;
+
+    typedef std::map<V, K> 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;
+    /// The graph type of InvertableMap.
+    typedef GR Graph;
+    /// The key type of InvertableMap (\c Node, \c Arc or \c Edge).
+    typedef K Item;
+    /// The key type of InvertableMap (\c Node, \c Arc or \c Edge).
+    typedef K Key;
+    /// The value type of InvertableMap.
+    typedef V Value;
 
     /// \brief Constructor.
     ///
-    /// Construct a new InvertableMap for the graph.
-    ///
+    /// Construct a new InvertableMap for the given graph.
     explicit InvertableMap(const Graph& graph) : Map(graph) {}
 
@@ -1903,6 +1946,5 @@
     /// This iterator is an stl compatible forward
     /// iterator on the values of the map. The values can
-    /// be accessed in the [beginValue, endValue) range.
-    ///
+    /// be accessed in the <tt>[beginValue, endValue)</tt> range.
     class ValueIterator
       : public std::iterator<std::forward_iterator_tag, Value> {
@@ -1936,5 +1978,5 @@
     /// Returns an stl compatible iterator to the
     /// first value of the map. The values of the
-    /// map can be accessed in the [beginValue, endValue)
+    /// map can be accessed in the <tt>[beginValue, endValue)</tt>
     /// range.
     ValueIterator beginValue() const {
@@ -1946,5 +1988,5 @@
     /// Returns an stl compatible iterator after the
     /// last value of the map. The values of the
-    /// map can be accessed in the [beginValue, endValue)
+    /// map can be accessed in the <tt>[beginValue, endValue)</tt>
     /// range.
     ValueIterator endValue() const {
@@ -1952,7 +1994,7 @@
     }
 
-    /// \brief The setter function of the map.
-    ///
-    /// Sets the mapped value.
+    /// \brief Sets the value associated with the given key.
+    ///
+    /// Sets the value associated with the given key.
     void set(const Key& key, const Value& val) {
       Value oldval = Map::operator[](key);
@@ -1965,7 +2007,7 @@
     }
 
-    /// \brief The getter function of the map.
-    ///
-    /// It gives back the value associated with the key.
+    /// \brief Returns the value associated with the given key.
+    ///
+    /// Returns the value associated with the given key.
     typename MapTraits<Map>::ConstReturnValue
     operator[](const Key& key) const {
@@ -1983,7 +2025,7 @@
   protected:
 
-    /// \brief Erase the key from the map.
-    ///
-    /// Erase the key to the map. It is called by the
+    /// \brief Erase the key from the map and the inverse map.
+    ///
+    /// Erase the key from the map and the inverse map. It is called by the
     /// \c AlterationNotifier.
     virtual void erase(const Key& key) {
@@ -1996,7 +2038,7 @@
     }
 
-    /// \brief Erase more keys from the map.
-    ///
-    /// Erase more keys from the map. It is called by the
+    /// \brief Erase more keys from the map and the inverse map.
+    ///
+    /// Erase more keys from the map and the inverse map. It is called by the
     /// \c AlterationNotifier.
     virtual void erase(const std::vector<Key>& keys) {
@@ -2011,7 +2053,7 @@
     }
 
-    /// \brief Clear the keys from the map and inverse map.
-    ///
-    /// Clear the keys from the map and inverse map. It is called by the
+    /// \brief Clear the keys from the map and the inverse map.
+    ///
+    /// Clear the keys from the map and the inverse map. It is called by the
     /// \c AlterationNotifier.
     virtual void clear() {
@@ -2025,8 +2067,8 @@
     ///
     /// The inverse of this map. The subscript operator of the map
-    /// gives back always the item what was last assigned to the value.
+    /// gives back the item that was last assigned to the value.
     class InverseMap {
     public:
-      /// \brief Constructor of the InverseMap.
+      /// \brief Constructor
       ///
       /// Constructor of the InverseMap.
@@ -2041,6 +2083,6 @@
       /// \brief Subscript operator.
       ///
-      /// Subscript operator. It gives back always the item
-      /// what was last assigned to the value.
+      /// Subscript operator. It gives back the item
+      /// that was last assigned to the given value.
       Value operator[](const Key& key) const {
         return _inverted(key);
@@ -2051,7 +2093,7 @@
     };
 
-    /// \brief It gives back the just readable inverse map.
-    ///
-    /// It gives back the just readable inverse map.
+    /// \brief It gives back the read-only inverse map.
+    ///
+    /// It gives back the read-only inverse map.
     InverseMap inverse() const {
       return InverseMap(*this);
@@ -2061,38 +2103,46 @@
 
   /// \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>
+  /// item in a graph.
+  ///
+  /// DescriptorMap provides a unique and continuous (but mutable)
+  /// descriptor (id) for each item of the same type (\c Node, \c Arc or
+  /// \c Edge) in a graph. This id is
+  ///  - \b unique: different items get different ids,
+  ///  - \b continuous: the range of the ids is the set of integers
+  ///    between 0 and \c n-1, where \c n is the number of the items of
+  ///    this type (\c Node, \c Arc or \c Edge). So the id of an item can
+  ///    change if you delete an other item of the same type, i.e. this
+  ///    id is mutable.
+  ///
+  /// Thus this id is not (necessarily) the same as what can get using
+  /// the \c id() function of the graph or \ref IdMap.
+  /// This map can be inverted with its member class \c InverseMap,
+  /// or with the \c operator() member.
+  ///
+  /// \tparam GR The graph type.
+  /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or
+  /// \c GR::Edge).
+  ///
+  /// \see IdMap
+  template <typename GR, typename K>
   class 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;
+    : protected ItemSetTraits<GR, K>::template Map<int>::Type {
+
+    typedef typename ItemSetTraits<GR, K>::template Map<int>::Type Map;
+
+  public:
+    /// The graph type of DescriptorMap.
+    typedef GR Graph;
+    /// The key type of DescriptorMap (\c Node, \c Arc or \c Edge).
+    typedef K Item;
+    /// The key type of DescriptorMap (\c Node, \c Arc or \c Edge).
+    typedef K Key;
     /// The value type of DescriptorMap.
-    typedef typename Map::Value Value;
+    typedef int Value;
 
     /// \brief Constructor.
     ///
     /// Constructor for descriptor map.
-    explicit DescriptorMap(const Graph& _graph) : Map(_graph) {
+    explicit DescriptorMap(const Graph& gr) : Map(gr) {
       Item it;
       const typename Map::Notifier* nf = Map::notifier();
@@ -2105,5 +2155,5 @@
   protected:
 
-    /// \brief Add a new key to the map.
+    /// \brief Adds a new key to the map.
     ///
     /// Add a new key to the map. It is called by the
@@ -2215,4 +2265,5 @@
 
   public:
+
     /// \brief The inverse map type of DescriptorMap.
     ///
@@ -2220,5 +2271,5 @@
     class InverseMap {
     public:
-      /// \brief Constructor of the InverseMap.
+      /// \brief Constructor
       ///
       /// Constructor of the InverseMap.
@@ -2235,5 +2286,5 @@
       ///
       /// Subscript operator. It gives back the item
-      /// that the descriptor belongs to currently.
+      /// that the descriptor currently belongs to.
       Value operator[](const Key& key) const {
         return _inverted(key);
@@ -2259,32 +2310,34 @@
   };
 
-  /// \brief Returns the source of the given arc.
-  ///
-  /// The SourceMap gives back the source Node of the given arc.
+  /// \brief Map of the source nodes of arcs in a digraph.
+  ///
+  /// SourceMap provides access for the source node of each arc in a digraph,
+  /// which is returned by the \c source() function of the digraph.
+  /// \tparam GR The digraph type.
   /// \see TargetMap
-  template <typename Digraph>
+  template <typename GR>
   class SourceMap {
   public:
 
-    typedef typename Digraph::Node Value;
-    typedef typename Digraph::Arc Key;
+    ///\e
+    typedef typename GR::Arc Key;
+    ///\e
+    typedef typename GR::Node Value;
 
     /// \brief Constructor
     ///
-    /// Constructor
+    /// Constructor.
     /// \param digraph The digraph that the map belongs to.
-    explicit SourceMap(const Digraph& digraph) : _digraph(digraph) {}
-
-    /// \brief The subscript operator.
-    ///
-    /// The subscript operator.
-    /// \param arc The arc
-    /// \return The source of the arc
+    explicit SourceMap(const GR& digraph) : _graph(digraph) {}
+
+    /// \brief Returns the source node of the given arc.
+    ///
+    /// Returns the source node of the given arc.
     Value operator[](const Key& arc) const {
-      return _digraph.source(arc);
+      return _graph.source(arc);
     }
 
   private:
-    const Digraph& _digraph;
+    const GR& _graph;
   };
 
@@ -2293,37 +2346,39 @@
   /// This function just returns an \c SourceMap class.
   /// \relates SourceMap
-  template <typename Digraph>
-  inline SourceMap<Digraph> sourceMap(const Digraph& digraph) {
-    return SourceMap<Digraph>(digraph);
-  }
-
-  /// \brief Returns the target of the given arc.
-  ///
-  /// The TargetMap gives back the target Node of the given arc.
+  template <typename GR>
+  inline SourceMap<GR> sourceMap(const GR& graph) {
+    return SourceMap<GR>(graph);
+  }
+
+  /// \brief Map of the target nodes of arcs in a digraph.
+  ///
+  /// TargetMap provides access for the target node of each arc in a digraph,
+  /// which is returned by the \c target() function of the digraph.
+  /// \tparam GR The digraph type.
   /// \see SourceMap
-  template <typename Digraph>
+  template <typename GR>
   class TargetMap {
   public:
 
-    typedef typename Digraph::Node Value;
-    typedef typename Digraph::Arc Key;
+    ///\e
+    typedef typename GR::Arc Key;
+    ///\e
+    typedef typename GR::Node Value;
 
     /// \brief Constructor
     ///
-    /// Constructor
+    /// Constructor.
     /// \param digraph The digraph that the map belongs to.
-    explicit TargetMap(const Digraph& digraph) : _digraph(digraph) {}
-
-    /// \brief The subscript operator.
-    ///
-    /// The subscript operator.
-    /// \param e The arc
-    /// \return The target of the arc
+    explicit TargetMap(const GR& digraph) : _graph(digraph) {}
+
+    /// \brief Returns the target node of the given arc.
+    ///
+    /// Returns the target node of the given arc.
     Value operator[](const Key& e) const {
-      return _digraph.target(e);
+      return _graph.target(e);
     }
 
   private:
-    const Digraph& _digraph;
+    const GR& _graph;
   };
 
@@ -2332,31 +2387,32 @@
   /// This function just returns a \c TargetMap class.
   /// \relates TargetMap
-  template <typename Digraph>
-  inline TargetMap<Digraph> targetMap(const Digraph& digraph) {
-    return TargetMap<Digraph>(digraph);
-  }
-
-  /// \brief Returns the "forward" directed arc view of an edge.
-  ///
-  /// Returns the "forward" directed arc view of an edge.
+  template <typename GR>
+  inline TargetMap<GR> targetMap(const GR& graph) {
+    return TargetMap<GR>(graph);
+  }
+
+  /// \brief Map of the "forward" directed arc view of edges in a graph.
+  ///
+  /// ForwardMap provides access for the "forward" directed arc view of
+  /// each edge in a graph, which is returned by the \c direct() function
+  /// of the graph with \c true parameter.
+  /// \tparam GR The graph type.
   /// \see BackwardMap
-  template <typename Graph>
+  template <typename GR>
   class ForwardMap {
   public:
 
-    typedef typename Graph::Arc Value;
-    typedef typename Graph::Edge Key;
+    typedef typename GR::Arc Value;
+    typedef typename GR::Edge Key;
 
     /// \brief Constructor
     ///
-    /// Constructor
+    /// Constructor.
     /// \param graph The graph that the map belongs to.
-    explicit ForwardMap(const Graph& graph) : _graph(graph) {}
-
-    /// \brief The subscript operator.
-    ///
-    /// The subscript operator.
-    /// \param key An edge
-    /// \return The "forward" directed arc view of edge
+    explicit ForwardMap(const GR& graph) : _graph(graph) {}
+
+    /// \brief Returns the "forward" directed arc view of the given edge.
+    ///
+    /// Returns the "forward" directed arc view of the given edge.
     Value operator[](const Key& key) const {
       return _graph.direct(key, true);
@@ -2364,5 +2420,5 @@
 
   private:
-    const Graph& _graph;
+    const GR& _graph;
   };
 
@@ -2371,31 +2427,32 @@
   /// This function just returns an \c ForwardMap class.
   /// \relates ForwardMap
-  template <typename Graph>
-  inline ForwardMap<Graph> forwardMap(const Graph& graph) {
-    return ForwardMap<Graph>(graph);
-  }
-
-  /// \brief Returns the "backward" directed arc view of an edge.
-  ///
-  /// Returns the "backward" directed arc view of an edge.
+  template <typename GR>
+  inline ForwardMap<GR> forwardMap(const GR& graph) {
+    return ForwardMap<GR>(graph);
+  }
+
+  /// \brief Map of the "backward" directed arc view of edges in a graph.
+  ///
+  /// BackwardMap provides access for the "backward" directed arc view of
+  /// each edge in a graph, which is returned by the \c direct() function
+  /// of the graph with \c false parameter.
+  /// \tparam GR The graph type.
   /// \see ForwardMap
-  template <typename Graph>
+  template <typename GR>
   class BackwardMap {
   public:
 
-    typedef typename Graph::Arc Value;
-    typedef typename Graph::Edge Key;
+    typedef typename GR::Arc Value;
+    typedef typename GR::Edge Key;
 
     /// \brief Constructor
     ///
-    /// Constructor
+    /// Constructor.
     /// \param graph The graph that the map belongs to.
-    explicit BackwardMap(const Graph& graph) : _graph(graph) {}
-
-    /// \brief The subscript operator.
-    ///
-    /// The subscript operator.
-    /// \param key An edge
-    /// \return The "backward" directed arc view of edge
+    explicit BackwardMap(const GR& graph) : _graph(graph) {}
+
+    /// \brief Returns the "backward" directed arc view of the given edge.
+    ///
+    /// Returns the "backward" directed arc view of the given edge.
     Value operator[](const Key& key) const {
       return _graph.direct(key, false);
@@ -2403,5 +2460,5 @@
 
   private:
-    const Graph& _graph;
+    const GR& _graph;
   };
 
@@ -2410,61 +2467,21 @@
   /// This function just returns a \c BackwardMap class.
   /// \relates BackwardMap
-  template <typename Graph>
-  inline BackwardMap<Graph> backwardMap(const Graph& graph) {
-    return BackwardMap<Graph>(graph);
-  }
-
-  /// \brief Potential difference map
-  ///
-  /// If there is an potential map on the nodes then we
-  /// can get an arc map as we get the substraction of the
-  /// values of the target and source.
-  template <typename Digraph, typename NodeMap>
-  class PotentialDifferenceMap {
-  public:
-    typedef typename Digraph::Arc Key;
-    typedef typename NodeMap::Value Value;
-
-    /// \brief Constructor
-    ///
-    /// Contructor of the map
-    explicit PotentialDifferenceMap(const Digraph& digraph,
-                                    const NodeMap& potential)
-      : _digraph(digraph), _potential(potential) {}
-
-    /// \brief Const subscription operator
-    ///
-    /// Const subscription operator
-    Value operator[](const Key& arc) const {
-      return _potential[_digraph.target(arc)] -
-        _potential[_digraph.source(arc)];
-    }
-
-  private:
-    const Digraph& _digraph;
-    const NodeMap& _potential;
-  };
-
-  /// \brief Returns a PotentialDifferenceMap.
-  ///
-  /// This function just returns a PotentialDifferenceMap.
-  /// \relates PotentialDifferenceMap
-  template <typename Digraph, typename NodeMap>
-  PotentialDifferenceMap<Digraph, NodeMap>
-  potentialDifferenceMap(const Digraph& digraph, const NodeMap& potential) {
-    return PotentialDifferenceMap<Digraph, NodeMap>(digraph, potential);
-  }
-
-  /// \brief Map of the node in-degrees.
+  template <typename GR>
+  inline BackwardMap<GR> backwardMap(const GR& graph) {
+    return BackwardMap<GR>(graph);
+  }
+
+  /// \brief Map of the in-degrees of nodes in a digraph.
   ///
   /// This map returns the in-degree of a node. Once it is constructed,
-  /// the degrees are stored in a standard NodeMap, so each query is done
+  /// the degrees are stored in a standard \c NodeMap, so each query is done
   /// in constant time. On the other hand, the values are updated automatically
   /// whenever the digraph changes.
   ///
-  /// \warning Besides addNode() and addArc(), a digraph structure may provide
-  /// alternative ways to modify the digraph. The correct behavior of InDegMap
-  /// is not guarantied if these additional features are used. For example
-  /// the functions \ref ListDigraph::changeSource() "changeSource()",
+  /// \warning Besides \c addNode() and \c addArc(), a digraph structure 
+  /// may provide alternative ways to modify the digraph.
+  /// The correct behavior of InDegMap is not guarantied if these additional
+  /// features are used. For example the functions
+  /// \ref ListDigraph::changeSource() "changeSource()",
   /// \ref ListDigraph::changeTarget() "changeTarget()" and
   /// \ref ListDigraph::reverseArc() "reverseArc()"
@@ -2472,15 +2489,17 @@
   ///
   /// \sa OutDegMap
-
-  template <typename _Digraph>
+  template <typename GR>
   class InDegMap
-    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
+    : protected ItemSetTraits<GR, typename GR::Arc>
       ::ItemNotifier::ObserverBase {
 
   public:
-
-    typedef _Digraph Digraph;
+    
+    /// The digraph type
+    typedef GR Digraph;
+    /// The key type
+    typedef typename Digraph::Node Key;
+    /// The value type
     typedef int Value;
-    typedef typename Digraph::Node Key;
 
     typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
@@ -2524,7 +2543,7 @@
     /// \brief Constructor.
     ///
-    /// Constructor for creating in-degree map.
-    explicit InDegMap(const Digraph& digraph)
-      : _digraph(digraph), _deg(digraph) {
+    /// Constructor for creating an in-degree map.
+    explicit InDegMap(const Digraph& graph)
+      : _digraph(graph), _deg(graph) {
       Parent::attach(_digraph.notifier(typename Digraph::Arc()));
 
@@ -2534,4 +2553,6 @@
     }
 
+    /// \brief Gives back the in-degree of a Node.
+    ///
     /// Gives back the in-degree of a Node.
     int operator[](const Key& key) const {
@@ -2580,15 +2601,16 @@
   };
 
-  /// \brief Map of the node out-degrees.
+  /// \brief Map of the out-degrees of nodes in a digraph.
   ///
   /// This map returns the out-degree of a node. Once it is constructed,
-  /// the degrees are stored in a standard NodeMap, so each query is done
+  /// the degrees are stored in a standard \c NodeMap, so each query is done
   /// in constant time. On the other hand, the values are updated automatically
   /// whenever the digraph changes.
   ///
-  /// \warning Besides addNode() and addArc(), a digraph structure may provide
-  /// alternative ways to modify the digraph. The correct behavior of OutDegMap
-  /// is not guarantied if these additional features are used. For example
-  /// the functions \ref ListDigraph::changeSource() "changeSource()",
+  /// \warning Besides \c addNode() and \c addArc(), a digraph structure 
+  /// may provide alternative ways to modify the digraph.
+  /// The correct behavior of OutDegMap is not guarantied if these additional
+  /// features are used. For example the functions
+  /// \ref ListDigraph::changeSource() "changeSource()",
   /// \ref ListDigraph::changeTarget() "changeTarget()" and
   /// \ref ListDigraph::reverseArc() "reverseArc()"
@@ -2596,15 +2618,17 @@
   ///
   /// \sa InDegMap
-
-  template <typename _Digraph>
+  template <typename GR>
   class OutDegMap
-    : protected ItemSetTraits<_Digraph, typename _Digraph::Arc>
+    : protected ItemSetTraits<GR, typename GR::Arc>
       ::ItemNotifier::ObserverBase {
 
   public:
 
-    typedef _Digraph Digraph;
+    /// The digraph type
+    typedef GR Digraph;
+    /// The key type
+    typedef typename Digraph::Node Key;
+    /// The value type
     typedef int Value;
-    typedef typename Digraph::Node Key;
 
     typedef typename ItemSetTraits<Digraph, typename Digraph::Arc>
@@ -2646,7 +2670,7 @@
     /// \brief Constructor.
     ///
-    /// Constructor for creating out-degree map.
-    explicit OutDegMap(const Digraph& digraph)
-      : _digraph(digraph), _deg(digraph) {
+    /// Constructor for creating an out-degree map.
+    explicit OutDegMap(const Digraph& graph)
+      : _digraph(graph), _deg(graph) {
       Parent::attach(_digraph.notifier(typename Digraph::Arc()));
 
@@ -2656,4 +2680,6 @@
     }
 
+    /// \brief Gives back the out-degree of a Node.
+    ///
     /// Gives back the out-degree of a Node.
     int operator[](const Key& key) const {
@@ -2702,4 +2728,54 @@
   };
 
+  /// \brief Potential difference map
+  ///
+  /// PotentialMap returns the difference between the potentials of the
+  /// source and target nodes of each arc in a digraph, i.e. it returns
+  /// \code
+  ///   potential[gr.target(arc)] - potential[gr.source(arc)].
+  /// \endcode
+  /// \tparam GR The digraph type.
+  /// \tparam POT A node map storing the potentials.
+  template <typename GR, typename POT>
+  class PotentialDifferenceMap {
+  public:
+    /// Key type
+    typedef typename GR::Arc Key;
+    /// Value type
+    typedef typename POT::Value Value;
+
+    /// \brief Constructor
+    ///
+    /// Contructor of the map.
+    explicit PotentialDifferenceMap(const GR& gr,
+                                    const POT& potential)
+      : _digraph(gr), _potential(potential) {}
+
+    /// \brief Returns the potential difference for the given arc.
+    ///
+    /// Returns the potential difference for the given arc, i.e.
+    /// \code
+    ///   potential[gr.target(arc)] - potential[gr.source(arc)].
+    /// \endcode
+    Value operator[](const Key& arc) const {
+      return _potential[_digraph.target(arc)] -
+        _potential[_digraph.source(arc)];
+    }
+
+  private:
+    const GR& _digraph;
+    const POT& _potential;
+  };
+
+  /// \brief Returns a PotentialDifferenceMap.
+  ///
+  /// This function just returns a PotentialDifferenceMap.
+  /// \relates PotentialDifferenceMap
+  template <typename GR, typename POT>
+  PotentialDifferenceMap<GR, POT>
+  potentialDifferenceMap(const GR& gr, const POT& potential) {
+    return PotentialDifferenceMap<GR, POT>(gr, potential);
+  }
+
   /// @}
 }
