Class NearestCityPairHeuristic

java.lang.Object
org.cicirello.search.problems.tsp.NearestCityPairHeuristic
All Implemented Interfaces:
Splittable<ConstructiveHeuristic<Permutation>>, ConstructiveHeuristic<Permutation>

public final class NearestCityPairHeuristic extends Object implements ConstructiveHeuristic<Permutation>
This class implements a constructive heuristic for the TSP that prefers the first city of the nearest pair of cities. Since the stochastic sampling algorithms of the library require higher heuristic values to imply preferred choice, this heuristic is implemented as: h(j) == 1.0 / (1.0 + distance(i, j) + mink(distance(j, k))), where h(j) is the heuristic value for city j, and i is the most recently added city.