Download presentation
Presentation is loading. Please wait.
1
Complements of Languages in NP Osama Awwad Department of Computer Science Western Michigan University July 13, 2015
2
Complement classes In general, if C is a complexity class co-C is the complement class, containing all complements of languages in C L C implies ( * - L) co-C ( * - L) C implies L co-C Some classes closed under complement: e.g. co-P = P
3
Co-P = P Given a polynomial-time TM M for L, we can modify M to accept the complement of L as follows: Make each accepting state of M a nonaccepting state from which there are no moves. Thus, if M accepts, the new TM (L) will halt without accepting. Create a new state q, which is the only accepting state in the new TM. For each state-symbol combination that has no move, the new TM enters state q, whereupon it accepts and halts.
4
Co-NP NP (nondeterministic polynomial-time): NP (nondeterministic polynomial-time): class of problems for which, if the answer is yes, then there's a polynomial-size proof of that fact that you can check in polynomial time. Co-NP Co-NP: The set of languages whose complements are in NP
5
no Does G have no Hamiltonian cycle? Example Input: graph G=(V,E) Does G have a Hamiltonian cycle? Hamiltonian cycle: cycle visiting each vertex exactly once If G has a Hamiltonian cycle then let us take a promised Hamiltonian cycle – we can check if this is indeed one in O(n) time! Hamiltonian cycle is in NP
6
q accept q reject x L x L q accept q reject x Lx L Can we transform this machine: into this machine? Is it true that CoNP = NP?
7
Every language in P has its complement also in P, and therefore in NP. We believe that none of the NP-complete problems have their complements in NP. no NP-complete problem is in Co-NP. We believe the complements of NP-complete problems, which are by definition in Co-NP, are not in NP. NP-Complete and Co-NP
8
Co-NP NP P NPC Co-NPC
9
NP-Complete and Co-NP Theorem NP=co-NP if and only if the complement of some NP-complete problem is in NP.
10
Proof (Only if): Should NP and Co-NP be the same Every NP-complete problem L, being in NP, is also in co-NP The complement of a problem in Co-NP is in NP the complement of L is in NP (If) Let P be an NP-complete problem Suppose P c is in NP For each L in NP, there is a polynomial-time reduction of L to P L c is polynomial reducible to P c _ L c is in NP
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.