// Simulated annealing, using the O(n) neighborhood. // A class used to represent a point: simple x and y value. class Pointd { public double x, y; } public class TSPAnnealingAlt { public static final int INIT_TEMP = 1000; // Initial temp hardcoded. public static final int ITERATIONS = 1000; // Number of iterations to use overall. int numIterations = ITERATIONS; double delT = 0.0001; // Additively decreasing temp schedule. public int[] computeTour (Pointd[] points) { // Use numPoints for convenience. int numPoints = points.length; // Space for current and best tour. int[] tour = new int [numPoints]; int[] bestTour = new int [numPoints]; // Initial tour in given sequence. for (int i=0; i