# Wolfram Language & System 10.0 (2014)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# FindShortestTour

FindShortestTour[{v1,v2,}]
attempts to find an ordering of the that minimizes the total distance on a tour that visits all the once.

FindShortestTour[graph]
attempts to find an ordering of the vertices in graph that minimizes the total length when visiting each vertex once.

## Details and OptionsDetails and Options

• FindShortestTour is also known as the traveling salesman problem (TSP).
• FindShortestTour returns a list of the form , where is the length of the tour found, and is the ordering.
• The following options can be given:
•  DistanceFunction Automatic function to to apply to pairs of objects Method Automatic method to use
• Automatic settings for DistanceFunction depending on the include:
•  EuclideanDistance numbers of lists of numbers EditDistance strings GeoDistance geo positions
• For graph, the distance is taken to be GraphDistance, which is the shortest path length for an unweighted graph and the sum of weights for a weighted graph.

## ExamplesExamplesopen allclose all

### Basic Examples  (2)Basic Examples  (2)

Find the length and ordering of the shortest tour through points in the plane:

 Out[2]=

Order the points according to the tour found:

 Out[3]=

Plot the tour:

 Out[4]=

Find the shortest tour in a graph:

 Out[2]=

Highlight the tour:

 Out[3]=