Dirac's theorem (1952) is a classical result of graph theory, stating that an n-vertex graph (n ≥ 3) is Hamiltonian if every vertex has degree at least n/2. Both the value n/2 and the requirement for every vertex to have high degree are necessary for the theorem to hold.In this work we give efficient algorithms for determining Hamiltonicity when either of the two conditions are relaxed. More precisely, we show that the Hamiltonian cycle problem can be solved in time c k · n O(1) , for some fixed constant c, if at least n − k vertices have degree at least n/2, or if all vertices have degree at least n/2 − k. The running time is, in both cases, asymptotically optimal, under the exponential-time hypothesis (ETH).The results extend the range of tractability of the Hamiltonian cycle problem, showing that it is fixed-parameter tractable when parameterized below a natural bound. In addition, for the first parameterization we show that a kernel with O(k) vertices can be found in polynomial time.
ACM Subject ClassificationTheory of computation → Graph algorithms analysis, Theory of computation → Parameterized complexity and exact algorithms 23:3 states this algorithmic result as a corollary of structural theorems. He does not describe the details of the algorithm or its analysis, but these are not hard to reconstruct.) Here we improve the running time of Häggkvist's algorithm to the stated (asymptotically optimal) c k · n O(1) by more efficiently solving the arising path-cover subproblem.
Statement of resultsOur first result shows that if a graph has a "relaxed" Dirac property, it can be compressed while preserving its Hamiltonicity. Theorem 1.1. Let G be an n-vertex graph such that at least n − k vertices of G have degree at least n/2. There is a deterministic algorithm that, given G, constructs in time O(n 3 ) a 3k-vertex graph G , such that G is Hamiltonian if and only if G is Hamiltonian.Equivalently stated in the language of parameterized complexity, the Hamiltonian cycle problem parameterized by k has a kernel with a linear number of vertices. To determine the Hamiltonicity of a graph G, we simply apply the algorithm of Theorem 1.1 to compress G, and use an exponential-time algorithm (for instance, the Held-Karp algorithm) to solve Hamiltonian Cycle directly on the compressed graph. We thus obtain the following result.Corollary 1.2. If at least n − k vertices of an n-vertex graph G have degree at least n/2, then Hamiltonian Cycle with input G can be solved in deterministic time O(8 k · k 2 + n 3 ).As an alternative, we may also use an approach based on inclusion-exclusion [26] to solve the reduced Hamiltonian cycle instance, achieving the overall running time O(8 k · k 3 + n 3 ), with polynomial space.Our result for the second relaxation of Dirac's theorem is as follows.