k-Path is NP-complete #
k-Path (Cslib.Complexity.LongPath) [CyganEtAl2015, Section 5.2] is NP-complete
(Cslib.Complexity.LongPath_npComplete), with the target k in binary.
Membership. A certificate is an ordering of the declared vertices, read by
Cslib.Complexity.Graph.verifyOrdering as for Cslib.Complexity.HamPath. The verifier
(Cslib.Complexity.LongPath.verifier) checks that the first k entries are k vertices with
consecutive ones adjacent. A path on k vertices extends to an ordering by appending the other
declared vertices. The first k entries, for k in binary, are the first min (length) k
entries, a count in unary, so the verifier is polynomial-time.
Hardness. The pendant copy (Cslib.Complexity.HamPath.pendantCopy) of an instance ⟨G, s, t⟩
of undirected Hamiltonian path relabels every declared vertex v as Nat.pair i (p + 2)
(Cslib.Complexity.HamPath.copyLabel), for p the position of the first occurrence of v, and
attaches two pendant vertices Nat.pair i 0 and Nat.pair i 1 to the copies of s and t. A
path on N + 2 vertices of the copy, for N the number of distinct vertices of G, visits every
vertex of the copy; its ends are the pendant vertices, and removing them leaves a Hamiltonian path
from s to t. Conversely, the pendant vertices extend a Hamiltonian path
(Cslib.Complexity.HamPath.pendantCopy_mem_LongPath_iff). With i = 0 this is a
polynomial-time reduction, so k-Path is NP-hard (Cslib.Complexity.LongPath_npHard). The labels
use positions, which are bounded by the encoded length, because the library's pairing rule
Turing.MultiTapeTM.ComputableInPolyTime.unary_pair takes unary arguments and a vertex name,
written in binary, can be exponentially larger than its encoding. The copy index i is used by
the disjoint union of copies in
CslibFrontier.Computability.Complexity.Parameterized.LongPathKernel,
the OR-cross-composition behind the kernel lower bound for k-Path. The gadget was written for this
library; it is not taken from a source, and no novelty is claimed.
Main definitions #
Cslib.Complexity.LongPath.verifier: the verifier for k-Path.Cslib.Complexity.HamPath.copyLabel: the label of a vertex in copyi.Cslib.Complexity.HamPath.pendantCopy: copyiof a graph with the two pendant vertices.
Main results #
Cslib.Complexity.LongPath.mem_NP: k-Path belongs toNP.Cslib.Complexity.HamPath.pendantCopy_mem_LongPath_iff: correctness of the pendant copy.Cslib.Complexity.LongPath_npHard,Cslib.Complexity.LongPath_npComplete: k-Path isNP-hard andNP-complete.
References #
The verifier for LongPath: decode a list of vertices from the certificate
(Graph.decodeVertexList), check that it lists every declared vertex exactly once, and check that
its first k entries are k vertices with consecutive ones adjacent.
LongPath.verifier verifies LongPath with certificates of length n ^ 2 for instances of
encoded length n: a path on k vertices extends to an ordering of the declared vertices, and the
first k entries of such an ordering form a path when there are k of them and consecutive ones
are adjacent.
The LongPath verifier is polynomial-time: the first k entries, for k in binary, are the
first min (length) k entries, a count in unary.
The label of the vertex v of the graph G in copy i: the pair of i and two more than
the position of the first occurrence of v in the vertex list of G.
Polynomial time #
Building a pendant copy is polynomial-time, with the copy index in unary.
Labels #
One copy #
Every vertex of copy i is a pair with first component i.
Both ends of every edge of copy i are pairs with first component i.
Paths through one copy #
One copy: the copy of ⟨G, s, t⟩ has a path on two more vertices than G has exactly
when G has a Hamiltonian path from s to t.
k-Path is NP-hard, by the pendant copy of an instance of HamPath: a graph has a
Hamiltonian path from s to t exactly when its pendant copy has a path on two more vertices than
the graph has.
k-Path is NP-complete, with the target k in binary.