Index: gtags
===================================================================
--- .hgtags	(revision 1321)
+++ 	(revision )
@@ -1,2 +1,0 @@
-57ab090b6109902536ee34b1e8d4d123474311e3 r1.3
-bdabbf66b2ad131199059736178664f44c69adaf r1.3.1
Index: NEWS
===================================================================
--- NEWS	(revision 1320)
+++ NEWS	(revision 1281)
@@ -1,17 +1,2 @@
-2014-07-07 Version 1.3.1 released
-
-        Bugfix release.
-
-        #484: Require CMAKE 2.8
-        #471, #472, #480: Various clang compatibility fixes
-        #481, #482: Fix shared lib build and versioning
-        #476: Fix invalid map query in NearestNeighborTsp
-        #478: Bugfix in debug checking and lower bound handling
-              in min cost flow algorithms
-        #479, #465: Bugfix in default LP/MIP backend settings
-        #476: Bugfix in tsp_test
-        #487: Add missing include header and std:: namespace spec.
-        #474: Fix division by zero error in NetworkSimplex
-
 2013-08-10 Version 1.3 released
 
Index: doc/groups.dox
===================================================================
--- doc/groups.dox	(revision 1280)
+++ doc/groups.dox	(revision 1271)
@@ -295,4 +295,12 @@
 
 /**
+@defgroup matrices Matrices
+@ingroup auxdat
+\brief Two dimensional data storages implemented in LEMON.
+
+This group contains two dimensional data storages implemented in LEMON.
+*/
+
+/**
 @defgroup algs Algorithms
 \brief This group contains the several algorithms
@@ -327,4 +335,8 @@
    but the digraph should not contain directed cycles with negative total
    length.
+ - \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms
+   for solving the \e all-pairs \e shortest \e paths \e problem when arc
+   lenghts can be either positive or negative, but the digraph should
+   not contain directed cycles with negative total length.
  - \ref Suurballe A successive shortest path algorithm for finding
    arc-disjoint paths between two nodes having minimum total length.
@@ -360,8 +372,18 @@
 \f[ 0 \leq f(uv) \leq cap(uv) \quad \forall uv\in A \f]
 
-\ref Preflow is an efficient implementation of Goldberg-Tarjan's
-preflow push-relabel algorithm \cite goldberg88newapproach for finding
-maximum flows. It also provides functions to query the minimum cut,
-which is the dual problem of maximum flow.
+LEMON contains several algorithms for solving maximum flow problems:
+- \ref EdmondsKarp Edmonds-Karp algorithm
+  \cite edmondskarp72theoretical.
+- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm
+  \cite goldberg88newapproach.
+- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees
+  \cite dinic70algorithm, \cite sleator83dynamic.
+- \ref GoldbergTarjan !Preflow push-relabel algorithm with dynamic trees
+  \cite goldberg88newapproach, \cite sleator83dynamic.
+
+In most cases the \ref Preflow algorithm provides the
+fastest method for computing a maximum flow. All implementations
+also provide functions to query the minimum cut, which is the dual
+problem of maximum flow.
 
 \ref Circulation is a preflow push-relabel algorithm implemented directly
@@ -498,4 +520,14 @@
 
 The matching algorithms implemented in LEMON:
+- \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm
+  for calculating maximum cardinality matching in bipartite graphs.
+- \ref PrBipartiteMatching Push-relabel algorithm
+  for calculating maximum cardinality matching in bipartite graphs.
+- \ref MaxWeightedBipartiteMatching
+  Successive shortest path algorithm for calculating maximum weighted
+  matching and maximum weighted bipartite matching in bipartite graphs.
+- \ref MinCostMaxBipartiteMatching
+  Successive shortest path algorithm for calculating minimum cost maximum
+  matching in bipartite graphs.
 - \ref MaxMatching Edmond's blossom shrinking algorithm for calculating
   maximum cardinality matching in general graphs.
@@ -622,4 +654,21 @@
 
 /**
+@defgroup lp_utils Tools for Lp and Mip Solvers
+@ingroup lp_group
+\brief Helper tools to the Lp and Mip solvers.
+
+This group adds some helper tools to general optimization framework
+implemented in LEMON.
+*/
+
+/**
+@defgroup metah Metaheuristics
+@ingroup gen_opt_group
+\brief Metaheuristics for LEMON library.
+
+This group contains some metaheuristic optimization tools.
+*/
+
+/**
 @defgroup utils Tools and Utilities
 \brief Tools and utilities for programming in LEMON
Index: lemon/dimacs.h
===================================================================
--- lemon/dimacs.h	(revision 1375)
+++ lemon/dimacs.h	(revision 1270)
@@ -26,5 +26,4 @@
 #include <lemon/maps.h>
 #include <lemon/error.h>
-
 /// \ingroup dimacs_group
 /// \file
@@ -124,5 +123,5 @@
   ///
   /// If the file type was previously evaluated by dimacsType(), then
-  /// the descriptor struct should be given by the \c desc parameter.
+  /// the descriptor struct should be given by the \c dest parameter.
   template <typename Digraph, typename LowerMap,
             typename CapacityMap, typename CostMap,
@@ -278,5 +277,5 @@
   ///
   /// If the file type was previously evaluated by dimacsType(), then
-  /// the descriptor struct should be given by the \c desc parameter.
+  /// the descriptor struct should be given by the \c dest parameter.
   template<typename Digraph, typename CapacityMap>
   void readDimacsMax(std::istream& is,
@@ -305,5 +304,5 @@
   ///
   /// If the file type was previously evaluated by dimacsType(), then
-  /// the descriptor struct should be given by the \c desc parameter.
+  /// the descriptor struct should be given by the \c dest parameter.
   template<typename Digraph, typename LengthMap>
   void readDimacsSp(std::istream& is,
@@ -336,5 +335,5 @@
   ///
   /// If the file type was previously evaluated by dimacsType(), then
-  /// the descriptor struct should be given by the \c desc parameter.
+  /// the descriptor struct should be given by the \c dest parameter.
   template<typename Digraph, typename CapacityMap>
   void readDimacsCap(std::istream& is,
@@ -345,5 +344,5 @@
     typename Digraph::Node u,v;
     if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is);
-    if(desc.type!=DimacsDescriptor::MAX && desc.type!=DimacsDescriptor::SP)
+    if(desc.type!=DimacsDescriptor::MAX || desc.type!=DimacsDescriptor::SP)
       throw FormatError("Problem type mismatch");
     _readDimacs(is, g, capacity, u, v, infty, desc);
@@ -376,5 +375,5 @@
   ///
   /// If the file type was previously evaluated by dimacsType(), then
-  /// the descriptor struct should be given by the \c desc parameter.
+  /// the descriptor struct should be given by the \c dest parameter.
   template<typename Graph>
   void readDimacsMat(std::istream& is, Graph &g,
Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 1385)
+++ lemon/preflow.h	(revision 1270)
@@ -477,5 +477,5 @@
     /// flow to the given \c flowMap. The \c flowMap should contain a
     /// flow or at least a preflow, i.e. at each node excluding the
-    /// source node the incoming flow should be greater or equal to the
+    /// source node the incoming flow should greater or equal to the
     /// outgoing flow.
     /// \return \c false if the given \c flowMap is not a preflow.
@@ -496,5 +496,5 @@
           excess -= (*_flow)[e];
         }
-        if (_tolerance.negative(excess) && n != _source) return false;
+        if (excess < 0 && n != _source) return false;
         (*_excess)[n] = excess;
       }
@@ -640,5 +640,5 @@
           (*_excess)[n] = excess;
 
-          if (_tolerance.nonZero(excess)) {
+          if (excess != 0) {
             if (new_level + 1 < _level->maxLevel()) {
               _level->liftHighestActive(new_level + 1);
@@ -721,5 +721,5 @@
           (*_excess)[n] = excess;
 
-          if (_tolerance.nonZero(excess)) {
+          if (excess != 0) {
             if (new_level + 1 < _level->maxLevel()) {
               _level->liftActiveOn(level, new_level + 1);
@@ -792,5 +792,5 @@
         if (!reached[n]) {
           _level->dirtyTopButOne(n);
-        } else if (_tolerance.positive((*_excess)[n]) && _target != n) {
+        } else if ((*_excess)[n] > 0 && _target != n) {
           _level->activate(n);
         }
@@ -853,5 +853,5 @@
         (*_excess)[n] = excess;
 
-        if (_tolerance.nonZero(excess)) {
+        if (excess != 0) {
           if (new_level + 1 < _level->maxLevel()) {
             _level->liftHighestActive(new_level + 1);
Index: test/max_flow_test.cc
===================================================================
--- test/max_flow_test.cc	(revision 1385)
+++ test/max_flow_test.cc	(revision 1270)
@@ -27,5 +27,4 @@
 #include <lemon/lgf_reader.h>
 #include <lemon/elevator.h>
-#include <lemon/tolerance.h>
 
 using namespace lemon;
@@ -67,35 +66,4 @@
   "target 8\n";
 
-char test_lgf_float[] =
-  "@nodes\n"
-  "label\n"
-  "0\n"
-  "1\n"
-  "2\n"
-  "3\n"
-  "4\n"
-  "5\n"
-  "6\n"
-  "7\n"
-  "8\n"
-  "9\n"
-  "@arcs\n"
-  "      capacity\n"
-  "0 1 0.1\n"
-  "0 2 0.1\n"
-  "0 3 0.1\n"
-  "1 4 0.1\n"
-  "2 4 0.1\n"
-  "3 4 0.1\n"
-  "4 5 0.3\n"
-  "5 6 0.1\n"
-  "5 7 0.1\n"
-  "5 8 0.1\n"
-  "6 9 0.1\n"
-  "7 9 0.1\n"
-  "8 9 0.1\n"
-  "@attributes\n"
-  "source 0\n"
-  "target 9\n";
 
 // Checks the general interface of a max flow algorithm
@@ -198,4 +166,6 @@
   typedef concepts::Digraph Digraph;
   typedef concepts::ReadMap<Digraph::Arc, Value> CapMap;
+  typedef Elevator<Digraph, Digraph::Node> Elev;
+  typedef LinkedElevator<Digraph, Digraph::Node> LinkedElev;
 
   Digraph g;
@@ -215,11 +185,11 @@
 
 template <typename T>
-T cutValue(const SmartDigraph& g,
-           const SmartDigraph::NodeMap<bool>& cut,
-           const SmartDigraph::ArcMap<T>& cap) {
-
-  T c = 0;
-  for (SmartDigraph::ArcIt e(g); e != INVALID; ++e) {
-    if (cut[g.source(e)] && !cut[g.target(e)]) c += cap[e];
+T cutValue (const SmartDigraph& g,
+              const SmartDigraph::NodeMap<bool>& cut,
+              const SmartDigraph::ArcMap<T>& cap) {
+
+  T c=0;
+  for(SmartDigraph::ArcIt e(g); e!=INVALID; ++e) {
+    if (cut[g.source(e)] && !cut[g.target(e)]) c+=cap[e];
   }
   return c;
@@ -230,9 +200,8 @@
                const SmartDigraph::ArcMap<T>& flow,
                const SmartDigraph::ArcMap<T>& cap,
-               SmartDigraph::Node s, SmartDigraph::Node t,
-               const Tolerance<T>& tol) {
+               SmartDigraph::Node s, SmartDigraph::Node t) {
 
   for (SmartDigraph::ArcIt e(g); e != INVALID; ++e) {
-    if (tol.negative(flow[e]) || tol.less(cap[e], flow[e])) return false;
+    if (flow[e] < 0 || flow[e] > cap[e]) return false;
   }
 
@@ -246,27 +215,26 @@
       sum -= flow[e];
     }
-    if (tol.nonZero(sum)) return false;
+    if (sum != 0) return false;
   }
   return true;
 }
 
-void checkInitPreflow()
+void initFlowTest()
 {
   DIGRAPH_TYPEDEFS(SmartDigraph);
 
   SmartDigraph g;
-  SmartDigraph::ArcMap<int> cap(g), iflow(g);
-  Node s = g.addNode(); Node t = g.addNode();
-  Node n1 = g.addNode(); Node n2 = g.addNode();
+  SmartDigraph::ArcMap<int> cap(g),iflow(g);
+  Node s=g.addNode(); Node t=g.addNode();
+  Node n1=g.addNode(); Node n2=g.addNode();
   Arc a;
-  a = g.addArc(s, n1); cap[a] = 20; iflow[a] = 20;
-  a = g.addArc(n1, n2); cap[a] = 10; iflow[a] = 0;
-  a = g.addArc(n2, t); cap[a] = 20; iflow[a] = 0;
-
-  Preflow<SmartDigraph> pre(g, cap, s, t);
+  a=g.addArc(s,n1); cap[a]=20; iflow[a]=20;
+  a=g.addArc(n1,n2); cap[a]=10; iflow[a]=0;
+  a=g.addArc(n2,t); cap[a]=20; iflow[a]=0;
+
+  Preflow<SmartDigraph> pre(g,cap,s,t);
   pre.init(iflow);
   pre.startFirstPhase();
-
-  check(pre.flowValue() == 10, "Incorrect max flow value.");
+  check(pre.flowValue() == 10, "The incorrect max flow value.");
   check(pre.minCut(s), "Wrong min cut (Node s).");
   check(pre.minCut(n1), "Wrong min cut (Node n1).");
@@ -276,5 +244,5 @@
 
 template <typename MF, typename SF>
-void checkMaxFlowAlg(const char *input_lgf,  typename MF::Value expected) {
+void checkMaxFlowAlg() {
   typedef SmartDigraph Digraph;
   DIGRAPH_TYPEDEFS(Digraph);
@@ -285,14 +253,12 @@
   typedef BoolNodeMap CutMap;
 
-  Tolerance<Value> tol;
-
   Digraph g;
   Node s, t;
   CapMap cap(g);
-  std::istringstream input(input_lgf);
-  DigraphReader<Digraph>(g, input)
+  std::istringstream input(test_lgf);
+  DigraphReader<Digraph>(g,input)
       .arcMap("capacity", cap)
-      .node("source", s)
-      .node("target", t)
+      .node("source",s)
+      .node("target",t)
       .run();
 
@@ -300,7 +266,5 @@
   max_flow.run();
 
-  check(!tol.different(expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(checkFlow(g, max_flow.flowMap(), cap, s, t, tol),
+  check(checkFlow(g, max_flow.flowMap(), cap, s, t),
         "The flow is not feasible.");
 
@@ -309,10 +273,13 @@
   Value min_cut_value = cutValue(g, min_cut, cap);
 
-  check(!tol.different(expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value,
+        "The max flow value is not equal to the min cut value.");
 
   FlowMap flow(g);
-  for (ArcIt e(g); e != INVALID; ++e) flow[e] = 13 * max_flow.flowMap()[e];
-  for (ArcIt e(g); e != INVALID; ++e) cap[e] = 17 * cap[e];
+  for (ArcIt e(g); e != INVALID; ++e) flow[e] = max_flow.flowMap()[e];
+
+  Value flow_value = max_flow.flowValue();
+
+  for (ArcIt e(g); e != INVALID; ++e) cap[e] = 2 * cap[e];
   max_flow.init(flow);
 
@@ -323,12 +290,11 @@
   min_cut_value = cutValue(g, min_cut1, cap);
 
-  check(!tol.different(17 * expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(!tol.different(17 * expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value &&
+        min_cut_value == 2 * flow_value,
+        "The max flow value or the min cut value is wrong.");
 
   SF::startSecondPhase(max_flow);       // start second phase of the algorithm
 
-  check(checkFlow(g, max_flow.flowMap(), cap, s, t, tol),
+  check(checkFlow(g, max_flow.flowMap(), cap, s, t),
         "The flow is not feasible.");
 
@@ -337,8 +303,8 @@
   min_cut_value = cutValue(g, min_cut2, cap);
 
-  check(!tol.different(17 * expected, max_flow.flowValue()),
-        "Incorrect max flow value.");
-  check(!tol.different(17 * expected, min_cut_value),
-        "Incorrect min cut value.");
+  check(max_flow.flowValue() == min_cut_value &&
+        min_cut_value == 2 * flow_value,
+        "The max flow value or the min cut value was not doubled");
+
 
   max_flow.flowMap(flow);
@@ -359,7 +325,7 @@
   CutMap min_cut3(g);
   max_flow.minCutMap(min_cut3);
-  min_cut_value = cutValue(g, min_cut3, cap);
-
-  check(!tol.different(max_flow.flowValue(), min_cut_value),
+  min_cut_value=cutValue(g, min_cut3, cap);
+
+  check(max_flow.flowValue() == min_cut_value,
         "The max flow value or the min cut value is wrong.");
 }
@@ -414,26 +380,15 @@
   typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<int> > PType1;
   typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<float> > PType2;
-  typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<double> > PType3;
-
-  checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >(test_lgf, 13);
-  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf, 13);
-  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf, 13);
-
-  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(test_lgf_float, 0.3);
-  checkMaxFlowAlg<PType3, PreflowStartFunctions<PType3> >(test_lgf_float, 0.3);
-
-  checkInitPreflow();
+  checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >();
+  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >();
+  initFlowTest();
 
   // Check EdmondsKarp
   typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<int> > EKType1;
   typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<float> > EKType2;
-  typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<double> > EKType3;
-
-  checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >(test_lgf, 13);
-  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf, 13);
-  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf, 13);
-
-  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(test_lgf_float, 0.3);
-  checkMaxFlowAlg<EKType3, GeneralStartFunctions<EKType3> >(test_lgf_float, 0.3);
+  checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >();
+  checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >();
+
+  initFlowTest();
 
   return 0;
Index: tools/dimacs-solver.cc
===================================================================
--- tools/dimacs-solver.cc	(revision 1386)
+++ tools/dimacs-solver.cc	(revision 1271)
@@ -223,5 +223,4 @@
         throw IoError("Cannot open the file for writing", ap.files()[1]);
       }
-      // fall through
     case 1:
       input.open(ap.files()[0].c_str());
@@ -229,5 +228,4 @@
         throw IoError("File cannot be found", ap.files()[0]);
       }
-      // fall through
     case 0:
       break;
@@ -254,5 +252,4 @@
         case DimacsDescriptor::SP:
           std::cout << "sp";
-          break;
         case DimacsDescriptor::MAT:
           std::cout << "mat";
