College of Computer & Information Science Fall 2007 Northeastern University Handout 25 September 2007 CS G399: Algorithmic Power Tools I Scribe: Bishal Thapa

Lecture Outline:

• Uncapacitated Facility Location:

– Linear Programming Rounding Approach : Constant (6)-Approximation – Combinatorial “Greedy” Approach : Constant (6)-Approximation

In this lecture, we take a look at two separate constant approximation polynomial-time solutions for the Uncapacitated Facility Location problem. The first algorithm features a deterministic LP rounding approach, and the second algorithm takes a greedy approach to the problem (which is not explicitly a primal-dual algorithm, but can be analyzed by looking at the dual LP), both yielding a solution of cost within a factor of 6 of the optimal.

1 (metric) Uncapacitated Facility Location

We described the Uncapacitated Facility Location problem in the previous class.

V  Set of demand points (clients)
F  Set of possible facility locations
d_{i}  Demand for the service at demand point i
c  Metric on V ∪ F
c_{ij}  Cost for assigning i ∈ V to facility j ∈ F
σ  Assignment function, σ : V → F
f_{j}  Cost of opening a facility at location j ∈ F
F acility Cost = ∑_{j∈F} f_{j}
Service Cost = ∑_{i∈V} d_{i} × c_{iσ(i)}
T otal Cost  = F acility Cost + Service Cost

Our goal is to minimize the total cost. Notice that we are considering the uncapacitated metric facility problem. So, the metric service costs satisfy this property (triangle inequality):

c_{ij} + c_{jk} + c_{kl} ≥ c_{il} ∀ i, j, k, l ∈ V ∪ F

1.1 LP Rounding

Assuming unit demands, the UNCAPACITATED FACILITY LOCATION PROBLEM (UFLP) can be formulated as an integer linear program as follows:

min  ∑_{j∈F} f_{j} × y_{j} + ∑_{i∈V} x_{ij} × c_{ij}

s.t.  x_{ij} ≤ y_{j}  ∀i ∈ V, j ∈ F

∑_{j} x_{ij} ≥ 1 ∀i ∈ V

x_{ij}, y_{j} ∈ {0, 1} ∀i ∈ V, j ∈ F

By relaxing the integrality constraints we get the linear program:

min  ∑_{j∈F} f_{j} × y_{j} + ∑_{i∈V} x_{ij} × c_{ij}
s.t.  x_{ij} ≤ y_{j}  ∀i ∈ V, j ∈ F

∑_{j} x_{ij} ≥ 1 ∀i ∈ V

x_{ij}, y_{j} ≥ 0 ∀i ∈ V, j ∈ F

LP rounding algorithms solve the latter linear program and round the fractional solution of the primal LP suitably to achieve a feasible integral solution to the problem. Algorithm 1 achieves a solution of cost within a factor of 6 to the optimal solution.

Algorithm 1: Rounding the non-integral LP solution

1. Solve the non-integral LP. Let (< x_{ij}^{∗} >, < y_{j}^{∗} >) be the optimum fractional solution.

2. for each client i ∈ V do

define: ; r_{i} = 2 ∑_{j} x_{ij}^{∗} × c_{ij} ; B_{i} = {j ∈ F |c_{ij} ≤ r_{i}}

3. Sort r_{i} in the non-decreasing order. WLOG, assume r_{1} ≤ r_{2} ≤ ⋯ ≤ r_{n}.

4. Let V′ := {r_{1}, r_{2}, ⋯ r_{n}} s.t. the index-set of V′ represents the clients. Call the set I[V′].

5. Let i := 1, F′ := ∅.

6. for client i ∈ I[V′] do let j ∈ B_{i} with x_{ij}^{∗} > 0 and f_{j} minimum. Set F′ = F′ ∪ {j}. let N_{i} = {r_{k} ∈ V′|B_{i} ∩ B_{k} ≠ ∅}. for each client k s.t. r_{k} ∈ N_{i} do

Set σ(k) ← j.

Note: i ∈ N_{i} vacuously.

Set V′ = V′ \ N_{i} while keeping the sorted order among the remaining elements as before. Re-label the elements in the new V’ starting from index 1. (new I[V′] ⊂ old I[V′].) If V′ = ∅, break.

7. Output F′ and σ.

Theorem 1. The running time for Algorithm 1 is polynomial in the size of input.

Proof. It is clear that the algorithm terminates. The algorithm consists of three processes: LP solving, Sorting and Comparing. We know that the linear programming can be solved in polynomial time using the ellipsoid or interior point methods. Sorting can be done very efficiently as well, using a merge sort or heap sort at the cost of O(n log n) running time. Finally, the comparing procedure involved in step 6 of Algorithm 1 is doable in polynomial-time also. The detailed complexity analysis of comparison procedure is left for the reader.

Claim 1. ∀i ∈ V, ∑_{j∈B_{i}} y_{j}^{∗} ≥ \frac{1}{2}

Proof. (Proof by Contradiction) Let LP_{i} denote the service cost of client i ∈ V in the LP solution. So, LP_{i} = ∑_{j} x_{ij}^{∗} × c_{ij}. Assume that the claim is not true. Then, ∑_{j∈B_{i}} y_{j}^{∗} < \frac{1}{2} [hypothesis]. We have,

LP_{i} ≥ ∑_{j∉B_{i}} x_{ij}^{∗} × c_{ij}

because, the right hand side doesn’t include j’s inside the ball.

≥ ∑_{j∉B_{i}} x_{ij}^{∗} × r_{i} (= r_{i} × ∑_{j∉B_{i}} x_{ij}^{∗})

because, c_{ij} > r_{i} ∀j ∉ B_{i}.

> \frac{1}{2} × r_{i}

because of the hypothesis and the fact that,

∑_{j∈B_{i}} x_{ij}^{∗} ≤ ∑_{j∈B_{i}} y_{j}^{∗}

thus, ∑_{j∈B_{i}} x_{ij}^{∗} < \frac{1}{2}, which further implies,

∑_{j∉B_{i}} x_{ij}^{∗} > \frac{1}{2}

Hence, we get

LP_{i} > \frac{1}{2} × r_{i} = LP_{i} (contradiction)

because of the definition of LP_{i}.

Lemma 1. Let LP_{F} denote the facility cost of the LP solution. Then, ∑_{j∈F′} f_{j} ≤ 2 × LP_{F}.

Proof. We know LP_{F} = ∑_{j∈F} f_{j} × y_{j}^{∗}. For each j ∈ F′, let i_{j} denote the client in I[V′] that was considered, when j was added to F′. Consider a ball B_{i_{j}}. Then,

∑_{l∈B_{i_{j}}} y_{l}^{∗} × f_{l} ≥ ∑_{l∈B_{i_{j}}} y_{l}^{∗} × f_{j} (= f_{j} × ∑_{l∈B_{i_{j}}} y_{l}^{∗})

because, we pick j ∈ B_{i_{j}} s.t. f_{j} is minimum [refer to Step 6, Algorithm 1]. Hence,

∑_{l∈B_{i_{j}}} y_{l}^{∗} × f_{l} ≥ \frac{1}{2} × f_{j}

by previous equation and Claim 1. Adding over all j ∈ F′,

\frac{1}{2} × ∑_{j∈F′} f_{j} ≤ ∑_{l∈B_{i_{j}}} y_{l}^{∗} × f_{l} ≤ ∑_{j∈F} f_{j} × y_{j}^{∗}

because, we pick a facility j ∈ F from each of the non-overlapping balls. If balls overlap, we pick one j from a ball among all the intersecting balls, and ignore the rest. Also, we pick the least cost facility inside a ball. Hence,

∑_{j∈F′} f_{j} ≤ 2 × LP_{F}

Lemma 2. Let LP_{i} be the service cost of client i ∈ V in the LP solution. Then, ∀i ∈ V, c_{iσ(i)} ≤ 6 × LP_{i}.

Proof. Consider two possible cases for a client i:

1. Client i is such that some j ∈ B_{i} was selected in step 6 of the algorithm 1. Then,

c_{iσ(i)} ≤ r_{i} = 2 × LP_{i}

by definition of B_{i}.

2. Client i is removed at some iteration in Step 6, due to the overlap of B_{i} with B_{k} for some k.

Then,

r_{i} ≥ r_{k},
∃l ∈ B_{i} ∩ B_{k}

Assuming, we included j ∈ B_{k} in F′, we have

σ(i) = σ(k) = j

Therefore,

c_{ij} ≤ c_{il} + c_{lk} + c_{kj} ≤ r_{i} + 2 × r_{k} ≤ 3 × r_{i}

due to triangle inequality. Hence,

c_{ij} ≤ 6 × LP_{i}

In either case, c_{iσ(i)} ≤ 6 × LP_{i}.

Let LP_{S} denote the service cost of the LP solution. Then, Lemma 2 gives us,

∑_{i∈V} c_{iσ(i)} ≤ 6 × LP_{S}

.

Theorem 2. T otal Cost ≤ 6 × (LP_{F} + LP_{S})

Proof. This follows directly from Lemmas 1 and 2 and the definition of Total Cost. Since,

Service Cost ≤ 6 × LP_{S}, F acility Cost ≤ 2 × LP_{F}
⟹ T otal Cost ≤ 6 × (LP_{F} + LP_{S})

.

1.2 Combinatorial “Greedy” Approach

This algorithm takes a greedy approach on the UNCAPACITATED FACILITY LOCATION problem. The algorithm doesn’t make an explicit use of primal-dual schema however, it substantially derives its intuition from the dual fitting approach. Algorithm 2 runs on polynomial-time and achieves a solution of cost within a factor of 6 of the optimal solution.

Algorithm 2: Greedy Approach

1. for each facility j ∈ F do define: r_{j} = r, r > 0 at which ∑_{i:c_{ij}≤r}(r − c_{ij}) = f_{j} B_{j} = {i ∈ V |c_{ij} ≤ r_{j}}

2. Sort r_{j} in the non-decreasing order. WLOG, assume r_{1} ≤ r_{2} ≤ ⋯ ≤ r_{m}.

3. Let F′ := {r_{1}, r_{2}, ⋯ r_{m}} s.t. the index-set of F′ represents the facilities. Call the set I[F′].

4. Let j := 1, X := ∅.

5. for facility j ∈ I[F′] do Set X = X ∪ {j}. let M_{j} = {r_{l} ∈ F′|B_{j} ∩ B_{l} ≠ ∅}. Set F′ = F′ \ M_{j} while keeping the sorted order among the remaining elements as before. Note: j ∈ M_{j} vacuously. Re-label the elements in the new F′ starting from index 1. (new I[F′] ⊂ old I[F′].) If F′ = ∅, break.

6. Assign each client to the nearest facility in X. Let σ : V → X denote the mapping.

7. Output X and σ.