Dynamic Unit-Disk Range Reporting
Abstract
For a set of points in the plane and a value , the unit-disk range reporting problem is to construct a data structure so that given any query disk of radius , all points of in the disk can be reported efficiently. We consider the dynamic version of the problem where point insertions and deletions of are allowed. The previous best method provides a data structure of space that supports amortized insertion time, amortized deletion time, and query time, where is an arbitrarily small positive constant and is the output size. In this paper, we improve the query time to while keeping other complexities the same as before. A key ingredient of our approach is a shallow cutting algorithm for circular arcs, which may be interesting in its own right. A related problem that can also be solved by our techniques is the dynamic unit-disk range emptiness queries: Given a query unit disk, we wish to determine whether the disk contains a point of . The best previous work can maintain in a data structure of space that supports amortized insertion time, amortized deletion time, and query time. Our new data structure also uses space but can support each update in amortized time and support each query in time.
Keywords and phrases:
Unit disks, range reporting, range emptiness, alpha-hulls, dynamic data structures, shallow cuttingsCopyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Computational geometry ; Theory of computation Design and analysis of algorithmsFunding:
This research was supported in part by NSF under Grant CCF-2300356.Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim ThắngSeries and Publisher:

1 Introduction
Range searching is a fundamental problem and has been studied extensively in computational geometry [2, 3, 26]. In this paper, we consider a dynamic range reporting problem regarding disks of fixed radius, called unit disks.
Given a set of points in the plane, the unit-disk range reporting problem (or UDRR for short) is to construct a data structure to report all points of in any query unit disk. The problem is also known as the fixed-radius neighbor problem in the literature [4, 14, 16, 17]. Chazelle and Edelsbrunner [17] constructed a data structure of space that can answer each query in time, where is the output size; their data structure can be constructed in time. By a standard lifting transformation [5], the problem can be reduced to the half-space range reporting queries in 3D; this reduction also works if the radius of the query disk is arbitrary. Using Afshani and Chan’s 3D half-space range reporting data structure [1], one can construct a data structure of space with query time, while the preprocessing takes expected time since it invokes Ramos’ algorithm [27] to construct shallow cuttings for a set of planes in 3D. Chan and Tsakalidis [13] later presented an -time deterministic shallow cutting algorithm. Combining the framework in [1] with the shallow cutting algorithm [13], one can build a data structure of space in deterministic time that can answer each UDRR query in time.
We consider the dynamic UDRR problem in which point insertions and deletions of are allowed. By the lifting transformation, the problem can be reduced to dynamic halfspace range reporting in 3D [11, 7, 10], which also works for query disks of arbitrary radii. Using the currently best result of dynamic halfspace range reporting [6], one can obtain a data structure of space that supports amortized insertion time, amortized deletion time, and query time, where is an arbitrarily small positive constant and is the output size.
Our result.
In this paper, we achieve the optimal query time, while the space of the data structure and the update time complexities are the same as above.
A byproduct of our techniques is a static data structure of space that can be built in time and support query time. This matches the above result of [1, 13]. But our method is much simpler. Indeed, the algorithm of [1, 13] involves relatively advanced geometric techniques like computing shallow cuttings for the planes in 3D, planar graph separators, etc. Our algorithm, on the contrary, relies only on elementary techniques (the most complicated one might be a fractional cascading data structure [18, 19]). One may consider our algorithm a generalization of the classical 2D half-plane range reporting algorithm of Chazelle, Guibas, and Lee [20].
Our techniques may also be useful for solving other problems related to unit disks. In particular, we can obtain an efficient algorithm for the dynamic unit-disk range emptiness queries. For a dynamic set of points in the plane, we wish to determine whether a query unit disk contains any point of (and if so, return such a point as an “evidence”). The previous best solution is to use a dynamic nearest neighbor search data structure [11]. Specifically, we can have a data structure of space that supports amortized insertion time, amortized deletion time, and query time. Using our techniques, we obtain an improved data structure of space that supports both insertions and deletions in amortized time and supports queries in time.
Our approach.
We first discuss our static data structure. We use a set of grid cells (each of which is an axis-parallel rectangle) to capture the proximity information for the points of , such that the distance between any two points in the same cell is at most 1. For a query unit disk whose center is , points of in the cell that contains can be reported immediately. The critical part is handling other cells that contain points of . The number of such cells is constant and each of them is separated from (and thus from ) by an axis-parallel line. The problem thus boils down to the following subproblem: Given a set of points in a grid cell above a horizontal line , report the points of in any query unit disk whose center is below . A point is in if and only if lies in the unit disk centered at , or equivalently, is above the arc of the boundary of below . Let denote the set of all such arcs for all points . To find the points of in , it suffices to report the arcs of below . To tackle this problem, we follow the same framework as that for the 2D half-plane range reporting algorithm [20], by constructing lower envelope layers of and building a fractional cascading data structure on them [18, 19].
To make the data structure dynamic, we first derive a data structure to maintain the grid cells dynamically so that each update (point insertions/deletions) can be handled in amortized time. This dynamic data structure could be of independent interest. Next, we develop a data structure to dynamically maintain arcs of to support the arc-reporting queries (i.e., given a query point, report all arcs of below it). To this end, we cannot use the fractional cascading data structure anymore because it is not amenable to dynamic changes. Instead, we adapt the techniques for dynamically maintaining a set of lines to answer line-reporting queries (i.e., given a query point, report all lines below the query point; its dual problem is the halfplane range reporting queries) [6, 9, 10, 11, 23]. To make these techniques work for the arcs of in our problem, we need an efficient shallow cutting algorithm for . For this, we adapt the algorithm in [13] for lines and derive an time shallow cutting algorithm for . As shallow cuttings have many applications, our algorithm may be interesting in its own right.
Outline.
The rest of the paper is organized as follows. In Section 2, we introduce notation and a conforming coverage set of grid cells to capture the proximity information for points of . Section 3 discusses our dynamic UDRR data structure. A main subproblem of it is solved in Section 4. A key ingredient of our method is an efficient algorithm for computing shallow cuttings for arcs; this algorithm is presented in Section 5. Section 6 demonstrates that our techniques may be used to solve other related problems, such as dynamic unit-disk range emptiness queries. Due to the space limit, some details and proofs are omitted but can be found in the full paper.
2 Preliminaries
We define some notation that will be used throughout the paper. A unit disk refers to a disk of radius . A unit circle is defined similarly. Unless otherwise stated, a circular arc or an arc refers to a circular arc of radius . For a circular arc , we call the circle that contains the underlying circle of and call the disk whose boundary contains the underlying disk.
For any point , let denote the unit disk centered at . For any region and any set of points in the plane, let denote the subset of points of inside , i.e., . For any region in the plane, we use to denote its boundary, e.g., if is a disk, then is its bounding circle.
Unless otherwise stated, refers to an arbitrarily small positive constant. Depending on the context, we often use to denote the output size of a reporting query. For any point in the plane, we use and to denote the and -coordinates of , respectively.
2.1 Conforming coverage of
Let be a set of points in the plane. We wish to have a data structure for to answer the following unit-disk range reporting queries: Given a query unit disk , report , i.e., the points of in .
As discussed in Section 1, our method (for both static and dynamic problems) relies on a set of grid cells to capture the proximity information for the points of . The technique of using grids has been widely used in various algorithms for solving problems in unit-disk graphs [32, 29, 12, 31, 30, 28]. However, the difference here is that we need to handle updates to and therefore our grid cells will be dynamically changed as well. To resolve the issue, our definition of grid cells is slightly different from the previous work. Specifically, we define a conforming coverage set of cells for in the following.
Definition 1 (Conforming Coverage).
A set of cells in the plane is called a conforming coverage for if the following conditions hold.
-
1.
Each cell of is an axis-parallel rectangle of side lengths at most . This implies that the distance of every two points in each cell is at most .
-
2.
The union of all cells of covers all the points of .
-
3.
Every two cells are separated by an axis-parallel line.
-
4.
Each cell is associated with a subset of cells (called neighboring cells of ) such that for any point , .
-
5.
For any point , if is not in any cell of , then .
To solve the static problem, after computing a conforming coverage set of cells for , we never need to change it in the future. As such, the following lemma from [28] suffices.
Lemma 2 ([28]).
-
1.
A conforming coverage set of size , along with and for all cells , can be computed in time and space.
-
2.
With time and space preprocessing, given any point , we can do the following in time: Determine whether is in a cell of , and if so, return and .
However, for the dynamic problem, due to the updates of , the conforming coverage set also needs to be maintained dynamically. For this, we have the following lemma.
Lemma 3.
A conforming coverage set of cells for can be maintained in space (where is the size of the current set ) such that each point insertion of can be handled in worst-case time, each point deletion can be handled in amortized time, and the following query can be answered in time: Given a query point , determine whether is in a cell of , and if so, return and .
The proof of Lemma 3, which is lengthy and technical, is in the full paper. Roughly speaking, if a point is inserted to , then at most cells will be added to and will eventually be inserted into for the cell containing . If a point is deleted from , the deletion boils down to the deletion of from for the cell containing . We do not remove cells from . Instead, we reconstruct the entire data structure after deletions; this guarantees that the size of is always . See the full paper for the details.
3 Dynamic range reporting
Let be a set of points in the plane. We wish to maintain a data structure for to answer unit-disk range reporting queries subject to point insertions and deletions of . Let denote the size of the current set .
Using Lemma 3, we maintain a conforming coverage set of cells for . To insert a point to , our insertion algorithm for Lemma 3 boils down to inserting to for a cell that contains . To delete a point from , our deletion algorithm for Lemma 3 boils down to deleting from for a cell that contains .
Consider a query unit disk whose center is . If is not in a cell of , then by Definition 1(5), and thus we simply return null. Otherwise, to report , it suffices to report for all cells . In the case of , since the distance between two points in is at most 1 by Definition 1(1), we can simply report all points of . If , and are separated by an axis-parallel line by Definition 1(3). Without loss of generality, we assume that and are separated by a horizontal line with above and below . As , is below , i.e., is separated from by . Our goal is to report points of . Due to the point updates of , our problem is reduced to the following subproblem, called dynamic line-separable UDRR problem.
Problem 1 (Dynamic line-separable UDRR).
For a set of points above a horizontal line , maintain in a data structure to support the following operations. (1) Insertion: insert a point to ; (2) deletion: delete a point from ; (3) unit-disk range reporting query: given a point below , report the points of in the unit disk .
We have the following Lemma 4 for the dynamic line-separable UDRR problem.
Lemma 4.
For the dynamic line-separable UDRR problem, we can have a data structure of space to maintain to support insertions in amortized time, deletions in amortized time, and unit-disk range reporting queries in time, where is the output size, is an arbitrarily small positive constant, and is the size of the current set .
We will prove Lemma 4 in Section 4. With Lemmas 3 and 4, we can obtain the following main result for our original dynamic UDRR problem.
Theorem 5.
We can maintain a set of points in the plane in a data structure of space to support insertions in amortized time, deletions in amortized time, and unit-disk range reporting queries in time, where is the output size, is an arbitrarily small positive constant, and is the size of the current set .
Proof.
We build the data structure in Lemma 3 to maintain a conforming coverage set of cells for . For each cell that contains at least one point of , we maintain a data structure for with respect to the supporting line of each edge of . Since the space of each is , each cell of has four edges, and , the total space of the overall data structure is .
Insertions.
Deletions.
Queries.
Given a query unit disk with center , we first check whether is in a cell of , and if so, find such a cell; this takes time by Lemma 3. If no cell of contains , then and we simply return null. Otherwise, let be the cell of that contains . We first report all points of . Next, for each , by Definition 1(3), and are separated by an axis-parallel line . Since each edge of and is axis-parallel, must have an edge whose supporting line is parallel to and separates and . Using , we report all points of inside . As , the total query time is by Lemma 4.
4 Proving Lemma 4: Dynamic line-separable UDRR
We now prove Lemma 4. For notational convenience, instead of , we use to denote the size of .
Consider a query unit disk with center below . The goal is to report . Observe that a point is in if and only if is in the unit disk . The portion of below is a circular arc, denoted by . Since is above , is on the lower half circle of and thus is -monotone. As such, is in if and only if is above the arc . Define to be the set of arcs for all points . Therefore, reporting the points of in becomes reporting the arcs of that are below , which we call arcs reporting queries.
In what follows, an arc of always refers to the portion below of a unit circle with center above . Our problem thus becomes dynamically maintaining a set of arcs to report the arcs of below a query point . The arcs reporting queries can be reduced to the following -lowest-arcs queries: Given a query vertical line and a number , report the lowest arcs of intersecting . We have the following observation, which follows the proof of Chan [7] for lines.
Observation 6 ([7]).
Suppose that we can answer each -lowest-arcs query in time. Then, the arcs of below a query point can be reported in time, where is the output size.
In light of the above observation, we now focus on the -lowest-arcs queries. We adapt a technique for a similar problem on lines (which is the dual problem of the dynamic halfplane range reporting problem): Dynamically maintain a set of lines (subject to insertions and deletions) to report the -lowest lines at a query vertical line. For this problem, Chan [10] gave a data structure of space that supports amortized update time and query time. De Berg and Staals [6] improved the result of [10] for dynamically maintaining a set of planes in 3D. They gave a data structure of space that supports amortized insertion time, amortized deletion time, and query time. Their approach is based on the techniques for dynamically maintaining planes for answering lowest point queries [9, 11, 23] and these techniques in turn replies on computing shallow cuttings on the planes in 3D [13]. In the following, we will extend these techniques to the arcs of and prove the following result.
Lemma 7.
For the set of arcs, we can have a data structure of space to support insertions in amortized time, deletions in amortized time, and -lowest-arcs queries in time, where is the size of the current set .
In what follows, we first develop a shallow cutting algorithm for arcs of in Section 4.1 and then using the algorithm to prove Lemma 7 in Section 4.2.
4.1 Shallow cuttings
Without loss of generality, we assume that is the -axis. Let (resp., ) be the half-plane below (resp., above) . Note that each arc of is -monotone, every arc has both endpoints on , and every two arcs cross each other at most once.
We use -constrained unit disk to refer to a unit disk with center in and use -constrained arc to refer to a portion of the arc for a unit circle with center in . For any point , let to denote the vertical downward ray from . We say that an arc of is below if it intersects . As the center of is in and , intersects at most once.
For a parameter and a region of the plane, a -cutting covering for the arcs of is a set of interior-disjoint cells such that the union of all cells covers and each cell intersects at most arcs of . For each cell , its conflict list is the set of arcs of that intersect . The size of the cutting is the number of its cells.
For a point , the level of in is the number of arcs of below . For any integer , the -level of , denoted by , is defined as the region consisting of all points of with level at most . Given parameters , a -shallow -cutting is a -cutting for that covers .
We use pseudo-trapezoid to refer to a region that has two vertical line segments as left and right edges, an -constrained arc or a line segment on as a top edge, and an -constrained arc as a bottom edge. In particular, if a pseudo-trapezoid does not have a bottom edge, i.e., the bottom side is unbounded, then we call it a bottom-open pseudo-trapezoid.
We say that a shallow cutting is in the bottom-open pseudo-trapezoid form if every cell of it is a bottom-open pseudo-trapezoid. Our main result about the shallow cuttings for is given in the following theorem.
Theorem 8.
There exist constants , , and , such that for a parameter , we can compute a -shallow -cutting of size at most in the bottom-open pseudo-trapezoid form, along with conflict lists of all its cells, for all , in total time. In particular, we can compute a -shallow -cutting of size , along with its conflict lists, in time.
4.2 Proving Lemma 7
We now prove Lemma 7. With the shallow cutting algorithm in Theorem 8, we generalize the techniques of [6, 10] for lines to the arcs of . We first give two deletion-only data structures, which will be needed in our fully dynamic data structure for Lemma 7.
4.2.1 Deletion-only data structure
Our first deletion-only data structure is given in Lemma 9 (see the full paper for the proof).
Lemma 9.
There is a data structure of size to maintain a set of arcs to support amortized time deletions and time -lowest-arcs queries. If a set of arcs is given initially, the data structure can be constructed in time.
We have the following lemma for another deletion-only data structure, obtained by following the same algorithmic scheme as [6, Lemma 6] and replacing their shallow cutting algorithm for lines with our shallow cutting algorithm for arcs of in Theorem 8.
Lemma 10.
[6, Lemma 6] For any fixed , there is a data structure of size to maintain a set of arcs to support amortized time deletions and time -lowest-arcs queries. If a set of arcs is given initially, the data structure can be constructed in time.
4.2.2 Fully-dynamic data structure for Lemma 7
With the two deletion-only data structures in Lemmas 9 and 10, we are now in a position to describe our fully dynamic data structure for Lemma 7.
Overview.
To achieve our result in Lemma 7, roughly speaking, we can simply plug our shallow cutting algorithm for in Theorem 8 and Lemma 9 into the algorithmic scheme of [6] or [10]. The algorithms of [6] and [10] are similar. For the method of [10], we can just replace their shallow cutting algorithm for lines [13] with our shallow cutting algorithm for in Theorem 8 and replace their deletion-only data structure [24] with a combination of Lemmas 9 and 10. In addition, a general technique of querying multiple structures simultaneously from [6, Theorem 1] is also needed. For the method of [6], it was described for the plane problem in 3D with a query time . We can follow the same algorithmic scheme but using our shallow cutting algorithm for in Theorem 8 and Lemma 9 in the corresponding places. In addition, since our problem is a 2D problem, the technique of dynamic interval trees in [13] can be used to reduce the query time component from to . In the following, we adapt the method from Chan [10].
The data structure is an adaptation of the one for dynamic 3D convex hulls [9, 11, 23] (the idea was originally given in [9] and subsequent improvements were made in [11, 23]). We first give the following lemma. The lemma is similar to [10, Theorem 3.1], which is based on the result in [9], but Lemma 11 provides slightly better complexities than [10, Theorem 3.1] by using the recently improved result of [11] (see the full paper for more details).
Lemma 11 ([9, 10, 11, 23]).
Let be a set of arcs, which initially is and undergoes updates (insertions and deletions). For any , we can maintain a collection of shallow cuttings in the bottom-open pseudo-trapezoid form, , , in amortized time per update such that the following properties hold.
-
1.
Each cutting is of size and never changes until it is replaced by a new one created from scratch. The total size of all cuttings created over time is .
-
2.
Each cell is associated with a list of arcs of . Each list undergoes deletions only after its creation. The total size of all such lists created over time is .
-
3.
For any , let for a sufficiently large constant . For any vertical line , if an arc is among the lowest arcs at , then there exists some such that is in the list of the cell intersecting .
-
4.
At any moment, for each , the number of cells of the current cuttings for all is . This implies that the total size of the lists of all cells of all current cuttings at any moment is .
With Lemma 11, we can answer a -lowest-arcs query as follows. Consider a query vertical line . By Lemma 11(3), for each , we compute the cell of intersecting , which takes time by binary search as the -projections of partition the -axis into intervals. Then, we use “brute-force” to find the lowest arcs among all arcs in in time as . Finally, among all arcs found above, we return the lowest arcs, which takes time. As such, the total query time is .
An improved query algorithm.
We now improve the query time. We store each list by a deletion-only data structure that supports -lowest-arcs queries. Suppose that such a deletion-only data structure is of space , supports each -lowest-arcs query in time and deletion time, and can be built in time. Then, by Lemma 11(2), each update causes at most amortized number of deletions to the lists , and thus the amortized update time is
(1) |
Note that the last term is obtained due to the following. After every updates, we reconstruct the entire data structure and thus the reconstruction time is on the order of , which is bounded by since by Lemma 11(2) (assuming that ).
By Lemma 11(4), the total space is
(2) |
For each query, there are two tasks: (1) Compute the cell for every ; (2) find the lowest arcs of all lists for all . In the following, we solve the first task in time and solve the second task in time.
For the first task, following the method in [10], for each , we use a dynamic interval tree [5] to store the intervals of the -projections of the cuttings for all in an interval tree . Using , all intervals intersecting can be computed in time. In our problem, . Insertions and deletions of intervals on can be supported in amortized time. We can thus maintain all interval trees in additional amortized time per update as the total size of all cuttings over time is by Lemma 11(1). This additional update time is subsumed by the first term in (1). In this way, the first task can be solved in time.
For the second task, instead of brute-force, we use the deletion-only data structures for the lists and resort to a technique of querying multiple -lowest-arcs data structures simultaneously in [6, Theorem 1], which is based on an adaption of the heap selection algorithm of Frederickson [22]. Applying [6, Theorem 1], the second task can be accomplished in time, which is since the size of each is .
Combining the complexities of the first and second tasks, the overall query time is
(3) |
Let . Depending on , we use different deletion-only data structures for .
- 1.
-
2.
If , then we use Lemma 10 to handle by setting . This results in , , , . Since , we have . Plugging them into (1) and (3) and setting , we obtain and , which is . For the space, since , if we plug into (2), we only need to consider those ’s such that . There are only such ’s. Therefore, we obtain for all such ’s in this case.
Combining the above two cases leads to , , and . We can actually obtain a better bound for the insertion time. If is the preprocessing time for constructing the data structure for a set of arcs, then the amortized insertion time is bounded by [6, 11]. According to our above discussion and Lemma 11(4), constructing the deletion-only data structures for all lists is . The shallow cuttings in Lemma 11 can be built in following the method in [11] and using our shallow cutting algorithm in Theorem 8. In this way, we can bound the amortized insertion time by , which is with . This proves Lemma 7.
5 Algorithm for shallow cuttings
As in [13], we use parameter instead of . A -shallow -cutting becomes a -shallow -cutting and we use a -shallow cutting to represent it. It has the following properties: (1) for each cell ; (2) the union of all cells covers . Theorem 8 says that a -shallow cutting of size in the bottom-open pseudo-trapezoid form can be computed in time.
Following the analysis of Matoušek [25], we start with the following lemma (see the full paper for the proof), which shows the existence of the shallow cutting in the pseudo-trapezoid form, i.e., each cell is a pseudo-trapezoid but not necessarily bottom-open.
Lemma 12.
For any , there exists a -shallow cutting of size in the pseudo-trapezoid form.
Chan and Tsakalidis [13] introduced a vertex form of the shallow cutting for lines. Here for arcs of , using vertices is not sufficient. We will introduce a vertex-segment form in Section 5.2. The definition requires a concept, which we call line-separated -hulls and is discussed in Section 5.1. In Section 5.3, we present our algorithm to compute shallow cuttings in the vertex-segment form.
5.1 Line-separated -hulls
The line-separated -hull is an extension of the -hull introduced in [21]. In [21], -hull is considered for all values . For our problem, we only consider the value .
Let be a set of points in . We define the line-separated -hull of with respect to the -axis as the complement of the union of all unit disks with centers in that do not contain any point of (so the disk centers and the points of are separated by , which is why we use “line-separated”; see Fig. 1).
Many of the properties of the -hulls [21] can be extended to the line-separated case. We list some of these in the following observation; the proof is a straightforward extension of that in [21] by adding the “line-separated” constraint.
Observation 13.
-
1.
, and for any subset , .
-
2.
A point is a vertex of if and only if there exists a unit disk with center in and its boundary containing such that the interior of the disk does not contain any point of .
-
3.
If there is an -constrained arc connecting two points of such that the interior of the underlying disk of the arc does not contain any point of , then the arc is an edge of .
For any two points that can be covered by a -constrained unit disk, there exists a unique -constrained arc that connects and ; we use to denote that arc.
5.1.1 Algorithm for computing
By slightly modifying the algorithm of [21], can be computed in time, where . The algorithm also suggests that is -monotone. In the following, assuming that the points of are already sorted from left to right as , we give a linear time algorithm to compute , which is similar in spirit to Graham’s scan for computing convex hulls.
Irrelevant points.
Note that if a point whose -coordinate is smaller than or equal to , then must be in because every -constrained disk does not contain in the interior. Hence, in that case is irrelevant for computing and thus can be ignored. If all points of are irrelevant, then is simply the region below the horizontal line whose -coordinate is . In the following, we assume that every point of is relevant.
Wings.
Consider a point . Let be a point on the -axis with such that is on the unit circle centered at . Let be the lowest point of . We define the left wing of to be the concatenation of the following two parts (see Fig. 3): (1) the arc of between and , called the left wing arc, and the horizontal half-line with as the right endpoint, called the left wing half-line. The point is called the left wing vertex of . We define the right wing of and the corresponding concepts symmetrically. The left and right wings together actually form the boundary of the line-separated -hull of . In Fig. 1, the four (red) dotted arcs are wing arcs and the three (blue) dashed segments are on wing half-lines.
Far-away position.
Consider two points such that . We say that are in far-away position if holds, where is the right wing vertex of and is the left wing vertex of (see Fig. 3). In this case, is above the right wing of and there is no -constrained unit disk covering both and . We use to denote the concatenation of the right wing arc of , the segment , and the left wing arc of . In fact, the left wing of , , and the right wing of together form the boundary of the line-separated -hull of . In Fig. 1, and are also in far-away position.
The algorithm.
Define for each . Our algorithm handles the points of incrementally from to . For each , the algorithm computes by updating with . Suppose that are the points of that are the vertices of sorted from left to right. Then, our algorithm maintains the following invariant: the boundary is -monotone and consists of the following parts from left to right: the left wing of , or , for each in order, and the right wing of . is the region below .
Initially, for , we set to the concatenation of the left wing and the right wing of . In general, suppose we already have . We compute as follows. We process the points of in the backward order. For ease of exposition, we assume that ; the special case can be easily handled.
We first process the point . If and are in the far-away position, then we delete the right wing of from and add and the right wing of . This finishes computing . Below, we assume that and are not in the far-away position.
If is below the right wing of , then is inside . In this case, is and we are done. If is above the right wing of , then we further check whether the arc exists (which is true if and only if there exists an -constrained unit disk covering both and ).
-
If does not exist (in this case must be below the left wing of and thus does not contribute to because it is “dominated” by ), then we “prune” from , i.e., delete the right wing of and also delete or whichever exists in . Next, we process following the same algorithm.
-
If exists, then we further check whether contains , where is the underlying disk of . If , then must be in and thus does not contribute to . In this case, we prune as above and continue processing . If , we delete the right wing of from and add the arc and the right wing of ; this finishes computing .
Clearly, the runtime for computing is , where is the number of points of pruned from . The overall algorithm for computing takes time since once a point is pruned it will never appear on the hull again, which resembles Graham’s scan for computing convex hulls.
5.1.2 Vertical decompositions
According to the above discussion, has at most vertices with , including all wing vertices. The vertical downward rays from all vertices partition into at most bottom-open pseudo-trapezoids and rectangles. We call this partition the vertical decomposition of , denoted by .
In our later discussion, we need to combine with a set of pairwise disjoint segments on whose endpoints are all in . For each segment , we draw a vertical downward ray from each endpoint of ; let denote the bottom-open rectangular region bounded by the two rays and . The regions for all segments form the vertical decomposition of , denoted by .
We combine and to form a vertical decomposition of , denoted by as follows. Let be the upper envelope of and . We draw a vertical downward ray from each vertex of of . These rays divide the region below into cells, each of which is bounded by two vertical rays from left and right, and bounded from above by a line segment or an -constrained arc. These cells together form the decomposition . In the following, depending on the context, may refer to the region covered by all cells of it; the same applies to and . As such, we have . Note that since the endpoints of all segments of are in and on , the boundary is -monotone.
5.2 Shallow cuttings in the vertex-segment form
We introduce a vertex-segment form of the shallow cutting. Given parameters with , a -shallow cutting for the arcs of in the vertex-segment form is a set of points in along with a set of interior pairwise-disjoint segments on such that the following conditions hold:
-
1.
The endpoints of all segments of are in .
-
2.
Every point of has level at most in .
-
3.
Every segment of intersects at most arcs of .
-
4.
covers .
The conflict list of a point , denoted by , is the set of arcs of below . Note that as the level of is at most . The conflict list of a segment , denoted by , is the set of arcs intersecting . The conflict lists of refer to the conflict lists of all points of and all segments of . The size of the cutting is defined to be . Observe that since the endpoints of all segments of are in and the segments of are interior pairwise-disjoint, we have . Therefore, has cells, and more specifically, at most cells. Further, we have following observation.
Observation 14.
Suppose that is a -shallow cutting for in the vertex-segment form. Then every cell of intersects at most arcs of .
Proof.
Consider a cell of . Let be the top edge of . By the definition of , is one of the following: a segment of , an arc for two points , a wing arc of a point , and a segment of a wing half-line of a point . Below, we argue for each of these cases, where is the set of arcs of intersecting .
-
1.
If a segment of , then recall that . Also, the size of the conflict list of each endpoint of is at most . For any arc intersecting , since the center of is in , must either intersect or in the conflict list of at least one endpoint of . Therefore, holds.
-
2.
If is an arc for two points , then any arc intersecting must be in the conflict list of one of and . Hence, we have .
-
3.
If is a wing arc of a point , then is an endpoint of . Let be the other endpoint of . By definition, the -coordinate of is . Thus, no arc of is below . By definition, the radius of is and the center of is on . Hence, any arc of intersecting must be in the conflict list of and thus .
-
4.
If is a segment of a wing half-line of a point , then by definition is horizontal and has -coordinate equal to . As centers of all arcs of are in , no arc of can intersect . Hence, .
Combining all the above cases leads to .
In the next two lemmas, we show that shallow cuttings in the vertex-segment form and in the pseudo-trapezoid form can be transformed to each other.
Lemma 15.
A -shallow cutting of size in the pseudo-trapezoid form can be transformed into a -shallow cutting in the vertex-segment form of size .
Proof.
Let be a -shallow cutting of size in the pseudo-trapezoid form. Without loss of generality, we assume that all cells of intersect . Define to be the set of vertices of all cells of . Define to be the top edges of all cells of that are segments of . Since the interiors of cells of are pairwise disjoint, the segments of are also interior pairwise-disjoint. As has cells, we have . In the following, we argue that is a -shallow cutting in the vertex-segment form.
First of all, by definition, endpoints of all segments of are in . Consider a point , which is a vertex of a cell . As intersects and , there are at most arcs of below . Hence, has level at most in . For each segment , since it is a top edge of a cell and , we obtain .
It remains to argue that covers . By definition, the union of all cells of covers . Consider a cell , which is a pseudo-trapezoid. We show that , which will prove that covers .
Let be the top edge of . As is a pseudo-trapezoid, is either a segment on or an -constrained arc. If is a segment of , then and thus is a cell of . Hence, . If is an -constrained arc, then let and be its two endpoints; thus is the arc . Since is a pseudo-trapezoid with as the top edge, must be contained in the line-separated -hull , which is a subset of by Observation 13(1) as . Recall that is the vertical decomposition of . Hence, we have .
This proves and therefore covers .
Lemma 16.
A -shallow cutting of size in the vertex-segment form can be transformed into a -shallow cutting of size in the bottom-open pseudo-trapezoid form.
Proof.
Let be a -shallow cutting of size in the vertex-segment form. We intend to take the vertical decomposition as the -shallow cutting of size in the bottom-open pseudo-trapezoid form. However, a subtle issue is that some cells of might not be pseudo-trapezoids. More specifically, consider a cell . Let be the top edge of . According to the definition of , belongs to one of the three cases: (1) is an -constrained arc; (2) is a segment of ; (3) is a segment of a wing half-line of a point of . In the first two cases, is a bottom-open pseudo-trapezoid and we include in . In the third case, is not a pseudo-trapezoid by our definition since is a line segment but not on . In this case, we extend by moving upwards until to obtain an extended cell , which is a bottom-open pseudo-trapezoid; we add to . We call a special cell of .
We claim that , i.e., does not intersect any arcs of . Indeed, let be the top edge of . Let be the rectangular region of between and (see Fig. 4). Then, . Consider any point . We argue that no arc of is below , which will prove the claim. Assume to the contradiction that there is an arc below . Without loss of generality, we assume that is the lowest arc of intersecting the vertical downward ray . Let be the intersection of and . By definition, . Since is a -shallow cutting, covers and thus covers as . Therefore, covers . On the other hand, since is on a wing half-line of a point of , the -coordinate of is and thus no arcs of intersect . Hence, must be above . But since is the top edge of the cell , cannot be covered by , a contradiction. This proves that .
Since , has cells. By definition, the size of is . We next show that is a -shallow cutting in the bottom-open pseudo-trapezoid form. First of all, by definition, each cell of is a bottom-open pseudo-trapezoid. Also, since covers and each cell of is either in or contained in a cell of , is a subset of . Therefore, covers . For each of , if it is a special cell, then as proved above; otherwise is also a cell in and we have by Observation 14. Therefore, is a -shallow cutting in the bottom-open pseudo-trapezoid form.
Corollary 17.
Given , there exists a -shallow cutting of size in the vertex-segment form.
5.3 Computing shallow cuttings in the vertex-segment form
In what follows, by extending the algorithm of [13], we present an algorithm to compute shallow cuttings for in the vertex-segment form.
We say that a (standard) cutting is in the pseudo-trapezoid form if every cell of the cutting is a pseudo-trapezoid. The following result was known previously [15, 28].
Lemma 18 ([15, 28]).
Given any constant , an -cutting for in the pseudo-trapezoid form of size covering the plane, along with its conflict lists, can be computed in time.
We say that a shallow cutting in the vertex-segment form is sorted if points of are sorted by their -coordinates. The following is the main theorem about our algorithm.
Theorem 19.
There exist constants , such that for any parameter , given a -shallow cutting in the sorted vertex-segment form for of size at most along with its conflict lists, we can compute a -shallow cutting in the sorted vertex-segment form for of size at most along with its conflict lists in time.
Proof.
Let be a constant to be set later. We begin by computing the decomposition . Since is sorted, can be computed in time using the algorithm from Section 5.1. As the endpoints of all segments of are in and segments of are interior pairwise-disjoint on , the segments of can also be sorted from left to right in time. As such, computing can be done in time, which is as .
Next, for each cell , we perform the following two steps.
-
1.
Compute an -cutting of size for . We clip the cells of to lie within (and redecompose each new cell into pseudo-trapezoids if needed). Let denote the set of vertices of all cells of and the set of top edges of the cells of that are segments of .
Since , has cells and computing takes time by Lemma 18. Hence, both and are . As , the total time of this step for all cells is .
-
2.
Compute by brute force a smallest subset , along with a subset , such that the following conditions are satisfied.
-
(a)
The endpoints of all segments of are in .
-
(b)
Every vertex in has level in at most .
-
(c)
Every segment in intersects at most arcs of .
-
(d)
For each cell whose vertices are all in , is covered by .
As both and are , there are different pairs of and . For each such pair , we can check whether the four conditions are satisfied in time, because , , and the size of are all . Hence, finding a smallest subset with takes time. After that, for each point , its conflict list in , which is also its conflict list in , can be found in time. Similarly, for each segment of , its conflict list can be found in time. As both and are , finding the conflict lists of takes time. Since , the runtime of this step for all is .
-
(a)
We define and . We can sort the points of in time as follows. For each , we sort the points of , which takes time as . Then, for all cells in order from left to right, we concatenate the sorted lists of , and the resulting list is a sorted list of . This takes time in total as has cells.
The total runtime of the above algorithm is .
Correctness.
In the following, we argue the correctness, i.e., prove that is a -shallow cutting for of size at most . We first show that is a -shallow cutting and then bound its size.
Consider a cell . For each point , according to our algorithm, has level in at most . In light of the definition of , is a bottom-open cell bounded by two vertical rays. Hence, the level of in is also its level in . Therefore, has level in at most .
For each segment , by definition, is a top edge of a cell . According to our algorithm, intersects at most arcs of . Since , any arc of intersecting must intersect and thus is in . Therefore, intersects at most arcs of . In addition, according to our algorithm, the endpoints of are in .
To show that is a -shallow cutting, it remains to prove that covers . Consider a point . By definition, covers . By setting , covers and thus must be in a cell of . In the following, we argue that is covered by , which will prove that covers .
Let be the cell of the cutting that contains . Since has level in at most and the number of arcs of intersecting is at most , every vertex of has level at most . Because the size of the conflict list of each point of is at most , by Observation 14. Therefore, by setting the constant . Hence, all vertices of are in and thus is covered by according to our algorithm. As , we obtain that is covered by .
Bounding the size of , i.e., .
We now prove . To this end, we compare it against a -shallow cutting of size at most for some constant , whose existence is guaranteed by Corollary 17. The details can be found in the full paper. This proves the theorem.
Corollary 20.
There exist constants , , and , such that for any parameter , we can compute a -shallow cutting in the sorted vertex-segment form of size at most , along with its conflict lists, for all in total time. In particular, we can compute a -shallow cutting of size in the sorted vertex-segment form, along with its conflict lists, in time.
Proof.
By Theorem 19, the runtime satisfies the recurrence with the trivial base case . The recurrence solves to .
Proving Theorem 8.
6 Dynamic unit-disk range emptiness queries
Our techniques may be extended to solve other related problems about unit disks. In the following, we demonstrate one exemplary problem: the dynamic unit-disk range emptiness queries (see the full paper for a simple solution to the static problem using our techniques).
For a set of points in the plane, we wish to maintain in a dynamic data structure for points insertions and deletions to answer unit-disk range emptiness queries: Given a unit disk , determine whether contains a point of , and if so, return such a point. One can solve the problem by using a dynamic nearest neighbor search data structure (i.e., given a query disk , using a nearest neighbor query we find a point nearest to the center of ; contains a point of if and only if ). The current best dynamic nearest neighbor search data structure is given by Chan [11]; with that, we can obtain a data structure of space in time that supports amortized insertion time, amortized deletion time, and time for unit-disk range emptiness queries. In the following, using our techniques, we propose a better result.
As in Section 3 for the dynamic reporting problem, we can use Lemma 3 to reduce the problem to the following line-separated problem.
Problem 2 (Dynamic line-separable unit-disk range emptiness queries).
Given a set of points above a horizontal line , build a data structure to maintain to support the following operations. (1) Insertion: insert a point to ; (2) deletion: delete a point from ; (3) unit-disk range emptiness query: given a unit disk whose center is below , determine whether contains a point of Q, and if so, return such a point.
To solve the line-separable problem, we define the set of arcs using in the same way as before. Let be a unit disk with center below . Note that if and only if is above the lower envelope of . Further, is above the lower envelope of if and only if the lowest arc of intersecting is below , where is the vertical line through . Therefore, our problem reduces to the following vertical line queries subject to arcs insertions and deletions for : Given a vertical line , find the lowest arc of that intersects .
To solve the dynamic vertical line query problem among arcs of , we apply Chan’s framework [8] for the dynamic vertical line query problem among lines (in the dual plane, a vertical line query is dual to: Finding an extreme point on the convex hull of all dual points along a query direction). To this end, we need the following two components: (1) a dynamic data structure of space with query time and update time; (2) a deletion-only data structure of space that can be built in time, supporting query time and amortized deletion time. For (1), we can use our static data structure as discussed above, i.e., whenever there is an update, we simply rebuild the data structure. For (2), Wang and Zhao [30] already provided such a data structure. Using these two components, we can apply exactly the same framework of Chan [8]. Indeed, the framework still works for the arcs of because every arc is -monotone. With the framework and the above two components, we can obtain a data structure of space that allows insertions and deletions of arcs of in amortized update time and answers a vertical line query in time, where is the size of the current set . Consequently, we can solve Problem 2 with the same time complexities. Finally, with Lemma 3 and our problem reduction, we can have a data structure of space that allows insertions and deletions of points of in amortized time and answers a unit-disk range emptiness query in time, where is the size of the current set .
References
- [1] Peyman Afshani and Timothy M. Chan. Optimal halfspace range reporting in three dimensions. In Proceedings of the 20th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 180–186, 2009. doi:10.1137/1.9781611973068.21.
- [2] Pankaj K. Agarwal. Range searching, in Handbook of Discrete and Computational Geometry, C.D. Tóth, J. O’Rourke, and J.E. Goodman (eds.), pages 1057–1092. CRC Press, 3rd edition, 2017.
- [3] Pankaj K. Agarwal. Simplex range searching and its variants: a review. In A Journey Through Discrete Mathematics, pages 1–30. Springer, 2017. doi:10.1007/978-3-319-44479-6_1.
- [4] Jon L. Bentley and Hermann A. Maurer. A note on Euclidean near neighbor searching in the plane. Information Processing Letters, 8:133–136, 1979.
- [5] Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry — Algorithms and Applications. Springer-Verlag, Berlin, 3rd edition, 2008.
- [6] Sarita de Berg and Frank Staals. Dynamic data structures for k-nearest neighbor queries. Computational Geometry: Theory and Applications, 111(101976), 2023. doi:10.1016/j.comgeo.2022.101976.
- [7] Timothy M. Chan. Random sampling, halfspace range reporting, and construction of -levels in three dimensions. SIAM Journal on Computing, 20:561–575, 2000. doi:10.1137/S0097539798349188.
- [8] Timothy M. Chan. Dynamic planar convex hull operations in near-logarithmaic amortized time. Journal of the ACM, 48:1–12, 2001. doi:10.1145/363647.363652.
- [9] Timothy 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.
- [10] Timothy M. Chan. Three problems about dynamic convex hulls. International Journal of Computational Geometry and Applications, 22:341–364, 2012. doi:10.1142/S0218195912600096.
- [11] Timothy M. Chan. Dynamic geometric data structures via shallow cuttings. Discrete and Computational Geometry, 64:1235–1252, 2020. doi:10.1007/s00454-020-00229-5.
- [12] Timothy M. Chan and Dimitrios Skrepetos. All-pairs shortest paths in unit-disk graphs in slightly subquadratic time. In Proceedings of the 27th International Symposium on Algorithms and Computation (ISAAC), pages 24:1–24:13, 2016. doi:10.4230/LIPIcs.ISAAC.2016.24.
- [13] Timothy M. Chan and Konstantinos Tsakalidis. Optimal deterministic algorithms for 2-d and 3-d shallow cuttings. Discrete and Computational Geometry, 56:866–881, 2016. doi:10.1007/s00454-016-9784-4.
- [14] Bernard Chazelle. An improved algorithm for the fixed-radius neighbor problem. Information Processing Letters, 16:193–198, 1983. doi:10.1016/0020-0190(83)90123-0.
- [15] Bernard Chazelle. Cutting hyperplanes for divide-and-conquer. Discrete and Computational Geometry, 9(2):145–158, 1993. doi:10.1007/BF02189314.
- [16] Bernard Chazelle, Richard Cole, Franco P. Preparata, and Chee-Keng Yap. New upper bounds for neighbor searching. Information and Control, 68:105–124, 1986. doi:10.1016/S0019-9958(86)80030-4.
- [17] Bernard Chazelle and Herbert Edelsbrunner. Optimal solutions for a class of point retrieval problems. Journal of Symbolic Computation, 1:47–56, 1985. doi:10.1016/S0747-7171(85)80028-6.
- [18] Bernard Chazelle and Leonidas J. Guibas. Fractional cascading: I. A data structuring technique. Algorithmica, 1:133–162, 1986. doi:10.1007/BF01840440.
- [19] Bernard Chazelle and Leonidas J. Guibas. Fractional cascading: II. Applications. Algorithmica, 1:163–191, 1986. doi:10.1007/BF01840441.
- [20] Bernard Chazelle, Leonidas J. Guibas, and D.T. Lee. The power of geometric duality. BIT, 25:76–90, 1985. doi:10.1007/BF01934990.
- [21] Herbert Edelsbrunner, David G. Kirkpatrick, and Raimund Seidel. On the shape of a set of points in the plane. IEEE Transactions on Information Theory, 29:551–559, 1983. doi:10.1109/TIT.1983.1056714.
- [22] G.N. Frederickson. An optimal algorithm for selection in a min-heap. Information and Computation, 104:197–214, 1993. doi:10.1006/inco.1993.1030.
- [23] Haim Kaplan, Wolfgang Mulzer, Liam Roditty, Paul Seiferth, and Micha Sharir. Dynamic planar Voronoi diagrams for general distance functions and their algorithmic applications. Discrete and Computational Geometry, 64:838–904, 2020. doi:10.1007/s00454-020-00243-7.
- [24] Jir̆í Matoušek. Efficient partition trees. Discrete and Computational Geometry, 8(3):315–334, 1992. doi:10.1007/BF02293051.
- [25] Jiří Matoušek. Reporting points in halfspaces. Computational Geometry: Theory and Applications, 2:169–186, 1992. doi:10.1016/0925-7721(92)90006-E.
- [26] Jiří Matoušek. Geometric range searching. ACM Computing Survey, 26:421–461, 1994. doi:10.1145/197405.197408.
- [27] Edgar A. Ramos. On range reporting, ray shooting and -level construction. In Proceedings of the 15th Annual Symposium on Computational Geometry (SoCG), pages 390–399, 1999. doi:10.1145/304893.304993.
- [28] Haitao Wang. Unit-disk range searching and applications. Journal of Computational Geometry, 14:343–394, 2023. doi:10.20382/jocg.v14i1a13.
- [29] Haitao Wang and Jie Xue. Near-optimal algorithms for shortest paths in weighted unit-disk graphs. Discrete and Computational Geometry, 64:1141–1166, 2020. doi:10.1007/s00454-020-00219-7.
- [30] Haitao Wang and Yiming Zhao. Computing the minimum bottleneck moving spanning tree. In Proceedings of the 47th International Symposium on Mathematical Foundations of Computer Science (MFCS), pages 82:1–82:15, 2022. doi:10.4230/LIPIcs.MFCS.2022.82.
- [31] Haitao Wang and Yiming Zhao. An optimal algorithm for shortest paths in unit-disk graphs. Computational Geometry: Theory and Applications, 110:101960: 1–9, 2023. doi:10.1016/j.comgeo.2022.101960.
- [32] Haitao Wang and Yiming Zhao. Reverse shortest path problem for unit-disk graphs. Journal of Computational Geometry, 14:14–47, 2023. doi:10.20382/jocg.v14i1a2.