Adjacent Files

Project Info

. > TravelingSalesPerson.java

run

Type: public static void

Runs the traveling sales person algorithm and prints the results in the console.

Parameter Name Description
points The points to calculate the order of.

getPath

Type: private static void

Applies the double neighbor heuristic and adds the closest points to the path. The first two points should be calculated first before calling this method.

Parameter Name Description
p1 The “right” point.
p2 The “left” point.

getNearest

Type: private static void

Finds the point nearest to a given parameter…

Parameter Name Description
p The point to compare other points to.
i The current (or start) index of the iteration.

printPath

Type: private static void

Prints all of the “path” points in the console.

Parameter Name Description
i The index of the current iteration.
This site may do shady things with cookies and stuff because it's evil. Please don't read my privacy policy. close