Abstract 1 Introduction 2 Decomposing the π’Œ-Level of an Arrangement of Distance Functions 3 Vertical Shallow Cuttings 4 Dynamic Data Structures for Proximity Queries References

Dynamic Nearest-Neighbor Searching Under General Metrics in β„πŸ‘ and Its Applications

Pankaj K. Agarwal ORCID Department of Computer Science, Duke University, Durham, NC, USA    Matthew J. Katz ORCID The Stein Faculty of Computer and Information Science, Ben-Gurion University of the Negev, Beer Sheva, Israel    Micha Sharir ORCID School of Computer Science, Tel Aviv University, Tel Aviv, Israel
Abstract

Let K be a compact, centrally-symmetric, strictly-convex region in ℝ3, which is a semi-algebraic set of constant complexity, i.e. the unit ball of a corresponding metric, denoted as βˆ₯β‹…βˆ₯K. Let 𝒦 be a set of n homothetic copies of K. This paper contains two main sets of results:

  1. (i)

    For a storage parameter s∈[n,n3], 𝒦 can be preprocessed in Oβˆ—β’(s) expected time into a data structure of size Oβˆ—β’(s), so that for a query homothet K0 of K, an intersection-detection query (determine whether K0 intersects any member of 𝒦, and if so, report such a member) or a nearest-neighbor query (return the member of 𝒦 whose βˆ₯β‹…βˆ₯K-distance from K0 is smallest) can be answered in Oβˆ—β’(n/s1/3) time; all k homothets of 𝒦 intersecting K0 can be reported in additional O⁒(k) time. In addition, the data structure supports insertions/deletions in Oβˆ—β’(s/n) amortized expected time per operation. Here the Oβˆ—β’(β‹…) notation hides factors of the form nΞ΅, where Ξ΅>0 is an arbitrarily small constant, and the constant of proportionality depends on Ξ΅.

  2. (ii)

    Let 𝒒⁒(𝒦) denote the intersection graph of 𝒦. Using the above data structure, breadth-first or depth-first search on 𝒒⁒(𝒦) can be performed in Oβˆ—β’(n3/2) expected time. Combining this result with the so-called shrink-and-bifurcate technique, the reverse-shortest-path problem in a suitably defined proximity graph of 𝒦 can be solved in Oβˆ—β’(n62/39) expected time. Dijkstra’s shortest-path algorithm, as well as Prim’s MST algorithm, on a βˆ₯β‹…βˆ₯K-proximity graph on n points in ℝ3, with edges weighted by βˆ₯β‹…βˆ₯K, can also be performed in Oβˆ—β’(n3/2) time.

Keywords and phrases:
Homothets, Minkowski metric, Shallow cuttings, Nearest-neighbor searching, Intersection and proximity graphs, Reverse-shortest-path problem
Funding:
Pankaj K. Agarwal: Partially supported by NSF grants CCF-2223870 and IIS-2402823, and by a US-Israel Binational Science Foundation Grant 2022/131.
Matthew J. Katz: Partially supported by Israel Science Foundation Grant 495/23.
Micha Sharir: Partially supported by Israel Science Foundation Grant 495/23.
Copyright and License:
[Uncaptioned image] © Pankaj K. Agarwal, Matthew J. Katz, and Micha Sharir; 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/2603.26585
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Problem statement.

Let K be a compact, centrally-symmetric, strictly-convex region in ℝ3, which is a semi-algebraic set of constant complexity.111Roughly speaking, a semi-algebraic set in ℝd is the set of points in ℝd that satisfy a Boolean formula over a set of polynomial inequalities; the complexity of a semi-algebraic set is the number of polynomials defining the set and their maximum degree. See [12] for formal definitions of a semi-algebraic set and its complexity. K is the unit ball of a norm βˆ₯β‹…βˆ₯K, and we denote its metric as distK.

A homothet (or homothetic copy) of K is a scaled and translated copy of K, expressed as K⁒(c,ρ):=ρ⁒K+c, for cβˆˆβ„3 and ρβ‰₯0; c is the center of K⁒(c,ρ) and ρ is its size. We represent K⁒(c,ρ) as the point (c,ρ)βˆˆβ„3×ℝβ‰₯0. Let 𝕂 be the set of all homothets of K, represented as the halfspace x4β‰₯0 of ℝ4. The K-distance distK⁒(u,v)=β€–uβˆ’vβ€–K between points u,vβˆˆβ„3 is the minimum value of ρ for which v∈K⁒(u,ρ) (or, equivalently, u∈K⁒(v,ρ)). Since K is strictly convex, the triangle inequality distK⁒(u,v)≀distK⁒(u,w)+distK⁒(w,v) is sharp unless w lies on the segment u⁒v. The K-distance of a point xβˆˆβ„3 from a homothet K⁒(c,ρ) is defined as fc,ρ⁒(x)=distK⁒(c,x)βˆ’Ο, and the K distance of another homothet K⁒(cβ€²,ρ′) from K⁒(c,ρ) is fc,ρ⁒(cβ€²)βˆ’Οβ€²=distK⁒(c,cβ€²)βˆ’Οβˆ’Οβ€². Since K is a constant-complexity semi-algebraic set, fc,ρ is a semi-algebraic function of constant complexity. The homothets K⁒(c,ρ) and K⁒(cβ€²,ρ′) intersect if the distance between them is non-positive, i.e., distK⁒(c,cβ€²)≀ρ+ρ′, or equivalently, the point (cβ€²,ρ′) lies above the graph of fc,ρ in ℝ4, or vice-versa.

Let 𝒦={K1,…,Kn}βŠ‚π•‚ be a set of n homothets of K, where Ki=K⁒(ci,ρi). In this paper we study two classes of proximity problems related to 𝒦.

Proximity queries.

We wish to preprocess 𝒦 into a data structure so that various proximity queries for a query homothet K0, such as intersection-detection (determine whether K0 intersects any homothet of 𝒦; if the answer is yes, return one such intersecting homothet of 𝒦), intersection reporting (report all homothets of 𝒦 that intersect K0), and nearest-neighbor queries (report the homothet of 𝒦 at the minimum K-distance from K0), can be performed efficiently. In addition, the data structure should support insertions and deletions of homothets of K.

Searching in the intersection graph and related problems.

Let 𝒒⁒(𝒦) denote the intersection graph of 𝒦, whose vertices are the homothets of 𝒦 and (Ki,Kj) is an edge if Ki∩Kjβ‰ βˆ…. Similarly, for a threshold parameter r0, the r0-proximity graph 𝒒r0⁒(𝒦) of 𝒦 consists of those edges (Ki,Kj) for which distK⁒(Ki,Kj)≀r0. We study efficient implementation of graph-search problems on 𝒒⁒(𝒦), like BFS or DFS. We also study the reverse shortest path (RSP) problem on 𝒦: given two elements Ki,Kjβˆˆπ’¦ and a parameter 1≀k<n, compute the smallest value rβˆ— for which 𝒒rβˆ—β’(𝒦) contains a path from Ki to Kj with at most k edges.

Related work.

There is extensive work on nearest-neighbor (NN) searching in many different fields including computational geometry, database systems, and machine learning. We refer the readers to various survey papers [4, 10, 20] for a general overview of known results on this topic. Here we briefly mention a few results that are most closely related to the problems studied in this paper. Agarwal and MatouΕ‘ek [9] presented a dynamic NN data structure for a point set in ℝd, under the Euclidean metric, that answers a query in Oβˆ—β’(n/sΟ•) time, where Ο•=1βˆ’1⌈d/2βŒ‰ and s∈[n,n⌈d/2βŒ‰] is a storage parameter, using Oβˆ—β’(s) space and preprocessing; the (amortized) update time for insertions/deletions of points is Oβˆ—β’(s/n). The bounds were slightly improved – nΞ΅ factors were replaced by logO⁒(1)⁑n factors – in [15, 26]. Kaplan et al. [26] presented a dynamic NN data structure for a set S of points in ℝ2 under fairly general distance functions. Its performance depends on the complexity of the Voronoi diagram of S under that distance function. For the Minkowski metric induced by a centrally-symmetric convex region, which is a semi-algebraic set of constant complexity, their data structure can answer an NN query in O⁒(log2⁑n) time, and handle insertion and deletion of a point in O⁒(β⁒(n)⁒log5⁑n) and O⁒(β⁒(n)⁒log9⁑n) amortized expected time, respectively, where β⁒(n), a variant of inverse Ackermann’s function, is an extremely slowly growing function; see also [31] for slightly improved bounds. These data structures, however, do not extend to ℝ3.

The problem of NN searching under general distance functions in ℝ3 is much less understood. By reducing NN queries to ball-intersection queries [8] and using semi-algebraic range-searching data structures [2, 33, 1], an NN query amid the set 𝒦 of n homothets in ℝ3, as above, can be answered in Oβˆ—β’(1) time using Oβˆ—β’(n4) space and preprocessing, or in Oβˆ—β’(n3/4) time using O⁒(n) space and preprocessing. Using recent standard techniques (see, e.g., the Appendix in [1]), one can obtain a space/query-time trade-off, as well as handle insertions/deletions of objects. Using a recent result by Agarwal et al. [5] on the vertical decomposition of the lower envelope of trivariate functions, an NN query amid 𝒦 can be answered in O⁒(log2⁑n) time using only Oβˆ—β’(n3) space, but this data structure does not support efficient deletions (insertions can be handled in a standard manner, using the dynamization technique of Bentley and Saxe [13]). Furthermore, it was not known whether an NN query amid 𝒦 can be answered in Oβˆ—β’(n2/3) time using Oβˆ—β’(n) space.

Motivated by numerous applications, there has been work on developing fast algorithms for intersection and proximity graphs of n geometric objects. Although the intersection graph may have Θ⁒(n2) edges, the goal in this line of work is to develop algorithms, by exploiting the underlying geometry, that run in Oβˆ—β’(n) time (or at least in subquadratic time). Cabello and Jejčič [14], and subsequently Chan and Skrepetos [21], presented O⁒(n⁒log⁑n) implementations of BFS in unit-disk intersection graphs, which was recently extended to general disk-intersection graphs by de Berg and Cabello [22]; see also [25, 26, 29]. The algorithm in [22] can also perform DFS and Dijkstra’s algorithm in O⁒(n⁒log⁑n) time. Katz et al. [28] showed that BFS in ball-intersection graphs (for congruent or arbitrary Euclidean balls) can be implemented in Oβˆ—β’(n2⁒ϕ/(Ο•+1)) time, where Ο•=⌊d/2βŒ‹+1, so in Oβˆ—β’(n4/3) time for d=3. The problem of devising efficient implementations for BFS/DFS in more general graphs in the plane also has received some attention, see, e.g., [6, 7, 27].

The reverse shortest path (RSP) problem for unit disks was studied by Wang and Zhao [36], who gave an Oβˆ—β’(n5/4)-time solution. Kaplan et al. [25] improved the runtime to Oβˆ—β’(n6/5) using the shrink-and-bifurcate technique (see [11]), and it was recently improved to Oβˆ—β’(n9/8) by Chan and Huang [17]. The best-known RSP algorithm for arbitrary disks runs in Oβˆ—β’(n6/5) expected time. Katz et al. [28] presented RSP algorithms for balls in ℝ3 – with Oβˆ—β’(n29/21) time for congruent balls and Oβˆ—β’(n56/39) for arbitrary balls. The RSP problem also has been studied for other geometric objects in ℝ2 [7, 28, 17].

Our results.

Our main result is a dynamic data structure for answering intersection and NN queries with a homothet of 𝕂 amid the set 𝒦 of homothets:

Theorem 1.

Let K be a compact, centrally-symmetric strictly convex semi-algebraic set in ℝ3 of constant complexity. Let 𝒦 be a set of n homothetic copies of K. For a storage parameter s∈[n,n3], 𝒦 can be maintained in a dynamic data structure with Oβˆ—β’(s) storage, that can answer an intersection-detection or NN-query (under the K-distance) with a homothet K0 of K in Oβˆ—β’(n/s1/3) time and that supports insertions/deletions in Oβˆ—β’(s/n) amortized expected time. It can report all k objects of 𝒦 intersecting K0 in additional O⁒(k) time.

Plugging Theorem 1 into Eppstein’s technique [23], or its enhancement by Chan [16], for maintaining bichromatic closest pairs, using s=n3/2, we obtain:

Corollary 2.

Let K be a compact, centrally-symmetric strictly-convex semi-algebraic set in ℝ3 of constant complexity. Let 𝒦,𝒦′ be two sets of homothets of K of combined size n. The K-closest pair between 𝒦 and 𝒦′, under insertions/deletions of homothets (in 𝒦 and 𝒦′), can be maintained in Oβˆ—β’(n1/2) amortized expected time per update.

Theorem 1 is obtained by presenting two data structures. The first one (see Section 4.1) uses Oβˆ—β’(n3) space, answers a query in Oβˆ—β’(1) time, and handles an insertion/deletion in Oβˆ—β’(n2) amortized expected time. (The data structure in [5] also obtains a similar space/query-time bound but it cannot handle deletions efficiently.) This data structure is based on constructing vertical shallow cuttings, a notion originally introduced in [18, 15], of the graphs of the distance functions of 𝒦. Roughly speaking, for a parameter tβ‰₯1, a vertical (n/t)-shallow cutting of 𝒦 is a collection of pairwise openly disjoint semi-unbounded pseudo-prisms that covers the region lying below the k-level of the arrangement of 𝒦, where each prism, consisting of all points that lie vertically below a constant-complexity semi-algebraic 3-dimensional region, intersects the graphs of only O⁒(n/t) functions of 𝒦. The random-sampling based technique used in [15, 26] to construct a vertical shallow cutting does not immediately extend to our setting because one needs to decompose the q-level, for some parameter q>0, in the 4D arrangement of the distance functions of 𝒦 into Oβˆ—β’(n3⁒(q+1)) constant-complexity cells. Although a recent result [5] constructs such a decomposition of the 0-level (with Oβˆ—β’(n3) cells), it does not extend to larger values of q. This problem remains elusive for arrangements of arbitrary trivariate semi-algebraic functions of constant complexity, but we develop a desired decomposition technique for our setting (in Section 2) by exploiting the structural geometric properties of the distance functions of 𝒦. This result is one of the main technical contributions of the paper. Using our result on the decomposition of the q-level, we construct a vertical (n/t)-shallow cutting of 𝒦 of size Oβˆ—β’(t3), for any t (Section 3).

The second data structure is a linear-size partition tree, with Oβˆ—β’(n2/3) query time, constructed on the point set π’¦βˆ—={(ci,ρi)∣1≀i≀n}βŠ‚β„4, that answers intersection-detection queries on 𝒦 with a homothet of 𝕂 as a query. The main technical challenge we face here is the construction of a so-called test set of 𝒦 (see [35] and below) of size rO⁒(1), which represents well the distance functions of all (n/r)-shallow homothets in 𝕂, i.e., the homothets that intersect at most n/r elements of 𝒦. By adapting the technique in [35] and again exploiting the structural geometric properties of the distance functions, we show that a test set, of size Oβˆ—β’(r4), with the desired properties can be constructed efficiently.

Using Theorem 1 and Corollary 2, we obtain our second set of results:

Theorem 3.
  1. (a)

    Given a set 𝒦 of n homothets of a constant-complexity, strictly convex, centrally-symmetric semi-algebraic set K, BFS or DFS in the intersection graph of 𝒦 can be performed in Oβˆ—β’(n3/2) expected time.

  2. (b)

    The single-source shortest-path tree as well as the minimum spanning forest of the r0-proximity graph of a set of n points, for any threshold parameter r0, weighted by the pairwise K-distances, can be computed in Oβˆ—β’(n3/2) time.

Combining Theorem 3(a) with the shrink-and-bifurcate technique [11, 25] yields:

Theorem 4.

Given a set 𝒦 of n homothets of a constant-complexity, strictly convex, centrally-symmetric semi-algebraic set K, two designated elements K, Kβ€²βˆˆπ’¦, and an integer k<n, the RSP problem on 𝒦, of finding the smallest rβˆ— for which Grβˆ—β’(𝒦) contains a path between K and Kβ€² of length at most k, can be solved in Oβˆ—β’(n62/39) expected time.

Because of lack of space, the proofs of Theorems 3 and 4 and of some of the lemmas are omitted from this version.

2 Decomposing the π’Œ-Level of an Arrangement of Distance Functions

Preliminaries.

Let 𝒦={K1,…,Kn}, where each Ki is a homothetic copy of K represented by a point Kiβˆ—=(ci,ρi) in ℝ4. For 1≀i≀n, set fi=fci,ρi, and let β„±:=ℱ⁒(𝒦)={fi∣1≀i≀n}. (As noted, distances from points x that lie inside some copy Ki, still measured by fi⁒(x), are nonpositive.) We will not distinguish between a function of β„± and its graph. For a point xβˆˆβ„3, Ki is the nearest neighbor of x in 𝒦 (under the K-distance distK), i.e., i=arg⁑min1≀j≀n⁑fj⁒(x), if fi appears on the lower envelope of β„± at x.

The level of a point pβˆˆβ„4 in π’œβ’(β„±) is the number of functions in β„± whose graphs lie below p. For a parameter k<n, the k-level of π’œβ’(β„±), denoted π’œk⁒(β„±), is the (closure of the) locus of all points on ⋃ℱ whose level is k. We define the (≀k)-level of π’œβ’(β„±), denoted π’œβ‰€k⁒(β„±), to be the (closure of the) set of all points in ℝ4 of level at most k, i.e., the set of points that lie on or below π’œk⁒(β„±) (not necessarily on βˆͺβ„±). The projection of π’œk⁒(β„±) onto ℝ3, denoted by β„³k=β„³k⁒(𝒦), is a subdivision of ℝ3. If a cell τ↓ of β„³k is the projection of a cell Ο„ of π’œk⁒(β„±) that lies on the graph of fi, then Ki is the k-th nearest neighbor in 𝒦 (under the K-distance function) of all points in τ↓. Note that A0⁒(β„±) is the lower envelope of β„±, and β„³0⁒(𝒦) is the Voronoi diagram of 𝒦 (under the K-distance).

The decomposition.

The main technical result of this section is that π’œk⁒(β„±) can be decomposed into Oβˆ—β’(n3⁒(k+1)) elementary cells, namely, constant-complexity semi-algebraic regions, each homeomorphic to a ball; see below for a more precise definition.

For 1≀iβ‰ j≀n, let Bi⁒j={xβˆˆβ„3∣fi⁒(x)=fj⁒(x)} be the bisector of Ki and Kj under the K-distance. Note that if KiβŠ‚Kj then, as is easily verified, fj⁒(x)<fi⁒(x) for all xβˆˆβ„3 and Bi⁒j is undefined. The following lemma gives a useful property of bisectors.

Lemma 5.

Fix a homothet Kiβˆˆπ’¦. Let Ξ» be a ray in ℝ3 emanating from ci. For any 1≀jβ‰ i≀n such that KiβŠ„Kj, Ξ» intersects Bi⁒j in at most one point, say, ΞΎ. Furthermore, fi⁒(x)≀fj⁒(x) for all x∈ci⁒ξ (where ci⁒ξ denotes the segment with endpoints ci and ΞΎ) and fj⁒(x)>fi⁒(x) for all xβˆˆΞ»βˆ–ci⁒ξ.

We are now ready to describe the decomposition of the cells of π’œk⁒(β„±) into elementary cells. (Our ultimate goal is to decompose the region below π’œk⁒(β„±) into elementary cells, but we start with this subtask.) For 1≀i≀n, let π’œki=π’œki⁒(β„±) denote the subset of cells of π’œk⁒(β„±) that lie on the graph of fi, and let β„³ki denote their projections (which are the cells of β„³k for which Ki is the k-th nearest neighbor). We describe the algorithm for decomposing the cells of β„³ki (or of π’œki). Lemma 5 implies that, for any jβ‰ i, Bi⁒j can be viewed as the graph of a function gi⁒j:π•Š2→ℝβ‰₯0 in spherical coordinates with ci as the origin. That is, for a given uβˆˆπ•Š2, let λ⁒(u) be the ray emanating from ci in direction u, and let xi⁒j⁒(u) be the intersection point of λ⁒(u) with the bisector Bi⁒j if such an intersection point exists; otherwise xi⁒j⁒(u) is undefined. We set gi⁒j⁒(u)=fj⁒(xi⁒j⁒(u)) if xi⁒j⁒(u) is defined and +∞ otherwise. Let G(i)={gi⁒j∣1≀jβ‰ i≀n}. We define the level of a point xβˆˆβ„3 in (the 3D arrangement, within π•Š2×ℝ) π’œβ’(G(i)) to be the number of functions in G(i) whose graphs intersect the (relatively open) segment ci⁒x. The following lemma will be useful in analyzing the complexity of the decomposition of π’œki.

Lemma 6.

For a parameter k<n, let Ο„ be a 3D cell of π’œki. Then τ↓ is a cell of level at most k in π’œβ’(G(i)).

Figure 1: A bisector crossing Ξ». (The figure is drawn in the 3D c-space.)

Proof.

It is obvious from the definition of G(i) that τ↓ is a cell in π’œβ’(G(i)). We now argue that its level in π’œβ’(G(i)) is at most k. Choose a point xβˆˆΟ„β†“. Let Ξ» be the ray emanating from ci and passing through x. Let gi⁒j be a function whose graph intersects the segment ci⁒x, say, at a point x0∈Bi⁒j. (See Fig. 1.) By Lemma 5, fi⁒(y)<fj⁒(y) for all points y on Ξ» preceding x0, and fj⁒(y)<fi⁒(y) for all points on Ξ» beyond x0. In particular, fi⁒(x)>fj⁒(x). Since Ο„ is a cell of π’œβ’(β„±), fj does not intersect Ο„, so fj lies below Ο„ in ℝ4 (in the x4-, or rather ρ-direction). Furthermore, Ο„βˆˆπ’œk⁒(β„±), so there are exactly k functions of β„± whose graphs lie below Ο„, implying that the level of τ↓ in π’œβ’(G(i)) is at most k, as claimed. β—€

Figure 2: Vertical decomposition of a cell in the spherical coordinate system.

We decompose the cells Ο„ of π’œk(i)⁒(β„±) by constructing β€œvertical decompositions” of the corresponding 3D projections τ↓ in the spherical coordinate system around ci. As for standard vertical decompositions in 3D, we proceed in two stages. The first stage erects a wall from each edge of Ο„ as follows. Fix an edge e of τ↓. For a point x∈e, let λ⁒(x) be the ray emanating from ci and passing through x, and let h⁒(x)=λ⁒(x)βˆ©Ο„β†“. By Lemma 5, h⁒(x) is a (connected) segment that touches e at one of its endpoints – it is either the top endpoint, for all points on e, or the bottom endpoint (with respect to distances from ci). We erect the wall e^=⋃x∈eh⁒(x) in τ↓; parts of the wall may extend to infinity when τ↓ is unbounded and e is a bottom edge. We repeat this step for all edges of τ↓. These walls decompose τ↓ into frustums (truncated cones), each of which, denoted by Ξ”, has a unique pair of front and back faces; the other faces of Ξ” lie on the created walls. (See Fig. 2.) The projections of the front and back faces of Ξ” on π•Š2 (with ci as the origin) are identical, and we denote this identical projection by Δ↓. The complexity of Δ↓ may be arbitrarily large (a typical situation in the first stage of vertical decompositions in general; see, e.g., [19]). The subcell Ξ” itself is of the form Ξ”={(u,r)∣uβˆˆΞ”β†“,r∈[gβˆ’β’(u),g+⁒(u)]}, where gβˆ’,g+ are the functions of G(i) whose graphs contain the front and back faces of Ξ”, respectively.

The second stage decomposes Ξ” into constant-complexity frustums, which we refer to as pseudo-cones. We decompose Δ↓ into spherical pseudo-trapezoids, by drawing portions of meridians within Δ↓ from each vertex and meridian-tangency point. We then lift each pseudo-trapezoid σ↓ to form the pseudo-cone Οƒ={(u,r)∣uβˆˆΟƒβ†“,r∈[gβˆ’β’(u),g+⁒(u)]} in ℝ3.

Repeating this step for all frustums created in the first stage, we obtain a decomposition of τ↓ into pseudo-cones, each being a semi-algebraic set of constant complexity and bounded by up to six facets (compare with standard vertical decompositions in 3D [19]). We refer to these pseudo-cones as elementary cells. We note that each pseudo-cone Ο• is defined by a subset DΟ• of at most seven functions of β„± (the function fi and up to six additional functions that define the functions gi⁒j that form the frustum), in the sense that Ο• appears in the vertical decomposition of a 3D cell of π’œβ’(DΟ•). By repeating this step for all cells of β„³ki and for all homothets Ki of 𝒦, we obtain a decomposition of β„³k=β„³k⁒(𝒦) into elementary cells. Finally, we lift each elementary cell of this decomposition vertically to π’œk⁒(β„±) in a straightforward manner, to obtain a corresponding decomposition of π’œk⁒(β„±).

Kaplan et al. [26, Lemma 6.2] have shown that the complexity of the vertical decomposition of the (≀k)-level π’œβ‰€k⁒(𝒒) of a set of 𝒒 of m bivariate semi-algebraic functions of constant complexity is O⁒(k2⁒ψ⁒(n/k)⁒λs⁒(k)), where ψ⁒(r) is the maximum complexity of the lower envelope of a subset of 𝒒 of size at most r, Ξ»s⁒(t) is the maximum length of Davenport-Schnizel sequences of order s composed of t symbols [34], and s is a constant depending on the complexity of the functions in 𝒒. By applying the argument in [26] to our spherical coordinate system and using the worst-case bound ψ⁒(m)=Oβˆ—β’(m2) on the complexity of the lower envelope of m constant-complexity bivariate functions [34], we conclude that the cells of β„³ki can be decomposed into Oβˆ—β’(n2⁒k) elementary cells. Hence, π’œk⁒(β„±), or β„³k⁒(𝒦), can be decomposed into Oβˆ—β’(n3⁒k) elementary cells. By adapting the randomized incremental algorithm described in [26], β„³ki, for each i, can be computed in Oβˆ—β’(n2⁒k) expected time. We thus obtain:

Theorem 7.

Let K be a compact, centrally-symmetric strictly convex semi-algebraic set in ℝ3 of constant complexity. Let 𝒦 be a set of n homothetic copies of K. The cells of β„³k⁒(𝒦), and the cells of the k-level in the arrangement of their K-distance functions, can be decomposed into Oβˆ—β’(n3⁒k) elementary cells, in Oβˆ—β’(n3⁒k) expected time.

3 Vertical Shallow Cuttings

A key notion that we need for constructing the dynamic NN data structures of Section 4 is that of a vertical shallow cutting of π’œβ’(β„±), as studied in [15, 18, 26] (for simpler scenarios). For a parameter k, a vertical k-shallow cutting of β„± is a collection of pairwise openly disjoint semi-unbounded pseudo-prisms (prisms for short), where each prism consists of all points that lie vertically below some pseudo-cone, of the decomposition (of Section 2) that covers π’œβ‰€k⁒(β„±), and is thus a semi-algebraic set of constant complexity. Furthermore, the ceilings of these prisms collectively form an x4-monotone surface that lies between π’œk⁒(β„±) and π’œ2⁒k⁒(β„±), and each prism is crossed by the graphs of at most O⁒(k) functions of β„±. The conflict list of a prism Οƒ is the set of functions whose graphs cross Οƒ.

Following the ideas in [26], for a parameter t∈[1,n], we construct a vertical (n/t)-shallow cutting as follows. We set two parameters: r=β⁒t⁒log⁑t, where Ξ² is a sufficiently large constant, independent of t, and q=β⁒log⁑t=r/t. We choose a random subset π–­βŠ†β„± consisting of r functions, construct π’œq⁒(𝖭), and compute the decomposition of π’œq⁒(𝖭) into a family Ξ of pseudo-cones as described in Section 2. For each pseudo-cone Ο„βˆˆΞž, we associate a label φ⁒(Ο„) which is the function of 𝖭 whose graph contains Ο„. Finally, we erect a semi-unbounded prism τ↑ from each pseudo-cone Ο„ of Ξ, given by τ↑=⋃{{c}Γ—(βˆ’βˆž,ρ]∣(c,ρ)βˆˆΟ„}. Let Ξžβ†‘ be the resulting set of pseudo-prisms. By Theorem 7, with large probability, |Ξ|=Oβˆ—β’(r3⁒q)=Oβˆ—β’(t3). We next show that Ξ is a vertical k-shallow cutting of β„±, where k=n/t, with high probability.

Range spaces and shallow 𝜺-nets.

Let Ξ£=(𝖷,β„›) be a (finite) range space, where 𝖷 is a set of objects and β„›βŠ†2𝖷 a set of ranges. Let 0<Ξ΅<1 be a given parameter. A subset π–­βŠ†π–· is called a shallow Ξ΅-net of Ξ£ if it satisfies the following two properties for every range Rβˆˆβ„› and for any parameter ΞΆβ‰₯0:

  1. (i)

    If |Rβˆ©π–­|≀΢⁒log⁑1Ξ΅ then |Rβˆ©π–·|≀α⁒(ΞΆ+1)⁒Ρ⁒|𝖷|, and

  2. (ii)

    If |Rβˆ©π–·|≀΢⁒Ρ⁒|𝖷| then |Rβˆ©π–­|≀α⁒(ΞΆ+1)⁒log⁑1Ξ΅.

Here Ξ± is a suitable constant. Note the difference between shallow and standard Ξ΅-nets: Property (i) (with ΞΆ=0) implies that a shallow Ξ΅-net is also a standard Ξ΅-net (possibly with a recalibration of Ξ΅). Property (ii) has no parallel in the case of standard Ξ΅-nets – there is no guarantee how a standard net interacts with small ranges (of the entire set 𝖷). The following result by Sharir and Shaul [35] is a generalization of the result on standard Ξ΅-nets [24].

Lemma 8 (Theorem 2.2 of Sharir and Shaul [35]).

Let Ξ£=(𝖷,β„›) be a range space with VC-dimension d. With a suitable choice of the constant of proportionality, a random sample π–­βŠ†π–· of O⁒(dΡ⁒log⁑1Ξ΅+log⁑1Ξ΄) is a shallow Ξ΅-net with probability at least 1βˆ’Ξ΄.

𝚡 is a vertical shallow cutting.

We apply the above result to the range space Ξ£=(β„±,β„›), so that each range in β„› is the subset of the surfaces of β„± that cross some region in ℝ4, taken from some family Ξ“ of regions. Concretely, this includes the following families Ξ“: (i) the set of pseudo-cones generated by the decomposition of a set of at most seven functions of β„± (recall that a pseudo-cone is defined by at most seven functions), (ii) the set of pseudo-prisms erected on these pseudo-cones, (iii) the set of edges in an arrangement of five functions of β„± (an edge in the arrangement of a subset of β„± is defined by at most five functions), and (iv) the set of rays in the positive x4-direction. Using standard arguments, it can be shown that the VC-dimension of Ξ£ is finite. Therefore, by applying Lemma 8 with Ξ΅=1/t and Ξ΄=1/3 and choosing the constant of proportionality appropriately, the random subset β„› is a (1/t)-shallow net of Ξ£ with probability at least 2/3, so we assume that 𝖭 is indeed a (1/t)-shallow net of Ξ£. Recall that q=β⁒log⁑t. Assuming Ξ²β‰₯2⁒α, where Ξ± is the constant in the definition of shallow nets, the converse of property (ii) of shallow nets, with ΞΆ=1, implies that the level of any point p on π’œq⁒(𝖭) with respect to β„± is at least n/t. Also, by property (i), the level of p is at most O⁒(n/t). Finally, the shallow net property also implies that the size of the conflict-list of any prism in Ξžβ†‘ is O⁒(n/t). The conflict list of all prisms can be computed in Oβˆ—β’(n⁒t3) time. Hence, we obtain:

Theorem 9.

Let K be a compact, centrally-symmetric strictly convex semi-algebraic set in ℝ3 of constant complexity. Let 𝒦 be a set of n homothetic copies of K. For any parameter t∈[1,nβˆ’1], there exists a vertical (n/t)-shallow cutting Ξ of the arrangement of the distance functions of 𝒦 of size Oβˆ—β’(t3). The cutting Ξ, along with the conflict list of each of its prisms, can be computed in Oβˆ—β’(n⁒t3) expected time.

4 Dynamic Data Structures for Proximity Queries

In this section we describe a dynamic data structure for answering intersection-detection queries amid 𝒦. Namely, for a query homothet K0βˆˆπ•‚, determine whether K0 intersects some homothet of 𝒦, and, if the answer is yes, return such a homothet. In addition to answering queries, the data structure can be updated efficiently as a homothet K0βˆˆπ•‚ is inserted into 𝒦 or deleted from 𝒦. The data structure can be extended to answering intersection-reporting queries, namely, reporting all homothets of 𝒦 that intersect K0, at an additional cost of O⁒(k).

As already noted, the insertion of a new homothet into 𝒦 can be handled using the standard dynamization technique by Bentley and Saxe [13] (see also [9]). That is, assume that we have an intersection-detection data structure that can handle deletions, which can be constructed in P⁒(n) time, so that a query can be answered in Q⁒(n) time and an object can be deleted in D⁒(n) time. Then the amortized insertion time is O⁒((P⁒(n)/n)⁒log⁑n), the deletion time remains D⁒(n), and the overall query time is O⁒(Q⁒(n)), assuming that Q⁒(n)=Ω⁒(nΞ΅).

We first describe a data structure that answers a query in Oβˆ—β’(1) time using Oβˆ—β’(n3) space and handles a deletion in Oβˆ—β’(n2) amortized expected time, and then describe a linear-size data structure that answers a query in Oβˆ—β’(n2/3) time and handles a deletion in O⁒(log2⁑n) amortized expected time.

4.1 Fast query-time data structure

We follow the same approach of Agarwal and MatouΕ‘ek for performing dynamic halfspace range reporting [9] (slightly improved but more involved approaches were proposed in [15, 26], but the one in [9] will do for our setting).

Data structure.

Let β„± be the collection of distance functions corresponding to the elements of 𝒦. Roughly speaking, we build a tree data structure on β„± using vertical shallow cuttings. That is, we start with β„±, choose a parameter t>1, compute an (n/t)-vertical shallow cutting Ξ of β„± of size Oβˆ—β’(t3), in Oβˆ—β’(n⁒t3) time, create a child for each prism Ο„ of Ξ, recursively construct the data structure for the conflict list β„±Ο„ of every Ο„βˆˆΞž, and attach it as the subtree of the child corresponding to Ο„. The recursion proceeds until we reach cells Ο„ with |β„±Ο„|=O⁒(1), in which case we just store β„±Ο„ at Ο„, as a list, say.

A query, with a copy K0=(c0,ρ0) of K, is answered in a standard way, by traversing the tree in a top-down manner. At each node (prism) Ο„ that we visit, we know that (c0,ρ0)βˆˆΟ„. We check whether (c0,ρ0) lies in any child prism of Ο„, and, if so, recurse at that child. Otherwise, we locate the child prism Ο„β€² for which (c0,ρ0) lies above Ο„β€², and report any element whose function belongs to the conflict list β„±Ο„β€².

However, this simple recursive approach runs into a technical difficulty when we delete a function from β„±. When deleting a function from the root, the deletion has to be propagated to some of its children, to their children, and so on. On average, each function appears in the conflict lists of Oβˆ—β’(t2) prisms of Ξ. When such a β€œgood” function is deleted, the deletion is propagated to only Oβˆ—β’(t2) descendants, leading to Oβˆ—β’(n2) overall deletion time, as can easily be verified. However, some of the functions (in fact, up to n/t of them) may appear in the conflict lists of Ω⁒(t3) prisms of Ξ. If these β€œbad” functions are the first n/t functions to be deleted and then the data structure is reconstructed, the overall cost of the deletion operations will be too high. As in [9, 26], we circumvent this difficulty by maintaining a partition of β„± into a few subsets and constructing a cutting for each subset that is good for all functions in that subset (i.e., each function in the subset appears in only Oβˆ—β’(t2) conflict lists).

We now describe the data structure in detail. We fix a sufficiently large constant t>0. The data structure is periodically reconstructed after performing some deletions. We use m to denote the size of β„± when the data structure was previously reconstructed and n to denote its current size. We reconstruct the data structure after deleting m/2⁒t functions from β„±. Thus nβ‰₯m⁒(1βˆ’1/2⁒t). Let P⁒(r) denote the maximum time spent in constructing the data structure for a set of r functions. We pay for the reconstruction cost by charging 2⁒t⁒P⁒(mβˆ’m/2⁒t)/m≀2⁒t⁒P⁒(n)/n time to each of the m/2⁒t delete operations that occurred before the reconstruction (the inequality holds because P is assumed to be superlinear). The data structure for β„± is a (recursively defined) tree Ψ⁒(β„±). We describe how a subtree Ψ⁒(𝒒), for a subset 𝒒 of Ξ½ functions, is constructed.

If ν≀n0, for some sufficiently large constant n0, then Ψ⁒(𝒒) is a single leaf, and we simply store 𝒒 at that leaf. So assume that Ξ½>n0. The root of Ψ⁒(𝒒) stores the following data:

  • β– 

    A partition of 𝒒 into subsets 𝒒1,…,𝒒u, uβ‰€βŒˆlog2⁑tβŒ‰, as described below.

  • β– 

    For each 1≀i≀u, a vertical (Ξ½/t)-shallow cutting Ξi for 𝒒i. For each Ξ”βˆˆΞži, we store its conflict list 𝒒i,Ξ”.

  • β– 

    For each 1≀i≀u and Ξ”βˆˆΞži, a pointer to the tree Ψ⁒(𝒒i,Ξ”).

  • β– 

    For each function fβˆˆπ’’i, the set LfβŠ†Ξži of prisms Ξ” crossed by the graph of f.

  • β– 

    A counter Ο‡ that keeps track of how many functions of 𝒒 can be deleted before we reconstruct Ψ⁒(𝒒).

After the construction of Ψ⁒(𝒒), before any deletions occur, the following properties hold:

  1. (P1)

    The counter Ο‡ is set to Ξ½/2⁒t.

  2. (P2)

    For each i, the x4-monotone surface formed by the pseudo-cones of Ξi (i.e., the ceilings of prisms of Ξi) lie above π’œΞ½/t⁒(𝒒i).

  3. (P3)

    For every i and Ξ”βˆˆΞži, |𝒒i,Ξ”|≀c⁒n/t, for some suitable absolute constant c.

  4. (P4)

    Each function fβˆˆπ’’i appears in the conflict lists of at most ΞΊ:=2⁒C1⁒t2+Ξ΄ prisms of Ξi, where C1 and Ξ΄>0 are the constants appearing in (1) below.

We now describe the construction of the partition 𝒒1,…,𝒒u, which proceeds iteratively. Suppose we have constructed 𝒒1,…,𝒒iβˆ’1. Set 𝒒iβˆ—=π’’βˆ–β‹ƒj<i𝒒i and put Ξ½i=|𝒒iβˆ—|. If Ξ½i≀ν/t, we stop. Otherwise, set ti=t⁒νi/Ξ½ and k=Ξ½i/ti=Ξ½/t.

We construct a vertical k-shallow cutting Ξi of 𝒒iβˆ— of size O⁒(ti3+Ξ΄), for an arbitrarily small constant Ξ΄>0. For each Ξ”βˆˆΞži, |𝒒i,Ξ”βˆ—|≀c⁒νi/ti=c⁒ν/t. We note that

βˆ‘Ξ”βˆˆΞži|𝒒i,Ξ”βˆ—|≀O⁒(ti3+Ξ΄)⁒c⁒νt≀C1⁒(t⁒νiΞ½)3+δ⁒νt≀C1⁒νi⁒t2+Ξ΄. (1)

A function fβˆˆπ’’iβˆ— is called good if it appears in the conflict list of at most ΞΊ prisms of Ξi and bad otherwise. Let 𝒒i be the set of good functions of 𝒒iβˆ—; set 𝒒i+1βˆ—=𝒒iβˆ—βˆ–π’’i. By (1), |𝒒i+1βˆ—|≀νi/2. Hence, uβ‰€βŒˆlog2⁑tβŒ‰. It is easily seen that properties (P1)–(P4) hold after the construction. This completes the description of the data structure. The total size and preprocessing time are Oβˆ—β’(n3).

Query procedure.

Let K⁒(c0,ρ0)βˆˆπ•‚ be a query homothet. Recall that K⁒(c0,ρ0) intersects a homothet of 𝒦 if the point (c0,ρ0) lies above the lower envelope of the corresponding set β„± of functions. The query is performed as follows. We search Ψ⁒(β„±) in a top-down manner with (c0,ρ0). Suppose we are at the root of a subtree Ψ⁒(𝒒). If Ψ⁒(𝒒) is a leaf, we check all functions of 𝒒 in a brute-force manner and return an answer in O⁒(n0)=O⁒(1) time. Otherwise, for each i≀u, we check whether (c0,ρ0) lies above the lower envelope of 𝒒i. If the answer is yes for any i, we return yes and also return an intersecting homothet (see below). Otherwise, we return no.

For a fixed i≀u, we proceed as follows. We search with c0, in a brute force manner, in Oβˆ—β’(t3)=O⁒(1) time, to determine the pseudo-cone τ↓ in the projection of Ξi that contains c0. Let fi be the function associated with Ο„, i.e., the ceiling of Ξ” lies in the graph of fi. We test whether ρ0β‰₯fi⁒(c0). If so, Ki and K⁒(c0,ρ0) intersect, so we return yes and report Ki as an intersection witness and terminate the query. If not, (c0,ρ0) lies in the semi-unbounded prism Ξ”, and we continue the search recursively in the data structure Ψ⁒(𝒒i,Ξ”).

Let Q⁒(Ξ½) be the maximum time spent by the query procedure in the subtree Ψ⁒(𝒒) storing at most Ξ½ functions. Then we obtain the following recurrence:

Q⁒(Ξ½)β‰€βŒˆlog2⁑tβŒ‰β’Q⁒(c⁒ν/t)+O⁒(t3+Ξ΄).

Its solution is easily seen to be Q⁒(ν)=O⁒(nΡ), for any constant Ρ>0, provided that n0 and t are chosen sufficiently large.

Deletion procedure.

Let fβˆˆβ„± be a function that we wish to delete from β„±. Again, we visit Ψ⁒(β„±) in a top-down manner. Suppose we are at the root v of a subtree Ψ⁒(𝒒). If v is a leaf, then we simply delete f from 𝒒 and stop. If v is an internal node, we first decrement the counter Ο‡ stored at v. If Ο‡ becomes 0, we reconstruct Ψ⁒(𝒒) from scratch (for the current 𝒒). Otherwise, we find the index i such that fβˆˆπ’’i. For each Ξ”βˆˆLf, we delete f from 𝒒i,Ξ” and then recursively delete f from Ψ⁒(𝒒i,Ξ”). By construction, |Lf|≀κ. The deletion procedure maintains the properties (P3) and (P4), and (P2) is replaced with a slightly weaker property:

(P2’)

For every i, the x4-monotone surface formed by the pseudo-cones of Ξi (i.e., the ceilings of prisms of Ξi) lie above or on π’œΞ½/2⁒t⁒(𝒒i).

The correctness of the query procedure follows from property (P2’). Following the analysis in [9], the amortized deletion time, including the time spent in reconstructing the data structure, is Oβˆ—β’(n2). Putting everything together, and combining this with the technique of Bentley and Saxe [13] for insertions, we obtain:

Lemma 10.

𝒦 can be preprocessed, in Oβˆ—β’(n3) expected time, into a data structure of size Oβˆ—β’(n3), so that an intersection-detection query, including the cost of reporting an intersecting member of 𝒦 if one exists, can be performed in Oβˆ—β’(1) time. A homothet can be inserted into 𝒦 or deleted from 𝒦 in Oβˆ—β’(n2) amortized expected time.

4.2 Linear-size data structure

Next, we present a linear-size dynamic data structure that supports intersection-detection queries in Oβˆ—β’(n2/3) time each, and can handle updates (insertions and deletions) in O⁒(log2⁑n) amortized expected time per update.

For a homothet K⁒(c0,ρ0), let fc0,ρ0+={(c,ρ)βˆˆβ„βˆ£Οβ‰₯fc0,ρ0⁒(c)} be the region lying above the graph of the distance function fc0,ρ0, which corresponds to the set of homothets that intersect K⁒(c0,ρ0). Put π’¦βˆ—={(c,ρ)∣K⁒(c,ρ)βˆˆπ’¦}βŠ‚β„4. For a query homothet K⁒(c0,ρ0), we wish to determine whether any point of π’¦βˆ— lies in fc0,ρ0+. We construct a linear-size partition tree for answering these queries, following the same approach as in [9, 32, 35]. We need a few definitions. Let 𝔽 be the set of distance functions corresponding to the homothets in 𝕂. Let PβŠ‚π•‚ be a set of n points (representing homothets of K). For a parameter kβ‰₯1, we call a semi-algebraic set Ξ³βŠ‚π•‚, which is semi-unbounded in the (βˆ’x4)-direction, k-shallow if |P∩γ|≀k. A major ingredient of the approach in [32, 35] is to construct a so-called test set composed of a small number of semi-algebraic sets, which represent well (in the sense made precise below) all distance functions of 𝔽 that are (n/r)-shallow, for a given parameter r>1, with respect to P. Formally, a finite collection Ξ¦ of semi-algebraic sets of constant complexity (not necessarily a subset of 𝔽) is called a test set for (n/r)-shallow ranges in 𝔽 with respect to P if it satisfies the following properties:

  1. (i)

    Every set in Ξ¦ is (n/r)-shallow with respect to P.

  2. (ii)

    The complement of the union of any m sets of Ξ¦ can be decomposed into at most ΢⁒(m) β€œelementary cells” (semi-algebraic sets of constant complexity) for any mβ‰₯1, where ΢⁒(m) is a suitable monotone increasing superlinear function of m.

  3. (iii)

    Any (n/r)-shallow set Οƒβˆˆπ”½ can be covered by the union of at most Ξ΄ ranges of Ξ¦, where Ξ΄ is a constant (independent of r).

Sharir and Shaul [35] showed that if there exists a test set of size rO⁒(1) for (n/r)-shallow ranges of 𝔽, then one can construct a linear-size partition tree on P so that an 𝔽-emptiness query can be answered in Oβˆ—β’(n/ΞΆβˆ’1⁒(n)) time, for the corresponding function ΞΆ.

Test-set construction.

We describe an algorithm for constructing a test set of size O⁒(r4) with ΢⁒(m)=Oβˆ—β’(m3) and Ξ΄=1. Let β„± be the set of distance functions of 𝒦 as above. We take a random subset RβŠ†β„± of s=c⁒r⁒log⁑r functions, for some sufficiently large constant r, where c>0 is another sufficiently large absolute constant, independent of, and much smaller than r, and construct the (standard) 4D vertical decomposition π’œβˆ₯⁒(R) of the arrangement π’œβ’(R), of size Oβˆ—β’(r4), as described in [3, 30, 34]. By a standard random-sampling argument [24], with probability at least 1/2, each cell of π’œβˆ₯⁒(R) is crossed by at most n/r functions of β„±, provided that c is chosen sufficiently large. If this is not the case, we discard R and choose another random subset, until we find, in expected O⁒(1) trials, one with the desired property. We clip π’œβˆ₯⁒(R) within the halfspace x4β‰₯0 (to restrict it to within 𝕂). We choose a subset Ξ of the cells of π’œβˆ₯⁒(R), consisting of those cells that have at most n/r functions of β„± passing fully below them. By construction, these cells cover π’œβ‰€n/r⁒(β„±), and are contained in π’œβ‰€2⁒n/r⁒(β„±).

Let Ο„ be a cell of Ξ. Set Φτ=⋃(c0,ρ0)βˆˆΟ„fc0,ρ0+. Since Ο„ and fc0,ρ0 are semi-algebraic sets of constant complexity, Φτ is also a semi-algebraic set of constant complexity. For a homothet Kiβˆˆπ’¦, the point Kiβˆ—βˆˆπ•‚ lies in Φτ if and only if there is a point (c0,ρ0)βˆˆΟ„ such that Kiβˆ—βˆˆfc0,ρ0+. This happens when (c0,ρ0)∈fi+, i.e., the graph of the function fi crosses Ο„ or lies below Ο„. By construction, there are at most n/r+n/r=2⁒n/r such functions. Consequently, Φτ is (2⁒n/r)-shallow with respect to the points of π’¦βˆ— with Ξ΄=1.

Set Ξ¦={Ξ¦Ο„βˆ£Ο„βˆˆΞž}. Ξ¦ is a family of Oβˆ—β’(r4) constant-complexity semi-algebraic sets in 𝕂, each of which is (2⁒n/r)-shallow with respect to π’¦βˆ—. This is the desired test set. Each set Φτ is unbounded in the positive x4-direction, therefore the complement of the union of a subset of m sets is the region lying below their lower envelope. By a result in [5], the complement of their union (i.e., the region below their lower envelope) can be decomposed into Oβˆ—β’(m3) pseudo-prisms. Hence, we obtain:

Lemma 11.

Let PβŠ‚π•‚ be a set of n points and rβ‰₯1 a parameter. A test set Ξ¦ of size O⁒(r4) for the functions in 𝔽 that are (n/r)-shallow with respect to P can be computed in Oβˆ—β’(r4) expected time, so that ΢⁒(m)=Oβˆ—β’(m3) and Ξ΄=1.

Using Lemma 11 and adapting the approach in [35], we can preprocess 𝒦 into a linear-size data structure that supports intersection-detection queries in Oβˆ—β’(n2/3) time. By (re)constructing portions of the partition tree periodically (as in the previous data structure), deletions can be handled efficiently. Omitting the straightforward details, we obtain:

Lemma 12.

Let 𝒦 be a set of n homothets of K. 𝒦 can be preprocessed, in O⁒(n⁒log⁑n) expected time, into a data structure of size O⁒(n), so that an intersection-detection query can be answered in Oβˆ—β’(n2/3) time. A homothet of K can be inserted into or deleted from the data structure in O⁒(log2⁑n) amortized time.

By combining this data structure with Lemma 10 in a standard manner [1], we can obtain the following space/query-time trade-off:

Theorem 13.

Let 𝒦 be a set of n homothets of K, and let s∈[n,n3] be a storage parameter. 𝒦 can be preprocessed, in Oβˆ—β’(s) expected time, into a data structure of size Oβˆ—β’(s), so that an intersection-detection query can be answered in Oβˆ—β’(n/s1/3) time. A homothet can be inserted into or deleted from the data structure in Oβˆ—β’(s/n) amortized time.

Finally, by combining this data structure with the parametric-search technique [8], we establish Theorem 1 (for answering nearest-neighbor queries in 𝒦 under the K-distance).

References

  • [1] P. K. Agarwal, B. Aronov, E. Ezra, M. J. Katz, and M. Sharir. Intersection queries for flat semi-algebraic objects in three dimensions and related problems. ACM Transactions on Algorithms, 21:25:1–25:59, 2025. doi:10.1145/3721290.
  • [2] P. K. Agarwal, B. Aronov, E. Ezra, and J. Zahl. An efficient algorithm for generalized polynomial partitioning and its applications. SIAM Journal on Computing, 50:760–787, 2021. doi:10.1137/19M1268550.
  • [3] P. K. Agarwal, A. Efrat, and M. Sharir. Vertical decomposition of shallow levels in 3-dimensional arrangements and its applications. SIAM Journal on Computing, 29(3):912–953, 1999. doi:10.1137/S0097539795295936.
  • [4] P. K. Agarwal and J. Erickson. Geometric range searching and its relatives. In Advances in Discrete and Computational Geometry, volume 223 of Contemporary Mathematics, pages 1–56. American Mathematical Society, Providence, RI, 1999. doi:10.1090/conm/223/03131.
  • [5] P. K. Agarwal, E. Ezra, and M. Sharir. Vertical decomposition in 3D and 4D with applications to line nearest-neighbor searching in 3D. In 35th ACM-SIAM Symposium on Discrete Algorithms (SODA 2024), pages 150–170, 2024. doi:10.1137/1.9781611977912.8.
  • [6] P. K. Agarwal, H. Kaplan, M. J. Katz, and M. Sharir. Segment proximity graphs and nearest neighbor queries amid disjoint segments. In 32nd European Symposium on Algorithms (ESA 2024), pages 7:1–7:20, 2024. doi:10.4230/LIPIcs.ESA.2024.7.
  • [7] P. K. Agarwal, M. J. Katz, and M. Sharir. On reverse shortest paths in geometric proximity graphs. Computational Geometry, 117:102053, 2024. doi:10.1016/j.comgeo.2023.102053.
  • [8] P. K. Agarwal and J. MatouΕ‘ek. Ray shooting and parametric search. SIAM Journal on Computing, 22:794–806, 1993. doi:10.1137/0222051.
  • [9] P. K. Agarwal and J. MatouΕ‘ek. Dynamic half-space range reporting and its applications. Algorithmica, 13:325–345, 1995. doi:10.1007/BF01293483.
  • [10] A. Andoni and P. Indyk. Nearest neighbors in high dimensional spaces. In J. E. Goodman, J. O’Rourke, and C. D. TΓ³th, editors, Handbook of Discrete and Computational Geometry. CRC Press, Boca Raton, FL, 3rd edition, 2017. Chapter 43. doi:10.1201/9781315119601.
  • [11] R. Ben Avraham, O. Filtser, H. Kaplan, M. J. Katz, and M. Sharir. The discrete and semicontinuous FrΓ©chet distance with shortcuts via approximate distance counting and selection. ACM Transactions on Algorithms, 11(4):29:1–29:29, 2015. doi:10.1145/2700222.
  • [12] S. Basu, R. Pollack, and M.-F. Roy. Algorithms in Real Algebraic Geometry. Springer, Berlin, 2nd edition, 2006.
  • [13] J. L. Bentley and J. B. Saxe. Decomposable searching problems I: Static-to-dynamic transformation. Journal of Algorithms, 1:301–358, 1980. doi:10.1016/0196-6774(80)90015-2.
  • [14] S. Cabello and M. Jejčič. Shortest paths in intersection graphs of unit disks. Computational Geometry, 48:360–367, 2015. doi:10.1016/j.comgeo.2014.12.003.
  • [15] T. M. Chan. A dynamic data structure for 3-d convex hulls and 2-d nearest-neighbor queries. Journal of the ACM, 57:16:1–16:15, 2010. doi:10.1145/1706591.1706596.
  • [16] T. M. Chan. Dynamic generalized closest pair: Revisiting Eppstein’s technique. In 3rd Symposium on Simplicity in Algorithms (SOSA 2020), pages 33–37, 2020. doi:10.1137/1.9781611976014.6.
  • [17] T. M. Chan and Z. Huang. Faster algorithms for reverse shortest path in unit-disk graphs and related geometric optimization problems: Improving the shrink-and-bifurcate technique. In 41st International Symposium on Computational Geometry (SoCG 2025), pages 32:1–32:14, 2025. doi:10.4230/LIPIcs.SoCG.2025.32.
  • [18] T. M. Chan and K. Tsakalidis. Optimal deterministic algorithms for 2-d and 3-d shallow cuttings. Discrete & Computational Geometry, 56:866–881, 2016. doi:10.1007/S00454-016-9784-4.
  • [19] B. Chazelle, H. Edelsbrunner, L. Guibas, and M. Sharir. A singly exponential stratification scheme for real semi-algebraic varieties and its applications. In 16th International Colloquium on Automata, Languages and Programming (ICALP 1989), pages 179–193, 1989. Also in Theoretical Computer Science 84 (1991), 77–105. doi:10.1007/BFB0035760.
  • [20] K. L. Clarkson. Nearest neighbor searching and metric space dimensions. In G. Shakhnarovich, T. Darrell, and P. Indyk, editors, Nearest-Neighbor Methods in Learning and Vision. MIT Press, 2006.
  • [21] K. L. Clarkson and P. W. Shor. Applications of random sampling in computational geometry, II. Discrete & Computational Geometry, 4:387–421, 1989. doi:10.1007/BF02187740.
  • [22] M. de Berg and S. Cabello. An O⁒(n⁒log⁑n) algorithm for single-source shortest paths in disk graphs. In 33rd European Symposium on Algorithms (ESA 2025), pages 81:1–81:15, 2025. doi:10.4230/LIPIcs.ESA.2025.81.
  • [23] D. Eppstein. Fast hierarchical clustering and other applications of dynamic closest pairs. ACM Journal of Experimental Algorithmics, 5:1, 2000. doi:10.1145/351827.351829.
  • [24] D. Haussler and E. Welzl. Epsilon-nets and simplex range queries. Discrete & Computational Geometry, 2:127–151, 1987. doi:10.1007/BF02187876.
  • [25] H. Kaplan, M. J. Katz, R. Saban, and M. Sharir. The unweighted and weighted reverse shortest path problem for disk graphs. ACM Transactions on Algorithms, 2023. To appear. Also in 31st European Symposium on Algorithms (ESA 2023), 67:1–67:14.
  • [26] H. Kaplan, W. Mulzer, L. Roditty, P. Seiferth, and M. 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.
  • [27] M. J. Katz, R. Saban, and M. Sharir. Near-linear algorithms for visibility graphs over a 1.5-dimensional terrain. In 32nd European Symposium on Algorithms (ESA 2024), pages 77:1–77:17, 2024. doi:10.4230/LIPICS.ESA.2024.77.
  • [28] M. J. Katz, R. Saban, and M. Sharir. BFS and reverse shortest paths for ball intersection graphs in three and higher dimensions. In 36th International Symposium on Algorithms and Computation (ISAAC 2025), pages 45:1–45:15, 2025. doi:10.4230/LIPICS.ISAAC.2025.45.
  • [29] K. Klost. An algorithmic framework for the single source shortest path problem with applications to disk graphs. Computational Geometry, 111:101979, 2023. doi:10.1016/j.comgeo.2022.101979.
  • [30] V. Koltun. Almost tight upper bounds for vertical decompositions in four dimensions. Journal of the ACM, 51:699–730, 2004. doi:10.1145/1017460.1017461.
  • [31] C.-H. Liu. Nearly optimal planar k nearest neighbors queries under general distance functions. SIAM Journal on Computing, 51(3):723–765, 2022. doi:10.1137/20M1388371.
  • [32] J. MatouΕ‘ek. Reporting points in halfspaces. Computational Geometry, 2:169–186, 1992. doi:10.1016/0925-7721(92)90006-E.
  • [33] J. MatouΕ‘ek and Z. PatΓ‘kovΓ‘. Multilevel polynomial partitioning and simplified range searching. Discrete & Computational Geometry, 54:22–41, 2015. doi:10.1007/s00454-015-9701-2.
  • [34] M. Sharir and P. K. Agarwal. Davenport-Schinzel Sequences and Their Geometric Applications. Cambridge University Press, New York, 1995.
  • [35] M. Sharir and H. Shaul. Semialgebraic range reporting and emptiness searching with applications. SIAM Journal on Computing, 40(4):1045–1074, 2011. doi:10.1137/090765092.
  • [36] H. Wang and Y. Zhao. Reverse shortest path problem for unit-disk graphs. Journal of Computational Geometry, 14(1):14–47, 2023. doi:10.20382/JOCG.V14I1A2.