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 distributed in 0..b
14How to get a PTAS
IDEA add more structure (depending on e)
as e-gt0, additional structure -gt 0
15Structuring the Input
16Example P2Cmax
P2Cmax Makespan minimization on 2 identical
machines (weakly NP-hard)
I 2 identical machines n jobs with lengths
p1, p2, , pn
17How to round the input
pj gt e LB big
pj pj
pj e LB small
18Rounded 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!!
19Back to a feasible solution
small
20Back to a feasible solution (ctd)
Cmax Opt eLB (1e) Opt
21How much error is introduced?
Cmax Opt e LB Opt Opt e LB
Cmax Opt 2e LB (12e) Opt
?
22Opt vs. Opt
23Structuring 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
24Example 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
25Example 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
26Dynamic 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
27Dynamic 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
28State Space Sk
P Sj minp1j, p2j State space in PxP box
D (1e)1/n D, D2, D3,...
29Clean up Sk
P Sj minp1j, p2j State space in PxP box
D (1e)1/n D, D2, D3,...
30Running 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
31How 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
32In-Approximability Techniques
33How 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
34Main Techniques
FPTAS Strong NP-hardness gt no
FPTAS PTAS Gap-technique gt no
PTAS (MAX-SNP-hardness gt no PTAS)
35Disproof 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
36Disproof 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 !!
37The 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.
38The 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
39Example
Problem (bin packing or scheduling with
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.
40Example (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.
41References
- 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
(http//wwwhome.math.utwente.nl/woegingergj/paper
s.htm).
Conferences STOC, FOCS, SODA, ESA, ICALP, IPCO,
STACS, SWAT, WADS, FSTTCS,APPROX, RANDOM, ISAAC,
FCT, MFCS, COCOON, LATIN,...
42(No Transcript)
43(No Transcript)
44If there is time
45Linear Programming based approximation algorithms
IDEA
46Example R3Cmax
R3Cmax Makespan minimization on 3 unrelated
machines (weakly NP-hard)
- I 3 unrelated machines n jobs
- Job j has length
- p1j on machine M1
- p2j on machine M2
- p3j on machine M3
M1
M2
M3
Cmax
47Integer Linear Program (ILP)
48LP relaxation
49Number 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 n3
Since Cmax is always positive at most n2 of the
xij variables are positive
Every job has at least one positive variable
associated with it.
At most 2 jobs have been split!!
50Rounding
J5 fractional
J6 fractional
OptLP Opt
M1
J1
J4
J5
M2
J2
J3
J7
J8
J6
2Opt
Opt