Index: lemon/hartmann_orlin.h
===================================================================
--- lemon/hartmann_orlin.h	(revision 766)
+++ lemon/hartmann_orlin.h	(revision 767)
@@ -151,9 +151,8 @@
     struct PathData
     {
-      bool found;
       LargeValue dist;
       Arc pred;
-      PathData(bool f = false, LargeValue d = 0, Arc p = INVALID) :
-        found(f), dist(d), pred(p) {}
+      PathData(LargeValue d, Arc p = INVALID) :
+        dist(d), pred(p) {}
     };
 
@@ -191,4 +190,7 @@
 
     Tolerance _tolerance;
+
+    // Infinite constant
+    const LargeValue INF;
 
   public:
@@ -246,5 +248,8 @@
       _gr(digraph), _length(length), _comp(digraph), _out_arcs(digraph),
       _best_found(false), _best_length(0), _best_size(1),
-      _cycle_path(NULL), _local_path(false), _data(digraph)
+      _cycle_path(NULL), _local_path(false), _data(digraph),
+      INF(std::numeric_limits<LargeValue>::has_infinity ?
+          std::numeric_limits<LargeValue>::infinity() :
+          std::numeric_limits<LargeValue>::max())
     {}
 
@@ -473,5 +478,5 @@
       }      
       for (int i = 0; i < n; ++i) {
-        _data[(*_nodes)[i]].resize(n + 1);
+        _data[(*_nodes)[i]].resize(n + 1, PathData(INF));
       }
       return true;
@@ -483,5 +488,5 @@
     void processRounds() {
       Node start = (*_nodes)[0];
-      _data[start][0] = PathData(true, 0);
+      _data[start][0] = PathData(0);
       _process.clear();
       _process.push_back(start);
@@ -518,10 +523,7 @@
           v = _gr.target(e);
           d = _data[u][k-1].dist + _length[e];
-          if (!_data[v][k].found) {
-            next.push_back(v);
-            _data[v][k] = PathData(true, _data[u][k-1].dist + _length[e], e);
-          }
-          else if (_tolerance.less(d, _data[v][k].dist)) {
-            _data[v][k] = PathData(true, d, e);
+          if (_tolerance.less(d, _data[v][k].dist)) {
+            if (_data[v][k].dist == INF) next.push_back(v);
+            _data[v][k] = PathData(d, e);
           }
         }
@@ -541,6 +543,6 @@
           v = _gr.target(e);
           d = _data[u][k-1].dist + _length[e];
-          if (!_data[v][k].found || _tolerance.less(d, _data[v][k].dist)) {
-            _data[v][k] = PathData(true, d, e);
+          if (_tolerance.less(d, _data[v][k].dist)) {
+            _data[v][k] = PathData(d, e);
           }
         }
@@ -562,5 +564,5 @@
       for (int i = 0; i < n; ++i) {
         u = (*_nodes)[i];
-        if (!_data[u][k].found) continue;
+        if (_data[u][k].dist == INF) continue;
         for (int j = k; j >= 0; --j) {
           if (level[u].first == i && level[u].second > 0) {
@@ -587,9 +589,9 @@
         for (int i = 0; i < n; ++i) {
           u = (*_nodes)[i];
-          pi[u] = std::numeric_limits<LargeValue>::max();
+          pi[u] = INF;
           for (int j = 0; j <= k; ++j) {
-            d = _data[u][j].dist * _curr_size - j * _curr_length;
-            if (_data[u][j].found && _tolerance.less(d, pi[u])) {
-              pi[u] = d;
+            if (_data[u][j].dist < INF) {
+              d = _data[u][j].dist * _curr_size - j * _curr_length;
+              if (_tolerance.less(d, pi[u])) pi[u] = d;
             }
           }
Index: lemon/howard.h
===================================================================
--- lemon/howard.h	(revision 764)
+++ lemon/howard.h	(revision 767)
@@ -179,4 +179,7 @@
     Tolerance _tolerance;
   
+    // Infinite constant
+    const LargeValue INF;
+
   public:
   
@@ -231,7 +234,11 @@
     Howard( const Digraph &digraph,
             const LengthMap &length ) :
-      _gr(digraph), _length(length), _cycle_path(NULL), _local_path(false),
+      _gr(digraph), _length(length), _best_found(false),
+      _best_length(0), _best_size(1), _cycle_path(NULL), _local_path(false),
       _policy(digraph), _reached(digraph), _level(digraph), _dist(digraph),
-      _comp(digraph), _in_arcs(digraph)
+      _comp(digraph), _in_arcs(digraph),
+      INF(std::numeric_limits<LargeValue>::has_infinity ?
+          std::numeric_limits<LargeValue>::infinity() :
+          std::numeric_limits<LargeValue>::max())
     {}
 
@@ -308,5 +315,5 @@
         }
         // Update the best cycle (global minimum mean cycle)
-        if ( !_best_found || (_curr_found &&
+        if ( _curr_found && (!_best_found ||
              _curr_length * _best_size < _best_length * _curr_size) ) {
           _best_found = true;
@@ -447,5 +454,5 @@
       }
       for (int i = 0; i < int(_nodes->size()); ++i) {
-        _dist[(*_nodes)[i]] = std::numeric_limits<LargeValue>::max();
+        _dist[(*_nodes)[i]] = INF;
       }
       Node u, v;
Index: lemon/karp.h
===================================================================
--- lemon/karp.h	(revision 765)
+++ lemon/karp.h	(revision 767)
@@ -149,9 +149,8 @@
     struct PathData
     {
-      bool found;
       LargeValue dist;
       Arc pred;
-      PathData(bool f = false, LargeValue d = 0, Arc p = INVALID) :
-        found(f), dist(d), pred(p) {}
+      PathData(LargeValue d, Arc p = INVALID) :
+        dist(d), pred(p) {}
     };
 
@@ -187,4 +186,7 @@
 
     Tolerance _tolerance;
+    
+    // Infinite constant
+    const LargeValue INF;
 
   public:
@@ -242,5 +244,8 @@
       _gr(digraph), _length(length), _comp(digraph), _out_arcs(digraph),
       _cycle_length(0), _cycle_size(1), _cycle_node(INVALID),
-      _cycle_path(NULL), _local_path(false), _data(digraph)
+      _cycle_path(NULL), _local_path(false), _data(digraph),
+      INF(std::numeric_limits<LargeValue>::has_infinity ?
+          std::numeric_limits<LargeValue>::infinity() :
+          std::numeric_limits<LargeValue>::max())
     {}
 
@@ -459,5 +464,5 @@
       }      
       for (int i = 0; i < n; ++i) {
-        _data[(*_nodes)[i]].resize(n + 1);
+        _data[(*_nodes)[i]].resize(n + 1, PathData(INF));
       }
       return true;
@@ -469,5 +474,5 @@
     void processRounds() {
       Node start = (*_nodes)[0];
-      _data[start][0] = PathData(true, 0);
+      _data[start][0] = PathData(0);
       _process.clear();
       _process.push_back(start);
@@ -494,10 +499,7 @@
           v = _gr.target(e);
           d = _data[u][k-1].dist + _length[e];
-          if (!_data[v][k].found) {
-            next.push_back(v);
-            _data[v][k] = PathData(true, _data[u][k-1].dist + _length[e], e);
-          }
-          else if (_tolerance.less(d, _data[v][k].dist)) {
-            _data[v][k] = PathData(true, d, e);
+          if (_tolerance.less(d, _data[v][k].dist)) {
+            if (_data[v][k].dist == INF) next.push_back(v);
+            _data[v][k] = PathData(d, e);
           }
         }
@@ -517,6 +519,6 @@
           v = _gr.target(e);
           d = _data[u][k-1].dist + _length[e];
-          if (!_data[v][k].found || _tolerance.less(d, _data[v][k].dist)) {
-            _data[v][k] = PathData(true, d, e);
+          if (_tolerance.less(d, _data[v][k].dist)) {
+            _data[v][k] = PathData(d, e);
           }
         }
@@ -529,10 +531,10 @@
       for (int i = 0; i < n; ++i) {
         Node u = (*_nodes)[i];
-        if (!_data[u][n].found) continue;
+        if (_data[u][n].dist == INF) continue;
         LargeValue length, max_length = 0;
         int size, max_size = 1;
         bool found_curr = false;
         for (int k = 0; k < n; ++k) {
-          if (!_data[u][k].found) continue;
+          if (_data[u][k].dist == INF) continue;
           length = _data[u][n].dist - _data[u][k].dist;
           size = n - k;
