complements of languages in np
DESCRIPTION
Complements of Languages in NP. Osama Awwad Department of Computer Science Western Michigan University October 20, 2014. 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 - PowerPoint PPT PresentationTRANSCRIPT
Complements of Languages in NP
Osama Awwad
Department of Computer Science
Western Michigan University
April 20, 2023
Complement classes
In general, if C is a complexity class co-C is the complement class, containing
all complements of languages in CL C implies (* - L) co-C(* - L) C implies L co-C
Some classes closed under complement:e.g. co-P = P
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.
Co-NP
NPNP (nondeterministic polynomial-time): (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-NPCo-NP: The set of languages whose complements are in NP
• Does G have nono 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
qaccept qreject
x L x L
qacceptqreject
x Lx L
Can we transform this machine:
into this machine?
Is it true that CoNP = NP?
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
NP-Complete and Co-NP
Co-NP NP
P
NPCCo-NPC
NP-Complete and Co-NP
Theorem NP=co-NP if and only if the complement of some NP-complete problem is in NP.
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 Pc is in NP For each L in NP, there is a polynomial-time reduction of L to P Lc is polynomial reducible to Pc
_ Lc is in NP