Abstract 1 Introduction 2 Geometric Primal-Dual Framework 3 A Sub-Quadratic Algorithm for the 𝒌-SP Problem 4 Conclusion and Open Questions References

Geometric Bipartite Matching Based Exact Algorithms for Server Problems

Sharath Raghvendra ORCID North Carolina State University, Raleigh, NC, USA Pouyan Shirzadian ORCID Virginia Tech, Blacksburg, VA, USA Rachita Sowle ORCID Virginia Commonwealth University, Richmond, VA, USA
Abstract

For any given metric space, obtaining an offline optimal solution to the classical k-server problem can be reduced to solving a minimum-cost partial bipartite matching between two point sets A and B within that metric space.

For d-dimensional p metric space, we present an O~(min{nk,n212d+1logΔ}Φ(n)) time algorithm for solving this instance of minimum-cost partial bipartite matching; here, Δ represents the spread of the point set, and Φ(n) is the query/update time of a d-dimensional dynamic weighted nearest neighbor data structure. Our algorithm improves upon prior algorithms that require at least Ω(nkΦ(n)) time. The design of minimum-cost (partial) bipartite matching algorithms that make sub-quadratic queries to a weighted nearest-neighbor data structure, even for bounded spread instances, is a major open problem in computational geometry. We resolve this problem at least for the instances that are generated by the offline version of the k-server problem.

Our algorithm employs a hierarchical partitioning approach, dividing the points of AB into rectangles. It maintains a partial minimum-cost matching where any point bB is either matched to another point aA or to the boundary of the rectangle it is located in. The algorithm involves iteratively merging pairs of rectangles by erasing the shared boundary between them and recomputing the minimum-cost partial matching. This continues until all boundaries are erased and we obtain the desired minimum-cost partial matching of A and B. We exploit geometry in our analysis to show that each point participates in only O~(n112d+1logΔ) number of augmenting paths, leading to a total execution time of O~(n212d+1Φ(n)logΔ).

We also show that, for the 1 norm and d dimensions, any algorithm that can solve instances of the offline n-server problem with an exponential spread in T(n) time can be used to compute minimum-cost bipartite matching in a complete graph defined on two (d1)-dimensional point sets under the 1 norm within T(n) time. This suggests that removing spread from the execution time of our algorithm may be difficult as it immediately results in a sub-quadratic algorithm for bipartite matching under the 1 norm.

Keywords and phrases:
Minimum-Cost Bipartite Matching, Server Problems, Primal-Dual Approach
Copyright and License:
[Uncaptioned image] © Sharath Raghvendra, Pouyan Shirzadian, and Rachita Sowle; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/abs/2504.06079 [19]
Funding:
This research was supported by NSF grants CCF 2514753 and CCF 2223871.
Editors:
Oswin Aichholzer and Haitao Wang

1 Introduction

This paper considers two classical optimization problems: the offline k-server problem and the minimum-cost bipartite matching problem in geometric settings.

Offline 𝒌-server problem and its variant.

Consider a sequence of requests ς=r1,,rm in a metric space equipped with the cost function d(,). The cost of a single server servicing the requests in ς is the sum of the distances between every consecutive pair of points in the sequence, i.e., ¢(ς)=i=1m1d(ri,ri+1). Given a sequence σ=r1,rn of n requests and an integer 1kn, the k-sequence partitioning problem (or simply the k-SP problem) requires partitioning the requests in σ into k subsequences ς1,,ςk so that i=1k¢(ςi) is minimized. The optimal solution for the k-sequence partitioning problem is the cheapest way for k servers to service all of the requests in σ. We also consider a variant: the k-sequence partitioning with initial locations problem (or the k-SPI problem). Here, in addition to the requests σ, we are also given the initial locations η=s1,,sk for the k servers. The objective of this problem is to partition σ=ησ into k subsequences ς1,,ςk so that the initial location sj of server j appears in the first element of the subsequence ςj and the cost i=1k¢(ςk) is minimized. The optimal solution to the k-SPI problem is the offline optimal solution to the well-known k-server problem.

We assume that the requests in σ and the initial locations in η are scaled and translated so that they are contained inside the unit hypercube [0,1]d. Such scaling and translation do not impact the optimal solutions for the k-SP and k-SPI problems. We define the diameter Diam(σ) to be the largest distance between any two request locations in σ and the closest pair distance, denoted by CP(σ), to be the smallest non-zero distance between any two requests in σ. The spread, denoted by Δ, is the ratio of the diameter to the closest-pair distance, i.e., Δ=Diam(σ)/CP(σ).

Minimum-cost bipartite matching.

Consider a weighted bipartite graph G(AB,EA×B), where each edge between u and v is assigned a real-valued cost. Let n:=min{|A|,|B|}. A matching of size tn, or simply a t-matching, is a set of t edges in G that are vertex-disjoint. The cost of any matching M is the sum of the costs of its edges. Given a parameter tn, the minimum-cost bipartite t-matching problem seeks to find a t-matching with a minimum cost. When |A|=|B|=n, a matching of size n is called a perfect matching. When A and B are d-dimensional point sets and the cost of any edge between aA and bB is the p distance abp, the problem of finding the minimum-cost bipartite t-matching is also called the (partial) geometric bipartite matching problem.

Relating the two problems.

Chrobak et al. [4] established a reduction from the minimum-cost bipartite t-matching problem to the k-SPI problem.

Lemma 1 ([4, Theorem 11]).

Any algorithm that computes an optimal solution to the n-SPI in an arbitrary metric space in T(n) time can also find, in T(n)+O(n2) time, a minimum-cost perfect matching in any complete bipartite graph with real-valued costs.

We strengthen the connection between the two problems by showing a reduction in the reverse direction, i.e., we reduce the k-SP (resp. k-SPI) problem to the minimum-cost bipartite t-matching problem. Given an input sequence σ of requests to the k-SP problem, we construct a bipartite graph 𝒢σ with a vertex set AB and a set of edges as follows. Vertex Set: For each request ri, we create a vertex bi (resp. ai) in B (resp. A) and designate it as the entry (resp. exit) gate for request ri. Edge Set: The exit gate ai of request ri is connected to the entry gate bj of every subsequent request rj with j>i with an edge. The cost of this edge is d(ai,bj)=rirjp. Any minimum-cost (nk)-matching M in 𝒢σ can be used to find an optimal solution to the k-SP problem. See Figure 1.

For the k-SPI problem, for each server j, we add a vertex aj at the initial location sj to A and connect aj to the entry gate bi of every request ri in σ. The cost of this edge is d(aj,bi)=sjbip. A minimum-cost n-matching in this graph can be converted to an optimal solution for the k-SPI problem.

A different reduction from k-SP and k-SPI problems to the minimum-cost flow problem has been presented in previous works [4, 22, 24], leading to the development of O(n2k) time algorithm. However, unlike our reduction, their approach generates instances that include edges whose costs are and fails to maintain the metric properties of costs.

Refer to caption
Figure 1: The graph 𝒢σ constructed for σ=r1,r2,,r6. The vertex set A (red disks) and B (blue squares) represent the exit and entry gates of each request, and the purple dashed lines show an (n2)-partial matching on 𝒢σ representing a 2-partitioning r1,r2,r4,r5 and r3,r6.
Lemma 2.

An optimal solution for an instance σ (resp. σ) of k-SP (resp. k-SPI) problem can be found by computing a minimum-cost matching of size nk (resp. n) in 𝒢σ (resp. 𝒢σ).

Finally, we extend the reduction Chrobak et al. [4] to geometric settings and provide a reduction from the geometric minimum-cost matching problem under the 1-norm to the geometric version of the n-SPI problem. This reduction, however, creates an instance of the n-SPI problem with a spread of 3n. Lemma 3 follows directly from this reduction.

Lemma 3.

Any algorithm that can solve the d-dimensional n-SPI problem under the 1 costs in T(n) time can also be used to solve an instance of minimum-cost bipartite matching under the 1 costs on a complete graph in T(n) time.

Related work.

For a graph with m edges and n vertices, the classical Hungarian algorithm computes a minimum-cost t-matching for all values of 0tn [11, 16]. Starting with an empty matching, the Hungarian algorithm iteratively builds a minimum-cost i-matching from the maintained minimum-cost (i1)-matching in O(m+nlogn) time by finding a minimum net-cost augmenting path, i.e., an augmenting path that increases the matching cost by the smallest value. The overall execution time of the Hungarian algorithm is O(nm+n2logn), or O(n3) when m=Θ(n2). Despite substantial efforts, this remains the most efficient algorithm for the problem. Notable exceptions include specialized cases, such as graphs with small vertex separators [13] or integer edge weights [2, 5, 6].

In geometric settings, Vaidya showed that each iteration of the Hungarian algorithm can be implemented in O~(nΦ(n)) time, where Φ(n) represents the query/update time of a dynamic weighted nearest neighbor (DWNN) data structure. Thus, the minimum-cost t-matching can be computed in O(n2Φ(n)) time, which is sub-cubic in n provided Φ(n) is sub-linear. For instance, for the 1 norm and d dimensions, Φ(n)=O(logdn) [27] and for the 2 norm and 2 dimensions, Φ(n)=logO(1)n [8]. In these cases, the Hungarian algorithm can be implemented in near-quadratic time.

Designing algorithms that compute a minimum-cost matching using sub-quadratic DWNN queries remains a central open problem in computational geometry. There are three notable exceptions. First, for points with integer coordinates and the 1 and norms, Sharathkumar and Agarwal [26] adapted a cost-scaling algorithm [5] and presented an algorithm that executes in O~(n3/2Φ(n)) time. Second, Sharathkumar [25] extended this result to 2-dimensional point sets with integer coordinates and the 2 costs. Their result, however, relies on planarity as well as the edge costs being the square root of integers and does not extend to d-dimensional points with real-valued coordinates. Third, Gattani et al. [7] presented a divide-and-conquer algorithm (GRS algorithm) with a worst-case runtime of O~(n2Φ(n)logΔ), where Δ is the spread of the points. For 2-dimensional stochastic points drawn from an unknown distribution, however, the expected runtime of the GRS algorithm improves to O~(n7/4Φ(n)logΔ).

Refer to caption
Refer to caption
Refer to caption
Figure 2: Illustration of the GRS algorithm.

The GRS algorithm uses a randomly-shifted quadtree to divide the problem into smaller subproblems. Within each square of the quadtree, it recursively computes a minimum-cost extended matching, allowing each point of B in to match either to a point of A in or to the boundaries of (Figure 2(left)). The algorithm then combines the matchings of the child squares by erasing their common boundaries, freeing points of B that were matched to those boundaries (Figure 2(middle)), and then it iteratively matches the freed points.

Gattani et al. [7] showed that for stochastic point sets A and B, most points in B will match to a close-by point in A and only O~(n3/4) points will match to boundaries. Thus, erasing these boundaries creates O~(n3/4) free points, each again matched in O(nΦ(n)) time, resulting in an overall runtime of O~(n7/4Φ(n)). However, this efficiency does not extend to arbitrary point sets. For instance, if all points in A lie in one child 1 and all points in B lie in another child 2, then all edges of a minimum-cost matching cross the boundaries. In this case, the minimum-cost extended matching in 2 matches all points in B to its boundary (Figure 2(right)), and erasing the boundary creates n free points. Hence, the merge step takes Ω(n2Φ(n)) time. Furthermore, unlike the Hungarian algorithm, the GRS algorithm does not guarantee optimal intermediate matchings and cannot compute minimum-cost t-matchings.

Our results.

The optimal solutions to the k-SP (resp. k-SPI) problems can be computed in O~(nkΦ(n)) time by non-trivially adapting the Hungarian algorithm to find a minimum-cost (nk)-matching (resp. n-matching) in 𝒢σ (resp. 𝒢σ). This algorithm, however, makes quadratic queries to a DWNN data structure when k=Θ(n). The main contribution of this paper is the design of a novel algorithm that, for any k, computes the optimal solution to the k-SP and k-SPI problems using only a sub-quadratic number of DWNN queries.

Theorem 4.

Given any sequence σ (resp. σ=ησ) of n requests (resp. n requests and k initial server locations) in 2 dimensions with a spread of Δ, and a value 1kn, there exists a deterministic algorithm that computes the optimal solution for the instance of k-SP (resp. k-SPI) problem under the p norm in O~(min{nk,n1.8logΔ}Φ(n)) time.

Our algorithm also extends to higher dimensions, and for any dimension d2, it computes optimal solutions to the k-SP and k-SPI problems in O~(min{nk,n212d+1logΔ}Φ(n)) time.

Designing geometric bipartite matching algorithms that perform a sub-quadratic number of queries to a DWNN data structure is challenging. Nevertheless, Theorem 4 shows that the bipartite matching instances generated by k-SP and k-SPI problems with bounded spread can be solved using sub-quadratic DWNN queries. For unbounded spread cases, the challenge remains elusive, at least for the k-SPI problem since, by Lemma 3, such an algorithm yields a sub-quadratic solution for the d-dimensional minimum-cost bipartite matching problem under 1 costs.

Our algorithm uses a hierarchical partitioning tree, whose nodes (referred to as cells) are axis-parallel rectangles with an aspect ratio of at most 3, and each cell splits into two smaller rectangles, forming its children. Our algorithm maintains a set of current cells 𝒞 that partition the input points and computes a minimum-cost extended (nk)-matching, where the points in B are allowed to match to the cell boundaries. It then replaces a pair of sibling rectangles in 𝒞 with their parent, effectively erasing their shared boundary and creating additional free points. These free points are then matched again by finding minimum net-cost augmenting paths. When all the boundaries are erased, the algorithm terminates with the desired minimum-cost (nk)-matching.

Our efficiency analysis faces three main hurdles. First, while finding a minimum net-cost augmenting path typically requires a search on the entire graph, we show that for extended matchings, such paths lie entirely within a current cell, allowing efficient local searches inside each current cell and selecting the global minimum across cells. Second, bounding the time to merge two cells is challenging, especially since some current cells may hold Θ(n) points, where each point is matched to a far away point in the optimal solution (Figure 3(left)). We address this challenge by showing that any minimum-cost extended matching has only O(n0.8) points matched to the shared boundary. To establish this, we critically use the fact that every sub-problem has a hidden low-cost high-cardinality matching with sub-linearly many free points (see Figure 3 (right)). Finally, the k free points in our extended matching M may differ from those in the minimum-cost (nk)-matching M. For instance, a point bB may be free in M but matched to the boundary in M, leaving another point b unmatched. While correcting such mismatches via alternating and augmenting paths can take Θ(n) time each (leading to a naïve bound of O(nk)), we use geometry to show that only O(n0.8) such corrections occur for each cell, yielding an overall runtime to O~(n1.8Φ(n)logΔ).

Refer to caption
Refer to caption
Figure 3: (left) A sub-problem of the k-SP problem, where the optimal solution has a high cost, and (right) there exists a low-cost high-cardinality matching inside the sub-problems.

Our proof techniques also refine the analysis of the GRS algorithm when the cost between points aA and bB is ab2q for any q2. Prior work showed that the GRS algorithm computes the minimum-cost perfect matching between two 2-dimensional stochastic point sets in O~(n212(q+1)Φ(n)) time [7], which implies a quadratic number of queries to the DWNN data structure as q. Raghvendra et al. [20] observed that, for any q1, there exists a low-cost, high-cardinality matching with sublinear free points. Building on a similar observation and our novel analysis techniques, we show that the GRS algorithm makes only a sub-quadratic number of DWNN queries, regardless of the value of q.

Theorem 5.

Suppose U is a set of 2n points inside the unit square and A is a subset chosen uniformly at random from all subsets of size n. Let B=UA. Then, there exists an algorithm that computes the minimum-cost perfect matching on the complete bipartite graph on A and B under 2q costs in O~(n7/4Φ(n)logΔ) expected time.

The setting originally considered in the analysis of the GRS algorithm [7], where A and B are samples from the same distribution, is a special case of randomly partitioning a set of 2n points into two sets A and B of n points, considered in Theorem 5.

Due to space limitations, we restrict the description of our algorithm and its analysis to the k-SP problem in 2 dimensions. All other results, including extensions to higher dimensions, are presented in the full version of our paper.

2 Geometric Primal-Dual Framework

Let σ be an input to the k-SP problem, where the distance between two locations a and b is given by d(a,b)=abp. In this section, we introduce a primal-dual framework based on hierarchical partitioning to compute a minimum-cost (nk)-matching in 𝒢σ=(AB,EA×B). We begin by describing the hierarchical partitioning scheme.

2.1 Hierarchical Partitioning

Using λ:=9n1/5, we construct a hierarchical partitioning recursively. Each node of is an axis-parallel rectangle, referred to as a cell. The root node, :=[3n,3n]2, contains all points in AB. For each node , let A and B be the points of A and B inside and let n=|AB|. If n2 (i.e., is empty or contains the entry and exit gates of a single request), then is marked as a leaf node. Otherwise, we partition into two smaller rectangles as follows. Let be the larger of the length and width of rectangle . Without loss of generality, assume that is the width of and let xmin be the x-coordinate of the bottom-left corner of . For any value x^[xmin+3,xmin+23], define Λ(x^):={uAB:|uxx^|λ}; here, ux denotes the x coordinate of the point u. Let x:=argminx^[xmin+3,xmin+23]|Λ(x^)|. We partition into two smaller rectangles by using a vertical line defined by x=x and add them as the children of to . We refer to the segment partitioning into its two children as its divider and denote it by Γ. See Figure 4(left). For any cell , the four sides of its rectangle are defined by the dividers of its ancestor or the boundaries of the root square. This completes the construction of . Note that the height of the tree is O(lognΔ). A simple sweep-line algorithm can compute x in O(nlogn) time. Using this procedure, we construct in O~(nlog(nΔ)) time.

Refer to caption
Refer to caption
Figure 4: (left) Partitioning a rectangle into two children (the purple dashed vertical line is the divider), and (right) a 𝒞-extended 20-matching with 9 matched points (blue discs), 11 boundary-matched points (blue circles), and 8 free points (blue crosses). The matching cost is the total length of the solid and dashed lines. The boundary-matched point b is matched to the divider Γ.
Lemma 6.

For each cell of , the ratio of the largest to the smallest side of is at most 3. Furthermore, the number of points of AB with a distance smaller than λ to the divider Γ is O(nλ).

Recollect that a matching M in 𝒢σ is a subset of vertex-disjoint edges. We refer to a point bB as unmatched in M if it does not have an edge of M incident on it and matched otherwise. The following structural property of the k-SP problem will be critical in bounding the efficiency of our algorithm.

Lemma 7.

For any cell of , there exists a matching M between AB that matches all except O(n4/5) points of B and has a cost O(n3/5).

2.2 Extended Bipartite Matching

Suppose we are given a subset 𝒞 of cells from that partitions , i.e., the cells of 𝒞 are interior disjoint and these cells cover the root square . Let d(u,) denote the shortest distance from u to the boundaries of the cell . For any point u inside , let u be the cell of 𝒞 that contains u. We define d(b,𝒞)=d(b,b). We extend the definition of matching to allow points in B to match to the boundaries of cells in 𝒞. A 𝒞-extended matching consists of a matching M as well as a subset B𝒞 of points of B that are unmatched in M but instead matched to the boundaries of the cells of 𝒞 that contain them. See Figure 4(right). The cost of a 𝒞-extended matching M𝒞 is

w𝒞(M𝒞):=(a,b)Md(a,b)+bB𝒞d(b,𝒞). (1)

We refer to all points of B𝒞 as boundary-matched. All points of B that are neither matched in M nor boundary-matched are considered free. All points of A that are not matched in M are also considered free. The size of M𝒞 is equal to |M|+|B𝒞|. When 𝒞 is clear from the context, we refer to M𝒞 as an extended matching. An extended matching M𝒞 of size t with the minimum cost is called a minimum-cost 𝒞-extended t-matching.

Consider the partitioning 𝒞={}, where is the root cell of . Using the fact that the input points are far from the boundaries of , we show in Lemma 8 below that any minimum-cost 𝒞-extended matching M𝒞 of size t is also a minimum-cost t-matching, i.e., no point of B is boundary-matched in M𝒞.

Lemma 8.

Suppose 𝒞={}, where is the root cell of . Let M𝒞=(M,B𝒞) be a minimum-cost extended t-matching on 𝒢σ, for t<n. Then, the matching M is a minimum-cost t-matching.

Let M𝒞=(M,B𝒞) denote a 𝒞-extended matching. Any path P on the graph 𝒢σ whose edges alternate between matching and non-matching edges in M is called an alternating path. An alternating path P is called an augmenting path if P starts from a free point bB and ends with either (i) a free point aA, or (ii) a point bB. We augment the extended matching M𝒞 along an augmenting path P by updating its matching MMP and for case (ii), we match b to the boundary and update B𝒞 to include b. The net-cost of P in case (i) is ϕ(P):=(a,b)PMd(a,b)(a,b)PMd(a,b), and in case (ii) is

ϕ(P):=d(b,𝒞)+(a,b)PMd(a,b)(a,b)PMd(a,b).

From Lemma 8, given a sequence σ of n requests in the unit square, one can compute an optimal solution to the k-SP problem on σ by computing a minimum-cost 𝒞-extended (nk)-matching on 𝒢σ. Given a partitioning 𝒞, to compute a minimum-cost 𝒞-extended (nk)-matching, similar to the Hungarian algorithm, one can start from an empty extended matching M𝒞 and iteratively augment M𝒞 along a minimum net-cost augmenting path. In the next section, we present a primal-dual framework that our algorithm uses to efficiently compute minimum net-cost augmenting paths.

2.3 A Constrained Dual Formulation for Extended Matchings

Suppose 𝒞 is a set of cells of partitioning the root cell . Consider a 𝒞-extended matching M𝒞=(M,B𝒞) on 𝒢σ along with a set of non-negative dual weights y:AB0. Let AF be the set of free points of A with respect to M𝒞. We say that M𝒞,y() is feasible if,

y(b)y(a) d(a,b), (a,b) E, (2)
y(b)y(a) =d(a,b), (a,b) M, (3)
y(b) d(b,𝒞), b B, (4)
y(b) =d(b,𝒞), b B𝒞, (5)
y(a) =0, a AF. (6)

For any edge (a,b)E, the slack of (a,b) is defined as s(a,b):=d(a,b)y(b)+y(a). The edge (a,b) is admissible if s(a,b)=0. For any point bB, the slack of b is defined as s(b):=d(b,𝒞)y(b). For any feasible extended matching M𝒞,y(), the slack of every edge as well as every point bB is non-negative. Recall that an augmenting path P starts at a free point bB and ends at (i) a free point aA or (ii) a point bB. The path P is admissible if all edges of P are admissible and in case (ii), the slack of the end-point b is s(b)=0. The following properties of extended feasible matchings are critical in the design of an efficient and correct algorithm.

Lemma 9.

Given a feasible 𝒞-extended t-matching M𝒞=(M,B𝒞) and a set of non-negative dual weights y() on AB, let P be a minimum net-cost augmenting path with respect to M𝒞. Let, for any 𝒞, y=maxbBy(b). Then,

  1. (a)

    all points of P lie inside a single cell of 𝒞, and

  2. (b)

    if, for every cell 𝒞, yϕ(P) and for all free points bB, y(b)=y, then M𝒞 is a minimum-cost extended t-matching.

The property described in Lemma 9(a) is important for the design of an efficient algorithm. Unlike the Hungarian algorithm, which searches the entire graph for the minimum net-cost augmenting path, our algorithm can find the minimum net-cost augmenting path by searching for the cheapest augmenting path inside each cell 𝒞 and then taking the smallest among them. Thus, we can replace a global search with a search inside each cell of 𝒞. The property in Lemma 9(b) is important for the design of a correct algorithm since it provides conditions under which an extended matching is a minimum-cost extended matching. Our algorithm is designed to maintain these conditions as invariants during its execution. Lemma 10 provides a method to update the dual weights, which is essential during the process of merging cells.

Lemma 10.

Suppose M𝒞,y() is a feasible 𝒞-extended matching and P is a minimum net-cost augmenting path. For any cell 𝒞, define y=maxbBy(b), and suppose yϕ(P) and y(bf)=y for all free points bfB. Then, one can update the dual weights in O~(nΦ(n)) time such that M𝒞,y() remains feasible, y(b)ϕ(P) for all bB, and y(bf)=ϕ(P) for all free points bfB.

The next lemma provides critical properties that allow for correctly and efficiently merging cells in 𝒞.

Lemma 11.

For a cell of , suppose and ′′ denote its two children, and let 𝒞 denote a partitioning containing and ′′. Let 𝒞=𝒞{}{,′′}. Given a feasible 𝒞-extended matching (M,B𝒞),y(), let B𝒞B𝒞 denote the subset of boundary-matched points that are matched to the divider Γ of . Then,

  1. (a)

    the 𝒞-extended matching (M,B𝒞B𝒞),y() is also feasible, and,

  2. (b)

    |B𝒞|=O(n4/5).

From Lemma 11(a), erasing a divider does not cause the feasibility conditions to be violated. The proof of Lemma 11(a) relies on the fact that when we erase the divider of a cell in 𝒞, the RHS of (4) will only increase and so it is not violated. Despite preserving the feasibility conditions, erasing the boundary may result in the violation of Lemma 9(b), i.e., the matching may no longer be a minimum-cost extended matching. In our algorithm in Section 3, we describe a process to adjust the matching M𝒞 and dual weights y() and obtain a minimum-cost extended matching.

Residual Graph.

Similar to the Hungarian algorithm, we define a residual graph that assists in finding the minimum net-cost augmenting path. Consider a feasible 𝒞-extended matching M𝒞=(M,B𝒞) along with a set of dual weights y() on points of AB. For each cell 𝒞, we define a residual graph 𝒢. The vertex set of 𝒢 is a source vertex s and the points in AB. For any edge (a,b)E inside , if (a,b)M (resp. (a,b)M), there is an edge directed from a to b (resp. from b to a) with a weight s(a,b) in 𝒢. Furthermore, there is an edge directed from s to every free point bB with a weight y(b).

3 A Sub-Quadratic Algorithm for the 𝒌-SP Problem

In this section, we describe an algorithm that, given a sequence σ of n requests in 2-dimensions, computes the optimal solution to the k-SP problem in O~(n1.8Φ(n)log(nΔ)) time.

3.1 Algorithm

Initialize 𝒞 to the leaf cells of . Let M𝒞=(M,B𝒞) be the extended matching maintained by the algorithm and initialized to M= and B𝒞=. For each point vAB, let y(v) denote its dual weight initialized to y(v)=0. Let BF, initialized to B, be the free points of B with respect to M𝒞. For each cell that contains at least one free point bBF, let P denote the minimum net-cost augmenting path inside . Initially, since is a leaf of , it contains only one point bBF, and therefore, P is this point with a net-cost equal to d(b,𝒞). Our algorithm maintains a priority queue PQ storing every leaf cell 𝒞 with at least one free vertex with a key of ϕ(P). At any time during the execution of our algorithm, let min be the cell with the smallest key in PQ and let φ be the key of min. Execute the following steps until PQ becomes empty:

  • While |BF|>k,

    • Extended Hungarian search step: Extract the cell with the minimum key of φ from PQ. Augment the matching M𝒞 along P and update the key of in PQ (See Section 3.1.1 for details).

  • Merge step: If 𝒞={}, remove from PQ and return the matching M of M𝒞. Otherwise, pick a cell 𝒞 with the smallest perimeter and let and ′′ be the parent and sibling of in , respectively. Erase the divider of , i.e., set 𝒞=𝒞{,′′}{}. We execute a Merge procedure that updates the matching M𝒞 inside the cell so that ϕ(P) is at least φ (See Section 3.1.2 for details). At this point, the size of the updated extended matching M𝒞 may not be (nk), i.e., there may be more than k free points.

Invariants.

For each cell 𝒞, let y=maxbBy(b). During the execution of our algorithm,

  1. (I1)

    the extended matching M𝒞,y() is feasible,

  2. (I2)

    For each cell 𝒞, yφ and for all free point bB, y(b)=y, and,

  3. (I3)

    The φ-value is non-decreasing. Furthermore, after each step of the algorithm, φ denotes the smallest net-cost of all augmenting paths with respect to M𝒞.

3.1.1 Details of the Extended Hungarian Search Step

Given a feasible extended matching M𝒞,y() and a cell 𝒞, the extended Hungarian search procedure computes the minimum net-cost augmenting path P and augments M𝒞 along P. It then computes the new minimum net-cost augmenting path and updates the key of in PQ to be its net-cost. This procedure is similar to the classical Hungarian search procedure executed on 𝒢 and is mildly modified to include the augmenting paths that end at the boundary of . Details of the procedure are as follows.

  1. 1.

    Update duals: With s as the source vertex, execute Dijkstra’s shortest path algorithm on the residual graph 𝒢. Let Pv be the shortest path from s to each vAB and let κv be the cost of Pv. Let

    κ=min{minaAFκa,minbBκb+s(b)}. (7)

    For any vAB, if κv<κ, set y(v)y(v)+κκv.

  2. 2.

    Augment: Let uAFB be the point realizing the minimum distance in Equation (7). Let P be the augmenting path obtained by removing s. Augment M𝒞 along P.

  3. 3.

    Update key: If B has no free points, then remove from PQ. Otherwise,

    1. (a)

      Recompute the residual graph 𝒢 with respect to the updated matching,

    2. (b)

      With s as the source, execute the Dijkstra’s shortest path algorithm on 𝒢. For each vAB, let κv be the distance from s to v.

    3. (c)

      Update the key of in PQ to κ=min{minaAFκa,minbBκb+s(b)}.

Lemma 12 establishes the properties of the extended Hungarian search procedure.

Lemma 12.

After the execution of the extended Hungarian search procedure for a cell , the extended matching M𝒞,y() remains feasible, y(v)φ for all points vAB, and y(bf)=φ for all free points bfB. Furthermore, the path P computed by the procedure is a minimum net-cost augmenting path inside . After augmenting along P, the updated key for is the smallest net-cost of all augmenting paths inside and is at least φ.

3.1.2 Details of the Merge Step

Given a feasible extended matching M𝒞=(M,B𝒞),y(), any cell of where both of its children and ′′ are in 𝒞, and a value φ, the merge procedure uses the algorithm in Lemma 10 to update the dual weights y() inside (resp. ′′) so that M𝒞,y() remains feasible, the dual weights of all points in (resp. ′′) are at most φ, and the dual weight of all free points bfB (resp. bf′′B′′) is y(bf)=φ (resp. y(bf′′)=φ). The procedure then updates 𝒞𝒞{}{,′′} and makes the points matched to the divider Γ free. While there exists a free point bB with y(b)<φ,

  1. 1.

    With s as the source, execute Dijkstra’s shortest path algorithm on the residual graph 𝒢. For each vAB, let Pv be the shortest path from s to v in 𝒢 and let κv be its cost. Define

    κ=min{minaAFκa,minbBκb+s(b),minbBκb+φy(b)}. (8)
  2. 2.

    Let uAFB be the point realizing the minimum value in Equation (8). Let P be the path obtained by removing s from the path Pu.

    1. (a)

      If uB and κ=κu+φy(u) (i.e., κ is determined by the third element in the RHS of Equation (8)), then P is a path from a free point bB to the matched point u. For each vAB, if κv<κ, update its dual weight to y(v)y(v)+κκv. The path P is an admissible alternating path with respect to the updated dual weights. Set MMP. Note that u is now a free point with y(u)=φ.

    2. (b)

      Otherwise, P is an augmenting path. For each vAB, if κv<κ, update its dual weight to y(v)y(v)+κκv. The path P is an admissible augmenting path with respect to the updated dual weights. Augment M along P.

At the end of this execution, all free points of B in have a dual weight of φ. Finally, we update the key for by executing steps 3(a)–(c) from the extended Hungarian search step.

The following lemma states the useful properties of the merge step.

Lemma 13.

After the execution of the merge procedure on a cell , the updated extended matching M𝒞,y() is feasible, the dual weights y(v) for every vAB is at most φ, and y(bf)=φ for all free points bfB. Furthermore, the updated key for is the smallest net-cost of all augmenting paths within and is at least φ.

3.2 Analysis

We begin by showing in Section 3.2.1 that the three invariants (I1)–(I3) hold during the execution of our algorithm and use them to show the correctness of our algorithm. We then show in Section 3.2.2 that the running time of our algorithm is O~(n9/5Φ(n)lognΔ).

3.2.1 Correctness

Our algorithm initializes M𝒞 with a feasible 𝒞-extended matching and sets all dual weights and φ to 0. Therefore, (I1) and (I2) hold at the start of the algorithm. The extended Hungarian search (Lemma 12) as well as the merge step (Lemma 13) do not violate the feasibility of the extended matching and therefore (I1) holds during the execution of the algorithm. The extended Hungarian search (Lemma 12) and the merge (Lemma 13) procedures keep the dual weight of every point inside at or below φ, while ensuring that the dual weight of free points inside is φ; hence, (I2) holds. Finally, both the extended Hungarian search (Lemma 12) and the merge (Lemma 13) procedures update the key of to the smallest net-cost of all augmenting paths inside and do not decrease the key of any cell. From this observation, (I3) follows in a straightforward way.

From (I1) and (I2), our algorithm maintains a feasible 𝒞-extended matching where, for each cell 𝒞, yφ. From (I3), φ is equal to the minimum net-cost of all augmenting paths with respect to M𝒞; combining this with Lemma 9(b), we conclude that M𝒞 is a minimum-cost 𝒞-extended matching. Upon termination, the algorithm returns a minimum-cost 𝒞-extended (nk)-matching for 𝒞={}, which from Lemma 8 has no boundary-matched points. Therefore, this matching is also a minimum-cost (nk)-matching, as desired.

3.2.2 Efficiency

Both the merge step and the extended Hungarian search step require an execution of Dijkstra’s shortest path algorithm on 𝒢. In the full version of our paper, we show that this execution takes O~(nΦ(n)) time. Using this, we analyze the execution time.

We begin by establishing a bound on the execution time of the merge step, which combines and ′′ into a single cell . At the start of this step, the dual weight of all free points in and ′′ are raised to φ (from Lemma 10). As a result, once the divider is removed, the only free points with dual weights below φ are those that are matched to the divider Γ. From Lemma 11(b), the number of points matched to Γ is O(n4/5). Therefore, the while-loop in the merge procedure executes only O(n4/5) times. Since each iteration takes O~(nΦ(n)) time, the total execution time of a single execution of the merge step is O~(n4/5nΦ(n)). Given that each point is in only O(lognΔ) many cells of , the total time taken by the merge step across all cells of is O~(n9/5Φ(n)lognΔ).

Similarly, if the execution time for the extended Hungarian search within a single cell is bounded by O(n4/5nΦ(n)), then the cumulative execution time of the extended Hungarian search across all cells – and consequently, the total runtime of the entire algorithm – can be bounded by O~(n9/5Φ(n)lognΔ). In the remainder of our analysis, we establish a bound of O(n4/5nΦ(n)) for the time taken by the extended Hungarian search within a single cell . Recall that the algorithm selects a cell containing the minimum net-cost augmenting path from the priority queue PQ and performs an extended Hungarian search procedure within , requiring O~(nΦ(n)) time. To analyze the total execution time of the extended Hungarian search procedure, we show that any cell can be selected by the algorithm at most O(n4/5) times. In particular, we categorize the selection of as a low-net-cost case if φn1/5 and a high-net-cost case otherwise. First, we show that in the high-net-cost case (φ>n1/5), the number of free points remaining in is O(n4/5), and as a result, the total number of high-net-cost selections of is O(n4/5).

Lemma 14.

Given a feasible extended matching M𝒞,y() and any cell 𝒞, if the net-cost of the minimum net-cost augmenting path inside is greater than n1/5, then the number of free points of M𝒞 is O(n4/5).

Next, we bound the number of low-net-cost selections of . Define 𝒞 as the set of all cells that are processed by the merge procedure while 𝒞 and φn1/5 (Figure 5). Our algorithm always picks the smallest perimeter cells to merge, and as a result, we obtain the following lemma.

Lemma 15.

For any non-leaf cell in and any cell 𝒞, 1394.

For any cell 𝒞, the merge step erases the divider Γ and makes the points that are matched to Γ free. Each of these new free points might cause to be selected by the algorithm. Therefore, to bound the number of low-net-cost selections of , we show that the total number of points that are matched to the dividers of the cells in 𝒞 is at most O(n4/5). For any cell 𝒞, let denote the set of points of B𝒞 that are matched to the divider Γ when our algorithm starts the merge step on . Thus, we have to bound 𝒞|| by O(n4/5). By invariant (I2), for each point b, y(b)φn1/5. Furthermore, by Condition (5), y(b)=d(b,)=d(b,Γ). Therefore, the point b is within a distance n1/5 from the divider Γ.

Refer to caption
Refer to caption
Figure 5: (left) The set 𝒞 (the cells shaded in orange with dashed lines as their divider) for a cell (shaded in blue), and (right) any boundary-matched point in the gray area might cause a low-net-cost execution of the extended Hungarian search procedure on .

From Lemma 15, for each cell 𝒞 and each point b, the point b is within a distance n1/5<λ from the divider Γ, and from the construction of (Lemma 6), ||=O(nn1/5). Furthermore, from Lemma 15 and the construction of , each point bB can lie inside a constant number of cells in 𝒞; hence, 𝒞||=O(𝒞nn1/5)=O(n4/5). Therefore, the total number of low-net-cost selections of by the extended Hungarian search procedure is O(n4/5).

4 Conclusion and Open Questions

We presented an exact algorithm for the k-SP and k-SPI problems on d-dimensional point sets with bounded spread Δ, achieving sub-quadratic queries to a DWNN data structure and only logarithmic dependence on Δ. We highlight two open directions: First, can the O(logΔ) dependence be removed? This would yield sub-quadratic algorithms for geometric bipartite matching, addressing a central open problem in computational geometry. Second, our reductions frame the k-server problem as a mild variant of online metric matching. This connects with extensive work on the online k-server problem [1, 3, 9, 10, 12, 14, 21, 23]. The reduction suggests simplifications and improvements to work function-based implementations, including the scalable algorithm by Raghvendra and Sowle [21]. Moreover, can we adapt the RM algorithm [15, 17, 18], which is the best-known online metric algorithm, to establish tighter bounds on its competitive ratio for k-server?

References

  • [1] Sébastien Bubeck, Michael B Cohen, Yin Tat Lee, James R Lee, and Aleksander Mądry. K-server via multiscale entropic regularization. In Proc. 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 3–16, 2018.
  • [2] Li Chen, Rasmus Kyng, Yang P Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. In Proc. 63rd IEEE Annual Sympos. Foundations of Computer Science, pages 612–623. IEEE, 2022. doi:10.1109/FOCS54457.2022.00064.
  • [3] M. Chrobak and L. L. Larmore. An optimal on-line algorithm for k servers on trees. SIAM Journal of Computing, 20(1):144–148, 1991. doi:10.1137/0220008.
  • [4] Marek Chrobak, H Karloof, Tom Payne, and Sundar Vishwnathan. New results on server problems. SIAM Journal on Discrete Mathematics, 4(2):172–181, 1991. doi:10.1137/0404017.
  • [5] H. N. Gabow and R. E. Tarjan. Faster scaling algorithms for network problems. SIAM Journal of Computing, 18(5):1013–1036, October 1989. doi:10.1137/0218069.
  • [6] Harold N. Gabow and Robert Endre Tarjan. Faster scaling algorithms for general graph-matching problems. Journal ACM, 38(4):815–853, 1991. doi:10.1145/115234.115366.
  • [7] Akshaykumar Gattani, Sharath Raghvendra, and Pouyan Shirzadian. A robust exact algorithm for the Euclidean bipartite matching problem. Advances in Neural Information Processing Systems, 36, 2024.
  • [8] Haim Kaplan, Wolfgang Mulzer, Liam Roditty, Paul Seiferth, and Micha Sharir. Dynamic planar Voronoi diagrams for general distance functions and their algorithmic applications. Discrete & Computational Geometry, 64:838–904, 2020. doi:10.1007/S00454-020-00243-7.
  • [9] E. Koutsoupias. The k-server problem. Computer Science Review, 3(2):105–118, 2009. doi:10.1016/J.COSREV.2009.04.002.
  • [10] Elias Koutsoupias and Christos H. Papadimitriou. On the k-server conjecture. Journal of the ACM, 42(5):971–983, 1995. doi:10.1145/210118.210128.
  • [11] Harold W Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1-2):83–97, 1955.
  • [12] James R. Lee. Fusible HSTs and the randomized k-server conjecture. In Mikkel Thorup, editor, Proc. 59th IEEE Annual Symposium on Foundations of Computer Science, pages 438–449, 2018. doi:10.1109/FOCS.2018.00049.
  • [13] Richard J Lipton and Robert Endre Tarjan. Applications of a planar separator theorem. SIAM Journal on Computing, 9(3):615–627, 1980. doi:10.1137/0209046.
  • [14] Mark S. Manasse, Lyle A. McGeoch, and Daniel D. Sleator. Competitive algorithms for server problems. Journal of Algorithms, 11(2):208–230, 1990. doi:10.1016/0196-6774(90)90003-W.
  • [15] Krati Nayyar and Sharath Raghvendra. An input sensitive online algorithm for the metric bipartite matching problem. In Proc. 58th IEEE Annual Symposium on Foundations of Computer Science, pages 505–515, 2017. doi:10.1109/FOCS.2017.53.
  • [16] Abhijeet Phatak, Sharath Raghvendra, Chittaranjan Tripathy, and Kaiyi Zhang. Computing all optimal partial transports. In Proc. 11th Internat. Conference on Learning Representations, 2022.
  • [17] Sharath Raghvendra. A robust and optimal online algorithm for minimum metric bipartite matching. In Approximation, Randomization, and Combinatorial Optimization, 2016.
  • [18] Sharath Raghvendra. Optimal analysis of an online algorithm for the bipartite matching problem on a line. In 34th International Symposium on Computational Geometry, pages 67:1–67:14, 2018. doi:10.4230/LIPICS.SOCG.2018.67.
  • [19] Sharath Raghvendra, Pouyan Shirzadian, and Rachita Sowle. Geometric bipartite matching based exact algorithms for server problems, 2025. arXiv:2504.06079.
  • [20] Sharath Raghvendra, Pouyan Shirzadian, and Kaiyi Zhang. A new robust partial p-Wasserstein-based metric for comparing distributions. In 41st Internat. Conference on Machine Learning, 2024.
  • [21] Sharath Raghvendra and Rachita Sowle. A scalable work function algorithm for the k-server problem. In 18th Scandinavian Symposium and Workshops on Algorithm Theory, volume 227, 2022. doi:10.4230/LIPICS.SWAT.2022.30.
  • [22] Tomislav Rudec, Alfonzo Baumgartner, and Robert Manger. A fast implementation of the optimal off-line algorithm for solving the k-server problem. Mathematical Communications, 14(1):119–134, 2009.
  • [23] Tomislav Rudec, Alfonzo Baumgartner, and Robert Manger. A fast work function algorithm for solving the k-server problem. Central European Journal of Operations Research, 21:187–205, 2013. doi:10.1007/S10100-011-0222-7.
  • [24] Tomislav Rudec and Robert Manger. A new approach to solve the k-server problem based on network flows and flow cost reduction. Computers & operations research, 40(4):1004–1013, 2013. doi:10.1016/J.COR.2012.11.006.
  • [25] R. Sharathkumar. A sub-quadratic algorithm for bipartite matching of planar points with bounded integer coordinates. In Proc. 29th Annual Symposium on Computational Geometry, pages 9–16, 2013. doi:10.1145/2462356.2480283.
  • [26] R Sharathkumar and Pankaj K Agarwal. Algorithms for the transportation problem in geometric settings. In Proc. 23rd Annual ACM-SIAM Sympos. on Discrete Algorithms, pages 306–317, 2012. doi:10.1137/1.9781611973099.29.
  • [27] Pravin M Vaidya. Geometry helps in matching. SIAM Journal of Computing, 18(6):1201–1225, 1989. doi:10.1137/0218080.