NP-Completeness. More Reductions. Definitions. P: is the class of all decision problems which can be solved in polynomial time, O(n ^ k) for some constant k. For example MST ∈ P but HC is not known (and suspected not) to be in P.
NP-hard does not mean that it is hard to solve
The first graph is Non-Hamiltonian, second is Hamiltonian
No known algorithm to solve Hamiltonian Cycle Problem (HC)
We can however check whether a given cycle is Hamiltonian
(i) V ‘ is a clique of size k for the complement, G’
(ii) V’ is an independent set of size k for G
(iii) V − V ‘ is a vertex cover of size n − k for G
Theorem: CLIQUE is NP-complete.
1. CLIQUE ∈NP: The certificate consists of the k vertices in the clique. Given such a certificate we can easilyverify in polynomial time that all pairs of vertices in the set are adjacent.
2. IS <= CLIQUE: We want to show that given an instance of the IS problem (G,k), we can produce an equivalentinstance of the CLIQUE problem in polynomial time. The reduction function f inputs G and k, andoutputs the pair (G’, k). Clearly this can be done in polynomial time. By the above lemma, this instance isequivalent.
1. VC ∈ NP: The certificate consists of the k vertices in the vertex cover. Given such a certificate we can easilyverify in polynomial time that every edge is incident to one of these vertices.
2. IS <= VC: We want to show that given an instance of the IS problem (G, k), we can produce an equivalentinstance of the VC problem in polynomial time. The reduction function f inputs G and k, computes thenumber of vertices, n, and then outputs (G, n − k).Clearly this can be done in polynomial time. By thelemma above, these instances are equivalent.
is transformed to :
2. satisfying assignment k-clique: If we have a satisfyingassignment, then we canchoose one literal in each clause that is true. Those literals form a clique in the graph.
Graph with k nodes
3CNF with k clauses
TRUE or FALSE
Max. Clique size
Smallest VC S
Largest IS V \ S