Proof that Vertex Cover is NP-Complete
The Vertex Cover problem is a classical problem in computer science and graph theory. It asks, given a graph ( G = (V, E) ) and an integer ( k ), whether there exists a subset ( V' \subseteq V ) of at most ( k ) vertices such that every edge in ( E ) is incident to at least one vertex in ( V' ). This subset ( V' ) is called a vertex cover of ( G ).
To prove that the Vertex Cover problem is NP-Complete, we'll follow these steps:
- Show that Vertex Cover is in NP.
- Demonstrate that Vertex Cover is NP-Hard by providing a polynomial-time reduction from a known NP-Complete problem.
- Conclude that Vertex Cover is NP-Complete.
1. Vertex Cover is in NP
A problem is in NP (nondeterministic polynomial time) if a proposed solution can be verified in polynomial time. For Vertex Cover:
- Certificate: A subset ( V' \subseteq V ) of vertices.
- Verification Process:
- Check the size: Verify that ( |V'| \leq k ).
- Edge Coverage: For each edge ( (u, v) \in E ), check whether ( u \in V' ) or ( v \in V' ).
Both steps can be performed in polynomial time:
- Checking the size takes ( O(1) ) time.
- Verifying edge coverage involves checking each edge, which takes ( O(|E|) ) time.
Since the verification process is polynomial in the size of the input graph, Vertex Cover is in NP.
2. Vertex Cover is NP-Hard
To prove that Vertex Cover is NP-Hard, we'll reduce a known NP-Complete problem to it in polynomial time. We'll use the 3-Satisfiability (3-SAT) problem, which is a canonical NP-Complete problem.
Reduction from 3-SAT to Vertex Cover
Problem Statement of 3-SAT:
Given a boolean formula ( \phi ) in conjunctive normal form (CNF), where each clause has exactly three literals, determine if there exists a truth assignment to the variables that satisfies ( \phi ).
Objective:
Given an instance of 3-SAT, construct a graph ( G = (V, E) ) and an integer ( k ) such that ( \phi ) is satisfiable if and only if ( G ) has a vertex cover of size at most ( k ).
Construction Steps:
Let ( \phi ) be a 3-SAT formula with variables ( { x_1, x_2, \dots, x_n } ) and clauses ( { C_1, C_2, \dots, C_m } ).
-
Variable Nodes:
- For each variable ( x_i ), create two vertices labeled ( x_i ) and ( \neg x_i ).
- Add an edge between ( x_i ) and ( \neg x_i ) to enforce that at most one can be in the vertex cover.
-
Clause Nodes:
- For each clause ( C_j = (l_{j1} \lor l_{j2} \lor l_{j3}) ), create three vertices ( c_{j1}, c_{j2}, c_{j3} ).
- Connect these vertices to form a triangle: add edges ( (c_{j1}, c_{j2}), (c_{j2}, c_{j3}), (c_{j1}, c_{j3}) ).
- Each vertex ( c_{jk} ) corresponds to the literal ( l_{jk} ) in the clause.
-
Literal Edges:
- For each clause vertex ( c_{jk} ), add an edge between ( c_{jk} ) and the corresponding literal vertex:
- If ( l_{jk} ) is ( x_i ), add edge ( (c_{jk}, x_i) ).
- If ( l_{jk} ) is ( \neg x_i ), add edge ( (c_{jk}, \neg x_i) ).
Setting ( k ):
Set ( k = n + 2m ).
Explanation of the Construction:
Proof of Correctness
We need to show that ( \phi ) is satisfiable if and only if ( G ) has a vertex cover of size at most ( k ).
(⇒) If ( \phi ) is satisfiable, then ( G ) has a vertex cover of size ( k ).
Assume ( \phi ) is satisfiable. There exists a truth assignment to the variables such that all clauses are satisfied.
-
Variable Assignment:
- For each variable ( x_i ):
- If ( x_i = \text{True} ), include ( \neg x_i ) in the vertex cover.
- If ( x_i = \text{False} ), include ( x_i ) in the vertex cover.
- This covers the edge ( (x_i, \neg x_i) ).
- Total variable vertices in the cover: ( n ).
-
Clause Coverage:
- For each clause ( C_j ), since it is satisfied, at least one literal ( l_{jk} ) is true.
- The corresponding literal vertex (e.g., ( x_i ) if ( l_{jk} = x_i )) is not in the vertex cover (since its negation was included due to the truth assignment).
- Clause Vertex Inclusion:
- Include the two clause vertices not connected to the true literal's variable vertex.
- This covers all edges in the triangle:
- The edge connected to the true literal's variable vertex is covered because the variable vertex is included.
- The remaining two edges are covered by the two included clause vertices.
- Total clause vertices in the cover: ( 2m ).
Total vertices in the vertex cover: ( n + 2m = k ).
(⇐) If ( G ) has a vertex cover of size ( k ), then ( \phi ) is satisfiable.
Assume ( G ) has a vertex cover ( V' ) of size ( k = n + 2m ).
-
Variable Edges:
- For each variable edge ( (x_i, \neg x_i) ), at least one of ( x_i ) or ( \neg x_i ) must be in ( V' ).
- Including both would exceed ( k ).
- Assignment:
- If ( x_i \in V' ), assign ( x_i = \text{False} ).
- If ( \neg x_i \in V' ), assign ( x_i = \text{True} ).
-
Clause Triangles:
- Each triangle requires at least two vertices to be included in ( V' ) to cover its edges.
- If all three clause vertices were included, ( V' ) would exceed size ( k ).
- Therefore, exactly two clause vertices per triangle are in ( V' ).
-
Clause Satisfaction:
- For each clause ( C_j ):
- The clause vertices not in ( V' ) correspond to literals whose variable vertices are not in ( V' ).
- Since only one clause vertex is not in ( V' ), it corresponds to a literal ( l_{jk} ) such that the variable vertex for ( l_{jk} ) is not in ( V' ).
- From our assignment, this means the literal ( l_{jk} ) is assigned True.
- Thus, every clause has at least one literal assigned True, meaning ( \phi ) is satisfied.
3. Conclusion
Since we've shown:
- Vertex Cover is in NP.
- Vertex Cover is NP-Hard via a polynomial-time reduction from 3-SAT.
We conclude that Vertex Cover is NP-Complete.
Implications:
- The reduction is polynomial in time and size.
- The construction effectively transforms logical satisfiability into a graph-theoretical problem.
- This proof solidifies the complexity of the Vertex Cover problem, placing it among the class of problems that are believed to lack efficient (polynomial-time) solutions.
Note: While the above proof uses 3-SAT, it's worth noting that Vertex Cover can also be proven NP-Complete via reductions from other NP-Complete problems, such as Independent Set or Clique, due to the close relationships between these problems. However, the reduction from 3-SAT provides a clear and illustrative demonstration of the NP-Hardness of Vertex Cover.