Point Location
Point Location
Spring 2015
• Important metrics:
– Time complexity for preprocessing
= time to construct the data structure
– Space needed to store the data structure
– Time complexity for querying the data structure
p p p
• In each slab, the vertical order of the line segments remains constant.
• If we know in which slab p lies, we can perform binary search, using the
sorted order of the segments in the slab.
• Find slab that contains p by binary search on x among slab boundaries.
• A second binary search in slab determines the face containing p.
• Search complexity O(log n), but space complexity (n2) .
lower bound?
2/5/15 CMPS 3130/6130 Computational Geometry 6
Kirkpatrick’s Algorithm
• Needs a triangulation as input. b
• Can convert a planar subdivision with
n vertices into a triangulation:
– Triangulate each face, keep same label as
original face.
– If the outer face is not a triangle:
• Compute the convex hull of the p
subdivision.
• Triangulate pockets between the
subdivision and the convex hull.
• Add a large triangle (new vertices a
a, b, c) around the convex hull, and c
triangulate the space in-between.
– Constant degree:
Each vertex v to be deleted has O(1) degree in
the graph Ti .
• If v has degree d, the resulting hole can be re-
triangulated with d-2 triangles
• Each new triangle in Ti+1 overlaps at most d original
triangles in Ti
– Independent sets:
No two deleted vertices are adjacent.
• Each hole can be re-triangulated independently.
Proof:
Algorithm to construct independent set:
• Mark all vertices of degree ≥ 9
• While there is an unmarked vertex
• Let v be an unmarked vertex v
• Add v to the independent set
• Mark v and all its neighbors
• Can be implemented in O(n) time: Keep list of unmarked
vertices, and store the triangulation in a data structure that
allows finding neighbors in O(1) time.
• In the beginning of the algorithm, at least n/2 nodes are unmarked. Each
picked vertex v marks ≤ 8 other vertices, so including itself 9.
• Therefore, the while loop can be repeated at least n/18 times.
• This shows that there is an independent set of size at least n/18 in which
each node has degree ≤ 8.
• Create trapezoidal map by shooting two rays vertically (up and down)
from each vertex until a segment is hit. [Assume no segment is vertical.]
• Trapezoidal map = rays + segments
• Enclose S into bounding box to avoid
infinite rays.
• All faces in subdivision are trapezoids,
with vertical sides.
• The trapezoidal map has at most
6n+4 vertices and 3n+1 trapezoids:
• Each vertex shoots two rays, so, 2n(1+2)
vertices, plus 4 for the bounding box.
• Count trapezoids by vertex that creates its
left boundary segment: Corner of box for
one trapezoid, right segment endpoint for
one trapezoid, left segment endpoint for
at most two trapezoids. 3n+1
2/5/15 CMPS 3130/6130 Computational Geometry 17
Construction
• Randomized incremental construction
• Start with outer box which is a single trapezoid. Then add one segment
si at a time, in random order.
si
si
si si
n/2+1
n/2+2
1 2 3 n/2
• Random variable ki(s)= #trapezoids added when s was inserted last in Si.
• ki(s)=∑∆∈ ∆,
• E(ki)=∑ ∈ k ∑ ∈ k ∑ ∈ ∑∆∈ ∆,
• Random variable ki(s)= #trapezoids added when s was inserted last in Si.
• ki(s)=∑∆∈ ∆,
• E(ki)=∑ ∈ k ∑ ∈ k ∑ ∈ ∑∆∈ ∆,
• = ∑∆∈ ∑ ∈ ∆,
• How many segments does depend on? At most 4.
• Also, Ti has O(i) trapezoids (by Euler’s formula).
• E(ki)= ∑∆∈ ∑ ∈ ∆, = ∑∆∈ 4 4| | 1
s3 q3
p3
q3
s3
p3
s3 s3
s3 s3
s3 s3