Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 2670 Introduction to Theory of Computing

Similar presentations


Presentation on theme: "CSCI 2670 Introduction to Theory of Computing"— Presentation transcript:

1 CSCI 2670 Introduction to Theory of Computing
November 22, 2005

2 Agenda Last week Today The Class P The Class NP More on the class NP
November 22, 2005

3 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

4 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 uV’ or vV’ November 22, 2005

5 Vertex cover November 22, 2005

6 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

7 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

8 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

9 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

10 What we know NP P coNP November 22, 2005

11 What we don’t know Are there any problems here? NP P coNP
November 22, 2005

12 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

13


Download ppt "CSCI 2670 Introduction to Theory of Computing"

Similar presentations


Ads by Google