Comp 360: Algorithm Design (Fall 2017)
Lecture 13: NP and NP-Complete Problems
Instructor: Yang Cai
Basedon Kevin Wayne’sSlides.

Review: Polynomial-time Reduction

3
Polynomial-Time Reduction
Reduction.
Problem X
polynomial reduces to
problem Y if arbitrary
instances of problem X can be solved using:
n
Polynomial number of standard computational steps, plus
n
Polynomial number of calls to oracle that solves problem Y.
Notation.
X
≤
P
Y. We read this as “X is polynomial-time reducible to
Y” or “Y is at least as hard as X”.
Remarks.
n
We pay for time to write down instances sent to black box
⇒
instances of Y must be of polynomial size.
computational model supplemented by special piece
of hardware that solves instances of Y in a single step

4
Polynomial-Time Reduction
Purpose.
Classify problems according to
relative
difficulty.
Design algorithms.
If X
≤
P
Y and Y can be solved in polynomial-time,
then X can also be solved in polynomial time.
Establish intractability.
If X
≤
P
Y and X cannot be solved in polynomial-
time, then Y cannot be solved in polynomial time.
Establish equivalence.
If X
≤
P
Y and Y
≤
P
X, we use notation X
≡
P
Y.

5
Review
Basic reduction strategies.
n
Simple equivalence:
INDEPENDENT-SET
≡
P
VERTEX-COVER.
n
Special case to general case:
VERTEX-COVER
≤
P
SET-COVER.
n
Encoding with gadgets:
3-SAT
≤
P
INDEPENDENT-SET.
Transitivity.
If X
≤
P
Y and Y
≤
P
Z, then X
≤
P
Z.
Pf idea.
Compose the two algorithms.
Ex:
3-SAT
≤
P
INDEPENDENT-SET
≤
P
VERTEX-COVER
≤
P
SET-COVER
.

Definition of NP

7
Decision Problems
Decision problem.
n
The input to a computational problem encoded as a binary string.
n
X is a set of strings.
n
Instance:
string s.
n
Algorithm A solves problem X:
A(s) =
yes
iff s
∈
X.
Polynomial time.
Algorithm A runs in poly-time if for every string s, A(s)
terminates in at most p(|s|) "steps", where p(
⋅
) is some polynomial.
PRIMES
:
X = { 2, 3, 5, 7, 11, 13, 17, 23, 29, 31, 37, …. }
Algorithm.
[Agrawal-Kayal-Saxena, 2002]
p(|s|) = |s|
8
.
length of s

8
NP
Def.
Algorithm C(s, t) is a
certifier
for problem X if for every string s,
s
∈
X
iff there exists a string t such that C(s, t) =
yes
.
–
If C(s, t) =
yes,
then
s
∈
X.
–
If C(s, t) =
no,
doens’t mean s
∉
X . Maybe s
∉
X or s
∈
X but t is
not a correct certificate.
–
To make sure s
∉
X, need to make sure for any t, C(s, t) =
no.
NP.
Decision problems for which there exists a
poly-time
certifier.
C(s, t) is a poly-time algorithm and
|t|
≤
p(|s|) for some polynomial p(
⋅
).
"certificate" or "witness” or “proof”

9
NP
NP.
Decision problems for which there exists a
poly-time
certifier.

#### You've reached the end of your free preview.

Want to read all 30 pages?

- Winter '13
- AdrianRoshanVetta