Professional Documents
Culture Documents
1 / 18
Complexity
Introduction
2 / 18
Complexity
Size of a Problem
Size of a Problem P: in most cases, it is equivalent to the number of input
values that define an instance of P.
Example: the Knapsack Problem has input data:
n (number of objects),
W (knapsack capacity),
(pj ) profit vector with n values,
(wj ) weight vector with n values.
The global number of values needed to represent the input data of an
instance of the Knapsack Problem is given by (2n + 2).
To represent a value x, dlog xe bits are needed.
The number of bits needed to represent the input data
Pnof an instance of
the Knapsack Problem is given by dlog ne, dlog W e, j=1 dlog pj e,
Pn
j=1 dlog wj e.
We can assume to use, for all values, the number of bits required by the
largest value: (2n + 2) ∗ dlog (max{n, W , p1 , . . . , pn , w1 , . . . , wn })e
For sufficiently large n, the size of the problem is proportional to n.
3 / 18
Complexity
4 / 18
Complexity
Computational Complexity
5 / 18
Complexity
6 / 18
Complexity
Polynomial Problems
8 / 18
Complexity
Classes P and N P
9 / 18
Complexity
Class N P
10 / 18
Complexity
11 / 18
Complexity
12 / 18
Complexity
Classification
13 / 18
Complexity
N P-Complete Problems
14 / 18
Complexity
Given
m positive values (aj ) (j = 1, . . . , m),
a positive value b
determine if there exists a subset of the m values whose sum is equal to
b.
It is a Feasibility Problem with size m
The Partition Problem is known to be N P-Complete
15 / 18
Complexity
16 / 18
Complexity
ILP and LP
17 / 18
Complexity
P versus N P
18 / 18