Manuscript Offprint
arXiv:2610.41187Multiple Swap Local Search Approximations for Uniform-Cost Capacitated Facility Location with Extensions to Outliers
Abstract
We study CAPACITATED FACILITY LOCATION, a fundamental clustering problem, in the setting of uniform opening costs and non-uniform capacities. We give a polynomial-time -approximation for this problem. Our algorithm is a multiple-swap generalization of the local search algorithm by Dabas, Garg, and Gupta (2024), who obtained a 3.732-approximation. The main technical contribution is the analysis of this natural multiple-swap local-search method: variants of this approach have been analyzed previously, but allowing larger swaps requires new grouping and counting arguments. We also show that a multiple-swap local search algorithm provides a -approximation for CAPACITATED FACILITY LOCATION WITH OUTLIERS, again in the same setting of uniform opening costs and non-uniform capacities. This is an improvement over the 6.372-approximation, again by Dabas, Garg, and Gupta. Finally, we show that the factor 3 is tight for our local-search framework, and that the same multiple-swap idea does not improve the known locality gap for the non-uniform opening-cost setting.
1 Introduction
Facility location problems are among the most extensively studied models in operations research and clustering. At a high level, the goal is to place service providers and connect clients to these service providers while minimizing costs. In this paper, we focus on the case where each facility can only serve a limited number of clients. Specifically, in the CAPACITATED FACILITY LOCATION PROBLEM (CFL), we are given a finite collection of points that is partitioned into subsets (the clients) and (the facilities) along with metric distances . Each has an associated opening cost and capacity .
The goal is to select some facilities and an assignment satisfying for each while minimizing . That is, we want to minimize the cost of opening all facilities plus the cost of connecting clients to their prescribed facilities. We emphasize that we are only allowed to open each facility once, i.e. we consider the hard-capacitated setting.
For a given , finding the cheapest assignment can be done in polynomial time by solving a minimum-cost transportation problem: throughout this paper we let denote any one particular minimum-cost assignment for . For brevity, for any we define
So, compactly, the goal is to find minimizing cost(). Following a series of work on this problem (see Section 1.2), Bansal, Garg, and Gupta [4] gave the current-best approximation for CFL with an approximation guarantee of 5.
In this paper, we focus on the special case of CFL where all facilities have the same opening cost. That is, in CAPACITATED FACILITY LOCATION PROBLEM WITH UNIFORM OPENING COSTS (U-CFL) there is a single value such that for each . Prior to our work on this problem, the best approximation algorithm was a 3.732-approximation by Dabas, Garg, and Gupta [5] using a local search algorithm. We still consider non-uniform capacities, it is just the opening costs that are identical.
Finally, we also consider on the case where not all clients need to be connected in a solution. In the CAPACITATED FACILITY LOCATION WITH OUTLIERS problem, we are additionally given a value indicating the number of outliers permitted by a solution. In a solution, we only need to connect clients to open facilities, the remaining clients are discarded at no cost. Note that given , we can find cheapest assignment that assigns at least clients to in a capacity-respecting fashion in polynomial time, again by solving a minimum-cost transportation problem where we include a dummy node that can accept up to units of demand with no cost. Let be the clients that are discarded and the assignment satisfying in the best solution for .
Again, we let cost() denote the cost of the cheapest assignment that discards at most clients, it will be clear from the context when we are referring to the version of CFL with outliers and when we are not. Let U-CFL-O denote the variant of CFL with uniform opening costs and outliers. The best approximation for U-CFL-O prior to our work is a 6.372-approximation based on local search [5].
Theorem 1. There is a -approximation for U-CFL for any constant .
Theorem 2. There is a -approximation for U-CFL-O for any constant .
Of course, Theorem 2 subsumes Theorem 1. We first prove Theorem 1 as both a warm up to the ideas and because we follow the framework set out in [7] for adapting local-search based approximations for uniform opening cost facility location problems to the extension with outliers.
As in [5] and many previous algorithms for CFL, our algorithms are based on local search. At a high level, our local search algorithm begins with and iteratively considers one of two operations: either adding a single facility and recomputing the optimal assignment, or adding a set to , where contains at most a constant number of facilities, and closing an arbitrary number of facilities from while limiting the assignment-cost recalculation to optimally reassign clients in to . Specific details are described in Section 2. Note that our algorithm is a natural extension of the algorithm in [5]: it attempts to open a large constant number of facilities in the swap operation, instead of just one or two as in their U-CFL and U-CFL-O algorithms, respectively. This larger-swap operation is natural to consider, but its analysis requires new grouping and counting arguments. In contrast to previous multi-exchange local-search approaches such as [4, 12], where the local moves are organized around opening or closing a single facility and then using an auxiliary optimization problem to choose the corresponding set of facilities, our swap operation directly allows a large set of facilities to be opened in a single move while identifying a suitable set of currently open facilities to close. We believe that this analysis, together with our improvement and extension of the outlier framework of [7] to the capacitated setting, may be useful for studying related facility-location variants.
We show a locally-optimal solution has cost at most times the optimum solution's cost. Theorem 1 is obtained by selecting large enough as a function of and using a standard trick to ensure the algorithm only uses a polynomial number of local search steps. In Section 5, we also show that this factor is tight for our local-search approach, and that the analogous multiple-swap method does not improve the known locality gap for non-uniform opening costs.
As with most local search algorithms for CFL, our analysis considers an exchange graph, namely the one described in [5]. In their argument, they bound the opening costs of facilities in one of two ways. The opening costs of facilities in that are leaves in the exchange graph are bounded using swap operations that only open one new facility and close all leaves connected to . The opening costs of facilities in that are internal nodes in the exchange graph are bounded using a simple counting argument (recalling that opening costs are uniform) which does not require any test swaps. Our improvement comes from grouping many swaps together to bound the opening cost of leaves and also "low-degree' internal nodes. We also rely on a counting argument to ensure the unaccounted facilities in (having high degree in the exchange graph) to bound the number of high-degree facilities in to where is some fixed optimal solution. The precise details are a bit more involved since it also requires careful handling of low- versus high-degree nodes of the optimum solution as well in the exchange graph and a second, unrelated counting argument is used even in the analysis of the test swaps.
Finally, to prove Theorem 2 we use the framework in [7] to group together swaps used in our algorithm for U-CFL to prove, with a larger but still constant value , that the same set of local search operations (appropriately generalized to the outliers case) yield a -approximation for U-CFL-O. Note that there is no black-box result that can be cited from [7] as they merely provide a template for adapting local search to handle outliers and show its effectiveness on key examples. We are demonstrating that an appropriate adaptation works in our setting, though the adaptation is not immediate. We view the resulting grouping technique and its extension to the outlier setting as potentially useful building blocks for future local-search algorithms for related facility-location variants.
1.2 Previous Work
The case of uniform opening costs we consider here was first explicitly studied by Levi, Shmoys, and Swamy who gave a 5-approximation based on rounding an LP relaxation [9]. Then Aardal, van den Berg, and Gijswijt gave a 4.562-approximation based on local search [1]. Kao revisited LP rounding to give a 4-approximation [8]. Finally, Dabas, Garg, and Gupta demonstrated that local search can be used to get a 3.732-approximation [5] which is the best approximation prior to our work.
For general CFL, the first constant-factor approximation for CFL was given by Pál, Tardos, and Wexler [11] and was subsequently improved by Mahdian and Pal [10] (for the more general UNIVERSAL FACILITY LOCATION problem) and then by Zhang, Chen, and Yi [12]. Later, Bansal, Garg, and Gupta gave the current-best algorithm with an approximation ratio of 5 [4]. While the natural LP relaxation for CFL with non-uniform opening costs has an unbounded integrality gap, approximation algorithms based on stronger LP relaxations were first given by An, Singh, and Svensson [2] and later improved to a 9.0927 LP-based approximation by Kao [8].
The only non-bicriteria previous work on CFL with outliers is the aforementioned 6.372-approximation in the case of U-CFL-O by Dabas, Garg, and Gupta [5], while Dabas and Gupta provided a bicriteria algorithm for CFL with outliers/penalties [6]. As mentioned earlier, Friggstad et al. give a template that helps convert local search algorithms for uniform-cost facility location problems to the variant with outliers [7], though they only show it works in the facility location problems without capacities.
2 The Local Search Algorithm for U-CFL and the Exchange Graph
In this section and the next, we focus on U-CFL. The details for U-CFL-O are presented in Section 4. Throughout, we assume is at least the number of clients that are required to be served, i.e. at least for U-CFL and at least for U-CFL-O, otherwise there can be no feasible solution.
Our local search algorithm maintains some , initially setting itself. In each iteration, it tries one of the following operations:
-
: If there is some such that , we update .
-
: Consider some with and some . Suppose we first close (i.e. remove from ) and then open , noting any remains open. Then we compute the optimal way to assign all clients from their current location to while ensuring each receives at most clients. If this results in a solution cheaper than , we update .
If there are multiple choices for such an operation, we may choose any. We emphasize that after some application of , we still recompute for the new in preparation for future iterations, but determining if can be performed depends only on the reassignment of to .
Concerning the running time, we first explain how a single iteration of the local search algorithm can be executed to run in polynomial time. We can simply enumerate all and compute in polynomial time to determine if such an operation would find a cheaper solution. Searching for an admissible operation is more involved. There are subsets to be tried, we enumerate them all. Then we solve an auxiliary optimization problem to find the best , i.e. the set that would lead to the most improved solution after reassigning optimally to , accounting also for the change in opening cost. This can be viewed as a variant of the multiple knapsack problem where every item (i.e. center that we may consider closing) has polynomially-bounded integer demands that can be integrally split between multiple knapsacks. A standard dynamic programming algorithm is used to find the best in time. The full details appear in Appendix Appendix A.
While each iteration runs polynomial time, it is not clear that a local optimum will be reached after polynomially-many iterations. The usual trick works here. Namely, our analysis uses at most “test swaps” so if we limit ourselves to operations that only find solutions with cost then we only lose an -factor in the approximation guarantee. The number of iterations is now polynomial since every iterations will result in the cost dropping by a constant factor. These details are entirely standard in local search analysis and are omitted.
From now on, let be a local optimum solution and be any fixed optimal solution to the U-CFL instance, recall that and denote optimal client assignments in the respective solutions. Throughout we let be the opening cost and be the assignment cost of solution . Similarly, let and
The Exchange Graph
As in many previous works on CFL, we use an exchange graph to analyze the local search procedure. In our case, we use the exchange graph introduced in [5], who build off of the exchange graph used in [11]. That is, in [5] a bipartite graph is described where each has a copy on each side of . We adopt the convention that when we refer to an edge that and . Additionally, integer values for are also given. The graph and the vector have the following properties
(i) is a forest.
(ii) .
(iii) for and for .
(iv) For each , and one of these copies of in is a leaf.
Here, denotes the standard graph-theoretic cut set. At a high level, and are constructed by solving a minimum-cost transportation problem sending clients from each to so each receives clients. Edges are the support of an optimal solution, which can be taken to be acyclic by cycle-shifting arguments. The assignments and can be used to describe a transportation solution with cost at most , so the optimal transportation solution is no worse. Finally, that one copy of each is a leaf follows because we can assume an optimal solution sends clients from to its copy in , thereby making one of them a leaf node.
3 U-CFL Analysis
As in [5] and most other local search work in CFL, the following holds simply because no add operation results in a better solution.
Lemma 3 (Lemma 4.1, Arya et al. [3]).
We remark that this analysis requires at most “test swaps”, one per . In [5], the bound is given leading to a bound of . A facility cost rescaling trick is used to get their final approximation guarantee of 3.732.
Here is where we deviate in our analysis. For some constant such that is an integer, we now set . We prove
Theorem 4.
From this, we get (for sufficiently small ). This completes the proof of Theorem 1 after shrinking by a factor of 9.
Theorem 4 is proven by identifying a collection of at most different operations based on the exchange graph. Consider a component of . There must be some facility in in this component, otherwise it is a singleton component corresponding to some with so would be an improving operation as the cost would decrease by exactly for closing . We view each component of as being rooted at some facility in .
Let be the facilities in that are leaf nodes in . For each , let be the children of . Let and , this partitions into facilities with a “small” number of children and a “large” number of children. In a similar but not identical manner, we define and partition into facilities with a “small” number of non-leaf children and a “large” number of non-leaf children.
Lemma 5.
Proof. This is simply because every has at least children in . This does not double-count, i.e. for any distinct .
All that is left is to bound the opening cost of . To do this, we consider the subgraph of obtained by deleting (only the copy from but leaving the copy in if it was in both), i.e. the induced subgraph . Each component of can still be viewed as being rooted in since the original trees of were and we only deleted nodes in . We will decompose into subtrees with limited overlap, each containing at most nodes from .
Let denote the layers of nodes of in the trees of . That is, is all root nodes in and, inductively, for we have is all grandchildren of nodes in . For some , consider . Since the partition , there is some such that , fix any such .

Figure 1: A decomposition of into subtrees (the leaves added to form are not depicted) for . Nodes in layer labeled by some in , nodes between these layers are in . The grey nodes are in (using ) and the black node is in . The subtrees are indicated by dashed contours, each node in is the root of exactly one subtree, the only node in is the root of three subtrees. If we used instead, then we would still have the top node in by construction.
Now, for each consider the maximal subtree of rooted at that does not contain any internal nodes from . That is, consider all nodes encountered in a depth-first search in the subtree under that does not recurse deeper from another node in . Let denote this subtree. Note each has depth at most and the only node in that can have more than children in is itself, but only if .
Next, for each we create subtrees of as follows. Consider the children of in , i.e. . Arbitrarily partition these children so that each part has size exactly except, perhaps, the last part which has size at most . For each part of the partition, we consider the subtree of rooted at but only including the subtrees rooted at children in that part .
Let be the collection of subtrees of created this way, one per part of the partition. Note can only happen if . Each tree in has height at most and each node has at most children, so the number of nodes is at most . Finally let denote all such trees created this way. Observe each appears in at least one tree in and can only appear in multiple if . This construction is depicted in Figure 1.
Finally, for each pick a single tree in that contains the parent of and add along with its only incident edge to this tree. Let denote these final trees, each tree in is a tree in with, perhaps, some leaves in appended to it. By construction, each appears in precisely one tree of : if it was only included in the final formation of from and if it was an internal node for precisely one tree in . Finally, we note each edge of the original exchange graph itself is contained in at most one subtree, in fact in exactly one subtree if and only if .
Consider a tree and, for brevity, let and . As noted above, has at most nodes not in , so meaning the cost change calculated in is nonnegative as is a local minimum.
The optimal cost of reassigning to in is upper bounded by the following reassignment. Note that each has each of its neighbours in by construction of the subtrees. That is, if then . Hence it is feasible to move all of to for each by property (3) of from Section 2. The cost of this reassignment is at most . Summing over all , the reassignment cost is at most the total -weighted distance of the edges of contained in this subtree.
Recalling no such swap will result in an improved solution by local optimality of , summing over all subtrees and using property (2) of from Section 2 shows:
Here, each has been counted once in the first term when it is a non-root of the corresponding subtree in and is counted as many times in the sum as there are subtrees rooted at in . Each is only opened times, once for each subtree for which it is the root, because it is not in any tree in rooted at a shallower node. Its contribution to is offset by its negative contribution to .
There is a subtlety in how the opening costs are considered for some . By property (4) of , we have and one copy of in is a leaf. If is a leaf, then the swap that closes it also opens its parent : the appears in front of for this swap and the is accounted for in the term . But there may be other swaps involving , i.e. if is in or . Since is already open when for these swaps, the upper bound on cost calculated by for these swaps does not include the for this . However, it is safe to include its contribution in the sum because this is an upper bound. If is a leaf then the only actual swap is when is closed as and, again, the for closing is offset by the for opening in the upper bound.
The final step is to bound the sum using a counting argument.
Lemma 6.
Proof. If then ; it could be zero if there are no non-leaf children of in . So .
For , . Since each is the child of exactly one facility in , which completes the proof.
Applying this to (1) and rearranging shows
Applying Lemma 5 to the preceding inequality gives
which completes the proof of Theorem 4.
4 U-CFL-O Algorithm and Analysis
Recall that for each , we can compute cost() along with an optimal way to discard at most clients and assign the remaining clients to in polynomial time. We let denote the clients that are discarded and be the assignment of the rest. Of course, we assume as otherwise we may discard all clients. Given this, we may then assume as well since we could always discard clients until exactly are discarded without increasing the cost of a solution.
The local search operations we consider are the following. Let be some constant that we will fix later.
-
for : This operation is the same as in Section 3, with the understanding that our computation of cost() is now for the outliers case.
-
: For with and , this operation first closes and then opens as before (leaving any open). It then finds an optimal way to assign some clients in to while discarding the rest as outliers, and to connect some clients in to , while ensuring that the number of outliers remains at most . The clients that are reassigned to pay the additional distance from to their new facility in when we compute the cost of this reassignment. We show how to compute the optimum swap operation of this form in polynomial time in Appendix Appendix A.
As before, let now denote a local optimum solution, a global optimum solution, and the respective client/facility costs of these solutions. We emphasize and are the outliers in the respective solutions, that , and that are the assignments of the non-outliers in the respective solutions. We assume , as would still be a local optimum in the instance with removed and adjusted to , and would still be a global optimum solution in this adjusted instance. Finally, for each , let , i.e. the clients assigned to in the local optimum solution that are outliers in the global optimum. Similarly for , let .
The bound on the assignment cost of a locally optimal solution obtained from the operation follows from previous work, and is very similar to the classic argument in CFL.
Lemma 7 (Lemma 6 in [5]).
Dabas, Garg, and Gupta introduce a slightly different exchange graph for their outlier analysis; we use that exchange graph. Here, is a bipartite graph, and we have integer values for . We state this slightly differently, but it follows directly from their construction (say, by deleting the dummy nodes introduced for outliers and simply handling the outliers explicitly in property (2) below). The properties of in this case are
(i) is a forest.
(iv) For each , and one of these copies of in is a leaf.
The total cost of the exchange graph is at most . Again, this follows immediately from their construction. Our phrasing is just a different view that is convenient for our algorithm.
4.1 Bounding the Facility Cost
If we were to form test swaps in the same way as in our analysis of U-CFL but also apply the outlier changes associated with each swap, then the main reason we cannot use them to generate a similar bound on is that the number of outliers used in the analysis of the swaps may exceed . To fix this, we use the idea from Friggstad et al. [7] to combine the test swaps into larger groups each of which uses outliers. There may be some overlap in these groups, but it will be limited enough to get an effective bound on .
Let be the same constant as in the previous section; we will eventually set to be a constant larger than . Almost everything from the previous section still works here. We define as before and we still get the bound , i.e. Lemma 5 works without adjustment in our setting. We form by deleting the nodes (keeping their copies in if they are there), select and form , and decompose into subtrees as before using this same value of . Lemma 6 holds without modification.
We now consider outliers. For each tree we create two sets and as follows. For each , pick any single tree with and add to . For each with , pick the unique tree with and add to . Note the latter step only considers clients that are assigned to a small facility in . Therefore, partitions and is a partition of a subset of . Clients not in a part (i.e. assigned to some by ) are effectively ignored in the rest of this proof. The idea is that when we swap facilities in , and will be the clients that change their outlier status in this swap.
We first consider what happens if we try to perform the swaps based on and their associated outlier sets. That is, if we were to close all and open all as before, we could upper bound the reassignment cost as follows. We could first make outliers and each could be assigned to instead. The remaining clients located at centres in could be reassigned as per the -values on the edges as in the previous section. If this left at most outliers, then this reassignment would place a valid upper bound on , and the cost analysis would be the same as in the previous section, except for the cost change for outliers, which is handled by property (2) of the exchange graph in this section.
To fix the issue that this way of analyzing swaps might not be “balanced” in terms of the outlier difference, we follow a strategy similar to that of [7] by merging swaps, though there are some differences.
4.2 Grouping Subtrees
First, we partition into groups as follows. Initially, let each be in a group of its own. Then, while there are two groups having at most facilities from , merge them. Afterwards, if there is a group that has fewer than facilities from , merge it with any group (there must be another group, otherwise so local search would have trivially found the optimal solution). Each group now has between and facilities.
Let be the resulting partition. Each is a collection of trees from . We use the notation to denote the that appear among the trees in and to denote the that appear at least once among the trees in . Let and . Finally, let . The idea is that if we were to perform and bound the cost using the tree edges plus connecting and letting be outliers, the number of outliers would be . Thus, if , this would lead to a valid reassignment. We also let
Note no is in more than one set of the form since it appeared in at most one subtree .
Let , and . We first show how to derive a bound on the reassignment cost by using swaps in .
Lemma 8. If , then for each we have
Proof. Note that , so we can consider . This opens each and closes each . If some is in both sets, we may regard it as both closed and then opened, so it contributes to both sides of the bound to be proven.
To bound the optimal reassignment cost for this swap, we move clients to their open facility in and have clients now be outliers (we save their connection cost in , but that is not needed for the bound). The remaining clients in are reassigned according to , so exactly clients are moved from to for each and this accounts for all client movement. This is a feasible reallocation because all edges incident to each are in , meaning all corresponding are opened. Together with property (3) of , this guarantees there is enough room in each to accommodate all incoming clients (the ones being reassigned from and the ones in being assigned there). Since this places an upper bound on the optimal reassignment and since the swap operation did not result in a cheaper solution, the bound follows.
If , i.e. all parts were balanced, we would be done because summing this bound over all would make the left-hand side sum to exactly , the first term on the right would be as before, and the sum over would be at most the -weighted cost of , which, along with the total outlier bound, is at most . That is, we would get the exact same bound as in the non-outliers setting. In the next section, we discuss how to handle the case when there are some imbalanced parts.
4.3 Managing the Imbalanced Parts
Finally, we fix . Suppose, for now, that , i.e. all have and hence are accounted for in . In [7], a bipartite graph with sides , and a bijection is constructed. We use the following properties of this construction:
- The graph Q is a caterpillar, i.e. a single “central” path plus some leaf nodes appended to the path.
• For each , the parts and with and are either equal or are connected by an edge in .
- The edges of Q admit a natural linear ordering: the edges of the central path are ordered according to an arbitrary direction of the path, and all leaves incident to an internal part P are ordered arbitrarily between the two path edges incident to P.
-
For any group , let be the parts incident to edges of . The boundary parts , namely those incident to edges outside , satisfy .
-
The local facilities in decompose into consecutive blocks in the left-to-right ordering. By the construction of , each block is incident to a single group , and different blocks are internally disjoint, overlapping only possibly at boundary local facilities. Let be the set of facilities in the blocks incident to , excluding the two boundary facilities.
See Figure 2 for an illustration of and some concepts defined below.

Figure 2: The caterpillar graph . The central path is depicted with bold, the ordering of the edges is depicted "left to right". Groups formed using are delimited by dashed lines, the shaded nodes correspond to parts that are in at least one boundary set .
In our case, we only have that . Still, the exact same construction works except is only guaranteed to be one-to-one but not necessarily onto. This is a straightforward verification, the details are skipped.
Label the edges of according to this ordering as . Finally, partition these edges into groups of consecutive edges except the last group, which should have between and edges (if the number of edges was less than , then so the -swap algorithm would have found an optimal solution). Call these groups .
For a group , let be all edges of appearing in the parts of , and consider
This operation opens every facility of that appears in a tree contained in a part of , and closes every facility of in except those lying in a boundary part but not in . Note that since there are at most parts in each and each has at most facilities in . To bound the cost change, consider the following reassignment:
-
For every with as well, make an outlier and instead connect to , which is now open.
-
All other with are redistributed according to to open facilities.
Recall that, for every facility that is closed, all of its neighbours in are opened because the groups are, ultimately, unions of trees . Thus the redistribution is valid. Also note that, for every that is closed, each has open because we only close facilities if every neighbour (in ) of its part is also involved in the swap. Thus, for every outlier we create we also reclaim one; therefore, the number of outliers after this reassignment has not increased. The cost of the described reassignment places an upper bound on the test swaps' cost. Let denote the set of all boundary facilities, that is B'_B = (\bigcup_i B_i) \setminus \left( \bigcup_{G_i} B'_G_i \right). We immediately get the following bound:
where we have, again, ignored the savings from no longer assigning .
Now the only facilities that are never closed are the facilities in . The maximum number of such intervals over all groups is at most , and thus the maximum number of facilities that are never closed is at most . Then
Summing over all groups, we almost get the same bound as in the case of U-CFL. The only difference is that some parts are opened multiple times, i.e. whenever they are part of some . But in every group, at least parts are not boundary parts. Since each part has size between and , in each group the number of facilities of in one of the at most two parts in is at most and the number of facilities of (counted with multiplicity if they lie in multiple parts in the group) is at least .
Therefore, the total number of facilities we swap in over all boundary parts is at most
where the last inequality follows from the analysis of U-CFL.
To conclude, if we sum (2) over all groups and apply Lemma 8 to , we get
recalling property (2) of H when aggregating all of the charges to x and outlier connections.
Rearranging and adding the bounds , and shows
as required.
5 Tight Examples for Local Search
We have a simple example showing that our local search analysis is tight; see Figure 3. The circles and rectangle are facilities, and the triangles are clients. All facilities have opening cost 2, and the two circle facilities form a local optimum. Adding a facility does not decrease the total cost. Moreover, a swap operation also does not decrease the total cost: if we open the rectangle and close the two circle facilities, we save 2 in opening cost, but rerouting the two clients from the circle facilities to the rectangle has total cost 2. Thus, there is no decrease in the total cost.
The local optimum has cost 6: opening the two circle facilities costs 4, and the routing cost is 2. The optimal solution has cost 2: opening the rectangle costs 2, and the routing cost is 0. Thus, the ratio is 3.
One might argue that the swap operation could save 2 in routing cost if the clients were reassigned directly from their locations. However, the algorithm in Appendix A that computes the optimal set
to close for a given subset of facilities to open measures the assignment cost change in moving a client from, say, to as rather than . That is why our swap operation for any constant would not find an improving swap in even in this simple example.

Figure 3: The tight example.
5.1 A Lower Bound for Non-Uniform Opening Costs
One can easily check that we can still efficiently search for an improving swap move even if the facility opening costs are non-uniform. So one might wonder if our approach yields improvements for this setting. Unfortunately the bad examples from previous work for local search for instances of CFL with non-uniform opening costs easily extend to give the same lower bounds for our multiple-swap algorithm. That is, our algorithm does not improve over the 5-approximation by Bansal, Garg, and Gupta [4] for CFL with non-uniform opening costs.
Figure 4 is a modification of the bad locality gap examples from [13, 4]. As in these papers, the rectangular boxes are unopened facilities, the circle boxes are the facilities opened in the local optimum solution, and the triangle boxes are client demands. For the rectangle boxes and circle boxes, the value above is the opening cost, and the value below is the capacity.
It is easy to see that opening a rectangle box does not decrease the solution cost. Consider any swap move that opens at most facilities; we can assume that . First, closing one circle facility and opening the rectangle below the circle together with any other non-root rectangle does not decrease the total cost: closing one circle saves 4, but rerouting from the circle to another non-root rectangle has cost 4. Therefore, this move does not decrease the total cost. Finally, if we open the root rectangle, then we would also open bottom rectangles and close all circles in the same subtree. This saves , but opening the root rectangle costs , and there is no saving in the connection cost. Thus, the circle facilities are indeed a local optimum solution.
Now, if we calculate the cost of the local solution, we have opening cost for the circle facilities and connection cost . For the optimal solution, the opening cost for the rectangle facilities is , and the connection cost is . Thus, the ratio is
As and , this becomes 5.

Figure 4: The tight example.
References
[1] K. Aardal, P. L. van den Berg, D. Gijswijt, and S. Li. "Approximation algorithms for hard capacitated k-facility location problems". In: European Journal of Operational Research 242.2 (2015), pp. 358–368. ISSN: 0377-2217 (cit. on p. 3).
[2] H.-C. An, M. Singh, and O. Svensson. "LP-Based Algorithms for Capacitated Facility Location". In: SIAM Journal on Computing 46.1 (2017), pp. 272–306. DOI: 10.1137/151002320 (cit. on p. 3).
[3] V. Arya, N. Garg, R. Khandekar, A. Meyerson, K. Munagala, and V. Pandit. "Local Search Heuristics for k-Median and Facility Location Problems". In: SIAM J. Comput. 33.3 (2004), pp. 544–562. DOI: 10.1137/S0097539702416402 (cit. on p. 5).
[4] M. Bansal, N. Garg, and N. Gupta. "A 5-Approximation for Capacitated Facility Location". In: European Symposium on Algorithms (ESA). Ed. by L. Epstein and P. Ferragina. Berlin, Heidelberg: Springer Berlin Heidelberg, 2012, pp. 133–144. ISBN: 978-3-642-33090-2 (cit. on pp. 1–3, 13).
[5] R. Dabas, N. Garg, and N. Gupta. "Capacitated Facility Location with Outliers and Uniform Facility Costs". In: Integer Programming and Combinatorial Optimization - 25th International Conference, IPCO 2024, Wrocław, Poland, July 3-5, 2024, Proceedings. Ed. by J. Vygen and J. Byrka. Lecture Notes in Computer Science. Springer, 2024, pp. 85–98. DOI: 10.1007/978-3-031-59835-7_7 (cit. on pp. 1–5, 8).
[6] R. Dabas and N. Gupta. "Uniform capacitated facility location with outliers/penalties". In: Discret. Optim. 55 (2025), p. 100878. DOI: 10.1016/J.DISOPT.2025.100878 (cit. on p. 3).
[7] Z. Friggstad, K. Khodamoradi, M. Rezapour, and M. R. Salavatipour. "Approximation Schemes for Clustering with Outliers". In: ACM Trans. Algorithms 15.2 (2019), 26:1–26:26. DOI: 10.1145/3301446 (cit. on pp. 2, 3, 9, 10).
[8] M. Kao. "Improved LP-based Approximation Algorithms for Facility Location with Hard Capacities". In: CoRR abs/2102.06613 (2021). arXiv: 2102.06613 (cit. on p. 3).
[9] R. Levi, D. B. Shmoys, and C. Swamy. "LP-Based Approximation Algorithms for Capacitated Facility Location". In: Mathematics of Operations Research 35.4 (2010), pp. 739–755. DOI: 10.1287/moor.1100.0461 (cit. on p. 3).
[10] M. Mahdian and M. Pál. "Universal Facility Location". In: Proceedings of the European Symposium on Algorithms (ESA). 2003 (cit. on p. 3).
[11] M. Pál, É. Tardos, and T. Wexler. "Facility Location with Nonuniform Hard Capacities". In: 42nd Annual Symposium on Foundations of Computer Science, FOCS 2001, Las Vegas, Nevada, USA, October 14-17, 2001. IEEE Computer Society, 2001, pp. 329–338. DOI: 10.1109/SFCS.2001.959907 (cit. on pp. 3, 4).
[12] J. Zhang, B. Chen, and Y. Ye. "A Multi-exchange Local Search Algorithm for the Capacitated Facility Location Problem". In: Integer Programming and Combinatorial Optimization. Ed. by D. Bienstock and G. Nemhauser. Berlin, Heidelberg: Springer Berlin Heidelberg, 2004, pp. 219–233. ISBN: 978-3-540-25960-2 (cit. on pp. 2, 3).
[13] J. Zhang, B. Chen, and Y. Ye. "A Multiexchange Local Search Algorithm for the Capacitated Facility Location Problem". In: Math. Oper. Res. 30.2 (2005), pp. 389–403. DOI: 10.1287/M00R.1040.0125 (cit. on p. 13).
Appendix A Finding the best swap(S', T) Operation
Lemma 9. Given with , we can find some minimizing the cost change of swap(S', T) in the U-CFL algorithm in time.
Proof. Consider an arbitrary ordering of . In this proof, all vectors we consider will have dimension (with indices corresponding to ) and hold nonnegative integer entries. For two such vectors and , we let indicate the bound holds pointwise at each coordinate. Also let be an arbitrary ordering of itself. Our goal is to decide which of these to close and reroute to .
We use dynamic programming; for each and each vector with , let be the cheapest way to close a subset and reroute to ensuring each receives at most clients this way. Of course, the final solution will be where for each .
For brevity, for each we let be all vectors such that . That is, all possible ways to redistribute the clients currently assigned to to other locations in . Note,
. For each , let be the total cost of moving the clients currently assigned to to according to .
That is, if there are no further facilities in to consider then we just have to account for the opening cost of the facilities in that are not already open. If as well then it is already open so we just try all possible reassignments of its clients. Finally, if then we either try keeping it open or try closing it and then trying all possible client reassignments. We comment that it could be that in the two recursive cases that there is no with , i.e. the leftover capacity is not able to accommodate all clients in . In this case, an empty min takes the value .
Since there are subproblems and each takes time to process, the total running time is . The recurrence only computes the minimum possible value, but the optimal T for a swap move can be recovered through an optimal trace through the dynamic programming table.
Lemma 10. Given with we can find some minimizing the cost change of swap in the U-CFL-O algorithm in time .
Proof. Let be the vector of capacities of facilities in . First, we guess vectors with nonnegative integer vectors, i.e. such that . The algorithm returns the best solution computed over all capacities.
For a particular guess, we compute a minimum-cost partial mapping from to such that exactly clients from are mapped to . If there is no such assignment, i.e. , then we skip this guess.
Finally, we run the dynamic programming algorithm from the previous proof with minor modifications. We start with initial capacities and we carry an additional parameter that is initially (the number of outliers we reclaimed via ). That is, we let be the cheapest way to assign clients in to (respecting capacities ), allowing for of them to be outliers instead.
The recurrence in this case is nearly identical to the previous Lemma except we also guess in each step how many clients from to make outliers and adjust the parameters appropriately when we recurse. The straightforward details are omitted