Manuscript Offprint
arXiv:2610.23348Simpler Algorithms for Capacitated -Median with -Violations Using New Inequalities
Simpler Algorithms for Capacitated k-Median with -Violations Using New Inequalities
Han Dai *
School of Computer Science,
Nanjing University,
Nanjing, Jiangsu Province, China.
Shi Li *
School of Computer Science,
Nanjing University,
Nanjing, Jiangsu Province, China.
Abstract
We revisit the capacitated k-median problem, focusing on constant-factor approximation algorithms with either -cardinality or capacity violations. Previous results [17, 28] achieve an -approximation with -violations via complex extended configuration linear programming formulations with the round-or-cut framework.
We propose a simpler, unified round-or-cut framework that handles both cardinality and capacity violation settings. Our main technical contribution is a mechanism that directly utilizes the costs of local instances to generate valid inequalities. Specifically, we partition the metric space into local pieces of size as in previous work, and construct instances of capacitated clustering with penalties, which allow client demands to be unserved at a penalty cost. Solving these local instances yields lower bounds on the original LP cost, yielding valid LP constraints. In contrast, previous approaches rely on complex extended configuration LPs over connection variables 's and opening variables 's.
As a secondary contribution, our approach achieves an improved running time of , bypassing the exponential dependence on required to solve the previous extended configuration LPs. Instead of solving the local instances optimally in time exponential in , we obtain -approximate solutions in time. Finally, for the cardinality-violation setting, our algorithm opens a set of at most distinct facilities, and thus gives a bicriteria approximation in the hard-capacitated setting. In contrast, the algorithm of [28] may open the same facility multiple times.
When for all , the CKM problem reduces to the classic (uncapacitated) k-median problem. Following the first constant-factor approximation algorithm by Charikar, Guha, Tardos
The work of HD and SL is supported by State Key Laboratory for Novel Software Technology, and New Cornerstone Science Foundation.
and Shmoys [13], a long line of work has progressively improved the approximation ratio [21, 22, 30, 7, 8, 20, 11, 4, 16, 25, 26], including recent [15, 6]. On the negative side, it is known to be NP-hard to approximate the problem within a factor better than [23, 24].
In contrast, obtaining a true constant-factor approximation for the capacitated k-median (CKM) problem remains a notoriously hard problem in approximation algorithms. The current best approximation ratio is [2], achieved via the metric tree-embedding framework of Fakcharoenphol, Rao, and Talwar [18, 19]. Consequently, most prior work focuses on bicriteria approximation algorithms, which allow constant-factor violations on either the number of open facilities (the cardinality constraint) or the facility capacity constraints.
For the uniform capacitated k-median problem—where all facilities have the same capacity—Charikar, Guha, Tardos and Shmoys [12] gave a 16-approximation with a capacity violation factor of 3. Later, Li [27] presented an -approximation with a -capacity violation. For the general capacity setting, Chuzhoy and Rabani [14] obtained a 40-approximation with a capacity violation factor of 50. Byrka, Fleszar, Rybicki, and Spoerhase [5] subsequently achieved a constant-factor approximation with a -capacity violation. On the cardinality-violation front, Aardal, Berg, Gijswijk and Li [1] designed a -approximation algorithm that opens at most 2k facilities (a factor-2 cardinality violation).
Most bicriteria approximations for CKM rely on linear programming (LP) relaxations. However, the natural LP relaxation has an unbounded integrality gap, even if one permits up to a -violation on either the cardinality or capacity constraint. Thus, to achieve an -approximation via standard LP formulations, a violation factor of at least 2 is necessary—a barrier that holds even for uniform capacities.
Li [29] was the first to break this factor-2 barrier, proposing an -approximation algorithm for uniform CKM with a -cardinality violation. To overcome the integrality gap, Li introduced an exponential family of rectangle inequalities. Because separating these inequalities efficiently is non-trivial, Li employed a round-or-cut framework: given a fractional solution that only satisfies the basic constraints, the algorithm either rounds it to an integer solution with cost at most times the value of the LP solution (round), or identifies a violated rectangle inequality (cut). Coupled with the Ellipsoid method, this yields a polynomial-time -approximation. Li [28] subsequently extended this framework to general capacities, achieving an -approximation under a -cardinality violation—providing an exponential improvement in the approximation ratio's dependence on . Since rectangle constraints fail in the general capacity setting, the approach in [28] instead constructed exponentially many extended configuration LP relaxations with auxiliary variables.
Similarly, in the capacity-violation setting, Byrka, Rybicki, and Uniyal [9] developed an -approximation algorithm for uniform CKM with a -capacity violation. Demirci and Li [17] generalized this result to arbitrary capacities, achieving an -approximation with a -capacity violation using extended configuration LPs in [28]. Together, these results establish optimal -violation factors in both settings, leaving the existence of a true -approximation as the primary remaining open problem.
Regarding the running time, the uniform-capacity algorithm of [29] runs in time, whereas the uniform-capacity algorithm of [9] and the general-capacity algorithms of [28] and [17] run in time. Furthermore, there is a distinction between the soft-capacitated setting (where multiple copies of a facility may be opened, each counting toward ) and the hard-capacitated setting (where each facility can be opened at most once). Notably, the state-of-the-art results for the cardinality violation setting [28] apply only to the soft-capacitated variant.
1.1 Our Results
We present a simplified and unified bicriteria approximation framework for the capacitated -median problem with hard capacities, addressing the -cardinality and -capacity violation settings. Throughout, denotes the total number of facilities and clients, and opt denotes the optimum cost of the CKM instance, without any violation.
Theorem 1.1. For any constant , there exists a poly-time algorithm that, given a hard capacitated -median instance, outputs a solution opening at most facilities while satisfying all capacity constraints, with cost at most .
Our second main result addresses the capacity-violation setting.
Theorem 1.2. For any constant , there exists a poly-time algorithm that, given a hard capacitated -median instance, outputs a solution opening at most facilities while connecting at most clients to each open facility , with cost at most .
| Capacitated -Median | |||||
|---|---|---|---|---|---|
| Capacity | Approx. factor | Facility violation | Capacity violation | Run time | Reference |
| Soft | Li [28] | ||||
| Hard | Demirci and Li [17] | ||||
| Theorem 1.1 | |||||
| Theorem 1.2 | |||||
Table 1: For Theorem 1.2, the capacity bound in the final integral assignment is for each open facility .
Compared with [28, 17], our main contribution is to generate valid inequalities from local penalty instances, thereby avoiding the explicit use of extended configuration LPs and improving the running time to .
1.2 Our Techniques
We now present the key ideas behind our simplified framework. To illustrate our core intuition, consider the integrality gap of the basic LP relaxation (LP(1)) in the cardinality-violation setting. Suppose we have two facilities, and , and clients co-located at the same point, where for some large integer . The LP can fractionally open facilities from to serve all clients at cost 0. By taking disjoint copies of this gadget, the LP can open fractional facilities in total at cost 0. However, any integer solution must open facilities to achieve cost 0, requiring a cardinality violation factor of , which approaches 2 for large .
More generally, a CKM instance can consist of far-apart “islands”, where the LP solution opens fractional facilities per island for some small integer . Under a -cardinality budget, we cannot afford to open facilities on each island. Thus, one must guarantee that each island’s subproblem admits a small-cost integral solution with at most z open facilities. While rectangle inequalities suffice for uniform capacities [29], the general capacity setting becomes significantly more intricate: Li [28] introduced auxiliary variables to encode every valid configuration of open facilities on each island (up to size ), leading to a heavy configuration LP. The capacity violation setting exhibits a similar complexity behavior.
We take a simpler, direct approach. Rather than constructing complex extended LPs, we solve the local instance on each island directly to establish a valid lower bound on its client connection cost, and then enforce this bound via a valid linear constraint. To handle the more general case where a small fraction of demands from clients may be satisfied outside their local island, we formalize each local subproblem as a capacitated clustering with penalty problem, where unserved client demand incurs a penalty proportional to the distance from the island to outside. Furthermore, by approximating these local penalty instances within an factor instead of solving them optimally, we reduce the running time from to .
Our island construction follows the spanning tree framework of prior work [29, 28, 9, 17]. Given a fractional solution to the basic LP, a filtering step selects a set of representative clients, and all demands are moved to representatives at a small cost. We then run Kruskal's algorithm on these representatives to build a Minimum Spanning Tree (MST) and color its edges in black, gray, and white. The resulting black components (maximal connected subtrees of black edges) form our islands. For each black component, we define a family of capacitated clustering instances with penalty, parameterized by the number t of open facilities. We solve these instances approximately and use the resulting lower bounds to generate valid LP constraints. As in previous work, the construction of black components depends on the LP solution. Thus these valid constraints cannot be fixed a priori, necessitating the round-or-cut framework.
Finally, our rounding procedures for both the cardinality- and capacity-violation settings follow a similar framework. We first construct a local fractional solution for each black component by combining the LP solution with our local penalty solutions. Next, we partition the black components into groups, each containing fractional open facilities, ensuring that demand within each group can be satisfied internally with a -violation. We then formulate an auxiliary LP over these local solutions. The structure of this auxiliary LP guarantees that in an extreme solution, each group contains strictly fractional facility variables. A -violation provides just enough slack to round these residual fractional facilities to integers at low cost. The specific constructions of local solutions and group partition schemes vary between the two violation settings and are motivated by previous work.
Organization In Section 2, we give a common algorithm for cardinality-violation and capacity-violation settings. In Section 3, we give the -approximation for the capacitated k-median problem with open facilities, proving Theorem 1.1. In Section 4, we give the -approximation for the capacitated k-median problem with at most k facilities while connecting at most clients to each open facility, proving Theorem 1.2. All missing proofs can be found in Appendix A.
2 Common algorithm for cardinality-violation and capacity-violation settings
In this section, we describe the common procedure in our rounding algorithms for both the cardinality and capacity-violation settings. The following is the basic LP relaxation for both settings:
In the corresponding integer program, for every facility and client indicates whether is connected to , for indicates whether is open, and for denotes the connection cost of the client . The objective (1) is the sum of connection costs over all clients. (2) requires that every is connected to exactly 1 facility, (3) requires that the number of open facilities is at most , and (4) says that can be connected to only if is open. (5) is the capacity requirement, and (6) is by the definition of . In the LP relaxation program, we only require 's and 's to be in , as stated in (7).
We shall use the "round-or-cut" paradigm [10, 3]. Given a fractional solution to LP(1), our rounding algorithm either succeeds by returning an integral solution whose cost is at most (which may violate the cardinality constraint or the capacity constraints by a factor of ), or returns a valid constraint of the following form, that is violated by the solution :
where , , for every , and . We can think of that each facility has a cost , and a client has weight . The inequality says that the sum of facility cost and the weighted connection cost of clients is at least . When our rounding algorithm returns a constraint of this form, we guarantee its validity. That is, it is satisfied by all integral solutions to the CKM instance. It is well-known that such an algorithm is sufficient to obtain an -approximation, with -cardinality or capacity violation.
Furthermore, when the facility opening variables 's are integral ( for every ), the optimum client-to-facility assignment reduces to a minimum-cost maximum flow (or matching) problem. As allowing 's to take fractional values does not decrease the cost, our rounding algorithm allows the connections between clients and facilities to be fractional. We assume every has 1 unit of demand. Our goal is to choose a set of at most open facilities, and send the demands to the open facilities, so that every open facility receives at most units of demand. When a -capacity violation is allowed, an open facility can take up to units of demand fractionally. But in an integral solution, we need to increase its capacity to .
We can assume ; otherwise, opening all facilities and computing a minimum-cost assignment is optimal. Fix a solution to LP(1). Increase coordinatewise within until
, keeping and unchanged. This preserves feasibility and cost. Any constraint of form (8) violated afterward was also violated before this modification, since its coefficients of are nonnegative. We continue to denote the modified vector by .
For any set of facilities and any set of clients, we shall let ; we simply write for and for . We define for any . This notational convention applies to other variants of as well.
Throughout the paper, we let be an integer with a sufficiently large hidden constant in .
2.1 Representatives R and Initial Moving of Demands
We use the same framework as in [29, 28, 17, 9] to choose a set of representatives and move all demands to . We define the average connection cost of each client as . The value of the solution is . We select representatives using Algorithm 1.
Algorithm 1 filtering of representatives
1: Input: a facility set , a client set , a metric , and a fractional solution .
2: Output: a set of representatives.
3: compute for each .
4: ; .
5: while do
6: choose , breaking ties arbitrarily.
7: ; .
itself is also removed
8: return .
We perform a Voronoi partition on facility set centered at representative set : each facility is assigned to its nearest representative , yielding a partition of into clusters , where . For any subset of representatives, we use to denote the union of Voronoi regions with centers .
Lemma 2.1. The following statements hold:
(2.1a) for all and , we have ;
(2.1b) for all , there exists , such that and ;
(2.1c) for every ;
(2.1d) for any , and , we have .
We move all demands to client representatives. First, for each client and , we move units of demand from to . Obviously, the moving cost is exactly . After this step, each has units of demand. Second, for each and , we move the units of demand at to . Then, all demands are moved to and a representative has units of demand.
Let be the amount of demand moved from a to . That is, we define . Clearly, for every , we have .
Let for each , and for every . Notice that . We can think of as the budget given to .
Lemma 2.2. For every , we have .
Proof. By Property (2.1d), we have for every and . Thus, .
This immediately implies the following lemma, which shows that the initial moving of demands from clients C to representatives R is small.
Lemma 2.3. For every , we have .
Proof. For each , by the triangle inequality, . So
The last inequality follows from Lemma 2.2.
2.2 Construction of Black Components and Gray Forest Using Kruskal's Algorithm
We now describe the framework of [28, 17] in which we run Kruskal's Algorithm to obtain a minimum spanning tree (MST) for , and color the edges of the MST using black, gray and white colors. We can assume . Otherwise, the -approximation algorithm for capacitated -median problem by [2] gives a true approximation ratio of .
For any , define its weight as satisfying . For any subset , define its weight as . If , then is said to be heavy; otherwise, it is said to be light.
Recall that in Kruskal's algorithm for MST, we maintain the edge set and a partition P of R, defined in Algorithm 2.
Let be the minimum spanning tree returned by Algorithm 2. Consider the forest formed by the black edges of the MST. The vertex set of any tree in the forest is said to be a black component, or simply component. Let be the set of all black components; so, forms a partition of . For every , we define . When , define .
Claim 2.4. For each and , each black edge in satisfies .
We take the MST, remove all white edges, and contract all black edges. The resulting graph is a forest, which we call the gray forest and denote by . We call each tree in the forest a gray tree. We keep the direction of the gray edges, as defined earlier. So, the gray forest is over the set of black components, and each gray tree is a rooted tree with gray edges directed towards the root.
Lemma 2.5. For each tree in the gray forest , the following properties hold:
Algorithm 2 Kruskal's algorithm with edge coloring
1: Input: a representative set , a metric , weights , and a threshold . 2: Output: a minimum spanning tree on with colored edges. 3: ; . 4: sort the edges in in non-decreasing order of length, breaking ties arbitrarily. 5: for all in the sorted order do 6: let be the components containing and , respectively. 7: if then 8: . 9: if both and are light then 10: color black and leave it undirected. 11: else if exactly one of and is light then 12: color gray and direct it from the light set to the heavy set. 13: else 14: color white and leave it undirected. 15: . 16: return , with all edges colored and gray edges directed.
(2.5a) the root of is a heavy black component, and all other vertices of are light black components.
(2.5b) let be two black components in such that is the parent of . Then is the length of the gray edge between and .
(2.5c) for any leaf-to-root path of , the L-values of nodes are non-increasing.
2.3 Capacitated Clustering with Penalty Problem
We now introduce the key contribution discussed in Section 1.2: the use of capacitated clustering with penalty instances to generate valid inequalities on the original capacitated k-median instance.
Given a black component , and an integer parameter , the capacitated clustering with penalty instance (or simply, penalty instance) is defined as follows. We have demands at , where each has units of demand. The facilities are , and each facility has capacity . We are allowed to open at most facilities.
Crucially, for the instance , we are allowed to not connect all the demands: for every unit-demand that is not connected, we pay a penalty cost of . Our goal is to open at most facilities in , and connect some demands from to , so that every receives at most units of demand. Connecting demands at to incurs a per-unit cost of . For all the demands that are not connected to , we pay a per-unit penalty cost of . The goal of the problem is to minimize the sum of connection and penalty costs.
-Approximate Solution for As is small, we can afford to use an -approximation for the problem. We first convert the metric to a hierarchical tree metric. Let
Alternatively, we could solve the problem exactly with running time exponential in . However, it is more important to achieve running time, and we lose approximation factors of anyway. So we use
and . Let consist of the black MST edges over , together with an edge for every and . Representatives and facilities are treated as separate vertices, even if they are at the same location. Assign auxiliary weights
For distinct vertices of , let be the maximum auxiliary weight on their unique path in , and set . Define . This is an ultrametric, and the Kruskal decomposition described below realizes it as a tree metric with all original vertices at leaves. The different scaling of black edges and facility edges allows us to retain the factor .
Lemma 2.6. For every and , we have .
Proof. Fix and for some , and let . The path from to in has at most black edges, each of original length at most 2b, and one facility edge, of length at most . By the triangle inequality, . For the reverse inequality, since is a closest representative to . Every black edge on the MST path from to has length at most . Thus every auxiliary weight on the path from to is at most , giving .
By losing a factor of on the connection cost, we can consider the tree metric . Furthermore, we can make the following two assumptions on the solution for the instance :
(D1) First, if some has (notice that for the with ), then . This can be assumed since such will have distance more than to all demands and thus it would be better to pay the penalty for the demands than to connect them to .
(D2) Second, either all the capacities of the open facilities are used, or all the demands are connected. After (D1), every auxiliary edge on the path from any to any remaining facility i has weight at most : this follows from Claim 2.4 for black edges, and from (D1) for the facility edge. Hence . Whenever both unconnected demand and unused open capacity remain, we can connect them at a per-unit cost of at most instead of paying a penalty of . Starting with an optimum solution in the original metric, its original connection costs increase by at most , and each originally penalized unit costs at most after this modification, whether it is connected or left unconnected. Thus (D1), (D2), and the metric conversion together lose only a factor of .
As all capacities for are integers in , the assumption in (D2) allows us to solve the modified instance precisely using dynamic programming.
We give a more formal description of the dynamic programming now. For the sake of notations, it is convenient for us to introduce a standalone problem, give a dynamic programming for this problem, and we show how to reduce our problem to this standalone problem.
In the standalone problem, we have a full binary tree rooted at , with leaf set . Each vertex has a height , where leaves have height zero and heights are non-decreasing towards the root. For a parent and child , the edge length is .
the -approximation in -time.
The resulting tree metric satisfies
where denotes their lowest common ancestor. Each leaf has a capacity and a demand . Only leaves may be opened as facilities; internal vertices have neither capacity nor demand. We are also given integers . For every , let .
The goal is to open a set of at most facilities with total capacity , and connect exactly units of demand at minimum cost, respecting the capacity of each open facility. Here is the total leaf demand, and connections may be fractional. Equivalently, either all demands are connected or all open capacity is used.
The hierarchical metric ensures that there is an optimum assignment that matches as much demand as possible within every subtree before connecting to outside. More precisely, for any fixed open set and every subtree rooted at , we can match exactly units between leaves of , where is its leaf set. To see this, suppose this amount is not reached. Some demand in is unconnected or connected outside, and some open capacity in is unused or serves outside demand. Match a positive amount of this demand and capacity internally. If both were matched outside, reconnect the displaced outside demand and capacity to each other; otherwise, leave the displaced endpoint unmatched. The internal distance is at most , whereas the distance between any leaf in and any leaf in is at least . Moreover, the distance between two outside leaves is at most the larger of their distances to , by the ultrametric inequality. Thus this exchange does not increase cost and preserves the total connected demand. The case of both endpoints being unmatched is impossible, since all demand or all open capacity is used. Applying these exchanges from the leaves upwards preserves matches already made within descendant subtrees and gives the claimed assignment.
We give a poly -time dynamic programming algorithm to solve this problem exactly. For every , let be the subtree rooted at , and let be its total leaf demand. For integers and , define to be the minimum cost of opening exactly leaves in with total capacity , and connecting units of demand entirely within . Infeasible states have value .
For a leaf , the feasible states are and , whenever their indices are in range. For an internal vertex with children , write for . For any split and , define
This nonnegative quantity is exactly the amount that must be matched between the two child subtrees after each child has matched as much demand as possible internally. Each such connection costs per unit, independently of its endpoints. Therefore,
where the minimum ranges over states with valid indices. The preceding exchange argument shows that an optimum assignment may maximize the internal matching in each child. Conversely, optimal child solutions can always be combined by matching units of their residual demand and capacity. Any residual endpoints left for ancestors have the same distance to every fixed outside leaf, so their identities need not be included in the state. This proves the recurrence.
The optimum value is . We may cap at and declare the instance infeasible if . The table has states and can be computed in arithmetic operations, which is polynomial in and . An optimal facility set and assignment are recovered by tracing the minimizing splits and matching residual demand and capacity at each merge.
We now reduce the hierarchical tree-metric problem restricted by (D1) and (D2) to the standalone problem. Let be the remaining facilities, and delete the other facility vertices from . Run Kruskal's algorithm on this tree using the auxiliary weights , breaking ties arbitrarily. Its decomposition tree has one leaf for each vertex in . Initially, each singleton component is represented by its leaf. Whenever an edge merges two components, create a new parent whose two children are the nodes representing those components, and give this parent height . Give all leaves height zero. Thus every node corresponds to a component that appeared during Kruskal's algorithm, and internal nodes have exactly two children. Equal merge weights simply give zero-length edges in .
For any two leaves , the merge weight at their lowest common ancestor is . Therefore . The construction uses vertices. Assign demand and capacity zero to the leaf for each representative . Assign demand zero and capacity to the leaf for each facility ; internal nodes have neither. Set and . Zero-capacity leaves never need to be opened, so any standalone solution yields a set of at most original facilities.
Enumerate all integers . For each , let denote the optimum connection cost of the standalone instance, or if it is infeasible. Let . By (D2), exactly units are connected. Hence the optimum value of the modified problem is
We select a minimizing value of , recover its facility set and assignment, and use the same connections in the original metric . By Lemma 2.6, this cannot increase cost. Since and , the enumeration and dynamic programming take polynomial time. By the joint charging argument for the metric conversion and (D2), the returned solution is an -approximation for .
Let be the solution obtained using the dynamic programming algorithm, be the amount of demand that is not connected in the solution (that is, we pay a penalty for units of demand), and be the cost of the solution. As we argued, is a -approximate solution for the instance . So is at most times the optimum cost of .
2.4 Generating Valid Constraint Using for
For a given black component and parameter , we can use the solution for to generate a valid constraint of form (8).
Lemma 2.7. For any and integer , the following is a valid constraint for the original CKM instance:
Proof. Consider an integral solution to . If , then the inequality clearly holds as the first term is already at least .
So we assume . Assume towards the contradiction that . In particular, . For every , let be the open facility connected to in the integral solution. So .
We then construct a solution to the capacitated clustering with penalty instance . We open the set of facilities with . So, we open at most facilities. For every , and every with , we consider how to connect the units of demand moved from to at the initial moving phase:
-
If , we connect the demand to . In this case, the connection cost for the demand is . The first inequality holds by the triangle inequality, and the second by (6).
-
If , we treat the demand as unconnected, and pay a penalty of . Notice that since otherwise would be in . So, the penalty we pay is at most ; again, we used the triangle inequality and (6).
So, the cost of the solution is at most , which contradicts the fact that is a -approximate solution to .
Notice that the inequality in Lemma 2.7 can be written as an inequality of form (8). We can check if our satisfies the constraint for every and integer . If not, we return a constraint that is violated. So from now on, we assume satisfies all these constraints. As we shall see later, for our rounding algorithm to succeed, we only need a small subset of these constraints to hold, but we can afford to check all of them.
So far, we have finished the description of the algorithm that is common to both the cardinality violation and capacity violation settings. We describe the two algorithms separately in the next two sections. As we mentioned, the algorithms follow a similar framework: we partition the black components into groups, construct local solutions for black components, and use an auxiliary LP to obtain a fractional solution with only a few fractional facility variables, and round these variables to integral with a -violation.
3 Algorithm for -Cardinality-Violation Setting
In this section, we describe the algorithm for the cardinality-violation setting. Our algorithm builds on the gray-forest grouping framework of [28]. We partition the black components into groups and round each group independently. The main difference lies in the construction and analysis of the local solutions. We use the penalty solutions from Section 2.3 to define the local opening vectors and the auxiliary LP. Their costs are bounded using the valid inequalities (9), rather than the configuration-LP constraints used in [28].
3.1 Partition Gray Forest into Groups of Weight
We partition each gray tree in the gray forest into groups of weight , using a bottom-up greedy approach similar to that in [28]. (The only exception is that the root of may be a singleton group, with weight much larger than .) Focus on such a tree . In each iteration, select the deepest node (black component) in such that the total weight of all descendants of is at least ; recall that the weight of a black component is defined as . As the root of has weight at least , such exists.
By Property (2.5a), every non-root node in has weight less than . By the choice of , the total weight of the subtree rooted at any child of is less than . If the total weight of all these subtrees is at most , then we take to be the set of black components in the whole sub-tree rooted at and let . Otherwise, a greedy procedure can select a subset of children of such that the total weight of subtrees rooted at is between and . In this case, we let contain the black components in these subtrees, and define to be child with the smallest . Notice that in this case is not connected in , as we did not include in .
In both cases, we remove from the tree and repeat until becomes empty. We define as the set of all groups we constructed, over all trees in the gray forest. Clearly, is a partition of . The total weight of black components in any is at least .
Lemma 3.1. For every , every and , the distance between and any representative in root is at most .
3.2 Construction of Local Solutions for Black Components
For every black component , we define . We shall only use the capacitated clustering with penalty instance for each . For convenience, we use and for and respectively.
Fix a black component , and let be the -approximate solution to the instance with cost . In this solution, we construct a local solution for this , along with a per-unit cost vector .
For every , we define to be the “effective capacity” of , which is the capacity used by the LP solution . is one of the following two types:
(1) if , which is equivalent to . In this case, we let for every , and for every . That is, is the indicator vector for , plus times restricted to . We let in this case.
(2) if . We let . Then, we define for every and for every . So, is with values for scaled up to 1.
In both cases we have . Then for both cases, we define for every , and for every .
Lemma 3.2. The following inequalities hold:
(3.2a)
(3.2b)
Proof. We first prove (3.2a). We consider the two cases (1) and (2) above. For type-(1) component , we have For type-(2) component , The first inequality holds by for each .
It remains to consider (3.2b). For type-(1) component J, we have
Recall that for every . The last inequality follows from Lemma 2.2 and .
For type-(2) component , we have . We shall bound . As is of type-(2), we have , and . By our assumption on the solution , all capacities in are fully used in the solution for . Therefore, we have
So, we have . Overall, we have . So, we have . This finishes the proof of (3.2b) and thus the whole lemma.
3.3 Rounding Procedure for Each Group
Our rounding algorithm handles each group independently. We focus on a fixed . Recall that every black component , we defined two vectors and . We then let and be the concatenation of all black components . So, the domain of both and is .
Consider the following LP with variables :
By setting , we obtain a solution to LP(10) of value . Fix on such an optimum vertex-point solution of LP(10). Since there are only two non-box-constraints, has at most two fractional values. We then open all facilities with .
We now reassign demands to these finally opened facilities. We define the root representative of G to be any representative in the root black component of G. The whole process consists of the following two steps.
-
Sending step. For each black component , we consider the solution for the capacitated clustering with penalty instance . Recall that if is of type-(1) and if is of type-(2). Then we pre-connect demands at to according to the solution . For the demands that are not connected, we send them to the designated root representative of . Notice that every has , and its full capacity is used in the local solution, unless . So, for a , the amount of demands sent from to the root is at most .
-
Receiving step. For the demands sent to the root representative in the previous step, we send them to the open facilities in . For every , only facilities in are allowed to receive demand, and such a facility receives at most units of demand from the root representative. This is the only requirement for the receiving step.
So, the total amount of demands sent to the root is at most
Therefore, we have enough capacity to receive the demands sent to the root representative.
Lemma 3.3. The connection cost incurred by the sending and receiving steps is at most .
Proof. Consider the sending step for each . The cost of local matching of demands according to the solution is at most . Let be the amount of demand sent from to the root representative after local pre-connection. If is of type-(1), then . If is of type-(2), all facilities in are fully utilized, so . By Lemma 3.1 and , the sending cost is at most . The cost of receiving demands from the root representative is at most
Now we consider all black components . The cost of receiving the demands is at most
The first inequality follows from the optimality of for LP(10) and the feasibility of . The second inequality follows from Lemma (3.2b). Summing the local pre-connection and sending costs over gives at most . Combining this with the receiving-cost bound, the total cost is at most .
Then, we wrap up the analysis of cost by considering all groups G, as well as the cost incurred by initial moving. The total cost is at most
To see this, we just need to bound . The inequality in Lemma 2.7 holds for , and every black component . We add up the inequality over all . We obtain
The equality holds because for every . Therefore, .
The following lemma gives an upper bound on the number of open facilities:
Lemma 3.4. The total number of open facilities is at most .
Proof. Focus on a fixed , since the vector has at most two fractional entries, so . Since every group has weight at least , and the groups form a partition of all black components, we have . By summing over all , . Then summing over all , the total number of open facilities is at most .
With a large enough hidden constant in , we finish the proof of Theorem 1.1.
4 Algorithm for the Capacity-Violation Setting
This section presents the rounding algorithm for the capacity-violation setting. In contrast to the cardinality-violation setting, we enforce the total number of opened facilities to be at most k, and each open facility i is allowed to carry demand up to .
We follow the binary-forest construction and the top-down grouping framework of [17]. We also use their general strategy of removing excess facilities and reassigning demand to nearby groups. Our local solutions are constructed differently: we use the penalty instances and the four component types defined below. The auxiliary LP selects the opening variables, and the cost analysis uses inequalities (9).
4.1 Converting Gray Forest into A Forest of Binary Trees
The way we partition each gray tree into groups is different from the one we used for the cardinality-violation setting. In the capacity violation setting, we need to use the tree structure over the groups, and it is important to make sure that the values of black components in a parent group is at most the values of black components in a child group. Therefore, we use a top-to-bottom approach to construct the groups. Moreover, to bound the number of child groups of each group, we first make each gray tree binary using the left-child-right-sibling method.
We use the same framework as in [17] to convert into a binary forest. For every rooted tree , we convert it to a tree with the same set of nodes (black components) as follows. For every non-leaf black component , we sort its children in non-decreasing order of -values, and let the order be . Then, we add edges to , with the first node of each edge being the child, and the second node being the parent. So, is a rooted tree with edges directed towards the root and every node in has at most 2 children.
We call the tree a transformed gray tree. Let be the set of all transformed gray trees , over all gray trees , and we call the transformed gray forest.
Lemma 4.1. satisfies the following properties:
(4.1a) for any leaf-to-root path of , the L-values of nodes are non-increasing.
(4.1b) every root component of has either or .
(4.1c) for any non-root component and its parent in , we have .
4.2 Partition J into Groups using
With the transformed gray forest , we can now partition the black components into groups. We also use the framework of [17]. Let initially. For every transformed gray tree in and its root , we call construct-groups , defined in Algorithm 3.
Algorithm 3 construct-groups( , )
1:
2: while and does not contain all descendants of in do
3: choose an edge in with the smallest satisfying , (recall that edges are directed towards the root, so is the parent of )
4:
5:
6: for every edge in such that , do
is the parent of
7: construct-groups( , )
Notice that every group G induces a (weakly) connected component in . Thus, every G has a unique root black component. The forest structure naturally defines a parent-child relationship among groups: a group G is the parent of a group if the root of is a child of some black component in G. Also, the root of any transformed gray tree forms a singleton group, as its weight is at least . We call this a root group.
We extend the definition of to sets of black components, and in particular groups. For any set of components, we define . Let children( ) be the set of all child-groups of a group . Let children'( ) = children( ) if is a root group, and children'( ) = children( ) otherwise. A root group is called an isolated root group if it has no child group, that is, children( ) = , then children'( ) = .
Lemma 4.2. satisfies the following properties:
(4.2a) if is not a root group, then ;
(4.2b) if is a non-leaf group, then ;
(4.2c) If is an isolated root group, then and .
(4.2d) any group G has at most child groups;
(4.2e) let be a group, , and , then .
Observe that a set J in an isolated root group can satisfy either or .
4.3 Types of Black Components and Construction of Local Solutions
For every black component , we define , for a sufficiently large absolute constant . If is a root black component of some gray tree (equivalent, transformed gray tree), and , then we update . Notice that for a non-root black component , we have as .
Fix a black component . We consider the solution for the penalty instance . When , we may need to also consider the penalty instance . Recall that denotes the amount of unconnected demands in the solution , and is the overall cost of the solution . We assume ; otherwise, we can use the solution for the instance .
A black component is one of four types. If is singleton root black component with , then it is of type-(1). Otherwise, its type is:
(1) if ,
(2) if and ,
(3) if , and , and
(4) if , and .
As before, we shall construct local solutions for the 4 types of components respectively. If is of type-(1), we simply use the fractional solution . If is of type-(2), we use the solution for the penalty instance , with unconnected demands sent to , using proportional distribution: the amount of demand sent to any is proportional to the amount of demand it already serves. In this case, we say we follow the instance for . If is of type-(4), we follow either or , depending on how many facilities will be open in in the end. If is of type-(3), we follow the instance initially. If in the end we can only open facilities in , we perform a remove operation to decrease the number of open facilities by 1.
4.4 Construction of Final Solution Using Auxiliary Linear Program
With the ideas of local solutions, we form an auxiliary linear program to construct the final integral solution for our CKM instance. Define , , and as the sets of type-(1), (2), (3) and (4) black components respectively. We shall use to denote ; the notations for other subsets of are defined analogously. And we define to be the set of all singleton root black components with . So . This section mainly focuses on the algorithm, and we defer the analysis of the cost and capacity violation to the next section.
For every , and , we have a variable . If , it indicates if is open or not in the final solution. For every , we have a single variable . If , then it denotes the number of facilities we open in . For black components of , as we always follow . So we do not have variables for them.
As in the previous section, we use as the “effective capacity” of a facility . The auxiliary LP is defined as follows:
In the objective, the functions in and notations will be specified later. For an isolated root group , constraint (13) is redundant: its left-hand side is either zero or , which is at most 1 by (18).
Lemma 4.3. Setting for every and for every gives a valid solution to LP(11).
Proof. (12), (15), (16), (17) and (18) hold trivially.
Now consider (13). If is of type-(3) or (4), then . The equality holds as and thus . Therefore, . Therefore
Summing up the inequality over all for a fixed , we have
If is a root group, then . If , the corresponding sum is 0. Otherwise, , so , and Property (4.1b) implies .
As G has at most children, we have
when c is large enough. Therefore, (13) holds.
For every , we have facilities. Therefore, setting as in the lemma, we have . Thus, (14) holds.
We solve the LP to obtain a vertex solution . From now on, we fix this .
Lemma 4.4. The following statements hold:
(4.4a) there are at most three facilities with , for every non-leaf or isolated root group .
(4.4b) at most one black component has .
Proof. Consider the first statement (4.4a). We fix a non-leaf or isolated root group . We say is a strictly fractional facility if (and exists). We say contains a strictly fractional facility , if additionally .
Suppose some group contains at least 3 strictly fractional facilities . Notice that there are at most three tight constraints involving one of the three variables : (12) for , (14) and (15) for . The coefficient matrix between the three constraints and three variables is . The rank of the matrix is less than 3, contradicting that is a vertex solution.
Now suppose there are two different groups in children'(G), each of which contains at least 2 strictly fractional facilities. There are at least 4 of these facilities, but the rank of the coefficient matrix defined as above is at most 3. Again a contradiction.
Now suppose there are three groups in children'(G), each of which contains exactly 1 strictly fractional facility. Notice that (12) is not tight for and . There are at most 2 tight constraints involving the one of the fractional variables. Again, would not be a vertex solution.
Finally, if there are three groups in children'(G), two of which contain exactly 1 strictly fractional facility, and one of which contains exactly 2 strictly fractional facilities, using the above method one can argue that the rank of the coefficient matrix is at most 3. Therefore, we conclude that there are at most 3 strictly fractional facilities over all groups in children'(G).
Consider the second statement (4.4b). Fix a group G, similarly, suppose there are at least 2 such components and involved in the same constraint from (13). Then (13) and (14) might be tight for . The coefficient matrix is , whose rank is 1. This contradicts that is a vertex solution.
Now suppose there are two strictly fractional components in different groups. By integrality and the preceding argument, the corresponding constraints in (13), if any, cannot be tight. Thus, only (14) can be tight for these variables, whose rank at most 1, a contradiction.
We shall maintain a set of open facilities, a flow from to . Every sends units of demand (this is the demand received by during the initial moving procedure in Section 2.1). At the beginning, may have size more than . We shall use the “remove” procedure to remove facilities from to guarantee the upper bound.
We start with , and add facilities as follows:
- For every , we add to . For every non-leaf or isolated root group , we send the demands at to , where every receives at most units of demand. The total demand and the total capacity are respectively
By (15) for a non-leaf group, or (16) for an isolated root group, the total demand is at most the total capacity.
-
For , we add to . We satisfy the demands at using , by following the instance . To address a small technicality issue, for every , we arbitrarily choose facilities in , and add them to . They do not serve any demand and we call them "dummy facilities".
-
For , we add to . We satisfy the demands at using , by following the instance .
-
For , we add to . Similarly, we satisfy the demands at using , by following the instance .
For every , let if , and let otherwise. After adding , we add arbitrary facilities from to as dummy facilities serving no demand. This is possible since . The local assignment, , and remain unchanged. The size of may be more than for two reasons. First, some type-(1) component may have some facility with and we included it in . Second, some type-(3) component may have but we opened facilities in , including dummy facilities. To reduce the size of , we run Algorithm 4.
The top-to-bottom order in Algorithm 4 is chosen so that all black components of a group are processed before any black component of its child groups.
We first argue that the algorithm is well-defined. The initial we constructed has for every group . This holds due to (12), (13), which implies for every group , and that we added dummy facilities for type-(2), type-(3) and type-(4) components. If is an isolated root group, the inequality follows directly from (18). In particular,
Algorithm 4 reduce the size of W to at most k
1: for every black component respecting the top-to-bottom order do 2: let G be the parent group of the group containing J, or if J is a root group 3: if J is of type-(1) then 4: let a be the number of facilities with 5: repeat a times: remove(G, J) 6: else if J is of type-(3) and then 7: remove(G, J)
Algorithm 5 remove(G, J)
1: let be the facility in serving the least demand 2: remove from W 3: resend the demands sent to to , split proportionally to the amount of demands they already serve
for every non-leaf or isolated root group , we have . By the first statement of Lemma 4.4, for any non-leaf or isolated root , the number of times we call remove( ) over all type-(1) components at most 3. For a non-leaf group, by (13), the number of times we call remove( ) over all type-(3) components at most 1. An isolated root group contains only one black component, so the same bound holds for it. Therefore, the facility can always be chosen. For every group , at most four facilities in are removed while processing components of , and at most four more are removed while processing its child groups. Hence every non-leaf or isolated root group retains open facilities throughout the algorithm.
The initial exceeds by at most the number of strictly fractional type-(1) facilities, plus the number of type-(3) components with . This holds due to the second statement of Lemma 4.4. As we removed this number of facilities, we have in the end.
4.5 Analysis of Cost and Capacity Violation
We analyze the cost and capacity violation of our solution.
Cost of Initial Flow Before Removing Operations We first analyze the cost of the flow sent from v to the initial W, before we apply the remove operations.
Focus on the cost incurred by type-(1) black components. For a non-leaf or isolated root group , the cost of sending the demands from to can be bounded as follows. We take an arbitrary representative at the root component of , as the transfer point. First we send all the demands to , and then we dispatch the demands from to . The cost incurred in the two steps is at most
Therefore, the cost of the initial flow incurred by type-(1) black components is
By , for every , then . And for , since , we have . So the cost of initial flow incurred by type-(2), (3) and (4) black components is at most
The cost of the initial flow is at most .
Cost due to Removing Operations Now we analyze the cost incurred by removing operations. During the analysis, we only bound the cost of the flows between representatives. To be more specific, suppose we resend the flow sent to some to another facility , where and . Then we only consider the cost of sending the flow from to . In our analysis, all the flow sent to are sent through . That is, the cost of sending a unit flow from some representative to is calculated as . This applies to the solutions for the penalty instances 's. Therefore, to resend the flow sent to , we actually undo a portion of the flow sent from to . Second, due to the proportional distribution, we can charge the cost of sending the flow from to using the existing flow sent to . We will call the cost of sending the flow from to the -to- cost, and the cost of sending the flow from to the -to- cost.
Notice that as we handle the black components in Algorithm 4 in a top-to-bottom fashion, no facilities have been removed from before we handle . Then, we prove the following lemma:
Lemma 4.5. The remove(G, J) incurs a R-to-R cost of at most 0 if , if , and if .
Proof. Consider the case where is a type-(1) component. If is a singleton root component, then . Also, . So, the -to- cost of resending flow from to the new is 0.
Now consider . Initially, the total demand assigned to facilities in is at most . Let is a facility with the minimum demand in , we have demand( ) . By Lemma (4.2e) and the triangle inequality, the representative-to-representative distance used in the reassignment is at most . Therefore, the -to- cost is at most .
The case where is type-(3) component, we have , implying . Combining this inequality with the per-unit reassignment bound gives an -to- cost of at most .
The remove operations incur a R-to-R cost of
So, the final cost without counting the R-to-F cost of the removing operations is at most
The second inequality holds by Lemma 4.3 and the third inequality holds by Lemma 2.2.
To see the fourth-to-last inequality, we bound for and for respectively. By inequality (9), we have
Recall that . We have , implying that . Therefore, we have .
Consider the case , where we have .
where we used that .
Then we argue about the capacity violation of the solution, along with the -to- cost of the removing operations. In the initial flow, every facility receives at most units of flow. As we argued, always holds. When we send some flow to for some non-leaf group or isolated root group , we guarantee that the amount of flow sent is at most the least flow received by any facility in . Also we apply the operation for any at most times. Therefore, the operations will increase the flow received by any by a factor of at most . This also implies that the R-to-F cost incurred by the removing operations is negligible.
Notice that the initial moving step in Section 2.1, which moves demands from to has cost . So, the overall moving cost of our solution is at most . This finishes the proof of Theorem 1.2.
References
[1] Karen I. Aardal, Pieter L. van den Berg, Dion Gijswijk, and Shanfei Li. Approximation algorithms for hard capacitated k-facility location problems. European Journal of Operational Research, 242(2):358–368, 2015.
[2] Marek Adamczyk, Jarosław Byrka, Jan Marcinkowski, Syed Mohammad Meesum, and Michal Wlodarczyk. Constant-factor FPT approximation for capacitated k-median. In 27th Annual European Symposium on Algorithms, ESA 2019, volume 144, pages 1:1–1:14, 2019.
[3] Hyung-Chan An, Mohit Singh, and Ola Svensson. Lp-based algorithms for capacitated facility location. SIAM Journal on Computing, 46(1):272–306, 2017.
[4] Vijay Arya, Naveen Garg, Rohit Khandekar, Adam Meyerson, Kamesh Munagala, and Vinayaka Pandit. Local search heuristics for k-median and facility location problems. SIAM Journal on Computing, 33(3):544–562, 2004.
[5] Jarosław Byrka, Krzysztof Fleszar, Bartosz Rybicki, and Joachim Spoerhase. Bi-factor approximation algorithms for hard capacitated k-median problems. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, pages 722–736, 2015.
[6] Jaroslaw Byrka, Yuhao Guo, Yang Hu, Shi Li, Chengzhang Wan, and Zaixuan Wang. k-clustering via iterative randomized rounding. In Proceedings of the 67th Annual Symposium on Foundations of Computer Science, FOCS 2026, 2026.
[7] Jaroslaw Byrka, Thomas W. Pensyl, Bartosz Rybicki, Aravind Srinivasan, and Khoa Trinh. An improved approximation for k-median, and positive correlation in budgeted optimization. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, pages 737–756, 2015.
[8] Jaroslaw Byrka, Thomas W. Pensyl, Bartosz Rybicki, Aravind Srinivasan, and Khoa Trinh. An improved approximation for k-median and positive correlation in budgeted optimization. ACM Transactions on Algorithms, 13(2):23:1–23:31, 2017.
[9] Jaroslaw Byrka, Bartosz Rybicki, and Sumedha Uniyal. An approximation algorithm for uniform capacitated k-median problem with capacity violation. In Integer Programming and Combinatorial Optimization-18th International Conference, IPCO 2016, volume 9682, pages 262–274, 2016.
[10] Robert D. Carr, Lisa Fleischer, Vitus J. Leung, and Cynthia A. Phillips. Strengthening integrality gaps for capacitated network design and covering problems. In Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2000, pages 106–115, 2000.
[11] Moses Charikar, Chandra Chekuri, Ashish Goel, and Sudipto Guha. Rounding via trees: Deterministic approximation algorithms for group steiner trees and k-median. In Proceedings of the Thirtieth Annual ACM Symposium on the Theory of Computing, STOC 1998, pages 114–123, 1998.
[12] Moses Charikar, Sudipto Guha, Éva Tardos, and David B. Shmoys. A constant-factor approximation algorithm for the k-median problem (extended abstract). In Proceedings of the Thirty-First Annual ACM Symposium on Theory of Computing, STOC 1999, pages 1–10, 1999.
[13] Moses Charikar, Sudipto Guha, Éva Tardos, and David B. Shmoys. A constant-factor approximation algorithm for the k-median problem. Journal of Computer and System Sciences, 65(1):129–149, 2002.
[14] Julia Chuzhoy and Yuval Rabani. Approximating k-median with non-uniform capacities. In Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2005, pages 952–958, 2005.
[15] Vincent Cohen-Addad, Fabrizio Grandoni, Euiwoong Lee, Chris Schwiegelshohn, and Ola Svensson. A -approximation algorithm for metric k-median. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC 2025, pages 615–624, 2025.
[16] Vincent Cohen-Addad, Anupam Gupta, Lunjia Hu, Hoon Oh, and David Saulpic. An improved local search algorithm for k-median. In Proceedings of the 2022 ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, pages 1556–1612, 2022.
[17] H. Gökalp Demirci and Shi Li. Constant approximation for capacitated k-median with -capacity violation. In 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, volume 55, pages 73:1–73:14, 2016.
[18] Jittat Fakcharoenphol, Satish Rao, and Kunal Talwar. A tight bound on approximating arbitrary metrics by tree metrics. In Proceedings of the 35th Annual ACM Symposium on Theory of Computing, STOC 2003, pages 448–455, 2003.
[19] Jittat Fakcharoenphol, Satish Rao, and Kunal Talwar. A tight bound on approximating arbitrary metrics by tree metrics. Journal of Computer and System Sciences, 69(3):485–497, 2004.
[20] Kishen N. Gowda, Thomas W. Pensyl, Aravind Srinivasan, and Khoa Trinh. Improved bi-point rounding algorithms and a golden barrier for k-median. In Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, pages 987–1011, 2023.
[21] Sudipto Guha and Samir Khuller. Greedy strikes back: Improved facility location algorithms. Journal of Algorithms, 31(1):228–248, 1999.
[22] Dorit S Hochbaum and David B Shmoys. A unified approach to approximation algorithms for bottleneck problems. Journal of the ACM, 33(3):533–550, 1986.
[23] Kamal Jain, Mohammad Mahdian, Evangelos Markakis, Amin Saberi, and Vijay V. Vazirani. Greedy facility location algorithms analyzed using dual fitting with factor-revealing LP. Journal of the ACM, 50(6):795–824, 2003.
[24] Kamal Jain, Mohammad Mahdian, and Amin Saberi. A new greedy approach for facility location problems. In Proceedings on 34th Annual ACM Symposium on Theory of Computing, STOC 2002, pages 731–740, 2002.
[25] Tapas Kanungo, David M. Mount, Nathan S. Netanyahu, Christine D. Piatko, Ruth Silverman, and Angela Y. Wu. A local search approximation algorithm for k-means clustering. Computational Geometry, 28(2-3):89–112, 2004.
[26] Madhukar R. Korupolu, C. Greg Plaxton, and Rajmohan Rajaraman. Analysis of a local search heuristic for facility location problems. Journal of Algorithms, 37(1):146–188, 2000.
[27] Shanfei Li. An improved approximation algorithm for the hard uniform capacitated k-median problem. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2014, volume 28, pages 325–338, 2014.
[28] Shi Li. Approximating capacitated k-median with open facilities. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, pages 786–796, 2016.
[29] Shi Li. On uniform capacitated k-median beyond the natural lp relaxation. ACM Transactions on Algorithms, 13(2):1–18, 2017.
[30] Shi Li and Ola Svensson. Approximating k-median via pseudo-approximation. SIAM Journal on Computing, 45(2):530–547, 2016.
A Omitted proofs
Lemma 2.1. The following statements hold:
(2.1a) for all and , we have ;
(2.1b) for all , there exists , such that and ;
(2.1c) for every ;
(2.1d) for any , and , we have .
Proof. For Property(2.1a), let be distinct, and assume . When is added to , the algorithm removes every client with . Since , it was not removed in that iteration. Hence . For Property (2.1b), fix any client , and consider the iteration in which is removed from . Then consider Property (2.1c). By (2.1a), we have . Since and , we have , implying , due to Constraint (4). The case is trivial.
Then we consider Property (2.1d). By (2.1b), there is a client such that and . Since as and was added to , we have .
Claim 2.4. For each and , each black edge in satisfies .
Proof. Fix a black component , and let be the first edge processed by Kruskal's algorithm with and . So . Since no previously added edge crosses the cut , the endpoints of belong to distinct connected components, so is added to .
Since is a final black component, cannot be black. Thus, the merged component is heavy and remains heavy thereafter. Consequently, no subsequent black edge can enlarge the black component containing , so this black component must already be before is added. Therefore, every black edge in is added before , implying . For the case , the claim follows trivially.
Lemma 2.5. For each tree in the gray forest , the following properties hold:
(2.5a) the root of is a heavy black component, and all other vertices of are light black components.
(2.5b) let be two black components in such that is the parent of . Then is the length of the gray edge between and .
(2.5c) for any leaf-to-root path of , the L-values of nodes are non-increasing.
Proof. For Property (2.5a), we recall that . Once a connected component maintained by Kruskal's algorithm becomes heavy, it remains heavy. It cannot participate in any subsequent black-edge merge. Consequently, all black edges of a black component are added before any MST edge leaving it. Consider a light black component . Since , we have . Let be the first edge leaving that is added to the MST. Immediately before is added, is a connected component maintained by Kruskal's algorithm. The edge is not white, since is light. It is not black, since is a maximal black component. Thus, is gray and directed away from . After this merge, the connected component containing remains heavy. Hence, no subsequent gray edge is directed away from . Therefore, every light black component has outdegree one in . Every heavy black component has outdegree zero, since it is already heavy before any edge leaving it is added. Now fix a gray tree . Its underlying undirected graph is a tree, so . Since every vertex has outdegree zero or one, exactly one vertex has outdegree zero. This vertex is a heavy black component. All other vertices are light black components, and all gray edges are directed towards this unique root.
For Property (2.5b), let be the gray edge from to its parent . Immediately before is added, is a connected component maintained by Kruskal's algorithm. Hence is the first processed edge crossing , and therefore . Since and , we obtain , proving the desired equality.
For Property (2.5c), every component and its parent satisfies , where the last equality follows from (2.5b).
Lemma 3.1. For every , every and , the distance between and any representative in root is at most .
Proof. Fix a group . Let be the black component selected when is constructed, and let be the root of the gray tree containing . Set . The subgraph of induced by is a tree. Let be obtained by expanding its nodes into their black components and retaining the corresponding gray edges. First consider the case . Since is not the root of , by Lemma (2.5a) its weight is less than . By construction, the total weight of is at most .
Thus the total weight of is at most . By Lemma (2.1c), each original representative satisfies . Therefore the number of nodes in is at most .
Now consider . If has weight at most , then contains at most representatives. Otherwise, is a singleton black component and contributes only one representative. The remaining components contribute at most representatives. Thus, contains at most representatives in either case.
Fix , , and . Their path in the original MST is contained in . If , then . Lemma (2.5c) implies that every black component on the path has -value at most . Otherwise, let be the selected child of whose subtree contains . By the choice of , . Together with Lemma (2.5c), this gives the same bound for every black component on the path. By Claim 2.4 and Lemma (2.5b), every edge on the path has length at most . Therefore, .
Lemma 4.1. satisfies the following properties:
(4.1a) for any leaf-to-root path of , the L-values of nodes are non-increasing.
(4.1b) every root component of has either or .
(4.1c) for any non-root component and its parent in , we have .
Proof. For Property (4.1a), for any child-parent edge in , we consider two cases: if is the parent of in the original gray tree. By Lemma (2.5c), the leaf-to-root monotonicity of -values for the original gray tree, we have . If and are adjacent siblings in the original tree, with ordered before . Due to the sorting rule, . Hence the -values are non-increasing along every leaf-to-root path.
For Property (4.1b), suppose a black component contains multiple representatives, that is . Then it must be formed by merging at least two black components through the last black edge. Let the two child components before this final merge be and , satisfying and . After merging, we have , and the total weight satisfies .
For Property (4.1c), let be the parent of in the original gray forest . By the construction of , either , or is the sibling of immediately preceding it in the non-decreasing order of -values. Hence and . For every , , and by Claim 2.4, we have . If , then the original gray edge between and has length . Thus, for every and , . Otherwise, both and are children of in . The gray edges from and to have lengths and , respectively. Hence, . Therefore, .
Lemma 4.2. satisfies the following properties:
(4.2a) if is not a root group, then ;
(4.2b) if is a non-leaf group, then ;
(4.2c) If is an isolated root group, then and .
(4.2d) any group G has at most child groups;
(4.2e) let G be a group, , and , then .
Proof. For Property (4.2a), any non-root component has . Thus, if is not a root group, the terminating condition constructing implies that had total weight less than right before the last black component was added to it. Then we have .
For Property (4.2b), when we construct the group from the tree by Algorithm 3, the terminating condition is that contain all descendants of in or . Thus, if is not a leaf-group, then the condition that contains all descendants of in does not hold. So we have .
For Property (4.2c), let be the root black component of the transformed gray tree that contains . By Lemma (2.5a), is heavy. Hence, . And by Algorithm 3, the root group remains .
For Property (4.2d), since the forest is binary and every group contains at most components, we have that every group contains at most children.
Finally for Property (4.2e), in the transformed gray tree , the -values are non-increasing along every leaf-to-root path. By Algorithm 3, we select the child component with the smallest -value add each time. Let be a child group of and let be the root component of . Then for every . On the other hand, every component is a descendant of . By the monotonicity of -values along root-to-leaf paths, for all . Therefore, . The property then holds by Claim 2.4, Lemma (4.1a), (4.1c) and that each group has at most components. If , then is a root group. Claim 2.4 gives , which also implies the stated bound.