

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS 5160/6160: Computational Geometry Feb 19, 2009
DUE DATE: Mar 5, 2009
The slab method for point location described in class uses O(n^2 ) storage. In this assignment, we will investigate how we might reduce storage without changing the query time.
We start by stating (without proof) the existence of a certain data structure. Let r 1 ,... rn be a set of items drawn from an ordered universe R. These items divide R into intervals, where Ii = (ri, ri+1). Associate a weight wi with each interval. Let W =
wi.
Lemma 3.1.1 ([]). For any weighted sequence as described above, there exists a search tree with interior nodes corresponding to the ri’s ( 1 ≤ i ≤ n) and leaves corresponding to the intervals Ii such that for any i, the length of the path from the root to the leaf Ii is 2 + log(W/wi).
The intuition behind this is that items with high weight (you can think of wi/W as the “proba- bility” of accessing i) will appear higher in the tree than items with low weight, so the average query time remains small (this has the flavor of a Huffman code).
We’re now ready to modify the slab algorithm.
n groups, each of size
n. We can use a simple binary search to find which group the point lies in. Within each group, some segments completely intersect it, breaking the slab into trapezoids. Each trapezoid is partially intersected by some other segments; build a slab data structure on each trapezoid, and use a weighted search tree to locate the right trapezoid to consider ( HINT: Choose as weight e^2 j , where ej is the number of segments that intersect a trapezoid. Show that this data structure uses O(n^3 /^2 ) space while requiring a query time of 32 log n. Note the constants! Don’t reduce query time via O() notation.
Given a collection of n axis-parallel rectangles in the plane, construct a data structure that answers queries of the form, “Given a point p, return all rectangles that contain p”. Find the
Assignment 3: Feb 19, 2009 3-
Trapezoids formed within the slab
Segments within a trapezoid
Figure 3.1: A Single Slab
best structure possible; you should use o(n) query time, o(n^2 ) space, and o(n^2 ) preprocessing. Points will be awarded based on the asymptotic quality of the solution.
This is problem 5.13(b) from the textbook.
Let S be a set of n polygons in the plane. Describe a data structure that uses O(n log^3 n) storatge and takes O(log^4 n + k) query time to report all polygons completely contained in the query rectangle, where k the number of reported answers.
This is problem 10.6 from the textbook
Let I be a set of intervals on the real line. We want to be able to count the number of intervals containing a query point in O(log n) time. Specificaly, the query time is independent of the number of segments containing the query point.