Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

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 OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (1)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]=
Introduced in 2015
(10.2)