Point Location Problem
   HOME

TheInfoList



OR:

The point location problem is a fundamental topic of computational geometry. It finds applications in areas that deal with processing geometrical data:
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
,
geographic information system A geographic information system (GIS) consists of integrated computer hardware and Geographic information system software, software that store, manage, Spatial analysis, analyze, edit, output, and Cartographic design, visualize Geographic data ...
s (GIS),
motion planning Motion planning, also path planning (also known as the navigation problem or the piano mover's problem) is a computational problem to find a sequence of valid configurations that moves the object from the source to destination. The term is used ...
, and
computer aided design Computer-aided design (CAD) is the use of computers (or ) to aid in the creation, modification, analysis, or optimization of a design. This software is used to increase the productivity of the designer, improve the quality of design, improve c ...
(CAD). In its most general form, the problem is, given a partition of the space into disjoint regions, to determine the region where a query point lies. For example, the problem of determining which window of a
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
contains a given mouse click can be formulated as an instance of point location, with a subdivision formed by the visible parts of each window, although specialized data structures may be more appropriate than general-purpose point location data structures in this application. Another special case is the
point in polygon In computational geometry, the point-in-polygon (PIP) problem asks whether a given point in the plane lies inside, outside, or on the boundary of a polygon. It is a special case of point location problems and finds applications in areas that deal ...
problem, in which one needs to determine whether a point is inside, outside, or on the boundary of a single
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
. In many applications, one needs to determine the location of several different points with respect to the same partition of the space. To solve this problem efficiently, it is useful to build a
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
that, given a query point, quickly determines which region contains the query point (e.g.
Voronoi Diagram In mathematics, a Voronoi diagram is a partition of a plane into regions close to each of a given set of objects. It can be classified also as a tessellation. In the simplest case, these objects are just finitely many points in the plane (calle ...
).


Planar case

In the planar case, we are given a planar subdivision ''S'', formed by multiple
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
s called faces, and need to determine which face contains a query point. A
brute force search In computer science, brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique and algorithmic paradigm that consists of systematically checking all possible candidates for whether or n ...
of each face using the point-in-polygon algorithm is possible, but usually not feasible for subdivisions of high complexity. Several different approaches lead to optimal data structures, with O(''n'') storage space and O(log ''n'') query time, where ''n'' is the total number of vertices in ''S''. For simplicity, we assume that the planar subdivision is contained inside a square bounding box.


Slab decomposition

The simplest and earliest data structure to achieve O(log ''n'') time was discovered by Dobkin and
Lipton Lipton is a brand named after its founder, Sir Thomas Lipton, Tom Lipton, who started an eponymous grocery retail business in the United Kingdom in 1871. The brand was used for various consumer goods sold in Lipton stores, including tea from 1 ...
in 1976. It is based on subdividing ''S'' using vertical lines that pass through each vertex in ''S''. The region between two consecutive vertical lines is called a
slab Slab or SLAB may refer to: Physical materials * Concrete slab, a flat concrete plate used in construction * Stone slab, a flat stone used in construction * Slab (casting), a length of metal * Slab (geology), that portion of a tectonic plate that ...
. Notice that each slab is divided by non-intersecting line segments that completely cross the slab from left to right. The region between two consecutive segments inside a slab corresponds to a unique face of ''S''. Therefore, we reduce our point location problem to two simpler problems: # Given a subdivision of the plane into vertical slabs, determine which slab contains a given point. # Given a slab subdivided into regions by non-intersecting segments that completely cross the slab from left to right, determine which region contains a given point. The first problem can be solved by
binary search In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the m ...
on the ''x'' coordinate of the vertical lines in O(log ''n'') time. The second problem can also be solved in O(log ''n'') time by binary search. To see how, notice that, as the segments do not intersect and completely cross the slab, the segments can be sorted vertically inside each slab. While this algorithm allows point location in logarithmic time and is easy to implement, the space required to build the slabs and the regions contained within the slabs can be as high as O(''n''²), since each slab can cross a significant fraction of the segments. Several authors noticed that the segments that cross two adjacent slabs are mostly the same. Therefore, the size of the data structure can be significantly reduced. More specifically, Sarnak and Tarjan sweep a vertical line ''l'' from left to right over the plane, while maintaining the segments that intersect ''l'' in a Persistent red-black tree. This allows them to reduce the storage space to O(''n''), while maintaining the O(log ''n'') query time.


Monotone subdivisions

A (vertical) monotone chain is a
path A path is a route for physical travel – see Trail. Path or PATH may also refer to: Physical paths of different types * Bicycle path * Bridle path, used by people on horseback * Course (navigation), the intended path of a vehicle * Desir ...
such that the ''y''-coordinate never increases along the path. A
simple polygon In geometry, a simple polygon is a polygon that does not Intersection (Euclidean geometry), intersect itself and has no holes. That is, it is a Piecewise linear curve, piecewise-linear Jordan curve consisting of finitely many line segments. The ...
is (vertical) monotone if it is formed by two monotone chains, with the first and last vertices in common. It is possible to add some edges to a planar subdivision, in order to make all faces monotone, obtaining what is called a monotone subdivision. This process does not add any vertices to the subdivision (therefore, the size remains O(''n'')), and can be performed in O(''n'' log ''n'') time by plane sweep (it can also be performed in linear time, using
polygon triangulation In computational geometry, polygon triangulation is the partition of a polygonal area (simple polygon) into a set of triangles, i.e., finding a set of triangles with pairwise non-intersecting interiors whose union is . Triangulations may ...
). Therefore, there is no loss of generality, if we restrict our data structure to the case of monotone subdivisions, as we do in this section. The weakness of the slab decomposition is that the vertical lines create additional segments in the decomposition, making it difficult to achieve O(''n'') storage space.
Herbert Edelsbrunner Herbert Edelsbrunner (born March 14, 1958) is a computer scientist working in the field of computational geometry, the Arts & Science Professor of Computer Science and Mathematics at Duke University, Professor at the Institute of Science and Tec ...
, Leonidas J. Guibas, and Jorge Stolfi discovered an optimal data structure that only uses the edges in a monotone subdivision. The idea is to use vertical monotone chains, instead of using vertical lines to partition the subdivision. Converting this general idea to an actual efficient data structure is not a simple task. First, we need to be able to compute a monotone chain that divides the subdivision into two halves of similar sizes. Second, since some edges may be contained in several monotone chains, we need to be careful to guarantee that the storage space is O(n). Third, testing whether a point is on the left or the right side of a monotone subdivision takes O(''n'') time if performed naïvely. Details on how to solve the first two issues are beyond the scope of this article. We briefly mention how to address the third issue. Using binary search, we can test whether a point is to the left or right of a monotone chain in O(log ''n'') time. As we need to perform another nested binary search through O(log ''n'') chains to actually determine the point location, the query time is O(log² n). To achieve O(log ''n'') query time, we need to use
fractional cascading In computer science, fractional cascading is a technique to speed up a sequence of binary searches for the same value in a sequence of related data structures. The first binary search in the sequence takes a logarithmic amount of time, as is standar ...
, keeping pointers between the edges of different monotone chains.


Triangulation refinement

A polygon with ''m'' vertices can be partitioned into ''m''–2 triangles. Which can be shown by induction starting from a triangle. There are numerous algorithms to triangulate a polygon efficiently, the fastest having O(''n'') worst case time. Therefore, we can decompose each polygon of our subdivision in triangles, and restrict our data structure to the case of subdivisions formed exclusively by triangles. Kirkpatrick gives a data structure for point location in triangulated subdivisions with O(''n'') storage space and O(log ''n'') query time. The general idea is to build a hierarchy of triangles. To perform a query, we start by finding the top-level triangle that contains the query point. Since the number of top-level triangles is bounded by a constant, this operation can be performed in O(1) time. Each triangle has pointers to the triangles it intersects in the next level of the hierarchy, and the number of pointers is also bounded by a constant. We proceed with the query by finding which triangle contains the query point level by level. The data structure is built in the opposite order, that is, bottom-up. We start with the triangulated subdivision, and choose an independent set of vertices to be removed. After removing the vertices, we retriangulate the subdivision. Because the subdivision is formed by triangles, a greedy algorithm can find an independent set that contains a constant fraction of the vertices. Therefore, the number of removal steps is O(log ''n'').


Trapezoidal decomposition

A randomized approach to this problem is based on trapezoidal decomposition, or trapezoidal map. A trapezoidal decomposition is obtained by shooting vertical bullets going both up and down from each vertex in the original subdivision. The bullets stop when they hit an edge, and form a new edge in the subdivision. This way, we obtain a subset of the slab decomposition, with only O(''n'') edges and vertices, since for each vertex in the original subdivision we only add two new vertices and increase the number of edges by four. A trapezoidal decomposition can be constructed by adding the segments from the original subdivision, one by one, in a random order. Initially (before no segments have been added) the trapezoidal decomposition consists of a single trapezoid, the
bounding box In geometry, the minimum bounding box or smallest bounding box (also known as the minimum enclosing box or smallest enclosing box) for a point set in dimensions is the box with the smallest measure (area, volume, or hypervolume in higher dime ...
of the subdivision. Each subsequent step uses a point location query to locate one endpoint of the next line segment, within the current trapezoidal decomposition, and then walks from the resulting trapezoid to neighboring trapezoids containing the same segment, subdividing and recombining them to form the refined decomposition. Backwards analysis, a form of analysis commonly used for this sort of randomized incremental geometry algorithm, shows that the expected number of trapezoids created for each insertion is bounded by a constant, and therefore that the total number of steps of this algorithm, outside of the point locations, is linear. The point locations in the current subdivision, performed within this algorithm, may be done using the same structure that, at the end of the algorithm, can be used for point location queries in the final trapezoidal decomposition. This point location data structure takes the form of a
directed acyclic graph In mathematics, particularly graph theory, and computer science, a directed acyclic graph (DAG) is a directed graph with no directed cycles. That is, it consists of vertices and edges (also called ''arcs''), with each edge directed from one ...
, where the vertices are the trapezoids that existed at some point in the refinement, and directed edges connect each trapezoid that is no longer in the refinement to the trapezoids that replaced it. A point location query is performed by following a path in this graph, starting from the initial trapezoid, and at each step choosing the replacement trapezoid that contains the query point, until reaching a trapezoid that has not been replaced. The expected depth of a search in this digraph, starting from any query point, is O(log ''n''). The space for the data structure is proportional to the number of trapezoids created throughout this refinement process, which in expectation is O(''n'').


Higher dimensions

There are no known general point location data structures with linear space and logarithmic query time for dimensions greater than 2. Therefore, we need to sacrifice either query time, or storage space, or restrict ourselves to some less general type of subdivision. In three-dimensional space, it is possible to answer point location queries in O(log² ''n'') using O(''n'' log ''n'') space. The general idea is to maintain several planar point location data structures, corresponding to the intersection of the subdivision with ''n'' parallel planes that contain each subdivision vertex. A naive use of this idea would increase the storage space to O(''n''²). In the same fashion as in the slab decomposition, the similarity between consecutive data structures can be exploited in order to reduce the storage space to O(''n'' log ''n''), but the query time increases to O(log² ''n''). In ''d''-dimensional space, point location can be solved by recursively projecting the faces into a (''d''-1)-dimensional space. While the query time is O(log ''n''), the storage space can be as high as O(n^). The high complexity of the ''d''-dimensional data structures led to the study of special types of subdivision. One important example is the case of arrangements of hyperplanes. An arrangement of ''n'' hyperplanes defines O(''nd'') cells, but point location can be performed in O(log ''n'') time with O(''nd'') space by using Chazelle's hierarchical
cutting Cutting is the separation or opening of a physical object, into two or more portions, through the application of an acutely directed force. Implements commonly used for wikt:cut, cutting are the knife and saw, or in medicine and science the sca ...
s. Another special type of subdivision is called rectilinear (or orthogonal) subdivision. In a rectilinear subdivision, all edges are parallel to one of the ''d'' orthogonal axis. In this case, point location can be answered in O(log''d''-1 ''n'') time with O(''n'') space.


References


Notes


Sources

* * * * * *


Further reading

* {{cite book , editor1-first = Jacob E., editor1-last= Goodman, editor1-link=Jacob E. Goodman, editor2-link=Joseph O'Rourke (professor), editor2-first=Joseph, editor2-last=O'Rourke , title = Handbook of Discrete and Computational Geometry , edition = 2nd , publisher = Chapman & Hall/CRC , date = 2004 , isbn = 1-58488-301-4, chapter=Chapter 34: "Point Location, first=Jack, last=Snoeyink


External links


Point-Location Source Repository
at Stony Brook University

in
CGAL The Computational Geometry Algorithms Library (CGAL) is an open source software library of computational geometry algorithms. While primarily written in C++, Scilab bindings and bindings generated with SWIG (supporting Python and Java for now) a ...
, the Computational Geometry Algorithms Library Geometric data structures