Interface TSPAlgorithm


public interface TSPAlgorithm

Interface TSPAlgorithm actually represents two algorithms. One is the genetic algorithm and the other is a greedy heuristic.


Method Summary
 int[] geneticAlgorithm(Pointd[] points)
          Method geneticAlgorithm should implement the genetic algorithm for TSP.
 int[] heuristic(Pointd[] points)
          Method heuristic should implement a simple greedy heuristic.
 

Method Detail

geneticAlgorithm

public int[] geneticAlgorithm(Pointd[] points)
Method geneticAlgorithm should implement the genetic algorithm for TSP. The input is a collection of n 2D points, where n is the length of the array. The output should be a permuation of the digits 0 to n-1.

Parameters:
points - a Pointd[] value
Returns:
an int[] value

heuristic

public int[] heuristic(Pointd[] points)
Method heuristic should implement a simple greedy heuristic.

Parameters:
points - a Pointd[] value
Returns:
an int[] value