Academia.eduAcademia.edu

Search for Hamiltonian Cycles

2011, The Mathematica Journal

Abstract

Determining whether Hamiltonian cycles exist in graphs is an NP-complete problem, so it is no wonder that the Combinatorica function HamiltonianCycle is slow for large graphs. Theorems by Dirac, Ore, Pósa, and Chvátal provide sufficient conditions that are easy to check for the existence of such cycles. This article provides Mathematica programs for those conditions, thus extending the capability of HamiltonianQ, which only tests the biconnectivity-a simple necessary condition-of a given graph. We also investigate experimentally the limiting behavior of whether the conditions are fulfilled for large random graphs. The phenomenon seen is proved as a theorem, closely related to earlier results by Karp and Pósa. ‡ Introduction