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.

FindShortestTour[{v1,v2,},j,k]
finds an ordering of the that minimizes the total distance on a path from to .

FindShortestTour[graph,s,t]
finds an ordering of the vertices that minimizes the total length on a path from s to t.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

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

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Order the points according to the tour found:

In[3]:=
Click for copyable input
Out[3]=

Plot the tour:

In[4]:=
Click for copyable input
Out[4]=

Find the shortest tour in a graph:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Highlight the tour:

In[3]:=
Click for copyable input
Out[3]=

Find a shortest tour of Europe from Albania to Spain:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Show the tour:

In[5]:=
Click for copyable input
Out[5]=
Introduced in 2007
(6.0)
| Updated in 2015
(10.2)
Translate this page: