|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public int[] geneticAlgorithm(Pointd[] points)
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.
points
- a Pointd[]
value
int[]
valuepublic int[] heuristic(Pointd[] points)
heuristic
should implement a simple
greedy heuristic.
points
- a Pointd[]
value
int[]
value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |