Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 552)
+++ CMakeLists.txt	(revision 619)
@@ -26,10 +26,4 @@
 # C4996: 'function': was declared deprecated
 ENDIF(MSVC)
-
-IF(GLPK_FOUND)
-  SET(HAVE_LP TRUE)
-  SET(HAVE_MIP TRUE)
-  SET(HAVE_GLPK TRUE)
-ENDIF(GLPK_FOUND)
 
 INCLUDE(CheckTypeSize)
Index: cmake/FindGLPK.cmake
===================================================================
--- cmake/FindGLPK.cmake	(revision 473)
+++ cmake/FindGLPK.cmake	(revision 619)
@@ -14,4 +14,5 @@
 
 IF(GLPK_FOUND)
+  SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
   SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
   SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
@@ -19,2 +20,8 @@
 
 MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
+
+IF(GLPK_FOUND)
+  SET(HAVE_LP TRUE)
+  SET(HAVE_MIP TRUE)
+  SET(HAVE_GLPK TRUE)
+ENDIF(GLPK_FOUND)
Index: demo/graph_to_eps_demo.cc
===================================================================
--- demo/graph_to_eps_demo.cc	(revision 612)
+++ demo/graph_to_eps_demo.cc	(revision 440)
@@ -183,5 +183,5 @@
   ListDigraph::NodeMap<Point> hcoords(h);
 
-  int cols=int(std::sqrt(double(palette.size())));
+  int cols=int(sqrt(double(palette.size())));
   for(int i=0;i<int(paletteW.size());i++) {
     Node n=h.addNode();
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 549)
+++ lemon/CMakeLists.txt	(revision 619)
@@ -21,5 +21,5 @@
 IF(HAVE_GLPK)
   SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
-  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
   IF(WIN32)
     INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
Index: lemon/adaptors.h
===================================================================
--- lemon/adaptors.h	(revision 617)
+++ lemon/adaptors.h	(revision 579)
@@ -110,9 +110,11 @@
     template <typename V>
     class NodeMap : public DGR::template NodeMap<V> {
+    public:
+
       typedef typename DGR::template NodeMap<V> Parent;
 
-    public:
       explicit NodeMap(const Adaptor& adaptor)
         : Parent(*adaptor._digraph) {}
+
       NodeMap(const Adaptor& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) { }
@@ -133,9 +135,11 @@
     template <typename V>
     class ArcMap : public DGR::template ArcMap<V> {
+    public:
+
       typedef typename DGR::template ArcMap<V> Parent;
 
-    public:
       explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor)
         : Parent(*adaptor._digraph) {}
+
       ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value)
         : Parent(*adaptor._digraph, value) {}
@@ -252,7 +256,6 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
       explicit NodeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -275,7 +278,6 @@
     template <typename V>
     class ArcMap : public GR::template ArcMap<V> {
+    public:
       typedef typename GR::template ArcMap<V> Parent;
-
-    public:
       explicit ArcMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -297,7 +299,6 @@
     template <typename V>
     class EdgeMap : public GR::template EdgeMap<V> {
+    public:
       typedef typename GR::template EdgeMap<V> Parent;
-
-    public:
       explicit EdgeMap(const GraphAdaptorBase<GR>& adapter)
         : Parent(*adapter._graph) {}
@@ -321,7 +322,7 @@
   template <typename DGR>
   class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
+  public:
+    typedef DGR Digraph;
     typedef DigraphAdaptorBase<DGR> Parent;
-  public:
-    typedef DGR Digraph;
   protected:
     ReverseDigraphBase() : Parent() { }
@@ -374,8 +375,8 @@
     public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
 #endif
-    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
   public:
     /// The type of the adapted digraph.
     typedef DGR Digraph;
+    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
   protected:
     ReverseDigraph() { }
@@ -403,5 +404,4 @@
   template <typename DGR, typename NF, typename AF, bool ch = true>
   class SubDigraphBase : public DigraphAdaptorBase<DGR> {
-    typedef DigraphAdaptorBase<DGR> Parent;
   public:
     typedef DGR Digraph;
@@ -410,4 +410,5 @@
 
     typedef SubDigraphBase Adaptor;
+    typedef DigraphAdaptorBase<DGR> Parent;
   protected:
     NF* _node_filter;
@@ -509,9 +510,8 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
 	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
-      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
-	LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
-
     public:
       typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
+	    LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
 
       NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
@@ -536,9 +536,8 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
 	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
         LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
@@ -564,5 +563,4 @@
   class SubDigraphBase<DGR, NF, AF, false>
     : public DigraphAdaptorBase<DGR> {
-    typedef DigraphAdaptorBase<DGR> Parent;
   public:
     typedef DGR Digraph;
@@ -571,4 +569,5 @@
 
     typedef SubDigraphBase Adaptor;
+    typedef DigraphAdaptorBase<Digraph> Parent;
   protected:
     NF* _node_filter;
@@ -652,9 +651,8 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
           LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
         LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
@@ -679,9 +677,8 @@
       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
           LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
-      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
-        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
-
     public:
       typedef V Value;
+      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
+          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
 
       ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
@@ -867,5 +864,4 @@
   template <typename GR, typename NF, typename EF, bool ch = true>
   class SubGraphBase : public GraphAdaptorBase<GR> {
-    typedef GraphAdaptorBase<GR> Parent;
   public:
     typedef GR Graph;
@@ -874,4 +870,5 @@
 
     typedef SubGraphBase Adaptor;
+    typedef GraphAdaptorBase<GR> Parent;
   protected:
 
@@ -1020,9 +1017,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
@@ -1047,9 +1043,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
@@ -1074,9 +1069,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
@@ -1103,5 +1097,4 @@
   class SubGraphBase<GR, NF, EF, false>
     : public GraphAdaptorBase<GR> {
-    typedef GraphAdaptorBase<GR> Parent;
   public:
     typedef GR Graph;
@@ -1110,4 +1103,5 @@
 
     typedef SubGraphBase Adaptor;
+    typedef GraphAdaptorBase<GR> Parent;
   protected:
     NF* _node_filter;
@@ -1218,9 +1212,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
@@ -1245,9 +1238,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
           LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
+    public:
+      typedef V Value;
       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
-
-    public:
-      typedef V Value;
 
       ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
@@ -1272,9 +1264,8 @@
       : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
-      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
-	LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
-
     public:
       typedef V Value;
+      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
+		  LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
 
       EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
@@ -1495,12 +1486,12 @@
                      true> > {
 #endif
+  public:
+
+    typedef GR Digraph;
+    typedef NF NodeFilterMap;
+
     typedef DigraphAdaptorExtender<
       SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
                      true> > Parent;
-
-  public:
-
-    typedef GR Digraph;
-    typedef NF NodeFilterMap;
 
     typedef typename Parent::Node Node;
@@ -1558,15 +1549,12 @@
                    true> > {
 
+  public:
+    typedef GR Graph;
+    typedef NF NodeFilterMap;
     typedef GraphAdaptorExtender<
       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
                    true> > Parent;
 
-  public:
-
-    typedef GR Graph;
-    typedef NF NodeFilterMap;
-
     typedef typename Parent::Node Node;
-
   protected:
     ConstMap<typename GR::Edge, Const<bool, true> > const_true_map;
@@ -1642,14 +1630,13 @@
                      AF, false> > {
 #endif
-    typedef DigraphAdaptorExtender<
-      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
-                     AF, false> > Parent;
-
-  public:
-
+  public:
     /// The type of the adapted digraph.
     typedef DGR Digraph;
     /// The type of the arc filter map.
     typedef AF ArcFilterMap;
+
+    typedef DigraphAdaptorExtender<
+      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
+                     AF, false> > Parent;
 
     typedef typename Parent::Arc Arc;
@@ -1752,14 +1739,13 @@
                    EF, false> > {
 #endif
-    typedef GraphAdaptorExtender<
-      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
-                   EF, false> > Parent;
-
-  public:
-
+  public:
     /// The type of the adapted graph.
     typedef GR Graph;
     /// The type of the edge filter map.
     typedef EF EdgeFilterMap;
+
+    typedef GraphAdaptorExtender<
+      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
+                   EF, false> > Parent;
 
     typedef typename Parent::Edge Edge;
@@ -2126,8 +2112,8 @@
     template <typename V>
     class NodeMap : public DGR::template NodeMap<V> {
-      typedef typename DGR::template NodeMap<V> Parent;
-
     public:
+
       typedef V Value;
+      typedef typename DGR::template NodeMap<Value> Parent;
 
       explicit NodeMap(const UndirectorBase<DGR>& adaptor)
@@ -2152,9 +2138,9 @@
     template <typename V>
     class ArcMap
-      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > {
-      typedef SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > Parent;
-
+      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> >
+    {
     public:
       typedef V Value;
+      typedef SubMapExtender<Adaptor, ArcMapBase<V> > Parent;
 
       explicit ArcMap(const UndirectorBase<DGR>& adaptor)
@@ -2178,8 +2164,8 @@
     template <typename V>
     class EdgeMap : public Digraph::template ArcMap<V> {
+    public:
+
+      typedef V Value;
       typedef typename Digraph::template ArcMap<V> Parent;
-
-    public:
-      typedef V Value;
 
       explicit EdgeMap(const UndirectorBase<DGR>& adaptor)
@@ -2253,8 +2239,8 @@
     public GraphAdaptorExtender<UndirectorBase<DGR> > {
 #endif
-    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   public:
     /// The type of the adapted digraph.
     typedef DGR Digraph;
+    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   protected:
     Undirector() { }
@@ -2464,7 +2450,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
+
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
 
       explicit NodeMap(const OrienterBase<GR, DM>& adapter)
@@ -2489,7 +2475,7 @@
     template <typename V>
     class ArcMap : public GR::template EdgeMap<V> {
+    public:
+
       typedef typename Graph::template EdgeMap<V> Parent;
-
-    public:
 
       explicit ArcMap(const OrienterBase<GR, DM>& adapter)
@@ -2561,5 +2547,4 @@
     public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
 #endif
-    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
   public:
 
@@ -2569,9 +2554,8 @@
     typedef DM DirectionMap;
 
+    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
     typedef typename Parent::Arc Arc;
-
   protected:
     Orienter() { }
-
   public:
 
@@ -2883,9 +2867,8 @@
   template <typename DGR>
   class SplitNodesBase {
+  public:
+
+    typedef DGR Digraph;
     typedef DigraphAdaptorBase<const DGR> Parent;
-
-  public:
-
-    typedef DGR Digraph;
     typedef SplitNodesBase Adaptor;
 
@@ -3246,9 +3229,9 @@
     template <typename V>
     class NodeMap
-      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > {
-      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > Parent;
-
+      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> >
+    {
     public:
       typedef V Value;
+      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<Value> > Parent;
 
       NodeMap(const SplitNodesBase<DGR>& adaptor)
@@ -3272,9 +3255,9 @@
     template <typename V>
     class ArcMap
-      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > {
-      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > Parent;
-
+      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> >
+    {
     public:
       typedef V Value;
+      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<Value> > Parent;
 
       ArcMap(const SplitNodesBase<DGR>& adaptor)
@@ -3342,8 +3325,7 @@
     : public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
 #endif
+  public:
+    typedef DGR Digraph;
     typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
-
-  public:
-    typedef DGR Digraph;
 
     typedef typename DGR::Node DigraphNode;
Index: lemon/bits/array_map.h
===================================================================
--- lemon/bits/array_map.h	(revision 617)
+++ lemon/bits/array_map.h	(revision 503)
@@ -48,5 +48,5 @@
   public:
     // The graph type.
-    typedef _Graph GraphType;
+    typedef _Graph Graph;
     // The item type.
     typedef _Item Item;
@@ -64,15 +64,11 @@
     typedef _Value& Reference;
 
-    // The map type.
-    typedef ArrayMap Map;
-
     // The notifier type.
     typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
 
-  private:
-  
     // The MapBase of the Map which imlements the core regisitry function.
     typedef typename Notifier::ObserverBase Parent;
 
+  private:
     typedef std::allocator<Value> Allocator;
 
@@ -82,5 +78,5 @@
     //
     // Graph initialized map constructor.
-    explicit ArrayMap(const GraphType& graph) {
+    explicit ArrayMap(const Graph& graph) {
       Parent::attach(graph.notifier(Item()));
       allocate_memory();
@@ -96,5 +92,5 @@
     //
     // It constructs a map and initialize all of the the map.
-    ArrayMap(const GraphType& graph, const Value& value) {
+    ArrayMap(const Graph& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
       allocate_memory();
Index: lemon/bits/base_extender.h
===================================================================
--- lemon/bits/base_extender.h	(revision 617)
+++ lemon/bits/base_extender.h	(revision 440)
@@ -39,8 +39,8 @@
   template <typename Base>
   class UndirDigraphExtender : public Base {
+
+  public:
+
     typedef Base Parent;
-
-  public:
-
     typedef typename Parent::Arc Edge;
     typedef typename Parent::Node Node;
@@ -281,7 +281,6 @@
   template <typename Base>
   class BidirBpGraphExtender : public Base {
+  public:
     typedef Base Parent;
-
-  public:
     typedef BidirBpGraphExtender Digraph;
 
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 617)
+++ lemon/bits/default_map.h	(revision 535)
@@ -154,14 +154,13 @@
   class DefaultMap
     : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
+  public:
     typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
+    typedef DefaultMap<_Graph, _Item, _Value> Map;
 
-  public:
-    typedef DefaultMap<_Graph, _Item, _Value> Map;
-    
-    typedef typename Parent::GraphType GraphType;
+    typedef typename Parent::Graph Graph;
     typedef typename Parent::Value Value;
 
-    explicit DefaultMap(const GraphType& graph) : Parent(graph) {}
-    DefaultMap(const GraphType& graph, const Value& value)
+    explicit DefaultMap(const Graph& graph) : Parent(graph) {}
+    DefaultMap(const Graph& graph, const Value& value)
       : Parent(graph, value) {}
 
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 617)
+++ lemon/bits/edge_set_extender.h	(revision 559)
@@ -35,8 +35,7 @@
   template <typename Base>
   class ArcSetExtender : public Base {
+  public:
+
     typedef Base Parent;
-
-  public:
-
     typedef ArcSetExtender Digraph;
 
@@ -220,7 +219,8 @@
     class ArcMap 
       : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
+    public:
+      typedef ArcSetExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
 
-    public:
       explicit ArcMap(const Digraph& _g) 
 	: Parent(_g) {}
@@ -275,13 +275,14 @@
   template <typename Base>
   class EdgeSetExtender : public Base {
+
+  public:
+
     typedef Base Parent;
-
-  public:
-
-    typedef EdgeSetExtender Graph;
+    typedef EdgeSetExtender Digraph;
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
     typedef typename Parent::Edge Edge;
+
 
     int maxId(Node) const {
@@ -350,5 +351,5 @@
 
     class NodeIt : public Node { 
-      const Graph* graph;
+      const Digraph* digraph;
     public:
 
@@ -357,13 +358,13 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
+      explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
 	_graph.first(static_cast<Node&>(*this));
       }
 
-      NodeIt(const Graph& _graph, const Node& node) 
-	: Node(node), graph(&_graph) {}
+      NodeIt(const Digraph& _graph, const Node& node) 
+	: Node(node), digraph(&_graph) {}
 
       NodeIt& operator++() { 
-	graph->next(*this);
+	digraph->next(*this);
 	return *this; 
       }
@@ -373,5 +374,5 @@
 
     class ArcIt : public Arc { 
-      const Graph* graph;
+      const Digraph* digraph;
     public:
 
@@ -380,13 +381,13 @@
       ArcIt(Invalid i) : Arc(i) { }
 
-      explicit ArcIt(const Graph& _graph) : graph(&_graph) {
+      explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
 	_graph.first(static_cast<Arc&>(*this));
       }
 
-      ArcIt(const Graph& _graph, const Arc& e) : 
-	Arc(e), graph(&_graph) { }
+      ArcIt(const Digraph& _graph, const Arc& e) : 
+	Arc(e), digraph(&_graph) { }
 
       ArcIt& operator++() { 
-	graph->next(*this);
+	digraph->next(*this);
 	return *this; 
       }
@@ -396,5 +397,5 @@
 
     class OutArcIt : public Arc { 
-      const Graph* graph;
+      const Digraph* digraph;
     public:
 
@@ -403,14 +404,14 @@
       OutArcIt(Invalid i) : Arc(i) { }
 
-      OutArcIt(const Graph& _graph, const Node& node) 
-	: graph(&_graph) {
+      OutArcIt(const Digraph& _graph, const Node& node) 
+	: digraph(&_graph) {
 	_graph.firstOut(*this, node);
       }
 
-      OutArcIt(const Graph& _graph, const Arc& arc) 
-	: Arc(arc), graph(&_graph) {}
+      OutArcIt(const Digraph& _graph, const Arc& arc) 
+	: Arc(arc), digraph(&_graph) {}
 
       OutArcIt& operator++() { 
-	graph->nextOut(*this);
+	digraph->nextOut(*this);
 	return *this; 
       }
@@ -420,5 +421,5 @@
 
     class InArcIt : public Arc { 
-      const Graph* graph;
+      const Digraph* digraph;
     public:
 
@@ -427,14 +428,14 @@
       InArcIt(Invalid i) : Arc(i) { }
 
-      InArcIt(const Graph& _graph, const Node& node) 
-	: graph(&_graph) {
+      InArcIt(const Digraph& _graph, const Node& node) 
+	: digraph(&_graph) {
 	_graph.firstIn(*this, node);
       }
 
-      InArcIt(const Graph& _graph, const Arc& arc) : 
-	Arc(arc), graph(&_graph) {}
+      InArcIt(const Digraph& _graph, const Arc& arc) : 
+	Arc(arc), digraph(&_graph) {}
 
       InArcIt& operator++() { 
-	graph->nextIn(*this);
+	digraph->nextIn(*this);
 	return *this; 
       }
@@ -444,5 +445,5 @@
 
     class EdgeIt : public Parent::Edge { 
-      const Graph* graph;
+      const Digraph* digraph;
     public:
 
@@ -451,13 +452,13 @@
       EdgeIt(Invalid i) : Edge(i) { }
 
-      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
+      explicit EdgeIt(const Digraph& _graph) : digraph(&_graph) {
 	_graph.first(static_cast<Edge&>(*this));
       }
 
-      EdgeIt(const Graph& _graph, const Edge& e) : 
-	Edge(e), graph(&_graph) { }
+      EdgeIt(const Digraph& _graph, const Edge& e) : 
+	Edge(e), digraph(&_graph) { }
 
       EdgeIt& operator++() { 
-	graph->next(*this);
+	digraph->next(*this);
 	return *this; 
       }
@@ -467,5 +468,5 @@
     class IncEdgeIt : public Parent::Edge {
       friend class EdgeSetExtender;
-      const Graph* graph;
+      const Digraph* digraph;
       bool direction;
     public:
@@ -475,15 +476,15 @@
       IncEdgeIt(Invalid i) : Edge(i), direction(false) { }
 
-      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
+      IncEdgeIt(const Digraph& _graph, const Node &n) : digraph(&_graph) {
 	_graph.firstInc(*this, direction, n);
       }
 
-      IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n)
-	: graph(&_graph), Edge(ue) {
+      IncEdgeIt(const Digraph& _graph, const Edge &ue, const Node &n)
+	: digraph(&_graph), Edge(ue) {
 	direction = (_graph.source(ue) == n);
       }
 
       IncEdgeIt& operator++() {
-	graph->nextInc(*this, direction);
+	digraph->nextInc(*this, direction);
 	return *this; 
       }
@@ -534,11 +535,12 @@
     template <typename _Value>
     class ArcMap 
-      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
-      typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
-
-    public:
-      ArcMap(const Graph& _g) 
+      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
+    public:
+      typedef EdgeSetExtender Digraph;
+      typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
+
+      ArcMap(const Digraph& _g) 
 	: Parent(_g) {}
-      ArcMap(const Graph& _g, const _Value& _v) 
+      ArcMap(const Digraph& _g, const _Value& _v) 
 	: Parent(_g, _v) {}
 
@@ -558,12 +560,13 @@
     template <typename _Value>
     class EdgeMap 
-      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
-      typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
-
-    public:
-      EdgeMap(const Graph& _g) 
+      : public MapExtender<DefaultMap<Digraph, Edge, _Value> > {
+    public:
+      typedef EdgeSetExtender Digraph;
+      typedef MapExtender<DefaultMap<Digraph, Edge, _Value> > Parent;
+
+      EdgeMap(const Digraph& _g) 
 	: Parent(_g) {}
 
-      EdgeMap(const Graph& _g, const _Value& _v) 
+      EdgeMap(const Digraph& _g, const _Value& _v) 
 	: Parent(_g, _v) {}
 
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h	(revision 617)
+++ lemon/bits/graph_adaptor_extender.h	(revision 580)
@@ -27,8 +27,7 @@
   template <typename _Digraph>
   class DigraphAdaptorExtender : public _Digraph {
+  public:
+
     typedef _Digraph Parent;
-
-  public:
-
     typedef _Digraph Digraph;
     typedef DigraphAdaptorExtender Adaptor;
@@ -175,8 +174,7 @@
   template <typename _Graph>
   class GraphAdaptorExtender : public _Graph {
+  public:
+
     typedef _Graph Parent;
-
-  public:
-
     typedef _Graph Graph;
     typedef GraphAdaptorExtender Adaptor;
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 617)
+++ lemon/bits/graph_extender.h	(revision 440)
@@ -38,8 +38,7 @@
   template <typename Base>
   class DigraphExtender : public Base {
+  public:
+
     typedef Base Parent;
-
-  public:
-
     typedef DigraphExtender Digraph;
 
@@ -220,7 +219,8 @@
     class NodeMap
       : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
+    public:
+      typedef DigraphExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Node, _Value> > Parent;
 
-    public:
       explicit NodeMap(const Digraph& digraph)
         : Parent(digraph) {}
@@ -244,7 +244,8 @@
     class ArcMap
       : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
+    public:
+      typedef DigraphExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
 
-    public:
       explicit ArcMap(const Digraph& digraph)
         : Parent(digraph) {}
@@ -330,8 +331,7 @@
   template <typename Base>
   class GraphExtender : public Base {
+  public:
+
     typedef Base Parent;
-
-  public:
-
     typedef GraphExtender Graph;
 
@@ -602,7 +602,8 @@
     class NodeMap
       : public MapExtender<DefaultMap<Graph, Node, _Value> > {
+    public:
+      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Node, _Value> > Parent;
 
-    public:
       NodeMap(const Graph& graph)
         : Parent(graph) {}
@@ -626,7 +627,8 @@
     class ArcMap
       : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
+    public:
+      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
 
-    public:
       ArcMap(const Graph& graph)
         : Parent(graph) {}
@@ -650,7 +652,8 @@
     class EdgeMap
       : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
+    public:
+      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
 
-    public:
       EdgeMap(const Graph& graph)
         : Parent(graph) {}
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 617)
+++ lemon/bits/map_extender.h	(revision 580)
@@ -37,10 +37,11 @@
   template <typename _Map>
   class MapExtender : public _Map {
+  public:
+
     typedef _Map Parent;
-    typedef typename Parent::GraphType GraphType;
-
-  public:
-
     typedef MapExtender Map;
+
+
+    typedef typename Parent::Graph Graph;
     typedef typename Parent::Key Item;
 
@@ -58,8 +59,8 @@
   public:
 
-    MapExtender(const GraphType& graph)
+    MapExtender(const Graph& graph)
       : Parent(graph) {}
 
-    MapExtender(const GraphType& graph, const Value& value)
+    MapExtender(const Graph& graph, const Value& value)
       : Parent(graph, value) {}
 
@@ -77,8 +78,7 @@
   public:
     class MapIt : public Item {
-      typedef Item Parent;
-
-    public:
-
+    public:
+
+      typedef Item Parent;
       typedef typename Map::Value Value;
 
@@ -117,7 +117,7 @@
 
     class ConstMapIt : public Item {
-      typedef Item Parent;
-
-    public:
+    public:
+
+      typedef Item Parent;
 
       typedef typename Map::Value Value;
@@ -148,7 +148,7 @@
 
     class ItemIt : public Item {
-      typedef Item Parent;
-
-    public:
+    public:
+
+      typedef Item Parent;
 
       ItemIt() {}
@@ -179,10 +179,11 @@
   template <typename _Graph, typename _Map>
   class SubMapExtender : public _Map {
+  public:
+
     typedef _Map Parent;
-    typedef _Graph GraphType;
-
-  public:
-
     typedef SubMapExtender Map;
+
+    typedef _Graph Graph;
+
     typedef typename Parent::Key Item;
 
@@ -200,8 +201,8 @@
   public:
 
-    SubMapExtender(const GraphType& _graph)
+    SubMapExtender(const Graph& _graph)
       : Parent(_graph), graph(_graph) {}
 
-    SubMapExtender(const GraphType& _graph, const Value& _value)
+    SubMapExtender(const Graph& _graph, const Value& _value)
       : Parent(_graph, _value), graph(_graph) {}
 
@@ -223,7 +224,7 @@
   public:
     class MapIt : public Item {
-      typedef Item Parent;
-
-    public:
+    public:
+
+      typedef Item Parent;
       typedef typename Map::Value Value;
 
@@ -262,7 +263,7 @@
 
     class ConstMapIt : public Item {
-      typedef Item Parent;
-
-    public:
+    public:
+
+      typedef Item Parent;
 
       typedef typename Map::Value Value;
@@ -293,7 +294,7 @@
 
     class ItemIt : public Item {
-      typedef Item Parent;
-
-    public:
+    public:
+
+      typedef Item Parent;
 
       ItemIt() {}
@@ -320,5 +321,5 @@
   private:
 
-    const GraphType& graph;
+    const Graph& graph;
 
   };
Index: lemon/bits/traits.h
===================================================================
--- lemon/bits/traits.h	(revision 616)
+++ lemon/bits/traits.h	(revision 440)
@@ -30,42 +30,40 @@
   struct InvalidType {};
 
-  template <typename GR, typename _Item>
+  template <typename _Graph, typename _Item>
   class ItemSetTraits {};
 
 
-  template <typename GR, typename Enable = void>
+  template <typename Graph, typename Enable = void>
   struct NodeNotifierIndicator {
     typedef InvalidType Type;
   };
-  template <typename GR>
+  template <typename Graph>
   struct NodeNotifierIndicator<
-    GR,
-    typename enable_if<typename GR::NodeNotifier::Notifier, void>::type
-  > {
-    typedef typename GR::NodeNotifier Type;
-  };
-
-  template <typename GR>
-  class ItemSetTraits<GR, typename GR::Node> {
+    Graph,
+    typename enable_if<typename Graph::NodeNotifier::Notifier, void>::type
+  > {
+    typedef typename Graph::NodeNotifier Type;
+  };
+
+  template <typename _Graph>
+  class ItemSetTraits<_Graph, typename _Graph::Node> {
   public:
 
-    typedef GR Graph;
-    typedef GR Digraph;
-
-    typedef typename GR::Node Item;
-    typedef typename GR::NodeIt ItemIt;
-
-    typedef typename NodeNotifierIndicator<GR>::Type ItemNotifier;
-
-    template <typename V>
-    class Map : public GR::template NodeMap<V> {
-      typedef typename GR::template NodeMap<V> Parent;
-
+    typedef _Graph Graph;
+
+    typedef typename Graph::Node Item;
+    typedef typename Graph::NodeIt ItemIt;
+
+    typedef typename NodeNotifierIndicator<Graph>::Type ItemNotifier;
+
+    template <typename _Value>
+    class Map : public Graph::template NodeMap<_Value> {
     public:
-      typedef typename GR::template NodeMap<V> Type;
+      typedef typename Graph::template NodeMap<_Value> Parent;
+      typedef typename Graph::template NodeMap<_Value> Type;
       typedef typename Parent::Value Value;
 
-      Map(const GR& _digraph) : Parent(_digraph) {}
-      Map(const GR& _digraph, const Value& _value)
+      Map(const Graph& _digraph) : Parent(_digraph) {}
+      Map(const Graph& _digraph, const Value& _value)
         : Parent(_digraph, _value) {}
 
@@ -74,38 +72,36 @@
   };
 
-  template <typename GR, typename Enable = void>
+  template <typename Graph, typename Enable = void>
   struct ArcNotifierIndicator {
     typedef InvalidType Type;
   };
-  template <typename GR>
+  template <typename Graph>
   struct ArcNotifierIndicator<
-    GR,
-    typename enable_if<typename GR::ArcNotifier::Notifier, void>::type
-  > {
-    typedef typename GR::ArcNotifier Type;
-  };
-
-  template <typename GR>
-  class ItemSetTraits<GR, typename GR::Arc> {
+    Graph,
+    typename enable_if<typename Graph::ArcNotifier::Notifier, void>::type
+  > {
+    typedef typename Graph::ArcNotifier Type;
+  };
+
+  template <typename _Graph>
+  class ItemSetTraits<_Graph, typename _Graph::Arc> {
   public:
 
-    typedef GR Graph;
-    typedef GR Digraph;
-
-    typedef typename GR::Arc Item;
-    typedef typename GR::ArcIt ItemIt;
-
-    typedef typename ArcNotifierIndicator<GR>::Type ItemNotifier;
-
-    template <typename V>
-    class Map : public GR::template ArcMap<V> {
-      typedef typename GR::template ArcMap<V> Parent;
-
+    typedef _Graph Graph;
+
+    typedef typename Graph::Arc Item;
+    typedef typename Graph::ArcIt ItemIt;
+
+    typedef typename ArcNotifierIndicator<Graph>::Type ItemNotifier;
+
+    template <typename _Value>
+    class Map : public Graph::template ArcMap<_Value> {
     public:
-      typedef typename GR::template ArcMap<V> Type;
+      typedef typename Graph::template ArcMap<_Value> Parent;
+      typedef typename Graph::template ArcMap<_Value> Type;
       typedef typename Parent::Value Value;
 
-      Map(const GR& _digraph) : Parent(_digraph) {}
-      Map(const GR& _digraph, const Value& _value)
+      Map(const Graph& _digraph) : Parent(_digraph) {}
+      Map(const Graph& _digraph, const Value& _value)
         : Parent(_digraph, _value) {}
     };
@@ -113,38 +109,36 @@
   };
 
-  template <typename GR, typename Enable = void>
+  template <typename Graph, typename Enable = void>
   struct EdgeNotifierIndicator {
     typedef InvalidType Type;
   };
-  template <typename GR>
+  template <typename Graph>
   struct EdgeNotifierIndicator<
-    GR,
-    typename enable_if<typename GR::EdgeNotifier::Notifier, void>::type
-  > {
-    typedef typename GR::EdgeNotifier Type;
-  };
-
-  template <typename GR>
-  class ItemSetTraits<GR, typename GR::Edge> {
+    Graph,
+    typename enable_if<typename Graph::EdgeNotifier::Notifier, void>::type
+  > {
+    typedef typename Graph::EdgeNotifier Type;
+  };
+
+  template <typename _Graph>
+  class ItemSetTraits<_Graph, typename _Graph::Edge> {
   public:
 
-    typedef GR Graph;
-    typedef GR Digraph;
-
-    typedef typename GR::Edge Item;
-    typedef typename GR::EdgeIt ItemIt;
-
-    typedef typename EdgeNotifierIndicator<GR>::Type ItemNotifier;
-
-    template <typename V>
-    class Map : public GR::template EdgeMap<V> {
-      typedef typename GR::template EdgeMap<V> Parent;
-
+    typedef _Graph Graph;
+
+    typedef typename Graph::Edge Item;
+    typedef typename Graph::EdgeIt ItemIt;
+
+    typedef typename EdgeNotifierIndicator<Graph>::Type ItemNotifier;
+
+    template <typename _Value>
+    class Map : public Graph::template EdgeMap<_Value> {
     public:
-      typedef typename GR::template EdgeMap<V> Type;
+      typedef typename Graph::template EdgeMap<_Value> Parent;
+      typedef typename Graph::template EdgeMap<_Value> Type;
       typedef typename Parent::Value Value;
 
-      Map(const GR& _digraph) : Parent(_digraph) {}
-      Map(const GR& _digraph, const Value& _value)
+      Map(const Graph& _digraph) : Parent(_digraph) {}
+      Map(const Graph& _digraph, const Value& _value)
         : Parent(_digraph, _value) {}
     };
@@ -211,91 +205,91 @@
   // Indicators for the tags
 
-  template <typename GR, typename Enable = void>
+  template <typename Graph, typename Enable = void>
   struct NodeNumTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct NodeNumTagIndicator<
-    GR,
-    typename enable_if<typename GR::NodeNumTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::NodeNumTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct ArcNumTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct ArcNumTagIndicator<
-    GR,
-    typename enable_if<typename GR::ArcNumTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::ArcNumTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct EdgeNumTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct EdgeNumTagIndicator<
-    GR,
-    typename enable_if<typename GR::EdgeNumTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::EdgeNumTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct FindArcTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct FindArcTagIndicator<
-    GR,
-    typename enable_if<typename GR::FindArcTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::FindArcTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct FindEdgeTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct FindEdgeTagIndicator<
-    GR,
-    typename enable_if<typename GR::FindEdgeTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::FindEdgeTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct UndirectedTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct UndirectedTagIndicator<
-    GR,
-    typename enable_if<typename GR::UndirectedTag, void>::type
-  > {
-    static const bool value = true;
-  };
-
-  template <typename GR, typename Enable = void>
+    Graph,
+    typename enable_if<typename Graph::UndirectedTag, void>::type
+  > {
+    static const bool value = true;
+  };
+
+  template <typename Graph, typename Enable = void>
   struct BuildTagIndicator {
     static const bool value = false;
   };
 
-  template <typename GR>
+  template <typename Graph>
   struct BuildTagIndicator<
-    GR,
-    typename enable_if<typename GR::BuildTag, void>::type
+    Graph,
+    typename enable_if<typename Graph::BuildTag, void>::type
   > {
     static const bool value = true;
Index: lemon/bits/vector_map.h
===================================================================
--- lemon/bits/vector_map.h	(revision 617)
+++ lemon/bits/vector_map.h	(revision 503)
@@ -57,5 +57,5 @@
 
     // The graph type of the map.
-    typedef _Graph GraphType;
+    typedef _Graph Graph;
     // The item type of the map.
     typedef _Item Item;
@@ -73,4 +73,6 @@
     // The map type.
     typedef VectorMap Map;
+    // The base class of the map.
+    typedef typename Notifier::ObserverBase Parent;
 
     // The reference type of the map;
@@ -79,10 +81,4 @@
     typedef typename Container::const_reference ConstReference;
 
-  private:
-
-    // The base class of the map.
-    typedef typename Notifier::ObserverBase Parent;
-
-  public:
 
     // \brief Constructor to attach the new map into the notifier.
@@ -90,5 +86,5 @@
     // It constructs a map and attachs it into the notifier.
     // It adds all the items of the graph to the map.
-    VectorMap(const GraphType& graph) {
+    VectorMap(const Graph& graph) {
       Parent::attach(graph.notifier(Item()));
       container.resize(Parent::notifier()->maxId() + 1);
@@ -99,5 +95,5 @@
     // It constructs a map uses a given value to initialize the map.
     // It adds all the items of the graph to the map.
-    VectorMap(const GraphType& graph, const Value& value) {
+    VectorMap(const Graph& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
       container.resize(Parent::notifier()->maxId() + 1, value);
Index: lemon/concepts/graph_components.h
===================================================================
--- lemon/concepts/graph_components.h	(revision 617)
+++ lemon/concepts/graph_components.h	(revision 584)
@@ -181,7 +181,4 @@
     class BaseGraphComponent : public BaseDigraphComponent {
     public:
-
-      typedef BaseGraphComponent Graph;
-
       typedef BaseDigraphComponent::Node Node;
       typedef BaseDigraphComponent::Arc Arc;
@@ -193,7 +190,7 @@
       /// represented by two opposite directed arcs.
       class Edge : public GraphItem<'e'> {
+      public:
         typedef GraphItem<'e'> Parent;
 
-      public:
         /// \brief Default constructor.
         ///
@@ -995,8 +992,10 @@
     template <typename GR, typename K, typename V>
     class GraphMap : public ReferenceMap<K, V, V&, const V&> {
-      typedef ReferenceMap<K, V, V&, const V&> Parent;
-
-    public:
-
+    public:
+
+      typedef ReadWriteMap<K, V> Parent;
+
+      /// The graph type of the map.
+      typedef GR Graph;
       /// The key type of the map.
       typedef K Key;
@@ -1014,9 +1013,9 @@
       ///
       /// Construct a new map for the graph.
-      explicit GraphMap(const GR&) {}
+      explicit GraphMap(const Graph&) {}
       /// \brief Construct a new map with default value.
       ///
       /// Construct a new map for the graph and initalize the values.
-      GraphMap(const GR&, const Value&) {}
+      GraphMap(const Graph&, const Value&) {}
 
     private:
@@ -1059,5 +1058,5 @@
 
         const _Map &m;
-        const GR &g;
+        const Graph &g;
         const typename GraphMap::Value &t;
       };
@@ -1087,7 +1086,7 @@
       template <typename V>
       class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
+      public:
         typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
 
-      public:
         /// \brief Construct a new map.
         ///
@@ -1125,7 +1124,7 @@
       template <typename V>
       class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
+      public:
         typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
 
-      public:
         /// \brief Construct a new map.
         ///
@@ -1223,7 +1222,7 @@
       template <typename V>
       class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
+      public:
         typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
 
-      public:
         /// \brief Construct a new map.
         ///
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 617)
+++ lemon/core.h	(revision 581)
@@ -1037,10 +1037,11 @@
   template <typename GR>
   class ConArcIt : public GR::Arc {
-    typedef typename GR::Arc Parent;
-
   public:
 
-    typedef typename GR::Arc Arc;
-    typedef typename GR::Node Node;
+    typedef GR Graph;
+    typedef typename Graph::Arc Parent;
+
+    typedef typename Graph::Arc Arc;
+    typedef typename Graph::Node Node;
 
     /// \brief Constructor.
@@ -1048,5 +1049,5 @@
     /// Construct a new ConArcIt iterating on the arcs that
     /// connects nodes \c u and \c v.
-    ConArcIt(const GR& g, Node u, Node v) : _graph(g) {
+    ConArcIt(const Graph& g, Node u, Node v) : _graph(g) {
       Parent::operator=(findArc(_graph, u, v));
     }
@@ -1055,5 +1056,5 @@
     ///
     /// Construct a new ConArcIt that continues the iterating from arc \c a.
-    ConArcIt(const GR& g, Arc a) : Parent(a), _graph(g) {}
+    ConArcIt(const Graph& g, Arc a) : Parent(a), _graph(g) {}
 
     /// \brief Increment operator.
@@ -1066,5 +1067,5 @@
     }
   private:
-    const GR& _graph;
+    const Graph& _graph;
   };
 
@@ -1159,10 +1160,11 @@
   template <typename GR>
   class ConEdgeIt : public GR::Edge {
-    typedef typename GR::Edge Parent;
-
   public:
 
-    typedef typename GR::Edge Edge;
-    typedef typename GR::Node Node;
+    typedef GR Graph;
+    typedef typename Graph::Edge Parent;
+
+    typedef typename Graph::Edge Edge;
+    typedef typename Graph::Node Node;
 
     /// \brief Constructor.
@@ -1170,5 +1172,5 @@
     /// Construct a new ConEdgeIt iterating on the edges that
     /// connects nodes \c u and \c v.
-    ConEdgeIt(const GR& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
+    ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
       Parent::operator=(findEdge(_graph, _u, _v));
     }
@@ -1177,5 +1179,5 @@
     ///
     /// Construct a new ConEdgeIt that continues iterating from edge \c e.
-    ConEdgeIt(const GR& g, Edge e) : Parent(e), _graph(g) {}
+    ConEdgeIt(const Graph& g, Edge e) : Parent(e), _graph(g) {}
 
     /// \brief Increment operator.
@@ -1187,5 +1189,5 @@
     }
   private:
-    const GR& _graph;
+    const Graph& _graph;
     Node _u, _v;
   };
@@ -1218,12 +1220,9 @@
     : protected ItemSetTraits<GR, typename GR::Arc>::ItemNotifier::ObserverBase
   {
+  public:
     typedef typename ItemSetTraits<GR, typename GR::Arc>
     ::ItemNotifier::ObserverBase Parent;
 
     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
-  public:
-
-    /// The Digraph type
     typedef GR Digraph;
 
@@ -1231,7 +1230,7 @@
 
     class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
+    public:
+
       typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
-
-    public:
 
       AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
@@ -1258,4 +1257,10 @@
       }
     };
+
+    const Digraph &_g;
+    AutoNodeMap _head;
+    typename Digraph::template ArcMap<Arc> _parent;
+    typename Digraph::template ArcMap<Arc> _left;
+    typename Digraph::template ArcMap<Arc> _right;
 
     class ArcLess {
@@ -1268,12 +1273,4 @@
       }
     };
-
-  protected: 
-
-    const Digraph &_g;
-    AutoNodeMap _head;
-    typename Digraph::template ArcMap<Arc> _parent;
-    typename Digraph::template ArcMap<Arc> _left;
-    typename Digraph::template ArcMap<Arc> _right;
 
   public:
@@ -1634,9 +1631,6 @@
   class ArcLookUp
   {
+  public:
     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
-  public:
-
-    /// The Digraph type
     typedef GR Digraph;
 
@@ -1753,6 +1747,7 @@
 
     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
-
-    typename GR::template ArcMap<Arc> _next;
+    typedef GR Digraph;
+
+    typename Digraph::template ArcMap<Arc> _next;
 
     Arc refreshNext(Arc head,Arc next=INVALID)
@@ -1773,8 +1768,4 @@
 
   public:
-
-    /// The Digraph type
-    typedef GR Digraph;
-
     ///Constructor
 
Index: lemon/edge_set.h
===================================================================
--- lemon/edge_set.h	(revision 617)
+++ lemon/edge_set.h	(revision 559)
@@ -34,4 +34,5 @@
   public:
 
+    typedef GR Graph;
     typedef typename GR::Node Node;
     typedef typename GR::NodeIt NodeIt;
@@ -208,7 +209,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
+
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
 
       explicit NodeMap(const ListArcSetBase<GR>& arcset)
@@ -259,10 +260,14 @@
   template <typename GR>
   class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
+
+  public:
+
     typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
-
-  public:
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
+
+    typedef GR Graph;
+
 
     typedef typename Parent::NodesImplBase NodesImplBase;
@@ -288,7 +293,7 @@
 
     class NodesImpl : public NodesImplBase {
+    public:
       typedef NodesImplBase Parent;
 
-    public:
       NodesImpl(const GR& graph, ListArcSet& arcset)
         : Parent(graph), _arcset(arcset) {}
@@ -350,4 +355,5 @@
   public:
 
+    typedef GR Graph;
     typedef typename GR::Node Node;
     typedef typename GR::NodeIt NodeIt;
@@ -632,7 +638,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
+
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
 
       explicit NodeMap(const ListEdgeSetBase<GR>& arcset)
@@ -683,11 +689,15 @@
   template <typename GR>
   class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
+
+  public:
+
     typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
-
-  public:
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
     typedef typename Parent::Edge Edge;
+
+    typedef GR Graph;
+
 
     typedef typename Parent::NodesImplBase NodesImplBase;
@@ -708,7 +718,7 @@
 
     class NodesImpl : public NodesImplBase {
+    public:
       typedef NodesImplBase Parent;
 
-    public:
       NodesImpl(const GR& graph, ListEdgeSet& arcset)
         : Parent(graph), _arcset(arcset) {}
@@ -770,6 +780,7 @@
   public:
 
-    typedef typename GR::Node Node;
-    typedef typename GR::NodeIt NodeIt;
+    typedef GR Graph;
+    typedef typename Graph::Node Node;
+    typedef typename Graph::NodeIt NodeIt;
 
   protected:
@@ -890,7 +901,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
+
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
 
       explicit NodeMap(const SmartArcSetBase<GR>& arcset)
@@ -946,10 +957,13 @@
   template <typename GR>
   class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
+
+  public:
+
     typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
-
-  public:
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
+
+    typedef GR Graph;
 
   protected:
@@ -970,7 +984,7 @@
 
     class NodesImpl : public NodesImplBase {
+    public:
       typedef NodesImplBase Parent;
 
-    public:
       NodesImpl(const GR& graph, SmartArcSet& arcset)
         : Parent(graph), _arcset(arcset) {}
@@ -1049,4 +1063,5 @@
   public:
 
+    typedef GR Graph;
     typedef typename GR::Node Node;
     typedef typename GR::NodeIt NodeIt;
@@ -1235,7 +1250,7 @@
     template <typename V>
     class NodeMap : public GR::template NodeMap<V> {
+    public:
+
       typedef typename GR::template NodeMap<V> Parent;
-
-    public:
 
       explicit NodeMap(const SmartEdgeSetBase<GR>& arcset)
@@ -1290,7 +1305,8 @@
   template <typename GR>
   class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
+
+  public:
+
     typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
-
-  public:
 
     typedef typename Parent::Node Node;
@@ -1298,4 +1314,6 @@
     typedef typename Parent::Edge Edge;
 
+    typedef GR Graph;
+
   protected:
 
@@ -1314,7 +1332,7 @@
 
     class NodesImpl : public NodesImplBase {
+    public:
       typedef NodesImplBase Parent;
 
-    public:
       NodesImpl(const GR& graph, SmartEdgeSet& arcset)
         : Parent(graph), _arcset(arcset) {}
Index: lemon/full_graph.h
===================================================================
--- lemon/full_graph.h	(revision 617)
+++ lemon/full_graph.h	(revision 582)
@@ -32,5 +32,5 @@
   public:
 
-    typedef FullDigraphBase Digraph;
+    typedef FullDigraphBase Graph;
 
     class Node;
@@ -170,7 +170,7 @@
   /// \sa FullGraph
   class FullDigraph : public ExtendedFullDigraphBase {
+  public:
+
     typedef ExtendedFullDigraphBase Parent;
-
-  public:
 
     /// \brief Constructor
@@ -227,4 +227,6 @@
 
   class FullGraphBase {
+    int _node_num;
+    int _edge_num;
   public:
 
@@ -236,7 +238,4 @@
 
   protected:
-
-    int _node_num;
-    int _edge_num;
 
     FullGraphBase() {}
@@ -539,7 +538,7 @@
   /// \sa FullDigraph
   class FullGraph : public ExtendedFullGraphBase {
+  public:
+
     typedef ExtendedFullGraphBase Parent;
-
-  public:
 
     /// \brief Constructor
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 617)
+++ lemon/graph_to_eps.h	(revision 584)
@@ -70,5 +70,4 @@
 {
   typedef GR Graph;
-  typedef GR Digraph;
   typedef typename Graph::Node Node;
   typedef typename Graph::NodeIt NodeIt;
@@ -243,5 +242,4 @@
 
   typedef typename T::Graph Graph;
-  typedef typename T::Digraph Digraph;
   typedef typename Graph::Node Node;
   typedef typename Graph::NodeIt NodeIt;
Index: lemon/grid_graph.h
===================================================================
--- lemon/grid_graph.h	(revision 617)
+++ lemon/grid_graph.h	(revision 582)
@@ -500,7 +500,7 @@
   /// "Graph concept".
   class GridGraph : public ExtendedGridGraphBase {
+  public:
+
     typedef ExtendedGridGraphBase Parent;
-
-  public:
 
     /// \brief Map to get the indices of the nodes as dim2::Point<int>.
Index: lemon/hypercube_graph.h
===================================================================
--- lemon/hypercube_graph.h	(revision 617)
+++ lemon/hypercube_graph.h	(revision 582)
@@ -295,7 +295,7 @@
   /// "Graph concept".
   class HypercubeGraph : public ExtendedHypercubeGraphBase {
+  public:
+
     typedef ExtendedHypercubeGraphBase Parent;
-
-  public:
 
     /// \brief Constructs a hypercube graph with \c dim dimensions.
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 617)
+++ lemon/list_graph.h	(revision 582)
@@ -324,6 +324,4 @@
 
   class ListDigraph : public ExtendedListDigraphBase {
-    typedef ExtendedListDigraphBase Parent;
-
   private:
     ///ListDigraph is \e not copy constructible. Use copyDigraph() instead.
@@ -339,4 +337,6 @@
     void operator=(const ListDigraph &) {}
   public:
+
+    typedef ExtendedListDigraphBase Parent;
 
     /// Constructor
@@ -794,5 +794,5 @@
   public:
 
-    typedef ListGraphBase Graph;
+    typedef ListGraphBase Digraph;
 
     class Node;
@@ -1177,6 +1177,4 @@
 
   class ListGraph : public ExtendedListGraphBase {
-    typedef ExtendedListGraphBase Parent;
-
   private:
     ///ListGraph is \e not copy constructible. Use copyGraph() instead.
@@ -1197,4 +1195,6 @@
     ///
     ListGraph() {}
+
+    typedef ExtendedListGraphBase Parent;
 
     typedef Parent::OutArcIt IncEdgeIt;
Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 617)
+++ lemon/maps.h	(revision 584)
@@ -1839,5 +1839,4 @@
     /// The graph type of IdMap.
     typedef GR Graph;
-    typedef GR Digraph;
     /// The key type of IdMap (\c Node, \c Arc or \c Edge).
     typedef K Item;
@@ -1931,5 +1930,4 @@
     /// The graph type of CrossRefMap.
     typedef GR Graph;
-    typedef GR Digraph;
     /// The key type of CrossRefMap (\c Node, \c Arc or \c Edge).
     typedef K Item;
@@ -2135,5 +2133,4 @@
     /// The graph type of RangeIdMap.
     typedef GR Graph;
-    typedef GR Digraph;
     /// The key type of RangeIdMap (\c Node, \c Arc or \c Edge).
     typedef K Item;
@@ -2498,6 +2495,5 @@
   public:
     
-    /// The graph type of InDegMap
-    typedef GR Graph;
+    /// The digraph type
     typedef GR Digraph;
     /// The key type
@@ -2628,6 +2624,5 @@
   public:
 
-    /// The graph type of OutDegMap
-    typedef GR Graph;
+    /// The digraph type
     typedef GR Digraph;
     /// The key type
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 618)
+++ lemon/network_simplex.h	(revision 609)
@@ -382,6 +382,5 @@
         const int MIN_BLOCK_SIZE = 10;
 
-        _block_size = std::max( int(BLOCK_SIZE_FACTOR *
-                                    std::sqrt(double(_arc_num))),
+        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
                                 MIN_BLOCK_SIZE );
       }
@@ -459,6 +458,5 @@
         const int MIN_MINOR_LIMIT = 3;
 
-        _list_length = std::max( int(LIST_LENGTH_FACTOR *
-                                     std::sqrt(double(_arc_num))),
+        _list_length = std::max( int(LIST_LENGTH_FACTOR * sqrt(_arc_num)),
                                  MIN_LIST_LENGTH );
         _minor_limit = std::max( int(MINOR_LIMIT_FACTOR * _list_length),
@@ -580,6 +578,5 @@
         const int MIN_HEAD_LENGTH = 3;
 
-        _block_size = std::max( int(BLOCK_SIZE_FACTOR *
-                                    std::sqrt(double(_arc_num))),
+        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
                                 MIN_BLOCK_SIZE );
         _head_length = std::max( int(HEAD_LENGTH_FACTOR * _block_size),
@@ -1148,5 +1145,4 @@
       // Run Circulation to check if a feasible solution exists
       typedef ConstMap<Arc, Flow> ConstArcMap;
-      ConstArcMap zero_arc_map(0), inf_arc_map(inf_cap);
       FlowNodeMap *csup = NULL;
       bool local_csup = false;
@@ -1169,5 +1165,5 @@
           } else {
             Circulation<GR, FlowArcMap, ConstArcMap, FlowNodeMap>
-              circ(_graph, *_plower, inf_arc_map, *csup);
+              circ(_graph, *_plower, ConstArcMap(inf_cap), *csup);
             circ_result = circ.run();
           }
@@ -1175,9 +1171,9 @@
           if (_pupper) {
             Circulation<GR, ConstArcMap, FlowArcMap, FlowNodeMap>
-              circ(_graph, zero_arc_map, *_pupper, *csup);
+              circ(_graph, ConstArcMap(0), *_pupper, *csup);
             circ_result = circ.run();
           } else {
             Circulation<GR, ConstArcMap, ConstArcMap, FlowNodeMap>
-              circ(_graph, zero_arc_map, inf_arc_map, *csup);
+              circ(_graph, ConstArcMap(0), ConstArcMap(inf_cap), *csup);
             circ_result = circ.run();
           }
@@ -1196,5 +1192,5 @@
           } else {
             Circulation<RevGraph, FlowArcMap, ConstArcMap, NegNodeMap>
-              circ(rgraph, *_plower, inf_arc_map, neg_csup);
+              circ(rgraph, *_plower, ConstArcMap(inf_cap), neg_csup);
             circ_result = circ.run();
           }
@@ -1202,9 +1198,9 @@
           if (_pupper) {
             Circulation<RevGraph, ConstArcMap, FlowArcMap, NegNodeMap>
-              circ(rgraph, zero_arc_map, *_pupper, neg_csup);
+              circ(rgraph, ConstArcMap(0), *_pupper, neg_csup);
             circ_result = circ.run();
           } else {
             Circulation<RevGraph, ConstArcMap, ConstArcMap, NegNodeMap>
-              circ(rgraph, zero_arc_map, inf_arc_map, neg_csup);
+              circ(rgraph, ConstArcMap(0), ConstArcMap(inf_cap), neg_csup);
             circ_result = circ.run();
           }
@@ -1230,5 +1226,5 @@
 
       // Store the arcs in a mixed order
-      int k = std::max(int(std::sqrt(double(_arc_num))), 10);
+      int k = std::max(int(sqrt(_arc_num)), 10);
       int i = 0;
       for (ArcIt e(_graph); e != INVALID; ++e) {
Index: lemon/smart_graph.h
===================================================================
--- lemon/smart_graph.h	(revision 617)
+++ lemon/smart_graph.h	(revision 582)
@@ -56,5 +56,5 @@
   public:
 
-    typedef SmartDigraphBase Digraph;
+    typedef SmartDigraphBase Graph;
 
     class Node;
@@ -196,4 +196,6 @@
   ///\sa concepts::Digraph.
   class SmartDigraph : public ExtendedSmartDigraphBase {
+  public:
+
     typedef ExtendedSmartDigraphBase Parent;
 
@@ -419,5 +421,5 @@
   public:
 
-    typedef SmartGraphBase Graph;
+    typedef SmartGraphBase Digraph;
 
     class Node;
@@ -630,6 +632,4 @@
   /// \sa concepts::Graph.
   class SmartGraph : public ExtendedSmartGraphBase {
-    typedef ExtendedSmartGraphBase Parent;
-
   private:
 
@@ -648,4 +648,6 @@
 
   public:
+
+    typedef ExtendedSmartGraphBase Parent;
 
     /// Constructor
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 611)
+++ test/CMakeLists.txt	(revision 619)
@@ -3,8 +3,4 @@
   ${PROJECT_BINARY_DIR}
 )
-
-IF(HAVE_GLPK)
-  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
-ENDIF(HAVE_GLPK)
 
 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
Index: test/min_cost_flow_test.cc
===================================================================
--- test/min_cost_flow_test.cc	(revision 615)
+++ test/min_cost_flow_test.cc	(revision 609)
@@ -234,5 +234,10 @@
     typedef int Flow;
     typedef int Cost;
-    typedef concepts::Digraph GR;
+    // TODO: This typedef should be enabled if the standard maps are
+    // reference maps in the graph concepts (See #190).
+/**/
+    //typedef concepts::Digraph GR;
+    typedef ListDigraph GR;
+/**/
     checkConcept< McfClassConcept<GR, Flow, Cost>,
                   NetworkSimplex<GR, Flow, Cost> >();
Index: tools/dimacs-solver.cc
===================================================================
--- tools/dimacs-solver.cc	(revision 614)
+++ tools/dimacs-solver.cc	(revision 611)
@@ -94,5 +94,5 @@
 template<class Value>
 void solve_min(ArgParser &ap, std::istream &is, std::ostream &,
-               Value infty, DimacsDescriptor &desc)
+               DimacsDescriptor &desc)
 {
   bool report = !ap.given("q");
@@ -101,33 +101,15 @@
   Digraph::NodeMap<Value> sup(g);
   Timer ti;
-
-  ti.restart();
-  readDimacsMin(is, g, lower, cap, cost, sup, infty, desc);
-  ti.stop();
-  Value sum_sup = 0;
-  for (Digraph::NodeIt n(g); n != INVALID; ++n) {
-    sum_sup += sup[n];
-  }
-  if (report) {
-    std::cerr << "Sum of supply values: " << sum_sup << "\n";
-    if (sum_sup <= 0)
-      std::cerr << "GEQ supply contraints are used for NetworkSimplex\n\n";
-    else
-      std::cerr << "LEQ supply contraints are used for NetworkSimplex\n\n";
-  }
+  ti.restart();
+  readDimacsMin(is, g, lower, cap, cost, sup, 0, desc);
   if (report) std::cerr << "Read the file: " << ti << '\n';
-
   ti.restart();
   NetworkSimplex<Digraph, Value> ns(g);
   ns.lowerMap(lower).capacityMap(cap).costMap(cost).supplyMap(sup);
-  if (sum_sup > 0) ns.problemType(ns.LEQ);
   if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n';
   ti.restart();
-  bool res = ns.run();
-  if (report) {
-    std::cerr << "Run NetworkSimplex: " << ti << "\n\n";
-    std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n';
-    if (res) std::cerr << "Min flow cost: " << ns.totalCost() << '\n';
-  }
+  ns.run();
+  if (report) std::cerr << "Run NetworkSimplex: " << ti << '\n';
+  if (report) std::cerr << "\nMin flow cost: " << ns.totalCost() << '\n';
 }
 
@@ -170,5 +152,5 @@
     {
     case DimacsDescriptor::MIN:
-      solve_min<Value>(ap,is,os,infty,desc);
+      solve_min<Value>(ap,is,os,desc);
       break;
     case DimacsDescriptor::MAX:
Index: tools/lgf-gen.cc
===================================================================
--- tools/lgf-gen.cc	(revision 616)
+++ tools/lgf-gen.cc	(revision 584)
@@ -66,5 +66,5 @@
   double tlen=0;
   for(EdgeIt e(g);e!=INVALID;++e)
-    tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
+    tlen+=sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
   return tlen;
 }
@@ -189,5 +189,5 @@
       (r.x * r.x + r.y * r.y) * (p.x * q.y - q.x * p.y);
 
-    return d / (2 * a) + std::sqrt((d * d + e * e) / (4 * a * a) + f / a);
+    return d / (2 * a) + sqrt((d * d + e * e) / (4 * a * a) + f / a);
   }
 
@@ -207,5 +207,5 @@
     double b = (q.x - sx) * p.y - (p.x - sx) * q.y;
     double d = (q.x - sx) * (p.x - sx) * (p - q).normSquare();
-    return (b - std::sqrt(d)) / a;
+    return (b - sqrt(d)) / a;
   }
 
@@ -721,5 +721,5 @@
 
   if (ap["rand"]) {
-    int seed = int(time(0));
+    int seed = time(0);
     std::cout << "Random number seed: " << seed << std::endl;
     rnd = Random(seed);
@@ -814,5 +814,5 @@
   double tlen=0;
   for(EdgeIt e(g);e!=INVALID;++e)
-    tlen+=std::sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
+    tlen+=sqrt((coords[g.v(e)]-coords[g.u(e)]).normSquare());
   std::cout << "Total arc length  : " << tlen << std::endl;
 
