We say that two points u, v Y ae in the same connected component of Y if thee is a path in R N fom u to v such that all the points along the path ae in the set Y. (Thee ae two connected components in the figue.) We will make use of the following fundamental esult on algebaic decision tees, due to Ben-O. Intuitively, it states that if you set has M connected components, then thee must be at least M leaves in any decision tee fo the set, and the tee must have height at least the logaithm of the numbe of leaves. Theoem: Let Y R N be any set and let T be any d-th ode algebaic decision tee that detemines membeship in W.IfW has M disjoint connected components, then T must have height at least Ω((log M) N). We will begin ou poof with a simple poblem. Multiset Size Veification Poblem (MSV): Given a multiset of n eal numbes and an intege k, confim that the multiset has exactly k distinct elements. Lemma: The MSV poblem equies Ω(n log k) steps in the wost case in the d-th ode algebaic decision tee Poof: In tems of points in R n, the set of points fo which the answe is yes is Y = {(z 1,z 2,...,z n ) R n {z 1,z 2,...,z n } = k}. It suffices to show that thee ae at least k!k n k diffeent connected components in this set, because by Ben-O s esult it would follow that the time to test membeship in Y would be Ω(log(k!k n k ) n) = Ω(k log k +(n k)logk n) = Ω(n log k). Conside the all the tuples (z 1,...,z n ) with z 1,...z k set to the distinct integes fom 1 to k, and z k+1...z n each set to an abitay intege in the same ange. Clealy thee ae k! ways to select the fist k elements and k n k ways to select the emaining elements. Each such tuple has exactly k distinct items, but it is not had to see that if we attempt to continuously modify one of these tuples to equal anothe one, we must change the numbe of distinct elements, implying that each of these tuples is in a diffeent connected component of Y. To finish the lowe bound poof, we ague that any instance of MSV can be educed to the convex hull size veification poblem (CHSV). Thus any lowe bound fo MSV poblem applies to CHSV as well. Theoem: The CHSV poblem equies Ω(n log h) time to solve. Poof: Let Z =(z 1,...,z n ) and k be an instance of the MSV poblem. We ceate a point set {p 1,...,p n } in the plane whee p i =(z i,zi 2 ), and set h = k. (Obseve that the points lie on a paabola, so that all the points ae on the convex hull.) Now, if the multiset Z has exactly k distinct elements, then thee ae exactly h = k points in the point set (since the othes ae all duplicates of these) and so thee ae exactly h points on the hull. Convesely, if thee ae h points on the convex hull, then thee wee exactly h = k distinct numbes in the multiset to begin with in Z. Thus, we cannot solve CHSV any faste than Ω(n log h) time, fo othewise we could solve MSV in the same time. The poof is athe unsatisfying, because it elies on the fact that thee ae many duplicate points. You might wonde, does the lowe bound still hold if thee ae no duplicates? Kikpatic and Seidel actually pove a stonge (but hade) esult that the Ω(n log h) lowe bound holds even you assume that the points ae distinct. Lectue 27: Voonoi Diagams Reading: O Rouke, Chapt 5, Mulmuley, Sect. 2.8.4. Lectue Notes 110 CMSC 754
Plana Voonoi Diagams: Recall that, given n points P = {p 1,p 2,...,p n } in the plane, the Voonoi polygon of a point p i, V (p i ), is defined to be the set of all points q in the plane fo which p i is among the closest points to q in P. That is, V (p i )={q : p i q p j q, j i}. The union of the boundaies of the Voonoi polygons is called the Voonoi diagam of P, denoted VD(P ). The dual of the Voonoi diagam is a tiangulation of the point set, called the Delaunay tiangulation. Recall fom ou discussion of quad-edge data stuctue, that given a good epesentation of any plana gaph, the dual is easy to constuct. Hence, it suffices to show how to compute eithe one of these stuctues, fom which the othe can be deived easily in O(n) time. Thee ae fou faily well-known algoithms fo computing Voonoi diagams and Delaunay tiangulations in the plane. They ae Divide-and-Conque: (Fo both VD and DT.) The fist O(n log n) algoithm fo this poblem. Not widely used because it is somewhat had to implement. Can be genealized to highe dimensions with some difficulty. Can be genealized to computing Vonoi diagams of line segments with some difficulty. Randomized Incemental: (Fo DT and VD.) The simplest. O(n log n) time with high pobability. Can be genealized to highe dimensions as with the andomized algoithm fo convex hulls. Can be genealized to computing Voonoi diagams of line segments faily easily. Fotune s Plane Sweep: (Fo VD.) A vey cleve and faily simple algoithm. It computes a defomed Voonoi diagam by plane sweep in O(n log n) time, fom which the tue diagam can be extacted easily. Can be genealized to computing Voonoi diagams of line segments faily easily. Reduction to convex hulls: (Fo DT.) Computing a Delaunay tiangulation of n points in dimension d can be educed to computing a convex hull of n points in dimension d +1. Use you favoite convex hull algoithm. Unclea how to genealize to compute Voonoi diagams of line segments. We will cove all of these appoaches, except Fotune s algoithm. O Rouke does not give detailed explanations of any of these algoithms, but he does discuss the idea behind Fotune s algoithm. Today we will discuss the divide-and-conque algoithm. This algoithm is pesented in Mulmuley, Section 2.8.4. Divide-and-conque algoithm: The divide-and-conque appoach woks like most standad geometic divide-andconque algoithms. We split the points accoding to x-coodinates into 2 oughly equal sized goups (e.g. by pesoting the points by x-coodinate and selecting medians). We compute the Voonoi diagam of the left side, and the Voonoi diagam of the ight side. Note that since each diagam alone coves the entie plane, these two diagams ovelap. We then mege the esulting diagams into a single diagam. The meging step is whee all the wok is done. Obseve that evey point in the the plane lies within two Voonoi polygons, one in VD(L) and one in VD(R). We need to esolve this ovelap, by sepaating ovelapping polygons. Let V (l 0 ) be the Voonoi polygon fo a point fom the left side, and let V ( 0 ) be the Voonoi polygon fo a point on the ight side, and suppose these polygons ovelap one anothe. Obseve that if we inset the bisecto between l 0 and 0, and though away the potions of the polygons that lie on the wong side of the bisecto, we esolve the ovelap. If we do this fo evey pai of ovelapping Voonoi polygons, we get the final Voonoi diagam. This is illustated in the figue below. The union of these bisectos that sepaate the left Voonoi diagam fom the ight Voonoi diagam is called the contou. A point is on the contou if and only if it is equidistant fom 2 points in S, one in L and one in R. (0) Pesot the points by x-coodinate (this is done once). (1) Split the point set S by a vetical line into two subsets L and R of oughly equal size. (2) Compute VD(L) and VD(R) ecusively. (These diagams ovelap one anothe.) (3) Mege the two diagams into a single diagam, by computing the contou and discading the potion of the VD(L) that is to the ight of the contou, and the potion of VD(R) that is to the left of the contou. Lectue Notes 111 CMSC 754
Left/Right Diagams and Contou Final Voonoi Diagam Figue 96: Meging Voonoi diagams. Lectue Notes 112 CMSC 754
Assuming we can implement step (3) in O(n) time (whee n is the size of the emaining point set) then the unning time will be defined by the familia ecuence which we know solves to O(n log n). T (n) =2T (n/2) + n, Computing the contou: What makes the divide-and-conque algoithm somewhat ticky is the task of computing the contou. Befoe giving an algoithm to compute the contou, let us make some obsevations about its geomtetic stuctue. Let us make the usual simplifying assumptions that no 4 points ae cocicula. Lemma: The contou consists of a single polygonal cuve (whose fist and last edges ae semiinfinite) which is monotone with espect to the y-axis. Poof: A detailed poof is a eal hassle. Hee ae the main ideas, though. The contou sepaates the plane into two egions, those points whose neaest neighbo lies in L fom those points whose neaest neighbo lies in R. Because the contou locally consists of points that ae equidistant fom 2 points, it is fomed fom pieces that ae pependicula bisectos, with one point fom L and the othe point fom R. Thus, it is a piecewise polygonal cuve. Because no 4 points ae cocicula, it follows that all vetices in the Voonoi diagam can have degee at most 3. Howeve, because the contou sepaates the plane into only 2 types of egions, it can contain only vetices of degee 2. Thus it can consist only of the disjoint union of closed cuves (actually this neve happens, as we will see) and unbounded cuves. Obseve that if we oient the contou counteclockwise with espect to each point in R (clockwise with espect to each point in L), then each segment must be diected in the y diections, because L and R ae sepaated by a vetical line. Thus, the contou contains no hoizontal cusps. This implies that the contou cannot contain any closed cuves, and hence contains only vetically monotone unbounded cuves. Also, this oientability also implies that thee is only one such cuve. Lemma: The topmost (bottommost) edge of the contou is the pependicula bisecto fo the two points foming the uppe (lowe) tangent of the left hull and the ight hull. Poof: This follows fom the fact that the vetices of the hull coespond to unbounded Voonoi polygons, and hence uppe and lowe tangents coespond to unbounded edges of the contou. These last two theoem suggest the geneal appoach. We stat by computing the uppe tangent, which we know can be done in linea time (once we know the left and ight hulls, o by pune and seach). Then, we stat tacing the contou fom top to bottom. When we ae in Voonoi polygons V (l 0 ) and V ( 0 ) we tace the bisecto between l 0 and 0 in the negative y-diection until its fist contact with the boundaies of one of these polygons. Suppose that we hit the bounday of V (l 0 ) fist. Assuming that we use a good data stuctue fo the Voonoi diagam (e.g. quad-edge data stuctue) we can detemine the point l 1 lying on the othe side of this edge in the left Voonoi diagam. We continue following the contou by tacing the bisecto of l 1 and 0. Howeve, in ode to insue efficiency, we must be caeful in how we detemine whee the bisecto hits the edge of the polygon. Conside the figue shown below. We stat tacing the contou between l 0 and 0. By walking along the bounday of V (l 0 ) we can detemine the edge that the contou would hit fist. This can be done in time popotional to the numbe of edges in V (l 0 ) (which can be as lage as O(n)). Howeve, we discove that befoe the contou hits the bounday of V (l 0 ) it hits the bounday of V ( 0 ). We find the new point 1 and now tace the bisecto between l 0 and 1. Again we can compute the intesection with the bounday of V (l 0 ) in time popotional to its size. Howeve the contou hits the bounday of V ( 1 ) fist, and so we go on to 2. As can be seen, if we ae not smat, we can escan the bounday of V (l 0 ) ove and ove again, until the contou finally hits the bounday. If we do this O(n) times, and the bounday of V (l 0 ) is O(n), then we ae stuck with O(n 2 ) time to tace the contou. We have to avoid this epeated escanning. Howeve, thee is a way to scan the bounday of each Voonoi polygon at most once. Obseve that as we walk along the contou, each time we stay in the same polygon V (l 0 ), we ae adding anothe edge onto its Voonoi polygon. Because the Voonoi polygon is convex, we know Lectue Notes 113 CMSC 754
Contou 0 l 0 1 2 Figue 97: Tacing the contou. that the edges we ae ceating tun consistently in the same diection (clockwise fo points on the left, and counteclockwise fo points on the ight). To test fo intesections between the contou and the cuent Voonoi polygon, we tace the bounday of the polygon clockwise fo polygons on the left side, and counteclockwise fo polygons on the ight side. Wheneve the contou changes diection, we continue the scan fom the point that we left off. In this way, we know that we will neve need to escan the same edge of any Voonoi polygon moe than once. Lectue 28: Delaunay Tiangulations and Convex Hulls Reading: O Rouke 5.7 and 5.8. Delaunay Tiangulations and Convex Hulls: At fist, Delaunay tiangulations and convex hulls appea to be quite diffeent stuctues, one is based on metic popeties (distances) and the othe on affine popeties (collineaity, coplanaity). Today we show that it is possible to convet the poblem of computing a Delaunay tiangulation in dimension d to that of computing a convex hull in dimension d +1. Thus, thee is a emakable elationship between these two stuctues. We will demonstate the connection in dimension 2 (by computing a convex hull in dimension 3). Some of this may be had to visualize, but see O Rouke fo illustations. (You can also eason by analogy in one lowe dimension of Delaunay tiangulations in 1-d and convex hulls in 2-d, but the eal complexities of the stuctues ae not eally appaent in this case.) The connection between the two stuctues is the paaboloid z = x 2 + y 2. Obseve that this equation defines a suface whose vetical coss sections (constant x o constant y) ae paabolas, and whose hoizontal coss sections (constant z) ae cicles. Fo each point in the plane, (x, y), the vetical pojection of this point onto this paaboloid is (x, y, x 2 + y 2 ) in 3-space. Given a set of points S in the plane, let S denote the pojection of evey point in S onto this paaboloid. Conside the lowe convex hull of S. This is the potion of the convex hull of S which is visible to a viewe standing at z =. We claim that if we take the lowe convex hull of S, and poject it back onto the plane, then we get the Delaunay tiangulation of S. In paticula, let p, q, S, and let p, q, denote the pojections of these points onto the paaboloid. Then p q define a face of the lowe convex hull of S if and only if pq is a tiangle of the Delaunay tiangulation of S. The pocess is illustated in the following figue. The question is, why does this wok? To see why, we need to establish the connection between the tiangles of the Delaunay tiangulation and the faces of the convex hull of tansfomed points. In paticula, ecall that Delaunay condition: Thee points p, q, S fom a Delaunay tiangle if and only if the cicumcicle of these points contains no othe point of S. Convex hull condition: Thee points p,q, S fom a face of the convex hull of S if and only if the plane passing though p, q, and has all the points of S lying to one side. Lectue Notes 114 CMSC 754