Searching edges in the overlap of two plane graphs
John Iacono, Elena Khramtcova, Stefan Langerman

TL;DR
This paper introduces an efficient O(n log n) preprocessing technique for pairs of plane graphs with red and blue edges, enabling fast intersection searches and solving several geometric problems with improved algorithms.
Contribution
The paper presents a novel O(n log n)-time preprocessing method for red-blue plane graph pairs, enabling efficient geometric computations and improving existing algorithms.
Findings
Efficient intersection search among red-blue edges in O(n log n) time.
New algorithms for maximum vertical distance between 3D terrains and Hausdorff Voronoi diagrams.
Improved solutions for the farthest-color Voronoi diagram and stabbing circle problems.
Abstract
Consider a pair of plane straight-line graphs, whose edges are colored red and blue, respectively, and let n be the total complexity of both graphs. We present a O(n log n)-time O(n)-space technique to preprocess such pair of graphs, that enables efficient searches among the red-blue intersections along edges of one of the graphs. Our technique has a number of applications to geometric problems. This includes: (1) a solution to the batched red-blue search problem [Dehne et al. 2006] in O(n log n) queries to the oracle; (2) an algorithm to compute the maximum vertical distance between a pair of 3D polyhedral terrains one of which is convex in O(n log n) time, where n is the total complexity of both terrains; (3) an algorithm to construct the Hausdorff Voronoi diagram of a family of point clusters in the plane in O((n+m) log^3 n) time and O(n+m) space, where n is the total number of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Geometry and Mesh Generation · Remote Sensing and LiDAR Applications · Data Management and Algorithms
11institutetext: Department of Computer Science and Engineering, New York University
New York, USA, 11email: [email protected] 22institutetext: Computer Science Department, Université libre de Bruxelles (ULB)
Brussels, Belgium, 22email: {elena.khramtcova,stefan.langerman}@ulb.ac.be
Searching edges in the overlap of two plane graphs††thanks:
Research partially completed while J. I. was on sabbatical at the Algorithms Research Group of the Département d’Informatique at ULB with support from a Fulbright Research Fellowship, F.R.S.-FNRS, and NSF grants CNS-1229185, CCF-1319648, and CCF-1533564. E. K. was supported in part by F.R.S.-FNRS, and by SNF project P2TIP2-168563 under SNF Early PostDoc Mobility program; S. L. is directeur de recherches du F.R.S.-FNRS.
John Iacono 11
Elena Khramtcova 22
Stefan Langerman 22
Abstract
Consider a pair of plane straight-line graphs whose edges are colored red and blue, respectively, and let be the total complexity of both graphs. We present a -time -space technique to preprocess such a pair of graphs, that enables efficient searches among the red-blue intersections along edges of one of the graphs. Our technique has a number of applications to geometric problems. This includes: (1) a solution to the batched red-blue search problem [Dehne et al. 2006] in queries to the oracle; (2) an algorithm to compute the maximum vertical distance between a pair of 3D polyhedral terrains, one of which is convex, in time, where is the total complexity of both terrains; (3) an algorithm to construct the Hausdorff Voronoi diagram of a family of point clusters in the plane in time and space, where is the total number of points in all clusters and is the number of crossings between all clusters; (4) an algorithm to construct the farthest-color Voronoi diagram of the corners of disjoint axis-aligned rectangles in time; (5) an algorithm to solve the stabbing circle problem for parallel line segments in the plane in optimal time. All these results are new or improve on the best known algorithms.
1 Introduction
Many geometric algorithms have subroutines that involve investigating intersections between two plane graphs, often assumed being colored red and blue respectively. Such subroutines differ in the questions that are asked about the red-blue intersections. The most well-studied questions are to report all red-blue intersections or to count them. It is shown how to report all the intersections in optimal time and space [3, 4, 15, 16, 19], where is the total complexity of both graphs, and is the size of the output. Note that may be . Counting the red-blue intersections can be carried out in time and space [4, 16].
In this paper, we consider the situation where one wants to search the red-blue intersections, though avoiding to compute all of them. Problems of this type appear as building blocks in diverse geometric algorithms. The latter include: distance measurement between polyhedral terrains [4], motion planning [12], construction of various generalized Voronoi diagrams (divide-and-conquer [9, 6] or randomized incremental [5] construction). Therefore solving such problems efficiently is of high importance.
Often it is guaranteed that each red edge contains at most one sought red-blue intersection, and an oracle is provided, that, given a red-blue intersection, is able to quickly determine to which side of that intersection the sought intersection lies along the same red edge (see Section 3.1 for more details on this setting). A particular case, when the red graph consists of a unique edge, appeared under the name of segment query in the randomized incremental construction algorithm for the Hausdorff Voronoi diagram [5], and under the name of find-change query in an algorithm to solve the stabbing circle problem for a set of line segments [8]. If the blue graph is a tree, it can be preprocessed in time using the centroid decomposition [2, 5]. Centroid decomposition supports segment (or find-change) queries for arbitrary line segments, requiring only queries to the oracle [5, 7]. If the blue graph is not a tree, then in time it can be preprocessed for point location, and a nested point location along the red edge is performed, which requires queries to the oracle [6, 8]. For two general plane straight-line graphs (where the red graph is not necessarily one edge) the problem is called batched red-blue intersection problem (see Problem 2). It was formulated in Dehne et al. [9], and solved in time and space [9] using hereditary segment trees [4]. However, this is optimal in neither time nor space.
We present a data structure that provides a clear interface for efficient searches for red-blue intersections along a red edge. Our data structure can be used to improve the above result [9] (see Section 3.1), which includes an improvement on segment (or find-change) queries in plane straight-line graphs. Our data structure can also handle more general search problems, e.g., a setting when a red edge may have more than one sought red-blue intersection on it. Below we state our result and its applications.
1.1 Our result
Let , be a pair of plane straight-line111Our technique can be trivially generalized to apply to -monotone pseudoline arcs in place of straight-line edges of the graphs. graphs. We address the following problem.
Problem 1 (RB-Preprocessing problem)
Given graphs , construct a data structure that for each edge of stores implicitly the intersections between and the edges of sorted according to the order, in which these intersections appear along . Let be a perfectly balanced binary search tree built on the sorted sequence of intersections along . The data structure should answer efficiently the following navigation queries in :
- •
Return the root of ;
- •
Given a non-root node of , return the parent of this node;
- •
Given a non-leaf node of , return the left (or the right) child of this node.
We provide a solution to the RB-Preprocessing problem, where each of the navigation queries can be answered in time, and constructing the data structure requires time and space, where is the total number of vertices and edges in both and (see Section 2).
The resulting data structure allows for fast searches for interesting intersections between edges of and the ones of . We note that the notion of interesting is external to the data structure: It is not known at the time of preprocessing, but rather guides the searches on the data structure after it is built. In particular, for the input graphs and , the data structure is always the same, while interesting intersections can be defined in several ways, which of course implies that the searches may have different outputs.
Our preprocessing technique can be applied to a number of geometric problems. We provide a list of applications, which is not exhaustive. For each application, we show how to reduce the initial problem to searching for interesting red-blue intersections, and how to navigate the searches, that is, how to decide, which subtree(s) of the current node of the (implicit) tree to search. Using our technique we are able to make the contributions listed below, and we expect it to be applicable to many more problems.
The batched red-blue search problem [9] for a pair of segment sets can be solved in space and queries to the oracle, where is the total number of segments in both sets (see Section 3.1). The problem is as follows. Given are: (1) two sets of line segments in the plane (colored red and blue, respectively), where no two segments in the same set intersect; and (2) an oracle that, given a point of intersection between a red segment and a blue segment , determines to which side of segment with respect to point the interesting red-blue intersection lies. It is assumed that each segment contains at most one interesting intersection. The batched red-blue search problem is to find all interesting red-blue intersections. Our solution is an improvement on the one of Dehne et al. [9] which requires space and queries to the oracle. 2. 2.
The maximum vertical distance between a pair of polyhedral terrains, one of which is convex, can be computed in time and space (see Section 3.2). Previously, a related notion of the minimum vertical distance between a pair of non-intersecting polyhedral terrains was considered, and it was shown how to find it in time and space for a pair of general polyhedral terrains [4], in time for one convex and one general terrain [24], and in time for two convex terrains [24]. Our technique yields an alternative solution for the second case within the same time bound as in [24]. The maximum distance for non-intersecting polyhedra can be found by the above methods [4, 24], however it is different from the minimum distance for intersecting polyhedra: asking about the former is still interesting, while the latter is trivially zero. 3. 3.
The Hausdorff Voronoi diagram of a family of point clusters in the plane can be constructed in time, where is the total number of pairwise crossings of the clusters (see Sections 3.3 and 4). Parameter can be , but is small in practice [21, 20]. There is a deterministic algorithm to compute the diagram in time [11]. All other known deterministic algorithms [20, 21] have a running time that depends on parameters of the input, that cannot be bounded by a function of .222 The algorithms have time complexity respectively and , where parameters reflect the number of pairs of clusters such that one is enclosed in a certain type of enclosing circle of the other. Each of them may take time even if . There is a recent randomized algorithm with expected time complexity [14]. For a simpler case of non-crossing clusters (), the diagram can be computed in deterministic time333The time complexity claimed in [9] is . See the discussion in Section 3.3. [9], or in expected time [5, 14]. Thus our algorithm is the best deterministic algorithm for the case of small number of crossings. The time complexity of our algorithm is subquadratic in and and depends only on them, unlike any previous deterministic algorithm. 4. 4.
The farthest-color Voronoi diagram for a family of point clusters, where each cluster is all the corners of an axis-aligned rectangle,444A cluster is either the four corners of a non-degenerate axis-aligned rectangle, or the two endpoints of a horizontal/vertical segment, or a single point. and these rectangles are pairwise disjoint, can be computed in time and space (see Section 3.4). Previous results on the topic are as follows. For arbitrary point clusters, the diagram may have complexity and can be computed in time and space [1, 11], where is the total number of points in all clusters. When clusters are pairs of endpoints of parallel line segments, the diagram has complexity and can be constructed in time and space [8]. In this paper, we broaden the class of inputs, for which the diagram can be constructed in subquadratic time. We also show that the complexity of the diagram for such inputs is . 5. 5.
The stabbing circle problem for line segments in the plane can be solved in time , where and denote respectively the complexity of the Hausdorff and the farthest-color Voronoi diagram of the pairs of endpoints of segments in , and denote the time to compute these diagrams, and is a parameter reflecting the number of “bad” pairs of segments in 555See Section 3.5 for the definition of . (See Section 3.5). If all segments in are parallel to each other, the stabbing circle problem can be solved in optimal time and space. This is an improvement over the recent time technique for general segments, which yielded an time algorithm for parallel segments [8].
2 The technique to preprocess a pair of graphs
Suppose we are given two plane straight-line graphs and , and let be the total number of vertices and edges in both . We assume that no two vertices of the graphs have the same coordinate. In this section, it is more convenient to treat and as two sets of line segments in the plane, where the segments in are colored red, and the ones in are colored blue. No two segments of the same color intersect, although they may share an endpoint.
Our preprocessing technique consists of three phases. In the first phase, we invoke an algorithm that finds the intersections between the edges of the two graphs (see Section 2.1). After that, in the second phase, we build a linearized life table for the red segments (see Section 2.2). Finally we sweep the life table with a line, which provides us the resulting data structure (see Section 2.3).
2.1 Finding red-blue intersections
For the sets (red) and (blue), we need to find all the intersections between segments of different color, i.e., all the red-blue intersections.
It is known how to count the red-blue intersections in optimal time [4, 16, 19], or report them in optimal time [3, 4, 15, 16, 19], where is the total number of the intersections. The space requirement of each of these algorithms is . The algorithm by Mantler and Snoeyink [16] processes the red-blue intersections in batches (called bundle-bundle intersections). In time and space it can implicitly discover all the red-blue intersections, without reporting every one of them individually. The latter feature is useful for our technique, therefore we invoke the Mantler-Snoeyink algorithm in its first phase. We summarize the algorithm below.
To describe the algorithm, we need to define the following key notions: the witness of a (bichromatic) segment intersection, a pseudoline at time , and a (monochromatic) bundle of segments at time .
Given a red segment that intersects a blue segment , the witness of their intersection is the leftmost of the endpoints of segments in that are contained in the closed right wedge formed by and . The closed right wedge formed by and is the intersection of two closed right halfplanes: the one bounded by the line through , and the one bounded by the line through , see the shaded area in Figure 1. Note that the witness always exists: it may be an endpoint of a segment different from or (as in Figure 1), or it may be an endpoint of either or .
Let be the total number of distinct endpoints of the segments in and . Let denote the sequence of these endpoints in the order of increasing coordinate. The basis of the Mantler-Snoeyink algorithm can be formulated as follows.
Lemma 1
For each there is a -monotone curve that passes through point , and subdivides the plane into two open regions (the left and the right one), such that all the points , and all the red-blue intersections witnessed by the points are contained in the left region, and all the points together with the intersections witnessed by them are contained in the right region, and intersects each segment in or in at most once.
We call such curve a pseudoline at time . Figure 2 shows a pseudoline at time 7, i.e., , in dashed black lines. Note that cannot be replaced by a vertical straight line, because it must pass through the point 7, and to the left of the intersection point between the segments and , and the latter point lies to the left of the former one.
A blue bundle at time is a maximal contiguous sequence of blue segments that intersect the pseudoline .666This definition can be seen as a generalization of the one of single-edge bundles in Mount [18]. See Figure 2, right. A red bundle is defined analogously.
The algorithm can be seen as a topological sweep with a pseudoline, where the only events are the endpoints of the segments in and . The sweepline at each moment is a pseudoline such as defined in Lemma 1. The sweepline status structure maintains all the red and blue bundles that intersect the current sweepline. The sweepline status consists of (1) a balanced binary tree for each bundle, supporting insertion, deletion of segments, and a query for the topmost and the bottommost segment in the bundle, (2) a doubly-linked list for all the bundles intersecting the sweepline (bundles alternate colors), supporting insertion, deletion of the bundles, and sequential search, and (3) two balanced binary trees (one per color) storing all the red and blue bundles in order, and supporting splitting and merging of bundles.
At the event point the algorithm processes the intersections witnessed by , updates the sweepline from to , and makes the necessary changes to bundles (i.e., splits or merges them). By proceeding this way, the algorithm maintains the invariant that all the red-blue intersections whose witness is to the left of the current event point are already encountered. We summarize the result in the following.
Theorem 2.1 ([16])
The Mantler-Snoeyink algorithm runs in time, requires space, and encounters bundle-bundle intersections in total.
2.2 Building the life table
In this section we describe our algorithm to build the life table for the sets and . Figure 2 illustrates the execution of the algorithm for a simple example.
Before we start our description, recall [10] that every pointer-based data structure with constant in-degree can be transformed into a partially persistent one. Such a persistent data structure allows accessing in constant time the data structure at any moment in the past, and performing pointer operations on it (but not modifying it); the total time and space required to make a data structure partially persistent is linear in the number of structural changes it underwent.
To build the life table for and , we first perform the Mantler-Snoeyink plane sweep algorithm (see Section 2.1), making the sweepline status structure partially persistent. This ensures that each blue bundle that has appeared during the algorithm, can afterwards be retrieved from the version of the sweepline status at the corresponding moment in the past. In particular, we are interested in the blue bundles that intersect red bundles. We assign each such blue bundle a timestamp reflecting the moment when the first bundle-bundle intersection involving was witnessed. In order to distinguish between two different bundle-bundle intersections discovered at the same moment (i.e., witnessed by the same point), we assign the moment to the intersection that has smaller coordinate. Figure 2, right, lists all such blue bundles for the given example.
Observe that the plane sweep algorithm induces a partial order among the red segments: At any moment, the red segments crossed by the sweepline can be ordered from bottom to top. Since the red segments are pairwise non-intersecting, no two segments may swap their relative position. Let be a total order consistent with the partial order along the sweepline at each moment. In Figure 2, the red segments are named according to such an order.
We now build the life table of red segments and blue bundles, see Figure 2, bottom. The life table is a graph defined as follows. On its axis it has integers from [math] to , where is the number of red segments; the axis of the life table coincides with the axis of the original setting, i.e., of the plane . Each red segment is represented by a horizontal line segment whose coordinate equals and whose endpoints’ coordinates coincide with the coordinates of the endpoints of . Each blue bundle , that has participated in at least one bundle-bundle intersection, is retrieved from the version of the sweepline status at the moment when the first such intersection has been witnessed; is the timestamp of . In the table, is represented by a vertical line segment (that could possibly be a point), whose coordinate is . This vertical segment intersects exactly the segments representing all red segments intersected by bundle (i.e., the segments of the red bundle(s) participating in the bundle-bundle intersection(s) with ). In particular, the bottom and the top endpoints of this segment lie respectively on the two red segments that represent the first and the last segment in intersected by bundle , according to the topological ordering of the red segments. If intersects only one red segment, then in the life table is represented by a point. In Figure 2 all the blue bundles except are represented by a point, but in a more complicated example many bundles might be represented by line segments. Note that instead of storing the segment list of each blue bundle explicitly, we just maintain a pointer to that bundle as it appears in (the corresponding version of) the sweepline status structure.
2.3 The resulting data structure
After the life table is built, we sweep it with a horizontal straight line from bottom to top, again making the sweepline status partially persistent. The events now correspond to red segments, and the version of the sweepline status at a time moment contains all blue bundles crossing the horizontal line , sorted by coordinate and stored in a balanced binary tree.
Our ultimate data structure is the persistent sweepline status of the above (second) plane sweep. We are able, in time, to retrieve the version of the sweepline status structure at any moment . The sweepline status at the moment is a tree storing the blue bundles whose beginning was witnessed before the moment and whose end was witnessed after that moment (in other words, those blue bundles that intersect the horizontal line in the life table). See Figure 2. Since each single bundle is stored in a balanced binary tree, the tree of bundles is also a balanced binary tree. Therefore it has height . Moreover, it can be accessed in the same way as a standard binary tree: any navigation query in it (see Problem 1) can be performed in time.
Now suppose we wish to perform a search on (a portion of) a red segment among the blue segments that cross it. We are required to be able to quickly determine where the interesting intersection(s) lie with respect to , for any point of intersection between and a blue segment. The search in our data structure is then done as follows. We retrieve the version of the sweepline status (of the second plane sweep) at the moment . This sweepline status is an implicit balanced binary tree, as explained above. We locate the endpoints of in that tree. Then we search in the portion of the tree between ’s endpoints. The decisions during the search are made based on our knowledge about the interesting intersections.
We conclude with the following.
Theorem 2.2
Given a pair of plane straight-line graphs with edges and vertices in total in both graphs, the RB-Preprocessing problem for and can be solved in time and space, such that the resulting data structure answers each of the navigation queries in time.
Proof
The first phase of our procedure to build the data structure is an execution of the Mantler-Snoeyink algorithm, with the only difference that the bundle trees from the sweepline status are made partially persistent. The latter can be performed with amortized time and space overhead per update step and a worst-case time cost of per access step [10]. The total number of updates made to the sweepline status during the course of the Mantler-Snoeyink algorithm is [16]. Thus, after the first phase is completed, we have the order of red segments and the persistent sweepline status. With this information, the life table can be built in time and space: we fill the table with the horizontal red segments, and we access sequentially all the versions of the sweepline, retrieving the blue bundles and the information on their intersections with the red bundles, and drawing the vertical segments of the life table. Sweeping the life table with a horizontal line, and making the sweepline status partially persistent again costs time and space.
For an edge of , the version of the sweepline status structure at time provides a balanced binary search tree , required by the RB-Preprocessing problem, such that can be navigated (but not modified) in the same way and with the same time complexity as the standard balanced binary search tree. Hence the navigation queries of the RB-Preprocessing problem can be answered in each.
3 Applications
We proceed with more detail on the applications of our technique, which are listed in Section 1.
3.1 The red-blue batched search problem
Consider two sets, (red) and (blue), of line segments in , such that the segments in each set are pairwise interior-disjoint, and suppose that some of the red-blue intersections are interesting, and there is at most one interesting red-blue intersection per each segment. Let be an oracle that, given an intersection point of a red segment and a blue segment , determines to which side of the interesting intersection on lies.
Problem 2 (Red-blue batched search problem [9])
Given sets and oracle , find all interesting intersections between the segments in and the ones in .
Dehne et al. [9] showed how to solve the red-blue batched search problem by using an augmentation of the hereditary segment tree data structure of Chazelle et al. [4]. Their solution requires space and queries to the oracle.
Our technique presented in Section 2.2 can be directly applied to solve the red-blue batched search problem with better time and space: We preprocess the sets and ; after that for each red segment we perform a binary search in the (implicit) tree storing the red-blue intersections along . The search is guided by the oracle , and thus it requires queries to the oracle. Since the number of red segments is , the total number of queries to the oracle required for searching all red edges is . Theorem 2.2 implies the following.
Theorem 3.1
The red-blue batched search problem for the sets and the oracle can be solved using space and queries to the oracle, where is the total number of segments in and .
3.2 Vertical distance for a pair of 3D polyhedral terrains, one of which is convex
Let and be two polyhedral terrains of complexity and respectively, where terrain is convex (that is, is the upper envelope of a set of planes in ). Let . We wish to determine the maximum vertical distance between and , i.e., the length of the longest vertical line segment connecting a point in and a point in .777It may happen, that the distance keeps increasing as we move along some direction towards infinity. Then we say that the maximum vertical distance between and is . As an illustration, the reader may imagine a (convex) approximate model of a mountain, and a need to compare it with the real mountain (of course, not necessarily convex) in order to estimate the quality of the approximation.
Since both surfaces and are composed of planar patches, the vertical distance between and is the vertical distance between these patches. The maximum vertical distance between and is thus attained either between a vertex of and a facet of (or vice versa), at infinity along an unbounded edge of one of the surfaces, or between an edge of and an edge of . In the second case the distance between and is . Both the first and the second case can be easily processed by point location queries of a (possibly infinite) vertex of one surface into the other one, which requires time in total. To deal with the last case one can preprocess the vertical projections of and following our technique, and perform the binary searches along each edge of for the intersection with an edge of maximizing the vertical distance. Consider the cross-section of by the vertical plane containing . This is a convex monotone polygonal line. The sequence of heights of its breakpoints is unimodal, and since all points of lie on the same line, if we subtract from each member of the height of the point in lying on the same vertical line, the resulting sequence will still have one maximum. It then follows that given a point vertically above/below an edge of , in constant time we can find out in which direction this maximum lies, and this is exactly what the oracle for the binary search along should do. Using Theorem 2.2, we conclude.
Theorem 3.2
Given a pair of polyhedral terrains in 3D, where one of the terrains is convex, the maximum vertical distance between the terrains can be found in time and space, where is the total complexity of both terrains.
Notice that by slightly changing the algorithm, we could be answering the minimum vertical distance, instead of the maximum one. In particular this gives an alternative algorithm to solve the shortest watchtower problem [23, 24].
3.3 Construction of the Hausdorff Voronoi diagram
Given a set of distinct points in the plane, we partition this set, resulting in a family of point clusters, where no two clusters share a point. Let the distance from a point to a cluster , denoted as , be the maximum Euclidean distance from to any point in . The Hausdorff Voronoi diagram of , denoted as , is a subdivision of into maximal regions such that every point within one region has the same nearest cluster according to distance .
The diagram has worst-case combinatorial complexity , and it can be constructed in optimal time [11]. However, these bounds can be refined according to certain parameters of the family . Two clusters are called non-crossing if their convex hulls intersect at most twice (i.e., their convex hulls are pseudocircles), and crossing otherwise. Below we consider separately the (simpler) case of non-crossing clusters, and the one of crossing clusters. The latter case subsumes the former one.
Non-crossing clusters.
If all clusters in are pairwise non-crossing, the complexity of is . In this case the diagram can be constructed in expected time and expected space [5, 14]. The best deterministic algorithm to date requires time and space [9].888The time complexity claimed in Dehne et al. is , however we believe that in reality the described algorithm requires time.
The latter algorithm follows the divide-and-conquer strategy. To merge two recursively computed diagrams, a bottleneck procedure is formulated as a red-blue batched segment search problem (see Section 3.1), where the two segment sets are the sets of edges of the two diagrams. The latter problem is then solved in space and queries to the oracle. The authors define an oracle to perform this search, which they assume can be implemented in time. We were unable to reconstruct the claimed constant-time oracle, however we know how to implement it in time per query. Theorem 3.1 implies an algorithm to construct the Hausdorff Voronoi diagram of a family of non-crossing clusters in time and space.999Note that if it was possible to implement the oracle in time, our algorithm would instantly be improved by a factor. Thus in all cases our algorithm is faster than the previous one by a factor of . This result is subsumed by the one for arbitrary clusters, which is strictly more general (for a family of non-crossing clusters ).
Arbitrary clusters.
Consider the Hausdorff Voronoi diagram of a family of arbitrary clusters, that could possibly cross. The essential parameter used to refine the quadratic bounds related to the diagram in that case, is the number of crossings,101010See [20, 21] for the formal definition of the number of crossings. denoted by . The parameter is bounded from above by half the number of intersections between the convex hulls of all pairs of crossing clusters. In the worst case , however it is small in known practical applications, e.g., in VLSI CAD [20, 21]. The combinatorial complexity of the Hausdorff Voronoi diagram is shown to be [20]. Apart from the time algorithm mentioned above, there is a plane sweep [20] and a divide-and-conquer [21] algorithm to construct the diagram. Both of them are sensitive to the parameter , however their time complexity depends as well on some other parameters, which are unrelated to . In particular, these algorithms may have time complexity even when clusters are non-crossing.
Our technique can be applied to reduce the time complexity of the divide-and-conquer construction of the Hausdorff Voronoi diagram of arbitrary clusters [21]. The resulting algorithm is the fastest to date deterministic algorithm for certain input families, where clusters may cross, but the number of crossings is small. Since the description of our algorithm requires a lot of additional definitions and details, we defer it to Section 4.
3.4 Construction of the farthest-color Voronoi diagram
Let be a family of clusters of points in the plane, induced by partitioning a set of points in the plane – the same setting as in the previous section. Here we consider the farthest-color Voronoi diagram [13, 1] of , a generalized cluster Voronoi diagram, which is in some sense the opposite to the Hausdorff Voronoi diagram. It is defined as a subdivision of the plane into maximal regions, such that for any point in the region , , the cluster is the farthest cluster in . The distance from a point to a cluster is the minimum distance from to a point in . In , each is subdivided into finer regions of the points of by the nearest-neighbor Voronoi diagram of the points of that cluster, . The edges of this additional subdivision are called internal edges.
The farthest-color Voronoi diagram is much less understood than the Hausdorff diagram. Its combinatorial complexity is , and a matching lower bound is known for [1], where is the number of clusters in . An time construction algorithm is implied by the result of Edelsbrunner et al. [11]. Since the diagram is not an instance of farthest abstract Voronoi diagrams [17], studying particular families of clusters (proving better bounds on the complexity of the diagram, and finding faster construction algorithms) is a non-trivial task. Recently it was shown that if the clusters in are pairs of endpoints of disjoint segments parallel to each other, has complexity and can be computed in optimal time [8].
Applying our technique, we are able to claim near-optimal time complexity for a larger class of input families, where each cluster in a family is a quadruple of points that are corners of an axis-aligned rectangle, and the corresponding rectangles are pairwise disjoint. We first need to show that the farthest-color Voronoi diagram of such an input has linear combinatorial complexity, see Proposition 1 below. To prove this, we make use of the following.
Lemma 2
Let be a bounded face of . Then is incident to an internal edge of .
Proof
The following proof is a simple generalization of one of the arguments used to prove [8, Lemma 3]. Face is a face of for some point . Let be a point in , and let be the ray originating at and having direction . See Figure 3. Consider the closed disk centered at a point and passing through . Since , intersects all the clusters in . As moves along , the disk grows and it still intersects all clusters in . Until hits an edge of , the minimum distance from to is attained by , and since intersects all clusters in , lies in . Thus either the whole ray is contained in , or the first intersection between and the boundary of lies on an internal edge of . Since we assumed to be bounded, the latter must hold.
Proposition 1
For a family of clusters, where each cluster is all the corners of an axis-aligned rectangle, and these rectangles are pairwise disjoint, the combinatorial complexity of is .
Proof
is a plane graph, whose each vertex has degree at least three. Thus by Euler’s formula it is enough to show that the number of faces of is . We will treat separately its bounded and unbounded faces. We assume that each cluster has four distinct points, as otherwise (when it has two or one point) the situation becomes simpler.
We first show that the total number of bounded faces of is . By Lemma 2, any bounded face of is incident to an internal edge of . Recall that each internal edge of is a portion of an edge of , that lies in , for some cluster . In other words, an edge of intersects in several connected components (line segments or rays), and each such connected component is an internal edge of . In the next paragraph, we will show that each edge of of any cluster contributes at most two internal edges to . This will imply that the total number of internal edges in is : Since each cluster is a quadruple of points that are the corners of an axis-aligned rectangle, has four edges (see Figure 4a), and therefore the total number of edges in the nearest-neighbor Voronoi diagrams of all clusters in is .
Let be an edge of , and let be the points that induce , i.e., is a ray contained in the bisector of . See Figure 4b. The segment breaks into two portions; consider one of them, ; the other part is treated analogously. Suppose for the sake of contradiction that intersects in at least two connected components. Consider the circle passing through points and whose center moves along in the direction of growing radius of the circle. When stops being in , the circle stops containing a point of every cluster in . That is, some cluster starts to be outside the circle. Since the circle is growing, there is no way for to restart intersecting the circle, unless the convex hull of intersects the segment (see the dark-blue rectangles in Figure 4b), which would contradict the disjointness of the convex hulls of the clusters in .
Now we estimate the number of unbounded faces of . Consider the arrangement of all edges of the nearest-neighbor Voronoi diagrams of clusters in . This is a grid made of vertical and horizontal lines. Within one cell of that grid, coincides with the farthest Voronoi diagram of points (one point per cluster). The number of unbounded regions of equals the number of unbounded edges of . That number is comprised of the total number of unbounded internal edges (it is since each of them is a portion of a line forming the grid) and the total number of the unbounded edges of within the unbounded cells of the grid. Now we observe that such cells are half-strips and four quarter-planes. At infinity, the total number of distinct directions that all the half-strips correspond to is only four, thus at most four additional unbounded edges of may lie within these strips. At each quarter-plane, we have the farthest-point Voronoi diagram of points, which has unbounded edges. Therefore the total number of unbounded edges of is , and the same bound holds for the total number of unbounded faces of .
We proceed with the main result of this section.
Theorem 3.3
For a family of clusters, that are corners of pairwise disjoint axis-aligned rectangles, has complexity and it can be constructed in time.
Proof
The complexity of is due to the above Proposition 1.
To construct , we employ the divide-and-conquer strategy. We are not able to apply the divide-and-conquer algorithm from [8, Lemma 24], since the merge curve is not necessarily connected, and may have cycles. Suppose that for two subsets , of , the farthest-color Voronoi diagram is already computed. To merge two diagrams, we preprocess them using our technique from Section 2.2, and obtain the implicit search trees for the edges of . Then we can search each internal edge of , to determine all its portions that appear in the merged diagram. If we subdivide the edge by the segment through its generator points, the two halves will have at most one such connected component each, see the proof of Proposition 1. Thus we search them separately. To navigate the search along such a portion , given a point of intersection between and an edge of , we obtain the cluster that is farthest from among the clusters in . We construct the bisector between and , and this shows to which side of there lies the portion of that is farther from that from . That portion is the only one to which we should continue.
The merging step overall takes time and space to preprocess the diagrams, and -time search per each of internal edges of . The claimed time and space complexity follows.
3.5 The stabbing circle problem
Given a set of line segments in the plane, a circle is called a stabbing circle for if every segment in has exactly one endpoint in the exterior of the disk induced by . Two stabbing circles are combinatorially different if they classify the endpoints of differently.
The stabbing circle problem for consists of computing (a representation of) all the combinatorially different stabbing circles for (if they exist); and finding stabbing circles with the minimum and maximum radius. Although the stabbing circle problem can be solved in a worst-case optimal time and space by applying a technique by Edelsbrunner et al. [11] (see [8] for the explanation), the problem can be solved much faster if the input set of segments is of some particular form [8]. The method to do so is based on the Hausdorff and the farthest-color Voronoi diagram (see Section 3.3 and 3.4 for the definitions), and its time complexity depends on the parameters of these diagrams and of the input segment set; we will detail it in the next paragraph. For the segments parallel to each other, it works in time. The technique presented in Section 2.2 helps to improve the time complexity of this alternative method by a factor. This automatically reduces the time required to solve the stabbing circle problem for parallel segments from to , which now matches the lower bound given in [7].
Let and denote respectively the Hausdorff and the farthest-color Voronoi diagram, whose sites are pairs of endpoints of the segments in . Let and denote the time required to compute these two diagrams, and let and respectively denote their combinatorial complexity. Additionally, we let be a parameter reflecting interaction between the segments in .111111 denotes the number of pairs formed by a segment and a pure edge of such that and . (resp., ) is the disk centered at (resp., at ) with the radius (resp., ), where is the cluster in such that is incident to . We are ready to state the new result for the stabbing circle problem for that improves on [8, Lemma 17; Corollary 3, Theorem 4].
Theorem 3.4
Given a set of segments in the plane in general position, the stabbing circle problem for can be solved in time . If the segments in are parallel to each other, the stabbing circle problem for can be solved in optimal time and space.
Proof (sketch)
The only substantial change to the algorithm in [8] is an alternative procedure for the find-change query. In particular, [8, Lemma 17] gives a procedure to perform this query in time by a nested point location in . By using the technique presented in Section 3, we replace the nested point location by a binary search on among the intersections with the edges of . The oracle for our search works in time: Given a point on the intersection of an edge of and of , the “owners” of in both diagrams are available automatically. Once the owners of are known, determining the type of is a constant-time operation. Using Theorem 2.2, we improve the result of [8, Lemma 17] by a factor of . The claim follows by plugging the improved result into [8, Theorem 1].
4 A Divide and Conquer Algorithm for the Hausdorff Voronoi Diagram
Let be a family of point clusters in the plane, such that no two clusters have a common point. Let be the total number of points in . We follow a general position assumption that no four points lie on the same circle. We also assume that no cluster encloses another in its convex hull, as the outer cluster would have empty region in the Hausdorff Voronoi diagram.
Definition 1
Two clusters and are called non-crossing, if the convex hull of admits at most two supporting segments with one endpoint in and one endpoint in . If the convex hull of admits more than two such supporting segments, then and are called crossing.
The farthest Voronoi diagram of a cluster , denoted as , is a partitioning of the plane into regions where the farthest Voronoi region of a point is The graph structure of is a tree .
Given a cluster and a point , we let denote the maximum distance between and the points of the cluster , i.e., , where denotes the Euclidean distance between two points.
The Hausdorff Voronoi diagram of , denoted as , is a partitioning of the plane into regions, where the Hausdorff Voronoi region of a cluster is The Hausdorff Voronoi region of a point is If clear from the context, we do not write subscripts for and .
For two clusters , their Hausdorff bisector consists of one (if are non-crossing) or more (if are crossing) unbounded polygonal chains [20, 21]. Each vertex of is the center of a circle passing through two points of one cluster and one point of another that entirely encloses and . The vertices of are called mixed vertices.
Definition 2
A mixed vertex on the bisector , induced by two points and a point is called crossing, if there is a diagonal of that crosses the diagonal of , and all points are on the convex hull of . The total number of crossing vertices along the bisectors of all pairs of clusters is the number of crossings and is denoted by .
Edges of the Hausdorff Voronoi diagram are of two types: pure edges, and internal edges, that are portions of edges of inside . Each pure edge separates the Hausdorff Voronoi regions of two different clusters, and each internal edge separates the Hausdorff Voronoi regions of two different point in one cluster. Another way to see it is the following. Any edge of the Hausdorff Voronoi diagram is a portion of a bisector between two points. If these points are of the same cluster than the edge is a pure edge, otherwise it is an internal edge.
Property 1 ([20])
Each face of a region intersects in one non-empty connected component.
Given a family of point clusters, its Hausdorff Voronoi diagram can be computed in 121212 , where is the number of crossing mixed vertices on the bisector between and , for any pair of crossing clusters . , , where is the number of clusters enclosed in the minimum enclosing circle of , and is the number of convex hull points that are interacting with , that is, is enclosed in the minimum enclosing circle of and either is entirely enclosed in the minimum enclosing circle of or is crossing with . using the divide-and-conquer strategy [21]. We show how to reduce this to time and space (Theorem 4.1) by using the data structure described in Section 2.2.
Let the input set be subdivided into two sets and by a vertical line , such that the leftmost point of each cluster in and in is respectively to the left and to the right of . Let the diagrams and be recursively computed. The nontrivial part of merging and is to find the merge curve . The main complication, that distinguishes this case from the well-known divide-and-conquer algorithm for the Voronoi diagram of points, is that is not a Jordan curve, in particular, it has several unbounded components and several cycles [21]. The unbounded components, as well as the cycles that enclose at least one vertex of or of , can be found efficiently [21]. The cycles that enclose no vertices of or must contain a portion of an internal edge of one of the diagrams (which follows from Property 1). Thus to identify them, we need to perform searches along the internal edges of , and the ones of . Below we will concentrate on the former case; the latter one is analogous.
We perform these searches by means of the data structure developed in Section 2.2. For any internal edge of , the data structure provides a (implicit) tree storing all the intersections of this edge with the edges of . We search this tree, that is, at each accessed node we need to decide which subtree we should continue with. Sometimes we should continue to both subtrees, but we are able to charge this branching to crossing mixed vertices induced by and . Each vertex is charged at most once, and their overall number is , which gives us the claimed time complexity. We proceed with a more detailed description.
The following lemmas are the basis of our decision procedure. Let be a connected portion of an internal edge of induced by points of cluster , i.e., is a portion of the Euclidean bisector of and .
Lemma 3
For any cluster in : (i) the locus of points in that are closer to than to is connected. (ii) the locus of points in that are closer to than to may have up to two connected components. If it has two connected components, then there is a pair of crossing mixed vertex induced by and a point in .
Proof
(i). Suppose for the sake of contradiction that the locus of points in that are closer to than to is not connected. Then there are points such that is between and , and , , and . Let be the disks centered at respectively and , and each passing through points . See Figure 5. Note that since is a portion of an internal edge of , for each point , . Thus, , , and . But . We obtain a contradiction.
(ii). The first part of the statement follows directly from item (i) since the locus of points in closer to than to is the complement of the locus of points considered in (i). Now suppose the locus of points in that are closer to than to has two connected components. Thus, for the segment in-between these two components, every point in is closer to than to . Consider the two disks and centered respectively at and , and each passing through . See Figure 6. By construction, and contain respectively a point and a point on their boundaries, and these points are to the opposite sides of , and both and are contained in each of and . Thus the chord crosses the chord , and all four points appear on the convex hull of . Thus and both are crossing mixed vertices of induced respectively by and by . The claim follows.
Lemma 4
Let be a point in , and let be a cluster in such that for any . If , then in time it is possible to check whether contains points closer to than to .
Proof
We check whether contains points closer to than to as follows. We locate point in , which gives us . Recall that , and this is available immediately. If , we return the positive answer. If , then by Lemma 3i all the points in are closer to than to , and the answer to our query is negative.
Now we are ready to state the main result of this section.
Theorem 4.1
Given a family of point clusters in the plane, The Hausdorff Voronoi diagram of can be computed in time and space, where is the total number of points in all clusters in , and is the number of crossings for the clusters in .
Proof
The algorithm is a divide-and-conquer algorithm, that follows the one of Papadopoulou and Lee [21], except for finding a point on each cycle of the merge curve in the merging step.
Let the input family be subdivided into two subfamilies and by a vertical line (using the location of the leftmost point in each cluster), and let the diagrams and be recursively computed. The main difference from the well-known divide-and-conquer algorithm for the Voronoi diagram of points [22] is that the merge curve for and may have several unbounded components and several cycles [21]. Merging and then consists of (1) finding a point on each component of the merge curve, (2) tracing the merge curve and stitching the relevant parts of and together. It is known how to perform task (2) such that the overall time required for this task during the course of the algorithm is [21]. Task (1) for the unbounded components can be done in time , where is the total number of points in the clusters in and [21]. Each cycle of that encloses at least one vertex of or of , can be found in time [21].
We describe how to find a point on each cycle that encloses no vertices of or . We make use of the fact that such cycles enclose a portion of an internal edge of one of the diagrams (which follows from Property 1). We preprocess and as shown in Section 2.2, resulting in a data structure, that for every edge of provides a (implicit) tree storing all the intersections between that edge and the edges of .
For each internal edge of , we examine its portions that are outside any merge curve identified so far. Let be such a portion of an internal edge induced by . That is, is a portion of the bisector of and , and both are closer to some cluster in than to . We must find all the portions of that are closer to than to any cluster in , or report that they do not exist.
We search the tree that stores the intersections between and the edges of . As we navigate in the tree we keep track of the portion of that corresponds to the current node: the root of the tree corresponds to , and each consecutive node on any root-to-leaf path subdivides the current portion into two, which are assigned to the two children of . Observe that no two distinct nodes of the tree may be such that the portions corresponding to their left children intersect, and the ones of their right children intersect as well. Indeed, for two nodes and , either is an ancestor of , and then both intervals of are contained in one of the intervals of , or is an ancestor of (a symmetric case), or and do not lie on one root-to-leaf path, and then the intervals of do not intersect the ones of . This observation will be useful for estimating the time complexity of the algorithm.
Consider a tree node , let be the edge of , such that is the intersection point between and , and let be the portion of that corresponds to . We need to decide in which subtree of to continue the search. Suppose first that is an internal edge of . Let be the cluster in , such that belongs to . Employing Lemma 4, we determine if and/or contain points closer to than to . If (resp., ) does not contain such points, than it cannot intersect the merge curve, and the corresponding subtree should be ignored. Otherwise, the search continues in that subtree.
Suppose now that is a pure edge of , that separates the regions of some clusters . We perform the checks for both and , and we continue to a subtree only if the corresponding portion of contains points closer to that to and points closer to than to .
We now analyze the time complexity of the merging procedure. Let be the total number of crossings between pairs of clusters, one of which is in and the other is in . All the unbounded components of the merge curve, as well as the cycles that contain Voronoi vertices, can be found in total time [21]. When the merge curve is fully determined, stitching the appropriate pieces of and together can be done within the same time bound [21]. Below we prove that our procedure to find all the cycles of the merge curve that do not contain Voronoi vertices, requires . The claimed overall time complexity to construct then will follow from the fact that for each pair of clusters in , it happens at most once that is in and is in or vice versa. Thus the total sum of the numbers in all the merging steps is at most .
To prove that finding all empty cycles of the merge curve requires time, we note that if at a node the search has continued in both subtrees of , we necessarily have that the cluster that is the closest to , such that both and contain points closer to than to . By Lemma 3, there are two crossing mixed vertices induced by and . We charge the branching of our search at to that pair of vertices. Since no two nodes of the tree may have the portions of that correspond to their left children and the ones corresponding to their right children, respectively, both intersecting (as observed above), a pair of crossing vertices can be charged at most once. Therefore, the total number of nodes of all the search trees where our search went both ways is . The claim follows, since the number of leaves reached by our search in one tree is , where is the number of times the search was continued to both subtrees of a node. Since the height of any leaf is , and the time spent in one node is , the total time for searching one tree is .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Abellanas, M., Hurtado, F., Icking, C., Klein, R., Langetepe, E., Ma, L., Palop, B., Sacristán, V.: The farthest color Voronoi diagram and related problems. In: 17th Eur. Workshop on Comput. Geom. pp. 113–116 (2001), Tech. Rep. 002 2006, Univ. Bonn
- 2[2] Aronov, B., Bose, P., Demaine, E.D., Gudmundsson, J., Iacono, J., Langerman, S., Smid, M.: Data structures for halfplane proximity queries and incremental voronoi diagrams. In: 7th Latin American Symp. on Theoretical Informatics (LATIN). pp. 80–92. Springer (2006)
- 3[3] Chan, T.M.: A simple trapezoid sweep algorithm for reporting red/blue segment intersections. In: CCCG. pp. 263–268 (1994)
- 4[4] Chazelle, B., Edelsbrunner, H., Guibas, L.J., Sharir, M.: Algorithms for bichromatic line-segment problems and polyhedral terrains. Algorithmica 11(2), 116–132 (1994)
- 5[5] Cheilaris, P., Khramtcova, E., Langerman, S., Papadopoulou, E.: A randomized incremental algorithm for the Hausdorff Voronoi diagram of non-crossing clusters. Algorithmica 76(4), 935–960 (2016)
- 6[6] Cheong, O., Everett, H., Glisse, M., Gudmundsson, J., Hornus, S., Lazard, S., Lee, M., Na, H.S.: Farthest-polygon voronoi diagrams. Comput. Geom. 44(4), 234–247 (2011)
- 7[7] Claverol, M., Khramtcova, E., Papadopoulou, E., Saumell, M., Seara, C.: Stabbing circles for some sets of Delaunay segments. In: 32th Eur. Workshop on Comput. Geom. (Euro CG). pp. 139–143 (2016)
- 8[8] Claverol, M., Khramtcova, E., Papadopoulou, E., Saumell, M., Seara, C.: Stabbing circles for sets of segments in the plane. Algorithmica (2017), DOI 10.1007/s 00453-017-0299-z
