arXiv is now an independent nonprofit! Learn more
License: CC BY-NC-SA 4.0
arXiv:2609.27231v1 [cs.DS] 23 Sep 2026

University of Konstanz, Germanygregor.diatzko@uni-konstanz.dehttps://orcid.org/0000-0002-0904-4910University of Konstanz, Germany and ENSEIRB, Bordeaux, Francefelix.lasseux@labri.frhttps://orcid.org/0009-0003-8312-4702 University of Konstanz, Germanysabine.storandt@uni-konstanz.dehttps://orcid.org/0000-0001-5411-3834

cc-Packedness versus λ\lambda-Low-Density in Geometric Graphs: Theory and Practice

Gregor Diatzko    Félix Lasseux    Sabine Storandt
Abstract

When designing algorithms for geometric graphs, exploiting structural parameters can lead to significantly improved bounds. Two prominent parameters in this context are cc-packedness and λ\lambda-low density, both of which locally restrict graph complexity. Parameterized algorithms based on these parameters have been developed for computing well-separated pair decompositions, balanced separators, as well as distance oracles. Despite this theoretical progress, the practical applicability of algorithms parameterized by cc or λ\lambda remains unclear. While cc-packed and λ\lambda-low-density graphs have been proposed as realistic models for road networks, the actual parameter values of large real-world instances have so far remained unknown, and existing theoretical guarantees are partially too loose for practical usage. In this paper we first devise scalable implementations for the approximate computation of cc and the exact computation of λ\lambda. Our experimental evaluation on road networks with millions of edges reveals a significant gap between the two parameters. On the theoretical side we prove that c∈𝒪⁡(λ​n)c\in\mathcal{O}(\lambda\sqrt{n}) which complements the known result that λ∈𝒪⁡(c)\lambda\in\mathcal{O}(c). Furthermore we present improved parameterized algorithms for balanced separator computation that reduce the separator size in theory and practice. We also show how to compute a tree decomposition with a width linear in the respective parameterized balanced separator size in polynomial time. This structural result yields a variety of new algorithmic consequences. Among them is an exact distance oracle with query time 𝒪⁡(c)\mathcal{O}(c) for cc-packed graphs after polynomial-time preprocessing, which improves upon the previous 𝒪⁡(c​log⁡n)\mathcal{O}(c\log n) bound. Our experiments demonstrate that the proposed techniques efficiently produce small balanced separator and enable the construction of concise exact distance oracles on large road networks.

ccs
Theory of computation Graph algorithms analysis
keywords
Geometric Graph, Balanced Separator, Tree Decomposition, Distance Oracle
††runningauthor: G. Diatzko, F. Lasseux and S. Storandt††copyright: Gregor Diatzko, Félix Lasseux and Sabine Storandt††relatedversion: This is the full version of an article accepted at IPEC 2026.††supplement: Software: https://gitlab.inf.uni-konstanz.de/felix.lasseux/c-packed_edos††supplement: Software: https://gitlab.inf.uni-konstanz.de/ag-storandt/packedness-vs-density††editors: Tuukka Korhonen and Michael Lampis††event-title: 21th International Symposium on Parameterized and Exact Computation (IPEC 2026)††event-shorttitle: IPEC 2026††event-acronym: IPEC††year: 2026††event-date: September 2–4, 2026††event-location: L’Aquila, Italy††series-volume: 398††articleno: 27

1 Introduction

Identifying realistic graph classes that model road networks is an ongoing endeavor, with the goal to explain empirical observations—such as the existence of small balanced separators—and to develop efficient algorithms and data structures with provable bounds. Parameterized graph classes have been of great interest in this context. Most of the parameters considered so far, as treewidth tw [3], highway dimension hd [1] or skeleton dimension k [31], are based on the graph topology and the shortest path structure. For 𝚙∈{tw,𝚑𝚍,𝚔}{\tt p}\in\{{\texttt{tw}},{\tt hd},{\tt k}\} exact distance oracles with query times in 𝒪⁡(𝚙​log⁡n)\mathcal{O}({\tt p}\log n) can be constructed on a given graph G⁡(V,E)G(V,E) with nn nodes. The respective oracle construction algorithms are impractical though, as even approximate variants have running times that are either exponential in the parameter 𝚙{\tt p} or (super-)quadratic in nn. Throughput the paper, we call a parametrized algorithm practical if it has a running time of the form p​o​l​y​(𝚙)⋅𝒪~​(n)poly({\tt p})\cdot\tilde{\mathcal{O}}(n), as this allows it to scale to large graphs even when the parameter value is moderate. To achieve such running times, typically heuristics are used in implementations of parameterized distance oracles instead of exact or approximate algorithms [17, 13, 4], potentially forfeiting their respective theoretical guarantees.

However, recently new parameterized graph classes for road networks have been studied that solely rely on the geometry of the graph embedding. Two particularly successful notions are cc-packed graphs and λ\lambda-low density graphs. Informally, an embedded graph is cc-packed if the total length of edges contained in any ball of radius rr is at most c​rcr. Likewise, a graph has λ\lambda-low density if every ball of radius rr intersects at most λ\lambda edges of length at least rr. Thus, a small parameter values implies a certain notion of sparsity in both definitions. Practical algorithms for a variety of problems have been proposed under such sparsity assumptions. For cc-packed graphs, this includes the computation of a WSPD of size 𝒪⁡(c3​n)\mathcal{O}(c^{3}n) in time 𝒪⁡(c3​n​log⁡n)\mathcal{O}(c^{3}n\log n), a balanced separator of size 𝒪⁡(c)\mathcal{O}(c) in time 𝒪⁡(c2​n)\mathcal{O}(c^{2}n), and an exact distance oracle with a preprocessing time in 𝒪⁡(c2​n​log2​n)\mathcal{O}(c^{2}n\log^{2}n) and a query time in 𝒪⁡(c​log⁡n)\mathcal{O}(c\log n) [14]. For λ\lambda-low-density graphs, a WSPD can be constructed in time 𝒪⁡(λ2​n​log⁡n)\mathcal{O}(\lambda^{2}n\log n) [24], and a balanced separator of size 𝒪⁡(λ​n)\mathcal{O}(\lambda\sqrt{n}) can be computed in expected time 𝒪⁡(λ​n)\mathcal{O}(\lambda n) [32].

To assess the usefulness of these bounds, the question arises what the values of cc and λ\lambda are in large real-world networks. In this paper, we engineer algorithms to extract cc and λ\lambda, enabling us to compute their (approximate) values for road networks with millions of edges for the first time. Furthermore, we investigate the practical applicability of algorithms parameterized by cc or λ\lambda. We identify several theoretical bottlenecks and propose improved and novel algorithms to overcome them. In particular, we present the first exact distance oracle with a practical preprocessing time and 𝒪⁡(c)\mathcal{O}(c) query time. Unlike previous parameterized distance oracles, our implementation adheres to the theoretical guarantees while also scaling to large networks and exhibiting excellent query times in practice.

1.1 Related Work

The notion of cc-packedness was originally proposed to study polygonal curves [15]. It was shown in the same paper that computing the Fréchet distance between cc-packed curves only takes near-linear time. In [22], the concept was transferred to graphs and studied in the context of map matching. A plethora of other results for cc-packed curves or graphs have been established in the meantime, see e.g. [5, 20, 14, 9, 18]. For the computation of cc, an exact algorithm with a running time in 𝒪⁡(m3)\mathcal{O}(m^{3}) is known, where mm is the number of edges, if axis-aligned squares are used in the definition instead of balls [23]. Furthermore, approximation algorithms have been investigated, including a 22-approximation with a running time in 𝒪⁡(m2​log⁡m)\mathcal{O}(m^{2}\log m) [21], a (6+ε)(6+\varepsilon)-approximation with a running time in 𝒪~​((m/ε3)4/3)\tilde{\mathcal{O}}((m/\varepsilon^{3})^{4/3}) [34], and a recent 4242-approximation with an expected running time in 𝒪⁡(m​log2​m)\mathcal{O}(m\log^{2}m) and high success probability [27]. In [2], the authors propose the first exact algorithm for cc-packedness defined on balls with a running time in 𝒪⁡(m5)\mathcal{O}(m^{5}). Furthermore, they also improve the running time of the 22-approximation to 𝒪⁡(m2)\mathcal{O}(m^{2}) and the guarantee of the (6+ε)(6+\varepsilon)-approximation to (4+ε)(4+\varepsilon). To the best of our knowledge, only [21] also reports empirical results for cc, in particular for the 22-approximation. They evaluate their implementation on trajectory sets with small to moderate size. Oftentimes small cc values are reported. However no general graphs were considered and no running times were provided.

The study of λ\lambda-low-density was initiated in [39] in the context of motion planning amid obstacles. Later, it was shown to also be useful for map matching [8] as well as the design of approximation algorithms [26] and data structures [24]. An exact algorithm to compute λ\lambda with a running time in 𝒪⁡(n​log3​n+λ​n​log2​n+λ2​n)\mathcal{O}(n\log^{3}n+\lambda n\log^{2}n+\lambda^{2}n) was proposed in [12] and a 33-approximation with an improved running time of 𝒪⁡(n​log⁡n+λ​n)\mathcal{O}(n\log n+\lambda n) in [19]. The exact algorithm was tested in [12] on triangulations with up to 5000 points, and in [8] on small city road networks. In [19] a 44-approximation for λ\lambda (a slight simplification of the 33-approximation) was implemented and evaluated on a trajectory set with the largest containing roughly n=65 000n=$65\,000$ points. But again no running times were reported in any of these papers and thus scalability to general graphs, especially with million of edges, remained unclear.

1.2 Contribution

We present novel theoretical and practical results for algorithms parameterized by cc or λ\lambda.

  • •

    Parameter relationship. We prove that c∈𝒪⁡(λ​n)c\in\mathcal{O}(\lambda\sqrt{n}) and that this bound is tight. The upper bound allows to transform algorithms parameterized by cc into algorithms parameterized by λ\lambda and complements the known result λ∈𝒪⁡(c)\lambda\in\mathcal{O}(c) [15].

  • •

    Parameter computation. We present the first implementation for the exact computation of λ\lambda that scales to graphs with millions of edges as well efficient approximations for cc. Our experiments show that both parameters remain moderate even on very large road networks, with λ\lambda being consistently much smaller than cc.

  • •

    Balanced separators. It was shown in [14] that cc-packed graphs admit balanced separators of size 𝒪⁡(c)\mathcal{O}(c) and that such separators can be computed efficiently. However, we observe that the hidden constant in the size bound is prohibitively large in practice. We therefore develop techniques that substantially reduce the separator size without increasing the asymptotic running time. A key ingredient is an improved PTAS for the smallest enclosing square problem, which may be of independent interest. We also present an engineered separator algorithm and show that it consistently computes smaller balanced separators on road networks than KaHIP, a state-of-the-art graph partitioning framework [36].

  • •

    Tree decomposition. We show that a tree decomposition of width 𝒪⁡(c)\mathcal{O}(c) can be computed in time 𝒪⁡(c2​n​log⁡n)\mathcal{O}(c^{2}n\log n) time. While it was previously known that the treewidth of cc-packed graphs is bounded by 𝒪⁡(c)\mathcal{O}(c), existing algorithms for constructing such a decomposition were assumed to require exponential time [14]. Our efficient construction therefore enables, for the first time, the practical use of treewidth-based algorithms on cc-packed graphs after only polynomial-time preprocessing. As one application, combining our algorithm with the exact distance oracle of [10] yields a construction time 𝒪⁡(c3​n​log⁡n)\mathcal{O}(c^{3}n\log n) and distance query time 𝒪⁡(c)\mathcal{O}(c). This improves the previous best query time of 𝒪⁡(c​log⁡n)\mathcal{O}(c\log n) for cc-packed graphs. We also provide a careful implementation of our tree decomposition algorithm and show that it produces small bags on large real-world road networks, enabling the construction of highly efficient exact distance oracles in practice.

2 Parameter Definitions and Relationships

In the following, we consider simple undirected graphs embedded in the plane. Each vertex is associated with a point in the plane, and every edge is assigned its Euclidean length.

The definitions of the parameters considered in this paper appear in the literature using either balls or axis-aligned squares. Since every square can be covered by a constant number of balls of the same radius and every ball can be covered by a constant number of axis-aligned squares of the same radius, the two variants are equivalent up to a constant factor. Throughout the paper, the radius of a square is defined as half its side length.

Definition 1 (λ\lambda-low density).

A graph GG has λ\lambda-low density if for each square (ball) SS of radius rr, there are at most λ\lambda edges of GG that have length greater than rr and intersect SS.

Definition 2 (cc-packedness).

A graph GG is cc-packed if for each square (ball) SS of radius rr, the total length of the edges of GG clipped to SS is at most c​rcr.

Unless otherwise specified, we call the number of vertices of the graph nn and its number of edges mm. Note that both λ\lambda and cc are upper bounds for the maximum degree of a graph with λ\lambda-low density and packedness cc, so m∈𝒪⁡(n)m\in\mathcal{O}(n) if λ\lambda or cc is constant. It was already known that each graph has λ≤2​c\lambda\leq 2c [15], but for the other direction we give the following new result.

Lemma 3.

Let GG be a graph with λ\lambda-low density, then GG has packedness c∈𝒪⁡(λ​n)c\in\mathcal{O}\bigl(\lambda\sqrt{n}\bigr).

Proof.

Let SS be an arbitrary square of radius rr. W.l.o.g. assume r=1r=1; else scale GG and SS by 1/r1/r. We want to show that the total length of edges inside SS is 𝒪⁡(λ​n)\mathcal{O}\bigl(\lambda\sqrt{n}\bigr). There are at most λ\lambda edges whose intersection with SS has length greater than 22; this intersection has length at most 2​22\sqrt{2}. Let kk be some natural number to be determined shortly. For each i∈{0,…,k}i\in\{0,\ldots,k\} and for each of the 4i4^{i} squares of radius 2−i2^{-i} that cover SS, there can be at most λ\lambda edges whose intersection with SS has length between 2−i2^{-i} and 2−i+12^{-i+1}. Generally there can be at most λ​n\lambda n edges in GG since it has maximum degree λ\lambda. In particular there can be at most λ​n\lambda n edges of length at most 2−k2^{-k} intersecting SS. This covers all intersections of edges with SS. Their total length is

‖G∩S‖≤λ​2​2+∑i=0k4i​λ​2−i+1+λ​n​2−k≤4​λ​(1+2k+n​2−k).\|G\cap S\|\leq\lambda 2\sqrt{2}+\sum_{i=0}^{k}4^{i}\lambda 2^{-i+1}+\lambda n2^{-k}\leq 4\lambda\bigl(1+2^{k}+n2^{-k}\bigr).

With k:=⌊log⁡n⌋k:=\bigl\lfloor\log\sqrt{n}\bigr\rfloor the claim follows. ∎

This bound is tight: A (n×n)\bigl(\sqrt{n}\times\sqrt{n}\bigr)-grid graph has constant density but packedness Θ⁡(n)\Theta(\sqrt{n}).

3 Balanced Separators

Balanced separator computation is a core primitive in many algorithms. An α\alpha-balanced separator in G⁡(V,E)G(V,E) for α∈(0,1)\alpha\in(0,1) is a set of nodes S⊂VS\subset V such that all connected components in G⁡[V∖S]G[V\setminus S] contain at most α​n\alpha n nodes. Computing the smallest α\alpha-balanced separator for given α\alpha takes exponential time in general graphs, but in cc-packed and λ\lambda-low-density graphs efficient algorithms with parameterized separator size bounds are known. However, the hidden constants in the respective separator sizes are too large to be useful in practice. We thus device modified separator constructions with significantly improved separator sizes.

3.1 From Ball Separators to Square Separators in Geometric Graphs

In [32] a randomized algorithm for computing balanced separators in λ\lambda-low-density graphs11 1 The paper actually considers τ\tau-lanky graphs and proves a separator size in 𝒪⁡(τ​n)\mathcal{O}(\tau\sqrt{n}). However by definition, τ≤λ\tau\leq\lambda and thus the result directly transfers to low-density graphs. was proposed which guarantees a separator size in 𝒪⁡(λ​n)\mathcal{O}(\lambda\sqrt{n}). They prove that there always exists a ball BrB_{r} of radius rr that encloses a constant fraction of all nodes but not more than n2\frac{n}{2}, such that the number of edges of length at most rr intersecting the ball is in 𝒪⁡(λ​n)\mathcal{O}(\lambda\sqrt{n}). As there are at most λ\lambda edges of length greater than rr that intersect the ball by definition, the respective separator size follows. They argue that a ball with these properties can be computed in the Euclidean plane with an expected running time in 𝒪⁡(λ​n)\mathcal{O}(\lambda\sqrt{n}). For cc-packed graphs a deterministic algorithm was proposed in [14] that computes a balanced separator of size 𝒪⁡(c)\mathcal{O}(c) in time 𝒪⁡(c2​n)\mathcal{O}(c^{2}n). The idea is to compute two nested balls B=BrB=B_{r} and B′=B2​rB^{\prime}=B_{2r}, with BB enclosing at least a constant fraction of the nodes, and at least half of the nodes being outside of B′B^{\prime}. Then running a max-flow algorithm from border nodes inside BB to nodes outside B′B^{\prime} and using the max flow–min cut duality, a valid balanced separator is identified. See Figure 4 for an illustration of this algorithm.

{subfigure}

[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption

Figure 1: The first step consists in finding two nested balls B{\color[rgb]{0.9961,0.6289,0.5664}B} and B′{\color[rgb]{0.6484,0.3008,0.4102}B^{\prime}} enclosing a particular amount of vertices.
Figure 2: The second step is to solve a max-flow instance where sources are nodes inside B{\color[rgb]{0.9961,0.6289,0.5664}B}, here connected to the supersource ■{\color[rgb]{1,0,0}\mathord{\resizebox{}{486607}{\rotatebox[origin={c}]{45.0}{$\blacksquare$}}}}, and sinks are nodes outside B′{\color[rgb]{0.6484,0.3008,0.4102}B^{\prime}}, again connected to the supersink ■{\color[rgb]{0,0,1}\blacksquare}. Edge capacity is set to 1. From this, the min-cut (S,T)({\color[rgb]{1,0,0}S},{\color[rgb]{0,0,1}T}) is extracted.
Figure 3: Finally, cut edges can be identified, and the separator is defined as a vertex cover of the latter.
Figure 4: Illustration of the original separation method from [14].

They argue that for each separator node there needs to be a path of length at least 2​r−r=r2r-r=r from inside BB to outside B′B^{\prime} and the set of such paths needs to be edge disjoint. As the total length of edges inside B′B^{\prime} is bounded by 2​c​r2cr by definition of packedness, an upper bound of 2​c2c on the separator size follows. Given our newly established relationship between cc and λ\lambda in Lemma 3, we get the following corollary.

Corollary 4.

Each separator of size 𝒪⁡(c)\mathcal{O}(c) has size 𝒪⁡(λ​n)\mathcal{O}\bigl(\lambda\sqrt{n}\bigr).

This directly implies that the algorithm for cc-packed graphs works for λ\lambda-low-density graphs with a size bound matching the one shown in [32], but without relying on randomization.

method α\alpha |Sα||S_{\alpha}| |S2/3||S_{2/3}|
nested balls 1−12​δ3≈0.9981-\frac{1}{2\delta^{3}}\approx 0.998 2​c2c 406​c406c
+ better balance (bb) 1−1δ3+1≈0.9971-\frac{1}{\delta^{3}+1}\approx 0.997 2​c2c 270​c270c
+ approximation (apx) 1−1δ+1=0.8751-\frac{1}{\delta+1}=0.875 21−ε​c\frac{2}{1-\varepsilon}c 9​c9c
nested squares + bb + apx 1−15=0.8001-\frac{1}{5}=0.800 2​21−ε​c\frac{2\sqrt{2}}{1-\varepsilon}c 6​c6c
Table 1: Comparison of α\alpha-balanced separator computation methods for cc-packed graphs. The specified α\alpha is the provided balance guarantee and |Sα||S_{\alpha}| denotes the respective separator size. The column |S2/3||S_{2/3}| shows the separator size resulting from iterating the method until each component contains at most 23​n\frac{2}{3}n nodes (using ε=0.05\varepsilon=0.05 for the bottom two rows).

In principle the separator computation algorithm for cc-packed graphs as presented in [14] is practical. However there is one caveat: The balance factor that is guaranteed by the approach is (1−12​δ3)\left(1-\frac{1}{2\delta^{3}}\right) where δ\delta denotes the doubling constant of ℝd\mathbb{R}^{d}. For d=2d=2 we have δ=7\delta=7 and therefore the achieved balance factor is greater than 0.9980.998. To obtain a smaller balance factor α\alpha, this algorithm can be applied iteratively to the largest connected component of the graph after separator removal. If we use kk iterations, the resulting balance factor guarantee is α=(1−12​δ3)k\alpha=\left(1-\frac{1}{2\delta^{3}}\right)^{k} with a running time in 𝒪⁡(c2​n​k)\mathcal{O}(c^{2}nk). However the resulting separator consists in the worst-case of the union of all kk computed separators, increasing the separator size from 2​c2c to 2​k​c2kc. Thus to achieve α=12\alpha=\frac{1}{2}, we have to set k≈475k\approx 475 and therefore get a separator size bound of approximately 950​c950c. With such a large coefficient, the practical utility is void. In the following we will discuss how to decrease the coefficient significantly by (i) better balancing the number of nodes inside BB and outside B′B^{\prime}, (ii) leveraging (1+ε)(1+\varepsilon)-approximation algorithms for smallest enclosing ball, (iii) switching from balls to squares. Table 1 summarizes the (accumulated) impact of these improvements for the construction of a 23\frac{2}{3}-balanced separator.

Better Balance. The balance guarantee of α=(1−12​δ3)\alpha=\left(1-\frac{1}{2\delta^{3}}\right) shown in [14] relies on the following approach: BB is supposed to enclose k=n2​δ3k=\frac{n}{2\delta^{3}} nodes. However computing the smallest such ball with radius ro​p​tr_{opt} takes time in 𝒪⁡(n​k)\mathcal{O}(nk) [25] and thus for the chosen kk this results in a quadratic running time. Therefore a linear time algorithm is applied instead, which returns a ball BB with radius r≤2​ro​p​tr\leq 2r_{opt} [25]. Accordingly each ball of radius r2\frac{r}{2} contains strictly less than kk nodes. Then B′B^{\prime} is constructed from BB by doubling its radius, that is, r′=2​r≤4​ro​p​tr^{\prime}=2r\leq 4r_{opt}. Consequently B′B^{\prime} can be covered with at most δ3\delta^{3} balls of radius r2\frac{r}{2}. As a result B′B^{\prime} contains less than k​δ3=n2k\delta^{3}=\frac{n}{2} nodes. But the worst balance factor is anyway obtained in case only the kk nodes in BB are separated from the rest. Thus it suffices to ensure that there are at least as many nodes outside of B′B^{\prime} as inside of BB, that is, n−δ3​k=kn-\delta^{3}k=k which yields k=nδ3+1k=\frac{n}{\delta^{3}+1}. The respective improved balance factor shown in the second row of Table 1.

Smallest Enclosing Ball Approximation. To further improve α\alpha, we leverage the fact that in [25] not only a 22-approximation for smallest enclosing ball of kk points is presented but also a (1+ε)(1+\varepsilon)-approximation which runs in time 𝒪⁡(n+1ε3​log2​1ε)\mathcal{O}(n+\frac{1}{\varepsilon^{3}}\log^{2}\frac{1}{\varepsilon}) for ε>0\varepsilon>0 and k∈Ω⁡(n)k\in\Omega(n). We use this algorithm to compute a ball BB with radius r≤(1+ε′)​ro​p​tr\leq(1+\varepsilon^{\prime})r_{opt} for some ε′>0\varepsilon^{\prime}>0. We then choose ε∈(ε′,1)\varepsilon\in(\varepsilon^{\prime},1). Based thereupon, we know that r/(1+ε)<ro​p​tr/(1+\varepsilon)<r_{opt}. We set the radius of B′B^{\prime} to r′=2​r/(1+ε)r^{\prime}=2r/(1+\varepsilon). By the ball covering property, it directly follows that B′B^{\prime} contains at most δ​k\delta k nodes. To balance the number of nodes inside BB and outside B′B^{\prime}, we solve n−δ​k=kn-\delta k=k for kk and get nδ+1\frac{n}{\delta+1}, which results in a significant improvement in balance factor; see the third row of Table 1. However these modifications also affect the separator size. We know that each path from inside BB to outside of B′B^{\prime} has a length of at least r′−rr^{\prime}-r and the total length of all edge disjoint paths is upper bounded by c​r′cr^{\prime}. With r′=2​r/(1+ε)r^{\prime}=2r/(1+\varepsilon) we get c​r′r′−r=2​c1−ε\frac{cr^{\prime}}{r^{\prime}-r}=\frac{2c}{1-\varepsilon}.

Switching to Squares. To cover a ball in the plane, δ=7\delta=7 balls of half the radius are needed. However for a square with side length rr, we only need 44 squares of side length r2\frac{r}{2} to cover it. Thus if we can compute a (1+ε)(1+\varepsilon)-approximation for the smallest enclosing square of kk points, the analysis from above can be transferred with two differences: If the definition of cc relies on balls, then the segment lengths inside a square of side length rr is bounded by 2​c​r\sqrt{2}cr instead of c​rcr and thus the separator size bound increases proportionally. The second difference is that we can now set k=n5k=\frac{n}{5} as B′B^{\prime} will contain at most 4​k4k nodes and thus the number of nodes outside of B′B^{\prime} will also be at least n5\frac{n}{5}. This further improves the balance factor; see the fourth row in Table 1. In [6], the smallest enclosing rectangle problem was considered and a (1+ε)(1+\varepsilon)-approximation for the rectangle area was described which runs in 𝒪⁡(n​log⁡n​1ε3​log⁡1ε)\mathcal{O}(n\log n\frac{1}{\varepsilon^{3}}\log\frac{1}{\varepsilon}). By restricting the algorithm to consider squares, the area approximation translates into an approximation of side length, which is exactly what we need. However, by combining ideas from [25] and [6], we can design an algorithm directly tailored to side length approximation for smallest enclosing square that runs in 𝒪⁡(n+1ε2​log⁡1ε)\mathcal{O}(n+\frac{1}{\varepsilon^{2}}\log\frac{1}{\varepsilon}) for ε>0\varepsilon>0 and k∈Ω⁡(n)k\in\Omega(n) and is thus faster than the algorithms for balls and rectangles. The detailed algorithm description is provided in Appendix A. Given that for any fixed ε>0\varepsilon>0 the computation of the required square is in 𝒪⁡(n)\mathcal{O}(n), the running time of the separator computation is still dominated by the max-flow component. Therefore we match the 𝒪⁡(c2​n)\mathcal{O}(c^{2}n) running time of the nested ball approach. But now, we can construct an α=23\alpha=\frac{2}{3}-balanced separator with a practically useful size guarantee of 6​c6c when using ε=0.05\varepsilon=0.05, which is over a factor of 60 smaller than the original bound. This factor further increases for smaller choices of α\alpha.

4 Separator-Based Exact Distance Oracles

Given an algorithm that computes balanced separators, an exact distance oracle (EDO) can be constructed by computing a balanced hierarchical separator tree 𝒮\mathcal{S} and storing with each node per separator its shortest path distances to all nodes in the respective subgraph. See Figure 7 for an illustration of 𝒮\mathcal{S}. We refer to this data structure as 𝒮\mathcal{S}-EDO. In an aa-bb-query, first the separator bags in 𝒮\mathcal{S} containing aa and bb are identified, respectively. Then for nodes ww in the union of all bags from their lowest-common-ancestor bag to the root of 𝒮\mathcal{S}, distances d⁡(w,a)d(w,a) and d⁡(w,b)d(w,b) are looked up and the smallest sum of such distances is tracked. As balanced separators are used for the construction of 𝒮\mathcal{S}, its depth is logarithmic. Thus if every separator in 𝒮\mathcal{S} has a size in 𝒪⁡(c)\mathcal{O}(c), the space consumption is in 𝒪⁡(c​n​log⁡n)\mathcal{O}(cn\log n) and the query time is in 𝒪⁡(c​log⁡n)\mathcal{O}(c\log n). The data structure can be constructed in 𝒪⁡(c2​n​log2​n)\mathcal{O}(c^{2}n\log^{2}n) time [14].

When given a tree decomposition 𝒯\mathcal{T} with bag size tw, though, an alternative distance oracle (𝒯\mathcal{T}-EDO) was described in [10]. The construction time is in 𝒪⁡(tw3​n​log⁡n)\mathcal{O}({\texttt{tw}}^{3}n\log n), the space consumption in 𝒪⁡(tw⋅n​log⁡n)\mathcal{O}({\texttt{tw}}\cdot n\log n), and the query time in 𝒪⁡(tw)\mathcal{O}({\texttt{tw}}). It is known that cc-packed graphs have treewidth tw∈𝒪⁡(c){\texttt{tw}}\in\mathcal{O}(c) [16, 14]. However constructing a tree decomposition with maximum bag size tw takes 2𝒪⁡(tw2)​n𝒪⁡(1)2^{\mathcal{O}({\texttt{tw}}^{2})}n^{\mathcal{O}(1)} time [30], and no constant factor approximation algorithm for general graphs exists unless 𝖯=𝖭𝖯\mathsf{P}=\mathsf{NP} [40]. In this section we show how to compute 𝒯\mathcal{T} for cc-packed graphs of width 𝒪⁡(c)\mathcal{O}(c) in polynomial time. This makes a rich set of algorithms based on tree decompositions directly applicable to cc-packed graphs, including the improved distance oracle described in [10].

4.1 Tree Decompositions from Separators

A simple way to obtain a valid tree decomposition 𝒯\mathcal{T} using a balanced separator oracle is as follows: First construct a balanced hierarchical separator tree 𝒮\mathcal{S}, subsequently include in each separator bag XX all bags on the path from XX to the root of 𝒮\mathcal{S}. This ensures that each edge is covered by at least one bag and that the bags containing a specific node form a connected subtree. However, if BB is an upper bound on the separator size occurring in 𝒮\mathcal{S}, the resulting width of the tree decomposition is in 𝒪⁡(B​log⁡n)\mathcal{O}(B\log n).

Reed’s algorithm [35] for tree decomposition construction in graphs with bounded separator size avoids this logarithmic blow-up The algorithm takes as input a graph G⁡(V,E)G(V,E) with an assumed upper bound BB on its treewidth tw, as well as a special node subset WW of size at most 3​B3B. It then either certifies that tw>B{\texttt{tw}}>B or returns a tree decomposition with width at most 4​B4B. When calling reed​(G​(V,E),W)\textsc{reed}(G(V,E),W), the algorithm first computes a so-called balanced WW-separator SS which must ensure for each connected component CC in G⁡[V∖S]G[V\setminus S] we have |C|≤34​|V||C|\leq\frac{3}{4}|V| and |C∩W|≤23​|W||C\cap W|\leq\frac{2}{3}|W|. Thus SS must separate both the whole graph and the subset WW in a balanced manner at the same time. Reed shows that such a balanced WW-separator of size at most BB can be computed in time 𝒪⁡(9B​B​|E|)\mathcal{O}(9^{B}B|E|) if it exists. Once a separator of suitable size is identified, the algorithm creates a tree decomposition bag S∪WS\cup W and recursively calls itself on each connected component CC of G⁡[V∖S]G[V\setminus S] using reed​(G⁡[C∪S],(C∩W)∪S)\textsc{reed}(G[C\cup S],(C\cap W)\cup S). See Figure 7 for an illustration of this process.

{subfigure}

[t]0.54 Refer to caption {subfigure}[t]0.44 Refer to caption

Figure 5: A hierarchical separator tree, for 𝒮\mathcal{S}-EDO. Separators are Bordeaux stripes.
Figure 6: A partial reed call tree up to depth 2. W{\color[rgb]{0.9961,0.6289,0.5664}W}-separators are materialized by Bordeaux stripes.
Figure 7: Illustration of the two main constructs leading to Exact Distance Oracles.

If the number of nodes in G⁡[C∪S]G[C\cup S] drops below 4​B4B, no further refinement is necessary and instead a tree decomposition bag containing C∪SC\cup S is returned. Tree decompositions resulting from recursive calls on the components CC are then connected to the parent bag S∪WS\cup W. As we always have |S|≤B|S|\leq B and W≤3​BW\leq 3B, the maximum bag size is 4​B4B. The size bound of WW is maintained throughout the recursive calls as for each component CC we have |C∩W|≤23​|W||C\cap W|\leq\frac{2}{3}|W| by definition of the balanced WW-separator and thus |(C∩W)∪S|≤23​3​B+B≤3​B|(C\cap W)\cup S|\leq\frac{2}{3}3B+B\leq 3B. The size of the graph in a recursive call is bounded by |C∪S|≤34​|V|+B|C\cup S|\leq\frac{3}{4}|V|+B. Therefore the graph size drops below 4​B4B after a logarithmic number of calls. Thus Reed’s algorithm constructs a tree decomposition with a width linear in BB. However the balanced WW-separator computation—with exponential dependency on BB—only runs in polynomial time on graphs with tw≤B∈𝒪⁡(1){\texttt{tw}}\leq B\in\mathcal{O}(1).

4.2 Application to cc-Packed Graphs

The naive tree decomposition construction with width in 𝒪⁡(B​log⁡n)\mathcal{O}(B\log n) is directly applicable to cc-packed graphs using B∈𝒪⁡(c)B\in\mathcal{O}(c). The construction time for 𝒮\mathcal{S} is in 𝒪⁡(c2​n​log⁡n)\mathcal{O}(c^{2}n\log n), and the 𝒯\mathcal{T} construction based thereupon runs in time 𝒪⁡(c​n​log⁡n)\mathcal{O}(cn\log n). However, with a width of 𝒪⁡(c​log⁡n)\mathcal{O}(c\log n), the query time of 𝒯\mathcal{T}-EDO is the same as for 𝒮\mathcal{S}-EDO.

To get 𝒯\mathcal{T} with width 𝒪⁡(c)\mathcal{O}(c), we now adapt Reed’s algorithm to cc-packed graphs. The crucial step is the efficient computation of a balanced WW-separator SS for a given graph G⁡(V,E)G(V,E) and a node subset WW, such that each component in G⁡[V∖S]G[V\setminus S] contains at most a constant fraction of the nodes in VV and the nodes in WW. To achieve this, we actually compute two separators SVS_{V} and SWS_{W} and set S:=SV∪SWS:=S_{V}\cup S_{W}. Here SVS_{V} is simply a 45\frac{4}{5}-balanced square separator of GG of size at most 3​c3c constructed as described in Section 3.1 with ε=0.05\varepsilon=0.05. For SWS_{W} we require that it separate both GG and WW simultaneously, but only for WW the balance criterion needs to be enforced. This can be achieved by constructing the two nested squares for separator computation solely based on the nodes in WW, but then considering all nodes in VV for the actual flow and separator computation. See Figure 8 for an illustration.

Refer to caption
Figure 8: Illustration of the balanced WW-separation process using cc-Packed separation.

As the separator bound of 3​c3c is oblivious to the number of nodes enclosed in the respective squares but only depends on their side length ratio, we get the same maximum separator size for SWS_{W} as for SVS_{V}. Accordingly we have |S|≤|SV|+|SW|≤6​c|S|\leq|S_{V}|+|S_{W}|\leq 6c. It remains to adapt the bound on the size of WW to make the recursion work. If |W|≤30​c|W|\leq 30c, we know that |(C∩W)∪S|≤45​|W|+6​c≤30​c|(C\cap W)\cup S|\leq\frac{4}{5}|W|+6c\leq 30c. Furthermore |C∪S|≤45​|V|+6​c|C\cup S|\leq\frac{4}{5}|V|+6c holds, and therefore, after a logarithmic number of steps, a subgraph size of at most 30​c30c is reached. We remark that we do not require explicit knowledge of the value of cc to stop the recursion. Instead we can keep track of the largest bag size we have seen so far and once the current subgraph size drops below this threshold, we can safely abort. As the recursion depth is logarithmic and the separator computations at each recursion level take 𝒪⁡(c2​n)\mathcal{O}(c^{2}n) time in total, we get the following theorem.

Theorem 5.

Given a cc-packed graph with nn nodes, a tree decomposition of width 30​c30c can be computed in time 𝒪⁡(c2​n​log⁡n)\mathcal{O}(c^{2}n\log n).

The theorem allows to apply many known algorithms based on tree decompositions to cc-packed graphs after a polynomial time preprocessing. This includes the exact distance oracle 𝒯\mathcal{T}-EDO as described in [10].

Corollary 6.

Given a cc-packed graph, an exact distance oracle can be computed in 𝒪⁡(c3​n​log⁡n)\mathcal{O}(c^{3}n\log n) time, with a space consumption in 𝒪⁡(c​n​log⁡n)\mathcal{O}(cn\log n), and a query time in 𝒪⁡(c)\mathcal{O}(c).

Thus, compared to the 𝒮\mathcal{S}-EDO data structure described in [14], the 𝒯\mathcal{T}-EDO data structure for cc-packed graphs is factor of cc slower in preprocessing time but a factor of log⁡n\log n faster with respect to query time, achieving query times that are independent of the overall graph size.

5 Experimental Results

In this section, we first devise engineered algorithms for the computation of λ\lambda and cc. Afterwards, we describe our implementations of the balanced separator and the tree decomposition algorithm in detail and evaluate them on real-world road networks extracted from OSM, see Table 2 for selected instances. Experiments are conducted on an AMD Ryzen Threadripper 1950X 16-Core Processor clocked at 3.4 GHz3.4\text{\,}\mathrm{GHz} with 128 GB128\text{\,}\mathrm{GB} of RAM.

Instance n=#​𝐯𝐞𝐫𝐭𝐢𝐜𝐞𝐬n=\bf\#vertices m=#​𝐞𝐝𝐠𝐞𝐬m=\bf\#edges density λ\lambda packedness cc λ​n\lambda\sqrt{n}
OSM-01 500500 540540 99 [32,64][32,64] 201201
OSM-02 10001000 10841084 99 [37,74][37,74] 285285
OSM-03 20002000 21902190 1414 [45,90][45,90] 626626
OSM-04 50005000 54075407 1414 [61,122][61,122] 990990
OSM-05 10 00010\,000 10 74810\,748 1414 [78,156][78,156] 14001400
OSM-06 20 00020\,000 21 39421\,394 1414 [103,206][103,206] 19801980
OSM-07 50 00050\,000 53 70053\,700 1515 [162,324][162,324] 33543354
OSM-08 100 000100\,000 107 180107\,180 1717 [224,448][224,448] 53765376
OSM-09 200 000200\,000 214 178214\,178 1717 [316,632][316,632] 76037603
OSM-10 500 000500\,000 535 115535\,115 2929 [475,950][475,950] 20 50620\,506
OSM-11 1 000 0001\,000\,000 1 062 9281\,062\,928 2929 [597,1194][597,1194] 29 00029\,000
City 121 936121\,936 231 589231\,589 4646 [444,888][444,888] 16 06316\,063
State 346 127346\,127 680 991680\,991 3434 [639,1278][639,1278] 20 00320\,003
Cutout 999 591999\,591 2 120 8082\,120\,808 6464 [1447,2894][1447,2894] 63 98763\,987
Small 100 242100\,242 212 220212\,220 3030 [452,904][452,904] 94989498
Medium 4 094 6084\,094\,608 8 287 3018\,287\,301 9696 [2120,4240][2120,4240] 194 257194\,257
Large 20 690 32020\,690\,320 21 895 40721\,895\,407 4848 ≥2643\geq 2643 218 336218\,336
Table 2: Characteristics of our benchmark graphs.

5.1 Efficient Computation of the Density

Both the exact algorithm [12]22 2 The paper states it takes as input a “planar scene.” [19] interpreted this to mean that no edge crossings are allowed. However it only means that the objects lie in the plane (as in ℝ2\mathbb{R}^{2}), since the algorithm and its proof do not make any mention of planarity (as in freedom of intersections). and the 3-approximation [19] for computing λ\lambda use the same framework: For each edge ee we find the set R⁡(e)R(e) of edges that lie within 2​‖e‖2\|e\| of ee; this takes time 𝒪⁡(m​log⁡m)\mathcal{O}(m\log m) with a quadtree. For each edge ee and each pp from a certain set P⁡(e)P(e) of points, we count the edges from R⁡(e)R(e) that lie within ‖e‖\|e\| of a point pp; this is equivalent to a stabbing query with input {e′⊕S⁡(‖e‖)∣e′∈R⁡(e)}\bigl\{\,e^{\prime}\oplus S(\|e\|)\mid e^{\prime}\in R(e)\,\bigr\}, where ⊕\oplus denotes the Minkowski sum and S⁡(r)S(r) the square (or ball) of radius r about the origin. Finally we return the maximum of these counts over all choices of ee and pp. For each e∈E⁡(G)e\in E(G), the 3-approximation chooses |P⁡(e)|=48 600∈𝒪⁡(1)|P(e)|=48\,600\in\mathcal{O}(1) points, while the exact algorithm computes the arrangement of |R⁡(e)|∈𝒪⁡(λ)|R(e)|\in\mathcal{O}(\lambda) Minkowski sums in time 𝒪⁡(λ2)\mathcal{O}\bigl(\lambda^{2}\bigr)—at least on paper. In our implementation we simply use the 𝒪⁡(λ2)\mathcal{O}\bigl(\lambda^{2}\bigr) intersection points of the boundaries of these Minkowski sums as P⁡(e)P(e), which results in a running time of 𝒪⁡(λ3)\mathcal{O}\bigl(\lambda^{3}\bigr) per choice of ee or 𝒪⁡(λ3​m)\mathcal{O}\bigl(\lambda^{3}m\bigr) in total. However we believe that the hidden constants in the running time of the arrangement construction are larger than λ\lambda for realistic instances.

We can organize these computations in several ways. First we can process the edges ee by decreasing length as suggested by [12]; then we know that the current ee admits a new count of at most λ′+1\lambda^{\prime}+1, where λ′\lambda^{\prime} is the previous maximum; thus we can skip the remainder of P⁡(e)P(e) as soon as we find a point that lies close to λ′+1\lambda^{\prime}+1 edges from R⁡(e)R(e). Additionally we can skip ee entirely if |R⁡(e)|≤λ′|R(e)|\leq\lambda^{\prime}; in this case we cannot hope to find a new maximum; this is “full synchronization.” We can hope to exploit the latter shortcut more often if we process the edges ee by decreasing |R⁡(e)||R(e)|. Indeed, if we abandon the former shortcut entirely, we need not wait for the result of the stabbing query for one choice of ee before we start with the next; that is, we may run the stabbing queries concurrently; optionally with “limited synchronization” to skip edges ee with small R⁡(e)R(e). This way the computation can run on up to mm CPU cores.

Figure 9: The low-density constants of several road networks as computed by the exact algorithm and the 3-approximation as well as the respective running times.

When one examines the results in Figure 9, it is immediately clear that the 3-approximation is actually slower than the exact algorithm. We attribute the difference in running time to the fact that all instances have relatively low density, so λ3\lambda^{3} is in fact smaller than 48 600​λ48\,600\,\lambda. Additionally we observe that the 3-approximation is usually worse than the optimum by a factor of about 1.5. Finally we see that in all cases the variant that runs on multiple cores with limited synchronization is the fastest.

5.2 Efficient Computation of the Packedness

For the packedness cc, we implement the 2-approximation from [21] and the randomized 42-approximation approximation from [27]. The 2-approximation restricts the centers of the squares it considers to vertices of the graph and sweeps outward from each vertex. It runs in 𝒪⁡(m2​log⁡m)\mathcal{O}(m^{2}\log m). A key detail of this algorithm is the update operation it performs whenever the sweep line hits an event point: It updates the growth rate of the total length ℓ\ell of edges inside the square per additional unit of radius (i.e., d​ℓ/d​rd\ell/dr) in constant time. An implementer must take care that floating point imprecisions do not accumulate too much. To guarantee this, we use Kahan’s summation algorithm [29] in our implementation. Furthermore, since we run a sweep from each vertex independently, the algorithm is embarrassingly parallel; only combining maximum accumulation at the end requires synchronization.

The randomized 42-approximation runs in 𝒪⁡(m​log3​m)\mathcal{O}(m\log^{3}m) [27]. This algorithm uses a WSPD to find a linear number of squares one of which approximates the packedness. Then it randomly scales and shifts these squares Θ⁡(n)\Theta(n) times, builds a quadtree of the translated squares, and approximates the packedness of its nodes in a bottom-up traversal. With high probability a square with high packedness is approximately equal to a node in one of the quadtrees. We may once again create and process the quadtrees in parallel on up to Θ⁡(log⁡n)\Theta(\log n) cores. To make the 42-approximation algorithm for packedness scalable to large graphs, we make the following adjustments: In practice the separation factor 7 200 of the WSPD as specified in the paper is prohibitively large for instances of practical sizes. Other constants that control the approximation factor for the packedness of the quadtree lead to impractical running times as well. We changed them to the values shown in Table 3. The result is a worse approximation guarantee in theory, but our experiments show that the approximation factor is still always below 5 in practice.

Constant Value from paper Our implementation
α\alpha 20 [27, lemma 22] 3
ξ\xi 1/300 [27, pages 10–11] 1/30
ss 7200 [21, page 7] 6
m=#​quadtreesm=\#{\rm quadtrees} 𝒪⁡(1000​log⁡n)\mathcal{O}(1000\log n) [27, lemma 10] ⌊log2⁡n⌋\lfloor\log_{2}n\rfloor
Table 3: Constants from the 42-approximation as specified in the paper versus the values we use in our implementation.
Figure 10: The packednesses of several road networks as computed by the 2- and 42-approximation as well as the respective running times.

In Figure 10 we can see that the 42-approximation is much faster than the 2-approximation, for large instances even by several orders of magnitude. This comes at the cost of solution quality: The 2-approximation usually finds a square that is twice as packed as the estimate from the 42-approximation. We can further increase the quality of the result in practice by computing the exact packedness of the square output by the 42-approximation by running a single sweep from its center as in the 2-approximation. This takes only 𝒪⁡(m​log⁡m)\mathcal{O}(m\log m) time, so it does not change the asymptotic running time; but with this additional step we find squares whose packedness is at least 75 %75\text{\,}\mathrm{\%} of those found by the 2-approximation for our test instances, and indeed the running time of the sweep is negligible in comparison to the 42-approximation. This way we get the best tradeoff between quality and running time.

For the two largest instances, where the 2-approximation did not finish within twelve hours, we report lower bounds on cc from the 42-approximation and partial runs of the 2-approximation in Table 2. As one can see there, cc is always much larger than λ\lambda for the same graph, but also much smaller than λ​n\lambda\sqrt{n}, indicating that the known theoretical relationships between the two parameters are far from tight on the tested road networks.

5.3 A Practical Separation Algorithm

One can conceptualize the separation algorithm proposed in [14] as two independent steps: first, run a strategy yielding two balls which ensure a given balance factor, and second, extract vertices inside BB and outside B′B^{\prime}, and then run a max-flow min-cut algorithm. Extracting vertices is done using a naive linear filtering. The chosen max-flow algorithm is Ford–Fulkerson with iterative depth-first searches to find augmenting paths, resulting in a running time of 𝒪⁡(F⋅(n+m))\mathcal{O}(F\cdot(n+m)) where FF is the maximum flow, which reduces to 𝒪⁡(c2​n)\mathcal{O}(c^{2}n) for cc-packed graphs. Because the first step is more flexible, we could use any of the methods shown in Table 1. As a baseline and suggested in [14], and in order to compute B=BrB=B_{r} and deduce B′=B2​rB^{\prime}=B_{2r}, the 𝒪⁡(n​(nk)d)\mathcal{O}(n(\frac{n}{k})^{d})-time 2-approximation for kk-enclosing disk from [25] was implemented. Using k=n2​λ3k=\frac{n}{2\lambda^{3}}, it indeed yields a linear time algorithm, but in practice constant factors are substantial: in dimension 2, the running time is 470 596​n$470\,596$n. Besides, as presented in Section 3, the best balance factor using this 2-approximation is 0.9970.997 with Better Balance. In practice, it yields exactly this balance; see Figure 13.

{subfigure}

[t]0.48 Refer to captionRefer to caption

Figure 11: Global view of the small graph and its separator in the top left corner, overlaid with a zoom on the separator, where one can also observe smaller components and balls. The largest component is of size 98 87098\,870, which indeed gives a balance of 0.9970.997.
{subfigure}

[t]0.48 Refer to caption

Figure 12: The resulting balance factor is 0.5460.546 with a very small separator of size 10. KaHIP identifies almost the same separator in many runs.
Figure 13: Separation of the small graph using different ball strategies. On the left is the original one with Better Balance. On the right is an output of the engineered sampling strategy, with 100100 vertices sampled and 50 %50\text{\,}\mathrm{\%} probability of separating.

Instead a more practical but randomized ball strategy consists in sampling the vertices, finding the exact kk- and (1−k)(1-k)-enclosing balls B=b⁡(p,r)B=b(p,r) and B′=b⁡(p,R)B^{\prime}=b(p,R) from each vertex point pp, and keeping the best ball pair. This method also allows for arbitrary balance. One could define the best pair to be the one that guarantees the best theoretical upper bound aa−1​c\frac{a}{a-1}c on the separator size, maximizing the radius ratio a=Rra=\frac{R}{r}, or also randomly run separations using intermediately computed balls and keep the one yielding the smallest separator size. To prevent this ratio aa from diverging, one could set a threshold and fall back to nested squares ball strategy if no suitable ball is found. In practice, setting a threshold of 1.21.2 still ensures a maximum separator size of aa−1​c=6​c\frac{a}{a-1}c=6c, and such balls can always be found on the small graph; see Figure 14.

Refer to caption
Figure 14: Density of separators w.r.t. ball radius ratio a=Rra=\frac{R}{r} and separator size. This is done on the small graph, taking each vertex as a ball centre, and targeting a 23\frac{2}{3} balance.

This figure also illustrates the fact that maximizing aa induces smaller separator sizes. It also makes sense, because there should be more paths in the ring for the max-flow algorithm to consider. Consequently, during the sample strategy, one could accumulate and sort balls by decreasing radius ratio aa, and run separations by processing balls in order. Combining both approaches, we then run the separation using the best theoretical pair of balls and keep the smallest separator. Radii rr or RR can be found naively by computing distances from a sample vertex pp to each vertex point. Selecting the kkth farthest vertex point can be done in 𝒪⁡(n)\mathcal{O}(n) thanks to a selection algorithm such as introselect. The ball radius is set to the distance to this kkth farthest vertex point. This process can be greatly optimized by precomputing a spanning grid of log2⁡(n)\log^{2}(n) cells which holds their covered vertices. The query to find distance rr from pp consists in accumulating cells by exploring the grid outwards from the cell of pp. When at least kk vertices are accumulated, one only have to compute distances to the last expanded annulus to determine the exact kkth-farthest vertex. See Figure 21 for an illustration of this process. To accelerate the process even further, distance computations can be skipped at the cost of an approximation on rr.

{subfigure}

[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption {subfigure}[t]0.32 Refer to caption

Figure 15: Pre-computation of the spanning grid of log2⁡(n)\log^{2}(n) cells. For the sake of clarity, more cells are used in this illustration. Sampled vertices are highlighted.
Figure 16: First step of the grid exploration from the cell containing one sampled vertex pp, in order to find the radius rr of the inner ball BB centred at p{\color[rgb]{0.0391,0.5664,0.5273}p}.
Figure 17: Second step of the grid exploration, accumulating vertices in cells of the next ring. It is also the last expansion, supposing enough vertices ((1−α)​n(1-\alpha)n) were accumulated.
Figure 18: Distances from p{\color[rgb]{0.0391,0.5664,0.5273}p} to vertices in the last expanded ring are computed.
Figure 19: From previously computed distances, the exact (1−α)​n(1-\alpha)nth-farthest vertex is identified, and hence rr, giving the complete inner ball B⁡(p,r){\color[rgb]{0.9961,0.6289,0.5664}B({\color[rgb]{0.0391,0.5664,0.5273}p},r)}.
Figure 20: The outer ball B′=B⁡(p,R){\color[rgb]{0.6484,0.3008,0.4102}B^{\prime}=B({\color[rgb]{0.0391,0.5664,0.5273}p},R)} is found in the same way. The grid exploration is resumed until α​n\alpha n vertices are accumulated, distances to the last expanded ring are computed, and RR is deduced.
Figure 21: Illustration of the sampling ball strategy using a precomputed spanning grid.

To determine the necessary parameters, namely sample size and expected number of separation runs, we benchmarked several configurations on a representative road network. According to results shown Figure 24, a sample of size 100 with 50 separation runs seems to yield the smallest separator for a balance factor of α=23\alpha=\frac{2}{3} almost every time. The smallest separator is also found in the 50 first tries 75 %75\text{\,}\mathrm{\%} of the time with larger separation runs; see Figure 24.

{subfigure}

[t] {subfigure}[t]

Figure 22: Smallest separator sizes w.r.t. number of samples and expected number of separation runs.
Figure 23: Rank of smallest separator w.r.t. expected number of separation runs.
Figure 24: Benchmark results to determine best sampling parameters for the corresponding ball strategy. Left is the small instance, and right is the large one.

In order to assess the practical performance of this separation algorithm, we compare its performance against the heavy-engineered KaHIP [36, 37]. To make it a fair fight, we first separate the graph using our algorithm and measure the balance factor. Then, we separate using KaHIP by asking two components and giving the same balance as target. Its mode is also set to FAST or STRONG, which enables a compromise between separation time and size. On the small graph, our algorithm yields better separator sizes while using less time at 10 to 35 separation runs when compared to KaHIP-FAST, and at 30 to 110 separation runs when compared to KaHIP-STRONG; see Figure 25. On the large graph, up to 100 separation runs performed during the ball strategy execution, the separation is either slower but of higher quality against KaHIP-FAST, or faster while yielding roughly the same size against KaHIP-STRONG. In the context of nested dissection, only a very few amounts of separation are done on large subgraphs, though, and most of the separations are performed on smaller graphs, closer to the previous, small one.

Figure 25: Time and separator size comparison between our separation algorithm and KaHIP in FAST and STRONG modes, w.r.t. the expected number of separation runs, for the small dataset (left) and the large dataset (right). The cc-packed balance factor in the ball strategy is always set to 23\frac{2}{3}. For the large dataset, two KaHIP separator outliers (larger than 10001000) were removed, one was of size 54 00054\,000. This again shows the importance of having a theoretical guarantee on the separator size.

5.4 Exact Distance Oracles

The separator decomposition was implemented just as described Section 4. using our separator algorithm described above as a subroutine. The tree decomposition was fully implemented as described in Section 4.2. A small optimization was added: instead of recurring on (G⁡[C∪S],(C∩W)∪S)\bigl(G[C\cup S],(C\cap W)\cup S\bigr), we extract the set N⁡(C)∩SN(C)\cap S—vertices of SS connected to CC—in time 𝒪⁡(|S|​Δ)\mathcal{O}(|S|\Delta) and use it in place of SS. This optimization resulted in an average bag size smaller by a factor of 13\frac{1}{3}. Both structures have been constructed on the large dataset. Regarding the pre-computation, they both took around 4.5 h4.5\text{\,}\mathrm{h} to compute, without any parallelization. The computed separator decomposition has a height of 24 with 1 700 0001\,700\,000 bags, whereas the tree decomposition is 19 nodes high and is made of 1 200 0001\,200\,000 bags. As discussed earlier Section 4, those two data structures can be used to define Exact Distance Oracles, namely 𝒮\mathcal{S}-EDO and 𝒯\mathcal{T}-EDO. In order to finally compare them, we investigate the number of distance comparisons done at query phase—which is expected to be smaller by a factor of 𝒪⁡(log⁡n)\mathcal{O}(\log n) for 𝒯\mathcal{T}-EDO. The query time should be proportional. We can observe this only from the separation and tree decompositions, based on bag sizes. Results indeed show a clear domination of the 𝒯\mathcal{T}-EDO, as show on Figure 26. On average, it requires only 20 distance comparisons to answer a query, whereas the 𝒮\mathcal{S}-EDO needs a bit less than 4 times more. The 75 %75\text{\,}\mathrm{\%} quantile of 𝒯\mathcal{T}-EDO (1414) is below the 25 %25\text{\,}\mathrm{\%} quantile of 𝒮\mathcal{S}-EDO (4343).

Figure 26: Distribution of the number of distance comparisons required for a query, on average, between 𝒮\mathcal{S}-EDO and 𝒯\mathcal{T}-EDO.

The tree decomposition can be used as an intermediate step to solve many more problems. Its very small average bag size might even make algorithms with exponential dependency on tw practical.

6 Conclusions and Future Work

Our experiments reveal that λ\lambda and cc are small enough in large real-world road networks for parameterized bounds to be meaningful. Especially λ\lambda values turned out to be really low, which motivates further research into algorithms parameterized by it. We also show that such parameterized algorithms can be engineered to perform very well in practice while upholding theoretical guarantees. In particular, our exact distance oracle with 𝒪⁡(c)\mathcal{O}(c) query time requires only few distance computations on average. Indeed, even the maximum oracle time is much better than the computed cc-value which might warrant further investigation.

Balanced separator computation is at the core of our implemented algorithms. Very recently, Har-Peled [28] presented a simple randomized algorithm that computes balanced separators of size 𝒪⁡(c)\mathcal{O}(c) in expected 𝒪⁡(c​n)\mathcal{O}(cn) time. The algorithm is closely related to separator constructions for τ\tau-lanky and λ\lambda-low-density graphs [32] and avoids the max-flow computations that currently dominate the running time of our implementation. Consequently, it has the potential to significantly accelerate our algorithms, although it remains to be seen whether it can match the separator quality achieved by our approach in practice. Incorporating Har-Peled’s algorithm into our tree decomposition algorithm reduces its running time to 𝒪⁡(c​n​log⁡n)\mathcal{O}(cn\log n). The preprocessing time of the exact distance oracle, however, would still be dominated by the subsequent distance computations, which require 𝒪⁡(c3​n​log⁡n)\mathcal{O}(c^{3}n\log n) time. Reducing this dependence on cc remains an interesting open problem.

References

  • [1] I. Abraham, D. Delling, A. Fiat, A. V. Goldberg, and R. F. Werneck (2016) Highway dimension and provably efficient shortest path algorithms. Journal of the ACM 63 (5), pp. 1–26. External Links: Document Cited by: §1.
  • [2] S. Aghamolaei, V. Keikha, M. Ghodsi, and A. Mohades (2023) Sampling and sparsification for approximating the packedness of trajectories and detecting gatherings. International Journal of Data Science and Analytics 15 (2), pp. 201–216. External Links: ISSN 2364-4168, Document Cited by: §1.1.
  • [3] R. Bauer, T. Columbus, I. Rutter, and D. Wagner (2016) Search-space size in contraction hierarchies. Theoretical Computer Science 645, pp. 112–127. External Links: Document Cited by: §1.
  • [4] J. Blum, S. Funke, and S. Storandt (2021) Sublinear search spaces for shortest path planning in grid and road networks. Journal of Combinatorial Optimization 42 (2), pp. 231–257. External Links: Document Cited by: §1.
  • [5] K. Bringmann and M. Künnemann (2017) Improved approximation for Fréchet distance on cc-packed curves matching conditional lower bounds. International Journal of Computational Geometry & Applications 27 (01n02), pp. 85–119. External Links: Document Cited by: §1.1.
  • [6] T. M. Chan and S. Har-Peled (2021) Smallest kk-enclosing rectangle revisited. Discrete & Computational Geometry 66 (2), pp. 769–791. External Links: Document Cited by: §3.1.
  • [7] T. M. Chan (1998) Geometric applications of a randomized optimization technique. In Proceedings of the Fourteenth Annual Symposium on Computational Geometry, SCG ’98, New York, NY, USA, pp. 269–278. External Links: Document Cited by: Appendix A.
  • [8] D. Chen, A. Driemel, L. J. Guibas, A. Nguyen, and C. Wenk (2011) Approximate map matching with respect to the Fréchet distance. In 2011 Proceedings of the Workshop on Algorithm Engineering and Experiments (ALENEX), pp. 75–83. External Links: Document Cited by: §1.1.
  • [9] J. Conradi, I. van der Hoog, T. van der Horst, and T. Ophelders (2026) Computing the Fréchet distance when just one curve is cc-packed: a simple almost-tight algorithm. In 2026 SIAM Symposium on Simplicity in Algorithms (SOSA), pp. 43–55. External Links: Document Cited by: §1.1.
  • [10] G. K. Conrado, A. K. Goharshady, P. Hudec, P. Li, and H. J. Motwani (2024) Faster treewidth-based approximations for Wiener index. In 22nd International Symposium on Experimental Algorithms (SEA 2024), L. Liberti (Ed.), Leibniz International Proceedings in Informatics (LIPIcs), Vol. 301, Dagstuhl, Germany, pp. 6:1–6:19. External Links: Document Cited by: 4th item, §4.2, §4.
  • [11] A. Datta, H. Lenhof, C. Schwarz, and M. Smid (1995) Static and dynamic algorithms for kk-point clustering problems. Journal of Algorithms 19 (3), pp. 474–503. External Links: Document Cited by: Appendix A.
  • [12] M. de Berg, A. F. van der Stappen, J. Vleugels, and M. Katz (2002) Realistic input models for geometric algorithms. Algorithmica 34 (1), pp. 81–97. External Links: Document Cited by: §1.1, §5.1, §5.1.
  • [13] D. Delling, A. V. Goldberg, R. Savchenko, and R. F. Werneck (2014) Hub labels: theory and practice. In Experimental Algorithms, J. Gudmundsson and J. Katajainen (Eds.), Cham, pp. 259–270. External Links: Document Cited by: §1.
  • [14] L. Deryckere, J. Gudmundsson, A. van Renssen, Y. Sha, and S. Wong (2025) A WSPD, separator and small tree cover for cc-packed graphs. In 19th International Symposium on Algorithms and Data Structures (WADS 2025), P. Morin and E. Oh (Eds.), Leibniz International Proceedings in Informatics (LIPIcs), Vol. 349, Dagstuhl, Germany, pp. 21:1–21:15. External Links: ISBN 978-3-95977-398-0, ISSN 1868-8969, Document Cited by: 3rd item, 4th item, §1.1, §1, Figure 4, §3.1, §3.1, §3.1, §4.2, §4, §4, §5.3.
  • [15] A. Driemel, S. Har-Peled, and C. Wenk (2010) Approximating the Fréchet distance for realistic curves in near linear time. In Proceedings of the Twenty-Sixth Annual Symposium on Computational Geometry, SoCG ’10, New York, NY, USA, pp. 365–374. External Links: ISBN 9781450300162, Document Cited by: 1st item, §1.1, §2.
  • [16] Z. Dvořák and S. Norin (2019) Treewidth of graphs with balanced separations. Journal of Combinatorial Theory, Series B 137, pp. 137–144. External Links: ISSN 0095-8956, Document Cited by: §4.
  • [17] L. Gottesbüren, M. Hamann, T. N. Uhl, and D. Wagner (2019) Faster and better nested dissection orders for customizable contraction hierarchies. Algorithms 12 (9). External Links: Document Cited by: §1.
  • [18] J. Gudmundsson, Z. Huang, A. van Renssen, and S. Wong (2023) Computing a subtrajectory cluster from cc-packed trajectories. In 34th International Symposium on Algorithms and Computation (ISAAC 2023), S. Iwata and N. Kakimura (Eds.), Leibniz International Proceedings in Informatics (LIPIcs), Vol. 283, Dagstuhl, Germany, pp. 34:1–34:15. External Links: Document Cited by: §1.1.
  • [19] J. Gudmundsson, Z. Huang, and S. Wong (2023) Approximating the λ\lambda-low-density value. In Computing and Combinatorics, W. Wu and G. Tong (Eds.), Lecture Notes in Computer Science, Vol. 14422, Cham, pp. 71–82. External Links: Document Cited by: §1.1, §5.1, footnote 2.
  • [20] J. Gudmundsson, M. P. Seybold, and S. Wong (2024) Map matching queries on realistic input graphs under the Fréchet distance. ACM Transactions on Algorithms 20 (2). External Links: Document Cited by: §1.1.
  • [21] J. Gudmundsson, Y. Sha, and S. Wong (2023) Approximating the packedness of polygonal curves. Computational Geometry 108, pp. 101920. External Links: Document Cited by: §1.1, §5.2, Table 3.
  • [22] J. Gudmundsson and M. Smid (2015) Fast algorithms for approximate Fréchet matching queries in geometric trees. Computational Geometry 48 (6), pp. 479–494. External Links: Document Cited by: §1.1.
  • [23] J. Gudmundsson, M. van Kreveld, and F. Staals (2013) Algorithms for hotspot computation on trajectory data. In Proceedings of the 21st ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, SIGSPATIAL’13, New York, NY, USA, pp. 134–143. External Links: Document Cited by: §1.1.
  • [24] J. Gudmundsson and S. Wong (2026) A well-separated pair decomposition for low density graphs. In Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), K. G. Larsen and B. Saha (Eds.), pp. 3688–3723. External Links: Document Cited by: §1.1, §1.
  • [25] S. Har-Peled and S. Mazumdar (2005) Fast algorithms for computing the smallest kk-enclosing circle. Algorithmica 41 (3), pp. 147–157. External Links: ISSN 1432-0541, Document Cited by: Appendix A, Appendix A, §3.1, §3.1, §3.1, §5.3.
  • [26] S. Har-Peled and K. Quanrud (2017) Approximation algorithms for polynomial-expansion and low-density graphs. SIAM Journal on Computing 46 (6), pp. 1712–1744. External Links: Document Cited by: §1.1.
  • [27] S. Har-Peled and T. Zhou (2025) How packed is it, really?. Computing in Geometry and Topology 4 (1), pp. 6:1–6:14. External Links: Document Cited by: §1.1, §5.2, §5.2, Table 3, Table 3, Table 3.
  • [28] S. Har-Peled (2026) Separator for cc-packed segments and curves. External Links: Document Cited by: §6.
  • [29] W. Kahan (1965) Pracniques: further remarks on reducing truncation errors. Communications of the ACM 8 (1), pp. 40. External Links: Document Cited by: §5.2.
  • [30] T. Korhonen and D. Lokshtanov (2023) An improved parameterized algorithm for treewidth. In Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC 2023, New York, NY, USA, pp. 528–541. External Links: ISBN 9781450399135, Document Cited by: §4.
  • [31] A. Kosowski and L. Viennot (2017) Beyond highway dimension: small distance labels using tree skeletons. In Proceedings of the 2017 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1462–1478. External Links: Document Cited by: §1.
  • [32] H. Le and C. Than (2024) Greedy spanners in Euclidean spaces admit sublinear separators. ACM Trans. Algorithms 20 (3). External Links: ISSN 1549-6325, Document Cited by: §1, §3.1, §3.1, §6.
  • [33] P. R. S. Mahapatra, A. Karmakar, S. Das, and P. P. Goswami (2011) kk-Enclosing axis-parallel square. In Computational Science and Its Applications. ICCSA 2011, B. Murgante, O. Gervasi, A. Iglesias, D. Taniar, and B. O. Apduhan (Eds.), Lecture Notes in Computer Science, Vol. 6784, Berlin, Heidelberg, pp. 84–93. External Links: Document Cited by: Appendix A.
  • [34] G. Narasimhan and M. Smid (2007) Geometric spanner networks. Cambridge University Press. External Links: ISBN 9780521815130, Link Cited by: §1.1.
  • [35] B. A. Reed (1992) Finding approximate separators and computing tree width quickly. In Proceedings of the twenty-fourth annual ACM symposium on Theory of Computing, pp. 221–228. External Links: Document Cited by: §4.1.
  • [36] P. Sanders and C. Schulz (2013) Think locally, act globally: highly balanced graph partitioning. In Experimental Algorithms. SEA 2013, V. Bonifaci, C. Demetrescu, and A. Marchetti-Spaccamela (Eds.), Lecture Notes in Computer Science, Vol. 7933, Berlin, Heidelberg, pp. 164–175. External Links: Document Cited by: 3rd item, §5.3.
  • [37] P. Sanders and C. Schulz (2016) Advanced multilevel node separator algorithms. In Experimental Algorithms. SEA 2016, A. V. Goldberg and A. S. Kulikov (Eds.), Lecture Notes in Computer Science, Vol. 9685, Cham, pp. 294–309. External Links: ISBN 978-3-319-38851-9, Document Cited by: §5.3.
  • [38] M. Smid (1992) Finding kk points with a smallest enclosing square. Technical report Max-Planck-Institut für Informatik. External Links: Link Cited by: Appendix A.
  • [39] A. F. van der Stappen, D. Halperin, and M. H. Overmars (1993) The complexity of the free space for a robot moving amidst fat obstacles. Computational Geometry 3 (6), pp. 353–373. External Links: Document Cited by: §1.1.
  • [40] Y. Wu, P. Austrin, T. Pitassi, and D. Liu (2014) Inapproximability of treewidth and related problems. Journal of Artificial Intelligence Research 49, pp. 569–600. External Links: Document Cited by: §4.

Appendix A Improved Approximation Algorithm for Smallest Enclosing Square

Given a set of nn points in the plane and a parameter kk, the goal is to compute an axes-parallel square with minimum side length that encloses kk points. Smid [38] presented an algorithm for this problem with a running time in 𝒪⁡(n​log⁡n+n​k​log2​k)\mathcal{O}(n\log n+nk\log^{2}k) and a linear space consumption. Datta et al. [11] reduced the running time to 𝒪⁡(n​log⁡n+n​log2​k)\mathcal{O}(n\log n+n\log^{2}k). Chan [7] described a randomized algorithm that runs in 𝒪⁡(n​log⁡n)\mathcal{O}(n\log n) for arbitrary kk and Mahapatra [33] a deterministic one with a running time in 𝒪⁡(n​log2​n)\mathcal{O}(n\log^{2}n). Using this exact algorithm directly for our separator computation in cc-packed graphs yields a separator size of |S0.8|=2​2​c|S_{0.8}|=2\sqrt{2}c, and accordingly we get |S2/3|=4​2​c|S_{2/3}|=4\sqrt{2}c in 𝒪⁡(c2​n+n​log2​n)\mathcal{O}(c^{2}n+n\log^{2}n) time.

However, for the purpose of more efficient separator computation, we strive for a linear running time but are also content with a (1+ε)(1+\varepsilon)-approximation, that is, we can accept a slightly larger than optimal square. For disks this was shown to be possible in [25], where an algorithm with a running time in 𝒪⁡(n+1ε3​log2​1ε)\mathcal{O}(n+\frac{1}{\varepsilon^{3}}\log^{2}\frac{1}{\varepsilon}) for ε>0\varepsilon>0 and k∈Ω⁡(n)k\in\Omega(n) was presented. In the following, we discuss that this algorithm can be applied to axes-parallel squares with only minor modifications. As squares are arguably even simpler to treat, we decrease the running time to 𝒪⁡(n+1ε2​log⁡1ε)\mathcal{O}(n+\frac{1}{\varepsilon^{2}}\log\frac{1}{\varepsilon}) in the process.

The algorithm works as follows: First, it computes a 22-approximation of the optimal radius rO​P​Tr_{OPT} in linear time. This algorithm does not rely on disk geometry and directly transfers to squares. The returned radius r≤2​rO​P​Tr\leq 2r_{OPT} is used to construct a grid. It is argued that each grid cell can be covered by at most 5 disks of radius r/2r/2and thus the maximum number of points contained in each grid cell is upper bounded by 5​k5k. For squares, this bound reduces to 4​k4k. Clearly, the optimal disk/square can not extend beyond a 3×33\times 3 grid cell cluster, as the radius would then exceed 2​r>2​rO​P​T2r>2r_{OPT}. Therefore, it suffices to inspect each such cluster which contains at least kk points. The current cluster is further subdivided using a grid of side length 1ε​r\frac{1}{\varepsilon}r and the cluster points are snapped to their closest grid points. Thus, we go from at most 45​k45k distinct points in the cluster (36​k36k for squares) to 𝒪⁡(1ε2)\mathcal{O}\left(\frac{1}{\varepsilon^{2}}\right) snapped points. We know strive the find the smallest kk-enclosing disk/square for the snapped points, respecting the multiplicities of points with the same coordinate. For squares, it is easy to see that we can restrict at least one pair of diagonally opposing corners do be grid points. Thus for each grid point, we assume it is w.l.o.g. the lower left corner of the square (and then repeat the process for lower right, upper left and upper right corner). We then want to find the smallest side length such that the resulting square contains at least kk points. We do so via binary search over the possible side lengths. To quickly answer how many points are contained in such a square, we use a 2-dimensional prefix sum array which can be precomputed for the grid point counts in linear time and which returns the correct value in 𝒪⁡(1)\mathcal{O}(1). Thus, for each grid point and corner role, we need 𝒪⁡(log⁡1ε)\mathcal{O}\left(\log\frac{1}{\varepsilon}\right) time and 𝒪⁡(1ε2​log⁡1ε)\mathcal{O}\left(\frac{1}{\varepsilon^{2}}\log\frac{1}{\varepsilon}\right) in total. For disks, the data structures that report the point counts are more complicated and thus the dependency on ε\varepsilon is worse. Returning the smallest square seen in this process is a valid (1+ε)(1+\varepsilon)-approximation, as we only need to enlarge the square by at most this factor to enclose all relevant original points to fit the bound of kk. All other calculations from [25] regarding the running time analysis (including how often clusters with many points occur) are oblivious to the disk geometry and carry over unchanged to squares. Therefore, we get the following theorem.

Theorem 7.

Given a set of points in the plane, k∈Θ⁡(n)k\in\Theta(n), and ε>0\varepsilon>0, we can compute a (1+ε)(1+\varepsilon)-approximation of the smallest axis-aligned kk-enclosing square in time 𝒪⁡(n+1ε2​log⁡1ε)\mathcal{O}(n+\frac{1}{\varepsilon^{2}}\log\frac{1}{\varepsilon}).