Lecture 4: (ppt)

advertisement
Reconnect ‘04
LP-Based Approximation Algorithms
Cynthia Phillips
Sandia National Laboratories
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company,
for the United States Department of Energy under contract DE-AC04-94AL85000.
Linear Programming (LP) Relaxation-Based Approximation
• Variables can take rational values (relax integrality constraints)
• Efficiently solvable: gives lower bound on optimal IP solution
• Common technique:
– Use structural information from LP solution to find feasible IP solution
– Bound quality using LP bound
• Integrality gap = (best IP solution)/(best LP solution)
• This technique cannot prove anything better than integrality gap
Slide 2
Integer Program (IP) for capacitated network design
A simple IP for capacitated network design:
min

e C

e C
c ex e
uex e  d(C)  cutset C
x e  0,1
Where d(C) is the maximum demand di for any pair that crosses cut C
xe = 1 if edge e is selected
Slide 3
Knapsack Cover (KC) Inequalities
A
u(A) 
C
u
A
 D(C)
e A
residual D(A)  D  u(A)
uA (e)  min( ue ,D(A))
KC :
u
e C A
Slide 4
A
(e)x e  D(A)
Finding An Approximate Solution
Let

1 
A  e  E | x e  

2 
Set of edges at least half selected by LP
• Select all these edges

– Increases cost (for A) by factor of 2
• Now much meet demand D(A) = D - u(A) with rest of edges
Slide 5
Finding an Approximate Solutions
• Sort edge by ue
uA (e)  min (ue ,D(A))
if ue1  ue 2 then
uA (e1)  uA (e1 )
Consider the three cases
ue1  ue2  DA
ue1  DA  ue2
DA  ue1  ue2
Slide 6

Finding an Approximate Solution
xe = q/p rational
r is least common multiple of denominators so rxe integral for all e
Make 2rxe “copies” of xe
(convex multipliers will be 1/r)
Slide 7
Approximate solution for knapsack (gap 2)
• 2rxe copies of edge e, sorted by capacity
• Place in r buckets, round robin
e2 e2 e3 e3
e1 e1 e1 e1
e1
• No edge in any solution twice
Slide 8
e1
1
2
2rx e  r
xe 
e2
e2
All buckets are Feasible
ek4
<
ek2
<
ek3
e1
ek1
First Bucket (biggest)
u
A
e first
Slide 9
(e) 
Last Bucket (smallest)
u
A
e last
(e)  D(A)
All Buckets Feasible
u
Suppose
A
(e)  D(A)
e last
u
We have
A
e first

So
u
A
u
(e) 
A
e last
(e)  2D(A)

From total capacity:
u
A
e EA
 Contradicts KC inequality

Slide 10
(e)  D(A)
for all buckets
(e)x e  2rD(A)
Separation
Only have to satisfy KC inequality for

1 
A  e  E | x e  

2 
Add these cuts if violated till we get an LP solution where KC inequality

holds for it’s A.
Slide 11
Polynomial Time
Really only m+1 distinct solutions
e2 e2 e3 e3
e1 e1 e1 e1
Slide 12
e1
e1
e2
e2
A Scheduling Example
Given n jobs J1, J2, …, Jn
Job Ji has length pi, weight wi
Precedence constraints: J
J j mean Ji must finish before Jj starts
i
No preemption, one machine
Cj = completion time of job Jj
n
Goal: minimize
wC
j 1
j
j
NP-complete. We’ll get a 4-approximation
Slide 13
Integer Programming Formulation
1 if job J j completes at time t
x jt  
0 otherwise
n
maximize
T
  w tx
j 1 t p j
j
jt
T
Subject to
x
tp j
n t p j 1

j 1
t
x
u1
ju
u t
t  pk
jt
1
n
x ju  1
  x ku  0
t  1,...,T   pj
j 1
Ji
Jk , t  1,...,T  pk
u1
x jt 0,1
Slide 14
j
j  1,...,n; t  pj ,...,T
Constraint: One Job at a Time
n t p j 1

j 1
T-pj
u t
t-1
x ju  1
t
t+1
t+2
...
t+pj-1
t-1
Consider all (job, finish time) pairs that would run over (t-1, t]
Slide 15
Precedence Constraints
t
x
u1
t  pk
ju   x ku  0
Jj
Jk
u1
If job Jk finishes by time t + pk, then job Jj must finish by time t
Slide 16
LP relaxation, Fractional Schedule
xjt
pj
Slide 17
Fractional Schedule x*
Fractional Completion Time:
Midpoint: min t* such that
C *j 
T
*
tx
 jt
t  pj
t*
1
x 

2
tp j
*
jt
Slide 18
Approximation Algorithm
• Solve LP
• Compute midpoints for all jobs
• Order by midpoints
Slide 19
Approximate Schedule is feasible
• No preemption
• One job at a time
• Precedence constraints
t  pk
t
x
u1
ju
  x ku  0
u1
Midpoint of Jj < Midpoint of Jk
Slide 20
Jj
Jk
Proof of Quality Road Map
• Relate Cj to LP values
Renumber jobs by midpoint:
t1*  t2*  ...  t *n
We’ll show
C j  2t *j
and
*
t
C *j  j
2
 Cj  4C *j
 4 - approximation
Slide 21
Upper Bound on Completion Times
t
t-pj
xjt
• At time tj* fractional schedule has done pj/2 work.
• Since tk* tj* for k<j, schedule has done pk/2 work on Jk.
1 j
total   pk
2 k 1
j
1
• One unit of work/time unit 
t *j   pk
2 k 1
j
• But by construction
C j   pk
k 1
 Cj  2t *j
Slide 22
Lower Bound on LP values
t*j 1
• By definition:
1
x ju 

2
u p j
So
C 
T
 tx
*
j
jt
t p j
T
  txjt
t t *j
T
*
j
t t *j
t
x
1 *
 tj
2
Slide 23
jt
Proof of Quality
C j  2t *j
*
t
C *j  j
2
 Cj  4C *j
Therefore
w C
j
j
and
j
j
j
 4 wj C*j
 4 wj tx*jt
j
 4 * Optimal
Slide 24
Comments
• Can create alternative schedules using  point tj

t j  min t s.t.
t
x
t'  p j
jt '

• LP-based approximation algorithms can give feasible solutions in branch
and bound
• Other LP-based approximation algorithms for scheduling problems are
based on matching/assignment
Slide 25
Appendix
Slide 26
General Graphs
Let

1 
A  e  E | x e 

 (G)  1

…

…
.
.
.
…
Solutions: one bucket from each multiedge
Slide 27
Analysis for General Graphs
Consider cut C and
Ac  AC
• For each edge, maximum uA capacity difference is D(Ac).

• Cut from at most (G) multiedges (combination of buckets), so
maximum capacity difference between solutions is (G) D(Ac).
• By similar arguments, KC cut would be violated if any cut were
infeasible.
Slide 28
General Graphs - separation
• Check smallest bucket for feasibility (meeting all demand pairs)
• If cut C violated, add KC inequality:

1 
A  e  C | x e 

 (G)  1

• Don’t know (G)
– Run binary search with full algorithm

Slide 29
Some Additional Results
• Everything holds if edge e can be chosen b(e) times
 (G)
2

• Series-parallel graphs have integrality gap 
 2 
• Capacitated cover bound: max nonzeros in any row
• FPTAS for outerplanar graphs with one demand pair

• FPTAS to find approximately most violated KC inequality.
Slide 30
Download