Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 1230)
+++ lemon/CMakeLists.txt	(revision 1133)
@@ -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()
 
Index: lemon/base.cc
===================================================================
--- lemon/base.cc	(revision 1222)
+++ lemon/base.cc	(revision 554)
@@ -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/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 1221)
+++ lemon/capacity_scaling.h	(revision 1240)
@@ -67,9 +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(e\log U (n+e)\log n)\f$, where <i>U</i> denotes the maximum
-  /// of node supply and arc capacity values.
+  /// \ref min_cost_flow "minimum cost flow" \ref amo93networkflows,
+  /// \ref edmondskarp72theoretical. It is an efficient dual
+  /// solution method.
   ///
   /// This algorithm is typically slower than \ref CostScaling and
@@ -740,4 +738,9 @@
       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
       for (int i = 0; i != _root; ++i) {
@@ -832,4 +835,13 @@
 
       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.h
===================================================================
--- lemon/cbc.h	(revision 1232)
+++ lemon/cbc.h	(revision 956)
@@ -17,4 +17,5 @@
  */
 
+// -*- C++ -*-
 #ifndef LEMON_CBC_H
 #define LEMON_CBC_H
Index: lemon/concepts/bpgraph.h
===================================================================
--- lemon/concepts/bpgraph.h	(revision 1217)
+++ lemon/concepts/bpgraph.h	(revision 1196)
@@ -998,5 +998,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; }
@@ -1004,5 +1004,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/digraph.h
===================================================================
--- lemon/concepts/digraph.h	(revision 1217)
+++ lemon/concepts/digraph.h	(revision 956)
@@ -410,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; }
@@ -416,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 1217)
+++ lemon/concepts/graph.h	(revision 1186)
@@ -758,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; }
@@ -764,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 1217)
+++ lemon/concepts/graph_components.h	(revision 1196)
@@ -876,13 +876,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 {}
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 1232)
+++ lemon/config.h.in	(revision 1133)
@@ -7,6 +7,4 @@
 #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
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 1239)
+++ lemon/core.h	(revision 1195)
@@ -36,9 +36,4 @@
 #ifdef _MSC_VER
 #pragma warning( disable : 4250 4355 4503 4800 4996 )
-#endif
-
-#ifdef __GNUC__
-// Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
-#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
 #endif
 
Index: lemon/cost_scaling.h
===================================================================
--- lemon/cost_scaling.h	(revision 1221)
+++ lemon/cost_scaling.h	(revision 1240)
@@ -92,11 +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^2e\log(nK))\f$, where <i>K</i> denotes the maximum arc cost.
   ///
   /// In general, \ref NetworkSimplex and \ref CostScaling are the fastest
@@ -764,4 +762,8 @@
       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
@@ -899,4 +901,13 @@
 
       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;
     }
 
@@ -1272,5 +1283,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];
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 1231)
+++ lemon/cplex.cc	(revision 1183)
@@ -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 1231)
+++ lemon/cplex.h	(revision 793)
@@ -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 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 1221)
+++ lemon/cycle_canceling.h	(revision 1240)
@@ -48,11 +48,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.
+  /// \ref amo93networkflows, \ref klein67primal,
+  /// \ref 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 O(n<sup>2</sup>e<sup>2</sup>log(n)),
-  /// but in practice, it is typically orders of magnitude slower than
-  /// the scaling algorithms and \ref NetworkSimplex.
+  /// It runs in strongly polynomial time, 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".)
   ///
@@ -132,5 +132,5 @@
       /// 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 O(n<sup>2</sup>e<sup>3</sup>log(n)).
@@ -138,5 +138,5 @@
       /// 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 O(n<sup>2</sup>e<sup>2</sup>log(n)).
@@ -671,4 +671,8 @@
       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
@@ -779,4 +783,13 @@
 
       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/edmonds_karp.h
===================================================================
--- lemon/edmonds_karp.h	(revision 1229)
+++ 	(revision )
@@ -1,555 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2010
- * 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 \ref clrs01algorithms, \ref amo93networkflows,
-  /// \ref 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:
-
-    /// The \ref 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/glpk.cc
===================================================================
--- lemon/glpk.cc	(revision 1231)
+++ lemon/glpk.cc	(revision 1142)
@@ -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 1231)
+++ lemon/glpk.h	(revision 956)
@@ -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 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/grosso_locatelli_pullan_mc.h
===================================================================
--- lemon/grosso_locatelli_pullan_mc.h	(revision 1221)
+++ lemon/grosso_locatelli_pullan_mc.h	(revision 1022)
@@ -41,5 +41,5 @@
   /// \ref GrossoLocatelliPullanMc implements the iterated local search
   /// algorithm of Grosso, Locatelli, and Pullan for solving the \e maximum
-  /// \e clique \e problem \cite grosso08maxclique.
+  /// \e clique \e problem \ref grosso08maxclique.
   /// It is to find the largest complete subgraph (\e clique) in an
   /// undirected graph, i.e., the largest set of nodes where each
Index: lemon/hartmann_orlin_mmc.h
===================================================================
--- lemon/hartmann_orlin_mmc.h	(revision 1221)
+++ lemon/hartmann_orlin_mmc.h	(revision 1164)
@@ -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(ne) and uses space O(n<sup>2</sup>+e).
+  /// \ref hartmann93finding, \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.
@@ -276,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 1221)
+++ lemon/howard_mmc.h	(revision 1178)
@@ -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 dasdan98minmeancycle, \ref dasdan04experimental.
   /// This class provides the most efficient algorithm for the
   /// minimum mean cycle problem, though the best known theoretical
@@ -283,6 +283,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/karp_mmc.h
===================================================================
--- lemon/karp_mmc.h	(revision 1221)
+++ 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
-  /// \cite karp78characterization, \cite dasdan98minmeancycle.
+  /// \ref karp78characterization, \ref dasdan98minmeancycle.
   /// It runs in time O(ne) and uses space O(n<sup>2</sup>+e).
   ///
@@ -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/list_graph.h
===================================================================
--- lemon/list_graph.h	(revision 1217)
+++ lemon/list_graph.h	(revision 1193)
@@ -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.
Index: lemon/lp.h
===================================================================
--- lemon/lp.h	(revision 1232)
+++ lemon/lp.h	(revision 956)
@@ -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.h
===================================================================
--- lemon/lp_base.h	(revision 1231)
+++ lemon/lp_base.h	(revision 1143)
@@ -1008,34 +1008,4 @@
   public:
 
-    ///\e
-    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 1231)
+++ lemon/lp_skeleton.cc	(revision 956)
@@ -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 1231)
+++ lemon/lp_skeleton.h	(revision 956)
@@ -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/math.h
===================================================================
--- lemon/math.h	(revision 1222)
+++ lemon/math.h	(revision 956)
@@ -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/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 1221)
+++ lemon/network_simplex.h	(revision 1240)
@@ -42,6 +42,6 @@
   /// \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
@@ -1067,4 +1067,8 @@
       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
@@ -1231,4 +1235,13 @@
       return true;
     }
+    
+    // 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
@@ -1504,5 +1517,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/path.h
===================================================================
--- lemon/path.h	(revision 1212)
+++ lemon/path.h	(revision 1162)
@@ -318,5 +318,5 @@
       /// Constructor with starting point
       ArcIt(const SimplePath &_path, int _idx)
-        : path(&_path), idx(_idx) {}
+        : idx(_idx), path(&_path) {}
 
     public:
Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 1221)
+++ lemon/preflow.h	(revision 1111)
@@ -103,6 +103,6 @@
   /// 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
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 1222)
+++ lemon/time_measure.h	(revision 833)
@@ -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;
@@ -86,18 +70,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
     void stamp()
@@ -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;
+    }
   };
 
