Title: Approximation Algorithms
1Approximation Algorithms
Monaldo Mastrolilli IDSIA, Lugano (Switzerland)
2Optimization Problems
Instance I Length of description In Goal
minimize objective function gt Opt(I)
3a-Approximation algorithm
- A(I) solution value
- A(I) a Opt(I) for all instances
- running time polynomial in I
- a worst-case approximation ratio
- a gt 1 Good a close to 1
4PTAS Polynomial Time Approximation Scheme
- Family Aeegt0 of (1e)-approximation algorithms
- running time polynomial in I
- ok exponential in 1/e e.g. O(I1/e)
FPTAS Fully PTAS running time also polynomial in
1/e e.g. O(I/e3)
5Strongly and Weakly NP-hard
- If a problem is NP-hard even if the input is
encoded in unary, then it is called strongly
NP-hard NP-hard in the strong sense unary
NP-hard - If a problem is polynomially solvable under a
unary encoding, then it is solvable in
pseudo-polynomial time.
weak sense
strong sense
6Complexity Classes Relationships
7Approximation Algorithms
- Non-constant worst-case ratio
- Graph coloring O(n1/2-e)
- Total flow time O(n1/2)
- Set covering O(log n)
- Constant worst-case ratio
- TSP with triangle-inequalities 3/2
- Max Sat 1.2987
- FPTAS
- Makespan on 2 machines
8The first Approximation Algorithm (Graham 66)
PCmax Makespan minimization on m identical
machines (strongly NP-hard)
I m identical machines n jobs with lengths
p1, p2, , pn
9List-Scheduling (LS)
LS schedule jobs in any given order to the
first available (i.e. idle) machine
List J1, J2 , J3 , J4 , J5 , J6
10LS Analysis
11LS Analysis
12LS Analysis
Th LS is a (2-1/m)-approximation algorithm.
The approximation ratio is tight. Example p1
p2 1 and p3 2
13Worst vs. Average Case
Assumption processing times are
independently and uniformly distribuited in 0..b
14Linear Programming based approximation algorithms
IDEA
15Example R2Cmax
R2Cmax Makespan minimization on 2 unrelated
machines (weakly NP-hard)
- I 2 unrelated machines n jobs
- Job j has length
- p1j on machine M1
- p2j on machine M2
16Integer Linear Program (ILP)
17LP relaxation
18Number of fractional jobs
Known a basic optimal LP solution has the
property that the number of variables that get
positive values is at most the number of rows in
the constraint matrix gt n2
Since Cmax is always positive at most n1 of the
xij variables are positive
Every job has at least one positive variable
associated with it.
At most 1 job has been split onto two machines !!
19Rounding
J5 fractional
20How to get a PTAS
IDEA add more structure (depending on e)
as e-gt0, additional structure -gt 0
21Structuring the Input
22Example P2Cmax
P2Cmax Makespan minimization on 2 identical
machines (weakly NP-hard)
I 2 identical machines n jobs with lengths
p1, p2, , pn
23How to round the input
pj gt e LB big
pj pj
pj e LB small
24Rounded Instance I
- Recall that S pj 2LB
- How many big jobs ?
- a big job has pj gt e LB gt (big) 2/e
- How many small jobs ?
- A small job has pj e LB gt (small) 2/e
The rounded instance has a constant(e) number of
jobs. gt optimal solution in constant time!!
25Back to a feasible solution
small
26Back to a feasible solution (ctd)
Cmax Opt eLB (1e) Opt
27How much error is introduced?
Cmax Opt e LB Opt Opt e LB
Cmax Opt 2e LB (12e) Opt
?
28Opt vs. Opt
29Structuring the execution of an algorithm
IDEA take an exact but slow algorithm A and
interact with it while it is working. Clean-up
part of its memory. As a result the algorithm
becomes faster (less data to process) and
generates incorrect output. IDEAL CASE the time
complexity becomes polynomial and the incorrect
output is a good approximation Compare tabu
search vs. branch bound
30Example R2Cmax
- Exact Algorithm (Dynamic Program)
- Encode a partial schedule for the first k jobs by
a vector (state) a, b - a total processing time on M1
- b total processing time on M2
- Assign job one by one and update the states
appropriately
31Dynamic Program
S0 0,0 For k1 to n do Sk For
all a, b in Sk-1 do add the two states a
p1k, b and a, b p2k to Sk End For End
For Output min maxa, b a, b in Sn
32Dynamic Program
S0 0,0 For k1 to n do Sk For
all a, b in Sk-1 do add the two states a
p1k, b and a, b p2k to Sk End
For CLEAN UP SK End For Output min maxa, b
a, b in Sn
33State Space Sk
P Sj minp1j, p2j State space in PxP box
D (1e)1/n D, D2, D3,...
34Clean up Sk
P Sj minp1j, p2j State space in PxP box
D (1e)1/n D, D2, D3,...
35Running Time
The running time is n times the number of
boxes. The number of boxes is at most (b1)2
where Db P Therefore blog(P) / log(D) Since D
(1e)1/n then b n log(P) /log(1e) n
log(P) (1e)/e
36How much error is introduced by clean up?
Clean up replaces state a,b by another state
a,b in the same box a/D a aD b/D b
bD Therefore gt error D There are n clean
up, and each clean up has error D gt Overall
error Dn 1e
37In-Approximability Techniques
38How do we disprove the existence of a PTAS?
MAIN IDEA Prove that the existence of a
polynomial time approximation algorithm for
problem X with worst case guarantee better than a
implies the existence of an exact polynomial
time algorithm for an NP-hard problem
Y implies PNP
39Main Techniques
FPTAS Strong NP-hardness gt no
FPTAS PTAS Gap-technique gt no
PTAS (MAX-SNP-hardness gt no PTAS)
40Disproof of an FPTAS
PCmax Makespan minimization on m identical
machines
I m identical machines n jobs with lengths
p1, p2, , pn
- Assume p1, p2, , pn are integers encoded in
unary (e.g., p13 write p1111) - Known PCmax is NP-hard even under unary
encoding - P S pj polynomial in size of input
- Opt P and Opt is an integer 0, 1, 2, , P
41Disproof of an FPTAS (ctd)
A(I) (1e)Opt (1 1/2P) Opt Opt 1/2 gt
A(I) lt Opt 1 gt A(I)Opt gt PNP !!
42The Gap Technique
IDEA Let X be a minimization with integral
objective function values (costs). Let g be a
fixed integer. Assume that the problem of
deciding whether an instance of X has a feasible
solution with cost at most g is NP-hard. Then X
does not have an approximation algorithm with
ratio a lt (g 1)/g, unless PNP.
43The Gap Technique (ctd)
- Assume for any instance I it exists an
a-approximation algorithm A with a lt (g 1)/g. - If Opt(I) g then A(I) a g lt g 1
gt YES - If Opt(I) gt g 1 then A(I) gt g 1
gt NO
44Example
Problem (bin packing or scheduling wih deadline)
Input n jobs with lengths p1, p2, , pn and a
hard deadline d Goal find the minimum number m
of machines on which all jobs can be completed
before their deadline d.
45Example (ctd)
THEOREM. Deciding if m 2 is NP-hard. PROOF
(use partition).
Gap Technique
For the Bin packing problem no a -approximation
algorithm is possible with a lt 3/2 ( no PTAS!),
unless PNP.
46References
- Books and Tutorials
- Ausiello et al. (1999), Complexity and
Approximation, Springer. - D.S. Hochbaum (eds), (1995), Approximation
Algorithms for NP-hard Problems, PWS. - R. Motwani and P. Raghavan (1995), Randomized
Algorithms, Cambridge. - P. Schuurman and G. Woeginger (2001),
Approximation Schemes - A Tutorial.
Conferences STOC, FOCS, SODA, ESA, ICALP, IPCO,
STACS, SWAT, WADS, FSTTCS,APPROX, RANDOM, ISAAC,
FCT, MFCS, COCOON, LATIN,...