[Lemon-commits] Alpar Juttner: Merge bugfix #476

Lemon HG hg at lemon.cs.elte.hu
Thu Oct 10 17:27:04 CEST 2013


details:   http://lemon.cs.elte.hu/hg/lemon/rev/f70d8f5a1a5d
changeset: 1295:f70d8f5a1a5d
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Wed Sep 25 11:32:41 2013 +0200
description:
	Merge bugfix #476

diffstat:

 lemon/nearest_neighbor_tsp.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff --git a/lemon/nearest_neighbor_tsp.h b/lemon/nearest_neighbor_tsp.h
--- a/lemon/nearest_neighbor_tsp.h
+++ b/lemon/nearest_neighbor_tsp.h
@@ -115,7 +115,7 @@
           if (min_edge1 == INVALID) {
             for (IncEdgeIt e(_gr, n1); e != INVALID; ++e) {
               if (!used[_gr.runningNode(e)] &&
-                  (_cost[e] < _cost[min_edge1] || min_edge1 == INVALID)) {
+                  (min_edge1 == INVALID || _cost[e] < _cost[min_edge1])) {
                 min_edge1 = e;
               }
             }
@@ -124,7 +124,7 @@
           if (min_edge2 == INVALID) {
             for (IncEdgeIt e(_gr, n2); e != INVALID; ++e) {
               if (!used[_gr.runningNode(e)] &&
-                  (_cost[e] < _cost[min_edge2] || min_edge2 == INVALID)) {
+                  (min_edge2 == INVALID||_cost[e] < _cost[min_edge2])) {
                 min_edge2 = e;
               }
             }


More information about the Lemon-commits mailing list