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.
Classical NP-Completeness Reductions
1 · Prerequisites
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Foundations of the Real Numbers for Analysis
- Graphs, Walks and Connectivity
- Linear Recurrences and Rational Generating Functions
- P, NP, coNP, and Polynomial Reductions
- Relations, Functions, and Quotients
- Resource Bounds and Machine Invariance
- Sequences and Limits
- The ZFC Axioms and the Basic Set Constructions
- Turing Machines, Configurations, and Computation
2 · Summary
This page records the standard web of classical polynomial-time reductions that propagates NP-completeness outward from -SAT. The reductions are organized by gadget families and simple graph or arithmetic transforms: clause-cluster graphs for CLIQUE, complement and set-complement moves for INDEPENDENT SET and VERTEX COVER, Hamiltonian detour gadgets, digit-column encodings for SUBSET SUM and PARTITION, the edge-incidence translation to SET COVER, and the not-all-equal colouring gadget for -COLORABILITY.
The emphasis is on exact reduction obligations. Each theorem checks the construction cost, the witness translation, and both directions of the iff condition required by polynomial-time many-one reducibility. The two false statements isolate the common mistakes of proving only one implication and of confusing pseudopolynomial dependence on a numeric target with polynomial dependence on the binary input length.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Reduction gadgets and interface invariants
Definition
Let source and target languages be equipped with explicit witness relations and , so that membership means existence of a corresponding witness. Fix a proposed polynomial-time map between their ambient string spaces in the sense of Polynomial-time many-one reductions.
A reduction gadget is a bounded local piece of together with a specified way that candidate witnesses may enter, exit, or label its boundary. An interface invariant is the condition imposed on those boundary data so that local choices from neighbouring gadgets are compatible with one global target witness satisfying .
On this page, a gadget proof is regarded as complete only after all of the following have been established.
- A total algorithm constructs the target instance from the source instance in polynomial time.
- The target size is polynomially bounded in the source size.
- Every source witness with induces target choices satisfying each gadget's local constraints and the interface invariants.
- Every global target witness with projects back to a source witness because the interface invariants rule out inconsistent local choices.
The gadget language is therefore bookkeeping for the two directions of the iff condition in a many-one reduction, not a substitute for that condition.
Clique, independent set, and vertex cover decision problems
Definition
Let be a finite simple graph.
- A subset is a clique when every two distinct vertices of are adjacent.
- A subset is an independent set when no two distinct vertices of are adjacent.
- A subset is a vertex cover when every edge in has at least one endpoint in .
The associated decision problems are:
- CLIQUE: given with , decide whether has a clique of size at least ;
- INDEPENDENT SET: given , decide whether has an independent set of size at least ;
- VERTEX COVER: given , decide whether has a vertex cover of size at most .
Because the input graph is simple, adjacency means the edge relation from Adjacency, incidence, open and closed neighbourhoods, vertex degree, minimum degree and maximum degree on the vertex set of A finite simple graph is a finite vertex set together with a set of two-element vertex subsets.
3SAT polynomial-time many-one reduces to CLIQUE
Statement
There is a polynomial-time many-one reduction from -SAT to CLIQUE. Explicitly, for every -CNF formula one can construct in polynomial time a graph such that
Facts & Assumptions
Given: A -CNF formula
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
A gadget reduction is correct only after the construction cost and both directions of the witness translation are proved, by Reduction gadgets and interface invariants.
A CLIQUE instance asks for pairwise adjacent vertices in a finite simple graph, by Clique, independent set, and vertex cover decision problems.
Proof
Construct a graph with one vertex for each literal occurrence in clause . Join and by an edge exactly when and the literals and are not complementary. Output the CLIQUE instance .
Assume that is satisfiable, and choose a satisfying assignment. For each clause , pick one literal made true by that assignment and take the corresponding vertex of . This gives chosen vertices, one from each clause. Two chosen literals cannot be complementary because one assignment cannot make a variable and its negation both true, so step 1.1 makes every chosen pair adjacent. Therefore the chosen vertices form an -clique.
Assume conversely that has a clique of size . By step 1.1, no two vertices from the same clause are adjacent, so contains exactly one vertex from each clause. Again by step 1.1, the literals represented by those vertices are pairwise noncomplementary. Assign truth values so that every chosen literal is true, and extend arbitrarily to variables not yet assigned. Then each clause contains its chosen true literal, so is satisfiable.
The graph has vertices and at most candidate edges, so the map in step 1.1 is computable in polynomial time. Steps 2.1 and 2.2 prove By [L1] and [L2], this is a polynomial-time many-one reduction.
CLIQUE is NP-complete
Statement
CLIQUE is NP-complete.
Facts & Assumptions
Given: An arbitrary CLIQUE instance .
The previous theorem gives a polynomial-time many-one reduction from -SAT to CLIQUE, by 3SAT polynomial-time many-one reduces to CLIQUE.
The language -SAT is NP-complete, by 3-SAT is NP-complete.
A language is NP-complete exactly when it is NP-hard and belongs to , by NP-hard and NP-complete languages.
A yes-instance of CLIQUE consists of a graph with pairwise adjacent chosen vertices, by Clique, independent set, and vertex cover decision problems.
Proof
A certificate for is a list of vertices. One checks in polynomial time that the listed vertices are distinct and that every pair is adjacent, so CLIQUE lies in .
Because [L2] says that -SAT is NP-complete, every language in reduces to -SAT. Composing any such reduction with the fixed reduction [L1] shows that every language in reduces to CLIQUE. Hence CLIQUE is NP-hard.
Step 1.1 gives CLIQUE , and step 1.2 gives NP-hardness. Therefore CLIQUE is NP-complete by [L3].
CLIQUE, INDEPENDENT SET, and VERTEX COVER are polynomially interreducible
Statement
Each of the languages CLIQUE, INDEPENDENT SET, and VERTEX COVER polynomial-time many-one reduces to each of the other two.
Facts & Assumptions
Given: A finite simple graph and a natural number .
The complement has the same vertex set as , and distinct vertices are adjacent in exactly when they are nonadjacent in , by Graph isomorphisms, automorphisms and graph complements.
A finite vertex set has a cardinality in , by The cardinality of a finite set.
CLIQUE, INDEPENDENT SET, and VERTEX COVER are the graph problems defined on by pairwise adjacency, absence of adjacency, and edge coverage respectively, by Clique, independent set, and vertex cover decision problems.
Proof
For any subset , [L1] implies that the vertices of are pairwise adjacent in if and only if they are pairwise nonadjacent in . Thus is a clique in if and only if it is an independent set in . Therefore is a polynomial-time many-one reduction from CLIQUE to INDEPENDENT SET, and the same map is also a reduction in the reverse direction.
For any subset , the complement is a vertex cover if and only if is an independent set. Indeed, if is independent, every edge has at least one endpoint outside , so it is covered by . Conversely, if is a vertex cover and two vertices of were adjacent, that edge would have no endpoint in , a contradiction. Hence, whenever , the graph has an independent set of size at least if and only if it has a vertex cover of size at most .
Use step 1.2 to define total reductions. For INDEPENDENT SET to VERTEX COVER, map to when , and map it to the fixed no-instance when . For VERTEX COVER to INDEPENDENT SET, map to when , and map it to the fixed yes-instance when . The exceptional branches are correct because no graph has an independent set larger than its vertex set, while every graph has a vertex cover of size at most . Both maps are clearly polynomial-time.
Step 1.1 gives reductions between CLIQUE and INDEPENDENT SET, and step 2.1 gives reductions between INDEPENDENT SET and VERTEX COVER. Composing these reductions yields reductions in every direction among the three problems.
INDEPENDENT SET and VERTEX COVER are NP-complete
Statement
INDEPENDENT SET and VERTEX COVER are NP-complete.
Facts & Assumptions
Given: Arbitrary instances of INDEPENDENT SET and VERTEX COVER.
CLIQUE is NP-complete, by CLIQUE is NP-complete.
CLIQUE, INDEPENDENT SET, and VERTEX COVER polynomial-time many-one reduce to one another, by CLIQUE, INDEPENDENT SET, and VERTEX COVER are polynomially interreducible.
A language is NP-complete exactly when it is NP-hard and belongs to , by NP-hard and NP-complete languages.
INDEPENDENT SET asks for pairwise nonadjacent chosen vertices, and VERTEX COVER asks for at most vertices meeting every edge, by Clique, independent set, and vertex cover decision problems.
Proof
A certificate for INDEPENDENT SET is a list of vertices, and one checks in polynomial time that no pair among them is adjacent. A certificate for VERTEX COVER is a list of at most vertices, and one checks in polynomial time that every edge has an endpoint in that list. Hence both problems lie in .
Since [L1] makes CLIQUE NP-complete, every language in reduces to CLIQUE. Applying the reductions from [L2] from CLIQUE to INDEPENDENT SET and from CLIQUE to VERTEX COVER shows that every language in reduces to each of those target problems. Therefore both targets are NP-hard.
Combine step 1.1 with step 1.2 and [L3]. Both INDEPENDENT SET and VERTEX COVER are NP-complete.
Directed and undirected Hamiltonian path and cycle decision problems
Definition
Let be a finite directed graph in the sense of Multigraphs, loops and directed graphs as variants distinct from the default finite simple graph. A directed Hamiltonian path in is an ordering of all vertices of such that for each . A directed Hamiltonian cycle in is a cyclic ordering of all vertices of such that for and .
Let be a finite simple graph. An undirected Hamiltonian path in is a path in the sense of Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges that visits every vertex exactly once, and an undirected Hamiltonian cycle in is a cycle there that visits every vertex exactly once.
The four decision problems are:
- directed Hamiltonian path: given , decide whether has a directed Hamiltonian path;
- directed Hamiltonian cycle: given , decide whether has a directed Hamiltonian cycle;
- undirected Hamiltonian path: given , decide whether has an undirected Hamiltonian path;
- undirected Hamiltonian cycle: given , decide whether has an undirected Hamiltonian cycle.
3SAT polynomial-time many-one reduces to directed Hamiltonian cycle
Statement
There is a polynomial-time many-one reduction from -SAT to directed Hamiltonian cycle.
More explicitly, for every -CNF formula one can construct in polynomial time a directed graph with distinguished vertices such that
- is satisfiable if and only if has a directed Hamiltonian path from to ; and
- after adjoining one fresh vertex and the two arcs and , the resulting digraph has a directed Hamiltonian cycle if and only if is satisfiable.
Facts & Assumptions
Given: A -CNF formula
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
A gadget reduction must prove the construction bound and both directions of the witness translation, by Reduction gadgets and interface invariants.
Directed Hamiltonian paths and cycles are the decision problems from Directed and undirected Hamiltonian path and cycle decision problems.
Proof
If , then is the empty conjunction and is satisfiable. Let be the one-vertex digraph and name its unique vertex both and ; it has the required one-vertex Hamiltonian path. Adjoining and the two opposite arcs between and gives a directed Hamiltonian cycle. This is the required constant-size output in the empty case. Assume henceforth that , so at least one variable occurs. Enumerate the variables of as and the clauses as . For each variable , create vertices The crossbar of the gadget is the bidirected path and we also add the four boundary arcs Thus every Hamiltonian path from to inside must enter the crossbar at one end, traverse every crossbar vertex exactly once, and exit from the opposite end; equivalently it is either the left-to-right route through all clause pairs or the right-to-left route through all clause pairs. Identify with for , and write , . For each clause , add one clause vertex . If the literal occurs in , add the two arcs if the literal occurs in , add If both literals occur, add both pairs of arcs. This completely specifies the digraph , which has vertices and arcs and is computable in polynomial time.
Suppose that is satisfiable. In each gadget , choose the left-to-right crossbar route if and the right-to-left route if . Concatenating these routes through the identified vertices already yields a directed path from to visiting every gadget vertex exactly once. Now fix a clause , and choose one literal of that is true under the satisfying assignment. If it is a positive occurrence of , replace the local edge on the left-to-right route by the detour . If it is a negative occurrence of , replace the local edge on the right-to-left route by . Doing this once for each clause visits every clause vertex exactly once and does not revisit any gadget vertex, because each detour leaves and re-enters the same clause pair. Hence has a directed Hamiltonian path from to .
Suppose conversely that has a directed Hamiltonian path from to . We first verify the interface invariant omitted by a merely pictorial gadget argument. If the path enters a clause vertex from an occurrence pair in and leaves toward a different occurrence pair, then the unused vertex of the first pair can subsequently be entered only from its other crossbar neighbour; after that entry, every possible exit goes to that already visited neighbour, the visited mate, or the already visited clause vertex. The path is therefore stuck before reaching . The same four-case check applies with the crossbar direction reversed and with positive and negative occurrence arcs exchanged. Hence every visit to leaves through the mate in the same occurrence pair: a clause visit only replaces one crossbar edge by its two-edge detour. It follows that the path cannot jump between variable gadgets through a clause vertex. The remaining connections force it through in order, and within each it traverses the entire crossbar monotonically from one end to the other. Set exactly for a left-to-right traversal. Every clause vertex is visited by a same-pair detour whose orientation exists only for a literal made true by this assignment. Thus every clause has a true literal and is satisfiable.
Now add one fresh vertex and the two arcs and . If has a Hamiltonian path from to , then adjoining closes that path to a directed Hamiltonian cycle in . Conversely, any directed Hamiltonian cycle in must pass through the fresh vertex , whose only outgoing arc is to and whose only incoming arc is from . Deleting from the cycle therefore yields a directed Hamiltonian path from to in .
Step 1.1 handles the empty formula and gives a polynomial-time construction for every well-formed -CNF formula. For , steps 2.1 and 2.2 prove the iff for directed Hamiltonian path, and step 3.1 converts that iff to directed Hamiltonian cycle. Extend the map to every input string by checking -CNF syntax in polynomial time and sending any malformed string to the fixed one-vertex loopless digraph, which has no directed Hamiltonian cycle. By [L1] and [L2], the resulting total function is a polynomial-time many-one reduction from -SAT to directed Hamiltonian cycle.
Directed Hamiltonian cycle polynomial-time many-one reduces to undirected Hamiltonian cycle
Statement
Directed Hamiltonian cycle polynomial-time many-one reduces to undirected Hamiltonian cycle.
Facts & Assumptions
Given: A finite directed graph .
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
Directed Hamiltonian cycles and undirected Hamiltonian cycles are the problems defined in Directed and undirected Hamiltonian path and cycle decision problems.
A directed graph has a finite vertex set and an arc set , by Multigraphs, loops and directed graphs as variants distinct from the default finite simple graph.
Proof
If , decide directly whether has a directed Hamiltonian cycle and map it to a fixed yes-instance or no-instance of undirected Hamiltonian cycle accordingly. Thus it is enough to treat the case . Delete every loop, since a Hamiltonian cycle through at least two distinct vertices cannot use a loop. For each vertex , create three undirected vertices and the two edges and . For each arc with , add the undirected edge . Call the resulting graph .
In any Hamiltonian cycle of , the middle vertex has degree two, so the cycle must traverse the gadget for as the consecutive path or as the consecutive path . Moreover, every external gadget edge joins a -vertex to a -vertex. Hence, after orienting the cycle, once one gadget is traversed in one of those two directions, every subsequent gadget is forced to be traversed in the same direction around the cycle.
If has a directed Hamiltonian cycle , then is a Hamiltonian cycle in , because each directed arc supplies the edge .
Conversely, let be a Hamiltonian cycle in . By step 2.1 and, if necessary, reversing the orientation of , we may assume that every gadget is traversed as . Whenever moves from the gadget of to the gadget of , it uses an edge , and such an edge exists only when . Replacing each gadget path by the single vertex therefore projects to a directed Hamiltonian cycle of .
The map uses vertices and at most edges, so it is polynomial-time. Steps 2.2 and 3.1 prove has a directed Hamiltonian cycle if and only if has an undirected Hamiltonian cycle. By [L1], this is a polynomial-time many-one reduction.
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.
The previous theorem builds, from every -CNF formula , a digraph with a directed Hamiltonian path exactly when is satisfiable and then a digraph with a directed Hamiltonian cycle exactly when is satisfiable, by 3SAT polynomial-time many-one reduces to directed Hamiltonian cycle.
Directed Hamiltonian cycle reduces in polynomial time to undirected Hamiltonian cycle, by Directed Hamiltonian cycle polynomial-time many-one reduces to undirected Hamiltonian cycle.
The language -SAT is NP-complete, by 3-SAT is NP-complete.
A language is NP-complete exactly when it is NP-hard and belongs to , by NP-hard and NP-complete languages.
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
Each of the four problems lies in : 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.
By [L1], every -CNF formula gives a digraph with distinguished vertices such that is satisfiable exactly when has a directed Hamiltonian path from to , and also a digraph with a directed Hamiltonian cycle exactly when is satisfiable. Since [L3] makes -SAT NP-complete, directed Hamiltonian cycle is NP-hard, and the endpoint-labelled problem is NP-hard as well.
Reduce to the ordinary directed Hamiltonian path problem. Given , add fresh vertices and together with the two arcs and . Any Hamiltonian path in the new digraph must start at and end at , because has indegree and has outdegree . Deleting those two new vertices therefore recovers a directed Hamiltonian path from to in , and conversely any such path extends by adjoining at the front and at the end. Thus ordinary directed Hamiltonian path is NP-hard.
Next define the endpoint-labelled undirected problem First handle the allowed boundary case . If has one vertex, map it to the one-vertex yes-instance with its sole vertex named as both endpoints. If 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 . Build an undirected graph by replacing every vertex by a path , replacing by a single vertex , replacing by a single vertex , and adding an undirected edge for every arc of that is not incoming to and not outgoing from , with the conventions if and if . A directed Hamiltonian path in then becomes the undirected Hamiltonian path in . Conversely, an undirected Hamiltonian path from to must traverse every triple consecutively because the middle vertex has degree , and all external edges join a -vertex to a -vertex. Contracting each triple therefore recovers a directed Hamiltonian path from to in . Hence .
For undirected Hamiltonian cycle, NP-hardness is exactly [L2] composed with the NP-hardness of directed Hamiltonian cycle from step 1.2.
Reduce to the ordinary undirected Hamiltonian path problem. Given , attach two fresh leaves and by the edges and . Any Hamiltonian path in the enlarged graph must have the two leaves as its endpoints, so deleting them recovers a Hamiltonian path from to in ; conversely any -to- Hamiltonian path in extends by the two leaves. Therefore ordinary undirected Hamiltonian path is NP-hard.
Step 1.1 gives membership in , 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].
Subset sum and partition decision problems
Definition
An instance of SUBSET SUM is a finite list of positive integers written in binary together with a target integer , also written in binary. It is a yes-instance when some subset of the listed integers sums exactly to .
An instance of PARTITION is a finite list of positive integers written in binary. It is a yes-instance when the list can be divided into two subcollections having the same total sum.
3SAT polynomial-time many-one reduces to subset sum
Statement
There is a polynomial-time many-one reduction from -SAT to SUBSET SUM.
Facts & Assumptions
Given: An arbitrary INDEPENDENT SET instance , where
There is a polynomial-time many-one reduction from -SAT to CLIQUE, by 3SAT polynomial-time many-one reduces to CLIQUE.
CLIQUE, INDEPENDENT SET, and VERTEX COVER polynomial-time many-one reduce to one another, by CLIQUE, INDEPENDENT SET, and VERTEX COVER are polynomially interreducible.
INDEPENDENT SET asks for pairwise nonadjacent vertices, and SUBSET SUM asks for a subcollection of positive integers whose sum is a prescribed target, by Clique, independent set, and vertex cover decision problems and Subset sum and partition decision problems.
Proof
By [L1] and [L2], it is enough to reduce INDEPENDENT SET to SUBSET SUM. If , map to the fixed yes-instance consisting of the list with target , because every graph has an independent set of size . If , map to the fixed no-instance consisting of the list with target , because no graph on vertices has an independent set of size greater than . So assume from now on that . Set the base to .
For each vertex , form a base- integer with digits: the leading digit is , and the digit in edge-column is exactly when is incident to . For each edge , form one slack integer whose only nonzero digit is a in edge-column . Let the target integer have leading digit and digit in every edge-column. Since the leading-column sum is at most and every edge-column sum is at most , no carries can occur in any valid sum.
If is an independent set of size , choose the vertex numbers with . For each edge that has no endpoint in , also choose the slack number . Then the leading digit sums to , and each edge-column sums to : an edge with one endpoint in receives its from the corresponding vertex number, while an edge with no endpoint in receives its from its slack number. Hence the chosen integers sum to .
Conversely, suppose that some subcollection of the constructed integers sums to . Because the slack numbers have leading digit , exactly vertex numbers must be chosen. Consider any edge . The target has digit in column , and there are no carries by step 2.1. Hence both endpoint numbers for and cannot both be chosen, because that would contribute at least in column . Therefore the chosen vertices are pairwise nonadjacent, so they form an independent set.
The map in step 2.1 uses integers with base- digits, so its binary output size and construction time are polynomial in the size of . Steps 3.1 and 3.2 prove a polynomial-time many-one reduction from INDEPENDENT SET to SUBSET SUM. Composing that reduction with [L1] and [L2] yields a polynomial-time many-one reduction from -SAT to SUBSET SUM.
Subset sum polynomial-time many-one reduces to partition
Statement
SUBSET SUM polynomial-time many-one reduces to PARTITION.
Facts & Assumptions
Given: A SUBSET SUM instance and the total
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
SUBSET SUM asks for a subcollection summing to , and PARTITION asks for a split into two subcollections of equal total sum, by Subset sum and partition decision problems.
Proof
If , map the instance to the one-element list for PARTITION. This is a correct no-instance because no subcollection of can exceed the total , and the list cannot be partitioned into two equal sums. Thus it remains to treat the case . Define and , and output the PARTITION instance with list .
The new total sum is , so any equal partition must split the numbers into two subcollections each summing to .
If the SUBSET SUM instance is positive, choose with . Then . The complementary numbers among therefore sum to , and . So the augmented list is a yes-instance of PARTITION.
Conversely, suppose the augmented list has a partition into two subcollections each summing to . The numbers and cannot lie on the same side because , and they cannot both be absent from one side because then that side would use only the original and so would sum at most . Hence exactly one of lies on each side. The side containing must then contain original numbers summing to . Those numbers witness a yes-instance of SUBSET SUM.
The construction adds only two binary integers computed from and , so it is polynomial-time. Steps 3.1 and 3.2 establish the required iff, and [L1] therefore gives a polynomial-time many-one reduction from SUBSET SUM to PARTITION.
The set cover decision problem
Definition
An instance of SET COVER consists of a finite set a family of subsets and a natural number . It is a yes-instance when there exist indices with such that
Vertex cover polynomial-time many-one reduces to set cover
Statement
VERTEX COVER polynomial-time many-one reduces to SET COVER.
Facts & Assumptions
Given: A VERTEX COVER instance , where .
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
A vertex cover is a subset of vertices meeting every edge, by Clique, independent set, and vertex cover decision problems.
A set cover chooses at most members of a family of subsets whose union is the whole universe, by The set cover decision problem.
Proof
Let the SET COVER universe be the edge set . For each vertex , define the subset . Output the SET COVER instance . This is computable in polynomial time by scanning the incidence relation of .
If is a vertex cover with , then every edge of has an endpoint in . Equivalently, every element of lies in one of the sets with . Hence is a set cover of size at most .
Conversely, if is a set cover of size at most , then every edge belongs to some with . By definition of , that means is an endpoint of . Therefore is a vertex cover of size at most .
Steps 2.1 and 2.2 prove . By [L1], the construction in step 1.1 is a polynomial-time many-one reduction.
The three-colourability decision problem
Definition
Let be a finite simple graph. A proper three-colouring of is a map such that
The decision problem -COLORABILITY asks, given , whether such a proper three-colouring exists.
3SAT polynomial-time many-one reduces to 3-COLORABILITY
Statement
There is a polynomial-time many-one reduction from -SAT to -COLORABILITY.
Facts & Assumptions
Given: A -CNF formula
A polynomial-time many-one reduction is a total polynomial-time function preserving membership in both directions, by Polynomial-time many-one reductions.
A gadget reduction must prove the construction cost and both directions of correctness, by Reduction gadgets and interface invariants.
A graph is a yes-instance of -COLORABILITY exactly when it admits a proper colouring with colours , by The three-colourability decision problem.
Proof
First reduce to a not-all-equal -CNF formula. Introduce one global fresh variable and, for each clause , one fresh variable . Replace by the two NAE clauses and . Call the conjunction of all these clauses . This is polynomial-time and doubles the number of clauses.
The formula is satisfiable if and only if is NAE-satisfiable. If is satisfiable, set and keep the satisfying values of the original variables. Then every original clause has at least one true literal, so the four-tuple is not all equal; choose so that the pair of NAE clauses in step 1.1 holds, which is possible exactly because . Conversely, if is NAE-satisfiable and , then each original clause has at least one true literal and is satisfiable. If instead , complement every Boolean value. NAE truth is invariant under global complementation, so the complemented assignment still satisfies and now has . Thus is satisfiable in all cases.
From , build a graph as follows. Add one distinguished vertex . For each variable appearing in , add the triangle on the three vertices . For each NAE clause with ordered literal occurrences , add a clause triangle with three position-distinguished vertices , and join them respectively to the variable-triangle vertices labeled . The position labels remain distinct even when a literal is repeated. This is polynomial-time and creates vertices and edges.
Suppose that is NAE-satisfiable. Colour by . In each variable triangle, colour the literal vertices and by their Boolean values and , which are opposite because they are complements. Now fix one clause triangle. Because the clause is NAE-satisfied, two of its literals have different Boolean values; colour the corresponding two clause vertices by the opposite Boolean values, so each differs from the colour of the adjacent variable vertex. Colour the third clause vertex by . The three clause-vertex colours are then , so the clause triangle is proper. Doing this for every clause yields a proper three-colouring of .
Suppose conversely that has a proper three-colouring. Every triangle uses all three colours, so after permuting colour names assume has colour . In each variable triangle, the vertices and therefore receive colours and in some order; assign the truth value of the literal to be the complementary Boolean value, so and receive opposite truth values. In each clause triangle, exactly one vertex has colour and the other two have colours and . Because each clause vertex is adjacent to the matching literal vertex, a clause vertex with colour or forces the corresponding literal to have the complementary truth value. Thus the three literals of the clause are not all equal, so the clause is NAE-satisfied. Therefore is NAE-satisfiable.
Steps 2.1, 3.1, and 4.1 show . Since the constructions in steps 1.1 and 2.2 are polynomial-time, [L1] and [L2] yield a polynomial-time many-one reduction from -SAT to -COLORABILITY.
5 · Examples, counterexamples and false statements
A gadget reduction is correct as soon as every yes-instance maps to a yes-instance
Statement
A gadget reduction is correct as soon as every yes-instance maps to a yes-instance.
Facts & Assumptions
Given: A source language having at least one no-instance and a target language having at least one yes-instance .
A gadget reduction is not complete until both directions of correctness have been proved, by Reduction gadgets and interface invariants.
A polynomial-time many-one reduction requires if and only if , by Polynomial-time many-one reductions.
Refutation
Define the constant map for every source instance . This map is total and polynomial-time, and it certainly sends every yes-instance of to a yes-instance of .
Let . Then , so the reverse implication in [L2] fails: does not force . Therefore yes-preservation alone does not make a correct many-one reduction.
The statement is false.
A pseudopolynomial algorithm is polynomial in the binary input length
Statement
A pseudopolynomial algorithm is polynomial in the binary input length.
Facts & Assumptions
Given: The standard dynamic program for SUBSET SUM that fills an table for an instance with input numbers and target .
A SUBSET SUM instance writes its target integer in binary, by Subset sum and partition decision problems.
Worst-case running time is measured as a function of the input length, not of the numeric value of a parameter written inside that input, by Worst-case time and space complexity of a machine.
Refutation
Consider the one-number SUBSET SUM instances for . By [F1], the binary input length is .
The standard table-filling algorithm uses time on this family because here and .
Since is exponential in the binary length , the running time in step 2.1 is not polynomial in the input length. By [L1], polynomial-time complexity is measured against that binary length. Therefore pseudopolynomial dependence on does not imply polynomial dependence on the bit-length of .
The statement is false.
Sources
- Sanjeev Arora and Boaz Barak, Computational Complexity: A Modern Approach
- Luca Trevisan and Fabrizio Iozzi, 30540 Computer Science 2 course page
- Fabrizio Iozzi and Luca Trevisan, Handout NP3
- MIT 6.045J / 18.400J, Lecture 16: More NP-completeness
- Fabrizio Iozzi and Luca Trevisan, Handout NP2
- John E. Savage, Models of Computation, Chapter 8