chapter 8 pd-method and local ratio

48
Chapter 8 PD-Method and Local Ratio (5) Equivalence This ppt is editored from a ppt of Reuven Bar-Yehuda. Reuven Bar-Yehuda

Upload: amber

Post on 06-Feb-2016

54 views

Category:

Documents


0 download

DESCRIPTION

Chapter 8 PD-Method and Local Ratio. (5) Equivalence. This ppt is editored from a ppt of Reuven Bar-Yehuda. Reuven Bar-Yehuda. Introduction. The local ratio technique is an approximation paradigm for NP-hard optimization to obtain approximate solutions - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 8  PD-Method and  Local Ratio

Chapter 8 PD-Method and Local Ratio

(5) Equivalence

This ppt is editored from a ppt of Reuven Bar-Yehuda.

Reuven Bar-Yehuda

Page 2: Chapter 8  PD-Method and  Local Ratio

2

Introduction

• The local ratio technique is an approximation paradigm for NP-hard optimization to obtain approximate solutions

• Its main feature of attraction is its simplicity and elegance; it is very easy to understand, and has surprisingly broad applicability.

Page 3: Chapter 8  PD-Method and  Local Ratio

3

A Vertex Cover Problem:Network Testing

• A network tester involves placing probes onto the network vertices.

• A probe can determine if a connected link is working correctly.

• The goal is to minimize the number of used probes to check all the links.

Page 4: Chapter 8  PD-Method and  Local Ratio

4

A Vertex Cover Problem:Precedence Constrained

Scheduling

• Schedule a set of jobs on a single machine;• Jobs have precedence constraints between

them;• The goal is to find a schedule which

minimizes the weighted sum of completion times.

This problem can be formulated as a vertex cover problem [Ambuehl-Mastrolilli’05]

Page 5: Chapter 8  PD-Method and  Local Ratio

5

The Local Ratio Theorem(for minimization problems)

Let w = w1 + w2 . If x is an r-approximate solution for w1 and w2 then x is r-approximate with respect to w as well.

Note that the theorem holds even when negative weights are allowed.

)(/)(

)()(/)(

)()(/)(

ly.respective , and ,for solutions optimal be and ,Let

*

*2

*222

*1

*111

21**

2*1

xwrxw

xwxwrxw

xwxwrxw

wwwxxx

Proof

Page 6: Chapter 8  PD-Method and  Local Ratio

6

Vertex Cover example

W = [41, 62, 13, 14, 35, 26, 17]

W1 = [ 0, 0, 0, 14, 14, 0, 0]

W2 = [41, 62, 13, 0, 21, 26, 17]

W = W1 + W2

Weight functions:41

62

14

35

17

26

13

Page 7: Chapter 8  PD-Method and  Local Ratio

7

Vertex Cover example (step 1)

= +

41

62

14

35

17

26

13 0 0

14

14

0

0

041

62

0 21

17

26

13

Note: any feasible solution is a 2-approximate solution for weight function W1

Page 8: Chapter 8  PD-Method and  Local Ratio

8

Vertex Cover example (step 2)

= +

41

62

0 21

17

26

13 0 0

0 21

0

21

041

62

0 0

17

5

13

Page 9: Chapter 8  PD-Method and  Local Ratio

9

Vertex Cover example (step 3)

= +

41

62

0 0

17

5

1341

41

0 0

0

0

0 0 21

0 0

17

5

13

Page 10: Chapter 8  PD-Method and  Local Ratio

10

Vertex Cover example (step 4)

= +

0 21

0 0

17

5

13 0 13

0 0

0

0

13 0 8

0 0

17

5

0

Page 11: Chapter 8  PD-Method and  Local Ratio

11

Vertex Cover example (step 5)

= +

0 8

0 0

17

5

0 0 8

0 0

12

0

00 0

0 0

5

5

0

Page 12: Chapter 8  PD-Method and  Local Ratio

12

Vertex Cover example (step 6)

• The optimal solution value of the VC instance on the left is zero.

• By a recurrent application of the Local Ratio Theorem we are guaranteed to be within 2 times the optimal solution value by picking the zero nodes.

• Opt = 120 Approx = 129

0 8

0 0

12

0

041 62 13

14 35 26

17

Page 13: Chapter 8  PD-Method and  Local Ratio

13

1. For each edge {u,v} do:

2. Let = min {w(u), w(v)}.

3. w(u) w(u) - .4. w(v) w(v) - .5. Return {v | w(v) = 0}.

2-Approx VC (Bar-Yehuda & Even 81)

Iterative implementation – edge by edge

Page 14: Chapter 8  PD-Method and  Local Ratio

14

Recursive implementation

1. If a zero-cost solution can be found, return one.

2. Otherwise, find a suitable decomposition of w into two weight functions w1 and w2 = w − w1, and solve the problem recursively, using w2 as the weight function in the recursive call.

The Local Ratio Theorem leads naturally to the formulation of recursive algorithms with the following general structure

Page 15: Chapter 8  PD-Method and  Local Ratio

15

2-Approx VC (Bar-Yehuda & Even 81)

Recursive implementation – edge by edge

1. VC (V, E, w)

2. If E= return ;

3. If w(v)=0 return {v}+VC(V-{v}, E-E(v), w);

4. Let (x,y)E;

5. Let = min{p(x), p(y)};

6. Define w1(v) = if v=x or v=y and 0 otherwise;

7. Return VC(V, E, w- w1 )

Page 16: Chapter 8  PD-Method and  Local Ratio

16

Algorithm Analysis

We prove that the solution returned by the algorithm is 2-approximate by induction on the recursion and by using the Local Ratio Theorem.

1. In the base case, the algorithm returns a vertex cover of zero cost, which is optimal.

2. For the inductive step, consider the solution returned by the recursive call.

By the inductive hypothesis it is 2-approximate with respect to w2.

We claim that it is also 2-approximate with respect to w1 . In fact, every feasible solution is 2-approximate with respect to w1 .

Page 17: Chapter 8  PD-Method and  Local Ratio

17

Generality of the analysis

• The proof that a given algorithm is an r-approximation algorithm is by induction on the recursion.

• In the base case, the solution is optimal (and, therefore, r-approximate) because it has zero cost, and in the inductive step, the solution returned by the recursive call is r-approximate with respect to w2 by the inductive hypothesis.

• Thus, different algorithms differ from one Thus, different algorithms differ from one another only in the choice of another only in the choice of ww11, and in the proof , and in the proof that every feasible solution is that every feasible solution is rr-approximate with -approximate with respect to respect to ww11..

Page 18: Chapter 8  PD-Method and  Local Ratio

18

The key ingredient

Different algorithms (for different problems), differ from one another only in the decomposition of W, and this decomposition is determined completely by the choice of W1.

W2 = W – W1

Page 19: Chapter 8  PD-Method and  Local Ratio

19

The creative part…find r-effective weights

w1 is fully r-effective if there exists a number b such that

b w1 · x r · b

for all feasible solutions x

Page 20: Chapter 8  PD-Method and  Local Ratio

20

Framework

Proving this amounts to proving that:

1. b is a lower bound on the optimum value,

2. r ·b is an upper bound on the cost of every feasible solution

…and thus every feasible solution is r-approximate (all with respect to w1).

The analysis of algorithms in our framework boils down to proving that w1 is r-effective.

Page 21: Chapter 8  PD-Method and  Local Ratio

.Output

while.-end

;1

for and set

;1 and if set

min

such that )( choose

.)(* choose

}0|{)(

and 0}|{)(set

begin do feasible primenot is while

.0 0, 0,set Initially,

1*

1*

11

*

1)(

*

1

1

00

kA

ki

ki

ki

ki

kr

kj

kj

ji

m

i

kiijj

kJjri

m

i

kiirr

n

j

kjij

kj

k

xx

kk

i*iyyyy

xrjxx

a

yac

a

yac

kJr

kIi

xaikI

xjkJ

x

kyx

do covered,not edgean exists thereif

tices}chosen vernot {)( kJ

edge} coverednot {)( kI

1or 0

of weight remaining j

ight vertex weupdate

edge uncoveredan choose

Page 22: Chapter 8  PD-Method and  Local Ratio

while.-end

* of endpoint each at weight update

};{

;ight smaller we

with * of endpoint an choose

;* edge uncoveredan choose

};in not vertices{

exists edge uncovered while

. Initially,

jj cc

ij

rCC

ir

i

CJ

C

.Output

while.-end

;1

for and set

;1 and if set

min

such that )( choose

.)(* choose

}0|{)(

and 0}|{)(set

begin do feasible primenot is while

.0 0, 0,set Initially,

1*

1*

11

*

1)(

*

1

1

00

kA

ki

ki

ki

ki

kr

kj

kj

ji

m

i

kiijj

kJjri

m

i

kiirr

n

j

kjij

kj

k

xx

kk

i*iyyyy

xrjxx

a

yac

a

yac

kJr

kIi

xaikI

xjkJ

x

kyx

Page 23: Chapter 8  PD-Method and  Local Ratio

23

A different W1 for VC star by star (Clarkson’83)

41

62

16

35

17

26

13

Let x 2 V with minimum " = w(x)d(x)

16/4

16/4

16

16/4

16/4

0

0 37

58

0 31

13

26

13

= +

Let d(x) be the degree of vertex x

Page 24: Chapter 8  PD-Method and  Local Ratio

24

A different W1 for VC star by star

Let x 2 V with minimum " = w(x)d(x)

4

0

0b = 4 · is a lower bound on the optimum value,

2 ·b is an upper bound on the cost of every feasible solution

W1 is 2-effective

Page 25: Chapter 8  PD-Method and  Local Ratio

25

Another W1 for VChomogeneous (= proportional to the potential coverage)

Let " =minx2Vw(x)d(x)

3 4

4 5

3

3

2 b = |E| · is a lower bound on the optimum value,

2 ·b is an upper bound on the cost of every feasible solution

W1 is 2-effective

Page 26: Chapter 8  PD-Method and  Local Ratio

.Output

while.-end

;1

otherwisw;

0 and )(for set

;1 and if set

min

such that )( choose

}0|{)(

and 0}|{)(set

begin do feasible primenot is while

.0 0, 0,set Initially,

1

1

11

)(

1)(

)(

1

1

00

kA

ki

ki

irki

ki

kr

kj

kj

kIiij

m

i

kiijj

kJj

kIiir

m

i

kiirr

n

j

kjij

kj

k

xx

kk

yy

akIiyy

xrjxx

a

yac

a

yac

kJr

xaikI

xjkJ

x

kyx

do covered,not edgean exists thereif

tices}chosen vernot {)( kJ

edge} coverednot {)( kI

)( at edges uncovered of #

of weight remaining r

r

ight vertex weupdate

minimize to vertex a choose r

Page 27: Chapter 8  PD-Method and  Local Ratio

while.-end

oadjacent t x each verte and

0

at weight update

};{

; at edges uncovered of #

of weight remainingmin

reach to vertex a choose

edges}; uncovered{

};in not vertices{

exists edge uncovered while

. Initially,

jj

r

Jj

cc

rj

c

r

rCC

j

j

r

I

CJ

C

.Output

while.-end

;1

otherwisw;

0 and )(for set

;1 and if set

min

such that )( choose

}0|{)(

and 0}|{)(set

begin do feasible primenot is while

.0 0, 0,set Initially,

1

1

11

)(

1)(

)(

1

1

00

kA

ki

ki

irki

ki

kr

kj

kj

kIiij

m

i

kiijj

kJj

kIiir

m

i

kiirr

n

j

kjij

kj

k

xx

kk

yy

akIiyy

xrjxx

a

yac

a

yac

kJr

xaikI

xjkJ

x

kyx

Page 28: Chapter 8  PD-Method and  Local Ratio

28

Partial Vertex Cover

Input: VC with a fixed number k

Goal: Identify a minimum cost subset of vertices that hits at least k edges

Examples:• if k = 1 then OPT = 13• if k = 3 then OPT = 14• if k = 5 then OPT = 25• if k = 6 then OPT = 14+13

41

62

14

25

17

26

13

Page 29: Chapter 8  PD-Method and  Local Ratio

29

w=[41, 62, 13, 14, 25, 26, 17]

w1=[ 0, 0, 0, 14, 14, 0, 0]

w2=[41, 62, 13, 0, 11, 26, 17]w = w1 + w2

Weight functions:

Assume k < |E| (number of edges)Note: NOT every feasible solution is a 2-approximate solution for weight function w1

In VC every edge must be hit by a vertex.In partial VC, k vertices are sufficient. So the optimum for w1 is 0 (k<=5); vice versa the solution that takes for example vertex 4 is infinite many times larger than the optimum

41

62

14

25

17

26

13

Partial Vertex Cover

}

Page 30: Chapter 8  PD-Method and  Local Ratio

30

Positive Weight Function

• We do not know of any single subset that must contribute to all solutions.

• To prevent OPT from being equal to 0, we can assign a positive weight to every element.

Page 31: Chapter 8  PD-Method and  Local Ratio

31

w=[41, 62, 13, 14, 25, 26, 17]

w1=[ 0, 0, 0, 14, 14, 0, 0]

w2=[41, 62, 13, 0, 11, 26, 17]

w = w1 + w2

Weight functions:

Observe that 14 is NOT a lower bound Observe that 14 is NOT a lower bound of the optimal value!of the optimal value!For example for k=1 then 13 is the optimal value.

41

62

14

25

17

26

13

Positive Weight Function

Page 32: Chapter 8  PD-Method and  Local Ratio

32

x

Let d(x) be the degree of vertex xWhat is the amortized cost to hit one edge by using x ?

What is the minimal amortized cost to hit any edge?

Positive Weight Function

)),(min(

)(min

kxd

xwx

bound.lower valida represents "" edges, hit tohave weSince kk

Page 33: Chapter 8  PD-Method and  Local Ratio

33

Positive Weight Function W1

w1(x) = · min{ d(x) , k }

For k = 3 then = 14/3

Weight functions (k=3):

w = [41, 62, 13, 14, 25, 26, 17]w1= [14, 14, 28/3, 14, 14, 14, 14]w2= [27, 48, 11/3, 0, 11, 12, 3]

w = w1 + w2

41

62

14

25

17

26

13

Page 34: Chapter 8  PD-Method and  Local Ratio

34

Function W1

• [Lower Bound] Every feasible solution costs at least k = 14

• [Upper Bound] There are feasible solutions whose value can be arbitrarily larger than k (e.g. take all the vertices)

• But if you take all the vertices then not all of them are strictly necessary!!

• We can focus on Minimal Solutions!!!

14

14

14

14

14

14

28/3

Page 35: Chapter 8  PD-Method and  Local Ratio

35

Minimal Solutions

• By minimal solution we mean a feasible solution that is minimal with respect to set inclusion, that is, a feasible solution whose proper subsets are all infeasible.

• Minimal solutions are meaningful mainly in the context of covering problems (covering problems are problems for which feasible solutions are monotone inclusion-wise, that is, if a set X is a feasible solution, then so is every superset of X; MST is not a covering problem).

Page 36: Chapter 8  PD-Method and  Local Ratio

36

Minimal Solutions:r-effective weights

w1 is r-effective if there exists a number b such that

b w1 · x r · b

for all minimal feasible solution x

Page 37: Chapter 8  PD-Method and  Local Ratio

37

The creative part…again find r-effective weights

• If we can show that our algorithm uses an r-effective w1 and returns minimal solutions, we will have essentially proved that it is an r-approximation algorithm.

• Designing an algorithm to return minimal solutions is quite easy.

• Most of the creative effort is therefore expended in finding an r-effective weight function (for a small r).

Page 38: Chapter 8  PD-Method and  Local Ratio

38

2-effective weight function

1. In terms of w1 every feasible solution costs at least · k 2. In terms of w1 every minimal feasible solution costs at most 2 · · k

Minimal solution = any proper subset is not a feasible solution

)),(min()(1 kxdxw

Page 39: Chapter 8  PD-Method and  Local Ratio

39

Proof of 2. (= costs at most 2 · · k )

.2))((22)(*)()(

Hence,

deleted.) becan * ,(otherwise )(

minimal, is Since .)(2

1 Denote

nodes.) least twoat contains :(note .)(*)(Then

).(min*)(such that * Choose

).()()(Then .by hit and ,in

endpoints only with edges ofnumber thedenote )(let ,For

.2)( show tosufficesIt .)( is value

cost theOtherwise, .cost with }{ that ,)),(min(

such that node a contains If .solution minimal aConsider

*}\{ 1*}\{ 11

*}\{ 1

2

*}\{ 11

11

21

kxdttxdxdxd

xkxdt

Cxdt

Cxdxd

xdxdCx

xdxdxdxC

ixdCx

kxdxd

kxCkkxd

xCC

xCxxCxCx

xCx

Cx

xCx

Cx

i

CxCx

Page 40: Chapter 8  PD-Method and  Local Ratio

40

Proof of 2. (cont.) xd1(x) = 2d2(x) = 3

Page 41: Chapter 8  PD-Method and  Local Ratio

41

The approximation algorithm

Let C be theset of edges and S(x) be theset of edges that arehit by x

Algorithm from Bar-Yehuda et al. “Local Ratio: A Unified Framework for Approximation Algorithms” ACM Computing Surveys, 2004

Page 42: Chapter 8  PD-Method and  Local Ratio

42

Algorithm Framework

1. If a zero-cost minimal solution can be found, do: optimal solution.

2. Otherwise, if the problem contains a zero-cost element, do: problem size reduction.

3. Otherwise, do: weight decomposition.

Page 43: Chapter 8  PD-Method and  Local Ratio

Partial Vertex Cover

vertices.least at hit to

subset rtex weight veminimum a find ,0integer

and ,ex weight with vert),(graph aGiven

k

k

wEVG

.21for }1,0{ ,

),(for s.t.

min

}.,...,,{ Assume

),(

2211

21

, n, , i = zx

kz

Evv z+ xx

x+ w + x + wxw

vvvV

iji

Evvij

jiijji

nn

n

ji

Page 44: Chapter 8  PD-Method and  Local Ratio

Primal and Dual

0,0

),(

s.t.

min

),(

zx

kz

Evv

zxx

wx

Evvij

ji

ijji

ji

.0,0

,

),(, s.t.

max

),(:

uy

Vvwy

Evvyu

ku

iEvvj

iij

jiij

ji

Page 45: Chapter 8  PD-Method and  Local Ratio

Complementary Slackness Condition

0)(

0)(

0)(

0)(

),(

),(:

kzu

zxxy

zuy

xyw

Evvij

ijjiij

ijij

iEvvjiji

ji

ji primal

dual

Page 46: Chapter 8  PD-Method and  Local Ratio

Complementary Slackness Condition

0)(

0)(

0)(

0)(

),(

),(:

kzu

zxxy

zuy

xyw

Evvij

ijjiij

ijij

iEvvjiji

ji

ji primal

dual

Page 47: Chapter 8  PD-Method and  Local Ratio

.Output

;0,),(:for 0

0 then

and 1 if

do to1for

while;-end

|;}),(|{|

;min

;),(for set

;),(for 1

;1set

))(deg,min(min

))(deg,min(

such that choose

};0|),{(

and 0}|{set

begin do 0 while

.,0 0,,0 0,set Initially,

0,),(:),(

),(

),(:),(:

xx

xEvvjz

x

kzzx

ns

Ijrjll

yu

Ijryy

Ijrz

x

il

yw

rl

yw

Jr

zjiI

xjJ

l

kluyzx

A

jjssj

s

xEvvjsj

Evvijs

ijEvv

rjrj

rj

r

I

Evvjiji

JiI

Evvjrjr

ij

j

jjsji

ji

jijr

do edges) (covered# while k

tices}chosen vernot {J

edge} coverednot {I

)at edges uncovered of #,min(

of weight remainingmin

jk

jJj

ight vertex weupdate

reach to vertex a choose Jr

Primal-Dual schema ???

Page 48: Chapter 8  PD-Method and  Local Ratio