Index: src/work/alpar/emptygraph.h
===================================================================
--- src/work/alpar/emptygraph.h	(revision 183)
+++ src/work/alpar/emptygraph.h	(revision 186)
@@ -13,6 +13,6 @@
   /// An empty graph class.
   
-  /// This class provides all the common features of a grapf structure,
-  /// however completely without implementations or real data structures
+  /// This class provides all the common features of a graph structure,
+  /// however completely without implementations and real data structures
   /// behind the interface.
   /// All graph algorithms should compile with this class, but it will not
@@ -32,5 +32,5 @@
     /// The base type of the node iterators.
 
-    /// This \c Node is the base type of each node iterators,
+    /// This is the base type of each node iterators,
     /// thus each kind of node iterator will convert to this.
     class Node {
@@ -59,4 +59,12 @@
     
     /// This iterator goes through each node.
+
+    /// This iterator goes through each node.
+    /// Its usage is quite simple, for example you can count the number
+    /// of nodes in graph \c G of type \c Graph like this:
+    /// \code
+    ///int count=0;
+    ///for(Graph::NodeIt n(G);G.valid(n);G.next(n)) count++;
+    /// \endcode
     class NodeIt : public Node {
     public:
@@ -92,5 +100,15 @@
     };
     
-    /// This iterator goes trought the outgoing edges of a certain graph.
+    /// This iterator goes trought the outgoing edges of a node.
+
+    /// This iterator goes trought the \e outgoing edges of a certain node
+    /// of a graph.
+    /// Its usage is quite simple, for example you can count the number
+    /// of outgoing edges of a node \c n
+    /// in graph \c G of type \c Graph as follows.
+    /// \code
+    ///int count=0;
+    ///for(Graph::OutEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
+    /// \endcode
     
     class OutEdgeIt : public Edge {
@@ -110,4 +128,16 @@
     };
 
+    /// This iterator goes trought the incoming edges of a node.
+
+    /// This iterator goes trought the \e incoming edges of a certain node
+    /// of a graph.
+    /// Its usage is quite simple, for example you can count the number
+    /// of outgoing edges of a node \c n
+    /// in graph \c G of type \c Graph as follows.
+    /// \code
+    ///int count=0;
+    ///for(Graph::InEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
+    /// \endcode
+
     class InEdgeIt : public Edge {
     public:
@@ -120,4 +150,14 @@
     };
     //  class SymEdgeIt : public Edge {};
+
+    /// This iterator goes through each edge.
+
+    /// This iterator goes through each edge of a graph.
+    /// Its usage is quite simple, for example you can count the number
+    /// of edges in a graph \c G of type \c Graph as follows:
+    /// \code
+    ///int count=0;
+    ///for(Graph::EdgeIt e(G);G.valid(e);G.next(e)) count++;
+    /// \endcode
     class EdgeIt : public Edge {
     public:
@@ -174,6 +214,12 @@
 
     /// Checks if a node iterator is valid
+
+    ///\todo Maybe, it would be better if iterator converted to
+    ///bool directly, as Jacint prefers.
     bool valid(const Node) const { return true;}
     /// Checks if an edge iterator is valid
+
+    ///\todo Maybe, it would be better if iterator converted to
+    ///bool directly, as Jacint prefers.
     bool valid(const Edge) const { return true;}
 
@@ -195,4 +241,5 @@
 
     /// \return the new node.
+    ///
     Node addNode() { return INVALID;}
     ///Add a new edge to the graph.
@@ -228,6 +275,8 @@
   
 
-    ///Read/write map of the nodes to type \c T.
-
+    ///Read/write/reference map of the nodes to type \c T.
+
+    ///Read/write/reference map of the nodes to type \c T.
+    /// \sa MemoryMapSkeleton
     /// \todo We may need copy constructor
     /// \todo We may need conversion from other nodetype
@@ -263,8 +312,13 @@
     };
 
-    ///Read/write map of the edges to type \c T.
-
-    ///Read/write map of the edges to type \c T.
-    ///It behaves exactly the same way as \ref NodeMap.
+    ///Read/write/reference map of the edges to type \c T.
+
+    ///Read/write/reference map of the edges to type \c T.
+    ///It behaves exactly in the same way as \ref NodeMap.
+    /// \sa NodeMap
+    /// \sa MemoryMapSkeleton
+    /// \todo We may need copy constructor
+    /// \todo We may need conversion from other edgetype
+    /// \todo We may need operator=
     template<class T> class EdgeMap
     {
Index: src/work/alpar/mapskeleton.h
===================================================================
--- src/work/alpar/mapskeleton.h	(revision 186)
+++ src/work/alpar/mapskeleton.h	(revision 186)
@@ -0,0 +1,80 @@
+// -*- c++ -*-
+#ifndef HUGO_MAPSKELETON_H
+#define HUGO_MAPSKELETON_H
+
+namespace hugo {
+  
+  ///Readable map skeleton
+  template<typename K, typename T>
+  class ReadMapSkeleton
+  {
+  public:
+    /// Map value type.
+    typedef T ValueType;
+    /// Map key type.
+    typedef K KeyType;
+
+    ///Default constructor.
+    ReadMapSkeleton() {}
+    
+    ///Reads an element of the map.
+    ValueType get(const KeyType &i) const {return ValueType();}
+  };
+
+
+  ///Writeable map skeleton
+  template<typename K, typename T>
+  class WriteMapSkeleton 
+  {
+  public:
+    /// Map value type.
+    typedef T ValueType;
+    /// Map key type.
+    typedef K KeyType;
+
+    ///Default constructor.
+    WriteMapSkeleton() {}
+    ///'Fill with' constructor.
+    WriteMapSkeleton(const ValueType &t) {}
+    
+    ///Write an element of a map.
+    void set(const KeyType &i,const ValueType &t) {}
+  };
+
+  ///Read/Write map skeleton.
+  template<typename K, typename T>
+  class ReadWriteMapSkeleton : public ReadMapSkeleton<K,T>,
+			       public WriteMapSkeleton<K,T>
+  {
+  public:
+    ///Default constructor.
+    ReadWriteMapSkeleton() : ReadMapSkeleton(), WriteMapSkeleton() {}
+    ///'Fill with' constructor.
+    ReadWriteMap(const ValueType &t) :ReadMapSkeleton(), WriteMapSkeleton(t) {}
+  };
+  
+  
+  ///Dereferable map skeleton
+  template<typename K, typename T>
+  class MemoryMapSkeleton : public ReadWriteMapSkeleton<K,T>
+  {
+  public:
+    /// Map value type.
+    typedef T ValueType;
+    /// Map key type.
+    typedef K KeyType;
+
+    ///Default constructor.
+    ReferenceMapSkeleton() : ReadWriteMapSkeleton() {}
+    ///'Fill with' constructor.
+    ReferenceMapSkeleton(const ValueType &t) : ReadWriteMapSkeleton(t) {}    
+
+    ///Give a reference to the value belonging to a key.
+    ValueType &operator[](const KeyType &i) {return *(ValueType*)0;}
+    //    const ValueType &operator[](const KeyType &i) const {return *(T*)0;}
+  };
+
+
+
+}
+#endif // HUGO_MAPSKELETON_H
Index: src/work/alpar/smart_graph.h
===================================================================
--- src/work/alpar/smart_graph.h	(revision 185)
+++ src/work/alpar/smart_graph.h	(revision 186)
@@ -13,6 +13,12 @@
   class SymSmartGraph;
 
-  //  template<typename T> class SymSmartGraph::SymEdgeMap;
-  
+  ///A smart graph class.
+
+  ///This is a simple and fast graph implementation.
+  ///It is also quite memory efficient, but at the price
+  ///that <b> it does not support node and edge deletion</b>.
+  ///Apart from this it conforms to the graph interface documented under
+  ///the description of \ref GraphSkeleton.
+  ///\sa \ref GraphSkeleton.
   class SmartGraph {
 
@@ -56,5 +62,5 @@
     //  protected:
     // HELPME:
-  public:
+  protected:
     ///\bug It must be public because of SymEdgeMap.
     ///
@@ -100,8 +106,11 @@
     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
 
+    ///\bug This function does something different than
+    ///its name would suggests...
     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
+    ///\bug This function does something different than
+    ///its name would suggests...
     int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
 
-    
     Node tail(Edge e) const { return edges[e.n].tail; }
     Node head(Edge e) const { return edges[e.n].head; }
@@ -481,13 +490,26 @@
   ///The purpose of this graph structure is to handle graphs
   ///having bidirectional edges. Here the function \c addEdge(u,v) adds a pair
-  ///of oppositely directed edges. You can define edge maps which
-  ///stores a common value for the edge pairs. The usual edge maps can be used
+  ///of oppositely directed edges.
+  ///There is a new edge map type called
+  ///\ref SymSmartGraph::SymEdgeMap "SymEdgeMap"
+  ///that complements this
+  ///feature by
+  ///storing shared values for the edge pairs. The usual
+  ///\ref GraphSkeleton::EdgeMap "EdgeMap"
+  ///can be used
   ///as well.
   ///
-  ///The oppositely directed edge can also be obtained easily.
+  ///The oppositely directed edge can also be obtained easily
+  ///using \ref opposite.
+  ///\warning It shares the similarity with \ref SmartGraph that
+  ///it is not possible to delete edges or nodes from the graph.
+  //\sa \ref SmartGraph.
 
   class SymSmartGraph : public SmartGraph
   {
   public:
+    template<typename T> class SymEdgeMap;
+    template<typename T> friend class SymEdgeMap;
+
     SymSmartGraph() : SmartGraph() { }
     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
@@ -499,4 +521,8 @@
     }
 
+    ///The oppositely directed edge.
+
+    ///Returns the oppositely directed
+    ///pair of the edge \c e.
     Edge opposite(Edge e) const
     {
@@ -506,4 +532,8 @@
     }
     
+    ///Common data storage for the edge pairs.
+
+    ///This map makes it possible to store data shared by the oppositely
+    ///directed pairs of edges.
     template <typename T> class SymEdgeMap : public DynMapBase<Edge>
     {
@@ -514,10 +544,10 @@
       typedef Edge KeyType;
 
-      SymEdgeMap(const SmartGraph &_G) :
+      SymEdgeMap(const SymSmartGraph &_G) :
 	DynMapBase<Edge>(_G), container(_G.maxEdgeId()/2)
       {
-	G->dyn_edge_maps.push_back(this);
-      }
-      SymEdgeMap(const SmartGraph &_G,const T &t) :
+	static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.push_back(this);
+      }
+      SymEdgeMap(const SymSmartGraph &_G,const T &t) :
 	DynMapBase<Edge>(_G), container(_G.maxEdgeId()/2,t)
       {
@@ -551,11 +581,12 @@
 	if(G) {
 	  std::vector<DynMapBase<Edge>* >::iterator i;
-	  for(i=G->dyn_edge_maps.begin();
-	      i!=G->dyn_edge_maps.end() && *i!=this; ++i) ;
+	  for(i=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.begin();
+	      i!=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.end()
+		&& *i!=this; ++i) ;
 	  //if(*i==this) G->dyn_edge_maps.erase(i); //Way too slow...
 	  //A better way to do that: (Is this really important?)
 	  if(*i==this) {
-	    *i=G->dyn_edge_maps.back();
-	    G->dyn_edge_maps.pop_back();
+	    *i=static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.back();
+	    static_cast<const SymSmartGraph*>(G)->dyn_edge_maps.pop_back();
 	  }
 	}
