The Theory of NP-Completeness: Tractable and Intractable Problems NP-complete Problems
The Theory of NP-Completeness: Tractable and Intractable Problems NP-complete Problems
NP 2
Classifying problems
Classify problems as tractable or intractable.
Problem is tractable if there exists at least one
polynomial bound algorithm that solves it.
An algorithm is polynomial bound if its worst case
growth rate can be bound by a polynomial p(n) in the
size n of the problem
Intractable problems
Problem is intractable if it is not tractable.
All algorithms that solve the problem are not
polynomial bound.
It has a worst case growth rate f(n) which cannot be
bound by a polynomial p(n) in the size n of the
problem.
For intractable problems the bounds are:
f ( n) c n , or n log n , etc.
NP 4
NP 5
Intractable problems
Turing showed some problems are so hard that no
algorithm can solve them (undecidable)
Other researchers showed some decidable problems
from automata, mathematical logic, etc. are intractable:
Halting Problem
Presburger Arithmetic
and
Presburger Arith.
are in here
No problem is known
for certain to be in
here
NP
P
NP 6
NP 7
NP 8
NP 10
Decision Problems
A decision problem answers yes or no for a given
input
Examples:
Given a graph G Is there a path from s to t of
length at most k?
Does graph G contain a Hamiltonian cycle?
Given a graph G is it bipartite?
NP 11
NP 12
NP 13
NP 14
NP 15
The class P
P is the class of decision problems that are
polynomial bounded
Is the following problem in P?
Given a weighted graph G, is there a spanning
tree of weight at most B?
The decision versions of problems such as shortest
distance, and minimum spanning tree belong to P
NP 17
NP 18
Verification Algorithms
A verification algorithm, takes a problem instance x
and answers yes, if there exists a certificate y such
that the answer for x with certificate y is yes
Consider HAMILTONIAN-CYCLE
A problem instance x lists the vertices and edges of
G: ({1,2,3,4}, {(3,2), (2,4), (3,4), (4,1), (1, 3)})
There exists a certificate y = (3, 2, 4, 1, 3) for which
the verification algorithm answers yes
4
1
3
2
NP 19
NP 22
NP 23
The class NP
NP is the class of decision problems for which there
is a polynomial bounded verification algorithm
It can be shown that:
all decision problems in P, and
decision problems such as traveling salesman,
knapsack, bin pack, are also in NP
NP 24
NP 25
Polynomial reductions
Motivation: The definition of NP-completeness uses
the notion of polynomial reductions of one problem
to another problem written as
NP 27
Polynomial reductions
tran is a polynomial reduction from to if:
1. tran can be computed in polynomial bounded time
2. The answer to for input x is yes if and only if the
answer to for input tran(x) is yes.
x
tran
tran(x)
Algorithm
for B
yes or no
Algorithm for A
NP 28
NP 29
Is there a transformation?
Can we transform an instance of into an instance of
Yes.
tran(x)
for ( j =1; j =< n; j ++)
if (xj == true)
ij=1
else // xj=false
ij = 0
T(false, false, true, false)= 0,0,1,0
Is this transformation polynomial bounded? yes
NP 30
NP 32
Polynomial reductions
Theorem:
If and is in P, then is in P
If A is not in P then B is also not in P
NP 33
NP-complete problems
A problem is NP-complete if
1. It is in NP and
2. For every other problem A in NP,
A problem is NP-hard if
For every other problem A in NP,
NP 34
NP 35
NP 36
NP P
P = NP
NP-complete
NP-complete
P
The trival decision problem
that always answers
yes in here
Some Problem
is definitely in
here
NP 37
NP 38
NP 39
NP 40
NP 41
NP 42
NP 43