Advanced Algorithms 南京大学 尹一通

Similar documents
Integer Programming (IP)

- Well-characterized problems, min-max relations, approximate certificates. - LP problems in the standard form, primal and dual linear programs

Dual fitting approximation for Set Cover, and Primal Dual approximation for Set Cover

Lectures 6, 7 and part of 8

Lecture 15 (Oct 6): LP Duality

Lecture 6,7 (Sept 27 and 29, 2011 ): Bin Packing, MAX-SAT

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

4. Duality Duality 4.1 Duality of LPs and the duality theorem. min c T x x R n, c R n. s.t. ai Tx = b i i M a i R n

Topics in Approximation Algorithms Solution for Homework 3

Linear Programming. Scheduling problems

BBM402-Lecture 20: LP Duality

Lecture 11 October 7, 2013

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

In the original knapsack problem, the value of the contents of the knapsack is maximized subject to a single capacity constraint, for example weight.

Approximation Algorithms

Introduction to Mathematical Programming IE406. Lecture 10. Dr. Ted Ralphs

Network Design and Game Theory Spring 2008 Lecture 6

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

CO759: Algorithmic Game Theory Spring 2015

Lecture #21. c T x Ax b. maximize subject to

IE 5531: Engineering Optimization I

Duality of LPs and Applications

Topic: Primal-Dual Algorithms Date: We finished our discussion of randomized rounding and began talking about LP Duality.

Duality Theory, Optimality Conditions

Discrete (and Continuous) Optimization WI4 131

Maximum flow problem

4. Duality and Sensitivity

Excluded t-factors in Bipartite Graphs:

Chapter 1: Linear Programming

Advanced Linear Programming: The Exercises

The Simplex Algorithm

The Primal-Dual Algorithm P&S Chapter 5 Last Revised October 30, 2006

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

4.6 Linear Programming duality

Linear Programming Duality

Lecture 5. x 1,x 2,x 3 0 (1)

Acyclic Semidefinite Approximations of Quadratically Constrained Quadratic Programs

Lecture 20: LP Relaxation and Approximation Algorithms. 1 Introduction. 2 Vertex Cover problem. CSCI-B609: A Theorist s Toolkit, Fall 2016 Nov 8

Introduction to Semidefinite Programming I: Basic properties a

3.10 Lagrangian relaxation

CSC Linear Programming and Combinatorial Optimization Lecture 10: Semidefinite Programming

Planning and Optimization

LP Duality: outline. Duality theory for Linear Programming. alternatives. optimization I Idea: polyhedra

Cutting Plane Methods II

1 Review Session. 1.1 Lecture 2

Discrete (and Continuous) Optimization Solutions of Exercises 2 WI4 131

Optimisation and Operations Research

The Strong Duality Theorem 1

CS261: A Second Course in Algorithms Lecture #9: Linear Programming Duality (Part 2)

Lecture 10: Linear programming. duality. and. The dual of the LP in standard form. maximize w = b T y (D) subject to A T y c, minimize z = c T x (P)

Algorithms. Outline! Approximation Algorithms. The class APX. The intelligence behind the hardware. ! Based on

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

6. Linear Programming

3.4 Relaxations and bounds

CO 250 Final Exam Guide

Operations Research Lecture 6: Integer Programming

Integer Linear Programs

3. Duality: What is duality? Why does it matter? Sensitivity through duality.

Dual bounds: can t get any better than...

Linear Programming: Chapter 5 Duality

Summary of the simplex method

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi

Semidefinite and Second Order Cone Programming Seminar Fall 2001 Lecture 5

ACO Comprehensive Exam March 17 and 18, Computability, Complexity and Algorithms

SDP Relaxations for MAXCUT

15.1 Matching, Components, and Edge cover (Collaborate with Xin Yu)

Review Solutions, Exam 2, Operations Research

Approximation Basics

Convex Optimization and Support Vector Machine

ABHELSINKI UNIVERSITY OF TECHNOLOGY

CSCI5654 (Linear Programming, Fall 2013) Lecture-8. Lecture 8 Slide# 1

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

Part 1. The Review of Linear Programming

Conic Linear Optimization and its Dual. yyye

P,NP, NP-Hard and NP-Complete

Linear and Combinatorial Optimization

Solutions to Exercises

COMP3121/9101/3821/9801 Lecture Notes. Linear Programming

Chapter 1 Linear Programming. Paragraph 5 Duality

Advanced Algorithms 南京大学 尹一通

Approximation Algorithms and Hardness of Approximation. IPM, Jan Mohammad R. Salavatipour Department of Computing Science University of Alberta

Introduction to Mathematical Programming

Welfare Maximization with Friends-of-Friends Network Externalities

Lagrangian Duality and Convex Optimization

Optimization for Communications and Networks. Poompat Saengudomlert. Session 4 Duality and Lagrange Multipliers

Midterm Review. Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A.

Sensitivity Analysis and Duality

56:171 Operations Research Fall 1998

3.7 Cutting plane methods

NP-Complete Problems. More reductions

Lecture 5 January 16, 2013

Discrete Optimization 2010 Lecture 8 Lagrangian Relaxation / P, N P and co-n P

Local Search Based Approximation Algorithms. Vinayaka Pandit. IBM India Research Laboratory

A Review of Linear Programming

Extreme Abridgment of Boyd and Vandenberghe s Convex Optimization

4. The Dual Simplex Method

Algorithmic Game Theory and Applications. Lecture 7: The LP Duality Theorem

Ω R n is called the constraint set or feasible set. x 1

Today: Linear Programming (con t.)

Transcription:

Advanced Algorithms 南京大学 尹一通

LP-based Algorithms LP rounding: Relax the integer program to LP; round the optimal LP solution to a nearby feasible integral solution. The primal-dual schema: Find a pair of solutions to the primal and dual programs which are close to each other.

Vertex Cover Instance: An undirected graph G(V,E) Find the smallest C V that every edge has at least one endpoint in C. e 1 v1 e 2 e 1 e 3 v3 v2 e 2 e 3 v1 v2 e 5 e 6 e 4 v4 incidence graph e 4 e 5 e 6 v3 v4 instance of set cover with frequency =2

Instance: An undirected graph G(V,E) Find the smallest C V that every edge has at least one endpoint in C. Find a maximal matching M; return the set C ={v: uv M} of matched vertices; maximality C is vertex cover e 1 matching M OPTVC (weak duality) e 2 e 3 e 4 v1 v2 v3 C 2 M 2OPT e 5 e 6 v4

Duality e 1 vertex cover: matching: e 2 e 3 e 4 e 5 e 6 constraints v e xv 1 variables ye {0,1} v1 v2 v3 v4 variables xv {0,1} constraints e v ye 1

Duality Instance: graph G(V,E) primal: dual: minimize subject to v2v v2e maximize subject to x v x v 1, x v 2 {0, 1}, e2e e3v y e y v apple 1, y e 2 {0, 1}, 8e 2 E 8v 2 V 8v 2 V 8e 2 E vertex covers matchings

Duality for LP-Relaxation Instance: graph G(V,E) primal: dual: minimize subject to v2v v2e maximize subject to e2e e3v x v x v 1, x v 0, y e y v apple 1, y e 0, 8e 2 E 8v 2 V 8v 2 V 8e 2 E

Estimate the Optima minimize subject to 7x 1 + x 2 + 5x 3 x 1 x 2 + 3x 3 10 + 5x 1 + 2x 2 x 3 6 + = x 1,x 2,x 3 0 16 16 OPT any feasible solution

Estimate the Optima minimize 7x 1 + x 2 + 5x 3 subject to y 1 x 1 x 2 + 3x 3 10 y 1 + + y 2 5x 1 + 2x 2 x 3 6 y 2 x 1,x 2,x 3 0 10y 1 +6y 2 OPT for any y 1 + 5y 2 7 y 1 + 2y 2 1 3y 1 y 2 5 y 1,y 2 0

Primal-Dual Primal min 7x 1 + x 2 + 5x 3 x 1 x 2 + 3x 3 10 5x 1 + 2x 2 x 3 6 x 1,x 2,x 3 0 Dual max 10y 1 +6y 2 dual feasible y 1 + 5y 2 7 primal OPT y 1 + 2y 2 1 3y 1 y 2 5 LP NP conp y 1,y 2 0

Surviving Problem price vitamin 1 c1 c2 cn a11 a12 a1n healthy b1 vitamin m am1 am2 amn bm solution: x1 x2 xn minimize the total price while keeping healthy

Surviving Problem min c T x Ax b x 0 price vitamin 1 c1 c2 cn a11 a12 a1n healthy b1 vitamin m am1 am2 amn bm solution: x1 x2 xn minimize the total price while keeping healthy

LP Duality Primal: min c T x Dual: max b T y Ax b y T A c T x 0 y 0 dual solution: price c1 c2 cn healthy y1 vitamin 1 a11 a12 a1n b1 ym vitamin m am1 am2 amn bm m types of vitamin pills, design a pricing system competitive to n natural foods, max the total price

LP Duality Primal: min c T x Dual: max b T y Ax b y T A c T x 0 y 0 Monogamy: dual(dual(lp)) = LP Weak Duality: feasible primal solution x and dual solution y y T b y T A x c T x

LP Duality Primal: min c T x Dual: max b T y Ax b y T A c T x 0 y 0 Weak Duality Theorem: feasible primal solution x and dual solution y y T b c T x

LP Duality Primal: min c T x Dual: max b T y Ax b y T A c T x 0 y 0 Strong Duality Theorem: Primal LP has finite optimal solution x * iff dual LP has finite optimal solution y *. y *T b = c T x *

Primal: min c T x Dual: max b T y Ax b x 0 y T A c T y 0 feasible primal solution x and dual solution y y T b y T A x c T x Strong Duality Theorem x and y are both optimal iff y T b = y T A x = c T x i: either Ai x = bi or yi = 0 j: either y T A j = cj or xj = 0 0 1 m m n b i y i = @ a ij x j A y i i=1 n c j x j = i=1 n j=1 j=1 j=1 i=1! m a ij y i x j

Complementary Slackness Primal: min c T x Ax b x 0 Dual: max b T y y T A c T y 0 Complementary Slackness Conditions: feasible primal solution x and dual solution y x and y are both optimal iff i: either Ai x = bi or yi = 0 j: either y T A j = cj or xj = 0

Relaxed Complementary Slackness Primal: min c T x Dual: max b T y Ax b x 0 y T A c T y 0 feasible primal solution x and dual solution y for α, β 1: i: either Ai x α bi or yi = 0 j: either y T A j cj/β or xj = 0 c T x αβ b T y αβ OPTLP n c j x j apple j=1 n j=1! m a ij y i x j = i=1 0 1 m n @ a ij x i A y j i=1 j=1 apple m i=1 b i y i

Primal-Dual Schema Primal IP: min c T x Dual LP-relax: max b T y Ax b x Z 0 y T A c T y 0 Find a primal integral solution x and a dual solution y for α, β 1: i: either Ai x α bi or yi = 0 j: either y T A j cj/β or xj = 0 c T x αβ b T y αβ OPTLP αβ OPTIP

e 1 e 2 e 3 e 4 e 5 e 6 vertex cover: constraints v e xv 1 matching: variables ye {0,1} v1 v2 v3 v4 variables xv {0,1} constraints e v ye 1 primal: dual-relax: min min v2v x v x v 1, 8e 2 E v2e x v 2 {0, 1}, e2e y e y e apple 1, e3v 8v 2 V 8v 2 V y e 0, 8e 2 E feasible (x, y) such that: e: ye > 0 v e xv α v: xv = 1 e v ye = 1

primal: min v2v x v x v 1, 8e 2 E v2e x v 2 {0, 1}, 8v 2 V dual-relax: min e2e y e y e apple 1, e3v 8v 2 V y e 0, 8e 2 E event: v is tight (saturated) e v ye = 1 Initially x = 0, y = 0; while E to 1 pick an e E and raise ye until some v goes tight; set xv = 1 for those tight v and delete all e v from E; v e o every deleted e is incident to a v that xv = 1 e E: v e x v 1 all edges are eventually deleted x is feasible relaxed complementary slackness: e: either v e xv 2 or ye = 0 v: either e v ye = 1 or xv = 0 v2v x v apple 2 OPT

Initially x = 0, y = 0; while E to 1 pick an e E and raise ye until some v goes tight; set xv = 1 for those tight v and delete all e v from E; v e Find a maximal matching; return the set of matched vertices; the returned set is a vertex cover SOL 2 OPT

The Primal-Dual Schema Write down an LP-relaxation and its dual. min c T x Ax b x Z 0 Start with a primal infeasible solution x and a dual feasible solution y (usually x=0, y=0). Raise x and y until x is feasible: raise y until some dual constraints gets tight y T A j = cj ; raise xj (integrally) corresponding to the tight dual constraints. Show the complementary slackness conditions: i: either A i x α b i or y i = 0 j: either y T A j cj/β or xj = 0 max b T y y T A c T y 0 c T x αβ b T y αβ OPT

Integrality Gap LP relaxation of vertex cover : given G(V,E), minimize v V xv subject to v e xv 1, e E xv {0, 1}, v V xv [0, 1], Integrality gap = sup I OPT(I) OPT LP (I) For the LP relaxation of vertex cover: integrality gap = 2

Facility Location hospitals in Nanjing

Facility Location facilities: f i c ij clients: j i Instance: set F of facilities; set C of clients; Find a subset I F of opening facilities and a way φ: C I of connecting all clients to them such that the total cost facility opening costs f: F [0, ); connection costs c: F C [0, ); j2c c (j),j + i2i f i is minimized. uncapacitated facility location; NP-hard; AP(Approximation Preserving)-reduction from Set Cover; [Dinur, Steuer 2014] no poly-time (1-o(1))ln n-approx. algorithm unless NP = P.

Metric Facility Location facilities: clients: j i f i d ij Instance: set F of facilities; set C of clients; facility opening costs f: F [0, ); connection metric d: F C [0, ); Find a subset I F of opening facilities and a way φ: C I of connecting all clients to them such that the total cost triangle inequality: j2c d (j),j + i2i f i is minimized. 8i 1,i 2 2 F, 8j 1,j 2 2 C i1 i2 d i1 j 1 + d i2 j 1 + d i2 j 2 d i1 j 2 j1 j2

Instance: set F of facilities; set C of clients; facility opening costs f: F [0, ); connection metric d: F C [0, ); Find φ: C I F to minimize facilities: LP-relaxation: min x ij,y i 0, d ij y i 2 {0, 1} i f i j2c d (j),j + i2i i2f,j2c d ij x ij + i2f i2f x ij 2 {0, 1} clients: j y i x ij, x ij,y i 2 {0, 1}, indicates i I f i y i x ij 1, 8j 2 C f i indicates i = φ(j) 8i 2 F, j 2 C 8i 2 F, j 2 C

facilities: d ij clients: j i ij j f i Primal: min d ij x ij + f i y i i2f,j2c i2f y i x ij 0, 8i 2 F, j 2 C x ij 1, 8j 2 C i2f x ij,y i 2 {0, 1}, 8i 2 F, j 2 C Dual-relax: max j2c j j ij apple d ij, ij apple f i, j2c 8i 2 F, j 2 C 8i 2 F j, ij 0, 8i 2 F, j 2 C α j : amount of value paid by client j to all facilities βij αj - dij : payment to facility i by client j (after deduction) complimentary slackness conditions: (if ideally held) x ij =1 α j - β ij = d ij ; yi =1 j C βij = fi ; α j > 0 i F x ij = 1 ; βij > 0 yi = xij ;

min d ij x ij + f i y i i2f,j2c i2f y i x ij 0, 8i 2 F, j 2 C x ij 1, 8j 2 C i2f x ij,y i 2 {0, 1}, facilities: 8i 2 F, j 2 C i f i d ij ij j max clients: j j2c j j ij apple d ij, ij apple f i, j2c 8i 2 F, j 2 C 8i 2 F j, ij 0, 8i 2 F, j 2 C Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj;

facilities: i f i d ij ij j clients: j Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj; The events that occur at the same time are processed in arbitrary order. Fully paid facilities are tentatively open: j C βij = fi Fully paid edges to tentatively opening facilities are connected: αj - βij = dij Eventually all clients connect to tentatively opening facilities. A client may connect to more than one facilities!

Phase I: Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj; facilities: i f i d ij ij Phase II: construct graph G(V,E) where V={tentatively open facilities} and (i 1, i 2 ) E if facilities i 1, i 2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility; j clients: j i1 j1 i2 j2

Phase I: Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj; Phase II: construct graph G(V,E) where V={tentatively open facilities} and (i 1, i 2 ) E if facilities i 1, i 2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility; i1 j1 i2 j2 I is independent set Every client is connected to exact one open facilities. (feasible)

facilities: i f i d ij ij j clients: j Primal: min d ij x ij + f i y i i2f,j2c i2f y i x ij 0, 8i 2 F, j 2 C x ij 1, 8j 2 C i2f x ij,y i 2 {0, 1}, 8i 2 F, j 2 C Dual-relax: max j2c j j ij apple d ij, ij apple f i, j2c 8i 2 F, j 2 C 8i 2 F j, ij 0, 8i 2 F, j 2 C α j : amount of value paid by client j to all facilities βij αj - dij : payment to facility i by client j (after deduction) complimentary slackness conditions: (if ideally held) x ij =1 α j - β ij = d ij ; yi =1 j C βij = fi ; α j > 0 i F x ij = 1 ; βij > 0 yi = xij ;

Phase I: Initially α = 0, β = 0, no facility is open, no client is served; raise n αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj; Phase II: construct graph G(V,E) where V={tentatively open facilities} and (i 1, i 2 ) E if facilities i 1, i 2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility; SOL= apple f i + i2i j:directly connected (j) = ( j:directly connected j d (j)j + triangle inequality apple 3 + maximality of I j:indirectly connected i that βij = αj - dij if j is directly connected nearest facility in I j:indirectly connected d (j)j j if j is indirectly connected i1 j1 i2 j2 apple 3 j2c j 3 OPT

Phase I: Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate: upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised; upon j C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to facility i and stop raising αj; upon αj = dij for a tentatively open facility i: connect client j to facility i and stop raising αj; Phase II: construct graph G(V,E) where V={tentatively open facilities} and (i 1, i 2 ) E if facilities i 1, i 2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility; SOL 3 OPT i1 j1 i2 j2 can be implemented discretely: in O(m log m) time, m= F C sort all edges (i,j) F C by non-decreasing dij dynamically maintain the time of next event by heap

Instance: set F of facilities; set C of clients; facility opening costs f: F [0, ); connection metric d: F C [0, ); Find φ: C I F to minimize j2c d (j),j + i2i f i min i2f,j2c d ij x ij + i2f x ij,y i 2 {0, 1}, f i y i y i x ij 0, x ij 1, 8j 2 C i2f facilities: i f i d ij clients: j 8i 2 F, j 2 C 8i 2 F, j 2 C Integrality gap = 3 no poly-time <1.463-approx. algorithm unless NP=P [Li 2011] 1.488-approx. algorithm