Poly-time reducibility [00WK]
- December 3, 2026
We also typically care about how long the reduction takes.
Definition Polynomial-time reducibility [00WD]
- December 3, 2026
If A \leq B and the translation functions f and g take polynomial time to compute, and the reduction makes only a polynomial number of subroutine calls to B, then we say that A is polynomial-time reducible to B, and write A \leq _P B.
Example Bipartite matching \leq _P max flow [00WE]
- December 3, 2026
As we saw earlier in the semester, finding bipartite matchings is poly-time reducible to max flow. The "translation functions" only take an amount of time which is linear (hence polynomial) in the size of the input graph.
Example IND-SET and Reducibility and \mathcal {NP}-completeness [00WF]
- December 3, 2026
As another simple example, we saw that IND-SET \leq _P VERTEX-COVER and vice versa: given a graph G = (V,E) and natural number k as input, all the translation function f has to do is replace k by |V| - k.
Example 3-SAT \leq _P SAT [00WG]
- December 3, 2026
Clearly 3-SAT \leq _P SAT: any instance of 3-SAT is in fact a valid instance of SAT as well, so the "reduction" doesn't even have to do any work.
It turns out (but is extremely nonobvious!) that the other direction is true as well: SAT \leq _P 3-SAT (we will prove this eventually). So in some sense even though the special case of 3-SAT seems like it might be “easier” than the general case of SAT, it is not.
Why 3, you ask? Because 3 is the smallest k for which k-SAT is just as hard as SAT. It turns out that 2-SAT, where all clauses have exactly two variables, is much easier, and can even be solved in linear time. (1-SAT, of course, is trivial (though not as trivial as 0-SAT).)
Lemma Poly-time reducibility preserves poly-time solvability [00WL]
- December 3, 2026
Suppose A and B are decision problems with A \leq _P B. If B is solvable in polynomial time, then so is A.
Proof.
- December 3, 2026
Suppose we have an input x to A of size n. Suppose the translation function f (which converts x into an input suitable for B) takes time p(n) to compute, for some polynomial p. Note that this means the size of f’s output is also O(p(n)), since it takes p(n) time and it has to produce the entire output in that time.
Now suppose B can be solved in time q(m), where q is a polynomial and m is the size of its input. Then the total time to solve problem A on input x, using the reduction to B, is the time to convert the input plus the time to run B on an input of size O(p(n)), that is, p(n) + q(p(n)). Since p and q are polynomials, and polynomials are closed under addition and substitution, this is a polynomial.
Remark [00WM]
- December 3, 2026
It is not too hard to extend the above lemma and proof in a couple ways:
- If A and B are not decision problems then we must also take into account the time needed to run the output conversion.
- We can also take into account the case where B is called a polynomial number of times as a subroutine—it essentially involves multiplying by another polynomial, though to do it formally one has to be a bit more careful to state that we have not just a single input conversion function but many, which are all bounded by some polynomial runtime.
Corollary [00WN]
- December 3, 2026
Suppose A \leq _P B. If A is not solvable in polynomial time, then neither is B.
Remark [00WO]
- December 3, 2026
Intuitively, if A \leq _P B then B is “at least as hard as” A (that is, with respect to solvability in polynomial time).
Lemma Properties of \leq _P [00WP]
- December 3, 2026
\leq _P is reflexive and transitive.
Proof.
- December 3, 2026
Theorem 3-SAT \leq _P IND-SET [00WQ]
- December 3, 2026
Although the two problems seem totally unrelated, it turns out that we can reduce 3-SAT to IND-SET (in fact, as we will see, we can reduce in the other direction as well)!
Proof.
- December 3, 2026
We want to exhibit a polynomial reduction from 3-SAT to IND-SET. That is, given a black box to solve IND-SET, we want to show how we could use it to solve 3-SAT, using only a polynomial amount of additional work.
Given a set of 3-SAT clauses, we want to find a satisfying assignment, which has to make each clause true. In order to make a clause true it suffices to choose exactly one term from each clause which will be set to \mathsf {T}. (Note that “setting \overline {x_i} to True” of course means setting x_i to \mathsf {F}.) However, we have to choose consistently: we can never pick both x_i and \overline {x_i}.
We start by constructing a graph G with 3k vertices arranged in k triangles, like so:
Each triangle corresponds to a clause, and each vertex corresponds to a term; in particular, label v_{ij} by the jth term from clause C_i. So, for example, given the clauses (x_1 \lor \overline {x_3} \lor x_4), (x_2 \lor x_1 \lor x_3), (\overline {x_1} \lor x_3 \lor \overline {x_4}), we would start by constructing the graph
This graph always has independent sets of size k (but no bigger): just pick exactly one node from each triangle. However, we don’t want to allow picking just any old combination of nodes. So we add more edges: in particular, add an edge between every pair of nodes labelled by x_i and \overline {x_i} for some i. So our example graph becomes:
An independent set can’t contain both endpoints of an edge. These edges therefore encode the constraint that we have to choose variables consistently: we can never choose both x_i and \overline {x_i}.
The claim is now that this graph has an independent set of size \geq k iff the original 3-SAT instance is satisfiable—and hence we can solve the original 3-SAT instance by asking our black box for whether this graph has an independent set of size \geq k. If the graph has an independent set of size \geq k, it must in fact have size exactly k and consist of a choice of one term from each clause. Just making these terms \mathsf {T} will result in a satisfying assignment (variables which do not correspond to any chosen term can be set to anything, say, \mathsf {F}); this is well-defined because we will never have both x_i and \overline {x_i} selected (because of the extra edges we added). Conversely, if there is a satisfying assignment, just choose one vertex from each triangle whose label is \mathsf {T} under the assignment (since it is a satisfying assignment, each clause must have at least one term which is \mathsf {T}). Any two vertices connected by an edge are either in the same triangle (and we only pick one vertex from each triangle) or are labelled with inverse terms (and hence can’t both be labelled \mathsf {T}), so this is an independent set of size k.
Finally, this reduction does only a polynomial amount of work: given k clauses we construct a graph with \Theta (k) vertices and O(k^2) edges.