Primal-Dual Algorithms for Connected Facility Location Problems

Similar documents
Approximation Algorithms: The Primal-Dual Method. My T. Thai

Steiner Trees and Forests

Network Design Foundations Fall 2011 Lecture 10

Group Strategyproof Mechanisms via Primal-Dual Algorithms. Key Points to Discuss

The Online Connected Facility Location Problem

Approximation Algorithms

Approximation Algorithms

A Constant Factor Approximation Algorithm for the Multicommodity Rent-or-Buy Problem

6. Lecture notes on matroid intersection

1 Linear programming relaxation

Primal-Dual Methods for Approximation Algorithms

Lecture Overview. 2 The Steiner Tree Problem. 2.1 Steiner tree: a 2-approximation algorithm. COMPSCI 590.1: Graph Algorithms March 22, 2015

1 The Traveling Salesperson Problem (TSP)

In this lecture, we ll look at applications of duality to three problems:

Algorithms for Provisioning Virtual Private Networks in the Hose Model

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

Approximation Algorithms

15-854: Approximations Algorithms Lecturer: Anupam Gupta Topic: Direct Rounding of LP Relaxations Date: 10/31/2005 Scribe: Varun Gupta

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007

5. Lecture notes on matroid intersection

Lower-Bounded Facility Location

Theorem 2.9: nearest addition algorithm

Repetition: Primal Dual for Set Cover

Lecture Overview. 2 Shortest s t path. 2.1 The LP. 2.2 The Algorithm. COMPSCI 530: Design and Analysis of Algorithms 11/14/2013

Solutions for the Exam 6 January 2014

The Design of Approximation Algorithms

Distributed minimum spanning tree problem

Treewidth and graph minors

Combinatorial Optimization

Lecture 7: Asymmetric K-Center

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

Topic: Local Search: Max-Cut, Facility Location Date: 2/13/2007

ACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms

1 Variations of the Traveling Salesman Problem

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

6 Randomized rounding of semidefinite programs

Notes for Lecture 24

4 Integer Linear Programming (ILP)

Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class)

Online Facility Location

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

The Encoding Complexity of Network Coding

8 Matroid Intersection

3 No-Wait Job Shops with Variable Processing Times

12.1 Formulation of General Perfect Matching

12 Introduction to LP-Duality

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Lecture 3: Totally Unimodularity and Network Flows

1. Lecture notes on bipartite matching February 4th,

LECTURES 3 and 4: Flows and Matchings

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP

CSE 417 Network Flows (pt 4) Min Cost Flows

A Primal-Dual Approximation Algorithm for Partial Vertex Cover: Making Educated Guesses

Problem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.

A Note on Polyhedral Relaxations for the Maximum Cut Problem

EXERCISES SHORTEST PATHS: APPLICATIONS, OPTIMIZATION, VARIATIONS, AND SOLVING THE CONSTRAINED SHORTEST PATH PROBLEM. 1 Applications and Modelling

22 Elementary Graph Algorithms. There are two standard ways to represent a

Linear Programming Duality and Algorithms

Notes on Binary Dumbbell Trees

Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching. 1 Primal/Dual Algorithm for weighted matchings in Bipartite Graphs

Network Design for Information Networks

Lecture 14: Linear Programming II

Solution for Homework set 3

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Math 5593 Linear Programming Lecture Notes

Lecture 7. s.t. e = (u,v) E x u + x v 1 (2) v V x v 0 (3)

22 Elementary Graph Algorithms. There are two standard ways to represent a

Approximation Algorithms

Algorithms for Euclidean TSP

1. Lecture notes on bipartite matching

Stanford University CS261: Optimization Handout 1 Luca Trevisan January 4, 2011

Approximating Node-Weighted Multicast Trees in Wireless Ad-Hoc Networks

Randomized rounding of semidefinite programs and primal-dual method for integer linear programming. Reza Moosavi Dr. Saeedeh Parsaeefard Dec.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

ON THE EQUIVALENCE BETWEEN THE PRIMAL-DUAL SCHEMA AND THE LOCAL RATIO TECHNIQUE

Basic Graph Theory with Applications to Economics

Approximating Buy-at-Bulk and Shallow-light k-steiner trees

11. APPROXIMATION ALGORITHMS

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

Approximation Algorithms

A Reduction of Conway s Thrackle Conjecture

1 Bipartite maximum matching

Polynomial-Time Approximation Algorithms

Lecture 5: Duality Theory

11.1 Facility Location

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006

A 4-Approximation Algorithm for k-prize Collecting Steiner Tree Problems

Parameterized graph separation problems

4 Greedy Approximation for Set Cover

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality

Approximation algorithms for minimum-cost k-(s, T ) connected digraphs

Number Theory and Graph Theory

11. APPROXIMATION ALGORITHMS

Greedy algorithms is another useful way for solving optimization problems.

Transcription:

Primal-Dual Algorithms for Connected Facility Location Problems Lecture Notes for the course Approximation algorithms by Martin Korff (korff@diku.dk) Matias Sevel Rasmussen (sevel@math.ku.dk) Tor Justesen (torustesen@gmail.dk) Department of Computer Science, University of Copenhagen January, 2006

Contents Preface 2 1 Incentive 3 2 Problem description 5 2.1 IP formulation................................... 5 2.2 The rent-or-buy problem.............................. 5 2.2.1 A naive algorithm............................. 6 3 The rent-or-buy Problem 8 3.1 The algorithm.................................... 9 3.1.1 Phase 1................................... 9 3.1.2 Phase 2................................... 10 3.2 Example....................................... 12 3.3 Analysis....................................... 14 4 The connected facility location problem 19 4.1 The algorithm.................................... 19 4.2 Analysis....................................... 22 5 Implementation and extensions 23 References 24 1

Preface These lecture notes are a presentation of the article Primal-Dual Algorithms for Connected Facility Location Problems by Chaitanya Swamy and Amit Kumar (see [Swamy & Kumar 2004]). The lecture notes are written by Martin Korff, Matias Sevel Rasmussen and Tor Justesen as a part of the course Approximation algorithms held at Department of Computer Science, University of Copenhagen, winter 2005 06. The lecture notes are written on the assumption that the reader is at a professional level equivalent to the course Approximation algorithms. 2

1 Incentive The facility location problem has occupied a central place in research since the early 1960 s. It models design situations such as deciding placement of factories, warehouses, schools, and hospitals. Modern day applications include placement of proxy servers on the web. The metric uncapacitated facility location problem (FL) Given an undirected graph G = (V, E) with nonnegative edge costs, a set F V of facilities with opening costs f i, i F and a set of clients D V. Let c i denote the connection costs for connecting client D to facility i F. The connection costs satisfy the triangle inequality. The problem is to find a subset I F of facilities to open and a function σ() : D I assigning clients to open facilities in such a way that the total cost of opening facilities and connecting clients to open facilities is minimized. Several constant factor approximation algorithms have already been found for the facility location problem, however, many modern applications occur settings where the open facilities want to communicate with each other. That is, the problem is to find a minimal cost solution in which the demands are first clustered around the opened facilities, and then the opened facilities are interconnected allowing them to communicate. This problem is also known as the metric uncapacitated connected facility location problem. A typical example is a telecommunication network consisting of a central core and a set of endnodes. The core consists of a set of interconnected core nodes (facilities) which have switching capability with a certain switch cost for each core node (opening costs). The problem now consists in selecting a subset of core nodes, connecting the core nodes to each other, and routing traffic from the endnodes (clients) to the selected core nodes. Another example arises when considering a data management/caching problem. Here we have some users issuing read and write requests for data obects. Each obect has to be stored in a memory module by paying a certain storage cost and an obect may be replicated and stored in multiple locations. Given a placement of obects, a read request for an obect issued at node is served by the nearest location i() that has a copy of the obect. A write request however needs to update all copies of the obect. The goal is now to find a placement of obects to memory modules that minimizes the sum of storage, read, and write request costs. In this case, the facilities are the memory modules, the clients are the nodes issuing read/write requests, and the opening cost of a facility is the storage cost associated with the memory module. The demand of a client is the number of requests issued by the node. A virtual private network (VPN) is a private data network that makes use of the public telecommunication infrastructure, maintaining privacy through the use of a tunneling protocol and security procedures. That is, rather than building a new physical network, the private network is established by reserving bandwidth on the public telecommunication network. Since bandwidth must be reserved at a cost, the goal is to reserve as little as necessary to support the expected communication. At the same time, the VPN must be flexible enough to support a range of possible communication patterns among the nodes it serves. In other words, a single traffic matrix is not known in advance, since communication patterns will be changing over time. Finally, it is often desirable for the subgraph on which bandwidth is reserved to have a simple structure that will facilitate routing in the resulting VPN. In the simplest form of the model (the symmetric case) each terminal has an upper bound on the cumulative amount of traffic that can be sent or received at any point in time. We must hence 3

choose bandwidth reservations and node-to-node paths so that any set of demands respecting these upper bounds can be feasibly routed. In addition to the symmetric model, there is a more general asymmetric formulation of the problem in which each node now has two upper bounds, (b in (v), b out (v)), which represent upper bounds on the amount of flow that the terminal v can receive and send, respectively. According to [Gupta et al. 2001] the symmetric VPN problem is in P, whereas the asymmetric VPN is in NP. However, [Gupta et al. 2001] also describes how an instance of the asymmetric VPN can be reduced to an instance of the metric uncapacitated connected facility location problem. An approximation algorithm for the metric uncapacited connected facility location problem is thus also an approximation algorithm for the asymmetric VPN problem. In general, the best way to interconnect the facilities is by finding a minimal cost Steiner tree over the opened facilities. This problem is also know as the metric Steiner tree problem. The metric Steiner tree problem (ST) Given an undirected graph G = (V, E) with nonnegative edge costs and whose vertices are partitioned into two sets, R V (required vertices) and S = V \R (Steiner vertices), find a minimum cost tree in G that contains all the vertices in R and any subset of the Steiner vertices. We can hence think of the metric uncapacitated facility location problem as a combination of FL and ST. The metric uncapacitated connected facility location problem (ConFL) Given an undirected graph G = (V, E) with nonnegative edge costs, a set F V of facilities with opening costs f i, i F and a set of clients D V with demands d, D. Furthermore we are given a parameter M 1. Let i() : D F denote the facility that client D is assigned to in the final solution and let c i denote the connection costs (with respect to the edge costs) for connecting client D to facility i F. Moreover, assume that the assignment costs for a client D are proportional to the demand d. The problem is to find a subset I F of facilities to open, a function σ() : D I assigning clients to open facilities and a Steiner tree T connecting all of the opened facilities, in such a way that the total cost of opening facilities, connecting clients to open facilities and connecting the opened facilities is minimized. The cost of connecting the facilities is simply the cost of the Steiner tree T scaled by a factor of M. A recently published report ([Swamy & Kumar 2004]) presents a 8.55-approximation algorithm for ConFL, which is currently the best-known approximation factor. Previously the best approximation factor for the problem was 10.66 and this result was not combinatorial it was obtained by solving an exponential size linear programming relaxation. The algorithm presented in [Swamy & Kumar 2004] integrates the primal-dual approaches for FL problem and ST. In the following we will give a description of the algorithm a present the basic analysis of the theory behind the algorithm. 4

2 Problem description In the following we will introduce an IP formulation for ConFL. It is based on this formulation the primal dual algorithms are developed. 2.1 IP formulation Let y i indicate if facility i is open, x i indicate if client D is connected to facility i F and z e indicate if edge e E is included in the Steiner tree. Furthermore assume that we know a facility v that is opened and hence belongs to the Steiner tree constructed by the optimal solution. We can make this assumption because we can try all F different possibilities for v and select the cheapest solution. The connected facility location problem can thus be formulated as the following integer program minimize f i y i + d c i x i + M c e z e i e subect to i i x i 1 for all, x i y i for all i,, y v = 1 x i z e for all S V, v / S,, i S e δ(s) x i, z e {0, 1} The constraint i x i 1 specifies that each client must be connected to at least one facility. Notice, that even though the constraint is an inequality, we will in the final solution have that for all x i = 1 i because it is a minimization problem. The constraint x i y i specifies that a client may only be connected to an open facility and the constraint y v = 1 specifies that facility v F is open. From the first constraint we have each client will be connected to exactly one facility, thus for any set S V the sum i S x i will be at most one. If the sum is one the constraint i S x i e δ(s) z e thus prescribes, that there must be at least one edge e δs that is included in the Steiner tree. Considering the set S = {i} we thus see that the constraint specifies that if a client is connected to an i, then i must be connected to the Steiner tree. 2.2 The rent-or-buy problem The rent-or-buy problem is a type of network design problem, in which there are two ways to install capacity on any given edge. Capacity can either be rented, with cost incurred on a per-unit basis, or bought, which allows unlimited use after payment of a large fixed cost. Given an undirected graph G = (V, E) and a set D = {(s 1, t 1 ),..., (s p, t p )} of vertex pairs called demands, we seek a minimum-cost way of installing sufficient capacity on the edges E so that a prescribed amount of flow can be sent simultaneously from each source s k to the corresponding sink t k. A special case of the rent-or-buy problem is the so-called single-sink version, where all sinks t k are identical. 5

In a solution to the connected facility problem we have that each client is connected to exactly one open facility i and that the open facilities are connected to each other by a Steiner tree. We thus have, that the solution forms a tree. Now, assume that we know a facility v that is opened and hence belongs to the Steiner tree constructed by the optimal solution. Furthermore we assume that f i = 0 for all facilities i F and that F = V, that is, a facility may be opened anywhere in the network without any opening costs. With these assumptions the connected facility location problem can be seen as a special case of the singlesink rent-or-buy problem, where the demands are given by the set of vertex pairs (, v), D and the prescribed flow for each demand is given by d. For the sake of simplicity we will assume that d = 1 for all D. If we let y i, x i and z e be defined as in Section 2 we can formulate the rent-or-buy problem as the following integer program minimize c i x i + M c e z e e subect to i 2.2.1 A naive algorithm i x i 1 for all, x i z e for all S V, v / S,, i S e δ(s) x i, z e {0, 1} Basically, the connected metric uncapacitated facility location problem is a combination of FL and ST, as we require, that the opened facilities be connected to each other by a Steiner tree. This gives occasion to an obvious naive algorithm for ConFL. For the sake of simplicity, let us look only at the rent-or-buy problem. Algorithm 1 Naive rent-or-buy algorithm 1: run a constant factor approximation FL algorithm on the problem instance. Open facilities and assign demands. 2: run a constant factor approximation ST algorithm on the opened facilities. Connect facilities by the Steiner tree The first step in the naive algorithm will open a facility at each demand. So the Steiner tree is build on all demands. The example illustrated in Figure 1 shows an instance where the naive algorithm finds a solution with costs as high as Ω(M) OPT. This should motivate the development of a better algorithm. 6

(a) 1 1 1 1 n v n open facility node client (b) v Figure 1: Naive algorithm (a): the costs are 2M(n 1). Optimal (b): the costs are 2M + 2n. The illustration is based on [Swamy & Kumar 2002]. 7

3 The rent-or-buy Problem In this section we will give a description of the approximation algorithm for the rent-or-buy problem presented in [Swamy & Kumar 2004]. The rent-or-buy and its corresponding integer program are described in Section 2. We now relax the integrality constraints of the IP giving us the following linear program (LP) minimize subect to The dual of this LP is maximize α c i x i + M e i i c e z e x i 1 for all, x i z e for all S V, v / S,, i S x i, z e 0. e δ(s) subect to α c i + S V :e δ(s),v / S S V :i S,v / S θ S,, for all i v,, α c v. for all, θ S, Mc e for all e, α, θ S, 0. The constraints of the IP and the LP are the same except for the last constraint that x i and z e have to be 0 or 1 in the integer version and this is relaxed to the variables being positive in the linear version. The constraints of the primal LP are explained for the IP formulation in Section 2 so there is no need to repeat those. Instead we will now give an explanation of the constraints of the dual LP. Intuitively we can think of the dual variable α as being the amount that client is willing to pay for the construction of a feasible primal solution. That is, for all, α represents the amount that client is willing to contribute to get connected to a facility i and to the constructing of the part of the Steiner tree which connects i to v. Correspondingly we may intuitively think of the the variable θ S, as being the amount client is willing to contribute in order to get facility a i connected to v via the set S, if client is connected to i. For a given client and facility i, the first constraint thus specifies that is at most willing to pay the sum of the cost of being connected to i and the cost of connecting i to v. Because otherwise, client would have payed more than necessary. The second constraint is special case of the second constraint, and the sum S V :v S,v / S θ S, is clearly 0 since v can never both be in S and not be in S at the same time. We know that the price of buying an edge e E is given by Mc e. The fourth constraint thus specifies that for each edge e E, the total amount that the clients are willing to pay in order to get connected to v via e will never be larger than the prize of buying e. The basic idea is now to consider the integer programming formulation (IP) of the problem and the dual of its linear programming relaxation (LP), and construct simultaneously an 8

integer primal solution and a dual solution. The dual linear program can be interpreted as comprising two parts; a part resembling the dual of the facility location problem and a part corresponding to the dual of the Steiner tree problem. The algorithm is in two phases. The first phase is a facility location phase where it is decided which facilities to open, demand are connected to facilities and the demands are clustered at each facility. At the end of this phase, a primal facility location solution is obtained as well as a feasible dual solution. In the primal solution the demands are clustered so that each open facility serves at least M demand points, satisfying the demand lower bound. This is done by charging some of the cost incurred to the Steiner tree portion of the dual solution, thereby exploiting the fact that any ConFL solution also needs to connect the facilities it opens. Despite the added clustering requirement, the algorithm has a fairly simple description. Each demand keeps raising its dual variable, α, till it gets connected to a facility and is near a point at which M demands are clustered. All other variables simply respond to this change trying to maintain feasibility or complementary slackness. Phase 2 is a Steiner phase where the open facilities are connected by a Steiner tree. The dual solution constructed in this phase is not feasible, but it is possible to show that the infeasibility is bounded by a small additive factor. 3.1 The algorithm To describe the algorithm, we will first introduce some definitions. We begin with a simplifying assumption. We assume that a facility can be opened anywhere along an edge. We collectively refer to vertices in V and internal points on an edge as locations. We reserve the term facility for a vertex in F. Initially all dual variables are set to 0. Thus, α = θ S, = 0 for all S V,. The algorithm uses a time t (initially also 0) to keep track of the dual variables in the algorithm. We raise t at unit rate in each iteration and we let α and θ S, follow. Let S be the set of vertices with which is tight. A client is said to be tight with a facility i if α c i. We also say that a demand can be in two different states: frozen and unfrozen. A demand stays unfrozen until its dual variable α stops being raised. When this happens becomes frozen. Let C denote the set of unfrozen demands. Initially all demands C. Finally, let D i denote the set of demands that are tight with facility i, and let T denote the Steiner tree that connects the facility locations. The last thing we need to do before we can start the algorithm is to tentatively open a facility v. 3.1.1 Phase 1 The goal of Phase 1 is to connect all demands to open facilities, i.e. to freeze all demands. Whenever a demand freezes it is removed from C and we only update α for C. If at any time t, is not frozen, we have that α = t. Furthermore, we have that when freezes it no longer becomes tight with any new location. During the process of raising the dual variables there are several events which can take place. Whenever a demand becomes tight with a location i, is added to D i. Furthermore, if i is a tentatively open location, freezes. If the location i, however, is not open yet we need to see if the total demand connected to i is big enough for us to tentatively open location i, that is, D i M. If this condition holds then add i to the set of tentatively open locations L and freeze all demands in D i, including the demands which instituted the condition. 9

At the end of Phase 1 there is a bit of a magic box. It is not really part of any of the phases but merely a cleaning up process that removes any dependent facility locations. If for any locations i, i L there exists a demand to which both locations are tight, the locations i, i are said to be dependent. We remove the location that was added to L latest, meaning, if for i, i L, i and i are dependent we remove the one added latest, lets say i. We thereby create the set L L of independent open locations. Note that v is in the set L since it was the first location to tentatively open. Even if it is dependent on some i L, we remove i before v and then v is no longer dependent. If L L there must be some i L\L. Therefore we need to assign the demands that previously was assigned to i to a new location. If demand is tight with some other location i L, assign to i. If is not tight with any location in L, then there must exist a location i which made i become dependent and we then assign to i. 3.1.2 Phase 2 Let S denote the set of minimal violated sets, that is, a set of connected nodes S V {v} such that no edges are crossing the cut (S, S). We denote the set of edges crossing the cut as δ(s), see [Vazirani 2003, p 198] for more detail on the definition of δ. This set S is used to make sure we end up with one connected component. The dual variable α is set to 0 again at the beginning of the second phase. We only raise α if D = i L {v} D i. The rate at which α and also θ S, are raised is 1/ D S. This ensures that the sum D S, increases at rate 1 for all of the sets S S We raise the dual variables until an edge e goes tight. An edge goes tight when θ S, = Mc e S V :e δ(s),v / S When the egde e goes tight, it is added to the tree T. In each step S is updated. Updating S gives the new set of minimal violated set. When the algorithm returns there are no longer any violated sets and thus all components are connected. When the dependent locations are removed in Phase 1, they are inspected in the order they were put into L. This ensures that v L. The last task of the algorithm, however, removes the redundant edges in the reverse order they were added. Again this gives us that v is in the solution. As stated earlier, the algorithm allows locations to be opened on an internal point of an edge, e = (u, w). However, we can easily move those non-vertex locations to the nearest vertex. Let e be an edge which holds a non-vertex location and let D e denote the set of demands assigned to this location. D u, D w are the demands that are assigned to e and go through u and w respectively. We then have that D u D e. The same holds for w. The Steiner tree T must hold u, w or both of u and w. We can split this into 2 different situations 1. u, w T. Then clients in D u are assigned to u and likewise for clients in D w. 2. Suppose u T, w / T. Then let l, be the open location on e which is farthest from u. All demands of D u are assigned to u. If D w < M, then all the clients in D w are assigned to u and remove all edges along e. If, however, D w M we assign all client in D w to w and add all of e to T. 10

T is still a Steiner tree and in fact it is possible to show that the total cost cannot grow larger then it was before we started moving the locations. The steps can be seen in Algorithm 2. Algorithm 2 Rent-or-buy 1: {Phase 1} 2: (Initialization) L = {v} 3: while C do 4: if C and α c i then 5: D i = D i {} 6: if i L then 7: C = C {} 8: end if 9: end if 10: if i / L v and D i M then 11: C = C D i { Actually C D i {}, but this is set i step 5.} 12: L = L {i} 13: end if 14: raise t, α if C and θ S, a unit 15: end while 16: remove dependent locations from L thus creating L 17: if i is removed then 18: for all D i do 19: D i 20: end for 21: end if 22: {Phase 2} 23: (Initialization) T =, D = i L {v} D i, set t = α theta S, = 0 24: while S = do 25: if θ S, = Mc e then S V :δ(s),v / S 26: T = T {e} 27: update S 28: end if 29: raise t, α if D and θ S, by 1/ D S 30: end while 31: remove all redundant edges in T 11

3.2 Example An example illustrating the use of the algorithm where M = 2 is shown in Figures 2 and 3. In Figure 2, the circles illustrate the levels of the dual variables α during phase 1 and in Figure 3, the circles illustrate the levels of the sum S V :e δ(s),v / S θ S, during Phase 2. The black squares represent closed locations and the blue squares represent opened locations. The red dots represent clients. (a) t = 0 (b) t = 1 (c) t = 2 (d) t = 3 (e) t = 3 Figure 2: Phase 1 of the rent-or-buy Problem 12

(a) t = 3 (b) t = 4 (c) t = 5 (d) t = 6 (e) t = 7 Figure 3: Phase 2 of the rent-or-buy Problem 13

3.3 Analysis In this section we will show the algorithm for the rent-or-buy algorithm presented in Section 3 is a 4.55-approximation algorithm for the rent-or-buy problem. In the following ( α (1), θ (1)) and ( α (2), θ (2)) will denote the value of the dual variables at the end of Phases 1 and 2, respectively. We start out by showing the following lemmas. Lemma 3.1 The dual solution ( α (1), θ (1)) is feasible. Proof To prove that the dual solution ( α (1), θ (1)) is feasible we must show that it satisfies each of the constraints of the dual LP. Re (2) At the end of Phase 1, all clients are connected connected for open location, i.e. all clients are frozen. A client may become tight with a given location i before it freezes. Once becomes tight with location i, we may raise α and S V :i S,v / S at the same rate, because it is no longer necessary for to contribute to the cost of getting connected to i. Recalling that demand is tight with a location i if α c i, we must hence have that α (1) c i + θ S, θ S, S V :i S,v / S Re (3) This constraint is satisfied because freezes once it reaches v, because no extra costs are neede in order for to get connected to the Steiner tree (v is the root). Re (4) Consider an edge e = (u, w) and let l() be the contribution of to the left-hand side of (4) for this edge, i.e. l() = S V :e δ(s),v / S Assume that c u c w, that is, becomes tight with u before it gets tight with w and consider a point p on the edge e = (u, w) at distance x from u. We now define the function { 1 if α c f(, x) = p and does not freeze when it becomes tight with p 0 otherwise The function f thus indicates whether or not freezes when it becomes tight with p. If does not freeze, but becomes tight with p it means both that α can still be raised and that still hasn t satisfied its demand. The sum f(, x) θ (1) S, 14

thus indicates the number of demands that are still unsatified when the part (u, p) of the edge e is considered. It can be seen that for all x we have that f(, x) M Because otherwise we would have that more than M clients are tight with p but still haven t satisfied their demand. This would contradict that p would be tentatively opened as soon as f(, x) > M. Now, assume that p is the last point on e with which becomes tight before it freezes. Since c e equals the length of the edge e we have that and that ce 0 f(, s) ds = x 0 f(, s) ds + ce x f(, s) ds = x l() x S V :e δ(s),v / S θ (1) S, ce 0 f(, s) ds This gives us S V :e δ(s),v / S θ (1) S, ce 0 f(, s) ds = ce 0 f(, s) ds ce 0 M ds = Mc e We have thus proved that the dual solution ( α (1), θ (1)) satisfies each of the constraints of the dual LP and is hence feasible. This completes the proof. Lemma 3.2 At the end of Phase 1, the assignment cost of any demand is at most 3α (1), i.e. for all c i() 3α (1) Proof Consider a demand. At the end of Phase 1, two situations may occur: is tight with a location in L If is tight with a location i L it means that is tight with a tentatively opened location that is independent. We can hence assign to i implying that c i α (1) < 3α (1). is tight with a location in L Let i denote the location in L that causes to become frozen, and let i denote a previously opened location in L such that i and i are dependent. According to the algorithm will be assigned to i. Now, let t i and t i denote the times at which the locations i and i were opened. We have that t i t i. Since i is the location that causes to become frozen we must have that is tight with i and that t i α (1) 15

Since i and i are dependent, there must exist some demand k which is tight with both i and i. Suppose that k becomes tight with i first. If i is tentatively open at this time, then k will freeze and so it will never become tight with i. Therefore i cannot be tentatively open when k becomes tight with it. We therefore have that k must freeze when i becomes tentatively open, i.e. α (1) k t i t i. Similarly we can show for the case where k becomes tight with i first. We hence have that We now see that This completes the proof. α (1) k t i t i α (1) c i c i + c ki + c ki α (1) + 2α (1) k 3α (1) Lemma 3.3 If i is an open location and D i, then c σ() α (1) Proof Recall, that σ() denotes the location to which is assigned. For every open location i, all demands in D i are assigned to i. We thus have that σ() = i and hence that c σ() α (1) To summarize we have now proved that the following will hold at the end of Phase 1 The dual solution ( α (1), θ (1)) is feasible Each demand is assigned to σ() such that c σ() 3α (1) Each open facility i has more than M clients assigned to it, and each of these clients is assigned to i such that c i α (1) Now, let OPT denote the value of an optimal solution for the rent-or-buy problem, and assume that we have a ρ ST -approximation algorithm to build the Steiner tree on the opened facilities. Lemma The algoritm 2 produces a solution of cost at most (3 + ρ ST ) OPT. Proof Let C and S denote the assignment costs and the Steiner tree costs in the optimal solution, i.e. OPT = C + S. The idea of the proof is now to obtain an upper bound for total cost of the solution by extending the Steiner tree in OPT, in such a way that it yields a Steiner tree on the locations opened by algorithm 2. Let i () denote the facility to which is assigned in the optimal solution. The extention is now done by connecting each l L to the Steiner tree in OPT via the shortest l i () path for D l as illustrated in Figure 4. Let c l denote the length of the shortest l i () path. For all l L we have that 16

Figure 4: Connection of open facilities l L to the Steiner tree in an optimal solution. D l M, because otherwise l would not have been opened. The cost of adding l L to the Steiner tree in OPT is thus bounded by Mc l D l (c l + c i ()) Locations l L that are allready in the optimal tree Steiner tree need not be considered and we may hence discard the node v. Now, summing over all l L we see that the cost of adding the opened locations is bounded by (c l + c i ()) = (c σ() + c i ()) = c σ() + C l L v D l D D where D = l L D l The last inequality is due to the fact that we are discarding the node v, however in the optimal solution a demand may be directly connected to v. The total cost of the obtained Steiner tree is thus bounded by S + C + c σ() = OPT + c σ() D D An upper bound for the cost of the Steiner tree in the generated solution is thus OPT + ρ ST D c σ() 17

By using Lemma 3.2 and 3.3, we thus see that the total cost of the solution generated by algorithm 2 is bounded by c σ() + ρ ST OPT + c σ() = c σ() + c σ() + ρ ST OPT + ρ ST D D / D = (1 + ρ ST ) c σ() + c σ() + ρ ST OPT D / D (1 + ρ ST ) α (1) D + 3 α (1) / D + ρ ST OPT D c σ() According to Theorem 3.2 in [Vazirani 2003] the cost of a minimum spanning tree (MST) on the open facilities (L ) is within a factor 2 of the cost of the optimal Steiner tree. A straightforward factor 2-approximation algorithm for finding the Steiner tree connecting the open facilities is thus simply to find an MST on L, because the minimum spanning tree is in P. We therefore have that ρ ST 2 which gives us (1 + ρ ST ) + 3 + ρ ST OPT 3 + 3 + ρ ST OPT D α (1) / D α (1) = 3 D α (1) α (1) / D α (1) + ρ ST OPT According to Lemma 3.1, α (1) is a feasible solution to the dual problem. The sum α(1) will therefore be a lower bound for OPT. This implies that 3 α (1) + ρ ST OPT 3 OPT + ρ ST OPT = (3 + ρ ST ) OPT which completes the proof. We can now prove the main theorem. Theorem 3.7 There is a 4.55-approximation algorithm for the rent-or-buy problem. Proof According to [Swamy & Kumar 2004] there exists an ρ ST = 1.55-approximation algorithm for the Steiner tree problem. 18

4 The connected facility location problem In this section we will present an approximation algorithm for the ConFL problem. Compared with the rent-or-buy problem we now have a facility opening cost of f i 0 for all facilities i F. Furthermore we cannot open facilities at every vertex, i.e. F V. The main idea, though, is the same: we want to gather at least M demands around a facility i before we open it and connect to it, so that these demands can pay for opening facility i and for connecting facility i to the Steiner tree. 4.1 The algorithm All demands have d = 1 and all dual variable incrementation is at unit rate. Compared to the rent-or-buy problem some extra notions must be presented. A demand can still be either frozen or unfrozen, and furthermore a demand can be free or slave. Initially a demand is unfrozen and free, then becomes slave and finally frozen. The demand properties control how and when we increase our dual variables. A demand is said to be tight with a location l if α c l, and a location can be anywhere on an edge. A demand is bound to a location l if is tight with l and was free when it became tight with l. When the weight of a location l, i.e. the number of demands bound to l, becomes at least M, l is said to be a terminal location. The steps can be seen in Algorithm 3. 19

Algorithm 3 Connected Facility Location, Phase 1, part 1 1: (Initialization) Set t = α = θ S, = β i = 0. All demands are free and unfrozen. Pick a facility v to tentatively open and set f v = 0. Facility v will be the root of the Steiner tree. 2: while there are unfrozen demands do 3: if the weight of a location l becomes at least M then 4: l is declared a terminal location. All free tight with l become slaves to l. (Influence on dual variable incrementation: For all these new slaves to l we stop increasing θ S, and for all facilities i S (if any) we start increasing β i.) 5: end if 6: if a free becomes tight with a terminal location l then 7: becomes a slave to l 8: if l = v then 9: connect to l and freeze 10: end if 11: end if 12: if a facility i gets paid for, i.e. β i = f i then 13: tentatively open facility i. All unfrozen slaves tight with i gets connected to i and frozen. 14: end if 15: if a slave gets tight with a tentatively open facility i then 16: connect to i and freeze 17: end if 18: increase t, increase α for all unfrozen demands, increase θ S, for all free demands, for all slaves increase β i for facilities i in S 19: end while Whenever a demand becomes tight with a facility i, that is not tentatively open, starts to pay towards to the opening cost of the facility by increasing β i. This ensures that the first constraint in the dual problem is not violated. The incrementation of α and β i can be seen in Figure 5. The solution obtained at the end of Phase 1, part 1 is called (α (1), β (1), θ (1) ). The next part of Phase 1, see Algorithm 4, is less detailed in order to maintain focus. Algorithm 4 Connected Facility Location, Phase 1, part 2 1: for all terminal locations l we associate a terminal facility, which can be considered as a nearby facility. 2: pick terminal locations and open associated terminal facilities, ensuring that a demand does not pay for opening or Steiner tree connecting more than one facility. 3: the selected terminal locations are connected to their associated terminal facilities by buying Steiner edges on a shortest path from l to i, see Figure 6 4: demands are assigned to the opened terminal facilities through their terminal locations We now have opened a subset of the facilities F F, we have assigned all demands to the open facilities, and we have bought a set of Steiner edges T. Thus we need to connect the open facilities in a Steiner tree in Phase 2. Phase 2 in the generel ConFL is quite similar to Phase 2 in the rent-or-buy problem, so we will not explain it here. 20

Figure 5: Incrementation of dual variables α and β i. The illustration is a modified version of an illustration from slides by David P. Williamson, IBM, 2001. Figure 6: Connecting terminal locations l to terminal facilities i along Steiner edges. At least M demands are collected at l, and l is near i. The illustration is from [Swamy & Kumar 2004, p. 257]. 21

4.2 Analysis We will now give a proof for the approximation factor of the ConFL algorithm. Technical parts of the proof are omitted and can be found in [Swamy & Kumar 2004]. Reminding that T is the set of edges found in Phase 1 and that F is the set of opened facilities found in Phase 1, it can be shown that the solution satisfies 7 i F f i + c i() + cost(t ) + 2 c σ() 7 D α (1). (1) It can also be shown that (α (1), β (1), θ (1) ) is a dual feasible solution. The latter can be shown in a way similar to the corresponding statement for the rent-or-buy-problem. Theorem 1 Using ρ ST = 1.55, the ConFL-algorithm gives a solution of cost at most 8.55 OPT Proof Let again C be the assignment costs and S be the Steiner tree costs of an optimal solution. As in the rent-or-buy problem analysis it is possible to show that the constructed Steiner tree at the end of Phase 2 has costs of at most ρ ST (S + C + D c σ()). The costs of opening facilities and assigning demands end the end of Phase 1 is f i + c i() + cost(t ), i F so the total cost TOT of the generated solution is thus bounded by TOT f i + c i() + cost(t ) + ρ ST c σ() + ρ ST (S + C ). i F D Using S + C OPT, ρ ST 2 and (1) we get that TOT f i + c i() + cost(t ) + ρ ST c σ() + ρ ST (S + C ) i F D f i + c i() + cost(t ) + ρ ST c σ() + ρ ST OPT i F D f i + c i() + cost(t ) + 2 c σ() + ρ ST OPT i F D 7 f i + c i() + cost(t ) + 2 c σ() + ρ ST OPT i F D 7 α (1) + ρ ST OPT. Now, since v is tentatively open at t = 0, all demands that get tight with v freezes, so β v is never increased for any, especially we have β (1) v = 0 for all. Because (α (1), β (1), θ (1) ) is a dual feasible solution, it gives a lower bound for the primal problem, that is we have β(1) v OPT giving α(1) OPT. Finally, we get α(1) TOT (7 + ρ ST ) OPT, or, taking ρ ST = 1.55, TOT 8.55 OPT. This completes the proof. 22

5 Implementation and extensions In this last section we will shortly mention how the algorithm could be implemented, and we will shortly look at possible extensions of the ConFL problem. To implement the algorithm it is needed to know the time when the next event (e.g. a demand becoming tight with a tentatively open location) will occur. This can be done by keeping the events in a priority queue 1, prioritized by time. The following extensions are described in detail in [Swamy & Kumar 2004]. Demands of arbitrary size In the previous presented rent-or-buy and ConFL problems, we have required the demands d for all clients to be of unit size, i.e. d = 1. A naturally extension is to look at demands of arbitrary size, i.e. d 0 is allowed. If demands are integers, the same algorithm can be used by making d copies of client. If the demands are not integers, the dual variables for client are increased by a rate of d. The approximation factor for the modified algorithm is the same. Connected k-median problem The Connected k-median problem is ConFL augmented with the constraint that at most k facilities can be opened. Since v is always opened initially, a linear program for the problem is obtained be adding the constraint y i k 1, i i v to the linear program of ConFL. [Swamy & Kumar 2004] shows that there exists a 15.55- factor approximation algorithm using Phase 1 of the ConFL algorithm for the Connected k-median problem. Capacitated edges Another natural extension is to look at edges with capacities. For all edges e, we add the notion of length c e. Consider a telecommunications network scenario. We have two kinds of cables. The first cable has a cost of σ per unit length and capacity u, the second cable has a cost of M per unit length and infinite capacity. Facilities are opened and clients get connected to them with the first cable type. The facilities are connected to each other in a Steiner tree by the second cable type. For unit demands, [Swamy & Kumar 2004] shows a 10.1-approximation factor for edgecapacitated ConFL and a 6.1-approximation factor for the edge-capacitated rent-or-buy problem. With arbitrary demands, the edge-capacitated ConFL gets a 17.1-approximation factor, and the edge-capacitated rent-or-buy problem gets a 9.1-approximation factor. 1 A priority queue is a data structure with two operations: 1) adding of elements with a priority to the queue, and 2) get the element with the highest priority from the queue 23

References [Gupta et al. 2001] Gupta, Anupam et al.: Provisioning a Virtual Private Network: A Network Design Problem for Multicommodity Flow, Proceedings of the 33rd ACM Symposium on Theory of Computing (2001): 389 398 [Swamy & Kumar 2002] Swamy, Chaitanya & Amit Kumar: Primal Dual Algorithms for Connected Facility Location Problems, Slides, Theory Seminar, Cornell University, October 2002 [Swamy & Kumar 2004] Swamy, Chaitanya & Amit Kumar: Primal Dual Algorithms for Connected Facility Location Problems, Algorithmica 40 (2004): 245 269 [Vazirani 2003] Vazirani, Viay V.: Approximation Algorithms, Springer-Verlag, Berlin 2003 24