Decision vs. Optimization So far languages L f defined by boolean - - PowerPoint PPT Presentation

decision vs optimization
SMART_READER_LITE
LIVE PREVIEW

Decision vs. Optimization So far languages L f defined by boolean - - PowerPoint PPT Presentation

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 ?


slide-1
SLIDE 1

Search Problems and coNP

Nabil Mustafa Computability and Complexity

Nabil Mustafa Search Problems and coNP

Decision 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 coNP

Example

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 coNP

General 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
t

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
slide-2
SLIDE 2

Computing Certificate for CNF Satisfiability

Claim Assume P = NP . Then there exists a poly-time TM to find a satisfying assignment for any formula φ. Proof. Lets assume the variables are x1, . . . , xn and formula φ Repeat the following for i = 1 . . . n: If SAT(φ(xi = 1, xi+1, . . . , xn)) = 1, set xi = 1 Else If SAT(φ(xi = 0, xi+1, . . . , xn)) = 1, set xi = 0 Else return failure. Number of calls to SAT: 2n

Nabil Mustafa Search Problems and coNP

Example

Independent Set problem Given G = (V , E) and an integer k, compute an independent set

  • f size k in G.

Black box: Given G = (V , E), does G have an independent set of size k? Solution: Find and remove useless nodes one by one Pick v and ask: Does G \ v have independent set of size k? If yes then v is useless so remove it from G If no, then v is in independent set. Keep v Repeat from step 1 until the remaining graph has no edges.

Nabil Mustafa Search Problems and coNP

Finding independent set

Concrete Example Compute independent set of size k = 2 in this graph. Answer: Yes

Nabil Mustafa Search Problems and coNP

Languages With No Short Certificate

L ∈ NP iff for each x ∈ L, ∃ poly-sized certificate u certifying the existence of x ∈ L. 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: Ω(2n) 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 in the language has a short certificate.

Nabil Mustafa Search Problems and coNP
slide-3
SLIDE 3

The Class coNP

Definition of coNP A language L ∈ coNP iff for every x / ∈ L, ∃u of size O(p(|x|)) and a poly-time TM M such that M(x, u) = 0. Definition coNP = {L : L ∈ NP } L ∈ coNP = ⇒ x / ∈ L has a short certificate Claim: SAT ∈ coNP

Nabil Mustafa Search Problems and coNP

Examples

No Hamiltonian Cycle Instance: A graph G Question: Does G have no Hamiltonian cycle? Tautology Instance: A CNF-formula f Question: Is f satisfied by all assignments?

Nabil Mustafa Search Problems and coNP

coNP is not complement of NP

Claim: coNP = {L : L / ∈ NP }

  • Incorrect. A language can be in both NP and coNP !

Claim: Any language in P is in NP and coNP Any language in P is in NP : Trivial. Any language in P is in coNP : L ∈ P = ⇒ TM M: M(x) = 1 ↔ x ∈ L Claim: L ∈ P M′(x) = 1 − M(x). Then M′(x) = 1 ↔ x ∈ L Hence L ∈ P and so L ∈ coNP Corollary: coP = P .

Nabil Mustafa Search Problems and coNP

coNP complete languages

Definition A language L is coNP complete iff

1 L ∈ coNP , and 2 Any L′ ∈ coNP can be reduced to L, denoted L′ ≤ L

Claim A language L is coNP complete iff L is NP complete. Proof. L is NP complete = ⇒ L is coNP complete Show: Deciding x ∈ L′ can be reduced to g(x) ∈ L Deciding x ∈ L′ can be reduced to x / ∈ L′ Deciding x / ∈ L′ can be reduced to g(x) / ∈ L Deciding g(x) / ∈ L can be reduced to g(x) ∈ L

Nabil Mustafa Search Problems and coNP
slide-4
SLIDE 4

coNP complete languages

Claim The language Tautology is coNP complete. Claim The language No Hamiltonian Path is coNP complete. Claim The language No Satisfiability is coNP complete.

Nabil Mustafa Search Problems and coNP

A Claim for coNP

Claim If L is coNP complete, and L ∈ NP , then coNP = NP Proof. L ∈ coNP and L ∈ NP L ∈ NP : x ∈ L has a short certificate L ∈ coNP : x / ∈ L has a short certificate L is coNP complete L is NP complete L′ ∈ NP = ⇒ L′ ∈ coNP : x / ∈ L′ has a short certificate x / ∈ L′ ⇐ ⇒ g(x) / ∈ L ⇐ ⇒ g(x) ∈ L L′ ∈ coNP = ⇒ L′ ∈ NP : x ∈ L′ has a short certificate x ∈ L′ ⇐ ⇒ g(x) ∈ L ⇐ ⇒ g(x) ∈ L

Nabil Mustafa Search Problems and coNP

Complexity Classes Scenery

Decidable coNP P

NP-complete coNP-complete

NP Undecidable

Nabil Mustafa Search Problems and coNP