Polynomial-Time Reductions and the 3-SAT to Vertex Cover Reduction

Polynomial-Time Reductions and the 3-SAT to Vertex Cover Reduction

Verified Sources
Sep 11, 2026

This section explains three central ideas in computational complexity:

  1. What a polynomial-time reduction is.
  2. How reductions establish that a problem is NP-complete.
  3. How to transform an instance of 3-SAT into an equivalent instance of Vertex Cover.

The key principle is that a reduction transfers computational difficulty from one problem to another. If problem AA can be transformed efficiently into problem BB, then an efficient algorithm for BB would also yield an efficient algorithm for AA.

A standard polynomial-time many-one reduction is written

ApB.A \leq_p B.

This means that there is a polynomial-time computable function ff such that, for every input xx,

xA    f(x)B.x \in A \iff f(x) \in B.

The transformation must preserve the answer exactly: yes-instances map to yes-instances, and no-instances map to no-instances.

Footnotes

  1. Cook–Levin theorem - Background on SAT, 3-SAT, and the foundational NP-completeness result.

  2. P-time reducibility lecture notes - Definitions of polynomial-time reductions, NP-hardness, and NP-completeness.

Direction of a Reduction

To prove that B is hard, reduce a known hard problem A to B: A ≤p B. The direction matters. Reducing B to A generally shows that A is at least as hard as B, not that B is NP-hard.

(i) What Is Polynomial-Time Reduction?

Consider two decision problems, AA and BB. We say that AA is polynomial-time reducible to BB, written ApBA \leq_p B, if an algorithm can convert every instance xx of AA into an instance f(x)f(x) of BB in polynomial time, while preserving the answer:

x is a yes-instance of A    f(x) is a yes-instance of B.x \text{ is a yes-instance of } A \iff f(x) \text{ is a yes-instance of } B.

The function ff is called the reduction function.

Important properties

  • Efficient construction: f(x)f(x) must be computable in polynomial time.
  • Answer preservation: xx and f(x)f(x) must have the same yes/no answer.
  • Single target instance: A many-one reduction creates one instance of BB.
  • Polynomial growth: The output size must be polynomial in the input size.
  • Algorithmic implication: If BB has a polynomial-time algorithm, then AA also has one.

Suppose x=n|x|=n, the reduction takes O(nc)O(n^c) time, and problem BB can be solved in O(md)O(m^d) time on an instance of size mm. If the reduction produces mnkm \leq n^k, then solving AA through BB takes at most

O(nc)+O((nk)d)=O(nc+nkd),O(n^c) + O((n^k)^d) = O(n^c+n^{kd}),

which is polynomial in nn.

Reduction versus ordinary algorithm

A reduction is not necessarily a direct solution to the original problem. Instead, it translates the original problem into another problem whose structure or difficulty is already understood.

For example:

3-SAT instanceVertex Cover instance.\text{3-SAT instance} \longrightarrow \text{Vertex Cover instance}.

The reduction is useful only if the following equivalence holds:

φ is satisfiable    (Gφ,k) has a vertex cover of size at most k.\varphi \text{ is satisfiable} \iff (G_\varphi,k) \text{ has a vertex cover of size at most } k.

Footnotes

  1. P-time reducibility lecture notes - Definitions of polynomial-time reductions, NP-hardness, and NP-completeness.

How to Verify a Polynomial-Time Reduction

  1. 1
    Step 1

    Specify precisely what constitutes an instance and a yes-instance for problems A and B.

  2. 2
    Step 2

    Give an explicit algorithm that maps an arbitrary instance x of A to an instance f(x) of B.

  3. 3
    Step 3

    Bound the time required to create f(x), and show that the output size is polynomial in |x|.

  4. 4
    Step 4

    Show that every yes-instance of A becomes a yes-instance of B.

  5. 5
    Step 5

    Show that every yes-instance of B corresponds to a yes-instance of A. Together, the two directions establish x ∈ A if and only if f(x) ∈ B.

Common Reduction Mistakes

(ii) How Polynomial-Time Reductions Prove NP-Completeness

A decision problem is in NP if a proposed solution, called a certificate, can be checked in polynomial time.

A problem is NP-hard if every problem in NP reduces to it:

ANP,ApB.\forall A \in \mathrm{NP},\quad A \leq_p B.

A problem is NP-complete exactly when it satisfies both conditions:

BNPandB is NP-hard.B \in \mathrm{NP} \quad\text{and}\quad B \text{ is NP-hard}.

Standard proof pattern

To prove that a problem BB is NP-complete:

  1. Show that BNPB \in \mathrm{NP}.
  2. Choose a known NP-complete problem AA.
  3. Construct a polynomial-time reduction ApBA \leq_p B.
  4. Prove the equivalence xA    f(x)B.x \in A \iff f(x) \in B.
  5. Conclude that BB is NP-hard.
  6. Combine membership and hardness to conclude that BB is NP-complete.

The Cook–Levin theorem establishes SAT, and consequently 3-SAT, as a foundational NP-complete problem. Many later NP-completeness proofs use 3-SAT as the source problem.

Why the reduction proves hardness

Assume that AA is NP-complete and that

ApB.A \leq_p B.

If BB had a polynomial-time algorithm, then an instance of AA could be solved by:

  1. Applying the polynomial-time reduction to obtain f(x)f(x).
  2. Running the polynomial-time algorithm for BB.
  3. Returning the same answer.

Thus AA would be in P. Since every problem in NP reduces to AA, this would imply

P=NP.\mathrm{P}=\mathrm{NP}.

Therefore, BB is at least as difficult as the known NP-complete problem AA under polynomial-time reductions.

Footnotes

  1. Introduction to Theoretical Computer Science: NP, NP Completeness, and the Cook–Levin Theorem - Formal discussion of NP verification and reductions.

  2. Cook–Levin theorem - Background on SAT, 3-SAT, and the foundational NP-completeness result.

  3. P-time reducibility lecture notes - Definitions of polynomial-time reductions, NP-hardness, and NP-completeness.

Reduction-Based NP-Completeness Workflow

Choose a source problem

Step 1

Select a problem already known to be NP-complete, such as 3-SAT."

Define the target instance

Step 2

Construct an instance of the target problem from the source instance."

Prove polynomial construction

Step 3

Show that the graph, formula, or numerical instance can be created in polynomial time."

Prove yes-direction

Step 4

Transform a solution of the source instance into a solution of the target instance."

Prove no-direction

Step 5

Show that a target solution would imply a source solution."

Conclude NP-completeness

Step 6

Combine NP-hardness from the reduction with membership in NP."

Hardness Does Not Mean Membership

A reduction from 3-SAT proves NP-hardness only. To prove NP-completeness, you must separately show that the target problem belongs to NP.

(iii) Reducing 3-SAT to Vertex Cover

Source problem: 3-SAT

An instance of 3-SAT is a Boolean formula in conjunctive normal form:

φ=C1C2Cm,\varphi = C_1 \land C_2 \land \cdots \land C_m,

where each clause contains exactly three literals. For example,

φ=(x1¬x2x3)(¬x1x2x4).\varphi = (x_1 \lor \neg x_2 \lor x_3) \land (\neg x_1 \lor x_2 \lor x_4).

The question is whether there exists a truth assignment satisfying every clause.

A literal is either xix_i or ¬xi\neg x_i. A clause is satisfied if at least one of its literals is true.

Let:

  • nn be the number of variables;
  • mm be the number of clauses.

Target problem: Vertex Cover

Given an undirected graph G=(V,E)G=(V,E) and an integer kk, the Vertex Cover problem asks whether there is a set

SVS \subseteq V

such that

Sk|S| \leq k

and every edge has at least one endpoint in SS.

The set SS is a vertex cover.

Vertex Cover is in NP because a certificate is simply a proposed set SS. We can verify in polynomial time that Sk|S|\leq k and that every edge is covered.

Footnotes

  1. NP Completeness lecture notes - Definition of Vertex Cover, its membership in NP, and the 3-SAT reduction. 2

Construction of the graph

Given a 3-SAT formula φ\varphi with nn variables and mm clauses, construct a graph GφG_\varphi as follows.

1. Variable gadgets

For every variable xix_i, create two vertices:

  • one vertex labeled xix_i;
  • one vertex labeled ¬xi\neg x_i.

Connect these two vertices by an edge.

Thus, every variable creates a pair:

(xi,¬xi).(x_i,\neg x_i).

Because the pair is connected by an edge, every vertex cover must select at least one of them. Selecting xix_i represents setting xi=truex_i=\mathrm{true}, while selecting ¬xi\neg x_i represents setting xi=falsex_i=\mathrm{false}.

There are nn variable edges, so any vertex cover must contain at least nn vertices from the variable gadgets.

2. Clause gadgets

For every clause

Cj=(j1j2j3),C_j=(\ell_{j1}\lor \ell_{j2}\lor \ell_{j3}),

create three new vertices:

cj1,cj2,cj3.c_{j1},c_{j2},c_{j3}.

Connect all three clause vertices to one another, forming a triangle:

(cj1,cj2),(cj2,cj3),(cj1,cj3).(c_{j1},c_{j2}),\quad (c_{j2},c_{j3}),\quad (c_{j1},c_{j3}).

Each clause vertex corresponds to one literal in the clause. If cjrc_{jr} corresponds to literal jr\ell_{jr}, add an edge between cjrc_{jr} and the variable-literal vertex labeled jr\ell_{jr}.

The triangle forces every vertex cover to select at least two of its three vertices. Therefore, the mm clause gadgets require at least 2m2m selected vertices.

3. Set the cover bound

Define

k=n+2m.k=n+2m.

The complete reduction is therefore

φ(Gφ,n+2m).\varphi \longmapsto (G_\varphi,n+2m).

The graph contains:

  • 2n+3m2n+3m vertices;
  • n+3m+3m=n+6mn+3m+3m= n+6m edges if every clause contains three literal-connection edges.

The graph and the parameter kk are computable in time polynomial in the size of φ\varphi.

Footnotes

  1. Sample Proof of NP-Completeness - Construction of variable and clause gadgets for reducing 3-SAT to Vertex Cover.

Size of the Constructed Vertex Cover Instance

For a 3-SAT formula with n variables and m clauses

3-SAT to Vertex Cover Construction

  1. 1
    Step 1

    Parse φ into n variables and m clauses, with each clause containing three literals.

  2. 2
    Step 2

    For every variable xi, create vertices xi and ¬xi and connect them with an edge.

  3. 3
    Step 3

    For each clause, create three vertices and connect every pair, producing a triangle.

  4. 4
    Step 4

    Connect each clause vertex to the variable-literal vertex representing the corresponding literal.

  5. 5
    Step 5

    Set k = n + 2m, because a cover must select at least one vertex from each variable pair and at least two from each clause triangle.

  6. 6
    Step 6

    Return the Vertex Cover instance (Gφ, k).

Correctness Proof

We prove the central equivalence:

φ is satisfiable    Gφ has a vertex cover of size at most n+2m.\varphi \text{ is satisfiable} \iff G_\varphi \text{ has a vertex cover of size at most } n+2m.

Forward direction

Assume that φ\varphi is satisfiable. Let α\alpha be a satisfying assignment.

Variable gadgets

For every variable xix_i, select exactly one of the two vertices xix_i and ¬xi\neg x_i:

  • select xix_i if α(xi)=true\alpha(x_i)=\mathrm{true};
  • select ¬xi\neg x_i if α(xi)=false\alpha(x_i)=\mathrm{false}.

This selects exactly nn vertices and covers every variable edge.

Clause gadgets

Because α\alpha satisfies every clause, each clause has at least one true literal. For a clause triangle, leave unselected a clause vertex corresponding to a true literal. Select the other two clause vertices.

This selects exactly two vertices per clause triangle, for a total of 2m2m clause vertices.

The unselected clause vertex is connected to a variable-literal vertex representing a true literal. That variable-literal vertex was selected in the variable gadget, so the connecting edge is covered.

All other edges incident to selected clause vertices are automatically covered. Therefore, the resulting set is a vertex cover of size

n+2m=k.n+2m=k.

Hence,

φ satisfiable    (Gφ,k) is a yes-instance of Vertex Cover.\varphi \text{ satisfiable} \implies (G_\varphi,k) \text{ is a yes-instance of Vertex Cover}.

Reverse direction

Assume that GφG_\varphi has a vertex cover SS with

Sn+2m.|S|\leq n+2m.

Minimum selections forced by gadgets

Each variable pair contains an edge, so SS must contain at least one vertex from each pair. Therefore, SS contains at least nn variable vertices.

Each clause gadget is a triangle. A triangle has three edges, and at least two of its vertices must be selected to cover all three edges. Therefore, SS contains at least 2m2m clause vertices.

Thus, every vertex cover has size at least

n+2m.n+2m.

Since Sn+2m|S|\leq n+2m, the cover must contain exactly:

  • one vertex from every variable pair;
  • two vertices from every clause triangle.

Deriving a truth assignment

Define an assignment α\alpha by:

  • α(xi)=true\alpha(x_i)=\mathrm{true} if xiSx_i\in S;
  • α(xi)=false\alpha(x_i)=\mathrm{false} if ¬xiS\neg x_i\in S.

Exactly one vertex from each pair is selected, so this assignment is well-defined.

Showing every clause is satisfied

Consider a clause triangle. Exactly two of its vertices are in SS, so exactly one clause vertex is not in SS. Let that unselected vertex correspond to literal \ell.

The edge connecting this clause vertex to the variable-literal vertex for \ell must be covered. Since the clause vertex is not selected, its literal vertex must be selected.

By the way the assignment was defined, selecting the vertex for \ell means that \ell is true. Therefore, the clause contains a true literal.

Since this holds for every clause, α\alpha satisfies φ\varphi.

Hence,

(Gφ,k) is a yes-instance    φ is satisfiable.(G_\varphi,k) \text{ is a yes-instance} \implies \varphi \text{ is satisfiable}.

Combining both directions:

φ3SAT    (Gφ,n+2m)VERTEX-COVER.\varphi \in \mathrm{3SAT} \iff (G_\varphi,n+2m)\in \mathrm{VERTEX\text{-}COVER}.

Why the Clause Triangle Works

The clause triangle encodes the requirement that at least one literal in each clause must be true.

A triangle requires two selected vertices in every vertex cover. Consequently, exactly one clause vertex can remain unselected when the cover has the minimum allowed size.

That one unselected clause vertex identifies a literal that must be true:

  1. The unselected clause vertex is connected to its corresponding literal vertex.
  2. The connecting edge must still be covered.
  3. Therefore, the corresponding literal vertex must be selected.
  4. Selection of that literal vertex represents a satisfying truth value.

This is the central gadget invariant:

one unselected clause vertexone true literal in the clause.\text{one unselected clause vertex} \Longrightarrow \text{one true literal in the clause}.

The construction uses the complement relationship between Vertex Cover and Independent Set as an additional perspective. For any graph G=(V,E)G=(V,E),

S is an independent set    VS is a vertex cover.S \text{ is an independent set} \iff V\setminus S \text{ is a vertex cover}.

This relationship is often useful when designing or checking graph reductions.

Footnotes

  1. NP-Complete Problems lecture notes - Relationship among Independent Set, Vertex Cover, and polynomial reductions.

Detailed Questions and Answers

Proof Checklist

For a polished NP-completeness proof, explicitly state: source problem, target construction, output size, polynomial running time, forward implication, reverse implication, and target membership in NP.

Polynomial Reductions and Vertex Cover

1 / 8
Question · Term

What does A ≤p B mean?

Click to reveal
Answer · Definition

There is a polynomial-time function f such that x is a yes-instance of A exactly when f(x) is a yes-instance of B.

Knowledge Check

Question 1 of 5
Q1Single choice

Which statement correctly defines a polynomial-time many-one reduction A ≤p B?