Point-Location in The Arrangement of Curves
PPoint-Location in The Arrangement of Curves
Sepideh Aghamolaei Sharif University of Technology, Tehran, Iran [email protected]
Abstract.
An arrangement of n curves in the plane is given. The queryis a point q and the goal is to find the face of the arrangement thatcontains q . A data-structure for point-location, preprocesses the curvesinto a data structure of polynomial size in n , such that the queries canbe answered in time polylogarithmic in n .We design a data structure for solving the point location problem queriesin O (log C ( n ) + log S ( n )) time using O ( T ( n ) + S ( n ) log( S ( n ))) prepro-cessing time, if a polygonal subdivision of total size S ( n ), with cell com-plexity at most C ( n ) can be computed in time T ( n ), such that the orderof the parts of the curves inside each cell has a monotone order withrespect to at least one segment of the boundary of the cell. We call sucha partitioning a curve-monotone polygonal subdivision. Keywords:
Point-location · Pseudo-line Arrangement · Data Structures · Computational Geometry.
An arrangement of curves is a subdivision of the plane induced by those curves.The arrangement of pseudo-lines has complexity O ( n ), where a pseudo-line is acurve that goes to infinity in two directions, and two pseudo-lines can intersectat most once. An output-sensitive algorithm for the arrangement of Jordan arcswith running time O (( n + k ) log n ) exists, where k is the number of intersectionsin the arrangement [4].Bzier curves based on Bernstein basis polynomials from computer graphics fornon-rasterized curves are examples of real-world examples of polynomial curves.Testing whether a given pseudoline arrangement can be converted into anstraight-line arrangement is known as the stretchability problem is NP-hardand is equivalent to existential theory of the reals [3]. A generalized version ofthis problem is the d-stretchability discusses the possibility of replacing eachpseudoline with a polynomial of degree d which requires Ω ( √ n ) for all simplearrangements [4].Finding a point in a planar subdivision and returning the face that containthat point is called point location . Point location in a polygonal subdivision with n segments can be solved in O ( n log n ) preprocessing to build the data-structureand O (log n ) query time for n segments [2]. Without using a point-location data-structure, the problem can be solved in O ( nQ ( n )) time, for arbitrary shapes a r X i v : . [ c s . C G ] J u l Sepideh Aghamolaei with an inclusion-exclusion oracle Q ( n ), by testing whether the point is insideor outside each shape.Since the problem of converting the arrangement of pseudo-lines into a polyg-onal arrangement is NP-hard [3], the point-location on polygonal subdivisions isnot helpful. The problem of point-location in a set of congruent disks has alreadybeen discussed, and an algorithm with O (log n + k ) query time and O ( n log n )preprocessing exists for it [1]. Contributions – We improve the previous work on the point-location of congruent disks touse O (log n ) query time, instead of O (log n + k ), at the cost of increasingthe preprocessing time to O ( n log n ). – We give a data structure for the point location problem in the arrangementof a set of curves with O ( T ( n ) + S ( n ) log S ( n )) preprocessing and O (log n +log C ( n )) query time, if an algorithm for constructing a planar subdivisionof complexity S ( n ) and cell size at most C ( n ) in time T ( n ) is given. In Algorithm 3, we use a polygonal partitioning such that the part of the curveinside each partition is monotone with respect to at least one boundary of thatcell, which we call a curve-monotone partitioning . Then, we use a combinationof point-location in polygonal subdivisions and binary search on the ordered setof polynomial arcs bounded by a segment of the subdivision (Algorithm 4).
After breaking the input into a set of disjoint xy -monotone convex/concavecurves, Algorithm 1 computes a subdivision of the plane, such that the order ofthe curves in each cell is monotone with respect to each cell boundary.To do this, first compute the bounding box of each curve. Some of the bound-ing rectangles might be intersecting, or inside one another:(a) For a sequence of boxes inside one another (nested rectangles), merge theirboxes by considering the outermost bounding box only, if there are no otherrectangles outside this sequence inside them.(b) For intersecting boxes, add the tangents to the curves at the points of in-tersections with bounding rectangles of other curves and their own. Then,starting from a point on the boundary of the intersected area, move towardsone of the curves, until hitting the other curve’s bounding box or tangent,then repeat this on the other curve. If it is the intersection of two curves,draw the common tangent of the curves to separate them.(c) For disjoint rectangles inside another rectangle, we divide them by extendingthe edges of the rectangles inside the bigger rectangle, until intersecting theboundary of the extension of an edge of another rectangle. oint-Location in The Arrangement of Curves 3 (d) For disjoint rectangles, extend their edges until intersecting the boundary orthe extension of an edge to create a set of disjoint rectangles.(e) For intersecting nested bounding boxes, first handle the intersecting seg-ments, then handle the disjoint and then the nested rectangles.An example of these cases is shown in Figure 1. Fig. 1.
Four possible arrangements of bounding boxes and their subdivisions.
Algorithm 1
Curve-Monotone Subdivision
Input:
A set of curves P , · · · , P n Output:
A subdivision of the plane such that the distances of { P i } ni =1 in each cell canbe uniquely defined.1: for i = 1 , · · · , n do Q ← Q ∪ { Break each curve P i into xy -monotone totally concave or totallyconvex parts } .3: end for A =Build the arrangement of curves Q .5: B =Connect the intersections and vertices using straight line segments.6: C =Partition B by drawing the bounding boxes of the curves in Q or the mutualtangents of the curves in Q when their bounding boxes intersect, except for thecurves that are inside another curve.7: Triangulate the cells of C with complexity more than 3.8: Store for each segment s the list of curves inside cell c intersecting it as L s,c alongwith the index of their adjacent cells.9: return C and L s,c , s ∈ c, c ∈ C Algorithm 2 computes a planar subdivision for a set of arbitrary disks. An ex-ample of the possible cases of Algorithm 2 is shown in Figure 2. The size ofthe arrangement is O ( n ), since at most (cid:0) n (cid:1) lines connect the centers of thedisks, there are 4 (cid:0) n (cid:1) mutual tangents, and the bounding box adds at most 4vertices and therefore a multiple of at most 4. Because of the triangulation, thecell complexity is at most 3 Sepideh Aghamolaei
Algorithm 2
Subdivision for Disks
Input:
A set of disks P , · · · , P n Output:
A subdivision of the plane D .1: A =Build the arrangement of the disks P , · · · , P n .2: B =Build the bounding box of the input, connect the intersections of the disks,their pairwise tangents and their centers to each other and to the boundary withstraight lines.3: C =Triangulate the cells of B with complexity more than 3.4: Store for each segment s the list of curves inside cell c intersecting it as L s,c alongwith the index of their adjacent cells.5: return C and L s,c , s ∈ c, c ∈ C Fig. 2.
Four examples of the subdivisions of Algorithm 2 for a set of disks.
Assuming a curve-monotone planar subdivision is given, Algorithm 3 buildsa data-structure for the point-location problem. Assuming the algorithm for
Algorithm 3
Preprocessing
Input:
A set of curves P , · · · , P n Output:
A point location data structure D augmented by a set of lists L s,c C = Build a curve-monotone planar subdivision on P , · · · , P n .2: Sort each list L s,c , s ∈ c, c ∈ C , based on their distances from the segment s .3: D = Build a point-location data structure on C .4: return D and L s,c , s ∈ c, c ∈ C constructing the curve-monotone planar subdivision has time complexity T ( n ),space complexity S ( n ) and maximum cell complexity C ( n ), Algorithm 3 takes T ( n ) + O ( S ( n ) log S ( n )) for building the subdivision, sorting and constructingthe point-location data-structure.An example of a valid partitioning for the point-location using Algorithm 3is shown in Figure 3. Theorem 1.
Algorithm 3 using Algorithm 1 for computing the subdivision hastime complexity O ( n log( n )) and space complexity O ( n ) . oint-Location in The Arrangement of Curves 5 Fig. 3.
The input curves in blue, and the finer partitioning of B into C (Algorithm 3). Algorithm 4
Query
Input:
A point q , a point location data structure D augmented by a set of lists L s,c Output:
The cell of D that contains q c = The output of point location of q in D .2: X = ∅ for s ∈ the boundary of c do X ← X ∪ Binary search on the lists L s,c , using the polynomial’s equation todetect above/below to find the cell of the arrangement.5: end for return the only non-empty result in X . Proof.
The sizes of intermediate structures is as follows: | Q | = O ( n ) , | A | = O (( n ) ) , | B | = | A | , | C | ≤ | B | = O ( n ) , (cid:88) s ∈ c,c ∈ C | L s,c | = O ( | C | )Triangulating the regions does not increase the overall complexity, since thisadds a linear number of edges.Breaking each polynomial into monotone parts takes O (1) time. Computing D takes O ( | C | log | C | ) = O ( n log( n )) time. Triangulating the regions takes lin-ear time, and sorting the set of segments in each cell takes O ( | C | log | C | ). So,the time complexity is dominated by the time complexity of computing D . Theorem 2.
Algorithm 4 has time complexity O (log n ) .Proof. The point-location in D takes O (log( n )) time, since it is a polygonal pointlocation for an input of size O ( n ). Based on Algorithm 3, the complexity of eachcell is at most 4, and each list has size at most n , so the binary searches take O (log( n )) time. So, the total time complexity of a query is O (log n ). Approximate Point-Location.
While building an exact point-location data-structuremight be expensive in terms of time complexity, it is possible to build approxi-mate point-location data structures by enclosing the original curve between two
Sepideh Aghamolaei simpler curves. Then, the exact point-location data-structure needs to be usedfor the area between the enclosing simplified curves. For the one-sided error,such as never reporting a point inside (outside) the shape as outside (inside),the data-structure built on the bounding (enclosed) curve is enough to get anapproximate solution.
Application: Point-Location among Contour Lines.
For a given objective func-tion and its discretization, the contour lines separate the input into regions suchthat the value of the objective function is the same between two contour curves.By building a point-location data structure on such an arrangement, it is possibleto get the values with error dependent on the discretization used when build-ing the contour lines. An example of this method exists for the length queryproblem [1].