Alphabeta Math
CorollaryStatement: Literature-sourcedProof: AI-generatedprecheck passjudge pass (gpt-5.6-terra)audited 2026-09-05
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Directed and undirected Hamiltonian path and cycle are NP-complete

Statement

The directed Hamiltonian path, directed Hamiltonian cycle, undirected Hamiltonian path, and undirected Hamiltonian cycle problems are all NP-complete.

Facts & Assumptions

Given: An arbitrary instance of one of the four Hamiltonian problems.

[L1]

The previous theorem builds, from every 3-CNF formula φ, a digraph Dφ with a directed Hamiltonian path exactly when φ is satisfiable and then a digraph Dφ with a directed Hamiltonian cycle exactly when φ is satisfiable, by 3SAT polynomial-time many-one reduces to directed Hamiltonian cycle.

[L2]

Directed Hamiltonian cycle reduces in polynomial time to undirected Hamiltonian cycle, by Directed Hamiltonian cycle polynomial-time many-one reduces to undirected Hamiltonian cycle.

[L3]

The language 3-SAT is NP-complete, by 3-SAT is NP-complete.

[L4]

A language is NP-complete exactly when it is NP-hard and belongs to NP, by NP-hard and NP-complete languages.

[F1]

Each Hamiltonian problem asks whether a proposed ordering of all vertices forms a path or cycle of the appropriate kind, by Directed and undirected Hamiltonian path and cycle decision problems.

Proof

technique · direct
1.1

Each of the four problems lies in NP: a certificate is an ordering of all vertices, and one checks in polynomial time that consecutive vertices are connected by the required edges or arcs, with one additional last-to-first check in the cycle cases.

F1givenconstruct
1.2

By [L1], every 3-CNF formula φ gives a digraph Dφ with distinguished vertices sφ,tφ such that φ is satisfiable exactly when Dφ has a directed Hamiltonian path from sφ to tφ, and also a digraph Dφ with a directed Hamiltonian cycle exactly when φ is satisfiable. Since [L3] makes 3-SAT NP-complete, directed Hamiltonian cycle is NP-hard, and the endpoint-labelled problem DHAMPATH:={(D,s,t):D has a directed Hamiltonian path from s to t} is NP-hard as well.

L1L3L4
2.1

Reduce DHAMPATH to the ordinary directed Hamiltonian path problem. Given (D,s,t), add fresh vertices s and t+ together with the two arcs ss and tt+. Any Hamiltonian path in the new digraph must start at s and end at t+, because s has indegree 0 and t+ has outdegree 0. Deleting those two new vertices therefore recovers a directed Hamiltonian path from s to t in D, and conversely any such path extends by adjoining s at the front and t+ at the end. Thus ordinary directed Hamiltonian path is NP-hard.

F1step 1.2construct
2.2

Next define the endpoint-labelled undirected problem UHAMPATH:={(G,s,t):G has an undirected Hamiltonian path from s to t}. First handle the allowed boundary case s=t. If D has one vertex, map it to the one-vertex yes-instance with its sole vertex named as both endpoints. If D has more than one vertex, no Hamiltonian ordering can both start and end at the same vertex, so map it to the fixed two-isolated-vertex no-instance. Now assume st. Build an undirected graph G by replacing every vertex v{s,t} by a path v1v2v3, replacing s by a single vertex s3, replacing t by a single vertex t1, and adding an undirected edge u3v1 for every arc uv of D that is not incoming to s and not outgoing from t, with the conventions u3=s3 if u=s and v1=t1 if v=t. A directed Hamiltonian path s=v(1)v(2)v(r)=t in D then becomes the undirected Hamiltonian path s3,v1(2),v2(2),v3(2),,v1(r1),v2(r1),v3(r1),t1 in G. Conversely, an undirected Hamiltonian path from s3 to t1 must traverse every triple v1v2v3 consecutively because the middle vertex v2 has degree 2, and all external edges join a 3-vertex to a 1-vertex. Contracting each triple therefore recovers a directed Hamiltonian path from s to t in D. Hence DHAMPATHpUHAMPATH.

F1step 1.2casesconstruct
2.3

For undirected Hamiltonian cycle, NP-hardness is exactly [L2] composed with the NP-hardness of directed Hamiltonian cycle from step 1.2.

L2step 1.2algebra
3.1

Reduce UHAMPATH to the ordinary undirected Hamiltonian path problem. Given (G,s,t), attach two fresh leaves s and t+ by the edges ss and tt+. Any Hamiltonian path in the enlarged graph must have the two leaves as its endpoints, so deleting them recovers a Hamiltonian path from s to t in G; conversely any s-to-t Hamiltonian path in G extends by the two leaves. Therefore ordinary undirected Hamiltonian path is NP-hard.

F1step 2.2construct
4.1

Step 1.1 gives membership in NP, while steps 1.2, 2.1, 2.2, 2.3, and 3.1 give NP-hardness for directed Hamiltonian path, directed Hamiltonian cycle, undirected Hamiltonian path, and undirected Hamiltonian cycle. Hence all four problems are NP-complete by [L4].

L4step 1.1step 1.2step 2.1step 2.2step 2.3step 3.1

Depends on

Used by

Nothing in the library uses this result yet.

Dependency tree · two levels

10 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources