Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 1264)
+++ lemon/CMakeLists.txt	(revision 1113)
@@ -5,10 +5,10 @@
 
 CONFIGURE_FILE(
-  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
   ${CMAKE_CURRENT_BINARY_DIR}/config.h
 )
 
 CONFIGURE_FILE(
-  ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.in
+  ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.cmake
   ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc
   @ONLY
@@ -37,5 +37,5 @@
 IF(LEMON_HAVE_CPLEX)
   SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
-  INCLUDE_DIRECTORIES(${ILOG_INCLUDE_DIRS})
+  INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
 ENDIF()
 
@@ -48,9 +48,4 @@
   SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
-ENDIF()
-
-IF(LEMON_HAVE_SOPLEX)
-  SET(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc)
-  INCLUDE_DIRECTORIES(${SOPLEX_INCLUDE_DIRS})
 ENDIF()
 
Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 1107)
+++ lemon/Makefile.am	(revision 1107)
@@ -0,0 +1,151 @@
+EXTRA_DIST += \
+	lemon/lemon.pc.in \
+	lemon/lemon.pc.cmake \
+	lemon/CMakeLists.txt \
+	lemon/config.h.cmake
+
+pkgconfig_DATA += lemon/lemon.pc
+
+lib_LTLIBRARIES += lemon/libemon.la
+
+lemon_libemon_la_SOURCES = \
+	lemon/arg_parser.cc \
+	lemon/base.cc \
+	lemon/color.cc \
+	lemon/lp_base.cc \
+	lemon/lp_skeleton.cc \
+	lemon/random.cc \
+	lemon/bits/windows.cc
+
+nodist_lemon_HEADERS = lemon/config.h	
+
+lemon_libemon_la_CXXFLAGS = \
+	$(AM_CXXFLAGS) \
+	$(GLPK_CFLAGS) \
+	$(CPLEX_CFLAGS) \
+	$(SOPLEX_CXXFLAGS) \
+	$(CLP_CXXFLAGS) \
+	$(CBC_CXXFLAGS)
+
+lemon_libemon_la_LDFLAGS = \
+	$(GLPK_LIBS) \
+	$(CPLEX_LIBS) \
+	$(SOPLEX_LIBS) \
+	$(CLP_LIBS) \
+	$(CBC_LIBS)
+
+if HAVE_GLPK
+lemon_libemon_la_SOURCES += lemon/glpk.cc
+endif
+
+if HAVE_CPLEX
+lemon_libemon_la_SOURCES += lemon/cplex.cc
+endif
+
+if HAVE_SOPLEX
+lemon_libemon_la_SOURCES += lemon/soplex.cc
+endif
+
+if HAVE_CLP
+lemon_libemon_la_SOURCES += lemon/clp.cc
+endif
+
+if HAVE_CBC
+lemon_libemon_la_SOURCES += lemon/cbc.cc
+endif
+
+lemon_HEADERS += \
+	lemon/adaptors.h \
+	lemon/arg_parser.h \
+	lemon/assert.h \
+	lemon/bellman_ford.h \
+	lemon/bfs.h \
+	lemon/bin_heap.h \
+	lemon/binomial_heap.h \
+	lemon/bucket_heap.h \
+	lemon/capacity_scaling.h \
+	lemon/cbc.h \
+	lemon/circulation.h \
+	lemon/clp.h \
+	lemon/color.h \
+	lemon/concept_check.h \
+	lemon/connectivity.h \
+	lemon/core.h \
+	lemon/cost_scaling.h \
+	lemon/counter.h \
+	lemon/cplex.h \
+	lemon/cycle_canceling.h \
+	lemon/dfs.h \
+	lemon/dheap.h \
+	lemon/dijkstra.h \
+	lemon/dim2.h \
+	lemon/dimacs.h \
+	lemon/edge_set.h \
+	lemon/elevator.h \
+	lemon/error.h \
+	lemon/euler.h \
+	lemon/fib_heap.h \
+	lemon/fractional_matching.h \
+	lemon/full_graph.h \
+	lemon/glpk.h \
+	lemon/gomory_hu.h \
+	lemon/graph_to_eps.h \
+	lemon/grid_graph.h \
+	lemon/hartmann_orlin_mmc.h \
+	lemon/howard_mmc.h \
+	lemon/hypercube_graph.h \
+	lemon/karp_mmc.h \
+	lemon/kruskal.h \
+	lemon/hao_orlin.h \
+	lemon/lgf_reader.h \
+	lemon/lgf_writer.h \
+	lemon/list_graph.h \
+	lemon/lp.h \
+	lemon/lp_base.h \
+	lemon/lp_skeleton.h \
+	lemon/maps.h \
+	lemon/matching.h \
+	lemon/math.h \
+	lemon/min_cost_arborescence.h \
+	lemon/nauty_reader.h \
+	lemon/network_simplex.h \
+	lemon/pairing_heap.h \
+	lemon/path.h \
+	lemon/planarity.h \
+	lemon/preflow.h \
+	lemon/quad_heap.h \
+	lemon/radix_heap.h \
+	lemon/radix_sort.h \
+	lemon/random.h \
+	lemon/smart_graph.h \
+	lemon/soplex.h \
+	lemon/static_graph.h \
+	lemon/suurballe.h \
+	lemon/time_measure.h \
+	lemon/tolerance.h \
+	lemon/unionfind.h \
+	lemon/bits/windows.h
+
+bits_HEADERS += \
+	lemon/bits/alteration_notifier.h \
+	lemon/bits/array_map.h \
+	lemon/bits/bezier.h \
+	lemon/bits/default_map.h \
+	lemon/bits/edge_set_extender.h \
+	lemon/bits/enable_if.h \
+	lemon/bits/graph_adaptor_extender.h \
+	lemon/bits/graph_extender.h \
+	lemon/bits/map_extender.h \
+	lemon/bits/path_dump.h \
+	lemon/bits/solver_bits.h \
+	lemon/bits/traits.h \
+	lemon/bits/variant.h \
+	lemon/bits/vector_map.h
+
+concept_HEADERS += \
+	lemon/concepts/digraph.h \
+	lemon/concepts/graph.h \
+	lemon/concepts/graph_components.h \
+	lemon/concepts/heap.h \
+	lemon/concepts/maps.h \
+	lemon/concepts/path.h
Index: lemon/adaptors.h
===================================================================
--- lemon/adaptors.h	(revision 1270)
+++ lemon/adaptors.h	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/assert.h
===================================================================
--- lemon/assert.h	(revision 1270)
+++ lemon/assert.h	(revision 463)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -200,5 +200,5 @@
                              ::lemon::_assert_bits::cstringify(msg),    \
                              #exp), 0)))
-#    if defined LEMON_ENABLE_DEBUG
+#    if LEMON_ENABLE_DEBUG
 #      define LEMON_DEBUG(exp, msg)                                     \
          (static_cast<void> (!!(exp) ? 0 : (                            \
Index: lemon/base.cc
===================================================================
--- lemon/base.cc	(revision 1270)
+++ lemon/base.cc	(revision 554)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -22,5 +22,4 @@
 #include<lemon/tolerance.h>
 #include<lemon/core.h>
-#include<lemon/time_measure.h>
 namespace lemon {
 
@@ -33,5 +32,3 @@
 #endif
 
-  TimeStamp::Format TimeStamp::_format = TimeStamp::NORMAL;
-
 } //namespace lemon
Index: lemon/bellman_ford.h
===================================================================
--- lemon/bellman_ford.h	(revision 1270)
+++ lemon/bellman_ford.h	(revision 960)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -150,5 +150,5 @@
   /// This class provides an efficient implementation of the Bellman-Ford
   /// algorithm. The maximum time complexity of the algorithm is
-  /// <tt>O(nm)</tt>.
+  /// <tt>O(ne)</tt>.
   ///
   /// The Bellman-Ford algorithm solves the single-source shortest path
@@ -201,10 +201,9 @@
     /// The type of the paths.
     typedef PredMapPath<Digraph, PredMap> Path;
-    ///\brief The \ref lemon::BellmanFordDefaultOperationTraits
+    ///\brief The \ref BellmanFordDefaultOperationTraits
     /// "operation traits class" of the algorithm.
     typedef typename TR::OperationTraits OperationTraits;
 
-    ///\brief The \ref lemon::BellmanFordDefaultTraits "traits class"
-    ///of the algorithm.
+    ///The \ref BellmanFordDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
 
Index: lemon/bfs.h
===================================================================
--- lemon/bfs.h	(revision 1270)
+++ lemon/bfs.h	(revision 1127)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -153,5 +153,5 @@
     typedef PredMapPath<Digraph, PredMap> Path;
 
-    ///The \ref lemon::BfsDefaultTraits "traits class" of the algorithm.
+    ///The \ref BfsDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
 
Index: lemon/bin_heap.h
===================================================================
--- lemon/bin_heap.h	(revision 1270)
+++ lemon/bin_heap.h	(revision 758)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/alteration_notifier.h
===================================================================
--- lemon/bits/alteration_notifier.h	(revision 1270)
+++ lemon/bits/alteration_notifier.h	(revision 463)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -24,5 +24,4 @@
 
 #include <lemon/core.h>
-#include <lemon/bits/lock.h>
 
 //\ingroup graphbits
@@ -253,5 +252,5 @@
     typedef std::list<ObserverBase*> Observers;
     Observers _observers;
-    lemon::bits::Lock _lock;
+
 
   public:
@@ -334,16 +333,12 @@
 
     void attach(ObserverBase& observer) {
-      _lock.lock();
       observer._index = _observers.insert(_observers.begin(), &observer);
       observer._notifier = this;
-      _lock.unlock();
     }
 
     void detach(ObserverBase& observer) {
-      _lock.lock();
       _observers.erase(observer._index);
       observer._index = _observers.end();
       observer._notifier = 0;
-      _lock.unlock();
     }
 
Index: lemon/bits/array_map.h
===================================================================
--- lemon/bits/array_map.h	(revision 1270)
+++ lemon/bits/array_map.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/bezier.h
===================================================================
--- lemon/bits/bezier.h	(revision 1270)
+++ lemon/bits/bezier.h	(revision 1157)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 1270)
+++ lemon/bits/default_map.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 1270)
+++ lemon/bits/edge_set_extender.h	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h	(revision 1270)
+++ lemon/bits/graph_adaptor_extender.h	(revision 965)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 1270)
+++ lemon/bits/graph_extender.h	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -747,585 +747,4 @@
   };
 
-  // \ingroup _graphbits
-  //
-  // \brief Extender for the BpGraphs
-  template <typename Base>
-  class BpGraphExtender : public Base {
-    typedef Base Parent;
-
-  public:
-
-    typedef BpGraphExtender BpGraph;
-
-    typedef True UndirectedTag;
-
-    typedef typename Parent::Node Node;
-    typedef typename Parent::RedNode RedNode;
-    typedef typename Parent::BlueNode BlueNode;
-    typedef typename Parent::Arc Arc;
-    typedef typename Parent::Edge Edge;
-
-    // BpGraph extension
-
-    using Parent::first;
-    using Parent::next;
-    using Parent::id;
-
-    int maxId(Node) const {
-      return Parent::maxNodeId();
-    }
-
-    int maxId(RedNode) const {
-      return Parent::maxRedId();
-    }
-
-    int maxId(BlueNode) const {
-      return Parent::maxBlueId();
-    }
-
-    int maxId(Arc) const {
-      return Parent::maxArcId();
-    }
-
-    int maxId(Edge) const {
-      return Parent::maxEdgeId();
-    }
-
-    static Node fromId(int id, Node) {
-      return Parent::nodeFromId(id);
-    }
-
-    static Arc fromId(int id, Arc) {
-      return Parent::arcFromId(id);
-    }
-
-    static Edge fromId(int id, Edge) {
-      return Parent::edgeFromId(id);
-    }
-
-    Node u(Edge e) const { return this->redNode(e); }
-    Node v(Edge e) const { return this->blueNode(e); }
-
-    Node oppositeNode(const Node &n, const Edge &e) const {
-      if( n == u(e))
-        return v(e);
-      else if( n == v(e))
-        return u(e);
-      else
-        return INVALID;
-    }
-
-    Arc oppositeArc(const Arc &arc) const {
-      return Parent::direct(arc, !Parent::direction(arc));
-    }
-
-    using Parent::direct;
-    Arc direct(const Edge &edge, const Node &node) const {
-      return Parent::direct(edge, Parent::redNode(edge) == node);
-    }
-
-    RedNode asRedNode(const Node& node) const {
-      if (node == INVALID || Parent::blue(node)) {
-        return INVALID;
-      } else {
-        return Parent::asRedNodeUnsafe(node);
-      }
-    }
-
-    BlueNode asBlueNode(const Node& node) const {
-      if (node == INVALID || Parent::red(node)) {
-        return INVALID;
-      } else {
-        return Parent::asBlueNodeUnsafe(node);
-      }
-    }
-
-    // Alterable extension
-
-    typedef AlterationNotifier<BpGraphExtender, Node> NodeNotifier;
-    typedef AlterationNotifier<BpGraphExtender, RedNode> RedNodeNotifier;
-    typedef AlterationNotifier<BpGraphExtender, BlueNode> BlueNodeNotifier;
-    typedef AlterationNotifier<BpGraphExtender, Arc> ArcNotifier;
-    typedef AlterationNotifier<BpGraphExtender, Edge> EdgeNotifier;
-
-
-  protected:
-
-    mutable NodeNotifier node_notifier;
-    mutable RedNodeNotifier red_node_notifier;
-    mutable BlueNodeNotifier blue_node_notifier;
-    mutable ArcNotifier arc_notifier;
-    mutable EdgeNotifier edge_notifier;
-
-  public:
-
-    NodeNotifier& notifier(Node) const {
-      return node_notifier;
-    }
-
-    RedNodeNotifier& notifier(RedNode) const {
-      return red_node_notifier;
-    }
-
-    BlueNodeNotifier& notifier(BlueNode) const {
-      return blue_node_notifier;
-    }
-
-    ArcNotifier& notifier(Arc) const {
-      return arc_notifier;
-    }
-
-    EdgeNotifier& notifier(Edge) const {
-      return edge_notifier;
-    }
-
-
-
-    class NodeIt : public Node {
-      const BpGraph* _graph;
-    public:
-
-      NodeIt() {}
-
-      NodeIt(Invalid i) : Node(i) { }
-
-      explicit NodeIt(const BpGraph& graph) : _graph(&graph) {
-        _graph->first(static_cast<Node&>(*this));
-      }
-
-      NodeIt(const BpGraph& graph, const Node& node)
-        : Node(node), _graph(&graph) {}
-
-      NodeIt& operator++() {
-        _graph->next(*this);
-        return *this;
-      }
-
-    };
-
-    class RedNodeIt : public RedNode {
-      const BpGraph* _graph;
-    public:
-
-      RedNodeIt() {}
-
-      RedNodeIt(Invalid i) : RedNode(i) { }
-
-      explicit RedNodeIt(const BpGraph& graph) : _graph(&graph) {
-        _graph->first(static_cast<RedNode&>(*this));
-      }
-
-      RedNodeIt(const BpGraph& graph, const RedNode& node)
-        : RedNode(node), _graph(&graph) {}
-
-      RedNodeIt& operator++() {
-        _graph->next(static_cast<RedNode&>(*this));
-        return *this;
-      }
-
-    };
-
-    class BlueNodeIt : public BlueNode {
-      const BpGraph* _graph;
-    public:
-
-      BlueNodeIt() {}
-
-      BlueNodeIt(Invalid i) : BlueNode(i) { }
-
-      explicit BlueNodeIt(const BpGraph& graph) : _graph(&graph) {
-        _graph->first(static_cast<BlueNode&>(*this));
-      }
-
-      BlueNodeIt(const BpGraph& graph, const BlueNode& node)
-        : BlueNode(node), _graph(&graph) {}
-
-      BlueNodeIt& operator++() {
-        _graph->next(static_cast<BlueNode&>(*this));
-        return *this;
-      }
-
-    };
-
-
-    class ArcIt : public Arc {
-      const BpGraph* _graph;
-    public:
-
-      ArcIt() { }
-
-      ArcIt(Invalid i) : Arc(i) { }
-
-      explicit ArcIt(const BpGraph& graph) : _graph(&graph) {
-        _graph->first(static_cast<Arc&>(*this));
-      }
-
-      ArcIt(const BpGraph& graph, const Arc& arc) :
-        Arc(arc), _graph(&graph) { }
-
-      ArcIt& operator++() {
-        _graph->next(*this);
-        return *this;
-      }
-
-    };
-
-
-    class OutArcIt : public Arc {
-      const BpGraph* _graph;
-    public:
-
-      OutArcIt() { }
-
-      OutArcIt(Invalid i) : Arc(i) { }
-
-      OutArcIt(const BpGraph& graph, const Node& node)
-        : _graph(&graph) {
-        _graph->firstOut(*this, node);
-      }
-
-      OutArcIt(const BpGraph& graph, const Arc& arc)
-        : Arc(arc), _graph(&graph) {}
-
-      OutArcIt& operator++() {
-        _graph->nextOut(*this);
-        return *this;
-      }
-
-    };
-
-
-    class InArcIt : public Arc {
-      const BpGraph* _graph;
-    public:
-
-      InArcIt() { }
-
-      InArcIt(Invalid i) : Arc(i) { }
-
-      InArcIt(const BpGraph& graph, const Node& node)
-        : _graph(&graph) {
-        _graph->firstIn(*this, node);
-      }
-
-      InArcIt(const BpGraph& graph, const Arc& arc) :
-        Arc(arc), _graph(&graph) {}
-
-      InArcIt& operator++() {
-        _graph->nextIn(*this);
-        return *this;
-      }
-
-    };
-
-
-    class EdgeIt : public Parent::Edge {
-      const BpGraph* _graph;
-    public:
-
-      EdgeIt() { }
-
-      EdgeIt(Invalid i) : Edge(i) { }
-
-      explicit EdgeIt(const BpGraph& graph) : _graph(&graph) {
-        _graph->first(static_cast<Edge&>(*this));
-      }
-
-      EdgeIt(const BpGraph& graph, const Edge& edge) :
-        Edge(edge), _graph(&graph) { }
-
-      EdgeIt& operator++() {
-        _graph->next(*this);
-        return *this;
-      }
-
-    };
-
-    class IncEdgeIt : public Parent::Edge {
-      friend class BpGraphExtender;
-      const BpGraph* _graph;
-      bool _direction;
-    public:
-
-      IncEdgeIt() { }
-
-      IncEdgeIt(Invalid i) : Edge(i), _direction(false) { }
-
-      IncEdgeIt(const BpGraph& graph, const Node &node) : _graph(&graph) {
-        _graph->firstInc(*this, _direction, node);
-      }
-
-      IncEdgeIt(const BpGraph& graph, const Edge &edge, const Node &node)
-        : _graph(&graph), Edge(edge) {
-        _direction = (_graph->source(edge) == node);
-      }
-
-      IncEdgeIt& operator++() {
-        _graph->nextInc(*this, _direction);
-        return *this;
-      }
-    };
-
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the source in this case) of the iterator
-    Node baseNode(const OutArcIt &arc) const {
-      return Parent::source(static_cast<const Arc&>(arc));
-    }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the target in this case) of the
-    // iterator
-    Node runningNode(const OutArcIt &arc) const {
-      return Parent::target(static_cast<const Arc&>(arc));
-    }
-
-    // \brief Base node of the iterator
-    //
-    // Returns the base node (ie. the target in this case) of the iterator
-    Node baseNode(const InArcIt &arc) const {
-      return Parent::target(static_cast<const Arc&>(arc));
-    }
-    // \brief Running node of the iterator
-    //
-    // Returns the running node (ie. the source in this case) of the
-    // iterator
-    Node runningNode(const InArcIt &arc) const {
-      return Parent::source(static_cast<const Arc&>(arc));
-    }
-
-    // Base node of the iterator
-    //
-    // Returns the base node of the iterator
-    Node baseNode(const IncEdgeIt &edge) const {
-      return edge._direction ? this->u(edge) : this->v(edge);
-    }
-    // Running node of the iterator
-    //
-    // Returns the running node of the iterator
-    Node runningNode(const IncEdgeIt &edge) const {
-      return edge._direction ? this->v(edge) : this->u(edge);
-    }
-
-    // Mappable extension
-
-    template <typename _Value>
-    class NodeMap
-      : public MapExtender<DefaultMap<BpGraph, Node, _Value> > {
-      typedef MapExtender<DefaultMap<BpGraph, Node, _Value> > Parent;
-
-    public:
-      explicit NodeMap(const BpGraph& bpgraph)
-        : Parent(bpgraph) {}
-      NodeMap(const BpGraph& bpgraph, const _Value& value)
-        : Parent(bpgraph, value) {}
-
-    private:
-      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 RedNodeMap
-      : public MapExtender<DefaultMap<BpGraph, RedNode, _Value> > {
-      typedef MapExtender<DefaultMap<BpGraph, RedNode, _Value> > Parent;
-
-    public:
-      explicit RedNodeMap(const BpGraph& bpgraph)
-        : Parent(bpgraph) {}
-      RedNodeMap(const BpGraph& bpgraph, const _Value& value)
-        : Parent(bpgraph, value) {}
-
-    private:
-      RedNodeMap& operator=(const RedNodeMap& cmap) {
-        return operator=<RedNodeMap>(cmap);
-      }
-
-      template <typename CMap>
-      RedNodeMap& operator=(const CMap& cmap) {
-        Parent::operator=(cmap);
-        return *this;
-      }
-
-    };
-
-    template <typename _Value>
-    class BlueNodeMap
-      : public MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > {
-      typedef MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > Parent;
-
-    public:
-      explicit BlueNodeMap(const BpGraph& bpgraph)
-        : Parent(bpgraph) {}
-      BlueNodeMap(const BpGraph& bpgraph, const _Value& value)
-        : Parent(bpgraph, value) {}
-
-    private:
-      BlueNodeMap& operator=(const BlueNodeMap& cmap) {
-        return operator=<BlueNodeMap>(cmap);
-      }
-
-      template <typename CMap>
-      BlueNodeMap& operator=(const CMap& cmap) {
-        Parent::operator=(cmap);
-        return *this;
-      }
-
-    };
-
-    template <typename _Value>
-    class ArcMap
-      : public MapExtender<DefaultMap<BpGraph, Arc, _Value> > {
-      typedef MapExtender<DefaultMap<BpGraph, Arc, _Value> > Parent;
-
-    public:
-      explicit ArcMap(const BpGraph& graph)
-        : Parent(graph) {}
-      ArcMap(const BpGraph& graph, const _Value& value)
-        : Parent(graph, value) {}
-
-    private:
-      ArcMap& operator=(const ArcMap& cmap) {
-        return operator=<ArcMap>(cmap);
-      }
-
-      template <typename CMap>
-      ArcMap& operator=(const CMap& cmap) {
-        Parent::operator=(cmap);
-        return *this;
-      }
-    };
-
-
-    template <typename _Value>
-    class EdgeMap
-      : public MapExtender<DefaultMap<BpGraph, Edge, _Value> > {
-      typedef MapExtender<DefaultMap<BpGraph, Edge, _Value> > Parent;
-
-    public:
-      explicit EdgeMap(const BpGraph& graph)
-        : Parent(graph) {}
-
-      EdgeMap(const BpGraph& graph, const _Value& value)
-        : Parent(graph, value) {}
-
-    private:
-      EdgeMap& operator=(const EdgeMap& cmap) {
-        return operator=<EdgeMap>(cmap);
-      }
-
-      template <typename CMap>
-      EdgeMap& operator=(const CMap& cmap) {
-        Parent::operator=(cmap);
-        return *this;
-      }
-
-    };
-
-    // Alteration extension
-
-    RedNode addRedNode() {
-      RedNode node = Parent::addRedNode();
-      notifier(RedNode()).add(node);
-      notifier(Node()).add(node);
-      return node;
-    }
-
-    BlueNode addBlueNode() {
-      BlueNode node = Parent::addBlueNode();
-      notifier(BlueNode()).add(node);
-      notifier(Node()).add(node);
-      return node;
-    }
-
-    Edge addEdge(const RedNode& from, const BlueNode& to) {
-      Edge edge = Parent::addEdge(from, to);
-      notifier(Edge()).add(edge);
-      std::vector<Arc> av;
-      av.push_back(Parent::direct(edge, true));
-      av.push_back(Parent::direct(edge, false));
-      notifier(Arc()).add(av);
-      return edge;
-    }
-
-    void clear() {
-      notifier(Arc()).clear();
-      notifier(Edge()).clear();
-      notifier(Node()).clear();
-      notifier(BlueNode()).clear();
-      notifier(RedNode()).clear();
-      Parent::clear();
-    }
-
-    template <typename BpGraph, typename NodeRefMap, typename EdgeRefMap>
-    void build(const BpGraph& graph, NodeRefMap& nodeRef,
-               EdgeRefMap& edgeRef) {
-      Parent::build(graph, nodeRef, edgeRef);
-      notifier(RedNode()).build();
-      notifier(BlueNode()).build();
-      notifier(Node()).build();
-      notifier(Edge()).build();
-      notifier(Arc()).build();
-    }
-
-    void erase(const Node& node) {
-      Arc arc;
-      Parent::firstOut(arc, node);
-      while (arc != INVALID ) {
-        erase(arc);
-        Parent::firstOut(arc, node);
-      }
-
-      Parent::firstIn(arc, node);
-      while (arc != INVALID ) {
-        erase(arc);
-        Parent::firstIn(arc, node);
-      }
-
-      if (Parent::red(node)) {
-        notifier(RedNode()).erase(this->asRedNodeUnsafe(node));
-      } else {
-        notifier(BlueNode()).erase(this->asBlueNodeUnsafe(node));
-      }
-
-      notifier(Node()).erase(node);
-      Parent::erase(node);
-    }
-
-    void erase(const Edge& edge) {
-      std::vector<Arc> av;
-      av.push_back(Parent::direct(edge, true));
-      av.push_back(Parent::direct(edge, false));
-      notifier(Arc()).erase(av);
-      notifier(Edge()).erase(edge);
-      Parent::erase(edge);
-    }
-
-    BpGraphExtender() {
-      red_node_notifier.setContainer(*this);
-      blue_node_notifier.setContainer(*this);
-      node_notifier.setContainer(*this);
-      arc_notifier.setContainer(*this);
-      edge_notifier.setContainer(*this);
-    }
-
-    ~BpGraphExtender() {
-      edge_notifier.clear();
-      arc_notifier.clear();
-      node_notifier.clear();
-      blue_node_notifier.clear();
-      red_node_notifier.clear();
-    }
-
-  };
-
 }
 
Index: lemon/bits/lock.h
===================================================================
--- lemon/bits/lock.h	(revision 1270)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_BITS_LOCK_H
-#define LEMON_BITS_LOCK_H
-
-#include <lemon/config.h>
-#if defined(LEMON_USE_PTHREAD)
-#include <pthread.h>
-#elif defined(LEMON_USE_WIN32_THREADS)
-#include <lemon/bits/windows.h>
-#endif
-
-namespace lemon {
-  namespace bits {
-
-#if defined(LEMON_USE_PTHREAD)
-    class Lock {
-    public:
-      Lock() {
-        pthread_mutex_init(&_lock, 0);
-      }
-      ~Lock() {
-        pthread_mutex_destroy(&_lock);
-      }
-      void lock() {
-        pthread_mutex_lock(&_lock);
-      }
-      void unlock() {
-        pthread_mutex_unlock(&_lock);
-      }
-
-    private:
-      pthread_mutex_t _lock;
-    };
-#elif defined(LEMON_USE_WIN32_THREADS)
-    class Lock : public WinLock {};
-#else
-    class Lock {
-    public:
-      Lock() {}
-      ~Lock() {}
-      void lock() {}
-      void unlock() {}
-    };
-#endif
-  }
-}
-
-#endif
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 1270)
+++ lemon/bits/map_extender.h	(revision 867)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/path_dump.h
===================================================================
--- lemon/bits/path_dump.h	(revision 1270)
+++ lemon/bits/path_dump.h	(revision 973)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/solver_bits.h
===================================================================
--- lemon/bits/solver_bits.h	(revision 1270)
+++ lemon/bits/solver_bits.h	(revision 1142)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/bits/traits.h
===================================================================
--- lemon/bits/traits.h	(revision 1270)
+++ lemon/bits/traits.h	(revision 663)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -149,86 +149,4 @@
         : Parent(_digraph, _value) {}
     };
-
-  };
-
-  template <typename GR, typename Enable = void>
-  struct RedNodeNotifierIndicator {
-    typedef InvalidType Type;
-  };
-  template <typename GR>
-  struct RedNodeNotifierIndicator<
-    GR,
-    typename enable_if<typename GR::RedNodeNotifier::Notifier, void>::type
-  > {
-    typedef typename GR::RedNodeNotifier Type;
-  };
-
-  template <typename GR>
-  class ItemSetTraits<GR, typename GR::RedNode> {
-  public:
-
-    typedef GR BpGraph;
-    typedef GR Graph;
-    typedef GR Digraph;
-
-    typedef typename GR::RedNode Item;
-    typedef typename GR::RedNodeIt ItemIt;
-
-    typedef typename RedNodeNotifierIndicator<GR>::Type ItemNotifier;
-
-    template <typename V>
-    class Map : public GR::template RedNodeMap<V> {
-      typedef typename GR::template RedNodeMap<V> Parent;
-
-    public:
-      typedef typename GR::template RedNodeMap<V> Type;
-      typedef typename Parent::Value Value;
-
-      Map(const GR& _bpgraph) : Parent(_bpgraph) {}
-      Map(const GR& _bpgraph, const Value& _value)
-        : Parent(_bpgraph, _value) {}
-
-     };
-
-  };
-
-  template <typename GR, typename Enable = void>
-  struct BlueNodeNotifierIndicator {
-    typedef InvalidType Type;
-  };
-  template <typename GR>
-  struct BlueNodeNotifierIndicator<
-    GR,
-    typename enable_if<typename GR::BlueNodeNotifier::Notifier, void>::type
-  > {
-    typedef typename GR::BlueNodeNotifier Type;
-  };
-
-  template <typename GR>
-  class ItemSetTraits<GR, typename GR::BlueNode> {
-  public:
-
-    typedef GR BpGraph;
-    typedef GR Graph;
-    typedef GR Digraph;
-
-    typedef typename GR::BlueNode Item;
-    typedef typename GR::BlueNodeIt ItemIt;
-
-    typedef typename BlueNodeNotifierIndicator<GR>::Type ItemNotifier;
-
-    template <typename V>
-    class Map : public GR::template BlueNodeMap<V> {
-      typedef typename GR::template BlueNodeMap<V> Parent;
-
-    public:
-      typedef typename GR::template BlueNodeMap<V> Type;
-      typedef typename Parent::Value Value;
-
-      Map(const GR& _bpgraph) : Parent(_bpgraph) {}
-      Map(const GR& _bpgraph, const Value& _value)
-        : Parent(_bpgraph, _value) {}
-
-     };
 
   };
Index: lemon/bits/windows.cc
===================================================================
--- lemon/bits/windows.cc	(revision 1270)
+++ lemon/bits/windows.cc	(revision 1055)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -131,36 +131,4 @@
 #endif
     }
-
-    WinLock::WinLock() {
-#ifdef WIN32
-      CRITICAL_SECTION *lock = new CRITICAL_SECTION;
-      InitializeCriticalSection(lock);
-      _repr = lock;
-#else
-      _repr = 0; //Just to avoid 'unused variable' warning with clang
-#endif
-    }
-
-    WinLock::~WinLock() {
-#ifdef WIN32
-      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
-      DeleteCriticalSection(lock);
-      delete lock;
-#endif
-    }
-
-    void WinLock::lock() {
-#ifdef WIN32
-      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
-      EnterCriticalSection(lock);
-#endif
-    }
-
-    void WinLock::unlock() {
-#ifdef WIN32
-      CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr);
-      LeaveCriticalSection(lock);
-#endif
-    }
   }
 }
Index: lemon/bits/windows.h
===================================================================
--- lemon/bits/windows.h	(revision 1270)
+++ lemon/bits/windows.h	(revision 576)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -29,14 +29,4 @@
     std::string getWinFormattedDate();
     int getWinRndSeed();
-
-    class WinLock {
-    public:
-      WinLock();
-      ~WinLock();
-      void lock();
-      void unlock();
-    private:
-      void *_repr;
-    };
   }
 }
Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 1270)
+++ lemon/capacity_scaling.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -67,14 +67,7 @@
   /// \ref CapacityScaling implements the capacity scaling version
   /// of the successive shortest path algorithm for finding a
-  /// \ref min_cost_flow "minimum cost flow" \cite amo93networkflows,
-  /// \cite edmondskarp72theoretical. It is an efficient dual
-  /// solution method, which runs in polynomial time
-  /// \f$O(m\log U (n+m)\log n)\f$, where <i>U</i> denotes the maximum
-  /// of node supply and arc capacity values.
-  ///
-  /// This algorithm is typically slower than \ref CostScaling and
-  /// \ref NetworkSimplex, but in special cases, it can be more
-  /// efficient than them.
-  /// (For more information, see \ref min_cost_flow_algs "the module page".)
+  /// \ref min_cost_flow "minimum cost flow" \ref amo93networkflows,
+  /// \ref edmondskarp72theoretical. It is an efficient dual
+  /// solution method.
   ///
   /// Most of the parameters of the problem (except for the digraph)
@@ -94,9 +87,8 @@
   /// consider to use the named template parameters instead.
   ///
-  /// \warning Both \c V and \c C must be signed number types.
-  /// \warning Capacity bounds and supply values must be integer, but
-  /// arc costs can be arbitrary real numbers.
-  /// \warning This algorithm does not support negative costs for
-  /// arcs having infinite upper bound.
+  /// \warning Both number types must be signed and all input data must
+  /// be integer.
+  /// \warning This algorithm does not support negative costs for such
+  /// arcs that have infinite upper bound.
 #ifdef DOXYGEN
   template <typename GR, typename V, typename C, typename TR>
@@ -119,6 +111,5 @@
     typedef typename TR::Heap Heap;
 
-    /// \brief The \ref lemon::CapacityScalingDefaultTraits "traits class"
-    /// of the algorithm
+    /// The \ref CapacityScalingDefaultTraits "traits class" of the algorithm
     typedef TR Traits;
 
@@ -432,5 +423,5 @@
     ///
     /// Using this function has the same effect as using \ref supplyMap()
-    /// with a map in which \c k is assigned to \c s, \c -k is
+    /// with such a map in which \c k is assigned to \c s, \c -k is
     /// assigned to \c t and all other nodes have zero supply value.
     ///
@@ -647,5 +638,5 @@
     ///
     /// This function returns the total cost of the found flow.
-    /// Its complexity is O(m).
+    /// Its complexity is O(e).
     ///
     /// \note The return type of the function can be specified as a
@@ -685,6 +676,5 @@
     }
 
-    /// \brief Copy the flow values (the primal solution) into the
-    /// given map.
+    /// \brief Return the flow map (the primal solution).
     ///
     /// This function copies the flow value on each arc into the given
@@ -710,6 +700,5 @@
     }
 
-    /// \brief Copy the potential values (the dual solution) into the
-    /// given map.
+    /// \brief Return the potential map (the dual solution).
     ///
     /// This function copies the potential (dual value) of each node
@@ -740,9 +729,4 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
-
-      // Check lower and upper bounds
-      LEMON_DEBUG(checkBoundMaps(),
-          "Upper bounds must be greater or equal to the lower bounds");
-
 
       // Initialize vectors
@@ -838,13 +822,4 @@
 
       return OPTIMAL;
-    }
-
-    // Check if the upper bound is greater or equal to the lower bound
-    // on each arc.
-    bool checkBoundMaps() {
-      for (int j = 0; j != _res_arc_num; ++j) {
-        if (_upper[j] < _lower[j]) return false;
-      }
-      return true;
     }
 
Index: lemon/cbc.cc
===================================================================
--- lemon/cbc.cc	(revision 1270)
+++ lemon/cbc.cc	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/cbc.h
===================================================================
--- lemon/cbc.h	(revision 1270)
+++ lemon/cbc.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -17,4 +17,5 @@
  */
 
+// -*- C++ -*-
 #ifndef LEMON_CBC_H
 #define LEMON_CBC_H
Index: lemon/christofides_tsp.h
===================================================================
--- lemon/christofides_tsp.h	(revision 1270)
+++ 	(revision )
@@ -1,254 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_CHRISTOFIDES_TSP_H
-#define LEMON_CHRISTOFIDES_TSP_H
-
-/// \ingroup tsp
-/// \file
-/// \brief Christofides algorithm for symmetric TSP
-
-#include <lemon/full_graph.h>
-#include <lemon/smart_graph.h>
-#include <lemon/kruskal.h>
-#include <lemon/matching.h>
-#include <lemon/euler.h>
-
-namespace lemon {
-
-  /// \ingroup tsp
-  ///
-  /// \brief Christofides algorithm for symmetric TSP.
-  ///
-  /// ChristofidesTsp implements Christofides' heuristic for solving
-  /// symmetric \ref tsp "TSP".
-  ///
-  /// This a well-known approximation method for the TSP problem with
-  /// metric cost function.
-  /// It has a guaranteed approximation factor of 3/2 (i.e. it finds a tour
-  /// whose total cost is at most 3/2 of the optimum), but it usually
-  /// provides better solutions in practice.
-  /// This implementation runs in O(n<sup>3</sup>log(n)) time.
-  ///
-  /// The algorithm starts with a \ref spantree "minimum cost spanning tree" and
-  /// finds a \ref MaxWeightedPerfectMatching "minimum cost perfect matching"
-  /// in the subgraph induced by the nodes that have odd degree in the
-  /// spanning tree.
-  /// Finally, it constructs the tour from the \ref EulerIt "Euler traversal"
-  /// of the union of the spanning tree and the matching.
-  /// During this last step, the algorithm simply skips the visited nodes
-  /// (i.e. creates shortcuts) assuming that the triangle inequality holds
-  /// for the cost function.
-  ///
-  /// \tparam CM Type of the cost map.
-  ///
-  /// \warning CM::Value must be a signed number type.
-  template <typename CM>
-  class ChristofidesTsp
-  {
-    public:
-
-      /// Type of the cost map
-      typedef CM CostMap;
-      /// Type of the edge costs
-      typedef typename CM::Value Cost;
-
-    private:
-
-      GRAPH_TYPEDEFS(FullGraph);
-
-      const FullGraph &_gr;
-      const CostMap &_cost;
-      std::vector<Node> _path;
-      Cost _sum;
-
-    public:
-
-      /// \brief Constructor
-      ///
-      /// Constructor.
-      /// \param gr The \ref FullGraph "full graph" the algorithm runs on.
-      /// \param cost The cost map.
-      ChristofidesTsp(const FullGraph &gr, const CostMap &cost)
-        : _gr(gr), _cost(cost) {}
-
-      /// \name Execution Control
-      /// @{
-
-      /// \brief Runs the algorithm.
-      ///
-      /// This function runs the algorithm.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run() {
-        _path.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-        else if (_gr.nodeNum() == 2) {
-          _path.push_back(_gr(0));
-          _path.push_back(_gr(1));
-          return _sum = 2 * _cost[_gr.edge(_gr(0), _gr(1))];
-        }
-
-        // Compute min. cost spanning tree
-        std::vector<Edge> tree;
-        kruskal(_gr, _cost, std::back_inserter(tree));
-
-        FullGraph::NodeMap<int> deg(_gr, 0);
-        for (int i = 0; i != int(tree.size()); ++i) {
-          Edge e = tree[i];
-          ++deg[_gr.u(e)];
-          ++deg[_gr.v(e)];
-        }
-
-        // Copy the induced subgraph of odd nodes
-        std::vector<Node> odd_nodes;
-        for (NodeIt u(_gr); u != INVALID; ++u) {
-          if (deg[u] % 2 == 1) odd_nodes.push_back(u);
-        }
-
-        SmartGraph sgr;
-        SmartGraph::EdgeMap<Cost> scost(sgr);
-        for (int i = 0; i != int(odd_nodes.size()); ++i) {
-          sgr.addNode();
-        }
-        for (int i = 0; i != int(odd_nodes.size()); ++i) {
-          for (int j = 0; j != int(odd_nodes.size()); ++j) {
-            if (j == i) continue;
-            SmartGraph::Edge e =
-              sgr.addEdge(sgr.nodeFromId(i), sgr.nodeFromId(j));
-            scost[e] = -_cost[_gr.edge(odd_nodes[i], odd_nodes[j])];
-          }
-        }
-
-        // Compute min. cost perfect matching
-        MaxWeightedPerfectMatching<SmartGraph, SmartGraph::EdgeMap<Cost> >
-          mwpm(sgr, scost);
-        mwpm.run();
-
-        for (SmartGraph::EdgeIt e(sgr); e != INVALID; ++e) {
-          if (mwpm.matching(e)) {
-            tree.push_back( _gr.edge(odd_nodes[sgr.id(sgr.u(e))],
-                                     odd_nodes[sgr.id(sgr.v(e))]) );
-          }
-        }
-
-        // Join the spanning tree and the matching
-        sgr.clear();
-        for (int i = 0; i != _gr.nodeNum(); ++i) {
-          sgr.addNode();
-        }
-        for (int i = 0; i != int(tree.size()); ++i) {
-          int ui = _gr.id(_gr.u(tree[i])),
-              vi = _gr.id(_gr.v(tree[i]));
-          sgr.addEdge(sgr.nodeFromId(ui), sgr.nodeFromId(vi));
-        }
-
-        // Compute the tour from the Euler traversal
-        SmartGraph::NodeMap<bool> visited(sgr, false);
-        for (EulerIt<SmartGraph> e(sgr); e != INVALID; ++e) {
-          SmartGraph::Node n = sgr.target(e);
-          if (!visited[n]) {
-            _path.push_back(_gr(sgr.id(n)));
-            visited[n] = true;
-          }
-        }
-
-        _sum = _cost[_gr.edge(_path.back(), _path.front())];
-        for (int i = 0; i < int(_path.size())-1; ++i) {
-          _sum += _cost[_gr.edge(_path[i], _path[i+1])];
-        }
-
-        return _sum;
-      }
-
-      /// @}
-
-      /// \name Query Functions
-      /// @{
-
-      /// \brief The total cost of the found tour.
-      ///
-      /// This function returns the total cost of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      Cost tourCost() const {
-        return _sum;
-      }
-
-      /// \brief Returns a const reference to the node sequence of the
-      /// found tour.
-      ///
-      /// This function returns a const reference to a vector
-      /// that stores the node sequence of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      const std::vector<Node>& tourNodes() const {
-        return _path;
-      }
-
-      /// \brief Gives back the node sequence of the found tour.
-      ///
-      /// This function copies the node sequence of the found tour into
-      /// an STL container through the given output iterator. The
-      /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
-      /// For example,
-      /// \code
-      /// std::vector<FullGraph::Node> nodes(countNodes(graph));
-      /// tsp.tourNodes(nodes.begin());
-      /// \endcode
-      /// or
-      /// \code
-      /// std::list<FullGraph::Node> nodes;
-      /// tsp.tourNodes(std::back_inserter(nodes));
-      /// \endcode
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Iterator>
-      void tourNodes(Iterator out) const {
-        std::copy(_path.begin(), _path.end(), out);
-      }
-
-      /// \brief Gives back the found tour as a path.
-      ///
-      /// This function copies the found tour as a list of arcs/edges into
-      /// the given \ref lemon::concepts::Path "path structure".
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Path>
-      void tour(Path &path) const {
-        path.clear();
-        for (int i = 0; i < int(_path.size()) - 1; ++i) {
-          path.addBack(_gr.arc(_path[i], _path[i+1]));
-        }
-        if (int(_path.size()) >= 2) {
-          path.addBack(_gr.arc(_path.back(), _path.front()));
-        }
-      }
-
-      /// @}
-
-  };
-
-}; // namespace lemon
-
-#endif
Index: lemon/circulation.h
===================================================================
--- lemon/circulation.h	(revision 1270)
+++ lemon/circulation.h	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -196,6 +196,5 @@
   public:
 
-    /// \brief The \ref lemon::CirculationDefaultTraits "traits class"
-    /// of the algorithm.
+    ///The \ref CirculationDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
     ///The type of the digraph the algorithm runs on.
Index: lemon/clp.cc
===================================================================
--- lemon/clp.cc	(revision 1270)
+++ lemon/clp.cc	(revision 1142)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/clp.h
===================================================================
--- lemon/clp.h	(revision 1270)
+++ lemon/clp.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/concept_check.h
===================================================================
--- lemon/concept_check.h	(revision 1270)
+++ lemon/concept_check.h	(revision 1257)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/concepts/bpgraph.h
===================================================================
--- lemon/concepts/bpgraph.h	(revision 1270)
+++ 	(revision )
@@ -1,1029 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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.
- *
- */
-
-///\ingroup graph_concepts
-///\file
-///\brief The concept of undirected graphs.
-
-#ifndef LEMON_CONCEPTS_BPGRAPH_H
-#define LEMON_CONCEPTS_BPGRAPH_H
-
-#include <lemon/concepts/graph_components.h>
-#include <lemon/concepts/maps.h>
-#include <lemon/concept_check.h>
-#include <lemon/core.h>
-
-namespace lemon {
-  namespace concepts {
-
-    /// \ingroup graph_concepts
-    ///
-    /// \brief Class describing the concept of undirected bipartite graphs.
-    ///
-    /// This class describes the common interface of all undirected
-    /// bipartite graphs.
-    ///
-    /// Like all concept classes, it only provides an interface
-    /// without any sensible implementation. So any general algorithm for
-    /// undirected bipartite graphs should compile with this class,
-    /// but it will not run properly, of course.
-    /// An actual graph implementation like \ref ListBpGraph or
-    /// \ref SmartBpGraph may have additional functionality.
-    ///
-    /// The bipartite graphs also fulfill the concept of \ref Graph
-    /// "undirected graphs". Bipartite graphs provide a bipartition of
-    /// the node set, namely a red and blue set of the nodes. The
-    /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the
-    /// two node sets. With RedNodeMap and BlueNodeMap values can be
-    /// assigned to the nodes in the two sets.
-    ///
-    /// The edges of the graph cannot connect two nodes of the same
-    /// set. The edges inherent orientation is from the red nodes to
-    /// the blue nodes.
-    ///
-    /// \sa Graph
-    class BpGraph {
-    private:
-      /// BpGraphs are \e not copy constructible. Use bpGraphCopy instead.
-      BpGraph(const BpGraph&) {}
-      /// \brief Assignment of a graph to another one is \e not allowed.
-      /// Use bpGraphCopy instead.
-      void operator=(const BpGraph&) {}
-
-    public:
-      /// Default constructor.
-      BpGraph() {}
-
-      /// \brief Undirected graphs should be tagged with \c UndirectedTag.
-      ///
-      /// Undirected graphs should be tagged with \c UndirectedTag.
-      ///
-      /// This tag helps the \c enable_if technics to make compile time
-      /// specializations for undirected graphs.
-      typedef True UndirectedTag;
-
-      /// The node type of the graph
-
-      /// This class identifies a node of the graph. It also serves
-      /// as a base class of the node iterators,
-      /// thus they convert to this type.
-      class Node {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the object to an undefined value.
-        Node() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        Node(const Node&) { }
-
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the object to be invalid.
-        /// \sa Invalid for more details.
-        Node(Invalid) { }
-        /// Equality operator
-
-        /// Equality operator.
-        ///
-        /// Two iterators are equal if and only if they point to the
-        /// same object or both are \c INVALID.
-        bool operator==(Node) const { return true; }
-
-        /// Inequality operator
-
-        /// Inequality operator.
-        bool operator!=(Node) const { return true; }
-
-        /// Artificial ordering operator.
-
-        /// Artificial ordering operator.
-        ///
-        /// \note This operator only has to define some strict ordering of
-        /// the items; this order has nothing to do with the iteration
-        /// ordering of the items.
-        bool operator<(Node) const { return false; }
-
-      };
-
-      /// Class to represent red nodes.
-
-      /// This class represents the red nodes of the graph. It does
-      /// not supposed to be used directly, because the nodes can be
-      /// represented as Node instances. This class can be used as
-      /// template parameter for special map classes.
-      class RedNode : public Node {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the object to an undefined value.
-        RedNode() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        RedNode(const RedNode&) : Node() { }
-
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the object to be invalid.
-        /// \sa Invalid for more details.
-        RedNode(Invalid) { }
-
-      };
-
-      /// Class to represent blue nodes.
-
-      /// This class represents the blue nodes of the graph. It does
-      /// not supposed to be used directly, because the nodes can be
-      /// represented as Node instances. This class can be used as
-      /// template parameter for special map classes.
-      class BlueNode : public Node {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the object to an undefined value.
-        BlueNode() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        BlueNode(const BlueNode&) : Node() { }
-
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the object to be invalid.
-        /// \sa Invalid for more details.
-        BlueNode(Invalid) { }
-
-      };
-
-      /// Iterator class for the red nodes.
-
-      /// This iterator goes through each red node of the graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of red nodes in a graph \c g of type \c %BpGraph like this:
-      ///\code
-      /// int count=0;
-      /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
-      ///\endcode
-      class RedNodeIt : public RedNode {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        RedNodeIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        RedNodeIt(const RedNodeIt& n) : RedNode(n) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        RedNodeIt(Invalid) { }
-        /// Sets the iterator to the first red node.
-
-        /// Sets the iterator to the first red node of the given
-        /// digraph.
-        explicit RedNodeIt(const BpGraph&) { }
-        /// Sets the iterator to the given red node.
-
-        /// Sets the iterator to the given red node of the given
-        /// digraph.
-        RedNodeIt(const BpGraph&, const RedNode&) { }
-        /// Next node.
-
-        /// Assign the iterator to the next red node.
-        ///
-        RedNodeIt& operator++() { return *this; }
-      };
-
-      /// Iterator class for the blue nodes.
-
-      /// This iterator goes through each blue node of the graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of blue nodes in a graph \c g of type \c %BpGraph like this:
-      ///\code
-      /// int count=0;
-      /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
-      ///\endcode
-      class BlueNodeIt : public BlueNode {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        BlueNodeIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        BlueNodeIt(Invalid) { }
-        /// Sets the iterator to the first blue node.
-
-        /// Sets the iterator to the first blue node of the given
-        /// digraph.
-        explicit BlueNodeIt(const BpGraph&) { }
-        /// Sets the iterator to the given blue node.
-
-        /// Sets the iterator to the given blue node of the given
-        /// digraph.
-        BlueNodeIt(const BpGraph&, const BlueNode&) { }
-        /// Next node.
-
-        /// Assign the iterator to the next blue node.
-        ///
-        BlueNodeIt& operator++() { return *this; }
-      };
-
-      /// Iterator class for the nodes.
-
-      /// This iterator goes through each node of the graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of nodes in a graph \c g of type \c %BpGraph like this:
-      ///\code
-      /// int count=0;
-      /// for (BpGraph::NodeIt n(g); n!=INVALID; ++n) ++count;
-      ///\endcode
-      class NodeIt : public Node {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        NodeIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        NodeIt(const NodeIt& n) : Node(n) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        NodeIt(Invalid) { }
-        /// Sets the iterator to the first node.
-
-        /// Sets the iterator to the first node of the given digraph.
-        ///
-        explicit NodeIt(const BpGraph&) { }
-        /// Sets the iterator to the given node.
-
-        /// Sets the iterator to the given node of the given digraph.
-        ///
-        NodeIt(const BpGraph&, const Node&) { }
-        /// Next node.
-
-        /// Assign the iterator to the next node.
-        ///
-        NodeIt& operator++() { return *this; }
-      };
-
-
-      /// The edge type of the graph
-
-      /// This class identifies an edge of the graph. It also serves
-      /// as a base class of the edge iterators,
-      /// thus they will convert to this type.
-      class Edge {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the object to an undefined value.
-        Edge() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        Edge(const Edge&) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the object to be invalid.
-        /// \sa Invalid for more details.
-        Edge(Invalid) { }
-        /// Equality operator
-
-        /// Equality operator.
-        ///
-        /// Two iterators are equal if and only if they point to the
-        /// same object or both are \c INVALID.
-        bool operator==(Edge) const { return true; }
-        /// Inequality operator
-
-        /// Inequality operator.
-        bool operator!=(Edge) const { return true; }
-
-        /// Artificial ordering operator.
-
-        /// Artificial ordering operator.
-        ///
-        /// \note This operator only has to define some strict ordering of
-        /// the edges; this order has nothing to do with the iteration
-        /// ordering of the edges.
-        bool operator<(Edge) const { return false; }
-      };
-
-      /// Iterator class for the edges.
-
-      /// This iterator goes through each edge of the graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of edges in a graph \c g of type \c %BpGraph as follows:
-      ///\code
-      /// int count=0;
-      /// for(BpGraph::EdgeIt e(g); e!=INVALID; ++e) ++count;
-      ///\endcode
-      class EdgeIt : public Edge {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        EdgeIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        EdgeIt(const EdgeIt& e) : Edge(e) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        EdgeIt(Invalid) { }
-        /// Sets the iterator to the first edge.
-
-        /// Sets the iterator to the first edge of the given graph.
-        ///
-        explicit EdgeIt(const BpGraph&) { }
-        /// Sets the iterator to the given edge.
-
-        /// Sets the iterator to the given edge of the given graph.
-        ///
-        EdgeIt(const BpGraph&, const Edge&) { }
-        /// Next edge
-
-        /// Assign the iterator to the next edge.
-        ///
-        EdgeIt& operator++() { return *this; }
-      };
-
-      /// Iterator class for the incident edges of a node.
-
-      /// This iterator goes trough the incident undirected edges
-      /// of a certain node of a graph.
-      /// Its usage is quite simple, for example, you can compute the
-      /// degree (i.e. the number of incident edges) of a node \c n
-      /// in a graph \c g of type \c %BpGraph as follows.
-      ///
-      ///\code
-      /// int count=0;
-      /// for(BpGraph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
-      ///\endcode
-      ///
-      /// \warning Loop edges will be iterated twice.
-      class IncEdgeIt : public Edge {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        IncEdgeIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        IncEdgeIt(const IncEdgeIt& e) : Edge(e) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        IncEdgeIt(Invalid) { }
-        /// Sets the iterator to the first incident edge.
-
-        /// Sets the iterator to the first incident edge of the given node.
-        ///
-        IncEdgeIt(const BpGraph&, const Node&) { }
-        /// Sets the iterator to the given edge.
-
-        /// Sets the iterator to the given edge of the given graph.
-        ///
-        IncEdgeIt(const BpGraph&, const Edge&) { }
-        /// Next incident edge
-
-        /// Assign the iterator to the next incident edge
-        /// of the corresponding node.
-        IncEdgeIt& operator++() { return *this; }
-      };
-
-      /// The arc type of the graph
-
-      /// This class identifies a directed arc of the graph. It also serves
-      /// as a base class of the arc iterators,
-      /// thus they will convert to this type.
-      class Arc {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the object to an undefined value.
-        Arc() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        Arc(const Arc&) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the object to be invalid.
-        /// \sa Invalid for more details.
-        Arc(Invalid) { }
-        /// Equality operator
-
-        /// Equality operator.
-        ///
-        /// Two iterators are equal if and only if they point to the
-        /// same object or both are \c INVALID.
-        bool operator==(Arc) const { return true; }
-        /// Inequality operator
-
-        /// Inequality operator.
-        bool operator!=(Arc) const { return true; }
-
-        /// Artificial ordering operator.
-
-        /// Artificial ordering operator.
-        ///
-        /// \note This operator only has to define some strict ordering of
-        /// the arcs; this order has nothing to do with the iteration
-        /// ordering of the arcs.
-        bool operator<(Arc) const { return false; }
-
-        /// Converison to \c Edge
-
-        /// Converison to \c Edge.
-        ///
-        operator Edge() const { return Edge(); }
-      };
-
-      /// Iterator class for the arcs.
-
-      /// This iterator goes through each directed arc of the graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of arcs in a graph \c g of type \c %BpGraph as follows:
-      ///\code
-      /// int count=0;
-      /// for(BpGraph::ArcIt a(g); a!=INVALID; ++a) ++count;
-      ///\endcode
-      class ArcIt : public Arc {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        ArcIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        ArcIt(const ArcIt& e) : Arc(e) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        ArcIt(Invalid) { }
-        /// Sets the iterator to the first arc.
-
-        /// Sets the iterator to the first arc of the given graph.
-        ///
-        explicit ArcIt(const BpGraph &g)
-        {
-          ::lemon::ignore_unused_variable_warning(g);
-        }
-        /// Sets the iterator to the given arc.
-
-        /// Sets the iterator to the given arc of the given graph.
-        ///
-        ArcIt(const BpGraph&, const Arc&) { }
-        /// Next arc
-
-        /// Assign the iterator to the next arc.
-        ///
-        ArcIt& operator++() { return *this; }
-      };
-
-      /// Iterator class for the outgoing arcs of a node.
-
-      /// This iterator goes trough the \e outgoing directed arcs of a
-      /// certain node of a graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of outgoing arcs of a node \c n
-      /// in a graph \c g of type \c %BpGraph as follows.
-      ///\code
-      /// int count=0;
-      /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
-      ///\endcode
-      class OutArcIt : public Arc {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        OutArcIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        OutArcIt(const OutArcIt& e) : Arc(e) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        OutArcIt(Invalid) { }
-        /// Sets the iterator to the first outgoing arc.
-
-        /// Sets the iterator to the first outgoing arc of the given node.
-        ///
-        OutArcIt(const BpGraph& n, const Node& g) {
-          ::lemon::ignore_unused_variable_warning(n);
-          ::lemon::ignore_unused_variable_warning(g);
-        }
-        /// Sets the iterator to the given arc.
-
-        /// Sets the iterator to the given arc of the given graph.
-        ///
-        OutArcIt(const BpGraph&, const Arc&) { }
-        /// Next outgoing arc
-
-        /// Assign the iterator to the next
-        /// outgoing arc of the corresponding node.
-        OutArcIt& operator++() { return *this; }
-      };
-
-      /// Iterator class for the incoming arcs of a node.
-
-      /// This iterator goes trough the \e incoming directed arcs of a
-      /// certain node of a graph.
-      /// Its usage is quite simple, for example, you can count the number
-      /// of incoming arcs of a node \c n
-      /// in a graph \c g of type \c %BpGraph as follows.
-      ///\code
-      /// int count=0;
-      /// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
-      ///\endcode
-      class InArcIt : public Arc {
-      public:
-        /// Default constructor
-
-        /// Default constructor.
-        /// \warning It sets the iterator to an undefined value.
-        InArcIt() { }
-        /// Copy constructor.
-
-        /// Copy constructor.
-        ///
-        InArcIt(const InArcIt& e) : Arc(e) { }
-        /// %Invalid constructor \& conversion.
-
-        /// Initializes the iterator to be invalid.
-        /// \sa Invalid for more details.
-        InArcIt(Invalid) { }
-        /// Sets the iterator to the first incoming arc.
-
-        /// Sets the iterator to the first incoming arc of the given node.
-        ///
-        InArcIt(const BpGraph& g, const Node& n) {
-          ::lemon::ignore_unused_variable_warning(n);
-          ::lemon::ignore_unused_variable_warning(g);
-        }
-        /// Sets the iterator to the given arc.
-
-        /// Sets the iterator to the given arc of the given graph.
-        ///
-        InArcIt(const BpGraph&, const Arc&) { }
-        /// Next incoming arc
-
-        /// Assign the iterator to the next
-        /// incoming arc of the corresponding node.
-        InArcIt& operator++() { return *this; }
-      };
-
-      /// \brief Standard graph map type for the nodes.
-      ///
-      /// Standard graph map type for the nodes.
-      /// It conforms to the ReferenceMap concept.
-      template<class T>
-      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
-      {
-      public:
-
-        /// Constructor
-        explicit NodeMap(const BpGraph&) { }
-        /// Constructor with given initial value
-        NodeMap(const BpGraph&, T) { }
-
-      private:
-        ///Copy constructor
-        NodeMap(const NodeMap& nm) :
-          ReferenceMap<Node, T, T&, const T&>(nm) { }
-        ///Assignment operator
-        template <typename CMap>
-        NodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, T>, CMap>();
-          return *this;
-        }
-      };
-
-      /// \brief Standard graph map type for the red nodes.
-      ///
-      /// Standard graph map type for the red nodes.
-      /// It conforms to the ReferenceMap concept.
-      template<class T>
-      class RedNodeMap : public ReferenceMap<Node, T, T&, const T&>
-      {
-      public:
-
-        /// Constructor
-        explicit RedNodeMap(const BpGraph&) { }
-        /// Constructor with given initial value
-        RedNodeMap(const BpGraph&, T) { }
-
-      private:
-        ///Copy constructor
-        RedNodeMap(const RedNodeMap& nm) :
-          ReferenceMap<Node, T, T&, const T&>(nm) { }
-        ///Assignment operator
-        template <typename CMap>
-        RedNodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, T>, CMap>();
-          return *this;
-        }
-      };
-
-      /// \brief Standard graph map type for the blue nodes.
-      ///
-      /// Standard graph map type for the blue nodes.
-      /// It conforms to the ReferenceMap concept.
-      template<class T>
-      class BlueNodeMap : public ReferenceMap<Node, T, T&, const T&>
-      {
-      public:
-
-        /// Constructor
-        explicit BlueNodeMap(const BpGraph&) { }
-        /// Constructor with given initial value
-        BlueNodeMap(const BpGraph&, T) { }
-
-      private:
-        ///Copy constructor
-        BlueNodeMap(const BlueNodeMap& nm) :
-          ReferenceMap<Node, T, T&, const T&>(nm) { }
-        ///Assignment operator
-        template <typename CMap>
-        BlueNodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, T>, CMap>();
-          return *this;
-        }
-      };
-
-      /// \brief Standard graph map type for the arcs.
-      ///
-      /// Standard graph map type for the arcs.
-      /// It conforms to the ReferenceMap concept.
-      template<class T>
-      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
-      {
-      public:
-
-        /// Constructor
-        explicit ArcMap(const BpGraph&) { }
-        /// Constructor with given initial value
-        ArcMap(const BpGraph&, T) { }
-
-      private:
-        ///Copy constructor
-        ArcMap(const ArcMap& em) :
-          ReferenceMap<Arc, T, T&, const T&>(em) { }
-        ///Assignment operator
-        template <typename CMap>
-        ArcMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Arc, T>, CMap>();
-          return *this;
-        }
-      };
-
-      /// \brief Standard graph map type for the edges.
-      ///
-      /// Standard graph map type for the edges.
-      /// It conforms to the ReferenceMap concept.
-      template<class T>
-      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
-      {
-      public:
-
-        /// Constructor
-        explicit EdgeMap(const BpGraph&) { }
-        /// Constructor with given initial value
-        EdgeMap(const BpGraph&, T) { }
-
-      private:
-        ///Copy constructor
-        EdgeMap(const EdgeMap& em) :
-          ReferenceMap<Edge, T, T&, const T&>(em) {}
-        ///Assignment operator
-        template <typename CMap>
-        EdgeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Edge, T>, CMap>();
-          return *this;
-        }
-      };
-
-      /// \brief Gives back %true for red nodes.
-      ///
-      /// Gives back %true for red nodes.
-      bool red(const Node&) const { return true; }
-
-      /// \brief Gives back %true for blue nodes.
-      ///
-      /// Gives back %true for blue nodes.
-      bool blue(const Node&) const { return true; }
-
-      /// \brief Converts the node to red node object.
-      ///
-      /// This function converts unsafely the node to red node
-      /// object. It should be called only if the node is from the red
-      /// partition or INVALID.
-      RedNode asRedNodeUnsafe(const Node&) const { return RedNode(); }
-
-      /// \brief Converts the node to blue node object.
-      ///
-      /// This function converts unsafely the node to blue node
-      /// object. It should be called only if the node is from the red
-      /// partition or INVALID.
-      BlueNode asBlueNodeUnsafe(const Node&) const { return BlueNode(); }
-
-      /// \brief Converts the node to red node object.
-      ///
-      /// This function converts safely the node to red node
-      /// object. If the node is not from the red partition, then it
-      /// returns INVALID.
-      RedNode asRedNode(const Node&) const { return RedNode(); }
-
-      /// \brief Converts the node to blue node object.
-      ///
-      /// This function converts unsafely the node to blue node
-      /// object. If the node is not from the blue partition, then it
-      /// returns INVALID.
-      BlueNode asBlueNode(const Node&) const { return BlueNode(); }
-
-      /// \brief Gives back the red end node of the edge.
-      ///
-      /// Gives back the red end node of the edge.
-      RedNode redNode(const Edge&) const { return RedNode(); }
-
-      /// \brief Gives back the blue end node of the edge.
-      ///
-      /// Gives back the blue end node of the edge.
-      BlueNode blueNode(const Edge&) const { return BlueNode(); }
-
-      /// \brief The first node of the edge.
-      ///
-      /// It is a synonim for the \c redNode().
-      Node u(Edge) const { return INVALID; }
-
-      /// \brief The second node of the edge.
-      ///
-      /// It is a synonim for the \c blueNode().
-      Node v(Edge) const { return INVALID; }
-
-      /// \brief The source node of the arc.
-      ///
-      /// Returns the source node of the given arc.
-      Node source(Arc) const { return INVALID; }
-
-      /// \brief The target node of the arc.
-      ///
-      /// Returns the target node of the given arc.
-      Node target(Arc) const { return INVALID; }
-
-      /// \brief The ID of the node.
-      ///
-      /// Returns the ID of the given node.
-      int id(Node) const { return -1; }
-
-      /// \brief The red ID of the node.
-      ///
-      /// Returns the red ID of the given node.
-      int id(RedNode) const { return -1; }
-
-      /// \brief The blue ID of the node.
-      ///
-      /// Returns the blue ID of the given node.
-      int id(BlueNode) const { return -1; }
-
-      /// \brief The ID of the edge.
-      ///
-      /// Returns the ID of the given edge.
-      int id(Edge) const { return -1; }
-
-      /// \brief The ID of the arc.
-      ///
-      /// Returns the ID of the given arc.
-      int id(Arc) const { return -1; }
-
-      /// \brief The node with the given ID.
-      ///
-      /// Returns the node with the given ID.
-      /// \pre The argument should be a valid node ID in the graph.
-      Node nodeFromId(int) const { return INVALID; }
-
-      /// \brief The edge with the given ID.
-      ///
-      /// Returns the edge with the given ID.
-      /// \pre The argument should be a valid edge ID in the graph.
-      Edge edgeFromId(int) const { return INVALID; }
-
-      /// \brief The arc with the given ID.
-      ///
-      /// Returns the arc with the given ID.
-      /// \pre The argument should be a valid arc ID in the graph.
-      Arc arcFromId(int) const { return INVALID; }
-
-      /// \brief An upper bound on the node IDs.
-      ///
-      /// Returns an upper bound on the node IDs.
-      int maxNodeId() const { return -1; }
-
-      /// \brief An upper bound on the red IDs.
-      ///
-      /// Returns an upper bound on the red IDs.
-      int maxRedId() const { return -1; }
-
-      /// \brief An upper bound on the blue IDs.
-      ///
-      /// Returns an upper bound on the blue IDs.
-      int maxBlueId() const { return -1; }
-
-      /// \brief An upper bound on the edge IDs.
-      ///
-      /// Returns an upper bound on the edge IDs.
-      int maxEdgeId() const { return -1; }
-
-      /// \brief An upper bound on the arc IDs.
-      ///
-      /// Returns an upper bound on the arc IDs.
-      int maxArcId() const { return -1; }
-
-      /// \brief The direction of the arc.
-      ///
-      /// Returns \c true if the given arc goes from a red node to a blue node.
-      bool direction(Arc) const { return true; }
-
-      /// \brief Direct the edge.
-      ///
-      /// Direct the given edge. The returned arc
-      /// represents the given edge and its direction comes
-      /// from the bool parameter. If it is \c true, then the source of the node
-      /// will be a red node.
-      Arc direct(Edge, bool) const {
-        return INVALID;
-      }
-
-      /// \brief Direct the edge.
-      ///
-      /// Direct the given edge. The returned arc represents the given
-      /// edge and its source node is the given node.
-      Arc direct(Edge, Node) const {
-        return INVALID;
-      }
-
-      /// \brief The oppositely directed arc.
-      ///
-      /// Returns the oppositely directed arc representing the same edge.
-      Arc oppositeArc(Arc) const { return INVALID; }
-
-      /// \brief The opposite node on the edge.
-      ///
-      /// Returns the opposite node on the given edge.
-      Node oppositeNode(Node, Edge) const { return INVALID; }
-
-      void first(Node&) const {}
-      void next(Node&) const {}
-
-      void firstRed(RedNode&) const {}
-      void nextRed(RedNode&) const {}
-
-      void firstBlue(BlueNode&) const {}
-      void nextBlue(BlueNode&) const {}
-
-      void first(Edge&) const {}
-      void next(Edge&) const {}
-
-      void first(Arc&) const {}
-      void next(Arc&) const {}
-
-      void firstOut(Arc&, Node) const {}
-      void nextOut(Arc&) const {}
-
-      void firstIn(Arc&, Node) const {}
-      void nextIn(Arc&) const {}
-
-      void firstInc(Edge &, bool &, const Node &) const {}
-      void nextInc(Edge &, bool &) const {}
-
-      // The second parameter is dummy.
-      Node fromId(int, Node) const { return INVALID; }
-      // The second parameter is dummy.
-      Edge fromId(int, Edge) const { return INVALID; }
-      // The second parameter is dummy.
-      Arc fromId(int, Arc) const { return INVALID; }
-
-      // Dummy parameter.
-      int maxId(Node) const { return -1; }
-      // Dummy parameter.
-      int maxId(RedNode) const { return -1; }
-      // Dummy parameter.
-      int maxId(BlueNode) const { return -1; }
-      // Dummy parameter.
-      int maxId(Edge) const { return -1; }
-      // Dummy parameter.
-      int maxId(Arc) const { return -1; }
-
-      /// \brief The base node of the iterator.
-      ///
-      /// Returns the base node of the given incident edge iterator.
-      Node baseNode(IncEdgeIt) const { return INVALID; }
-
-      /// \brief The running node of the iterator.
-      ///
-      /// Returns the running node of the given incident edge iterator.
-      Node runningNode(IncEdgeIt) const { return INVALID; }
-
-      /// \brief The base node of the iterator.
-      ///
-      /// Returns the base node of the given outgoing arc iterator
-      /// (i.e. the source node of the corresponding arc).
-      Node baseNode(OutArcIt) const { return INVALID; }
-
-      /// \brief The running node of the iterator.
-      ///
-      /// Returns the running node of the given outgoing arc iterator
-      /// (i.e. the target node of the corresponding arc).
-      Node runningNode(OutArcIt) const { return INVALID; }
-
-      /// \brief The base node of the iterator.
-      ///
-      /// Returns the base node of the given incoming arc iterator
-      /// (i.e. the target node of the corresponding arc).
-      Node baseNode(InArcIt) const { return INVALID; }
-
-      /// \brief The running node of the iterator.
-      ///
-      /// Returns the running node of the given incoming arc iterator
-      /// (i.e. the source node of the corresponding arc).
-      Node runningNode(InArcIt) const { return INVALID; }
-
-      template <typename _BpGraph>
-      struct Constraints {
-        void constraints() {
-          checkConcept<BaseBpGraphComponent, _BpGraph>();
-          checkConcept<IterableBpGraphComponent<>, _BpGraph>();
-          checkConcept<IDableBpGraphComponent<>, _BpGraph>();
-          checkConcept<MappableBpGraphComponent<>, _BpGraph>();
-        }
-      };
-
-    };
-
-  }
-
-}
-
-#endif
Index: lemon/concepts/digraph.h
===================================================================
--- lemon/concepts/digraph.h	(revision 1271)
+++ lemon/concepts/digraph.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -313,7 +313,5 @@
         /// Sets the iterator to the first arc of the given digraph.
         ///
-        explicit ArcIt(const Digraph& g) {
-          ::lemon::ignore_unused_variable_warning(g);
-        }
+        explicit ArcIt(const Digraph& g) { ::lemon::ignore_unused_variable_warning(g); }
         /// Sets the iterator to the given arc.
 
@@ -412,5 +410,5 @@
       /// \brief The base node of the iterator.
       ///
-      /// Returns the base node of the given incoming arc iterator
+      /// Returns the base node of the given incomming arc iterator
       /// (i.e. the target node of the corresponding arc).
       Node baseNode(InArcIt) const { return INVALID; }
@@ -418,5 +416,5 @@
       /// \brief The running node of the iterator.
       ///
-      /// Returns the running node of the given incoming arc iterator
+      /// Returns the running node of the given incomming arc iterator
       /// (i.e. the source node of the corresponding arc).
       Node runningNode(InArcIt) const { return INVALID; }
Index: lemon/concepts/graph.h
===================================================================
--- lemon/concepts/graph.h	(revision 1271)
+++ lemon/concepts/graph.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -73,8 +73,8 @@
     class Graph {
     private:
-      /// Graphs are \e not copy constructible. Use GraphCopy instead.
+      /// Graphs are \e not copy constructible. Use DigraphCopy instead.
       Graph(const Graph&) {}
       /// \brief Assignment of a graph to another one is \e not allowed.
-      /// Use GraphCopy instead.
+      /// Use DigraphCopy instead.
       void operator=(const Graph&) {}
 
@@ -397,7 +397,5 @@
         /// Sets the iterator to the first arc of the given graph.
         ///
-        explicit ArcIt(const Graph &g) {
-          ::lemon::ignore_unused_variable_warning(g);
-        }
+        explicit ArcIt(const Graph &g) { ::lemon::ignore_unused_variable_warning(g); }
         /// Sets the iterator to the given arc.
 
@@ -760,5 +758,5 @@
       /// \brief The base node of the iterator.
       ///
-      /// Returns the base node of the given incoming arc iterator
+      /// Returns the base node of the given incomming arc iterator
       /// (i.e. the target node of the corresponding arc).
       Node baseNode(InArcIt) const { return INVALID; }
@@ -766,5 +764,5 @@
       /// \brief The running node of the iterator.
       ///
-      /// Returns the running node of the given incoming arc iterator
+      /// Returns the running node of the given incomming arc iterator
       /// (i.e. the source node of the corresponding arc).
       Node runningNode(InArcIt) const { return INVALID; }
Index: lemon/concepts/graph_components.h
===================================================================
--- lemon/concepts/graph_components.h	(revision 1270)
+++ lemon/concepts/graph_components.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -300,170 +300,4 @@
     };
 
-    /// \brief Base skeleton class for undirected bipartite graphs.
-    ///
-    /// This class describes the base interface of undirected
-    /// bipartite graph types.  All bipartite graph %concepts have to
-    /// conform to this class.  It extends the interface of \ref
-    /// BaseGraphComponent with an \c Edge type and functions to get
-    /// the end nodes of edges, to convert from arcs to edges and to
-    /// get both direction of edges.
-    class BaseBpGraphComponent : public BaseGraphComponent {
-    public:
-
-      typedef BaseBpGraphComponent BpGraph;
-
-      typedef BaseDigraphComponent::Node Node;
-      typedef BaseDigraphComponent::Arc Arc;
-
-      /// \brief Class to represent red nodes.
-      ///
-      /// This class represents the red nodes of the graph. The red
-      /// nodes can also be used as normal nodes.
-      class RedNode : public Node {
-        typedef Node Parent;
-
-      public:
-        /// \brief Default constructor.
-        ///
-        /// Default constructor.
-        /// \warning The default constructor is not required to set
-        /// the item to some well-defined value. So you should consider it
-        /// as uninitialized.
-        RedNode() {}
-
-        /// \brief Copy constructor.
-        ///
-        /// Copy constructor.
-        RedNode(const RedNode &) : Parent() {}
-
-        /// \brief Constructor for conversion from \c INVALID.
-        ///
-        /// Constructor for conversion from \c INVALID.
-        /// It initializes the item to be invalid.
-        /// \sa Invalid for more details.
-        RedNode(Invalid) {}
-      };
-
-      /// \brief Class to represent blue nodes.
-      ///
-      /// This class represents the blue nodes of the graph. The blue
-      /// nodes can also be used as normal nodes.
-      class BlueNode : public Node {
-        typedef Node Parent;
-
-      public:
-        /// \brief Default constructor.
-        ///
-        /// Default constructor.
-        /// \warning The default constructor is not required to set
-        /// the item to some well-defined value. So you should consider it
-        /// as uninitialized.
-        BlueNode() {}
-
-        /// \brief Copy constructor.
-        ///
-        /// Copy constructor.
-        BlueNode(const BlueNode &) : Parent() {}
-
-        /// \brief Constructor for conversion from \c INVALID.
-        ///
-        /// Constructor for conversion from \c INVALID.
-        /// It initializes the item to be invalid.
-        /// \sa Invalid for more details.
-        BlueNode(Invalid) {}
-
-        /// \brief Constructor for conversion from a node.
-        ///
-        /// Constructor for conversion from a node. The conversion can
-        /// be invalid, since the Node can be member of the red
-        /// set.
-        BlueNode(const Node&) {}
-      };
-
-      /// \brief Gives back %true for red nodes.
-      ///
-      /// Gives back %true for red nodes.
-      bool red(const Node&) const { return true; }
-
-      /// \brief Gives back %true for blue nodes.
-      ///
-      /// Gives back %true for blue nodes.
-      bool blue(const Node&) const { return true; }
-
-      /// \brief Gives back the red end node of the edge.
-      ///
-      /// Gives back the red end node of the edge.
-      RedNode redNode(const Edge&) const { return RedNode(); }
-
-      /// \brief Gives back the blue end node of the edge.
-      ///
-      /// Gives back the blue end node of the edge.
-      BlueNode blueNode(const Edge&) const { return BlueNode(); }
-
-      /// \brief Converts the node to red node object.
-      ///
-      /// This function converts unsafely the node to red node
-      /// object. It should be called only if the node is from the red
-      /// partition or INVALID.
-      RedNode asRedNodeUnsafe(const Node&) const { return RedNode(); }
-
-      /// \brief Converts the node to blue node object.
-      ///
-      /// This function converts unsafely the node to blue node
-      /// object. It should be called only if the node is from the red
-      /// partition or INVALID.
-      BlueNode asBlueNodeUnsafe(const Node&) const { return BlueNode(); }
-
-      /// \brief Converts the node to red node object.
-      ///
-      /// This function converts safely the node to red node
-      /// object. If the node is not from the red partition, then it
-      /// returns INVALID.
-      RedNode asRedNode(const Node&) const { return RedNode(); }
-
-      /// \brief Converts the node to blue node object.
-      ///
-      /// This function converts unsafely the node to blue node
-      /// object. If the node is not from the blue partition, then it
-      /// returns INVALID.
-      BlueNode asBlueNode(const Node&) const { return BlueNode(); }
-
-      template <typename _BpGraph>
-      struct Constraints {
-        typedef typename _BpGraph::Node Node;
-        typedef typename _BpGraph::RedNode RedNode;
-        typedef typename _BpGraph::BlueNode BlueNode;
-        typedef typename _BpGraph::Arc Arc;
-        typedef typename _BpGraph::Edge Edge;
-
-        void constraints() {
-          checkConcept<BaseGraphComponent, _BpGraph>();
-          checkConcept<GraphItem<'n'>, RedNode>();
-          checkConcept<GraphItem<'n'>, BlueNode>();
-          {
-            Node n;
-            RedNode rn;
-            BlueNode bn;
-            Node rnan = rn;
-            Node bnan = bn;
-            Edge e;
-            bool b;
-            b = bpgraph.red(rnan);
-            b = bpgraph.blue(bnan);
-            rn = bpgraph.redNode(e);
-            bn = bpgraph.blueNode(e);
-            rn = bpgraph.asRedNodeUnsafe(rnan);
-            bn = bpgraph.asBlueNodeUnsafe(bnan);
-            rn = bpgraph.asRedNode(rnan);
-            bn = bpgraph.asBlueNode(bnan);
-            ::lemon::ignore_unused_variable_warning(b);
-          }
-        }
-
-        const _BpGraph& bpgraph;
-      };
-
-    };
-
     /// \brief Skeleton class for \e idable directed graphs.
     ///
@@ -598,68 +432,4 @@
     };
 
-    /// \brief Skeleton class for \e idable undirected bipartite graphs.
-    ///
-    /// This class describes the interface of \e idable undirected
-    /// bipartite graphs. It extends \ref IDableGraphComponent with
-    /// the core ID functions of undirected bipartite graphs. Beside
-    /// the regular node ids, this class also provides ids within the
-    /// the red and blue sets of the nodes. This concept is part of
-    /// the BpGraph concept.
-    template <typename BAS = BaseBpGraphComponent>
-    class IDableBpGraphComponent : public IDableGraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
-      typedef IDableGraphComponent<BAS> Parent;
-      typedef typename Base::Node Node;
-      typedef typename Base::RedNode RedNode;
-      typedef typename Base::BlueNode BlueNode;
-
-      using Parent::id;
-
-      /// \brief Return a unique integer id for the given node in the red set.
-      ///
-      /// Return a unique integer id for the given node in the red set.
-      int id(const RedNode&) const { return -1; }
-
-      /// \brief Return a unique integer id for the given node in the blue set.
-      ///
-      /// Return a unique integer id for the given node in the blue set.
-      int id(const BlueNode&) const { return -1; }
-
-      /// \brief Return an integer greater or equal to the maximum
-      /// node id in the red set.
-      ///
-      /// Return an integer greater or equal to the maximum
-      /// node id in the red set.
-      int maxRedId() const { return -1; }
-
-      /// \brief Return an integer greater or equal to the maximum
-      /// node id in the blue set.
-      ///
-      /// Return an integer greater or equal to the maximum
-      /// node id in the blue set.
-      int maxBlueId() const { return -1; }
-
-      template <typename _BpGraph>
-      struct Constraints {
-
-        void constraints() {
-          checkConcept<IDableGraphComponent<Base>, _BpGraph>();
-          typename _BpGraph::Node node;
-          typename _BpGraph::RedNode red;
-          typename _BpGraph::BlueNode blue;
-          int rid = bpgraph.id(red);
-          int bid = bpgraph.id(blue);
-          rid = bpgraph.maxRedId();
-          bid = bpgraph.maxBlueId();
-          ::lemon::ignore_unused_variable_warning(rid);
-          ::lemon::ignore_unused_variable_warning(bid);
-        }
-
-        const _BpGraph& bpgraph;
-      };
-    };
-
     /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
     ///
@@ -876,13 +646,13 @@
       void next(Arc&) const {}
 
-      /// \brief Return the first arc incoming to the given node.
-      ///
-      /// This function gives back the first arc incoming to the
+      /// \brief Return the first arc incomming to the given node.
+      ///
+      /// This function gives back the first arc incomming to the
       /// given node.
       void firstIn(Arc&, const Node&) const {}
 
-      /// \brief Return the next arc incoming to the given node.
-      ///
-      /// This function gives back the next arc incoming to the
+      /// \brief Return the next arc incomming to the given node.
+      ///
+      /// This function gives back the next arc incomming to the
       /// given node.
       void nextIn(Arc&) const {}
@@ -1135,95 +905,4 @@
     };
 
-    /// \brief Skeleton class for iterable undirected bipartite graphs.
-    ///
-    /// This class describes the interface of iterable undirected
-    /// bipartite graphs. It extends \ref IterableGraphComponent with
-    /// the core iterable interface of undirected bipartite graphs.
-    /// This concept is part of the BpGraph concept.
-    template <typename BAS = BaseBpGraphComponent>
-    class IterableBpGraphComponent : public IterableGraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
-      typedef typename Base::Node Node;
-      typedef typename Base::RedNode RedNode;
-      typedef typename Base::BlueNode BlueNode;
-      typedef typename Base::Arc Arc;
-      typedef typename Base::Edge Edge;
-
-      typedef IterableBpGraphComponent BpGraph;
-
-      using IterableGraphComponent<BAS>::first;
-      using IterableGraphComponent<BAS>::next;
-
-      /// \name Base Iteration
-      ///
-      /// This interface provides functions for iteration on red and blue nodes.
-      ///
-      /// @{
-
-      /// \brief Return the first red node.
-      ///
-      /// This function gives back the first red node in the iteration order.
-      void first(RedNode&) const {}
-
-      /// \brief Return the next red node.
-      ///
-      /// This function gives back the next red node in the iteration order.
-      void next(RedNode&) const {}
-
-      /// \brief Return the first blue node.
-      ///
-      /// This function gives back the first blue node in the iteration order.
-      void first(BlueNode&) const {}
-
-      /// \brief Return the next blue node.
-      ///
-      /// This function gives back the next blue node in the iteration order.
-      void next(BlueNode&) const {}
-
-
-      /// @}
-
-      /// \name Class Based Iteration
-      ///
-      /// This interface provides iterator classes for red and blue nodes.
-      ///
-      /// @{
-
-      /// \brief This iterator goes through each red node.
-      ///
-      /// This iterator goes through each red node.
-      typedef GraphItemIt<BpGraph, RedNode> RedNodeIt;
-
-      /// \brief This iterator goes through each blue node.
-      ///
-      /// This iterator goes through each blue node.
-      typedef GraphItemIt<BpGraph, BlueNode> BlueNodeIt;
-
-      /// @}
-
-      template <typename _BpGraph>
-      struct Constraints {
-        void constraints() {
-          checkConcept<IterableGraphComponent<Base>, _BpGraph>();
-
-          typename _BpGraph::RedNode rn(INVALID);
-          bpgraph.first(rn);
-          bpgraph.next(rn);
-          typename _BpGraph::BlueNode bn(INVALID);
-          bpgraph.first(bn);
-          bpgraph.next(bn);
-
-          checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::RedNode>,
-            typename _BpGraph::RedNodeIt>();
-          checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::BlueNode>,
-            typename _BpGraph::BlueNodeIt>();
-        }
-
-        const _BpGraph& bpgraph;
-      };
-    };
-
     /// \brief Skeleton class for alterable directed graphs.
     ///
@@ -1251,12 +930,9 @@
       ArcNotifier;
 
-      mutable NodeNotifier node_notifier;
-      mutable ArcNotifier arc_notifier;
-
       /// \brief Return the node alteration notifier.
       ///
       /// This function gives back the node alteration notifier.
       NodeNotifier& notifier(Node) const {
-        return node_notifier;
+         return NodeNotifier();
       }
 
@@ -1265,5 +941,5 @@
       /// This function gives back the arc alteration notifier.
       ArcNotifier& notifier(Arc) const {
-        return arc_notifier;
+        return ArcNotifier();
       }
 
@@ -1301,5 +977,4 @@
 
       typedef BAS Base;
-      typedef AlterableDigraphComponent<Base> Parent;
       typedef typename Base::Edge Edge;
 
@@ -1309,13 +984,9 @@
       EdgeNotifier;
 
-      mutable EdgeNotifier edge_notifier;
-
-      using Parent::notifier;
-
       /// \brief Return the edge alteration notifier.
       ///
       /// This function gives back the edge alteration notifier.
       EdgeNotifier& notifier(Edge) const {
-        return edge_notifier;
+        return EdgeNotifier();
       }
 
@@ -1331,66 +1002,4 @@
         const _Graph& graph;
         Constraints() {}
-      };
-    };
-
-    /// \brief Skeleton class for alterable undirected bipartite graphs.
-    ///
-    /// This class describes the interface of alterable undirected
-    /// bipartite graphs. It extends \ref AlterableGraphComponent with
-    /// the alteration notifier interface of bipartite graphs. It
-    /// implements an observer-notifier pattern for the red and blue
-    /// nodes. More obsevers can be registered into the notifier and
-    /// whenever an alteration occured in the graph all the observers
-    /// will be notified about it.
-    template <typename BAS = BaseBpGraphComponent>
-    class AlterableBpGraphComponent : public AlterableGraphComponent<BAS> {
-    public:
-
-      typedef BAS Base;
-      typedef AlterableGraphComponent<Base> Parent;
-      typedef typename Base::RedNode RedNode;
-      typedef typename Base::BlueNode BlueNode;
-
-
-      /// Red node alteration notifier class.
-      typedef AlterationNotifier<AlterableBpGraphComponent, RedNode>
-      RedNodeNotifier;
-
-      /// Blue node alteration notifier class.
-      typedef AlterationNotifier<AlterableBpGraphComponent, BlueNode>
-      BlueNodeNotifier;
-
-      mutable RedNodeNotifier red_node_notifier;
-      mutable BlueNodeNotifier blue_node_notifier;
-
-      using Parent::notifier;
-
-      /// \brief Return the red node alteration notifier.
-      ///
-      /// This function gives back the red node alteration notifier.
-      RedNodeNotifier& notifier(RedNode) const {
-        return red_node_notifier;
-      }
-
-      /// \brief Return the blue node alteration notifier.
-      ///
-      /// This function gives back the blue node alteration notifier.
-      BlueNodeNotifier& notifier(BlueNode) const {
-        return blue_node_notifier;
-      }
-
-      template <typename _BpGraph>
-      struct Constraints {
-        void constraints() {
-          checkConcept<AlterableGraphComponent<Base>, _BpGraph>();
-          typename _BpGraph::RedNodeNotifier& rnn
-            = bpgraph.notifier(typename _BpGraph::RedNode());
-          typename _BpGraph::BlueNodeNotifier& bnn
-            = bpgraph.notifier(typename _BpGraph::BlueNode());
-          ::lemon::ignore_unused_variable_warning(rnn);
-          ::lemon::ignore_unused_variable_warning(bnn);
-        }
-
-        const _BpGraph& bpgraph;
       };
     };
@@ -1699,148 +1308,4 @@
     };
 
-    /// \brief Skeleton class for mappable undirected bipartite graphs.
-    ///
-    /// This class describes the interface of mappable undirected
-    /// bipartite graphs.  It extends \ref MappableGraphComponent with
-    /// the standard graph map class for red and blue nodes (\c
-    /// RedNodeMap and BlueNodeMap). This concept is part of the
-    /// BpGraph concept.
-    template <typename BAS = BaseBpGraphComponent>
-    class MappableBpGraphComponent : public MappableGraphComponent<BAS>  {
-    public:
-
-      typedef BAS Base;
-      typedef typename Base::Node Node;
-
-      typedef MappableBpGraphComponent BpGraph;
-
-      /// \brief Standard graph map for the red nodes.
-      ///
-      /// Standard graph map for the red nodes.
-      /// It conforms to the ReferenceMap concept.
-      template <typename V>
-      class RedNodeMap : public GraphMap<MappableBpGraphComponent, Node, V> {
-        typedef GraphMap<MappableBpGraphComponent, Node, V> Parent;
-
-      public:
-        /// \brief Construct a new map.
-        ///
-        /// Construct a new map for the graph.
-        explicit RedNodeMap(const MappableBpGraphComponent& graph)
-          : Parent(graph) {}
-
-        /// \brief Construct a new map with default value.
-        ///
-        /// Construct a new map for the graph and initalize the values.
-        RedNodeMap(const MappableBpGraphComponent& graph, const V& value)
-          : Parent(graph, value) {}
-
-      private:
-        /// \brief Copy constructor.
-        ///
-        /// Copy Constructor.
-        RedNodeMap(const RedNodeMap& nm) : Parent(nm) {}
-
-        /// \brief Assignment operator.
-        ///
-        /// Assignment operator.
-        template <typename CMap>
-        RedNodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, V>, CMap>();
-          return *this;
-        }
-
-      };
-
-      /// \brief Standard graph map for the blue nodes.
-      ///
-      /// Standard graph map for the blue nodes.
-      /// It conforms to the ReferenceMap concept.
-      template <typename V>
-      class BlueNodeMap : public GraphMap<MappableBpGraphComponent, Node, V> {
-        typedef GraphMap<MappableBpGraphComponent, Node, V> Parent;
-
-      public:
-        /// \brief Construct a new map.
-        ///
-        /// Construct a new map for the graph.
-        explicit BlueNodeMap(const MappableBpGraphComponent& graph)
-          : Parent(graph) {}
-
-        /// \brief Construct a new map with default value.
-        ///
-        /// Construct a new map for the graph and initalize the values.
-        BlueNodeMap(const MappableBpGraphComponent& graph, const V& value)
-          : Parent(graph, value) {}
-
-      private:
-        /// \brief Copy constructor.
-        ///
-        /// Copy Constructor.
-        BlueNodeMap(const BlueNodeMap& nm) : Parent(nm) {}
-
-        /// \brief Assignment operator.
-        ///
-        /// Assignment operator.
-        template <typename CMap>
-        BlueNodeMap& operator=(const CMap&) {
-          checkConcept<ReadMap<Node, V>, CMap>();
-          return *this;
-        }
-
-      };
-
-
-      template <typename _BpGraph>
-      struct Constraints {
-
-        struct Dummy {
-          int value;
-          Dummy() : value(0) {}
-          Dummy(int _v) : value(_v) {}
-        };
-
-        void constraints() {
-          checkConcept<MappableGraphComponent<Base>, _BpGraph>();
-
-          { // int map test
-            typedef typename _BpGraph::template RedNodeMap<int>
-              IntRedNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, int>,
-              IntRedNodeMap >();
-          } { // bool map test
-            typedef typename _BpGraph::template RedNodeMap<bool>
-              BoolRedNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, bool>,
-              BoolRedNodeMap >();
-          } { // Dummy map test
-            typedef typename _BpGraph::template RedNodeMap<Dummy>
-              DummyRedNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, Dummy>,
-              DummyRedNodeMap >();
-          }
-
-          { // int map test
-            typedef typename _BpGraph::template BlueNodeMap<int>
-              IntBlueNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, int>,
-              IntBlueNodeMap >();
-          } { // bool map test
-            typedef typename _BpGraph::template BlueNodeMap<bool>
-              BoolBlueNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, bool>,
-              BoolBlueNodeMap >();
-          } { // Dummy map test
-            typedef typename _BpGraph::template BlueNodeMap<Dummy>
-              DummyBlueNodeMap;
-            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, Dummy>,
-              DummyBlueNodeMap >();
-          }
-        }
-
-        const _BpGraph& bpgraph;
-      };
-    };
-
     /// \brief Skeleton class for extendable directed graphs.
     ///
@@ -1933,63 +1398,4 @@
     };
 
-    /// \brief Skeleton class for extendable undirected bipartite graphs.
-    ///
-    /// This class describes the interface of extendable undirected
-    /// bipartite graphs. It extends \ref BaseGraphComponent with
-    /// functions for adding nodes and edges to the graph. This
-    /// concept requires \ref AlterableBpGraphComponent.
-    template <typename BAS = BaseBpGraphComponent>
-    class ExtendableBpGraphComponent : public BAS {
-    public:
-
-      typedef BAS Base;
-      typedef typename Base::Node Node;
-      typedef typename Base::RedNode RedNode;
-      typedef typename Base::BlueNode BlueNode;
-      typedef typename Base::Edge Edge;
-
-      /// \brief Add a new red node to the digraph.
-      ///
-      /// This function adds a red new node to the digraph.
-      RedNode addRedNode() {
-        return INVALID;
-      }
-
-      /// \brief Add a new blue node to the digraph.
-      ///
-      /// This function adds a blue new node to the digraph.
-      BlueNode addBlueNode() {
-        return INVALID;
-      }
-
-      /// \brief Add a new edge connecting the given two nodes.
-      ///
-      /// This function adds a new edge connecting the given two nodes
-      /// of the graph. The first node has to be a red node, and the
-      /// second one a blue node.
-      Edge addEdge(const RedNode&, const BlueNode&) {
-        return INVALID;
-      }
-      Edge addEdge(const BlueNode&, const RedNode&) {
-        return INVALID;
-      }
-
-      template <typename _BpGraph>
-      struct Constraints {
-        void constraints() {
-          checkConcept<Base, _BpGraph>();
-          typename _BpGraph::RedNode red_node;
-          typename _BpGraph::BlueNode blue_node;
-          red_node = bpgraph.addRedNode();
-          blue_node = bpgraph.addBlueNode();
-          typename _BpGraph::Edge edge;
-          edge = bpgraph.addEdge(red_node, blue_node);
-          edge = bpgraph.addEdge(blue_node, red_node);
-        }
-
-        _BpGraph& bpgraph;
-      };
-    };
-
     /// \brief Skeleton class for erasable directed graphs.
     ///
@@ -2072,13 +1478,4 @@
     };
 
-    /// \brief Skeleton class for erasable undirected graphs.
-    ///
-    /// This class describes the interface of erasable undirected
-    /// bipartite graphs. It extends \ref BaseBpGraphComponent with
-    /// functions for removing nodes and edges from the graph. This
-    /// concept requires \ref AlterableBpGraphComponent.
-    template <typename BAS = BaseBpGraphComponent>
-    class ErasableBpGraphComponent : public ErasableGraphComponent<BAS> {};
-
     /// \brief Skeleton class for clearable directed graphs.
     ///
@@ -2117,14 +1514,25 @@
     /// This concept requires \ref AlterableGraphComponent.
     template <typename BAS = BaseGraphComponent>
-    class ClearableGraphComponent : public ClearableDigraphComponent<BAS> {};
-
-    /// \brief Skeleton class for clearable undirected biparite graphs.
-    ///
-    /// This class describes the interface of clearable undirected
-    /// bipartite graphs. It extends \ref BaseBpGraphComponent with a
-    /// function for clearing the graph.  This concept requires \ref
-    /// AlterableBpGraphComponent.
-    template <typename BAS = BaseBpGraphComponent>
-    class ClearableBpGraphComponent : public ClearableGraphComponent<BAS> {};
+    class ClearableGraphComponent : public ClearableDigraphComponent<BAS> {
+    public:
+
+      typedef BAS Base;
+
+      /// \brief Erase all nodes and edges from the graph.
+      ///
+      /// This function erases all nodes and edges from the graph.
+      void clear() {}
+
+      template <typename _Graph>
+      struct Constraints {
+        void constraints() {
+          checkConcept<Base, _Graph>();
+          graph.clear();
+        }
+
+        _Graph& graph;
+        Constraints() {}
+      };
+    };
 
   }
Index: lemon/concepts/heap.h
===================================================================
--- lemon/concepts/heap.h	(revision 1270)
+++ lemon/concepts/heap.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/concepts/maps.h
===================================================================
--- lemon/concepts/maps.h	(revision 1270)
+++ lemon/concepts/maps.h	(revision 1257)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/concepts/path.h
===================================================================
--- lemon/concepts/path.h	(revision 1270)
+++ lemon/concepts/path.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/config.h.cmake
===================================================================
--- lemon/config.h.cmake	(revision 725)
+++ lemon/config.h.cmake	(revision 725)
@@ -0,0 +1,8 @@
+#define LEMON_VERSION "@PROJECT_VERSION@"
+#cmakedefine LEMON_HAVE_LONG_LONG 1
+#cmakedefine LEMON_HAVE_LP 1
+#cmakedefine LEMON_HAVE_MIP 1
+#cmakedefine LEMON_HAVE_GLPK 1
+#cmakedefine LEMON_HAVE_CPLEX 1
+#cmakedefine LEMON_HAVE_CLP 1
+#cmakedefine LEMON_HAVE_CBC 1
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 1264)
+++ lemon/config.h.in	(revision 725)
@@ -1,13 +1,26 @@
-#define LEMON_VERSION "@PROJECT_VERSION@"
-#cmakedefine LEMON_HAVE_LONG_LONG 1
-#cmakedefine LEMON_HAVE_LP 1
-#cmakedefine LEMON_HAVE_MIP 1
-#cmakedefine LEMON_HAVE_GLPK 1
-#cmakedefine LEMON_HAVE_CPLEX 1
-#cmakedefine LEMON_HAVE_SOPLEX 1
-#cmakedefine LEMON_HAVE_CLP 1
-#cmakedefine LEMON_HAVE_CBC 1
-#cmakedefine LEMON_DEFAULT_LP @LEMON_DEFAULT_LP@
-#cmakedefine LEMON_DEFAULT_MIP @LEMON_DEFAULT_MIP@
-#cmakedefine LEMON_USE_PTHREAD 1
-#cmakedefine LEMON_USE_WIN32_THREADS 1
+/* The version string */
+#undef LEMON_VERSION
+
+/* Define to 1 if you have long long */
+#undef LEMON_HAVE_LONG_LONG
+
+/* Define to 1 if you have any LP solver. */
+#undef LEMON_HAVE_LP
+
+/* Define to 1 if you have any MIP solver. */
+#undef LEMON_HAVE_MIP
+
+/* Define to 1 if you have CPLEX. */
+#undef LEMON_HAVE_CPLEX
+
+/* Define to 1 if you have GLPK. */
+#undef LEMON_HAVE_GLPK
+
+/* Define to 1 if you have SOPLEX */
+#undef LEMON_HAVE_SOPLEX
+
+/* Define to 1 if you have CLP */
+#undef LEMON_HAVE_CLP
+
+/* Define to 1 if you have CBC */
+#undef LEMON_HAVE_CBC
Index: lemon/connectivity.h
===================================================================
--- lemon/connectivity.h	(revision 1270)
+++ lemon/connectivity.h	(revision 1268)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 1270)
+++ lemon/core.h	(revision 1259)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -160,47 +160,4 @@
   typedef typename Graph::template EdgeMap<double> DoubleEdgeMap
 
-  ///Create convenience typedefs for the bipartite graph types and iterators
-
-  ///This \c \#define creates the same convenient type definitions as
-  ///defined by \ref GRAPH_TYPEDEFS(BpGraph) and ten more, namely it
-  ///creates \c RedNode, \c RedNodeIt, \c BoolRedNodeMap,
-  ///\c IntRedNodeMap, \c DoubleRedNodeMap, \c BlueNode, \c BlueNodeIt,
-  ///\c BoolBlueNodeMap, \c IntBlueNodeMap, \c DoubleBlueNodeMap.
-  ///
-  ///\note If the graph type is a dependent type, ie. the graph type depend
-  ///on a template parameter, then use \c TEMPLATE_BPGRAPH_TYPEDEFS()
-  ///macro.
-#define BPGRAPH_TYPEDEFS(BpGraph)                                       \
-  GRAPH_TYPEDEFS(BpGraph);                                              \
-  typedef BpGraph::RedNode RedNode;                                     \
-  typedef BpGraph::RedNodeIt RedNodeIt;                                 \
-  typedef BpGraph::RedNodeMap<bool> BoolRedNodeMap;                     \
-  typedef BpGraph::RedNodeMap<int> IntRedNodeMap;                       \
-  typedef BpGraph::RedNodeMap<double> DoubleRedNodeMap;                 \
-  typedef BpGraph::BlueNode BlueNode;                                   \
-  typedef BpGraph::BlueNodeIt BlueNodeIt;                               \
-  typedef BpGraph::BlueNodeMap<bool> BoolBlueNodeMap;                   \
-  typedef BpGraph::BlueNodeMap<int> IntBlueNodeMap;                     \
-  typedef BpGraph::BlueNodeMap<double> DoubleBlueNodeMap
-
-  ///Create convenience typedefs for the bipartite graph types and iterators
-
-  ///\see BPGRAPH_TYPEDEFS
-  ///
-  ///\note Use this macro, if the graph type is a dependent type,
-  ///ie. the graph type depend on a template parameter.
-#define TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph)                                  \
-  TEMPLATE_GRAPH_TYPEDEFS(BpGraph);                                         \
-  typedef typename BpGraph::RedNode RedNode;                                \
-  typedef typename BpGraph::RedNodeIt RedNodeIt;                            \
-  typedef typename BpGraph::template RedNodeMap<bool> BoolRedNodeMap;       \
-  typedef typename BpGraph::template RedNodeMap<int> IntRedNodeMap;         \
-  typedef typename BpGraph::template RedNodeMap<double> DoubleRedNodeMap;   \
-  typedef typename BpGraph::BlueNode BlueNode;                              \
-  typedef typename BpGraph::BlueNodeIt BlueNodeIt;                          \
-  typedef typename BpGraph::template BlueNodeMap<bool> BoolBlueNodeMap;     \
-  typedef typename BpGraph::template BlueNodeMap<int> IntBlueNodeMap;       \
-  typedef typename BpGraph::template BlueNodeMap<double> DoubleBlueNodeMap
-
   /// \brief Function to count the items in a graph.
   ///
@@ -254,72 +211,4 @@
   }
 
-  namespace _graph_utils_bits {
-
-    template <typename Graph, typename Enable = void>
-    struct CountRedNodesSelector {
-      static int count(const Graph &g) {
-        return countItems<Graph, typename Graph::RedNode>(g);
-      }
-    };
-
-    template <typename Graph>
-    struct CountRedNodesSelector<
-      Graph, typename
-      enable_if<typename Graph::NodeNumTag, void>::type>
-    {
-      static int count(const Graph &g) {
-        return g.redNum();
-      }
-    };
-  }
-
-  /// \brief Function to count the red nodes in the graph.
-  ///
-  /// This function counts the red nodes in the graph.
-  /// The complexity of the function is O(n) but for some
-  /// graph structures it is specialized to run in O(1).
-  ///
-  /// If the graph contains a \e redNum() member function and a
-  /// \e NodeNumTag tag then this function calls directly the member
-  /// function to query the cardinality of the node set.
-  template <typename Graph>
-  inline int countRedNodes(const Graph& g) {
-    return _graph_utils_bits::CountRedNodesSelector<Graph>::count(g);
-  }
-
-  namespace _graph_utils_bits {
-
-    template <typename Graph, typename Enable = void>
-    struct CountBlueNodesSelector {
-      static int count(const Graph &g) {
-        return countItems<Graph, typename Graph::BlueNode>(g);
-      }
-    };
-
-    template <typename Graph>
-    struct CountBlueNodesSelector<
-      Graph, typename
-      enable_if<typename Graph::NodeNumTag, void>::type>
-    {
-      static int count(const Graph &g) {
-        return g.blueNum();
-      }
-    };
-  }
-
-  /// \brief Function to count the blue nodes in the graph.
-  ///
-  /// This function counts the blue nodes in the graph.
-  /// The complexity of the function is O(n) but for some
-  /// graph structures it is specialized to run in O(1).
-  ///
-  /// If the graph contains a \e blueNum() member function and a
-  /// \e NodeNumTag tag then this function calls directly the member
-  /// function to query the cardinality of the node set.
-  template <typename Graph>
-  inline int countBlueNodes(const Graph& g) {
-    return _graph_utils_bits::CountBlueNodesSelector<Graph>::count(g);
-  }
-
   // Arc counting:
 
@@ -563,67 +452,10 @@
       template <typename From, typename NodeRefMap, typename EdgeRefMap>
       static void copy(const From& from, Graph &to,
-                       NodeRefMap& nodeRefMap,
-                       EdgeRefMap& edgeRefMap) {
+                       NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
         to.build(from, nodeRefMap, edgeRefMap);
       }
     };
 
-    template <typename BpGraph, typename Enable = void>
-    struct BpGraphCopySelector {
-      template <typename From, typename RedNodeRefMap,
-                typename BlueNodeRefMap, typename EdgeRefMap>
-      static void copy(const From& from, BpGraph &to,
-                       RedNodeRefMap& redNodeRefMap,
-                       BlueNodeRefMap& blueNodeRefMap,
-                       EdgeRefMap& edgeRefMap) {
-        to.clear();
-        for (typename From::RedNodeIt it(from); it != INVALID; ++it) {
-          redNodeRefMap[it] = to.addRedNode();
-        }
-        for (typename From::BlueNodeIt it(from); it != INVALID; ++it) {
-          blueNodeRefMap[it] = to.addBlueNode();
-        }
-        for (typename From::EdgeIt it(from); it != INVALID; ++it) {
-          edgeRefMap[it] = to.addEdge(redNodeRefMap[from.redNode(it)],
-                                      blueNodeRefMap[from.blueNode(it)]);
-        }
-      }
-    };
-
-    template <typename BpGraph>
-    struct BpGraphCopySelector<
-      BpGraph,
-      typename enable_if<typename BpGraph::BuildTag, void>::type>
-    {
-      template <typename From, typename RedNodeRefMap,
-                typename BlueNodeRefMap, typename EdgeRefMap>
-      static void copy(const From& from, BpGraph &to,
-                       RedNodeRefMap& redNodeRefMap,
-                       BlueNodeRefMap& blueNodeRefMap,
-                       EdgeRefMap& edgeRefMap) {
-        to.build(from, redNodeRefMap, blueNodeRefMap, edgeRefMap);
-      }
-    };
-
   }
-
-  /// \brief Check whether a graph is undirected.
-  ///
-  /// This function returns \c true if the given graph is undirected.
-#ifdef DOXYGEN
-  template <typename GR>
-  bool undirected(const GR& g) { return false; }
-#else
-  template <typename GR>
-  typename enable_if<UndirectedTagIndicator<GR>, bool>::type
-  undirected(const GR&) {
-    return true;
-  }
-  template <typename GR>
-  typename disable_if<UndirectedTagIndicator<GR>, bool>::type
-  undirected(const GR&) {
-    return false;
-  }
-#endif
 
   /// \brief Class to copy a digraph.
@@ -1150,452 +982,4 @@
   graphCopy(const From& from, To& to) {
     return GraphCopy<From, To>(from, to);
-  }
-
-  /// \brief Class to copy a bipartite graph.
-  ///
-  /// Class to copy a bipartite graph to another graph (duplicate a
-  /// graph). The simplest way of using it is through the
-  /// \c bpGraphCopy() function.
-  ///
-  /// This class not only make a copy of a bipartite graph, but it can
-  /// create references and cross references between the nodes, edges
-  /// and arcs of the two graphs, and it can copy maps for using with
-  /// the newly created graph.
-  ///
-  /// To make a copy from a graph, first an instance of BpGraphCopy
-  /// should be created, then the data belongs to the graph should
-  /// assigned to copy. In the end, the \c run() member should be
-  /// called.
-  ///
-  /// The next code copies a graph with several data:
-  ///\code
-  ///  BpGraphCopy<OrigBpGraph, NewBpGraph> cg(orig_graph, new_graph);
-  ///  // Create references for the nodes
-  ///  OrigBpGraph::NodeMap<NewBpGraph::Node> nr(orig_graph);
-  ///  cg.nodeRef(nr);
-  ///  // Create cross references (inverse) for the edges
-  ///  NewBpGraph::EdgeMap<OrigBpGraph::Edge> ecr(new_graph);
-  ///  cg.edgeCrossRef(ecr);
-  ///  // Copy a red node map
-  ///  OrigBpGraph::RedNodeMap<double> ormap(orig_graph);
-  ///  NewBpGraph::RedNodeMap<double> nrmap(new_graph);
-  ///  cg.redNodeMap(ormap, nrmap);
-  ///  // Copy a node
-  ///  OrigBpGraph::Node on;
-  ///  NewBpGraph::Node nn;
-  ///  cg.node(on, nn);
-  ///  // Execute copying
-  ///  cg.run();
-  ///\endcode
-  template <typename From, typename To>
-  class BpGraphCopy {
-  private:
-
-    typedef typename From::Node Node;
-    typedef typename From::RedNode RedNode;
-    typedef typename From::BlueNode BlueNode;
-    typedef typename From::NodeIt NodeIt;
-    typedef typename From::Arc Arc;
-    typedef typename From::ArcIt ArcIt;
-    typedef typename From::Edge Edge;
-    typedef typename From::EdgeIt EdgeIt;
-
-    typedef typename To::Node TNode;
-    typedef typename To::RedNode TRedNode;
-    typedef typename To::BlueNode TBlueNode;
-    typedef typename To::Arc TArc;
-    typedef typename To::Edge TEdge;
-
-    typedef typename From::template RedNodeMap<TRedNode> RedNodeRefMap;
-    typedef typename From::template BlueNodeMap<TBlueNode> BlueNodeRefMap;
-    typedef typename From::template EdgeMap<TEdge> EdgeRefMap;
-
-    struct NodeRefMap {
-      NodeRefMap(const From& from, const RedNodeRefMap& red_node_ref,
-                 const BlueNodeRefMap& blue_node_ref)
-        : _from(from), _red_node_ref(red_node_ref),
-          _blue_node_ref(blue_node_ref) {}
-
-      typedef typename From::Node Key;
-      typedef typename To::Node Value;
-
-      Value operator[](const Key& key) const {
-        if (_from.red(key)) {
-          return _red_node_ref[_from.asRedNodeUnsafe(key)];
-        } else {
-          return _blue_node_ref[_from.asBlueNodeUnsafe(key)];
-        }
-      }
-
-      const From& _from;
-      const RedNodeRefMap& _red_node_ref;
-      const BlueNodeRefMap& _blue_node_ref;
-    };
-
-    struct ArcRefMap {
-      ArcRefMap(const From& from, const To& to, const EdgeRefMap& edge_ref)
-        : _from(from), _to(to), _edge_ref(edge_ref) {}
-
-      typedef typename From::Arc Key;
-      typedef typename To::Arc Value;
-
-      Value operator[](const Key& key) const {
-        return _to.direct(_edge_ref[key], _from.direction(key));
-      }
-
-      const From& _from;
-      const To& _to;
-      const EdgeRefMap& _edge_ref;
-    };
-
-  public:
-
-    /// \brief Constructor of BpGraphCopy.
-    ///
-    /// Constructor of BpGraphCopy for copying the content of the
-    /// \c from graph into the \c to graph.
-    BpGraphCopy(const From& from, To& to)
-      : _from(from), _to(to) {}
-
-    /// \brief Destructor of BpGraphCopy
-    ///
-    /// Destructor of BpGraphCopy.
-    ~BpGraphCopy() {
-      for (int i = 0; i < int(_node_maps.size()); ++i) {
-        delete _node_maps[i];
-      }
-      for (int i = 0; i < int(_red_maps.size()); ++i) {
-        delete _red_maps[i];
-      }
-      for (int i = 0; i < int(_blue_maps.size()); ++i) {
-        delete _blue_maps[i];
-      }
-      for (int i = 0; i < int(_arc_maps.size()); ++i) {
-        delete _arc_maps[i];
-      }
-      for (int i = 0; i < int(_edge_maps.size()); ++i) {
-        delete _edge_maps[i];
-      }
-    }
-
-    /// \brief Copy the node references into the given map.
-    ///
-    /// This function copies the node references into the given map.
-    /// The parameter should be a map, whose key type is the Node type of
-    /// the source graph, while the value type is the Node type of the
-    /// destination graph.
-    template <typename NodeRef>
-    BpGraphCopy& nodeRef(NodeRef& map) {
-      _node_maps.push_back(new _core_bits::RefCopy<From, Node,
-                           NodeRefMap, NodeRef>(map));
-      return *this;
-    }
-
-    /// \brief Copy the node cross references into the given map.
-    ///
-    /// This function copies the node cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Node type of the destination graph, while the value type is
-    /// the Node type of the source graph.
-    template <typename NodeCrossRef>
-    BpGraphCopy& nodeCrossRef(NodeCrossRef& map) {
-      _node_maps.push_back(new _core_bits::CrossRefCopy<From, Node,
-                           NodeRefMap, NodeCrossRef>(map));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given node map.
-    ///
-    /// This function makes a copy of the given node map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Node type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Node type of the source graph.
-    template <typename FromMap, typename ToMap>
-    BpGraphCopy& nodeMap(const FromMap& map, ToMap& tmap) {
-      _node_maps.push_back(new _core_bits::MapCopy<From, Node,
-                           NodeRefMap, FromMap, ToMap>(map, tmap));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given node.
-    ///
-    /// This function makes a copy of the given node.
-    BpGraphCopy& node(const Node& node, TNode& tnode) {
-      _node_maps.push_back(new _core_bits::ItemCopy<From, Node,
-                           NodeRefMap, TNode>(node, tnode));
-      return *this;
-    }
-
-    /// \brief Copy the red node references into the given map.
-    ///
-    /// This function copies the red node references into the given
-    /// map.  The parameter should be a map, whose key type is the
-    /// Node type of the source graph with the red item set, while the
-    /// value type is the Node type of the destination graph.
-    template <typename RedRef>
-    BpGraphCopy& redRef(RedRef& map) {
-      _red_maps.push_back(new _core_bits::RefCopy<From, RedNode,
-                          RedNodeRefMap, RedRef>(map));
-      return *this;
-    }
-
-    /// \brief Copy the red node cross references into the given map.
-    ///
-    /// This function copies the red node cross references (reverse
-    /// references) into the given map. The parameter should be a map,
-    /// whose key type is the Node type of the destination graph with
-    /// the red item set, while the value type is the Node type of the
-    /// source graph.
-    template <typename RedCrossRef>
-    BpGraphCopy& redCrossRef(RedCrossRef& map) {
-      _red_maps.push_back(new _core_bits::CrossRefCopy<From, RedNode,
-                          RedNodeRefMap, RedCrossRef>(map));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given red node map.
-    ///
-    /// This function makes a copy of the given red node map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Node type of
-    /// the destination graph with the red items, and the key type of
-    /// the original map \c map should be the Node type of the source
-    /// graph.
-    template <typename FromMap, typename ToMap>
-    BpGraphCopy& redNodeMap(const FromMap& map, ToMap& tmap) {
-      _red_maps.push_back(new _core_bits::MapCopy<From, RedNode,
-                          RedNodeRefMap, FromMap, ToMap>(map, tmap));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given red node.
-    ///
-    /// This function makes a copy of the given red node.
-    BpGraphCopy& redNode(const RedNode& node, TRedNode& tnode) {
-      _red_maps.push_back(new _core_bits::ItemCopy<From, RedNode,
-                          RedNodeRefMap, TRedNode>(node, tnode));
-      return *this;
-    }
-
-    /// \brief Copy the blue node references into the given map.
-    ///
-    /// This function copies the blue node references into the given
-    /// map.  The parameter should be a map, whose key type is the
-    /// Node type of the source graph with the blue item set, while the
-    /// value type is the Node type of the destination graph.
-    template <typename BlueRef>
-    BpGraphCopy& blueRef(BlueRef& map) {
-      _blue_maps.push_back(new _core_bits::RefCopy<From, BlueNode,
-                           BlueNodeRefMap, BlueRef>(map));
-      return *this;
-    }
-
-    /// \brief Copy the blue node cross references into the given map.
-    ///
-    /// This function copies the blue node cross references (reverse
-    /// references) into the given map. The parameter should be a map,
-    /// whose key type is the Node type of the destination graph with
-    /// the blue item set, while the value type is the Node type of the
-    /// source graph.
-    template <typename BlueCrossRef>
-    BpGraphCopy& blueCrossRef(BlueCrossRef& map) {
-      _blue_maps.push_back(new _core_bits::CrossRefCopy<From, BlueNode,
-                           BlueNodeRefMap, BlueCrossRef>(map));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given blue node map.
-    ///
-    /// This function makes a copy of the given blue node map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Node type of
-    /// the destination graph with the blue items, and the key type of
-    /// the original map \c map should be the Node type of the source
-    /// graph.
-    template <typename FromMap, typename ToMap>
-    BpGraphCopy& blueNodeMap(const FromMap& map, ToMap& tmap) {
-      _blue_maps.push_back(new _core_bits::MapCopy<From, BlueNode,
-                           BlueNodeRefMap, FromMap, ToMap>(map, tmap));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given blue node.
-    ///
-    /// This function makes a copy of the given blue node.
-    BpGraphCopy& blueNode(const BlueNode& node, TBlueNode& tnode) {
-      _blue_maps.push_back(new _core_bits::ItemCopy<From, BlueNode,
-                           BlueNodeRefMap, TBlueNode>(node, tnode));
-      return *this;
-    }
-
-    /// \brief Copy the arc references into the given map.
-    ///
-    /// This function copies the arc references into the given map.
-    /// The parameter should be a map, whose key type is the Arc type of
-    /// the source graph, while the value type is the Arc type of the
-    /// destination graph.
-    template <typename ArcRef>
-    BpGraphCopy& arcRef(ArcRef& map) {
-      _arc_maps.push_back(new _core_bits::RefCopy<From, Arc,
-                          ArcRefMap, ArcRef>(map));
-      return *this;
-    }
-
-    /// \brief Copy the arc cross references into the given map.
-    ///
-    /// This function copies the arc cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Arc type of the destination graph, while the value type is
-    /// the Arc type of the source graph.
-    template <typename ArcCrossRef>
-    BpGraphCopy& arcCrossRef(ArcCrossRef& map) {
-      _arc_maps.push_back(new _core_bits::CrossRefCopy<From, Arc,
-                          ArcRefMap, ArcCrossRef>(map));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given arc map.
-    ///
-    /// This function makes a copy of the given arc map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Arc type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Arc type of the source graph.
-    template <typename FromMap, typename ToMap>
-    BpGraphCopy& arcMap(const FromMap& map, ToMap& tmap) {
-      _arc_maps.push_back(new _core_bits::MapCopy<From, Arc,
-                          ArcRefMap, FromMap, ToMap>(map, tmap));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given arc.
-    ///
-    /// This function makes a copy of the given arc.
-    BpGraphCopy& arc(const Arc& arc, TArc& tarc) {
-      _arc_maps.push_back(new _core_bits::ItemCopy<From, Arc,
-                          ArcRefMap, TArc>(arc, tarc));
-      return *this;
-    }
-
-    /// \brief Copy the edge references into the given map.
-    ///
-    /// This function copies the edge references into the given map.
-    /// The parameter should be a map, whose key type is the Edge type of
-    /// the source graph, while the value type is the Edge type of the
-    /// destination graph.
-    template <typename EdgeRef>
-    BpGraphCopy& edgeRef(EdgeRef& map) {
-      _edge_maps.push_back(new _core_bits::RefCopy<From, Edge,
-                           EdgeRefMap, EdgeRef>(map));
-      return *this;
-    }
-
-    /// \brief Copy the edge cross references into the given map.
-    ///
-    /// This function copies the edge cross references (reverse references)
-    /// into the given map. The parameter should be a map, whose key type
-    /// is the Edge type of the destination graph, while the value type is
-    /// the Edge type of the source graph.
-    template <typename EdgeCrossRef>
-    BpGraphCopy& edgeCrossRef(EdgeCrossRef& map) {
-      _edge_maps.push_back(new _core_bits::CrossRefCopy<From,
-                           Edge, EdgeRefMap, EdgeCrossRef>(map));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given edge map.
-    ///
-    /// This function makes a copy of the given edge map for the newly
-    /// created graph.
-    /// The key type of the new map \c tmap should be the Edge type of the
-    /// destination graph, and the key type of the original map \c map
-    /// should be the Edge type of the source graph.
-    template <typename FromMap, typename ToMap>
-    BpGraphCopy& edgeMap(const FromMap& map, ToMap& tmap) {
-      _edge_maps.push_back(new _core_bits::MapCopy<From, Edge,
-                           EdgeRefMap, FromMap, ToMap>(map, tmap));
-      return *this;
-    }
-
-    /// \brief Make a copy of the given edge.
-    ///
-    /// This function makes a copy of the given edge.
-    BpGraphCopy& edge(const Edge& edge, TEdge& tedge) {
-      _edge_maps.push_back(new _core_bits::ItemCopy<From, Edge,
-                           EdgeRefMap, TEdge>(edge, tedge));
-      return *this;
-    }
-
-    /// \brief Execute copying.
-    ///
-    /// This function executes the copying of the graph along with the
-    /// copying of the assigned data.
-    void run() {
-      RedNodeRefMap redNodeRefMap(_from);
-      BlueNodeRefMap blueNodeRefMap(_from);
-      NodeRefMap nodeRefMap(_from, redNodeRefMap, blueNodeRefMap);
-      EdgeRefMap edgeRefMap(_from);
-      ArcRefMap arcRefMap(_from, _to, edgeRefMap);
-      _core_bits::BpGraphCopySelector<To>::
-        copy(_from, _to, redNodeRefMap, blueNodeRefMap, edgeRefMap);
-      for (int i = 0; i < int(_node_maps.size()); ++i) {
-        _node_maps[i]->copy(_from, nodeRefMap);
-      }
-      for (int i = 0; i < int(_red_maps.size()); ++i) {
-        _red_maps[i]->copy(_from, redNodeRefMap);
-      }
-      for (int i = 0; i < int(_blue_maps.size()); ++i) {
-        _blue_maps[i]->copy(_from, blueNodeRefMap);
-      }
-      for (int i = 0; i < int(_edge_maps.size()); ++i) {
-        _edge_maps[i]->copy(_from, edgeRefMap);
-      }
-      for (int i = 0; i < int(_arc_maps.size()); ++i) {
-        _arc_maps[i]->copy(_from, arcRefMap);
-      }
-    }
-
-  private:
-
-    const From& _from;
-    To& _to;
-
-    std::vector<_core_bits::MapCopyBase<From, Node, NodeRefMap>* >
-      _node_maps;
-
-    std::vector<_core_bits::MapCopyBase<From, RedNode, RedNodeRefMap>* >
-      _red_maps;
-
-    std::vector<_core_bits::MapCopyBase<From, BlueNode, BlueNodeRefMap>* >
-      _blue_maps;
-
-    std::vector<_core_bits::MapCopyBase<From, Arc, ArcRefMap>* >
-      _arc_maps;
-
-    std::vector<_core_bits::MapCopyBase<From, Edge, EdgeRefMap>* >
-      _edge_maps;
-
-  };
-
-  /// \brief Copy a graph to another graph.
-  ///
-  /// This function copies a graph to another graph.
-  /// The complete usage of it is detailed in the BpGraphCopy class,
-  /// but a short example shows a basic work:
-  ///\code
-  /// graphCopy(src, trg).nodeRef(nr).edgeCrossRef(ecr).run();
-  ///\endcode
-  ///
-  /// After the copy the \c nr map will contain the mapping from the
-  /// nodes of the \c from graph to the nodes of the \c to graph and
-  /// \c ecr will contain the mapping from the edges of the \c to graph
-  /// to the edges of the \c from graph.
-  ///
-  /// \see BpGraphCopy
-  template <typename From, typename To>
-  BpGraphCopy<From, To>
-  bpGraphCopy(const From& from, To& to) {
-    return BpGraphCopy<From, To>(from, to);
   }
 
Index: lemon/cost_scaling.h
===================================================================
--- lemon/cost_scaling.h	(revision 1271)
+++ lemon/cost_scaling.h	(revision 1041)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -92,16 +92,9 @@
   /// \ref CostScaling implements a cost scaling algorithm that performs
   /// push/augment and relabel operations for finding a \ref min_cost_flow
-  /// "minimum cost flow" \cite amo93networkflows,
-  /// \cite goldberg90approximation,
-  /// \cite goldberg97efficient, \cite bunnagel98efficient.
+  /// "minimum cost flow" \ref amo93networkflows, \ref goldberg90approximation,
+  /// \ref goldberg97efficient, \ref bunnagel98efficient.
   /// It is a highly efficient primal-dual solution method, which
   /// can be viewed as the generalization of the \ref Preflow
   /// "preflow push-relabel" algorithm for the maximum flow problem.
-  /// It is a polynomial algorithm, its running time complexity is
-  /// \f$O(n^2m\log(nK))\f$, where <i>K</i> denotes the maximum arc cost.
-  ///
-  /// In general, \ref NetworkSimplex and \ref CostScaling are the fastest
-  /// implementations available in LEMON for solving this problem.
-  /// (For more information, see \ref min_cost_flow_algs "the module page".)
   ///
   /// Most of the parameters of the problem (except for the digraph)
@@ -121,9 +114,8 @@
   /// consider to use the named template parameters instead.
   ///
-  /// \warning Both \c V and \c C must be signed number types.
-  /// \warning All input data (capacities, supply values, and costs) must
+  /// \warning Both number types must be signed and all input data must
   /// be integer.
-  /// \warning This algorithm does not support negative costs for
-  /// arcs having infinite upper bound.
+  /// \warning This algorithm does not support negative costs for such
+  /// arcs that have infinite upper bound.
   ///
   /// \note %CostScaling provides three different internal methods,
@@ -154,6 +146,5 @@
     typedef typename TR::LargeCost LargeCost;
 
-    /// \brief The \ref lemon::CostScalingDefaultTraits "traits class"
-    /// of the algorithm
+    /// The \ref CostScalingDefaultTraits "traits class" of the algorithm
     typedef TR Traits;
 
@@ -188,5 +179,5 @@
     /// relabel operation.
     /// By default, the so called \ref PARTIAL_AUGMENT
-    /// "Partial Augment-Relabel" method is used, which turned out to be
+    /// "Partial Augment-Relabel" method is used, which proved to be
     /// the most efficient and the most robust on various test inputs.
     /// However, the other methods can be selected using the \ref run()
@@ -215,6 +206,5 @@
     typedef std::vector<LargeCost> LargeCostVector;
     typedef std::vector<char> BoolVector;
-    // Note: vector<char> is used instead of vector<bool>
-    // for efficiency reasons
+    // Note: vector<char> is used instead of vector<bool> for efficiency reasons
 
   private:
@@ -244,4 +234,5 @@
     };
 
+    typedef StaticVectorMap<StaticDigraph::Node, LargeCost> LargeCostNodeMap;
     typedef StaticVectorMap<StaticDigraph::Arc, LargeCost> LargeCostArcMap;
 
@@ -294,4 +285,12 @@
     int _max_rank;
 
+    // Data for a StaticDigraph structure
+    typedef std::pair<int, int> IntPair;
+    StaticDigraph _sgr;
+    std::vector<IntPair> _arc_vec;
+    std::vector<LargeCost> _cost_vec;
+    LargeCostArcMap _cost_map;
+    LargeCostNodeMap _pi_map;
+
   public:
 
@@ -340,4 +339,5 @@
     CostScaling(const GR& graph) :
       _graph(graph), _node_id(graph), _arc_idf(graph), _arc_idb(graph),
+      _cost_map(_cost_vec), _pi_map(_pi),
       INF(std::numeric_limits<Value>::has_infinity ?
           std::numeric_limits<Value>::infinity() :
@@ -448,5 +448,5 @@
     ///
     /// Using this function has the same effect as using \ref supplyMap()
-    /// with a map in which \c k is assigned to \c s, \c -k is
+    /// with such a map in which \c k is assigned to \c s, \c -k is
     /// assigned to \c t and all other nodes have zero supply value.
     ///
@@ -494,5 +494,5 @@
     /// \param method The internal method that will be used in the
     /// algorithm. For more information, see \ref Method.
-    /// \param factor The cost scaling factor. It must be at least two.
+    /// \param factor The cost scaling factor. It must be larger than one.
     ///
     /// \return \c INFEASIBLE if no feasible flow exists,
@@ -508,6 +508,5 @@
     /// \see ProblemType, Method
     /// \see resetParams(), reset()
-    ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 16) {
-      LEMON_ASSERT(factor >= 2, "The scaling factor must be at least 2");
+    ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 8) {
       _alpha = factor;
       ProblemType pt = init();
@@ -573,23 +572,16 @@
     }
 
-    /// \brief Reset the internal data structures and all the parameters
-    /// that have been given before.
-    ///
-    /// This function resets the internal data structures and all the
-    /// paramaters that have been given before using functions \ref lowerMap(),
-    /// \ref upperMap(), \ref costMap(), \ref supplyMap(), \ref stSupply().
-    ///
-    /// It is useful for multiple \ref run() calls. By default, all the given
-    /// parameters are kept for the next \ref run() call, unless
-    /// \ref resetParams() or \ref reset() is used.
-    /// If the underlying digraph was also modified after the construction
-    /// of the class or the last \ref reset() call, then the \ref reset()
-    /// function must be used, otherwise \ref resetParams() is sufficient.
-    ///
-    /// See \ref resetParams() for examples.
-    ///
+    /// \brief Reset all the parameters that have been given before.
+    ///
+    /// This function resets all the paramaters that have been given
+    /// before using functions \ref lowerMap(), \ref upperMap(),
+    /// \ref costMap(), \ref supplyMap(), \ref stSupply().
+    ///
+    /// It is useful for multiple run() calls. If this function is not
+    /// used, all the parameters given before are kept for the next
+    /// \ref run() call.
+    /// However, the underlying digraph must not be modified after this
+    /// class have been constructed, since it copies and extends the graph.
     /// \return <tt>(*this)</tt>
-    ///
-    /// \see resetParams(), run()
     CostScaling& reset() {
       // Resize vectors
@@ -616,4 +608,7 @@
       _excess.resize(_res_node_num);
       _next_out.resize(_res_node_num);
+
+      _arc_vec.reserve(_res_arc_num);
+      _cost_vec.reserve(_res_arc_num);
 
       // Copy the graph
@@ -673,5 +668,5 @@
     ///
     /// This function returns the total cost of the found flow.
-    /// Its complexity is O(m).
+    /// Its complexity is O(e).
     ///
     /// \note The return type of the function can be specified as a
@@ -711,6 +706,5 @@
     }
 
-    /// \brief Copy the flow values (the primal solution) into the
-    /// given map.
+    /// \brief Return the flow map (the primal solution).
     ///
     /// This function copies the flow value on each arc into the given
@@ -736,6 +730,5 @@
     }
 
-    /// \brief Copy the potential values (the dual solution) into the
-    /// given map.
+    /// \brief Return the potential map (the dual solution).
     ///
     /// This function copies the potential (dual value) of each node
@@ -766,8 +759,4 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
-
-      // Check lower and upper bounds
-      LEMON_DEBUG(checkBoundMaps(),
-          "Upper bounds must be greater or equal to the lower bounds");
 
 
@@ -898,4 +887,12 @@
       }
 
+      return OPTIMAL;
+    }
+
+    // Execute the algorithm and transform the results
+    void start(Method method) {
+      // Maximum path length for partial augment
+      const int MAX_PATH_LENGTH = 4;
+
       // Initialize data structures for buckets
       _max_rank = _alpha * _res_node_num;
@@ -905,20 +902,5 @@
       _rank.resize(_res_node_num + 1);
 
-      return OPTIMAL;
-    }
-
-    // Check if the upper bound is greater or equal to the lower bound
-    // on each arc.
-    bool checkBoundMaps() {
-      for (int j = 0; j != _res_arc_num; ++j) {
-        if (_upper[j] < _lower[j]) return false;
-      }
-      return true;
-    }
-
-    // Execute the algorithm and transform the results
-    void start(Method method) {
-      const int MAX_PARTIAL_PATH_LENGTH = 4;
-
+      // Execute the algorithm
       switch (method) {
         case PUSH:
@@ -929,65 +911,24 @@
           break;
         case PARTIAL_AUGMENT:
-          startAugment(MAX_PARTIAL_PATH_LENGTH);
+          startAugment(MAX_PATH_LENGTH);
           break;
       }
 
-      // Compute node potentials (dual solution)
-      for (int i = 0; i != _res_node_num; ++i) {
-        _pi[i] = static_cast<Cost>(_pi[i] / (_res_node_num * _alpha));
-      }
-      bool optimal = true;
-      for (int i = 0; optimal && i != _res_node_num; ++i) {
-        LargeCost pi_i = _pi[i];
-        int last_out = _first_out[i+1];
-        for (int j = _first_out[i]; j != last_out; ++j) {
-          if (_res_cap[j] > 0 && _scost[j] + pi_i - _pi[_target[j]] < 0) {
-            optimal = false;
-            break;
-          }
-        }
-      }
-
-      if (!optimal) {
-        // Compute node potentials for the original costs with BellmanFord
-        // (if it is necessary)
-        typedef std::pair<int, int> IntPair;
-        StaticDigraph sgr;
-        std::vector<IntPair> arc_vec;
-        std::vector<LargeCost> cost_vec;
-        LargeCostArcMap cost_map(cost_vec);
-
-        arc_vec.clear();
-        cost_vec.clear();
-        for (int j = 0; j != _res_arc_num; ++j) {
-          if (_res_cap[j] > 0) {
-            int u = _source[j], v = _target[j];
-            arc_vec.push_back(IntPair(u, v));
-            cost_vec.push_back(_scost[j] + _pi[u] - _pi[v]);
-          }
-        }
-        sgr.build(_res_node_num, arc_vec.begin(), arc_vec.end());
-
-        typename BellmanFord<StaticDigraph, LargeCostArcMap>::Create
-          bf(sgr, cost_map);
-        bf.init(0);
-        bf.start();
-
-        for (int i = 0; i != _res_node_num; ++i) {
-          _pi[i] += bf.dist(sgr.node(i));
-        }
-      }
-
-      // Shift potentials to meet the requirements of the GEQ type
-      // optimality conditions
-      LargeCost max_pot = _pi[_root];
-      for (int i = 0; i != _res_node_num; ++i) {
-        if (_pi[i] > max_pot) max_pot = _pi[i];
-      }
-      if (max_pot != 0) {
-        for (int i = 0; i != _res_node_num; ++i) {
-          _pi[i] -= max_pot;
-        }
-      }
+      // Compute node potentials for the original costs
+      _arc_vec.clear();
+      _cost_vec.clear();
+      for (int j = 0; j != _res_arc_num; ++j) {
+        if (_res_cap[j] > 0) {
+          _arc_vec.push_back(IntPair(_source[j], _target[j]));
+          _cost_vec.push_back(_scost[j]);
+        }
+      }
+      _sgr.build(_res_node_num, _arc_vec.begin(), _arc_vec.end());
+
+      typename BellmanFord<StaticDigraph, LargeCostArcMap>
+        ::template SetDistMap<LargeCostNodeMap>::Create bf(_sgr, _cost_map);
+      bf.distMap(_pi_map);
+      bf.init(0);
+      bf.start();
 
       // Handle non-zero lower bounds
@@ -1007,13 +948,11 @@
         LargeCost pi_u = _pi[u];
         for (int a = _first_out[u]; a != last_out; ++a) {
-          Value delta = _res_cap[a];
-          if (delta > 0) {
-            int v = _target[a];
-            if (_cost[a] + pi_u - _pi[v] < 0) {
-              _excess[u] -= delta;
-              _excess[v] += delta;
-              _res_cap[a] = 0;
-              _res_cap[_reverse[a]] += delta;
-            }
+          int v = _target[a];
+          if (_res_cap[a] > 0 && _cost[a] + pi_u - _pi[v] < 0) {
+            Value delta = _res_cap[a];
+            _excess[u] -= delta;
+            _excess[v] += delta;
+            _res_cap[a] = 0;
+            _res_cap[_reverse[a]] += delta;
           }
         }
@@ -1031,232 +970,33 @@
     }
 
-    // Price (potential) refinement heuristic
-    bool priceRefinement() {
-
-      // Stack for stroing the topological order
-      IntVector stack(_res_node_num);
-      int stack_top;
-
-      // Perform phases
-      while (topologicalSort(stack, stack_top)) {
-
-        // Compute node ranks in the acyclic admissible network and
-        // store the nodes in buckets
-        for (int i = 0; i != _res_node_num; ++i) {
-          _rank[i] = 0;
-        }
-        const int bucket_end = _root + 1;
-        for (int r = 0; r != _max_rank; ++r) {
-          _buckets[r] = bucket_end;
-        }
-        int top_rank = 0;
-        for ( ; stack_top >= 0; --stack_top) {
-          int u = stack[stack_top], v;
-          int rank_u = _rank[u];
-
-          LargeCost rc, pi_u = _pi[u];
-          int last_out = _first_out[u+1];
-          for (int a = _first_out[u]; a != last_out; ++a) {
-            if (_res_cap[a] > 0) {
-              v = _target[a];
-              rc = _cost[a] + pi_u - _pi[v];
-              if (rc < 0) {
-                LargeCost nrc = static_cast<LargeCost>((-rc - 0.5) / _epsilon);
-                if (nrc < LargeCost(_max_rank)) {
-                  int new_rank_v = rank_u + static_cast<int>(nrc);
-                  if (new_rank_v > _rank[v]) {
-                    _rank[v] = new_rank_v;
-                  }
-                }
-              }
-            }
-          }
-
-          if (rank_u > 0) {
-            top_rank = std::max(top_rank, rank_u);
-            int bfirst = _buckets[rank_u];
-            _bucket_next[u] = bfirst;
-            _bucket_prev[bfirst] = u;
-            _buckets[rank_u] = u;
-          }
-        }
-
-        // Check if the current flow is epsilon-optimal
-        if (top_rank == 0) {
-          return true;
-        }
-
-        // Process buckets in top-down order
-        for (int rank = top_rank; rank > 0; --rank) {
-          while (_buckets[rank] != bucket_end) {
-            // Remove the first node from the current bucket
-            int u = _buckets[rank];
-            _buckets[rank] = _bucket_next[u];
-
-            // Search the outgoing arcs of u
-            LargeCost rc, pi_u = _pi[u];
-            int last_out = _first_out[u+1];
-            int v, old_rank_v, new_rank_v;
-            for (int a = _first_out[u]; a != last_out; ++a) {
-              if (_res_cap[a] > 0) {
-                v = _target[a];
-                old_rank_v = _rank[v];
-
-                if (old_rank_v < rank) {
-
-                  // Compute the new rank of node v
-                  rc = _cost[a] + pi_u - _pi[v];
-                  if (rc < 0) {
-                    new_rank_v = rank;
-                  } else {
-                    LargeCost nrc = rc / _epsilon;
-                    new_rank_v = 0;
-                    if (nrc < LargeCost(_max_rank)) {
-                      new_rank_v = rank - 1 - static_cast<int>(nrc);
-                    }
-                  }
-
-                  // Change the rank of node v
-                  if (new_rank_v > old_rank_v) {
-                    _rank[v] = new_rank_v;
-
-                    // Remove v from its old bucket
-                    if (old_rank_v > 0) {
-                      if (_buckets[old_rank_v] == v) {
-                        _buckets[old_rank_v] = _bucket_next[v];
-                      } else {
-                        int pv = _bucket_prev[v], nv = _bucket_next[v];
-                        _bucket_next[pv] = nv;
-                        _bucket_prev[nv] = pv;
-                      }
-                    }
-
-                    // Insert v into its new bucket
-                    int nv = _buckets[new_rank_v];
-                    _bucket_next[v] = nv;
-                    _bucket_prev[nv] = v;
-                    _buckets[new_rank_v] = v;
-                  }
-                }
-              }
-            }
-
-            // Refine potential of node u
-            _pi[u] -= rank * _epsilon;
-          }
-        }
-
-      }
-
-      return false;
-    }
-
-    // Find and cancel cycles in the admissible network and
-    // determine topological order using DFS
-    bool topologicalSort(IntVector &stack, int &stack_top) {
-      const int MAX_CYCLE_CANCEL = 1;
-
-      BoolVector reached(_res_node_num, false);
-      BoolVector processed(_res_node_num, false);
-      IntVector pred(_res_node_num);
-      for (int i = 0; i != _res_node_num; ++i) {
-        _next_out[i] = _first_out[i];
-      }
-      stack_top = -1;
-
-      int cycle_cnt = 0;
-      for (int start = 0; start != _res_node_num; ++start) {
-        if (reached[start]) continue;
-
-        // Start DFS search from this start node
-        pred[start] = -1;
-        int tip = start, v;
-        while (true) {
-          // Check the outgoing arcs of the current tip node
-          reached[tip] = true;
-          LargeCost pi_tip = _pi[tip];
-          int a, last_out = _first_out[tip+1];
-          for (a = _next_out[tip]; a != last_out; ++a) {
-            if (_res_cap[a] > 0) {
-              v = _target[a];
-              if (_cost[a] + pi_tip - _pi[v] < 0) {
-                if (!reached[v]) {
-                  // A new node is reached
-                  reached[v] = true;
-                  pred[v] = tip;
-                  _next_out[tip] = a;
-                  tip = v;
-                  a = _next_out[tip];
-                  last_out = _first_out[tip+1];
-                  break;
-                }
-                else if (!processed[v]) {
-                  // A cycle is found
-                  ++cycle_cnt;
-                  _next_out[tip] = a;
-
-                  // Find the minimum residual capacity along the cycle
-                  Value d, delta = _res_cap[a];
-                  int u, delta_node = tip;
-                  for (u = tip; u != v; ) {
-                    u = pred[u];
-                    d = _res_cap[_next_out[u]];
-                    if (d <= delta) {
-                      delta = d;
-                      delta_node = u;
-                    }
-                  }
-
-                  // Augment along the cycle
-                  _res_cap[a] -= delta;
-                  _res_cap[_reverse[a]] += delta;
-                  for (u = tip; u != v; ) {
-                    u = pred[u];
-                    int ca = _next_out[u];
-                    _res_cap[ca] -= delta;
-                    _res_cap[_reverse[ca]] += delta;
-                  }
-
-                  // Check the maximum number of cycle canceling
-                  if (cycle_cnt >= MAX_CYCLE_CANCEL) {
-                    return false;
-                  }
-
-                  // Roll back search to delta_node
-                  if (delta_node != tip) {
-                    for (u = tip; u != delta_node; u = pred[u]) {
-                      reached[u] = false;
-                    }
-                    tip = delta_node;
-                    a = _next_out[tip] + 1;
-                    last_out = _first_out[tip+1];
-                    break;
-                  }
-                }
-              }
-            }
-          }
-
-          // Step back to the previous node
-          if (a == last_out) {
-            processed[tip] = true;
-            stack[++stack_top] = tip;
-            tip = pred[tip];
-            if (tip < 0) {
-              // Finish DFS from the current start node
-              break;
-            }
-            ++_next_out[tip];
-          }
-        }
-
-      }
-
-      return (cycle_cnt == 0);
+    // Early termination heuristic
+    bool earlyTermination() {
+      const double EARLY_TERM_FACTOR = 3.0;
+
+      // Build a static residual graph
+      _arc_vec.clear();
+      _cost_vec.clear();
+      for (int j = 0; j != _res_arc_num; ++j) {
+        if (_res_cap[j] > 0) {
+          _arc_vec.push_back(IntPair(_source[j], _target[j]));
+          _cost_vec.push_back(_cost[j] + 1);
+        }
+      }
+      _sgr.build(_res_node_num, _arc_vec.begin(), _arc_vec.end());
+
+      // Run Bellman-Ford algorithm to check if the current flow is optimal
+      BellmanFord<StaticDigraph, LargeCostArcMap> bf(_sgr, _cost_map);
+      bf.init(0);
+      bool done = false;
+      int K = int(EARLY_TERM_FACTOR * std::sqrt(double(_res_node_num)));
+      for (int i = 0; i < K && !done; ++i) {
+        done = bf.processNextWeakRound();
+      }
+      return done;
     }
 
     // Global potential update heuristic
     void globalUpdate() {
-      const int bucket_end = _root + 1;
+      int bucket_end = _root + 1;
 
       // Initialize buckets
@@ -1265,11 +1005,10 @@
       }
       Value total_excess = 0;
-      int b0 = bucket_end;
       for (int i = 0; i != _res_node_num; ++i) {
         if (_excess[i] < 0) {
           _rank[i] = 0;
-          _bucket_next[i] = b0;
-          _bucket_prev[b0] = i;
-          b0 = i;
+          _bucket_next[i] = _buckets[0];
+          _bucket_prev[_buckets[0]] = i;
+          _buckets[0] = i;
         } else {
           total_excess += _excess[i];
@@ -1278,5 +1017,4 @@
       }
       if (total_excess == 0) return;
-      _buckets[0] = b0;
 
       // Search the buckets
@@ -1288,5 +1026,5 @@
           _buckets[r] = _bucket_next[u];
 
-          // Search the incoming arcs of u
+          // Search the incomming arcs of u
           LargeCost pi_u = _pi[u];
           int last_out = _first_out[u+1];
@@ -1300,7 +1038,6 @@
                 LargeCost nrc = (_cost[ra] + _pi[v] - pi_u) / _epsilon;
                 int new_rank_v = old_rank_v;
-                if (nrc < LargeCost(_max_rank)) {
-                  new_rank_v = r + 1 + static_cast<int>(nrc);
-                }
+                if (nrc < LargeCost(_max_rank))
+                  new_rank_v = r + 1 + int(nrc);
 
                 // Change the rank of v
@@ -1314,14 +1051,12 @@
                       _buckets[old_rank_v] = _bucket_next[v];
                     } else {
-                      int pv = _bucket_prev[v], nv = _bucket_next[v];
-                      _bucket_next[pv] = nv;
-                      _bucket_prev[nv] = pv;
+                      _bucket_next[_bucket_prev[v]] = _bucket_next[v];
+                      _bucket_prev[_bucket_next[v]] = _bucket_prev[v];
                     }
                   }
 
-                  // Insert v into its new bucket
-                  int nv = _buckets[new_rank_v];
-                  _bucket_next[v] = nv;
-                  _bucket_prev[nv] = v;
+                  // Insert v to its new bucket
+                  _bucket_next[v] = _buckets[new_rank_v];
+                  _bucket_prev[_buckets[new_rank_v]] = v;
                   _buckets[new_rank_v] = v;
                 }
@@ -1352,23 +1087,21 @@
     void startAugment(int max_length) {
       // Paramters for heuristics
-      const int PRICE_REFINEMENT_LIMIT = 2;
-      const double GLOBAL_UPDATE_FACTOR = 1.0;
-      const int global_update_skip = static_cast<int>(GLOBAL_UPDATE_FACTOR *
+      const int EARLY_TERM_EPSILON_LIMIT = 1000;
+      const double GLOBAL_UPDATE_FACTOR = 3.0;
+
+      const int global_update_freq = int(GLOBAL_UPDATE_FACTOR *
         (_res_node_num + _sup_node_num * _sup_node_num));
-      int next_global_update_limit = global_update_skip;
+      int next_update_limit = global_update_freq;
+
+      int relabel_cnt = 0;
 
       // Perform cost scaling phases
-      IntVector path;
-      BoolVector path_arc(_res_arc_num, false);
-      int relabel_cnt = 0;
-      int eps_phase_cnt = 0;
+      std::vector<int> path;
       for ( ; _epsilon >= 1; _epsilon = _epsilon < _alpha && _epsilon > 1 ?
                                         1 : _epsilon / _alpha )
       {
-        ++eps_phase_cnt;
-
-        // Price refinement heuristic
-        if (eps_phase_cnt >= PRICE_REFINEMENT_LIMIT) {
-          if (priceRefinement()) continue;
+        // Early termination heuristic
+        if (_epsilon <= EARLY_TERM_EPSILON_LIMIT) {
+          if (earlyTermination()) break;
         }
 
@@ -1387,43 +1120,30 @@
 
           // Find an augmenting path from the start node
+          path.clear();
           int tip = start;
-          while (int(path.size()) < max_length && _excess[tip] >= 0) {
+          while (_excess[tip] >= 0 && int(path.size()) < max_length) {
             int u;
-            LargeCost rc, min_red_cost = std::numeric_limits<LargeCost>::max();
-            LargeCost pi_tip = _pi[tip];
+            LargeCost min_red_cost, rc, pi_tip = _pi[tip];
             int last_out = _first_out[tip+1];
             for (int a = _next_out[tip]; a != last_out; ++a) {
-              if (_res_cap[a] > 0) {
-                u = _target[a];
-                rc = _cost[a] + pi_tip - _pi[u];
-                if (rc < 0) {
-                  path.push_back(a);
-                  _next_out[tip] = a;
-                  if (path_arc[a]) {
-                    goto augment;   // a cycle is found, stop path search
-                  }
-                  tip = u;
-                  path_arc[a] = true;
-                  goto next_step;
-                }
-                else if (rc < min_red_cost) {
-                  min_red_cost = rc;
-                }
+              u = _target[a];
+              if (_res_cap[a] > 0 && _cost[a] + pi_tip - _pi[u] < 0) {
+                path.push_back(a);
+                _next_out[tip] = a;
+                tip = u;
+                goto next_step;
               }
             }
 
             // Relabel tip node
+            min_red_cost = std::numeric_limits<LargeCost>::max();
             if (tip != start) {
               int ra = _reverse[path.back()];
-              min_red_cost =
-                std::min(min_red_cost, _cost[ra] + pi_tip - _pi[_target[ra]]);
+              min_red_cost = _cost[ra] + pi_tip - _pi[_target[ra]];
             }
-            last_out = _next_out[tip];
             for (int a = _first_out[tip]; a != last_out; ++a) {
-              if (_res_cap[a] > 0) {
-                rc = _cost[a] + pi_tip - _pi[_target[a]];
-                if (rc < min_red_cost) {
-                  min_red_cost = rc;
-                }
+              rc = _cost[a] + pi_tip - _pi[_target[a]];
+              if (_res_cap[a] > 0 && rc < min_red_cost) {
+                min_red_cost = rc;
               }
             }
@@ -1434,7 +1154,5 @@
             // Step back
             if (tip != start) {
-              int pa = path.back();
-              path_arc[pa] = false;
-              tip = _source[pa];
+              tip = _source[path.back()];
               path.pop_back();
             }
@@ -1444,5 +1162,4 @@
 
           // Augment along the found path (as much flow as possible)
-        augment:
           Value delta;
           int pa, u, v = start;
@@ -1451,5 +1168,4 @@
             u = v;
             v = _target[pa];
-            path_arc[pa] = false;
             delta = std::min(_res_cap[pa], _excess[u]);
             _res_cap[pa] -= delta;
@@ -1457,19 +1173,15 @@
             _excess[u] -= delta;
             _excess[v] += delta;
-            if (_excess[v] > 0 && _excess[v] <= delta) {
+            if (_excess[v] > 0 && _excess[v] <= delta)
               _active_nodes.push_back(v);
-            }
           }
-          path.clear();
 
           // Global update heuristic
-          if (relabel_cnt >= next_global_update_limit) {
+          if (relabel_cnt >= next_update_limit) {
             globalUpdate();
-            next_global_update_limit += global_update_skip;
+            next_update_limit += global_update_freq;
           }
         }
-
-      }
-
+      }
     }
 
@@ -1477,24 +1189,22 @@
     void startPush() {
       // Paramters for heuristics
-      const int PRICE_REFINEMENT_LIMIT = 2;
+      const int EARLY_TERM_EPSILON_LIMIT = 1000;
       const double GLOBAL_UPDATE_FACTOR = 2.0;
 
-      const int global_update_skip = static_cast<int>(GLOBAL_UPDATE_FACTOR *
+      const int global_update_freq = int(GLOBAL_UPDATE_FACTOR *
         (_res_node_num + _sup_node_num * _sup_node_num));
-      int next_global_update_limit = global_update_skip;
+      int next_update_limit = global_update_freq;
+
+      int relabel_cnt = 0;
 
       // Perform cost scaling phases
       BoolVector hyper(_res_node_num, false);
       LargeCostVector hyper_cost(_res_node_num);
-      int relabel_cnt = 0;
-      int eps_phase_cnt = 0;
       for ( ; _epsilon >= 1; _epsilon = _epsilon < _alpha && _epsilon > 1 ?
                                         1 : _epsilon / _alpha )
       {
-        ++eps_phase_cnt;
-
-        // Price refinement heuristic
-        if (eps_phase_cnt >= PRICE_REFINEMENT_LIMIT) {
-          if (priceRefinement()) continue;
+        // Early termination heuristic
+        if (_epsilon <= EARLY_TERM_EPSILON_LIMIT) {
+          if (earlyTermination()) break;
         }
 
@@ -1568,9 +1278,7 @@
                std::numeric_limits<LargeCost>::max();
             for (int a = _first_out[n]; a != last_out; ++a) {
-              if (_res_cap[a] > 0) {
-                rc = _cost[a] + pi_n - _pi[_target[a]];
-                if (rc < min_red_cost) {
-                  min_red_cost = rc;
-                }
+              rc = _cost[a] + pi_n - _pi[_target[a]];
+              if (_res_cap[a] > 0 && rc < min_red_cost) {
+                min_red_cost = rc;
               }
             }
@@ -1590,9 +1298,9 @@
 
           // Global update heuristic
-          if (relabel_cnt >= next_global_update_limit) {
+          if (relabel_cnt >= next_update_limit) {
             globalUpdate();
             for (int u = 0; u != _res_node_num; ++u)
               hyper[u] = false;
-            next_global_update_limit += global_update_skip;
+            next_update_limit += global_update_freq;
           }
         }
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 1270)
+++ lemon/cplex.cc	(revision 1183)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -492,15 +492,4 @@
                    _message_enabled ? CPX_ON : CPX_OFF);
   }
-
-  void CplexBase::_write(std::string file, std::string format) const
-  {
-    if(format == "MPS" || format == "LP")
-      CPXwriteprob(cplexEnv(), cplexLp(), file.c_str(), format.c_str());
-    else if(format == "SOL")
-      CPXsolwrite(cplexEnv(), cplexLp(), file.c_str());
-    else throw UnsupportedFormatError(format);
-  }
-
-
 
   // CplexLp members
Index: lemon/cplex.h
===================================================================
--- lemon/cplex.h	(revision 1270)
+++ lemon/cplex.h	(revision 793)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -151,6 +151,4 @@
     bool _message_enabled;
 
-    void _write(std::string file, std::string format) const;
-
   public:
 
@@ -173,17 +171,4 @@
     const cpxlp* cplexLp() const { return _prob; }
 
-#ifdef DOXYGEN
-    /// Write the problem or the solution to a file in the given format
-
-    /// This function writes the problem or the solution
-    /// to a file in the given format.
-    /// Trying to write in an unsupported format will trigger
-    /// \ref lemon::LpBase::UnsupportedFormatError "UnsupportedFormatError".
-    /// \param file The file path
-    /// \param format The output file format.
-    /// Supportted formats are "MPS", "LP" and "SOL".
-    void write(std::string file, std::string format = "MPS") const {}
-#endif
-
   };
 
Index: lemon/cycle_canceling.h
===================================================================
--- lemon/cycle_canceling.h	(revision 1270)
+++ lemon/cycle_canceling.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -36,5 +36,4 @@
 #include <lemon/bellman_ford.h>
 #include <lemon/howard_mmc.h>
-#include <lemon/hartmann_orlin_mmc.h>
 
 namespace lemon {
@@ -48,12 +47,11 @@
   /// \ref CycleCanceling implements three different cycle-canceling
   /// algorithms for finding a \ref min_cost_flow "minimum cost flow"
-  /// \cite amo93networkflows, \cite klein67primal,
-  /// \cite goldberg89cyclecanceling.
-  /// The most efficent one is the \ref CANCEL_AND_TIGHTEN
-  /// "Cancel-and-Tighten" algorithm, thus it is the default method.
-  /// It runs in strongly polynomial time \f$O(n^2 m^2 \log n)\f$,
-  /// but in practice, it is typically orders of magnitude slower than
-  /// the scaling algorithms and \ref NetworkSimplex.
-  /// (For more information, see \ref min_cost_flow_algs "the module page".)
+  /// \ref amo93networkflows, \ref klein67primal,
+  /// \ref goldberg89cyclecanceling.
+  /// The most efficent one (both theoretically and practically)
+  /// is the \ref CANCEL_AND_TIGHTEN "Cancel and Tighten" algorithm,
+  /// thus it is the default method.
+  /// It is strongly polynomial, but in practice, it is typically much
+  /// slower than the scaling algorithms and NetworkSimplex.
   ///
   /// Most of the parameters of the problem (except for the digraph)
@@ -68,9 +66,8 @@
   /// algorithm. By default, it is the same as \c V.
   ///
-  /// \warning Both \c V and \c C must be signed number types.
-  /// \warning All input data (capacities, supply values, and costs) must
+  /// \warning Both number types must be signed and all input data must
   /// be integer.
-  /// \warning This algorithm does not support negative costs for
-  /// arcs having infinite upper bound.
+  /// \warning This algorithm does not support negative costs for such
+  /// arcs that have infinite upper bound.
   ///
   /// \note For more information about the three available methods,
@@ -119,26 +116,25 @@
     ///
     /// \ref CycleCanceling provides three different cycle-canceling
-    /// methods. By default, \ref CANCEL_AND_TIGHTEN "Cancel-and-Tighten"
-    /// is used, which is by far the most efficient and the most robust.
+    /// methods. By default, \ref CANCEL_AND_TIGHTEN "Cancel and Tighten"
+    /// is used, which proved to be the most efficient and the most robust
+    /// on various test inputs.
     /// However, the other methods can be selected using the \ref run()
     /// function with the proper parameter.
     enum Method {
       /// A simple cycle-canceling method, which uses the
-      /// \ref BellmanFord "Bellman-Ford" algorithm for detecting negative
-      /// cycles in the residual network.
-      /// The number of Bellman-Ford iterations is bounded by a successively
-      /// increased limit.
+      /// \ref BellmanFord "Bellman-Ford" algorithm with limited iteration
+      /// number for detecting negative cycles in the residual network.
       SIMPLE_CYCLE_CANCELING,
       /// The "Minimum Mean Cycle-Canceling" algorithm, which is a
       /// well-known strongly polynomial method
-      /// \cite goldberg89cyclecanceling. It improves along a
+      /// \ref goldberg89cyclecanceling. It improves along a
       /// \ref min_mean_cycle "minimum mean cycle" in each iteration.
-      /// Its running time complexity is \f$O(n^2 m^3 \log n)\f$.
+      /// Its running time complexity is O(n<sup>2</sup>m<sup>3</sup>log(n)).
       MINIMUM_MEAN_CYCLE_CANCELING,
-      /// The "Cancel-and-Tighten" algorithm, which can be viewed as an
+      /// The "Cancel And Tighten" algorithm, which can be viewed as an
       /// improved version of the previous method
-      /// \cite goldberg89cyclecanceling.
+      /// \ref goldberg89cyclecanceling.
       /// It is faster both in theory and in practice, its running time
-      /// complexity is \f$O(n^2 m^2 \log n)\f$.
+      /// complexity is O(n<sup>2</sup>m<sup>2</sup>log(n)).
       CANCEL_AND_TIGHTEN
     };
@@ -354,5 +350,5 @@
     ///
     /// Using this function has the same effect as using \ref supplyMap()
-    /// with a map in which \c k is assigned to \c s, \c -k is
+    /// with such a map in which \c k is assigned to \c s, \c -k is
     /// assigned to \c t and all other nodes have zero supply value.
     ///
@@ -577,5 +573,5 @@
     ///
     /// This function returns the total cost of the found flow.
-    /// Its complexity is O(m).
+    /// Its complexity is O(e).
     ///
     /// \note The return type of the function can be specified as a
@@ -615,6 +611,5 @@
     }
 
-    /// \brief Copy the flow values (the primal solution) into the
-    /// given map.
+    /// \brief Return the flow map (the primal solution).
     ///
     /// This function copies the flow value on each arc into the given
@@ -640,6 +635,5 @@
     }
 
-    /// \brief Copy the potential values (the dual solution) into the
-    /// given map.
+    /// \brief Return the potential map (the dual solution).
     ///
     /// This function copies the potential (dual value) of each node
@@ -670,8 +664,4 @@
       }
       if (_sum_supply > 0) return INFEASIBLE;
-
-      // Check lower and upper bounds
-      LEMON_DEBUG(checkBoundMaps(),
-          "Upper bounds must be greater or equal to the lower bounds");
 
 
@@ -783,13 +773,4 @@
 
       return OPTIMAL;
-    }
-
-    // Check if the upper bound is greater or equal to the lower bound
-    // on each arc.
-    bool checkBoundMaps() {
-      for (int j = 0; j != _res_arc_num; ++j) {
-        if (_upper[j] < _lower[j]) return false;
-      }
-      return true;
     }
 
@@ -942,39 +923,16 @@
     // Execute the "Minimum Mean Cycle Canceling" method
     void startMinMeanCycleCanceling() {
-      typedef Path<StaticDigraph> SPath;
+      typedef SimplePath<StaticDigraph> SPath;
       typedef typename SPath::ArcIt SPathArcIt;
       typedef typename HowardMmc<StaticDigraph, CostArcMap>
-        ::template SetPath<SPath>::Create HwMmc;
-      typedef typename HartmannOrlinMmc<StaticDigraph, CostArcMap>
-        ::template SetPath<SPath>::Create HoMmc;
-
-      const double HW_ITER_LIMIT_FACTOR = 1.0;
-      const int HW_ITER_LIMIT_MIN_VALUE = 5;
-
-      const int hw_iter_limit =
-          std::max(static_cast<int>(HW_ITER_LIMIT_FACTOR * _node_num),
-                   HW_ITER_LIMIT_MIN_VALUE);
+        ::template SetPath<SPath>::Create MMC;
 
       SPath cycle;
-      HwMmc hw_mmc(_sgr, _cost_map);
-      hw_mmc.cycle(cycle);
+      MMC mmc(_sgr, _cost_map);
+      mmc.cycle(cycle);
       buildResidualNetwork();
-      while (true) {
-
-        typename HwMmc::TerminationCause hw_tc =
-            hw_mmc.findCycleMean(hw_iter_limit);
-        if (hw_tc == HwMmc::ITERATION_LIMIT) {
-          // Howard's algorithm reached the iteration limit, start a
-          // strongly polynomial algorithm instead
-          HoMmc ho_mmc(_sgr, _cost_map);
-          ho_mmc.cycle(cycle);
-          // Find a minimum mean cycle (Hartmann-Orlin algorithm)
-          if (!(ho_mmc.findCycleMean() && ho_mmc.cycleCost() < 0)) break;
-          ho_mmc.findCycle();
-        } else {
-          // Find a minimum mean cycle (Howard algorithm)
-          if (!(hw_tc == HwMmc::OPTIMAL && hw_mmc.cycleCost() < 0)) break;
-          hw_mmc.findCycle();
-        }
+      while (mmc.findCycleMean() && mmc.cycleCost() < 0) {
+        // Find the cycle
+        mmc.findCycle();
 
         // Compute delta value
@@ -997,15 +955,9 @@
     }
 
-    // Execute the "Cancel-and-Tighten" method
+    // Execute the "Cancel And Tighten" method
     void startCancelAndTighten() {
       // Constants for the min mean cycle computations
       const double LIMIT_FACTOR = 1.0;
       const int MIN_LIMIT = 5;
-      const double HW_ITER_LIMIT_FACTOR = 1.0;
-      const int HW_ITER_LIMIT_MIN_VALUE = 5;
-
-      const int hw_iter_limit =
-          std::max(static_cast<int>(HW_ITER_LIMIT_FACTOR * _node_num),
-                   HW_ITER_LIMIT_MIN_VALUE);
 
       // Contruct auxiliary data vectors
@@ -1181,28 +1133,15 @@
           }
         } else {
-          typedef HowardMmc<StaticDigraph, CostArcMap> HwMmc;
-          typedef HartmannOrlinMmc<StaticDigraph, CostArcMap> HoMmc;
+          typedef HowardMmc<StaticDigraph, CostArcMap> MMC;
           typedef typename BellmanFord<StaticDigraph, CostArcMap>
             ::template SetDistMap<CostNodeMap>::Create BF;
 
           // Set epsilon to the minimum cycle mean
-          Cost cycle_cost = 0;
-          int cycle_size = 1;
           buildResidualNetwork();
-          HwMmc hw_mmc(_sgr, _cost_map);
-          if (hw_mmc.findCycleMean(hw_iter_limit) == HwMmc::ITERATION_LIMIT) {
-            // Howard's algorithm reached the iteration limit, start a
-            // strongly polynomial algorithm instead
-            HoMmc ho_mmc(_sgr, _cost_map);
-            ho_mmc.findCycleMean();
-            epsilon = -ho_mmc.cycleMean();
-            cycle_cost = ho_mmc.cycleCost();
-            cycle_size = ho_mmc.cycleSize();
-          } else {
-            // Set epsilon
-            epsilon = -hw_mmc.cycleMean();
-            cycle_cost = hw_mmc.cycleCost();
-            cycle_size = hw_mmc.cycleSize();
-          }
+          MMC mmc(_sgr, _cost_map);
+          mmc.findCycleMean();
+          epsilon = -mmc.cycleMean();
+          Cost cycle_cost = mmc.cycleCost();
+          int cycle_size = mmc.cycleSize();
 
           // Compute feasible potentials for the current epsilon
Index: lemon/dfs.h
===================================================================
--- lemon/dfs.h	(revision 1270)
+++ lemon/dfs.h	(revision 1159)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -153,5 +153,5 @@
     typedef PredMapPath<Digraph, PredMap> Path;
 
-    ///The \ref lemon::DfsDefaultTraits "traits class" of the algorithm.
+    ///The \ref DfsDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
 
Index: lemon/dijkstra.h
===================================================================
--- lemon/dijkstra.h	(revision 1270)
+++ lemon/dijkstra.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -228,9 +228,9 @@
     ///The heap type used by the algorithm.
     typedef typename TR::Heap Heap;
-    /// \brief The \ref lemon::DijkstraDefaultOperationTraits
-    /// "operation traits class" of the algorithm.
+    ///\brief The \ref DijkstraDefaultOperationTraits "operation traits class"
+    ///of the algorithm.
     typedef typename TR::OperationTraits OperationTraits;
 
-    ///The \ref lemon::DijkstraDefaultTraits "traits class" of the algorithm.
+    ///The \ref DijkstraDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
 
Index: lemon/dimacs.h
===================================================================
--- lemon/dimacs.h	(revision 1270)
+++ lemon/dimacs.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/edge_set.h
===================================================================
--- lemon/edge_set.h	(revision 1270)
+++ lemon/edge_set.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/edmonds_karp.h
===================================================================
--- lemon/edmonds_karp.h	(revision 1270)
+++ 	(revision )
@@ -1,556 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_EDMONDS_KARP_H
-#define LEMON_EDMONDS_KARP_H
-
-/// \file
-/// \ingroup max_flow
-/// \brief Implementation of the Edmonds-Karp algorithm.
-
-#include <lemon/tolerance.h>
-#include <vector>
-
-namespace lemon {
-
-  /// \brief Default traits class of EdmondsKarp class.
-  ///
-  /// Default traits class of EdmondsKarp class.
-  /// \param GR Digraph type.
-  /// \param CAP Type of capacity map.
-  template <typename GR, typename CAP>
-  struct EdmondsKarpDefaultTraits {
-
-    /// \brief The digraph type the algorithm runs on.
-    typedef GR Digraph;
-
-    /// \brief The type of the map that stores the arc capacities.
-    ///
-    /// The type of the map that stores the arc capacities.
-    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef CAP CapacityMap;
-
-    /// \brief The type of the flow values.
-    typedef typename CapacityMap::Value Value;
-
-    /// \brief The type of the map that stores the flow values.
-    ///
-    /// The type of the map that stores the flow values.
-    /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
-#ifdef DOXYGEN
-    typedef GR::ArcMap<Value> FlowMap;
-#else
-    typedef typename Digraph::template ArcMap<Value> FlowMap;
-#endif
-
-    /// \brief Instantiates a FlowMap.
-    ///
-    /// This function instantiates a \ref FlowMap.
-    /// \param digraph The digraph for which we would like to define
-    /// the flow map.
-    static FlowMap* createFlowMap(const Digraph& digraph) {
-      return new FlowMap(digraph);
-    }
-
-    /// \brief The tolerance used by the algorithm
-    ///
-    /// The tolerance used by the algorithm to handle inexact computation.
-    typedef lemon::Tolerance<Value> Tolerance;
-
-  };
-
-  /// \ingroup max_flow
-  ///
-  /// \brief Edmonds-Karp algorithms class.
-  ///
-  /// This class provides an implementation of the \e Edmonds-Karp \e
-  /// algorithm producing a \ref max_flow "flow of maximum value" in a
-  /// digraph \cite clrs01algorithms, \cite amo93networkflows,
-  /// \cite edmondskarp72theoretical.
-  /// The Edmonds-Karp algorithm is slower than the Preflow
-  /// algorithm, but it has an advantage of the step-by-step execution
-  /// control with feasible flow solutions. The \e source node, the \e
-  /// target node, the \e capacity of the arcs and the \e starting \e
-  /// flow value of the arcs should be passed to the algorithm
-  /// through the constructor.
-  ///
-  /// The time complexity of the algorithm is \f$ O(nm^2) \f$ in
-  /// worst case. Always try the Preflow algorithm instead of this if
-  /// you just want to compute the optimal flow.
-  ///
-  /// \tparam GR The type of the digraph the algorithm runs on.
-  /// \tparam CAP The type of the capacity map. The default map
-  /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
-  /// \tparam TR The traits class that defines various types used by the
-  /// algorithm. By default, it is \ref EdmondsKarpDefaultTraits
-  /// "EdmondsKarpDefaultTraits<GR, CAP>".
-  /// In most cases, this parameter should not be set directly,
-  /// consider to use the named template parameters instead.
-
-#ifdef DOXYGEN
-  template <typename GR, typename CAP, typename TR>
-#else
-  template <typename GR,
-            typename CAP = typename GR::template ArcMap<int>,
-            typename TR = EdmondsKarpDefaultTraits<GR, CAP> >
-#endif
-  class EdmondsKarp {
-  public:
-
-    /// \brief The \ref lemon::EdmondsKarpDefaultTraits "traits class"
-    /// of the algorithm.
-    typedef TR Traits;
-    /// The type of the digraph the algorithm runs on.
-    typedef typename Traits::Digraph Digraph;
-    /// The type of the capacity map.
-    typedef typename Traits::CapacityMap CapacityMap;
-    /// The type of the flow values.
-    typedef typename Traits::Value Value;
-
-    /// The type of the flow map.
-    typedef typename Traits::FlowMap FlowMap;
-    /// The type of the tolerance.
-    typedef typename Traits::Tolerance Tolerance;
-
-  private:
-
-    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
-    typedef typename Digraph::template NodeMap<Arc> PredMap;
-
-    const Digraph& _graph;
-    const CapacityMap* _capacity;
-
-    Node _source, _target;
-
-    FlowMap* _flow;
-    bool _local_flow;
-
-    PredMap* _pred;
-    std::vector<Node> _queue;
-
-    Tolerance _tolerance;
-    Value _flow_value;
-
-    void createStructures() {
-      if (!_flow) {
-        _flow = Traits::createFlowMap(_graph);
-        _local_flow = true;
-      }
-      if (!_pred) {
-        _pred = new PredMap(_graph);
-      }
-      _queue.resize(countNodes(_graph));
-    }
-
-    void destroyStructures() {
-      if (_local_flow) {
-        delete _flow;
-      }
-      if (_pred) {
-        delete _pred;
-      }
-    }
-
-  public:
-
-    typedef EdmondsKarp Create;
-
-    ///\name Named template parameters
-
-    ///@{
-
-    template <typename T>
-    struct SetFlowMapTraits : public Traits {
-      typedef T FlowMap;
-      static FlowMap *createFlowMap(const Digraph&) {
-        LEMON_ASSERT(false, "FlowMap is not initialized");
-        return 0;
-      }
-    };
-
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// FlowMap type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting FlowMap
-    /// type
-    template <typename T>
-    struct SetFlowMap
-      : public EdmondsKarp<Digraph, CapacityMap, SetFlowMapTraits<T> > {
-      typedef EdmondsKarp<Digraph, CapacityMap, SetFlowMapTraits<T> > Create;
-    };
-
-    /// @}
-
-  protected:
-
-    EdmondsKarp() {}
-
-  public:
-
-    /// \brief The constructor of the class.
-    ///
-    /// The constructor of the class.
-    /// \param digraph The digraph the algorithm runs on.
-    /// \param capacity The capacity of the arcs.
-    /// \param source The source node.
-    /// \param target The target node.
-    EdmondsKarp(const Digraph& digraph, const CapacityMap& capacity,
-                Node source, Node target)
-      : _graph(digraph), _capacity(&capacity), _source(source), _target(target),
-        _flow(0), _local_flow(false), _pred(0), _tolerance(), _flow_value()
-    {
-      LEMON_ASSERT(_source != _target,
-                   "Flow source and target are the same nodes.");
-    }
-
-    /// \brief Destructor.
-    ///
-    /// Destructor.
-    ~EdmondsKarp() {
-      destroyStructures();
-    }
-
-    /// \brief Sets the capacity map.
-    ///
-    /// Sets the capacity map.
-    /// \return <tt>(*this)</tt>
-    EdmondsKarp& capacityMap(const CapacityMap& map) {
-      _capacity = &map;
-      return *this;
-    }
-
-    /// \brief Sets the flow map.
-    ///
-    /// Sets the flow map.
-    /// If you don't use this function before calling \ref run() or
-    /// \ref init(), an instance will be allocated automatically.
-    /// The destructor deallocates this automatically allocated map,
-    /// of course.
-    /// \return <tt>(*this)</tt>
-    EdmondsKarp& flowMap(FlowMap& map) {
-      if (_local_flow) {
-        delete _flow;
-        _local_flow = false;
-      }
-      _flow = &map;
-      return *this;
-    }
-
-    /// \brief Sets the source node.
-    ///
-    /// Sets the source node.
-    /// \return <tt>(*this)</tt>
-    EdmondsKarp& source(const Node& node) {
-      _source = node;
-      return *this;
-    }
-
-    /// \brief Sets the target node.
-    ///
-    /// Sets the target node.
-    /// \return <tt>(*this)</tt>
-    EdmondsKarp& target(const Node& node) {
-      _target = node;
-      return *this;
-    }
-
-    /// \brief Sets the tolerance used by algorithm.
-    ///
-    /// Sets the tolerance used by algorithm.
-    /// \return <tt>(*this)</tt>
-    EdmondsKarp& tolerance(const Tolerance& tolerance) {
-      _tolerance = tolerance;
-      return *this;
-    }
-
-    /// \brief Returns a const reference to the tolerance.
-    ///
-    /// Returns a const reference to the tolerance object used by
-    /// the algorithm.
-    const Tolerance& tolerance() const {
-      return _tolerance;
-    }
-
-    /// \name Execution control
-    /// The simplest way to execute the algorithm is to use \ref run().\n
-    /// If you need better control on the initial solution or the execution,
-    /// you have to call one of the \ref init() functions first, then
-    /// \ref start() or multiple times the \ref augment() function.
-
-    ///@{
-
-    /// \brief Initializes the algorithm.
-    ///
-    /// Initializes the internal data structures and sets the initial
-    /// flow to zero on each arc.
-    void init() {
-      createStructures();
-      for (ArcIt it(_graph); it != INVALID; ++it) {
-        _flow->set(it, 0);
-      }
-      _flow_value = 0;
-    }
-
-    /// \brief Initializes the algorithm using the given flow map.
-    ///
-    /// Initializes the internal data structures and sets the initial
-    /// flow to the given \c flowMap. The \c flowMap should
-    /// contain a feasible flow, i.e. at each node excluding the source
-    /// and the target, the incoming flow should be equal to the
-    /// outgoing flow.
-    template <typename FlowMap>
-    void init(const FlowMap& flowMap) {
-      createStructures();
-      for (ArcIt e(_graph); e != INVALID; ++e) {
-        _flow->set(e, flowMap[e]);
-      }
-      _flow_value = 0;
-      for (OutArcIt jt(_graph, _source); jt != INVALID; ++jt) {
-        _flow_value += (*_flow)[jt];
-      }
-      for (InArcIt jt(_graph, _source); jt != INVALID; ++jt) {
-        _flow_value -= (*_flow)[jt];
-      }
-    }
-
-    /// \brief Initializes the algorithm using the given flow map.
-    ///
-    /// Initializes the internal data structures and sets the initial
-    /// flow to the given \c flowMap. The \c flowMap should
-    /// contain a feasible flow, i.e. at each node excluding the source
-    /// and the target, the incoming flow should be equal to the
-    /// outgoing flow.
-    /// \return \c false when the given \c flowMap does not contain a
-    /// feasible flow.
-    template <typename FlowMap>
-    bool checkedInit(const FlowMap& flowMap) {
-      createStructures();
-      for (ArcIt e(_graph); e != INVALID; ++e) {
-        _flow->set(e, flowMap[e]);
-      }
-      for (NodeIt it(_graph); it != INVALID; ++it) {
-        if (it == _source || it == _target) continue;
-        Value outFlow = 0;
-        for (OutArcIt jt(_graph, it); jt != INVALID; ++jt) {
-          outFlow += (*_flow)[jt];
-        }
-        Value inFlow = 0;
-        for (InArcIt jt(_graph, it); jt != INVALID; ++jt) {
-          inFlow += (*_flow)[jt];
-        }
-        if (_tolerance.different(outFlow, inFlow)) {
-          return false;
-        }
-      }
-      for (ArcIt it(_graph); it != INVALID; ++it) {
-        if (_tolerance.less((*_flow)[it], 0)) return false;
-        if (_tolerance.less((*_capacity)[it], (*_flow)[it])) return false;
-      }
-      _flow_value = 0;
-      for (OutArcIt jt(_graph, _source); jt != INVALID; ++jt) {
-        _flow_value += (*_flow)[jt];
-      }
-      for (InArcIt jt(_graph, _source); jt != INVALID; ++jt) {
-        _flow_value -= (*_flow)[jt];
-      }
-      return true;
-    }
-
-    /// \brief Augments the solution along a shortest path.
-    ///
-    /// Augments the solution along a shortest path. This function searches a
-    /// shortest path between the source and the target
-    /// in the residual digraph by the Bfs algoritm.
-    /// Then it increases the flow on this path with the minimal residual
-    /// capacity on the path. If there is no such path, it gives back
-    /// false.
-    /// \return \c false when the augmenting did not success, i.e. the
-    /// current flow is a feasible and optimal solution.
-    bool augment() {
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        _pred->set(n, INVALID);
-      }
-
-      int first = 0, last = 1;
-
-      _queue[0] = _source;
-      _pred->set(_source, OutArcIt(_graph, _source));
-
-      while (first != last && (*_pred)[_target] == INVALID) {
-        Node n = _queue[first++];
-
-        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
-          Value rem = (*_capacity)[e] - (*_flow)[e];
-          Node t = _graph.target(e);
-          if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
-            _pred->set(t, e);
-            _queue[last++] = t;
-          }
-        }
-        for (InArcIt e(_graph, n); e != INVALID; ++e) {
-          Value rem = (*_flow)[e];
-          Node t = _graph.source(e);
-          if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
-            _pred->set(t, e);
-            _queue[last++] = t;
-          }
-        }
-      }
-
-      if ((*_pred)[_target] != INVALID) {
-        Node n = _target;
-        Arc e = (*_pred)[n];
-
-        Value prem = (*_capacity)[e] - (*_flow)[e];
-        n = _graph.source(e);
-        while (n != _source) {
-          e = (*_pred)[n];
-          if (_graph.target(e) == n) {
-            Value rem = (*_capacity)[e] - (*_flow)[e];
-            if (rem < prem) prem = rem;
-            n = _graph.source(e);
-          } else {
-            Value rem = (*_flow)[e];
-            if (rem < prem) prem = rem;
-            n = _graph.target(e);
-          }
-        }
-
-        n = _target;
-        e = (*_pred)[n];
-
-        _flow->set(e, (*_flow)[e] + prem);
-        n = _graph.source(e);
-        while (n != _source) {
-          e = (*_pred)[n];
-          if (_graph.target(e) == n) {
-            _flow->set(e, (*_flow)[e] + prem);
-            n = _graph.source(e);
-          } else {
-            _flow->set(e, (*_flow)[e] - prem);
-            n = _graph.target(e);
-          }
-        }
-
-        _flow_value += prem;
-        return true;
-      } else {
-        return false;
-      }
-    }
-
-    /// \brief Executes the algorithm
-    ///
-    /// Executes the algorithm by performing augmenting phases until the
-    /// optimal solution is reached.
-    /// \pre One of the \ref init() functions must be called before
-    /// using this function.
-    void start() {
-      while (augment()) {}
-    }
-
-    /// \brief Runs the algorithm.
-    ///
-    /// Runs the Edmonds-Karp algorithm.
-    /// \note ek.run() is just a shortcut of the following code.
-    ///\code
-    /// ek.init();
-    /// ek.start();
-    ///\endcode
-    void run() {
-      init();
-      start();
-    }
-
-    /// @}
-
-    /// \name Query Functions
-    /// The result of the Edmonds-Karp algorithm can be obtained using these
-    /// functions.\n
-    /// Either \ref run() or \ref start() should be called before using them.
-
-    ///@{
-
-    /// \brief Returns the value of the maximum flow.
-    ///
-    /// Returns the value of the maximum flow found by the algorithm.
-    ///
-    /// \pre Either \ref run() or \ref init() must be called before
-    /// using this function.
-    Value flowValue() const {
-      return _flow_value;
-    }
-
-    /// \brief Returns the flow value on the given arc.
-    ///
-    /// Returns the flow value on the given arc.
-    ///
-    /// \pre Either \ref run() or \ref init() must be called before
-    /// using this function.
-    Value flow(const Arc& arc) const {
-      return (*_flow)[arc];
-    }
-
-    /// \brief Returns a const reference to the flow map.
-    ///
-    /// Returns a const reference to the arc map storing the found flow.
-    ///
-    /// \pre Either \ref run() or \ref init() must be called before
-    /// using this function.
-    const FlowMap& flowMap() const {
-      return *_flow;
-    }
-
-    /// \brief Returns \c true when the node is on the source side of the
-    /// minimum cut.
-    ///
-    /// Returns true when the node is on the source side of the found
-    /// minimum cut.
-    ///
-    /// \pre Either \ref run() or \ref init() must be called before
-    /// using this function.
-    bool minCut(const Node& node) const {
-      return ((*_pred)[node] != INVALID) || node == _source;
-    }
-
-    /// \brief Gives back a minimum value cut.
-    ///
-    /// Sets \c cutMap to the characteristic vector of a minimum value
-    /// cut. \c cutMap should be a \ref concepts::WriteMap "writable"
-    /// node map with \c bool (or convertible) value type.
-    ///
-    /// \note This function calls \ref minCut() for each node, so it runs in
-    /// O(n) time.
-    ///
-    /// \pre Either \ref run() or \ref init() must be called before
-    /// using this function.
-    template <typename CutMap>
-    void minCutMap(CutMap& cutMap) const {
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        cutMap.set(n, (*_pred)[n] != INVALID);
-      }
-      cutMap.set(_source, true);
-    }
-
-    /// @}
-
-  };
-
-}
-
-#endif
Index: lemon/euler.h
===================================================================
--- lemon/euler.h	(revision 1270)
+++ lemon/euler.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -37,5 +37,5 @@
   ///Euler tour iterator for digraphs.
 
-  /// \ingroup graph_properties
+  /// \ingroup graph_prop
   ///This iterator provides an Euler tour (Eulerian circuit) of a \e directed
   ///graph (if there exists) and it converts to the \c Arc type of the digraph.
Index: lemon/fractional_matching.h
===================================================================
--- lemon/fractional_matching.h	(revision 1270)
+++ lemon/fractional_matching.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -124,6 +124,6 @@
   public:
 
-    /// \brief The \ref lemon::MaxFractionalMatchingDefaultTraits
-    /// "traits class" of the algorithm.
+    /// \brief The \ref MaxFractionalMatchingDefaultTraits "traits
+    /// class" of the algorithm.
     typedef TR Traits;
     /// The type of the graph the algorithm runs on.
Index: lemon/full_graph.h
===================================================================
--- lemon/full_graph.h	(revision 1270)
+++ lemon/full_graph.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -622,458 +622,4 @@
   };
 
-  class FullBpGraphBase {
-
-  protected:
-
-    int _red_num, _blue_num;
-    int _node_num, _edge_num;
-
-  public:
-
-    typedef FullBpGraphBase Graph;
-
-    class Node;
-    class Arc;
-    class Edge;
-
-    class Node {
-      friend class FullBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Node(int id) { _id = id;}
-
-    public:
-      Node() {}
-      Node (Invalid) { _id = -1; }
-      bool operator==(const Node& node) const {return _id == node._id;}
-      bool operator!=(const Node& node) const {return _id != node._id;}
-      bool operator<(const Node& node) const {return _id < node._id;}
-    };
-
-    class RedNode : public Node {
-      friend class FullBpGraphBase;
-    protected:
-
-      explicit RedNode(int pid) : Node(pid) {}
-
-    public:
-      RedNode() {}
-      RedNode(const RedNode& node) : Node(node) {}
-      RedNode(Invalid) : Node(INVALID){}
-    };
-
-    class BlueNode : public Node {
-      friend class FullBpGraphBase;
-    protected:
-
-      explicit BlueNode(int pid) : Node(pid) {}
-
-    public:
-      BlueNode() {}
-      BlueNode(const BlueNode& node) : Node(node) {}
-      BlueNode(Invalid) : Node(INVALID){}
-    };
-
-    class Edge {
-      friend class FullBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Edge(int id) { _id = id;}
-
-    public:
-      Edge() {}
-      Edge (Invalid) { _id = -1; }
-      bool operator==(const Edge& arc) const {return _id == arc._id;}
-      bool operator!=(const Edge& arc) const {return _id != arc._id;}
-      bool operator<(const Edge& arc) const {return _id < arc._id;}
-    };
-
-    class Arc {
-      friend class FullBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Arc(int id) { _id = id;}
-
-    public:
-      operator Edge() const {
-        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
-      }
-
-      Arc() {}
-      Arc (Invalid) { _id = -1; }
-      bool operator==(const Arc& arc) const {return _id == arc._id;}
-      bool operator!=(const Arc& arc) const {return _id != arc._id;}
-      bool operator<(const Arc& arc) const {return _id < arc._id;}
-    };
-
-
-  protected:
-
-    FullBpGraphBase()
-      : _red_num(0), _blue_num(0), _node_num(0), _edge_num(0) {}
-
-    void construct(int redNum, int blueNum) {
-      _red_num = redNum; _blue_num = blueNum;
-      _node_num = redNum + blueNum; _edge_num = redNum * blueNum;
-    }
-
-  public:
-
-    typedef True NodeNumTag;
-    typedef True EdgeNumTag;
-    typedef True ArcNumTag;
-
-    int nodeNum() const { return _node_num; }
-    int redNum() const { return _red_num; }
-    int blueNum() const { return _blue_num; }
-    int edgeNum() const { return _edge_num; }
-    int arcNum() const { return 2 * _edge_num; }
-
-    int maxNodeId() const { return _node_num - 1; }
-    int maxRedId() const { return _red_num - 1; }
-    int maxBlueId() const { return _blue_num - 1; }
-    int maxEdgeId() const { return _edge_num - 1; }
-    int maxArcId() const { return 2 * _edge_num - 1; }
-
-    bool red(Node n) const { return n._id < _red_num; }
-    bool blue(Node n) const { return n._id >= _red_num; }
-
-    static RedNode asRedNodeUnsafe(Node n) { return RedNode(n._id); }
-    static BlueNode asBlueNodeUnsafe(Node n) { return BlueNode(n._id); }
-
-    Node source(Arc a) const {
-      if (a._id & 1) {
-        return Node((a._id >> 1) % _red_num);
-      } else {
-        return Node((a._id >> 1) / _red_num + _red_num);
-      }
-    }
-    Node target(Arc a) const {
-      if (a._id & 1) {
-        return Node((a._id >> 1) / _red_num + _red_num);
-      } else {
-        return Node((a._id >> 1) % _red_num);
-      }
-    }
-
-    RedNode redNode(Edge e) const {
-      return RedNode(e._id % _red_num);
-    }
-    BlueNode blueNode(Edge e) const {
-      return BlueNode(e._id / _red_num + _red_num);
-    }
-
-    static bool direction(Arc a) {
-      return (a._id & 1) == 1;
-    }
-
-    static Arc direct(Edge e, bool d) {
-      return Arc(e._id * 2 + (d ? 1 : 0));
-    }
-
-    void first(Node& node) const {
-      node._id = _node_num - 1;
-    }
-
-    static void next(Node& node) {
-      --node._id;
-    }
-
-    void first(RedNode& node) const {
-      node._id = _red_num - 1;
-    }
-
-    static void next(RedNode& node) {
-      --node._id;
-    }
-
-    void first(BlueNode& node) const {
-      if (_red_num == _node_num) node._id = -1;
-      else node._id = _node_num - 1;
-    }
-
-    void next(BlueNode& node) const {
-      if (node._id == _red_num) node._id = -1;
-      else --node._id;
-    }
-
-    void first(Arc& arc) const {
-      arc._id = 2 * _edge_num - 1;
-    }
-
-    static void next(Arc& arc) {
-      --arc._id;
-    }
-
-    void first(Edge& arc) const {
-      arc._id = _edge_num - 1;
-    }
-
-    static void next(Edge& arc) {
-      --arc._id;
-    }
-
-    void firstOut(Arc &a, const Node& v) const {
-      if (v._id < _red_num) {
-        a._id = 2 * (v._id + _red_num * (_blue_num - 1)) + 1;
-      } else {
-        a._id = 2 * (_red_num - 1 + _red_num * (v._id - _red_num));
-      }
-    }
-    void nextOut(Arc &a) const {
-      if (a._id & 1) {
-        a._id -= 2 * _red_num;
-        if (a._id < 0) a._id = -1;
-      } else {
-        if (a._id % (2 * _red_num) == 0) a._id = -1;
-        else a._id -= 2;
-      }
-    }
-
-    void firstIn(Arc &a, const Node& v) const {
-      if (v._id < _red_num) {
-        a._id = 2 * (v._id + _red_num * (_blue_num - 1));
-      } else {
-        a._id = 2 * (_red_num - 1 + _red_num * (v._id - _red_num)) + 1;
-      }
-    }
-    void nextIn(Arc &a) const {
-      if (a._id & 1) {
-        if (a._id % (2 * _red_num) == 1) a._id = -1;
-        else a._id -= 2;
-      } else {
-        a._id -= 2 * _red_num;
-        if (a._id < 0) a._id = -1;
-      }
-    }
-
-    void firstInc(Edge &e, bool& d, const Node& v) const {
-      if (v._id < _red_num) {
-        d = true;
-        e._id = v._id + _red_num * (_blue_num - 1);
-      } else {
-        d = false;
-        e._id = _red_num - 1 + _red_num * (v._id - _red_num);
-      }
-    }
-    void nextInc(Edge &e, bool& d) const {
-      if (d) {
-        e._id -= _red_num;
-        if (e._id < 0) e._id = -1;
-      } else {
-        if (e._id % _red_num == 0) e._id = -1;
-        else --e._id;
-      }
-    }
-
-    static int id(const Node& v) { return v._id; }
-    int id(const RedNode& v) const { return v._id; }
-    int id(const BlueNode& v) const { return v._id - _red_num; }
-    static int id(Arc e) { return e._id; }
-    static int id(Edge e) { return e._id; }
-
-    static Node nodeFromId(int id) { return Node(id);}
-    static Arc arcFromId(int id) { return Arc(id);}
-    static Edge edgeFromId(int id) { return Edge(id);}
-
-    bool valid(Node n) const {
-      return n._id >= 0 && n._id < _node_num;
-    }
-    bool valid(Arc a) const {
-      return a._id >= 0 && a._id < 2 * _edge_num;
-    }
-    bool valid(Edge e) const {
-      return e._id >= 0 && e._id < _edge_num;
-    }
-
-    RedNode redNode(int index) const {
-      return RedNode(index);
-    }
-
-    int index(RedNode n) const {
-      return n._id;
-    }
-
-    BlueNode blueNode(int index) const {
-      return BlueNode(index + _red_num);
-    }
-
-    int index(BlueNode n) const {
-      return n._id - _red_num;
-    }
-
-    void clear() {
-      _red_num = 0; _blue_num = 0;
-      _node_num = 0; _edge_num = 0;
-    }
-
-    Edge edge(const Node& u, const Node& v) const {
-      if (u._id < _red_num) {
-        if (v._id < _red_num) {
-          return Edge(-1);
-        } else {
-          return Edge(u._id + _red_num * (v._id - _red_num));
-        }
-      } else {
-        if (v._id < _red_num) {
-          return Edge(v._id + _red_num * (u._id - _red_num));
-        } else {
-          return Edge(-1);
-        }
-      }
-    }
-
-    Arc arc(const Node& u, const Node& v) const {
-      if (u._id < _red_num) {
-        if (v._id < _red_num) {
-          return Arc(-1);
-        } else {
-          return Arc(2 * (u._id + _red_num * (v._id - _red_num)) + 1);
-        }
-      } else {
-        if (v._id < _red_num) {
-          return Arc(2 * (v._id + _red_num * (u._id - _red_num)));
-        } else {
-          return Arc(-1);
-        }
-      }
-    }
-
-    typedef True FindEdgeTag;
-    typedef True FindArcTag;
-
-    Edge findEdge(Node u, Node v, Edge prev = INVALID) const {
-      return prev != INVALID ? INVALID : edge(u, v);
-    }
-
-    Arc findArc(Node s, Node t, Arc prev = INVALID) const {
-      return prev != INVALID ? INVALID : arc(s, t);
-    }
-
-  };
-
-  typedef BpGraphExtender<FullBpGraphBase> ExtendedFullBpGraphBase;
-
-  /// \ingroup graphs
-  ///
-  /// \brief An undirected full bipartite graph class.
-  ///
-  /// FullBpGraph is a simple and fast implmenetation of undirected
-  /// full bipartite graphs. It contains an edge between every
-  /// red-blue pairs of nodes, therefore the number of edges is
-  /// <tt>nr*nb</tt>.  This class is completely static and it needs
-  /// constant memory space.  Thus you can neither add nor delete
-  /// nodes or edges, however the structure can be resized using
-  /// resize().
-  ///
-  /// This type fully conforms to the \ref concepts::BpGraph "BpGraph concept".
-  /// Most of its member functions and nested classes are documented
-  /// only in the concept class.
-  ///
-  /// This class provides constant time counting for nodes, edges and arcs.
-  ///
-  /// \sa FullGraph
-  class FullBpGraph : public ExtendedFullBpGraphBase {
-  public:
-
-    typedef ExtendedFullBpGraphBase Parent;
-
-    /// \brief Default constructor.
-    ///
-    /// Default constructor. The number of nodes and edges will be zero.
-    FullBpGraph() { construct(0, 0); }
-
-    /// \brief Constructor
-    ///
-    /// Constructor.
-    /// \param redNum The number of the red nodes.
-    /// \param blueNum The number of the blue nodes.
-    FullBpGraph(int redNum, int blueNum) { construct(redNum, blueNum); }
-
-    /// \brief Resizes the graph
-    ///
-    /// This function resizes the graph. It fully destroys and
-    /// rebuilds the structure, therefore the maps of the graph will be
-    /// reallocated automatically and the previous values will be lost.
-    void resize(int redNum, int blueNum) {
-      Parent::notifier(Arc()).clear();
-      Parent::notifier(Edge()).clear();
-      Parent::notifier(Node()).clear();
-      Parent::notifier(BlueNode()).clear();
-      Parent::notifier(RedNode()).clear();
-      construct(redNum, blueNum);
-      Parent::notifier(RedNode()).build();
-      Parent::notifier(BlueNode()).build();
-      Parent::notifier(Node()).build();
-      Parent::notifier(Edge()).build();
-      Parent::notifier(Arc()).build();
-    }
-
-    using Parent::redNode;
-    using Parent::blueNode;
-
-    /// \brief Returns the red node with the given index.
-    ///
-    /// Returns the red node with the given index. Since this
-    /// structure is completely static, the red nodes can be indexed
-    /// with integers from the range <tt>[0..redNum()-1]</tt>.
-    /// \sa redIndex()
-    RedNode redNode(int index) const { return Parent::redNode(index); }
-
-    /// \brief Returns the index of the given red node.
-    ///
-    /// Returns the index of the given red node. Since this structure
-    /// is completely static, the red nodes can be indexed with
-    /// integers from the range <tt>[0..redNum()-1]</tt>.
-    ///
-    /// \sa operator()()
-    int index(RedNode node) const { return Parent::index(node); }
-
-    /// \brief Returns the blue node with the given index.
-    ///
-    /// Returns the blue node with the given index. Since this
-    /// structure is completely static, the blue nodes can be indexed
-    /// with integers from the range <tt>[0..blueNum()-1]</tt>.
-    /// \sa blueIndex()
-    BlueNode blueNode(int index) const { return Parent::blueNode(index); }
-
-    /// \brief Returns the index of the given blue node.
-    ///
-    /// Returns the index of the given blue node. Since this structure
-    /// is completely static, the blue nodes can be indexed with
-    /// integers from the range <tt>[0..blueNum()-1]</tt>.
-    ///
-    /// \sa operator()()
-    int index(BlueNode node) const { return Parent::index(node); }
-
-    /// \brief Returns the edge which connects the given nodes.
-    ///
-    /// Returns the edge which connects the given nodes.
-    Edge edge(const Node& u, const Node& v) const {
-      return Parent::edge(u, v);
-    }
-
-    /// \brief Returns the arc which connects the given nodes.
-    ///
-    /// Returns the arc which connects the given nodes.
-    Arc arc(const Node& u, const Node& v) const {
-      return Parent::arc(u, v);
-    }
-
-    /// \brief Number of nodes.
-    int nodeNum() const { return Parent::nodeNum(); }
-    /// \brief Number of red nodes.
-    int redNum() const { return Parent::redNum(); }
-    /// \brief Number of blue nodes.
-    int blueNum() const { return Parent::blueNum(); }
-    /// \brief Number of arcs.
-    int arcNum() const { return Parent::arcNum(); }
-    /// \brief Number of edges.
-    int edgeNum() const { return Parent::edgeNum(); }
-  };
-
 
 } //namespace lemon
Index: lemon/glpk.cc
===================================================================
--- lemon/glpk.cc	(revision 1270)
+++ lemon/glpk.cc	(revision 1142)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -581,13 +581,4 @@
       break;
     }
-  }
-
-  void GlpkBase::_write(std::string file, std::string format) const
-  {
-    if(format == "MPS")
-      glp_write_mps(lp, GLP_MPS_FILE, 0, file.c_str());
-    else if(format == "LP")
-      glp_write_lp(lp, 0, file.c_str());
-    else throw UnsupportedFormatError(format);
   }
 
@@ -1008,5 +999,3 @@
   const char* GlpkMip::_solverName() const { return "GlpkMip"; }
 
-
-
 } //END OF NAMESPACE LEMON
Index: lemon/glpk.h
===================================================================
--- lemon/glpk.h	(revision 1270)
+++ lemon/glpk.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -116,6 +116,4 @@
     virtual void _messageLevel(MessageLevel level);
 
-    virtual void _write(std::string file, std::string format) const;
-
   private:
 
@@ -147,17 +145,4 @@
     int lpxCol(Col c) const { return cols(id(c)); }
 
-#ifdef DOXYGEN
-    /// Write the problem or the solution to a file in the given format
-
-    /// This function writes the problem or the solution
-    /// to a file in the given format.
-    /// Trying to write in an unsupported format will trigger
-    /// \ref LpBase::UnsupportedFormatError.
-    /// \param file The file path
-    /// \param format The output file format.
-    /// Supportted formats are "MPS" and "LP".
-    void write(std::string file, std::string format = "MPS") const {}
-#endif
-
   };
 
Index: lemon/gomory_hu.h
===================================================================
--- lemon/gomory_hu.h	(revision 1270)
+++ lemon/gomory_hu.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -47,5 +47,5 @@
   ///
   /// The algorithm calculates \e n-1 distinct minimum cuts (currently with
-  /// the \ref Preflow algorithm), thus it has \f$O(n^3\sqrt{m})\f$ overall
+  /// the \ref Preflow algorithm), thus it has \f$O(n^3\sqrt{e})\f$ overall
   /// time complexity. It calculates a rooted Gomory-Hu tree.
   /// The structure of the tree and the edge weights can be
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 1270)
+++ lemon/graph_to_eps.h	(revision 1249)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/greedy_tsp.h
===================================================================
--- lemon/greedy_tsp.h	(revision 1270)
+++ 	(revision )
@@ -1,251 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_GREEDY_TSP_H
-#define LEMON_GREEDY_TSP_H
-
-/// \ingroup tsp
-/// \file
-/// \brief Greedy algorithm for symmetric TSP
-
-#include <vector>
-#include <algorithm>
-#include <lemon/full_graph.h>
-#include <lemon/unionfind.h>
-
-namespace lemon {
-
-  /// \ingroup tsp
-  ///
-  /// \brief Greedy algorithm for symmetric TSP.
-  ///
-  /// GreedyTsp implements the greedy heuristic for solving
-  /// symmetric \ref tsp "TSP".
-  ///
-  /// This algorithm is quite similar to the \ref NearestNeighborTsp
-  /// "nearest neighbor" heuristic, but it maintains a set of disjoint paths.
-  /// At each step, the shortest possible edge is added to these paths
-  /// as long as it does not create a cycle of less than n edges and it does
-  /// not increase the degree of any node above two.
-  ///
-  /// This method runs in O(n<sup>2</sup>) time.
-  /// It quickly finds a relatively short tour for most TSP instances,
-  /// but it could also yield a really bad (or even the worst) solution
-  /// in special cases.
-  ///
-  /// \tparam CM Type of the cost map.
-  template <typename CM>
-  class GreedyTsp
-  {
-    public:
-
-      /// Type of the cost map
-      typedef CM CostMap;
-      /// Type of the edge costs
-      typedef typename CM::Value Cost;
-
-    private:
-
-      GRAPH_TYPEDEFS(FullGraph);
-
-      const FullGraph &_gr;
-      const CostMap &_cost;
-      Cost _sum;
-      std::vector<Node> _path;
-
-    private:
-
-      // Functor class to compare edges by their costs
-      class EdgeComp {
-      private:
-        const CostMap &_cost;
-
-      public:
-        EdgeComp(const CostMap &cost) : _cost(cost) {}
-
-        bool operator()(const Edge &a, const Edge &b) const {
-          return _cost[a] < _cost[b];
-        }
-      };
-
-    public:
-
-      /// \brief Constructor
-      ///
-      /// Constructor.
-      /// \param gr The \ref FullGraph "full graph" the algorithm runs on.
-      /// \param cost The cost map.
-      GreedyTsp(const FullGraph &gr, const CostMap &cost)
-        : _gr(gr), _cost(cost) {}
-
-      /// \name Execution Control
-      /// @{
-
-      /// \brief Runs the algorithm.
-      ///
-      /// This function runs the algorithm.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run() {
-        _path.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-
-        std::vector<int> plist;
-        plist.resize(_gr.nodeNum()*2, -1);
-
-        std::vector<Edge> sorted_edges;
-        sorted_edges.reserve(_gr.edgeNum());
-        for (EdgeIt e(_gr); e != INVALID; ++e)
-          sorted_edges.push_back(e);
-        std::sort(sorted_edges.begin(), sorted_edges.end(), EdgeComp(_cost));
-
-        FullGraph::NodeMap<int> item_int_map(_gr);
-        UnionFind<FullGraph::NodeMap<int> > union_find(item_int_map);
-        for (NodeIt n(_gr); n != INVALID; ++n)
-          union_find.insert(n);
-
-        FullGraph::NodeMap<int> degree(_gr, 0);
-
-        int nodesNum = 0, i = 0;
-        while (nodesNum != _gr.nodeNum()-1) {
-          Edge e = sorted_edges[i++];
-          Node u = _gr.u(e),
-               v = _gr.v(e);
-
-          if (degree[u] <= 1 && degree[v] <= 1) {
-            if (union_find.join(u, v)) {
-              const int uid = _gr.id(u),
-                        vid = _gr.id(v);
-
-              plist[uid*2 + degree[u]] = vid;
-              plist[vid*2 + degree[v]] = uid;
-
-              ++degree[u];
-              ++degree[v];
-              ++nodesNum;
-            }
-          }
-        }
-
-        for (int i=0, n=-1; i<_gr.nodeNum()*2; ++i) {
-          if (plist[i] == -1) {
-            if (n==-1) {
-              n = i;
-            } else {
-              plist[n] = i/2;
-              plist[i] = n/2;
-              break;
-            }
-          }
-        }
-
-        for (int i=0, next=0, last=-1; i!=_gr.nodeNum(); ++i) {
-          _path.push_back(_gr.nodeFromId(next));
-          if (plist[2*next] != last) {
-            last = next;
-            next = plist[2*next];
-          } else {
-            last = next;
-            next = plist[2*next+1];
-          }
-        }
-
-        _sum = _cost[_gr.edge(_path.back(), _path.front())];
-        for (int i = 0; i < int(_path.size())-1; ++i) {
-          _sum += _cost[_gr.edge(_path[i], _path[i+1])];
-        }
-
-        return _sum;
-      }
-
-      /// @}
-
-      /// \name Query Functions
-      /// @{
-
-      /// \brief The total cost of the found tour.
-      ///
-      /// This function returns the total cost of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      Cost tourCost() const {
-        return _sum;
-      }
-
-      /// \brief Returns a const reference to the node sequence of the
-      /// found tour.
-      ///
-      /// This function returns a const reference to a vector
-      /// that stores the node sequence of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      const std::vector<Node>& tourNodes() const {
-        return _path;
-      }
-
-      /// \brief Gives back the node sequence of the found tour.
-      ///
-      /// This function copies the node sequence of the found tour into
-      /// an STL container through the given output iterator. The
-      /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
-      /// For example,
-      /// \code
-      /// std::vector<FullGraph::Node> nodes(countNodes(graph));
-      /// tsp.tourNodes(nodes.begin());
-      /// \endcode
-      /// or
-      /// \code
-      /// std::list<FullGraph::Node> nodes;
-      /// tsp.tourNodes(std::back_inserter(nodes));
-      /// \endcode
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Iterator>
-      void tourNodes(Iterator out) const {
-        std::copy(_path.begin(), _path.end(), out);
-      }
-
-      /// \brief Gives back the found tour as a path.
-      ///
-      /// This function copies the found tour as a list of arcs/edges into
-      /// the given \ref lemon::concepts::Path "path structure".
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Path>
-      void tour(Path &path) const {
-        path.clear();
-        for (int i = 0; i < int(_path.size()) - 1; ++i) {
-          path.addBack(_gr.arc(_path[i], _path[i+1]));
-        }
-        if (int(_path.size()) >= 2) {
-          path.addBack(_gr.arc(_path.back(), _path.front()));
-        }
-      }
-
-      /// @}
-
-  };
-
-}; // namespace lemon
-
-#endif
Index: lemon/grosso_locatelli_pullan_mc.h
===================================================================
--- lemon/grosso_locatelli_pullan_mc.h	(revision 1270)
+++ 	(revision )
@@ -1,840 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_GROSSO_LOCATELLI_PULLAN_MC_H
-#define LEMON_GROSSO_LOCATELLI_PULLAN_MC_H
-
-/// \ingroup approx_algs
-///
-/// \file
-/// \brief The iterated local search algorithm of Grosso, Locatelli, and Pullan
-/// for the maximum clique problem
-
-#include <vector>
-#include <limits>
-#include <lemon/core.h>
-#include <lemon/random.h>
-
-namespace lemon {
-
-  /// \addtogroup approx_algs
-  /// @{
-
-  /// \brief Implementation of the iterated local search algorithm of Grosso,
-  /// Locatelli, and Pullan for the maximum clique problem
-  ///
-  /// \ref GrossoLocatelliPullanMc implements the iterated local search
-  /// algorithm of Grosso, Locatelli, and Pullan for solving the \e maximum
-  /// \e clique \e problem \cite grosso08maxclique.
-  /// It is to find the largest complete subgraph (\e clique) in an
-  /// undirected graph, i.e., the largest set of nodes where each
-  /// pair of nodes is connected.
-  ///
-  /// This class provides a simple but highly efficient and robust heuristic
-  /// method that quickly finds a quite large clique, but not necessarily the
-  /// largest one.
-  /// The algorithm performs a certain number of iterations to find several
-  /// cliques and selects the largest one among them. Various limits can be
-  /// specified to control the running time and the effectiveness of the
-  /// search process.
-  ///
-  /// \tparam GR The undirected graph type the algorithm runs on.
-  ///
-  /// \note %GrossoLocatelliPullanMc provides three different node selection
-  /// rules, from which the most powerful one is used by default.
-  /// For more information, see \ref SelectionRule.
-  template <typename GR>
-  class GrossoLocatelliPullanMc
-  {
-  public:
-
-    /// \brief Constants for specifying the node selection rule.
-    ///
-    /// Enum type containing constants for specifying the node selection rule
-    /// for the \ref run() function.
-    ///
-    /// During the algorithm, nodes are selected for addition to the current
-    /// clique according to the applied rule.
-    /// In general, the PENALTY_BASED rule turned out to be the most powerful
-    /// and the most robust, thus it is the default option.
-    /// However, another selection rule can be specified using the \ref run()
-    /// function with the proper parameter.
-    enum SelectionRule {
-
-      /// A node is selected randomly without any evaluation at each step.
-      RANDOM,
-
-      /// A node of maximum degree is selected randomly at each step.
-      DEGREE_BASED,
-
-      /// A node of minimum penalty is selected randomly at each step.
-      /// The node penalties are updated adaptively after each stage of the
-      /// search process.
-      PENALTY_BASED
-    };
-
-    /// \brief Constants for the causes of search termination.
-    ///
-    /// Enum type containing constants for the different causes of search
-    /// termination. The \ref run() function returns one of these values.
-    enum TerminationCause {
-
-      /// The iteration count limit is reached.
-      ITERATION_LIMIT,
-
-      /// The step count limit is reached.
-      STEP_LIMIT,
-
-      /// The clique size limit is reached.
-      SIZE_LIMIT
-    };
-
-  private:
-
-    TEMPLATE_GRAPH_TYPEDEFS(GR);
-
-    typedef std::vector<int> IntVector;
-    typedef std::vector<char> BoolVector;
-    typedef std::vector<BoolVector> BoolMatrix;
-    // Note: vector<char> is used instead of vector<bool> for efficiency reasons
-
-    // The underlying graph
-    const GR &_graph;
-    IntNodeMap _id;
-
-    // Internal matrix representation of the graph
-    BoolMatrix _gr;
-    int _n;
-
-    // Search options
-    bool _delta_based_restart;
-    int _restart_delta_limit;
-
-    // Search limits
-    int _iteration_limit;
-    int _step_limit;
-    int _size_limit;
-
-    // The current clique
-    BoolVector _clique;
-    int _size;
-
-    // The best clique found so far
-    BoolVector _best_clique;
-    int _best_size;
-
-    // The "distances" of the nodes from the current clique.
-    // _delta[u] is the number of nodes in the clique that are
-    // not connected with u.
-    IntVector _delta;
-
-    // The current tabu set
-    BoolVector _tabu;
-
-    // Random number generator
-    Random _rnd;
-
-  private:
-
-    // Implementation of the RANDOM node selection rule.
-    class RandomSelectionRule
-    {
-    private:
-
-      // References to the algorithm instance
-      const BoolVector &_clique;
-      const IntVector  &_delta;
-      const BoolVector &_tabu;
-      Random &_rnd;
-
-      // Pivot rule data
-      int _n;
-
-    public:
-
-      // Constructor
-      RandomSelectionRule(GrossoLocatelliPullanMc &mc) :
-        _clique(mc._clique), _delta(mc._delta), _tabu(mc._tabu),
-        _rnd(mc._rnd), _n(mc._n)
-      {}
-
-      // Return a node index for a feasible add move or -1 if no one exists
-      int nextFeasibleAddNode() const {
-        int start_node = _rnd[_n];
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0 && !_tabu[i]) return i;
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0 && !_tabu[i]) return i;
-        }
-        return -1;
-      }
-
-      // Return a node index for a feasible swap move or -1 if no one exists
-      int nextFeasibleSwapNode() const {
-        int start_node = _rnd[_n];
-        for (int i = start_node; i != _n; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i]) return i;
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i]) return i;
-        }
-        return -1;
-      }
-
-      // Return a node index for an add move or -1 if no one exists
-      int nextAddNode() const {
-        int start_node = _rnd[_n];
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0) return i;
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0) return i;
-        }
-        return -1;
-      }
-
-      // Update internal data structures between stages (if necessary)
-      void update() {}
-
-    }; //class RandomSelectionRule
-
-
-    // Implementation of the DEGREE_BASED node selection rule.
-    class DegreeBasedSelectionRule
-    {
-    private:
-
-      // References to the algorithm instance
-      const BoolVector &_clique;
-      const IntVector  &_delta;
-      const BoolVector &_tabu;
-      Random &_rnd;
-
-      // Pivot rule data
-      int _n;
-      IntVector _deg;
-
-    public:
-
-      // Constructor
-      DegreeBasedSelectionRule(GrossoLocatelliPullanMc &mc) :
-        _clique(mc._clique), _delta(mc._delta), _tabu(mc._tabu),
-        _rnd(mc._rnd), _n(mc._n), _deg(_n)
-      {
-        for (int i = 0; i != _n; i++) {
-          int d = 0;
-          BoolVector &row = mc._gr[i];
-          for (int j = 0; j != _n; j++) {
-            if (row[j]) d++;
-          }
-          _deg[i] = d;
-        }
-      }
-
-      // Return a node index for a feasible add move or -1 if no one exists
-      int nextFeasibleAddNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, max_deg = -1;
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0 && !_tabu[i] && _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0 && !_tabu[i] && _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        return node;
-      }
-
-      // Return a node index for a feasible swap move or -1 if no one exists
-      int nextFeasibleSwapNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, max_deg = -1;
-        for (int i = start_node; i != _n; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i] &&
-              _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i] &&
-              _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        return node;
-      }
-
-      // Return a node index for an add move or -1 if no one exists
-      int nextAddNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, max_deg = -1;
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0 && _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0 && _deg[i] > max_deg) {
-            node = i;
-            max_deg = _deg[i];
-          }
-        }
-        return node;
-      }
-
-      // Update internal data structures between stages (if necessary)
-      void update() {}
-
-    }; //class DegreeBasedSelectionRule
-
-
-    // Implementation of the PENALTY_BASED node selection rule.
-    class PenaltyBasedSelectionRule
-    {
-    private:
-
-      // References to the algorithm instance
-      const BoolVector &_clique;
-      const IntVector  &_delta;
-      const BoolVector &_tabu;
-      Random &_rnd;
-
-      // Pivot rule data
-      int _n;
-      IntVector _penalty;
-
-    public:
-
-      // Constructor
-      PenaltyBasedSelectionRule(GrossoLocatelliPullanMc &mc) :
-        _clique(mc._clique), _delta(mc._delta), _tabu(mc._tabu),
-        _rnd(mc._rnd), _n(mc._n), _penalty(_n, 0)
-      {}
-
-      // Return a node index for a feasible add move or -1 if no one exists
-      int nextFeasibleAddNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, min_p = std::numeric_limits<int>::max();
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0 && !_tabu[i] && _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0 && !_tabu[i] && _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        return node;
-      }
-
-      // Return a node index for a feasible swap move or -1 if no one exists
-      int nextFeasibleSwapNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, min_p = std::numeric_limits<int>::max();
-        for (int i = start_node; i != _n; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i] &&
-              _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (!_clique[i] && _delta[i] == 1 && !_tabu[i] &&
-              _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        return node;
-      }
-
-      // Return a node index for an add move or -1 if no one exists
-      int nextAddNode() const {
-        int start_node = _rnd[_n];
-        int node = -1, min_p = std::numeric_limits<int>::max();
-        for (int i = start_node; i != _n; i++) {
-          if (_delta[i] == 0 && _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        for (int i = 0; i != start_node; i++) {
-          if (_delta[i] == 0 && _penalty[i] < min_p) {
-            node = i;
-            min_p = _penalty[i];
-          }
-        }
-        return node;
-      }
-
-      // Update internal data structures between stages (if necessary)
-      void update() {}
-
-    }; //class PenaltyBasedSelectionRule
-
-  public:
-
-    /// \brief Constructor.
-    ///
-    /// Constructor.
-    /// The global \ref rnd "random number generator instance" is used
-    /// during the algorithm.
-    ///
-    /// \param graph The undirected graph the algorithm runs on.
-    GrossoLocatelliPullanMc(const GR& graph) :
-      _graph(graph), _id(_graph), _rnd(rnd)
-    {
-      initOptions();
-    }
-
-    /// \brief Constructor with random seed.
-    ///
-    /// Constructor with random seed.
-    ///
-    /// \param graph The undirected graph the algorithm runs on.
-    /// \param seed Seed value for the internal random number generator
-    /// that is used during the algorithm.
-    GrossoLocatelliPullanMc(const GR& graph, int seed) :
-      _graph(graph), _id(_graph), _rnd(seed)
-    {
-      initOptions();
-    }
-
-    /// \brief Constructor with random number generator.
-    ///
-    /// Constructor with random number generator.
-    ///
-    /// \param graph The undirected graph the algorithm runs on.
-    /// \param random A random number generator that is used during the
-    /// algorithm.
-    GrossoLocatelliPullanMc(const GR& graph, const Random& random) :
-      _graph(graph), _id(_graph), _rnd(random)
-    {
-      initOptions();
-    }
-
-    /// \name Execution Control
-    /// The \ref run() function can be used to execute the algorithm.\n
-    /// The functions \ref iterationLimit(int), \ref stepLimit(int), and
-    /// \ref sizeLimit(int) can be used to specify various limits for the
-    /// search process.
-
-    /// @{
-
-    /// \brief Sets the maximum number of iterations.
-    ///
-    /// This function sets the maximum number of iterations.
-    /// Each iteration of the algorithm finds a maximal clique (but not
-    /// necessarily the largest one) by performing several search steps
-    /// (node selections).
-    ///
-    /// This limit controls the running time and the success of the
-    /// algorithm. For larger values, the algorithm runs slower, but it more
-    /// likely finds larger cliques. For smaller values, the algorithm is
-    /// faster but probably gives worse results.
-    ///
-    /// The default value is \c 1000.
-    /// \c -1 means that number of iterations is not limited.
-    ///
-    /// \warning You should specify a reasonable limit for the number of
-    /// iterations and/or the number of search steps.
-    ///
-    /// \return <tt>(*this)</tt>
-    ///
-    /// \sa stepLimit(int)
-    /// \sa sizeLimit(int)
-    GrossoLocatelliPullanMc& iterationLimit(int limit) {
-      _iteration_limit = limit;
-      return *this;
-    }
-
-    /// \brief Sets the maximum number of search steps.
-    ///
-    /// This function sets the maximum number of elementary search steps.
-    /// Each iteration of the algorithm finds a maximal clique (but not
-    /// necessarily the largest one) by performing several search steps
-    /// (node selections).
-    ///
-    /// This limit controls the running time and the success of the
-    /// algorithm. For larger values, the algorithm runs slower, but it more
-    /// likely finds larger cliques. For smaller values, the algorithm is
-    /// faster but probably gives worse results.
-    ///
-    /// The default value is \c -1, which means that number of steps
-    /// is not limited explicitly. However, the number of iterations is
-    /// limited and each iteration performs a finite number of search steps.
-    ///
-    /// \warning You should specify a reasonable limit for the number of
-    /// iterations and/or the number of search steps.
-    ///
-    /// \return <tt>(*this)</tt>
-    ///
-    /// \sa iterationLimit(int)
-    /// \sa sizeLimit(int)
-    GrossoLocatelliPullanMc& stepLimit(int limit) {
-      _step_limit = limit;
-      return *this;
-    }
-
-    /// \brief Sets the desired clique size.
-    ///
-    /// This function sets the desired clique size that serves as a search
-    /// limit. If a clique of this size (or a larger one) is found, then the
-    /// algorithm terminates.
-    ///
-    /// This function is especially useful if you know an exact upper bound
-    /// for the size of the cliques in the graph or if any clique above
-    /// a certain size limit is sufficient for your application.
-    ///
-    /// The default value is \c -1, which means that the size limit is set to
-    /// the number of nodes in the graph.
-    ///
-    /// \return <tt>(*this)</tt>
-    ///
-    /// \sa iterationLimit(int)
-    /// \sa stepLimit(int)
-    GrossoLocatelliPullanMc& sizeLimit(int limit) {
-      _size_limit = limit;
-      return *this;
-    }
-
-    /// \brief The maximum number of iterations.
-    ///
-    /// This function gives back the maximum number of iterations.
-    /// \c -1 means that no limit is specified.
-    ///
-    /// \sa iterationLimit(int)
-    int iterationLimit() const {
-      return _iteration_limit;
-    }
-
-    /// \brief The maximum number of search steps.
-    ///
-    /// This function gives back the maximum number of search steps.
-    /// \c -1 means that no limit is specified.
-    ///
-    /// \sa stepLimit(int)
-    int stepLimit() const {
-      return _step_limit;
-    }
-
-    /// \brief The desired clique size.
-    ///
-    /// This function gives back the desired clique size that serves as a
-    /// search limit. \c -1 means that this limit is set to the number of
-    /// nodes in the graph.
-    ///
-    /// \sa sizeLimit(int)
-    int sizeLimit() const {
-      return _size_limit;
-    }
-
-    /// \brief Runs the algorithm.
-    ///
-    /// This function runs the algorithm. If one of the specified limits
-    /// is reached, the search process terminates.
-    ///
-    /// \param rule The node selection rule. For more information, see
-    /// \ref SelectionRule.
-    ///
-    /// \return The termination cause of the search. For more information,
-    /// see \ref TerminationCause.
-    TerminationCause run(SelectionRule rule = PENALTY_BASED)
-    {
-      init();
-      switch (rule) {
-        case RANDOM:
-          return start<RandomSelectionRule>();
-        case DEGREE_BASED:
-          return start<DegreeBasedSelectionRule>();
-        default:
-          return start<PenaltyBasedSelectionRule>();
-      }
-    }
-
-    /// @}
-
-    /// \name Query Functions
-    /// The results of the algorithm can be obtained using these functions.\n
-    /// The run() function must be called before using them.
-
-    /// @{
-
-    /// \brief The size of the found clique
-    ///
-    /// This function returns the size of the found clique.
-    ///
-    /// \pre run() must be called before using this function.
-    int cliqueSize() const {
-      return _best_size;
-    }
-
-    /// \brief Gives back the found clique in a \c bool node map
-    ///
-    /// This function gives back the characteristic vector of the found
-    /// clique in the given node map.
-    /// It must be a \ref concepts::WriteMap "writable" node map with
-    /// \c bool (or convertible) value type.
-    ///
-    /// \pre run() must be called before using this function.
-    template <typename CliqueMap>
-    void cliqueMap(CliqueMap &map) const {
-      for (NodeIt n(_graph); n != INVALID; ++n) {
-        map[n] = static_cast<bool>(_best_clique[_id[n]]);
-      }
-    }
-
-    /// \brief Iterator to list the nodes of the found clique
-    ///
-    /// This iterator class lists the nodes of the found clique.
-    /// Before using it, you must allocate a GrossoLocatelliPullanMc instance
-    /// and call its \ref GrossoLocatelliPullanMc::run() "run()" method.
-    ///
-    /// The following example prints out the IDs of the nodes in the found
-    /// clique.
-    /// \code
-    ///   GrossoLocatelliPullanMc<Graph> mc(g);
-    ///   mc.run();
-    ///   for (GrossoLocatelliPullanMc<Graph>::CliqueNodeIt n(mc);
-    ///        n != INVALID; ++n)
-    ///   {
-    ///     std::cout << g.id(n) << std::endl;
-    ///   }
-    /// \endcode
-    class CliqueNodeIt
-    {
-    private:
-      NodeIt _it;
-      BoolNodeMap _map;
-
-    public:
-
-      /// Constructor
-
-      /// Constructor.
-      /// \param mc The algorithm instance.
-      CliqueNodeIt(const GrossoLocatelliPullanMc &mc)
-       : _map(mc._graph)
-      {
-        mc.cliqueMap(_map);
-        for (_it = NodeIt(mc._graph); _it != INVALID && !_map[_it]; ++_it) ;
-      }
-
-      /// Conversion to \c Node
-      operator Node() const { return _it; }
-
-      bool operator==(Invalid) const { return _it == INVALID; }
-      bool operator!=(Invalid) const { return _it != INVALID; }
-
-      /// Next node
-      CliqueNodeIt &operator++() {
-        for (++_it; _it != INVALID && !_map[_it]; ++_it) ;
-        return *this;
-      }
-
-      /// Postfix incrementation
-
-      /// Postfix incrementation.
-      ///
-      /// \warning This incrementation returns a \c Node, not a
-      /// \c CliqueNodeIt as one may expect.
-      typename GR::Node operator++(int) {
-        Node n=*this;
-        ++(*this);
-        return n;
-      }
-
-    };
-
-    /// @}
-
-  private:
-
-    // Initialize search options and limits
-    void initOptions() {
-      // Search options
-      _delta_based_restart = true;
-      _restart_delta_limit = 4;
-
-      // Search limits
-      _iteration_limit = 1000;
-      _step_limit = -1;             // this is disabled by default
-      _size_limit = -1;             // this is disabled by default
-    }
-
-    // Adds a node to the current clique
-    void addCliqueNode(int u) {
-      if (_clique[u]) return;
-      _clique[u] = true;
-      _size++;
-      BoolVector &row = _gr[u];
-      for (int i = 0; i != _n; i++) {
-        if (!row[i]) _delta[i]++;
-      }
-    }
-
-    // Removes a node from the current clique
-    void delCliqueNode(int u) {
-      if (!_clique[u]) return;
-      _clique[u] = false;
-      _size--;
-      BoolVector &row = _gr[u];
-      for (int i = 0; i != _n; i++) {
-        if (!row[i]) _delta[i]--;
-      }
-    }
-
-    // Initialize data structures
-    void init() {
-      _n = countNodes(_graph);
-      int ui = 0;
-      for (NodeIt u(_graph); u != INVALID; ++u) {
-        _id[u] = ui++;
-      }
-      _gr.clear();
-      _gr.resize(_n, BoolVector(_n, false));
-      ui = 0;
-      for (NodeIt u(_graph); u != INVALID; ++u) {
-        for (IncEdgeIt e(_graph, u); e != INVALID; ++e) {
-          int vi = _id[_graph.runningNode(e)];
-          _gr[ui][vi] = true;
-          _gr[vi][ui] = true;
-        }
-        ++ui;
-      }
-
-      _clique.clear();
-      _clique.resize(_n, false);
-      _size = 0;
-      _best_clique.clear();
-      _best_clique.resize(_n, false);
-      _best_size = 0;
-      _delta.clear();
-      _delta.resize(_n, 0);
-      _tabu.clear();
-      _tabu.resize(_n, false);
-    }
-
-    // Executes the algorithm
-    template <typename SelectionRuleImpl>
-    TerminationCause start() {
-      if (_n == 0) return SIZE_LIMIT;
-      if (_n == 1) {
-        _best_clique[0] = true;
-        _best_size = 1;
-        return SIZE_LIMIT;
-      }
-
-      // Iterated local search algorithm
-      const int max_size = _size_limit >= 0 ? _size_limit : _n;
-      const int max_restart = _iteration_limit >= 0 ?
-        _iteration_limit : std::numeric_limits<int>::max();
-      const int max_select = _step_limit >= 0 ?
-        _step_limit : std::numeric_limits<int>::max();
-
-      SelectionRuleImpl sel_method(*this);
-      int select = 0, restart = 0;
-      IntVector restart_nodes;
-      while (select < max_select && restart < max_restart) {
-
-        // Perturbation/restart
-        restart++;
-        if (_delta_based_restart) {
-          restart_nodes.clear();
-          for (int i = 0; i != _n; i++) {
-            if (_delta[i] >= _restart_delta_limit)
-              restart_nodes.push_back(i);
-          }
-        }
-        int rs_node = -1;
-        if (restart_nodes.size() > 0) {
-          rs_node = restart_nodes[_rnd[restart_nodes.size()]];
-        } else {
-          rs_node = _rnd[_n];
-        }
-        BoolVector &row = _gr[rs_node];
-        for (int i = 0; i != _n; i++) {
-          if (_clique[i] && !row[i]) delCliqueNode(i);
-        }
-        addCliqueNode(rs_node);
-
-        // Local search
-        _tabu.clear();
-        _tabu.resize(_n, false);
-        bool tabu_empty = true;
-        int max_swap = _size;
-        while (select < max_select) {
-          select++;
-          int u;
-          if ((u = sel_method.nextFeasibleAddNode()) != -1) {
-            // Feasible add move
-            addCliqueNode(u);
-            if (tabu_empty) max_swap = _size;
-          }
-          else if ((u = sel_method.nextFeasibleSwapNode()) != -1) {
-            // Feasible swap move
-            int v = -1;
-            BoolVector &row = _gr[u];
-            for (int i = 0; i != _n; i++) {
-              if (_clique[i] && !row[i]) {
-                v = i;
-                break;
-              }
-            }
-            addCliqueNode(u);
-            delCliqueNode(v);
-            _tabu[v] = true;
-            tabu_empty = false;
-            if (--max_swap <= 0) break;
-          }
-          else if ((u = sel_method.nextAddNode()) != -1) {
-            // Non-feasible add move
-            addCliqueNode(u);
-          }
-          else break;
-        }
-        if (_size > _best_size) {
-          _best_clique = _clique;
-          _best_size = _size;
-          if (_best_size >= max_size) return SIZE_LIMIT;
-        }
-        sel_method.update();
-      }
-
-      return (restart >= max_restart ? ITERATION_LIMIT : STEP_LIMIT);
-    }
-
-  }; //class GrossoLocatelliPullanMc
-
-  ///@}
-
-} //namespace lemon
-
-#endif //LEMON_GROSSO_LOCATELLI_PULLAN_MC_H
Index: lemon/hao_orlin.h
===================================================================
--- lemon/hao_orlin.h	(revision 1270)
+++ lemon/hao_orlin.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -54,6 +54,6 @@
   /// preflow push-relabel algorithm. Our implementation calculates
   /// the minimum cut in \f$ O(n^2\sqrt{m}) \f$ time (we use the
-  /// highest-label rule), or in \f$O(nm)\f$ for unit capacities. A notable
-  /// use of this algorithm is testing network reliability.
+  /// highest-label rule), or in \f$O(nm)\f$ for unit capacities. The
+  /// purpose of such algorithm is e.g. testing network reliability.
   ///
   /// For an undirected graph you can run just the first phase of the
@@ -913,6 +913,4 @@
     /// source-side (i.e. a set \f$ X\subsetneq V \f$ with
     /// \f$ source \in X \f$ and minimal outgoing capacity).
-    /// It updates the stored cut if (and only if) the newly found one
-    /// is better.
     ///
     /// \pre \ref init() must be called before using this function.
@@ -927,6 +925,4 @@
     /// sink-side (i.e. a set \f$ X\subsetneq V \f$ with
     /// \f$ source \notin X \f$ and minimal outgoing capacity).
-    /// It updates the stored cut if (and only if) the newly found one
-    /// is better.
     ///
     /// \pre \ref init() must be called before using this function.
@@ -938,6 +934,6 @@
     /// \brief Run the algorithm.
     ///
-    /// This function runs the algorithm. It chooses source node,
-    /// then calls \ref init(), \ref calculateOut()
+    /// This function runs the algorithm. It finds nodes \c source and
+    /// \c target arbitrarily and then calls \ref init(), \ref calculateOut()
     /// and \ref calculateIn().
     void run() {
@@ -949,7 +945,7 @@
     /// \brief Run the algorithm.
     ///
-    /// This function runs the algorithm. It calls \ref init(),
-    /// \ref calculateOut() and \ref calculateIn() with the given
-    /// source node.
+    /// This function runs the algorithm. It uses the given \c source node,
+    /// finds a proper \c target node and then calls the \ref init(),
+    /// \ref calculateOut() and \ref calculateIn().
     void run(const Node& s) {
       init(s);
@@ -970,7 +966,5 @@
     /// \brief Return the value of the minimum cut.
     ///
-    /// This function returns the value of the best cut found by the
-    /// previously called \ref run(), \ref calculateOut() or \ref
-    /// calculateIn().
+    /// This function returns the value of the minimum cut.
     ///
     /// \pre \ref run(), \ref calculateOut() or \ref calculateIn()
@@ -983,11 +977,7 @@
     /// \brief Return a minimum cut.
     ///
-    /// This function gives the best cut found by the
-    /// previously called \ref run(), \ref calculateOut() or \ref
-    /// calculateIn().
-    ///
-    /// It sets \c cutMap to the characteristic vector of the found
-    /// minimum value cut - a non-empty set \f$ X\subsetneq V \f$
-    /// of minimum outgoing capacity (i.e. \c cutMap will be \c true exactly
+    /// This function sets \c cutMap to the characteristic vector of a
+    /// minimum value cut: it will give a non-empty set \f$ X\subsetneq V \f$
+    /// with minimal outgoing capacity (i.e. \c cutMap will be \c true exactly
     /// for the nodes of \f$ X \f$).
     ///
Index: lemon/hartmann_orlin_mmc.h
===================================================================
--- lemon/hartmann_orlin_mmc.h	(revision 1270)
+++ lemon/hartmann_orlin_mmc.h	(revision 959)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -99,9 +99,8 @@
   /// This class implements the Hartmann-Orlin algorithm for finding
   /// a directed cycle of minimum mean cost in a digraph
-  /// \cite hartmann93finding, \cite dasdan98minmeancycle.
-  /// This method is based on \ref KarpMmc "Karp"'s original algorithm, but
-  /// applies an early termination scheme. It makes the algorithm
-  /// significantly faster for some problem instances, but slower for others.
-  /// The algorithm runs in time O(nm) and uses space O(n<sup>2</sup>+m).
+  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
+  /// It is an improved version of \ref KarpMmc "Karp"'s original algorithm,
+  /// it applies an efficient early termination scheme.
+  /// It runs in time O(ne) and uses space O(n<sup>2</sup>+e).
   ///
   /// \tparam GR The type of the digraph the algorithm runs on.
@@ -144,12 +143,9 @@
     ///
     /// The path type of the found cycles.
-    /// Using the \ref lemon::HartmannOrlinMmcDefaultTraits
-    /// "default traits class",
+    /// Using the \ref HartmannOrlinMmcDefaultTraits "default traits class",
     /// it is \ref lemon::Path "Path<Digraph>".
     typedef typename TR::Path Path;
 
-    /// \brief The
-    /// \ref lemon::HartmannOrlinMmcDefaultTraits "traits class"
-    /// of the algorithm
+    /// The \ref HartmannOrlinMmcDefaultTraits "traits class" of the algorithm
     typedef TR Traits;
 
@@ -279,6 +275,6 @@
     ///
     /// If you don't call this function before calling \ref run() or
-    /// \ref findCycleMean(), a local \ref Path "path" structure
-    /// will be allocated. The destuctor deallocates this automatically
+    /// \ref findCycleMean(), it will allocate a local \ref Path "path"
+    /// structure. The destuctor deallocates this automatically
     /// allocated object, of course.
     ///
Index: lemon/howard_mmc.h
===================================================================
--- lemon/howard_mmc.h	(revision 1271)
+++ lemon/howard_mmc.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -99,5 +99,5 @@
   /// This class implements Howard's policy iteration algorithm for finding
   /// a directed cycle of minimum mean cost in a digraph
-  /// \cite dasdan98minmeancycle, \cite dasdan04experimental.
+  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
   /// This class provides the most efficient algorithm for the
   /// minimum mean cycle problem, though the best known theoretical
@@ -143,27 +143,10 @@
     ///
     /// The path type of the found cycles.
-    /// Using the \ref lemon::HowardMmcDefaultTraits "default traits class",
+    /// Using the \ref HowardMmcDefaultTraits "default traits class",
     /// it is \ref lemon::Path "Path<Digraph>".
     typedef typename TR::Path Path;
 
-    /// The \ref lemon::HowardMmcDefaultTraits "traits class" of the algorithm
+    /// The \ref HowardMmcDefaultTraits "traits class" of the algorithm
     typedef TR Traits;
-
-    /// \brief Constants for the causes of search termination.
-    ///
-    /// Enum type containing constants for the different causes of search
-    /// termination. The \ref findCycleMean() function returns one of
-    /// these values.
-    enum TerminationCause {
-
-      /// No directed cycle can be found in the digraph.
-      NO_CYCLE = 0,
-
-      /// Optimal solution (minimum cycle mean) is found.
-      OPTIMAL = 1,
-
-      /// The iteration count limit is reached.
-      ITERATION_LIMIT
-    };
 
   private:
@@ -283,6 +266,6 @@
     ///
     /// If you don't call this function before calling \ref run() or
-    /// \ref findCycleMean(), a local \ref Path "path" structure
-    /// will be allocated. The destuctor deallocates this automatically
+    /// \ref findCycleMean(), it will allocate a local \ref Path "path"
+    /// structure. The destuctor deallocates this automatically
     /// allocated object, of course.
     ///
@@ -342,26 +325,11 @@
     }
 
-    /// \brief Find the minimum cycle mean (or an upper bound).
+    /// \brief Find the minimum cycle mean.
     ///
     /// This function finds the minimum mean cost of the directed
-    /// cycles in the digraph (or an upper bound for it).
-    ///
-    /// By default, the function finds the exact minimum cycle mean,
-    /// but an optional limit can also be specified for the number of
-    /// iterations performed during the search process.
-    /// The return value indicates if the optimal solution is found
-    /// or the iteration limit is reached. In the latter case, an
-    /// approximate solution is provided, which corresponds to a directed
-    /// cycle whose mean cost is relatively small, but not necessarily
-    /// minimal.
-    ///
-    /// \param limit  The maximum allowed number of iterations during
-    /// the search process. Its default value implies that the algorithm
-    /// runs until it finds the exact optimal solution.
-    ///
-    /// \return The termination cause of the search process.
-    /// For more information, see \ref TerminationCause.
-    TerminationCause findCycleMean(int limit =
-                                   std::numeric_limits<int>::max()) {
+    /// cycles in the digraph.
+    ///
+    /// \return \c true if a directed cycle exists in the digraph.
+    bool findCycleMean() {
       // Initialize and find strongly connected components
       init();
@@ -369,18 +337,11 @@
 
       // Find the minimum cycle mean in the components
-      int iter_count = 0;
-      bool iter_limit_reached = false;
       for (int comp = 0; comp < _comp_num; ++comp) {
         // Find the minimum mean cycle in the current component
         if (!buildPolicyGraph(comp)) continue;
         while (true) {
-          if (++iter_count > limit) {
-            iter_limit_reached = true;
-            break;
-          }
           findPolicyCycle();
           if (!computeNodeDistances()) break;
         }
-
         // Update the best cycle (global minimum mean cycle)
         if ( _curr_found && (!_best_found ||
@@ -391,13 +352,6 @@
           _best_node = _curr_node;
         }
-
-        if (iter_limit_reached) break;
-      }
-
-      if (iter_limit_reached) {
-        return ITERATION_LIMIT;
-      } else {
-        return _best_found ? OPTIMAL : NO_CYCLE;
-      }
+      }
+      return _best_found;
     }
 
Index: lemon/insertion_tsp.h
===================================================================
--- lemon/insertion_tsp.h	(revision 1270)
+++ 	(revision )
@@ -1,533 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_INSERTION_TSP_H
-#define LEMON_INSERTION_TSP_H
-
-/// \ingroup tsp
-/// \file
-/// \brief Insertion algorithm for symmetric TSP
-
-#include <vector>
-#include <functional>
-#include <lemon/full_graph.h>
-#include <lemon/maps.h>
-#include <lemon/random.h>
-
-namespace lemon {
-
-  /// \ingroup tsp
-  ///
-  /// \brief Insertion algorithm for symmetric TSP.
-  ///
-  /// InsertionTsp implements the insertion heuristic for solving
-  /// symmetric \ref tsp "TSP".
-  ///
-  /// This is a fast and effective tour construction method that has
-  /// many variants.
-  /// It starts with a subtour containing a few nodes of the graph and it
-  /// iteratively inserts the other nodes into this subtour according to a
-  /// certain node selection rule.
-  ///
-  /// This method is among the fastest TSP algorithms, and it typically
-  /// provides quite good solutions (usually much better than
-  /// \ref NearestNeighborTsp and \ref GreedyTsp).
-  ///
-  /// InsertionTsp implements four different node selection rules,
-  /// from which the most effective one (\e farthest \e node \e selection)
-  /// is used by default.
-  /// With this choice, the algorithm runs in O(n<sup>2</sup>) time.
-  /// For more information, see \ref SelectionRule.
-  ///
-  /// \tparam CM Type of the cost map.
-  template <typename CM>
-  class InsertionTsp
-  {
-    public:
-
-      /// Type of the cost map
-      typedef CM CostMap;
-      /// Type of the edge costs
-      typedef typename CM::Value Cost;
-
-    private:
-
-      GRAPH_TYPEDEFS(FullGraph);
-
-      const FullGraph &_gr;
-      const CostMap &_cost;
-      std::vector<Node> _notused;
-      std::vector<Node> _tour;
-      Cost _sum;
-
-    public:
-
-      /// \brief Constants for specifying the node selection rule.
-      ///
-      /// Enum type containing constants for specifying the node selection
-      /// rule for the \ref run() function.
-      ///
-      /// During the algorithm, nodes are selected for addition to the current
-      /// subtour according to the applied rule.
-      /// The FARTHEST method is one of the fastest selection rules, and
-      /// it is typically the most effective, thus it is the default
-      /// option. The RANDOM rule usually gives slightly worse results,
-      /// but it is more robust.
-      ///
-      /// The desired selection rule can be specified as a parameter of the
-      /// \ref run() function.
-      enum SelectionRule {
-
-        /// An unvisited node having minimum distance from the current
-        /// subtour is selected at each step.
-        /// The algorithm runs in O(n<sup>2</sup>) time using this
-        /// selection rule.
-        NEAREST,
-
-        /// An unvisited node having maximum distance from the current
-        /// subtour is selected at each step.
-        /// The algorithm runs in O(n<sup>2</sup>) time using this
-        /// selection rule.
-        FARTHEST,
-
-        /// An unvisited node whose insertion results in the least
-        /// increase of the subtour's total cost is selected at each step.
-        /// The algorithm runs in O(n<sup>3</sup>) time using this
-        /// selection rule, but in most cases, it is almost as fast as
-        /// with other rules.
-        CHEAPEST,
-
-        /// An unvisited node is selected randomly without any evaluation
-        /// at each step.
-        /// The global \ref rnd "random number generator instance" is used.
-        /// You can seed it before executing the algorithm, if you
-        /// would like to.
-        /// The algorithm runs in O(n<sup>2</sup>) time using this
-        /// selection rule.
-        RANDOM
-      };
-
-    public:
-
-      /// \brief Constructor
-      ///
-      /// Constructor.
-      /// \param gr The \ref FullGraph "full graph" the algorithm runs on.
-      /// \param cost The cost map.
-      InsertionTsp(const FullGraph &gr, const CostMap &cost)
-        : _gr(gr), _cost(cost) {}
-
-      /// \name Execution Control
-      /// @{
-
-      /// \brief Runs the algorithm.
-      ///
-      /// This function runs the algorithm.
-      ///
-      /// \param rule The node selection rule. For more information, see
-      /// \ref SelectionRule.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run(SelectionRule rule = FARTHEST) {
-        _tour.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _tour.push_back(_gr(0));
-          return _sum = 0;
-        }
-
-        switch (rule) {
-          case NEAREST:
-            init(true);
-            start<ComparingSelection<std::less<Cost> >,
-                  DefaultInsertion>();
-            break;
-          case FARTHEST:
-            init(false);
-            start<ComparingSelection<std::greater<Cost> >,
-                  DefaultInsertion>();
-            break;
-          case CHEAPEST:
-            init(true);
-            start<CheapestSelection, CheapestInsertion>();
-            break;
-          case RANDOM:
-            init(true);
-            start<RandomSelection, DefaultInsertion>();
-            break;
-        }
-        return _sum;
-      }
-
-      /// @}
-
-      /// \name Query Functions
-      /// @{
-
-      /// \brief The total cost of the found tour.
-      ///
-      /// This function returns the total cost of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      Cost tourCost() const {
-        return _sum;
-      }
-
-      /// \brief Returns a const reference to the node sequence of the
-      /// found tour.
-      ///
-      /// This function returns a const reference to a vector
-      /// that stores the node sequence of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      const std::vector<Node>& tourNodes() const {
-        return _tour;
-      }
-
-      /// \brief Gives back the node sequence of the found tour.
-      ///
-      /// This function copies the node sequence of the found tour into
-      /// an STL container through the given output iterator. The
-      /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
-      /// For example,
-      /// \code
-      /// std::vector<FullGraph::Node> nodes(countNodes(graph));
-      /// tsp.tourNodes(nodes.begin());
-      /// \endcode
-      /// or
-      /// \code
-      /// std::list<FullGraph::Node> nodes;
-      /// tsp.tourNodes(std::back_inserter(nodes));
-      /// \endcode
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Iterator>
-      void tourNodes(Iterator out) const {
-        std::copy(_tour.begin(), _tour.end(), out);
-      }
-
-      /// \brief Gives back the found tour as a path.
-      ///
-      /// This function copies the found tour as a list of arcs/edges into
-      /// the given \ref lemon::concepts::Path "path structure".
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Path>
-      void tour(Path &path) const {
-        path.clear();
-        for (int i = 0; i < int(_tour.size()) - 1; ++i) {
-          path.addBack(_gr.arc(_tour[i], _tour[i+1]));
-        }
-        if (int(_tour.size()) >= 2) {
-          path.addBack(_gr.arc(_tour.back(), _tour.front()));
-        }
-      }
-
-      /// @}
-
-    private:
-
-      // Initializes the algorithm
-      void init(bool min) {
-        Edge min_edge = min ? mapMin(_gr, _cost) : mapMax(_gr, _cost);
-
-        _tour.clear();
-        _tour.push_back(_gr.u(min_edge));
-        _tour.push_back(_gr.v(min_edge));
-
-        _notused.clear();
-        for (NodeIt n(_gr); n!=INVALID; ++n) {
-          if (n != _gr.u(min_edge) && n != _gr.v(min_edge)) {
-            _notused.push_back(n);
-          }
-        }
-
-        _sum = _cost[min_edge] * 2;
-      }
-
-      // Executes the algorithm
-      template <class SelectionFunctor, class InsertionFunctor>
-      void start() {
-        SelectionFunctor selectNode(_gr, _cost, _tour, _notused);
-        InsertionFunctor insertNode(_gr, _cost, _tour, _sum);
-
-        for (int i=0; i<_gr.nodeNum()-2; ++i) {
-          insertNode.insert(selectNode.select());
-        }
-
-        _sum = _cost[_gr.edge(_tour.back(), _tour.front())];
-        for (int i = 0; i < int(_tour.size())-1; ++i) {
-          _sum += _cost[_gr.edge(_tour[i], _tour[i+1])];
-        }
-      }
-
-
-      // Implementation of the nearest and farthest selection rule
-      template <typename Comparator>
-      class ComparingSelection {
-        public:
-          ComparingSelection(const FullGraph &gr, const CostMap &cost,
-                  std::vector<Node> &tour, std::vector<Node> &notused)
-            : _gr(gr), _cost(cost), _tour(tour), _notused(notused),
-              _dist(gr, 0), _compare()
-          {
-            // Compute initial distances for the unused nodes
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Node u = _notused[i];
-              Cost min_dist = _cost[_gr.edge(u, _tour[0])];
-              for (unsigned int j=1; j<_tour.size(); ++j) {
-                Cost curr = _cost[_gr.edge(u, _tour[j])];
-                if (curr < min_dist) {
-                  min_dist = curr;
-                }
-              }
-              _dist[u] = min_dist;
-            }
-          }
-
-          Node select() {
-
-            // Select an used node with minimum distance
-            Cost ins_dist = 0;
-            int ins_node = -1;
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Cost curr = _dist[_notused[i]];
-              if (_compare(curr, ins_dist) || ins_node == -1) {
-                ins_dist = curr;
-                ins_node = i;
-              }
-            }
-
-            // Remove the selected node from the unused vector
-            Node sn = _notused[ins_node];
-            _notused[ins_node] = _notused.back();
-            _notused.pop_back();
-
-            // Update the distances of the remaining nodes
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Node u = _notused[i];
-              Cost nc = _cost[_gr.edge(sn, u)];
-              if (nc < _dist[u]) {
-                _dist[u] = nc;
-              }
-            }
-
-            return sn;
-          }
-
-        private:
-          const FullGraph &_gr;
-          const CostMap &_cost;
-          std::vector<Node> &_tour;
-          std::vector<Node> &_notused;
-          FullGraph::NodeMap<Cost> _dist;
-          Comparator _compare;
-      };
-
-      // Implementation of the cheapest selection rule
-      class CheapestSelection {
-        private:
-          Cost costDiff(Node u, Node v, Node w) const {
-            return
-              _cost[_gr.edge(u, w)] +
-              _cost[_gr.edge(v, w)] -
-              _cost[_gr.edge(u, v)];
-          }
-
-        public:
-          CheapestSelection(const FullGraph &gr, const CostMap &cost,
-                            std::vector<Node> &tour, std::vector<Node> &notused)
-            : _gr(gr), _cost(cost), _tour(tour), _notused(notused),
-              _ins_cost(gr, 0), _ins_pos(gr, -1)
-          {
-            // Compute insertion cost and position for the unused nodes
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Node u = _notused[i];
-              Cost min_cost = costDiff(_tour.back(), _tour.front(), u);
-              int min_pos = 0;
-              for (unsigned int j=1; j<_tour.size(); ++j) {
-                Cost curr_cost = costDiff(_tour[j-1], _tour[j], u);
-                if (curr_cost < min_cost) {
-                  min_cost = curr_cost;
-                  min_pos = j;
-                }
-              }
-              _ins_cost[u] = min_cost;
-              _ins_pos[u] = min_pos;
-            }
-          }
-
-          Cost select() {
-
-            // Select an used node with minimum insertion cost
-            Cost min_cost = 0;
-            int min_node = -1;
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Cost curr_cost = _ins_cost[_notused[i]];
-              if (curr_cost < min_cost || min_node == -1) {
-                min_cost = curr_cost;
-                min_node = i;
-              }
-            }
-
-            // Remove the selected node from the unused vector
-            Node sn = _notused[min_node];
-            _notused[min_node] = _notused.back();
-            _notused.pop_back();
-
-            // Insert the selected node into the tour
-            const int ipos = _ins_pos[sn];
-            _tour.insert(_tour.begin() + ipos, sn);
-
-            // Update the insertion cost and position of the remaining nodes
-            for (unsigned int i=0; i<_notused.size(); ++i) {
-              Node u = _notused[i];
-              Cost curr_cost = _ins_cost[u];
-              int curr_pos = _ins_pos[u];
-
-              int ipos_prev = ipos == 0 ? _tour.size()-1 : ipos-1;
-              int ipos_next = ipos == int(_tour.size())-1 ? 0 : ipos+1;
-              Cost nc1 = costDiff(_tour[ipos_prev], _tour[ipos], u);
-              Cost nc2 = costDiff(_tour[ipos], _tour[ipos_next], u);
-
-              if (nc1 <= curr_cost || nc2 <= curr_cost) {
-                // A new position is better than the old one
-                if (nc1 <= nc2) {
-                  curr_cost = nc1;
-                  curr_pos = ipos;
-                } else {
-                  curr_cost = nc2;
-                  curr_pos = ipos_next;
-                }
-              }
-              else {
-                if (curr_pos == ipos) {
-                  // The minimum should be found again
-                  curr_cost = costDiff(_tour.back(), _tour.front(), u);
-                  curr_pos = 0;
-                  for (unsigned int j=1; j<_tour.size(); ++j) {
-                    Cost tmp_cost = costDiff(_tour[j-1], _tour[j], u);
-                    if (tmp_cost < curr_cost) {
-                      curr_cost = tmp_cost;
-                      curr_pos = j;
-                    }
-                  }
-                }
-                else if (curr_pos > ipos) {
-                  ++curr_pos;
-                }
-              }
-
-              _ins_cost[u] = curr_cost;
-              _ins_pos[u] = curr_pos;
-            }
-
-            return min_cost;
-          }
-
-        private:
-          const FullGraph &_gr;
-          const CostMap &_cost;
-          std::vector<Node> &_tour;
-          std::vector<Node> &_notused;
-          FullGraph::NodeMap<Cost> _ins_cost;
-          FullGraph::NodeMap<int> _ins_pos;
-      };
-
-      // Implementation of the random selection rule
-      class RandomSelection {
-        public:
-          RandomSelection(const FullGraph &, const CostMap &,
-                          std::vector<Node> &, std::vector<Node> &notused)
-            : _notused(notused) {}
-
-          Node select() const {
-            const int index = rnd[_notused.size()];
-            Node n = _notused[index];
-            _notused[index] = _notused.back();
-            _notused.pop_back();
-            return n;
-          }
-
-        private:
-          std::vector<Node> &_notused;
-      };
-
-
-      // Implementation of the default insertion method
-      class DefaultInsertion {
-        private:
-          Cost costDiff(Node u, Node v, Node w) const {
-            return
-              _cost[_gr.edge(u, w)] +
-              _cost[_gr.edge(v, w)] -
-              _cost[_gr.edge(u, v)];
-          }
-
-        public:
-          DefaultInsertion(const FullGraph &gr, const CostMap &cost,
-                           std::vector<Node> &tour, Cost &total_cost) :
-            _gr(gr), _cost(cost), _tour(tour), _total(total_cost) {}
-
-          void insert(Node n) const {
-            int min = 0;
-            Cost min_val =
-              costDiff(_tour.front(), _tour.back(), n);
-
-            for (unsigned int i=1; i<_tour.size(); ++i) {
-              Cost tmp = costDiff(_tour[i-1], _tour[i], n);
-              if (tmp < min_val) {
-                min = i;
-                min_val = tmp;
-              }
-            }
-
-            _tour.insert(_tour.begin()+min, n);
-            _total += min_val;
-          }
-
-        private:
-          const FullGraph &_gr;
-          const CostMap &_cost;
-          std::vector<Node> &_tour;
-          Cost &_total;
-      };
-
-      // Implementation of a special insertion method for the cheapest
-      // selection rule
-      class CheapestInsertion {
-        TEMPLATE_GRAPH_TYPEDEFS(FullGraph);
-        public:
-          CheapestInsertion(const FullGraph &, const CostMap &,
-                            std::vector<Node> &, Cost &total_cost) :
-            _total(total_cost) {}
-
-          void insert(Cost diff) const {
-            _total += diff;
-          }
-
-        private:
-          Cost &_total;
-      };
-
-  };
-
-}; // namespace lemon
-
-#endif
Index: lemon/karp_mmc.h
===================================================================
--- lemon/karp_mmc.h	(revision 1270)
+++ lemon/karp_mmc.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -99,6 +99,6 @@
   /// This class implements Karp's algorithm for finding a directed
   /// cycle of minimum mean cost in a digraph
-  /// \cite karp78characterization, \cite dasdan98minmeancycle.
-  /// It runs in time O(nm) and uses space O(n<sup>2</sup>+m).
+  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
+  /// It runs in time O(ne) and uses space O(n<sup>2</sup>+e).
   ///
   /// \tparam GR The type of the digraph the algorithm runs on.
@@ -141,9 +141,9 @@
     ///
     /// The path type of the found cycles.
-    /// Using the \ref lemon::KarpMmcDefaultTraits "default traits class",
+    /// Using the \ref KarpMmcDefaultTraits "default traits class",
     /// it is \ref lemon::Path "Path<Digraph>".
     typedef typename TR::Path Path;
 
-    /// The \ref lemon::KarpMmcDefaultTraits "traits class" of the algorithm
+    /// The \ref KarpMmcDefaultTraits "traits class" of the algorithm
     typedef TR Traits;
 
@@ -271,6 +271,6 @@
     ///
     /// If you don't call this function before calling \ref run() or
-    /// \ref findCycleMean(), a local \ref Path "path" structure
-    /// will be allocated. The destuctor deallocates this automatically
+    /// \ref findCycleMean(), it will allocate a local \ref Path "path"
+    /// structure. The destuctor deallocates this automatically
     /// allocated object, of course.
     ///
Index: lemon/kruskal.h
===================================================================
--- lemon/kruskal.h	(revision 1270)
+++ lemon/kruskal.h	(revision 631)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -31,4 +31,7 @@
 ///\file
 ///\brief Kruskal's algorithm to compute a minimum cost spanning tree
+///
+///Kruskal's algorithm to compute a minimum cost spanning tree.
+///
 
 namespace lemon {
Index: lemon/lemon.pc.cmake
===================================================================
--- lemon/lemon.pc.cmake	(revision 1012)
+++ lemon/lemon.pc.cmake	(revision 1012)
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
+libdir=@CMAKE_INSTALL_PREFIX@/lib
+includedir=@CMAKE_INSTALL_PREFIX@/include
+
+Name: @PROJECT_NAME@
+Description: Library for Efficient Modeling and Optimization in Networks
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -lemon @GLPK_LIBS@ @CPLEX_LIBS@ @SOPLEX_LIBS@ @CLP_LIBS@ @CBC_LIBS@
+Cflags: -I${includedir}
Index: lemon/lemon.pc.in
===================================================================
--- lemon/lemon.pc.in	(revision 1133)
+++ lemon/lemon.pc.in	(revision 705)
@@ -1,10 +1,10 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
-libdir=@CMAKE_INSTALL_PREFIX@/lib
-includedir=@CMAKE_INSTALL_PREFIX@/include
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
 
-Name: @PROJECT_NAME@
+Name: @PACKAGE_NAME@
 Description: Library for Efficient Modeling and Optimization in Networks
-Version: @PROJECT_VERSION@
+Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -lemon @GLPK_LIBS@ @CPLEX_LIBS@ @SOPLEX_LIBS@ @CLP_LIBS@ @CBC_LIBS@
 Cflags: -I${includedir}
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 1270)
+++ lemon/lgf_reader.h	(revision 1107)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2011
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -155,14 +155,14 @@
     };
 
-    template <typename Value,
-              typename Map = std::map<std::string, Value> >
+    template <typename Value>
     struct MapLookUpConverter {
-      const Map& _map;
-
-      MapLookUpConverter(const Map& map)
+      const std::map<std::string, Value>& _map;
+
+      MapLookUpConverter(const std::map<std::string, Value>& map)
         : _map(map) {}
 
       Value operator()(const std::string& str) {
-        typename Map::const_iterator it = _map.find(str);
+        typename std::map<std::string, Value>::const_iterator it =
+          _map.find(str);
         if (it == _map.end()) {
           std::ostringstream msg;
@@ -171,37 +171,4 @@
         }
         return it->second;
-      }
-    };
-
-    template <typename Value,
-              typename Map1 = std::map<std::string, Value>,
-              typename Map2 = std::map<std::string, Value> >
-    struct DoubleMapLookUpConverter {
-      const Map1& _map1;
-      const Map2& _map2;
-
-      DoubleMapLookUpConverter(const Map1& map1, const Map2& map2)
-        : _map1(map1), _map2(map2) {}
-
-      Value operator()(const std::string& str) {
-        typename Map1::const_iterator it1 = _map1.find(str);
-        typename Map2::const_iterator it2 = _map2.find(str);
-        if (it1 == _map1.end()) {
-          if (it2 == _map2.end()) {
-            std::ostringstream msg;
-            msg << "Item not found: " << str;
-            throw FormatError(msg.str());
-          } else {
-            return it2->second;
-          }
-        } else {
-          if (it2 == _map2.end()) {
-            return it1->second;
-          } else {
-            std::ostringstream msg;
-            msg << "Item is ambigous: " << str;
-            throw FormatError(msg.str());
-          }
-        }
       }
     };
@@ -1231,8 +1198,7 @@
   /// \ingroup lemon_io
   ///
-  /// \brief Return a \ref lemon::DigraphReader "DigraphReader" class
-  ///
-  /// This function just returns a \ref lemon::DigraphReader
-  /// "DigraphReader" class.
+  /// \brief Return a \ref DigraphReader class
+  ///
+  /// This function just returns a \ref DigraphReader class.
   ///
   /// With this function a digraph can be read from an
@@ -1254,8 +1220,7 @@
   ///\endcode
   ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::DigraphReader "DigraphReader"
+  /// For a complete documentation, please see the \ref DigraphReader
   /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::DigraphReader::run() "run()"
+  /// \warning Don't forget to put the \ref DigraphReader::run() "run()"
   /// to the end of the parameter list.
   /// \relates DigraphReader
@@ -2111,7 +2076,7 @@
   /// \ingroup lemon_io
   ///
-  /// \brief Return a \ref lemon::GraphReader "GraphReader" class
-  ///
-  /// This function just returns a \ref lemon::GraphReader "GraphReader" class.
+  /// \brief Return a \ref GraphReader class
+  ///
+  /// This function just returns a \ref GraphReader class.
   ///
   /// With this function a graph can be read from an
@@ -2129,8 +2094,7 @@
   ///\endcode
   ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::GraphReader "GraphReader"
+  /// For a complete documentation, please see the \ref GraphReader
   /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::GraphReader::run() "run()"
+  /// \warning Don't forget to put the \ref GraphReader::run() "run()"
   /// to the end of the parameter list.
   /// \relates GraphReader
@@ -2162,1072 +2126,4 @@
   GraphReader<TGR> graphReader(TGR& graph, const char* fn) {
     GraphReader<TGR> tmp(graph, fn);
-    return tmp;
-  }
-
-  template <typename BGR>
-  class BpGraphReader;
-
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, std::istream& is = std::cin);
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, const std::string& fn);
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, const char *fn);
-
-  /// \ingroup lemon_io
-  ///
-  /// \brief \ref lgf-format "LGF" reader for bipartite graphs
-  ///
-  /// This utility reads an \ref lgf-format "LGF" file.
-  ///
-  /// It can be used almost the same way as \c GraphReader, but it
-  /// reads the red and blue nodes from separate sections, and these
-  /// sections can contain different set of maps.
-  ///
-  /// The red and blue node maps are read from the corresponding
-  /// sections. If a map is defined with the same name in both of
-  /// these sections, then it can be read as a node map.
-  template <typename BGR>
-  class BpGraphReader {
-  public:
-
-    typedef BGR Graph;
-
-  private:
-
-    TEMPLATE_BPGRAPH_TYPEDEFS(BGR);
-
-    std::istream* _is;
-    bool local_is;
-    std::string _filename;
-
-    BGR& _graph;
-
-    std::string _nodes_caption;
-    std::string _edges_caption;
-    std::string _attributes_caption;
-
-    typedef std::map<std::string, RedNode> RedNodeIndex;
-    RedNodeIndex _red_node_index;
-    typedef std::map<std::string, BlueNode> BlueNodeIndex;
-    BlueNodeIndex _blue_node_index;
-    typedef std::map<std::string, Edge> EdgeIndex;
-    EdgeIndex _edge_index;
-
-    typedef std::vector<std::pair<std::string,
-      _reader_bits::MapStorageBase<RedNode>*> > RedNodeMaps;
-    RedNodeMaps _red_node_maps;
-    typedef std::vector<std::pair<std::string,
-      _reader_bits::MapStorageBase<BlueNode>*> > BlueNodeMaps;
-    BlueNodeMaps _blue_node_maps;
-
-    typedef std::vector<std::pair<std::string,
-      _reader_bits::MapStorageBase<Edge>*> > EdgeMaps;
-    EdgeMaps _edge_maps;
-
-    typedef std::multimap<std::string, _reader_bits::ValueStorageBase*>
-      Attributes;
-    Attributes _attributes;
-
-    bool _use_nodes;
-    bool _use_edges;
-
-    bool _skip_nodes;
-    bool _skip_edges;
-
-    int line_num;
-    std::istringstream line;
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Construct an undirected graph reader, which reads from the given
-    /// input stream.
-    BpGraphReader(BGR& graph, std::istream& is = std::cin)
-      : _is(&is), local_is(false), _graph(graph),
-        _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {}
-
-    /// \brief Constructor
-    ///
-    /// Construct an undirected graph reader, which reads from the given
-    /// file.
-    BpGraphReader(BGR& graph, const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true),
-        _filename(fn), _graph(graph),
-        _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
-
-    /// \brief Constructor
-    ///
-    /// Construct an undirected graph reader, which reads from the given
-    /// file.
-    BpGraphReader(BGR& graph, const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true),
-        _filename(fn), _graph(graph),
-        _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) {
-        delete _is;
-        throw IoError("Cannot open file", fn);
-      }
-    }
-
-    /// \brief Destructor
-    ~BpGraphReader() {
-      for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-           it != _red_node_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-           it != _blue_node_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename EdgeMaps::iterator it = _edge_maps.begin();
-           it != _edge_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename Attributes::iterator it = _attributes.begin();
-           it != _attributes.end(); ++it) {
-        delete it->second;
-      }
-
-      if (local_is) {
-        delete _is;
-      }
-
-    }
-
-  private:
-    template <typename TBGR>
-    friend BpGraphReader<TBGR> bpGraphReader(TBGR& graph, std::istream& is);
-    template <typename TBGR>
-    friend BpGraphReader<TBGR> bpGraphReader(TBGR& graph,
-                                             const std::string& fn);
-    template <typename TBGR>
-    friend BpGraphReader<TBGR> bpGraphReader(TBGR& graph, const char *fn);
-
-    BpGraphReader(BpGraphReader& other)
-      : _is(other._is), local_is(other.local_is), _graph(other._graph),
-        _use_nodes(other._use_nodes), _use_edges(other._use_edges),
-        _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {
-
-      other._is = 0;
-      other.local_is = false;
-
-      _red_node_index.swap(other._red_node_index);
-      _blue_node_index.swap(other._blue_node_index);
-      _edge_index.swap(other._edge_index);
-
-      _red_node_maps.swap(other._red_node_maps);
-      _blue_node_maps.swap(other._blue_node_maps);
-      _edge_maps.swap(other._edge_maps);
-      _attributes.swap(other._attributes);
-
-      _nodes_caption = other._nodes_caption;
-      _edges_caption = other._edges_caption;
-      _attributes_caption = other._attributes_caption;
-
-    }
-
-    BpGraphReader& operator=(const BpGraphReader&);
-
-  public:
-
-    /// \name Reading Rules
-    /// @{
-
-    /// \brief Node map reading rule
-    ///
-    /// Add a node map reading rule to the reader.
-    template <typename Map>
-    BpGraphReader& nodeMap(const std::string& caption, Map& map) {
-      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<RedNode>* red_storage =
-        new _reader_bits::MapStorage<RedNode, Map>(map);
-      _red_node_maps.push_back(std::make_pair(caption, red_storage));
-      _reader_bits::MapStorageBase<BlueNode>* blue_storage =
-        new _reader_bits::MapStorage<BlueNode, Map>(map);
-      _blue_node_maps.push_back(std::make_pair(caption, blue_storage));
-      return *this;
-    }
-
-    /// \brief Node map reading rule
-    ///
-    /// Add a node map reading rule with specialized converter to the
-    /// reader.
-    template <typename Map, typename Converter>
-    BpGraphReader& nodeMap(const std::string& caption, Map& map,
-                           const Converter& converter = Converter()) {
-      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<RedNode>* red_storage =
-        new _reader_bits::MapStorage<RedNode, Map, Converter>(map, converter);
-      _red_node_maps.push_back(std::make_pair(caption, red_storage));
-      _reader_bits::MapStorageBase<BlueNode>* blue_storage =
-        new _reader_bits::MapStorage<BlueNode, Map, Converter>(map, converter);
-      _blue_node_maps.push_back(std::make_pair(caption, blue_storage));
-      return *this;
-    }
-
-    /// Add a red node map reading rule to the reader.
-    template <typename Map>
-    BpGraphReader& redNodeMap(const std::string& caption, Map& map) {
-      checkConcept<concepts::WriteMap<RedNode, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<RedNode>* storage =
-        new _reader_bits::MapStorage<RedNode, Map>(map);
-      _red_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Red node map reading rule
-    ///
-    /// Add a red node map node reading rule with specialized converter to
-    /// the reader.
-    template <typename Map, typename Converter>
-    BpGraphReader& redNodeMap(const std::string& caption, Map& map,
-                              const Converter& converter = Converter()) {
-      checkConcept<concepts::WriteMap<RedNode, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<RedNode>* storage =
-        new _reader_bits::MapStorage<RedNode, Map, Converter>(map, converter);
-      _red_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// Add a blue node map reading rule to the reader.
-    template <typename Map>
-    BpGraphReader& blueNodeMap(const std::string& caption, Map& map) {
-      checkConcept<concepts::WriteMap<BlueNode, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<BlueNode>* storage =
-        new _reader_bits::MapStorage<BlueNode, Map>(map);
-      _blue_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Blue node map reading rule
-    ///
-    /// Add a blue node map reading rule with specialized converter to
-    /// the reader.
-    template <typename Map, typename Converter>
-    BpGraphReader& blueNodeMap(const std::string& caption, Map& map,
-                               const Converter& converter = Converter()) {
-      checkConcept<concepts::WriteMap<BlueNode, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<BlueNode>* storage =
-        new _reader_bits::MapStorage<BlueNode, Map, Converter>(map, converter);
-      _blue_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge map reading rule
-    ///
-    /// Add an edge map reading rule to the reader.
-    template <typename Map>
-    BpGraphReader& edgeMap(const std::string& caption, Map& map) {
-      checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<Edge>* storage =
-        new _reader_bits::MapStorage<Edge, Map>(map);
-      _edge_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge map reading rule
-    ///
-    /// Add an edge map reading rule with specialized converter to the
-    /// reader.
-    template <typename Map, typename Converter>
-    BpGraphReader& edgeMap(const std::string& caption, Map& map,
-                          const Converter& converter = Converter()) {
-      checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<Edge>* storage =
-        new _reader_bits::MapStorage<Edge, Map, Converter>(map, converter);
-      _edge_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Arc map reading rule
-    ///
-    /// Add an arc map reading rule to the reader.
-    template <typename Map>
-    BpGraphReader& arcMap(const std::string& caption, Map& map) {
-      checkConcept<concepts::WriteMap<Arc, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<Edge>* forward_storage =
-        new _reader_bits::GraphArcMapStorage<Graph, true, Map>(_graph, map);
-      _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
-      _reader_bits::MapStorageBase<Edge>* backward_storage =
-        new _reader_bits::GraphArcMapStorage<BGR, false, Map>(_graph, map);
-      _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
-      return *this;
-    }
-
-    /// \brief Arc map reading rule
-    ///
-    /// Add an arc map reading rule with specialized converter to the
-    /// reader.
-    template <typename Map, typename Converter>
-    BpGraphReader& arcMap(const std::string& caption, Map& map,
-                          const Converter& converter = Converter()) {
-      checkConcept<concepts::WriteMap<Arc, typename Map::Value>, Map>();
-      _reader_bits::MapStorageBase<Edge>* forward_storage =
-        new _reader_bits::GraphArcMapStorage<BGR, true, Map, Converter>
-        (_graph, map, converter);
-      _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
-      _reader_bits::MapStorageBase<Edge>* backward_storage =
-        new _reader_bits::GraphArcMapStorage<BGR, false, Map, Converter>
-        (_graph, map, converter);
-      _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
-      return *this;
-    }
-
-    /// \brief Attribute reading rule
-    ///
-    /// Add an attribute reading rule to the reader.
-    template <typename Value>
-    BpGraphReader& attribute(const std::string& caption, Value& value) {
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<Value>(value);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Attribute reading rule
-    ///
-    /// Add an attribute reading rule with specialized converter to the
-    /// reader.
-    template <typename Value, typename Converter>
-    BpGraphReader& attribute(const std::string& caption, Value& value,
-                             const Converter& converter = Converter()) {
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<Value, Converter>(value, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Node reading rule
-    ///
-    /// Add a node reading rule to reader.
-    BpGraphReader& node(const std::string& caption, Node& node) {
-      typedef _reader_bits::DoubleMapLookUpConverter<
-        Node, RedNodeIndex, BlueNodeIndex> Converter;
-      Converter converter(_red_node_index, _blue_node_index);
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<Node, Converter>(node, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Red node reading rule
-    ///
-    /// Add a red node reading rule to reader.
-    BpGraphReader& redNode(const std::string& caption, RedNode& node) {
-      typedef _reader_bits::MapLookUpConverter<RedNode> Converter;
-      Converter converter(_red_node_index);
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<RedNode, Converter>(node, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Blue node reading rule
-    ///
-    /// Add a blue node reading rule to reader.
-    BpGraphReader& blueNode(const std::string& caption, BlueNode& node) {
-      typedef _reader_bits::MapLookUpConverter<BlueNode> Converter;
-      Converter converter(_blue_node_index);
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<BlueNode, Converter>(node, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge reading rule
-    ///
-    /// Add an edge reading rule to reader.
-    BpGraphReader& edge(const std::string& caption, Edge& edge) {
-      typedef _reader_bits::MapLookUpConverter<Edge> Converter;
-      Converter converter(_edge_index);
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<Edge, Converter>(edge, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Arc reading rule
-    ///
-    /// Add an arc reading rule to reader.
-    BpGraphReader& arc(const std::string& caption, Arc& arc) {
-      typedef _reader_bits::GraphArcLookUpConverter<BGR> Converter;
-      Converter converter(_graph, _edge_index);
-      _reader_bits::ValueStorageBase* storage =
-        new _reader_bits::ValueStorage<Arc, Converter>(arc, converter);
-      _attributes.insert(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// @}
-
-    /// \name Select Section by Name
-    /// @{
-
-    /// \brief Set \c \@nodes section to be read
-    ///
-    /// Set \c \@nodes section to be read.
-    BpGraphReader& nodes(const std::string& caption) {
-      _nodes_caption = caption;
-      return *this;
-    }
-
-    /// \brief Set \c \@edges section to be read
-    ///
-    /// Set \c \@edges section to be read.
-    BpGraphReader& edges(const std::string& caption) {
-      _edges_caption = caption;
-      return *this;
-    }
-
-    /// \brief Set \c \@attributes section to be read
-    ///
-    /// Set \c \@attributes section to be read.
-    BpGraphReader& attributes(const std::string& caption) {
-      _attributes_caption = caption;
-      return *this;
-    }
-
-    /// @}
-
-    /// \name Using Previously Constructed Node or Edge Set
-    /// @{
-
-    /// \brief Use previously constructed node set
-    ///
-    /// Use previously constructed node set, and specify the node
-    /// label map.
-    template <typename Map>
-    BpGraphReader& useNodes(const Map& map) {
-      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
-      LEMON_ASSERT(!_use_nodes, "Multiple usage of useNodes() member");
-      _use_nodes = true;
-      _writer_bits::DefaultConverter<typename Map::Value> converter;
-      for (RedNodeIt n(_graph); n != INVALID; ++n) {
-        _red_node_index.insert(std::make_pair(converter(map[n]), n));
-      }
-      for (BlueNodeIt n(_graph); n != INVALID; ++n) {
-        _blue_node_index.insert(std::make_pair(converter(map[n]), n));
-      }
-      return *this;
-    }
-
-    /// \brief Use previously constructed node set
-    ///
-    /// Use previously constructed node set, and specify the node
-    /// label map and a functor which converts the label map values to
-    /// \c std::string.
-    template <typename Map, typename Converter>
-    BpGraphReader& useNodes(const Map& map,
-                            const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
-      LEMON_ASSERT(!_use_nodes, "Multiple usage of useNodes() member");
-      _use_nodes = true;
-      for (RedNodeIt n(_graph); n != INVALID; ++n) {
-        _red_node_index.insert(std::make_pair(converter(map[n]), n));
-      }
-      for (BlueNodeIt n(_graph); n != INVALID; ++n) {
-        _blue_node_index.insert(std::make_pair(converter(map[n]), n));
-      }
-      return *this;
-    }
-
-    /// \brief Use previously constructed edge set
-    ///
-    /// Use previously constructed edge set, and specify the edge
-    /// label map.
-    template <typename Map>
-    BpGraphReader& useEdges(const Map& map) {
-      checkConcept<concepts::ReadMap<Edge, typename Map::Value>, Map>();
-      LEMON_ASSERT(!_use_edges, "Multiple usage of useEdges() member");
-      _use_edges = true;
-      _writer_bits::DefaultConverter<typename Map::Value> converter;
-      for (EdgeIt a(_graph); a != INVALID; ++a) {
-        _edge_index.insert(std::make_pair(converter(map[a]), a));
-      }
-      return *this;
-    }
-
-    /// \brief Use previously constructed edge set
-    ///
-    /// Use previously constructed edge set, and specify the edge
-    /// label map and a functor which converts the label map values to
-    /// \c std::string.
-    template <typename Map, typename Converter>
-    BpGraphReader& useEdges(const Map& map,
-                            const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<Edge, typename Map::Value>, Map>();
-      LEMON_ASSERT(!_use_edges, "Multiple usage of useEdges() member");
-      _use_edges = true;
-      for (EdgeIt a(_graph); a != INVALID; ++a) {
-        _edge_index.insert(std::make_pair(converter(map[a]), a));
-      }
-      return *this;
-    }
-
-    /// \brief Skip the reading of node section
-    ///
-    /// Omit the reading of the node section. This implies that each node
-    /// map reading rule will be abandoned, and the nodes of the graph
-    /// will not be constructed, which usually cause that the edge set
-    /// could not be read due to lack of node name
-    /// could not be read due to lack of node name resolving.
-    /// Therefore \c skipEdges() function should also be used, or
-    /// \c useNodes() should be used to specify the label of the nodes.
-    BpGraphReader& skipNodes() {
-      LEMON_ASSERT(!_skip_nodes, "Skip nodes already set");
-      _skip_nodes = true;
-      return *this;
-    }
-
-    /// \brief Skip the reading of edge section
-    ///
-    /// Omit the reading of the edge section. This implies that each edge
-    /// map reading rule will be abandoned, and the edges of the graph
-    /// will not be constructed.
-    BpGraphReader& skipEdges() {
-      LEMON_ASSERT(!_skip_edges, "Skip edges already set");
-      _skip_edges = true;
-      return *this;
-    }
-
-    /// @}
-
-  private:
-
-    bool readLine() {
-      std::string str;
-      while(++line_num, std::getline(*_is, str)) {
-        line.clear(); line.str(str);
-        char c;
-        if (line >> std::ws >> c && c != '#') {
-          line.putback(c);
-          return true;
-        }
-      }
-      return false;
-    }
-
-    bool readSuccess() {
-      return static_cast<bool>(*_is);
-    }
-
-    void skipSection() {
-      char c;
-      while (readSuccess() && line >> c && c != '@') {
-        readLine();
-      }
-      if (readSuccess()) {
-        line.putback(c);
-      }
-    }
-
-    void readRedNodes() {
-
-      std::vector<int> map_index(_red_node_maps.size());
-      int map_num, label_index;
-
-      char c;
-      if (!readLine() || !(line >> c) || c == '@') {
-        if (readSuccess() && line) line.putback(c);
-        if (!_red_node_maps.empty())
-          throw FormatError("Cannot find map names");
-        return;
-      }
-      line.putback(c);
-
-      {
-        std::map<std::string, int> maps;
-
-        std::string map;
-        int index = 0;
-        while (_reader_bits::readToken(line, map)) {
-          if (maps.find(map) != maps.end()) {
-            std::ostringstream msg;
-            msg << "Multiple occurence of red node map: " << map;
-            throw FormatError(msg.str());
-          }
-          maps.insert(std::make_pair(map, index));
-          ++index;
-        }
-
-        for (int i = 0; i < static_cast<int>(_red_node_maps.size()); ++i) {
-          std::map<std::string, int>::iterator jt =
-            maps.find(_red_node_maps[i].first);
-          if (jt == maps.end()) {
-            std::ostringstream msg;
-            msg << "Map not found: " << _red_node_maps[i].first;
-            throw FormatError(msg.str());
-          }
-          map_index[i] = jt->second;
-        }
-
-        {
-          std::map<std::string, int>::iterator jt = maps.find("label");
-          if (jt != maps.end()) {
-            label_index = jt->second;
-          } else {
-            label_index = -1;
-          }
-        }
-        map_num = maps.size();
-      }
-
-      while (readLine() && line >> c && c != '@') {
-        line.putback(c);
-
-        std::vector<std::string> tokens(map_num);
-        for (int i = 0; i < map_num; ++i) {
-          if (!_reader_bits::readToken(line, tokens[i])) {
-            std::ostringstream msg;
-            msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
-          }
-        }
-        if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
-
-        RedNode n;
-        if (!_use_nodes) {
-          n = _graph.addRedNode();
-          if (label_index != -1)
-            _red_node_index.insert(std::make_pair(tokens[label_index], n));
-        } else {
-          if (label_index == -1)
-            throw FormatError("Label map not found");
-          typename std::map<std::string, RedNode>::iterator it =
-            _red_node_index.find(tokens[label_index]);
-          if (it == _red_node_index.end()) {
-            std::ostringstream msg;
-            msg << "Node with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
-          }
-          n = it->second;
-        }
-
-        for (int i = 0; i < static_cast<int>(_red_node_maps.size()); ++i) {
-          _red_node_maps[i].second->set(n, tokens[map_index[i]]);
-        }
-
-      }
-      if (readSuccess()) {
-        line.putback(c);
-      }
-    }
-
-    void readBlueNodes() {
-
-      std::vector<int> map_index(_blue_node_maps.size());
-      int map_num, label_index;
-
-      char c;
-      if (!readLine() || !(line >> c) || c == '@') {
-        if (readSuccess() && line) line.putback(c);
-        if (!_blue_node_maps.empty())
-          throw FormatError("Cannot find map names");
-        return;
-      }
-      line.putback(c);
-
-      {
-        std::map<std::string, int> maps;
-
-        std::string map;
-        int index = 0;
-        while (_reader_bits::readToken(line, map)) {
-          if (maps.find(map) != maps.end()) {
-            std::ostringstream msg;
-            msg << "Multiple occurence of blue node map: " << map;
-            throw FormatError(msg.str());
-          }
-          maps.insert(std::make_pair(map, index));
-          ++index;
-        }
-
-        for (int i = 0; i < static_cast<int>(_blue_node_maps.size()); ++i) {
-          std::map<std::string, int>::iterator jt =
-            maps.find(_blue_node_maps[i].first);
-          if (jt == maps.end()) {
-            std::ostringstream msg;
-            msg << "Map not found: " << _blue_node_maps[i].first;
-            throw FormatError(msg.str());
-          }
-          map_index[i] = jt->second;
-        }
-
-        {
-          std::map<std::string, int>::iterator jt = maps.find("label");
-          if (jt != maps.end()) {
-            label_index = jt->second;
-          } else {
-            label_index = -1;
-          }
-        }
-        map_num = maps.size();
-      }
-
-      while (readLine() && line >> c && c != '@') {
-        line.putback(c);
-
-        std::vector<std::string> tokens(map_num);
-        for (int i = 0; i < map_num; ++i) {
-          if (!_reader_bits::readToken(line, tokens[i])) {
-            std::ostringstream msg;
-            msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
-          }
-        }
-        if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
-
-        BlueNode n;
-        if (!_use_nodes) {
-          n = _graph.addBlueNode();
-          if (label_index != -1)
-            _blue_node_index.insert(std::make_pair(tokens[label_index], n));
-        } else {
-          if (label_index == -1)
-            throw FormatError("Label map not found");
-          typename std::map<std::string, BlueNode>::iterator it =
-            _blue_node_index.find(tokens[label_index]);
-          if (it == _blue_node_index.end()) {
-            std::ostringstream msg;
-            msg << "Node with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
-          }
-          n = it->second;
-        }
-
-        for (int i = 0; i < static_cast<int>(_blue_node_maps.size()); ++i) {
-          _blue_node_maps[i].second->set(n, tokens[map_index[i]]);
-        }
-
-      }
-      if (readSuccess()) {
-        line.putback(c);
-      }
-    }
-
-    void readEdges() {
-
-      std::vector<int> map_index(_edge_maps.size());
-      int map_num, label_index;
-
-      char c;
-      if (!readLine() || !(line >> c) || c == '@') {
-        if (readSuccess() && line) line.putback(c);
-        if (!_edge_maps.empty())
-          throw FormatError("Cannot find map names");
-        return;
-      }
-      line.putback(c);
-
-      {
-        std::map<std::string, int> maps;
-
-        std::string map;
-        int index = 0;
-        while (_reader_bits::readToken(line, map)) {
-          if (maps.find(map) != maps.end()) {
-            std::ostringstream msg;
-            msg << "Multiple occurence of edge map: " << map;
-            throw FormatError(msg.str());
-          }
-          maps.insert(std::make_pair(map, index));
-          ++index;
-        }
-
-        for (int i = 0; i < static_cast<int>(_edge_maps.size()); ++i) {
-          std::map<std::string, int>::iterator jt =
-            maps.find(_edge_maps[i].first);
-          if (jt == maps.end()) {
-            std::ostringstream msg;
-            msg << "Map not found: " << _edge_maps[i].first;
-            throw FormatError(msg.str());
-          }
-          map_index[i] = jt->second;
-        }
-
-        {
-          std::map<std::string, int>::iterator jt = maps.find("label");
-          if (jt != maps.end()) {
-            label_index = jt->second;
-          } else {
-            label_index = -1;
-          }
-        }
-        map_num = maps.size();
-      }
-
-      while (readLine() && line >> c && c != '@') {
-        line.putback(c);
-
-        std::string source_token;
-        std::string target_token;
-
-        if (!_reader_bits::readToken(line, source_token))
-          throw FormatError("Red node not found");
-
-        if (!_reader_bits::readToken(line, target_token))
-          throw FormatError("Blue node not found");
-
-        std::vector<std::string> tokens(map_num);
-        for (int i = 0; i < map_num; ++i) {
-          if (!_reader_bits::readToken(line, tokens[i])) {
-            std::ostringstream msg;
-            msg << "Column not found (" << i + 1 << ")";
-            throw FormatError(msg.str());
-          }
-        }
-        if (line >> std::ws >> c)
-          throw FormatError("Extra character at the end of line");
-
-        Edge e;
-        if (!_use_edges) {
-          typename RedNodeIndex::iterator rit =
-            _red_node_index.find(source_token);
-          if (rit == _red_node_index.end()) {
-            std::ostringstream msg;
-            msg << "Item not found: " << source_token;
-            throw FormatError(msg.str());
-          }
-          RedNode source = rit->second;
-          typename BlueNodeIndex::iterator it =
-            _blue_node_index.find(target_token);
-          if (it == _blue_node_index.end()) {
-            std::ostringstream msg;
-            msg << "Item not found: " << target_token;
-            throw FormatError(msg.str());
-          }
-          BlueNode target = it->second;
-
-          // It is checked that source is red and
-          // target is blue, so this should be safe:
-          e = _graph.addEdge(source, target);
-          if (label_index != -1)
-            _edge_index.insert(std::make_pair(tokens[label_index], e));
-        } else {
-          if (label_index == -1)
-            throw FormatError("Label map not found");
-          typename std::map<std::string, Edge>::iterator it =
-            _edge_index.find(tokens[label_index]);
-          if (it == _edge_index.end()) {
-            std::ostringstream msg;
-            msg << "Edge with label not found: " << tokens[label_index];
-            throw FormatError(msg.str());
-          }
-          e = it->second;
-        }
-
-        for (int i = 0; i < static_cast<int>(_edge_maps.size()); ++i) {
-          _edge_maps[i].second->set(e, tokens[map_index[i]]);
-        }
-
-      }
-      if (readSuccess()) {
-        line.putback(c);
-      }
-    }
-
-    void readAttributes() {
-
-      std::set<std::string> read_attr;
-
-      char c;
-      while (readLine() && line >> c && c != '@') {
-        line.putback(c);
-
-        std::string attr, token;
-        if (!_reader_bits::readToken(line, attr))
-          throw FormatError("Attribute name not found");
-        if (!_reader_bits::readToken(line, token))
-          throw FormatError("Attribute value not found");
-        if (line >> c)
-          throw FormatError("Extra character at the end of line");
-
-        {
-          std::set<std::string>::iterator it = read_attr.find(attr);
-          if (it != read_attr.end()) {
-            std::ostringstream msg;
-            msg << "Multiple occurence of attribute: " << attr;
-            throw FormatError(msg.str());
-          }
-          read_attr.insert(attr);
-        }
-
-        {
-          typename Attributes::iterator it = _attributes.lower_bound(attr);
-          while (it != _attributes.end() && it->first == attr) {
-            it->second->set(token);
-            ++it;
-          }
-        }
-
-      }
-      if (readSuccess()) {
-        line.putback(c);
-      }
-      for (typename Attributes::iterator it = _attributes.begin();
-           it != _attributes.end(); ++it) {
-        if (read_attr.find(it->first) == read_attr.end()) {
-          std::ostringstream msg;
-          msg << "Attribute not found: " << it->first;
-          throw FormatError(msg.str());
-        }
-      }
-    }
-
-  public:
-
-    /// \name Execution of the Reader
-    /// @{
-
-    /// \brief Start the batch processing
-    ///
-    /// This function starts the batch processing
-    void run() {
-
-      LEMON_ASSERT(_is != 0, "This reader assigned to an other reader");
-
-      bool red_nodes_done = _skip_nodes;
-      bool blue_nodes_done = _skip_nodes;
-      bool edges_done = _skip_edges;
-      bool attributes_done = false;
-
-      line_num = 0;
-      readLine();
-      skipSection();
-
-      while (readSuccess()) {
-        try {
-          char c;
-          std::string section, caption;
-          line >> c;
-          _reader_bits::readToken(line, section);
-          _reader_bits::readToken(line, caption);
-
-          if (line >> c)
-            throw FormatError("Extra character at the end of line");
-
-          if (section == "red_nodes" && !red_nodes_done) {
-            if (_nodes_caption.empty() || _nodes_caption == caption) {
-              readRedNodes();
-              red_nodes_done = true;
-            }
-          } else if (section == "blue_nodes" && !blue_nodes_done) {
-            if (_nodes_caption.empty() || _nodes_caption == caption) {
-              readBlueNodes();
-              blue_nodes_done = true;
-            }
-          } else if ((section == "edges" || section == "arcs") &&
-                     !edges_done) {
-            if (_edges_caption.empty() || _edges_caption == caption) {
-              readEdges();
-              edges_done = true;
-            }
-          } else if (section == "attributes" && !attributes_done) {
-            if (_attributes_caption.empty() || _attributes_caption == caption) {
-              readAttributes();
-              attributes_done = true;
-            }
-          } else {
-            readLine();
-            skipSection();
-          }
-        } catch (FormatError& error) {
-          error.line(line_num);
-          error.file(_filename);
-          throw;
-        }
-      }
-
-      if (!red_nodes_done) {
-        throw FormatError("Section @red_nodes not found");
-      }
-
-      if (!blue_nodes_done) {
-        throw FormatError("Section @blue_nodes not found");
-      }
-
-      if (!edges_done) {
-        throw FormatError("Section @edges not found");
-      }
-
-      if (!attributes_done && !_attributes.empty()) {
-        throw FormatError("Section @attributes not found");
-      }
-
-    }
-
-    /// @}
-
-  };
-
-  /// \ingroup lemon_io
-  ///
-  /// \brief Return a \ref lemon::BpGraphReader "BpGraphReader" class
-  ///
-  /// This function just returns a \ref lemon::BpGraphReader
-  /// "BpGraphReader" class.
-  ///
-  /// With this function a graph can be read from an
-  /// \ref lgf-format "LGF" file or input stream with several maps and
-  /// attributes. For example, there is bipartite weighted matching problem
-  /// on a graph, i.e. a graph with a \e weight map on the edges. This
-  /// graph can be read with the following code:
-  ///
-  ///\code
-  ///ListBpGraph graph;
-  ///ListBpGraph::EdgeMap<int> weight(graph);
-  ///bpGraphReader(graph, std::cin).
-  ///  edgeMap("weight", weight).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::BpGraphReader "BpGraphReader"
-  /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::BpGraphReader::run() "run()"
-  /// to the end of the parameter list.
-  /// \relates BpGraphReader
-  /// \sa bpGraphReader(TBGR& graph, const std::string& fn)
-  /// \sa bpGraphReader(TBGR& graph, const char* fn)
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, std::istream& is) {
-    BpGraphReader<TBGR> tmp(graph, is);
-    return tmp;
-  }
-
-  /// \brief Return a \ref BpGraphReader class
-  ///
-  /// This function just returns a \ref BpGraphReader class.
-  /// \relates BpGraphReader
-  /// \sa bpGraphReader(TBGR& graph, std::istream& is)
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, const std::string& fn) {
-    BpGraphReader<TBGR> tmp(graph, fn);
-    return tmp;
-  }
-
-  /// \brief Return a \ref BpGraphReader class
-  ///
-  /// This function just returns a \ref BpGraphReader class.
-  /// \relates BpGraphReader
-  /// \sa bpGraphReader(TBGR& graph, std::istream& is)
-  template <typename TBGR>
-  BpGraphReader<TBGR> bpGraphReader(TBGR& graph, const char* fn) {
-    BpGraphReader<TBGR> tmp(graph, fn);
     return tmp;
   }
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 1270)
+++ lemon/lgf_writer.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -192,47 +192,18 @@
     };
 
-    template <typename Value,
-              typename Map = std::map<Value, std::string> >
+    template <typename Value>
     struct MapLookUpConverter {
-      const Map& _map;
-
-      MapLookUpConverter(const Map& map)
+      const std::map<Value, std::string>& _map;
+
+      MapLookUpConverter(const std::map<Value, std::string>& map)
         : _map(map) {}
 
-      std::string operator()(const Value& value) {
-        typename Map::const_iterator it = _map.find(value);
+      std::string operator()(const Value& str) {
+        typename std::map<Value, std::string>::const_iterator it =
+          _map.find(str);
         if (it == _map.end()) {
           throw FormatError("Item not found");
         }
         return it->second;
-      }
-    };
-
-    template <typename Value,
-              typename Map1 = std::map<Value, std::string>,
-              typename Map2 = std::map<Value, std::string> >
-    struct DoubleMapLookUpConverter {
-      const Map1& _map1;
-      const Map2& _map2;
-
-      DoubleMapLookUpConverter(const Map1& map1, const Map2& map2)
-        : _map1(map1), _map2(map2) {}
-
-      std::string operator()(const Value& value) {
-        typename Map1::const_iterator it1 = _map1.find(value);
-        typename Map1::const_iterator it2 = _map2.find(value);
-        if (it1 == _map1.end()) {
-          if (it2 == _map2.end()) {
-            throw FormatError("Item not found");
-          } else {
-            return it2->second;
-          }
-        } else {
-          if (it2 == _map2.end()) {
-            return it1->second;
-          } else {
-            throw FormatError("Item is ambigous");
-          }
-        }
       }
     };
@@ -945,8 +916,7 @@
   /// \ingroup lemon_io
   ///
-  /// \brief Return a \ref lemon::DigraphWriter "DigraphWriter" class
-  ///
-  /// This function just returns a \ref lemon::DigraphWriter
-  /// "DigraphWriter" class.
+  /// \brief Return a \ref DigraphWriter class
+  ///
+  /// This function just returns a \ref DigraphWriter class.
   ///
   /// With this function a digraph can be write to a file or output
@@ -969,8 +939,7 @@
   ///\endcode
   ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::DigraphWriter "DigraphWriter"
+  /// For a complete documentation, please see the \ref DigraphWriter
   /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::DigraphWriter::run() "run()"
+  /// \warning Don't forget to put the \ref DigraphWriter::run() "run()"
   /// to the end of the parameter list.
   /// \relates DigraphWriter
@@ -1018,5 +987,5 @@
   /// \ingroup lemon_io
   ///
-  /// \brief \ref lgf-format "LGF" writer for undirected graphs
+  /// \brief \ref lgf-format "LGF" writer for directed graphs
   ///
   /// This utility writes an \ref lgf-format "LGF" file.
@@ -1074,6 +1043,6 @@
     /// \brief Constructor
     ///
-    /// Construct an undirected graph writer, which writes to the
-    /// given output stream.
+    /// Construct a directed graph writer, which writes to the given
+    /// output stream.
     GraphWriter(const GR& graph, std::ostream& os = std::cout)
       : _os(&os), local_os(false), _graph(graph),
@@ -1082,5 +1051,5 @@
     /// \brief Constructor
     ///
-    /// Construct a undirected graph writer, which writes to the given
+    /// Construct a directed graph writer, which writes to the given
     /// output file.
     GraphWriter(const GR& graph, const std::string& fn)
@@ -1095,5 +1064,5 @@
     /// \brief Constructor
     ///
-    /// Construct a undirected graph writer, which writes to the given
+    /// Construct a directed graph writer, which writes to the given
     /// output file.
     GraphWriter(const GR& graph, const char* fn)
@@ -1321,7 +1290,7 @@
     }
 
-    /// \brief Add an additional caption to the \c \@edges section
-    ///
-    /// Add an additional caption to the \c \@edges section.
+    /// \brief Add an additional caption to the \c \@arcs section
+    ///
+    /// Add an additional caption to the \c \@arcs section.
     GraphWriter& edges(const std::string& caption) {
       _edges_caption = caption;
@@ -1586,7 +1555,7 @@
   /// \ingroup lemon_io
   ///
-  /// \brief Return a \ref lemon::GraphWriter "GraphWriter" class
-  ///
-  /// This function just returns a \ref lemon::GraphWriter "GraphWriter" class.
+  /// \brief Return a \ref GraphWriter class
+  ///
+  /// This function just returns a \ref GraphWriter class.
   ///
   /// With this function a graph can be write to a file or output
@@ -1605,8 +1574,7 @@
   ///\endcode
   ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::GraphWriter "GraphWriter"
+  /// For a complete documentation, please see the \ref GraphWriter
   /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::GraphWriter::run() "run()"
+  /// \warning Don't forget to put the \ref GraphWriter::run() "run()"
   /// to the end of the parameter list.
   /// \relates GraphWriter
@@ -1638,824 +1606,4 @@
   GraphWriter<TGR> graphWriter(const TGR& graph, const char* fn) {
     GraphWriter<TGR> tmp(graph, fn);
-    return tmp;
-  }
-
-  template <typename BGR>
-  class BpGraphWriter;
-
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph,
-                                    std::ostream& os = std::cout);
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, const std::string& fn);
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, const char* fn);
-
-  /// \ingroup lemon_io
-  ///
-  /// \brief \ref lgf-format "LGF" writer for undirected bipartite graphs
-  ///
-  /// This utility writes an \ref lgf-format "LGF" file.
-  ///
-  /// It can be used almost the same way as \c GraphWriter, but it
-  /// reads the red and blue nodes from separate sections, and these
-  /// sections can contain different set of maps.
-  ///
-  /// The red and blue node maps are written to the corresponding
-  /// sections. The node maps are written to both of these sections
-  /// with the same map name.
-  template <typename BGR>
-  class BpGraphWriter {
-  public:
-
-    typedef BGR BpGraph;
-    TEMPLATE_BPGRAPH_TYPEDEFS(BGR);
-
-  private:
-
-
-    std::ostream* _os;
-    bool local_os;
-
-    const BGR& _graph;
-
-    std::string _nodes_caption;
-    std::string _edges_caption;
-    std::string _attributes_caption;
-
-    typedef std::map<Node, std::string> RedNodeIndex;
-    RedNodeIndex _red_node_index;
-    typedef std::map<Node, std::string> BlueNodeIndex;
-    BlueNodeIndex _blue_node_index;
-    typedef std::map<Edge, std::string> EdgeIndex;
-    EdgeIndex _edge_index;
-
-    typedef std::vector<std::pair<std::string,
-      _writer_bits::MapStorageBase<RedNode>* > > RedNodeMaps;
-    RedNodeMaps _red_node_maps;
-    typedef std::vector<std::pair<std::string,
-      _writer_bits::MapStorageBase<BlueNode>* > > BlueNodeMaps;
-    BlueNodeMaps _blue_node_maps;
-
-    typedef std::vector<std::pair<std::string,
-      _writer_bits::MapStorageBase<Edge>* > >EdgeMaps;
-    EdgeMaps _edge_maps;
-
-    typedef std::vector<std::pair<std::string,
-      _writer_bits::ValueStorageBase*> > Attributes;
-    Attributes _attributes;
-
-    bool _skip_nodes;
-    bool _skip_edges;
-
-  public:
-
-    /// \brief Constructor
-    ///
-    /// Construct a bipartite graph writer, which writes to the given
-    /// output stream.
-    BpGraphWriter(const BGR& graph, std::ostream& os = std::cout)
-      : _os(&os), local_os(false), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {}
-
-    /// \brief Constructor
-    ///
-    /// Construct a bipartite graph writer, which writes to the given
-    /// output file.
-    BpGraphWriter(const BGR& graph, const std::string& fn)
-      : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
-
-    /// \brief Constructor
-    ///
-    /// Construct a bipartite graph writer, which writes to the given
-    /// output file.
-    BpGraphWriter(const BGR& graph, const char* fn)
-      : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {
-      if (!(*_os)) {
-        delete _os;
-        throw IoError("Cannot write file", fn);
-      }
-    }
-
-    /// \brief Destructor
-    ~BpGraphWriter() {
-      for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-           it != _red_node_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-           it != _blue_node_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename EdgeMaps::iterator it = _edge_maps.begin();
-           it != _edge_maps.end(); ++it) {
-        delete it->second;
-      }
-
-      for (typename Attributes::iterator it = _attributes.begin();
-           it != _attributes.end(); ++it) {
-        delete it->second;
-      }
-
-      if (local_os) {
-        delete _os;
-      }
-    }
-
-  private:
-
-    template <typename TBGR>
-    friend BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph,
-                                             std::ostream& os);
-    template <typename TBGR>
-    friend BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph,
-                                             const std::string& fn);
-    template <typename TBGR>
-    friend BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, const char *fn);
-
-    BpGraphWriter(BpGraphWriter& other)
-      : _os(other._os), local_os(other.local_os), _graph(other._graph),
-        _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {
-
-      other._os = 0;
-      other.local_os = false;
-
-      _red_node_index.swap(other._red_node_index);
-      _blue_node_index.swap(other._blue_node_index);
-      _edge_index.swap(other._edge_index);
-
-      _red_node_maps.swap(other._red_node_maps);
-      _blue_node_maps.swap(other._blue_node_maps);
-      _edge_maps.swap(other._edge_maps);
-      _attributes.swap(other._attributes);
-
-      _nodes_caption = other._nodes_caption;
-      _edges_caption = other._edges_caption;
-      _attributes_caption = other._attributes_caption;
-    }
-
-    BpGraphWriter& operator=(const BpGraphWriter&);
-
-  public:
-
-    /// \name Writing Rules
-    /// @{
-
-    /// \brief Node map writing rule
-    ///
-    /// Add a node map writing rule to the writer.
-    template <typename Map>
-    BpGraphWriter& nodeMap(const std::string& caption, const Map& map) {
-      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<RedNode>* red_storage =
-        new _writer_bits::MapStorage<RedNode, Map>(map);
-      _red_node_maps.push_back(std::make_pair(caption, red_storage));
-      _writer_bits::MapStorageBase<BlueNode>* blue_storage =
-        new _writer_bits::MapStorage<BlueNode, Map>(map);
-      _blue_node_maps.push_back(std::make_pair(caption, blue_storage));
-      return *this;
-    }
-
-    /// \brief Node map writing rule
-    ///
-    /// Add a node map writing rule with specialized converter to the
-    /// writer.
-    template <typename Map, typename Converter>
-    BpGraphWriter& nodeMap(const std::string& caption, const Map& map,
-                           const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<RedNode>* red_storage =
-        new _writer_bits::MapStorage<RedNode, Map, Converter>(map, converter);
-      _red_node_maps.push_back(std::make_pair(caption, red_storage));
-      _writer_bits::MapStorageBase<BlueNode>* blue_storage =
-        new _writer_bits::MapStorage<BlueNode, Map, Converter>(map, converter);
-      _blue_node_maps.push_back(std::make_pair(caption, blue_storage));
-      return *this;
-    }
-
-    /// \brief Red node map writing rule
-    ///
-    /// Add a red node map writing rule to the writer.
-    template <typename Map>
-    BpGraphWriter& redNodeMap(const std::string& caption, const Map& map) {
-      checkConcept<concepts::ReadMap<RedNode, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<RedNode>* storage =
-        new _writer_bits::MapStorage<RedNode, Map>(map);
-      _red_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Red node map writing rule
-    ///
-    /// Add a red node map writing rule with specialized converter to the
-    /// writer.
-    template <typename Map, typename Converter>
-    BpGraphWriter& redNodeMap(const std::string& caption, const Map& map,
-                              const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<RedNode, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<RedNode>* storage =
-        new _writer_bits::MapStorage<RedNode, Map, Converter>(map, converter);
-      _red_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Blue node map writing rule
-    ///
-    /// Add a blue node map writing rule to the writer.
-    template <typename Map>
-    BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map) {
-      checkConcept<concepts::ReadMap<BlueNode, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<BlueNode>* storage =
-        new _writer_bits::MapStorage<BlueNode, Map>(map);
-      _blue_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Blue node map writing rule
-    ///
-    /// Add a blue node map writing rule with specialized converter to the
-    /// writer.
-    template <typename Map, typename Converter>
-    BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map,
-                               const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<BlueNode, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<BlueNode>* storage =
-        new _writer_bits::MapStorage<BlueNode, Map, Converter>(map, converter);
-      _blue_node_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge map writing rule
-    ///
-    /// Add an edge map writing rule to the writer.
-    template <typename Map>
-    BpGraphWriter& edgeMap(const std::string& caption, const Map& map) {
-      checkConcept<concepts::ReadMap<Edge, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<Edge>* storage =
-        new _writer_bits::MapStorage<Edge, Map>(map);
-      _edge_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge map writing rule
-    ///
-    /// Add an edge map writing rule with specialized converter to the
-    /// writer.
-    template <typename Map, typename Converter>
-    BpGraphWriter& edgeMap(const std::string& caption, const Map& map,
-                          const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<Edge, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<Edge>* storage =
-        new _writer_bits::MapStorage<Edge, Map, Converter>(map, converter);
-      _edge_maps.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Arc map writing rule
-    ///
-    /// Add an arc map writing rule to the writer.
-    template <typename Map>
-    BpGraphWriter& arcMap(const std::string& caption, const Map& map) {
-      checkConcept<concepts::ReadMap<Arc, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<Edge>* forward_storage =
-        new _writer_bits::GraphArcMapStorage<BGR, true, Map>(_graph, map);
-      _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
-      _writer_bits::MapStorageBase<Edge>* backward_storage =
-        new _writer_bits::GraphArcMapStorage<BGR, false, Map>(_graph, map);
-      _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
-      return *this;
-    }
-
-    /// \brief Arc map writing rule
-    ///
-    /// Add an arc map writing rule with specialized converter to the
-    /// writer.
-    template <typename Map, typename Converter>
-    BpGraphWriter& arcMap(const std::string& caption, const Map& map,
-                          const Converter& converter = Converter()) {
-      checkConcept<concepts::ReadMap<Arc, typename Map::Value>, Map>();
-      _writer_bits::MapStorageBase<Edge>* forward_storage =
-        new _writer_bits::GraphArcMapStorage<BGR, true, Map, Converter>
-        (_graph, map, converter);
-      _edge_maps.push_back(std::make_pair('+' + caption, forward_storage));
-      _writer_bits::MapStorageBase<Edge>* backward_storage =
-        new _writer_bits::GraphArcMapStorage<BGR, false, Map, Converter>
-        (_graph, map, converter);
-      _edge_maps.push_back(std::make_pair('-' + caption, backward_storage));
-      return *this;
-    }
-
-    /// \brief Attribute writing rule
-    ///
-    /// Add an attribute writing rule to the writer.
-    template <typename Value>
-    BpGraphWriter& attribute(const std::string& caption, const Value& value) {
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Value>(value);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Attribute writing rule
-    ///
-    /// Add an attribute writing rule with specialized converter to the
-    /// writer.
-    template <typename Value, typename Converter>
-    BpGraphWriter& attribute(const std::string& caption, const Value& value,
-                             const Converter& converter = Converter()) {
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Value, Converter>(value, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Node writing rule
-    ///
-    /// Add a node writing rule to the writer.
-    BpGraphWriter& node(const std::string& caption, const Node& node) {
-      typedef _writer_bits::DoubleMapLookUpConverter<
-        Node, RedNodeIndex, BlueNodeIndex> Converter;
-      Converter converter(_red_node_index, _blue_node_index);
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Node, Converter>(node, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Red node writing rule
-    ///
-    /// Add a red node writing rule to the writer.
-    BpGraphWriter& redNode(const std::string& caption, const RedNode& node) {
-      typedef _writer_bits::MapLookUpConverter<Node> Converter;
-      Converter converter(_red_node_index);
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Node, Converter>(node, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Blue node writing rule
-    ///
-    /// Add a blue node writing rule to the writer.
-    BpGraphWriter& blueNode(const std::string& caption, const BlueNode& node) {
-      typedef _writer_bits::MapLookUpConverter<Node> Converter;
-      Converter converter(_blue_node_index);
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Node, Converter>(node, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Edge writing rule
-    ///
-    /// Add an edge writing rule to writer.
-    BpGraphWriter& edge(const std::string& caption, const Edge& edge) {
-      typedef _writer_bits::MapLookUpConverter<Edge> Converter;
-      Converter converter(_edge_index);
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Edge, Converter>(edge, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \brief Arc writing rule
-    ///
-    /// Add an arc writing rule to writer.
-    BpGraphWriter& arc(const std::string& caption, const Arc& arc) {
-      typedef _writer_bits::GraphArcLookUpConverter<BGR> Converter;
-      Converter converter(_graph, _edge_index);
-      _writer_bits::ValueStorageBase* storage =
-        new _writer_bits::ValueStorage<Arc, Converter>(arc, converter);
-      _attributes.push_back(std::make_pair(caption, storage));
-      return *this;
-    }
-
-    /// \name Section Captions
-    /// @{
-
-    /// \brief Add an additional caption to the \c \@red_nodes and
-    /// \c \@blue_nodes section
-    ///
-    /// Add an additional caption to the \c \@red_nodes and \c
-    /// \@blue_nodes section.
-    BpGraphWriter& nodes(const std::string& caption) {
-      _nodes_caption = caption;
-      return *this;
-    }
-
-    /// \brief Add an additional caption to the \c \@edges section
-    ///
-    /// Add an additional caption to the \c \@edges section.
-    BpGraphWriter& edges(const std::string& caption) {
-      _edges_caption = caption;
-      return *this;
-    }
-
-    /// \brief Add an additional caption to the \c \@attributes section
-    ///
-    /// Add an additional caption to the \c \@attributes section.
-    BpGraphWriter& attributes(const std::string& caption) {
-      _attributes_caption = caption;
-      return *this;
-    }
-
-    /// \name Skipping Section
-    /// @{
-
-    /// \brief Skip writing the node set
-    ///
-    /// The \c \@red_nodes and \c \@blue_nodes section will not be
-    /// written to the stream.
-    BpGraphWriter& skipNodes() {
-      LEMON_ASSERT(!_skip_nodes, "Multiple usage of skipNodes() member");
-      _skip_nodes = true;
-      return *this;
-    }
-
-    /// \brief Skip writing edge set
-    ///
-    /// The \c \@edges section will not be written to the stream.
-    BpGraphWriter& skipEdges() {
-      LEMON_ASSERT(!_skip_edges, "Multiple usage of skipEdges() member");
-      _skip_edges = true;
-      return *this;
-    }
-
-    /// @}
-
-  private:
-
-    void writeRedNodes() {
-      _writer_bits::MapStorageBase<RedNode>* label = 0;
-      for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-           it != _red_node_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      *_os << "@red_nodes";
-      if (!_nodes_caption.empty()) {
-        _writer_bits::writeToken(*_os << ' ', _nodes_caption);
-      }
-      *_os << std::endl;
-
-      if (label == 0) {
-        *_os << "label" << '\t';
-      }
-      for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-           it != _red_node_maps.end(); ++it) {
-        _writer_bits::writeToken(*_os, it->first) << '\t';
-      }
-      *_os << std::endl;
-
-      std::vector<RedNode> nodes;
-      for (RedNodeIt n(_graph); n != INVALID; ++n) {
-        nodes.push_back(n);
-      }
-
-      if (label == 0) {
-        IdMap<BGR, Node> id_map(_graph);
-        _writer_bits::MapLess<IdMap<BGR, Node> > id_less(id_map);
-        std::sort(nodes.begin(), nodes.end(), id_less);
-      } else {
-        label->sort(nodes);
-      }
-
-      for (int i = 0; i < static_cast<int>(nodes.size()); ++i) {
-        RedNode n = nodes[i];
-        if (label == 0) {
-          std::ostringstream os;
-          os << _graph.id(static_cast<Node>(n));
-          _writer_bits::writeToken(*_os, os.str());
-          *_os << '\t';
-          _red_node_index.insert(std::make_pair(n, os.str()));
-        }
-        for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-             it != _red_node_maps.end(); ++it) {
-          std::string value = it->second->get(n);
-          _writer_bits::writeToken(*_os, value);
-          if (it->first == "label") {
-            _red_node_index.insert(std::make_pair(n, value));
-          }
-          *_os << '\t';
-        }
-        *_os << std::endl;
-      }
-    }
-
-    void writeBlueNodes() {
-      _writer_bits::MapStorageBase<BlueNode>* label = 0;
-      for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-           it != _blue_node_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      *_os << "@blue_nodes";
-      if (!_nodes_caption.empty()) {
-        _writer_bits::writeToken(*_os << ' ', _nodes_caption);
-      }
-      *_os << std::endl;
-
-      if (label == 0) {
-        *_os << "label" << '\t';
-      }
-      for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-           it != _blue_node_maps.end(); ++it) {
-        _writer_bits::writeToken(*_os, it->first) << '\t';
-      }
-      *_os << std::endl;
-
-      std::vector<BlueNode> nodes;
-      for (BlueNodeIt n(_graph); n != INVALID; ++n) {
-        nodes.push_back(n);
-      }
-
-      if (label == 0) {
-        IdMap<BGR, Node> id_map(_graph);
-        _writer_bits::MapLess<IdMap<BGR, Node> > id_less(id_map);
-        std::sort(nodes.begin(), nodes.end(), id_less);
-      } else {
-        label->sort(nodes);
-      }
-
-      for (int i = 0; i < static_cast<int>(nodes.size()); ++i) {
-        BlueNode n = nodes[i];
-        if (label == 0) {
-          std::ostringstream os;
-          os << _graph.id(static_cast<Node>(n));
-          _writer_bits::writeToken(*_os, os.str());
-          *_os << '\t';
-          _blue_node_index.insert(std::make_pair(n, os.str()));
-        }
-        for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-             it != _blue_node_maps.end(); ++it) {
-          std::string value = it->second->get(n);
-          _writer_bits::writeToken(*_os, value);
-          if (it->first == "label") {
-            _blue_node_index.insert(std::make_pair(n, value));
-          }
-          *_os << '\t';
-        }
-        *_os << std::endl;
-      }
-    }
-
-    void createRedNodeIndex() {
-      _writer_bits::MapStorageBase<RedNode>* label = 0;
-      for (typename RedNodeMaps::iterator it = _red_node_maps.begin();
-           it != _red_node_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      if (label == 0) {
-        for (RedNodeIt n(_graph); n != INVALID; ++n) {
-          std::ostringstream os;
-          os << _graph.id(n);
-          _red_node_index.insert(std::make_pair(n, os.str()));
-        }
-      } else {
-        for (RedNodeIt n(_graph); n != INVALID; ++n) {
-          std::string value = label->get(n);
-          _red_node_index.insert(std::make_pair(n, value));
-        }
-      }
-    }
-
-    void createBlueNodeIndex() {
-      _writer_bits::MapStorageBase<BlueNode>* label = 0;
-      for (typename BlueNodeMaps::iterator it = _blue_node_maps.begin();
-           it != _blue_node_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      if (label == 0) {
-        for (BlueNodeIt n(_graph); n != INVALID; ++n) {
-          std::ostringstream os;
-          os << _graph.id(n);
-          _blue_node_index.insert(std::make_pair(n, os.str()));
-        }
-      } else {
-        for (BlueNodeIt n(_graph); n != INVALID; ++n) {
-          std::string value = label->get(n);
-          _blue_node_index.insert(std::make_pair(n, value));
-        }
-      }
-    }
-
-    void writeEdges() {
-      _writer_bits::MapStorageBase<Edge>* label = 0;
-      for (typename EdgeMaps::iterator it = _edge_maps.begin();
-           it != _edge_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      *_os << "@edges";
-      if (!_edges_caption.empty()) {
-        _writer_bits::writeToken(*_os << ' ', _edges_caption);
-      }
-      *_os << std::endl;
-
-      *_os << '\t' << '\t';
-      if (label == 0) {
-        *_os << "label" << '\t';
-      }
-      for (typename EdgeMaps::iterator it = _edge_maps.begin();
-           it != _edge_maps.end(); ++it) {
-        _writer_bits::writeToken(*_os, it->first) << '\t';
-      }
-      *_os << std::endl;
-
-      std::vector<Edge> edges;
-      for (EdgeIt n(_graph); n != INVALID; ++n) {
-        edges.push_back(n);
-      }
-
-      if (label == 0) {
-        IdMap<BGR, Edge> id_map(_graph);
-        _writer_bits::MapLess<IdMap<BGR, Edge> > id_less(id_map);
-        std::sort(edges.begin(), edges.end(), id_less);
-      } else {
-        label->sort(edges);
-      }
-
-      for (int i = 0; i < static_cast<int>(edges.size()); ++i) {
-        Edge e = edges[i];
-        _writer_bits::writeToken(*_os, _red_node_index.
-                                 find(_graph.redNode(e))->second);
-        *_os << '\t';
-        _writer_bits::writeToken(*_os, _blue_node_index.
-                                 find(_graph.blueNode(e))->second);
-        *_os << '\t';
-        if (label == 0) {
-          std::ostringstream os;
-          os << _graph.id(e);
-          _writer_bits::writeToken(*_os, os.str());
-          *_os << '\t';
-          _edge_index.insert(std::make_pair(e, os.str()));
-        }
-        for (typename EdgeMaps::iterator it = _edge_maps.begin();
-             it != _edge_maps.end(); ++it) {
-          std::string value = it->second->get(e);
-          _writer_bits::writeToken(*_os, value);
-          if (it->first == "label") {
-            _edge_index.insert(std::make_pair(e, value));
-          }
-          *_os << '\t';
-        }
-        *_os << std::endl;
-      }
-    }
-
-    void createEdgeIndex() {
-      _writer_bits::MapStorageBase<Edge>* label = 0;
-      for (typename EdgeMaps::iterator it = _edge_maps.begin();
-           it != _edge_maps.end(); ++it) {
-        if (it->first == "label") {
-          label = it->second;
-          break;
-        }
-      }
-
-      if (label == 0) {
-        for (EdgeIt e(_graph); e != INVALID; ++e) {
-          std::ostringstream os;
-          os << _graph.id(e);
-          _edge_index.insert(std::make_pair(e, os.str()));
-        }
-      } else {
-        for (EdgeIt e(_graph); e != INVALID; ++e) {
-          std::string value = label->get(e);
-          _edge_index.insert(std::make_pair(e, value));
-        }
-      }
-    }
-
-    void writeAttributes() {
-      if (_attributes.empty()) return;
-      *_os << "@attributes";
-      if (!_attributes_caption.empty()) {
-        _writer_bits::writeToken(*_os << ' ', _attributes_caption);
-      }
-      *_os << std::endl;
-      for (typename Attributes::iterator it = _attributes.begin();
-           it != _attributes.end(); ++it) {
-        _writer_bits::writeToken(*_os, it->first) << ' ';
-        _writer_bits::writeToken(*_os, it->second->get());
-        *_os << std::endl;
-      }
-    }
-
-  public:
-
-    /// \name Execution of the Writer
-    /// @{
-
-    /// \brief Start the batch processing
-    ///
-    /// This function starts the batch processing.
-    void run() {
-      if (!_skip_nodes) {
-        writeRedNodes();
-        writeBlueNodes();
-      } else {
-        createRedNodeIndex();
-        createBlueNodeIndex();
-      }
-      if (!_skip_edges) {
-        writeEdges();
-      } else {
-        createEdgeIndex();
-      }
-      writeAttributes();
-    }
-
-    /// \brief Give back the stream of the writer
-    ///
-    /// Give back the stream of the writer
-    std::ostream& ostream() {
-      return *_os;
-    }
-
-    /// @}
-  };
-
-  /// \ingroup lemon_io
-  ///
-  /// \brief Return a \ref lemon::BpGraphWriter "BpGraphWriter" class
-  ///
-  /// This function just returns a \ref lemon::BpGraphWriter
-  /// "BpGraphWriter" class.
-  ///
-  /// With this function a bipartite graph can be write to a file or output
-  /// stream in \ref lgf-format "LGF" format with several maps and
-  /// attributes. For example, with the following code a bipartite
-  /// weighted matching problem can be written to the standard output,
-  /// i.e. a graph with a \e weight map on the edges:
-  ///
-  ///\code
-  ///ListBpGraph graph;
-  ///ListBpGraph::EdgeMap<int> weight(graph);
-  ///  // Setting the weight map
-  ///bpGraphWriter(graph, std::cout).
-  ///  edgeMap("weight", weight).
-  ///  run();
-  ///\endcode
-  ///
-  /// For a complete documentation, please see the
-  /// \ref lemon::BpGraphWriter "BpGraphWriter"
-  /// class documentation.
-  /// \warning Don't forget to put the \ref lemon::BpGraphWriter::run() "run()"
-  /// to the end of the parameter list.
-  /// \relates BpGraphWriter
-  /// \sa bpGraphWriter(const TBGR& graph, const std::string& fn)
-  /// \sa bpGraphWriter(const TBGR& graph, const char* fn)
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, std::ostream& os) {
-    BpGraphWriter<TBGR> tmp(graph, os);
-    return tmp;
-  }
-
-  /// \brief Return a \ref BpGraphWriter class
-  ///
-  /// This function just returns a \ref BpGraphWriter class.
-  /// \relates BpGraphWriter
-  /// \sa graphWriter(const TBGR& graph, std::ostream& os)
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, const std::string& fn) {
-    BpGraphWriter<TBGR> tmp(graph, fn);
-    return tmp;
-  }
-
-  /// \brief Return a \ref BpGraphWriter class
-  ///
-  /// This function just returns a \ref BpGraphWriter class.
-  /// \relates BpGraphWriter
-  /// \sa graphWriter(const TBGR& graph, std::ostream& os)
-  template <typename TBGR>
-  BpGraphWriter<TBGR> bpGraphWriter(const TBGR& graph, const char* fn) {
-    BpGraphWriter<TBGR> tmp(graph, fn);
     return tmp;
   }
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 1270)
+++ lemon/list_graph.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -446,5 +446,5 @@
     ///or changeTarget(), thus \c ArcIt and \c OutArcIt iterators are
     ///invalidated for the outgoing arcs of node \c v and \c InArcIt
-    ///iterators are invalidated for the incoming arcs of \c v.
+    ///iterators are invalidated for the incomming arcs of \c v.
     ///Moreover all iterators referencing node \c v or the removed
     ///loops are also invalidated. Other iterators remain valid.
@@ -1600,909 +1600,4 @@
 
   /// @}
-
-  class ListBpGraphBase {
-
-  protected:
-
-    struct NodeT {
-      int first_out;
-      int prev, next;
-      int partition_prev, partition_next;
-      int partition_index;
-      bool red;
-    };
-
-    struct ArcT {
-      int target;
-      int prev_out, next_out;
-    };
-
-    std::vector<NodeT> nodes;
-
-    int first_node, first_red, first_blue;
-    int max_red, max_blue;
-
-    int first_free_red, first_free_blue;
-
-    std::vector<ArcT> arcs;
-
-    int first_free_arc;
-
-  public:
-
-    typedef ListBpGraphBase BpGraph;
-
-    class Node {
-      friend class ListBpGraphBase;
-    protected:
-
-      int id;
-      explicit Node(int pid) { id = pid;}
-
-    public:
-      Node() {}
-      Node (Invalid) { id = -1; }
-      bool operator==(const Node& node) const {return id == node.id;}
-      bool operator!=(const Node& node) const {return id != node.id;}
-      bool operator<(const Node& node) const {return id < node.id;}
-    };
-
-    class RedNode : public Node {
-      friend class ListBpGraphBase;
-    protected:
-
-      explicit RedNode(int pid) : Node(pid) {}
-
-    public:
-      RedNode() {}
-      RedNode(const RedNode& node) : Node(node) {}
-      RedNode(Invalid) : Node(INVALID){}
-    };
-
-    class BlueNode : public Node {
-      friend class ListBpGraphBase;
-    protected:
-
-      explicit BlueNode(int pid) : Node(pid) {}
-
-    public:
-      BlueNode() {}
-      BlueNode(const BlueNode& node) : Node(node) {}
-      BlueNode(Invalid) : Node(INVALID){}
-    };
-
-    class Edge {
-      friend class ListBpGraphBase;
-    protected:
-
-      int id;
-      explicit Edge(int pid) { id = pid;}
-
-    public:
-      Edge() {}
-      Edge (Invalid) { id = -1; }
-      bool operator==(const Edge& edge) const {return id == edge.id;}
-      bool operator!=(const Edge& edge) const {return id != edge.id;}
-      bool operator<(const Edge& edge) const {return id < edge.id;}
-    };
-
-    class Arc {
-      friend class ListBpGraphBase;
-    protected:
-
-      int id;
-      explicit Arc(int pid) { id = pid;}
-
-    public:
-      operator Edge() const {
-        return id != -1 ? edgeFromId(id / 2) : INVALID;
-      }
-
-      Arc() {}
-      Arc (Invalid) { id = -1; }
-      bool operator==(const Arc& arc) const {return id == arc.id;}
-      bool operator!=(const Arc& arc) const {return id != arc.id;}
-      bool operator<(const Arc& arc) const {return id < arc.id;}
-    };
-
-    ListBpGraphBase()
-      : nodes(), first_node(-1),
-        first_red(-1), first_blue(-1),
-        max_red(-1), max_blue(-1),
-        first_free_red(-1), first_free_blue(-1),
-        arcs(), first_free_arc(-1) {}
-
-
-    bool red(Node n) const { return nodes[n.id].red; }
-    bool blue(Node n) const { return !nodes[n.id].red; }
-
-    static RedNode asRedNodeUnsafe(Node n) { return RedNode(n.id); }
-    static BlueNode asBlueNodeUnsafe(Node n) { return BlueNode(n.id); }
-
-    int maxNodeId() const { return nodes.size()-1; }
-    int maxRedId() const { return max_red; }
-    int maxBlueId() const { return max_blue; }
-    int maxEdgeId() const { return arcs.size() / 2 - 1; }
-    int maxArcId() const { return arcs.size()-1; }
-
-    Node source(Arc e) const { return Node(arcs[e.id ^ 1].target); }
-    Node target(Arc e) const { return Node(arcs[e.id].target); }
-
-    RedNode redNode(Edge e) const {
-      return RedNode(arcs[2 * e.id].target);
-    }
-    BlueNode blueNode(Edge e) const {
-      return BlueNode(arcs[2 * e.id + 1].target);
-    }
-
-    static bool direction(Arc e) {
-      return (e.id & 1) == 1;
-    }
-
-    static Arc direct(Edge e, bool d) {
-      return Arc(e.id * 2 + (d ? 1 : 0));
-    }
-
-    void first(Node& node) const {
-      node.id = first_node;
-    }
-
-    void next(Node& node) const {
-      node.id = nodes[node.id].next;
-    }
-
-    void first(RedNode& node) const {
-      node.id = first_red;
-    }
-
-    void next(RedNode& node) const {
-      node.id = nodes[node.id].partition_next;
-    }
-
-    void first(BlueNode& node) const {
-      node.id = first_blue;
-    }
-
-    void next(BlueNode& node) const {
-      node.id = nodes[node.id].partition_next;
-    }
-
-    void first(Arc& e) const {
-      int n = first_node;
-      while (n != -1 && nodes[n].first_out == -1) {
-        n = nodes[n].next;
-      }
-      e.id = (n == -1) ? -1 : nodes[n].first_out;
-    }
-
-    void next(Arc& e) const {
-      if (arcs[e.id].next_out != -1) {
-        e.id = arcs[e.id].next_out;
-      } else {
-        int n = nodes[arcs[e.id ^ 1].target].next;
-        while(n != -1 && nodes[n].first_out == -1) {
-          n = nodes[n].next;
-        }
-        e.id = (n == -1) ? -1 : nodes[n].first_out;
-      }
-    }
-
-    void first(Edge& e) const {
-      int n = first_node;
-      while (n != -1) {
-        e.id = nodes[n].first_out;
-        while ((e.id & 1) != 1) {
-          e.id = arcs[e.id].next_out;
-        }
-        if (e.id != -1) {
-          e.id /= 2;
-          return;
-        }
-        n = nodes[n].next;
-      }
-      e.id = -1;
-    }
-
-    void next(Edge& e) const {
-      int n = arcs[e.id * 2].target;
-      e.id = arcs[(e.id * 2) | 1].next_out;
-      while ((e.id & 1) != 1) {
-        e.id = arcs[e.id].next_out;
-      }
-      if (e.id != -1) {
-        e.id /= 2;
-        return;
-      }
-      n = nodes[n].next;
-      while (n != -1) {
-        e.id = nodes[n].first_out;
-        while ((e.id & 1) != 1) {
-          e.id = arcs[e.id].next_out;
-        }
-        if (e.id != -1) {
-          e.id /= 2;
-          return;
-        }
-        n = nodes[n].next;
-      }
-      e.id = -1;
-    }
-
-    void firstOut(Arc &e, const Node& v) const {
-      e.id = nodes[v.id].first_out;
-    }
-    void nextOut(Arc &e) const {
-      e.id = arcs[e.id].next_out;
-    }
-
-    void firstIn(Arc &e, const Node& v) const {
-      e.id = ((nodes[v.id].first_out) ^ 1);
-      if (e.id == -2) e.id = -1;
-    }
-    void nextIn(Arc &e) const {
-      e.id = ((arcs[e.id ^ 1].next_out) ^ 1);
-      if (e.id == -2) e.id = -1;
-    }
-
-    void firstInc(Edge &e, bool& d, const Node& v) const {
-      int a = nodes[v.id].first_out;
-      if (a != -1 ) {
-        e.id = a / 2;
-        d = ((a & 1) == 1);
-      } else {
-        e.id = -1;
-        d = true;
-      }
-    }
-    void nextInc(Edge &e, bool& d) const {
-      int a = (arcs[(e.id * 2) | (d ? 1 : 0)].next_out);
-      if (a != -1 ) {
-        e.id = a / 2;
-        d = ((a & 1) == 1);
-      } else {
-        e.id = -1;
-        d = true;
-      }
-    }
-
-    static int id(Node v) { return v.id; }
-    int id(RedNode v) const { return nodes[v.id].partition_index; }
-    int id(BlueNode v) const { return nodes[v.id].partition_index; }
-    static int id(Arc e) { return e.id; }
-    static int id(Edge e) { return e.id; }
-
-    static Node nodeFromId(int id) { return Node(id);}
-    static Arc arcFromId(int id) { return Arc(id);}
-    static Edge edgeFromId(int id) { return Edge(id);}
-
-    bool valid(Node n) const {
-      return n.id >= 0 && n.id < static_cast<int>(nodes.size()) &&
-        nodes[n.id].prev != -2;
-    }
-
-    bool valid(Arc a) const {
-      return a.id >= 0 && a.id < static_cast<int>(arcs.size()) &&
-        arcs[a.id].prev_out != -2;
-    }
-
-    bool valid(Edge e) const {
-      return e.id >= 0 && 2 * e.id < static_cast<int>(arcs.size()) &&
-        arcs[2 * e.id].prev_out != -2;
-    }
-
-    RedNode addRedNode() {
-      int n;
-
-      if(first_free_red==-1) {
-        n = nodes.size();
-        nodes.push_back(NodeT());
-        nodes[n].partition_index = ++max_red;
-        nodes[n].red = true;
-      } else {
-        n = first_free_red;
-        first_free_red = nodes[n].next;
-      }
-
-      nodes[n].next = first_node;
-      if (first_node != -1) nodes[first_node].prev = n;
-      first_node = n;
-      nodes[n].prev = -1;
-
-      nodes[n].partition_next = first_red;
-      if (first_red != -1) nodes[first_red].partition_prev = n;
-      first_red = n;
-      nodes[n].partition_prev = -1;
-
-      nodes[n].first_out = -1;
-
-      return RedNode(n);
-    }
-
-    BlueNode addBlueNode() {
-      int n;
-
-      if(first_free_blue==-1) {
-        n = nodes.size();
-        nodes.push_back(NodeT());
-        nodes[n].partition_index = ++max_blue;
-        nodes[n].red = false;
-      } else {
-        n = first_free_blue;
-        first_free_blue = nodes[n].next;
-      }
-
-      nodes[n].next = first_node;
-      if (first_node != -1) nodes[first_node].prev = n;
-      first_node = n;
-      nodes[n].prev = -1;
-
-      nodes[n].partition_next = first_blue;
-      if (first_blue != -1) nodes[first_blue].partition_prev = n;
-      first_blue = n;
-      nodes[n].partition_prev = -1;
-
-      nodes[n].first_out = -1;
-
-      return BlueNode(n);
-    }
-
-    Edge addEdge(Node u, Node v) {
-      int n;
-
-      if (first_free_arc == -1) {
-        n = arcs.size();
-        arcs.push_back(ArcT());
-        arcs.push_back(ArcT());
-      } else {
-        n = first_free_arc;
-        first_free_arc = arcs[n].next_out;
-      }
-
-      arcs[n].target = u.id;
-      arcs[n | 1].target = v.id;
-
-      arcs[n].next_out = nodes[v.id].first_out;
-      if (nodes[v.id].first_out != -1) {
-        arcs[nodes[v.id].first_out].prev_out = n;
-      }
-      arcs[n].prev_out = -1;
-      nodes[v.id].first_out = n;
-
-      arcs[n | 1].next_out = nodes[u.id].first_out;
-      if (nodes[u.id].first_out != -1) {
-        arcs[nodes[u.id].first_out].prev_out = (n | 1);
-      }
-      arcs[n | 1].prev_out = -1;
-      nodes[u.id].first_out = (n | 1);
-
-      return Edge(n / 2);
-    }
-
-    void erase(const Node& node) {
-      int n = node.id;
-
-      if(nodes[n].next != -1) {
-        nodes[nodes[n].next].prev = nodes[n].prev;
-      }
-
-      if(nodes[n].prev != -1) {
-        nodes[nodes[n].prev].next = nodes[n].next;
-      } else {
-        first_node = nodes[n].next;
-      }
-
-      if (nodes[n].partition_next != -1) {
-        nodes[nodes[n].partition_next].partition_prev = nodes[n].partition_prev;
-      }
-
-      if (nodes[n].partition_prev != -1) {
-        nodes[nodes[n].partition_prev].partition_next = nodes[n].partition_next;
-      } else {
-        if (nodes[n].red) {
-          first_red = nodes[n].partition_next;
-        } else {
-          first_blue = nodes[n].partition_next;
-        }
-      }
-
-      if (nodes[n].red) {
-        nodes[n].next = first_free_red;
-        first_free_red = n;
-      } else {
-        nodes[n].next = first_free_blue;
-        first_free_blue = n;
-      }
-      nodes[n].prev = -2;
-    }
-
-    void erase(const Edge& edge) {
-      int n = edge.id * 2;
-
-      if (arcs[n].next_out != -1) {
-        arcs[arcs[n].next_out].prev_out = arcs[n].prev_out;
-      }
-
-      if (arcs[n].prev_out != -1) {
-        arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
-      } else {
-        nodes[arcs[n | 1].target].first_out = arcs[n].next_out;
-      }
-
-      if (arcs[n | 1].next_out != -1) {
-        arcs[arcs[n | 1].next_out].prev_out = arcs[n | 1].prev_out;
-      }
-
-      if (arcs[n | 1].prev_out != -1) {
-        arcs[arcs[n | 1].prev_out].next_out = arcs[n | 1].next_out;
-      } else {
-        nodes[arcs[n].target].first_out = arcs[n | 1].next_out;
-      }
-
-      arcs[n].next_out = first_free_arc;
-      first_free_arc = n;
-      arcs[n].prev_out = -2;
-      arcs[n | 1].prev_out = -2;
-
-    }
-
-    void clear() {
-      arcs.clear();
-      nodes.clear();
-      first_node = first_free_arc = first_red = first_blue =
-        max_red = max_blue = first_free_red = first_free_blue = -1;
-    }
-
-  protected:
-
-    void changeRed(Edge e, RedNode n) {
-      if(arcs[(2 * e.id) | 1].next_out != -1) {
-        arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
-          arcs[(2 * e.id) | 1].prev_out;
-      }
-      if(arcs[(2 * e.id) | 1].prev_out != -1) {
-        arcs[arcs[(2 * e.id) | 1].prev_out].next_out =
-          arcs[(2 * e.id) | 1].next_out;
-      } else {
-        nodes[arcs[2 * e.id].target].first_out =
-          arcs[(2 * e.id) | 1].next_out;
-      }
-
-      if (nodes[n.id].first_out != -1) {
-        arcs[nodes[n.id].first_out].prev_out = ((2 * e.id) | 1);
-      }
-      arcs[2 * e.id].target = n.id;
-      arcs[(2 * e.id) | 1].prev_out = -1;
-      arcs[(2 * e.id) | 1].next_out = nodes[n.id].first_out;
-      nodes[n.id].first_out = ((2 * e.id) | 1);
-    }
-
-    void changeBlue(Edge e, BlueNode n) {
-       if(arcs[2 * e.id].next_out != -1) {
-        arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
-      }
-      if(arcs[2 * e.id].prev_out != -1) {
-        arcs[arcs[2 * e.id].prev_out].next_out =
-          arcs[2 * e.id].next_out;
-      } else {
-        nodes[arcs[(2 * e.id) | 1].target].first_out =
-          arcs[2 * e.id].next_out;
-      }
-
-      if (nodes[n.id].first_out != -1) {
-        arcs[nodes[n.id].first_out].prev_out = 2 * e.id;
-      }
-      arcs[(2 * e.id) | 1].target = n.id;
-      arcs[2 * e.id].prev_out = -1;
-      arcs[2 * e.id].next_out = nodes[n.id].first_out;
-      nodes[n.id].first_out = 2 * e.id;
-    }
-
-  };
-
-  typedef BpGraphExtender<ListBpGraphBase> ExtendedListBpGraphBase;
-
-
-  /// \addtogroup graphs
-  /// @{
-
-  ///A general undirected graph structure.
-
-  ///\ref ListBpGraph is a versatile and fast undirected graph
-  ///implementation based on linked lists that are stored in
-  ///\c std::vector structures.
-  ///
-  ///This type fully conforms to the \ref concepts::BpGraph "BpGraph concept"
-  ///and it also provides several useful additional functionalities.
-  ///Most of its member functions and nested classes are documented
-  ///only in the concept class.
-  ///
-  ///This class provides only linear time counting for nodes, edges and arcs.
-  ///
-  ///\sa concepts::BpGraph
-  ///\sa ListDigraph
-  class ListBpGraph : public ExtendedListBpGraphBase {
-    typedef ExtendedListBpGraphBase Parent;
-
-  private:
-    /// BpGraphs are \e not copy constructible. Use BpGraphCopy instead.
-    ListBpGraph(const ListBpGraph &) :ExtendedListBpGraphBase()  {};
-    /// \brief Assignment of a graph to another one is \e not allowed.
-    /// Use BpGraphCopy instead.
-    void operator=(const ListBpGraph &) {}
-  public:
-    /// Constructor
-
-    /// Constructor.
-    ///
-    ListBpGraph() {}
-
-    typedef Parent::OutArcIt IncEdgeIt;
-
-    /// \brief Add a new red node to the graph.
-    ///
-    /// This function adds a red new node to the graph.
-    /// \return The new node.
-    RedNode addRedNode() { return Parent::addRedNode(); }
-
-    /// \brief Add a new blue node to the graph.
-    ///
-    /// This function adds a blue new node to the graph.
-    /// \return The new node.
-    BlueNode addBlueNode() { return Parent::addBlueNode(); }
-
-    /// \brief Add a new edge to the graph.
-    ///
-    /// This function adds a new edge to the graph between nodes
-    /// \c u and \c v with inherent orientation from node \c u to
-    /// node \c v.
-    /// \return The new edge.
-    Edge addEdge(RedNode u, BlueNode v) {
-      return Parent::addEdge(u, v);
-    }
-    Edge addEdge(BlueNode v, RedNode u) {
-      return Parent::addEdge(u, v);
-    }
-
-    ///\brief Erase a node from the graph.
-    ///
-    /// This function erases the given node along with its incident arcs
-    /// from the graph.
-    ///
-    /// \note All iterators referencing the removed node or the incident
-    /// edges are invalidated, of course.
-    void erase(Node n) { Parent::erase(n); }
-
-    ///\brief Erase an edge from the graph.
-    ///
-    /// This function erases the given edge from the graph.
-    ///
-    /// \note All iterators referencing the removed edge are invalidated,
-    /// of course.
-    void erase(Edge e) { Parent::erase(e); }
-    /// Node validity check
-
-    /// This function gives back \c true if the given node is valid,
-    /// i.e. it is a real node of the graph.
-    ///
-    /// \warning A removed node could become valid again if new nodes are
-    /// added to the graph.
-    bool valid(Node n) const { return Parent::valid(n); }
-    /// Edge validity check
-
-    /// This function gives back \c true if the given edge is valid,
-    /// i.e. it is a real edge of the graph.
-    ///
-    /// \warning A removed edge could become valid again if new edges are
-    /// added to the graph.
-    bool valid(Edge e) const { return Parent::valid(e); }
-    /// Arc validity check
-
-    /// This function gives back \c true if the given arc is valid,
-    /// i.e. it is a real arc of the graph.
-    ///
-    /// \warning A removed arc could become valid again if new edges are
-    /// added to the graph.
-    bool valid(Arc a) const { return Parent::valid(a); }
-
-    /// \brief Change the red node of an edge.
-    ///
-    /// This function changes the red node of the given edge \c e to \c n.
-    ///
-    ///\note \c EdgeIt and \c ArcIt iterators referencing the
-    ///changed edge are invalidated and all other iterators whose
-    ///base node is the changed node are also invalidated.
-    ///
-    ///\warning This functionality cannot be used together with the
-    ///Snapshot feature.
-    void changeRed(Edge e, RedNode n) {
-      Parent::changeRed(e, n);
-    }
-    /// \brief Change the blue node of an edge.
-    ///
-    /// This function changes the blue node of the given edge \c e to \c n.
-    ///
-    ///\note \c EdgeIt iterators referencing the changed edge remain
-    ///valid, but \c ArcIt iterators referencing the changed edge and
-    ///all other iterators whose base node is the changed node are also
-    ///invalidated.
-    ///
-    ///\warning This functionality cannot be used together with the
-    ///Snapshot feature.
-    void changeBlue(Edge e, BlueNode n) {
-      Parent::changeBlue(e, n);
-    }
-
-    ///Clear the graph.
-
-    ///This function erases all nodes and arcs from the graph.
-    ///
-    ///\note All iterators of the graph are invalidated, of course.
-    void clear() {
-      Parent::clear();
-    }
-
-    /// Reserve memory for nodes.
-
-    /// Using this function, it is possible to avoid superfluous memory
-    /// allocation: if you know that the graph you want to build will
-    /// be large (e.g. it will contain millions of nodes and/or edges),
-    /// then it is worth reserving space for this amount before starting
-    /// to build the graph.
-    /// \sa reserveEdge()
-    void reserveNode(int n) { nodes.reserve(n); };
-
-    /// Reserve memory for edges.
-
-    /// Using this function, it is possible to avoid superfluous memory
-    /// allocation: if you know that the graph you want to build will
-    /// be large (e.g. it will contain millions of nodes and/or edges),
-    /// then it is worth reserving space for this amount before starting
-    /// to build the graph.
-    /// \sa reserveNode()
-    void reserveEdge(int m) { arcs.reserve(2 * m); };
-
-    /// \brief Class to make a snapshot of the graph and restore
-    /// it later.
-    ///
-    /// Class to make a snapshot of the graph and restore it later.
-    ///
-    /// The newly added nodes and edges can be removed
-    /// using the restore() function.
-    ///
-    /// \note After a state is restored, you cannot restore a later state,
-    /// i.e. you cannot add the removed nodes and edges again using
-    /// another Snapshot instance.
-    ///
-    /// \warning Node and edge deletions and other modifications
-    /// (e.g. changing the end-nodes of edges or contracting nodes)
-    /// cannot be restored. These events invalidate the snapshot.
-    /// However, the edges and nodes that were added to the graph after
-    /// making the current snapshot can be removed without invalidating it.
-    class Snapshot {
-    protected:
-
-      typedef Parent::NodeNotifier NodeNotifier;
-
-      class NodeObserverProxy : public NodeNotifier::ObserverBase {
-      public:
-
-        NodeObserverProxy(Snapshot& _snapshot)
-          : snapshot(_snapshot) {}
-
-        using NodeNotifier::ObserverBase::attach;
-        using NodeNotifier::ObserverBase::detach;
-        using NodeNotifier::ObserverBase::attached;
-
-      protected:
-
-        virtual void add(const Node& node) {
-          snapshot.addNode(node);
-        }
-        virtual void add(const std::vector<Node>& nodes) {
-          for (int i = nodes.size() - 1; i >= 0; ++i) {
-            snapshot.addNode(nodes[i]);
-          }
-        }
-        virtual void erase(const Node& node) {
-          snapshot.eraseNode(node);
-        }
-        virtual void erase(const std::vector<Node>& nodes) {
-          for (int i = 0; i < int(nodes.size()); ++i) {
-            snapshot.eraseNode(nodes[i]);
-          }
-        }
-        virtual void build() {
-          Node node;
-          std::vector<Node> nodes;
-          for (notifier()->first(node); node != INVALID;
-               notifier()->next(node)) {
-            nodes.push_back(node);
-          }
-          for (int i = nodes.size() - 1; i >= 0; --i) {
-            snapshot.addNode(nodes[i]);
-          }
-        }
-        virtual void clear() {
-          Node node;
-          for (notifier()->first(node); node != INVALID;
-               notifier()->next(node)) {
-            snapshot.eraseNode(node);
-          }
-        }
-
-        Snapshot& snapshot;
-      };
-
-      class EdgeObserverProxy : public EdgeNotifier::ObserverBase {
-      public:
-
-        EdgeObserverProxy(Snapshot& _snapshot)
-          : snapshot(_snapshot) {}
-
-        using EdgeNotifier::ObserverBase::attach;
-        using EdgeNotifier::ObserverBase::detach;
-        using EdgeNotifier::ObserverBase::attached;
-
-      protected:
-
-        virtual void add(const Edge& edge) {
-          snapshot.addEdge(edge);
-        }
-        virtual void add(const std::vector<Edge>& edges) {
-          for (int i = edges.size() - 1; i >= 0; ++i) {
-            snapshot.addEdge(edges[i]);
-          }
-        }
-        virtual void erase(const Edge& edge) {
-          snapshot.eraseEdge(edge);
-        }
-        virtual void erase(const std::vector<Edge>& edges) {
-          for (int i = 0; i < int(edges.size()); ++i) {
-            snapshot.eraseEdge(edges[i]);
-          }
-        }
-        virtual void build() {
-          Edge edge;
-          std::vector<Edge> edges;
-          for (notifier()->first(edge); edge != INVALID;
-               notifier()->next(edge)) {
-            edges.push_back(edge);
-          }
-          for (int i = edges.size() - 1; i >= 0; --i) {
-            snapshot.addEdge(edges[i]);
-          }
-        }
-        virtual void clear() {
-          Edge edge;
-          for (notifier()->first(edge); edge != INVALID;
-               notifier()->next(edge)) {
-            snapshot.eraseEdge(edge);
-          }
-        }
-
-        Snapshot& snapshot;
-      };
-
-      ListBpGraph *graph;
-
-      NodeObserverProxy node_observer_proxy;
-      EdgeObserverProxy edge_observer_proxy;
-
-      std::list<Node> added_nodes;
-      std::list<Edge> added_edges;
-
-
-      void addNode(const Node& node) {
-        added_nodes.push_front(node);
-      }
-      void eraseNode(const Node& node) {
-        std::list<Node>::iterator it =
-          std::find(added_nodes.begin(), added_nodes.end(), node);
-        if (it == added_nodes.end()) {
-          clear();
-          edge_observer_proxy.detach();
-          throw NodeNotifier::ImmediateDetach();
-        } else {
-          added_nodes.erase(it);
-        }
-      }
-
-      void addEdge(const Edge& edge) {
-        added_edges.push_front(edge);
-      }
-      void eraseEdge(const Edge& edge) {
-        std::list<Edge>::iterator it =
-          std::find(added_edges.begin(), added_edges.end(), edge);
-        if (it == added_edges.end()) {
-          clear();
-          node_observer_proxy.detach();
-          throw EdgeNotifier::ImmediateDetach();
-        } else {
-          added_edges.erase(it);
-        }
-      }
-
-      void attach(ListBpGraph &_graph) {
-        graph = &_graph;
-        node_observer_proxy.attach(graph->notifier(Node()));
-        edge_observer_proxy.attach(graph->notifier(Edge()));
-      }
-
-      void detach() {
-        node_observer_proxy.detach();
-        edge_observer_proxy.detach();
-      }
-
-      bool attached() const {
-        return node_observer_proxy.attached();
-      }
-
-      void clear() {
-        added_nodes.clear();
-        added_edges.clear();
-      }
-
-    public:
-
-      /// \brief Default constructor.
-      ///
-      /// Default constructor.
-      /// You have to call save() to actually make a snapshot.
-      Snapshot()
-        : graph(0), node_observer_proxy(*this),
-          edge_observer_proxy(*this) {}
-
-      /// \brief Constructor that immediately makes a snapshot.
-      ///
-      /// This constructor immediately makes a snapshot of the given graph.
-      Snapshot(ListBpGraph &gr)
-        : node_observer_proxy(*this),
-          edge_observer_proxy(*this) {
-        attach(gr);
-      }
-
-      /// \brief Make a snapshot.
-      ///
-      /// This function makes a snapshot of the given graph.
-      /// It can be called more than once. In case of a repeated
-      /// call, the previous snapshot gets lost.
-      void save(ListBpGraph &gr) {
-        if (attached()) {
-          detach();
-          clear();
-        }
-        attach(gr);
-      }
-
-      /// \brief Undo the changes until the last snapshot.
-      ///
-      /// This function undos the changes until the last snapshot
-      /// created by save() or Snapshot(ListBpGraph&).
-      ///
-      /// \warning This method invalidates the snapshot, i.e. repeated
-      /// restoring is not supported unless you call save() again.
-      void restore() {
-        detach();
-        for(std::list<Edge>::iterator it = added_edges.begin();
-            it != added_edges.end(); ++it) {
-          graph->erase(*it);
-        }
-        for(std::list<Node>::iterator it = added_nodes.begin();
-            it != added_nodes.end(); ++it) {
-          graph->erase(*it);
-        }
-        clear();
-      }
-
-      /// \brief Returns \c true if the snapshot is valid.
-      ///
-      /// This function returns \c true if the snapshot is valid.
-      bool valid() const {
-        return attached();
-      }
-    };
-  };
-
-  /// @}
 } //namespace lemon
 
Index: lemon/lp.h
===================================================================
--- lemon/lp.h	(revision 1270)
+++ lemon/lp.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -60,5 +60,5 @@
   ///\ingroup lp_group
   ///
-  ///Currently, the possible values are \c GLPK, \c CPLEX or \c CBC
+  ///Currently, the possible values are \c GLPK or \c CPLEX
 #define LEMON_DEFAULT_MIP SOLVER
   ///The default MIP solver.
@@ -67,22 +67,23 @@
   ///\ingroup lp_group
   ///
-  ///Currently, it is either \c GlpkMip, \c CplexMip , \c CbcMip
+  ///Currently, it is either \c GlpkMip or \c CplexMip
   typedef GlpkMip Mip;
 #else
-#if LEMON_DEFAULT_LP == GLPK
+#ifdef LEMON_HAVE_GLPK
+# define LEMON_DEFAULT_LP GLPK
   typedef GlpkLp Lp;
-#elif LEMON_DEFAULT_LP == CPLEX
+# define LEMON_DEFAULT_MIP GLPK
+  typedef GlpkMip Mip;
+#elif LEMON_HAVE_CPLEX
+# define LEMON_DEFAULT_LP CPLEX
   typedef CplexLp Lp;
-#elif LEMON_DEFAULT_LP == SOPLEX
+# define LEMON_DEFAULT_MIP CPLEX
+  typedef CplexMip Mip;
+#elif LEMON_HAVE_SOPLEX
+# define DEFAULT_LP SOPLEX
   typedef SoplexLp Lp;
-#elif LEMON_DEFAULT_LP == CLP
+#elif LEMON_HAVE_CLP
+# define DEFAULT_LP CLP
   typedef ClpLp Lp;
-#endif
-#if LEMON_DEFAULT_MIP == GLPK
-  typedef GlpkLp Mip;
-#elif LEMON_DEFAULT_MIP == CPLEX
-  typedef CplexMip Mip;
-#elif LEMON_DEFAULT_MIP == CBC
-  typedef CbcMip Mip;
 #endif
 #endif
Index: lemon/lp_base.cc
===================================================================
--- lemon/lp_base.cc	(revision 1270)
+++ lemon/lp_base.cc	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 1270)
+++ lemon/lp_base.h	(revision 1143)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -1008,34 +1008,4 @@
   public:
 
-    ///Unsupported file format exception
-    class UnsupportedFormatError : public Exception
-    {
-      std::string _format;
-      mutable std::string _what;
-    public:
-      explicit UnsupportedFormatError(std::string format) throw()
-        : _format(format) { }
-      virtual ~UnsupportedFormatError() throw() {}
-      virtual const char* what() const throw() {
-        try {
-          _what.clear();
-          std::ostringstream oss;
-          oss << "lemon::UnsupportedFormatError: " << _format;
-          _what = oss.str();
-        }
-        catch (...) {}
-        if (!_what.empty()) return _what.c_str();
-        else return "lemon::UnsupportedFormatError";
-      }
-    };
-
-  protected:
-    virtual void _write(std::string, std::string format) const
-    {
-      throw UnsupportedFormatError(format);
-    }
-
-  public:
-
     /// Virtual destructor
     virtual ~LpBase() {}
@@ -1586,24 +1556,9 @@
     void min() { _setSense(MIN); }
 
-    ///Clear the problem
+    ///Clears the problem
     void clear() { _clear(); rows.clear(); cols.clear(); }
 
-    /// Set the message level of the solver
+    /// Sets the message level of the solver
     void messageLevel(MessageLevel level) { _messageLevel(level); }
-
-    /// Write the problem to a file in the given format
-
-    /// This function writes the problem to a file in the given format.
-    /// Different solver backends may support different formats.
-    /// Trying to write in an unsupported format will trigger
-    /// \ref UnsupportedFormatError. For the supported formats,
-    /// visit the documentation of the base class of the related backends
-    /// (\ref CplexBase, \ref GlpkBase etc.)
-    /// \param file The file path
-    /// \param format The output file format.
-    void write(std::string file, std::string format = "MPS") const
-    {
-      _write(file.c_str(),format.c_str());
-    }
 
     ///@}
Index: lemon/lp_skeleton.cc
===================================================================
--- lemon/lp_skeleton.cc	(revision 1270)
+++ lemon/lp_skeleton.cc	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -92,6 +92,4 @@
   void SkeletonSolverBase::_messageLevel(MessageLevel) {}
 
-  void SkeletonSolverBase::_write(std::string, std::string) const {}
-
   LpSkeleton::SolveExitStatus LpSkeleton::_solve() { return SOLVED; }
 
Index: lemon/lp_skeleton.h
===================================================================
--- lemon/lp_skeleton.h	(revision 1270)
+++ lemon/lp_skeleton.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -145,8 +145,4 @@
     ///\e
     virtual void _messageLevel(MessageLevel);
-
-    ///\e
-    virtual void _write(std::string file, std::string format) const;
-
   };
 
@@ -227,5 +223,4 @@
     ///\e
     virtual const char* _solverName() const;
-
   };
 
Index: lemon/maps.h
===================================================================
--- lemon/maps.h	(revision 1270)
+++ lemon/maps.h	(revision 1057)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/matching.h
===================================================================
--- lemon/matching.h	(revision 1270)
+++ lemon/matching.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/math.h
===================================================================
--- lemon/math.h	(revision 1270)
+++ lemon/math.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -66,12 +66,7 @@
     }
 
-  ///Round a value to its closest integer
-  inline double round(double r) {
-    return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
-  }
-
   /// @}
 
 } //namespace lemon
 
-#endif //LEMON_MATH_H
+#endif //LEMON_TOLERANCE_H
Index: lemon/max_cardinality_search.h
===================================================================
--- lemon/max_cardinality_search.h	(revision 1271)
+++ 	(revision )
@@ -1,794 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_MAX_CARDINALITY_SEARCH_H
-#define LEMON_MAX_CARDINALITY_SEARCH_H
-
-
-/// \ingroup search
-/// \file
-/// \brief Maximum cardinality search in undirected digraphs.
-
-#include <lemon/bin_heap.h>
-#include <lemon/bucket_heap.h>
-
-#include <lemon/error.h>
-#include <lemon/maps.h>
-
-#include <functional>
-
-namespace lemon {
-
-  /// \brief Default traits class of MaxCardinalitySearch class.
-  ///
-  /// Default traits class of MaxCardinalitySearch class.
-  /// \param Digraph Digraph type.
-  /// \param CapacityMap Type of capacity map.
-  template <typename GR, typename CAP>
-  struct MaxCardinalitySearchDefaultTraits {
-    /// The digraph type the algorithm runs on.
-    typedef GR Digraph;
-
-    template <typename CM>
-    struct CapMapSelector {
-
-      typedef CM CapacityMap;
-
-      static CapacityMap *createCapacityMap(const Digraph& g) {
-        return new CapacityMap(g);
-      }
-    };
-
-    template <typename CM>
-    struct CapMapSelector<ConstMap<CM, Const<int, 1> > > {
-
-      typedef ConstMap<CM, Const<int, 1> > CapacityMap;
-
-      static CapacityMap *createCapacityMap(const Digraph&) {
-        return new CapacityMap;
-      }
-    };
-
-    /// \brief The type of the map that stores the arc capacities.
-    ///
-    /// The type of the map that stores the arc capacities.
-    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef typename CapMapSelector<CAP>::CapacityMap CapacityMap;
-
-    /// \brief The type of the capacity of the arcs.
-    typedef typename CapacityMap::Value Value;
-
-    /// \brief Instantiates a CapacityMap.
-    ///
-    /// This function instantiates a \ref CapacityMap.
-    /// \param digraph is the digraph, to which we would like to define
-    /// the CapacityMap.
-    static CapacityMap *createCapacityMap(const Digraph& digraph) {
-      return CapMapSelector<CapacityMap>::createCapacityMap(digraph);
-    }
-
-    /// \brief The cross reference type used by heap.
-    ///
-    /// The cross reference type used by heap.
-    /// Usually it is \c Digraph::NodeMap<int>.
-    typedef typename Digraph::template NodeMap<int> HeapCrossRef;
-
-    /// \brief Instantiates a HeapCrossRef.
-    ///
-    /// This function instantiates a \ref HeapCrossRef.
-    /// \param digraph is the digraph, to which we would like to define the
-    /// HeapCrossRef.
-    static HeapCrossRef *createHeapCrossRef(const Digraph &digraph) {
-      return new HeapCrossRef(digraph);
-    }
-
-    template <typename CapacityMap>
-    struct HeapSelector {
-      template <typename Value, typename Ref>
-      struct Selector {
-        typedef BinHeap<Value, Ref, std::greater<Value> > Heap;
-      };
-    };
-
-    template <typename CapacityKey>
-    struct HeapSelector<ConstMap<CapacityKey, Const<int, 1> > > {
-      template <typename Value, typename Ref>
-      struct Selector {
-        typedef BucketHeap<Ref, false > Heap;
-      };
-    };
-
-    /// \brief The heap type used by MaxCardinalitySearch algorithm.
-    ///
-    /// The heap type used by MaxCardinalitySearch algorithm. It should
-    /// maximalize the priorities. The default heap type is
-    /// the \ref BinHeap, but it is specialized when the
-    /// CapacityMap is ConstMap<Digraph::Node, Const<int, 1> >
-    /// to BucketHeap.
-    ///
-    /// \sa MaxCardinalitySearch
-    typedef typename HeapSelector<CapacityMap>
-    ::template Selector<Value, HeapCrossRef>
-    ::Heap Heap;
-
-    /// \brief Instantiates a Heap.
-    ///
-    /// This function instantiates a \ref Heap.
-    /// \param crossref The cross reference of the heap.
-    static Heap *createHeap(HeapCrossRef& crossref) {
-      return new Heap(crossref);
-    }
-
-    /// \brief The type of the map that stores whether a node is processed.
-    ///
-    /// The type of the map that stores whether a node is processed.
-    /// It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    /// By default it is a NullMap.
-    typedef NullMap<typename Digraph::Node, bool> ProcessedMap;
-
-    /// \brief Instantiates a ProcessedMap.
-    ///
-    /// This function instantiates a \ref ProcessedMap.
-    /// \param digraph is the digraph, to which
-    /// we would like to define the \ref ProcessedMap
-#ifdef DOXYGEN
-    static ProcessedMap *createProcessedMap(const Digraph &digraph)
-#else
-    static ProcessedMap *createProcessedMap(const Digraph &)
-#endif
-    {
-      return new ProcessedMap();
-    }
-
-    /// \brief The type of the map that stores the cardinalities of the nodes.
-    ///
-    /// The type of the map that stores the cardinalities of the nodes.
-    /// It must meet the \ref concepts::WriteMap "WriteMap" concept.
-    typedef typename Digraph::template NodeMap<Value> CardinalityMap;
-
-    /// \brief Instantiates a CardinalityMap.
-    ///
-    /// This function instantiates a \ref CardinalityMap.
-    /// \param digraph is the digraph, to which we would like to
-    /// define the \ref CardinalityMap
-    static CardinalityMap *createCardinalityMap(const Digraph &digraph) {
-      return new CardinalityMap(digraph);
-    }
-
-
-  };
-
-  /// \ingroup search
-  ///
-  /// \brief Maximum Cardinality Search algorithm class.
-  ///
-  /// This class provides an efficient implementation of Maximum Cardinality
-  /// Search algorithm. The maximum cardinality search first chooses any
-  /// node of the digraph. Then every time it chooses one unprocessed node
-  /// with maximum cardinality, i.e the sum of capacities on out arcs
-  /// to the nodes
-  /// which were previusly processed.
-  /// If there is a cut in the digraph the algorithm should choose
-  /// again any unprocessed node of the digraph.
-
-  /// The arc capacities are passed to the algorithm using a
-  /// \ref concepts::ReadMap "ReadMap", so it is easy to change it to any
-  /// kind of capacity.
-  ///
-  /// The type of the capacity is determined by the \ref
-  /// concepts::ReadMap::Value "Value" of the capacity map.
-  ///
-  /// It is also possible to change the underlying priority heap.
-  ///
-  ///
-  /// \param GR The digraph type the algorithm runs on. The value of
-  /// Digraph is not used directly by the search algorithm, it
-  /// is only passed to \ref MaxCardinalitySearchDefaultTraits.
-  /// \param CAP This read-only ArcMap determines the capacities of
-  /// the arcs. It is read once for each arc, so the map may involve in
-  /// relatively time consuming process to compute the arc capacity if
-  /// it is necessary. The default map type is \ref
-  /// ConstMap "ConstMap<concepts::Digraph::Arc, Const<int,1> >". The value
-  /// of CapacityMap is not used directly by search algorithm, it is only
-  /// passed to \ref MaxCardinalitySearchDefaultTraits.
-  /// \param TR Traits class to set various data types used by the
-  /// algorithm.  The default traits class is
-  /// \ref MaxCardinalitySearchDefaultTraits
-  /// "MaxCardinalitySearchDefaultTraits<GR, CAP>".
-  /// See \ref MaxCardinalitySearchDefaultTraits
-  /// for the documentation of a MaxCardinalitySearch traits class.
-
-#ifdef DOXYGEN
-  template <typename GR, typename CAP, typename TR>
-#else
-  template <typename GR, typename CAP =
-            ConstMap<typename GR::Arc, Const<int,1> >,
-            typename TR =
-            MaxCardinalitySearchDefaultTraits<GR, CAP> >
-#endif
-  class MaxCardinalitySearch {
-  public:
-
-    typedef TR Traits;
-    ///The type of the underlying digraph.
-    typedef typename Traits::Digraph Digraph;
-
-    ///The type of the capacity of the arcs.
-    typedef typename Traits::CapacityMap::Value Value;
-    ///The type of the map that stores the arc capacities.
-    typedef typename Traits::CapacityMap CapacityMap;
-    ///The type of the map indicating if a node is processed.
-    typedef typename Traits::ProcessedMap ProcessedMap;
-    ///The type of the map that stores the cardinalities of the nodes.
-    typedef typename Traits::CardinalityMap CardinalityMap;
-    ///The cross reference type used for the current heap.
-    typedef typename Traits::HeapCrossRef HeapCrossRef;
-    ///The heap type used by the algorithm. It maximizes the priorities.
-    typedef typename Traits::Heap Heap;
-  private:
-    // Pointer to the underlying digraph.
-    const Digraph *_graph;
-    // Pointer to the capacity map
-    const CapacityMap *_capacity;
-    // Indicates if \ref _capacity is locally allocated (\c true) or not.
-    bool local_capacity;
-    // Pointer to the map of cardinality.
-    CardinalityMap *_cardinality;
-    // Indicates if \ref _cardinality is locally allocated (\c true) or not.
-    bool local_cardinality;
-    // Pointer to the map of processed status of the nodes.
-    ProcessedMap *_processed;
-    // Indicates if \ref _processed is locally allocated (\c true) or not.
-    bool local_processed;
-    // Pointer to the heap cross references.
-    HeapCrossRef *_heap_cross_ref;
-    // Indicates if \ref _heap_cross_ref is locally allocated (\c true) or not.
-    bool local_heap_cross_ref;
-    // Pointer to the heap.
-    Heap *_heap;
-    // Indicates if \ref _heap is locally allocated (\c true) or not.
-    bool local_heap;
-
-  public :
-
-    typedef MaxCardinalitySearch Create;
-
-    ///\name Named template parameters
-
-    ///@{
-
-    template <class T>
-    struct DefCapacityMapTraits : public Traits {
-      typedef T CapacityMap;
-      static CapacityMap *createCapacityMap(const Digraph &) {
-               LEMON_ASSERT(false,"Uninitialized parameter.");
-        return 0;
-      }
-    };
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// CapacityMap type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting CapacityMap type
-    /// for the algorithm.
-    template <class T>
-    struct SetCapacityMap
-      : public MaxCardinalitySearch<Digraph, CapacityMap,
-                                    DefCapacityMapTraits<T> > {
-      typedef MaxCardinalitySearch<Digraph, CapacityMap,
-                                   DefCapacityMapTraits<T> > Create;
-    };
-
-    template <class T>
-    struct DefCardinalityMapTraits : public Traits {
-      typedef T CardinalityMap;
-      static CardinalityMap *createCardinalityMap(const Digraph &)
-      {
-        LEMON_ASSERT(false,"Uninitialized parameter.");
-        return 0;
-      }
-    };
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// CardinalityMap type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting CardinalityMap
-    /// type for the algorithm.
-    template <class T>
-    struct SetCardinalityMap
-      : public MaxCardinalitySearch<Digraph, CapacityMap,
-                                    DefCardinalityMapTraits<T> > {
-      typedef MaxCardinalitySearch<Digraph, CapacityMap,
-                                   DefCardinalityMapTraits<T> > Create;
-    };
-
-    template <class T>
-    struct DefProcessedMapTraits : public Traits {
-      typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Digraph &) {
-               LEMON_ASSERT(false,"Uninitialized parameter.");
-        return 0;
-      }
-    };
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// ProcessedMap type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting ProcessedMap type
-    /// for the algorithm.
-    template <class T>
-    struct SetProcessedMap
-      : public MaxCardinalitySearch<Digraph, CapacityMap,
-                                    DefProcessedMapTraits<T> > {
-      typedef MaxCardinalitySearch<Digraph, CapacityMap,
-                                   DefProcessedMapTraits<T> > Create;
-    };
-
-    template <class H, class CR>
-    struct DefHeapTraits : public Traits {
-      typedef CR HeapCrossRef;
-      typedef H Heap;
-      static HeapCrossRef *createHeapCrossRef(const Digraph &) {
-             LEMON_ASSERT(false,"Uninitialized parameter.");
-        return 0;
-      }
-      static Heap *createHeap(HeapCrossRef &) {
-               LEMON_ASSERT(false,"Uninitialized parameter.");
-        return 0;
-      }
-    };
-    /// \brief \ref named-templ-param "Named parameter" for setting heap
-    /// and cross reference type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting heap and cross
-    /// reference type for the algorithm.
-    template <class H, class CR = typename Digraph::template NodeMap<int> >
-    struct SetHeap
-      : public MaxCardinalitySearch<Digraph, CapacityMap,
-                                    DefHeapTraits<H, CR> > {
-      typedef MaxCardinalitySearch< Digraph, CapacityMap,
-                                    DefHeapTraits<H, CR> > Create;
-    };
-
-    template <class H, class CR>
-    struct DefStandardHeapTraits : public Traits {
-      typedef CR HeapCrossRef;
-      typedef H Heap;
-      static HeapCrossRef *createHeapCrossRef(const Digraph &digraph) {
-        return new HeapCrossRef(digraph);
-      }
-      static Heap *createHeap(HeapCrossRef &crossref) {
-        return new Heap(crossref);
-      }
-    };
-
-    /// \brief \ref named-templ-param "Named parameter" for setting heap and
-    /// cross reference type with automatic allocation
-    ///
-    /// \ref named-templ-param "Named parameter" for setting heap and cross
-    /// reference type. It can allocate the heap and the cross reference
-    /// object if the cross reference's constructor waits for the digraph as
-    /// parameter and the heap's constructor waits for the cross reference.
-    template <class H, class CR = typename Digraph::template NodeMap<int> >
-    struct SetStandardHeap
-      : public MaxCardinalitySearch<Digraph, CapacityMap,
-                                    DefStandardHeapTraits<H, CR> > {
-      typedef MaxCardinalitySearch<Digraph, CapacityMap,
-                                   DefStandardHeapTraits<H, CR> >
-      Create;
-    };
-
-    ///@}
-
-
-  protected:
-
-    MaxCardinalitySearch() {}
-
-  public:
-
-    /// \brief Constructor.
-    ///
-    ///\param digraph the digraph the algorithm will run on.
-    ///\param capacity the capacity map used by the algorithm.
-    MaxCardinalitySearch(const Digraph& digraph,
-                         const CapacityMap& capacity) :
-      _graph(&digraph),
-      _capacity(&capacity), local_capacity(false),
-      _cardinality(0), local_cardinality(false),
-      _processed(0), local_processed(false),
-      _heap_cross_ref(0), local_heap_cross_ref(false),
-      _heap(0), local_heap(false)
-    { }
-
-    /// \brief Constructor.
-    ///
-    ///\param digraph the digraph the algorithm will run on.
-    ///
-    ///A constant 1 capacity map will be allocated.
-    MaxCardinalitySearch(const Digraph& digraph) :
-      _graph(&digraph),
-      _capacity(0), local_capacity(false),
-      _cardinality(0), local_cardinality(false),
-      _processed(0), local_processed(false),
-      _heap_cross_ref(0), local_heap_cross_ref(false),
-      _heap(0), local_heap(false)
-    { }
-
-    /// \brief Destructor.
-    ~MaxCardinalitySearch() {
-      if(local_capacity) delete _capacity;
-      if(local_cardinality) delete _cardinality;
-      if(local_processed) delete _processed;
-      if(local_heap_cross_ref) delete _heap_cross_ref;
-      if(local_heap) delete _heap;
-    }
-
-    /// \brief Sets the capacity map.
-    ///
-    /// Sets the capacity map.
-    /// \return <tt> (*this) </tt>
-    MaxCardinalitySearch &capacityMap(const CapacityMap &m) {
-      if (local_capacity) {
-        delete _capacity;
-        local_capacity=false;
-      }
-      _capacity=&m;
-      return *this;
-    }
-
-    /// \brief Returns a const reference to the capacity map.
-    ///
-    /// Returns a const reference to the capacity map used by
-    /// the algorithm.
-    const CapacityMap &capacityMap() const {
-      return *_capacity;
-    }
-
-    /// \brief Sets the map storing the cardinalities calculated by the
-    /// algorithm.
-    ///
-    /// Sets the map storing the cardinalities calculated by the algorithm.
-    /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destuctor deallocates this
-    /// automatically allocated map, of course.
-    /// \return <tt> (*this) </tt>
-    MaxCardinalitySearch &cardinalityMap(CardinalityMap &m) {
-      if(local_cardinality) {
-        delete _cardinality;
-        local_cardinality=false;
-      }
-      _cardinality = &m;
-      return *this;
-    }
-
-    /// \brief Sets the map storing the processed nodes.
-    ///
-    /// Sets the map storing the processed nodes.
-    /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destuctor deallocates this
-    /// automatically allocated map, of course.
-    /// \return <tt> (*this) </tt>
-    MaxCardinalitySearch &processedMap(ProcessedMap &m)
-    {
-      if(local_processed) {
-        delete _processed;
-        local_processed=false;
-      }
-      _processed = &m;
-      return *this;
-    }
-
-    /// \brief Returns a const reference to the cardinality map.
-    ///
-    /// Returns a const reference to the cardinality map used by
-    /// the algorithm.
-    const ProcessedMap &processedMap() const {
-      return *_processed;
-    }
-
-    /// \brief Sets the heap and the cross reference used by algorithm.
-    ///
-    /// Sets the heap and the cross reference used by algorithm.
-    /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destuctor deallocates this
-    /// automatically allocated map, of course.
-    /// \return <tt> (*this) </tt>
-    MaxCardinalitySearch &heap(Heap& hp, HeapCrossRef &cr) {
-      if(local_heap_cross_ref) {
-        delete _heap_cross_ref;
-        local_heap_cross_ref = false;
-      }
-      _heap_cross_ref = &cr;
-      if(local_heap) {
-        delete _heap;
-        local_heap = false;
-      }
-      _heap = &hp;
-      return *this;
-    }
-
-    /// \brief Returns a const reference to the heap.
-    ///
-    /// Returns a const reference to the heap used by
-    /// the algorithm.
-    const Heap &heap() const {
-      return *_heap;
-    }
-
-    /// \brief Returns a const reference to the cross reference.
-    ///
-    /// Returns a const reference to the cross reference
-    /// of the heap.
-    const HeapCrossRef &heapCrossRef() const {
-      return *_heap_cross_ref;
-    }
-
-  private:
-
-    typedef typename Digraph::Node Node;
-    typedef typename Digraph::NodeIt NodeIt;
-    typedef typename Digraph::Arc Arc;
-    typedef typename Digraph::InArcIt InArcIt;
-
-    void create_maps() {
-      if(!_capacity) {
-        local_capacity = true;
-        _capacity = Traits::createCapacityMap(*_graph);
-      }
-      if(!_cardinality) {
-        local_cardinality = true;
-        _cardinality = Traits::createCardinalityMap(*_graph);
-      }
-      if(!_processed) {
-        local_processed = true;
-        _processed = Traits::createProcessedMap(*_graph);
-      }
-      if (!_heap_cross_ref) {
-        local_heap_cross_ref = true;
-        _heap_cross_ref = Traits::createHeapCrossRef(*_graph);
-      }
-      if (!_heap) {
-        local_heap = true;
-        _heap = Traits::createHeap(*_heap_cross_ref);
-      }
-    }
-
-    void finalizeNodeData(Node node, Value capacity) {
-      _processed->set(node, true);
-      _cardinality->set(node, capacity);
-    }
-
-  public:
-    /// \name Execution control
-    /// The simplest way to execute the algorithm is to use
-    /// one of the member functions called \ref run().
-    /// \n
-    /// If you need more control on the execution,
-    /// first you must call \ref init(), then you can add several source nodes
-    /// with \ref addSource().
-    /// Finally \ref start() will perform the computation.
-
-    ///@{
-
-    /// \brief Initializes the internal data structures.
-    ///
-    /// Initializes the internal data structures, and clears the heap.
-    void init() {
-      create_maps();
-      _heap->clear();
-      for (NodeIt it(*_graph) ; it != INVALID ; ++it) {
-        _processed->set(it, false);
-        _heap_cross_ref->set(it, Heap::PRE_HEAP);
-      }
-    }
-
-    /// \brief Adds a new source node.
-    ///
-    /// Adds a new source node to the priority heap.
-    ///
-    /// It checks if the node has not yet been added to the heap.
-    void addSource(Node source, Value capacity = 0) {
-      if(_heap->state(source) == Heap::PRE_HEAP) {
-        _heap->push(source, capacity);
-      }
-    }
-
-    /// \brief Processes the next node in the priority heap
-    ///
-    /// Processes the next node in the priority heap.
-    ///
-    /// \return The processed node.
-    ///
-    /// \warning The priority heap must not be empty!
-    Node processNextNode() {
-      Node node = _heap->top();
-      finalizeNodeData(node, _heap->prio());
-      _heap->pop();
-
-      for (InArcIt it(*_graph, node); it != INVALID; ++it) {
-        Node source = _graph->source(it);
-        switch (_heap->state(source)) {
-        case Heap::PRE_HEAP:
-          _heap->push(source, (*_capacity)[it]);
-          break;
-        case Heap::IN_HEAP:
-          _heap->decrease(source, (*_heap)[source] + (*_capacity)[it]);
-          break;
-        case Heap::POST_HEAP:
-          break;
-        }
-      }
-      return node;
-    }
-
-    /// \brief Next node to be processed.
-    ///
-    /// Next node to be processed.
-    ///
-    /// \return The next node to be processed or INVALID if the
-    /// priority heap is empty.
-    Node nextNode() {
-      return !_heap->empty() ? _heap->top() : INVALID;
-    }
-
-    /// \brief Returns \c false if there are nodes
-    /// to be processed in the priority heap
-    ///
-    /// Returns \c false if there are nodes
-    /// to be processed in the priority heap
-    bool emptyQueue() { return _heap->empty(); }
-    /// \brief Returns the number of the nodes to be processed
-    /// in the priority heap
-    ///
-    /// Returns the number of the nodes to be processed in the priority heap
-    int emptySize() { return _heap->size(); }
-
-    /// \brief Executes the algorithm.
-    ///
-    /// Executes the algorithm.
-    ///
-    ///\pre init() must be called and at least one node should be added
-    /// with addSource() before using this function.
-    ///
-    /// This method runs the Maximum Cardinality Search algorithm from the
-    /// source node(s).
-    void start() {
-      while ( !_heap->empty() ) processNextNode();
-    }
-
-    /// \brief Executes the algorithm until \c dest is reached.
-    ///
-    /// Executes the algorithm until \c dest is reached.
-    ///
-    /// \pre init() must be called and at least one node should be added
-    /// with addSource() before using this function.
-    ///
-    /// This method runs the %MaxCardinalitySearch algorithm from the source
-    /// nodes.
-    void start(Node dest) {
-      while ( !_heap->empty() && _heap->top()!=dest ) processNextNode();
-      if ( !_heap->empty() ) finalizeNodeData(_heap->top(), _heap->prio());
-    }
-
-    /// \brief Executes the algorithm until a condition is met.
-    ///
-    /// Executes the algorithm until a condition is met.
-    ///
-    /// \pre init() must be called and at least one node should be added
-    /// with addSource() before using this function.
-    ///
-    /// \param nm must be a bool (or convertible) node map. The algorithm
-    /// will stop when it reaches a node \c v with <tt>nm[v]==true</tt>.
-    template <typename NodeBoolMap>
-    void start(const NodeBoolMap &nm) {
-      while ( !_heap->empty() && !nm[_heap->top()] ) processNextNode();
-      if ( !_heap->empty() ) finalizeNodeData(_heap->top(),_heap->prio());
-    }
-
-    /// \brief Runs the maximum cardinality search algorithm from node \c s.
-    ///
-    /// This method runs the %MaxCardinalitySearch algorithm from a root
-    /// node \c s.
-    ///
-    ///\note d.run(s) is just a shortcut of the following code.
-    ///\code
-    ///  d.init();
-    ///  d.addSource(s);
-    ///  d.start();
-    ///\endcode
-    void run(Node s) {
-      init();
-      addSource(s);
-      start();
-    }
-
-    /// \brief Runs the maximum cardinality search algorithm for the
-    /// whole digraph.
-    ///
-    /// This method runs the %MaxCardinalitySearch algorithm from all
-    /// unprocessed node of the digraph.
-    ///
-    ///\note d.run(s) is just a shortcut of the following code.
-    ///\code
-    ///  d.init();
-    ///  for (NodeIt it(digraph); it != INVALID; ++it) {
-    ///    if (!d.reached(it)) {
-    ///      d.addSource(s);
-    ///      d.start();
-    ///    }
-    ///  }
-    ///\endcode
-    void run() {
-      init();
-      for (NodeIt it(*_graph); it != INVALID; ++it) {
-        if (!reached(it)) {
-          addSource(it);
-          start();
-        }
-      }
-    }
-
-    ///@}
-
-    /// \name Query Functions
-    /// The results of the maximum cardinality search algorithm can be
-    /// obtained using these functions.
-    /// \n
-    /// Before the use of these functions, either run() or start() must be
-    /// called.
-
-    ///@{
-
-    /// \brief The cardinality of a node.
-    ///
-    /// Returns the cardinality of a node.
-    /// \pre \ref run() must be called before using this function.
-    /// \warning If node \c v in unreachable from the root the return value
-    /// of this funcion is undefined.
-    Value cardinality(Node node) const { return (*_cardinality)[node]; }
-
-    /// \brief The current cardinality of a node.
-    ///
-    /// Returns the current cardinality of a node.
-    /// \pre the given node should be reached but not processed
-    Value currentCardinality(Node node) const { return (*_heap)[node]; }
-
-    /// \brief Returns a reference to the NodeMap of cardinalities.
-    ///
-    /// Returns a reference to the NodeMap of cardinalities. \pre \ref run()
-    /// must be called before using this function.
-    const CardinalityMap &cardinalityMap() const { return *_cardinality;}
-
-    /// \brief Checks if a node is reachable from the root.
-    ///
-    /// Returns \c true if \c v is reachable from the root.
-    /// \warning The source nodes are initated as unreached.
-    /// \pre \ref run() must be called before using this function.
-    bool reached(Node v) { return (*_heap_cross_ref)[v] != Heap::PRE_HEAP; }
-
-    /// \brief Checks if a node is processed.
-    ///
-    /// Returns \c true if \c v is processed, i.e. the shortest
-    /// path to \c v has already found.
-    /// \pre \ref run() must be called before using this function.
-    bool processed(Node v) { return (*_heap_cross_ref)[v] == Heap::POST_HEAP; }
-
-    ///@}
-  };
-
-}
-
-#endif
Index: lemon/min_cost_arborescence.h
===================================================================
--- lemon/min_cost_arborescence.h	(revision 1270)
+++ lemon/min_cost_arborescence.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -102,5 +102,5 @@
   /// the minimum cost subgraph that is the union of arborescences with the
   /// given sources and spans all the nodes which are reachable from the
-  /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+m).
+  /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+e).
   ///
   /// The algorithm also provides an optimal dual solution, therefore
@@ -129,5 +129,5 @@
   public:
 
-    /// \brief The \ref lemon::MinCostArborescenceDefaultTraits "traits class"
+    /// \brief The \ref MinCostArborescenceDefaultTraits "traits class"
     /// of the algorithm.
     typedef TR Traits;
Index: lemon/nagamochi_ibaraki.h
===================================================================
--- lemon/nagamochi_ibaraki.h	(revision 1270)
+++ 	(revision )
@@ -1,702 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_NAGAMOCHI_IBARAKI_H
-#define LEMON_NAGAMOCHI_IBARAKI_H
-
-
-/// \ingroup min_cut
-/// \file
-/// \brief Implementation of the Nagamochi-Ibaraki algorithm.
-
-#include <lemon/core.h>
-#include <lemon/bin_heap.h>
-#include <lemon/bucket_heap.h>
-#include <lemon/maps.h>
-#include <lemon/radix_sort.h>
-#include <lemon/unionfind.h>
-
-#include <cassert>
-
-namespace lemon {
-
-  /// \brief Default traits class for NagamochiIbaraki class.
-  ///
-  /// Default traits class for NagamochiIbaraki class.
-  /// \param GR The undirected graph type.
-  /// \param CM Type of capacity map.
-  template <typename GR, typename CM>
-  struct NagamochiIbarakiDefaultTraits {
-    /// The type of the capacity map.
-    typedef typename CM::Value Value;
-
-    /// The undirected graph type the algorithm runs on.
-    typedef GR Graph;
-
-    /// \brief The type of the map that stores the edge capacities.
-    ///
-    /// The type of the map that stores the edge capacities.
-    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
-    typedef CM CapacityMap;
-
-    /// \brief Instantiates a CapacityMap.
-    ///
-    /// This function instantiates a \ref CapacityMap.
-#ifdef DOXYGEN
-    static CapacityMap *createCapacityMap(const Graph& graph)
-#else
-    static CapacityMap *createCapacityMap(const Graph&)
-#endif
-    {
-        LEMON_ASSERT(false, "CapacityMap is not initialized");
-        return 0; // ignore warnings
-    }
-
-    /// \brief The cross reference type used by heap.
-    ///
-    /// The cross reference type used by heap.
-    /// Usually \c Graph::NodeMap<int>.
-    typedef typename Graph::template NodeMap<int> HeapCrossRef;
-
-    /// \brief Instantiates a HeapCrossRef.
-    ///
-    /// This function instantiates a \ref HeapCrossRef.
-    /// \param g is the graph, to which we would like to define the
-    /// \ref HeapCrossRef.
-    static HeapCrossRef *createHeapCrossRef(const Graph& g) {
-      return new HeapCrossRef(g);
-    }
-
-    /// \brief The heap type used by NagamochiIbaraki algorithm.
-    ///
-    /// The heap type used by NagamochiIbaraki algorithm. It has to
-    /// maximize the priorities.
-    ///
-    /// \sa BinHeap
-    /// \sa NagamochiIbaraki
-    typedef BinHeap<Value, HeapCrossRef, std::greater<Value> > Heap;
-
-    /// \brief Instantiates a Heap.
-    ///
-    /// This function instantiates a \ref Heap.
-    /// \param r is the cross reference of the heap.
-    static Heap *createHeap(HeapCrossRef& r) {
-      return new Heap(r);
-    }
-  };
-
-  /// \ingroup min_cut
-  ///
-  /// \brief Calculates the minimum cut in an undirected graph.
-  ///
-  /// Calculates the minimum cut in an undirected graph with the
-  /// Nagamochi-Ibaraki algorithm. The algorithm separates the graph's
-  /// nodes into two partitions with the minimum sum of edge capacities
-  /// between the two partitions. The algorithm can be used to test
-  /// the network reliability, especially to test how many links have
-  /// to be destroyed in the network to split it to at least two
-  /// distinict subnetworks.
-  ///
-  /// The complexity of the algorithm is \f$ O(nm\log(n)) \f$ but with
-  /// \ref FibHeap "Fibonacci heap" it can be decreased to
-  /// \f$ O(nm+n^2\log(n)) \f$.  When the edges have unit capacities,
-  /// \c BucketHeap can be used which yields \f$ O(nm) \f$ time
-  /// complexity.
-  ///
-  /// \warning The value type of the capacity map should be able to
-  /// hold any cut value of the graph, otherwise the result can
-  /// overflow.
-  /// \note This capacity is supposed to be integer type.
-#ifdef DOXYGEN
-  template <typename GR, typename CM, typename TR>
-#else
-  template <typename GR,
-            typename CM = typename GR::template EdgeMap<int>,
-            typename TR = NagamochiIbarakiDefaultTraits<GR, CM> >
-#endif
-  class NagamochiIbaraki {
-  public:
-
-    typedef TR Traits;
-    /// The type of the underlying graph.
-    typedef typename Traits::Graph Graph;
-
-    /// The type of the capacity map.
-    typedef typename Traits::CapacityMap CapacityMap;
-    /// The value type of the capacity map.
-    typedef typename Traits::CapacityMap::Value Value;
-
-    /// The heap type used by the algorithm.
-    typedef typename Traits::Heap Heap;
-    /// The cross reference type used for the heap.
-    typedef typename Traits::HeapCrossRef HeapCrossRef;
-
-    ///\name Named template parameters
-
-    ///@{
-
-    struct SetUnitCapacityTraits : public Traits {
-      typedef ConstMap<typename Graph::Edge, Const<int, 1> > CapacityMap;
-      static CapacityMap *createCapacityMap(const Graph&) {
-        return new CapacityMap();
-      }
-    };
-
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// the capacity map to a constMap<Edge, int, 1>() instance
-    ///
-    /// \ref named-templ-param "Named parameter" for setting
-    /// the capacity map to a constMap<Edge, int, 1>() instance
-    struct SetUnitCapacity
-      : public NagamochiIbaraki<Graph, CapacityMap,
-                                SetUnitCapacityTraits> {
-      typedef NagamochiIbaraki<Graph, CapacityMap,
-                               SetUnitCapacityTraits> Create;
-    };
-
-
-    template <class H, class CR>
-    struct SetHeapTraits : public Traits {
-      typedef CR HeapCrossRef;
-      typedef H Heap;
-      static HeapCrossRef *createHeapCrossRef(int num) {
-        LEMON_ASSERT(false, "HeapCrossRef is not initialized");
-        return 0; // ignore warnings
-      }
-      static Heap *createHeap(HeapCrossRef &) {
-        LEMON_ASSERT(false, "Heap is not initialized");
-        return 0; // ignore warnings
-      }
-    };
-
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// heap and cross reference type
-    ///
-    /// \ref named-templ-param "Named parameter" for setting heap and
-    /// cross reference type. The heap has to maximize the priorities.
-    template <class H, class CR = RangeMap<int> >
-    struct SetHeap
-      : public NagamochiIbaraki<Graph, CapacityMap, SetHeapTraits<H, CR> > {
-      typedef NagamochiIbaraki< Graph, CapacityMap, SetHeapTraits<H, CR> >
-      Create;
-    };
-
-    template <class H, class CR>
-    struct SetStandardHeapTraits : public Traits {
-      typedef CR HeapCrossRef;
-      typedef H Heap;
-      static HeapCrossRef *createHeapCrossRef(int size) {
-        return new HeapCrossRef(size);
-      }
-      static Heap *createHeap(HeapCrossRef &crossref) {
-        return new Heap(crossref);
-      }
-    };
-
-    /// \brief \ref named-templ-param "Named parameter" for setting
-    /// heap and cross reference type with automatic allocation
-    ///
-    /// \ref named-templ-param "Named parameter" for setting heap and
-    /// cross reference type with automatic allocation. They should
-    /// have standard constructor interfaces to be able to
-    /// automatically created by the algorithm (i.e. the graph should
-    /// be passed to the constructor of the cross reference and the
-    /// cross reference should be passed to the constructor of the
-    /// heap). However, external heap and cross reference objects
-    /// could also be passed to the algorithm using the \ref heap()
-    /// function before calling \ref run() or \ref init(). The heap
-    /// has to maximize the priorities.
-    /// \sa SetHeap
-    template <class H, class CR = RangeMap<int> >
-    struct SetStandardHeap
-      : public NagamochiIbaraki<Graph, CapacityMap,
-                                SetStandardHeapTraits<H, CR> > {
-      typedef NagamochiIbaraki<Graph, CapacityMap,
-                               SetStandardHeapTraits<H, CR> > Create;
-    };
-
-    ///@}
-
-
-  private:
-
-    const Graph &_graph;
-    const CapacityMap *_capacity;
-    bool _local_capacity; // unit capacity
-
-    struct ArcData {
-      typename Graph::Node target;
-      int prev, next;
-    };
-    struct EdgeData {
-      Value capacity;
-      Value cut;
-    };
-
-    struct NodeData {
-      int first_arc;
-      typename Graph::Node prev, next;
-      int curr_arc;
-      typename Graph::Node last_rep;
-      Value sum;
-    };
-
-    typename Graph::template NodeMap<NodeData> *_nodes;
-    std::vector<ArcData> _arcs;
-    std::vector<EdgeData> _edges;
-
-    typename Graph::Node _first_node;
-    int _node_num;
-
-    Value _min_cut;
-
-    HeapCrossRef *_heap_cross_ref;
-    bool _local_heap_cross_ref;
-    Heap *_heap;
-    bool _local_heap;
-
-    typedef typename Graph::template NodeMap<typename Graph::Node> NodeList;
-    NodeList *_next_rep;
-
-    typedef typename Graph::template NodeMap<bool> MinCutMap;
-    MinCutMap *_cut_map;
-
-    void createStructures() {
-      if (!_nodes) {
-        _nodes = new (typename Graph::template NodeMap<NodeData>)(_graph);
-      }
-      if (!_capacity) {
-        _local_capacity = true;
-        _capacity = Traits::createCapacityMap(_graph);
-      }
-      if (!_heap_cross_ref) {
-        _local_heap_cross_ref = true;
-        _heap_cross_ref = Traits::createHeapCrossRef(_graph);
-      }
-      if (!_heap) {
-        _local_heap = true;
-        _heap = Traits::createHeap(*_heap_cross_ref);
-      }
-      if (!_next_rep) {
-        _next_rep = new NodeList(_graph);
-      }
-      if (!_cut_map) {
-        _cut_map = new MinCutMap(_graph);
-      }
-    }
-
-  protected:
-    //This is here to avoid a gcc-3.3 compilation error.
-    //It should never be called.
-    NagamochiIbaraki() {}
-
-  public:
-
-    typedef NagamochiIbaraki Create;
-
-
-    /// \brief Constructor.
-    ///
-    /// \param graph The graph the algorithm runs on.
-    /// \param capacity The capacity map used by the algorithm.
-    NagamochiIbaraki(const Graph& graph, const CapacityMap& capacity)
-      : _graph(graph), _capacity(&capacity), _local_capacity(false),
-        _nodes(0), _arcs(), _edges(), _min_cut(),
-        _heap_cross_ref(0), _local_heap_cross_ref(false),
-        _heap(0), _local_heap(false),
-        _next_rep(0), _cut_map(0) {}
-
-    /// \brief Constructor.
-    ///
-    /// This constructor can be used only when the Traits class
-    /// defines how can the local capacity map be instantiated.
-    /// If the SetUnitCapacity used the algorithm automatically
-    /// constructs the capacity map.
-    ///
-    ///\param graph The graph the algorithm runs on.
-    NagamochiIbaraki(const Graph& graph)
-      : _graph(graph), _capacity(0), _local_capacity(false),
-        _nodes(0), _arcs(), _edges(), _min_cut(),
-        _heap_cross_ref(0), _local_heap_cross_ref(false),
-        _heap(0), _local_heap(false),
-        _next_rep(0), _cut_map(0) {}
-
-    /// \brief Destructor.
-    ///
-    /// Destructor.
-    ~NagamochiIbaraki() {
-      if (_local_capacity) delete _capacity;
-      if (_nodes) delete _nodes;
-      if (_local_heap) delete _heap;
-      if (_local_heap_cross_ref) delete _heap_cross_ref;
-      if (_next_rep) delete _next_rep;
-      if (_cut_map) delete _cut_map;
-    }
-
-    /// \brief Sets the heap and the cross reference used by algorithm.
-    ///
-    /// Sets the heap and the cross reference used by algorithm.
-    /// If you don't use this function before calling \ref run(),
-    /// it will allocate one. The destuctor deallocates this
-    /// automatically allocated heap and cross reference, of course.
-    /// \return <tt> (*this) </tt>
-    NagamochiIbaraki &heap(Heap& hp, HeapCrossRef &cr)
-    {
-      if (_local_heap_cross_ref) {
-        delete _heap_cross_ref;
-        _local_heap_cross_ref = false;
-      }
-      _heap_cross_ref = &cr;
-      if (_local_heap) {
-        delete _heap;
-        _local_heap = false;
-      }
-      _heap = &hp;
-      return *this;
-    }
-
-    /// \name Execution control
-    /// The simplest way to execute the algorithm is to use
-    /// one of the member functions called \c run().
-    /// \n
-    /// If you need more control on the execution,
-    /// first you must call \ref init() and then call the start()
-    /// or proper times the processNextPhase() member functions.
-
-    ///@{
-
-    /// \brief Initializes the internal data structures.
-    ///
-    /// Initializes the internal data structures.
-    void init() {
-      createStructures();
-
-      int edge_num = countEdges(_graph);
-      _edges.resize(edge_num);
-      _arcs.resize(2 * edge_num);
-
-      typename Graph::Node prev = INVALID;
-      _node_num = 0;
-      for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
-        (*_cut_map)[n] = false;
-        (*_next_rep)[n] = INVALID;
-        (*_nodes)[n].last_rep = n;
-        (*_nodes)[n].first_arc = -1;
-        (*_nodes)[n].curr_arc = -1;
-        (*_nodes)[n].prev = prev;
-        if (prev != INVALID) {
-          (*_nodes)[prev].next = n;
-        }
-        (*_nodes)[n].next = INVALID;
-        (*_nodes)[n].sum = 0;
-        prev = n;
-        ++_node_num;
-      }
-
-      _first_node = typename Graph::NodeIt(_graph);
-
-      int index = 0;
-      for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
-        for (typename Graph::OutArcIt a(_graph, n); a != INVALID; ++a) {
-          typename Graph::Node m = _graph.target(a);
-
-          if (!(n < m)) continue;
-
-          (*_nodes)[n].sum += (*_capacity)[a];
-          (*_nodes)[m].sum += (*_capacity)[a];
-
-          int c = (*_nodes)[m].curr_arc;
-          if (c != -1 && _arcs[c ^ 1].target == n) {
-            _edges[c >> 1].capacity += (*_capacity)[a];
-          } else {
-            _edges[index].capacity = (*_capacity)[a];
-
-            _arcs[index << 1].prev = -1;
-            if ((*_nodes)[n].first_arc != -1) {
-              _arcs[(*_nodes)[n].first_arc].prev = (index << 1);
-            }
-            _arcs[index << 1].next = (*_nodes)[n].first_arc;
-            (*_nodes)[n].first_arc = (index << 1);
-            _arcs[index << 1].target = m;
-
-            (*_nodes)[m].curr_arc = (index << 1);
-
-            _arcs[(index << 1) | 1].prev = -1;
-            if ((*_nodes)[m].first_arc != -1) {
-              _arcs[(*_nodes)[m].first_arc].prev = ((index << 1) | 1);
-            }
-            _arcs[(index << 1) | 1].next = (*_nodes)[m].first_arc;
-            (*_nodes)[m].first_arc = ((index << 1) | 1);
-            _arcs[(index << 1) | 1].target = n;
-
-            ++index;
-          }
-        }
-      }
-
-      typename Graph::Node cut_node = INVALID;
-      _min_cut = std::numeric_limits<Value>::max();
-
-      for (typename Graph::Node n = _first_node;
-           n != INVALID; n = (*_nodes)[n].next) {
-        if ((*_nodes)[n].sum < _min_cut) {
-          cut_node = n;
-          _min_cut = (*_nodes)[n].sum;
-        }
-      }
-      (*_cut_map)[cut_node] = true;
-      if (_min_cut == 0) {
-        _first_node = INVALID;
-      }
-    }
-
-  public:
-
-    /// \brief Processes the next phase
-    ///
-    /// Processes the next phase in the algorithm. It must be called
-    /// at most one less the number of the nodes in the graph.
-    ///
-    ///\return %True when the algorithm finished.
-    bool processNextPhase() {
-      if (_first_node == INVALID) return true;
-
-      _heap->clear();
-      for (typename Graph::Node n = _first_node;
-           n != INVALID; n = (*_nodes)[n].next) {
-        (*_heap_cross_ref)[n] = Heap::PRE_HEAP;
-      }
-
-      std::vector<typename Graph::Node> order;
-      order.reserve(_node_num);
-      int sep = 0;
-
-      Value alpha = 0;
-      Value pmc = std::numeric_limits<Value>::max();
-
-      _heap->push(_first_node, static_cast<Value>(0));
-      while (!_heap->empty()) {
-        typename Graph::Node n = _heap->top();
-        Value v = _heap->prio();
-
-        _heap->pop();
-        for (int a = (*_nodes)[n].first_arc; a != -1; a = _arcs[a].next) {
-          switch (_heap->state(_arcs[a].target)) {
-          case Heap::PRE_HEAP:
-            {
-              Value nv = _edges[a >> 1].capacity;
-              _heap->push(_arcs[a].target, nv);
-              _edges[a >> 1].cut = nv;
-            } break;
-          case Heap::IN_HEAP:
-            {
-              Value nv = _edges[a >> 1].capacity + (*_heap)[_arcs[a].target];
-              _heap->decrease(_arcs[a].target, nv);
-              _edges[a >> 1].cut = nv;
-            } break;
-          case Heap::POST_HEAP:
-            break;
-          }
-        }
-
-        alpha += (*_nodes)[n].sum;
-        alpha -= 2 * v;
-
-        order.push_back(n);
-        if (!_heap->empty()) {
-          if (alpha < pmc) {
-            pmc = alpha;
-            sep = order.size();
-          }
-        }
-      }
-
-      if (static_cast<int>(order.size()) < _node_num) {
-        _first_node = INVALID;
-        for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
-          (*_cut_map)[n] = false;
-        }
-        for (int i = 0; i < static_cast<int>(order.size()); ++i) {
-          typename Graph::Node n = order[i];
-          while (n != INVALID) {
-            (*_cut_map)[n] = true;
-            n = (*_next_rep)[n];
-          }
-        }
-        _min_cut = 0;
-        return true;
-      }
-
-      if (pmc < _min_cut) {
-        for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
-          (*_cut_map)[n] = false;
-        }
-        for (int i = 0; i < sep; ++i) {
-          typename Graph::Node n = order[i];
-          while (n != INVALID) {
-            (*_cut_map)[n] = true;
-            n = (*_next_rep)[n];
-          }
-        }
-        _min_cut = pmc;
-      }
-
-      for (typename Graph::Node n = _first_node;
-           n != INVALID; n = (*_nodes)[n].next) {
-        bool merged = false;
-        for (int a = (*_nodes)[n].first_arc; a != -1; a = _arcs[a].next) {
-          if (!(_edges[a >> 1].cut < pmc)) {
-            if (!merged) {
-              for (int b = (*_nodes)[n].first_arc; b != -1; b = _arcs[b].next) {
-                (*_nodes)[_arcs[b].target].curr_arc = b;
-              }
-              merged = true;
-            }
-            typename Graph::Node m = _arcs[a].target;
-            int nb = 0;
-            for (int b = (*_nodes)[m].first_arc; b != -1; b = nb) {
-              nb = _arcs[b].next;
-              if ((b ^ a) == 1) continue;
-              typename Graph::Node o = _arcs[b].target;
-              int c = (*_nodes)[o].curr_arc;
-              if (c != -1 && _arcs[c ^ 1].target == n) {
-                _edges[c >> 1].capacity += _edges[b >> 1].capacity;
-                (*_nodes)[n].sum += _edges[b >> 1].capacity;
-                if (_edges[b >> 1].cut < _edges[c >> 1].cut) {
-                  _edges[b >> 1].cut = _edges[c >> 1].cut;
-                }
-                if (_arcs[b ^ 1].prev != -1) {
-                  _arcs[_arcs[b ^ 1].prev].next = _arcs[b ^ 1].next;
-                } else {
-                  (*_nodes)[o].first_arc = _arcs[b ^ 1].next;
-                }
-                if (_arcs[b ^ 1].next != -1) {
-                  _arcs[_arcs[b ^ 1].next].prev = _arcs[b ^ 1].prev;
-                }
-              } else {
-                if (_arcs[a].next != -1) {
-                  _arcs[_arcs[a].next].prev = b;
-                }
-                _arcs[b].next = _arcs[a].next;
-                _arcs[b].prev = a;
-                _arcs[a].next = b;
-                _arcs[b ^ 1].target = n;
-
-                (*_nodes)[n].sum += _edges[b >> 1].capacity;
-                (*_nodes)[o].curr_arc = b;
-              }
-            }
-
-            if (_arcs[a].prev != -1) {
-              _arcs[_arcs[a].prev].next = _arcs[a].next;
-            } else {
-              (*_nodes)[n].first_arc = _arcs[a].next;
-            }
-            if (_arcs[a].next != -1) {
-              _arcs[_arcs[a].next].prev = _arcs[a].prev;
-            }
-
-            (*_nodes)[n].sum -= _edges[a >> 1].capacity;
-            (*_next_rep)[(*_nodes)[n].last_rep] = m;
-            (*_nodes)[n].last_rep = (*_nodes)[m].last_rep;
-
-            if ((*_nodes)[m].prev != INVALID) {
-              (*_nodes)[(*_nodes)[m].prev].next = (*_nodes)[m].next;
-            } else{
-              _first_node = (*_nodes)[m].next;
-            }
-            if ((*_nodes)[m].next != INVALID) {
-              (*_nodes)[(*_nodes)[m].next].prev = (*_nodes)[m].prev;
-            }
-            --_node_num;
-          }
-        }
-      }
-
-      if (_node_num == 1) {
-        _first_node = INVALID;
-        return true;
-      }
-
-      return false;
-    }
-
-    /// \brief Executes the algorithm.
-    ///
-    /// Executes the algorithm.
-    ///
-    /// \pre init() must be called
-    void start() {
-      while (!processNextPhase()) {}
-    }
-
-
-    /// \brief Runs %NagamochiIbaraki algorithm.
-    ///
-    /// This method runs the %Min cut algorithm
-    ///
-    /// \note mc.run(s) is just a shortcut of the following code.
-    ///\code
-    ///  mc.init();
-    ///  mc.start();
-    ///\endcode
-    void run() {
-      init();
-      start();
-    }
-
-    ///@}
-
-    /// \name Query Functions
-    ///
-    /// The result of the %NagamochiIbaraki
-    /// algorithm can be obtained using these functions.\n
-    /// Before the use of these functions, either run() or start()
-    /// must be called.
-
-    ///@{
-
-    /// \brief Returns the min cut value.
-    ///
-    /// Returns the min cut value if the algorithm finished.
-    /// After the first processNextPhase() it is a value of a
-    /// valid cut in the graph.
-    Value minCutValue() const {
-      return _min_cut;
-    }
-
-    /// \brief Returns a min cut in a NodeMap.
-    ///
-    /// It sets the nodes of one of the two partitions to true and
-    /// the other partition to false.
-    /// \param cutMap A \ref concepts::WriteMap "writable" node map with
-    /// \c bool (or convertible) value type.
-    template <typename CutMap>
-    Value minCutMap(CutMap& cutMap) const {
-      for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) {
-        cutMap.set(n, (*_cut_map)[n]);
-      }
-      return minCutValue();
-    }
-
-    ///@}
-
-  };
-}
-
-#endif
Index: lemon/nearest_neighbor_tsp.h
===================================================================
--- lemon/nearest_neighbor_tsp.h	(revision 1270)
+++ 	(revision )
@@ -1,238 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_NEAREST_NEIGHBOUR_TSP_H
-#define LEMON_NEAREST_NEIGHBOUR_TSP_H
-
-/// \ingroup tsp
-/// \file
-/// \brief Nearest neighbor algorithm for symmetric TSP
-
-#include <deque>
-#include <vector>
-#include <limits>
-#include <lemon/full_graph.h>
-#include <lemon/maps.h>
-
-namespace lemon {
-
-  /// \ingroup tsp
-  ///
-  /// \brief Nearest neighbor algorithm for symmetric TSP.
-  ///
-  /// NearestNeighborTsp implements the nearest neighbor heuristic for solving
-  /// symmetric \ref tsp "TSP".
-  ///
-  /// This is probably the simplest TSP heuristic.
-  /// It starts with a minimum cost edge and at each step, it connects the
-  /// nearest unvisited node to the current path.
-  /// Finally, it connects the two end points of the path to form a tour.
-  ///
-  /// This method runs in O(n<sup>2</sup>) time.
-  /// It quickly finds a relatively short tour for most TSP instances,
-  /// but it could also yield a really bad (or even the worst) solution
-  /// in special cases.
-  ///
-  /// \tparam CM Type of the cost map.
-  template <typename CM>
-  class NearestNeighborTsp
-  {
-    public:
-
-      /// Type of the cost map
-      typedef CM CostMap;
-      /// Type of the edge costs
-      typedef typename CM::Value Cost;
-
-    private:
-
-      GRAPH_TYPEDEFS(FullGraph);
-
-      const FullGraph &_gr;
-      const CostMap &_cost;
-      Cost _sum;
-      std::vector<Node> _path;
-
-    public:
-
-      /// \brief Constructor
-      ///
-      /// Constructor.
-      /// \param gr The \ref FullGraph "full graph" the algorithm runs on.
-      /// \param cost The cost map.
-      NearestNeighborTsp(const FullGraph &gr, const CostMap &cost)
-        : _gr(gr), _cost(cost) {}
-
-      /// \name Execution Control
-      /// @{
-
-      /// \brief Runs the algorithm.
-      ///
-      /// This function runs the algorithm.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run() {
-        _path.clear();
-        if (_gr.nodeNum() == 0) {
-          return _sum = 0;
-        }
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-
-        std::deque<Node> path_dq;
-        Edge min_edge1 = INVALID,
-             min_edge2 = INVALID;
-
-        min_edge1 = mapMin(_gr, _cost);
-        Node n1 = _gr.u(min_edge1),
-             n2 = _gr.v(min_edge1);
-        path_dq.push_back(n1);
-        path_dq.push_back(n2);
-
-        FullGraph::NodeMap<bool> used(_gr, false);
-        used[n1] = true;
-        used[n2] = true;
-
-        min_edge1 = INVALID;
-        while (int(path_dq.size()) != _gr.nodeNum()) {
-          if (min_edge1 == INVALID) {
-            for (IncEdgeIt e(_gr, n1); e != INVALID; ++e) {
-              if (!used[_gr.runningNode(e)] &&
-                  (_cost[e] < _cost[min_edge1] || min_edge1 == INVALID)) {
-                min_edge1 = e;
-              }
-            }
-          }
-
-          if (min_edge2 == INVALID) {
-            for (IncEdgeIt e(_gr, n2); e != INVALID; ++e) {
-              if (!used[_gr.runningNode(e)] &&
-                  (_cost[e] < _cost[min_edge2] || min_edge2 == INVALID)) {
-                min_edge2 = e;
-              }
-            }
-          }
-
-          if (_cost[min_edge1] < _cost[min_edge2]) {
-            n1 = _gr.oppositeNode(n1, min_edge1);
-            path_dq.push_front(n1);
-
-            used[n1] = true;
-            min_edge1 = INVALID;
-
-            if (_gr.u(min_edge2) == n1 || _gr.v(min_edge2) == n1)
-              min_edge2 = INVALID;
-          } else {
-            n2 = _gr.oppositeNode(n2, min_edge2);
-            path_dq.push_back(n2);
-
-            used[n2] = true;
-            min_edge2 = INVALID;
-
-            if (_gr.u(min_edge1) == n2 || _gr.v(min_edge1) == n2)
-              min_edge1 = INVALID;
-          }
-        }
-
-        n1 = path_dq.back();
-        n2 = path_dq.front();
-        _path.push_back(n2);
-        _sum = _cost[_gr.edge(n1, n2)];
-        for (int i = 1; i < int(path_dq.size()); ++i) {
-          n1 = n2;
-          n2 = path_dq[i];
-          _path.push_back(n2);
-          _sum += _cost[_gr.edge(n1, n2)];
-        }
-
-        return _sum;
-      }
-
-      /// @}
-
-      /// \name Query Functions
-      /// @{
-
-      /// \brief The total cost of the found tour.
-      ///
-      /// This function returns the total cost of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      Cost tourCost() const {
-        return _sum;
-      }
-
-      /// \brief Returns a const reference to the node sequence of the
-      /// found tour.
-      ///
-      /// This function returns a const reference to a vector
-      /// that stores the node sequence of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      const std::vector<Node>& tourNodes() const {
-        return _path;
-      }
-
-      /// \brief Gives back the node sequence of the found tour.
-      ///
-      /// This function copies the node sequence of the found tour into
-      /// an STL container through the given output iterator. The
-      /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
-      /// For example,
-      /// \code
-      /// std::vector<FullGraph::Node> nodes(countNodes(graph));
-      /// tsp.tourNodes(nodes.begin());
-      /// \endcode
-      /// or
-      /// \code
-      /// std::list<FullGraph::Node> nodes;
-      /// tsp.tourNodes(std::back_inserter(nodes));
-      /// \endcode
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Iterator>
-      void tourNodes(Iterator out) const {
-        std::copy(_path.begin(), _path.end(), out);
-      }
-
-      /// \brief Gives back the found tour as a path.
-      ///
-      /// This function copies the found tour as a list of arcs/edges into
-      /// the given \ref lemon::concepts::Path "path structure".
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Path>
-      void tour(Path &path) const {
-        path.clear();
-        for (int i = 0; i < int(_path.size()) - 1; ++i) {
-          path.addBack(_gr.arc(_path[i], _path[i+1]));
-        }
-        if (int(_path.size()) >= 2) {
-          path.addBack(_gr.arc(_path.back(), _path.front()));
-        }
-      }
-
-      /// @}
-
-  };
-
-}; // namespace lemon
-
-#endif
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 1270)
+++ lemon/network_simplex.h	(revision 978)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -42,15 +42,14 @@
   /// \ref NetworkSimplex implements the primal Network Simplex algorithm
   /// for finding a \ref min_cost_flow "minimum cost flow"
-  /// \cite amo93networkflows, \cite dantzig63linearprog,
-  /// \cite kellyoneill91netsimplex.
+  /// \ref amo93networkflows, \ref dantzig63linearprog,
+  /// \ref kellyoneill91netsimplex.
   /// This algorithm is a highly efficient specialized version of the
   /// linear programming simplex method directly for the minimum cost
   /// flow problem.
   ///
-  /// In general, \ref NetworkSimplex and \ref CostScaling are the fastest
-  /// implementations available in LEMON for solving this problem.
-  /// (For more information, see \ref min_cost_flow_algs "the module page".)
-  /// Furthermore, this class supports both directions of the supply/demand
-  /// inequality constraints. For more information, see \ref SupplyType.
+  /// In general, %NetworkSimplex is the fastest implementation available
+  /// in LEMON for this problem.
+  /// Moreover, it supports both directions of the supply/demand inequality
+  /// constraints. For more information, see \ref SupplyType.
   ///
   /// Most of the parameters of the problem (except for the digraph)
@@ -65,6 +64,5 @@
   /// algorithm. By default, it is the same as \c V.
   ///
-  /// \warning Both \c V and \c C must be signed number types.
-  /// \warning All input data (capacities, supply values, and costs) must
+  /// \warning Both number types must be signed and all input data must
   /// be integer.
   ///
@@ -124,15 +122,12 @@
     /// the \ref run() function.
     ///
-    /// \ref NetworkSimplex provides five different implementations for
-    /// the pivot strategy that significantly affects the running time
+    /// \ref NetworkSimplex provides five different pivot rule
+    /// implementations that significantly affect the running time
     /// of the algorithm.
-    /// According to experimental tests conducted on various problem
-    /// instances, \ref BLOCK_SEARCH "Block Search" and
-    /// \ref ALTERING_LIST "Altering Candidate List" rules turned out
-    /// to be the most efficient.
-    /// Since \ref BLOCK_SEARCH "Block Search" is a simpler strategy that
-    /// seemed to be slightly more robust, it is used by default.
-    /// However, another pivot rule can easily be selected using the
-    /// \ref run() function with the proper parameter.
+    /// By default, \ref BLOCK_SEARCH "Block Search" is used, which
+    /// proved to be the most efficient and the most robust on various
+    /// test inputs.
+    /// However, another pivot rule can be selected using the \ref run()
+    /// function with the proper parameter.
     enum PivotRule {
 
@@ -160,5 +155,5 @@
       /// The \e Altering \e Candidate \e List pivot rule.
       /// It is a modified version of the Candidate List method.
-      /// It keeps only a few of the best eligible arcs from the former
+      /// It keeps only the several best eligible arcs from the former
       /// candidate list and extends this list in every iteration.
       ALTERING_LIST
@@ -172,7 +167,6 @@
     typedef std::vector<Value> ValueVector;
     typedef std::vector<Cost> CostVector;
-    typedef std::vector<signed char> CharVector;
-    // Note: vector<signed char> is used instead of vector<ArcState> and
-    // vector<ArcDirection> for efficiency reasons
+    typedef std::vector<char> BoolVector;
+    // Note: vector<char> is used instead of vector<bool> for efficiency reasons
 
     // State constants for arcs
@@ -183,9 +177,7 @@
     };
 
-    // Direction constants for tree arcs
-    enum ArcDirection {
-      DIR_DOWN = -1,
-      DIR_UP   =  1
-    };
+    typedef std::vector<signed char> StateVector;
+    // Note: vector<signed char> is used instead of vector<ArcState> for
+    // efficiency reasons
 
   private:
@@ -226,11 +218,13 @@
     IntVector _succ_num;
     IntVector _last_succ;
-    CharVector _pred_dir;
-    CharVector _state;
     IntVector _dirty_revs;
+    BoolVector _forward;
+    StateVector _state;
     int _root;
 
     // Temporary data used in the current pivot iteration
     int in_arc, join, u_in, v_in, u_out, v_out;
+    int first, second, right, last;
+    int stem, par_stem, new_stem;
     Value delta;
 
@@ -257,5 +251,5 @@
       const IntVector  &_target;
       const CostVector &_cost;
-      const CharVector &_state;
+      const StateVector &_state;
       const CostVector &_pi;
       int &_in_arc;
@@ -309,5 +303,5 @@
       const IntVector  &_target;
       const CostVector &_cost;
-      const CharVector &_state;
+      const StateVector &_state;
       const CostVector &_pi;
       int &_in_arc;
@@ -348,5 +342,5 @@
       const IntVector  &_target;
       const CostVector &_cost;
-      const CharVector &_state;
+      const StateVector &_state;
       const CostVector &_pi;
       int &_in_arc;
@@ -421,5 +415,5 @@
       const IntVector  &_target;
       const CostVector &_cost;
-      const CharVector &_state;
+      const StateVector &_state;
       const CostVector &_pi;
       int &_in_arc;
@@ -524,5 +518,5 @@
       const IntVector  &_target;
       const CostVector &_cost;
-      const CharVector &_state;
+      const StateVector &_state;
       const CostVector &_pi;
       int &_in_arc;
@@ -543,5 +537,5 @@
         SortFunc(const CostVector &map) : _map(map) {}
         bool operator()(int left, int right) {
-          return _map[left] < _map[right];
+          return _map[left] > _map[right];
         }
       };
@@ -561,5 +555,5 @@
         const double BLOCK_SIZE_FACTOR = 1.0;
         const int MIN_BLOCK_SIZE = 10;
-        const double HEAD_LENGTH_FACTOR = 0.01;
+        const double HEAD_LENGTH_FACTOR = 0.1;
         const int MIN_HEAD_LENGTH = 3;
 
@@ -577,11 +571,9 @@
         // Check the current candidate list
         int e;
-        Cost c;
         for (int i = 0; i != _curr_length; ++i) {
           e = _candidates[i];
-          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
-          if (c < 0) {
-            _cand_cost[e] = c;
-          } else {
+          _cand_cost[e] = _state[e] *
+            (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (_cand_cost[e] >= 0) {
             _candidates[i--] = _candidates[--_curr_length];
           }
@@ -593,7 +585,7 @@
 
         for (e = _next_arc; e != _search_arc_num; ++e) {
-          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
-          if (c < 0) {
-            _cand_cost[e] = c;
+          _cand_cost[e] = _state[e] *
+            (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (_cand_cost[e] < 0) {
             _candidates[_curr_length++] = e;
           }
@@ -605,7 +597,7 @@
         }
         for (e = 0; e != _next_arc; ++e) {
-          c = _state[e] * (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
-          if (c < 0) {
-            _cand_cost[e] = c;
+          _cand_cost[e] = _state[e] *
+            (_cost[e] + _pi[_source[e]] - _pi[_target[e]]);
+          if (_cand_cost[e] < 0) {
             _candidates[_curr_length++] = e;
           }
@@ -620,14 +612,14 @@
       search_end:
 
-        // Perform partial sort operation on the candidate list
-        int new_length = std::min(_head_length + 1, _curr_length);
-        std::partial_sort(_candidates.begin(), _candidates.begin() + new_length,
-                          _candidates.begin() + _curr_length, _sort_func);
-
-        // Select the entering arc and remove it from the list
+        // Make heap of the candidate list (approximating a partial sort)
+        make_heap( _candidates.begin(), _candidates.begin() + _curr_length,
+                   _sort_func );
+
+        // Pop the first element of the heap
         _in_arc = _candidates[0];
         _next_arc = e;
-        _candidates[0] = _candidates[new_length - 1];
-        _curr_length = new_length - 1;
+        pop_heap( _candidates.begin(), _candidates.begin() + _curr_length,
+                  _sort_func );
+        _curr_length = std::min(_head_length, _curr_length - 1);
         return true;
       }
@@ -642,10 +634,9 @@
     ///
     /// \param graph The digraph the algorithm runs on.
-    /// \param arc_mixing Indicate if the arcs will be stored in a
+    /// \param arc_mixing Indicate if the arcs have to be stored in a
     /// mixed order in the internal data structure.
-    /// In general, it leads to similar performance as using the original
-    /// arc order, but it makes the algorithm more robust and in special
-    /// cases, even significantly faster. Therefore, it is enabled by default.
-    NetworkSimplex(const GR& graph, bool arc_mixing = true) :
+    /// In special cases, it could lead to better overall performance,
+    /// but it is usually slower. Therefore it is disabled by default.
+    NetworkSimplex(const GR& graph, bool arc_mixing = false) :
       _graph(graph), _node_id(graph), _arc_id(graph),
       _arc_mixing(arc_mixing),
@@ -740,6 +731,4 @@
     ///
     /// \return <tt>(*this)</tt>
-    ///
-    /// \sa supplyType()
     template<typename SupplyMap>
     NetworkSimplex& supplyMap(const SupplyMap& map) {
@@ -758,5 +747,5 @@
     ///
     /// Using this function has the same effect as using \ref supplyMap()
-    /// with a map in which \c k is assigned to \c s, \c -k is
+    /// with such a map in which \c k is assigned to \c s, \c -k is
     /// assigned to \c t and all other nodes have zero supply value.
     ///
@@ -925,5 +914,5 @@
       _parent.resize(all_node_num);
       _pred.resize(all_node_num);
-      _pred_dir.resize(all_node_num);
+      _forward.resize(all_node_num);
       _thread.resize(all_node_num);
       _rev_thread.resize(all_node_num);
@@ -939,5 +928,5 @@
       if (_arc_mixing) {
         // Store the arcs in a mixed order
-        const int skip = std::max(_arc_num / _node_num, 3);
+        int k = std::max(int(std::sqrt(double(_arc_num))), 10);
         int i = 0, j = 0;
         for (ArcIt a(_graph); a != INVALID; ++a) {
@@ -945,5 +934,5 @@
           _source[i] = _node_id[_graph.source(a)];
           _target[i] = _node_id[_graph.target(a)];
-          if ((i += skip) >= _arc_num) i = ++j;
+          if ((i += k) >= _arc_num) i = ++j;
         }
       } else {
@@ -974,5 +963,5 @@
     ///
     /// This function returns the total cost of the found flow.
-    /// Its complexity is O(m).
+    /// Its complexity is O(e).
     ///
     /// \note The return type of the function can be specified as a
@@ -1011,6 +1000,5 @@
     }
 
-    /// \brief Copy the flow values (the primal solution) into the
-    /// given map.
+    /// \brief Return the flow map (the primal solution).
     ///
     /// This function copies the flow value on each arc into the given
@@ -1036,6 +1024,5 @@
     }
 
-    /// \brief Copy the potential values (the dual solution) into the
-    /// given map.
+    /// \brief Return the potential map (the dual solution).
     ///
     /// This function copies the potential (dual value) of each node
@@ -1067,8 +1054,4 @@
       if ( !((_stype == GEQ && _sum_supply <= 0) ||
              (_stype == LEQ && _sum_supply >= 0)) ) return false;
-
-      // Check lower and upper bounds
-      LEMON_DEBUG(checkBoundMaps(),
-          "Upper bounds must be greater or equal to the lower bounds");
 
       // Remove non-zero lower bounds
@@ -1134,5 +1117,5 @@
           _state[e] = STATE_TREE;
           if (_supply[u] >= 0) {
-            _pred_dir[u] = DIR_UP;
+            _forward[u] = true;
             _pi[u] = 0;
             _source[e] = u;
@@ -1141,5 +1124,5 @@
             _cost[e] = 0;
           } else {
-            _pred_dir[u] = DIR_DOWN;
+            _forward[u] = false;
             _pi[u] = ART_COST;
             _source[e] = _root;
@@ -1161,5 +1144,5 @@
           _last_succ[u] = u;
           if (_supply[u] >= 0) {
-            _pred_dir[u] = DIR_UP;
+            _forward[u] = true;
             _pi[u] = 0;
             _pred[u] = e;
@@ -1171,5 +1154,5 @@
             _state[e] = STATE_TREE;
           } else {
-            _pred_dir[u] = DIR_DOWN;
+            _forward[u] = false;
             _pi[u] = ART_COST;
             _pred[u] = f;
@@ -1202,5 +1185,5 @@
           _last_succ[u] = u;
           if (_supply[u] <= 0) {
-            _pred_dir[u] = DIR_DOWN;
+            _forward[u] = false;
             _pi[u] = 0;
             _pred[u] = e;
@@ -1212,5 +1195,5 @@
             _state[e] = STATE_TREE;
           } else {
-            _pred_dir[u] = DIR_UP;
+            _forward[u] = true;
             _pi[u] = -ART_COST;
             _pred[u] = f;
@@ -1236,13 +1219,4 @@
     }
 
-    // Check if the upper bound is greater or equal to the lower bound
-    // on each arc.
-    bool checkBoundMaps() {
-      for (int j = 0; j != _arc_num; ++j) {
-        if (_upper[j] < _lower[j]) return false;
-      }
-      return true;
-    }
-
     // Find the join node
     void findJoinNode() {
@@ -1264,5 +1238,4 @@
       // Initialize first and second nodes according to the direction
       // of the cycle
-      int first, second;
       if (_state[in_arc] == STATE_LOWER) {
         first  = _source[in_arc];
@@ -1274,15 +1247,12 @@
       delta = _cap[in_arc];
       int result = 0;
-      Value c, d;
+      Value d;
       int e;
 
-      // Search the cycle form the first node to the join node
+      // Search the cycle along the path form the first node to the root
       for (int u = first; u != join; u = _parent[u]) {
         e = _pred[u];
-        d = _flow[e];
-        if (_pred_dir[u] == DIR_DOWN) {
-          c = _cap[e];
-          d = c >= MAX ? INF : c - d;
-        }
+        d = _forward[u] ?
+          _flow[e] : (_cap[e] >= MAX ? INF : _cap[e] - _flow[e]);
         if (d < delta) {
           delta = d;
@@ -1291,13 +1261,9 @@
         }
       }
-
-      // Search the cycle form the second node to the join node
+      // Search the cycle along the path form the second node to the root
       for (int u = second; u != join; u = _parent[u]) {
         e = _pred[u];
-        d = _flow[e];
-        if (_pred_dir[u] == DIR_UP) {
-          c = _cap[e];
-          d = c >= MAX ? INF : c - d;
-        }
+        d = _forward[u] ?
+          (_cap[e] >= MAX ? INF : _cap[e] - _flow[e]) : _flow[e];
         if (d <= delta) {
           delta = d;
@@ -1324,8 +1290,8 @@
         _flow[in_arc] += val;
         for (int u = _source[in_arc]; u != join; u = _parent[u]) {
-          _flow[_pred[u]] -= _pred_dir[u] * val;
+          _flow[_pred[u]] += _forward[u] ? -val : val;
         }
         for (int u = _target[in_arc]; u != join; u = _parent[u]) {
-          _flow[_pred[u]] += _pred_dir[u] * val;
+          _flow[_pred[u]] += _forward[u] ? val : -val;
         }
       }
@@ -1342,4 +1308,5 @@
     // Update the tree structure
     void updateTreeStructure() {
+      int u, w;
       int old_rev_thread = _rev_thread[u_out];
       int old_succ_num = _succ_num[u_out];
@@ -1347,127 +1314,122 @@
       v_out = _parent[u_out];
 
-      // Check if u_in and u_out coincide
-      if (u_in == u_out) {
-        // Update _parent, _pred, _pred_dir
-        _parent[u_in] = v_in;
-        _pred[u_in] = in_arc;
-        _pred_dir[u_in] = u_in == _source[in_arc] ? DIR_UP : DIR_DOWN;
-
-        // Update _thread and _rev_thread
-        if (_thread[v_in] != u_out) {
-          int after = _thread[old_last_succ];
-          _thread[old_rev_thread] = after;
-          _rev_thread[after] = old_rev_thread;
-          after = _thread[v_in];
-          _thread[v_in] = u_out;
-          _rev_thread[u_out] = v_in;
-          _thread[old_last_succ] = after;
-          _rev_thread[after] = old_last_succ;
-        }
+      u = _last_succ[u_in];  // the last successor of u_in
+      right = _thread[u];    // the node after it
+
+      // Handle the case when old_rev_thread equals to v_in
+      // (it also means that join and v_out coincide)
+      if (old_rev_thread == v_in) {
+        last = _thread[_last_succ[u_out]];
       } else {
-        // Handle the case when old_rev_thread equals to v_in
-        // (it also means that join and v_out coincide)
-        int thread_continue = old_rev_thread == v_in ?
-          _thread[old_last_succ] : _thread[v_in];
-
-        // Update _thread and _parent along the stem nodes (i.e. the nodes
-        // between u_in and u_out, whose parent have to be changed)
-        int stem = u_in;              // the current stem node
-        int par_stem = v_in;          // the new parent of stem
-        int next_stem;                // the next stem node
-        int last = _last_succ[u_in];  // the last successor of stem
-        int before, after = _thread[last];
-        _thread[v_in] = u_in;
-        _dirty_revs.clear();
-        _dirty_revs.push_back(v_in);
-        while (stem != u_out) {
-          // Insert the next stem node into the thread list
-          next_stem = _parent[stem];
-          _thread[last] = next_stem;
-          _dirty_revs.push_back(last);
-
-          // Remove the subtree of stem from the thread list
-          before = _rev_thread[stem];
-          _thread[before] = after;
-          _rev_thread[after] = before;
-
-          // Change the parent node and shift stem nodes
-          _parent[stem] = par_stem;
-          par_stem = stem;
-          stem = next_stem;
-
-          // Update last and after
-          last = _last_succ[stem] == _last_succ[par_stem] ?
-            _rev_thread[par_stem] : _last_succ[stem];
-          after = _thread[last];
-        }
-        _parent[u_out] = par_stem;
-        _thread[last] = thread_continue;
-        _rev_thread[thread_continue] = last;
-        _last_succ[u_out] = last;
-
-        // Remove the subtree of u_out from the thread list except for
-        // the case when old_rev_thread equals to v_in
-        if (old_rev_thread != v_in) {
-          _thread[old_rev_thread] = after;
-          _rev_thread[after] = old_rev_thread;
-        }
-
-        // Update _rev_thread using the new _thread values
-        for (int i = 0; i != int(_dirty_revs.size()); ++i) {
-          int u = _dirty_revs[i];
-          _rev_thread[_thread[u]] = u;
-        }
-
-        // Update _pred, _pred_dir, _last_succ and _succ_num for the
-        // stem nodes from u_out to u_in
-        int tmp_sc = 0, tmp_ls = _last_succ[u_out];
-        for (int u = u_out, p = _parent[u]; u != u_in; u = p, p = _parent[u]) {
-          _pred[u] = _pred[p];
-          _pred_dir[u] = -_pred_dir[p];
-          tmp_sc += _succ_num[u] - _succ_num[p];
-          _succ_num[u] = tmp_sc;
-          _last_succ[p] = tmp_ls;
-        }
-        _pred[u_in] = in_arc;
-        _pred_dir[u_in] = u_in == _source[in_arc] ? DIR_UP : DIR_DOWN;
-        _succ_num[u_in] = old_succ_num;
+        last = _thread[v_in];
+      }
+
+      // Update _thread and _parent along the stem nodes (i.e. the nodes
+      // between u_in and u_out, whose parent have to be changed)
+      _thread[v_in] = stem = u_in;
+      _dirty_revs.clear();
+      _dirty_revs.push_back(v_in);
+      par_stem = v_in;
+      while (stem != u_out) {
+        // Insert the next stem node into the thread list
+        new_stem = _parent[stem];
+        _thread[u] = new_stem;
+        _dirty_revs.push_back(u);
+
+        // Remove the subtree of stem from the thread list
+        w = _rev_thread[stem];
+        _thread[w] = right;
+        _rev_thread[right] = w;
+
+        // Change the parent node and shift stem nodes
+        _parent[stem] = par_stem;
+        par_stem = stem;
+        stem = new_stem;
+
+        // Update u and right
+        u = _last_succ[stem] == _last_succ[par_stem] ?
+          _rev_thread[par_stem] : _last_succ[stem];
+        right = _thread[u];
+      }
+      _parent[u_out] = par_stem;
+      _thread[u] = last;
+      _rev_thread[last] = u;
+      _last_succ[u_out] = u;
+
+      // Remove the subtree of u_out from the thread list except for
+      // the case when old_rev_thread equals to v_in
+      // (it also means that join and v_out coincide)
+      if (old_rev_thread != v_in) {
+        _thread[old_rev_thread] = right;
+        _rev_thread[right] = old_rev_thread;
+      }
+
+      // Update _rev_thread using the new _thread values
+      for (int i = 0; i != int(_dirty_revs.size()); ++i) {
+        u = _dirty_revs[i];
+        _rev_thread[_thread[u]] = u;
+      }
+
+      // Update _pred, _forward, _last_succ and _succ_num for the
+      // stem nodes from u_out to u_in
+      int tmp_sc = 0, tmp_ls = _last_succ[u_out];
+      u = u_out;
+      while (u != u_in) {
+        w = _parent[u];
+        _pred[u] = _pred[w];
+        _forward[u] = !_forward[w];
+        tmp_sc += _succ_num[u] - _succ_num[w];
+        _succ_num[u] = tmp_sc;
+        _last_succ[w] = tmp_ls;
+        u = w;
+      }
+      _pred[u_in] = in_arc;
+      _forward[u_in] = (u_in == _source[in_arc]);
+      _succ_num[u_in] = old_succ_num;
+
+      // Set limits for updating _last_succ form v_in and v_out
+      // towards the root
+      int up_limit_in = -1;
+      int up_limit_out = -1;
+      if (_last_succ[join] == v_in) {
+        up_limit_out = join;
+      } else {
+        up_limit_in = join;
       }
 
       // Update _last_succ from v_in towards the root
-      int up_limit_out = _last_succ[join] == v_in ? join : -1;
-      int last_succ_out = _last_succ[u_out];
-      for (int u = v_in; u != -1 && _last_succ[u] == v_in; u = _parent[u]) {
-        _last_succ[u] = last_succ_out;
-      }
-
+      for (u = v_in; u != up_limit_in && _last_succ[u] == v_in;
+           u = _parent[u]) {
+        _last_succ[u] = _last_succ[u_out];
+      }
       // Update _last_succ from v_out towards the root
       if (join != old_rev_thread && v_in != old_rev_thread) {
-        for (int u = v_out; u != up_limit_out && _last_succ[u] == old_last_succ;
+        for (u = v_out; u != up_limit_out && _last_succ[u] == old_last_succ;
              u = _parent[u]) {
           _last_succ[u] = old_rev_thread;
         }
-      }
-      else if (last_succ_out != old_last_succ) {
-        for (int u = v_out; u != up_limit_out && _last_succ[u] == old_last_succ;
+      } else {
+        for (u = v_out; u != up_limit_out && _last_succ[u] == old_last_succ;
              u = _parent[u]) {
-          _last_succ[u] = last_succ_out;
+          _last_succ[u] = _last_succ[u_out];
         }
       }
 
       // Update _succ_num from v_in to join
-      for (int u = v_in; u != join; u = _parent[u]) {
+      for (u = v_in; u != join; u = _parent[u]) {
         _succ_num[u] += old_succ_num;
       }
       // Update _succ_num from v_out to join
-      for (int u = v_out; u != join; u = _parent[u]) {
+      for (u = v_out; u != join; u = _parent[u]) {
         _succ_num[u] -= old_succ_num;
       }
     }
 
-    // Update potentials in the subtree that has been moved
+    // Update potentials
     void updatePotential() {
-      Cost sigma = _pi[v_in] - _pi[u_in] -
-                   _pred_dir[u_in] * _cost[in_arc];
+      Cost sigma = _forward[u_in] ?
+        _pi[v_in] - _pi[u_in] - _cost[_pred[u_in]] :
+        _pi[v_in] - _pi[u_in] + _cost[_pred[u_in]];
+      // Update potentials in the subtree, which has been moved
       int end = _thread[_last_succ[u_in]];
       for (int u = u_in; u != end; u = _thread[u]) {
@@ -1517,5 +1479,5 @@
           }
         } else {
-          // Find the min. cost incoming arc for each demand node
+          // Find the min. cost incomming arc for each demand node
           for (int i = 0; i != int(demand_nodes.size()); ++i) {
             Node v = demand_nodes[i];
Index: lemon/opt2_tsp.h
===================================================================
--- lemon/opt2_tsp.h	(revision 1270)
+++ 	(revision )
@@ -1,367 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2013
- * 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_OPT2_TSP_H
-#define LEMON_OPT2_TSP_H
-
-/// \ingroup tsp
-/// \file
-/// \brief 2-opt algorithm for symmetric TSP.
-
-#include <vector>
-#include <lemon/full_graph.h>
-
-namespace lemon {
-
-  /// \ingroup tsp
-  ///
-  /// \brief 2-opt algorithm for symmetric TSP.
-  ///
-  /// Opt2Tsp implements the 2-opt heuristic for solving
-  /// symmetric \ref tsp "TSP".
-  ///
-  /// This algorithm starts with an initial tour and iteratively improves it.
-  /// At each step, it removes two edges and the reconnects the created two
-  /// paths in the other way if the resulting tour is shorter.
-  /// The algorithm finishes when no such 2-opt move can be applied, and so
-  /// the tour is 2-optimal.
-  ///
-  /// If no starting tour is given to the \ref run() function, then the
-  /// algorithm uses the node sequence determined by the node IDs.
-  /// Oherwise, it starts with the given tour.
-  ///
-  /// This is a rather slow but effective method.
-  /// Its typical usage is the improvement of the result of a fast tour
-  /// construction heuristic (e.g. the InsertionTsp algorithm).
-  ///
-  /// \tparam CM Type of the cost map.
-  template <typename CM>
-  class Opt2Tsp
-  {
-    public:
-
-      /// Type of the cost map
-      typedef CM CostMap;
-      /// Type of the edge costs
-      typedef typename CM::Value Cost;
-
-    private:
-
-      GRAPH_TYPEDEFS(FullGraph);
-
-      const FullGraph &_gr;
-      const CostMap &_cost;
-      Cost _sum;
-      std::vector<int> _plist;
-      std::vector<Node> _path;
-
-    public:
-
-      /// \brief Constructor
-      ///
-      /// Constructor.
-      /// \param gr The \ref FullGraph "full graph" the algorithm runs on.
-      /// \param cost The cost map.
-      Opt2Tsp(const FullGraph &gr, const CostMap &cost)
-        : _gr(gr), _cost(cost) {}
-
-      /// \name Execution Control
-      /// @{
-
-      /// \brief Runs the algorithm from scratch.
-      ///
-      /// This function runs the algorithm starting from the tour that is
-      /// determined by the node ID sequence.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run() {
-        _path.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-        else if (_gr.nodeNum() == 2) {
-          _path.push_back(_gr(0));
-          _path.push_back(_gr(1));
-          return _sum = 2 * _cost[_gr.edge(_gr(0), _gr(1))];
-        }
-
-        _plist.resize(2*_gr.nodeNum());
-        for (int i = 1; i < _gr.nodeNum()-1; ++i) {
-          _plist[2*i] = i-1;
-          _plist[2*i+1] = i+1;
-        }
-        _plist[0] = _gr.nodeNum()-1;
-        _plist[1] = 1;
-        _plist[2*_gr.nodeNum()-2] = _gr.nodeNum()-2;
-        _plist[2*_gr.nodeNum()-1] = 0;
-
-        return start();
-      }
-
-      /// \brief Runs the algorithm starting from the given tour.
-      ///
-      /// This function runs the algorithm starting from the given tour.
-      ///
-      /// \param tour The tour as a path structure. It must be a
-      /// \ref checkPath() "valid path" containing excactly n arcs.
-      ///
-      /// \return The total cost of the found tour.
-      template <typename Path>
-      Cost run(const Path& tour) {
-        _path.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-        else if (_gr.nodeNum() == 2) {
-          _path.push_back(_gr(0));
-          _path.push_back(_gr(1));
-          return _sum = 2 * _cost[_gr.edge(_gr(0), _gr(1))];
-        }
-
-        _plist.resize(2*_gr.nodeNum());
-        typename Path::ArcIt it(tour);
-        int first = _gr.id(_gr.source(it)),
-            prev = first,
-            curr = _gr.id(_gr.target(it)),
-            next = -1;
-        _plist[2*first+1] = curr;
-        for (++it; it != INVALID; ++it) {
-          next = _gr.id(_gr.target(it));
-          _plist[2*curr] = prev;
-          _plist[2*curr+1] = next;
-          prev = curr;
-          curr = next;
-        }
-        _plist[2*first] = prev;
-
-        return start();
-      }
-
-      /// \brief Runs the algorithm starting from the given tour.
-      ///
-      /// This function runs the algorithm starting from the given tour
-      /// (node sequence).
-      ///
-      /// \param tour A vector that stores all <tt>Node</tt>s of the graph
-      /// in the desired order.
-      ///
-      /// \return The total cost of the found tour.
-      Cost run(const std::vector<Node>& tour) {
-        _path.clear();
-
-        if (_gr.nodeNum() == 0) return _sum = 0;
-        else if (_gr.nodeNum() == 1) {
-          _path.push_back(_gr(0));
-          return _sum = 0;
-        }
-        else if (_gr.nodeNum() == 2) {
-          _path.push_back(_gr(0));
-          _path.push_back(_gr(1));
-          return _sum = 2 * _cost[_gr.edge(_gr(0), _gr(1))];
-        }
-
-        _plist.resize(2*_gr.nodeNum());
-        typename std::vector<Node>::const_iterator it = tour.begin();
-        int first = _gr.id(*it),
-            prev = first,
-            curr = _gr.id(*(++it)),
-            next = -1;
-        _plist[2*first+1] = curr;
-        for (++it; it != tour.end(); ++it) {
-          next = _gr.id(*it);
-          _plist[2*curr] = prev;
-          _plist[2*curr+1] = next;
-          prev = curr;
-          curr = next;
-        }
-        _plist[2*first] = curr;
-        _plist[2*curr] = prev;
-        _plist[2*curr+1] = first;
-
-        return start();
-      }
-
-      /// @}
-
-      /// \name Query Functions
-      /// @{
-
-      /// \brief The total cost of the found tour.
-      ///
-      /// This function returns the total cost of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      Cost tourCost() const {
-        return _sum;
-      }
-
-      /// \brief Returns a const reference to the node sequence of the
-      /// found tour.
-      ///
-      /// This function returns a const reference to a vector
-      /// that stores the node sequence of the found tour.
-      ///
-      /// \pre run() must be called before using this function.
-      const std::vector<Node>& tourNodes() const {
-        return _path;
-      }
-
-      /// \brief Gives back the node sequence of the found tour.
-      ///
-      /// This function copies the node sequence of the found tour into
-      /// an STL container through the given output iterator. The
-      /// <tt>value_type</tt> of the container must be <tt>FullGraph::Node</tt>.
-      /// For example,
-      /// \code
-      /// std::vector<FullGraph::Node> nodes(countNodes(graph));
-      /// tsp.tourNodes(nodes.begin());
-      /// \endcode
-      /// or
-      /// \code
-      /// std::list<FullGraph::Node> nodes;
-      /// tsp.tourNodes(std::back_inserter(nodes));
-      /// \endcode
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Iterator>
-      void tourNodes(Iterator out) const {
-        std::copy(_path.begin(), _path.end(), out);
-      }
-
-      /// \brief Gives back the found tour as a path.
-      ///
-      /// This function copies the found tour as a list of arcs/edges into
-      /// the given \ref lemon::concepts::Path "path structure".
-      ///
-      /// \pre run() must be called before using this function.
-      template <typename Path>
-      void tour(Path &path) const {
-        path.clear();
-        for (int i = 0; i < int(_path.size()) - 1; ++i) {
-          path.addBack(_gr.arc(_path[i], _path[i+1]));
-        }
-        if (int(_path.size()) >= 2) {
-          path.addBack(_gr.arc(_path.back(), _path.front()));
-        }
-      }
-
-      /// @}
-
-    private:
-
-      // Iterator class for the linked list storage of the tour
-      class PathListIt {
-        public:
-          PathListIt(const std::vector<int> &pl, int i=0)
-            : plist(&pl), act(i), last(pl[2*act]) {}
-          PathListIt(const std::vector<int> &pl, int i, int l)
-            : plist(&pl), act(i), last(l) {}
-
-          int nextIndex() const {
-            return (*plist)[2*act] == last ? 2*act+1 : 2*act;
-          }
-
-          int prevIndex() const {
-            return (*plist)[2*act] == last ? 2*act : 2*act+1;
-          }
-
-          int next() const {
-            int x = (*plist)[2*act];
-            return x == last ? (*plist)[2*act+1] : x;
-          }
-
-          int prev() const {
-            return last;
-          }
-
-          PathListIt& operator++() {
-            int tmp = act;
-            act = next();
-            last = tmp;
-            return *this;
-          }
-
-          operator int() const {
-            return act;
-          }
-
-        private:
-          const std::vector<int> *plist;
-          int act;
-          int last;
-      };
-
-      // Checks and applies 2-opt move (if it improves the tour)
-      bool checkOpt2(const PathListIt& i, const PathListIt& j) {
-        Node u  = _gr.nodeFromId(i),
-             un = _gr.nodeFromId(i.next()),
-             v  = _gr.nodeFromId(j),
-             vn = _gr.nodeFromId(j.next());
-
-        if (_cost[_gr.edge(u, un)] + _cost[_gr.edge(v, vn)] >
-            _cost[_gr.edge(u, v)] + _cost[_gr.edge(un, vn)])
-        {
-          _plist[PathListIt(_plist, i.next(), i).prevIndex()] = j.next();
-          _plist[PathListIt(_plist, j.next(), j).prevIndex()] = i.next();
-
-          _plist[i.nextIndex()] = j;
-          _plist[j.nextIndex()] = i;
-
-          return true;
-        }
-
-        return false;
-     }
-
-      // Executes the algorithm from the initial tour
-      Cost start() {
-
-      restart_search:
-        for (PathListIt i(_plist); true; ++i) {
-          PathListIt j = i;
-          if (++j == 0 || ++j == 0) break;
-          for (; j != 0 && j != i.prev(); ++j) {
-            if (checkOpt2(i, j))
-              goto restart_search;
-          }
-        }
-
-        PathListIt i(_plist);
-        _path.push_back(_gr.nodeFromId(i));
-        for (++i; i != 0; ++i)
-          _path.push_back(_gr.nodeFromId(i));
-
-        _sum = _cost[_gr.edge(_path.back(), _path.front())];
-        for (int i = 0; i < int(_path.size())-1; ++i) {
-          _sum += _cost[_gr.edge(_path[i], _path[i+1])];
-        }
-
-        return _sum;
-      }
-
-  };
-
-}; // namespace lemon
-
-#endif
Index: lemon/path.h
===================================================================
--- lemon/path.h	(revision 1270)
+++ lemon/path.h	(revision 1146)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -44,5 +44,5 @@
   ///
   /// In a sense, the path can be treated as a list of arcs. The
-  /// LEMON path type stores just this list. As a consequence, it
+  /// lemon path type stores just this list. As a consequence, it
   /// cannot enumerate the nodes of the path and the source node of
   /// a zero length path is undefined.
@@ -149,5 +149,5 @@
     void clear() { head.clear(); tail.clear(); }
 
-    /// \brief The n-th arc.
+    /// \brief The nth arc.
     ///
     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
@@ -157,5 +157,5 @@
     }
 
-    /// \brief Initialize arc iterator to point to the n-th arc
+    /// \brief Initialize arc iterator to point to the nth arc
     ///
     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
@@ -245,5 +245,5 @@
   ///
   /// In a sense, the path can be treated as a list of arcs. The
-  /// LEMON path type stores just this list. As a consequence it
+  /// lemon path type stores just this list. As a consequence it
   /// cannot enumerate the nodes in the path and the zero length paths
   /// cannot store the source.
@@ -318,5 +318,5 @@
       /// Constructor with starting point
       ArcIt(const SimplePath &_path, int _idx)
-        : path(&_path), idx(_idx) {}
+        : idx(_idx), path(&_path) {}
 
     public:
@@ -354,5 +354,5 @@
     void clear() { data.clear(); }
 
-    /// \brief The n-th arc.
+    /// \brief The nth arc.
     ///
     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
@@ -361,5 +361,5 @@
     }
 
-    /// \brief  Initializes arc iterator to point to the n-th arc.
+    /// \brief  Initializes arc iterator to point to the nth arc.
     ArcIt nthIt(int n) const {
       return ArcIt(*this, n);
@@ -422,5 +422,5 @@
   ///
   /// In a sense, the path can be treated as a list of arcs. The
-  /// LEMON path type stores just this list. As a consequence it
+  /// lemon path type stores just this list. As a consequence it
   /// cannot enumerate the nodes in the path and the zero length paths
   /// cannot store the source.
@@ -544,7 +544,7 @@
     };
 
-    /// \brief The n-th arc.
-    ///
-    /// This function looks for the n-th arc in O(n) time.
+    /// \brief The nth arc.
+    ///
+    /// This function looks for the nth arc in O(n) time.
     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     const Arc& nth(int n) const {
@@ -556,5 +556,5 @@
     }
 
-    /// \brief Initializes arc iterator to point to the n-th arc.
+    /// \brief Initializes arc iterator to point to the nth arc.
     ArcIt nthIt(int n) const {
       Node *node = first;
@@ -775,5 +775,5 @@
   ///
   /// In a sense, the path can be treated as a list of arcs. The
-  /// LEMON path type stores just this list. As a consequence it
+  /// lemon path type stores just this list. As a consequence it
   /// cannot enumerate the nodes in the path and the source node of
   /// a zero length path is undefined.
@@ -884,5 +884,5 @@
     };
 
-    /// \brief The n-th arc.
+    /// \brief The nth arc.
     ///
     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
@@ -891,5 +891,5 @@
     }
 
-    /// \brief The arc iterator pointing to the n-th arc.
+    /// \brief The arc iterator pointing to the nth arc.
     ArcIt nthIt(int n) const {
       return ArcIt(*this, n);
@@ -1095,5 +1095,5 @@
   ///
   /// In a sense, the path can be treated as a list of arcs. The
-  /// LEMON path type stores only this list. As a consequence, it
+  /// lemon path type stores only this list. As a consequence, it
   /// cannot enumerate the nodes in the path and the zero length paths
   /// cannot have a source node.
Index: lemon/planarity.h
===================================================================
--- lemon/planarity.h	(revision 1270)
+++ lemon/planarity.h	(revision 1160)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 1270)
+++ lemon/preflow.h	(revision 1107)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -103,10 +103,10 @@
   /// This class provides an implementation of Goldberg-Tarjan's \e preflow
   /// \e push-relabel algorithm producing a \ref max_flow
-  /// "flow of maximum value" in a digraph \cite clrs01algorithms,
-  /// \cite amo93networkflows, \cite goldberg88newapproach.
+  /// "flow of maximum value" in a digraph \ref clrs01algorithms,
+  /// \ref amo93networkflows, \ref goldberg88newapproach.
   /// The preflow algorithms are the fastest known maximum
   /// flow algorithms. The current implementation uses a mixture of the
   /// \e "highest label" and the \e "bound decrease" heuristics.
-  /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{m})\f$.
+  /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{e})\f$.
   ///
   /// The algorithm consists of two phases. After the first phase
@@ -135,5 +135,5 @@
   public:
 
-    ///The \ref lemon::PreflowDefaultTraits "traits class" of the algorithm.
+    ///The \ref PreflowDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
     ///The type of the digraph the algorithm runs on.
@@ -555,8 +555,8 @@
         }
       }
-      for (NodeIt n(_graph); n != INVALID; ++n)
+      for (NodeIt n(_graph); n != INVALID; ++n) 
         if(n!=_source && n!=_target && _tolerance.positive((*_excess)[n]))
           _level->activate(n);
-
+          
       return true;
     }
@@ -586,5 +586,5 @@
           level = _level->highestActiveLevel();
           --num;
-
+          
           Value excess = (*_excess)[n];
           int new_level = _level->maxLevel();
Index: lemon/radix_sort.h
===================================================================
--- lemon/radix_sort.h	(revision 1270)
+++ lemon/radix_sort.h	(revision 606)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -35,10 +35,4 @@
   namespace _radix_sort_bits {
 
-    template <typename Iterator>
-    bool unitRange(Iterator first, Iterator last) {
-      ++first;
-      return first == last;
-    }
-
     template <typename Value>
     struct Identity {
@@ -67,4 +61,7 @@
       std::iter_swap(first, last);
       ++first;
+      if (!(first < last)) {
+        return first;
+      }
       while (true) {
         while (!(functor(*first) & mask)) {
@@ -75,5 +72,5 @@
           --last;
         }
-        if (unitRange(last, first)) {
+        if (!(first < last)) {
           return first;
         }
@@ -101,4 +98,7 @@
       std::iter_swap(first, last);
       ++first;
+      if (!(first < last)) {
+        return first;
+      }
       while (true) {
         while (functor(*first) < 0) {
@@ -109,5 +109,5 @@
           --last;
         }
-        if (unitRange(last, first)) {
+        if (!(first < last)) {
           return first;
         }
@@ -120,5 +120,5 @@
     void radixIntroSort(Iterator first, Iterator last,
                         Functor functor, Value mask) {
-      while (mask != 0 && first != last && !unitRange(first, last)) {
+      while (mask != 0 && last - first > 1) {
         Iterator cut = radixSortPartition(first, last, functor, mask);
         mask >>= 1;
Index: lemon/smart_graph.h
===================================================================
--- lemon/smart_graph.h	(revision 1270)
+++ lemon/smart_graph.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -406,4 +406,6 @@
     std::vector<ArcT> arcs;
 
+    int first_free_arc;
+
   public:
 
@@ -810,533 +812,4 @@
   };
 
-  class SmartBpGraphBase {
-
-  protected:
-
-    struct NodeT {
-      int first_out;
-      int partition_next;
-      int partition_index;
-      bool red;
-    };
-
-    struct ArcT {
-      int target;
-      int next_out;
-    };
-
-    std::vector<NodeT> nodes;
-    std::vector<ArcT> arcs;
-
-    int first_red, first_blue;
-    int max_red, max_blue;
-
-  public:
-
-    typedef SmartBpGraphBase Graph;
-
-    class Node;
-    class Arc;
-    class Edge;
-
-    class Node {
-      friend class SmartBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Node(int id) { _id = id;}
-
-    public:
-      Node() {}
-      Node (Invalid) { _id = -1; }
-      bool operator==(const Node& node) const {return _id == node._id;}
-      bool operator!=(const Node& node) const {return _id != node._id;}
-      bool operator<(const Node& node) const {return _id < node._id;}
-    };
-
-    class RedNode : public Node {
-      friend class SmartBpGraphBase;
-    protected:
-
-      explicit RedNode(int pid) : Node(pid) {}
-
-    public:
-      RedNode() {}
-      RedNode(const RedNode& node) : Node(node) {}
-      RedNode(Invalid) : Node(INVALID){}
-    };
-
-    class BlueNode : public Node {
-      friend class SmartBpGraphBase;
-    protected:
-
-      explicit BlueNode(int pid) : Node(pid) {}
-
-    public:
-      BlueNode() {}
-      BlueNode(const BlueNode& node) : Node(node) {}
-      BlueNode(Invalid) : Node(INVALID){}
-    };
-
-    class Edge {
-      friend class SmartBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Edge(int id) { _id = id;}
-
-    public:
-      Edge() {}
-      Edge (Invalid) { _id = -1; }
-      bool operator==(const Edge& arc) const {return _id == arc._id;}
-      bool operator!=(const Edge& arc) const {return _id != arc._id;}
-      bool operator<(const Edge& arc) const {return _id < arc._id;}
-    };
-
-    class Arc {
-      friend class SmartBpGraphBase;
-    protected:
-
-      int _id;
-      explicit Arc(int id) { _id = id;}
-
-    public:
-      operator Edge() const {
-        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
-      }
-
-      Arc() {}
-      Arc (Invalid) { _id = -1; }
-      bool operator==(const Arc& arc) const {return _id == arc._id;}
-      bool operator!=(const Arc& arc) const {return _id != arc._id;}
-      bool operator<(const Arc& arc) const {return _id < arc._id;}
-    };
-
-
-
-    SmartBpGraphBase()
-      : nodes(), arcs(), first_red(-1), first_blue(-1),
-        max_red(-1), max_blue(-1) {}
-
-    typedef True NodeNumTag;
-    typedef True EdgeNumTag;
-    typedef True ArcNumTag;
-
-    int nodeNum() const { return nodes.size(); }
-    int redNum() const { return max_red + 1; }
-    int blueNum() const { return max_blue + 1; }
-    int edgeNum() const { return arcs.size() / 2; }
-    int arcNum() const { return arcs.size(); }
-
-    int maxNodeId() const { return nodes.size()-1; }
-    int maxRedId() const { return max_red; }
-    int maxBlueId() const { return max_blue; }
-    int maxEdgeId() const { return arcs.size() / 2 - 1; }
-    int maxArcId() const { return arcs.size()-1; }
-
-    bool red(Node n) const { return nodes[n._id].red; }
-    bool blue(Node n) const { return !nodes[n._id].red; }
-
-    static RedNode asRedNodeUnsafe(Node n) { return RedNode(n._id); }
-    static BlueNode asBlueNodeUnsafe(Node n) { return BlueNode(n._id); }
-
-    Node source(Arc a) const { return Node(arcs[a._id ^ 1].target); }
-    Node target(Arc a) const { return Node(arcs[a._id].target); }
-
-    RedNode redNode(Edge e) const {
-      return RedNode(arcs[2 * e._id].target);
-    }
-    BlueNode blueNode(Edge e) const {
-      return BlueNode(arcs[2 * e._id + 1].target);
-    }
-
-    static bool direction(Arc a) {
-      return (a._id & 1) == 1;
-    }
-
-    static Arc direct(Edge e, bool d) {
-      return Arc(e._id * 2 + (d ? 1 : 0));
-    }
-
-    void first(Node& node) const {
-      node._id = nodes.size() - 1;
-    }
-
-    static void next(Node& node) {
-      --node._id;
-    }
-
-    void first(RedNode& node) const {
-      node._id = first_red;
-    }
-
-    void next(RedNode& node) const {
-      node._id = nodes[node._id].partition_next;
-    }
-
-    void first(BlueNode& node) const {
-      node._id = first_blue;
-    }
-
-    void next(BlueNode& node) const {
-      node._id = nodes[node._id].partition_next;
-    }
-
-    void first(Arc& arc) const {
-      arc._id = arcs.size() - 1;
-    }
-
-    static void next(Arc& arc) {
-      --arc._id;
-    }
-
-    void first(Edge& arc) const {
-      arc._id = arcs.size() / 2 - 1;
-    }
-
-    static void next(Edge& arc) {
-      --arc._id;
-    }
-
-    void firstOut(Arc &arc, const Node& v) const {
-      arc._id = nodes[v._id].first_out;
-    }
-    void nextOut(Arc &arc) const {
-      arc._id = arcs[arc._id].next_out;
-    }
-
-    void firstIn(Arc &arc, const Node& v) const {
-      arc._id = ((nodes[v._id].first_out) ^ 1);
-      if (arc._id == -2) arc._id = -1;
-    }
-    void nextIn(Arc &arc) const {
-      arc._id = ((arcs[arc._id ^ 1].next_out) ^ 1);
-      if (arc._id == -2) arc._id = -1;
-    }
-
-    void firstInc(Edge &arc, bool& d, const Node& v) const {
-      int de = nodes[v._id].first_out;
-      if (de != -1) {
-        arc._id = de / 2;
-        d = ((de & 1) == 1);
-      } else {
-        arc._id = -1;
-        d = true;
-      }
-    }
-    void nextInc(Edge &arc, bool& d) const {
-      int de = (arcs[(arc._id * 2) | (d ? 1 : 0)].next_out);
-      if (de != -1) {
-        arc._id = de / 2;
-        d = ((de & 1) == 1);
-      } else {
-        arc._id = -1;
-        d = true;
-      }
-    }
-
-    static int id(Node v) { return v._id; }
-    int id(RedNode v) const { return nodes[v._id].partition_index; }
-    int id(BlueNode v) const { return nodes[v._id].partition_index; }
-    static int id(Arc e) { return e._id; }
-    static int id(Edge e) { return e._id; }
-
-    static Node nodeFromId(int id) { return Node(id);}
-    static Arc arcFromId(int id) { return Arc(id);}
-    static Edge edgeFromId(int id) { return Edge(id);}
-
-    bool valid(Node n) const {
-      return n._id >= 0 && n._id < static_cast<int>(nodes.size());
-    }
-    bool valid(Arc a) const {
-      return a._id >= 0 && a._id < static_cast<int>(arcs.size());
-    }
-    bool valid(Edge e) const {
-      return e._id >= 0 && 2 * e._id < static_cast<int>(arcs.size());
-    }
-
-    RedNode addRedNode() {
-      int n = nodes.size();
-      nodes.push_back(NodeT());
-      nodes[n].first_out = -1;
-      nodes[n].red = true;
-      nodes[n].partition_index = ++max_red;
-      nodes[n].partition_next = first_red;
-      first_red = n;
-
-      return RedNode(n);
-    }
-
-    BlueNode addBlueNode() {
-      int n = nodes.size();
-      nodes.push_back(NodeT());
-      nodes[n].first_out = -1;
-      nodes[n].red = false;
-      nodes[n].partition_index = ++max_blue;
-      nodes[n].partition_next = first_blue;
-      first_blue = n;
-
-      return BlueNode(n);
-    }
-
-    Edge addEdge(RedNode u, BlueNode v) {
-      int n = arcs.size();
-      arcs.push_back(ArcT());
-      arcs.push_back(ArcT());
-
-      arcs[n].target = u._id;
-      arcs[n | 1].target = v._id;
-
-      arcs[n].next_out = nodes[v._id].first_out;
-      nodes[v._id].first_out = n;
-
-      arcs[n | 1].next_out = nodes[u._id].first_out;
-      nodes[u._id].first_out = (n | 1);
-
-      return Edge(n / 2);
-    }
-
-    void clear() {
-      arcs.clear();
-      nodes.clear();
-      first_red = -1;
-      first_blue = -1;
-      max_blue = -1;
-      max_red = -1;
-    }
-
-  };
-
-  typedef BpGraphExtender<SmartBpGraphBase> ExtendedSmartBpGraphBase;
-
-  /// \ingroup graphs
-  ///
-  /// \brief A smart undirected bipartite graph class.
-  ///
-  /// \ref SmartBpGraph is a simple and fast bipartite graph implementation.
-  /// It is also quite memory efficient but at the price
-  /// that it does not support node and edge deletion
-  /// (except for the Snapshot feature).
-  ///
-  /// This type fully conforms to the \ref concepts::BpGraph "BpGraph concept"
-  /// and it also provides some additional functionalities.
-  /// Most of its member functions and nested classes are documented
-  /// only in the concept class.
-  ///
-  /// This class provides constant time counting for nodes, edges and arcs.
-  ///
-  /// \sa concepts::BpGraph
-  /// \sa SmartGraph
-  class SmartBpGraph : public ExtendedSmartBpGraphBase {
-    typedef ExtendedSmartBpGraphBase Parent;
-
-  private:
-    /// Graphs are \e not copy constructible. Use GraphCopy instead.
-    SmartBpGraph(const SmartBpGraph &) : ExtendedSmartBpGraphBase() {};
-    /// \brief Assignment of a graph to another one is \e not allowed.
-    /// Use GraphCopy instead.
-    void operator=(const SmartBpGraph &) {}
-
-  public:
-
-    /// Constructor
-
-    /// Constructor.
-    ///
-    SmartBpGraph() {}
-
-    /// \brief Add a new red node to the graph.
-    ///
-    /// This function adds a red new node to the graph.
-    /// \return The new node.
-    RedNode addRedNode() { return Parent::addRedNode(); }
-
-    /// \brief Add a new blue node to the graph.
-    ///
-    /// This function adds a blue new node to the graph.
-    /// \return The new node.
-    BlueNode addBlueNode() { return Parent::addBlueNode(); }
-
-    /// \brief Add a new edge to the graph.
-    ///
-    /// This function adds a new edge to the graph between nodes
-    /// \c u and \c v with inherent orientation from node \c u to
-    /// node \c v.
-    /// \return The new edge.
-    Edge addEdge(RedNode u, BlueNode v) {
-      return Parent::addEdge(u, v);
-    }
-    Edge addEdge(BlueNode v, RedNode u) {
-      return Parent::addEdge(u, v);
-    }
-
-    /// \brief Node validity check
-    ///
-    /// This function gives back \c true if the given node is valid,
-    /// i.e. it is a real node of the graph.
-    ///
-    /// \warning A removed node (using Snapshot) could become valid again
-    /// if new nodes are added to the graph.
-    bool valid(Node n) const { return Parent::valid(n); }
-
-    /// \brief Edge validity check
-    ///
-    /// This function gives back \c true if the given edge is valid,
-    /// i.e. it is a real edge of the graph.
-    ///
-    /// \warning A removed edge (using Snapshot) could become valid again
-    /// if new edges are added to the graph.
-    bool valid(Edge e) const { return Parent::valid(e); }
-
-    /// \brief Arc validity check
-    ///
-    /// This function gives back \c true if the given arc is valid,
-    /// i.e. it is a real arc of the graph.
-    ///
-    /// \warning A removed arc (using Snapshot) could become valid again
-    /// if new edges are added to the graph.
-    bool valid(Arc a) const { return Parent::valid(a); }
-
-    ///Clear the graph.
-
-    ///This function erases all nodes and arcs from the graph.
-    ///
-    void clear() {
-      Parent::clear();
-    }
-
-    /// Reserve memory for nodes.
-
-    /// Using this function, it is possible to avoid superfluous memory
-    /// allocation: if you know that the graph you want to build will
-    /// be large (e.g. it will contain millions of nodes and/or edges),
-    /// then it is worth reserving space for this amount before starting
-    /// to build the graph.
-    /// \sa reserveEdge()
-    void reserveNode(int n) { nodes.reserve(n); };
-
-    /// Reserve memory for edges.
-
-    /// Using this function, it is possible to avoid superfluous memory
-    /// allocation: if you know that the graph you want to build will
-    /// be large (e.g. it will contain millions of nodes and/or edges),
-    /// then it is worth reserving space for this amount before starting
-    /// to build the graph.
-    /// \sa reserveNode()
-    void reserveEdge(int m) { arcs.reserve(2 * m); };
-
-  public:
-
-    class Snapshot;
-
-  protected:
-
-    void saveSnapshot(Snapshot &s)
-    {
-      s._graph = this;
-      s.node_num = nodes.size();
-      s.arc_num = arcs.size();
-    }
-
-    void restoreSnapshot(const Snapshot &s)
-    {
-      while(s.arc_num<arcs.size()) {
-        int n=arcs.size()-1;
-        Edge arc=edgeFromId(n/2);
-        Parent::notifier(Edge()).erase(arc);
-        std::vector<Arc> dir;
-        dir.push_back(arcFromId(n));
-        dir.push_back(arcFromId(n-1));
-        Parent::notifier(Arc()).erase(dir);
-        nodes[arcs[n-1].target].first_out=arcs[n].next_out;
-        nodes[arcs[n].target].first_out=arcs[n-1].next_out;
-        arcs.pop_back();
-        arcs.pop_back();
-      }
-      while(s.node_num<nodes.size()) {
-        int n=nodes.size()-1;
-        Node node = nodeFromId(n);
-        if (Parent::red(node)) {
-          first_red = nodes[n].partition_next;
-          if (first_red != -1) {
-            max_red = nodes[first_red].partition_index;
-          } else {
-            max_red = -1;
-          }
-          Parent::notifier(RedNode()).erase(asRedNodeUnsafe(node));
-        } else {
-          first_blue = nodes[n].partition_next;
-          if (first_blue != -1) {
-            max_blue = nodes[first_blue].partition_index;
-          } else {
-            max_blue = -1;
-          }
-          Parent::notifier(BlueNode()).erase(asBlueNodeUnsafe(node));
-        }
-        Parent::notifier(Node()).erase(node);
-        nodes.pop_back();
-      }
-    }
-
-  public:
-
-    ///Class to make a snapshot of the graph and to restore it later.
-
-    ///Class to make a snapshot of the graph and to restore it later.
-    ///
-    ///The newly added nodes and edges can be removed using the
-    ///restore() function. This is the only way for deleting nodes and/or
-    ///edges from a SmartBpGraph structure.
-    ///
-    ///\note After a state is restored, you cannot restore a later state,
-    ///i.e. you cannot add the removed nodes and edges again using
-    ///another Snapshot instance.
-    ///
-    ///\warning The validity of the snapshot is not stored due to
-    ///performance reasons. If you do not use the snapshot correctly,
-    ///it can cause broken program, invalid or not restored state of
-    ///the graph or no change.
-    class Snapshot
-    {
-      SmartBpGraph *_graph;
-    protected:
-      friend class SmartBpGraph;
-      unsigned int node_num;
-      unsigned int arc_num;
-    public:
-      ///Default constructor.
-
-      ///Default constructor.
-      ///You have to call save() to actually make a snapshot.
-      Snapshot() : _graph(0) {}
-      ///Constructor that immediately makes a snapshot
-
-      /// This constructor immediately makes a snapshot of the given graph.
-      ///
-      Snapshot(SmartBpGraph &gr) {
-        gr.saveSnapshot(*this);
-      }
-
-      ///Make a snapshot.
-
-      ///This function makes a snapshot of the given graph.
-      ///It can be called more than once. In case of a repeated
-      ///call, the previous snapshot gets lost.
-      void save(SmartBpGraph &gr)
-      {
-        gr.saveSnapshot(*this);
-      }
-
-      ///Undo the changes until the last snapshot.
-
-      ///This function undos the changes until the last snapshot
-      ///created by save() or Snapshot(SmartBpGraph&).
-      void restore()
-      {
-        _graph->restoreSnapshot(*this);
-      }
-    };
-  };
-
 } //namespace lemon
 
Index: lemon/soplex.cc
===================================================================
--- lemon/soplex.cc	(revision 1270)
+++ lemon/soplex.cc	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/soplex.h
===================================================================
--- lemon/soplex.h	(revision 1270)
+++ lemon/soplex.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
Index: lemon/suurballe.h
===================================================================
--- lemon/suurballe.h	(revision 1270)
+++ lemon/suurballe.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -138,5 +138,5 @@
     typedef typename TR::Heap Heap;
 
-    /// The \ref lemon::SuurballeDefaultTraits "traits class" of the algorithm.
+    /// The \ref SuurballeDefaultTraits "traits class" of the algorithm.
     typedef TR Traits;
 
@@ -683,5 +683,5 @@
     /// This function returns the total length of the found paths, i.e.
     /// the total cost of the found flow.
-    /// The complexity of the function is O(m).
+    /// The complexity of the function is O(e).
     ///
     /// \pre \ref run() or \ref findFlow() must be called before using
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 1270)
+++ lemon/time_measure.h	(revision 833)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2009
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -35,5 +35,4 @@
 #include <fstream>
 #include <iostream>
-#include <lemon/math.h>
 
 namespace lemon {
@@ -65,19 +64,4 @@
     double rtime;
 
-  public:
-    ///Display format specifier
-
-    ///\e
-    ///
-    enum Format {
-      /// Reports all measured values
-      NORMAL = 0,
-      /// Only real time and an error indicator is displayed
-      SHORT = 1
-    };
-
-  private:
-    static Format _format;
-
     void _reset() {
       utime = stime = cutime = cstime = rtime = 0;
@@ -85,18 +69,4 @@
 
   public:
-
-    ///Set output format
-
-    ///Set output format.
-    ///
-    ///The output format is global for all timestamp instances.
-    static void format(Format f) { _format = f; }
-    ///Retrieve the current output format
-
-    ///Retrieve the current output format
-    ///
-    ///The output format is global for all timestamp instances.
-    static Format format() { return _format; }
-
 
     ///Read the current time values of the process
@@ -255,22 +225,9 @@
   inline std::ostream& operator<<(std::ostream& os,const TimeStamp &t)
   {
-    switch(t._format)
-      {
-      case TimeStamp::NORMAL:
-        os << "u: " << t.userTime() <<
-          "s, s: " << t.systemTime() <<
-          "s, cu: " << t.cUserTime() <<
-          "s, cs: " << t.cSystemTime() <<
-          "s, real: " << t.realTime() << "s";
-        break;
-      case TimeStamp::SHORT:
-        double total = t.userTime()+t.systemTime()+
-          t.cUserTime()+t.cSystemTime();
-        os << t.realTime()
-           << "s (err: " << round((t.realTime()-total)/
-                                  t.realTime()*10000)/100
-           << "%)";
-        break;
-      }
+    os << "u: " << t.userTime() <<
+      "s, s: " << t.systemTime() <<
+      "s, cu: " << t.cUserTime() <<
+      "s, cs: " << t.cSystemTime() <<
+      "s, real: " << t.realTime() << "s";
     return os;
   }
@@ -512,5 +469,4 @@
     std::string _title;
     std::ostream &_os;
-    bool _active;
   public:
     ///Constructor
@@ -520,25 +476,11 @@
     ///\param os The stream to print the report to.
     ///\param run Sets whether the timer should start immediately.
-    ///\param active Sets whether the report should actually be printed
-    ///       on destruction.
-    TimeReport(std::string title,std::ostream &os=std::cerr,bool run=true,
-               bool active=true)
-      : Timer(run), _title(title), _os(os), _active(active) {}
+    TimeReport(std::string title,std::ostream &os=std::cerr,bool run=true)
+      : Timer(run), _title(title), _os(os){}
     ///Destructor that prints the ellapsed time
     ~TimeReport()
     {
-      if(_active) _os << _title << *this << std::endl;
-    }
-
-    ///Retrieve the activity status
-
-    ///\e
-    ///
-    bool active() const { return _active; }
-    ///Set the activity status
-
-    /// This function set whether the time report should actually be printed
-    /// on destruction.
-    void active(bool a) { _active=a; }
+      _os << _title << *this << std::endl;
+    }
   };
 
Index: lemon/unionfind.h
===================================================================
--- lemon/unionfind.h	(revision 1270)
+++ lemon/unionfind.h	(revision 956)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2013
+ * Copyright (C) 2003-2010
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
