80 likes | 230 Views
NP-Completeness. Section 7.1 Fri, Dec 9, 2005. Polynomial-Time Reductions. A function f : * * is polynomial-time computable if there exists a polynomially bounded Turing Machine that computes f .
E N D
NP-Completeness Section 7.1 Fri, Dec 9, 2005
Polynomial-Time Reductions • A function f : * * is polynomial-time computable if there exists a polynomially bounded Turing Machine that computes f. • A reduction from a language L1 to a language L2 is a polynomial reduction if it is polynomial-time computable.
Example • The Vertex Cover Problem (VC) is polynomial reducible to the Clique Problem (CLIQ). • Let (G, k) be in instance of CLIQ, where G = (V, E) is a graph and k is a nonnegative integer. • Create a graph G' = (V', E'): • V' = V. • eijE' if and only if eij E. • Let k' = n – k, where n is the number of vertices in G. • Then (G', k') is an instance of VC.
Example • Let be the function mapping (G, k) to (G', k'). • Theorem: The function is a reduction of CLIQ to VC. • Proof (): • Let (G, k) be an instance of CLIQ and let (G', k') = (G, k). • Suppose S V is a clique of size k in G. • We will show that S' = V – S is a vertex cover in G'. • Suppose that eij E'. • Then eij E, so vi or vj S. • Therefore, vi or vj S'. • Thus, eij is “covered” by a vertex in S'.
Example • Proof (): • Suppose S' V' is a vertex cover of size n – k. • Let vi and vj be vertices not in S', i.e., vi, vj S. • Then eij E'. • Therefore, eij E. • Thus, S is a clique of size k.
NP-Completeness • A language L is called NP-complete if • L is in NP, and • For every language L1 in NP, there is a polynomial reduction from L1 to L.
NP-Completeness • Theorem: Let L be NP-complete. Then P = NP if and only if L P. • That is, if a single NP-complete language can be shown to be decidable deterministically in polynomial time, then all problems that are decidable nondeterministically in polynomial time will be decidable deterministically in polynomial time.