0% found this document useful (0 votes)
174 views2 pages

HW 8

This document contains a 4-part homework assignment on computational geometry. Part 1 involves applying the Bentley-Ottmann sweepline algorithm to a set of line segments. Part 2 asks how to perform point-in-polygon queries in optimal time for convex and x-monotone polygons. Part 3 asks how to build a data structure to answer nearest neighbor queries. Part 4 involves building the Kirkpatrick point location hierarchy for a given triangulation.

Uploaded by

kalaputra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views2 pages

HW 8

This document contains a 4-part homework assignment on computational geometry. Part 1 involves applying the Bentley-Ottmann sweepline algorithm to a set of line segments. Part 2 asks how to perform point-in-polygon queries in optimal time for convex and x-monotone polygons. Part 3 asks how to build a data structure to answer nearest neighbor queries. Part 4 involves building the Kirkpatrick point location hierarchy for a given triangulation.

Uploaded by

kalaputra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AMS 345/CSE 355 (Spring, 2006) Joe Mitchell

COMPUTATIONAL GEOMETRY
Homework Set # 8

Due at the beginning of class on Wednesday, May 3, 2006.


Recommended Reading: O’Rourke, Chapter 7 (you may omit sections 7.3, 7.5, 7.6, 7.8, 7.9).
In all of the exercises, be sure to give at least a brief explanation or justification for each claim that you make.

(1). [25 points] Consider the set S of 7 line segments given by S = {s0 , s1 , . . . , s6 } = { ((-4,13.5),(4,6)), ((1,3),(6,16)),
((2,9),(7,13)), ((3,15),(8,5)), ((4,4),(10,8.5)), ((6,7),(13,17)), ((9,14),(12,10))}, where each segment s i = (ai , bi ) has
upper endpoint ai and lower endpoint bi .

15

3
0 6
10 2 5

5 1 4

5 10 15

Apply the Bentley-Ottmann sweepline algorithm to S. Give the event queue Q and the sweep status L just after
each event. (Use the notation as in the text that xij denotes the point (if any) at the intersection of segment si and
segment sj .)
Show the chart, just as in the handout given in class. (You need not compute the actual intersection points x ij .)
(a). Apply the “usual” Bentley-Ottmann sweep (as described in the text and in class).
(b). Apply the “modified” Bentley-Ottmann sweep (as described in class; see problem 2, Section 7.8.1, page 269
of the text), which removes from the event queue those crossing events that no longer correspond to segments that
are adjacent in the sweep line status (SLS).
(2). [20 points] Let P be a given simple polygon, specified by a list of its vertices in counterclockwise order around
its boundary. We know that P can be preprocessed in time O(n), to build a data structure of size O(n), that
supports “point-in-polygon” queries: Is the point q inside polygon P ? (Triangulate P , using Chazelle’s algorithm,
triangulating both the inside of P and its exterior (after placing it, e.g., in a giant triangle that surrounds it). Then
preprocess using the Kirkpatrick algorithm, which allows point location in time O(log n) to report which triangle
contains a query point q. Since we can tag each triangle as being “inside” or “outside”, we can determine if q is
inside or outside P in time O(log n) by this method.)
We want to solve the following two special cases by a simpler method, avoiding the need to triangulate P (since
Chazelle’s algorithm is a real mess!) and the need to build the Kirkpatrick hierarchy. Show how to do point-in-
polygon queries in time O(log n), using O(n) preprocessing/space, for the case that P is (a). a convex polygon; and
(b). an x-monotone polygon.
(3). [20 points] Given a set S of n points in the plane, give a method of constructing an efficient data structure
that allows one to answer quickly a query of the following form: Is there a point of S within distance r of point
q = (qx , qy )? (The query is specified by giving three numbers: r, qx , qy .)
(4). [35 points] Build the Kirkpatrick point location hierarchy for the triangulation shown below. At each step, when
you identify an independent set, apply Algorithm 7.4 on page 277, breaking ties when you select a node in favor of
the lowest numbered vertex. When you retriangulate a hole, use the simple ear-clipping algorithm (Triangulate,
page 39), starting at the bottommost vertex of the hole (as “v0” in Triangulate, the first one tested for earity),
and proceeding counterclockwise. (Ties (if any) for bottommost should be broken by picking the rightmost among
the bottommost vertices.)
(a). List the independent sets corresponding to each stage of the algorithm. Also, for each stage, draw the
corresponding triangulation.
(b). Draw the final hierarchy as a DAG, with each node of the hierarchy labeled by the triangle to which it
corresponds. (When you label a node, please list the triangle as a triple with the vertex indices in order; e.g., the
triangle with vertices “1”, “8” and “9” should be written as “189” (not as “819” or “918”, etc).)
(c). Highlight in the final hierarchy those nodes that are explored when point location is performed for point p,
as shown in the figure.
1

5 3
p
4

6
8
7

You might also like