a triple v_in, v_mid, v_out per vertex

DHC ≤p UHC

DHC≤pUHCDHC\le_p UHC — a Hamiltonian cycle in a directed graph reduces to one in an undirected graph, by encoding the orientation inside the graph's structure.

The construction

Given a directed graph G=(V,E)G=(V,E), build an undirected G′=(V′,E′)G'=(V',E'):

V′={vin:v∈V}∪{vmid:v∈V}∪{vout:v∈V},V'=\{v_{in}:v\in V\}\cup\{v_{mid}:v\in V\}\cup\{v_{out}:v\in V\}, E′={vinvmid:v∈V} ∪ {vmidvout:v∈V} ∪ {uoutvin:uv∈E}.E'=\{v_{in}v_{mid}:v\in V\}\ \cup\ \{v_{mid}v_{out}:v\in V\}\ \cup\ \{u_{out}v_{in}:uv\in E\}.

So each vertex becomes a path of length two vin−vmid−voutv_{in}-v_{mid}-v_{out}, and each directed edge u→vu\to v becomes an undirected edge from the out of uu to the in of vv.

What encodes the orientation. The vertex vmidv_{mid} has degree exactly 22 — its only neighbours are vinv_{in} and voutv_{out}. A Hamiltonian cycle must visit every vertex, and at a degree-22 vertex it must use both incident edges. So every Hamiltonian cycle of G′G' traverses each triple as vin→vmid→voutv_{in}\to v_{mid}\to v_{out} or its reverse — and since the cycle is a single closed walk, that choice is uniform across all triples. That is precisely the orientation lost in passing to an undirected graph.

Visualization

Guided construction

Directed → Undirected Hamiltonian Cycle

Step 1 of 7
Directed Hamiltonian Cycle reduced to Undirected Hamiltonian CycleOn the left a directed graph on four vertices; on the right each vertex is expanded into an in, mid and out vertex arranged around a circle, so that the Hamiltonian cycle runs along the ring and the degree-two middle vertices force a uniform direction.G — directed1→22→33→44→13→11234G′ — undirectedeach vertex is about to become a triple

Correctness — both directions

DHC ∈ ⟹ UHC ∈

Suppose G∈DHCG\in DHC; GG has a directed Hamiltonian cycle v(1)→v(2)→⋯→v(n)→v(1)v^{(1)}\to v^{(2)}\to\dots\to v^{(n)}\to v^{(1)}.

Build in G′G' the cycle vin(1)→vmid(1)→vout(1)→vin(2)→vmid(2)→vout(2)→⋯→vout(n)→vin(1).v^{(1)}_{in}\to v^{(1)}_{mid}\to v^{(1)}_{out}\to v^{(2)}_{in}\to v^{(2)}_{mid}\to v^{(2)}_{out}\to\dots\to v^{(n)}_{out}\to v^{(1)}_{in}.

Every edge exists: the edges vinvmidv_{in}v_{mid} and vmidvoutv_{mid}v_{out} exist for every vv by construction; and vout(t)vin(t+1)v^{(t)}_{out}v^{(t+1)}_{in} exists because v(t)v(t+1)v^{(t)}v^{(t+1)} is a directed edge of GG (it is a cycle edge).

It is Hamiltonian: it visits each of vin,vmid,voutv_{in},v_{mid},v_{out} for every v∈Vv\in V exactly once, since the original cycle visits each vv exactly once. So it covers all ∣V′∣=3∣V∣|V'|=3|V| vertices. Hence G′∈UHCG'\in UHC.

UHC ∈ ⟹ DHC ∈

Suppose G′∈UHCG'\in UHC, with Hamiltonian cycle C′C'.

Step 1 — the triples are traversed consecutively. Let v∈Vv\in V. The vertex vmidv_{mid} has degree 22 in G′G': its only neighbours are vinv_{in} and voutv_{out} (the construction gives it no other edge). A Hamiltonian cycle passes through vmidv_{mid} using exactly two incident edges, and since only two exist it uses both. So C′C' contains the segment vin−vmid−voutv_{in}-v_{mid}-v_{out} (in one of the two directions).

Step 2 — the direction is uniform. Fix a direction of travel along C′C'. By Step 1, in each triple C′C' enters at vinv_{in} and leaves at voutv_{out}, or the reverse. Without loss of generality (reversing the direction of travel if needed) some triple is entered at vinv_{in}. We show all are: the edge following voutv_{out} in C′C' is not internal to the triple, so it has the form voutuinv_{out}u_{in} — the only edges leaving an outout vertex go to inin vertices. So the next triple is likewise entered at uinu_{in}. By induction along the cycle, every triple is traversed as in→mid→outin\to mid\to out.

Step 3 — reading off the directed cycle. Let v(1),v(2),…,v(n)v^{(1)},v^{(2)},\dots,v^{(n)} be the order of the triples along C′C'. By Step 2, between the triple of v(t)v^{(t)} and that of v(t+1)v^{(t+1)}, C′C' uses the edge vout(t)vin(t+1)v^{(t)}_{out}v^{(t+1)}_{in}. Edges of this kind exist only when v(t)v(t+1)∈Ev^{(t)}v^{(t+1)}\in E — that is how E′E' was defined. So v(t)→v(t+1)v^{(t)}\to v^{(t+1)} is a directed edge of GG for every tt, and so is v(n)→v(1)v^{(n)}\to v^{(1)} (the closing edge).

Since C′C' is Hamiltonian in G′G', each triple occurs exactly once, so v(1),…,v(n)v^{(1)},\dots,v^{(n)} are all vertices of VV, each once. Hence v(1)→⋯→v(n)→v(1)v^{(1)}\to\dots\to v^{(n)}\to v^{(1)} is a directed Hamiltonian cycle in GG, i.e. G∈DHCG\in DHC.

Cost of the reduction

TimeO(|V| + |E|)
SpaceO(|V| + |E|)
Output size3|V| vertices, 2|V| + |E| edges

One pass over the vertices (three vertices and two edges each) and one over the edges (one edge each). Linear in the input size.

What it buys

One link of the cycle DHP≤pDHC≤pUHC≤pUHP≤pDHPDHP\le_p DHC\le_p UHC\le_p UHP\le_p DHP, showing the four Hamiltonian problems are polynomially equivalent, so if one is NP-hard, all are.

Pitfalls

  • vmidv_{mid} is not decoration. Without it, vinv_{in} and voutv_{out} would share a single edge and the cycle could cross a triple without any order being forced. The degree-22 property of vmidv_{mid} is the entire forcing mechanism.

  • Uniformity of direction needs proof. "Each triple is traversed in some direction" is not enough — one needs the argument that an edge leaving an outout vertex always arrives at an inin vertex, so the direction propagates around the whole cycle. Without Step 2 there is no way to read a directed cycle off the undirected one.

The chain

Where this was read from

  • 2026"Prove the algorithm is a polynomial-time reduction from DHCDHC to UHCUHC" — the construction is given in full in the question.
  • 2026The same construction, phrased as set definitions of V′V' and E′E'.
  • Lesson 12 assigns all four Hamiltonian reductions as homework and writes none of them; what the lesson does write is only the transitivity argument (why four reductions suffice instead of twelve). The construction above is copied from the phrasing the 2026 papers give it.