Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 1133)
+++ 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
Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 1131)
+++ lemon/Makefile.am	(revision 1131)
@@ -0,0 +1,155 @@
+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/grosso_locatelli_pullan_mc.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/max_cardinality_search.h \
+	lemon/nagamochi_ibaraki.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/lock.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 1159)
+++ lemon/adaptors.h	(revision 956)
@@ -1372,5 +1372,5 @@
     /// and edge filter maps.
     SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
-      this->initialize(graph, node_filter, edge_filter);
+      initialize(graph, node_filter, edge_filter);
     }
 
@@ -2278,5 +2278,5 @@
     /// Creates an undirected graph from the given digraph.
     Undirector(DGR& digraph) {
-      this->initialize(digraph);
+      initialize(digraph);
     }
 
Index: lemon/bits/bezier.h
===================================================================
--- lemon/bits/bezier.h	(revision 1157)
+++ lemon/bits/bezier.h	(revision 463)
@@ -160,5 +160,5 @@
     const Point d=(a+b)/2;
     const Point e=(b+c)/2;
-    // const Point f=(d+e)/2;
+    const Point f=(d+e)/2;
     R f1=_f(Bezier3(p1,a,d,e),_d);
     R f2=_f(Bezier3(e,d,c,p4),_d);
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 1161)
+++ lemon/bits/edge_set_extender.h	(revision 1110)
@@ -524,5 +524,5 @@
     // Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &e) const {
-      return e.direction ? this->u(e) : this->v(e);
+      return e.direction ? u(e) : v(e);
     }
     // Running node of the iterator
@@ -530,5 +530,5 @@
     // Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &e) const {
-      return e.direction ? this->v(e) : this->u(e);
+      return e.direction ? v(e) : u(e);
     }
 
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 1159)
+++ lemon/bits/graph_extender.h	(revision 825)
@@ -588,5 +588,5 @@
     // Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &edge) const {
-      return edge._direction ? this->u(edge) : this->v(edge);
+      return edge._direction ? u(edge) : v(edge);
     }
     // Running node of the iterator
@@ -594,5 +594,5 @@
     // Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &edge) const {
-      return edge._direction ? this->v(edge) : this->u(edge);
+      return edge._direction ? v(edge) : u(edge);
     }
 
Index: lemon/bits/solver_bits.h
===================================================================
--- lemon/bits/solver_bits.h	(revision 1142)
+++ lemon/bits/solver_bits.h	(revision 956)
@@ -45,5 +45,4 @@
       void clear() {
         first_item = -1;
-        last_item = -1;
         first_free_item = -1;
         items.clear();
Index: lemon/bits/windows.cc
===================================================================
--- lemon/bits/windows.cc	(revision 1163)
+++ lemon/bits/windows.cc	(revision 1131)
@@ -137,6 +137,4 @@
       InitializeCriticalSection(lock);
       _repr = lock;
-#else
-      _repr = 0; //Just to avoid 'unused variable' warning with clang
 #endif
     }
Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 1137)
+++ lemon/capacity_scaling.h	(revision 1026)
@@ -88,6 +88,6 @@
   ///
   /// \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 All input data (capacities, supply values, and costs) must
+  /// be integer.
   /// \warning This algorithm does not support negative costs for
   /// arcs having infinite upper bound.
Index: lemon/cbc.cc
===================================================================
--- lemon/cbc.cc	(revision 1161)
+++ lemon/cbc.cc	(revision 1122)
@@ -436,4 +436,6 @@
 
     _prob = new CoinModel();
+    rows.clear();
+    cols.clear();
   }
 
Index: lemon/circulation.h
===================================================================
--- lemon/circulation.h	(revision 1159)
+++ lemon/circulation.h	(revision 956)
@@ -573,4 +573,6 @@
 
       Node act;
+      Node bact=INVALID;
+      Node last_activated=INVALID;
       while((act=_level->highestActive())!=INVALID) {
         int actlevel=(*_level)[act];
Index: lemon/clp.cc
===================================================================
--- lemon/clp.cc	(revision 1142)
+++ lemon/clp.cc	(revision 956)
@@ -438,4 +438,6 @@
     delete _prob;
     _prob = new ClpSimplex();
+    rows.clear();
+    cols.clear();
     _col_names_ref.clear();
     _clear_temporals();
Index: lemon/concept_check.h
===================================================================
--- lemon/concept_check.h	(revision 1157)
+++ lemon/concept_check.h	(revision 463)
@@ -36,20 +36,4 @@
 
   template <class T> inline void ignore_unused_variable_warning(const T&) { }
-  template <class T1, class T2>
-  inline void ignore_unused_variable_warning(const T1&, const T2&) { }
-  template <class T1, class T2, class T3>
-  inline void ignore_unused_variable_warning(const T1&, const T2&,
-                                             const T3&) { }
-  template <class T1, class T2, class T3, class T4>
-  inline void ignore_unused_variable_warning(const T1&, const T2&,
-                                             const T3&, const T4&) { }
-  template <class T1, class T2, class T3, class T4, class T5>
-  inline void ignore_unused_variable_warning(const T1&, const T2&,
-                                             const T3&, const T4&,
-                                             const T5&) { }
-  template <class T1, class T2, class T3, class T4, class T5, class T6>
-  inline void ignore_unused_variable_warning(const T1&, const T2&,
-                                             const T3&, const T4&,
-                                             const T5&, const T6&) { }
 
   ///\e
Index: lemon/concepts/graph_components.h
===================================================================
--- lemon/concepts/graph_components.h	(revision 1161)
+++ lemon/concepts/graph_components.h	(revision 1127)
@@ -495,6 +495,4 @@
           _GraphItemIt it3 = it1;
           _GraphItemIt it4 = INVALID;
-          ignore_unused_variable_warning(it3);
-          ignore_unused_variable_warning(it4);
 
           it2 = ++it1;
@@ -586,6 +584,4 @@
           _GraphIncIt it3 = it1;
           _GraphIncIt it4 = INVALID;
-          ignore_unused_variable_warning(it3);
-          ignore_unused_variable_warning(it4);
 
           it2 = ++it1;
Index: lemon/concepts/maps.h
===================================================================
--- lemon/concepts/maps.h	(revision 1157)
+++ lemon/concepts/maps.h	(revision 1125)
@@ -50,5 +50,5 @@
       /// Returns the value associated with the given key.
       Value operator[](const Key &) const {
-        return *(static_cast<Value *>(0)+1);
+        return *static_cast<Value *>(0);
       }
 
Index: lemon/config.h.cmake
===================================================================
--- lemon/config.h.cmake	(revision 1131)
+++ lemon/config.h.cmake	(revision 1131)
@@ -0,0 +1,10 @@
+#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
+#cmakedefine LEMON_USE_PTHREAD 1
+#cmakedefine LEMON_USE_WIN32_THREADS 1
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 1133)
+++ lemon/config.h.in	(revision 1131)
@@ -1,10 +1,32 @@
-#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
-#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
+
+/* Define to 1 if you have pthread */
+#undef LEMON_USE_PTHREAD
+
+/* Define to 1 if you have win32 threads */
+#undef LEMON_USE_WIN32_THREADS
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 1162)
+++ lemon/core.h	(revision 1111)
@@ -1869,24 +1869,13 @@
     ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
     ///
-    Arc operator()(Node s, Node t, Arc prev=INVALID) const
+#ifdef DOXYGEN
+    Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
+#else
+    using ArcLookUp<GR>::operator() ;
+    Arc operator()(Node s, Node t, Arc prev) const
     {
-      if(prev==INVALID)
-        {
-          Arc f=INVALID;
-          Arc e;
-          for(e=_head[s];
-              e!=INVALID&&_g.target(e)!=t;
-              e = t < _g.target(e)?_left[e]:_right[e]) ;
-          while(e!=INVALID)
-            if(_g.target(e)==t)
-              {
-                f = e;
-                e = _left[e];
-              }
-            else e = _right[e];
-          return f;
-        }
-      else return _next[prev];
-    }
+      return prev==INVALID?(*this)(s,t):_next[prev];
+    }
+#endif
 
   };
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 1142)
+++ lemon/cplex.cc	(revision 956)
@@ -471,4 +471,6 @@
     int status;
     _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
+    rows.clear();
+    cols.clear();
   }
 
Index: lemon/glpk.cc
===================================================================
--- lemon/glpk.cc	(revision 1142)
+++ lemon/glpk.cc	(revision 956)
@@ -557,4 +557,6 @@
   void GlpkBase::_clear() {
     glp_erase_prob(lp);
+    rows.clear();
+    cols.clear();
   }
 
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 1159)
+++ lemon/graph_to_eps.h	(revision 1107)
@@ -223,5 +223,5 @@
   using T::_copyright;
 
-  using typename T::NodeTextColorType;
+  using T::NodeTextColorType;
   using T::CUST_COL;
   using T::DIST_COL;
Index: lemon/hartmann_orlin_mmc.h
===================================================================
--- lemon/hartmann_orlin_mmc.h	(revision 959)
+++ lemon/hartmann_orlin_mmc.h	(revision 1164)
@@ -99,5 +99,5 @@
   /// This class implements the Hartmann-Orlin algorithm for finding
   /// a directed cycle of minimum mean cost in a digraph
-  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
+  /// \ref hartmann93finding, \ref dasdan98minmeancycle.
   /// It is an improved version of \ref KarpMmc "Karp"'s original algorithm,
   /// it applies an efficient early termination scheme.
Index: lemon/howard_mmc.h
===================================================================
--- lemon/howard_mmc.h	(revision 956)
+++ lemon/howard_mmc.h	(revision 1164)
@@ -99,5 +99,5 @@
   /// This class implements Howard's policy iteration algorithm for finding
   /// a directed cycle of minimum mean cost in a digraph
-  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
+  /// \ref dasdan98minmeancycle, \ref dasdan04experimental.
   /// This class provides the most efficient algorithm for the
   /// minimum mean cycle problem, though the best known theoretical
Index: lemon/karp_mmc.h
===================================================================
--- lemon/karp_mmc.h	(revision 956)
+++ lemon/karp_mmc.h	(revision 1164)
@@ -99,5 +99,5 @@
   /// This class implements Karp's algorithm for finding a directed
   /// cycle of minimum mean cost in a digraph
-  /// \ref amo93networkflows, \ref dasdan98minmeancycle.
+  /// \ref karp78characterization, \ref dasdan98minmeancycle.
   /// It runs in time O(ne) and uses space O(n<sup>2</sup>+e).
   ///
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/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 1143)
+++ lemon/lp_base.h	(revision 1094)
@@ -1557,5 +1557,5 @@
 
     ///Clears the problem
-    void clear() { _clear(); rows.clear(); cols.clear(); }
+    void clear() { _clear(); }
 
     /// Sets the message level of the solver
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 1136)
+++ lemon/network_simplex.h	(revision 1026)
@@ -123,15 +123,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
+    /// turend out 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 {
 
@@ -159,5 +156,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
@@ -542,5 +539,5 @@
         SortFunc(const CostVector &map) : _map(map) {}
         bool operator()(int left, int right) {
-          return _map[left] < _map[right];
+          return _map[left] > _map[right];
         }
       };
@@ -560,5 +557,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;
 
@@ -604,7 +601,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;
           }
@@ -619,14 +616,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;
       }
Index: lemon/path.h
===================================================================
--- lemon/path.h	(revision 1162)
+++ lemon/path.h	(revision 1024)
@@ -65,10 +65,4 @@
     Path() {}
 
-    /// \brief Copy constructor
-    ///
-    Path(const Path& cpath) {
-      pathCopy(cpath, *this);
-    }
-
     /// \brief Template copy constructor
     ///
@@ -78,11 +72,4 @@
     Path(const CPath& cpath) {
       pathCopy(cpath, *this);
-    }
-
-    /// \brief Copy assignment
-    ///
-    Path& operator=(const Path& cpath) {
-      pathCopy(cpath, *this);
-      return *this;
     }
 
@@ -266,10 +253,4 @@
     SimplePath() {}
 
-    /// \brief Copy constructor
-    ///
-    SimplePath(const SimplePath& cpath) {
-      pathCopy(cpath, *this);
-    }
-
     /// \brief Template copy constructor
     ///
@@ -279,11 +260,4 @@
     SimplePath(const CPath& cpath) {
       pathCopy(cpath, *this);
-    }
-
-    /// \brief Copy assignment
-    ///
-    SimplePath& operator=(const SimplePath& cpath) {
-      pathCopy(cpath, *this);
-      return *this;
     }
 
@@ -458,10 +432,4 @@
     ListPath() : first(0), last(0) {}
 
-    /// \brief Copy constructor
-    ///
-    ListPath(const ListPath& cpath) : first(0), last(0) {
-      pathCopy(cpath, *this);
-    }
-
     /// \brief Template copy constructor
     ///
@@ -478,11 +446,4 @@
     ~ListPath() {
       clear();
-    }
-
-    /// \brief Copy assignment
-    ///
-    ListPath& operator=(const ListPath& cpath) {
-      pathCopy(cpath, *this);
-      return *this;
     }
 
@@ -798,10 +759,4 @@
     StaticPath() : len(0), arcs(0) {}
 
-    /// \brief Copy constructor
-    ///
-    StaticPath(const StaticPath& cpath) : arcs(0) {
-      pathCopy(cpath, *this);
-    }
-
     /// \brief Template copy constructor
     ///
@@ -817,11 +772,4 @@
     ~StaticPath() {
       if (arcs) delete[] arcs;
-    }
-
-    /// \brief Copy assignment
-    ///
-    StaticPath& operator=(const StaticPath& cpath) {
-      pathCopy(cpath, *this);
-      return *this;
     }
 
Index: lemon/planarity.h
===================================================================
--- lemon/planarity.h	(revision 1160)
+++ lemon/planarity.h	(revision 956)
@@ -73,4 +73,5 @@
 
       void discover(const Arc& arc) {
+        Node source = _graph.source(arc);
         Node target = _graph.target(arc);
 
