OBSOLETE GRAPH UTILITIES 程序包 符号

# HamiltonianCycles

As of Version 10, all the functionality of the GraphUtilities package is built into the Wolfram System. >>

HamiltonianCycles[g,n]
gives a list of n Hamiltonian cycles.

HamiltonianCycles[g]
gives a list of one Hamiltonian cycle.

## 更多信息更多信息

• HamiltonianCycles functionality is now available in the built-in Wolfram Language function FindHamiltonianCycle.
• To use HamiltonianCycles, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
• HamiltonianCycles[g,n] returns an empty list if no Hamiltonian cycle exists.
• HamiltonianCycles considers the input graph as undirected.
• The complexity of the algorithm is such that finding all Hamiltonian cycles for a large graph can take an exponential amount of time.

## 范例范例打开所有单元关闭所有单元

### 基本范例  (2)基本范例  (2)

 In[1]:=

This defines a small graph and finds a Hamiltonian cycle of the graph:

 In[2]:=
 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

HamiltonianCycles has been superseded by FindHamiltonianCycle:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=