---
name: "nauty-hamheuristic"
section: "1"
platform: "linux"
package: "nauty"
version: "2.8.9+ds-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nauty-hamheuristic"
---

# nauty-hamheuristic(1)

try to find hamiltonian cycles in any graphs

## NAME

nauty-hamheuristic - try to find hamiltonian cycles in any graphs

## SYNOPSIS

**hamheuristic** \[*-sgu*\] \[*-vq*\] \[*-V*\] \[*-L#*\] \[*-t#*\] \[*infile* \[*outfile*\]\]

## DESCRIPTION

-

  Apply a heuristic for finding hamiltonian cycles.

-

  Output those which are unsuccessful.

- **-s**

  force output to sparse6 format

- **-g**

  force output to graph6 format If neither **-s** or **-g** are given, the output format is determined by the header or, if there is none, by the format of the first input graph.

- **-V**

  Write those for which a cycle (path with **-p**) is found instead

- **-u**

  Suppress output to outfile, give statistics instead.

-

  The output file will have a header if and only if the input file does.

- **-p**

  Be content with a hamiltonian path

- **-v**

  Give a cycle or path if one is found.

**-L**# Limit number of sideways steps (default 1000+5\*n)

**-t**# Try # times (default 1)

- **-q**

  suppress auxiliary information
