Title: NP-complete Problems
1NP-complete Problems
Lecture 30
- Prof. Sin-Min Lee
- Department of Computer Science
2(No Transcript)
3(No Transcript)
4Decision Problems To keep things simple, we
will mainly concern ourselves with decision
problems. These problems only require a single
bit output yes'' and no''. How would you
solve the following decision problems? Is
this directed graph acyclic? Is there a
spanning tree of this undirected graph with
total weight less than w? Does this
bipartite graph have a perfect (all nodes
matched) matching? Does the pattern p
appear as a substring in text t?
5(No Transcript)
6P P is the set of decision problems that can be
solved in worst-case polynomial time If
the input is of size n, the running time must be
O(nk). Note that k can depend on the
problem class, but not the particular instance.
All the decision problems mentioned above are
in P. P Polynomial algorithms - These include
all the sorting algorithms we've seen, with
running times on the order of nlgn and n2.
Running times like n3 and 4, though considerably
slower, are also polynomial time.
7(No Transcript)
8(No Transcript)
9NP Technically speaking A problem is in
NP if it has a short accepting certificate.
An accepting certificate is something that we can
use to quickly show that the answer is yes''
(if it is yes). Quickly means in polynomial
time. Short means polynomial size. This
means that all problems in P are in NP (since we
don't even need a certificate to quickly show the
answer is yes''). But other problems in NP
may not be in P. Given an integer x, is it
composite? How do we know this is in NP?
10Good Guessing Another way of thinking of NP is
it is the set of problems that can solved
efficiently by a really good guesser. The
guesser essentially picks the accepting
certificate out of the air (Non-deterministic
Polynomial time). It can then convince itself
that it is correct using a polynomial time
algorithm. (Like a right-brain, left-brain sort
of thing.) Clearly this isn't a practically
useful characterization how could we build such
a machine?
11Exponential Upperbound Another useful property
of the class NP is that all NP problems can be
solved in exponential time (EXP). This is
because we can always list out all short
certificates in exponential time and check all
O(2nk) of them. Thus, P is in NP, and NP is in
EXP. Although we know that P is not equal to EXP,
it is possible that NP P, or EXP, or neither.
Frustrating! NP-hardness As we will see, some
problems are at least as hard to solve as any
problem in NP. We call such problems NP-hard.
How might we argue that problem X is at least
as hard (to within a polynomial factor) as
problem Y?
12 If X is at least as hard as Y, how would we
expect an algorithm that is able to solve X to
behave? NP-Completeness Basically, computer
scientists have used computer theory to prove
that some of the problems we want to solve are
members of a group of problems called
NP-Complete. A problem can be included in this
group by proving its similarity to other
problems in the group. By similarity, we mean
that if one member of the group can be solved in
polynomial time, we can translate the solution
appropriately to solve any other problem in the
group in polynomial time. So, this is a very
important group. A solution for any of these
problems that is polynomial proves that PNP
(not just P-NP-complete.)
13(No Transcript)
14Cook's Theorem The Satisfiability problem x
((AB)C)((ABC')C)(ABC') Can you assign boolean
(true or false) values to each of A, B, and C so
that x is true? If so, we say that the circuit
is 'satisfiable.' This circuit (which could also
be drawn with AND/OR/NOT gates) is unsatisfiable.
(Make sure you review how to draw an AND/OR/NOT
circuit from a boolean equation. You've usually
seen the equations written with x, y, and z
instead of A, B, and C.)
15(No Transcript)
16(No Transcript)
17(No Transcript)
18(No Transcript)
19(No Transcript)
20(No Transcript)
21(No Transcript)
22(No Transcript)
23(No Transcript)
24(No Transcript)
25(No Transcript)
26(No Transcript)
27(No Transcript)
28(No Transcript)
29(No Transcript)
30(No Transcript)
31(No Transcript)
32(No Transcript)
33(No Transcript)
34(No Transcript)
35(No Transcript)
36(No Transcript)
37(No Transcript)
38(No Transcript)
39(No Transcript)
40(No Transcript)
41(No Transcript)
42(No Transcript)
43(No Transcript)
44(No Transcript)
45(No Transcript)
46(No Transcript)
47(No Transcript)
48(No Transcript)
49(No Transcript)
50Implications of NP-Completeness Most people don't
believe that PNP, because so many computer
scientists have tried to solve so many of the
problems in the NP-Complete group of problems
that it's unlikely that they all weren't capable.
So, once you prove that a problem is NP-Complete,
conventional wisdom tells you to stop trying to
solve the problem.