Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat...

64
Convex Hull Problem Presented By Erion Lin

Transcript of Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat...

Page 1: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Convex Hull Problem

Presented By Erion Lin

Page 2: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Outline

Convex Hull Problem Voronoi Diagram Fermat Point

Page 3: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Outline

Convex Hull Problem Voronoi DiagramVoronoi Diagram Fermat PointFermat Point

Page 4: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Convex Hull Problem

Definitions Algorithm

Page 5: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Definitions

Page 6: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Concave Polygon

Page 7: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Convex Polygon

Page 8: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Convex Hull

The convex hull of a set of planar points is defined as the smallest convex polygon containing all of the points.

Page 9: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Algorithm

Page 10: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

An algorithm to Construct a Convex Hull

Input : A set S of planar points Output : A Convex hull of S

Page 11: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Initial Points

Page 12: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 13: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 14: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Convex Hulls after Step 3

Page 15: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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 :

Page 16: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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

Page 17: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Graham Scan

Page 18: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 19: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Graham Scan(Cont’d)

Page 20: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Convex Hull

Page 21: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Algorithm Analysis

T(n)=2T(n/2) + O(n) = O(nlogn)

Page 22: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Outline

Convex Hull ProblemConvex Hull Problem Voronoi Diagram Fermat PointFermat Point

Page 23: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Voronoi Diagram

Definitions Algorithms Applications

Page 24: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Definitions

Page 25: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 26: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Voronoi Diagram for Two Points

Page 27: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Voronoi Diagram for Three Points

Page 28: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Voronoi Diagram for Sex Points

Page 29: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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)

Page 30: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Voronoi Polygon

Page 31: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 32: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

A Delaunay Triangulation for Six Points

Page 33: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Algorithms

Page 34: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

An algorithm to Construct Voronoi Diagrams

Input: A Set S on n planar points. Output: The Voronoi Diagram of S

Page 35: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Initial Points

Page 36: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 37: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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).

Page 38: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

Page 39: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Voronoi Diagrams Step 4-1

Page 40: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Voronoi Diagrams Step 4-2

Page 41: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Voronoi Diagrams

Page 42: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Algorithm Analysis

T(n)=2T(n/2) + O(n) = O(nlogn)

Page 43: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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 L RS S S

Page 44: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Initial Voronoi Diagrams

Page 45: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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,

a bP P c dP P

a bP Pc dP P ,x ySG P P

and HP

Page 46: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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.

HP HP BS c dSG P P

x yP P

y zP P

y zP Px zSG P P z ySG P P

Page 47: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Voronoi Diagram after Step 3 、 4

Page 48: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

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 L RS S S

Page 49: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

The Resulting Voronoi Diagram

Page 50: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Applications

Page 51: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Constructing a Convex Hull from a Voronoi Diagram

Page 52: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Time Complexity Analysis

Preprocessing Time : O(nlogn) Constructing Time : O(n)

Page 53: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Euclidean Nearest Neighbor Searching Problem

Definition :We are given a set of n planar points: P1, P2, …Pn and a testing point P. Our problem is to find a nearest neighbor of P among Pi.

Page 54: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Euclidean Nearest Neighbor Searching Problem(Cont’d)

Page 55: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Time Complexity Analysis

Preprocessing Time : O(nlogn) Searching Time : O(logn)

Page 56: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Euclidean All Nearest Neighbor Problem

Definition :The Euclidean all nearest neighbor problem is to find a nearest neighbor of every Pi.

Page 57: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Euclidean All Nearest Neighbor Problem (Cont’d)

and .

This means that

2 2 2

i i i i

i i i i ik j

PN PM PL PN

PP PL PN PM PP

Page 58: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Euclidean All Nearest Neighbor Problem(Cont’d)

Page 59: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Time Complexity Analysis

O(nlogn)

Page 60: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Outline

Convex Hull ProblemConvex Hull Problem Voronoi DiagramVoronoi Diagram Fermat Point

Page 61: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Fermat Point

To find the shortest distance between A 、 B 、 C

Page 62: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Fermat Point (Cont’d)

Prove :

                                                                                                                                                                              

Page 63: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Fermat Point (Cont’d)

                                        

Page 64: Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.

Thanks for Your Listening