1.1 --- a/lemon/insertion_tsp.h Fri Aug 09 14:07:27 2013 +0200
1.2 +++ b/lemon/insertion_tsp.h Fri Aug 09 11:28:17 2013 +0200
1.3 @@ -2,7 +2,7 @@
1.4 *
1.5 * This file is a part of LEMON, a generic C++ optimization library.
1.6 *
1.7 - * Copyright (C) 2003-2010
1.8 + * Copyright (C) 2003-2013
1.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.11 *
1.12 @@ -360,7 +360,7 @@
1.13 for (unsigned int i=0; i<_notused.size(); ++i) {
1.14 Node u = _notused[i];
1.15 Cost min_cost = costDiff(_tour.back(), _tour.front(), u);
1.16 - int min_pos = 0;
1.17 + int min_pos = 0;
1.18 for (unsigned int j=1; j<_tour.size(); ++j) {
1.19 Cost curr_cost = costDiff(_tour[j-1], _tour[j], u);
1.20 if (curr_cost < min_cost) {
1.21 @@ -390,7 +390,7 @@
1.22 Node sn = _notused[min_node];
1.23 _notused[min_node] = _notused.back();
1.24 _notused.pop_back();
1.25 -
1.26 +
1.27 // Insert the selected node into the tour
1.28 const int ipos = _ins_pos[sn];
1.29 _tour.insert(_tour.begin() + ipos, sn);
1.30 @@ -405,7 +405,7 @@
1.31 int ipos_next = ipos == int(_tour.size())-1 ? 0 : ipos+1;
1.32 Cost nc1 = costDiff(_tour[ipos_prev], _tour[ipos], u);
1.33 Cost nc2 = costDiff(_tour[ipos], _tour[ipos_next], u);
1.34 -
1.35 +
1.36 if (nc1 <= curr_cost || nc2 <= curr_cost) {
1.37 // A new position is better than the old one
1.38 if (nc1 <= nc2) {
1.39 @@ -420,7 +420,7 @@
1.40 if (curr_pos == ipos) {
1.41 // The minimum should be found again
1.42 curr_cost = costDiff(_tour.back(), _tour.front(), u);
1.43 - curr_pos = 0;
1.44 + curr_pos = 0;
1.45 for (unsigned int j=1; j<_tour.size(); ++j) {
1.46 Cost tmp_cost = costDiff(_tour[j-1], _tour[j], u);
1.47 if (tmp_cost < curr_cost) {
1.48 @@ -433,7 +433,7 @@
1.49 ++curr_pos;
1.50 }
1.51 }
1.52 -
1.53 +
1.54 _ins_cost[u] = curr_cost;
1.55 _ins_pos[u] = curr_pos;
1.56 }