CClasses NP
CClasses NP
Similarly one can also argue that one cannot start from V6 and form
a Hamilton Cycle.
Complexity Class-NP Polynomial Time Verification
NP-Completeness Verification Algorithms
If all the edges are present in the graph, then one conclude that this
sequence of vertices is a valid Hamilton path otherwise, we conclude
that this is an incorrect solution.
Complexity Class-NP Polynomial Time Verification
NP-Completeness Verification Algorithms
Lemma
If L ∈ P =⇒ L ∈ NP.
Proof.
Since L ∈ P, there exists and algorithm A which decides L in
polynomial time.
Four options are based on whether NP and co-NP are equal or not.
If NP and co-NP are equal, then we have the first two possibilities,
otherwise there exist certain problems which lie in both NP and
co-NP, so the last two possibilities capture the cases when NP and
co-NP have non-empty intersection.
Complexity Class-NP
Definition
NP-Completeness
x ∈ L1 ⇐⇒ f (x) ∈ L2
f is called the reduction function and the algorithm which computes
f (x) is called the reduction algorithm. The notation L1 ≤P L2
conveys that complexity of L1 is at most (≤) complexity of L2 and
some polynomial term.
Complexity Class-NP
Definition
NP-Completeness
Theorem
If L1 , L2 ⊆ {0, 1}∗ are languages such that L1 ≤P L2 , then L2 ∈ P
implies L1 ∈ P.
A language L ⊆ 0, 1∗ is NP-complete if
1. L ∈ NP
2. L′ ≤P L for every L′ ∈ NP
If a language L satisfies property 2, but not necessarily property 1,
we say that L is NP-hard.
Complexity Class-NP
Definition
NP-Completeness
Theorem
If any NP-complete problem is polynomial-time solvable, then
P = NP. Equivalently, if any problem in NP is not polynomial-time
solvable, then no NP-complete problem is polynomial-time solvable.
Proof.
Suppose that L ∈ P and also that L ∈ NPC . For any L′ ∈ NP, we
have L′ ≤P L by property 2 of the definition of NP-completeness.
Thus, by the previous theorem, we also have that L′ ∈ P, which
proves the first statement of the theorem. The second statement is
just the contrapositive of the first statement.