This finds all points on an



grid with coordinates that are coprime:
Find the shortest tour using the

method, the default for 2D real inputs:
Find the shortest tour using the

method, the default for non-2D or nonreal inputs:
The

algorithm performs exchanges of edge endpoints for improvement:

(Convex hull, Cheapest insertion and Angle selection) intended for points in

:
The

algorithm moves from one point to the nearest unvisited neighbor:

is a variant of the

algorithm with a known upper bound:

uses simulated annealing to minimize the tour length:
This finds the shortest tour through 100 points, with a penalty added to cross a "river":
This defines a sparse distance matrix among six points and finds the shortest tour: