LP-Based Algorithms for Capacitated Facility Location Hyung-Chan An EPFL July 29, 2013 Joint work with Mohit Singh and Ola Svensson
Capacitated facility location problem Given a metric cost c on D: set of clients F: set of facilities
Capacitated facility location problem Given a metric cost c on D: set of clients F: set of facilities U i : capacity of i ∈ F o i : opening cost of i ∈ F 5 ≤3 1 ≤2 20 ≤3
Capacitated facility location problem Given a metric cost c on D: set of clients F: set of facilities U i : capacity of i ∈ F o i : opening cost of i ∈ F Want: Choose S ⊆ F to open 5 ≤3 1 ≤2 20 ≤3
Capacitated facility location problem Given a metric cost c on D: set of clients F: set of facilities U i : capacity of i ∈ F o i : opening cost of i ∈ F Want: Choose S ⊆ F to open Assign every client to an open facility f : D → S Capacities satisfied 5 ≤3 1 ≤2 20 ≤3
Capacitated facility location problem Given a metric cost c on D: set of clients F: set of facilities U i : capacity of i ∈ F o i : opening cost of i ∈ F Want: Choose S ⊆ F to open Assign every client to an open facility f : D → S Capacities satisfied Minimize Σ i ∈ S o i + Σ j ∈ D c j,f(j) = (20 + 5) + ( )
Successful special case Uncapacitated facility location problem U i = ∞ ∀ i NP-hard to approximate better than [Guha & Khuller 1999] [Sviridenko] approximation algorithm [Li 2011]
Successful special case Uncapacitated facility location problem U i = ∞ ∀ i NP-hard to approximate better than [Guha & Khuller 1999] [Sviridenko] approximation algorithm [Li 2011] Combining a linear program(LP)-rounding algorithm with a primal-dual algorithm LP-rounding 3.16-approximation [Shmoys, Tardos, Aardal 1997], LP-rounding & greedy approximation [Guha & Khuller 1999], LP-rounding 1.74-approximation [Chudak & Shmoys 1999], primal-dual 3-approximation [Jain & Vazirani 2001], combining 1.73-approximation [Charikar & Guha 1999], primal-dual 1.61-approximation [Jain, Mahdian, Markakis, Saberi, Vazirani 2003], LP-rounding approximation [Sviridenko 2002], primal-dual 1.52-approximation [Mahdian, Ye, Zhang 2006], combining 1.5-approximation algorithm [Byrka & Aardal 2010]
The Question Can we use these LP-based techniques to solve the capacitated facility location problem?
The Question Can we use these LP-based techniques to solve the capacitated facility location problem? All known approximation algorithms based on local search [Bansal, Garg, Gupta 2012], [Pal, Tardos, Wexler 2001], [Korupolu, Plaxton, Rajaraman 2000] 5-approximation
The Question Can we use these LP-based techniques to solve the capacitated facility location problem? Rich toolkit of algorithmic techniques
The Question Can we use these LP-based techniques to solve the capacitated facility location problem? Rich toolkit of algorithmic techniques Per-instance performance guarantee Application to related problems One of the ten Open Problems selected by the textbook of Williamson and Shmoys
The Question Can we use these LP-based techniques to solve the capacitated facility location problem? Why is this hard? Standard LP relaxation fails to bound the optimum within a reasonable factor Relaxed problems: uncapacitated problem, capacities can be violated [Abrams, Meyerson, Munagala, Plotkin 2002], facilities can be opened multiple times [Shmoys, Tardos, Aardal 1997], [Jain, Vazirani 2001], opening costs are uniform [Levi, Shmoys, Swamy 2012]
The Question Can we use these LP-based techniques to solve the capacitated facility location problem? Why is this hard? Standard LP relaxation fails to bound the optimum within a reasonable factor No LP relaxation known that is algorithmically amenable
Main result There is a good LP: its optimum is within a constant factor of the true optimum. In particular, there is a poly-time algorithm that finds a solution whose cost is within a constant factor of the LP optimum. Theorem
Our relaxation Standard LP rewritten ∀ i ∈ F y i = 1 if open, 0 if not ∀ i ∈ F, j ∈ D x ij = 1 if j is assigned to i, 0 if not Consider a multicommodity flow network: arc (j, i) of capacity x ij j ∈ D is a source of commodity j with demand 1 i ∈ F is a sink of commodity-oblivious capacity y i ∙U i commodity-specific capacity y i ∙ 1 ≤3 ≤2 ≤3 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0.
Our relaxation Standard LP rewritten ∀ i ∈ F y i = 1 if open, 0 if not ∀ i ∈ F, j ∈ D x ij = 1 if j is assigned to i, 0 if not Consider a multicommodity flow network: arc (j, i) of capacity x ij j ∈ D is a source of commodity j with demand 1 i ∈ F is a sink of commodity-oblivious capacity y i ∙U i commodity-specific capacity y i ∙ 1 ≤3 ≤2 ≤3 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0. Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject tothe flow network defined by (x, y) is feasible x ij, y i ∈ {0, 1 }
Our relaxation Standard LP rewritten ∀ i ∈ F y i = 1 if open, 0 if not ∀ i ∈ F, j ∈ D x ij = 1 if j is assigned to i, 0 if not Consider a multicommodity flow network: arc (j, i) of capacity x ij j ∈ D is a source of commodity j with demand 1 i ∈ F is a sink of commodity-oblivious capacity y i ∙U i commodity-specific capacity y i ∙ 1 ≤3 ≤2 ≤3 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0. Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject tothe flow network defined by (x, y) is feasible x ij, y i ∈ [0, 1]
Our relaxation Standard LP rewritten ∀ i ∈ F y i = 1 if open, 0 if not ∀ i ∈ F, j ∈ D x ij = 1 if j is assigned to i, 0 if not Consider a multicommodity flow network: arc (j, i) of capacity x ij j ∈ D is a source of commodity j with demand 1 i ∈ F is a sink of commodity-oblivious capacity y i ∙U i commodity-specific capacity y i ∙ 1 Instance with one client and one facility with capacity ≤10 ≤3 ≤2 ≤3 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0.
Our relaxation Consider arbitrary partial assignment g : D ↛ F Suppose that clients are assigned according to g (x, y) should still give a feasible solution for the remaining clients: i.e., the flow network should still be feasible when only the remaining clients have demand of 1 commodity-oblivious capacity of i is y i ∙(U i -|g - 1 (i)|) In similar spirit as knapsack-cover inequalities [Wolsey 1975] [Carr, Fleischer, Leung, Phillips 2000] LP constraint: the flow network defined by (g, x, y) is feasible for all g Is this really a relaxation? ≤32 ≤21 ≤3 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0. ≤3 ≤2 ≤3 x x
Our relaxation Is this really a relaxation? No. The only facility adjacent from remaining clients has 1 ∙0 = 0 commodity-oblivious capacity Introduce backward edges corresponding to g Now flows can be routed along alternating paths ≤3 ≤2 ≤30 y=1 y=0 y=1 All shown arcs are of capacity 1; others 0. ≤3 ≤2 ≤3 x
Our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ partial assignment g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity 1 if g assigns j to i, j ∈ D is a source of commodity j with demand 1 if not assigned by g, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i -|g - 1 (i)|) and commodity-specific capacity y i ∙ 1.
Our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ partial assignment g Automatically embraces Standard LP when g is the empty partial function Knapsack-cover inequalities Can be separated with respect to any given g Algorithm uses feasibility of MFN(g, x, y) for a single g Invoke standard techniques [Carr, Fleischer, Leung, Phillips 2000], [Levi, Lodi, Sviridenko 2007]
LP-rounding without exact separation Relaxed separation oracle Either finds a violated inequality or rounds the given point Our rounding algorithm gives one It does not rely on optimality We can separate with respect to a given g
LP-rounding without exact separation Relaxed separation oracle Either finds a violated inequality or rounds the given point (Optimization) ellipsoid method Queries (exact) separation oracle with x*, which either Finds an inequality violated by x* Determines x* is feasible – c(x) ≤ c(x*) added to system Can run with a relaxed separation oracle Finds an inequality violated by x* Rounds x* – c(x) ≤ c(x*) added to system
LP-rounding algorithm
I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Can afford it Choose a partial assignment g : D ↛ I For each client j assigned by g, assign j in the same way Remaining clients are to be assigned to S Lemma We can choose a partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where all flow is drained at S.
LP-rounding algorithm Remaining clients are to be assigned to S MFN(g, x *, y * ) remains feasible even when “restricted” to S MFN( ∅, x *, y * ) is feasible when restricted to remaining clients i.e., it is feasible for the standard LP Commodity-oblivious capacity of i ∈ S is y i ∙U i ≤ U i / 2 Capacity constraints are not tight Can use Abrams et al.’s algorithm based on the standard LP Finds 18-approx soln where capacities are violated by 2 Lemma We can choose a partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where all flow is drained at S.
LP-rounding algorithm Can use Abrams et al.’s algorithm based on the standard LP Finds 18-approx soln where capacities are violated by 2 A 288-approximation algorithm Obvious improvements, but perhaps not leading to ≤5 Determination of integrality gap remains open Lemma We can choose a fractional partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where at least half of each commodity’s flow is drained at S.
Lemma We can choose a partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where all flow is drained at S. LP-rounding algorithm
Simplifying assumption For each client j, all its incident edges in the support have equal costs Support of x * := { (i, j) | x * ij > 0 } ≤2 ≤1 ≤2 x-values shown on edges 1/2 1/3 1 1 y=1 y=1/2 Lemma We can choose a partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where all flow is drained at S. LP-rounding algorithm
Simplifying assumption For each client j, all its incident edges in the support have equal costs Support of x * := { (i, j) | x * ij > 0 } ≤2 ≤1 ≤2 Lemma We can choose a partial assignment g s.t. g is cheap MFN(g, x *, y * ) has a feasible flow where all flow is drained at S. LP-rounding algorithm
I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Find a maximum bipartite matching g on the support of x * j ∈ D is matched at most once i ∈ I is matched up to U i times i ∈ S is not matched ≤2 ≤1 ≤2 I S
LP-rounding algorithm I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Find a maximum bipartite matching g on the support of x * j ∈ D is matched at most once i ∈ I is matched up to U i times i ∈ S is not matched ≤2 ≤1 ≤2 I S
LP-rounding algorithm I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Find a maximum bipartite matching g on the support of x * j ∈ D is matched at most once i ∈ I is matched up to U i times i ∈ S is not matched Now we observe MFN(g, x *, y * ) There exists no path from a remaining client to a facility in I that is “undermatched” ≤2 ≤1 ≤2 I S ≤1 ≤2 I S
LP-rounding algorithm I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Find a maximum bipartite matching g on the support of x * j ∈ D is matched at most once i ∈ I is matched up to U i times i ∈ S is not matched Now we observe MFN(g, x *, y * ) There exists no path from a remaining client to a facility in I that is “undermatched” “Fully matched” facility has zero capacity All flow drained at S ≤2 ≤1 ≤2 I S ≤21 ≤10 ≤2 I S x x x
Lifting the assumption
Problem g may become expensive compared to c(x*) Solution Find a fractional partial assignment g ≤ x *
Lifting the assumption Problem g may become expensive compared to c(x*) Solution Find a fractional partial assignment g ≤ x * Σ i ∈ I g ij ≤ 1 ∀ j ∈ D Σ j ∈ D g ij ≤ U i ∀ i ∈ I g ij = 0 ∀ i ∈ S
Lifting the assumption Problem g may become expensive compared to c(x*) Solution Find a fractional partial assignment g ≤ x * 1/2 1/3 1 1 S s t
Lifting the assumption Problem g may become expensive compared to c(x*) Solution Find a fractional partial assignment g ≤ x * But we defined MFN(g, x *, y * ) only for integral g…
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ partial assignment g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity 1 if g assigns j to i, j ∈ D is a source of commodity j with demand 1 if not assigned by g, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i -|g - 1 (i)|) and commodity-specific capacity y i ∙ 1.
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ fractional part. asgn. g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity 1 if g assigns j to i, j ∈ D is a source of commodity j with demand 1 if not assigned by g, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i -|g - 1 (i)|) and commodity-specific capacity y i ∙ 1.
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ fractional part. asgn. g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity g ij, j ∈ D is a source of commodity j with demand 1 if not assigned by g, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i -|g - 1 (i)|) and commodity-specific capacity y i ∙ 1.
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ fractional part. asgn. g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity g ij, j ∈ D is a source of commodity j with demand d j := 1 - Σ i ∈ I g ij, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i -|g - 1 (i)|) and commodity-specific capacity y i ∙ 1.
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ fractional part. asgn. g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity g ij, j ∈ D is a source of commodity j with demand d j := 1 - Σ i ∈ I g ij, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i - Σ j ∈ D g ij ) and commodity-specific capacity y i ∙ 1.
(Extending) our relaxation Minimize Σ i ∈ F o i y i + Σ i ∈ F, j ∈ D c ij x ij subject toMFN(g, x, y) is feasible ∀ fractional part. asgn. g where MFN(g, x, y) is a multicommodity flow network with arc (j, i) of capacity x ij, arc (i, j) of capacity g ij, j ∈ D is a source of commodity j with demand d j := 1 - Σ i ∈ I g ij, i ∈ F is a sink of commodity-oblivious capacity y i ∙(U i - Σ j ∈ D g ij ) and commodity-specific capacity y i ∙d j.
Lifting the assumption Lemma We can choose a fractional partial assignment g s.t. g ≤ x * MFN(g, x *, y * ) has a feasible flow where at least half of each commodity’s flow is drained at S.
Lifting the assumption Lemma We can choose a fractional partial assignment g s.t. g ≤ x * MFN(g, x *, y * ) has a feasible flow where at least half of each commodity’s flow is drained at S. Hoping too much: y=.01 ≤1 y= d j =
Lifting the assumption Lemma We can choose a fractional partial assignment g s.t. g ≤ 2x * MFN(g, x *, y * ) has a feasible flow where at least half of each commodity’s flow is drained at S. What’s the goal? Goal is not in making MFN(g, x *, y * ) feasible – the ellipsoid method guarantees this Will find an assignment that leaves on clients “too much” demand to be served by remaining capacities in I
Lifting the assumption Two different type of “paths” In MFN(g, x *, y * ) In the residual graph of the partial assignment Previous argument A path from a client with positive demand to a facility in I with positive capacity corresponds to a path from an undermatched client to an undermatched facility and therefore does not exist.
LP-rounding algorithm I ← {i ∈ F | y * i > ½}, S ← {i ∈ F | y * i ≤ ½}; open I Find a maximum bipartite matching g on the support of x * j ∈ D is matched at most once i ∈ I is matched up to U i times i ∈ S is not matched Now we observe MFN(g, x *, y * ) There exists no path from a remaining client to a facility in I that is “undermatched” ≤2 ≤1 ≤2 I S ≤1 ≤2 I S
Lifting the assumption Two different type of “paths” In MFN(g, x *, y * ) In the residual graph of the partial assignment ≤1 All weights on edges 1/2 x*x*g ≤1 Residual Graph ≤1 MFN(g, x *, y * )
Lifting the assumption Consider a maximum fractional matching g and its residual graph s t
Lifting the assumption Consider a maximum fractional matching g and its residual graph R : reachable from an undermatched client N : not reachable s t DRDR DNDN IRIR ININ S
Lifting the assumption Consider a maximum fractional matching g and its residual graph R : reachable from an undermatched client N : not reachable Consider MFN(g, x *, y * ) s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S
Lifting the assumption No facility in I R is undermatched a R : reachable from an undermatched client N : not reachable s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S
Lifting the assumption No facility in I R is a sink s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinks
Lifting the assumption No facility in I R is a sink Every client with positive demand is in D R s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources
Lifting the assumption No facility in I R is a sink Every client with positive demand is in D R Consider j ∈ D R and i ∈ I N (j, i) is saturated: g ij = 2x* ij s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j j i i ×
Lifting the assumption Consider j ∈ D R and i ∈ I N (j, i) is saturated: g ij = 2x* ij Set g ij ← 0 Increases d j by Σ i ∈ I N 2x* ij, which is twice the total capacity from j to I N s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j j
Lifting the assumption For every j ∈ D R, its demand is at least twice the total capacity of arcs from j to I N in MFN(g, x *, y * ) s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j j
Lifting the assumption For every j ∈ D R, its demand is at least twice the total capacity of arcs from j to I N in MFN(g, x *, y * ) Compare to: For every j ∈ D R, there does not exist a path from j to I N in MFN(g, x *, y * ) s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j j
Lifting the assumption Say: arcs from j to I N is labeled as commodity j s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources
Lifting the assumption Say: arcs from j to I N is labeled as commodity j Want: there exists a feasible flow where, for every j ∈ D R, every arc from j to I N is used by commodity j s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources
Lifting the assumption Say: arcs from j to I N is labeled as commodity j Recall g i’j’ ← 0 for j’ ∈ D R and i’ ∈ I N s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources ×
Lifting the assumption Say: arcs from j to I N is labeled as commodity j Recall g i’j’ ← 0 for j’ ∈ D R and i’ ∈ I N Suppose g i’j’ > 0 for some j’ ∈ D N and i’ ∈ I R s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j’ × i’
Lifting the assumption Say: arcs from j to I N is labeled as commodity j Recall g i’j’ ← 0 for j’ ∈ D R and i’ ∈ I N Suppose g i’j’ > 0 for some j’ ∈ D N and i’ ∈ I R s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources ×
Lifting the assumption Say: arcs from j to I N is labeled as commodity j Recall g i’j’ ← 0 for j’ ∈ D R and i’ ∈ I N Suppose g i’j’ > 0 for some j’ ∈ D N and i’ ∈ I R Any flow path ending at I N contains an arc from D R to I N s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources
Lifting the assumption Any flow path ending at I N contains an arc from D R to I N s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j
Lifting the assumption Any flow path ending at I N contains an arc from D R to I N Suppose j ∈ D R drains the highest fraction of its flow at I N and this fraction is >1/2 Want: there exists a feasible flow where, for every j ∈ D R, every arc from j to I N is used by commodity j s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j
Want: there exists a feasible flow where, for every j ∈ D R, every arc from j to I N is used by commodity j Any flow path ending at I N contains an arc from D R to I N Suppose j ∈ D R drains the highest fraction(>½) of its flow at I N There is a flow path of j that “steals” an arc of k ∈ D R Lifting the assumption s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j k
Want: there exists a feasible flow where, for every j ∈ D R, every arc from j to I N is used by commodity j Any flow path ending at I N contains an arc from D R to I N Suppose j ∈ D R drains the highest fraction(>½) of its flow at I N There is a flow path of j that “steals” an arc of k ∈ D R Lifting the assumption s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j k
Want: there exists a feasible flow where, for every j ∈ D R, every arc from j to I N is used by commodity j k ∈ D R recovered its stolen arc Lifting the assumption s t DRDR DNDN IRIR ININ S DRDR DNDN IRIR ININ S possible sinkspossible sources j k
Main result There is a good LP: its optimum is within a constant factor of the true optimum. In particular, there is a poly-time algorithm that finds a solution whose cost is within a constant factor of the LP optimum. Theorem
The Question Can we use LP-based techniques to solve the capacitated facility location problem? Yes! Can we use other LP-based techniques with our new relaxation? Can we apply these results to related problems? Can we improve our integrality gap bounds?
Thank you.