CMSC 451: Reductions & NP-completeness: Slides By: Carl Kingsford
CMSC 451: Reductions & NP-completeness: Slides By: Carl Kingsford
Suppose:
• Y ≤P X , and
Why?
Polynomial Problems
Suppose:
• Y ≤P X , and Call X
Examples of Reductions:
Theorem
If Y ≤P X and Y cannot be solved in polynomial time, then X
cannot be solved in polynomial time.
Vertex Cover
Given a graph G and a number k, does G contain a vertex cover
of size at most k.
Independent Set to Vertex Cover
Independent Set
Given graph G and a number k, does G contain a set of at least k
independent vertices?
Vertex Cover
Given a graph G and a number k, does G contain a vertex cover
of size at most k.
Relation btw Vertex Cover and Indep. Set
Theorem
If G = (V , E ) is a graph, then S is an independent set ⇐⇒
V − S is a vertex cover.
Y2
If these hold, then X can be used to
solve every problem in NP.
NP
Theorem
If X is NP-complete, then X is solvable in polynomial time if and
only if P = NP.
Theorem
If Y is NP-complete, and
1 X is in NP
2 Y ≤P X
then X is NP-complete.
Set Cover
Given a set U of elements and a collection S1 , . . . , Sm of subsets of
U, is there a collection of at most k of these sets whose union
equals U?
Set Cover ∈ NP
Vertex Cover ≤P Set Cover
• U=E
• Create a Su for for each u ∈ V , where Su contains the edges
adjacent to u.
• Vertex Cover
• Independent Set
• Set Cover