Problem

Suppose we have a set of facilities FF and a set of clients CC, and would like to open a subset of facilities to serve the clients. The cost consists of two parts:

  1. one for opening the selected facilities;
  2. one for connecting each client to its nearest facility.

Formally, denote fif_i the cost of facility i∈Fi \in F and du,id_{u,i} the distance from a client u∈Cu \in C to a facility i∈Fi \in F. Further, we assume that the distances satisfy the following constraint:

dv,i≤dv,j+du,j+du,i,∀u,v∈C,i,j∈F. d_{v, i} \le d_{v, j} + d_{u, j} + d_{u, i}, \qquad \forall u, v \in C,\quad i, j \in F.

Let S⊆FS \subseteq F be a subset of facilities. The cost of SS is given by

∑i∈Sfi+∑u∈Cmin⁡i∈Sdu,i \sum_{i \in S} f_i + \sum_{u \in C} \min_{i \in S} d_{u,i}

The problem is to find a set SS that minimizes this cost.

Linear Programming

The linear program for the problem is given as follows:

min⁡∑i∈Ffiyi+∑u∈C,i∈Fdu,ixu,is.t.∑i∈Fxu,i≥1∀u∈C(1)yi−xu,i≥0∀i∈F,u∈C(2)xu,i≥0∀i∈F,u∈Cyi≥0∀i∈F \begin{array}{lrrlr} \min & \sum_{i \in F} f_i y_i + \sum_{u \in C, i \in F} d_{u, i} x_{u, i} & & \\ \text{s.t.} & \sum_{i \in F} x_{u, i} \ge 1 & \forall u \in C & (1) \\ & y_i - x_{u, i} \ge 0 & \forall i \in F, u \in C & (2) \\ & x_{u, i} \ge 0 & \forall i \in F, u \in C \\ & y_i \ge 0 & \forall i \in F \\ \end{array}

The first constraint says that each client is assigned to at least one facility. The second one says that a facility must be (fractionally) open if there is a client assigned to it.

Weak Duality   ⟹  \implies Dual Program

Let αu\alpha_u be the dual variable associated with constraint (1) and βu,i\beta_{u, i} be the one with constraint (2). We want the following inequalities, called weak duality, to hold:

∑u∈Cαu=∑u∈Cαu⋅1+∑i∈F,u∈Cβu,i⋅0≤∑u∈Cαu⋅(∑i∈Fxu,i)+∑i∈F,u∈Cβu,i⋅(yi−xu,i)=∑i∈F,u∈C(αu−βu,i)⋅xu,i+∑i∈F((∑u∈Cβu,i)⋅yi)≤∑i∈F,u∈Cdu,ixu,i+∑i∈Ffiyi \begin{aligned} \sum_{u \in C} \alpha_u &= \sum_{u \in C} \alpha_u \cdot 1 + \sum_{i \in F, u \in C} \beta_{u, i} \cdot 0 \\ &\le \sum_{u \in C} \alpha_u \cdot \left( \sum_{i \in F} x_{u, i} \right) + \sum_{i \in F, u \in C} \beta_{u, i} \cdot (y_i - x_{u, i}) \\ &= \sum_{i \in F, u \in C} (\alpha_u - \beta_{u, i}) \cdot x_{u, i} + \sum_{i \in F} \left( \left( \sum_{u \in C} \beta_{u, i} \right) \cdot y_i \right) \\ &\le \sum_{i \in F, u \in C} d_{u, i} x_{u, i} + \sum_{i \in F} f_i y_i \end{aligned}

When such inequalities hold, ∑u∈Cαu\sum_{u \in C} \alpha_u constitutes a lower bound for cost of the primal program. The problem of obtaining a tightest such lower bound, under the constraints under which the above inequalities hold, gives the dual program:

max⁡∑u∈Cαus.t.αu−βu,i≤du,i∀i∈F,∀u∈C∑u∈Cβu,i≤fi∀i∈Fαu≥0,∀u∈Cβu,i≥0.∀u∈C,i∈F \begin{array}{rrrr} \max & \sum_{u \in C} \alpha_u \\ \text{s.t.}& \alpha_u - \beta_{u, i} \le d_{u,i} & \forall i \in F, \forall u \in C\\ & \sum_{u \in C} \beta_{u, i} \le f_i & \forall i \in F \\ & \alpha_u \ge 0, & \forall u \in C \\ & \beta_{u, i} \ge 0. & \forall u \in C, i \in F \end{array}

Intuitive Explanation

Here we give a more intuitive way of deriving the dual. First, observe that ∑u∈Cmin⁡i∈Fdu,i\sum_{u \in C} \min_{i \in F} d_{u,i} is a trivial lower bound of the primal programming. In this case, each client is assigned to its nearest facility. However we ignore facility cost entirely.

To incorporate the facility cost, for each facility ii we divide its cost fif_i among the clients, such that client uu needs to pay βu,i\beta_{u, i} if it is assigned facility ii. Note that βu,i\beta_{u, i} can be arbitrary non-negative number as long as it satisfies that ∑u∈Cβu,i=fi\sum_{u \in C} \beta_{u, i} = f_i for all i∈Fi \in F.

Theorem. For each subset S⊆FS \subseteq F, let μ:C→S\mu : C \rightarrow S be the function defined by

μS(u)≐arg⁡min⁡i∈S du,i . \mu_S (u) \doteq \underset{i \in S}{\arg \min}\, d_{u,i} \,.

We have

∑u∈C(du,μS(u)+βu,μS(u))≤∑i∈Sfi+∑u∈Cdu,μS(u) \begin{aligned} \sum_{u \in C} \left( d_{u, \mu_S (u)} + \beta_{u, \mu_S (u)} \right) \le \sum_{i \in S} f_i + \sum_{u \in C} d_{u, \mu_S (u)} \end{aligned}

Proof. It suffices to show that

∑u∈Cβu,μS(u)≤∑i∈Sfi. \sum_{u \in C} \beta_{u, \mu_S (u)} \le \sum_{i \in S} f_i.

But this is obviously true, since

∑u∈Cβu,μS(u)≤∑u∈C(∑i∈Sβu,i)=∑i∈S(∑u∈Cβu,i)=∑i∈Sfi. \sum_{u \in C} \beta_{u, \mu_S (u)} \le \sum_{u \in C} \left( \sum_{i \in S} \beta_{u, i} \right) = \sum_{i \in S} \left( \sum_{u \in C} \beta_{u, i} \right) = \sum_{i \in S} f_i.

□\square

If we define

αu=min⁡i∈F(du,i+βu,i), \alpha_u = \min_{i \in F} (d_{u,i} + \beta_{u, i}),

Then ∑u∈Cαu\sum_{u \in C} \alpha_u constitutes a lower bound for the cost of each solution for the primal LP. In particular, it is a lower bound of the cost of the optimal integral solution S∗S^* (its corresponding assignment function is denoted as μ∗\mu^*):

∑u∈Cαu≤∑i∈S∗fi+∑u∈S∗min⁡i∈Sdu,i. \begin{aligned} \sum_{u \in C} \alpha_u \le \sum_{i \in S^*} f_i + \sum_{u \in S^*} \min_{i \in S} d_{u,i}. \end{aligned}

The problem of determining a set of βu,i\beta_{u, i}'s that maximizes the lower bound ∑u∈Cαu\sum_{u \in C} \alpha_u gives the dual program.

Complementary Slackness

min⁡∑i∈F,u∈Cdu,ixu,i+∑i∈Ffiyis.t.∑i∈Fxu,i≥1∀u∈Cyi−xu,i≥0∀i∈F,u∈Cxu,i≥0∀i∈F,u∈Cyi≥0∀i∈Fmax⁡∑u∈Cαus.t.αu−βu,i≤du,i∀i∈F,∀u∈C∑u∈Cβu,i≤fi∀i∈Fαu≥0,∀u∈Cβu,i≥0,∀u∈C,i∈F. \begin{array}{rrrr} \min & \sum_{i \in F, u \in C} d_{u, i} x_{u, i} + \sum_{i \in F} f_i y_i & & \\ \text{s.t.} & \sum_{i \in F} x_{u, i} \ge 1 & \forall u \in C \\ & y_i - x_{u, i} \ge 0 & \forall i \in F, u \in C \\ & x_{u, i} \ge 0 & \forall i \in F, u \in C \\ & y_i \ge 0 & \forall i \in F \\ \\ \max & \sum_{u \in C} \alpha_u \\ \text{s.t.}& \alpha_u - \beta_{u, i} \le d_{u,i} & \forall i \in F, \forall u \in C\\ & \sum_{u \in C} \beta_{u, i} \le f_i & \forall i \in F\\ & \alpha_u \ge 0, & \forall u \in C \\ & \beta_{u, i} \ge 0, & \forall u \in C, i \in F. \end{array}

Let x∗,y∗x^*, y^* and α∗,β∗\alpha^*, \beta^* be the optimal primal and dual solutions, respectively. For these set of variables, weak duality holds with equalities. By complementary slackness, it holds that

  1. αu∗=0\alpha^*_u = 0 or ∑i∈Fxu,i∗=1\sum_{i \in F} x^*_{u, i} = 1
  2. βu,i∗=0\beta^*_{u, i} = 0 or yi∗−xu,i∗=0y^*_i - x^*_{u, i} = 0

and

  1. αu∗−βu,i∗=du,i\alpha^*_u - \beta^*_{u, i} = d_{u,i} or xu,i∗=0x^*_{u, i} = 0
  2. ∑u∈Cβu,i∗=fi\sum_{u \in C} \beta^*_{u, i} = f_i or yi∗=0y^*_i = 0

Deterministic Rounding [1]

44-Approximation Algorithm

We show how to pick a good subset S⊂FS \subset F based on the optimal solutions x∗,y∗x^*, y^*, α∗\alpha^* and β∗\beta^*.

First we construct a graph G=(V,E)G = (V, E) based on the x∗x^*.

Definition. A derived graph from the optimal LP consists of the follows:

  1. The vertex set V=F∪CV = F \cup C;
  2. The undirected edge set E={(u,i):xu,i∗>0,∀i∈F,u∈C}E = \{ (u, i) : x^*_{u, i} > 0, \forall i \in F, u \in C\}, i.e., the edge set EE consists of client-facility pairs (u,i)(u, i) for which xu,i∗>0x^*_{u, i} > 0.

In the graph GG, the neighbors a client u∈Cu \in C can only be facilities.

Definition. For each u∈Cu \in C, let N(u)N(u) be the set of facilities adjacent to uu in GG.

Similarly, we define two-hop neighbors of a client CC, as the client who connects to uu via a intermediate facility.

Definition. For a client u∈Cu \in C, its two hop neighbors are the set of clients vv whose distance to uu is at most 22:

N2(u)={v∈C:N(u)∩N(v)≠∅}. N^2(u) = \{ v \in C: N(u) \cap N(v) \neq \emptyset \}.

Note that u∈N2(u)u \in N^2(u).

Below is an example. The cycles represent clients and the squares are for facilities. Associated each client and each facility are the αu∗\alpha_u^* value and opening cost respectively.

An important property of this graph is that

Property. If (u,i)∈E(u, i) \in E, then xu,i∗>0x^*_{u, i} >0, which implies that αu∗=du,i+βu,i∗\alpha^*_u =d_{u,i} + \beta^*_{u, i} by complementary slackness. It concludes that αu∗≥du,i\alpha^*_u \ge d_{u,i} if there is an edge (u,i)(u, i) in GG.

The following is the first constant factor approximation algorithm for the un-capacitated facility location problem, proposed in 1997 [1].

Algorithm 1

  1. S←∅S \leftarrow \emptyset
  2. U←C; B←∅U \leftarrow C;\, B \leftarrow \emptyset
  3. while U≠∅U \neq \emptyset do
  4. \quad u←arg⁡min⁡ v∈U αv∗u \leftarrow \underset{v \in U}{\arg \min \,} \,\alpha^*_v
  5. \quad iu←arg⁡min⁡ i∈N(u) fii_u \leftarrow \underset{i \in N(u)}{\arg \min \,} \,f_i
  6. \quad U←U∖N2(u)U \leftarrow U \setminus N^2(u)
  7. \quad B←B∪{u}B \leftarrow B \cup \{ u \}
  8. \quad S←S∪{iu}S \leftarrow S \cup \{ i_u \}

It is important that at each iteration, when a client uu is chosen, all vertices clients in N2(u)N^2(u) are removed from UU. This guarantees that clients in BB has non-overlapping neighbors, i.e.,

N(u)∩N(v)=∅, ∀u,v∈B. N(u) \cap N(v) = \emptyset,\, \quad \forall u, v \in B.

Consider the assignment scheme in which, instead of assigning each client to its nearest facility in SS, at each iteration, we assign clients in N2(u)N^2(u) to the chosen facility iui_u. Then each iteration of the algorithm creates a clusters, which contains three kinds of vertices:

  1. The selected client uu with minimum αu∗\alpha^*_u.
  2. All uu's neighboring facilities.
  3. All un-assigned clients neighboring to these facilities.

Such clusters are non-overlapping.

The example above shows one iteration of the algorithm. The vertex with minimum value of αu∗\alpha^*_u (i.e. 1) is opened, highlighted by the red cycle. There are two facilities connected to it, the cheap opening cost of which is 11. Then all un-assigned clients neighboring these two facilities are assigned to the cost 1 facility, as shown by the purple dashed arrows.

It is left to analyze the cost of the solution returned.

Theorem. The facility cost of Algorithm 11 is at most OPT.

Proof.

At each iteration, a client uu is selected. In the primal LP, constraint (1) requires that

∑i∈Fxu,i∗≥1 \sum_{i \in F} x^*_{u, i} \ge 1

Note that although uu can assigned to a facility fractionally, the total amount of assignment must be at least 11. Further, although a facility can be fractionally open in primal LP, the constraint (2)

yi∗≥xu,i∗ y^*_i \ge x^*_{u, i}

implies that the open amount must be at least the amount a client assign to it. We conclude that

min⁡i∈N(u)fi≤(min⁡i∈N(u)fi)⋅∑i∈N(u)xu,i∗≤∑i∈N(u)xu,i∗⋅fi≤∑i∈N(u)yi∗⋅fi. \begin{array}{llr} \min_{i \in N(u)} f_i &\le \big( \min_{i \in N(u)} f_i \big) \cdot \sum_{i \in N(u)} x^*_{u, i} \\ &\le \sum_{i \in N(u)} x^*_{u, i} \cdot f_i \\ &\le \sum_{i \in N(u)} y^*_{i} \cdot f_{i}. \end{array}

The neighbor sets N(u)N(u)'s of the selected clients u∈Bu \in B are disjoint.

Therefore, summing over u∈Bu \in B, the total facility cost is bounded by

∑u∈B∑i∈N(u)yi∗fi≤∑i∈Fyi∗fi≤OPT. \sum_{u \in B} \sum_{i \in N(u)} y^*_{i} f_{i} \le \sum_{i \in F} y^*_i f_i \le OPT.

Theorem. The connection cost of Algorithm 11 is at most 3⋅3 \cdotOPT.

Proof. Now we analyze the assignment cost.

Case One. If u∈Bu \in B, then it is selected by the algorithm, and iu≐arg⁡min⁡i∈N(u)fii_u \doteq \arg \min_{i \in N(u)} f_i belongs to SS. Therefore,

du,S≐arg⁡min⁡i∈Sdu,i≤di,iu≤αu∗. d_{u, S} \doteq \arg \min_{i \in S} d_{u, i} \le d_{i, i_u} \le \alpha_u^*.

Case Two. If v∉Bv \notin B, then v∈N2(u)v \in N^2(u) for some u∈Bu \in B. Since v∈N2(u)v \in N^2(u), there exists some facility j∈N(v)∩N(u)j \in N(v) \cap N(u). By triangle inequality, we have

dv,iu≤dv,j+du,j+dv,iu≤αv∗+αu∗+αu∗≤3αv∗ d_{v , i_u} \le d_{v, j} + d_{u, j} + d_{v, i_u} \le \alpha^*_v + \alpha^*_u + \alpha^*_u \le 3 \alpha^*_v

The last inequality holds since αu∗≤αv∗\alpha^*_u \le \alpha^*_v.

□\square

Combing assignment cost and facility cost, Algorithm 11 is 44-approximation.

How happy are we with the 44-approximation algorithm? Probably not. In the previous example, when a facility is opened, only one client contributes to its opening cost. However, in the primal solution, many other clients assigned to it do not contribute to the opening cost, which implies that the current analysis may not be tight.

Randomized Rounding [3]

33-Approximation Rounding

In the section, we improve the approximation ratio of 44 to an expected value of 33. In the previous rounding, we bound the opening cost as

∑u∈Bmin⁡i∈N(u)fi≤OPT \sum_{u \in B} \min_{i \in N(u) } f_i \le OPT

which is not tight.

Define the assignment cost for client uu in the optimal primal LP solution as Au=∑i∈Fxu,i∗du,iA_u = \sum_{i \in F} x^*_{u, i} d_{u,i}. Indeed, it is affordable to bound

∑u∈B∑i∈N(u)xu,i∗fi+∑u∈BAu≤OPT \sum_{u \in B} \sum_{i \in N(u) } x^*_{u, i} f_i + \sum_{u \in B} A_u \le OPT

It is possible to devise a randomized rounding algorithm that incorporates this cost and improve the approximation ratio to 33. The only differences compared to the first rounding algorithm are

  1. We pick a client that minimize αu∗+Au\alpha^*_u + A_u;
  2. We pick a facility with probability xu,i∗x^*_{u, i}.

Below is the algorithm.

Algorithm 2

  1. S←∅S \leftarrow \emptyset
  2. U←C; B←∅U \leftarrow C;\, B \leftarrow \emptyset
  3. while U≠∅U \neq \emptyset do
  4. \quad u←arg⁡min⁡ v∈U (αv∗+Av)u \leftarrow \underset{v \in U}{\arg \min \,} \,\big( \alpha^*_v + A_v \big)
  5. \quad Pr⁡[iu←i]=xu,i∗,∀i∈N(u)\Pr[ i_u \leftarrow i ] = x^*_{u, i}, \quad \forall i \in N(u)
  6. \quad U←U∖N2(u)U \leftarrow U \setminus N^2(u)
  7. \quad B←B∪{u}B \leftarrow B \cup \{ u \}
  8. \quad S←S∪{iu}S \leftarrow S \cup \{ i_u \}

Facility Cost

The analysis of expected facility cost is almost the same as before. It is guaranteed that

N(u)∩N(v)=∅,∀u,v∈N(u). N(u) \cap N(v) = \emptyset, \qquad \forall u, v \in N(u).

Therefore, the expected opening cost is bounded by

∑u∈B∑i∈N(u)xu,i∗⋅fi≤∑u∈B∑i∈N(u)yi∗⋅fi≤∑i∈Fyi∗fi. \sum_{u \in B} \sum_{i \in N(u) } x^*_{u, i} \cdot f_i \le \sum_{u \in B} \sum_{i \in N(u) } y^*_i \cdot f_i \le \sum_{i \in F} y_i^* f_i.

Connection Cost

Now we analyze the assignment cost.

Case One. If u∈Bu \in B, then

E[min⁡i∈Sdu,i]≤E[du,iu]=∑i∈N(u)xu,i∗⋅du,i. \mathbb{E}[ \min_{i \in S} d_{u, i} ] \le \mathbb{E}[ d_{u, i_u} ] = \sum_{i \in N(u)} x^*_{u, i} \cdot d_{u, i}.

Case One. If v∉Bv \notin B, then there exists u∈Bu \in B, s.t., v∈N2(u)v \in N^2(u). Then there exists some facility j∈N(u)∩N(v)j \in N(u) \cap N(v). By triangle inequality, the expected connection cost is at most

E[min⁡i∈Sdv,i]≤E[dv,iu]≤E[du,iu+du,j+dv,j]=∑i∈N(u)xu,i∗⋅du,i+du,j+dv,j≤Au+αu∗+αv∗≤Au+2αv∗. \begin{aligned} \mathbb{E}[ \min_{i \in S} d_{v, i} ] &\le \mathbb{E}[ d_{v, i_u} ] \le \mathbb{E}[ d_{u, i_u} + d_{u, j} + d_{v, j} ] \\ &= \sum_{i \in N(u)} x^*_{u, i} \cdot d_{u, i} + d_{u, j} + d_{v, j} \\ &\le A_u + \alpha^*_{u} + \alpha^*_v \le A_u + 2 \alpha^*_v. \end{aligned}

Total Cost

The cost is at most

∑i∈Fyi∗fi+∑i∈F,u∈Cdu,i⋅xu,i∗+2∑u∈Cαu∗≤3⋅OPT \sum_{i \in F} y_i^* f_i + \sum_{i \in F, u \in C} d_{u, i} \cdot x^*_{u, i} + 2\sum_{u \in C} \alpha^*_u \le 3 \cdot OPT

Remark: there is still room for improvement. When a client uu is selected and a facility ii is sampled, v∈N2(u)v \in N^2(u) is assigned to ii. On the other hand, vv itself may contributes to the opening cost of some other facility not open. To make the expected opening cost tight, we may consider opening facilities directly with respect to probability yi∗y^*_i.

(1+3/e)(1 + 3/e)-Approximation Rounding [3]

In the previous analysis, we see that a facility may be under-sampled. There are two reasons for this:

  1. For a facility ii, ∃u∈N(i)\exists u \in N(i) such that u∈Bu \in B. When uu is selected, facility ii is sampled with probability xu,i∗x^*_{u, i}, which might be smaller than yi∗y^*_i.

  2. For a facility ii, none of its clients u∈N(i)u \in N(i) is selected, therefore ii is never sampled.

To fix theses issues and based on Algorithm 22, we have the following algorithm. The algorithm presented here is a modified version of the one proposed in [3], but guided the same philosophy.

Algorithm 3:

  1. T←FT \leftarrow F
  2. k←0k \leftarrow 0
  3. S1,S2,S3←∅S_1, S_2, S_3 \leftarrow \emptyset
  4. while there exists un-assigned client do
  5. \quad k←k+1k \leftarrow k + 1
  6. \quad Let uku_k be the unassigned one with smallest αu∗\alpha^*_u
  7. \quad Open exactly one facility ik∈N(uk)i_k \in N( u_k ) with probability xu,i∗x^*_{u, i}
  8. \quad S1←S1∪{ik}S_1 \leftarrow S_1 \cup \{ i_k \}
  9. \quad For each i∈N(uk)−{ik}i \in N(u_k) - \{ i_k \}
  10. \qquad Open ii with probability (yi∗−xu,i∗)/(1−xu,i∗)(y^*_{i} - x^*_{u, i} ) / ( 1- x^*_{u, i} )
  11. \qquad \quad S2←S2∪{i}S_2 \leftarrow S_2 \cup \{ i \}
  12. \quad T←T−N(uk)T \leftarrow T - N(u_k)
  13. \quad Assign vv to iki_k, for each v∈N2(uk)v \in N^2( u_k )
  14. for each facility i∈Ti \in T
  15. \quad Open ii with probability yi∗y^*_i
  16. \qquad S3←S3∪{i}S_3 \leftarrow S_3 \cup \{ i \}
  17. Re-assign each u∈Cu \in C to its nearest open facility.

When the algorithm stops, denote S=S1∪S2∪S3S = S_1 \cup S_2 \cup S_3 the set of open facilities and B={u1,u2,...,u∣B∣}B = \{u_1, u_2, ..., u_{|B| } \} the set of selected clients by line 66. The following lemma shows that Algorithm 33 fully samples each facility and therefore never loses to Algorithm 11.

Facility Cost

Lemma 1. For each i∈Fi \in F, it is opened with probability yi∗y^*_i.

Proof. Note the facilities are not open independently. The claim is trivially true if a facility is is sampled in line 10. Otherwise, ∃u∈B\exists u \in B, s.t., i∈N(u)i \in N(u). The probability of ii being open is

xu,i∗+(1−xu,i∗)⋅yi∗−xu,i∗1−xu,i∗=yi∗. x^*_{u, i} + ( 1 - x^*_{u, i} ) \cdot \frac{y^*_{i} - x^*_{u, i} }{ 1- x^*_{u, i} } = y^*_i.

■\blacksquare

Corollary. By linearity of expectation, the expected facility opening cost is ∑i∈Fyi∗fi\sum_{i \in F} y^*_i f_i.

Connection Cost

What is not trivial is the analysis of the assignment cost. Given SS, assigning u∈Cu \in C to its nearest facility in SS minimizes the assignment cost. To bound this cost, we investigate a sub-optimal assignment based on SS. For each u∈Cu \in C we select a subset S(u)⊆SS(u) \subseteq S and assign it to a closest facility in S(u)S(u). This leads to a possibly increase in the expected assignment cost.

Let ZZ be the random variable of the assignment cost for client uu and XiX_i (i∈N(u)i \in N(u)) be the indicator random variable of ii being in S(u)S(u). As when none of the facility in N(u)N(u) is selected into S(u)S(u), then assignment cost is bounded by 3⋅αu∗3 \cdot \alpha^*_u, the value of ZZ is therefore at most

Z≤min⁡i∈N(u),Xi=1{du,i⋅Xi}+3αu∗⋅I[Xi=0,∀i∈N(u)] Z \le \min_{i \in N(u), X_i = 1} \{ d_{u, i} \cdot X_i \} + 3 \alpha^*_u \cdot \mathbb{I}_{[ X_i = 0, \forall i \in N(u)] }

The goal is to provide a method for generating S(u)S(u), such that

  1. Pr⁡[Xi=1]=xu,i∗\Pr[X_i = 1] = x^*_{u, i}, for ∀i∈N(u)\forall i \in N(u);
  2. Pr⁡[I[Xi=0,∀i∈N(u)]=1]≤1/e\Pr[\mathbb{I}_{[ X_i = 0, \forall i \in N(u)]} = 1 ] \le 1/e.

Any such generation method satisfies to bound the assignment cost of client uu:

E[Z]≤E[∑i∈N(u)du,iXi+3αu∗⋅I[Xi=0,∀i∈N(u)]]=∑i∈N(u)du,iE[Xi]+3αu∗⋅E[I[Xi=0,∀i∈N(u)]]≤∑i∈N(u)du,ixu,i∗+3eαu∗ \begin{aligned} \mathbb{E}[Z] &\le \mathbb{E} \left[ \sum_{i \in N(u)} d_{u, i} X_i + 3 \alpha^*_u \cdot \mathbb{I}_{[ X_i = 0, \forall i \in N(u)] } \right] \\ &= \sum_{i \in N(u)} d_{u, i} \mathbb{E}[X_i] + 3 \alpha^*_u \cdot \mathbb{E}\left[ \mathbb{I}_{[ X_i = 0, \forall i \in N(u)] } \right] \\ &\le \sum_{i \in N(u) } d_{u, i} x^*_{u, i} + \frac{3}{e} \alpha^*_u \end{aligned}

Note that the inequality here may not be tight, as we replace the min⁡\min operation into ∑\sum. But it suffices to prove the expected approximation ratio. When combined with the expected facility opening cost, we know that total expected cost is bounded by

∑i∈Fyi∗fi+∑u∈C∑i∈N(u)du,ixu,i∗+3eαu∗=(1+3e)⋅OPT \sum_{i \in F} y^*_i f_i + \sum_{u \in C} \sum_{i \in N(u) } d_{u, i} x^*_{u, i} + \frac{3}{e} \alpha^*_u = \left( 1 + \frac{3}{e} \right) \cdot OPT

The S(u)S(u) is generated as follows. If u∈Bu \in B, then we let S(u)=SS(u) = S. Otherwise, we initialize S(u)S(u) with S−N(u)S - N(u), and for facility i∈N(u)∩Si \in N(u) \cap S, we perform some carefully designed operations to ensure that Pr⁡[i∈S(u)]=xu,i∗\Pr[i \in S(u) ]= x^*_{u, i}.

  1. If i∈S3i \in S_3, we keep it in S(u)S(u) with probability xu,i∗yi∗\frac{x^*_{u, i} } {y^*_i}. Therefore,Pr⁡[i∈S(u)]=Pr⁡[i∈S(u)∣i∈S]⋅Pr⁡[i∈S]=xu,i∗ \Pr[i \in S(u)] = \Pr[i \in S(u) \mid i \in S] \cdot \Pr[i \in S] = x^*_{u, i}
  2. Otherwise, ∃uk∈B\exists u_k \in B, such that i∈N(uk)i \in N(u_k). There are two possible cases
    1. Case 1: xi,uk∗≥xu,i∗x^*_{i,u_k} \ge x^*_{u, i}, the probability of selecting ii is defined as follows:

      Pr⁡[i∈S(u)∣i∈S]={xu,i∗/xi,uk∗,i∈S10,i∈S2 \Pr[i \in S(u) \mid i \in S] = \begin{cases} \begin{array}{lr} {x^*_{u, i} } / { x^*_{i,u_k} }, &i \in S_1 \\ 0, & i \in S_2 \end{array} \end{cases}

      Therefore,

      Pr⁡[i∈S(u)]=Pr⁡[i∈S(u)∣i∈S1]⋅Pr⁡[i∈S1]+Pr⁡[i∈S(u)∣i∈S2]⋅Pr⁡[i∈S2]=xu,i∗/xi,uk∗⋅xi,uk∗=xu,i∗ \begin{array}{ll} \Pr[i \in S(u)] &= \Pr[i \in S(u) |i \in S_1 ] \cdot \Pr[ i \in S_1 ] + \Pr[i \in S(u) |i \in S_2 ] \cdot \Pr[ i \in S_2 ] \\ &= x^*_{u, i} / x^*_{i,u_k} \cdot x^*_{i,u_k} \\ &= x^*_{u, i} \end{array}
    2. Case 2: xi,uk∗<xu,i∗x^*_{i,u_k} < x^*_{u, i}, the probability of selecting ii is defined as follows:

      Pr⁡[i∈S(u)∣i∈S]={1,i∈S1(xu,i∗−xi,uk∗)⋅(1−xi,uk∗)/(yi∗−xi,uk∗),i∈S2 \Pr[i \in S(u) \mid i \in S] = \begin{cases} \begin{array}{lr} 1, &i \in S_1 \\ (x^*_{u, i} - x^*_{i, u_k} ) \cdot ( 1 - x^*_{i,u_k } ) / (y^*_{i} - x^*_{i,u_k } ), & i \in S_2 \end{array} \end{cases}

      The probability is well defined as yi∗≥xu,i∗y^*_i \ge x^*_{u, i}. It follows

      Pr⁡[i∈S(u)]=Pr⁡[i∈S(u)∣i∈S1]⋅Pr⁡[i∈S1]+Pr⁡[i∈S(u)∣i∈S2]⋅Pr⁡[i∈S2]=xi,uk∗+(xu,i∗−xi,uk∗)⋅(1−xi,uk∗)/(yi∗−xi,uk∗)⋅(yi∗−xi,uk∗)/(xu,i∗−xi,uk∗)=xu,i∗ \begin{array}{ll} \Pr[i \in S(u)] &= \Pr[i \in S(u) |i \in S_1 ] \cdot \Pr[ i \in S_1 ] + \Pr[i \in S(u) |i \in S_2 ] \cdot \Pr[ i \in S_2 ] \\ &= x^*_{i,u_k} + (x^*_{u, i} - x^*_{i, u_k} ) \cdot ( 1 - x^*_{i,u_k } ) / (y^*_{i} - x^*_{i,u_k } ) \cdot (y^*_{i} - x^*_{i,u_k } ) / (x^*_{u, i} - x^*_{i, u_k} )\\ &= x^*_{u, i} \end{array}

It is left to show that Pr⁡[I[Xi=0,∀i∈N(u)]=1]≤1/e\Pr[\mathbb{I}_{[ X_i = 0, \forall i \in N(u)]} = 1 ] \le 1/e. For u∈Bu \in B, this holds trivially. If not, we prove the following lemma.

Lemma 2. For any client u∈C∖Bu \in C \setminus B, the probability that none of facility in N(u)N(u) belongs to S(u)S(u) is bounded by 1/e1/ e.

Proof.

Observe that

N(j1)∪N(j2)∪...∪N(j∣B∣)∪T=F N(j_1) \cup N(j_2) \cup ... \cup N(j_{|B| } ) \cup T = F

constitutes a partition of FF. For any client uu, define Rk=N(uk)∩N(u)R_k = N(u_k) \cap N(u), where 1≤k≤∣B∣1 \le k \le |B|. Further, let R∣B∣+1=T∩N(u)R_{|B| + 1} = T \cap N(u). Then {Rk}k∈[∣B∣+1]\{ R_k \}_{k \in [|B| + 1]} is a partition of N(u)N(u).

Consider facilities in N(uk)N(u_k) (k∈[∣B∣]k \in [|B|]). The probability of none of them being in S(u)S(u) is

(1−∑i∈Rk∧xi,uk∗<xu,i∗xi,uk∗−∑i∈Rk∧xi,uk∗≥xu,i∗xi,uk∗⋅xu,i∗xi,uk∗)⋅∏i∈Rk∧xi,uk∗<xu,i∗(1−yi∗−xu,i∗1−xu,i∗1−xu,i∗yi∗−xu,i∗(xu,i∗−xi,uk∗))≤exp⁡(−∑i∈Rk∧xi,uk∗<xu,i∗xi,uk∗−∑i∈Rk∧xi,uk∗≥xu,i∗xu,i∗)⋅∏i∈Rk∧xi,uk∗<xu,i∗(1−(xu,i∗−xi,uk∗))≤exp⁡(−∑i∈Rk∧xi,uk∗<xu,i∗xi,uk∗−∑i∈Rk∧xi,uk∗≥xu,i∗xu,i∗)⋅exp⁡(−∑i∈Rk∧xi,uk∗<xu,i∗(xu,i∗−xi,uk∗))=exp⁡(−∑i∈Rkxu,i∗) \begin{aligned} &\left( 1 - \sum_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } x^*_{i, u_k} - \sum_{i \in R_k \wedge x^*_{i, u_k} \ge x^*_{u, i} } x^*_{i, u_k} \cdot \frac{x^*_{u, i} }{ x^*_{i, u_k} } \right) \cdot \prod_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } \left(1 - \frac{y^*_{i} - x^*_{u, i} }{ 1- x^*_{u, i}} \frac{ 1- x^*_{u, i}}{y^*_{i} - x^*_{u, i} } (x^*_{u, i} - x^*_{i, u_k} ) \right) \\ &\le \exp \left( - \sum_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } x^*_{i, u_k} - \sum_{i \in R_k \wedge x^*_{i, u_k} \ge x^*_{u, i} } x^*_{u, i}\right) \cdot \prod_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } \left(1 - (x^*_{u, i} - x^*_{i, u_k} ) \right) \\ &\le \exp \left( - \sum_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } x^*_{i, u_k} - \sum_{i \in R_k \wedge x^*_{i, u_k} \ge x^*_{u, i} } x^*_{u, i}\right) \cdot \exp \left( -\sum_{i \in R_k \wedge x^*_{i, u_k} < x^*_{u, i} } (x^*_{u, i} - x^*_{i, u_k} ) \right) \\ &= \exp \left( { - \sum_{i \in R_k} x^*_{u, i} } \right) \end{aligned}

The relation holds even if Rk=∅R_k = \emptyset, in which ∑i∈Rkxu,i∗=0\sum_{i \in R_k} x^*_{u, i} = 0.

For k=∣B∣+1k = |B| + 1, the probability that none of the facility in RkR_k is sampled is given by

∏i∈Rk+1(1−yi∗xu,i∗yi∗)≤exp⁡(−∑i∈Rk+1xu,i∗) \prod_{i \in R_{k + 1} } \left( 1 - y^*_i \frac{x^*_{u, i} } {y^*_i} \right) \le \exp \left( - \sum_{i \in R_{k + 1} } x^*_{u, i} \right)

Therefore, taking product over all the events, we know that

∏k∈[∣B∣+1]exp⁡(−∑i∈Rkxu,i∗)=exp⁡(−∑i∈N(u)xu,i∗)=1e \begin{aligned} \prod_{k \in [|B| + 1] } \exp \left( - \sum_{i \in R_k } x^*_{u, i} \right) = \exp \left( - \sum_{i \in N(u) } x^*_{u, i} \right) = \frac{1}{e} \end{aligned}

■\blacksquare

Primal-Dual Algorithm [2]

In this section we show a primal-dual algorithm that is purely combinatorial.

  1. Initially we have a set of dual variables αu,u∈C\alpha_u, u \in C and βu,i,u∈C,i∈F\beta_{u,i}, u \in C, i \in F that are set to 00. Note that they are feasible.

  2. Then we try to optimize this set of variables by increasing all αu,u∈C\alpha_u, u \in C in parallel until some αu\alpha_u's are blocked.

Why are they blocked? Because the dual constraint

αu≤du,i+βu,i \alpha_u \le d_{u,i} + \beta_{u,i}

becomes tight for some client u∈Cu \in C. If we increase αu\alpha_u further, the variables are no longer dual feasible. However, we can modify our strategy by increasing these βu,i\beta_{u,i} simultaneously with αu\alpha_u until facility ii is blocked, i.e.,

∑u∈Cβu,i=fi. \sum_{u \in C} \beta_{u,i} = f_i.

Definition. For each facility i∈Fi \in F, define its neighbors N(i)N(i) as to be the clients such that αu≥du,i\alpha_u \ge d_{u,i}.

The algorithm for constructing the dual variables are given as follows.

Algorithm. Increasing the Dual

  1. U←CU \leftarrow C: the set of un-blocked clients.
  2. B←∅B \leftarrow \emptyset: the set of blocked facilities.
  3. while U≠∅U \neq \emptyset do
  4. \quad For ∀u∈U\forall u \in U
  5. \qquad Increase all αu\alpha_u (if necessary, βu,i\beta_{u,i} for some ii ) simultaneously
  6. \quad Until either
  7. \qquad some facility i∉Bi \notin B is blocked:
  8. \qquad\quad B←B∪{i}B \leftarrow B \cup \{i \}
  9. \qquad\quad U←U∖N(i)U \leftarrow U \setminus N(i)
  10. \qquad some client uu neighbors a blocked facility i∈Bi \in B:
  11. \qquad\quad U←U∖{u}U \leftarrow U \setminus \{ u \}

Question to Ponder. What is the running time for the Dual Variable Increment algorithm.

After running the algorithm above, we get a set of maximal variables which we can't simultaneously increase any more. It has the following property

Property. Each client u∈Cu \in C neighbors at least one block facility.

If not, the algorithm will not stop since UU is not empty.

Next, we show how to construct an approximate solution from the maximal dual variables. First we construct a graph G=(V,E)G = (V, E) based on the dual LP.

  1. The vertex set V=B∪CV = B \cup C.
  2. The edge set E={(u,i):αu≥du,i,u∈C,∀i∈B}E = \{ (u, i) : \alpha_u \ge d_{u,i}, u \in C, \forall i \in B \}.

Moreover, if βu,i>0\beta_{u,i} > 0 for some i∈Fi \in F, u∈Cu \in C, we say that uu contributes to ii.

Definition. For each facility i∈Fi \in F, let N+(i)N^+(i) be set of clients contributing to it.

Algorithm. Facility Selection

  1. S←∅S \leftarrow \emptyset.
  2. while B≠∅B \neq \emptyset do
  3. \quad Let i∈Bi \in B be the earliest blocked facility.
  4. \quad S←S∪{i}S \leftarrow S \cup \{ i \}
  5. \quad // Remove all facilities i′i' if ∃u∈C\exists u \in C that contributes to both ii and i′i'.
  6. \quad B←B∖{i′∈B:N+(i)∩N+(i′)≠∅}B \leftarrow B \setminus \{ i' \in B : N^+(i) \cap N^+(i') \neq \emptyset \}.

The figure below shows an example of dual variable increment algorithm.

The figure below shows the corresponding derived graph.

The figure below shows an example of facility selection. The selected facilities are marked with dark green. The clients contributing to theses facilities are connected to them red lines.

Facility Cost

We can show by induction that when a blocked facility is selected, its opening cost is fully covered by all clients contributing to this facility. Note that if any other blocked facility is connected to any of these clients, it is removed from the candidate set. Therefore, when a new blocked facility ii is selected, the clients in N+(i)N^+(i) can not contribute to any previous selected facility.

The cost of open facilities in SS, plus the cost of connecting clients in N+(i)N^+(i) for i∈Si \in S, is given by

∑i∈S(fi+∑u∈N+(i)du,i)=∑i∈S(∑u∈N+(i)βi,j+∑u∈N+(i)du,i)=∑i∈S∑u∈N+(i)αu \sum_{i \in S} \left( f_i + \sum_{u \in N^+(i)} d_{u,i} \right) = \sum_{i \in S} \left( \sum_{u \in N^+(i)} \beta_{i,j} + \sum_{u \in N^+(i)} d_{u,i} \right) = \sum_{i \in S} \sum_{u \in N^+(i)} \alpha_u

Connection Cost

It is left to consider a client uu not in N+(i)N^+(i) for any i∈Si \in S.

Case One. u∈N(i)u \in N(i) for some i∈Si \in S, then the connection cost is

du,i=αu d_{u,i} = \alpha_u

Case Two. Otherwise, by the property of the algorithm, we know that there exists a facility ii that stops αu\alpha_u from increasing. The reason that ii is not selected is that when some other facility i′i' is selected into SS, ii is removed from the candidate set BB because N+(i)∩N+(i′)≠∅N^+(i) \cap N^+(i') \neq \emptyset.

Lemma. Let v∈N+(i)∩N+(i′)v \in N^+(i) \cap N^+(i'). Then αv≤αu\alpha_{v} \le \alpha_u

Proof.

When ii stops αu\alpha_u, since vv also contributes to ii,

  1. either αv\alpha_{v} has stopped from increasing or
  2. αv\alpha_v stops simultaneously with uu.

□\square

Therefore, the cost of assigning uu to i′i' is at most

du,i′≤du,i+dv,i+dv,i′≤αu+2αv≤3αu. d_{u, i'} \le d_{u,i} + d_{v, i} + d_{v, i'} \le \alpha_u + 2 \alpha_{v} \le 3 \alpha_u.

Question to Ponder. What is the running time of the algorithm?

Finally we show another example where the edge weight between (b,y)(b,y) is changed to 1.

Note that compared to the previous example, only facility xx is selected (marked by dark green), because we can use bb to contribute only one facility. Now facility yy is the one that stops αc\alpha_c and αd\alpha_d from increasing.

Reference

[1] Shmoys DB, Tardos É, Aardal K. Approximation algorithms for facility location problems. InProceedings of the twenty-ninth annual ACM symposium on Theory of computing 1997 May 4 (pp. 265-274).

[2] Jain K, Vazirani VV. Primal-dual approximation algorithms for metric facility location and k-median problems. In 40th annual symposium on foundations of computer science (Cat. No. 99CB37039) 1999 Oct 17 (pp. 2-13). IEEE.

[3] Chudak FA, Shmoys DB. Improved approximation algorithms for the uncapacitated facility location problem. SIAM Journal on Computing. 2003;33(1):1-25.