Search Problems and coNP
Nabil Mustafa Computability and Complexity
Nabil Mustafa Search Problems and coNPDecision vs. Optimization
So far languages Lf defined by boolean function f x ∈ Lf ⇐ ⇒ f (x) = 1 Given G = (V , E), is G k-colorable? Given G = (V , E), does G have independent set of size k? Given a 3-CNF formula φ, is φ satisfiable? What about the corresponding search questions Given G = (V , E), compute a k-coloring of G Given G = (V , E), compute an independent set of size k in G Given 3-CNF formula, compute a satisfying assignment
Nabil Mustafa Search Problems and coNPExample
Let A = {a1, . . . , an} be a set of n distinct integers Poly-time function: IsItSorted(π(A)) = 1 iff π(A) is sorted Then, using IsItSorted(A), can one actually sort n numbers? First try: Given n numbers A = {a1, . . . , an} For each permutation π′ of A, check IsItSorted(π′(A)) Total calls to IsItSorted(A): n! A better try: Start with the sorted set A1 = a1 Check IsItSorted(A1 ◦ a2) and IsItSorted(a2 ◦ A1) Exactly one of the above has answer 1, say latter one Then set A2 = a2 ◦ a1 Adding similarly, the i-th element: i calls to IsItSorted Total calls: n
i=1 i = O(n2) Nabil Mustafa Search Problems and coNPGeneral Reduction from Search to Decision
Claim Assume P = NP . Then for every NP language L, there exists a poly-time TM that, on input x ∈ L, outputs a certificate for x. Proof. Recall the proof of the Cook-Levin theorem Take L and do the reduction to CNF satisfiability of φ . The possible transition rules followed during the computation
- f x translated into boolean variables Ri
Now assume we can find a satisfying assignment for φ Ri
t now tell us which rule was used at each step!This gives us the certificate for x ... assuming satisfiability
Nabil Mustafa Search Problems and coNP