CSCI 2670 Introduction to Theory of Computing November 22, 2005
Agenda Last week Today The Class P The Class NP More on the class NP November 22, 2005
Solving vs. verifying What if we can’t solve the problem in O(nk) time? Given a problem and a potential solution, can we verify the solution is correct? November 22, 2005
Example The vertex cover problem Given a graph G = <V,E> and a number k in N, does there exist a subset V’ of V such that |V’| = k For every (u,v)E, either uV’ or vV’ November 22, 2005
Vertex cover November 22, 2005
The vertex cover problem There is no known polynomial solution to the vertex cover problem What if we have a potential solution Can we verify it in O(nk) time? November 22, 2005
Verifier M = “On input <V,E,k,V’> If |V’| ≠ k, reject For each vertex v in V’ For each edge (u,w) in E If u = v or w=v, mark (u,w) If (u,w) is not marked, reject Accept” M accepts <V,E,k,V’> if and only if |V’| = k and every edge in E has at least one endpoint in V’ Computational complexity? O(|V’|×|E|) November 22, 2005
A={w|V accepts <w,c> for some string c} The class NP Definition: A verifier for a language A is an algorithm V, where A={w|V accepts <w,c> for some string c} The string c is called a certificate of membership in A. Definition: NP is the class of languages that have polynomial-time verifiers. These problems have polynomial-time solutions on nondeterministic TM’s. November 22, 2005
Is NP closed under complementation? For example, can we verify in polynomial time that a graph cannot be 3-colored? Not obviously It seems we need to check many 3-colorings before we can conclude that none exist The 3-coloring problem is in coNP November 22, 2005
What we know NP P coNP November 22, 2005
What we don’t know Are there any problems here? NP P coNP November 22, 2005
Solving NP problems The best-known methods for solving problems in NP that are not known to be in P take exponential time Brute force search We don’t know if NP is actually in a smaller complexity class November 22, 2005