I think this is a bug, because getDistance returns double precision and somehow the java compiler doesn't complain about gain += getDistance(t2, t3) - getDistance(t1,t2); even though here is a loss of precision. For example, with wi29.tsp I get a slightly better path when changing to double.
LinKernighanTSP/src/LinKernighan.java
Line 320 in 55b6056
I think this is a bug, because
getDistancereturnsdoubleprecision and somehow the java compiler doesn't complain aboutgain += getDistance(t2, t3) - getDistance(t1,t2);even though here is a loss of precision. For example, withwi29.tspI get a slightly better path when changing todouble.