FindHamiltonianPath

FindHamiltonianPath[g]

finds a Hamiltonian path in the graph g with the smallest total length.

FindHamiltonianPath[g,s,t]

finds a Hamiltonian path with the smallest total length from s to t.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Find a Hamiltonian path through vertices in a graph:

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

Highlight the path:

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

Find a Hamiltonian path between two individual vertices in a graph:

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

Highlight the path:

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

Scope  (3)

Options  (1)

Applications  (2)

Properties & Relations  (2)

See Also

FindHamiltonianCycle  FindShortestTour  FindShortestPath

Introduced in 2015
(10.2)