load balancing center selection pricing method: weighted ...wayne/kleinberg-tardos/pdf/11... ·...

63
Lecture slides by Kevin Wayne Copyright © 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated on 2/26/20 11:14 AM 11. A PPROXIMATION A LGORITHMS load balancing center selection pricing method: weighted vertex cover LP rounding: weighted vertex cover generalized load balancing knapsack problem

Upload: others

Post on 01-May-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Lecture slides by Kevin WayneCopyright © 2005 Pearson-Addison Wesley

http://www.cs.princeton.edu/~wayne/kleinberg-tardos

Last updated on 2/26/20 11:14 AM

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

Coping with NP-completeness

Q. Suppose I need to solve an NP-hard optimization problem.

What should I do?

A. Sacrifice one of three desired features.

i. Runs in polynomial time.

ii. Solves arbitrary instances of the problem.

iii. Finds optimal solution to problem.

ρ-approximation algorithm.

・Runs in polynomial time.

・Solves arbitrary instances of the problem

・Finds solution that is within ratio ρ of optimum.

Challenge. Need to prove a solution’s value is close to optimum,

without even knowing what is optimum value.

2

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.1

Load balancing

Input. m identical machines; n ≥ m jobs, job j has processing time tj.

・Job j must run contiguously on one machine.

・A machine can process at most one job at a time.

Def. Let S[i] be the subset of jobs assigned to machine i. The load of machine i is L[i] = Σj ∈ S[i] tj.

Def. The makespan is the maximum load on any machine L = maxi L[i].

Load balancing. Assign each job to a machine to minimize makespan.

4

Machine 2

Machine 1a d f

b c e g

timeL[2]0

machine 1

machine 2

L[1]

Load balancing on 2 machines is NP-hard

Claim. Load balancing is hard even if m = 2 machines.

Pf. PARTITION ≤ P LOAD-BALANCE.

5

yes

a d

f

b c

ge

length of job f

NP-complete by Exercise 8.26

Machine 2

Machine 1a d f

b c e g

time0

machine 1

machine 2

L

Load balancing: list scheduling

List-scheduling algorithm.

・Consider n jobs in some fixed order.

・Assign job j to machine i whose load is smallest so far.

Implementation. O(n log m) using a priority queue for loads L[k].6

LIST-SCHEDULING (m, n, t1, t2, …, tn) _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

FOR i = 1 TO m

L[i] ← 0.

S[i] ← ∅.

FOR j = 1 TO n

i ← argmin k L[k].

S[i] ← S[i] ∪ { j }.

L[i] ← L[i] + tj.

RETURN S[1], S[2], …, S[m].

jobs assigned to machine i

load on machine i

machine i has smallest load

assign job j to machine i

update load of machine i

Load balancing: list scheduling analysis

Theorem. [Graham 1966] Greedy algorithm is a 2-approximation.

・First worst-case analysis of an approximation algorithm.

・Need to compare resulting solution with optimal makespan L*.

Lemma 1. For all k : the optimal makespan L* ≥ tk .

Pf. Some machine must process the most time-consuming job. ▪

Lemma 2. The optimal makespan .

Pf.

・The total processing time is Σk tk .

・One of m machines must do at least a 1 / m fraction of total work. ▪

7

L⇤ � 1

m

X

k

tk

<latexit sha1_base64="Y3OA4bSsV4Xby8G+3NXlWieoSpM=">AAACTnicbVDLThsxFPWkPFJeDbDsxiJFQiyiGZSKSGyQuumiC5CagJQJI49zJ1ixPSP7Dko0mh/ga9jCV3TbH2FXFWfIokl6JMtH59zr63viTAqLvv/bq31YW9/YrH/c2t7Z3fvU2D/o2TQ3HLo8lam5jZkFKTR0UaCE28wAU7GEm3j8bebfPICxItU/cZrBQLGRFongDJ0UNb78uDul4QUNR1BdiWG8CMpClTS0uYrGFKNx1Gj6Lb8CXSXBnDTJHFfRvncQDlOeK9DIJbO2H/gZDgpmUHAJ5VaYW8gYH7MR9B3VTIEdFNU6JT12ypAmqXFHI63UfzsKpqydqthVKob3dtmbif/z+jkmnUEhdJYjaP4+KMklxZTOsqFDYYCjnDrCuBHur5TfM5cIugQXplRvZ8AXNikmuRY8HcKSKnGChpUuxWA5s1XSO2sF7dbX63bzsjPPs04+kyNyQgJyTi7Jd3JFuoSTR/JEnsmL98t79f54f99La96855AsoFZ/A0i8s+g=</latexit>

Load balancing: list scheduling analysis

Theorem. Greedy algorithm is a 2-approximation.

Pf. Consider load L[i] of bottleneck machine i.

・Let j be last job scheduled on machine i.

・When job j assigned to machine i, i had smallest load.

Its load before assignment is L[i] – tj ; hence L[i] – tj ≤ L[k] for all 1 ≤ k ≤ m.

8

jmachine i

timeL = L[i]0 L[i] - tj

blue jobs scheduled before j

machine that ends up with highest load

Theorem. Greedy algorithm is a 2-approximation.

Pf. Consider load L[i] of bottleneck machine i.

・Let j be last job scheduled on machine i.

・When job j assigned to machine i, i had smallest load.

Its load before assignment is L[i] – tj ; hence L[i] – tj ≤ L[k] for all 1 ≤ k ≤ m.

・Sum inequalities over all k and divide by m:

・Now,

L[i] � tj � 1

m

k

L[k]

=1

m

k

tk

� L�.<latexit sha1_base64="DESbJrvZKpYke8VFK8zKaiKKHAw=">AAACx3icfVFdb9MwFHXCgFG+uvG4F4sKhCaoEpjE0IQ0aS8I9WFIlE2KQ+S4N5up7UT2zdQqygN/hP+1fzM3rRDtgCtd++jce3zt47xS0mEUXQfhna279+5vP+g9fPT4ydP+zu43V9ZWwFiUqrTnOXegpIExSlRwXlngOldwlk9PFvWzK7BOluYrzitINb8wspCCo6ey/q9RIlPKjuibxYLZD7+xo5eUKegQZYXloonbRreUvabM1Tqb0lEy9SrWo5uxVH/8nxZ9/lv6ezAdfd8fZv1BNIy6oLdBvAIDsorTbCfYZZNS1BoMCsWdS+KowrThFqVQ0PZY7aDiYsovIPHQcA0ubTojW/rCMxNalNanQdqxfyoarp2b69x3ao6XbrO2IP9WS2osDtNGmqpGMGI5qKgVxZIufoVOpAWBau4BF1b6u1Jxyb176P9ubUp3dgVi7SXNrDZSlBPYYBXO0PLWuxhvenYbjN8OPwyjLweD48OVndtkjzwnr0hM3pNj8omckjERwVawH7wLDsLPYRVehbNlaxisNM/IWoQ/bwDia83d</latexit><latexit sha1_base64="DESbJrvZKpYke8VFK8zKaiKKHAw=">AAACx3icfVFdb9MwFHXCgFG+uvG4F4sKhCaoEpjE0IQ0aS8I9WFIlE2KQ+S4N5up7UT2zdQqygN/hP+1fzM3rRDtgCtd++jce3zt47xS0mEUXQfhna279+5vP+g9fPT4ydP+zu43V9ZWwFiUqrTnOXegpIExSlRwXlngOldwlk9PFvWzK7BOluYrzitINb8wspCCo6ey/q9RIlPKjuibxYLZD7+xo5eUKegQZYXloonbRreUvabM1Tqb0lEy9SrWo5uxVH/8nxZ9/lv6ezAdfd8fZv1BNIy6oLdBvAIDsorTbCfYZZNS1BoMCsWdS+KowrThFqVQ0PZY7aDiYsovIPHQcA0ubTojW/rCMxNalNanQdqxfyoarp2b69x3ao6XbrO2IP9WS2osDtNGmqpGMGI5qKgVxZIufoVOpAWBau4BF1b6u1Jxyb176P9ubUp3dgVi7SXNrDZSlBPYYBXO0PLWuxhvenYbjN8OPwyjLweD48OVndtkjzwnr0hM3pNj8omckjERwVawH7wLDsLPYRVehbNlaxisNM/IWoQ/bwDia83d</latexit><latexit sha1_base64="DESbJrvZKpYke8VFK8zKaiKKHAw=">AAACx3icfVFdb9MwFHXCgFG+uvG4F4sKhCaoEpjE0IQ0aS8I9WFIlE2KQ+S4N5up7UT2zdQqygN/hP+1fzM3rRDtgCtd++jce3zt47xS0mEUXQfhna279+5vP+g9fPT4ydP+zu43V9ZWwFiUqrTnOXegpIExSlRwXlngOldwlk9PFvWzK7BOluYrzitINb8wspCCo6ey/q9RIlPKjuibxYLZD7+xo5eUKegQZYXloonbRreUvabM1Tqb0lEy9SrWo5uxVH/8nxZ9/lv6ezAdfd8fZv1BNIy6oLdBvAIDsorTbCfYZZNS1BoMCsWdS+KowrThFqVQ0PZY7aDiYsovIPHQcA0ubTojW/rCMxNalNanQdqxfyoarp2b69x3ao6XbrO2IP9WS2osDtNGmqpGMGI5qKgVxZIufoVOpAWBau4BF1b6u1Jxyb176P9ubUp3dgVi7SXNrDZSlBPYYBXO0PLWuxhvenYbjN8OPwyjLweD48OVndtkjzwnr0hM3pNj8omckjERwVawH7wLDsLPYRVehbNlaxisNM/IWoQ/bwDia83d</latexit>

Load balancing: list scheduling analysis

9

Lemma 2

L = L[i] = (L[i] � tj) + tj � 2L�<latexit sha1_base64="wgTOmA2fd2xP9+t8x59PlbcWMsc=">AAACbHicbVDbSgMxEE3Xe71VxaciBIviBcu2CCoiCL740AcFq0J3Ldl0qrHZ7JLMimXpB/k1vupX+Aum2wq2OhBy5syZTOYEsRQGXfcz50xMTk3PzM7l5xcWl5YLK6u3Jko0hzqPZKTvA2ZACgV1FCjhPtbAwkDCXdC56NfvXkAbEakb7Mbgh+xRibbgDC3VLFzUqHfqndIze9FaQ/j0J9nJsgOKzeddm+9bysKB2pMwAFVae9hrFkpu2c2C/gWVISiRYVw1V3KrXiviSQgKuWTGNCpujH7KNAouoZf3EgMx4x32CA0LFQvB+Gm2bY9uWaZF25G2RyHN2N8dKQuN6YaBVYYMn8x4rU/+V2sk2D72U6HiBEHxwaB2IilGtG8dbQkNHGXXAsa1sH+l/IlpxtEaPDIlezsGPrJJ+poowaMWjLESX1GznnWxMu7ZX1Cvlk/K7vVh6fx4aOcsKZJNskMq5Iick0tyReqEkzfyTj7IZ+7LWXeKzsZA6uSGPWtkJJztb77Ht1Y=</latexit><latexit sha1_base64="wgTOmA2fd2xP9+t8x59PlbcWMsc=">AAACbHicbVDbSgMxEE3Xe71VxaciBIviBcu2CCoiCL740AcFq0J3Ldl0qrHZ7JLMimXpB/k1vupX+Aum2wq2OhBy5syZTOYEsRQGXfcz50xMTk3PzM7l5xcWl5YLK6u3Jko0hzqPZKTvA2ZACgV1FCjhPtbAwkDCXdC56NfvXkAbEakb7Mbgh+xRibbgDC3VLFzUqHfqndIze9FaQ/j0J9nJsgOKzeddm+9bysKB2pMwAFVae9hrFkpu2c2C/gWVISiRYVw1V3KrXiviSQgKuWTGNCpujH7KNAouoZf3EgMx4x32CA0LFQvB+Gm2bY9uWaZF25G2RyHN2N8dKQuN6YaBVYYMn8x4rU/+V2sk2D72U6HiBEHxwaB2IilGtG8dbQkNHGXXAsa1sH+l/IlpxtEaPDIlezsGPrJJ+poowaMWjLESX1GznnWxMu7ZX1Cvlk/K7vVh6fx4aOcsKZJNskMq5Iick0tyReqEkzfyTj7IZ+7LWXeKzsZA6uSGPWtkJJztb77Ht1Y=</latexit><latexit sha1_base64="wgTOmA2fd2xP9+t8x59PlbcWMsc=">AAACbHicbVDbSgMxEE3Xe71VxaciBIviBcu2CCoiCL740AcFq0J3Ldl0qrHZ7JLMimXpB/k1vupX+Aum2wq2OhBy5syZTOYEsRQGXfcz50xMTk3PzM7l5xcWl5YLK6u3Jko0hzqPZKTvA2ZACgV1FCjhPtbAwkDCXdC56NfvXkAbEakb7Mbgh+xRibbgDC3VLFzUqHfqndIze9FaQ/j0J9nJsgOKzeddm+9bysKB2pMwAFVae9hrFkpu2c2C/gWVISiRYVw1V3KrXiviSQgKuWTGNCpujH7KNAouoZf3EgMx4x32CA0LFQvB+Gm2bY9uWaZF25G2RyHN2N8dKQuN6YaBVYYMn8x4rU/+V2sk2D72U6HiBEHxwaB2IilGtG8dbQkNHGXXAsa1sH+l/IlpxtEaPDIlezsGPrJJ+poowaMWjLESX1GznnWxMu7ZX1Cvlk/K7vVh6fx4aOcsKZJNskMq5Iick0tyReqEkzfyTj7IZ+7LWXeKzsZA6uSGPWtkJJztb77Ht1Y=</latexit>

above inequality

≤ L*

Lemma 1

≤ L*

L = L[i] = (L[i] � tj) + tj � 2L�<latexit sha1_base64="wgTOmA2fd2xP9+t8x59PlbcWMsc=">AAACbHicbVDbSgMxEE3Xe71VxaciBIviBcu2CCoiCL740AcFq0J3Ldl0qrHZ7JLMimXpB/k1vupX+Aum2wq2OhBy5syZ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KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit><latexit sha1_base64="UAE/BI6M8ARFfw88jIxMomzQrNA=">AAACyXicjVFNT9wwEHVSSun2a6FHLharVlVFV0nVDyouSFx62AOV2IIUp5HjnYBZ24nsSbXbKKf+kf4t/g3esIfuwoGRxn56M89jP+eVkg6j6DoIH2083nyy9bT37PmLl6/62zs/XVlbAWNRqtKe59yBkgbGKFHBeWWB61zBWT49XtTPfoN1sjSnOK8g1fzCyEIKjp7K+v9GiUwpO6QfFgtmV35jh28pU9AhygrLRRO3jW4p26fM1Tqb0lEy9SrWo+vxIDX6fICYjn69H2b9QTSMuqB3QbwEA7KMk2w72GGTUtQaDArFnUviqMK04RalUND2WO2g4mLKLyDx0HANLm06K1v6xjMTWpTWp0Hasf8rGq6dm+vcd2qOl269tiDvqyU1FgdpI01VIxhxO6ioFcWSLv6FTqQFgWruARdW+rtSccm9e+h/b2VKd3YFYuUlzaw2UpQTWGMVztDy1rsYr3t2F4w/Dr8Nox+fBkcHSzu3yC7ZI+9ITL6SI/KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit><latexit sha1_base64="UAE/BI6M8ARFfw88jIxMomzQrNA=">AAACyXicjVFNT9wwEHVSSun2a6FHLharVlVFV0nVDyouSFx62AOV2IIUp5HjnYBZ24nsSbXbKKf+kf4t/g3esIfuwoGRxn56M89jP+eVkg6j6DoIH2083nyy9bT37PmLl6/62zs/XVlbAWNRqtKe59yBkgbGKFHBeWWB61zBWT49XtTPfoN1sjSnOK8g1fzCyEIKjp7K+v9GiUwpO6QfFgtmV35jh28pU9AhygrLRRO3jW4p26fM1Tqb0lEy9SrWo+vxIDX6fICYjn69H2b9QTSMuqB3QbwEA7KMk2w72GGTUtQaDArFnUviqMK04RalUND2WO2g4mLKLyDx0HANLm06K1v6xjMTWpTWp0Hasf8rGq6dm+vcd2qOl269tiDvqyU1FgdpI01VIxhxO6ioFcWSLv6FTqQFgWruARdW+rtSccm9e+h/b2VKd3YFYuUlzaw2UpQTWGMVztDy1rsYr3t2F4w/Dr8Nox+fBkcHSzu3yC7ZI+9ITL6SI/KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit>

L[i] � tj � 1

m

k

L[k]

� 1

m

k

tk

� L�.<latexit sha1_base64="UAE/BI6M8ARFfw88jIxMomzQrNA=">AAACyXicjVFNT9wwEHVSSun2a6FHLharVlVFV0nVDyouSFx62AOV2IIUp5HjnYBZ24nsSbXbKKf+kf4t/g3esIfuwoGRxn56M89jP+eVkg6j6DoIH2083nyy9bT37PmLl6/62zs/XVlbAWNRqtKe59yBkgbGKFHBeWWB61zBWT49XtTPfoN1sjSnOK8g1fzCyEIKjp7K+v9GiUwpO6QfFgtmV35jh28pU9AhygrLRRO3jW4p26fM1Tqb0lEy9SrWo+vxIDX6fICYjn69H2b9QTSMuqB3QbwEA7KMk2w72GGTUtQaDArFnUviqMK04RalUND2WO2g4mLKLyDx0HANLm06K1v6xjMTWpTWp0Hasf8rGq6dm+vcd2qOl269tiDvqyU1FgdpI01VIxhxO6ioFcWSLv6FTqQFgWruARdW+rtSccm9e+h/b2VKd3YFYuUlzaw2UpQTWGMVztDy1rsYr3t2F4w/Dr8Nox+fBkcHSzu3yC7ZI+9ITL6SI/KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit><latexit sha1_base64="UAE/BI6M8ARFfw88jIxMomzQrNA=">AAACyXicjVFNT9wwEHVSSun2a6FHLharVlVFV0nVDyouSFx62AOV2IIUp5HjnYBZ24nsSbXbKKf+kf4t/g3esIfuwoGRxn56M89jP+eVkg6j6DoIH2083nyy9bT37PmLl6/62zs/XVlbAWNRqtKe59yBkgbGKFHBeWWB61zBWT49XtTPfoN1sjSnOK8g1fzCyEIKjp7K+v9GiUwpO6QfFgtmV35jh28pU9AhygrLRRO3jW4p26fM1Tqb0lEy9SrWo+vxIDX6fICYjn69H2b9QTSMuqB3QbwEA7KMk2w72GGTUtQaDArFnUviqMK04RalUND2WO2g4mLKLyDx0HANLm06K1v6xjMTWpTWp0Hasf8rGq6dm+vcd2qOl269tiDvqyU1FgdpI01VIxhxO6ioFcWSLv6FTqQFgWruARdW+rtSccm9e+h/b2VKd3YFYuUlzaw2UpQTWGMVztDy1rsYr3t2F4w/Dr8Nox+fBkcHSzu3yC7ZI+9ITL6SI/KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit><latexit sha1_base64="UAE/BI6M8ARFfw88jIxMomzQrNA=">AAACyXicjVFNT9wwEHVSSun2a6FHLharVlVFV0nVDyouSFx62AOV2IIUp5HjnYBZ24nsSbXbKKf+kf4t/g3esIfuwoGRxn56M89jP+eVkg6j6DoIH2083nyy9bT37PmLl6/62zs/XVlbAWNRqtKe59yBkgbGKFHBeWWB61zBWT49XtTPfoN1sjSnOK8g1fzCyEIKjp7K+v9GiUwpO6QfFgtmV35jh28pU9AhygrLRRO3jW4p26fM1Tqb0lEy9SrWo+vxIDX6fICYjn69H2b9QTSMuqB3QbwEA7KMk2w72GGTUtQaDArFnUviqMK04RalUND2WO2g4mLKLyDx0HANLm06K1v6xjMTWpTWp0Hasf8rGq6dm+vcd2qOl269tiDvqyU1FgdpI01VIxhxO6ioFcWSLv6FTqQFgWruARdW+rtSccm9e+h/b2VKd3YFYuUlzaw2UpQTWGMVztDy1rsYr3t2F4w/Dr8Nox+fBkcHSzu3yC7ZI+9ITL6SI/KdnJAxEcFmsB98Dr6Eo9CGs/DPbWsYLDWvyUqEf28ASPzO4Q==</latexit>

machine that ends up with highest load

Load balancing: list scheduling analysis

Q. Is our analysis tight?

A. Essentially yes.

Ex: m machines, first m (m – 1) jobs have length 1, last job has length m.

10

machine 2 idle

machine 3 idle

machine 4 idle

machine 5 idle

machine 6 idle

machine 7 idle

machine 8 idle

machine 9 idle

machine 10 idle

m = 10

0 9 19

list scheduling makespan = 19 = 2m - 1

Load balancing: list scheduling analysis

Q. Is our analysis tight?

A. Essentially yes.

Ex: m machines, first m (m – 1) jobs have length 1, last job has length m.

11

m = 10

0 9 19

optimal makespan = 10 = m

10

Longest processing time (LPT). Sort n jobs in decreasing order of processing

times; then run list scheduling algorithm.

LPT-LIST-SCHEDULING (m, n, t1, t2, …, tn) _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

SORT jobs and renumber so that t1 ≥ t2 ≥ … ≥ tn.

FOR i = 1 TO m

L[i] ← 0.

S[i] ← ∅.

FOR j = 1 TO n

i ← argmin k L[k].

S[i] ← S[i] ∪ { j }.

L[i] ← L[i] + tj.

RETURN S[1], S[2], …, S[m].

Load balancing: LPT rule

12

jobs assigned to machine i

load on machine i

machine i has smallest load

assign job j to machine i

update load of machine i

Load balancing: LPT rule

Observation. If bottleneck machine i has only 1 job, then optimal.

Pf. Any solution must schedule that job. ▪

Lemma 3. If there are more than m jobs, L* ≥ 2 tm+1 .

Pf.

・Consider processing times of first m+1 jobs t1 ≥ t2 ≥ … ≥ tm+1.

・Each takes at least tm+1 time.

・There are m + 1 jobs and m machines, so by pigeonhole principle,

at least one machine gets two jobs. ▪

Theorem. LPT rule is a 3/2-approximation algorithm.

Pf. [ similar to proof for list scheduling ]

・Consider load L[i] of bottleneck machine i.

・Let j be last job scheduled on machine i.

13as before ≤ L* Lemma 3 (since tm+1 ≥ tj )≤ ½ L*

L = L[i] = (L[i] � tj) + tj � 2L�<latexit sha1_base64="wgTOmA2fd2xP9+t8x59PlbcWMsc=">AAACbHicbVDbSgMxEE3Xe71VxaciBIviBcu2CCoiCL740AcFq0J3Ldl0qrHZ7JLMimXpB/k1vupX+Aum2wq2OhBy5syZTOYEsRQGXfcz50xMTk3PzM7l5x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anxhk+whVYLHI1hSJT6gZrl1sbHs2VvQbdbP6+6vk+rl2dzODfKV7JEaaZBTckl+kg7pEk7+kEfyRJ5LL86eU3MOZqVOad7zhSyE0/oHA4a8jA==</latexit>

assuming machine i has at least 2 jobs, we have j ≥ m + 1

Load balancing: LPT rule

Q. Is our 3/2 analysis tight?

A. No.

Theorem. [Graham 1969] LPT rule is a 4/3-approximation.

Pf. More sophisticated analysis of same algorithm.

Q. Is Graham’s 4/3 analysis tight?

A. Essentially yes.

Ex.

・m machines

・n = 2m + 1 jobs

・2 jobs of length m, m + 1, …, 2m – 1 and one more job of length m.

・Then, L / L* = (4m − 1) / (3m)

14

Believe it or not

15

L * ≥ 1m t jj∑ .

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.2

Center selection problem

Input. Set of n sites s1, …, sn and an integer k > 0.

Center selection problem. Select set of k centers C so that maximum

distance r(C) from a site to nearest center is minimized.

17

r(C)

k = 4 centers

center

site

Center selection problem

Input. Set of n sites s1, …, sn and an integer k > 0.

Center selection problem. Select set of k centers C so that maximum

distance r(C) from a site to nearest center is minimized.

Notation.

・dist(x, y) = distance between sites x and y.

・dist(si, C) = min c ∈ C dist(si, c) = distance from si to closest center.

・r(C) = maxi dist(si, C) = smallest covering radius.

Goal. Find set of centers C that minimizes r(C), subject to | C | = k.

Distance function properties.

・dist(x, x) = 0 [ identity ]

・dist(x, y) = dist(y, x) [ symmetry ]

・dist(x, y) ≤ dist(x, z) + dist(z, y) [ triangle inequality ]

18

Center selection example

Ex: each site is a point in the plane, a center can be any point in the plane,

dist(x, y) = Euclidean distance.

Remark: search can be infinite!

19

center

r(C)

site

k = 4 centers

Greedy algorithm: a false start

Greedy algorithm. Put the first center at the best possible location for a

single center, and then keep adding centers so as to reduce the covering

radius each time by as much as possible.

Remark: arbitrarily bad!

20

greedy center 1

center

site

k = 2 centers

Center selection: greedy algorithm

Repeatedly choose next center to be site farthest from any existing center.

Property. Upon termination, all centers in C are pairwise at least r(C) apart.

Pf. By construction of algorithm.

GREEDY-CENTER-SELECTION (k, n, s1, s2, … , sn) ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

C ← ∅.

REPEAT k times

Select a site si with maximum distance dist(si, C).

C ← C ∪ si.

RETURN C.________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

21

site farthest from any center

Center selection: analysis of greedy algorithm

Lemma. Let C* be an optimal set of centers. Then r(C) ≤ 2r(C*). Pf. [by contradiction] Assume r(C*) < ½ r(C).

・For each site ci ∈ C, consider ball of radius ½ r(C) around it.

・Exactly one ci* in each ball; let ci be the site paired with ci

*.

・Consider any site s and its closest center ci* ∈ C*.

・dist(s, C) ≤ dist(s, ci) ≤ dist(s, ci*) + dist(ci*, ci) ≤ 2r(C*).

・Thus, r(C) ≤ 2r(C*). ▪

22

½ r(C)

ci

ci*s

≤ r(C*) since ci* is closest center

½ r(C)

½ r(C)

Δ-inequality

C*

site

Center selection

Lemma. Let C* be an optimal set of centers. Then r(C) ≤ 2r (C*).

Theorem. Greedy algorithm is a 2-approximation for center selection

problem.

Remark. Greedy algorithm always places centers at sites, but is still within

a factor of 2 of best solution that is allowed to place centers anywhere.

Question. Is there hope of a 3/2-approximation? 4/3?

23

e.g., points in the plane

Dominating set reduces to center selection

Theorem. Unless P = NP, there no ρ-approximation for center selection

problem for any ρ < 2.

Pf. We show how we could use a (2 – ε) approximation algorithm for

CENTER-SELECTION selection to solve DOMINATING-SET in poly-time.

・Let G = (V, E), k be an instance of DOMINATING-SET.

・Construct instance Gʹ of CENTER-SELECTION with sites V and distances - dist(u, v) = 1 if (u, v) ∈ E- dist(u, v) = 2 if (u, v) ∉ E

・Note that Gʹ satisfies the triangle inequality.

・G has dominating set of size k iff there exists k centers C* with r(C*) = 1.

・Thus, if G has a dominating set of size k, a (2 – ε)-approximation

algorithm for CENTER-SELECTION would find a solution C* with r(C*) = 1

since it cannot use any edge of distance 2. ▪

24

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.4

Weighted vertex cover

Definition. Given a graph G = (V, E), a vertex cover is a set S ⊆ V such that

each edge in E has at least one end in S.

Weighted vertex cover. Given a graph G with vertex weights, find a vertex

cover of minimum weight.

26

4

9

2

2

4

9

2

2

weight = 2 + 2 + 4 weight = 11

Pricing method

Pricing method. Each edge must be covered by some vertex.

Edge e = (i, j) pays price pe ≥ 0 to use both vertex i and j.

Fairness. Edges incident to vertex i should pay ≤ wi in total.

Fairness lemma. For any vertex cover S and any fair prices pe : ∑e pe ≤ w(S).

Pf. ▪

27

4

9

2

2

for each vertex i : pee=(i , j)∑ ≤ wi

sum fairness inequalities for each node in S

each edge e covered by at least one node in S

Pricing method

Set prices and find vertex cover simultaneously.

28

WEIGHTED-VERTEX-COVER (G, w) __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

S ← ∅.

FOREACH e ∈ E

pe ← 0.

WHILE (there exists an edge (i, j) such that neither i nor j is tight)

Select such an edge e = (i, j).

Increase pe as much as possible until i or j tight. S ← set of all tight nodes.

RETURN S.__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Pricing method example

29

vertex weight

price of edge a-b

Pricing method: analysis

Theorem. Pricing method is a 2-approximation for WEIGHTED-VERTEX-COVER.

Pf.

・Algorithm terminates since at least one new node becomes tight after

each iteration of while loop.

・Let S = set of all tight nodes upon termination of algorithm.

S is a vertex cover: if some edge (i, j) is uncovered, then neither i nor j is tight. But then while loop would not terminate.

・Let S* be optimal vertex cover. We show w(S) ≤ 2 w(S*).

30

w(S) = wii∈ S∑ =

i∈ S∑ pe

e=(i, j)∑ ≤

i∈V∑ pe

e=(i, j)∑ = 2 pe

e∈ E∑ ≤ 2w(S*).

all nodes in S are tight S ⊆ V, prices ≥ 0

fairness lemmaeach edge counted twice

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.6

Weighted vertex cover

Given a graph G = (V, E) with vertex weights wi ≥ 0, find a min-weight subset

of vertices S ⊆ V such that every edge is incident to at least one vertex in S.

32

3

6

10

7

10

7

9

16

23 33

6

9

32

10

total weight = 6 + 9 + 10 + 32 = 57

Weighted vertex cover: ILP formulation

Given a graph G = (V, E) with vertex weights wi ≥ 0, find a min-weight subset

of vertices S ⊆ V such that every edge is incident to at least one vertex in S.

Integer linear programming formulation.

・Model inclusion of each vertex i using a 0/1 variable xi.

Vertex covers in 1–1 correspondence with 0/1 assignments:

S = { i ∈ V : xi = 1}.

・Objective function: minimize Σi wi xi.

・For every edge (i, j), must take either vertex i or j (or both): xi + xj ≥ 1.

33

xi = 0 if vertex i is not in vertex cover 1 if vertex i is in vertex cover" # $

Weighted vertex cover: ILP formulation

Weighted vertex cover. Integer linear programming formulation.

Observation. If x* is optimal solution to ILP, then S = { i ∈ V : xi* = 1} is a min-weight vertex cover.

34

(ILP ) KBM�i�V

wi xi

bXiX xi + xj � 1 (i, j) � E

xi � {0, 1} i � V

Given integers aij, bi, and cj, find integers xj that satisfy:

Observation. Vertex cover formulation proves that INTEGER-PROGRAMMING

is an NP-hard optimization problem.

KBM cTxbXiX Ax � b

x � 0x BMi2;`�H

<latexit sha1_base64="OJBhmaiSNFWzzMjEOJGzuVF/cLA=">AAAC+nicfVHLbtQwFHXCq4TXtCzZWIyoWEUJqtSyK2LDskgdWmkcRo5zk7HqOJF9gzKK8jWsEFt+hCV/gycTxMwUcSRbR+ceX18fp7WSFqPol+ffuXvv/oODh8Gjx0+ePpscHn2yVWMEzESlKnOdcgtKapihRAXXtQFepgqu0pv36/rVFzBWVvoSVzUkJS+0zKXg6KTF5CfLIGfcGL6yaADFsovDuA9YCoXU3VDoO2OM6gPqwMq0artS6p7SYyo+d6zkuLR5d9n3tKWMbblsiGHvXO9at7EC3J7SP5ZtHFP610Kj/1g2lCG02EmNUBjuBmOgs3HUIFhMplEYDaC3STySKRlxsTj0jlhWiaYEjUJxa+dxVGPiGqIUClz7xkLNxQ0vYO6o5iXYpBuy7+krp2Q0r4xbGumgbp/oeGntqkydc0hqv7YW/1WbN5ifJe6RdYOgxeaivFEUK7r+SJpJAwLVyhEujHSzUrHkhgt0371zy9C7BrHzkq5ttBRVBnuqwhYN712K8X5mt8nsTfg2jD6eTM/PxjgPyAvykrwmMTkl5+QDuSAzIrxTL/Fyr/B7/6v/zf++sfreeOY52YH/4zeEEuJg</latexit><latexit sha1_base64="OJBhmaiSNFWzzMjEOJGzuVF/cLA=">AAAC+nicfVHLbtQwFHXCq4TXtCzZWIyoWEUJqtSyK2LDskgdWmkcRo5zk7HqOJF9gzKK8jWsEFt+hCV/gycTxMwUcSRbR+ceX18fp7WSFqPol+ffuXvv/oODh8Gjx0+ePpscHn2yVWMEzESlKnOdcgtKapihRAXXtQFepgqu0pv36/rVFzBWVvoSVzUkJS+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Mn�

j=1cjxj

bXiXn�

j=1aijxj � bi 1 � i � m

xj � 0 1 � j � n

xj BMi2;`�H 1 � j � n

Linear programming

Given integers aij, bi, and cj, find real numbers xj that satisfy:

Linear. No x2, xy, arccos(x), x (1 – x), etc.

Simplex algorithm. [Dantzig 1947] Can solve LP in practice.

Ellipsoid algorithm. [Khachiyan 1979] Can solve LP in poly-time.

Interior point algorithms. [Karmarkar 1984, Renegar 1988, … ]

Can solve LP both in poly-time and in practice.

36

KBMn�

j=1cjxj

bXiXn�

j=1aijxj � bi 1 � i � m

xj � 0 1 � j � n

xj BMi2;`�H 1 � j � n

KBM cTxbXiX Ax � b

x � 0x BMi2;`�H

<latexit sha1_base64="OJBhmaiSNFWzzMjEOJGzuVF/cLA=">AAAC+nicfVHLbtQwFHXCq4TXtCzZWIyoWEUJqtSyK2LDskgdWmkcRo5zk7HqOJF9gzKK8jWsEFt+hCV/gycTxMwUcSRbR+ceX18fp7WSFqPol+ffuXvv/oODh8Gjx0+ePpscHn2yVWMEzESlKnOdcgtKapihRAXXtQFepgqu0pv36/rVFzBWVvoSVzUkJS+0zKXg6KTF5CfLIGfcGL6yaADFsovDuA9YCoXU3VDoO2OM6gPqwMq0artS6p7SYyo+d6zkuLR5d9n3tKWMbblsiGHvXO9at7EC3J7SP5ZtHFP610Kj/1g2lCG02EmNUBjuBmOgs3HUIFhMplEYDaC3STySKRlxsTj0jlhWiaYEjUJxa+dxVGPiGqIUClz7xkLNxQ0vYO6o5iXYpBuy7+krp2Q0r4xbGumgbp/oeGntqkydc0hqv7YW/1WbN5ifJe6RdYOgxeaivFEUK7r+SJpJAwLVyhEujHSzUrHkhgt0371zy9C7BrHzkq5ttBRVBnuqwhYN712K8X5mt8nsTfg2jD6eTM/PxjgPyAvykrwmMTkl5+QDuSAzIrxTL/Fyr/B7/6v/zf++sfreeOY52YH/4zeEEuJg</latexit><latexit sha1_base64="OJBhmaiSNFWzzMjEOJGzuVF/cLA=">AAAC+nicfVHLbtQwFHXCq4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aivFEUK7r+SJpJAwLVyhEujHSzUrHkhgt0371zy9C7BrHzkq5ttBRVBnuqwhYN712K8X5mt8nsTfg2jD6eTM/PxjgPyAvykrwmMTkl5+QDuSAzIrxTL/Fyr/B7/6v/zf++sfreeOY52YH/4zeEEuJg</latexit>

LP feasible region

LP geometry in 2D.

37

x1 + 2x2 = 62x1 + x2 = 6

x2 = 0

x1 = 0

Weighted vertex cover: LP relaxation

Linear programming relaxation.

Observation. Optimal value of LP is ≤ optimal value of ILP.

Pf. LP has fewer constraints.

Note. LP solution x* may not correspond to a vertex cover.

(even if all weights are 1)

Q. How can solving LP help us find a low-weight vertex cover?

A. Solve LP and round fractional values in x*.

38

½½

½

(LP ) KBM�i�V

wi xi

bXiX xi + xj � 1 (i, j) � E

xi � 0 i � V

Weighted vertex cover: LP rounding algorithm

Lemma. If x* is optimal solution to LP, then S = { i ∈ V : xi* ≥ ½ } is a

vertex cover whose weight is at most twice the min possible weight.

Pf. [ S is a vertex cover ]

・Consider an edge (i, j) ∈ E.

・Since xi* + xj* ≥ 1, either xi* ≥ ½ or xj* ≥ ½ (or both) ⇒ (i, j) covered.

Pf. [ S has desired weight ]

・Let S* be optimal vertex cover. Then

Theorem. The rounding algorithm is a 2-approximation algorithm.

Pf. Lemma + fact that LP can be solved in poly-time.

39

wii ∈ S*∑ ≥ wi xi

*

i ∈ S∑ ≥ 1

2 wii ∈ S∑

LP is a relaxation xi* ≥ ½

Weighted vertex cover inapproximability

Theorem. [Dinur–Safra 2004] If P ≠ NP, then no ρ-approximation algorithm

for WEIGHTED-VERTEX-COVER for any ρ < 1.3606 (even if all weights are 1).

Open research problem. Close the gap.

40

On the Hardness of Approximating Minimum Vertex Cover

Irit Dinur! Samuel Safra†

May 26, 2004

Abstract

We prove the Minimum Vertex Cover problem to be NP-hard to approximate to withina factor of 1.3606, extending on previous PCP and hardness of approximation technique. Tothat end, one needs to develop a new proof framework, and borrow and extend ideas fromseveral fields.

1 Introduction

The basic purpose of Computational Complexity Theory is to classify computational problemsaccording to the amount of resources required to solve them. In particular, the most basic taskis to classify computational problems to those that are e!ciently solvable and those that arenot. The complexity class P consists of all problems that can be solved in polynomial-time. Itis considered, for this rough classification, as the class of e!ciently-solvable problems. Whilemany computational problems are known to be in P, many others, are neither known to be inP, nor proven to be outside P. Indeed many such problems are known to be in the class NP,namely the class of all problems whose solutions can be verified in polynomial-time. When itcomes to proving that a problem is outside a certain complexity class, current techniques areradically inadequate. The most fundamental open question of Complexity Theory, namely, theP vs. NP question, may be a particular instance of this shortcoming.

While the P vs NP question is wide open, one may still classify computational problems intothose in P and those that are NP-hard [Coo71, Lev73, Kar72]. A computational problem Lis NP-hard if its complexity epitomizes the hardness of NP. That is, any NP problem can bee!ciently reduced to L. Thus, the existence of a polynomial-time solution for L implies P=NP.Consequently, showing P!=NP would immediately rule out an e!cient algorithm for any NP-hard problem. Therefore, unless one intends to show NP=P, one should avoid trying to comeup with an e!cient algorithm for an NP-hard problem.

Let us turn our attention to a particular type of computational problems, namely, optimizationproblems — where one looks for an optimal among all plausible solutions. Some optimizationproblems are known to be NP-hard, for example, finding a largest size independent set in agraph [Coo71, Kar72], or finding an assignment satisfying the maximum number of clauses in agiven 3CNF formula (MAX3SAT) [Kar72].

! The Miller Institute, UC Berkeley. Email: [email protected].† School of Mathematics and School of Computer Science, Tel Aviv University and The Miller Institute, UC

Berkeley. Research supported in part by the Fund for Basic Research administered by the Israel Academy ofSciences, and a Binational US-Israeli BSF grant. Email: [email protected].

1

Weighted vertex cover inapproximability

Theorem. [Kohot–Regev 2008] If Unique Games Conjecture is true, then no

2 − ε approximation algorithm for WEIGHTED-VERTEX-COVER for any ε > 0.

Open research problem. Prove the Unique Games Conjecture.

41

Journal of Computer and System Sciences 74 (2008) 335–349

Vertex cover might be hard to approximate to within 2 ! !

Subhash Khot a,1, Oded Regev b,",2

a Department of Computer Science, Princeton University, Princeton, NJ 08544, USAb Department of Computer Science, Tel-Aviv University, Tel-Aviv 69978, Israel

Received 28 May 2003; received in revised form 25 April 2006

Available online 13 June 2007

Abstract

Based on a conjecture regarding the power of unique 2-prover-1-round games presented in [S. Khot, On the power of unique2-Prover 1-Round games, in: Proc. 34th ACM Symp. on Theory of Computing, STOC, May 2002, pp. 767–775], we show thatvertex cover is hard to approximate within any constant factor better than 2. We actually show a stronger result, namely, based onthe same conjecture, vertex cover on k-uniform hypergraphs is hard to approximate within any constant factor better than k.! 2007 Elsevier Inc. All rights reserved.

Keywords: Hardness of approximation; Vertex cover; Unique games conjecture

1. Introduction

Minimum vertex cover is the problem of finding the smallest set of vertices that touches all the edges in a givengraph. This is one of the most fundamental NP-complete problems. A simple 2-approximation algorithm exists for thisproblem: construct a maximal matching by greedily adding edges and then let the vertex cover contain both endpointsof each edge in the matching. It can be seen that the resulting set of vertices indeed touches all the edges and thatits size is at most twice the size of the minimum vertex cover. However, despite considerable efforts, state of the arttechniques can only achieve an approximation ratio of 2 ! o(1) [16,21].

Given this state of affairs, one might strongly suspect that vertex cover is NP-hard to approximate within 2 ! ! forany ! > 0. This is one of the major open questions in the field of approximation algorithms. In [18], Håstad showedthat approximating vertex cover within constant factors less than 7

6 is NP-hard. This factor was recently improved byDinur and Safra [10] to 1.36. In a related result, Arora et al. [1] considered algorithms based on linear programming.They showed an integrality gap of 2 ! ! for a large family of linear programs for vertex cover. This implies that manylinear programming based algorithms cannot obtain an approximation ratio better than 2.

* Corresponding author.E-mail address: [email protected] (S. Khot).

1 Supported by Prof. Sanjeev Arora’s David and Lucile Packard Fellowship, NSF Grant CCR-0098180, and an NSF ITR grant.2 Supported by an Alon Fellowship, by the Binational Science Foundation, by the Israel Science Foundation, and by the EU Integrated

Project QAP.

0022-0000/$ – see front matter ! 2007 Elsevier Inc. All rights reserved.doi:10.1016/j.jcss.2007.06.019

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.7

Generalized load balancing

Input. Set of m machines M; set of n jobs J.

・Job j ∈ J must run contiguously on an authorized machine in Mj ⊆ M.

・Job j ∈ J has processing time tj.

・Each machine can process at most one job at a time.

Def. Let Ji be the subset of jobs assigned to machine i. The load of machine i is Li = Σj ∈ Ji tj.

Def. The makespan is the maximum load on any machine = maxi Li.

Generalized load balancing. Assign each job to an authorized machine to

minimize makespan.

43

Generalized load balancing: integer linear program and relaxation

ILP formulation. xij = time machine i spends processing job j.

LP relaxation.

44

(IP) min Ls. t. xi j

i∑ = t j for all j ∈ J

xi jj∑ ≤ L for all i ∈ M

xi j ∈ {0, t j} for all j ∈ J and i ∈ M j

xi j = 0 for all j ∈ J and i ∉ M j

(LP) min Ls. t. xi j

i∑ = t j for all j ∈ J

xi jj∑ ≤ L for all i ∈ M

xi j ≥ 0 for all j ∈ J and i ∈ M j

xi j = 0 for all j ∈ J and i ∉ M j

Generalized load balancing: lower bounds

Lemma 1. The optimal makespan L* ≥ maxj tj.

Pf. Some machine must process the most time-consuming job. ▪

Lemma 2. Let L be optimal value to the LP. Then, optimal makespan L* ≥ L.

Pf. LP has fewer constraints than ILP formulation. ▪

45

Generalized load balancing: structure of LP solution

Lemma 3. Let x be solution to LP. Let G(x) be the graph with an edge

between machine i and job j if xij > 0. Then G(x) is acyclic.

Pf. (deferred)

46

G(x) acyclic

can transform x into another LP solution where G(x) is acyclic if LP solver doesn’t return such an x

G(x) cyclic

xij > 0

job

machine

Generalized load balancing: rounding

Rounded solution. Find LP solution x where G(x) is a forest. Root forest G(x) at some arbitrary machine node r.

・If job j is a leaf node, assign j to its parent machine i.

・If job j is not a leaf node, assign j to any one of its children.

Lemma 4. Rounded solution only assigns jobs to authorized machines.

Pf. If job j is assigned to machine i, then xij > 0. LP solution can only assign

positive value to authorized machines. ▪

47

job

machine

Generalized load balancing: analysis

Lemma 5. If job j is a leaf node and machine i = parent(j), then xij = tj.

Pf.

・Since i is a leaf, xij = 0 for all j ≠ parent(i).

・LP constraint guarantees Σi xij = tj. ▪

Lemma 6. At most one non-leaf job is assigned to a machine.

Pf. The only possible non-leaf job assigned to machine i is parent(i). ▪

48

job

machine

Generalized load balancing: analysis

Theorem. Rounded solution is a 2-approximation.

Pf.

・Let J(i) be the jobs assigned to machine i.

・By LEMMA 6, the load Li on machine i has two components:

- leaf nodes:

- parent:

・Thus, the overall load Li ≤ 2 L*. ▪

49

t j j ∈ J(i)j is a leaf

∑ = xij j ∈ J(i)j is a leaf

∑ ≤ xijj ∈ J∑ ≤ L ≤ L *

Lemma 5Lemma 2 (LP is a relaxation)

tparent(i) ≤ L *

LP

Lemma 1optimal value of LP

Generalized load balancing: flow formulation

Flow formulation of LP.

Observation. Solution to feasible flow problem with value L are in

1-to-1 correspondence with LP solutions of value L.

50

xi ji∑ = t j for all j ∈ J

xi jj∑ ≤ L for all i ∈ M

xi j ≥ 0 for all j ∈ J and i ∈ M j

xi j = 0 for all j ∈ J and i ∉ M j

Generalized load balancing: structure of solution

Lemma 3. Let (x, L) be solution to LP. Let G(x) be the graph with an edge

from machine i to job j if xij > 0. We can find another solution (xʹ, L) such that

G(xʹ) is acyclic.

Pf. Let C be a cycle in G(x).

・Augment flow along the cycle C.

・At least one edge from C is removed (and none are added).

・Repeat until G(xʹ) is acyclic. ▪

51

3

4

4

3

2

3

1

2

6

5

G(x)

3

4

4

3

3

4

1

6

5

G(x′)

augment flowalong cycle C

flow conservation maintained

Conclusions

Running time. The bottleneck operation in our 2-approximation is

solving one LP with m n + 1 variables.

Remark. Can solve LP using flow techniques on a graph with m + n + 1 nodes:

given L, find feasible flow if it exists. Binary search to find L*.

Extensions: unrelated parallel machines. [Lenstra–Shmoys–Tardos 1990]

・Job j takes tij time if processed on machine i.

・2-approximation algorithm via LP rounding.

・If P ≠ NP, then no no ρ-approximation exists for any ρ < 3/2.

52

Mathematical Programming 46 (1990) 259-271 259 North-Holland

A P P R O X I M A T I O N A L G O R I T H M S FOR S C H E D U L I N G UNRELATED PARALLEL M A C H I N E S

Jan Karel LENSTRA Eindhoven University of Technology, Eindhoven, The Netherlands, and Centre for Mathematics and Computer Science, Amsterdam, The Netherlands

David B. SHMOYS and l~va TARDOS Cornell University, Ithaca, NY, USA

Received 1 October 1987 Revised manuscript 26 August 1988

We consider the following scheduling problem. There are m parallel machines and n independent .jobs. Each job is to be assigned to one of the machines. The processing of .job j on machine i requires time Pip The objective is to lind a schedule that minimizes the makespan.

Our main result is a polynomial algorithm which constructs a schedule that is guaranteed to be no longer than twice the optimum. We also present a polynomial approximation scheme for the case that the number of machines is fixed. Both approximation results are corollaries of a theorem about the relationship of a class of integer programming problems and their linear programming relaxations. In particular, we give a polynomial method to round the fractional extreme points of the linear program to integral points that nearly satisfy the constraints.

In contrast to our main result, we prove that no polynomial algorithm can achieve a worst-case ratio less than ~ unless P = NIL We finally obtain a complexity classification for all special cases with a fixed number of processing times.

Key words: Scheduling, parallel machines, approximation algorithm, worst case analysis, linear programming, integer programming, rounding.

1. Introduction

Although the performance of approximation algorithms has been studied for over twenty years, very little is understood about the structural properties of a problem that permit good performance guarantees. In fact, there are practically no tools to distinguish those problems for which there does exist a polynomial algorithm for any performance bound, and those for which this is not the case. One problem area in which these questions have received much attention is that of scheduling and bin packing. We examine a scheduling problem for which all previously analyzed polynomial algorithms have particularly poor performance guarantees. We present

A preliminary version of this paper appeared in the Proceedings c~f the 28th Annual lEEK Symposium on the Foundations of Computer Stience (Computer Society Press of the lEEK, Washington, I).C., 1987) pp. 217 224.

11. APPROXIMATION ALGORITHMS

‣ load balancing

‣ center selection

‣ pricing method: weighted vertex cover

‣ LP rounding: weighted vertex cover

‣ generalized load balancing

‣ knapsack problem

SECTION 11.8

Polynomial-time approximation scheme

PTAS. (1 + ε)-approximation algorithm for any constant ε > 0.

・Load balancing. [Hochbaum–Shmoys 1987]

・Euclidean TSP. [Arora, Mitchell 1996]

Consequence. PTAS produces arbitrarily high quality solution,

but trades off accuracy for time.

This section. PTAS for knapsack problem via rounding and scaling.

54

Knapsack problem

Knapsack problem.

・Given n objects and a knapsack.

・Item i has value vi > 0 and weighs wi > 0.

・Knapsack has weight limit W.

・Goal: fill knapsack so as to maximize total value.

Ex: { 3, 4 } has value 40.

55

we assume wi ≤ W for each i

original instance (W = 11)

item value weight

1 1 1

2 6 2

3 18 5

4 22 6

5 28 7

Knapsack is NP-complete

KNAPSACK. Given a set X, weights wi ≥ 0, values vi ≥ 0, a weight limit W, and a

target value V, is there a subset S ⊆ X such that:

SUBSET-SUM. Given a set X, values ui ≥ 0, and an integer U, is there a subset S ⊆ X whose elements sum to exactly U ?

Theorem. SUBSET-SUM ≤ P KNAPSACK.

Pf. Given instance (u1, …, un, U) of SUBSET-SUM, create KNAPSACK instance:

56

wii∈S∑ ≤ W

vii∈S∑ ≥ V

vi = wi = ui uii∈S∑ ≤ U

V =W =U uii∈S∑ ≥ U

Knapsack problem: dynamic programming I

Def. OPT(i, w) = max value subset of items 1,..., i with weight limit w.

Case 1. OPT does not select item i.

・OPT selects best of 1, …, i – 1 using up to weight limit w.

Case 2. OPT selects item i.

・New weight limit = w – wi. ・OPT selects best of 1, …, i – 1 using up to weight limit w – wi.

Theorem. Computes the optimal value in O(n W) time.

・Not polynomial in input size.

・Polynomial in input size if weights are small integers.

57

OPT(i, w) =

0 if i = 0OPT(i −1, w) if wi > wmax OPT(i −1, w), vi + OPT(i −1, w−wi ){ } otherwise

#

$ %

& %

Knapsack problem: dynamic programming II

Def. OPT(i, v) = min weight of a knapsack for which we can obtain a solution

of value ≥ v using a subset of items 1,..., i.

Note. Optimal value is the largest value v such that OPT(n, v) ≤ W.

Case 1. OPT does not select item i.

・OPT selects best of 1, …, i – 1 that achieves value ≥ v.

Case 2. OPT selects item i.

・Consumes weight wi, need to achieve value ≥ v – vi. ・OPT selects best of 1, …, i – 1 that achieves value ≥ v – vi.

58

OPT (i, v) =

���

��

0 B7 v � 0

� B7 i = 0 �M/ v > 0

min {OPT (i � 1, v), wi + OPT (i � 1, v � vi)} Qi?2`rBb2

Knapsack problem: dynamic programming II

Theorem. Dynamic programming algorithm II computes the optimal value

in O(n2 vmax) time, where vmax is the maximum of any value.

Pf.

・The optimal value V* ≤ n vmax.

・There is one subproblem for each item and for each value v ≤ V*.

・It takes O(1) time per subproblem. ▪

Remark 1. Not polynomial in input size!

Remark 2. Polynomial time if values are small integers.

59

Knapsack problem: polynomial-time approximation scheme

Intuition for approximation algorithm.

・Round all values up to lie in smaller range.

・Run dynamic programming algorithm II on rounded/scaled instance.

・Return optimal items in rounded instance.

60

original instance (W = 11)

item value weight

1 934221 1

2 5956342 2

3 17810013 5

4 21217800 6

5 27343199 7

rounded instance (W = 11)

item value weight

1 1 1

2 6 2

3 18 5

4 22 6

5 28 7

Knapsack problem: polynomial-time approximation scheme

Round up all values:

・0 < ε ≤ 1 = precision parameter.

・vmax = largest value in original instance.

・θ = scaling factor = ε vmax / 2n.

Observation. Optimal solutions to problem with are equivalent to

optimal solutions to problem with .

Intuition. close to v so optimal solution using is nearly optimal;

small and integral so dynamic programming algorithm II is fast.

61

ˆ v

v

ˆ v

v

v

v̄i =�vi

�� , v̂i =

�vi

Theorem. If S is solution found by rounding algorithm and S* is any other feasible solution, then

Pf. Let S* be any feasible solution satisfying weight constraint.

vmax � 2�

i�S

vi

<latexit sha1_base64="f7vMFGkDVUn5WDalVczXnYcH2K8=">AAACWHicbVDLSgMxFM2M73dbl26CRXFVp0VQ6UZw41LRqtApQya91WCSGZI7pWWYz/Br3OpHiD9jOnZhqwdCDufcm5t74lQKi0Hw6fkLi0vLK6tr6xubW9s7lWrt3iaZ4dDhiUzMY8wsSKGhgwIlPKYGmIolPMQvlxP/YQjGikTf4TiFnmJPWgwEZ+ikqHI8jPJQsVFBadgO24fuklBSSls0tJmKckFDoeltQYeRiCr1oBGUoH9Jc0rqZIrrqOrVwn7CMwUauWTWdptBir2cGRRcQrEeZhZSxl/YE3Qd1UyB7eXlZgU9cEqfDhLjjkZaqr87cqasHavYVSqGz3bem4j/ed0MB2e9XOg0Q9D8Z9AgkxQTOomJ9oUBjnLsCONGuL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9AgkxQTOomJ9oUBjnLsCONGuL9S/swM4+jCnJlSvp0Cn9kkH2Va8KQPc6rEERpWuBSb85n9JZ1W47wR3JzUL86mca6SPbJPjkiTnJILckWuSYdw8kreyDv58L58z1/x135KfW/as0tm4Ne+ASnGs+A=</latexit>

Knapsack problem: polynomial-time approximation scheme

62

solve rounded instance optimally

i�S�

vi ��

i�S�

v̄i

��

i�S

v̄i

��

i�S

(vi + �)

��

i�S

vi + n�

=�

i�S

vi + 12 � vmax

= (1 + �)�

i�S

vi

never round up by more than θ

i�S�

vi ��

i�S�

v̄i

��

i�S

v̄i

��

i�S

(vi + �)

��

i�S

vi + n�

=�

i�S

vi + 12 � vmax

= (1 + �)�

i�S

vi

| S | ≤ n

i�S�

vi ��

i�S�

v̄i

��

i�S

v̄i

��

i�S

(vi + �)

��

i�S

vi + n�

=�

i�S

vi + 12 � vmax

= (1 + �)�

i�S

vi

always round up�

i�S�

vi ��

i�S�

v̄i

��

i�S

v̄i

��

i�S

(vi + �)

��

i�S

vi + n�

=�

i�S

vi + 12 � vmax

= (1 + �)�

i�S

vi

� (1 + �)�

i�S

vi vmax ≤ 2 Σi ∈ S vi

i�S�

vi ��

i�S�

v̄i

��

i�S

v̄i

��

i�S

(vi + �)

��

i�S

vi + n�

=�

i�S

vi + 12 � vmax

� (1 + �)�

i�S

vi

<latexit sha1_base64="lmgXi5UfPcKd5/JFRedAnI9rjp0=">AAAD7XicpZJbaxNBFMcnu15qvLX10ZfBoKQVwm4RbAmFgi8+RjS2molhdnLSDJ2dXWbOhoRlv4ZP4qsfxE/ht3F2s4i50IIeWPjPufzOzNkTpUpaDIJfDc+/dfvO3Z17zfsPHj56vLu3/9EmmRHQF4lKzEXELSipoY8SFVykBngcKTiPrt6U8fMZGCsT/QEXKQxjfqnlRAqOzjXaa/xkNotHuaRMavr+y2FBZyN36LLuC8oUVIpu5LCIm2Uia9Jtdh2gKOP/B2iXpS8pwykgP/hHyPKhJaZLdc26AUVPl6TrUAwnhos8LPK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RbAmFgi8+RjS2molhdnLSDJ2dXWbOhoRlv4ZP4qsfxE/ht3F2s4i50IIeWPjPufzOzNkTpUpaDIJfDc+/dfvO3Z17zfsPHj56vLu3/9EmmRHQF4lKzEXELSipoY8SFVykBngcKTiPrt6U8fMZGCsT/QEXKQxjfqnlRAqOzjXaa/xkNotHuaRMavr+y2FBZyN36LLuC8oUVIpu5LCIm2Uia9Jtdh2gKOP/B2iXpS8pwykgP/hHyPKhJaZLdc26AUVPl6TrUAwnhos8LPKjojpDaqVKdKlno5zFfF7c1ObPlWk7LKk14mBrXzbabQWdoDK6KcJatEhtPffb99k4EVkMGoXi1g7CIMVhzg1KoaBossxCysUVv4SBk5rHYId5tW4Ffe48YzpJjPs00sr7d0XOY2sXceQyY45Tux4rndtigwwnx8Nc6jRD0GLZaJIpigktd5eOpQGBauEEF0a6u1Ix5W7Y6DZ8pUvFTkGsvCSfZ1qKZAxrXoVzNLxwUwzXZ7Yp+kedk07w7lXr7Lge5w55Sp6RNgnJa3JG3pIe6RPhHXo975P32U/9r/43//sy1WvUNU/Iivk/fgP5bR6R</latexit>

θ = ε vmax / 2n

(1 + �)�

i�S

vi ��

i�S�

vi

choosing S* = { max }

thus

subset containing only the item

of largest value

vmax ��

i�S

vi + 12 � vmax

��

i�S

vi + 12 vmax

<latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit><latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit><latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit>

vmax ��

i�S

vi + 12 � vmax

��

i�S

vi + 12 vmax

<latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit><latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit><latexit sha1_base64="wCmh0r2ei0YRvHzhQc6C2YWS3U4=">AAAC43icnZHNattAEMdXSj9S98tJjr0sNS2FgpFCoCm+BAolt7q0bgJeI1brUbJkP8TuyNgIvUFPode+SN+kb9OVYkrt5NQBrX76z+6M9j95qaTHJPkdxTv37j94uPuo9/jJ02fP+3v737ytnICJsMq685x7UNLABCUqOC8dcJ0rOMuvPrT5swU4L635iqsSZppfGFlIwTFIWf/XIquZ5suGUjZio9fhpaDDQL7SWS0pk4Z+aegiCziib9uFYeG4qNOmPmy6byi9VNa0/LciYz16R/x3n63iWX+QDJMu6G1I1zAg6xhne9E+m1tRaTAoFPd+miYlzmruUAoFTY9VHkourvgFTAMarsHP6s7khr4KypwW1oXHIO3Uf0/UXHu/0nnYqTle+u1cK96Vm1ZYHM9qacoKwYibRkWlKFraTozOpQOBahWACyfDv1JxyYMtGOa60aWrXYLYuEm9rIwUdg5bqsIlOt4EF9Ntz27D5HD4fph8PhqcHK/t3CUvyEvyhqTkHTkhp2RMJkRENPoYfYrGcRF/j6/jHzdb42h95oBsRPzzDxEc3Sg=</latexit>

Knapsack problem: polynomial-time approximation scheme

Theorem. For any ε > 0, the rounding algorithm computes a feasible solution

whose value is within a (1 + ε) factor of the optimum in O(n3 / ε) time.

Pf.

・We have already proved the accuracy bound.

・Dynamic program II running time is , where

63

O(n2 ˆ v max)

v̂max =�vmax

�=

�2n

<latexit sha1_base64="58X0JzzE4JOLvRSW88AYM8xzOSA=">AAACpnicbVFNaxsxENVuv5L0I45zzEXUFNqLWYdCE0wg0EtvTSFbByzjzsqzXhGttEizwWbZH9pz/0jlj0LtZEDi8eY9jfSUVVp5SpLfUfzs+YuXrw4Oj16/efvuuHPS/elt7SSm0mrr7jLwqJXBlBRpvKscQplpHGX3X1f90QM6r6y5pWWFkxLmRuVKAgVq2mlFAcQfpo0oYdFyMbwSQy405hR2iUpzkTuQzT9F2wgqkCBInZoXQeU2qiG/4k9bz00wYeWVtmbPNu30kn6yLv4YDLagx7Z1Mz2JumJmZV2iIanB+/EgqWjSgCMlNbZHovZYgbyHOY4DNFCinzTrnFr+ITAznlsXliG+Zv93NFB6vyyzoCyBCr/fW5FP9cY15ReTRpmqJjRyMyivNSfLV6HzmXIoSS8DAOlUuCuXBYRwKHzNzpT12RXKnZc0i9ooaWe4x2pakIM2pDjYz+wxSM/7l/3kx+fe9cU2zgN2xt6zj2zAvrBr9o3dsJRJ9ic6jLrRafwp/h6n8WgjjaOt55TtVPzrL8dn0hI=</latexit><latexit sha1_base64="58X0JzzE4JOLvRSW88AYM8xzOSA=">AAACpnicbVFNaxsxENVuv5L0I45zzEXUFNqLWYdCE0wg0EtvTSFbByzjzsqzXhGttEizwWbZH9pz/0jlj0LtZEDi8eY9jfSUVVp5SpLfUfzs+YuXrw4Oj16/efvuuHPS/elt7SSm0mrr7jLwqJXBlBRpvKscQplpHGX3X1f90QM6r6y5pWWFkxLmRuVKAgVq2mlFAcQfpo0oYdFyMbwSQy405hR2iUpzkTuQzT9F2wgqkCBInZoXQeU2qiG/4k9bz00wYeWVtmbPNu30kn6yLv4YDLagx7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