Decision vs. Optimization So far languages L f defined by boolean function f Search Problems and coNP x ∈ L f ⇐ ⇒ f ( x ) = 1 Given G = ( V , E ), is G k -colorable? Nabil Mustafa Given G = ( V , E ), does G have independent set of size k ? Given a 3-CNF formula φ , is φ satisfiable? Computability and Complexity 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 coNP Nabil Mustafa Search Problems and coNP Example General Reduction from Search to Decision Claim Let A = { a 1 , . . . , a n } be a set of n distinct integers 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. Poly-time function: IsItSorted ( π ( A )) = 1 iff π ( A ) is sorted Then, using IsItSorted ( A ), can one actually sort n numbers? Proof. First try: Given n numbers A = { a 1 , . . . , a n } Recall the proof of the Cook-Levin theorem For each permutation π ′ of A , check IsItSorted ( π ′ ( A )) Take L and do the reduction to CNF satisfiability of φ . Total calls to IsItSorted ( A ): n ! The possible transition rules followed during the computation A better try: of x translated into boolean variables R i Start with the sorted set A 1 = � a 1 � t Check IsItSorted ( � A 1 ◦ a 2 � ) and IsItSorted ( � a 2 ◦ A 1 � ) Now assume we can find a satisfying assignment for φ Exactly one of the above has answer 1, say latter one R i t now tell us which rule was used at each step! Then set A 2 = � a 2 ◦ a 1 � Adding similarly, the i -th element: i calls to IsItSorted This gives us the certificate for x ... assuming satisfiability Total calls: � n i =1 i = O ( n 2 ) Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP
Computing Certificate for CNF Satisfiability Example Claim Independent Set problem Assume P = NP . Then there exists a poly-time TM to find a Given G = ( V , E ) and an integer k , compute an independent set satisfying assignment for any formula φ . of size k in G . Proof. Lets assume the variables are x 1 , . . . , x n and formula φ Black box: Given G = ( V , E ), does G have an independent Repeat the following for i = 1 . . . n : set of size k ? Solution: Find and remove useless nodes one by one If SAT ( φ ( x i = 1 , x i +1 , . . . , x n )) = 1, set x i = 1 Else If SAT ( φ ( x i = 0 , x i +1 , . . . , x n )) = 1, set x i = 0 Pick v and ask: Does G \ v have independent set of size k ? Else return failure. If yes then v is useless so remove it from G If no , then v is in independent set. Keep v Number of calls to SAT : 2 n Repeat from step 1 until the remaining graph has no edges. Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP Finding independent set Languages With No Short Certificate L ∈ NP iff for each x ∈ L , ∃ poly-sized certificate u certifying Concrete Example the existence of x ∈ L . Compute independent set of size k = 2 in this graph. Are there languages with no short certificate of acceptance? SAT : all formulae φ which have no satisfying assignment. Is SAT ∈ NP ? I.e., φ ∈ SAT have a short certificate? How do you certify that φ has no satisfying assignment? Possibility: list all assignments and show no satisfying one Certificate size: Ω(2 n ) On the other hand, if φ / ∈ SAT , the certificate? Just the condition of class NP Now define the set of languages where the non-existence of x Answer : Yes in the language has a short certificate. Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP
The Class coNP Examples Definition of coNP No Hamiltonian Cycle A language L ∈ coNP iff for every x / ∈ L , ∃ u of size O ( p ( | x | )) Instance: A graph G and a poly-time TM M such that M ( x , u ) = 0. Question: Does G have no Hamiltonian cycle? Definition coNP = { L : L ∈ NP } Tautology Instance: A CNF-formula f Question: Is f satisfied by all assignments? L ∈ coNP = ⇒ x / ∈ L has a short certificate Claim: SAT ∈ coNP Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP coNP is not complement of NP coNP complete languages Definition Claim: coNP = { L : L / ∈ NP } A language L is coNP complete iff 1 L ∈ coNP , and Incorrect. A language can be in both NP and coNP ! 2 Any L ′ ∈ coNP can be reduced to L , denoted L ′ ≤ L Claim: Any language in P is in NP and coNP Claim Any language in P is in NP : Trivial. A language L is coNP complete iff L is NP complete. Any language in P is in coNP : Proof. L ∈ P = ⇒ TM M : M ( x ) = 1 ↔ x ∈ L L is NP complete = ⇒ L is coNP complete Claim: L ∈ P Show: Deciding x ∈ L ′ can be reduced to g ( x ) ∈ L M ′ ( x ) = 1 − M ( x ). Then M ′ ( x ) = 1 ↔ x ∈ L Deciding x ∈ L ′ can be reduced to x / ∈ L ′ ∈ L ′ can be reduced to g ( x ) / Hence L ∈ P and so L ∈ coNP Deciding x / ∈ L Deciding g ( x ) / ∈ L can be reduced to g ( x ) ∈ L Corollary: coP = P . Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP
coNP complete languages A Claim for coNP Claim Claim If L is coNP complete, and L ∈ NP , then coNP = NP The language Tautology is coNP complete. Proof. L ∈ coNP and L ∈ NP L ∈ NP : x ∈ L has a short certificate Claim L ∈ coNP : x / ∈ L has a short certificate The language No Hamiltonian Path is coNP complete. L is coNP complete L is NP complete L ′ ∈ NP ⇒ L ′ ∈ coNP : x / ∈ L ′ has a short certificate = ∈ L ′ ⇐ x / ⇒ g ( x ) / ∈ L ⇐ ⇒ g ( x ) ∈ L Claim L ′ ∈ coNP ⇒ L ′ ∈ NP : x ∈ L ′ has a short certificate = The language No Satisfiability is coNP complete. x ∈ L ′ ⇐ ⇒ g ( x ) ∈ L ⇐ ⇒ g ( x ) ∈ L Nabil Mustafa Search Problems and coNP Nabil Mustafa Search Problems and coNP Complexity Classes Scenery Undecidable Decidable coNP NP P NP-complete coNP-complete Nabil Mustafa Search Problems and coNP
Recommend
More recommend