*This preview shows
pages
1–3. Sign up to
view the full content.*

CS180 Fall 2009
Discussion 5: NP-Completeness
Intuitively, what constitutes a hard problem?
•
It is
possible
to solve.
•
When you see the answer, you are able to recognize it quickly.
•
No one seems to know how to solve it eﬃciently.
Let’s have some deﬁnitions.
NP
is a set of problems in Computer Science. In other classes, you were given a problem and
asked to solve it. Now I’m going to give you a problem and the solution, and I want you to write
a function that
veriﬁes
that my answer is correct. If you can verify my solution eﬃciently (that
is, in polynomial time), the problem is in
NP
, even if you have no idea how to come up with the
answer in the ﬁrst place. Maybe it was a “lucky guess” on my part.
NP
-Complete are the “hardest” of these. Not only are they in
NP
, but we can prove something
about their solutions. If you can solve it eﬃciently – not just verify a solution, but produce one –
then you can solve every other problem in
NP
eﬃciently.
In 1971, Cook and Levin proved that there is such a thing as an
NP
-Complete problem. The proof
is very elaborate and outside the scope of this class. The key beneﬁt of Cook’s proof is that it
makes it easier for you to show that other problems are
NP
-Complete.
To show a problem
Y
is
NP
-Complete, do the following three steps:
1.
Y
∈
NP
.
2. Choose a problem
X
that is known to be
NP
-Complete.
3. Prove that
X
≤
p
Y
.
1

This ** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*A note about decision and optimization
Most
NP
-Complete problems we discuss here are written as boolean problems: they are asked to
make a decision, yes or no, as to whether a problem is solvable in a given way. As such, they are

This is the end of the preview. Sign up
to
access the rest of the document.