Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Jannik Matuschke
February 6, 2017
Lecture: Approximation AlgorithmsLecture: Approximation Algorithms
Approximation of Metrics byTrees
Tree metric approximation
TheoremGiven a metric d on V , there is a randomized polynomial timealgorithm that computes a random tree metric dT ,` on V such that
d(u, v) ≤ dT ,`(u, v) and E[dT ,`(u, v)] ≤ O(log |V |)d(u, v)
for all u, v ∈ V .
Tree metric approximation forBuy-at-bulk
Network Design
Buy-at-bulk Network Design
Input: graph G = (V , E ), lengths ` : E → R+,terminal pairs si , ti and demands ∆i for i ∈ [k],non-decreasing cost function f : R+ → R+ withf (0) = 0 and f (x + y) ≤ f (x) + f (y)
Task: find paths Pi for i ∈ [k] minimizing∑
e∈E `ef (∆e)with ∆e :=
∑i∈[k]:e∈Pi ∆i
f (x)
Buy-at-bulk Network Design
Input: graph G = (V , E ), lengths ` : E → R+,terminal pairs si , ti and demands ∆i for i ∈ [k],non-decreasing cost function f : R+ → R+ withf (0) = 0 and f (x + y) ≤ f (x) + f (y)
Task: find paths Pi for i ∈ [k] minimizing∑
e∈E `ef (∆e)with ∆e :=
∑i∈[k]:e∈Pi ∆i
f (x)
AlgorithmAlgorithm
1 Approximate the metric dG,` by a tree metric dT ,`′ .2 For every i ∈ [k]:
I Let Ti = (v0, . . . , vn) be the unique si -ti -path in T .I For u, v ∈ V let Puv be a shortest u-v -path in G .I Let Pi be a simple path in the concatenation
Pv0v1 ◦ . . . ◦ Pvn−1vn .3 Return (Pi )i∈[k].
ti
si
si
P i
ti
AlgorithmAlgorithm
1 Approximate the metric dG,` by a tree metric dT ,`′ .2 For every i ∈ [k]:
I Let Ti = (v0, . . . , vn) be the unique si -ti -path in T .I For u, v ∈ V let Puv be a shortest u-v -path in G .I Let Pi be a simple path in the concatenation
Pv0v1 ◦ . . . ◦ Pvn−1vn .3 Return (Pi )i∈[k].
ti
si
si
P i
ti
Analysis
TheoremThe algorithm is a randomized O(log |V |)-approximation algorithmfor Buy-at-bulk Network Design.
Proof:
E [ALG] ≤ E
∑e∈T
`′ef (∆′e)
← cost of ALG in T
≤ E
∑e∈T
`′ef (∆̄e)
← cost of OPT in T
≤ O(log |V |)OPT
Today you learnt ...
ti
si
Life is less complicated on a tree (metric).
Combining twoApproximation Algorithms:
Location Routing
Location + Routing = Location RoutingLocation + Routing = Location Routing
facility location
Logistics
vehicle routing
location routing
Logistics
+
Location + Routing = Location RoutingLocation + Routing = Location Routing
facility location
Logistics
vehicle routing
location routing
Logistics
+
Location Routing
Input: facilities F , clients C , metric d on F ∪ C , openingcosts f ∈ RF
+, demands ∆ ∈ RC+, vehicle capacity U
Task: find a set of facilities F ′ ⊆ F and a collection oftours T such that
I every tour contains a facility from F ′,I every client contained in a tour,I total demand in each tour is at most U
minimizing∑
w∈F ′ fw +∑
T∈T d(T )
Location Routing
Input: facilities F , clients C , metric d on F ∪ C , openingcosts f ∈ RF
+, demands ∆ ∈ RC+, vehicle capacity U
Task: find a set of facilities F ′ ⊆ F and a collection oftours T such that
I every tour contains a facility from F ′,I every client contained in a tour,I total demand in each tour is at most U
minimizing∑
w∈F ′ fw +∑
T∈T d(T )
Location Routing
Input: facilities F , clients C , metric d on F ∪ C , openingcosts f ∈ RF
+, demands ∆ ∈ RC+, vehicle capacity U
Task: find a set of facilities F ′ ⊆ F and a collection oftours T such that
I every tour contains a facility from F ′,I every client contained in a tour,I total demand in each tour is at most U
minimizing∑
w∈F ′ fw +∑
T∈T d(T )
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r
0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}
I edge {v , w} for each v , w ∈ Cweight: d(v , w)
I edge {v , w} for each v ∈ C , w ∈ Fweight: d(v , w) + fw
I edge {r , w} for each w ∈ Fweight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r
0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)
I edge {v , w} for each v ∈ C , w ∈ Fweight: d(v , w) + fw
I edge {r , w} for each w ∈ Fweight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r
0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fw
I edge {r , w} for each w ∈ Fweight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 1: Minimum Spanning TreeConstruct graph G ′ with edge weights d ′:
r0
d(v , w) + fw
d(v , w)
I vertices F ∪ C ∪ {r}I edge {v , w} for each v , w ∈ C
weight: d(v , w)I edge {v , w} for each v ∈ C , w ∈ F
weight: d(v , w) + fwI edge {r , w} for each w ∈ F
weight: 0
LemmaLet S be a minimum spanning tree in G ′ w.r.t. d ′.Then d ′(S) ≤ OPT .
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
v
d ′′vwT = 2∆vU d(v , wT ) ≤ ∆v
U d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
v
d ′′vwT = 2∆vU d(v , wT ) ≤ ∆v
U d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
v
d ′′vwT = 2∆vU d(v , wT ) ≤ ∆v
U d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
v
d ′′vwT = 2∆vU d(v , wT ) ≤ ∆v
U d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
vd ′′vwT = 2∆v
U d(v , wT ) ≤ ∆vU d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
vd ′′vwT = 2∆v
U d(v , wT ) ≤ ∆vU d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Bound 2: Uncapacitated Facility Location
I construct UFL instance with clients C , facilities F , openingcosts f , and connection costs d ′′vw = 2∆v
U d(v , w)
LemmaLet F ′′ ⊆ F be an optimal solution to the UFL instance.Then
∑w∈F ′′ fw +
∑v∈C d ′′(v , F ) ≤ OPT .
Proof: Let (F ∗, T ∗) be optimal LR solution. Consider T ∈ T ∗:
wT
vd ′′vwT = 2∆v
U d(v , wT ) ≤ ∆vU d(T ) ∀ v ∈ V (T )
∑v∈V (T )
d ′′vwT ≤
∑v∈V (T )
∆vU
︸ ︷︷ ︸
≤1
d(T )
∑v∈C
d ′′(v , F ∗) ≤∑
T∈T ∗
∑v∈V (T )
d ′′(v , wT ) ≤∑
T∈T ∗d(T )
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S
2 compute UFLapproximation F ′′
3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′
3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree
1 find node v with ∆(Sv ) > Ubut ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v
2 partition subtrees of v into groups with demand between U/2and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v2 partition subtrees of v into groups with demand between U/2
and U (except for the one containing v)
3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v2 partition subtrees of v into groups with demand between U/2
and U (except for the one containing v)3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v2 partition subtrees of v into groups with demand between U/2
and U (except for the one containing v)3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v2 partition subtrees of v into groups with demand between U/2
and U (except for the one containing v)3 for each group find nearest open facility
Algorithm
r
U = 3, ∆ ≡ 1
Main Algorithm1 compute MST S2 compute UFL
approximation F ′′3 turn trees into tours
I relieve overloadedsubtree using F ′′
I double edges,shortcut
Subprocedure: relieve overloaded subtree1 find node v with ∆(Sv ) > U
but ∆(Sw ) ≤ U for all children w of v2 partition subtrees of v into groups with demand between U/2
and U (except for the one containing v)3 for each group find nearest open facility
This semester you learnt ...
many different techniques for designingapproximation algorithms
I get a feeling which one works in which situationI adapt them to your optimization problemsI know how to get lower boundsI be inventive