Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 2017)
+++ lemon/Makefile.am	(revision 2031)
@@ -28,4 +28,5 @@
 	dfs.h \
 	bin_heap.h \
+	bpugraph_adaptor.h \
 	color.h \
 	config.h \
Index: lemon/bits/array_map.h
===================================================================
--- lemon/bits/array_map.h	(revision 1999)
+++ lemon/bits/array_map.h	(revision 2031)
@@ -24,4 +24,6 @@
 #include <lemon/bits/traits.h>
 #include <lemon/bits/alteration_notifier.h>
+#include <lemon/concept_check.h>
+#include <lemon/concept/maps.h>
 
 /// \ingroup graphbits
@@ -120,4 +122,33 @@
     }
 
+    /// \brief Assign operator.
+    ///
+    /// This operator assigns for each item in the map the
+    /// value mapped to the same item in the copied map.  
+    /// The parameter map should be indiced with the same
+    /// itemset because this assign operator does not change
+    /// the container of the map. 
+    ArrayMap& operator=(const ArrayMap& cmap) {
+      return operator=<ArrayMap>(cmap);
+    }
+
+
+    /// \brief Template assign operator.
+    ///
+    /// The given parameter should be conform to the ReadMap
+    /// concecpt and could be indiced by the current item set of
+    /// the NodeMap. In this case the value for each item
+    /// is assigned by the value of the given ReadMap. 
+    template <typename CMap>
+    ArrayMap& operator=(const CMap& cmap) {
+      checkConcept<concept::ReadMap<Key, _Value>, CMap>();
+      const typename Parent::Notifier* notifier = Parent::getNotifier();
+      Item it;
+      for (notifier->first(it); it != INVALID; notifier->next(it)) {
+        set(it, cmap[it]);
+      }
+      return *this;
+    }
+
     /// \brief The destructor of the map.
     ///     
@@ -130,8 +161,4 @@
     }
 		
-  private:
-
-    ArrayMap& operator=(const ArrayMap&);
-
   protected:
 
Index: lemon/bits/base_extender.h
===================================================================
--- lemon/bits/base_extender.h	(revision 1999)
+++ lemon/bits/base_extender.h	(revision 2031)
@@ -467,4 +467,13 @@
       return Edge(edge, direction);
     }
+
+    int edgeNum() const {
+      return 2 * Parent::edgeNum();
+    }
+
+    int uEdgeNum() const {
+      return Parent::edgeNum();
+    }
+
   };
 
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 1999)
+++ lemon/bits/default_map.h	(revision 2031)
@@ -164,4 +164,14 @@
       : Parent(graph, value) {}
 
+    DefaultMap& operator=(const DefaultMap& cmap) {
+      return operator=<DefaultMap>(cmap);
+    }
+
+    template <typename CMap>
+    DefaultMap& operator=(const CMap& cmap) {
+      Parent::operator=(cmap);
+      return *this;
+    }
+
   };
 
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 1999)
+++ lemon/bits/edge_set_extender.h	(revision 2031)
@@ -102,5 +102,5 @@
 
       explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
+	_graph.first(static_cast<Node&>(*this));
       }
 
@@ -125,5 +125,5 @@
 
       explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
+	_graph.first(static_cast<Edge&>(*this));
       }
 
@@ -236,12 +236,8 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	Edge it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
+
     };
 
@@ -365,5 +361,5 @@
 
       explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
+	_graph.first(static_cast<Node&>(*this));
       }
 
@@ -388,5 +384,5 @@
 
       explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
+	_graph.first(static_cast<Edge&>(*this));
       }
 
@@ -459,5 +455,5 @@
 
       explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<UEdge*>(this));
+	_graph.first(static_cast<UEdge&>(*this));
       }
 
@@ -557,12 +553,8 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	Edge it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
+
     };
 
@@ -577,4 +569,5 @@
       UEdgeMap(const Graph& _g) 
 	: Parent(_g) {}
+
       UEdgeMap(const Graph& _g, const _Value& _v) 
 	: Parent(_g, _v) {}
@@ -586,12 +579,8 @@
       template <typename CMap>
       UEdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	UEdge it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
+
     };
 
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h	(revision 1996)
+++ lemon/bits/graph_adaptor_extender.h	(revision 2031)
@@ -34,10 +34,11 @@
   ///
   /// \brief Extender for the GraphAdaptors
-  template <typename Base>
-  class GraphAdaptorExtender : public Base {
+  template <typename _Graph>
+  class GraphAdaptorExtender : public _Graph {
   public:
 
-    typedef Base Parent;
-    typedef GraphAdaptorExtender Graph;
+    typedef _Graph Parent;
+    typedef _Graph Graph;
+    typedef GraphAdaptorExtender Adaptor;
 
     // Base extensions
@@ -72,5 +73,5 @@
 
     class NodeIt : public Node { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -79,9 +80,9 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
-      }
-
-      NodeIt(const Graph& _graph, const Node& node) 
+      explicit NodeIt(const Adaptor& _graph) : graph(&_graph) {
+	_graph.first(static_cast<Node&>(*this));
+      }
+
+      NodeIt(const Adaptor& _graph, const Node& node) 
 	: Node(node), graph(&_graph) {}
 
@@ -95,5 +96,5 @@
 
     class EdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -102,9 +103,9 @@
       EdgeIt(Invalid i) : Edge(i) { }
 
-      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
-      }
-
-      EdgeIt(const Graph& _graph, const Edge& e) : 
+      explicit EdgeIt(const Adaptor& _graph) : graph(&_graph) {
+	_graph.first(static_cast<Edge&>(*this));
+      }
+
+      EdgeIt(const Adaptor& _graph, const Edge& e) : 
 	Edge(e), graph(&_graph) { }
 
@@ -118,5 +119,5 @@
 
     class OutEdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -125,10 +126,10 @@
       OutEdgeIt(Invalid i) : Edge(i) { }
 
-      OutEdgeIt(const Graph& _graph, const Node& node) 
+      OutEdgeIt(const Adaptor& _graph, const Node& node) 
 	: graph(&_graph) {
 	_graph.firstOut(*this, node);
       }
 
-      OutEdgeIt(const Graph& _graph, const Edge& edge) 
+      OutEdgeIt(const Adaptor& _graph, const Edge& edge) 
 	: Edge(edge), graph(&_graph) {}
 
@@ -142,5 +143,5 @@
 
     class InEdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -149,10 +150,10 @@
       InEdgeIt(Invalid i) : Edge(i) { }
 
-      InEdgeIt(const Graph& _graph, const Node& node) 
+      InEdgeIt(const Adaptor& _graph, const Node& node) 
 	: graph(&_graph) {
 	_graph.firstIn(*this, node);
       }
 
-      InEdgeIt(const Graph& _graph, const Edge& edge) : 
+      InEdgeIt(const Adaptor& _graph, const Edge& edge) : 
 	Edge(edge), graph(&_graph) {}
 
@@ -198,10 +199,11 @@
   ///
   /// \brief Extender for the UGraphAdaptors
-  template <typename Base> 
-  class UGraphAdaptorExtender : public Base {
+  template <typename _UGraph> 
+  class UGraphAdaptorExtender : public _UGraph {
   public:
     
-    typedef Base Parent;
-    typedef UGraphAdaptorExtender Graph;
+    typedef _UGraph Parent;
+    typedef _UGraph UGraph;
+    typedef UGraphAdaptorExtender Adaptor;
 
     typedef typename Parent::Node Node;
@@ -255,5 +257,5 @@
 
     class NodeIt : public Node { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -262,9 +264,9 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
-      }
-
-      NodeIt(const Graph& _graph, const Node& node) 
+      explicit NodeIt(const Adaptor& _graph) : graph(&_graph) {
+	_graph.first(static_cast<Node&>(*this));
+      }
+
+      NodeIt(const Adaptor& _graph, const Node& node) 
 	: Node(node), graph(&_graph) {}
 
@@ -278,5 +280,5 @@
 
     class EdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -285,9 +287,9 @@
       EdgeIt(Invalid i) : Edge(i) { }
 
-      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
-      }
-
-      EdgeIt(const Graph& _graph, const Edge& e) : 
+      explicit EdgeIt(const Adaptor& _graph) : graph(&_graph) {
+	_graph.first(static_cast<Edge&>(*this));
+      }
+
+      EdgeIt(const Adaptor& _graph, const Edge& e) : 
 	Edge(e), graph(&_graph) { }
 
@@ -301,5 +303,5 @@
 
     class OutEdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -308,10 +310,10 @@
       OutEdgeIt(Invalid i) : Edge(i) { }
 
-      OutEdgeIt(const Graph& _graph, const Node& node) 
+      OutEdgeIt(const Adaptor& _graph, const Node& node) 
 	: graph(&_graph) {
 	_graph.firstOut(*this, node);
       }
 
-      OutEdgeIt(const Graph& _graph, const Edge& edge) 
+      OutEdgeIt(const Adaptor& _graph, const Edge& edge) 
 	: Edge(edge), graph(&_graph) {}
 
@@ -325,5 +327,5 @@
 
     class InEdgeIt : public Edge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -332,10 +334,10 @@
       InEdgeIt(Invalid i) : Edge(i) { }
 
-      InEdgeIt(const Graph& _graph, const Node& node) 
+      InEdgeIt(const Adaptor& _graph, const Node& node) 
 	: graph(&_graph) {
 	_graph.firstIn(*this, node);
       }
 
-      InEdgeIt(const Graph& _graph, const Edge& edge) : 
+      InEdgeIt(const Adaptor& _graph, const Edge& edge) : 
 	Edge(edge), graph(&_graph) {}
 
@@ -348,5 +350,5 @@
 
     class UEdgeIt : public Parent::UEdge { 
-      const Graph* graph;
+      const Adaptor* graph;
     public:
 
@@ -355,9 +357,9 @@
       UEdgeIt(Invalid i) : UEdge(i) { }
 
-      explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<UEdge*>(this));
-      }
-
-      UEdgeIt(const Graph& _graph, const UEdge& e) : 
+      explicit UEdgeIt(const Adaptor& _graph) : graph(&_graph) {
+	_graph.first(static_cast<UEdge&>(*this));
+      }
+
+      UEdgeIt(const Adaptor& _graph, const UEdge& e) : 
 	UEdge(e), graph(&_graph) { }
 
@@ -371,5 +373,5 @@
     class IncEdgeIt : public Parent::UEdge { 
       friend class UGraphAdaptorExtender;
-      const Graph* graph;
+      const Adaptor* graph;
       bool direction;
     public:
@@ -379,9 +381,9 @@
       IncEdgeIt(Invalid i) : UEdge(i), direction(false) { }
 
-      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
+      IncEdgeIt(const Adaptor& _graph, const Node &n) : graph(&_graph) {
 	_graph.firstInc(static_cast<UEdge&>(*this), direction, n);
       }
 
-      IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
+      IncEdgeIt(const Adaptor& _graph, const UEdge &ue, const Node &n)
 	: graph(&_graph), UEdge(ue) {
 	direction = (_graph.source(ue) == n);
@@ -437,4 +439,288 @@
   };
 
+  /// \ingroup graphbits
+  ///
+  /// \brief Extender for the BpUGraphAdaptors
+  template <typename Base>
+  class BpUGraphAdaptorExtender : public Base {
+  public:
+    typedef Base Parent;
+    typedef BpUGraphAdaptorExtender Graph;
+
+    typedef typename Parent::Node Node;
+    typedef typename Parent::BNode BNode;
+    typedef typename Parent::ANode ANode;
+    typedef typename Parent::Edge Edge;
+    typedef typename Parent::UEdge UEdge;
+
+    Node oppositeNode(const UEdge& edge, const Node& node) const {
+      return source(edge) == node ? 
+	target(edge) : source(edge);
+    }
+
+
+    int maxId(Node) const {
+      return Parent::maxNodeId();
+    }
+    int maxId(BNode) const {
+      return Parent::maxBNodeId();
+    }
+    int maxId(ANode) const {
+      return Parent::maxANodeId();
+    }
+    int maxId(Edge) const {
+      return Parent::maxEdgeId();
+    }
+    int maxId(UEdge) const {
+      return Parent::maxUEdgeId();
+    }
+
+
+    Node fromId(int id, Node) const {
+      return Parent::nodeFromId(id);
+    }
+    ANode fromId(int id, ANode) const {
+      return Parent::fromANodeId(id);
+    }
+    BNode fromId(int id, BNode) const {
+      return Parent::fromBNodeId(id);
+    }
+    Edge fromId(int id, Edge) const {
+      return Parent::edgeFromId(id);
+    }
+    UEdge fromId(int id, UEdge) const {
+      return Parent::uEdgeFromId(id);
+    }  
+  
+    class NodeIt : public Node { 
+      const Graph* graph;
+    public:
+    
+      NodeIt() { }
+    
+      NodeIt(Invalid i) : Node(INVALID) { }
+    
+      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
+	graph->first(static_cast<Node&>(*this));
+      }
+
+      NodeIt(const Graph& _graph, const Node& node) 
+	: Node(node), graph(&_graph) { }
+    
+      NodeIt& operator++() { 
+	graph->next(*this);
+	return *this; 
+      }
+
+    };
+
+    class ANodeIt : public Node { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      ANodeIt() { }
+    
+      ANodeIt(Invalid i) : Node(INVALID) { }
+    
+      explicit ANodeIt(const Graph& _graph) : graph(&_graph) {
+	graph->firstANode(static_cast<Node&>(*this));
+      }
+
+      ANodeIt(const Graph& _graph, const Node& node) 
+	: Node(node), graph(&_graph) {}
+    
+      ANodeIt& operator++() { 
+	graph->nextANode(*this);
+	return *this; 
+      }
+    };
+
+    class BNodeIt : public Node { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      BNodeIt() { }
+    
+      BNodeIt(Invalid i) : Node(INVALID) { }
+    
+      explicit BNodeIt(const Graph& _graph) : graph(&_graph) {
+	graph->firstBNode(static_cast<Node&>(*this));
+      }
+
+      BNodeIt(const Graph& _graph, const Node& node) 
+	: Node(node), graph(&_graph) {}
+    
+      BNodeIt& operator++() { 
+	graph->nextBNode(*this);
+	return *this; 
+      }
+    };
+
+    class EdgeIt : public Edge { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      EdgeIt() { }
+    
+      EdgeIt(Invalid i) : Edge(INVALID) { }
+    
+      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
+	graph->first(static_cast<Edge&>(*this));
+      }
+
+      EdgeIt(const Graph& _graph, const Edge& edge) 
+	: Edge(edge), graph(&_graph) { }
+    
+      EdgeIt& operator++() { 
+	graph->next(*this);
+	return *this; 
+      }
+
+    };
+
+    class UEdgeIt : public UEdge { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      UEdgeIt() { }
+    
+      UEdgeIt(Invalid i) : UEdge(INVALID) { }
+    
+      explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
+	graph->first(static_cast<UEdge&>(*this));
+      }
+
+      UEdgeIt(const Graph& _graph, const UEdge& edge) 
+	: UEdge(edge), graph(&_graph) { }
+    
+      UEdgeIt& operator++() { 
+	graph->next(*this);
+	return *this; 
+      }
+    };
+
+    class OutEdgeIt : public Edge { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      OutEdgeIt() { }
+    
+      OutEdgeIt(Invalid i) : Edge(i) { }
+    
+      OutEdgeIt(const Graph& _graph, const Node& node) 
+	: graph(&_graph) {
+	graph->firstOut(*this, node);
+      }
+    
+      OutEdgeIt(const Graph& _graph, const Edge& edge) 
+	: Edge(edge), graph(&_graph) {}
+    
+      OutEdgeIt& operator++() { 
+	graph->nextOut(*this);
+	return *this; 
+      }
+
+    };
+
+
+    class InEdgeIt : public Edge { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+    public:
+    
+      InEdgeIt() { }
+    
+      InEdgeIt(Invalid i) : Edge(i) { }
+    
+      InEdgeIt(const Graph& _graph, const Node& node) 
+	: graph(&_graph) {
+	graph->firstIn(*this, node);
+      }
+    
+      InEdgeIt(const Graph& _graph, const Edge& edge) : 
+	Edge(edge), graph(&_graph) {}
+    
+      InEdgeIt& operator++() { 
+	graph->nextIn(*this);
+	return *this; 
+      }
+
+    };
+  
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the source in this case) of the iterator
+    Node baseNode(const OutEdgeIt &e) const {
+      return Parent::source((Edge&)e);
+    }
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the target in this case) of the
+    /// iterator
+    Node runningNode(const OutEdgeIt &e) const {
+      return Parent::target((Edge&)e);
+    }
+  
+    /// \brief Base node of the iterator
+    ///
+    /// Returns the base node (ie. the target in this case) of the iterator
+    Node baseNode(const InEdgeIt &e) const {
+      return Parent::target((Edge&)e);
+    }
+    /// \brief Running node of the iterator
+    ///
+    /// Returns the running node (ie. the source in this case) of the
+    /// iterator
+    Node runningNode(const InEdgeIt &e) const {
+      return Parent::source((Edge&)e);
+    }
+  
+    class IncEdgeIt : public Parent::UEdge { 
+      friend class BpUGraphAdaptorExtender;
+      const Graph* graph;
+      bool direction;
+    public:
+    
+      IncEdgeIt() { }
+    
+      IncEdgeIt(Invalid i) : UEdge(i), direction(true) { }
+    
+      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
+	graph->firstInc(*this, direction, n);
+      }
+
+      IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
+	: graph(&_graph), UEdge(ue) {
+	direction = (graph->source(ue) == n);
+      }
+
+      IncEdgeIt& operator++() {
+	graph->nextInc(*this, direction);
+	return *this; 
+      }
+    };
+  
+
+    /// Base node of the iterator
+    ///
+    /// Returns the base node of the iterator
+    Node baseNode(const IncEdgeIt &e) const {
+      return e.direction ? source(e) : target(e);
+    }
+
+    /// Running node of the iterator
+    ///
+    /// Returns the running node of the iterator
+    Node runningNode(const IncEdgeIt &e) const {
+      return e.direction ? target(e) : source(e);
+    }
+
+  };
+
 
 }
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 1999)
+++ lemon/bits/graph_extender.h	(revision 2031)
@@ -104,5 +104,5 @@
 
       explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
+	_graph.first(static_cast<Node&>(*this));
       }
 
@@ -127,5 +127,5 @@
 
       explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
+	_graph.first(static_cast<Edge&>(*this));
       }
 
@@ -233,19 +233,7 @@
       }
 
-
-      /// \brief Template assign operator.
-      ///
-      /// The given parameter should be conform to the ReadMap
-      /// concecpt and could be indiced by the current item set of
-      /// the NodeMap. In this case the value for each item
-      /// is assigned by the value of the given ReadMap. 
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Node, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Node it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -271,10 +259,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -432,5 +415,5 @@
 
       explicit NodeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Node*>(this));
+	_graph.first(static_cast<Node&>(*this));
       }
 
@@ -455,5 +438,5 @@
 
       explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<Edge*>(this));
+	_graph.first(static_cast<Edge&>(*this));
       }
 
@@ -526,5 +509,5 @@
 
       explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
-	_graph.first(*static_cast<UEdge*>(this));
+	_graph.first(static_cast<UEdge&>(*this));
       }
 
@@ -623,19 +606,7 @@
       }
 
-
-      /// \brief Template assign operator.
-      ///
-      /// The given parameter should be conform to the ReadMap
-      /// concecpt and could be indiced by the current item set of
-      /// the NodeMap. In this case the value for each item
-      /// is assigned by the value of the given ReadMap. 
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Node, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Node it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -661,10 +632,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -681,4 +647,5 @@
       UEdgeMap(const Graph& graph) 
 	: Parent(graph) {}
+
       UEdgeMap(const Graph& graph, const _Value& value) 
 	: Parent(graph, value) {}
@@ -690,12 +657,8 @@
       template <typename CMap>
       UEdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
+
     };
 
@@ -1105,19 +1068,7 @@
       }
     
-
-      /// \brief Template assign operator.
-      ///
-      /// The given parameter should be conform to the ReadMap
-      /// concept and could be indiced by the current item set of
-      /// the ANodeMap. In this case the value for each item
-      /// is assigned by the value of the given ReadMap. 
       template <typename CMap>
       ANodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<ANode, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	ANode it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -1141,19 +1092,7 @@
       }
     
-
-      /// \brief Template assign operator.
-      ///
-      /// The given parameter should be conform to the ReadMap
-      /// concept and could be indiced by the current item set of
-      /// the BNodeMap. In this case the value for each item
-      /// is assigned by the value of the given ReadMap. 
       template <typename CMap>
       BNodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<BNode, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	BNode it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -1161,8 +1100,8 @@
     };
 
-  protected:
+  public:
 
     template <typename _Value>
-    class NodeMapBase {
+    class NodeMap {
     public:
       typedef BpUGraphExtender Graph;
@@ -1178,8 +1117,23 @@
       typedef True ReferenceMapTag;
 
-      NodeMapBase(const Graph& graph) 
-	: aNodeMap(graph), bNodeMap(graph) {}
-      NodeMapBase(const Graph& graph, const _Value& value) 
-	: aNodeMap(graph, value), bNodeMap(graph, value) {}
+      NodeMap(const Graph& _graph) 
+	: graph(_graph), aNodeMap(_graph), bNodeMap(_graph) {}
+      NodeMap(const Graph& _graph, const _Value& _value) 
+	: graph(_graph), aNodeMap(_graph, _value), bNodeMap(_graph, _value) {}
+
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+	checkConcept<concept::ReadMap<Node, _Value>, CMap>();
+	const typename Parent::Notifier* notifier = Parent::getNotifier();
+	Edge it;
+	for (graph.first(it); it != INVALID; graph.next(it)) {
+	  Parent::set(it, cmap[it]);
+	}
+	return *this;
+      }
 
       ConstReference operator[](const Key& node) const {
@@ -1207,52 +1161,60 @@
       }
 
-      const Graph* getGraph() const {
-        return aNodeMap.getGraph();
-      }
-
+      class MapIt : public NodeIt {
+      public:
+
+        typedef NodeIt Parent;
+        
+        explicit MapIt(NodeMap& _map) 
+          : Parent(_map.graph), map(_map) {}
+        
+        typename MapTraits<NodeMap>::ConstReturnValue operator*() const {
+          return map[*this];
+        }
+        
+        typename MapTraits<NodeMap>::ReturnValue operator*() {
+          return map[*this];
+        }
+        
+        void set(const Value& value) {
+          map.set(*this, value);
+        }
+
+      private:
+        NodeMap& map;
+      };
+
+      class ConstMapIt : public NodeIt {
+      public:
+
+        typedef NodeIt Parent;
+        
+        explicit ConstMapIt(const NodeMap& _map) 
+          : Parent(_map.graph), map(_map) {}
+        
+        typename MapTraits<NodeMap>::ConstReturnValue operator*() const {
+          return map[*this];
+        }
+        
+      private:
+        const NodeMap& map;
+      };
+
+      class ItemIt : public NodeIt {
+      public:
+
+        typedef NodeIt Parent;
+
+        explicit ItemIt(const NodeMap& _map)
+          : Parent(_map.graph) {}
+        
+      };
+      
     private:
+      const Graph& graph;
       ANodeMap<_Value> aNodeMap;
       BNodeMap<_Value> bNodeMap;
     };
     
-  public:
-
-    template <typename _Value>
-    class NodeMap 
-      : public MapExtender<NodeMapBase<_Value> > {
-    public:
-      typedef BpUGraphExtender Graph;
-      typedef MapExtender< NodeMapBase<_Value> > Parent;
-    
-      NodeMap(const Graph& graph) 
-	: Parent(graph) {}
-      NodeMap(const Graph& graph, const _Value& value) 
-	: Parent(graph, value) {}
-    
-      NodeMap& operator=(const NodeMap& cmap) {
-	return operator=<NodeMap>(cmap);
-      }
-    
-
-      /// \brief Template assign operator.
-      ///
-      /// The given parameter should be conform to the ReadMap
-      /// concept and could be indiced by the current item set of
-      /// the NodeMap. In this case the value for each item
-      /// is assigned by the value of the given ReadMap. 
-      template <typename CMap>
-      NodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Node, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
-	return *this;
-      }
-    
-    };
-
-
 
     template <typename _Value>
@@ -1274,10 +1236,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -1302,10 +1259,5 @@
       template <typename CMap>
       UEdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
-	const typename Parent::Notifier* notifier = Parent::getNotifier();
-	Edge it;
-	for (notifier->first(it); it != INVALID; notifier->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 1999)
+++ lemon/bits/map_extender.h	(revision 2031)
@@ -23,4 +23,7 @@
 
 #include <lemon/bits/traits.h>
+
+#include <lemon/concept_check.h>
+#include <lemon/concept/maps.h>
 
 ///\file
@@ -60,4 +63,13 @@
       : Parent(graph, value) {}
 
+    MapExtender& operator=(const MapExtender& cmap) {
+      return operator=<MapExtender>(cmap);
+    }
+
+    template <typename CMap>
+    MapExtender& operator=(const CMap& cmap) {
+      Parent::operator=(cmap);
+      return *this;
+    } 
 
     class MapIt : public Item {
@@ -131,5 +143,5 @@
     };
 
-    class ItemIt : Item {
+    class ItemIt : public Item {
     public:
       
@@ -141,5 +153,5 @@
 
       explicit ItemIt(Map& _map) : map(_map) {
-        map->getNotifier()->first(*this);
+        map.getNotifier()->first(*this);
       }
 
@@ -158,4 +170,151 @@
   };
 
+  /// \ingroup graphbits
+  /// 
+  /// \brief Extender for maps which use a subset of the items.
+  template <typename _Graph, typename _Map>
+  class SubMapExtender : public _Map {
+  public:
+
+    typedef _Map Parent;
+    typedef SubMapExtender Map;
+
+    typedef _Graph Graph;
+
+    typedef typename Parent::Key Item;
+
+    typedef typename Parent::Key Key;
+    typedef typename Parent::Value Value;
+
+    class MapIt;
+    class ConstMapIt;
+
+    friend class MapIt;
+    friend class ConstMapIt;
+
+  public:
+
+    SubMapExtender(const Graph& _graph) 
+      : Parent(_graph), graph(_graph) {}
+
+    SubMapExtender(const Graph& _graph, const Value& _value) 
+      : Parent(_graph, _value), graph(_graph) {}
+
+    SubMapExtender& operator=(const SubMapExtender& cmap) {
+      return operator=<MapExtender>(cmap);
+    }
+
+    template <typename CMap>
+    SubMapExtender& operator=(const CMap& cmap) {
+      checkConcept<concept::ReadMap<Key, Value>, CMap>();
+      Item it;
+      for (graph.first(it); it != INVALID; graph.next(it)) {
+        Parent::set(it, cmap[it]);
+      }
+      return *this;
+    } 
+
+    class MapIt : public Item {
+    public:
+      
+      typedef Item Parent;
+      typedef typename Map::Value Value;
+      
+      MapIt() {}
+
+      MapIt(Invalid i) : Parent(i) { }
+
+      explicit MapIt(Map& _map) : map(_map) {
+        map.graph.first(*this);
+      }
+
+      MapIt(const Map& _map, const Item& item) 
+	: Parent(item), map(_map) {}
+
+      MapIt& operator++() { 
+	map.graph.next(*this);
+	return *this; 
+      }
+      
+      typename MapTraits<Map>::ConstReturnValue operator*() const {
+	return map[*this];
+      }
+
+      typename MapTraits<Map>::ReturnValue operator*() {
+	return map[*this];
+      }
+      
+      void set(const Value& value) {
+	map.set(*this, value);
+      }
+      
+    protected:
+      Map& map;
+      
+    };
+
+    class ConstMapIt : public Item {
+    public:
+
+      typedef Item Parent;
+
+      typedef typename Map::Value Value;
+      
+      ConstMapIt() {}
+
+      ConstMapIt(Invalid i) : Parent(i) { }
+
+      explicit ConstMapIt(Map& _map) : map(_map) {
+        map.graph.first(*this);
+      }
+
+      ConstMapIt(const Map& _map, const Item& item) 
+	: Parent(item), map(_map) {}
+
+      ConstMapIt& operator++() { 
+	map.graph.next(*this);
+	return *this; 
+      }
+
+      typename MapTraits<Map>::ConstReturnValue operator*() const {
+	return map[*this];
+      }
+
+    protected:
+      const Map& map;
+    };
+
+    class ItemIt : public Item {
+    public:
+      
+      typedef Item Parent;
+      
+      ItemIt() {}
+
+      ItemIt(Invalid i) : Parent(i) { }
+
+      explicit ItemIt(Map& _map) : map(_map) {
+        map.graph.first(*this);
+      }
+
+      ItemIt(const Map& _map, const Item& item) 
+	: Parent(item), map(_map) {}
+
+      ItemIt& operator++() { 
+	map.graph.next(*this);
+	return *this; 
+      }
+
+    protected:
+      const Map& map;
+      
+    };
+    
+  private:
+
+    const Graph& graph;
+    
+  };
+
 }
 
Index: lemon/bits/vector_map.h
===================================================================
--- lemon/bits/vector_map.h	(revision 1999)
+++ lemon/bits/vector_map.h	(revision 2031)
@@ -27,4 +27,7 @@
 
 #include <lemon/bits/alteration_notifier.h>
+
+#include <lemon/concept_check.h>
+#include <lemon/concept/maps.h>
 
 ///\ingroup graphbits
@@ -113,8 +116,33 @@
     }
 
-  private:
-
-    VectorMap& operator=(const VectorMap&);
-
+    /// \brief Assign operator.
+    ///
+    /// This operator assigns for each item in the map the
+    /// value mapped to the same item in the copied map.  
+    /// The parameter map should be indiced with the same
+    /// itemset because this assign operator does not change
+    /// the container of the map. 
+    VectorMap& operator=(const VectorMap& cmap) {
+      return operator=<VectorMap>(cmap);
+    }
+
+
+    /// \brief Template assign operator.
+    ///
+    /// The given parameter should be conform to the ReadMap
+    /// concecpt and could be indiced by the current item set of
+    /// the NodeMap. In this case the value for each item
+    /// is assigned by the value of the given ReadMap. 
+    template <typename CMap>
+    VectorMap& operator=(const CMap& cmap) {
+      checkConcept<concept::ReadMap<Key, _Value>, CMap>();
+      const typename Parent::Notifier* notifier = Parent::getNotifier();
+      Item it;
+      for (notifier->first(it); it != INVALID; notifier->next(it)) {
+        set(it, cmap[it]);
+      }
+      return *this;
+    }
+    
   public:
 
Index: lemon/bpugraph_adaptor.h
===================================================================
--- lemon/bpugraph_adaptor.h	(revision 2031)
+++ lemon/bpugraph_adaptor.h	(revision 2031)
@@ -0,0 +1,412 @@
+/* -*- C++ -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) 2003-2006
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#ifndef LEMON_BPUGRAPH_ADAPTOR_H
+#define LEMON_BPUGRAPH_ADAPTOR_H
+
+#include <lemon/bits/invalid.h>
+#include <lemon/maps.h>
+
+#include <lemon/bits/graph_adaptor_extender.h>
+
+#include <lemon/bits/traits.h>
+
+#include <iostream>
+
+///\ingroup graph_adaptors
+///\file
+///\brief Several graph adaptors.
+///
+///This file contains several useful bpugraph adaptor functions.
+///
+///\author Balazs Dezso
+
+namespace lemon {
+
+  /// \ingroup graph_adaptors
+  ///
+  /// \brief Base type for the Bipartite Undirected Graph Adaptors
+  ///
+  /// This is the base type for most of LEMON bpugraph adaptors. 
+  /// This class implements a trivial graph adaptor i.e. it only wraps the 
+  /// functions and types of the graph. The purpose of this class is to 
+  /// make easier implementing graph adaptors. E.g. if an adaptor is 
+  /// considered which differs from the wrapped graph only in some of its 
+  /// functions or types, then it can be derived from BpUGraphAdaptor, and 
+  /// only the differences should be implemented.
+  ///
+  /// \author Balazs Dezso 
+  template<typename _BpUGraph>
+  class BpUGraphAdaptorBase {
+  public:
+    typedef _BpUGraph Graph;
+    typedef Graph ParentGraph;
+
+  protected:
+    Graph* graph;
+
+    BpUGraphAdaptorBase() : graph(0) {}
+
+    void setGraph(Graph& _graph) { graph = &_graph; }
+
+    Graph& getGraph() { return *graph; }
+    const Graph& getGraph() const { return *graph; }
+
+  public:
+
+    BpUGraphAdaptorBase(Graph& _graph) : graph(&_graph) {}
+ 
+    typedef typename Graph::Node Node;
+    typedef typename Graph::ANode ANode;
+    typedef typename Graph::BNode BNode;
+    typedef typename Graph::Edge Edge;
+    typedef typename Graph::UEdge UEdge;
+   
+    void first(Node& i) const { graph->first(i); }
+    void firstANode(Node& i) const { graph->firstANode(i); }
+    void firstBNode(Node& i) const { graph->firstBNode(i); }
+    void first(Edge& i) const { graph->first(i); }
+    void first(UEdge& i) const { graph->first(i); }
+    void firstIn(Edge& i, const Node& n) const { graph->firstIn(i, n); }
+    void firstOut(Edge& i, const Node& n ) const { graph->firstOut(i, n); }
+    void firstInc(UEdge &i, bool &d, const Node &n) const {
+      graph->firstInc(i, d, n);
+    }
+
+    void next(Node& i) const { graph->next(i); }
+    void nextANode(Node& i) const { graph->nextANode(i); }
+    void nextBNode(Node& i) const { graph->nextBNode(i); }
+    void next(Edge& i) const { graph->next(i); }
+    void next(UEdge& i) const { graph->next(i); }
+    void nextIn(Edge& i) const { graph->nextIn(i); }
+    void nextOut(Edge& i) const { graph->nextOut(i); }
+    void nextInc(UEdge &i, bool &d) const { graph->nextInc(i, d); }
+
+    Node source(const UEdge& e) const { return graph->source(e); }
+    Node target(const UEdge& e) const { return graph->target(e); }
+
+    Node source(const Edge& e) const { return graph->source(e); }
+    Node target(const Edge& e) const { return graph->target(e); }
+
+    typedef NodeNumTagIndicator<Graph> NodeNumTag;
+    int nodeNum() const { return graph->nodeNum(); }
+    int aNodeNum() const { return graph->aNodeNum(); }
+    int bNodeNum() const { return graph->bNodeNum(); }
+    
+    typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
+    int edgeNum() const { return graph->edgeNum(); }
+    int uEdgeNum() const { return graph->uEdgeNum(); }
+
+    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
+    Edge findEdge(const Node& source, const Node& target, 
+		  const Edge& prev = INVALID) {
+      return graph->findEdge(source, target, prev);
+    }
+    UEdge findUEdge(const Node& source, const Node& target, 
+                    const UEdge& prev = INVALID) {
+      return graph->findUEdge(source, target, prev);
+    }
+  
+    Node addNode() const { return graph->addNode(); }
+    UEdge addEdge(const Node& source, const Node& target) const { 
+      return graph->addEdge(source, target); 
+    }
+
+    void erase(const Node& i) const { graph->erase(i); }
+    void erase(const UEdge& i) const { graph->erase(i); }
+  
+    void clear() const { graph->clear(); }
+
+    bool direction(const Edge& e) const { return graph->direction(e); }
+    Edge direct(const UEdge& e, bool d) const { return graph->direct(e, d); }
+    
+    int id(const Node& v) const { return graph->id(v); }
+    int id(const ANode& v) const { return graph->id(v); }
+    int id(const BNode& v) const { return graph->id(v); }
+    int id(const Edge& e) const { return graph->id(e); }
+    int id(const UEdge& e) const { return graph->id(e); }
+
+    Node fromNodeId(int id) const { return graph->fromNodeId(id); }
+    ANode fromANodeId(int id) const { return graph->fromANodeId(id); }
+    BNode fromBNodeId(int id) const { return graph->fromBNodeId(id); }
+    Edge fromEdgeId(int id) const { return graph->fromEdgeId(id); }
+    UEdge fromUEdgeId(int id) const { return graph->fromUEdgeId(id); }
+
+    int maxNodeId() const { return graph->maxNodeId(); }
+    int maxANodeId() const { return graph->maxANodeId(); }
+    int maxBNodeId() const { return graph->maxBNodeId(); }
+    int maxEdgeId() const { return graph->maxEdgeId(); }
+    int maxUEdgeId() const { return graph->maxEdgeId(); }
+
+    typedef typename ItemSetTraits<Graph, Node>::ItemNotifier NodeNotifier;
+    NodeNotifier& getNotifier(Node) const {
+      return graph->getNotifier(Node()); 
+    } 
+
+    typedef typename ItemSetTraits<Graph, ANode>::ItemNotifier ANodeNotifier;
+    ANodeNotifier& getNotifier(ANode) const {
+      return graph->getNotifier(ANode());
+    } 
+
+    typedef typename ItemSetTraits<Graph, BNode>::ItemNotifier BNodeNotifier;
+    BNodeNotifier& getNotifier(BNode) const {
+      return graph->getNotifier(BNode());
+    } 
+
+    typedef typename ItemSetTraits<Graph, Edge>::ItemNotifier EdgeNotifier;
+    EdgeNotifier& getNotifier(Edge) const {
+      return graph->getNotifier(Edge());
+    } 
+
+    typedef typename ItemSetTraits<Graph, UEdge>::ItemNotifier UEdgeNotifier;
+    UEdgeNotifier& getNotifier(UEdge) const {
+      return graph->getNotifier(UEdge());
+    } 
+
+    template <typename _Value>
+    class NodeMap : public Graph::template NodeMap<_Value> {
+    public:
+      typedef typename Graph::template NodeMap<_Value> Parent;
+      explicit NodeMap(const BpUGraphAdaptorBase<Graph>& ga) 
+	: Parent(*ga.graph) {}
+      NodeMap(const BpUGraphAdaptorBase<Graph>& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class ANodeMap : public Graph::template ANodeMap<_Value> {
+    public:
+      typedef typename Graph::template ANodeMap<_Value> Parent;
+      explicit ANodeMap(const BpUGraphAdaptorBase& ga) 
+	: Parent(*ga.graph) {}
+      ANodeMap(const BpUGraphAdaptorBase& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      ANodeMap& operator=(const ANodeMap& cmap) {
+	return operator=<ANodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      ANodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class BNodeMap : public Graph::template BNodeMap<_Value> {
+    public:
+      typedef typename Graph::template BNodeMap<_Value> Parent;
+      explicit BNodeMap(const BpUGraphAdaptorBase<Graph>& ga) 
+	: Parent(*ga.graph) {}
+      BNodeMap(const BpUGraphAdaptorBase<Graph>& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      BNodeMap& operator=(const BNodeMap& cmap) {
+	return operator=<BNodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      BNodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class EdgeMap : public Graph::template EdgeMap<_Value> {
+    public:
+      typedef typename Graph::template EdgeMap<_Value> Parent;
+      explicit EdgeMap(const BpUGraphAdaptorBase<Graph>& ga) 
+	: Parent(*ga.graph) {}
+      EdgeMap(const BpUGraphAdaptorBase<Graph>& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class UEdgeMap : public Graph::template UEdgeMap<_Value> {
+    public:
+      typedef typename Graph::template UEdgeMap<_Value> Parent;
+      explicit UEdgeMap(const BpUGraphAdaptorBase<Graph>& ga) 
+	: Parent(*ga.graph) {}
+      UEdgeMap(const BpUGraphAdaptorBase<Graph>& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      UEdgeMap& operator=(const UEdgeMap& cmap) {
+	return operator=<UEdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      UEdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+  };
+
+  /// \ingroup graph_adaptors
+  template <typename _BpUGraph>
+  class BpUGraphAdaptor 
+    : public BpUGraphAdaptorExtender< BpUGraphAdaptorBase<_BpUGraph> > { 
+  public:
+    typedef _BpUGraph Graph;
+    typedef BpUGraphAdaptorExtender<BpUGraphAdaptorBase<_BpUGraph> > Parent;
+  protected:
+    BpUGraphAdaptor() : Parent() {}
+
+  public:
+    explicit BpUGraphAdaptor(Graph& _graph) { setGraph(_graph); }
+  };
+
+  template <typename _BpUGraph>
+  class SwapBpUGraphAdaptorBase : public BpUGraphAdaptorBase<_BpUGraph> {
+  public:
+    
+    typedef _BpUGraph Graph;
+    typedef BpUGraphAdaptorBase<_BpUGraph> Parent;
+
+  protected:
+    
+    SwapBpUGraphAdaptorBase() {}
+
+  public:
+
+    typedef typename Parent::Node Node;
+    typedef typename Parent::BNode ANode;
+    typedef typename Parent::ANode BNode;
+
+    void firstANode(Node& i) const { Parent::firstBNode(i); }
+    void firstBNode(Node& i) const { Parent::firstANode(i); }
+
+    void nextANode(Node& i) const { Parent::nextBNode(i); }
+    void nextBNode(Node& i) const { Parent::nextANode(i); }
+
+    int id(const ANode& v) const { return Parent::id(v); }
+    int id(const BNode& v) const { return Parent::id(v); }
+
+    ANode fromANodeId(int id) const { return Parent::fromBNodeId(id); }
+    BNode fromBNodeId(int id) const { return Parent::fromANodeId(id); }
+
+    int maxANodeId() const { return Parent::maxBNodeId(); }
+    int maxBNodeId() const { return Parent::maxANodeId(); }
+
+    int aNodeNum() const { return Parent::bNodeNum(); }
+    int bNodeNum() const { return Parent::aNodeNum(); }
+
+    typedef typename Parent::BNodeNotifier ANodeNotifier;
+    ANodeNotifier& getNotifier(ANode) const {
+      return Parent::getNotifier(typename Parent::BNode());
+    } 
+
+    typedef typename Parent::ANodeNotifier BNodeNotifier;
+    BNodeNotifier& getNotifier(BNode) const {
+      return Parent::getNotifier(typename Parent::ANode());
+    } 
+
+    template <typename _Value>
+    class ANodeMap : public Graph::template BNodeMap<_Value> {
+    public:
+      typedef typename Graph::template BNodeMap<_Value> Parent;
+      explicit ANodeMap(const SwapBpUGraphAdaptorBase& ga) 
+	: Parent(*ga.graph) {}
+      ANodeMap(const SwapBpUGraphAdaptorBase& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      ANodeMap& operator=(const ANodeMap& cmap) {
+	return operator=<ANodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      ANodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class BNodeMap : public Graph::template ANodeMap<_Value> {
+    public:
+      typedef typename Graph::template ANodeMap<_Value> Parent;
+      explicit BNodeMap(const SwapBpUGraphAdaptorBase<Graph>& ga) 
+	: Parent(*ga.graph) {}
+      BNodeMap(const SwapBpUGraphAdaptorBase<Graph>& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      BNodeMap& operator=(const BNodeMap& cmap) {
+	return operator=<BNodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      BNodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+    
+  };
+
+  /// \ingroup graph_adaptors
+  ///
+  /// \brief Bipartite graph adaptor which swaps the two nodeset.
+  ///
+  /// Bipartite graph adaptor which swaps the two nodeset. The adaptor's
+  /// a-nodeset will be the original graph's b-nodeset and the adaptor's
+  /// b-nodeset will be the original graph's a-nodeset. 
+  template <typename _BpUGraph>
+  class SwapBpUGraphAdaptor 
+    : public BpUGraphAdaptorExtender<SwapBpUGraphAdaptorBase<_BpUGraph> > { 
+  public:
+
+    typedef _BpUGraph Graph;
+    typedef BpUGraphAdaptorExtender<SwapBpUGraphAdaptorBase<_BpUGraph> > 
+    Parent;
+
+  protected:
+    SwapBpUGraphAdaptor() : Parent() {}
+
+  public:
+
+    explicit SwapBpUGraphAdaptor(Graph& _graph) { setGraph(_graph); }
+
+  };
+
+
+}
+
+#endif
Index: lemon/edge_set.h
===================================================================
--- lemon/edge_set.h	(revision 1999)
+++ lemon/edge_set.h	(revision 2031)
@@ -207,9 +207,22 @@
     class NodeMap : public Graph::template NodeMap<_Value> {
     public:
+
       typedef typename _Graph::template NodeMap<_Value> Parent;
+
       explicit NodeMap(const ListEdgeSetBase<Graph>& edgeset) 
-	: Parent(*edgeset.graph) { }
+	: Parent(*edgeset.graph) {}
+
       NodeMap(const ListEdgeSetBase<Graph>& edgeset, const _Value& value)
-	: Parent(*edgeset.graph, value) { }
+	: Parent(*edgeset.graph, value) {}
+
+      NodeMap& operator=(const NodeMap& cmap) {
+        return operator=<NodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
     };
 
@@ -522,9 +535,22 @@
     class NodeMap : public Graph::template NodeMap<_Value> {
     public:
+
       typedef typename _Graph::template NodeMap<_Value> Parent;
+
       explicit NodeMap(const SmartEdgeSetBase<Graph>& edgeset) 
 	: Parent(*edgeset.graph) { }
+
       NodeMap(const SmartEdgeSetBase<Graph>& edgeset, const _Value& value)
 	: Parent(*edgeset.graph, value) { }
+
+      NodeMap& operator=(const NodeMap& cmap) {
+        return operator=<NodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
     };
 
@@ -668,5 +694,5 @@
 
     void eraseNode(const Node& node) {
-      if (Parent::IncEdgeIt(*this, node) == INVALID) {
+      if (typename Parent::IncEdgeIt(*this, node) == INVALID) {
         return;
       }
Index: lemon/full_graph.h
===================================================================
--- lemon/full_graph.h	(revision 1999)
+++ lemon/full_graph.h	(revision 2031)
@@ -646,4 +646,12 @@
     }
 
+    typedef True NodeNumTag;
+    int nodeNum() const { return _aNodeNum + _bNodeNum; }
+    int aNodeNum() const { return _aNodeNum; }
+    int bNodeNum() const { return _bNodeNum; }
+
+    typedef True EdgeNumTag;
+    int edgeNum() const { return _edgeNum; }
+
   };
 
Index: lemon/graph_adaptor.h
===================================================================
--- lemon/graph_adaptor.h	(revision 1999)
+++ lemon/graph_adaptor.h	(revision 2031)
@@ -20,11 +20,11 @@
 #define LEMON_GRAPH_ADAPTOR_H
 
-///\ingroup graph_adaptors
-///\file
-///\brief Several graph adaptors.
+/// \ingroup graph_adaptors
+/// \file
+/// \brief Several graph adaptors.
 ///
-///This file contains several useful graph adaptor functions.
+/// This file contains several useful graph adaptor functions.
 ///
-///\author Marton Makai
+/// \author Marton Makai and Balazs Dezso
 
 #include <lemon/bits/invalid.h>
@@ -62,4 +62,5 @@
   public:
     typedef _Graph Graph;
+    typedef GraphAdaptorBase Adaptor;
     typedef Graph ParentGraph;
 
@@ -116,4 +117,12 @@
     int id(const Edge& e) const { return graph->id(e); }
 
+    Node fromNodeId(int id) const {
+      return graph->fromNodeId(id);
+    }
+
+    Edge fromEdgeId(int id) const {
+      return graph->fromEdgeId(id);
+    }
+
     int maxNodeId() const {
       return graph->maxNodeId();
@@ -137,21 +146,49 @@
     
     template <typename _Value>
-    class NodeMap : public _Graph::template NodeMap<_Value> {
+    class NodeMap : public Graph::template NodeMap<_Value> {
     public:
-      typedef typename _Graph::template NodeMap<_Value> Parent;
-      explicit NodeMap(const GraphAdaptorBase<_Graph>& ga) 
-	: Parent(*ga.graph) { }
-      NodeMap(const GraphAdaptorBase<_Graph>& ga, const _Value& value)
+
+      typedef typename Graph::template NodeMap<_Value> Parent;
+
+      explicit NodeMap(const Adaptor& ga) 
+	: Parent(*ga.graph) {}
+
+      NodeMap(const Adaptor& ga, const _Value& value)
 	: Parent(*ga.graph, value) { }
+
+      NodeMap& operator=(const NodeMap& cmap) {
+        return operator=<NodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
+      
     };
 
     template <typename _Value>
-    class EdgeMap : public _Graph::template EdgeMap<_Value> {
+    class EdgeMap : public Graph::template EdgeMap<_Value> {
     public:
-      typedef typename _Graph::template EdgeMap<_Value> Parent;
-      explicit EdgeMap(const GraphAdaptorBase<_Graph>& ga) 
-	: Parent(*ga.graph) { }
-      EdgeMap(const GraphAdaptorBase<_Graph>& ga, const _Value& value)
-	: Parent(*ga.graph, value) { }
+      
+      typedef typename Graph::template EdgeMap<_Value> Parent;
+      
+      explicit EdgeMap(const Adaptor& ga) 
+	: Parent(*ga.graph) {}
+
+      EdgeMap(const Adaptor& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      EdgeMap& operator=(const EdgeMap& cmap) {
+        return operator=<EdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
+
     };
 
@@ -256,4 +293,5 @@
   public:
     typedef _Graph Graph;
+    typedef SubGraphAdaptorBase Adaptor;
     typedef GraphAdaptorBase<_Graph> Parent;
   protected:
@@ -378,4 +416,57 @@
       return edge;
     }
+
+    template <typename _Value>
+    class NodeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template NodeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template NodeMap<_Value> > Parent;
+    
+      NodeMap(const Graph& graph) 
+	: Parent(graph) {}
+      NodeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template EdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template EdgeMap<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
   };
 
@@ -385,4 +476,5 @@
   public:
     typedef _Graph Graph;
+    typedef SubGraphAdaptorBase Adaptor;
     typedef GraphAdaptorBase<_Graph> Parent;
   protected:
@@ -497,4 +589,57 @@
       return edge;
     }
+
+    template <typename _Value>
+    class NodeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template NodeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template NodeMap<_Value> > Parent;
+    
+      NodeMap(const Graph& graph) 
+	: Parent(graph) {}
+      NodeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template EdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template EdgeMap<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
   };
 
@@ -567,9 +712,12 @@
   public:
     typedef _Graph Graph;
-    typedef GraphAdaptorExtender<
-      SubGraphAdaptorBase<_Graph, NodeFilterMap, EdgeFilterMap> > Parent;
+    typedef GraphAdaptorExtender< SubGraphAdaptorBase<_Graph, NodeFilterMap, 
+                                                      EdgeFilterMap, checked> >
+    Parent;
+
   protected:
     SubGraphAdaptor() { }
   public:
+
     SubGraphAdaptor(_Graph& _graph, NodeFilterMap& _node_filter_map, 
 		    EdgeFilterMap& _edge_filter_map) { 
@@ -578,4 +726,5 @@
       setEdgeFilterMap(_edge_filter_map);
     }
+
   };
 
@@ -636,6 +785,9 @@
 			   ConstMap<typename Graph::Edge,bool>, checked> {
   public:
+
     typedef SubGraphAdaptor<Graph, NodeFilterMap, 
-			    ConstMap<typename Graph::Edge,bool> > Parent;
+			    ConstMap<typename Graph::Edge,bool>, checked > 
+    Parent;
+
   protected:
     ConstMap<typename Graph::Edge, bool> const_true_map;
@@ -646,4 +798,5 @@
 
   public:
+
     NodeSubGraphAdaptor(Graph& _graph, NodeFilterMap& _node_filter_map) : 
       Parent(), const_true_map(true) { 
@@ -652,4 +805,5 @@
       Parent::setEdgeFilterMap(const_true_map);
     }
+
   };
 
@@ -821,4 +975,5 @@
 
   public:
+
     EdgeSubGraphAdaptor(Graph& _graph, EdgeFilterMap& _edge_filter_map) : 
       Parent(), const_true_map(true) { 
@@ -827,4 +982,5 @@
       Parent::setEdgeFilterMap(_edge_filter_map);
     }
+
   };
 
@@ -849,4 +1005,5 @@
   public:
     typedef _Graph Graph;
+    typedef UndirGraphAdaptorBase Adaptor;
     typedef UGraphBaseExtender<GraphAdaptorBase<_Graph> > Parent;
 
@@ -860,7 +1017,8 @@
     typedef typename Parent::Edge Edge;
 
+  private:
     
     template <typename _Value>
-    class EdgeMap {
+    class EdgeMapBase {
     private:
       
@@ -874,9 +1032,9 @@
       typedef Edge Key;
       
-      EdgeMap(const UndirGraphAdaptorBase<_Graph>& _g) :
-	forward_map(*(_g.graph)), backward_map(*(_g.graph)) {}
-
-      EdgeMap(const UndirGraphAdaptorBase<_Graph>& _g, const Value& a) 
-        : forward_map(*(_g.graph), a), backward_map(*(_g.graph), a) {}
+      EdgeMapBase(const Adaptor& adaptor) :
+	forward_map(*adaptor.graph), backward_map(*adaptor.graph) {}
+
+      EdgeMapBase(const Adaptor& adaptor, const Value& v) 
+        : forward_map(*adaptor.graph, v), backward_map(*adaptor.graph, v) {}
       
       void set(const Edge& e, const Value& a) { 
@@ -909,17 +1067,53 @@
 
     };
+
+  public:
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, EdgeMapBase<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, EdgeMapBase<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
         
     template <typename _Value>
-    class UEdgeMap : public _Graph::template EdgeMap<_Value> {
+    class UEdgeMap : public Graph::template EdgeMap<_Value> {
     public:
-
-      typedef typename _Graph::template EdgeMap<_Value> Parent; 
-
-      UEdgeMap(const UndirGraphAdaptorBase<_Graph>& g) 
-        : Parent(*(g.graph)) {}
-
-      UEdgeMap(const UndirGraphAdaptorBase<_Graph>& g, const _Value& a) 
-        : Parent(*(g.graph), a) {}
-      
+      
+      typedef typename Graph::template EdgeMap<_Value> Parent;
+      
+      explicit UEdgeMap(const Adaptor& ga) 
+	: Parent(*ga.graph) {}
+
+      UEdgeMap(const Adaptor& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      UEdgeMap& operator=(const UEdgeMap& cmap) {
+        return operator=<UEdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      UEdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
+
     };
       
@@ -934,4 +1128,5 @@
 
     typedef _Graph Graph;
+    typedef UndirGraphAdaptorBase Adaptor;
     typedef UGraphBaseExtender<GraphAdaptorBase<_Graph> > Parent;
 
@@ -1034,9 +1229,8 @@
     NotifierProxy edge_notifier_proxy;
 
-  public:
-    
+  private:
     
     template <typename _Value>
-    class EdgeMap {
+    class EdgeMapBase {
     private:
       
@@ -1050,9 +1244,9 @@
       typedef Edge Key;
       
-      EdgeMap(const UndirGraphAdaptorBase<_Graph>& _g) :
-	forward_map(*(_g.graph)), backward_map(*(_g.graph)) {}
-
-      EdgeMap(const UndirGraphAdaptorBase<_Graph>& _g, const Value& a) 
-        : forward_map(*(_g.graph), a), backward_map(*(_g.graph), a) {}
+      EdgeMapBase(const Adaptor& adaptor) :
+	forward_map(*adaptor.graph), backward_map(*adaptor.graph) {}
+
+      EdgeMapBase(const Adaptor& adaptor, const Value& v) 
+        : forward_map(*adaptor.graph, v), backward_map(*adaptor.graph, v) {}
       
       void set(const Edge& e, const Value& a) { 
@@ -1064,6 +1258,5 @@
       }
 
-      typename MapTraits<MapImpl>::ConstReturnValue 
-      operator[](const Edge& e) const { 
+      typename MapTraits<MapImpl>::ConstReturnValue operator[](Edge e) const { 
 	if (Parent::direction(e)) {
 	  return forward_map[e]; 
@@ -1073,6 +1266,5 @@
       }
 
-      typename MapTraits<MapImpl>::ReturnValue 
-      operator[](const Edge& e) { 
+      typename MapTraits<MapImpl>::ReturnValue operator[](Edge e) { 
 	if (Parent::direction(e)) {
 	  return forward_map[e]; 
@@ -1087,17 +1279,53 @@
 
     };
+
+  public:
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, EdgeMapBase<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, EdgeMapBase<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
         
     template <typename _Value>
-    class UEdgeMap : public _Graph::template EdgeMap<_Value> {
+    class UEdgeMap : public Graph::template EdgeMap<_Value> {
     public:
-
-      typedef typename _Graph::template EdgeMap<_Value> Parent; 
-
-      UEdgeMap(const UndirGraphAdaptorBase<_Graph>& g) 
-        : Parent(*(g.graph)) {}
-
-      UEdgeMap(const UndirGraphAdaptorBase<_Graph>& g, const _Value& a) 
-        : Parent(*(g.graph), a) {}
-      
+      
+      typedef typename Graph::template EdgeMap<_Value> Parent;
+      
+      explicit UEdgeMap(const Adaptor& ga) 
+	: Parent(*ga.graph) {}
+
+      UEdgeMap(const Adaptor& ga, const _Value& value)
+	: Parent(*ga.graph, value) {}
+
+      UEdgeMap& operator=(const UEdgeMap& cmap) {
+        return operator=<UEdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      UEdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
+
     };
       
Index: lemon/graph_utils.h
===================================================================
--- lemon/graph_utils.h	(revision 2029)
+++ lemon/graph_utils.h	(revision 2031)
@@ -49,6 +49,5 @@
   ///This \c \#define creates convenience typedefs for the following types
   ///of \c Graph: \c Node,  \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
-  ///\c OutEdgeIt,  \c BoolNodeMap,  \c IntNodeMap,  \c DoubleNodeMap,
-  ///\c BoolEdgeMap, \c IntEdgeMap,  \c DoubleEdgeMap.  
+  ///\c OutEdgeIt
   ///\note If \c G it a template parameter, it should be used in this way.
   ///\code
@@ -65,11 +64,5 @@
     typedef Graph:: InEdgeIt  InEdgeIt;			\
     typedef Graph::OutEdgeIt OutEdgeIt;			
-//     typedef Graph::template NodeMap<bool> BoolNodeMap;	       
-//     typedef Graph::template NodeMap<int> IntNodeMap;	       
-//     typedef Graph::template NodeMap<double> DoubleNodeMap;  
-//     typedef Graph::template EdgeMap<bool> BoolEdgeMap;	       
-//     typedef Graph::template EdgeMap<int> IntEdgeMap;	       
-//     typedef Graph::template EdgeMap<double> DoubleEdgeMap;
-  
+
   ///Creates convenience typedefs for the undirected graph types and iterators
 
@@ -77,5 +70,4 @@
   ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
   ///\c UEdge, \c UEdgeIt, \c IncEdgeIt,
-  ///\c BoolUEdgeMap, \c IntUEdgeMap,  \c DoubleUEdgeMap.  
   ///
   ///\note If \c G it a template parameter, it should be used in this way.
@@ -94,6 +86,23 @@
 //     typedef Graph::template UEdgeMap<int> IntUEdgeMap;
 //     typedef Graph::template UEdgeMap<double> DoubleUEdgeMap;
-  
-
+
+  ///\brief Creates convenience typedefs for the bipartite undirected graph 
+  ///types and iterators
+
+  ///This \c \#define creates the same convenience typedefs as defined by
+  ///\ref UGRAPH_TYPEDEFS(Graph) and two more, namely it creates
+  ///\c ANodeIt, \c BNodeIt, 
+  ///
+  ///\note If \c G it a template parameter, it should be used in this way.
+  ///\code
+  ///  BPUGRAPH_TYPEDEFS(typename G)
+  ///\endcode
+  ///
+  ///\warning There are no typedefs for the graph maps because of the lack of
+  ///template typedefs in C++.
+#define BPUGRAPH_TYPEDEFS(Graph)            \
+  UGRAPH_TYPEDEFS(Graph)                    \
+    typedef Graph::ANodeIt ANodeIt;	    \
+    typedef Graph::BNodeIt BNodeIt;
 
   /// \brief Function to count the items in the graph.
@@ -431,5 +440,5 @@
         if (u != v) {
           if (e == INVALID) {
-            g.firstInc(e, u, b);
+            g.firstInc(e, b, u);
           } else {
             b = g.source(e) == u;
@@ -441,5 +450,5 @@
         } else {
           if (e == INVALID) {
-            g.firstInc(e, u, b);
+            g.firstInc(e, b, u);
           } else {
             b = true;
@@ -486,9 +495,9 @@
   ///\endcode
   template <typename Graph>
-  inline typename Graph::UEdge findEdge(const Graph &g,
-                                        typename Graph::Node u, 
-                                        typename Graph::Node v,
-                                        typename Graph::UEdge prev = INVALID) {
-    return _graph_utils_bits::FindUEdgeSelector<Graph>::find(g, u, v, prev);
+  inline typename Graph::UEdge findUEdge(const Graph &g,
+                                         typename Graph::Node u, 
+                                         typename Graph::Node v,
+                                         typename Graph::UEdge p = INVALID) {
+    return _graph_utils_bits::FindUEdgeSelector<Graph>::find(g, u, v, p);
   }
 
Index: lemon/iterable_maps.h
===================================================================
--- lemon/iterable_maps.h	(revision 1993)
+++ lemon/iterable_maps.h	(revision 2031)
@@ -21,4 +21,5 @@
 
 #include <lemon/bits/default_map.h>
+#include <lemon/bits/map_extender.h>
 
 #include <vector>
@@ -401,10 +402,9 @@
   template <typename _Graph, typename _Item>
   class IterableIntMap 
-    : protected DefaultMap<_Graph, _Item, _iterable_maps_bits::
-                           IterableIntMapNode<_Item> > {
+    : protected MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
+                                       IterableIntMapNode<_Item> > >{
   public:
-    typedef DefaultMap<_Graph, _Item, _iterable_maps_bits::
-                       IterableIntMapNode<_Item> >
-    Parent;
+    typedef MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
+                                   IterableIntMapNode<_Item> > > Parent;
 
     /// The key type
@@ -690,9 +690,10 @@
   template <typename _Graph, typename _Item, typename _Value>
   class IterableValueMap 
-    : protected DefaultMap<_Graph, _Item, _iterable_maps_bits::
-                           IterableValueMapNode<_Item, _Value> > {
+    : protected MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
+                                       IterableValueMapNode<_Item, _Value> > >{
   public:
-    typedef DefaultMap<_Graph, _Item, _iterable_maps_bits::
-                       IterableValueMapNode<_Item, _Value> > Parent;
+    typedef MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
+                                   IterableValueMapNode<_Item, _Value> > >
+    Parent;
 
     /// The key type
@@ -703,8 +704,4 @@
     typedef _Graph Graph;
 
-  protected:
-
-    typedef typename ItemSetTraits<_Graph, Key>::ItemIt KeyIt; 
-
   public:
 
@@ -716,5 +713,5 @@
       : Parent(graph, _iterable_maps_bits::
                IterableValueMapNode<_Item, _Value>(value)) {
-      for (KeyIt it(*Parent::getGraph()); it != INVALID; ++it) {
+      for (typename Parent::ItemIt it(*this); it != INVALID; ++it) {
         lace(it);
       }
@@ -904,5 +901,5 @@
     virtual void build() {
       Parent::build();
-      for (KeyIt it(*Parent::getGraph()); it != INVALID; ++it) {
+      for (typename Parent::ItemIt it(*this); it != INVALID; ++it) {
         lace(it);
       }
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 1999)
+++ lemon/list_graph.h	(revision 2031)
@@ -67,5 +67,5 @@
 
       int id;
-      Node(int pid) { id = pid;}
+      explicit Node(int pid) { id = pid;}
 
     public:
@@ -82,5 +82,5 @@
 
       int id;
-      Edge(int pid) { id = pid;}
+      explicit Edge(int pid) { id = pid;}
 
     public:
@@ -111,6 +111,6 @@
     int maxEdgeId() const { return edges.size()-1; }
 
-    Node source(Edge e) const { return edges[e.id].source; }
-    Node target(Edge e) const { return edges[e.id].target; }
+    Node source(Edge e) const { return Node(edges[e.id].source); }
+    Node target(Edge e) const { return Node(edges[e.id].target); }
 
 
@@ -677,5 +677,5 @@
       int id;
 
-      Node(int _id) : id(_id) {}
+      explicit Node(int _id) : id(_id) {}
     public:
       Node() {}
@@ -691,5 +691,5 @@
       int id;
 
-      Edge(int _id) { id = _id;}
+      explicit Edge(int _id) { id = _id;}
     public:
       Edge() {}
Index: lemon/smart_graph.h
===================================================================
--- lemon/smart_graph.h	(revision 1999)
+++ lemon/smart_graph.h	(revision 2031)
@@ -576,4 +576,12 @@
     }
 
+    typedef True NodeNumTag;
+    int nodeNum() const { return aNodes.size() + bNodes.size(); }
+    int aNodeNum() const { return aNodes.size(); }
+    int bNodeNum() const { return bNodes.size(); }
+
+    typedef True EdgeNumTag;
+    int edgeNum() const { return edges.size(); }
+
   };
 
Index: lemon/ugraph_adaptor.h
===================================================================
--- lemon/ugraph_adaptor.h	(revision 1993)
+++ lemon/ugraph_adaptor.h	(revision 2031)
@@ -102,4 +102,5 @@
     typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
     int edgeNum() const { return graph->edgeNum(); }
+    int uEdgeNum() const { return graph->uEdgeNum(); }
 
     typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
@@ -119,13 +120,26 @@
 
     void erase(const Node& i) const { graph->erase(i); }
-    void erase(const Edge& i) const { graph->erase(i); }
+    void erase(const UEdge& i) const { graph->erase(i); }
   
     void clear() const { graph->clear(); }
     
-    int id(const Node& v) const { return graph->id(v); }
-    int id(const UEdge& e) const { return graph->id(e); }
-
     bool direction(const Edge& e) const { return graph->direction(e); }
     Edge direct(const UEdge& e, bool d) const { return graph->direct(e, d); }
+
+    int id(const Node& v) const { return graph->id(v); }
+    int id(const Edge& e) const { return graph->id(e); }
+    int id(const UEdge& e) const { return graph->id(e); }
+
+    Node fromNodeId(int id) const {
+      return graph->fromNodeId(id);
+    }
+
+    Edge fromEdgeId(int id) const {
+      return graph->fromEdgeId(id);
+    }
+
+    UEdge fromUEdgeId(int id) const {
+      return graph->fromUEdgeId(id);
+    }
 
     int maxNodeId() const {
@@ -174,12 +188,8 @@
       template <typename CMap>
       NodeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Node, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	Node it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
-	return *this;
-      }
+        Parent::operator=(cmap);
+        return *this;
+      }
+
     };
 
@@ -199,10 +209,5 @@
       template <typename CMap>
       EdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<Edge, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	Edge it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
+        Parent::operator=(cmap);
 	return *this;
       }
@@ -224,11 +229,6 @@
       template <typename CMap>
       UEdgeMap& operator=(const CMap& cmap) {
-	checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
-	const typename Parent::Graph* graph = Parent::getGraph();
-	UEdge it;
-	for (graph->first(it); it != INVALID; graph->next(it)) {
-	  Parent::set(it, cmap[it]);
-	}
-	return *this;
+        Parent::operator=(cmap);
+        return *this;
       }
     };
@@ -255,4 +255,5 @@
   public:
     typedef _UGraph Graph;
+    typedef SubUGraphAdaptorBase Adaptor;
     typedef UGraphAdaptorBase<_UGraph> Parent;
   protected:
@@ -417,4 +418,83 @@
       return uedge;
     }
+
+    template <typename _Value>
+    class NodeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template NodeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template NodeMap<_Value> > Parent;
+    
+      NodeMap(const Graph& graph) 
+	: Parent(graph) {}
+      NodeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template EdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template EdgeMap<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class UEdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template UEdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template UEdgeMap<_Value> > Parent;
+    
+      UEdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      UEdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      UEdgeMap& operator=(const UEdgeMap& cmap) {
+	return operator=<UEdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      UEdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
   };
 
@@ -424,4 +504,5 @@
   public:
     typedef _UGraph Graph;
+    typedef SubUGraphAdaptorBase Adaptor;
     typedef UGraphAdaptorBase<_UGraph> Parent;
   protected:
@@ -560,4 +641,82 @@
       return uedge;
     }
+
+    template <typename _Value>
+    class NodeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template NodeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template NodeMap<_Value> > Parent;
+    
+      NodeMap(const Graph& graph) 
+	: Parent(graph) {}
+      NodeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      NodeMap& operator=(const NodeMap& cmap) {
+	return operator=<NodeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class EdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template EdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template EdgeMap<_Value> > Parent;
+    
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      EdgeMap& operator=(const EdgeMap& cmap) {
+	return operator=<EdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
+
+    template <typename _Value>
+    class UEdgeMap 
+      : public SubMapExtender<Adaptor, 
+                              typename Parent::template UEdgeMap<_Value> > 
+    {
+    public:
+      typedef Adaptor Graph;
+      typedef SubMapExtender<Adaptor, typename Parent::
+                             template UEdgeMap<_Value> > Parent;
+    
+      UEdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+      UEdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
+    
+      UEdgeMap& operator=(const UEdgeMap& cmap) {
+	return operator=<UEdgeMap>(cmap);
+      }
+    
+      template <typename CMap>
+      UEdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+	return *this;
+      }
+    };
   };
 
@@ -679,5 +838,4 @@
   }
 
-
   /// \brief An adaptor for hiding undirected edges from an undirected graph.
   ///
@@ -705,4 +863,5 @@
 
   public:
+
     EdgeSubUGraphAdaptor(Graph& _graph, UEdgeFilterMap& _uedge_filter_map) : 
       Parent(), const_true_map(true) { 
@@ -711,4 +870,5 @@
       Parent::setUEdgeFilterMap(_uedge_filter_map);
     }
+
   };
 
@@ -838,9 +998,23 @@
     class NodeMap : public _UGraph::template NodeMap<_Value> {
     public:
+
       typedef typename _UGraph::template NodeMap<_Value> Parent;
+
       explicit NodeMap(const DirUGraphAdaptorBase& ga) 
-	: Parent(*ga.graph) { }
+	: Parent(*ga.graph) {}
+
       NodeMap(const DirUGraphAdaptorBase& ga, const _Value& value)
-	: Parent(*ga.graph, value) { }
+	: Parent(*ga.graph, value) {}
+
+      NodeMap& operator=(const NodeMap& cmap) {
+        return operator=<NodeMap>(cmap);
+      }
+
+      template <typename CMap>
+      NodeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
+
     };
 
@@ -848,9 +1022,22 @@
     class EdgeMap : public _UGraph::template UEdgeMap<_Value> {
     public:
+
       typedef typename _UGraph::template UEdgeMap<_Value> Parent;
+
       explicit EdgeMap(const DirUGraphAdaptorBase& ga) 
 	: Parent(*ga.graph) { }
+
       EdgeMap(const DirUGraphAdaptorBase& ga, const _Value& value)
 	: Parent(*ga.graph, value) { }
+
+      EdgeMap& operator=(const EdgeMap& cmap) {
+        return operator=<EdgeMap>(cmap);
+      }
+
+      template <typename CMap>
+      EdgeMap& operator=(const CMap& cmap) {
+        Parent::operator=(cmap);
+        return *this;
+      }
     };
 
