Planar subdivisions and point location
Measure the subdivision actually stored and distinguish face queries from boundary queries.
On this page
The question for today
What you’ll understand
- Represent a planar subdivision by incident vertices, edges, and faces.
- Check a point’s face using consistent orientation tests and boundary handling.
- State expected point-location bounds in the subdivision complexity.
A collection of drawn segments is not yet a planar subdivision: every crossing must become a vertex and split its incident edges. A subdivision records the resulting vertices, edge pieces, and faces, including the unbounded face. Let its complexity be the sum of those three counts. Point location asks which feature contains a query. For an interior query the answer is a face; a boundary query can instead return an edge or vertex with incidence information. This distinction avoids assigning a shared boundary arbitrarily to incompatible neighboring regions.
Store incidence as well as coordinates
A doubly connected edge list represents each undirected edge by two oppositely directed half-edges. Each half-edge records its twin, origin, next boundary edge, and incident face; suitable vertex and face records provide entry points. This supports local navigation around a face or vertex without repeatedly searching a geometric drawing. Holes and disconnected components need their own boundary-cycle records. The representation stores a planar embedding, not merely an abstract graph with no information about cyclic edge order.
For a finite connected plane graph, Euler's formula includes the unbounded face. More generally the right side depends on the number of connected components. These are useful consistency checks after splitting crossings or adding diagonals. They do not alone verify a correct embedding: overlapping edges, self-crossing face boundaries, or incorrect twin links can satisfy a numerical count. Incidence invariants and robust geometric predicates remain necessary. If original segments have many crossings, the stored subdivision can be quadratic in their initial count.
Replace a global search with local decisions
A vertical decomposition adds rays from vertices until they hit another edge or an enclosing box, producing constant-complexity trapezoid-like cells. A search hierarchy compares a query with vertical boundaries and supporting segments to locate its cell, then retrieves the original face label. The geometric decomposition and the hierarchy are different objects: many search paths may share a leaf for the same cell. A directed acyclic graph records that sharing and can remain much smaller than a naively duplicated search tree.
For noncrossing segment edges in a bounding box, with shared endpoints handled consistently and the usual generic sweep-direction assumptions, randomized incremental trapezoidal construction gives expected linear space and expected logarithmic search for each fixed interior query, with expected preprocessing at sorting scale. These expectations concern insertion order, independent of the fixed input and query, rather than a random query distribution. A worst-case bound simultaneously for all queries needs a stronger certified construction or another structure; it does not follow from the fixed-query expectation.
Boundary answers require an exact convention
An orientation zero at an edge is a possible answer, not a failed comparison. For an edge-interior query, an API may return the edge and both incident faces; at a vertex, it may return the vertex and its incident features. A face-only API can choose a consistent half-open ownership convention instead, but must document it. Generic interior-query analysis often excludes vertical alignments with vertices; implementations handle these ties through explicit branches or symbolic comparisons rather than numerical nudges.
Keep preprocessing stages separate when reporting costs. Constructing an arrangement from intersecting input segments can dominate building a locator for the resulting subdivision. If the input is already a valid subdivision, that initial intersection work has already been done. A logarithmic query in the final complexity does not imply a subquadratic total representation for an arbitrary segment arrangement. Similarly, triangulating or vertically decomposing a region introduces auxiliary edges whose labels must preserve the original face identity.
Work it through
Locate a query in a four-triangle subdivision
Take the rectangle with corners , , , and center . Join the center to all four corners. Count features and locate , using counterclockwise triangle .
There are five vertices, four rectangle edges and four spokes, so , . The four bounded triangles and exterior give , and as required for one connected component.
For triangle , the edge orientations against are , , and . All are positive.
Thus lies strictly inside the lower triangle. The stored feature complexity is . A query at is a vertex query, while lies on spoke and needs the boundary convention.
The face label and lower-dimensional feature answers are different legitimate outputs. The numerical Euler check supports, but does not replace, the incidence and orientation checks.
The living notebook
Explore the model
Interactive lab · vectors
Distinguish an interior query from a boundary query
Pause/Reset and set BOTH controls to angle degrees, magnitude . The endpoint has coordinate sum , placing it above the partition line . For a fresh comparison Pause/Reset and set BOTH to angle degrees, magnitude : the endpoint is exactly on that line. Changes retain the paused clock.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forThe endpoint is a query point for a manually specified partition. The display does not construct a subdivision or a point-location hierarchy.
Pause & reason
Check your understanding
Your turn
Try it yourself
Three segments have six distinct endpoints and three distinct proper pairwise crossings. Assume their union is connected and there are no further incidences. After splitting all crossings, find V, E, F and the subdivision complexity N.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Each crossing adds one vertex and splits each of two original segments into one additional edge piece.
Compare with the solution
The vertex count is . Initially there are three edges; each proper crossing adds two edge pieces, so . Connectedness and Euler give , including the exterior. Therefore . A point-location theorem measured in N applies to these pieces and features, rather than treating the original three unsplit segments as the entire stored input.
Keep the idea
Take it with you
- A subdivision requires split crossings and explicit incidence information.
- Point-location complexity uses the final feature count, not just the original segment count.
- Expected search for a fixed query and a simultaneous worst-case guarantee are different statements.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.