Facility Location Uni Bonn

download Facility Location Uni Bonn

of 59

Transcript of Facility Location Uni Bonn

  • 8/10/2019 Facility Location Uni Bonn

    1/59

    Approximation Algorithms for

    Facility Location Problems

    (Lecture Notes)

    Jens Vygen

    Research Institute for Discrete Mathematics, University of BonnLennestrae 2, 53113 Bonn, Germany

    Abstract

    This paper surveys approximation algorithms for various facility loca-

    tion problems, mostly with detailed proofs. It resulted from lecture notes

    of a course held at the University of Bonn in the winter term 2004/2005.

    Contents

    1 Introduction 2

    2 The Fermat-Weber Problem 3

    2.1 Geometric Solution for Three Points . . . . . . . . . . . . . . . . 32.2 The General Problem: Weiszfelds Algorithm . . . . . . . . . . . . 62.3 Completing Weiszfelds Algorithm . . . . . . . . . . . . . . . . . . 72.4 Proving Convergence . . . . . . . . . . . . . . . . . . . . . . . . . 10

    3 The Uncapacitated Facility Location Problem 13

    3.1 Relation to Set Covering . . . . . . . . . . . . . . . . . . . . . . . 143.2 Metric Service Costs . . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.4 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . 163.5 Rounding the LP solution . . . . . . . . . . . . . . . . . . . . . . 18

    4 Greedy and Primal-Dual Algorithms 21

    4.1 Two Primal-Dual Algorithms . . . . . . . . . . . . . . . . . . . . 214.2 The Jain-Mahdian-Saberi Algorithm . . . . . . . . . . . . . . . . 234.3 Scaling and Greedy Augmentation . . . . . . . . . . . . . . . . . 264.4 Lower Bound on Approximation Guarantees . . . . . . . . . . . . 28

    1

  • 8/10/2019 Facility Location Uni Bonn

    2/59

    5 Reductions for More General Problems 32

    5.1 Soft Capacities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.2 Bounding the Number of Facilities . . . . . . . . . . . . . . . . . . 34

    6 Local Search 37

    6.1 Single Swaps for thek-Median Problem . . . . . . . . . . . . . . . 376.2 Better Performance Guarantee by Multiswaps . . . . . . . . . . . 406.3 Local Search for Uncapacitated Facility Location . . . . . . . . . 42

    7 Capacitated Facility Location 44

    7.1 Capacitated and Universal Facility Location . . . . . . . . . . . . 447.2 Add Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467.3 Pivot Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477.4 Bounding the Facility Cost . . . . . . . . . . . . . . . . . . . . . . 497.5 The Performance Guarantee . . . . . . . . . . . . . . . . . . . . . 52

    8 Conclusions 53

    References 54

    1 IntroductionMany economical decision problems concern selecting and/or placing certain fa-cilities to serve given demands efficiently. Examples are manufacturing plants,storage facilities, depots, warehouses, libraries, fire stations, hospitals, base sta-tions for wireless services (like TV broadcasting or mobile phone service), etc.The problems have in common that a set of facilities, each with a certain posi-tion, has to be chosen, and the objective is to meet the demand (of customers,users etc.) best. Facility location problems, which occur also in less obviouscontexts, indeed have numerous applications.

    The most widely studied model in discrete facility location is the so-called

    Uncapacitated Facility Location Problem, also known as plant locationproblem or warehouse location problem. Here we are given two finite sets of cus-tomers and potential facilities, respectively, a fixed cost associated with openingeach single facility, and a nonnegative distance for any two elements, satisfyingthe triangle inequality. The goal is to select a subset of the potential facilities(open them) and assign each customer to a selected (open) facility, such that thetotal opening cost plus the total service cost is minimum.

    Although intensively studied since the 1960s (see, e.g., Stollsteimer [1963],Balinski and Wolfe [1963], Kuehn and Hamburger [1963], Manne [1964]), no ap-proximation algorithm was known for this problem until about ten years ago.

    Then several quite different approaches succeeded to prove an approximation

    2

  • 8/10/2019 Facility Location Uni Bonn

    3/59

    guarantee. We will present them in this paper, and also consider extensions to

    more general problems, such as capacitated variants, the k-Median Problem,and the Universal Facility Location Problem.

    However, we start with the Fermat-Weber Problem, which was probablyhistorically the first facility location problem, studied as early as in the 17thcentury. This is the simplest continuous facility location model, but there arestill questions resolved only very recently.

    2 The Fermat-Weber Problem

    The Fermat-Weber Problem is defined as follows: Given finitely many dis-tinct points A1, A2, . . . , Am in R

    n and positive multipliers w1, w2, . . . , wm R+,find a point P Rn that minimizes

    f(P) =mi=1

    wi||P Ai||.

    Here ||X|| denotes the Euclidean norm ofX Rn, i.e.||(x1, . . . , xn)||=

    x21+ + x2n.Special cases often considered are the ones with unit weights (wi= 1 for alli)

    and with points in the plane (n= 2). So the simplest version of the problem is:Givenm points in the plane, find a pointx such that the sum of the (Euclidean)distances fromxto the given points is minimum.

    2.1 Geometric Solution for Three Points

    We first consider the case m = 3 (with unit weights), proposed by Pierre deFermat (16011665): Given three points A, B, and C in the plane, construct afourth point D minimizing the sum of the distances A-D, B-D, and C-D. Thehistory of this problem can be sketched as follows.

    Before 1640, Torricelli showed that D can be constructed as the intersectionof the circumcircles bounding the equilateral triangles on A-B, B-C and C-A.

    Cavalieri (1647) showed that the three angles at D are all 120 . Simpson (1750)proved that the line segments from the far corner of the equilateral triangles tothe opposite corner of the triangle ABC intersect in D, too. Heinen (1834) showedthat the three Simpson-lines have equal length, as has the optimum Steiner tree.

    The geometric solution by Torricelli (red) and Simpson (blue) is visualized bythe following figure. It works if and only if all angles of the triangle ABC are lessthan 120.

    3

  • 8/10/2019 Facility Location Uni Bonn

    4/59

    B

    A

    C

    To prove correctness, we look at the lower equilateral (green) triangle and its

    (red) circumcircle. We show (see next figure):

    (a) = + = 60.

    (b) a + b= c.

    (a) shows that the constructions by Torricelli and Simpson are identical, and theresulting point has three 120 angles. (b) is Heinens result.

    4

  • 8/10/2019 Facility Location Uni Bonn

    5/59

    r

    r r

    b

    r

    a

    c

    The proof uses elementary trigonometry only.To prove (a), consider the angle sums of the triangles to the left and to the

    right of the Simpson line c. To the left, we have (starting at and continuingclockwise) + (30 ) + (30+ 30+ + 30) = 180, implying = 60.To the right, we have (+ ) + ( 30+ 30+ 30) + 3 0+ = 180, implying+ = 60.

    To prove (b), observe that cos( + ) = a2r

    , cos = b2r

    , and cos = c2r

    . Usingcos(60+ )+cos(60) = cos for[0, 30] (which can be seen easily fromthe figure below), this implies a+ b= c.

    5

  • 8/10/2019 Facility Location Uni Bonn

    6/59

    60+

    60

    11

    1

    2.2 The General Problem: Weiszfelds Algorithm

    The general Fermat-Weber Problemhas been studied by Simpson (1750),and in the 19th century, among others, by Weber and Steiner. Weiszfeld [1937]proposed an algorithm which we will discuss below. Bajaj [1988] proved that aconstruction by ruler and compasses only is impossible.

    Note that the Fermat-Weber Problem reduces to a weighted medianproblem (see Korte and Vygen [2000], Section 17.1) if the given points arecollinear. Thus this special case can be solved in linear time.

    (This also implies that the variant of the Fermat-Weber Problemwherewe consider 1-norm instead of Euclidean norm can be solved in linear time.Namely, in this case we can solve the problem separately for each coordinate.This also holds if we minimize the sum of squared Euclidean distances, in whichcase the problem reduces to finding the center of gravity.)

    Therefore we assume henceforth that the given points are not collinear. Thenwe note (cf. Kuhn [1973]):

    Proposition 2.1 If the points are not collinear, thenfis strictly convex.

    Proof: For P,Q,A

    Rn

    with P= Q and 0 < < 1 the Cauchy-Schwarzinequality implies

    ||(P A) + (1 )(Q A)||2= ||(P A)||2 + 2((P A))T((1 )(Q A)) + ||(1 )(Q A)||2 ||(P A)||2 + 2||(P A)| | | |(1 )(Q A)|| + ||(1 )(Q A)||2= (||P A|| + (1 )||Q A||)2

    with strict inequality if and only ifP,Q and Aare not collinear. Hence

    f(P+ (1

    )Q)< f(P) + (1

    )f(Q),

    6

  • 8/10/2019 Facility Location Uni Bonn

    7/59

    i.e.f is strictly convex.

    Thus f is minimized at a unique point M Rn. The idea behind Weiszfeldsalgorithm, starting anywhere and trying to converge to M, is actually very simple.IfP A={A1, A2, . . . , Am}, then the negative of the gradient off at P equals

    R(P) =mi=1

    wiAi P

    ||Ai P|| . (1)

    Hence, if also M A, then necessarily R(M) = 0 which is equivalent to

    M =mi=1 wiAi||MAi||m

    i=1wi

    ||MAi||. (2)

    In view of (2), Weiszfeld [1937] definedT(P) the next iterate for given someP A as

    T(P) =

    mi=1

    wiAi||PAi||m

    i=1wi

    ||PAi||(3)

    and claimed that the sequence of points

    P0, T(P0), T2(P0) =T(T(P0)), T3(P0), . . .

    converges to the optimum solution Mfor every choice of the starting point P0.He ignored the possibility that Ts(P0) A for some s 0 in which case (3)would not be defined.

    2.3 Completing Weiszfelds Algorithm

    Kuhn [1973] observed that it is easy to decide whether some Ai A is theoptimum point M. Setting

    Rk =m

    i=1,i=kwi

    Ai Ak||Ai Ak||

    for 1km, we haved

    dtf(Ak+tZ)

    t=0

    = wk RTk Z

    for Z Rn with||Z|| = 1. Therefore, the direction of greatest decrease of fat Ak is Z =

    Rk||Rk|| , in which case

    ddt

    f(Ak+tZ)|t=0 equals wk ||Rk||, and weimmediately obtain the following observation.

    7

  • 8/10/2019 Facility Location Uni Bonn

    8/59

    Proposition 2.2 Ak =M if and only ifwk

    ||Rk

    ||.

    Now let us assume that Ak A is not the optimum point. Proposition 2.2implies that wk ||Rk||< 0 and we can really decrease the value offby movingfromAk a little bit in the direction

    Rk||Rk|| . To make this quantitatively precise, we

    consider ddt

    f

    Ak+ t Rk||Rk||

    for t0. For Z= Rk||Rk|| elementary calculus yields

    d

    dtf(Ak+ tZ) =

    mi=1,i=k

    wiAk+ tZ Ai

    ||Ak+ tZ Ai||

    TZ+ wk

    =

    mi=1,i=k

    wi||Ak+ tZ Ai||

    (Ak Ai)TZ+ t+ wk

    = RTk||Rk||

    mi=1,i=k

    wi||Ak+ tZ Ai||(Ak Ai)

    +tm

    i=1,i=k

    wi||Ak+ tZ Ai|| + wk.

    Defining the vector Vk(t) by the following equation

    Rk+ Vk(t) =m

    i=1,i=k

    wi||Ak+ tZ Ai||(Ak Ai)

    we obtain for ttk with

    tk = min

    1

    2||Ak Ai||: 1im, i=k

    >0

    that

    ||Vk(t)|| =

    m

    i=1,i=kwi

    ||Ak+ tZ Ai||(Ak Ai) + Rk

    =

    mi=1,i=k

    wi(Ak Ai)

    1

    ||Ak+ tZ Ai|| 1

    ||Ak Ai||

    m

    i=1,i=kwi||Ak Ai||

    ||Ak Ai| || |Ak+ tZ Ai||||Ak+ tZ Ai||||Ak Ai||

    m

    i=1,i=kwi||Ak Ai||

    t(||Ak Ai|| t) ||Ak Ai||

    m

    i=1,i=k

    2wi

    ||Ak Ai|| t.8

  • 8/10/2019 Facility Location Uni Bonn

    9/59

    Similarly, for t

    tk we have

    mi=1,i=k

    wi||Ak+ tZ Ai||

    mi=1,i=k

    wi||Ak Ai|| t

    m

    i=1,i=k

    2wi||Ak Ai|| .

    Putting everything together, we obtain

    d

    dt

    fAk+ t Rk||Rk|| RTk

    ||Rk||(

    Rk+ Vk(t)) +

    m

    i=1,i=k

    2wi

    ||Ak Ai||t + wk

    wk ||Rk|| + ||Vk(t)|| +

    mi=1,i=k

    2wi||Ak Ai||

    t

    wk ||Rk|| +

    mi=1,i=k

    4wi||Ak Ai||

    t.

    If we define

    tk

    = max0, mintk

    , ||

    Rk

    || wk

    mi=1,i=k

    4wi||AkAi||

    for all 1 k m, then Proposition 2.2 together with the above estimates andthe mean value theorem imply the following lemma.

    Lemma 2.3 Using the above notation, tk = 0 for some1ik if and only ifAk =M. Furthermore,

    f(Ak)> fAk+ tk

    Rk

    ||Rk

    ||for allAk A withAk=M. In view of Lemma 2.3, Rautenbach et al. [2004] proposed the following (non-

    continuous) extension T ofT to Rn:

    T(P) =

    T(P) , P Rn \ AAk+ tk

    Rk||Rk|| , P =Ak, 1km.

    (4)

    We will show that the sequence P0, T(P0), T(T(P0)), . . . converges to the

    optimum solution M for every point P0 Rn.

    9

  • 8/10/2019 Facility Location Uni Bonn

    10/59

    2.4 Proving Convergence

    We start with some simple observations:

    Lemma 2.4 LetP Rn.(i) T(P) =P if and only ifP =M.

    (ii) IfT(P)=P, thenf(T(P))< f(P).Proof: Part (i) is trivial in view of the definition ofT, (1), (2), (3), Lemma2.3 and the strict convexity off. For P A, part (ii) follows immediately fromLemma 2.3.

    Hence it remains to prove part (ii) for P A

    . Clearly, T(P) =T(P) is theunique minimum of the strictly convex function

    gP(Q) =mi=1

    wi||Q Ai||2||P Ai||

    which implies gP(T(P))< gP(P). Now, gP(P) =f(P) and

    gP(T(P)) =mi=1

    wi||T(P) Ai||2||P Ai||

    =m

    i=1

    wi ((

    ||T(P)

    Ai

    | || |P

    Ai

    ||) +

    ||P

    Ai

    ||)2

    ||P Ai||=

    mi=1

    wi (||T(P) Ai| || |P Ai||)2||P Ai|| + 2(f(T(P)) f(P)) + f(P)

    2f(T(P)) f(P).Combining these (in)equalities impliesf(T(P))< f(P) and the proof is complete.

    Lemma 2.5 lim PAkP=Ak

    ||T(P)Ak||||PAk|| =

    ||Rk||wk

    fork= 1, . . . , m.

    Proof:

    limPAkP=Ak

    ||T(P) Ak||||P Ak|| = limPAk

    P /A

    ||T(P) Ak||||P Ak||

    = limPAkP=Ak

    Pm

    i=1wiAi

    ||PAi||Pmi=1

    wi||PAi||

    Ak

    ||P Ak||

    = limPAkP=Ak

    Pm

    i=1wiAi

    ||PAi||Pmi=1

    wi||PAi||

    Pm

    i=1wiAk

    ||PAi||Pmi=1

    wi||PAi||

    ||P Ak||

    10

  • 8/10/2019 Facility Location Uni Bonn

    11/59

    = limPAkP=Ak

    mi=1 wi(AiAk)||PAi|| mi=1

    wi||PAk||||PAi||

    =

    limPAkP=Ak

    mi=1 wi(AiAk)||PAi||

    limPAkP=Ak

    mi=1

    wi||PAk||||PAi||

    = ||Rk||

    wk

    Thus we get:

    Lemma 2.6 IfAk=M for some1km, then there are, >0 such that

    ||T(P) Ak||

    (1 + )||P Ak|| , P Rn, 0 1. Therefore, the exis-tence of and with the desired properties for P with||P Ak|| > 0 followsfrom Lemma 2.5. Choosing without loss of generality

    tk and observing that

    ||T(Ak) Ak||= tk>0, by Lemma 2.3, completes the proof. We can now proceed to the main convergence result, due to Rautenbach et

    al. [2004]:

    Theorem 2.7 IfP0 Rn andPk = T(Pk1) for allk N, then limk Pk =M.

    Proof: Since lim||P|| f(P) = and (f(Pk))k0 is non-negative and non-increasing, the sequence (Pk)k0 is bounded and the sequence (f(Pk))k0 con-

    verges. The main observation is expressed in the following claim.Claim A subsequence of (Pk)k0 converges to a point in Rn \ (A \ {M}).

    Proof of the claim: For contradiction we assume that the setA of all accumula-tion points of the bounded sequence (Pk)k0 is a subset ofA\{M}. This impliesthat for every >0 there are only finitely many elements of the sequence (Pk)k0outside of the union

    AAU(A)

    of open -neighbourhoodsU(A) =

    {Q

    Rn :

    ||Q

    A

    ||<

    }of the elements A

    inA.

    11

  • 8/10/2019 Facility Location Uni Bonn

    12/59

    Lemma 2.6 easily implies that

    |A

    | 2. Now the pigeonhole principle together

    with the finiteness ofA and once again Lemma 2.6 imply the existence of twodistinct elements A1, A2 A and a subsequence (Pkl)l0 of (Pk)k0 contained inRn \ A with

    A1 = liml

    Pkl ,

    A2 = liml

    T(Pkl).

    Since limPA,P=A T(P) = A for all A A (cf. Lemma 2.5)), this implies thecontradiction A1 = A2 and the proof of the claim is complete.

    By the claim there is a convergent subsequence (Pkl )l0 of (Pk)k0 whose limit

    P= liml

    Pkl

    lies outside ofA \ {M} which implies that T is continuous at P.By the convergence of (f(Pk))k0, we have

    limk

    f(Pk) = limk

    f(T(Pk)).

    By the continuity ofT at P, we have

    liml T(Pkl) =T(P).

    Since f is continuous

    f(P) = liml

    f(Pkl) = liml

    f(T(Pkl )) =f(T(P))

    and Lemma 2.4 implies P =T(P) =M.Finally, the fact that (f(Pk))k0 converges and f is strictly convex, implies

    that not just a subsequence of (Pk)k0 converges to M but the whole sequenceand the proof is complete.

    A different extension of Weiszfelds algorithm was proposed by Vardi andZhang [2001]. Struzyna [2004] and Szegedy [2005] partially extended Weiszfeldsalgorithm to a more general problem, where some vertices of a given graph areassociated with points in Rn, and the task is to find points for the other vertices inorder to minimize the total Euclidean distance of the edges of the graph. Again,the version for 1-distances or squared Euclidean distances can be solved quiteeasily by minimum-cost flows and linear algebra, respectively, but the problem isnot fully solved for Euclidean distances.

    Unfortunately, Weiszfelds algorithm converges quite slowly. See Drezner etal. [2002] for more information, and also for other, more difficult, continuous

    facility location problems. We shall not consider them here.

    12

  • 8/10/2019 Facility Location Uni Bonn

    13/59

    3 The Uncapacitated Facility Location Problem

    The rest of this paper deals with discrete facility location problems, where thenumber of possible locations is finite. The most basic problem, for which we shallpresent many results, is the Uncapacitated Facility Location Problem.It is defined as follows.

    Given:

    a finite setDof customers (or clients); a finite setFof potential facilities;

    a fixed cost fi R+ for opening each facility i F; a service cost cij R+ for each i F and j D;

    we look for:

    a subset Sof facilities (called open) and an assignment :D Sof customers to open facilities, such that the sum of facility costs and service costs

    iS

    fi+jD

    c(j)j

    is minimum.

    The problem has been studied intensively in the operations research literature.See Cornuejols, Nemhauser and Wolsey [1990] or Shmoys [2000] for survey papers.

    We look for approximation algorithms, i.e. algorithms computing a feasiblesolution for any instance such that

    the algorithm terminates after a number of steps that is bounded by a poly-nomial in the instance size (e.g. in the number of customers and facilities).

    There is a constant k such that the cost of the computed solution does notexceed k times the optimum cost for any instance.

    k is called the approximation ratio or performance guarantee; we speak of ak-factor approximation algorithm. Ifk = 1, we have an exact polynomial-timealgorithm. However, such an algorithm would imply P = NP, as the problemcontains many NP-hard problems. One of them will be discussed now. See Korteand Vygen [2000] for more general information on approximation algorithms.

    13

  • 8/10/2019 Facility Location Uni Bonn

    14/59

    3.1 Relation to Set Covering

    The well-known Set Covering Problem is defined as follows. Given a pair(U, S), whereUis a finite set andSis a family of subsets ofUwith SSS=U,and weights c:S R+, the task is to find a setR S with

    SR S=U such

    that the total weight

    RR c(R) is minimum.This problem is notoriously hard. Raz and Safra [1997] proved that there

    exists a constant > 0 such that, unless P= NP, there is no polynomial-timealgorithm that produces for each instance a solution whose cost is at most ln |U|times the optimum. Feige [1998] proved that such an algorithm does not evenexist for any < 1 unless every problem in NPcan be solved in O(nO(log logn))time. On the other hand, a simple greedy algorithm, which iteratively picks theset for which the ratio of weight over newly covered elements is minimum, yieldsa solution whose weight is at most 1 + ln |U|times the optimum. This is a resultof Chvatal [1979]; see Theorem 16.3 of Korte and Vygen [2000].

    The above negative results directly transfer to the Uncapacitated Facil-ity Location Problem. Namely, it is easy to see that the Set CoveringProblemis a special case of the Uncapacitated Facility Location Prob-lem: Given an instance (U, S, c) as above, defineD:= U,F :=S, fS=c(S) forS S, and let the service cost cSj be zero for j S S and for j U\ S.Therefore the best we can hope for is a logarithmic approximation factor.

    Conversely, let an instance of the Uncapacitated Facility LocationProblem be given. By a starwe mean a pair (i, D) with i F and D D.Thecostof a star (i, D) isfi +

    jDcij , and its effectivenessis

    fi+P

    jDcij

    |D| . Thenthe Uncapacitated Facility Location Problem is a special case of theMinimum Weight Set Cover Problem: set U :=Dand letS= 2D, wherec(D) is the minimum cost of a star (i, D) (i F).

    However, the resulting set cover instance has exponential size, and thereforethis reduction cannot be used directly. Nevertheless we can apply the greedyalgorithm for set covering without generating the instance explicitly, as proposedby Hochbaum [1982]:

    Namely, in each step, we have to find a most effective star, open the corre-sponding facility and henceforth disregard all customers in this star. Althoughthere are exponentially many stars, it is easy to find a most effective one as itsuffices to consider stars (i, Dik) fori Fandk {1, . . . , |D|}, whereD ik denotesthe firstk customers in a linear order with nondecreasing c ij. Clearly, other starscannot be more effective. Hence we get an approximation ratio of 1 + ln |D| alsofor the Uncapacitated Facility Location Problem. In view of Feigesresult mentioned above, this seems to be almost best possible.

    14

  • 8/10/2019 Facility Location Uni Bonn

    15/59

    3.2 Metric Service Costs

    The previous section shows that we have to make additional assumptions in orderto obtain constant-factor approximations. The usual assumption is that servicecosts stem from a metric, or equivalently satisfy

    cij+ cij+ cijcij for alli, i F and j, j D.Indeed, if this condition holds, we can define cii:= 0 and cii := minjD(cij+

    cij) fori, i F,cjj := 0 and cjj := miniF(cij+ cij) for j, j D, and cji :=cij

    for j D and i F, and obtain a metric c onD F. Therefore we speak ofmetricservice costs if the above condition is satisfied. We make this assumption

    in the following sections, and will occasionally work with the metric c onD F.In many practical problems service costs are proportional to geometric distances,or to travel times, and hence are metric.

    Jain et al. [2003] showed that the performance guarantee of the above greedyalgorithm is (log n/ log log n) even for metric instances, where n =|D|. In-deed, before the paper of Shmoys, Tardos and Aardal [1997] no constant-factorapproximation algorithm was known even for metric service costs. Since then,this has changed dramatically. The following sections show different techniquesfor obtaining constant-factor approximations for the Uncapacitated FacilityLocation Problemwith metric service costs.

    An even more restricted problem is the special case when facilities and cus-tomers are points in the plane and service costs are the geometric distances. HereArora, Raghavan and Rao [1998] showed that the problem has an approximationscheme, i.e. ak-factor approximation algorithm for anyk >1. This was improvedby Kolliopoulos and Rao [1999], but their algorithm seems to be still too slow forpractical purposes.

    For general metric service costs, the approximation guarantee that can beachieved is known to be between 1.46 (a result due to Guha und Khuller [1999]and Sviridenko [unpublished]; see Section 4.4) and 1.52 (Mahdian, Ye und Zhang[2002]; see Sections 4.2 and 4.3).

    In the rest of this paper we assume metric service costs.

    3.3 Notation

    When we work with an instance of the Uncapacitated Facility LocationProblem, we assume the notationD, F, fi, cij as above. For a given instanceand a given nonempty subset X of facilities, a best assignment :D Xsatisfyingc(j)j = miniXcij can be computed easily. Therefore we will often calla nonempty set X Fa feasible solution, with facility cost cF(X) :=

    iXfi

    and service costcS(X) :=jDminiXcij. The task is to find a nonempty subset

    X Fsuch thatcF(X) + cS(X) is minimum. We denote the optimum by OPT.

    15

  • 8/10/2019 Facility Location Uni Bonn

    16/59

    3.4 Linear Programming

    The Uncapacitated Facility Location Problem can be formulated as aninteger linear program as follows:

    minimizeiF

    fiyi+iF

    jD

    cijxij

    subject to

    xij yi (i F, j D)

    iF

    xij = 1 (j D

    )

    xij {0, 1} (i F, j D)

    yi {0, 1} (i F)

    By relaxing the integrality constraints we get the linear program:

    minimize

    iFfiyi+

    iFjDcijxij

    subject to

    xij yi (i F, j D)iF

    xij = 1 (j D)

    xij 0 (i F, j D)

    yi 0 (i F)

    (5)

    This was first formulated by Balinski [1965]. The dual of this LP is:

    maximizejD

    vj

    subject to

    vj wij cij (i F, j D)jD

    wij fi (i F)

    wij 0 (i F, j D)

    (6)

    16

  • 8/10/2019 Facility Location Uni Bonn

    17/59

    We will need some basic facts from LP theory. First, linear programs can

    be solved in polynomial time. Second, the primal and dual LP have the sameoptimum value. Hence for every feasible dual solution (v, w),

    jD vj OPT.

    Moreover, primal and dual feasible solutions (x, y) and (v, w) are both optimum ifand only if they satisfy the complementary slackness conditions: xij >0 impliesvi wij =cij ,yi > 0 implies

    jDwij =fi, and wij >0 implies xij =yi.

    In approximation algorithms, one often has approximate complementary slack-ness: For example, if (x, y) is an integral feasible primal solution, and (v, w) isa feasible dual solution such that yi > 0 implies fi 3

    jDwij and xij > 0

    implies cij 3(vj wij), then the cost of the solution (x, y) is

    iFfiyi +

    iFjDcijxij3jDvj3 OPT.We close this section by mentioning a different integer programming formula-

    tion. Here we have a 0/1-variablezS for each star S S :=F 2D. The cost ofa star S= (i, D) is c(S) =fi+

    jDcij. Then the Uncapacitated Facility

    Location Problemcan be formulated equivalently as:

    minimizeSS

    c(S)zS

    subject to

    S=(i,D)S:jDzS 1 (j D)

    zS {0, 1} (S S)As above, we relax integrality conditions:

    minimizeSS

    c(S)zS

    subject to S=(i,D)S:jD

    zS 1 (j D)

    zS 0 (S S)

    (7)

    The dual of (7) is:

    maximizejD

    vj

    subject to jD

    vj c(S) (S= (i, D) S)

    vj 0 (j D)

    (8)

    17

  • 8/10/2019 Facility Location Uni Bonn

    18/59

    Any solution zto (7) implies a solution (x, y) to (5) with the same value, by

    setting yi :=

    S=(i,D) zS and xij :=

    S=(i,D),jD zS. Conversely, any solution(x, y) to (5) implies a solution zto (7) with the same value by setting zS :=xikfor i F, k D and S = (i, {j D : xij xik}). Thus (7) can be solved inpolynomial time despite its exponential number of variables.

    The same holds for the dual LPs. For any feasible solution (v, w) to (6),v isa feasible solution to (8). Conversely, for any feasible solution v to (8) we candefine wij := max{0, vj cij} in order to obtain a feasible solution to (6): notethat for i F and D:={j D:vj > cij} we have

    jD

    wij =jD

    max{0, vj cij}=jD

    vjjD

    cijc(i, D) jD

    cij =fi.

    Hence the two LP relaxations can be considered equivalent.

    3.5 Rounding the LP solution

    LP rounding algorithms work with integer programming formulations, solve theLP relaxation, and round the resulting fractional solution. However, straightfor-ward rounding does not work for facility location problems. Nevertheless Shmoys,Tardos and Aardal [1997] obtained the first constant-factor approximation by thistechnique. We now present their approach.

    We first compute an optimum solution (x, y) to (5), and also an optimumsolution (v, w) to the dual (6). We shall produce an integral solution whosecost is at most four times the cost of an optimum fractional solution.

    Let Gbe the bipartite graph with vertex setF D containing an edge{i, j}iffxij >0. By complementary slackness, x

    ij >0 implies v

    j wij =cij , and thus

    cijvj .We assign clients to clusters iteratively as follows. In iteration k, let jk be

    a customer j D not assigned yet and with vj smallest. Create a new clustercontaining jk and those vertices ofG that have distance 2 from jk and are notassigned yet. Continue until all clients are assigned to clusters.

    For each cluster k we choose a neighbour ik ofjk with fik minimum, open ik,and assign all clients in this cluster to ik.

    Then the service cost for customer j in cluster k is at most

    cikjcij+ cijk+ cikjkvj + 2vjk3vj ,

    where i is a common neighbour ofj and jk.Finally, the facility cost fik can be bounded by

    fikiF

    xijk fi= iF:{i,jk}E(G)

    xijk fi iF:{i,jk}E(G)

    yi fi.

    18

  • 8/10/2019 Facility Location Uni Bonn

    19/59

    Asjk and jk cannot have a common neighbour for k

    =k , the total facility cost

    is at most

    iFyi fi.Summing up, the total cost is 3

    jDv

    j +

    iFyi fi, which is at most four

    times the LP value, and hence at most 4 OPT. We conclude:

    Theorem 3.1 (Shmoys, Tardos and Aardal [1997]) The above LP rounding al-gorithm is a 4-factor approximation algorithm.

    Note that the facility cost of the computed solution is at most OPT, whilethe service cost can be as large as 3 OPT. This raises the question whetherthe performance guarantee can be improved by opening additional facilities that

    reduce the service cost. This is indeed true, and we will return to this in Section4.3.

    The rounding itself can be improved quite easily, as shown by Chudak andShmoys [1998]: First find a solution (x, y) to (5) such thatxij >0 impliesx

    ij =y

    i .

    This can be by generating a solution to (7) as shown at the end of Section 3.4,and duplicating facilities when transforming it back to a solution to (5).

    Then assign clients to clusters as above. In clusterk, choose a neighbour ikofjk, where i is chosen with probability x

    ijk

    , and open ik. Finally, for each facilityithat does not belong to any cluster, open it with probability y i .

    Clearly, the expected total facility cost is iFyi fi. Moreover, for each cus-

    tomerj, the probability that a neighbour is open is at least 1 iF:{i,j}E(G)(1yi ). Sincey

    i xijand

    iF:{i,j}E(G) x

    ij = 1, we have

    iF:{i,j}E(G)(1yi ) 1e .

    Thus, for each j D, we have service cost at most vj with probability at least1 1

    e, and service cost at most 3vj otherwise. Hence the total expected ser-

    vice cost is

    jDvj (1 +

    2e

    ), yielding an overall expected cost of 2 + 2e

    times theoptimum.

    This can be further improved. We will need a well-known inequality (see, e.g.,Hardy, Littlewood and Polya [1964], Theorem 43):

    Lemma 3.2 Letp1, . . . , pn, a1, . . . , an, b1, . . . , bn 0 with (ai aj)(bi bj) 0for alli, j {1, . . . , n}. Then

    ni=1

    pi

    ni=1

    piaibi

    ni=1

    piai

    ni=1

    pibi

    .

    Proof: ni=1

    pi

    ni=1

    piaibi

    ni=1

    piai

    ni=1

    pibi

    =n

    i=1

    n

    j=1

    pipjajbj

    n

    i=1

    n

    j=1

    piaipjbj

    19

  • 8/10/2019 Facility Location Uni Bonn

    20/59

    = 1

    2

    n

    i=1

    n

    j=1

    pipj

    (aibi+ a

    jbj

    aibj

    aj

    bi)

    0.

    We now cluster in a slightly different way: In iteration k, choose jk amongthe unassigned customers so that vjk+

    iFx

    ijk

    cijk is minimum.Then the expected service cost for j, even if no neighbour is open, can be

    bounded by

    vj + vjk

    +

    iFxijk cijk2vj +

    iFxijcij.

    Let i1, . . . , il be the neighbours of j in G, with ci1j ci2j cilj.Applying the Lemma with pk = x

    ikj

    , ak =k1

    h=1(1xihj), and bk = cikj, theexpected service cost for j can be bounded by

    lk=1

    k1h=1

    (1 xihj)xikjcikj+l

    h=1

    (1 xihj)

    2vj +iF

    xijcij

    =l

    k=1

    akpkbk+ al

    2vj +

    lk=1

    pkbk

    lk=1

    pkbk l

    k=1

    pkak

    + al

    2vj +l

    k=1

    pkbk

    .

    Usingl

    k=1pkak+ al = 1 and log al =l

    k=1 log(1 xikj)l

    k=1(xikj) =1we get that the expected service cost for j is at most

    lk=1

    pkbk

    + 2alv

    j

    iF

    xijcij+2

    evj .

    Summing over all customers, and adding the expected total facility costiFfiyi ,

    the total expected cost is at most 1 + 2e 1.736 times the optimum. This re-sult is due to Chudak and Shmoys [1998]. They also show how to derandomizethe algorithm and obtain a deterministic algorithm with the same performanceguarantee.

    Sviridenko [2002] further refined the algorithm and improved the performanceguarantee to 1.582.

    Meanwhile, better performance guarantees have been obtained with simplerand faster algorithms, which do not need a linear programming algorithm. Thesewill be presented in the next section.

    20

  • 8/10/2019 Facility Location Uni Bonn

    21/59

    4 Greedy and Primal-Dual Algorithms

    Although a straighforward greedy algorithm does not produce good results, constant-factor approximations can be achieved by finding approximate primal and dualsolutions simultaneously. The algorithms in this section are much faster than LProunding algorithms, because they do not use a linear programming algorithm assubroutine.

    4.1 Two Primal-Dual Algorithms

    The first primal-dual approimxation algorithm for the metric UncapacitatedFacility Location Problem

    was due to Jain and Vazirani [2001]. It computesfeasible primal and dual solutions (to the LPs presented in Section 3.4) simulta-neously. The primal solution is integral, and the approximation guarantee willfollow from approximate complementary slackness conditions.

    Let t = 0 (t is interpreted as time), and set all dual variables to zero. Withproceeding time t, all vj are increased simultaneously, i.e. they are all equal to tuntil they are frozen and then remain constant until the end. (vj can be viewedas the price that customer j pays for being served.)

    There are three types of events:

    vj =cij for some i and j, where i is not tentatively open.

    Then start to increase wij at the same rate, maintaining vj wij =cij .(wijcan be regarded as the amount thatjoffers to contribute to the openingcost of facility i. At any stage wij = max{0, vj cij}.)

    jD wij =fi for some i.Then tentatively openi. For all unconnected customersj Dwithvjcij:connect j to i, and freeze vj and all wij for all i

    F. vj =cij for some i and j, where i is tentatively open.

    Then connect j to iand freeze vj.

    Several events can occur at the same time and are then processed in arbitraryorder. This continues until all customers are connected.

    Now let V be the set of facilities that are tentatively open, and let E bethe set of pairs{i, i} of distinct tentatively open facilities such that there is acustomer j with wij > 0 and wij > 0. Choose a maximal stable set X in thegraph (V, E). Open the facilities in X. For each customer j that is connected toa facilityi /X, connect j to an open neighbour ofi in (V, E).

    Theorem 4.1 (Jain and Vazirani [2001]) The above primal-dual algorithm opens

    a setX of facilities with3cF(X) + cS(X) 3OPT. In particular, the above is

    21

  • 8/10/2019 Facility Location Uni Bonn

    22/59

    a 3-factor approximation algorithm. It can be implemented to run inO(m log m)

    time, wherem=|F||D|.Proof: (v, w) constitutes a feasible dual solution, thus

    jDvj OPT. For

    each open facility i, all customers j with wij > 0 are connected to i, and fi =jD wij. Moreover, we claim that the assignment cost for each customer j is at

    most 3(vj wij), where i the facility that j is assigned to.We distinguish two cases. Ifcij =vj wij , this is clear. Otherwise cij > vj

    and wij = 0. Then there is a (closed) facility i with cij = vj wij and acustomer j with wij > 0 and wij > 0, and hence cij = vj wij < vj andcij =vj wij < vj. Note that vjvj, because j is connected to i beforej .We conclude that c

    i

    jci

    j

    + cij

    + cij

    3vj

    .To obtain the stated running time, we sort all cij once in advance. Next, let

    t2= min{ti2:iY}, where

    ti2= 1

    |Ui|

    fi+

    jD\U:vj>cij(cij vj) +

    jUi

    cij

    and Ui :={j U : t cij}. We maintain t2, ti2 and|Ui| throughout. Withthis information it is easy to compute the next event. The numbers|Ui|, ti2,and possibly t2, are updated when a new customer is connected or when t= c ijfor some j

    D. Hence there are 2m such updates overall, each of which takes

    constant time.

    The first statement of the theorem can be used to get a better performanceguarantee. Note that the factor 3 guarantee is tight only if service costs dominate.In this case we may benefit from opening additional facilities. We show howSection 4.3.

    The primal-dual algorithm itself has been improved by Jain et al. [2003]. Theyconsider only the set Uof unconnected customers. Each customer withdraws alloffered contributions to facility opening costs once it is connected. On the otherhand, facilities are opened once and for all when they are paid for. Let initially

    be U :=D. There are the following events: vj =cij, where j U and i is not open. Then start to increase wij at the

    same rate, in order to maintain vj wij =cij.jUwij =fi. Then open i. For all j with vj cij: freeze vj and all wij

    for alli (including i), and remove j fromU.

    vj =cij , where jU and i is open. Then freeze vj and remove j fromU.Note that this amounts to the greedy algorithm discussed in Section 3.1, with

    the only difference that facility costs of facilities that have already been chosen

    in previous steps are set to zero.

    22

  • 8/10/2019 Facility Location Uni Bonn

    23/59

    Now the total cost of the solution is clearly jD vj . However, (v, w) is nota feasible dual solution anymore. But Jain et al. [2003] showed that 1v, for= 1.861, is a feasible solution to (8). Hence 1

    jDvjOPT, and the above

    algorithm uses at mosttimes this cost. We shall not prove this, as this algorithmis outperformed by the one presented in the next section.

    4.2 The Jain-Mahdian-Saberi Algorithm

    A slightly modified version of the above primal-dual algorithm, due to Jain, Mah-dian and Saberi, and published in Jain et al. [2003], has an even better perfor-mance guarantee. Indeed, it leads to the best approximation guarantee known

    today.The idea is that connected customers can still offer a certain amount to other

    facilities if they are closer and re-connecting would save service cost. The algo-rithm proceeds as follows.

    Start with U :=D and time t = 0. Increase t, maintaining vj = t for alljU. Consider the following events:

    vj =cij, where j U and i is not open. Then start to increase wij at thesame rate, in order to maintain vj wij =cij.

    jD wij =fi. Then open i. For all j D with wij >0: freeze vj and setwij := max{0, cij cij} for alli F, and remove j from U. vj = cij, where j U and i is open. Then freeze vj and set wij :=

    max{0, cij cij} for all i F, and remove j from U.

    This algorithm can be implemented in O(|F|2|D|) time. Clearly the totalcost of the computed solution is

    jDvj. We will find a number such that

    jDvj c(S) for each star S = (i, D) (in other words: 1v is a feasiblesolution to (8)). This will imply the performance ratio .

    Consider a star S = (i, D), with

    |D

    |= d. Renumber the customers in D in

    the order in which they are connected in the algorithm; w.l.o.g. D ={1, . . . , d}.We have v1v2 vd.

    Let k D. Note that k is connected at time t = vk in the algorithm, andconsider the time t= vk for sufficiently small positive . Forj = 1, . . . , k 1let

    rj,k :=

    ci(j,k)j ifj is connected to i(j, k) Fat time tvk otherwise, i.e. ifvj =vk

    .

    We now write down valid inequalities for these variables. First, for j =1, . . . , d,

    rj,j+1

    rj,j+2

    rj,d (9)

    23

  • 8/10/2019 Facility Location Uni Bonn

    24/59

    because the service cost decreases if customers are re-connected. Next, fork =

    1, . . . , d,k1j=1

    max{0, rj,k cij} +dl=k

    max{0, vk cil} fi, (10)

    as

    jDwij at time t= vk converges to the left-hand side if 0. Finally,for 1j < kd,

    vkrj,k+ cij+ cik, (11)which is trivial ifrj,k =vk, and otherwise follows from observing that the right-hand side is at most ci(j,k)k due to metric service costs, and facility i(j, k) is openat time t.

    To prove a performance ratio, we consider the following optimization problemfor F 1 and d N:

    maximize

    dj=1 vj Ffid

    j=1 cij

    subject to

    vj vj+1 (1j < d)

    rj,k rj,k+1 (1j < k < d)rj,k+ cij+ cik vk (1j < kd)

    k1j=1

    max{rj,k cij, 0} +dl=k

    max{vk cil, 0} fi (1kd)d

    j=1 cij > 0

    vj , cij, fi, rj,k 0 (1jkd)

    Note that this optimization problem can be easily reformulated as a linearprogram; it is often referred to as the factor-revealing LP. Its optimum valuesimply performance guarantees for the Jain-Mahdian-Saberi algorithm:

    Theorem 4.2 LetF 1, and letSbe the supremum of the optimum values ofthe factor-revealing LP over alld N. Let an instance be given, and letX Fbe any solution. Then the cost of the solution produced by the algorithm by Jainet al. on this instance is at mostFcF(X

    ) + ScS(X).

    Proof: The algorithm produces numbers vj and, implicitly, rj,k for all j, k

    D with vj

    vk. For each star (i, D), the numbers fi, cij, vj, rj,k satisfy the

    conditions (9), (10) and (11) and thus constitute a feasible solution of the above

    24

  • 8/10/2019 Facility Location Uni Bonn

    25/59

    optimization problem unless dj=1 cij = 0. Hence dj=1 vjFfi

    Sdj=1 cij.

    Choosing :D Xsuch thatc(j)j = miniXcij, and summing over all pairs(i, {j D: (j) =i}) (iX), we get

    jDvjF

    iX

    fi+ SjD

    c(j)j =FcF(X) + ScS(X).

    As the solution computed by the algorithm has total cost at most

    jD vj , thisproves the theorem.

    To apply this, we observe:

    Lemma 4.3 Consider the above factor-revealing LP for somed N.(a) ForF = 1, the optimum is at most 2.

    (b) (Jain et al. [2003]) ForF = 1.61, the optimum is at most1.61.

    (c) (Mahdian, Ye and Zhang [2002]) ForF = 1.11, the optimum is at most1.78.

    Proof: Here we only prove (a). For a feasible solution we have

    d

    fi+d

    j=1

    cij d

    k=1

    k1j=1

    rj,k+dl=k

    vk

    d

    k=1

    dvk (d 1)d

    j=1

    cij,

    (12)

    implying that dd

    j=1 vjdfi+ (2d 1)d

    j=1 cij, i.e.d

    j=1 vjfi+ 2d

    j=1 cij.

    The proofs of (b) and (c) are quite long and technical. (a) directly impliesthat 1

    2v is a feasible dual solution, and the Jain-Mahdian-Saberi algorithm is a

    2-approximation. (b) implies a performance ratio of 1.61. Even better results canbe obtained by combining the Jain-Mahdian-Saberi algorithm with scaling andgreedy augmentation. This will be shown in the next section. For later use wesummarize what follows from Theorem 4.2 and Lemma 4.3:

    Corollary 4.4 Let (F, S) {(1, 2), (1.61, 1.61), (1.11, 1.78)}. Let an instanceof the metric Uncapacitated Facility Location Problem be given, andletX Fbe any solution. Then the cost of the solution produced by the Jain-Mahdian-Saberi algorithm on this instance is at mostFcF(X

    ) + ScS(X).

    25

  • 8/10/2019 Facility Location Uni Bonn

    26/59

    4.3 Scaling and Greedy Augmentation

    Many of the previous results are asymmetric in terms of facility cost and servicecost. Often the service cost is higher and could be reduced by opening addi-tional facilities. Indeed, this can be exploited to improve several performanceguarantees.

    For a solution X F and a facility i F, we denote by gX(i) := cS(X) cS(X {i}). Then we have:

    Proposition 4.5 Let =X, X F. TheniXgX(i)cS(X) cS(X).Proof: Forj

    Dlet (j)

    Xsuch thatc(j)j = mini

    Xcij, and let

    (j)

    X

    such that c(j)j = miniXcij. Then gX(i)jD:(j)=i(c(j)jcij) for alliX. Summation yields the lemma.

    In particular, there exists an i X with gX(i)fi

    cS(X)cS(X)cF(X)

    . By greedyaugmentationof a setXwe mean iteratively picking an element i FmaximizinggX(i)fi

    until gX(i)fi for all i F. We need the following lemma:

    Lemma 4.6 (Charikar and Guha [1999]) Let = X, X F. Apply greedyaugmentation to X, obtaining a setYX. Then

    cF(Y) + cS(Y)

    cF(X) + cF(X) ln

    max

    1,

    cS(X) cS(X)cF(X)

    + cF(X

    ) + cS(X).

    Proof: IfcS(X)cF(X) + cS(X), the above inequality evidently holds evenbefore augmentation (Y = X). Otherwise, let X = X0, X1, . . . , X k be the se-quence of augmented sets, such that k is the first index for which cS(Xk)cF(X

    ) +cS(X). By renumbering facilities we may assume Xi\Xi1 ={i}(i= 1, . . . , k). By Proposition 4.5,

    cS(Xi1)

    cS(Xi)

    fi cS(Xi1)

    cS(X

    )

    cF(X)

    fori = 1, . . . , k. HenceficF(X) cS(Xi1)cS(Xi)cS(Xi1)cS(X) (note thatcS(Xi1)> cS(X)),and

    cF(Xk) + cS(Xk) cF(X) + cF(X)ki=1

    cS(Xi1) cS(Xi)cS(Xi1) cS(X)+cS(Xk).

    As the right-hand side increases with increasing cS(Xk) (the derivative is 1cF(X

    )cS(Xk1)cS(X) > 0), we may assume cS(Xk) = cF(X

    ) +cS(X). By using

    26

  • 8/10/2019 Facility Location Uni Bonn

    27/59

    x

    1

    ln xfor x >0, we get

    cF(Xk) + cS(Xk) cF(X) + cF(X)ki=1

    1 cS(Xi) cS(X

    )cS(Xi1) cS(X)

    + cS(Xk)

    cF(X) cF(X)ki=1

    ln cS(Xi) cS(X)cS(Xi1) cS(X)+ cS(Xk)

    = cF(X) cF(X) lncS(Xk) cS(X)

    cS(X) cS(X) + cS(Xk)

    = cF(X) + cF(X) ln

    cS(X) cS(X)cF(X)

    + cF(X) + cS(X).

    This can be used to improve several of the previous performance guarantees.Sometimes it is good to combine greedy augmentation with scaling. We get thefollowing general result:

    Theorem 4.7 Suppose there are positive constants , S, Fand an algorithm Awhich, for every instance, computes a solutionX such thatcF(X) +cS(X)FcF(X

    ) + ScS(X) for each =X F. Let 1.Then, scaling facilities by, applying A to the modified instance, scaling back,

    and applying greedy augmentation to the original instance yields a solution of costat mostmax{F

    + ln(), 1 + S1

    } times the optimum.

    Proof: Let X be the set of facilities of an optimum solution to the originalinstance. We have cF(X) +cS(X) FcF(X) + ScS(X). If cS(X)cS(X

    ) + cF(X), then we have (cF(X) +cS(X))FcF(X) +ScS(X) +(1)(cS(X)+ cF(X)), soXis a solution that costs at most max{1+ F1 , 1+S1

    } times the optimum. Note that 1 + F1

    F

    + ln() as 1 1xln xfor

    allx >0.Otherwise we apply greedy augmentation to Xand get a solution of cost at

    most

    cF(X) + cF(X) ln

    cS(X) cS(X)cF(X)

    + cF(X) + cS(X

    )

    cF(X) + cF(X) ln(S 1)cS(X) + FcF(X) cF(X)

    cF(X) + cF(X

    ) + cS(X).

    The derivative of this expression with respect to cF(X) is

    1 cF(X)

    (S

    1)cS(X) + FcF(X)

    cF(X) ,

    27

  • 8/10/2019 Facility Location Uni Bonn

    28/59

    which is zero forcF(X) = F

    cF(X

    ) + S1

    cS(X). Hence we get a solution of

    cost at most F

    + ln()

    cF(X

    ) +

    1 +S 1

    cS(X

    ).

    With Corollary 4.4 we can apply this result to the Jain-Mahdian-Saberi al-gorithm with = F = 1 and S = 2: by setting = 1.76 we obtain anapproximation guarantee of 1.57. With = 1, F = 1.11 and S = 1.78 (cf.Corollary 4.4) we can do even better:

    Corollary 4.8 (Mahdian, Ye and Zhang [2002]) Multiply all facility costs by=1.504, apply the Jain-Mahdian-Saberi algorithm, scale back the facility costs, andapply greedy augmentation. Then this algorithm has an approximation guaranteeof1.52.

    This is the best performance ratio that is currently known for the metricUncapacitated Facility Location Problem.

    Theorem 4.7 can also be used to improve the performance ratio of other algo-rithms. Applied to the Jain-Vazirani algorithm, where we have=S=F= 3,we can set = 0.782 and obtain a performance ratio of 1.853 (instead of 3). For

    the LP rounding algorithm by Shmoys, Tardos and Aardal (Section 3.5), the pre-requisites hold for anyandF =S= 3+. By choosingandappropriately(e.g.= 6, = 0.7), the performance ratio can be reduced from 4 to below 3.

    In some cases, it suffices to scale facility costs before applying the algorithm:

    Proposition 4.9 Suppose there are constants F, S, F, S and an algorithmA, such that for every instance A computes a solution X such that cF(X)FcF(X

    ) + ScS(X) andcS(X)FcF(X) + ScS(X) for each =X F.Let :=

    SF+

    (SF)2+4FS2F

    = 2SFS+

    (SF)2+4FS

    . Then, multiply-

    ing all facility costs byand applying A to the modified instance yields a solution

    of cost at most S+F+(SF)2+4FS2

    times the optimum.

    Proof: Let be X the set of facilities of an optimum solution to the originalinstance. We have cF(X) +cS(X) 1 (FcF(X) +ScS(X)) +FcF(X) +ScS(X

    )) = (F+ F)cF(X) + ( 1S+ S)cS(X).

    4.4 Lower Bound on Approximation Guarantees

    In this section we denote by the solution of the equation + 1 = ln 2

    ; wehave 0.463

    0.4631. A simple calculation shows that =

    +1ln 2

    =

    max{ +1ln 2 : >0}.

    28

  • 8/10/2019 Facility Location Uni Bonn

    29/59

    We will show that 1 + is the approximation ratio that can be achieved for

    distances 1 and 3. More precisely, we have the following two results, both byGuha and Khuller [1999]:

    Theorem 4.10 Consider the Uncapacitated Facility Location Problemrestricted to instances where all service costs are within the interval [1, 3]. Thisproblem has an(1 + + )-factor approximation algorithm for every >0.

    Proof: Let > 0, and let k := 1. Enumerate all solutions X F with

    |X| k.We compute another solution as follows. We first open one facilityi with min-

    imum opening cost fi, and then apply greedy augmentation to obtain a solution

    Y. We claim that the best solution costs at most 1 + + times the optimum.Let X be an optimum solution and= cF(X

    )cS(X)

    . We may assume that|X|>k, as otherwise we have found X above. Then cF({i}) 1kcF(X). Moreover, asthe service costs are between 1 and 3,cS({i})3|D|3cS(X).

    By Lemma 4.6, the cost ofY is at most

    1

    kcF(X

    ) + cF(X) ln

    max

    1,

    2cS(X)

    cF(X)

    + cF(X

    ) + cS(X)

    = cS(X)

    k+ lnmax1,

    2

    + + 1 (1 + + )(1 + )cS(X)= (1 + + )(cF(X

    ) + cS(X)).

    The performance guarantee seems to be best possible in view of the following:

    Theorem 4.11 If there is an >0 and a(1 + )-factor approximation algo-rithm for the metricUncapacited Facility Location Problem, then thereis an algorithm for the Minimum Cardinality Set Cover Problemwhichfor every instance(U,

    S)computes a set cover

    Rwith

    |R| (1

    2) ln

    |U

    |OPT(U,

    S).

    By Feiges [1998] result, the latter would imply that every problem in NPcanbe solved in nO(log logn) time, where n is the input size.Proof: Let (U, S) be a set system. If|U| e +2 , we solve the instance bycomplete enumeration (in 22

    |U|time, which is a constant depending ononly).

    Otherwise we run the following algorithm for each t {1, . . . , |U|}:1 SetR:=. SetF :=S,D :=U, and let cij := 1 for ji F and

    cij := 3 for i F and jU\ {i}.2 Set fi := |D|t .

    3 Find a (1+ )-approximate solutionXto the instance (F, D, c , f )of the Uncapacitated Facility Location Problem.29

  • 8/10/2019 Facility Location Uni Bonn

    30/59

    4 Set

    R:=

    R X and

    D:=

    {j

    D:cij = 3 for alli

    X

    }.

    5 IfD =D, then stop (without output).6 SetD:=D. IfD =, then go to2.

    Note that the service costs defined in 1 are metric. Clearly R coversU\Datany stage. We claim that if there is a set cover of cardinalityt, then the algorithmterminates withD=and a set coverR with|R| t(1 2) ln |U|. As we runthe algorithm for all possible values oft, this will conclude the proof.

    Let us consider the k-th iteration of the algorithm, in which we denote nk :=|D|, k :=|X|, and k := |D|nk . In3 of iteration k, the algorithm computes asolution of cost k

    nkt

    + nk+ 2|D|. Suppose there is a set cover of cardinality t,and thus a solution of cost tnk

    t +nk to the facility location instance. Then we

    have k nkt + nk+ 2|D| (1 + )(+ 1)nk, and hencek

    t + 2k (1 + )(+ 1) 1

    = 2 + 2 (+ 1)< 2 + 2 (+ 2)= (1 )(+ 2),

    which impliesk

    t

    0, as the right-hand side is minimized for x = (1 ) ln 2(1) . Setting

    x= kt, we get

    k < e k

    t(1) , (14)

    and hence, for all k < l,

    k < t(1 ) ln 1k

    . (15)

    In particular, k

  • 8/10/2019 Facility Location Uni Bonn

    31/59

    = t(1 )lnl1k=1

    1

    k + + 2

    = t(1 )(ln |U| ln nl+ + 2) t(1 )(ln |U| + + 2) t(1 2) ln |U|

    since|U| e +2 . M. Sviridenko [unpublished] observed that this result can be strengthened

    using the following result:

    Theorem 4.12 For every fixed >0 and >0, the following decision problemis NP-hard: An instance consists of a set system (U, S) and a number t N,such that either

    (a) there exists aR S with|R|= t andR= U, or(b) for eachR S with|R| t we have|R| 1 e |R|t + |U|.

    The task is to decide whether (a) or (b) holds.

    For the case = 1 this was implicitly proved by Feige [1998], implying thatthe problem that asks for covering as many elements as possible with a givennumber t of sets in a given set system cannot be approximated with a factorsmaller than 1 1

    e unless P= NP(cf. Theorem 5.3 in Feiges paper; it is easy to

    see that the greedy algorithm achieves precisely this factor). Theorem 4.12 canbe proved similarly (see also the hints in Section 5 of Feige, Lov asz and Tetali[2004]). This implies:

    Theorem 4.13 (Sviridenko [unpublished]) If there is an >0 and a(1 + )-factor approximation algorithm for the metric Uncapacitated Facility Lo-cation Problem, thenP= NP.

    Proof: Suppose that for some 0< 1 e |R|

    t + |U|.31

  • 8/10/2019 Facility Location Uni Bonn

    32/59

    Indeed, we get from (13) in the proof of Theorem 4.11 that

    |R|< t+ (1

    )(+ 2)t < t. Hence we are done if|R|=|U|. Otherwise, (14) implies|R||U| = 1

    lk=1

    k>1 e |R|

    t(1) >1 e |R|t + ,

    as the function x ex e x(1) is monotonically decreasing for x 1 (thederivative 1

    1e x1 ex is negative as 1

    1 = 1 + 1 < e

    1 e x1 =exe x1 ),

    and 1 |R|t

    < .This means that we have a polynomial-time algorithm for the NP-hard deci-

    sion problem defined in Theorem 4.12.

    5 Reductions for More General Problems

    We will now discuss two generalizations of the metric Uncapacitated FacilityLocation Problem, which we can also solve with primal-dual algorithms dis-cussed above, by two different techniques. Both techniques have been proposedoriginally by Jain and Vazirani [2001].

    5.1 Soft Capacities

    In the Soft-Capacitated Facility Location Problem, each facility i Fhas a capacityui. If we assign a set D D of customers to i, then we have toopen |D|

    uicopies of facility i, and consequently pay an opening cost of |D|

    uifi.

    Another problem does not allow to open multiple copies of the facilities, i.e.we have hard capacity bounds. This is called the Capacitated Facility Lo-cation Problemand will be discussed in Section 7. It can probably not bereduced easily to the Uncapacitated Facility Location Problem.

    For soft capacities, however, the reduction is easy. Again we assume metricservice costs.

    Theorem 5.1 (Mahdian, Ye and Zhang [2002]) LetF andSbe constants andA a polynomial-time algorithm such that, for every instance of the metric Un-capacitated Facility Location Problem, A computes a solution X withcF(X) +cS(X) FcF(X) +ScS(X) for each = X F. Then there isa(F+S)-factor approximation algorithm for the metric Soft-CapacitatedFacility Location Problem.

    Proof: Consider an instanceI= (F, D, f , u , c) of the metric Soft-CapacitatedFacility Location Problem. We transform it to the instanceI = (F, D, f , c)of the metric Uncapacitated Facility Location Problem, where cij :=

    cij+ fiui for i F and j D. (Note that c is metric whenever c is metric.)

    32

  • 8/10/2019 Facility Location Uni Bonn

    33/59

    We apply A to I and find a solution X

    Fand an assignment :

    D X.

    If :D F is an optimum solution to I, where X :={i F :j D :(j) =i} is the set of facilities opened at least once,

    iX

    |{j D: (j) =i}|ui

    fi+jD

    c(j)j

    iX

    fi+jD

    c(j)j

    FiXfi+ SjD

    c(j)j

    (F+ S)iX

    |{j D: (j) =i}|ui

    fi+ S

    jD

    c(j)j .

    In particular, using the Jain-Mahdian-Saberi algorithm we get a 2.89-factorapproximation algorithm for the metric Soft-Capacitated Facility Loca-tion Problemby Corollary 4.4; here F = 1.11 andS= 1.78. In a subsequentpaper, Mahdian, Ye and Zhang [2003] observed that the last inequality can bestrengthened:

    Theorem 5.2 (Mahdian, Ye and Zhang [2003]) There is a 2-factor approxima-tion algorithm for the metric Soft-Capacitated Facility Location Prob-lem.

    Proof: Indeed, here we have cij = cij + fiui

    , and in the analysis of the Jain-Mahdian-Saberi algorithm we get

    vkrj,k+ cij+ cikinstead of (11) (with the original service costs c), and thus the analysis in (12)

    yields

    dd

    j=1

    vjdfi+ dd

    j=1

    cij+ (d 1)d

    j=1

    cij.

    This implies that the cost of the solution is at most

    iX

    fi+jD

    c(j)j+jD

    c(j)j2iX

    j:(j)=i dj

    ui

    fi+ 2jD

    c(j)j .

    33

  • 8/10/2019 Facility Location Uni Bonn

    34/59

    5.2 Bounding the Number of Facilities

    For k N, the k-Facility Location Problem is the Uncapacitated Fa-cility Location Problem with the additional constraint that no more thank facilities may be opened. A special case, where facility opening costs are zero,is the well-known k-Median Problem. In this section we describe an approxi-mation algorithm for the metric k-Facility Location Problem.

    When we have a problem which becomes much easier if a certain type ofconstraints is omitted, Lagrangian relaxation is a common technique. In ourcase, we will add a constant to each facility opening cost.

    Theorem 5.3 (Jain and Vazirani [2001]) If there is a constantSand a polynomial-

    time algorithm A, such that for every instance of the metricUncapacitated Fa-cility Location ProblemA computes a solutionXsuch thatcF(X)+cS(X)cF(X

    ) + ScS(X) for each = X F, then there is a (2S)-factor approxi-mation algorithm for the metrick-Facility Location Problemwith integraldata.

    Proof: Let an instance of the metric k-Facility Location Problem begiven. We assume that service costs are integers within{0, 1, . . . , cmax} and fa-cility opening costs are integers within{0, 1, . . . , f max}.

    First we check if OPT = 0, and find a solution of zero cost if one exists. This

    is easy; see the proof of Lemma 5.4. Hence we assume OPT1. Let X be anoptimum solution (we will use it for the analysis only).

    LetA() Fbe the solution computed byAfor the instance where all facilityopening costs are increased by but the constraint on the number of facilities isomitted. We havecF(A()) + |A()| + cS(A())cF(X) + |X| + ScS(X),and hence

    cF(A()) + cS(A())cF(X) + ScS(X) + (k |A()|) (16)for all 0. If|A(0)| k, then A(0) is a feasible solution costing at most Stimes the optimum, and we are done.

    Otherwise A(0) > k, and note that|A(fmax+ S|D|cmax+ 1)| = 1 k. Set := 0 and := fmax+ S|D|cmax+ 1, and apply binary search, maintaining|A()| k

  • 8/10/2019 Facility Location Uni Bonn

    35/59

    Thus we consider X :=A() and Y :=A() and assume henceforth

    |X

    |>

    k >|Y|. Let := k|Y||X||Y| and := |X|k|X||Y| .Choose a subset X ofX with|X| =|Y| such that miniXcii = miniXcii

    for each iY, where we write cii := minjD(cij+ cij).We open either all elements ofX (with probability ) or all elements ofY

    (with probability = 1 ). In addition, we open a set ofk |Y| facilities ofX\X, chosen uniformly at random. Then the expected facility cost is cF(X) +cF(Y).

    Let j D, and let i be a closest facility in X, and let i be a closest facilityin Y. Connectj to i if it is open, else to i if it is open. If neither i nor i isopen, connect j to a facility i

    X minimizing cii.

    This yields an expected service cost cij+ cij ifiX and at mostcij+ (1 )cij+ (1 )(1 )cij

    cij+ 2cij+

    cij+ minjD

    (cij+ cij)

    cij+ 2cij+ (cij+ cij+ cij)= (1 + )cij+ (1 + )cij

    ifiX\ X.Thus the total expected service cost is at most

    (1 + max{, })(cS(X) + cS(Y))

    2 1|D|

    (cS(X) + cS(Y)).

    Overall, using (16), we get an expected cost of at most2 1|D|

    ((cF(X) + cS(X)) + (cF(Y) + cS(Y)))

    2 1|D|

    cF(X) + ScS(X) + ( ) (|X| k)(k |Y|)|X| |Y|

    2 1

    |D|cF(X) + ScS(X) + ( )|X| |Y|

    4

    2 1|D|

    cF(X) + ScS(X) +

    1

    4|D|

    2 1|D|

    1 + 1

    4|D|

    (cF(X) + ScS(X))

    2 12|D|

    (cF(X) + ScS(X))

    and thus at most 2S(cF(X) + cS(X)).

    Note that the expected cost is easy to compute even under the condition that

    a subset Z is opened with probability 1 and randomly chosen k |Z| facilities

    35

  • 8/10/2019 Facility Location Uni Bonn

    36/59

    of some other set are opened. Hence one can derandomize this algorithm by the

    method of conditional probabilities: first open X or Ydepending on where thebound on the expected cost is at most (2 1|D|)((cF(X) + cS(X)) + (cF(Y) +cS(Y ))), and then successively open a facility of X\X such that this boundcontinues to hold.

    In particular, by the above Jain-Mahdian-Saberi algorithm (Corollary 4.4), weobtain a 4-factor approximation algorithm for the metric k-Facility LocationProblem. The first constant-factor approximation algorithm for the metrick-Facility Location Problemwas due to Charikar et al. [2002].

    The running time of the binary search is weakly polynomial and works for

    integral data only. However we can make it strongly polynomial by discretizingthe input data:

    Lemma 5.4 For any instanceIof the metrick-Facility Location Problem,max 1 and 0 < 1, we can decide whether OPT(I) = 0, and otherwisegenerate another instanceI inO(|F||D| log(|F||D|)) time, such that all serviceand facility costs are integers in{0, 1, . . . , 2max(k+|D|)3

    }, and for each 1

    max, each solution to I with cost at mostOPT(I) is a solution to I with cost

    at most(1 + ) OPT(I).

    Proof: Let n := k +|D|

    . Given an instance I, we first compute an upperbound and a lower bound on OPT(I) differing by a factor 2n2 1 as follows. Foreach B {fi : i F} {cij : i F, j D} we consider the bipartite graphGB := (D F, {{i, j} :i F, j D, fiB, cijB}).

    The smallest B for which the elements ofD belong to at most k differentconnected components of GB, each of which contains at least one facility, is alower bound on OPT(I). This numberB can be found in O(|F||D| log(|F||D|))time by a straightforward variant of Krukskals Algorithm for minimumspanning trees.

    Moreover, for this B we can choose an arbitrary facility in each connectedcomponent of GB that contains an element of

    D, and connect each customer

    with service cost at most (2|D| 1)B (using that service costs are metric). ThusOPT(I)kB + (2|D| 1)|D|B

  • 8/10/2019 Facility Location Uni Bonn

    37/59

    and thus a solution to I of cost at most OPT(I) contains no element of cost

    B

    , and hence is a solution to Iof cost at mostOPT(I)(OPT(I) + B)(1 + )OPT(I).

    Corollary 5.5 There is a strongly polynomial4-factor approximation algorithmfor the metrick-Facility Location Problem.

    Proof: Apply Lemma 5.4 with max = 4 and = 14|D| , and apply Theorem

    5.3 with the Jain-Mahdian-Saberi algorithm to the resulting instance. We haveS= 2 by Corollary 4.4 and get a solution of total cost at most

    2 12|D|

    1 + 1

    4|D|

    (cF(X) + ScS(X))4 (cF(X) + cS(X)) .

    6 Local Search

    Local search is a technique that is often applied successfully in practice, althoughusually no good approximation guarantees can be shown. It was therefore asurprise to learn that facility location problems can be approximated well by local

    search. This was first explored by Korupolu, Plaxton and Rajaraman [2000] andled to several strong results subsequently. We shall present some of them in thisand the next section.

    The main advantage of local search algorithms is their flexibility; they canbe applied to arbitrary cost functions and even in the presence of complicatedadditional constraints. We will see this in Section 7 when we deal with a quitegeneral problem, including hard capacities.

    In this section we consider the k-Median Problem and the Uncapaci-tated Facility Location Problem, both with metric service costs. For themetrick-Median Problem, local search yields the best known performance ra-

    tio. Before presenting this result, we start with the simplest possible local searchalgorithm.

    6.1 Single Swaps for the k-Median Problem

    We start with an arbitrary feasible solution (set ofk facilities) and improve it bycertain local steps. Let us first consider single swaps only.

    Theorem 6.1 (Arya et al. [2004]) Consider an instance of the metrick-MedianProblem. LetXbe a feasible solution andX an optimum solution. IfcS((X\

    {x}

    ) {

    y}

    )

    cS

    (X) for allx

    X andy

    X

    , thencS

    (X)

    5cS

    (X).

    37

  • 8/10/2019 Facility Location Uni Bonn

    38/59

    Proof: Let us consider optimum assignments and of the customers to the

    k facilities in X and X, respectively. We say thatx X capturesy X if|{j D : (j) = x, (j) = y}| > 12|{j D : (j) = y}|. Each y X is

    captured by at most one xX.Let :D D be a bijection such that for all j D: ((j)) =(j); and if((j)) =(j) then (j) captures(j).

    Such a mapping can be obtained easily by ordering, for each y X, theelements of{j D : (j) = y} ={j0, . . . , jt1} such that customers j withidentical(j) are consecutive, and setting(jk) :=jk, wherek = (k+

    t2) modt.

    We now define k swaps (x, y) withxXandyX. EachyXwill serveas target in exactly one of these swaps.

    If an xXcaptures only one facility y X, we consider a swap (x, y). Ifthere are l such swaps, then there are k l elements left in Xand in X. Someof the remaining elements ofX(at most kl

    2) may capture at least two facilities

    ofX; we will not consider these. For each remaining facilityyX we choosean xXsuch that x does not capture any facility, and such that each xX issource of at most two such swaps.

    We now analyze the swaps one by one. Consider the swap (x, y), i.e. the set

    of facilities changes fromX to X := (X\ {x}) {y}; note that the case yXis not excluded. If|X|

  • 8/10/2019 Facility Location Uni Bonn

    39/59

    cS(X

    )

    cS(X) + 2

    jD(c(j)j+ c(j)(j)+ c((j))(j)

    c(j)j)

    = cS(X) cS(X) + 2

    jD

    (c(j)j+ c((j))(j))

    = cS(X) cS(X) + 4cS(X),

    because is a bijection.

    Thus a local optimum is a 5-approximation. However, this does not make anystatement about the running time to achieve a local optimum, and the numberof steps to reach a local optimum could in fact be exponential. However, by

    applying Lemma 5.4 (i.e. by discretizing costs) we obtain a strongly polynomialrunning time.Another possibility is to make only moves that are sufficiently profitable:

    Lemma 6.2 (Arya et al. [2004]) Let 0 < < 1, and let a discrete minimiza-tion problem be given with objective function cost. Let k N, letN(X) be aneighbourhood defined for each feasible solution X, andN(X) N(X) with|N(X)| q. Suppose that, for some1, each feasible solutionX satisfies

    XN(X)(cost(X) cost(X)) OPT cost(X). (17)

    Then consider a local search algorithm that starts with any feasible solutionXand moves to anX N(X)withcost(X)< (1

    2q)cost(X)as long as there is

    such anX. Then after a number of iterations which is polynomial in the inputsize, qand 1

    , this algorithm stops with an(+ )-approximate solution.

    Proof: Each iteration decreases the cost by at least a factor 1 2q . If we startwith solution Xand end up with solution Y, the number of iterations is at most

    log cost(X)cost(Y)

    log 11

    2q

    2q

    (log cost(X) log cost(Y)),

    as log(1 x)> xfor 0< x

  • 8/10/2019 Facility Location Uni Bonn

    40/59

    and hence

    cost(X)<

    1 2

    OPT(+ )OPTas1.

    In the above theorem as well as in the following ones, we showed (17) for apolynomially boundedq. The most efficient running time is obtained by combin-ing Lemma 5.4 and Lemma 6.2

    A related result on achieving approximate local optima has been obtainedby Orlin, Punnen and Schulz [2004]: They showed that for a general discreteminimization problem with modular objective function and a neighbourhood forwhich each local minimum costs at most times the optimum, and for which thequestion whether a given feasible solution is a local optimum can be decided inpolynomial time, an (+)-approximate solution can be obtained for any >0by a combination of local search and scaling, in a running time that dependspolynomially on the input size and linearly on 1

    .

    6.2 Better Performance Guarantee by Multiswaps

    We have shown that local search with single swaps yields a (5 + )-factor ap-proximation algorithm for the metric k-Median Problemfor any >0. Usingmultiswaps the approximation guarantee can be improved significantly:

    Theorem 6.3 (Arya et al. [2004]) Consider an instance of the metrick-MedianProblem, and let p N. Let X be a feasible solution and X an optimumsolution. If cS((X\ {A}) {B}) cS(X) for all A X and B X with|A|=|B| p, thencS(X)(3 + 2p)cS(X).

    Proof: Let and be again optimum assignments of the customers to thek facilities in X and X, respectively. For each A X, let C(A) be the set offacilities in X that are captured by A, i.e.

    C(A) :=

    yX:|{j D: (j)A, (j) =y}|> 12 |{j D: (j) =y}|

    .

    We partition X=A1. .Ar and X=B1

    . .Br as follows:Let{xX :C({x})=}={x1, . . . , xr}=: X.Fori= 1 tor 1 do:

    Set Ai:={xi}.While|Ai|

  • 8/10/2019 Facility Location Uni Bonn

    41/59

    It is clear that this algorithm guarantees

    |Ai

    |=

    |Bi

    |fori = 1, . . . , r, and that

    the sets A1, . . . , Ar are pairwise disjoint and B1, . . . , Br are pairwise disjoint.Note that adding an element is always possible if|Ai| |X| |C(A1)| |C(Ai)| |C({xi+1})| |C({xr})| =|X\ (C(A1) C(Ai) C({xi+1}) C({xr}))| 0.

    Let :D D be a bijection such that for all j D: ((j)) =(j); if((j)) =(j) then (j) captures(j); and

    if (j) Ai and ((j)) Ai for some i {1, . . . , r}, then Ai captures(j).

    Such a mapping can be obtained almost identically as above.We now define a set of swaps (A, B) with|A|=|B| p,AXandBX.

    Each swap will be associated with a positive weight. The swap (A, B) means thatX is replaced by X := (X\ A) B; we say that A is the source set and B isthe target set. If|X| p, we consider the swap({x}, {y}) with weight 1

    q1 for each x Ai\ {xi} and y Bi. Each y Xappears in the target set of swaps of total weight 1, and each xXappears inthe source set of swaps of total weight at most p+1

    p .

    We reassign customers as with the single swaps. More precisely, for a swap(A, B) we reassign all j D with (j) B to (j) and all j D with(j) /B and(j)A to ((j)). Note that we have BC(A) for each of theconsidered swaps (A, B). Thus, for all j D with (j) A and (j) / B wehave ((j)) / A. Therefore we can bound the increase of the cost due to theswap as follows:

    0 cS(X) cS(X)

    jD:(j)B

    (c(j)j c(j)j) +

    jD:(j)A,(j)/B(c((j))j c(j)j)

    jD:(j)B(c(j)j c(j)j) +

    jD:(j)A

    (c((j))j c(j)j)

    as c((j))j c(j)j by definition of . Hence taking the weighted sum over allswaps yields

    0 jD(c(j)j c(j)j) +

    p + 1

    pjD

    (c((j))j

    c(j)j)

    41

  • 8/10/2019 Facility Location Uni Bonn

    42/59

    cS(X

    )

    cS(X) +p + 1

    pjD

    (c(j)j+ c(j)(j)+ c((j))(j)

    c(j)j)

    = cS(X) cS(X) + p + 1

    p

    jD

    (c(j)j+ c((j))(j))

    = cS(X) cS(X) + 2 p + 1

    p cS(X

    ),

    because is a bijection.

    Arya et al. [2004] also showed that this performance guarantee is tight. Wehave a (3+)-factor approximation algorithm for any >0, which is the currently

    best known approximation guarantee for the metric k-Median Problem.

    6.3 Local Search for Uncapacitated Facility Location

    We apply similar techniques to the Uncapacitated Facility Location Prob-lemto obtain a simple approximation algorithm based on local search:

    Theorem 6.4 (Arya et al. [2004]) Consider an instance of the metric Uncapac-itated Facility Location Problem. LetXandX be any feasible solutions.If neitherX\{x}norX{y}nor(X\{x}){y}is better thanXfor anyxXandy F \ X, thencS(X)cF(X) + cS(X) andcF(X)cF(X) + 2cS(X).Proof: We use the same notation as in the previous proofs. In particular, let and be optimum assignments of the customers to X and X, respectively.

    The first inequality is easily proved by considering the operations of adding anyXto X, which increases the cost by at mostfy+

    jD:(j)=y(c(j)jc(j)j).

    Summing these values up yields that cF(X) + cS(X) cS(X) is nonnegative.

    Let again:D D be a bijection such that for all j D: ((j)) =(j);

    if((j)) =(j) then (j) captures(j) and (j) =j .Such a mapping can be obtained identically as above after fixing (j) :=j for|{j D: (j) =y, (j) =x} ||{j D:(j) =y , (j)=x}| elements j Dwith (j) =y and (j) =x for any pair xX,yX where xcaptures y.

    To bound the facility cost ofX, let xX, and letDx:={j D: (j) =x}.Ifx does not capture any y X, we consider dropping x and reassigning eachj Dx to ((j))X\ {x}. Hence

    0 fx+jDx

    (c((j))j cxj). (18)

    42

  • 8/10/2019 Facility Location Uni Bonn

    43/59

    If the set C(

    {x

    }) of facilities captured by x is nonempty, let y

    C(

    {x

    }) be

    the nearest facility in C({x}) (i.e. minjD(cxj +cyj) is minimum). We considerthe addition of each facility y C({x})\ {y}, which increases the cost by atmost

    fy+

    jDx:(j)=y,(j)=j(c(j)j cxj). (19)

    Moreover, we consider the swap ({x}, {y}). For j Dx we reassign j to((j)) if(j)=j , and to y otherwise.

    The new service cost for j Dx is at most c((j))j in the first case, c(j)j if(j) =j and (j) =y , and

    cyjcxj+ minkD(cxk+ cyk)cxj+ minkD(cxk+ c(j)k)2cxj+ c(j)j

    otherwise, as xcaptures(j) in the latter case.Altogether, the swap from x to y increases the cost by at most

    fy fx jDx

    cxj+

    jDx:(j)=jc((j))j

    +

    jDx:(j)=j,(j)=yc(j)j+

    jDx:(j)=j,(j)=y

    (2cxj+ c(j)j).(20)

    Adding the nonnegative terms (19) and (20) yields

    0

    yC(x)fy fx+

    jDx:(j)=j

    (c((j))j cxj)

    +

    jDx:(j)=j,(j)=y(c(j)j cxj) +

    jDx:(j)=j,(j)=y

    2c(j)j

    yC(x)fy fx+

    jDx:(j)=j

    (c((j))j cxj) + 2

    jDx:(j)=jc(j)j

    (21)

    Summing (18) and (21), respectively, over all xXyields

    0 xX

    yC(x) fy cF(X) +

    jD:(j)=j(c((j))j c(j)j) + 2

    jD:(j)=j c(j)j

    cF(X) cF(X) +

    jD:(j)=j(c(j)j+ c(j)(j)+ c((j))(j) c(j)j)

    +2

    jD:(j)=jc(j)j

    = cF(X) cF(X) + 2cS(X).

    This directly implies that we have a (3 + )-approximation for any > 0.

    However, by Theorem 4.7, we get a 2.375-approximation algorithm by multiplying

    43

  • 8/10/2019 Facility Location Uni Bonn

    44/59

    facility costs by = 1.4547, applying the above local search technique, scaling

    facility costs back, and applying greedy augmentation.Instead, for a simpler result, we could multiply facility costs by

    2 before

    applying local search, and we obtain a solution X with cS(X)

    2cF(X) +

    cS(X) and

    2cF(X)

    2cF(X

    ) + 2cS(X). Hence cF(X) +cS(X) (1 +2)(cF(X

    ) + cS(X)), and we get the slightly worse approximation guarantee ofArya et al. [2004], namely (1 +

    2 + )2.415, without greedy augmentation.

    (This can be viewed as an application of Proposition 4.9.)Charikar and Guha [1999] proved the same approximation guarantee for a

    very similar local serach algorithm.

    7 Capacitated Facility Location

    In this section we consider hard capacities. Local search is the only techniqueknown to lead to an approximation guarantee for hard capacities. In fact, we showthat an even more general problem, called the Universal Facility LocationProblem, can be solved up to a factor of 6.702 by a local search algorithm. Thisincludes the metric Capacitated Facility Location Problem (with hardcapacities), for which local search is also the only technique that is known to leadto an approximation algorithm. But it also includes simpler problems like themetric Soft-Capacitated Facility Location Problem.

    When dealing with hard capacities, we have to allow the demand of customersto be split, i.e. assigned to multiple open facilities. However, the total demandassigned to a facility must not exceed its capacity. If we do not allow splitting,we cannot expect any result as even deciding whether a feasible solution existsat all is NP-complete (it contains the well-known Partitionproblem).

    7.1 Capacitated and Universal Facility Location

    The (metric) Capacitated Facility Location Problem is defined as follows:Given:

    a finite set V and distances cij 0 (i, j V) with cij +cjk cik for alli,j,kV.

    a setD Vof customers (or clients); a setF Vof potential facilities; a fixed cost fi0 for opening each facility i F; a capacity ui0 for each facility;

    a demand dj0 for each client.

    44

  • 8/10/2019 Facility Location Uni Bonn

    45/59

    we look for:

    a subset Sof facilities (called open) and an assignment x : S D R+ of customers demand to open facilities,

    where

    iSxij =dj for all j D,such that the sum of facility costs and service costs

    iSfi+iS

    jD

    cijxij

    is minimum.Note that for a fixed set Sof opened facilities, an optimum assignment xcan

    be found be solving a transshipment problem. If all ui and dj are integral, thereis an integral optimum assignment. In particular, if capacities are integral andall demands are 1, the demand will not be split.

    The first approximation algorithm for the general case is due to P al, Tardosand Wexler [2001], extending an earlier result for a special case by Korupolo,Plaxton and Rajamaran [2000]. The approximation guarantee was then improvedto 5.83 by Zhang, Chen and Ye [2004]. For the special case of uniform facilityopening costs, Levi, Shmoys and Swamy [2004] obtained a 5-factor approximationalgorithm by rounding an LP relaxation.

    The work by Pal, Tardos and Wexler has been generalized to the so-calledUniversal Facility Location Problemby Mahdian and Pal [2003]. In theUniversal Facility Location Problemwe are given V, c, F, D, das above,and a non-decreasing, left-continuous functionfi: R+ R+ {}, where fi(u)is the cost to install capacity u at facility i. The task is to find numbers xij0(i F, j D) withiFxij = dj for all j D (i.e. a fractional assignment)such that c(x) :=cF(x) + cS(x) is minimum, where

    cF(x) :=iF

    fijD

    xij and cS(x) :=iFjD

    cijxij.

    Lemma 7.1 (Mahdian and Pal [2003]) Every instance of the Universal Fa-cility Location Problemhas an optimum solution.

    Proof: If there is no solution with finite cost, any solution is optimum. Oth-erwise let (xi)iN be a sequence of solutions whose costs approach the infimumc of the set of costs of feasible solutions. As this sequence is bounded, there isa subsequence (xij )jN converging to some x. As all fi are left-continuous andnon-decreasing, we have c(x) = c(limj xij ) limj c(xij ) = c, i.e. x isoptimum.

    45

  • 8/10/2019 Facility Location Uni Bonn

    46/59

    For an algorithm, we have to specify how the functions fi are given. We

    need an oracle that, for each i F, u, c R+ and t R, computes fi(u) andmax{ R :u + 0, fi(u + ) fi(u) + c|| t}. This is a natural assumptionas this oracle can be implemented trivially for all special cases of the UniversalFacility Location Problemconsidered before.

    7.2 Add Operation

    In the following sections, based on Vygen [2005], we will present a local searchalgorithm for the Universal Facility Location Problem. It uses two op-erations. First, fort Fand R+ we consider the operation Add(t, ), whichmeans replacing the current feasible solution x by an optimum solution y of thetransshipment problem

    min

    cS(y) : y:F D R+,

    iF

    yij =dj(j D),jD

    yijjD

    xij(i F \ {t}),jD

    ytjjD

    xtj+

    .

    We denote by cx(t, ) := cS(y)cS(x) +ft(

    jD xtj +)ft(

    jDxtj) theestimated cost of this operation; this is an upper bound on c(y)

    c(x).

    Lemma 7.2 (Mahdian and Pal [2003]) Let > 0 and t F. Letx be a feasi-ble solution to a given instance. Then there is an algorithm with running timeO(|V|3 log |V|1) to find a R+ with cx(t, ) c(x) or decide that no R+ exists for whichcx(t, ) 2c(x).

    Proof: Let C :={c(x) : Z+, 1}. For each C let be themaximum R+ for which ft(

    jDxtj +) ft(

    jDxtj). We compute

    cx(t, ) for all C.Suppose there is a R+ with cx(t, ) 2c(x). Then consider :=

    c(x) 1c(x)(ft(

    jDxtj +) ft(jDxtj)) C. Note that and hence

    cx(t, )< cx(t, ) + c(x) c(x).

    The running time is dominated by solving|C| transshipment problems in adigraph with|V| vertices.

    If there is no sufficiently profitable Add operation, the service cost can bebounded. The following result is essentially due to Pal, Tardos and Wexler [2001]:

    Lemma 7.3 Let >0, and letx, x be feasible solutions to a given instance, andletcx(t, ) |F|c(x) for allt F and R+. ThencS(x)cF(x) + cS(x) +c(x).

    46

  • 8/10/2019 Facility Location Uni Bonn

    47/59

    Proof: Consider the (complete bipartite) digraph G = (

    D

    .

    F, (

    D F)

    (F D)) with edge weights c((j, i)) := cij and c((i, j)) :=cij for i F andj D. Let b(i) := jD(xijxij) for i F, S :={i F : b(i) > 0} andT :={i F :b(i)< 0}.

    Define a b-flow g :E(G) R+ byg(i, j) := max{0, xij xij} and g(j, i) :=max{0, xij xij} for i F,j D.

    Write g as the sum of bt-flows gt for t T, where bt(t) = b(t) and 0bt(v)b(v) forvV(G) \ T. (This can be done by standard flow decompositiontechniques.)

    For eachtT,gt defines a feasible way to reassign customers to t, i.e. a newsolution xt defined by xtij := xij +gt(j, i) gt(i, j) for i F, j D. We havecS(xt) =cS(x) +

    eE(G) c(e)gt(e) and hence

    cx(t, b(t))

    eE(G)c(e)gt(e) + ft

    jD

    xtj

    ft

    jDxtj

    .

    If the left-hand side is at least |F|c(x) for each tT, summation yields

    c(x)

    eE(G)c(e)g(e) +

    tT

    ft

    jD

    xtj

    eE(G) c(e)g(e) + cF(x)= cS(x

    ) cS(x) + cF(x).

    7.3 Pivot Operation

    Let x be a feasible solution for a given instance of the Universal FacilityLocation Problem. LetA be an arborescence with V(A) F andxA :={ RV(A) :

    jDxij+ i0 for all iV(A),

    iV(A) i= 0}.

    Then we consider the operation Pivot(A, ), which means replacing x by a

    solutionxwith

    jDxij =

    jDxij+ifor iV(A) andc(x)c(x)+cx(A, ),where cx(A, ) :=

    iV(A) c

    xA,i() and

    cxA,i() :=fi

    jD

    xij+ i

    fijD

    xij

    +

    jA+i

    j

    cip(i)for iV(A). HereA+i denotes the set of vertices reachable fromi in A, and p(i)is the predecessor ofi in A (andp(i) arbitrary ifi is the root). Such an x can beconstructed easily by moving demand along the edges in A in reverse topologicalorder. Note that the orientation ofA is irrelevant and used only to simplify the

    notation.

    47

  • 8/10/2019 Facility Location Uni Bonn

    48/59

    The operation will be performed if itsestimated costcx(A, ) is at most

    c(x).

    This guarantees that the resulting local search algorithm stops after a polynomialnumber of improvement steps. We call

    iV(A)jA+i j

    cip(i) the estimatedrouting costof Pivot(A, ).

    We now show how to find an improving Pivotoperation unless we are at anapproximate local optimum:

    Lemma 7.4 (Vygen [2005]) Let > 0 and A an arborescence with V(A)F. Let x be a feasible solution. Then there is an algorithm with running timeO(|F|43) to find a xA with cx(A, ) c(x) or decide that no xAexists for whichcx(A, ) 2c(x).Proof: Number V(A) = {1, . . . , n} in reverse topological order, i.e. for all(i, j) A we have i > j. For k V(A) with (p(k), k) E(A) let B(k) :={i < k : (p(k), i) E(A)} be the set of smaller siblings ofk, and let B(k) :=if k is the root of A. Let Ik :=

    jB(k){k} A

    +j, b(k) := max({0} B(k)) and

    s(k) := max({0} (A+k\ {k})).Let C :={

    nc(x) : Z, n

    n

    }. We compute the table TxA :

    {0, . . . , n} C xA {} defined as follows. LetTxA(0, 0) := 0, TxA(0, ) :=for allC\ {0}, and fork = 1, . . . , nlet TxA(k, ) be an optimum solutionof

    max

    iIk i : i= (T

    x

    A(b(k), ))i for i jB(k) A

    +

    j, C,i= (T

    xA(s(k),