Approximate and Randomized Algorithms for Computing a Second Hamiltonian Cycle

Argyrios Deligkas, George B. Mertzios, Paul G. Spirakis, Viktor ZamaraevAlgorithmica 2024 · DOI

Abstract

Finding a second Hamiltonian cycle in a graph when one is already known is a challenging problem in graph theory. This paper introduces two novel algorithmic strategies for this task: a linear-time approximation algorithm that finds a "nearly" Hamiltonian cycle and a randomized subexponential-time algorithm for graphs with high minimum degrees. These results bridge the gap between existential proofs and practical computation for a problem that has long lacked subexponential-time solutions.

Introduction

A Hamiltonian cycle is a closed loop visiting every vertex in a graph exactly once. While finding the first cycle is NP-complete, the problem of finding a second cycle $C' \neq C$ given an initial cycle $C$ is equally daunting. For certain graph classes, such as cubic graphs or those with high minimum degrees, the existence of a second cycle is mathematically guaranteed. However, efficient algorithms to locate these cycles have remained elusive. This research addresses this gap by relaxing the search criteria through approximation and randomization.

Algorithmic Strategies

The authors propose two distinct approaches to finding a second cycle.

The Approximation Approach

Instead of searching for a full Hamiltonian cycle of length $n$, this method seeks a "long" cycle. The algorithm partitions the known cycle $C$ into consecutive intervals and employs bipartite matching to identify "chords"—edges not present in $C$—that connect these intervals. By strategically selecting and combining these chords, a new cycle is constructed that approximates the length of the original.

Visualization of different chord configurations (short chords, crossing chords, and crossing pairs of parallel chords) used to construct a second cycle.

The Randomized Approach

This strategy focuses on finding a "red-independent and green-dominating set." The process involves:

  1. Randomized Selection: Using a randomized procedure to select a small vertex set $X$.
  2. Graph Reduction: "Shrinking" the original graph based on $X$ into a significantly smaller auxiliary graph $H$.
  3. Exact Computation: Applying a standard exact algorithm, such as Bellman–Held–Karp, to the reduced graph. The reduced problem size allows for much faster overall computation.

Key Insights and Performance

The effectiveness of these algorithms depends heavily on the graph's degree properties.

  • Degree Ratios and Approximation: The "closeness" of the approximated cycle to the original length is determined by the ratio between the maximum degree ($\Delta$) and minimum degree ($\delta$). If $\Delta/\delta = o(\sqrt{n})$, a cycle of length $n - o(n)$ can be found in $O(m)$ time.
  • Breaking the Exponential Barrier: For graphs with a sufficiently high minimum degree ($\delta = \omega(\log n)$), the randomized algorithm can find a second Hamiltonian cycle with high probability in subexponential time ($2^{o(n)}$). This is achieved because a small dominating set $X$ can serve as a "skeleton" for the second cycle, reducing a problem on $n$ vertices to one on approximately $4|X|$ vertices.
  • Trade-offs: The research demonstrates how different minimum degree requirements allow for different running times. For example, with a minimum degree of $32c \cdot \log \sqrt{8n} + 4$, the algorithm runs in $poly(n) \cdot 2^{n/c}$ time.

Conclusion and Future Directions

While these algorithms offer significant speedups, they are most effective for graphs with high minimum degrees. Sparse Hamiltonian graphs, where degrees are low but a second cycle is guaranteed, remain a challenge. Future work may explore the complexity of this problem within the PPA (Polynomial Parity Argument) class or seek deterministic subexponential-time algorithms for graphs with polylogarithmic minimum degrees.

Summary updated

Abstract

In this paper we consider the following problem: Given a Hamiltonian graph G, and a Hamiltonian cycle C of G, can we compute a second Hamiltonian cycle \(C^{\prime } \ne C\) of G, and if yes, how quickly? If the input graph G satisfies certain conditions (e.g. if every vertex of G is odd, or if the minimum degree is large enough), it is known that such a second Hamiltonian cycle always exists. Despite substantial efforts, no subexponential-time algorithm is known for this problem. In this paper we relax the problem of computing a second Hamiltonian cycle in two ways. First, we consider approximating the length of a second longest cycle on n-vertex graphs with minimum degree \(\delta \) and maximum degree \(\Delta \). We provide a linear-time algorithm for computing a cycle \(C^{\prime } \ne C\) of length at least \(n-4\alpha (\sqrt{n}+2\alpha )+8\), where \(\alpha = \frac{\Delta -2}{\delta -2}\). This results provides a constructive proof of a recent result by Girão, Kittipassorn, and Narayanan in the regime of \(\frac{\Delta }{\delta } = o(\sqrt{n})\). Our second relaxation of the problem is probabilistic. We propose a randomized algorithm which computes a second Hamiltonian cycle with high probability, given that the input graph G has a large enough minimum degree. More specifically, we prove that for every \(0<p\le 0.02\), if the minimum degree of G is at least \(\frac{8}{p} \log \sqrt{8}n + 4\), then a second Hamiltonian cycle can be computed with probability at least \(1 - \frac{1}{n}\left( \frac{50}{p^4} + 1 \right) \) in \(poly(n) \cdot 2^{4pn}\) time. This result implies that, when the minimum degree \(\delta \) is sufficiently large, we can compute with high probability a second Hamiltonian cycle faster than any known deterministic algorithm. In particular, when \(\delta = \omega (\log n)\), our probabilistic algorithm works in \(2^{o(n)}\) time.
BibTeX
@article{deligkas2024approximate,
  author = {Argyrios Deligkas and George B. Mertzios and Paul G. Spirakis and Viktor Zamaraev},
  title = {{Approximate and Randomized Algorithms for Computing a Second Hamiltonian Cycle}},
  journal = {Algorithmica},
  year = {2024},
  doi = {10.1007/s00453-024-01238-z},
}
Figure