\addbibresource

citations.bib \newlang\HAMHAM \newlang\hHAM-HAM

Complexity of Multiple-Hamiltonicity in Graphs of Bounded Degree

Brian Liu, Nathan Sheffield, Alek Westover
Abstract

We study the following generalization of the Hamiltonian cycle problem: Given integers a,b𝑎𝑏a,bitalic_a , italic_b and graph G𝐺Gitalic_G, does there exist a closed walk in G𝐺Gitalic_G that visits every vertex at least a𝑎aitalic_a times and at most b𝑏bitalic_b times? Equivalently, does there exist a connected [2a,2b]2𝑎2𝑏[2a,2b][ 2 italic_a , 2 italic_b ] factor of 2bG2𝑏𝐺2b\cdot G2 italic_b ⋅ italic_G with all degrees even? This problem is \NP\NP\NP-hard for any constants 1ab1𝑎𝑏1\leq a\leq b1 ≤ italic_a ≤ italic_b. However, the graphs produced by known reductions have maximum degree growing linearly in b𝑏bitalic_b. The case a=b=1𝑎𝑏1a=b=1italic_a = italic_b = 1 — i.e. Hamiltonicity — remains \NP-hard even in 3333-regular graphs; a natural question is whether this is true for other a𝑎aitalic_a, b𝑏bitalic_b.

In this work, we study which a,b𝑎𝑏a,bitalic_a , italic_b permit polynomial time algorithms and which lead to \NP\NP\NP-hardness in graphs with constrained degrees. We give tight characterizations for regular graphs and graphs of bounded max-degree, both directed and undirected.

1 Introduction

1.1 Background and Previous Work

The Hamiltonian cycle problem asks, given a graph G𝐺Gitalic_G, whether G𝐺Gitalic_G admits a closed walk visiting every vertex exactly once. A classic result of Garey, Johnson and Tarjan is that Hamiltonicity is \NP-hard even in graphs of max degree 3, and in fact even in 3-regular graphs [GJ3].

In 1990, Broersma and Göbel proposed two variants of the Hamiltonian cycle problem: for fixed k𝑘kitalic_k, is there a closed walk that visits each vertex exactly k𝑘kitalic_k times, or at least once and at most k𝑘kitalic_k times, respectively? They showed that for constant k𝑘kitalic_k, both of these problems are \NP-hard [broersmakwalks]. Jackson and Wormald subsequently proved that both problems remain \NP-hard in j𝑗jitalic_j-connected graphs for any constant j𝑗jitalic_j [wormaldkwalks]. These proofs extend to give hardness of the following generalization:

Definition 1.

For fixed integers 1ab1𝑎𝑏1\leq a\leq b1 ≤ italic_a ≤ italic_b, a graph G𝐺Gitalic_G is called [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] if there exists a closed walk on G𝐺Gitalic_G that visits each vertex at least a𝑎aitalic_a times and at most b𝑏bitalic_b times.

Being [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] can be considered as a graph factor problem. Letting 2bG2𝑏𝐺2b\cdot G2 italic_b ⋅ italic_G be the multigraph obtained by making 2b2𝑏2b2 italic_b copies of each edge in G𝐺Gitalic_G, G𝐺Gitalic_G is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] if and only if 2bG2𝑏𝐺2b\cdot G2 italic_b ⋅ italic_G contains a spanning even [2𝒂,2𝒃]2𝒂2𝒃[2a,2b]bold_[ bold_2 bold_italic_a bold_, bold_2 bold_italic_b bold_] factor; that is, a connected subgraph containing all vertices of G𝐺Gitalic_G, with every degree even and in [2a,2b]2𝑎2𝑏[2a,2b][ 2 italic_a , 2 italic_b ]. The equivalence of this formulation follows from taking an Euler tour.

There is a substantial body of combinatorics work seeking sufficient conditions for the existence of graph factors and walks; see Plummer’s survey [plummersurvey], the book by Akiyama and Kano [akiyamakanobook], or the survey by Kouider and Vestergaard which focuses specifically on connected factors [kouidersurvey]. For example, Gao and Richter showed that any 3333-connected planar graph is [1,2]\hHAM12\hHAM[1,2]\hHAM[ 1 , 2 ] [2walk3connectedplanar], and Schmid and Schmidt gave a polynomial-time algorithm to find such a walk in which only the 3-separators are visited twice [2walk3connectedplanarpolytime]. Several variants of the problem have also been consider from an algorithmic complexity standpoint. Ganian et al consider the case where a𝑎aitalic_a is nonconstant in n𝑛nitalic_n, showing that [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] is \NP\NP\NP-hard for aO(n1ε)𝑎𝑂superscript𝑛1𝜀a\leq O(n^{1-\varepsilon})italic_a ≤ italic_O ( italic_n start_POSTSUPERSCRIPT 1 - italic_ε end_POSTSUPERSCRIPT ), but in \RP\RP\RP for aΩ(n/logn)𝑎Ω𝑛𝑛a\geq\Omega(n/\log n)italic_a ≥ roman_Ω ( italic_n / roman_log italic_n ) [bigaa]. Nishiyama et al show that there is a polynomial-time algorithm to determine whether a graph has a walk visiting every vertex an odd number of times, but that the problem becomes \NP\NP\NP-hard when each edge can be traversed at most 3333 times [pairityham].

In this work, we will study the complexity of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in regular graphs and graphs of constant maximum degree. Prior papers have investigated degree conditions sufficient to guarantee [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] — for instance Kouider and Vestergaard showed that, for a2𝑎2a\geq 2italic_a ≥ 2, any 2-connected graph with minimum degree an/(a+b)𝑎𝑛𝑎𝑏an/(a+b)italic_a italic_n / ( italic_a + italic_b ) is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] [evenabmindeb], and independent papers by Gao and Richter, ** and Li respectively showed that any 2222-connected graph with maximum degree 2b22𝑏22b-22 italic_b - 2 is [1,b]\hHAM1𝑏\hHAM[1,b]\hHAM[ 1 , italic_b ] [2connectedmaxdeg, 2connectedmaxdeg2]. However, to our knowledge we are the first to consider the algorithmic complexity of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in general bounded degree graphs.

1.2 Results

Our main results are tight characterizations for the hardness of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in regular graphs, graphs of bounded max-degree, and bounded max-degree digraphs. Interestingly, the thresholds for which a,b𝑎𝑏a,bitalic_a , italic_b lead to \NP\NP\NP-hardness are very different in each of these settings. In regular graphs, we find that hardness is determined by the maximum visit count b𝑏bitalic_b in comparison to the degree d𝑑ditalic_d, where the parity of d𝑑ditalic_d is very important:

1.

When restricted to d𝑑ditalic_d-regular graphs, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard if either d𝑑ditalic_d is even and b<d/2𝑏𝑑2b<d/2italic_b < italic_d / 2, or d𝑑ditalic_d is odd and b<d𝑏𝑑b<ditalic_b < italic_d. Otherwise, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶.

In graphs of bounded max degree, we find instead that hardness is determined by the ratio of b𝑏bitalic_b to a𝑎aitalic_a in comparison to the max degree d𝑑ditalic_d, and that a=1𝑎1a=1italic_a = 1 is a special case:

2.

When restricted to graphs of maximum degree d𝑑ditalic_d, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard if either a=1𝑎1a=1italic_a = 1 and b<d𝑏𝑑b<ditalic_b < italic_d, or a>1𝑎1a>1italic_a > 1 and ba<d1𝑏𝑎𝑑1\frac{b}{a}<d-1divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG < italic_d - 1. Otherwise, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶.

For directed graphs, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] turns out to always be hard in graphs of maximum degree 4444, and hard in graphs of maximum degree 3333 unless a=b𝑎𝑏a=bitalic_a = italic_b or b=1𝑏1b=1italic_b = 1:

3.

In directed graphs of maximum degree 3333, for 1ab1𝑎𝑏1\leq a\leq b1 ≤ italic_a ≤ italic_b, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶ if a=b>1𝑎𝑏1a=b>1italic_a = italic_b > 1, and \NP\NP\NP-hard otherwise.

4.

For all ba1𝑏𝑎1b\geq a\geq 1italic_b ≥ italic_a ≥ 1, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP\NP\NP-hard in directed graphs of maximum degree 4.

The hardness proofs for maximum degree digraphs easily extend to show hardness in regular digraphs.

1.3 Preliminaries

Introducing Depletors

Now we introduce the notion of a depletor gadget which will be used in all of our hardness reductions. We introduce this notion by showing that [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is hard in unrestricted graphs.

Lemma 1 (Broersma, Göbel [broersmakwalks]).

In unrestricted graphs, for any constants 1ab1𝑎𝑏1\leq a\leq b1 ≤ italic_a ≤ italic_b, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard.

Proof.

We reduce from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] (i.e. the standard Hamiltonian cycle problem). Given a graph G𝐺Gitalic_G, we build a new graph Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT by gluing to each vertex b1𝑏1b-1italic_b - 1 triangles, as shown in Figure 1. In any [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle each of these triangles must be visited — this accounts for b1𝑏1b-1italic_b - 1 of the visits for each of the vertices in G𝐺Gitalic_G, so the rest of the walk when restricted to G𝐺Gitalic_G must be a Hamiltonian cycle. For the other direction, note that it is possible to satisfy the visit requirements of the each triangle by step** up to it, walking back and forth a1𝑎1a-1italic_a - 1 times, and then step** back down, contributing only 1111 additional visit to the vertex we attached the triangles to. So, if G𝐺Gitalic_G is Hamiltonian then Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ]. ∎

Refer to caption
Figure 1: Reducing [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] to [3,3]\hHAM33\hHAM[3,3]\hHAM[ 3 , 3 ].

In general a depletor gadget is some small graph that we glue to the starting graph G𝐺Gitalic_G that forces vertices to be visited many times. In 1, triangles are serving as depletors, since they each contribute a visit to the vertex they’re glued to. In future sections, we will need depletors with stronger properties, such as forcing an attachment edge to be traversed many times.

Introducing Labellings

Given an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle, we can label each edge of the graph G𝐺Gitalic_G with the number of times it’s traversed in the cycle. These labels satisfy the following properties:

  • the sum of the labels on the edges adjacent to each vertex is an even number at least 2a2𝑎2a2 italic_a and at most 2b2𝑏2b2 italic_b, and

  • the subgraph on edges with non-zero labels is connected.

Now, given such a labeling, we could create a multigraph by including each edge with multiplicity given by its label. Since all vertices in this multigraph have even degree, we can (efficiently) find an Eulerian cycle in the multigraph, which is then an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle in the original graph. So, finding a labeling with these properties is equivalent to finding an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle; this perspective will make the problem easier to reason about.

A Technical Note

Finally, we remark that, throughout this paper, degree bounds will be assumed to be greater than or equal to 3333. All problems we consider are trivial in graphs of maximum degree 2222, and so we will refrain from mentioning this special case. We will use “maximum degree” to refer to any upper bound on the degrees of a graph. In particular, a graph with no degree larger than d𝑑ditalic_d is a max-degree d𝑑ditalic_d graph even if it does not have a vertex achieving that degree. In directed graphs, degree refers to the sum of in-degree and out-degree.

Another piece of notation that is important to note is that we will write xmodymodulo𝑥𝑦x\mod yitalic_x roman_mod italic_y to denote the remainder when x𝑥xitalic_x is divided by y𝑦yitalic_y (as opposed to the equivalence class x+y𝑥𝑦x+y\mathbb{Z}italic_x + italic_y blackboard_Z).

2 Complexity characterization in d𝑑ditalic_d-regular graphs

2.1 Easiness

We claim that [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] can be solved in polynomial time for d𝑑ditalic_d-regular graphs, as long as either d𝑑ditalic_d is even and bd/2𝑏𝑑2b\geq d/2italic_b ≥ italic_d / 2, or d𝑑ditalic_d is odd and bd𝑏𝑑b\geq ditalic_b ≥ italic_d. The reason for this is simple: the following two lemmas demonstrate that any connected d𝑑ditalic_d-regular graph is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] for such b𝑏bitalic_b.

Lemma 2.

For even d𝑑ditalic_d, any d𝑑ditalic_d-regular graph is [d/2,d/2]\hHAM𝑑2𝑑2\hHAM[d/2,d/2]\hHAM[ italic_d / 2 , italic_d / 2 ]. For odd d𝑑ditalic_d, any d𝑑ditalic_d-regular graph is [d,d]\hHAM𝑑𝑑\hHAM[d,d]\hHAM[ italic_d , italic_d ].

Proof.

If d𝑑ditalic_d is even, then the graph is Eulerian — taking an Euler tour will visit every vertex exactly d/2𝑑2d/2italic_d / 2 times. If d𝑑ditalic_d is odd, we can duplicate all its edges to get a 2d2𝑑2d2 italic_d-regular multigraph — an Euler tour in that multigraph visits every vertex exactly d𝑑ditalic_d times. ∎

Now we use Tutte’s two-factor theorem to extend 2 to more [a,b]𝑎𝑏[a,b][ italic_a , italic_b ]. Specifically, the form of Tutte’s two-factor theorem that we use is:

Fact 1.

If H𝐻Hitalic_H is a 2k2𝑘2k2 italic_k-regular multigraph, its edges can be partitioned into k𝑘kitalic_k distinct 2222-factors (i.e. 2222-regular sub-multigraphs).

Using 1 we obtain:

Lemma 3 (Broersma, Göbel [broersmakwalks]).

If a graph G𝐺Gitalic_G is [b,b]\hHAM𝑏𝑏\hHAM[b,b]\hHAM[ italic_b , italic_b ] for some b𝑏bitalic_b, then it’s also [b,b]\hHAMsuperscript𝑏superscript𝑏\hHAM[b^{\prime},b^{\prime}]\hHAM[ italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ] for all b>bsuperscript𝑏𝑏b^{\prime}>bitalic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT > italic_b.

Proof.

Let H𝐻Hitalic_H be the multigraph corresponding to a [b,b]\hHAM𝑏𝑏\hHAM[b,b]\hHAM[ italic_b , italic_b ] walk on G𝐺Gitalic_G. This is a 2b2𝑏2b2 italic_b-regular multigraph, so we can find a multigraph two-factor by Tutte’s two-factor theorem. Duplicating all edges in that two-factor, we have a multigraph corresponding to a [b+1,b+1]\hHAM𝑏1𝑏1\hHAM[b+1,b+1]\hHAM[ italic_b + 1 , italic_b + 1 ] walk on G𝐺Gitalic_G. Repeating this process gives the desired claim. ∎

Since a [b,b]\hHAM𝑏𝑏\hHAM[b,b]\hHAM[ italic_b , italic_b ] cycle is also an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle for a<b𝑎𝑏a<bitalic_a < italic_b, we’ve shown the easiness part of the claim.

2.2 Hardness

2.2.1 Depletors

The first step in the hardness argument is to construct depletors. We would like a small structure that can always be part of an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle as long as it’s visited at least once.

We will describe such a d𝑑ditalic_d-regular depletor for even d𝑑ditalic_d with two attachment edges and 2d2𝑑2d2 italic_d vertices. Add an edge between visubscript𝑣𝑖v_{i}italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and vjsubscript𝑣𝑗v_{j}italic_v start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT whenever (ij)mod2d{d/2,,d/2}modulo𝑖𝑗2𝑑𝑑2𝑑2(i-j)\mod 2d\in\{-d/2,\dots,d/2\}( italic_i - italic_j ) roman_mod 2 italic_d ∈ { - italic_d / 2 , … , italic_d / 2 }. Now, cut the edges (v2d,v3d/2)subscript𝑣2𝑑subscript𝑣3𝑑2(v_{2d},v_{3d/2})( italic_v start_POSTSUBSCRIPT 2 italic_d end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 3 italic_d / 2 end_POSTSUBSCRIPT ) and (v1,vd/2+1)subscript𝑣1subscript𝑣𝑑21(v_{1},v_{d/2+1})( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_d / 2 + 1 end_POSTSUBSCRIPT ), and add the edge (v3d/2,vd/2+1)subscript𝑣3𝑑2subscript𝑣𝑑21(v_{3d/2},v_{d/2+1})( italic_v start_POSTSUBSCRIPT 3 italic_d / 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_d / 2 + 1 end_POSTSUBSCRIPT ) — note that this is in fact a new edge since

(3d/2d/21)mod2d{d/2,,d/2}.modulo3𝑑2𝑑212𝑑𝑑2𝑑2(3d/2-d/2-1)\bmod 2d\not\in\{-d/2,\dots,d/2\}.( 3 italic_d / 2 - italic_d / 2 - 1 ) roman_mod 2 italic_d ∉ { - italic_d / 2 , … , italic_d / 2 } .

So, if we add an edge leaving the gadget from each of v2dsubscript𝑣2𝑑v_{2d}italic_v start_POSTSUBSCRIPT 2 italic_d end_POSTSUBSCRIPT and v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, the construction will be d𝑑ditalic_d-regular.

Refer to caption
Figure 2: Labellings corresponding to [b,b]𝑏𝑏[b,b][ italic_b , italic_b ] walks on 4-regular and 5-regular depletors, respectively.
Lemma 4.

For any ba1𝑏𝑎1b\geq a\geq 1italic_b ≥ italic_a ≥ 1, there is a valid [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] traversal of this even-regularity depletor in which each attachment edge is traversed exactly once.

Proof.

Assign each edge (vi,vi+1)subscript𝑣𝑖subscript𝑣𝑖1(v_{i},v_{i+1})( italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT ) of the gadget to be traversed b𝑏bitalic_b times, and assign the edge (v2d,v1)subscript𝑣2𝑑subscript𝑣1(v_{2d},v_{1})( italic_v start_POSTSUBSCRIPT 2 italic_d end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) to be traversed b1𝑏1b-1italic_b - 1 times; see Figure 2. ∎

Note that this gadget required two attachment edges. This is a necessary consequence of the regularity constraint: since d𝑑ditalic_d is even, there must be an even number of half-edges within the gadget, meaning that the number of edges leaving the gadget must be even.

When d𝑑ditalic_d is odd, we can construct a d𝑑ditalic_d-regular depletor needing only one leaving edge. Start with the complete graph Kd+1subscript𝐾𝑑1K_{d+1}italic_K start_POSTSUBSCRIPT italic_d + 1 end_POSTSUBSCRIPT, and then delete all edges (vi,vi+(d+1)/2)subscript𝑣𝑖subscript𝑣𝑖𝑑12(v_{i},v_{i+(d+1)/2})( italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i + ( italic_d + 1 ) / 2 end_POSTSUBSCRIPT ) except for the edge (v1,v(d+1)/2+1)subscript𝑣1subscript𝑣𝑑121(v_{1},v_{(d+1)/2+1})( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT ( italic_d + 1 ) / 2 + 1 end_POSTSUBSCRIPT ). At this point, every vertex has degree (d1)𝑑1(d-1)( italic_d - 1 ), except for v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and v(d+1)/2+1subscript𝑣𝑑121v_{(d+1)/2+1}italic_v start_POSTSUBSCRIPT ( italic_d + 1 ) / 2 + 1 end_POSTSUBSCRIPT, which have degree d𝑑ditalic_d. So, we add a (d+2)𝑑2(d+2)( italic_d + 2 )-th vertex vsuperscript𝑣v^{*}italic_v start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT, with edges to every other vertex except v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and v(d+1)/2+1subscript𝑣𝑑121v_{(d+1)/2+1}italic_v start_POSTSUBSCRIPT ( italic_d + 1 ) / 2 + 1 end_POSTSUBSCRIPT, and a single edge leaving the construction — note that the result is now d𝑑ditalic_d-regular.

Lemma 5.

For any b2𝑏2b\geq 2italic_b ≥ 2, there is a valid [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] traversal of this odd-regularity depletor in which the attachment edge is traversed exactly twice.

Proof.

Assign all the edges in the loop passing through all vertices to be traversed b1𝑏1b-1italic_b - 1 times, and then add one more traversal to the edges (vi,v(i+1)modd+2)subscript𝑣𝑖subscript𝑣modulo𝑖1𝑑2(v_{i},v_{(i+1)\bmod d+2})( italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT ( italic_i + 1 ) roman_mod italic_d + 2 end_POSTSUBSCRIPT ); see Figure 2. ∎

2.2.2 Reductions

These depletor gadgets let us use the construction from 1 to resolve the case of even d𝑑ditalic_d.

Lemma 6.

For even d𝑑ditalic_d, if ab<d/2𝑎𝑏𝑑2a\leq b<d/2italic_a ≤ italic_b < italic_d / 2, then [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP\NP\NP-hard in d𝑑ditalic_d-regular graphs.

Proof.

We reduce from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in (d2b+2)𝑑2𝑏2(d-2b+2)( italic_d - 2 italic_b + 2 )-regular graphs, which is known to be \NP\NP\NP-hard as long as (d2b+2)>2𝑑2𝑏22(d-2b+2)>2( italic_d - 2 italic_b + 2 ) > 2 — i.e. as long as b<d/2𝑏𝑑2b<d/2italic_b < italic_d / 2. Given a (d2b+2)𝑑2𝑏2(d-2b+2)( italic_d - 2 italic_b + 2 )-regular graph G𝐺Gitalic_G, we construct Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT by attaching (b1)𝑏1(b-1)( italic_b - 1 ) copies of the d𝑑ditalic_d-regular depletor of 4 to each vertex. Recall that this depletor required two attachment edges, so Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is d𝑑ditalic_d-regular. But now, note that in the process of visiting each depletor gadget once, each vertex from G𝐺Gitalic_G must be visited at least b1𝑏1b-1italic_b - 1 times, leaving room for only 1111 additional visit. So, if G𝐺Gitalic_G was not Hamiltonian, Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is not [a,b]𝑎𝑏[a,b][ italic_a , italic_b ]-Hamiltonian for any a𝑎aitalic_a. Conversely, if G𝐺Gitalic_G was Hamiltonian, then by 4 we can extend the Hamiltonian cycle to a [b,b]\hHAM𝑏𝑏\hHAM[b,b]\hHAM[ italic_b , italic_b ] cycle by visiting each depletor exactly once. ∎

This argument is not immediately sufficient for the case of odd regularity, however. Applying the same construction would yield the following:

Lemma 7.

For odd d𝑑ditalic_d, if ab<d1𝑎𝑏𝑑1a\leq b<d-1italic_a ≤ italic_b < italic_d - 1, then [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard in d𝑑ditalic_d-regular graphs.

To be tight with our easiness results, however, we would like to show hardness of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] when b<d𝑏𝑑b<ditalic_b < italic_d. The gap here is coming from our base case: the hard problem we have to reduce from in 3333-regular graphs is [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ], whereas we need to show that even [1,2]\hHAM12\hHAM[1,2]\hHAM[ 1 , 2 ] and [2,2]\hHAM22\hHAM[2,2]\hHAM[ 2 , 2 ] are hard. Fortunately, a slightly more involved reduction closes this gap.

Lemma 8.

For odd d𝑑ditalic_d, if ad1𝑎𝑑1a\leq d-1italic_a ≤ italic_d - 1, then [a,d1]\hHAM𝑎𝑑1\hHAM[a,d-1]\hHAM[ italic_a , italic_d - 1 ] is \NP-hard in d𝑑ditalic_d-regular graphs.

Proof.

We reduce from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in 3333-regular graphs. Let G𝐺Gitalic_G be a 3333-regular graph; we construct Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT as follows:

  • Glue d3𝑑3d-3italic_d - 3 depletors to each vertex in G𝐺Gitalic_G.

  • Trisect each of G𝐺Gitalic_G’s original edges — that is, replace them with paths containing 2222 intermediate nodes.

  • Glue d2𝑑2d-2italic_d - 2 depletors to each of the intermediate nodes just added.

Using the d𝑑ditalic_d-regular depletors of 5, this construction is d𝑑ditalic_d-regular. We would like to show that Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [d1,d1]𝑑1𝑑1[d-1,d-1][ italic_d - 1 , italic_d - 1 ] Hamiltonian if G𝐺Gitalic_G is Hamiltonian, and otherwise not even [1,d1]1𝑑1[1,d-1][ 1 , italic_d - 1 ] Hamiltonian — this suffices to prove the lemma.

Refer to caption
Figure 3: Reduction from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in 3333-regular graphs to [4,4]\hHAM44\hHAM[4,4]\hHAM[ 4 , 4 ] in 5555-regular graphs. Red outgoing edges represent depletors.

First, note that if you ignore the depletors, each intermediate node must be visited exactly once, since the depletors contribute d2𝑑2d-2italic_d - 2 of the d1𝑑1d-1italic_d - 1 allowed visits. Thus, each edge gadget must be labeled either 1,1,11111,1,11 , 1 , 1 or 2,0,22022,0,22 , 0 , 2; see Figure 4.

Refer to caption
Figure 4: The two possible labelings of the edge gadget.

The depletors contribute d3𝑑3d-3italic_d - 3 visits to each of the original vertices, so each has an additional label budget of only 4444; this means that for every original vertex, exactly two of the three incident edge gadgets must be labeled 1,1,11111,1,11 , 1 , 1. So, the edges of G𝐺Gitalic_G corresponding to 1,1,11111,1,11 , 1 , 1 edge gadgets in Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT form a 2-factor; see Figure 5. But now, suppose this 2222-factor had multiple connected components. Since 2,0,22022,0,22 , 0 , 2 edges do not create connectivity, this would mean that the labeling of Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT was not connected, and so couldn’t correspond to a [1,d1]\hHAM1𝑑1\hHAM[1,d-1]\hHAM[ 1 , italic_d - 1 ] walk. Thus, Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT can be [1,d1]\hHAM1𝑑1\hHAM[1,d-1]\hHAM[ 1 , italic_d - 1 ] only if G𝐺Gitalic_G had a connected 2-factor, i.e. a Hamiltonian cycle.

Refer to caption
Figure 5: The edge gadgets labeled 1,1,11111,1,11 , 1 , 1 must correspond to a Hamiltonian path.

The reverse direction follows by the same logic: given a Hamiltonian cycle in G𝐺Gitalic_G, we label all edge gadgets corresponding to the cycle 1,1,11111,1,11 , 1 , 1 and all edge gadgets not in the cycle 2,0,22022,0,22 , 0 , 2; visiting each depletor once gives a [d1,d1]\hHAM𝑑1𝑑1\hHAM[d-1,d-1]\hHAM[ italic_d - 1 , italic_d - 1 ] labeling.

Combining the above lemmas gives a complete characterization of the hardness of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in regular graphs.

Theorem 1.

When restricted to d𝑑ditalic_d-regular graphs, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard if either d𝑑ditalic_d is even and b<d/2𝑏𝑑2b<d/2italic_b < italic_d / 2, or d𝑑ditalic_d is odd and b<d𝑏𝑑b<ditalic_b < italic_d. Otherwise, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶.

3 Complexity characterization in graphs of max-degree d𝑑ditalic_d

We now have a tight understanding of when [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is hard in regular graphs. If, instead, we just cared about graphs with constant maximum degree, the hardness results would translate, but easiness would not. We show in this section that in fact the true threshold for hardness in this setting looks very different: complexity is determined not by b𝑏bitalic_b but by the ratio ba𝑏𝑎\frac{b}{a}divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG.

For our easiness result, we will note that testing [a,b]𝑎𝑏[a,b][ italic_a , italic_b ]-Hamiltonicity is easy in trees, and then show that when bad1𝑏𝑎𝑑1\frac{b}{a}\leq d-1divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG ≤ italic_d - 1, for a>1𝑎1a>1italic_a > 1, any failure of [a,b]𝑎𝑏[a,b][ italic_a , italic_b ]-Hamiltonicity is witnessed by a tree-like subgraph. To show hardness, we will exploit a few low-degree vertices to construct and fine-tune highly efficient depletor gadgets.

3.1 Easiness

First, we observe that without loss of generality an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] walk never traverses a given edge more than 2a2𝑎2a2 italic_a times:

Lemma 9.

Let G𝐺Gitalic_G be a graph. If G𝐺Gitalic_G has an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] labeling, it has such a labeling with maximum label at most 2a2𝑎2a2 italic_a.

Proof.

Take such an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] walk, and consider an edge with label more than 2a2𝑎2a2 italic_a. Each of the vertices incident to that edge is therefore visited at least a+1𝑎1a+1italic_a + 1 times by the walk — so, if we subtract 2222 from the label of that edge, each of them will still be visited at least a𝑎aitalic_a times, and the labeling will still be valid. ∎

Now, we give an algorithm for [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in trees, which will be an important component of our algorithm for [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in general graphs.

Lemma 10.

Let ba1𝑏𝑎1b\geq a\geq 1italic_b ≥ italic_a ≥ 1, and let G𝐺Gitalic_G be a tree. There is a linear-time algorithm to determine whether G𝐺Gitalic_G is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ].

Proof.

Arbitrarily root the tree. We will work from the bottom-up, recording for each edge the set of label values that can extend to a valid labeling in the subtree below it. In fact, we will show that for each edge e𝑒eitalic_e the set of labels for e𝑒eitalic_e that can extend to a valid labelling in the subtree below e𝑒eitalic_e is of the form {e,e+2,,ue}subscript𝑒subscript𝑒2subscript𝑢𝑒\left\{\ell_{e},\ell_{e}+2,\ldots,u_{e}\right\}{ roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT + 2 , … , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT } for even integers e,uesubscript𝑒subscript𝑢𝑒\ell_{e},u_{e}roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT. Thus, it will suffice to record for each edge e𝑒eitalic_e the minimum and maximum labels e,uesubscript𝑒subscript𝑢𝑒\ell_{e},u_{e}roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT which can extend to valid labellings in the subtree below e𝑒eitalic_e.

Start by setting e=2a,ue=2bformulae-sequencesubscript𝑒2𝑎subscript𝑢𝑒2𝑏\ell_{e}=2a,u_{e}=2broman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT = 2 italic_a , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT = 2 italic_b for each edge e𝑒eitalic_e incident to a leaf of the tree: these edges must be traversed at least 2a2𝑎2a2 italic_a times in order to visit the leaves a𝑎aitalic_a times. Now we repeatedly apply the following process to find ue,esubscript𝑢𝑒subscript𝑒u_{e},\ell_{e}italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT for all edges in the tree:

Find a vertex v𝑣vitalic_v such that all edges in the subtree rooted at v𝑣vitalic_v have been labelled. Let Lv,Uvsubscript𝐿𝑣subscript𝑈𝑣L_{v},U_{v}italic_L start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT , italic_U start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT be the sum of e,uesubscriptsuperscript𝑒subscript𝑢superscript𝑒\ell_{e^{\prime}},u_{e^{\prime}}roman_ℓ start_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT respectively over edges esuperscript𝑒e^{\prime}italic_e start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT going down from v𝑣vitalic_v. Let e𝑒eitalic_e be the edge going up the tree from v𝑣vitalic_v. We claim that the valid labels for e𝑒eitalic_e are precisely the even numbers in the interval [e,ue]subscript𝑒subscript𝑢𝑒[\ell_{e},u_{e}][ roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT ] defined by

e=max(2,2aUv),ue=2bLv.formulae-sequencesubscript𝑒22𝑎subscript𝑈𝑣subscript𝑢𝑒2𝑏subscript𝐿𝑣\ell_{e}=\max(2,2a-U_{v}),\quad u_{e}=2b-L_{v}.roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT = roman_max ( 2 , 2 italic_a - italic_U start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT ) , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT = 2 italic_b - italic_L start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT .

First we argue that labelling for e𝑒eitalic_e must lie in this set; then we will argue that any labels in this set can be extending to labellings on the subtree. The label on e𝑒eitalic_e must be even because all of the edges going down from v𝑣vitalic_v have even labels (by induction). The label on e𝑒eitalic_e cannot be zero, or else the labelling is not connected. The label on e𝑒eitalic_e must be at least 2aUv2𝑎subscript𝑈𝑣2a-U_{v}2 italic_a - italic_U start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT or else vertex v𝑣vitalic_v is not visited enough times. The label on e𝑒eitalic_e cannot be larger than 2bLv2𝑏subscript𝐿𝑣2b-L_{v}2 italic_b - italic_L start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT or else vertex v𝑣vitalic_v is visited too many times. It is clear that for any even k[e,ue]𝑘subscript𝑒subscript𝑢𝑒k\in[\ell_{e},u_{e}]italic_k ∈ [ roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT ], if we give e𝑒eitalic_e label k𝑘kitalic_k, then there is a compatible labelling of the subtree rooted at v𝑣vitalic_v.

If at any step in the process an edge e𝑒eitalic_e is given e>uesubscript𝑒subscript𝑢𝑒\ell_{e}>u_{e}roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT > italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT, then we deduce that there is no valid labelling of the tree. Otherwise, the process will terminate with every edge having e,uesubscript𝑒subscript𝑢𝑒\ell_{e},u_{e}roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT with euesubscript𝑒subscript𝑢𝑒\ell_{e}\leq u_{e}roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT ≤ italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT. To finish our check of whether the tree is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] we simply iterate over all possible ways of assigning labels to the edges incident to the root, taken from their corresponding allowed sets [e,ue]2subscript𝑒subscript𝑢𝑒2[\ell_{e},u_{e}]\cap 2\mathbb{Z}[ roman_ℓ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT ] ∩ 2 blackboard_Z. If there is any combination of labels of the edges incident to the root that satisfies the root, then by construction of the allowed label sets, we can extend the labellings given to each e𝑒eitalic_e incident to the root to the entire subtree below e𝑒eitalic_e. Thus, we can label the entire tree. ∎

We now use this procedure for trees as part of an algorithm for [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in general graphs in the case a>1𝑎1a>1italic_a > 1. Afterwards we will analyze the case a=1𝑎1a=1italic_a = 1, which is simple but (somewhat surprisingly) meaningfully different from the case a>1𝑎1a>1italic_a > 1.

Lemma 11.

For any d𝑑ditalic_d and any ba>1𝑏𝑎1b\geq a>1italic_b ≥ italic_a > 1 such that ba(d1)𝑏𝑎𝑑1\frac{b}{a}\geq(d-1)divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG ≥ ( italic_d - 1 ), there exists a polynomial-time algorithm to test whether a graph G𝐺Gitalic_G of max degree d𝑑ditalic_d is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ].

Proof.

The first step of the algorithm is to search for tree derivations. Call an edge eE(G)𝑒𝐸𝐺e\in E(G)italic_e ∈ italic_E ( italic_G ) dangerous if it does not belong to any cycle in G𝐺Gitalic_G (the set of dangerous edges can be compute easily using connectivity tests on modified versions of the graph). The tree derivation stage will assign labels to all dangerous edges.

The means of performing a derivation is exactly as described in 10. The set of dangerous edges forms a forest, so for each tree in the forest we run the algorithm from 10 to find an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] labeling that satisfies all vertices except possibly the root. If any of these tree derivations fail, G𝐺Gitalic_G cannot be [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] — the failure of a tree derivation gives a set of vertices that cannot be mutually satisfied under any labeling, since there can’t be any more edges into this set.

Refer to caption
Figure 6: The algorithm performs all tree derivations, then labels disjoint cycles, then merges paths into those cycles, and finally labels all remaining edges with 2222.

If none of these tree derivations fail, we have a labeling of all dangerous edges that satisfies all vertices not involved in any cycle. Call a vertex good if it’s involved in at least one cycle. The next step of our argument is to show that, no matter what labeling we choose for the dangerous edges, there is always an assignment to the remaining edges that visits each good vertex between a𝑎aitalic_a and (d1)ab𝑑1𝑎𝑏(d-1)a\leq b( italic_d - 1 ) italic_a ≤ italic_b times, showing that G𝐺Gitalic_G is necessarily [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] unless a tree derivation fails.

Existence of a labelling, given that tree derivations succeed

We now give a procedure which finds a labelling of the remainder of the graph once all tree derivations have succeeded; we stress that we don’t actually run this procedure in our algorithm, it is an analysis tool to demonstrate the existence of a labelling. The procedure is as follows:

  • Find an arbitrary cycle in the graph, and label all of its edges with a𝑎aitalic_a. Mark the vertices involved in that cycle happy.

  • While there remains a cycle involving only unhappy vertices, repeat the above step with that cycle.

  • Now, suppose there still exists an unhappy good vertex. Since good vertices are involved in cycles, there must exist a path that starts and ends in happy vertices but otherwise contains only unhappy good vertices. (Here, we’re allowing that “path” to potentially start and end at the same happy vertex — this is a slight abuse of terminology.) Find such a path. If a𝑎aitalic_a is even, label all edges in the path with a𝑎aitalic_a. Otherwise, give the edges in the path alternating labels of a+1𝑎1a+1italic_a + 1 and a1𝑎1a-1italic_a - 1. Mark all vertices along the path happy.

  • Repeat the above step until all good vertices are happy. Then, label all unlabeled edges of the graph with 2222.

Now we analyze the procedure. First, note that all edges are assigned nonzero weight, so this construction is connected111This is the place where the argument fails for a=1𝑎1a=1italic_a = 1. In that case, the edges assigned a1𝑎1a-1italic_a - 1 would be given zero weight, and so we wouldn’t ensure connectivity.. Labeling a full cycle with a𝑎aitalic_a’s increases every vertex label sum by either 00 or 2a2𝑎2a2 italic_a, and all other labels used in this construction are even values, so this labeling gives even sums into every vertex. So, the only point to argue is that every vertex is given sum between 2a2𝑎2a2 italic_a and 2b2𝑏2b2 italic_b. This holds for the non-good vertices by virtue of the tree derivations succeeding. Now, note that for each good vertex, at some point we label two of its incident edges either a𝑎aitalic_a and a𝑎aitalic_a or a+1𝑎1a+1italic_a + 1 and a1𝑎1a-1italic_a - 1. In either case, this ensures that they have total weight at least 2a2𝑎2a2 italic_a. By 9, we can decrease all labels assigned while performing tree derivations to be at most 2a2𝑎2a2 italic_a. Thus, the sum of the labels incident to any good vertex is at most

2a+(d2)2a=(d1)2a2b.2𝑎𝑑22𝑎𝑑12𝑎2𝑏2a+(d-2)2a=(d-1)2a\leq 2b.2 italic_a + ( italic_d - 2 ) 2 italic_a = ( italic_d - 1 ) 2 italic_a ≤ 2 italic_b .

The final point to note in this section is the following, covering the a=1𝑎1a=1italic_a = 1 case:

Lemma 12.

Every connected graph of maximum degree d𝑑ditalic_d is [1,d]\hHAM1𝑑\hHAM[1,d]\hHAM[ 1 , italic_d ]

Proof.

Label all edges 2222. This visits each vertex at least once, and at most d𝑑ditalic_d times. ∎

Together, 11 and 12 give our easiness results. Note that we have easiness for [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] whenever bad1𝑏𝑎𝑑1\frac{b}{a}\geq d-1divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG ≥ italic_d - 1, unless a=1𝑎1a=1italic_a = 1, in which case we need bad𝑏𝑎𝑑\frac{b}{a}\geq ddivide start_ARG italic_b end_ARG start_ARG italic_a end_ARG ≥ italic_d. The first thing we will observe in the next section is that [1,d1]\hHAM1𝑑1\hHAM[1,d-1]\hHAM[ 1 , italic_d - 1 ] is in fact \NP\NP\NP-hard, so this distinction is necessary.

3.2 Hardness

Lemma 13.

[1,d1]\hHAM1𝑑1\hHAM[1,d-1]\hHAM[ 1 , italic_d - 1 ] is \NP\NP\NP-hard in graphs of maximum degree d𝑑ditalic_d.

Proof.

When d𝑑ditalic_d is odd, this follows by our hardness results in 8 — a d𝑑ditalic_d-regular graph is in particular a graph of maximum degree d𝑑ditalic_d. When d𝑑ditalic_d is even, we can use the exact same construction as in the proof of that lemma, but just use 3-regular depletors instead of d𝑑ditalic_d-regular depletors, since we’re no longer concerned with regularity. ∎

When a>1𝑎1a>1italic_a > 1, though, we will show hardness for much larger values of b𝑏bitalic_b than are hard in d𝑑ditalic_d-regular graphs. Proving this claim will require a new depletor construction, which we call a chain depletor, since it’s composed of a long chain of subunits:

Lemma 14.

Let a,b𝑎𝑏a,bitalic_a , italic_b be integers with 1ab<a(d1)1𝑎𝑏𝑎𝑑11\leq a\leq b<a(d-1)1 ≤ italic_a ≤ italic_b < italic_a ( italic_d - 1 ). For any integer 2k[2,2a]2𝑘22𝑎2k\in[2,2a]2 italic_k ∈ [ 2 , 2 italic_a ], there exists a gadget of maximum degree d𝑑ditalic_d and with a single attachment edge, which can be part of an [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] cycle if the attachment edge is labeled 2k2𝑘2k2 italic_k, but cannot be satisfied if the attachment edge is labeled <2kabsent2𝑘<2k< 2 italic_k.

Proof.

Consider the gadget shown in Figure 7 — a 3333-edge path on two intermediate vertices, with depletors of total depletion D𝐷Ditalic_D attached to the second intermediate vertex.

Refer to caption
Figure 7: A “chainlink” gadget, forcing yx+(2b2aD)𝑦𝑥2𝑏2𝑎𝐷y\leq x+(2b-2a-D)italic_y ≤ italic_x + ( 2 italic_b - 2 italic_a - italic_D )

Gadgets of this form will serve as the links in the chain. Let x𝑥xitalic_x be the label leaving the first intermediate vertex, y𝑦yitalic_y be the label leaving the second intermediate vertex, and m𝑚mitalic_m be the label on the edge between the two vertices. In order to satisfy the visit counts of the first vertex, we must have x+m2a𝑥𝑚2𝑎x+m\geq 2aitalic_x + italic_m ≥ 2 italic_a, and in order to satisfy the visit counts of the second vertex we must have y+m+D2b𝑦𝑚𝐷2𝑏y+m+D\leq 2bitalic_y + italic_m + italic_D ≤ 2 italic_b. Adding these constraints together, we find that if y>x+(2b2aD)𝑦𝑥2𝑏2𝑎𝐷y>x+(2b-2a-D)italic_y > italic_x + ( 2 italic_b - 2 italic_a - italic_D ), there is no setting of m𝑚mitalic_m that satisfies both of them. On the other hand, if x[2,2a2]𝑥22𝑎2x\in[2,2a-2]italic_x ∈ [ 2 , 2 italic_a - 2 ], then setting m=2ax𝑚2𝑎𝑥m=2a-xitalic_m = 2 italic_a - italic_x and y=x+(2b2aD)𝑦𝑥2𝑏2𝑎𝐷y=x+(2b-2a-D)italic_y = italic_x + ( 2 italic_b - 2 italic_a - italic_D ) not only satisfies all visit count constraints, but also preserves connectivity so long as y2𝑦2y\geq 2italic_y ≥ 2. So, this gadget forces its “outgoing” edge to have label at least (2b2aD)2𝑏2𝑎𝐷(2b-2a-D)( 2 italic_b - 2 italic_a - italic_D ) more than its “incoming” edge, and is satisfied by an outgoing label exactly that large as long as its incoming edge had label between 2222 and 2a22𝑎22a-22 italic_a - 2.

Of course, in constructing this link gadget, we assumed we were able to deplete a vertex by D𝐷Ditalic_D. So if we want to use these gadgets for anything, we first need some sort of depletors to start with. Fortunately we do have some depletors: using for instance the 3333-regular depletor of 5 (or an edge with a triangle on the end) gives 2222 depletion, and gluing a single vertex along an edge gives 2a2𝑎2a2 italic_a depletion. The overall goal of the chain depletor construction is to get a single gadget with depletion in between 2222 and 2a2𝑎2a2 italic_a, since for our reductions we will need to fine-tune the depletion exactly.

For our construction, we chain together multiple copies of the link gadget, identifying the outgoing edge of one with the incoming edge of the next, and finally ending in a single vertex, as shown in Figure 8:

Refer to caption
Figure 8: A chain of link gadgets forcing  x+i=1(2b2aDi)y2a𝑥superscriptsubscript𝑖12𝑏2𝑎subscript𝐷𝑖𝑦2𝑎x+\sum_{i=1}^{\ell}(2b-2a-D_{i})\geq y\geq 2aitalic_x + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_ℓ end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ≥ italic_y ≥ 2 italic_a.

Suppose the link gadgets are constructed with depletions D1,,Dsubscript𝐷1subscript𝐷D_{1},\dots,D_{\ell}italic_D start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_D start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT, and let x𝑥xitalic_x and y𝑦yitalic_y be the labels assigned to the attachment edge and final edge of the chain, respectively. By our analysis of the link gadget, this construction is unsatisfiable if the final edge has label y>x+i=1(2b2aDi)𝑦𝑥superscriptsubscript𝑖12𝑏2𝑎subscript𝐷𝑖y>x+\sum_{i=1}^{\ell}(2b-2a-D_{i})italic_y > italic_x + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_ℓ end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ). We would therefore like to choose the depletions Disubscript𝐷𝑖D_{i}italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT such that i=1(2b2aDi)=2a2ksuperscriptsubscript𝑖12𝑏2𝑎subscript𝐷𝑖2𝑎2𝑘\sum_{i=1}^{\ell}(2b-2a-D_{i})=2a-2k∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_ℓ end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) = 2 italic_a - 2 italic_k, since then if the incoming edge has too small a label x<2k𝑥2𝑘x<2kitalic_x < 2 italic_k, this will make setting y2a𝑦2𝑎y\geq 2aitalic_y ≥ 2 italic_a impossible, and so ensure that the vertex at the end of the chain can’t be satisfied. We also want to make sure that the chain is satisfiable if the incoming edge is labeled x=2k𝑥2𝑘x=2kitalic_x = 2 italic_k; to guarantee that, it suffices by our analysis of the link gadgets to ensure that 2k+i=1j(2b2aDi)[2,2a2]2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖22𝑎22k+\sum_{i=1}^{j}(2b-2a-D_{i})\in[2,2a-2]2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ∈ [ 2 , 2 italic_a - 2 ] for all j<𝑗j<\ellitalic_j < roman_ℓ, since then the construction is satisfied by greedily labeling each edge, from attachment edge to the final edge, with the smallest allowable value.

We will now show that, except in the case where b𝑏bitalic_b is a multiple of a𝑎aitalic_a, which we will handle slightly differently, it is always possible to construct such a sequence of Disubscript𝐷𝑖D_{i}italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. Let M=ba1𝑀𝑏𝑎1M=\left\lfloor\frac{b}{a}-1\right\rflooritalic_M = ⌊ divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG - 1 ⌋ and L=2bmod2a𝐿modulo2𝑏2𝑎L=2b\mod 2aitalic_L = 2 italic_b roman_mod 2 italic_a, so that 2b=2a(M+1)+L2𝑏2𝑎𝑀1𝐿2b=2a(M+1)+L2 italic_b = 2 italic_a ( italic_M + 1 ) + italic_L. We will use three kinds of links, with the following depletions:

  • Dlarge=2a(M+1)subscript𝐷large2𝑎𝑀1D_{\text{large}}=2a(M+1)italic_D start_POSTSUBSCRIPT large end_POSTSUBSCRIPT = 2 italic_a ( italic_M + 1 ), created by gluing (M+1)𝑀1(M+1)( italic_M + 1 ) single edges. We have

    (2b2aDlarge)=L2a.2𝑏2𝑎subscript𝐷large𝐿2𝑎(2b-2a-D_{\text{large}})=L-2a.( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT large end_POSTSUBSCRIPT ) = italic_L - 2 italic_a .
  • Dmedium=2aM+2subscript𝐷medium2𝑎𝑀2D_{\text{medium}}=2aM+2italic_D start_POSTSUBSCRIPT medium end_POSTSUBSCRIPT = 2 italic_a italic_M + 2, created by gluing M𝑀Mitalic_M single edges and one 3-regular depletor. We have

    (2b2aDmedium)=L2.2𝑏2𝑎subscript𝐷medium𝐿2(2b-2a-D_{\text{medium}})=L-2.( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT medium end_POSTSUBSCRIPT ) = italic_L - 2 .
  • Dsmall=2aMsubscript𝐷small2𝑎𝑀D_{\text{small}}=2aMitalic_D start_POSTSUBSCRIPT small end_POSTSUBSCRIPT = 2 italic_a italic_M, created by gluing M𝑀Mitalic_M single edges. We have

    (2b2aDsmall)=L.2𝑏2𝑎subscript𝐷small𝐿(2b-2a-D_{\text{small}})=L.( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT small end_POSTSUBSCRIPT ) = italic_L .

To verify that these links are well defined, we must check that the maximum degree in the link is at most d𝑑ditalic_d. Note that ba<d1𝑏𝑎𝑑1\frac{b}{a}<d-1divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG < italic_d - 1 by assumption. Thus, Md3𝑀𝑑3M\leq d-3italic_M ≤ italic_d - 3, so the degree constraint allows us to glue M+1𝑀1M+1italic_M + 1 depletors to a vertex in our link gadget.

As long as b𝑏bitalic_b is not a multiple of a𝑎aitalic_a, we have that L𝐿Litalic_L is positive, L2a𝐿2𝑎L-2aitalic_L - 2 italic_a is negative, and gcd(L,L2,L2a)=2𝐿𝐿2𝐿2𝑎2\gcd(L,L-2,L-2a)=2roman_gcd ( italic_L , italic_L - 2 , italic_L - 2 italic_a ) = 2. By Bezout’s lemma, there must therefore exist non-negative integers w1,w2,w3subscript𝑤1subscript𝑤2subscript𝑤3w_{1},w_{2},w_{3}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_w start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT such that

w1(L2a)+w2(L2)+w3L=2a2k.subscript𝑤1𝐿2𝑎subscript𝑤2𝐿2subscript𝑤3𝐿2𝑎2𝑘w_{1}(L-2a)+w_{2}(L-2)+w_{3}L=2a-2k.italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( italic_L - 2 italic_a ) + italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( italic_L - 2 ) + italic_w start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT italic_L = 2 italic_a - 2 italic_k .

So, we have constructed a multiset of links with the desired sum. Now we give an ordering of the links in the multiset such that such that

2k+i=1j(2b2aDi)[2,2a2]2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖22𝑎22k+\sum_{i=1}^{j}(2b-2a-D_{i})\in[2,2a-2]2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ∈ [ 2 , 2 italic_a - 2 ]

for all j<𝑗j<\ellitalic_j < roman_ℓ. We construct the ordering greedily. Let S𝑆Sitalic_S be the multiset of links we found above. While

2k+i=1j(2b2aDi)2a,2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖2𝑎2k+\sum_{i=1}^{j}(2b-2a-D_{i})\neq 2a,2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ≠ 2 italic_a ,

we choose an element Dsuperscript𝐷D^{*}italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT of S𝑆Sitalic_S such that

(2b2aD)+2k+i=1j(2b2aDi)[2,2a],2𝑏2𝑎superscript𝐷2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖22𝑎(2b-2a-D^{*})+2k+\sum_{i=1}^{j}(2b-2a-D_{i})\in[2,2a],( 2 italic_b - 2 italic_a - italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT ) + 2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ∈ [ 2 , 2 italic_a ] ,

set Dj+1=Dsubscript𝐷𝑗1superscript𝐷D_{j+1}=D^{*}italic_D start_POSTSUBSCRIPT italic_j + 1 end_POSTSUBSCRIPT = italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT, and remove Dsuperscript𝐷D^{*}italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT from S𝑆Sitalic_S. We now show that such a Dsuperscript𝐷D^{*}italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT necessarily exists.

Suppose S𝑆Sitalic_S is nonempty, and adding a large link brings the sum outside the desired interval. That is,

(L2a)+2k+i=1j(2b2aDi)0.𝐿2𝑎2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖0(L-2a)+2k+\sum_{i=1}^{j}(2b-2a-D_{i})\leq 0.( italic_L - 2 italic_a ) + 2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ≤ 0 .

Then, since adding all remaining elements of S𝑆Sitalic_S would bring the sum to 2a2𝑎2a2 italic_a, we know that S𝑆Sitalic_S cannot consist only of large links. L𝐿Litalic_L and L2𝐿2L-2italic_L - 2 are both non-negative, and we know

L+2k+i=1j(2b2aDi)0+2a=2a,𝐿2𝑘superscriptsubscript𝑖1𝑗2𝑏2𝑎subscript𝐷𝑖02𝑎2𝑎L+2k+\sum_{i=1}^{j}(2b-2a-D_{i})\leq 0+2a=2a,italic_L + 2 italic_k + ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_j end_POSTSUPERSCRIPT ( 2 italic_b - 2 italic_a - italic_D start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) ≤ 0 + 2 italic_a = 2 italic_a ,

so adding either a medium or a small link would be valid. If, on the other hand, adding a large link would be valid, then either S𝑆Sitalic_S contains a large link and we can add that, or S𝑆Sitalic_S contains only small and medium links, in which case since L𝐿Litalic_L and L2𝐿2L-2italic_L - 2 are both non-negative we can add them in any order. Repeating this argument on S𝑆Sitalic_S until we reach a sum of 2a2𝑎2a2 italic_a will give a greedy construction for the link sequence Dsuperscript𝐷D^{*}italic_D start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT.

We have established the lemma in the case that abnot-divides𝑎𝑏a\nmid bitalic_a ∤ italic_b; we now deal with the case where b𝑏bitalic_b is a multiple of a𝑎aitalic_a. Here, L=0𝐿0L=0italic_L = 0, so now none of L𝐿Litalic_L, L2𝐿2L-2italic_L - 2, and L2a𝐿2𝑎L-2aitalic_L - 2 italic_a are positive. In this case, we will build our chain using k1𝑘1k-1italic_k - 1 copies of the Dmediumsubscript𝐷mediumD_{\text{medium}}italic_D start_POSTSUBSCRIPT medium end_POSTSUBSCRIPT link, and feed the final edge into a 3333-regular depletor as opposed to a single vertex, as in Figure 9.

Refer to caption
Figure 9: A chain of link gadgets forcing x2(k1)y2𝑥2𝑘1𝑦2x-2(k-1)\geq y\geq 2italic_x - 2 ( italic_k - 1 ) ≥ italic_y ≥ 2.

If the attachment edge is labeled 2k2𝑘2k2 italic_k, then the final edge can be labeled at least 2222 and so this is satisfiable. However if the attachment edge is labeled x<2k𝑥2𝑘x<2kitalic_x < 2 italic_k, then the final edge can’t have positive label, and so the final depletor is not visited. ∎

Now that we have these fine-tunable depletors, we can glue them to the vertices of a graph to contribute a specific number of artificial visits. However, in order to contribute enough visits in our reduction, it is sometimes necessary to also deplete along the edges.

Lemma 15.

Let a,b𝑎𝑏a,bitalic_a , italic_b be constants with 1ab<a(d1)1𝑎𝑏𝑎𝑑11\leq a\leq b<a(d-1)1 ≤ italic_a ≤ italic_b < italic_a ( italic_d - 1 ). For any integer 2k[2,2a2]2𝑘22𝑎22k\in[2,2a-2]2 italic_k ∈ [ 2 , 2 italic_a - 2 ], there exists a gadget of maximum degree d𝑑ditalic_d and with two attachment edges with the following properties:

  • The gadget can be satisfied if both attachment edges are labeled 2k2𝑘2k2 italic_k.

  • The gadget cannot be satisfied if an attachment edge is labeled less than 2k2𝑘2k2 italic_k.

  • The gadget can be both satisfied and connected if both attachment edges are labeled 2k+12𝑘12k+12 italic_k + 1.

  • The gadget cannot be connected if an attachment edge is labeled less than 2k+12𝑘12k+12 italic_k + 1.

Proof.

Consider the gadget shown in Figure 10: a path on 4444 intermediate vertices, where the 2222 middle vertices each have 2b2a+2k2𝑏2𝑎2𝑘2b-2a+2k2 italic_b - 2 italic_a + 2 italic_k worth of depletion glued to them — this can be constructed using the chain depletors of 14.

Refer to caption
Figure 10: An edge gadget that is satisfiable if both inputs are 2k2𝑘2k2 italic_k, satisfiable and connected if both inputs are 2k+12𝑘12k+12 italic_k + 1.

The middle edge can be assigned non-negative label only if both attachment edges are labeled at least 2k2𝑘2k2 italic_k, and can be assigned positive label only if both attachment edges are labeled at least 2k+12𝑘12k+12 italic_k + 1. ∎

We can think of this edge gadget as effectively providing 2k2𝑘2k2 italic_k depletion to both sides. So, we can now give a reduction to show our complete complexity characterization:

Theorem 2.

When restricted to graphs of maximum degree d𝑑ditalic_d, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP-hard if either a=1𝑎1a=1italic_a = 1 and b<d𝑏𝑑b<ditalic_b < italic_d, or a>1𝑎1a>1italic_a > 1 and ba<d1𝑏𝑎𝑑1\frac{b}{a}<d-1divide start_ARG italic_b end_ARG start_ARG italic_a end_ARG < italic_d - 1. Otherwise, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶.

Proof.

The easiness results were established in Section 3.1, and the case of a=1𝑎1a=1italic_a = 1 in 13. So, it suffices to show a reduction from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in a 3333-regular graph G𝐺Gitalic_G to [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in a max-degree d𝑑ditalic_d graph Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT when 1<ab<(d1)a1𝑎𝑏𝑑1𝑎1<a\leq b<(d-1)a1 < italic_a ≤ italic_b < ( italic_d - 1 ) italic_a. By replacing the edges of G𝐺Gitalic_G with the edge gadgets of 15, we can introduce up to 3(2a1)32𝑎13(2a-1)3 ( 2 italic_a - 1 ) depletion at each vertex, and by gluing up to (d3)𝑑3(d-3)( italic_d - 3 ) additional chain depletors to each original vertex, we can introduce up to 2a(d3)2𝑎𝑑32a(d-3)2 italic_a ( italic_d - 3 ) more. Since

3(2a1)+2a(d3)2b2,32𝑎12𝑎𝑑32𝑏23(2a-1)+2a(d-3)\geq 2b-2,3 ( 2 italic_a - 1 ) + 2 italic_a ( italic_d - 3 ) ≥ 2 italic_b - 2 ,

and all of these depletors are fully fine-tunable, we can ensure exactly 2b22𝑏22b-22 italic_b - 2 depletion on each original vertex of G𝐺Gitalic_G. This means that up to but no more than 2222 of the edge gadgets incident to each original vertex can be connected; thus, Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] if and only if G𝐺Gitalic_G has a connected 2222-factor. ∎

4 Complexity characterization in directed graphs

In contrast to the case of undirected graphs, where we found that sufficiently large size of the [a,b]𝑎𝑏[a,b][ italic_a , italic_b ] range compared to degree made [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] easy, we will show that in directed graphs every case is hard, except when the [a,b]𝑎𝑏[a,b][ italic_a , italic_b ] range is very small (contains only a single element) and d=3𝑑3d=3italic_d = 3.

Just as in the directed case, we can think of the problem of [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] as finding labels. More precisely, a directed graph is [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] if and only if there is a connected labeling of the edges such that every vertex has in-label sum a𝑎aitalic_a and out-label sum a𝑎aitalic_a. As in the directed case the equivalence of these notions follows from taking an Euler tour on the multigraph generated by viewing the labels as multiplicities for edges.

4.1 Easiness

First we give a simple algorithm for the easy cases of [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] in directed graphs.

Lemma 16.

For a>1𝑎1a>1italic_a > 1, there exists a polynomial-time algorithm to decide [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] in directed graphs of maximum degree 3333.

Proof.

Fix a directed graph of maximum degree 3333. If any vertex has in-degree or out-degree 3333 we immediately deduce that the graph is not [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ]; in the remainder of the proof we assume there are no vertices with in-degree or out-degree 3333.

Our algorithm for [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] begins as follows: while there exists a vertex v𝑣vitalic_v in the graph with only a single unlabeled out-edge, or only a single unlabeled in-edge, assign that edge the unique label that satisfies v𝑣vitalic_v. When that process terminates, each vertex must have either zero or two unlabeled in-edges, and either zero or two unlabeled out-edges. So, if we look at the subgraph on unlabeled edges, and think of them as undirected, we must have a union of even-length cycles. For each of those cycles, assign labels by alternating between a2𝑎2\left\lfloor\frac{a}{2}\right\rfloor⌊ divide start_ARG italic_a end_ARG start_ARG 2 end_ARG ⌋ and a2𝑎2\left\lceil\frac{a}{2}\right\rceil⌈ divide start_ARG italic_a end_ARG start_ARG 2 end_ARG ⌉. Now, check whether the assigned labels represent an [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] labeling; if so accept, if not reject.

Since a2+a2=a𝑎2𝑎2𝑎\left\lfloor\frac{a}{2}\right\rfloor+\left\lceil\frac{a}{2}\right\rceil=a⌊ divide start_ARG italic_a end_ARG start_ARG 2 end_ARG ⌋ + ⌈ divide start_ARG italic_a end_ARG start_ARG 2 end_ARG ⌉ = italic_a, if our labeling violates a vertex visit constraint, that constraint must have been violated during the forced initial phase. Similarly, since this process only labels edges with 00 during the initial phase, if connectivity fails then no labeling can achieve connectivity. ∎

4.2 Hardness

4.2.1 Max degree 3333

We now show hardness of [a,a+1]\hHAM𝑎𝑎1\hHAM[a,a+1]\hHAM[ italic_a , italic_a + 1 ]. We will argue by induction. The following lemma constitutes the inductive step of the argument.

Lemma 17.

Fix k1𝑘1k\geq 1italic_k ≥ 1. Suppose that [1,k]\hHAM1𝑘\hHAM[1,k]\hHAM[ 1 , italic_k ] is \NP-hard in 3333-regular digraphs. Then, for any a1𝑎1a\geq 1italic_a ≥ 1, [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] is \NP-hard in 3333-regular digraphs.

Proof.

Let G𝐺Gitalic_G be a 3333-regular digraph. We construct Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT by replacing each vertex of G𝐺Gitalic_G with a vertex gadget consisting of three hub vertices connected by bridge gadgets, as shown in Figure 11.

Refer to caption
Figure 11: A vertex gadget. Note that the specific structure of the bridge gadgets is just to preserve 3333-regularity; what’s important is that they are acyclic. The labelings shown here are the two possible [a,a+1]\hHAM𝑎𝑎1\hHAM[a,a+1]\hHAM[ italic_a , italic_a + 1 ] traversals — in a similar manner, any way to enter and leave the gadget at most k𝑘kitalic_k times can be turned into an [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] traversal.

We claim that G𝐺Gitalic_G is [1,k]\hHAM1𝑘\hHAM[1,k]\hHAM[ 1 , italic_k ] if and only if Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ]. First we show that if Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] then G𝐺Gitalic_G must be [1,k]\hHAM1𝑘\hHAM[1,k]\hHAM[ 1 , italic_k ]. Each of the bridge gadgets must be visited at least a𝑎aitalic_a times, contributing at least a𝑎aitalic_a of the in-label and out-label of each of the hub vertices. Thus, the edges entering and leaving the vertex gadget can be traversed at most k+aa𝑘𝑎𝑎k+a-aitalic_k + italic_a - italic_a times. That is, each vertex gadget is visited at most k𝑘kitalic_k times and at least once in an [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] tour of Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. If this is possible, then G𝐺Gitalic_G must be [1,k]\hHAM1𝑘\hHAM[1,k]\hHAM[ 1 , italic_k ].

For the other direction, if G𝐺Gitalic_G is [1,k]\hHAM1𝑘\hHAM[1,k]\hHAM[ 1 , italic_k ] we can create labelling of Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT proving that Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] as follows. First, copy the labels on the edges in G𝐺Gitalic_G to the edges that enter and exit the vertex gadgets. Now, label the edges internal to the vertex gadgets as follows: start by assigning all edges in the gadget label a𝑎aitalic_a. Then, increase the edges in the first bridge gadget by one for every traversal of the first edge out of the vertex in G𝐺Gitalic_G. Then, increase the labels of edges in both the first and second bridge gadgets by one for each traversal of the second edge leaving the vertex in G𝐺Gitalic_G. This labeling visits each interval vertex at least a𝑎aitalic_a times and at most a+k𝑎𝑘a+kitalic_a + italic_k times, as desired. Thus, Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ]. ∎

Now, by applying this construction recursively, we can show our full hardness result:

Lemma 18.

For any 1a<b1𝑎𝑏1\leq a<b1 ≤ italic_a < italic_b, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP\NP\NP-hard in 3333-regular digraphs.

Proof.

We will argue by induction on k𝑘kitalic_k that for all constants a1,k1formulae-sequence𝑎1𝑘1a\geq 1,k\geq 1italic_a ≥ 1 , italic_k ≥ 1, [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] is \NP-hard. Using the classic theorem that [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] is \NP-hard in 3333-regular digraphs, by 17 we deduce [a,a+1]\hHAM𝑎𝑎1\hHAM[a,a+1]\hHAM[ italic_a , italic_a + 1 ] is \NP-hard for all a1𝑎1a\geq 1italic_a ≥ 1; this will serve as the base case of our induction. Now, assume that [a,a+k]\hHAM𝑎𝑎𝑘\hHAM[a,a+k]\hHAM[ italic_a , italic_a + italic_k ] is \NP-hard for any constant a𝑎aitalic_a. In particular this means that [1,1+k]11𝑘[1,1+k][ 1 , 1 + italic_k ] is \NP-hard. Then, applying 17 we conclude that [a,a+k+1]\hHAM𝑎𝑎𝑘1\hHAM[a,a+k+1]\hHAM[ italic_a , italic_a + italic_k + 1 ] is \NP-hard for all a1𝑎1a\geq 1italic_a ≥ 1. ∎

16 and 18 together establish 3:

Theorem 3.

In directed graphs of maximum degree 3333, for 1ab1𝑎𝑏1\leq a\leq b1 ≤ italic_a ≤ italic_b, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM\in\P[ italic_a , italic_b ] ∈ ¶ if a=b>1𝑎𝑏1a=b>1italic_a = italic_b > 1, and \NP\NP\NP-hard otherwise.

4.2.2 Max degree 4

The hardness for max degree 3333 digraphs immediately gives that [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is hard in max degree 4444 digraphs as long as b>a𝑏𝑎b>aitalic_b > italic_a. In this section, we will take a different reduction approach to show that [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] is also hard. We will use the following depletor-like construction, which we call an at-least-𝒌𝒌kbold_italic_k gadget:

Lemma 19.

For any k[1,a]𝑘1𝑎k\in[1,a]italic_k ∈ [ 1 , italic_a ], there exists a gadget of max degree 4444 with one incoming edge and one outgoing edge that can be part of an [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] cycle as long as it’s traversed at least k𝑘kitalic_k times and at most a𝑎aitalic_a times.

Proof.

First, as a base case, consider the construction in Figure 12. It is clear that this is an at-least-1111 gadget.

Refer to caption
Figure 12: A gadget that can be traversed between 1111 and a𝑎aitalic_a times.

Now, suppose we know how to build an at-least-(k1)𝑘1(k-1)( italic_k - 1 ) gadget. Then, the construction in Figure 13 is an at-least-k𝑘kitalic_k gadget.

Refer to caption
Figure 13: A gadget that can be traversed between k𝑘kitalic_k and a𝑎aitalic_a times.

By using at-least-(a1)𝑎1(a-1)( italic_a - 1 ) gadgets, we can give our desired reduction.

Lemma 20.

For any a1𝑎1a\geq 1italic_a ≥ 1, [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] is \NP\NP\NP-hard in directed graphs of maximum degree 4444.

Proof.

We reduce from [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in max degree 3333 digraphs. Let G𝐺Gitalic_G be a max degree 3333 digraph. We will make two copies, Vinsubscript𝑉inV_{\text{in}}italic_V start_POSTSUBSCRIPT in end_POSTSUBSCRIPT and Voutsubscript𝑉outV_{\text{out}}italic_V start_POSTSUBSCRIPT out end_POSTSUBSCRIPT, of the vertex set, and add the edge (uout,vin)subscript𝑢outsubscript𝑣in(u_{\text{out}},v_{\text{in}})( italic_u start_POSTSUBSCRIPT out end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT in end_POSTSUBSCRIPT ) for every edge (u,v)E(G)𝑢𝑣𝐸𝐺(u,v)\in E(G)( italic_u , italic_v ) ∈ italic_E ( italic_G ). We will also add the edges (vin,vout)subscript𝑣insubscript𝑣out(v_{\text{in}},v_{\text{out}})( italic_v start_POSTSUBSCRIPT in end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT out end_POSTSUBSCRIPT ) for all vV(G)𝑣𝑉𝐺v\in V(G)italic_v ∈ italic_V ( italic_G ). Finally, for every vV(G)𝑣𝑉𝐺v\in V(G)italic_v ∈ italic_V ( italic_G ), we will add an at-least-(a1)𝑎1(a-1)( italic_a - 1 ) gadget from voutsubscript𝑣outv_{\text{out}}italic_v start_POSTSUBSCRIPT out end_POSTSUBSCRIPT to vinsubscript𝑣inv_{\text{in}}italic_v start_POSTSUBSCRIPT in end_POSTSUBSCRIPT. This construction is shown in Figure 14.

Refer to caption
Figure 14: Reducing [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] in max degree 3333 digraphs to [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] in max degree 4444 digraphs.

The at-least-(a1)𝑎1(a-1)( italic_a - 1 ) gadget consumes all but 1111 of voutsubscript𝑣outv_{\text{out}}italic_v start_POSTSUBSCRIPT out end_POSTSUBSCRIPT’s available out-label, and all but 1111 of vinsubscript𝑣inv_{\text{in}}italic_v start_POSTSUBSCRIPT in end_POSTSUBSCRIPT’s available in-label, so at most one other edge out of voutsubscript𝑣outv_{\text{out}}italic_v start_POSTSUBSCRIPT out end_POSTSUBSCRIPT can be given nonzero label, and at most one other edge into vinsubscript𝑣inv_{\text{in}}italic_v start_POSTSUBSCRIPT in end_POSTSUBSCRIPT can be given nonzero label. Thus, in order to maintain connectivity between all v𝑣vitalic_v, the labeling in Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT must correspond to a Hamiltonian cycle in G𝐺Gitalic_G. ∎

This establishes 4:

Theorem 4.

For all ba1𝑏𝑎1b\geq a\geq 1italic_b ≥ italic_a ≥ 1, [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] is \NP\NP\NP-hard in directed graphs of maximum degree 4.

5 Conclusion and open questions

We now have full characterizations of which a𝑎aitalic_a and b𝑏bitalic_b make [a,b]\hHAM𝑎𝑏\hHAM[a,b]\hHAM[ italic_a , italic_b ] \NP-hard in d𝑑ditalic_d-regular graphs and graphs of max degree d𝑑ditalic_d. One question of further potential interest would be to extend this analysis to low-dimensional grid graphs (i.e. induced subgraphs of a square lattice). It’s known that [1,1]\hHAM11\hHAM[1,1]\hHAM[ 1 , 1 ] is \NP-hard in 2-dimensional grid graphs [gridgraphs], but not clear whether one should expect [1,2]\hHAM12\hHAM[1,2]\hHAM[ 1 , 2 ] to be hard as well, for example. Another problem worth considering would be hardness of approximation — for instance, when is it possible to distinguish between [a,a]\hHAM𝑎𝑎\hHAM[a,a]\hHAM[ italic_a , italic_a ] graphs and graphs that aren’t even [a,a]\hHAMsuperscript𝑎superscript𝑎\hHAM[a^{\prime},a^{\prime}]\hHAM[ italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ], for some a>asuperscript𝑎𝑎a^{\prime}>aitalic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT > italic_a?

Acknowledgments

This paper was initiated during open problem solving in the MIT class “Algorithmic Lower Bounds: Fun with Hardness Proofs” (6.5440) taught by Erik Demaine in Fall 2023. We thank the other participants of that class for helpful discussions and providing an inspiring atmosphere.

\printbibliography