840 likes | 1.57k Views
Convex Hull Problem. Presented By Erion Lin. Outline. Convex Hull Problem Voronoi Diagram Fermat Point. Outline. Convex Hull Problem Voronoi Diagram Fermat Point. Convex Hull Problem. Definitions Algorithm . Definitions. Concave Polygon. Convex Polygon. A Convex Hull.
E N D
Convex Hull Problem Presented By Erion Lin
Outline • Convex Hull Problem • Voronoi Diagram • Fermat Point
Outline • Convex Hull Problem • Voronoi Diagram • Fermat Point
Convex Hull Problem • Definitions • Algorithm
A Convex Hull • The convex hull of a set of planar points is defined as the smallest convex polygon containing all of the points.
An algorithm to Construct a Convex Hull • Input:A set S of planar points • Output:A Convex hull of S
An algorithm to Construct a Convex Hull(Cont’d) • Step 1. If S contains no more than five points, use exhaustive searching to find the convex hull and return. • Step 2. Find a median line perpendicular to the x-axis which divides S into SL and SR.
An algorithm to Construct a Convex Hull(Cont’d) • Step 3. Recursively construct convex hulls for SL and SR. Denote these convex hulls by Hull by Hull(SL) and Hull(SR) respectively.
An algorithm to Construct a Convex Hull(Cont’d) • Step 4. Find an interior point P of SL. Find the vertices v1 and v2 of Hull(SR) which divide the vertices of Hull(SR) into two sequences of vertices which have increasing polar angles with respect to P. Without loss of generality, let us assume that v1 has y-value greater than v2. Then form three sequences as follows:
An algorithm to Construct a Convex Hull(Cont’d) (a) Sequence 1: all of the convex hull vertices of Hull(SL) in counterclockwise direction. (b) Sequence 2: the convex hull vertices of Hull(SR) from v2 to v1 in counterclockwise direction. (c) Sequence 3: the convex hull vertices of Hull (SR) from v2 to v1 in clockwise direction
An algorithm to Construct a Convex Hull(Cont’d) • Merge these three sequences and conduct the Graham scan. Eliminate the points which are reflexive and the remaining points from the convex hull.
Algorithm Analysis • T(n)=2T(n/2) + O(n) = O(nlogn)
Outline • Convex Hull Problem • Voronoi Diagram • Fermat Point
Voronoi Diagram • Definitions • Algorithms • Applications
Definitions • The Voronoi diagram is, as the minimal spanning tree, a very interesting data structure, and it can be used to store important information about nearest neighbor of points on a plane.
Definitions(Cont’d) • The Voronoi polygon associated with Pi is a convex polygon region having no more than n-1 sides, defined by V(i)=H(Pi, Pj)
Definitions(Cont’d) • The Delaunay triangulation is a line segment connecting Pi and Pj if and only if the Voronoi polygons of Pi and Pj share the same edge.
An algorithm to Construct Voronoi Diagrams • Input: A Set S on n planar points. • Output: The Voronoi Diagram of S
An algorithm to Construct Voronoi Diagrams(Cont’d) • Step 1. If S contains only one point, return. • Step 2. Find a median line L perpendicular to the x-axis which divides S into SL and SR such that SL(SR) lies to the left(right) of L and the sizes of SL and SR are equal.
An algorithm to Construct Voronoi Diagrams(Cont’d) • Step 3. Construct Voronoi diagrams of SL and SR recursively. Denote these Voronoi diagrams by VD(SL) and VD(SR).
An algorithm to Construct Voronoi Diagrams(Cont’d) • Step 4. Construct a dividing piece-wise linear hyperplane HP which is the locus of points simultaneously closest to a point in SL and a point SR. Discard all segments of VD(SL) which lie to the right of HP and all segments of VD(SR) that lie to the left of HP. The resulting graph is the Voronoi diagram of S.
Algorithm Analysis • T(n)=2T(n/2) + O(n) = O(nlogn)
An algorithm to Merge Two Voronoi Diagrams • Input: (a)SL and SR where SL and SR are divided by a perpendicular line L. (b)VD(SL) and VD(SR). • Output: VD(S) where
An algorithm to Merge Two Voronoi Diagrams(Cont’d) • Step 1. Find the convex hulls of SL and SR. Let them be denoted as Hull(SL) and Hull(SR) respectively. • Step 2. Find segments and which join Hull(SL) and Hull (SR) into a convex hull (Pa and Pc belong to SL and Pb and Pd belong to SR.) Assume that lies above .Let x=a, y=b,
An algorithm to Merge Two Voronoi Diagrams(Cont’d) • Step 3. Find the perpendicular bisector of SG. Denote it by BS. Let . If , Go to Step5; otherwise, Go to Step4. • Step 4. Let BS first intersect with a ray from VD(SL) or VD(SR). This ray must be a perpendicular bisector of either or for some z. If this ray is the perpendicular bisector of , then let ; otherwise, let . Go to Step 3.
An algorithm to Merge Two Voronoi Diagrams(Cont’d) • Step 5. Discard the edges of VD(SL) which extend to the right of HP and discard the edges of VD(SR) which extend to the left of HP. The resulting graph is the Voronoi diagram of