Second Homework Due Date: Friday, March 20th, 2015

advertisement
Bilkent University
Department of Computer Engineering
CS 564 COMPUTATIONAL GEOMETRY
HOMEWORK 2
Instructor: Uğur Güdükbay
Due date: Friday, March 20, 2015, Class Hour.
In doing the assignments, you are on the honour system, meaning that any
submitted assignment is solely the work of the submitter. You are free to discuss
the questions with your friends, but you should submit your own work.
You must use a Word Processor to prepare your answers. Handwritten
homeworks will not be graded.
1) Modify the graph weight balancing algorithm given in the lecture slides so that it
constructs a monotone complete set of chains from the given Planar Straight Line
Graph. You should modify the second pass to construct the monotone complete
set of chains.
2) Let p1 = (x1, y1) and p2 = (x2, y2) be two points in the plane. We say that point p1
dominates point p2 if x1  x2 and y1  y2. Let S be a set of points in the plane. A
point p S is a maximal element if p is not dominated by any other point in S.
Solve the following problem: Given a set of n points in the plane, let k denote the
number of maximal elements in this set. Design a divide-and-conquer algorithm of
time O(n log n) (or better) for finding these maximal elements. Prove the
correctness of your algorithm.
3) Graham’s scan is applied to a set of points in certain order. We used algorithm
Simple Polygon to sort the points in the following way. We started with an
extreme point p (which was guaranteed to be on the hull) and sorted all other
points according to the angles between a fixed line (e.g., the x axis) and the line
segments connecting the points to p. Prove (by showing a counterexample) that
not every point p can be used for this purpose. In other words, show a set of points
S and another point p, not in the set, such that sorting the points relative to p
(using the angles from p to the points in the set) and then applying Graham’s Scan
does not lead to the correct convex hull.
4) A d-approximate convex hull of a set of points P is a convex polygon all of
whose vertices are from P, such that all points are either inside or within distance
d from it. (We define the distance of a point from a polygon as the minimum over
all lengths of line segments connecting the point to anywhere in the polygon.) Let
P be a set of n points such that the maximal difference between the x coordinates
of any two points in P is X. Design an algorithm to compute a d-approximate
convex hull of P, which runs in time and space O(n + X / d).
5) Two disjoint convex polygons P1 and P2 in the plane are given.
a) How many common supporting lines do P1 and P2 have (See the textbook
page 117 for the definition of supporting lines)?
b) Construct the supporting lines by an algorithm based exclusively on the angles
between polygon edges and straight lines through vertices.
6) Given a point p and a vertex v of a convex polygon P in the plane, Give an
algorithm to classify in constant time vertex v with respect to pv (as concave or
supporting or reflex).
7) Referring to the dynamic convex hull maintenance technique (the textbook page
page 124 Section 3.3.7), solve the following problem: Give a Pidgin Algol
program for the function BRIDGE(U1, U2) that produces the support segment of
the two U-hulls U1 and U2.
8) Let S be a set of N points in the plane with integer coordinates between 1 and Nd ,
where d is a constant. Show that the convex hull of S can be obtained in linear
time.
Download