Proof that vertex cover is NP complete
Last Updated :
07 Feb, 2025
Given a graph G(V, E) and a positive integer k, the problem is to determine whether there exists a subset V’ of vertices with at most k vertices such that every edge in the graph is connected to at least one vertex in V’.
Explanation
To understand the proof, we first define what an instance of a problem means. An instance is simply an input to the given problem. In this case, an instance of the Vertex Cover problem consists of a graph G(V, E) and a positive integer k. The goal is to check whether a vertex cover of size at most k exists in G.
By definition, an NP-Complete problem is one that is both in NP and NP-Hard. Therefore, proving that Vertex Cover is NP-Complete consists of two parts:
- Proof that Vertex Cover is in NP
- Proof that Vertex Cover is NP-Hard
Proof that Vertex Cover is in NP
A problem is in NP if, given a solution (also called a ‘certificate’) and an instance of the problem, we can verify the correctness of the solution in polynomial time.
For the Vertex Cover problem, the certificate is a subset V’ of V, which represents the vertex cover. To check whether V’ is a valid vertex cover of size at most k, we can use the following strategy:
let count be an integer
set count to 0
for each vertex v in V’
remove all edges adjacent to v from set E
increment count by 1
if count = k and E is empty
then
the given solution is correct
else
the given solution is incorrect
Since this verification process runs in polynomial time, the Vertex Cover problem belongs to NP.
Proof that Vertex Cover is NP-Hard
To prove that Vertex Cover is NP-Hard, we reduce a known NP-Hard problem to Vertex Cover. We use the Clique Problem, which is already proven to be NP-Complete (hence also NP-Hard).
Definition of Clique Problem: In graph theory, a clique is a subset of vertices such that every pair of vertices is connected by an edge.
Here, the problem is to determine whether a clique of size k exists in a given graph G(V, E).
Reduction from Clique Problem to Vertex Cover
To show that any instance of the Clique Problem can be reduced to an instance of the Vertex Cover Problem, we proceed as follows:
1. Construct Graph Complement:
- Given a graph G(V, E), construct G’ (the complement of G).
- G’ consists of all edges not in G, but present in a complete graph on the same set of vertices.
2. Equivalence of the Two Problems:
- Finding a clique of size k in G is equivalent to finding a vertex cover of size |V| – k in G’.
Forward Proof (Clique → Vertex Cover)
- Assume there is a clique of size k in G.
- Let V’ be the set of vertices forming the clique.
- In G’, at least one vertex of each edge must belong to V – V’ to cover all edges.
- This means V – V’ forms a vertex cover of size |V| – k in G’.
Backward Proof (Vertex Cover → Clique)
- Assume there exists a vertex cover of size |V| – k in G’.
- The remaining k vertices (not in the vertex cover) must form a clique in G, since all their edges exist in G.
Thus, we have shown that finding a clique of size k in G is equivalent to finding a vertex cover of size |V| – k in G’.
Since the Clique Problem is NP-Complete, and we have successfully reduced it to the Vertex Cover Problem, we conclude that Vertex Cover is NP-Hard.
Thus, we can conclude the following:
- We have proven that Vertex Cover is in NP by showing that a given solution can be verified in polynomial time.
- We have proven that Vertex Cover is NP-Hard by reducing the Clique problem to the Vertex Cover problem.
- Since Vertex Cover is both NP and NP-Hard, it is NP-Complete.
To understand the proof, consider the following example graph and its complement:

See for – Proof that Hamiltonian Path is NP-Complete
Similar Reads
Proof that SAT is NP Complete
SAT Problem: SAT(Boolean Satisfiability Problem) is the problem of determining if there exists an interpretation that satisfies a given boolean formula. It asks whether the variables of a given boolean formula can be consistently replaced by the values TRUE or FALSE in such a way that the formula ev
3 min read
Set cover is NP Complete
Problem: Given a ground Set X, an integer k, and a collection of subsets Si of X, the problem is to identify if there exists a collection of subsets whose union is X, with size at most k. Proof: An instance of the problem is an input specified to the problem. An instance of the Set Cover problem is
3 min read
Proof that 4 SAT is NP complete
4-SAT Problem: 4-SAT is a generalization of 3-SAT(k-SAT is SAT where each clause has k or fewer literals). Problem Statement: Given a formula f in Conjunctive Normal Form(CNF) composed of clauses, each of four literals, the problem is to identify whether there is a satisfying assignment for the form
3 min read
Proof that MAX-SAT is NP Complete
Prerequisite: NP-Completeness, NP Class, SAT Problem: The MAX-SAT problem which is built on top of SAT(Boolean Satisfiability Problem) problem takes a boolean formula in conjunctive normal form with m clauses, n literals and input variable g where g ⤠m. If such an assignment exists, the result is a
5 min read
Proof that Hamiltonian Cycle is NP-Complete
Prerequisite: NP-Completeness, Hamiltonian cycle. Hamiltonian Cycle: A cycle in an undirected graph G=(V, E) traverses every vertex exactly once. Problem Statement: Given a graph G=(V, E), the problem is to determine if graph G contains a Hamiltonian cycle consisting of all the vertices belonging to
4 min read
Prove that KITE is NP-Complete
Prerequisite: NP-Completeness, NP Class, Clique Problem: Given an undirected graph G = (V, E) and an integer K, determine if there is a kite subgraph of size 2K which consists of a clique of size K with a K-size tail. Demonstrate that it is an NP-Complete. Explanation: A KITE is a graph on an even n
5 min read
Proof that Almost-SAT is NP Complete
Prerequisite: NP-Completeness, NP Class, SAT Problem- The Almost-SAT problem which is built on top of SAT(Boolean Satisfiability Problem) problem takes a boolean formula in conjunctive normal form with m clauses as input. If such an assignment exists, the result is an assignment of the literals such
5 min read
Proof that NAE-4-SAT is NP Complete
Problem Statement: Given a 4-CNF formula f, the task is to check if there is every clause such that at least one literal is TRUE and the other is FALSE. Explanation: An instance of the problem is an input specified to the problem. An instance of the NAE-4-SAT Problem is a boolean 4-CNF formula. Sinc
4 min read
Set partition is NP complete
Set partition problem: Set partition problem partitions an array of numbers into two subsets such that the sum of each of these two subsets is the same. Let S be a set of numbers and A is a subset of numbers with sum S1, then there exists another subset containing the remainder of the elements (S -
4 min read
Prove that Sparse Graph is NP-Complete
Prerequisite: NP-Completeness, NP Class, Sparse Graph, Independent Set Problem: Given graph G = (V, E) and two integers a and b. A set of a number of vertices of G such that there are at most b edges between them is known as the Sparse Subgraph of graph G. Explanation: Sparse Subgraph problem is def
4 min read