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 e 2 v 1 v 1 v 2 e 2 e 3 e 1 v 2 e 3 v 3 e 5 e 6 v 3 e 4 e 4 incidence graph v 4 e 5 v 4 e 6 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 v 1 e 2 matching | M | ≤ OPT VC v 2 e 3 ( weak duality ) v 3 e 4 v 4 e 5 | C | ≤ 2| M | ≤ 2OPT e 6
Duality e 1 v 1 e 2 v 2 e 3 v 3 e 4 v 4 e 5 e 6 constraints variables vertex cover: ∑ v ∈ e x v ≥ 1 x v ∈ {0,1} variables constraints matching: y e ∈ {0,1} ∑ e ∋ v y e ≤ 1
Duality Instance : graph G ( V , E ) primal: X minimize x v v ∈ V X subject to x v ≥ 1 , ∀ e ∈ E vertex v ∈ e covers x v ∈ { 0 , 1 } , ∀ v ∈ V dual: X maximize y e e ∈ E X subject to y v ≤ 1 , ∀ v ∈ V matchings e 3 v y e ∈ { 0 , 1 } , ∀ e ∈ E
Duality for LP-Relaxation Instance : graph G ( V , E ) primal: X minimize x v v ∈ V X subject to x v ≥ 1 , ∀ e ∈ E v ∈ e x v ≥ 0 , ∀ v ∈ V dual: X maximize y e e ∈ E X subject to y v ≤ 1 , ∀ v ∈ V e 3 v y e ≥ 0 , ∀ e ∈ E
Estimate the Optima minimize 7 x 1 + + 5 x 3 x 2 ≤ subject to + 3 x 3 10 − ≥ x 1 x 2 + + 5 x 1 + 2 x 2 6 − ≥ x 3 = 16 x 1 , x 2 , x 3 ≥ 0 ≤ OPT ≤ any feasible solution 16
Estimate the Optima minimize 7 x 1 + + 5 x 3 x 2 ≤ subject to y 1 y 1 + 3 x 3 10 − ≥ x 1 x 2 + + 5 x 1 + 2 x 2 6 − ≥ y 2 y 2 x 3 x 1 , x 2 , x 3 ≥ 0 ≤ OPT 10 y 1 + 6 y 2 for any + 5 y 2 7 ≤ y 1 y 1 , y 2 ≥ 0 + 2 y 2 1 − y 1 ≤ 3 y 1 5 − ≤ y 2
Primal-Dual Primal min 7 x 1 + + 5 x 3 x 2 s.t. + 3 x 3 10 − ≥ x 1 x 2 5 x 1 + 2 x 2 6 − ≥ x 3 x 1 , x 2 , x 3 ≥ 0 Dual max ∀ dual feasible 10 y 1 + 6 y 2 ≤ primal OPT s.t. + 5 y 2 7 ≤ y 1 + 2 y 2 1 − y 1 ≤ LP ∈ NP ∩ co NP 3 y 1 5 − ≤ y 2 y 1 , y 2 ≥ 0
Surviving Problem price healthy c 1 c 2 c n vitamin 1 ≥ b 1 a 11 a 12 a 1 n vitamin m a m 1 a m 2 a mn ≥ b m solution: x 1 x 2 x n minimize the total price while keeping healthy
Surviving Problem min c T x s.t. A x ≥ b x ≥ 0 price healthy c 1 c 2 c n vitamin 1 ≥ b 1 a 11 a 12 a 1 n vitamin m a m 1 a m 2 a mn ≥ b m solution: x 1 x 2 x n minimize the total price while keeping healthy
LP Duality Primal: Dual: min c T x max b T y s.t. s.t. A x ≥ b y T A ≤ c T y ≥ 0 x ≥ 0 dual price solution: healthy c 1 c 2 c n vitamin 1 y 1 b 1 a 11 a 12 a 1 n vitamin m y m a m 1 a m 2 a mn b m design a pricing system m types of vitamin pills, max the total price competitive to n natural foods,
LP Duality Primal: Dual: min c T x max b T y ≥ s.t. y T A ≤ c T s.t. A x ≥ b 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 ≤ c T x x
LP Duality Primal: Dual: min c T x max b T y ≥ s.t. s.t. y T A ≤ c T A x ≥ b x ≥ 0 y ≥ 0 Weak Duality Theorem : ∀ feasible primal solution x and dual solution y y T b ≤ c T x
LP Duality Primal: Dual: min c T x max b T y s.t. s.t. y T A ≤ c T A x ≥ b 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 *
Dual: max b T y Primal: min c T x s.t. y T A ≤ c T s.t. A x ≥ b y ≥ 0 x ≥ 0 ∀ feasible primal solution x and dual solution y y T b ≤ y T A x ≤ c T x x and y are both optimal iff Strong Duality Theorem y T b = y T A x = c T x 0 1 m m n X X X A y i b i y i = a ij x j @ ∀ i : either A i · x = b i or y i = 0 i =1 i =1 j =1 m ! n n ∀ j : either y T A · j = c j or x j = 0 X X X c j x j = a ij y i x j j =1 j =1 i =1
Complementary Slackness Dual: max b T y Primal: min c T x s.t. y T A ≤ c T s.t. A x ≥ b y ≥ 0 x ≥ 0 Complementary Slackness Conditions: ∀ feasible primal solution x and dual solution y x and y are both optimal iff ∀ i : either A i · x = b i or y i = 0 ∀ j : either y T A · j = c j or x j = 0
Relaxed Complementary Slackness Dual: max b T y Primal: min c T x s.t. y T A ≤ c T s.t. A x ≥ b y ≥ 0 x ≥ 0 ∀ feasible primal solution x and dual solution y for α , β ≥ 1: ∀ i : either A i · x ≤ α b i or y i = 0 ∀ j : either y T A · j ≥ c j / β or x j = 0 c T x ≤ αβ b T y ≤ αβ OPT LP 0 1 ! n n m m m n X X X X X X β c j x j ≤ x j = β A y j ≤ αβ b i y i a ij y i a ij x i @ i =1 j =1 j =1 j =1 i =1 i =1
Primal-Dual Schema Dual LP-relax: max b T y min c T x Primal IP: s.t. y T A ≤ c T s.t. A x ≥ b x ∈ ℤ ≥ 0 y ≥ 0 Find a primal integral solution x and a dual solution y for α , β ≥ 1: ∀ i : either A i · x ≤ α b i or y i = 0 ∀ j : either y T A · j ≥ c j / β or x j = 0 ≤ αβ OPT IP c T x ≤ αβ b T y ≤ αβ OPT LP
e 1 primal: min X x v v 1 v ∈ V e 2 s.t. X x v ≥ 1 , ∀ e ∈ E v 2 e 3 v ∈ e x v ∈ { 0 , 1 } , ∀ v ∈ V v 3 e 4 v 4 dual-relax: min e 5 X y e e ∈ E e 6 s.t. X y e ≤ 1 , ∀ v ∈ V vertex cover: e 3 v constraints variables y e ≥ 0 , ∀ e ∈ E ∑ v ∈ e x v ≥ 1 x v ∈ {0,1} feasible ( x , y ) such that: matching: ∀ e : y e > 0 ⟹ ∑ v ∈ e x v ≤ α variables constraints ∀ v : x v = 1 ⟹ ∑ e ∋ v y e = 1 y e ∈ {0,1} ∑ e ∋ v y e ≤ 1
primal: dual-relax: min X min X y e x v e ∈ E v ∈ V s.t. X s.t. y e ≤ 1 , ∀ v ∈ V X x v ≥ 1 , ∀ e ∈ E e 3 v v ∈ e y e ≥ 0 , ∀ e ∈ E x v ∈ { 0 , 1 } , ∀ v ∈ V event: “ v is tight ( saturated )” ∑ e ∋ v y e = 1 Initially x = 0 , y = 0 ; while E ≠ ∅ to 1 pick an e ∈ E and raise y e until some v goes tight; set x v = 1 for those tight v and delete all e ∋ v from E ; v ∈ e every deleted e is incident to a v that x v = 1 ∀ e ∈ E : ∑ v ∈ e x v ≥ 1 o all edges are eventually deleted x is feasible relaxed ∀ e : either ∑ v ∈ e x v ≤ 2 or y e = 0 X x v ≤ 2 · OPT complementary ∀ v : either ∑ e ∋ v y e = 1 or x v = 0 slackness : v ∈ V
Initially x = 0 , y = 0 ; while E ≠ ∅ to 1 pick an e ∈ E and raise y e until some v goes tight; set x v = 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 max b T y s.t. A x ≥ b s.t. y T A ≤ c T x ∈ ℤ ≥ 0 y ≥ 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 = c j ; • raise x j (integrally) corresponding to the tight dual constraints. • Show the complementary slackness conditions : ∀ i : either A i · x ≤ α b i or y i = 0 c T x ≤ αβ b T y ∀ j : either y T A · j ≥ c j / β or x j = 0 ≤ αβ OPT
Integrality Gap LP relaxation of vertex cover : given G ( V , E ) , ∑ v ∈ V x v minimize subject to e ∈ E ∑ v ∈ e x v ≥ 1, v ∈ V x v ∈ {0, 1}, x v ∈ [0, 1], OPT( I ) Integrality gap = sup OPT LP ( I ) I For the LP relaxation of vertex cover: integrality gap = 2
Facility Location hospitals in Nanjing
Facility Location f i … … facilities: i … … … … c ij … … … … … … clients: j Instance : set F of facilities; set C of clients; facility opening costs f : F → [0, ∞ ) ; connection costs c : 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 is minimized. X X c φ ( j ) ,j + f i j ∈ C i ∈ I • 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 … f i … facilities: i … … … … d ij … … … … … … clients: j 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 is minimized. X X d φ ( j ) ,j + f i j ∈ C i ∈ I i 1 i 2 triangle inequality: ∀ i 1 , i 2 ∈ F, ∀ j 1 , j 2 ∈ C d i 1 j 1 + d i 2 j 1 + d i 2 j 2 ≥ d i 1 j 2 j 2 j 1
Recommend
More recommend