CS133
Computational Geometry
Voronoi Diagram Delaunay Triangulation
1
CS133 Computational Geometry Voronoi Diagram Delaunay - - PowerPoint PPT Presentation
CS133 Computational Geometry Voronoi Diagram Delaunay Triangulation 1 Nearest Neighbor Problem Given a set of points and a query point , find the closest point to , , ,
1
2
3
Voronoi Diagram
4
5
6
7
π1 π2 π π1 π π2
8
π1 π2 π π1 π π2 π3 π π3
9
π1 π2 π π1 π π2 π3 π π3
10
11
http://forum.woodenboat.com/showthread.php?112363-Voronoi-Diagrams-in-Nature
http://forum.woodenboat.com/showthread.php?112363-Voronoi-Diagrams-in-Nature
Onion cells under the microscope
http://forum.woodenboat.com/showthread.php?112363-Voronoi-Diagrams-in-Nature
A thin slice of carrot under the scope
http://forum.woodenboat.com/showthread.php?112363-Voronoi-Diagrams-in-Nature
A dead maple leaf at 160X
http://forum.woodenboat.com/showthread.php?112363-Voronoi-Diagrams-in-Nature
An oak leaf
19
20
21
The edges of πΈ π do not intersect Is πΈ π unique?
Yes, if no four sites are co-circular
If ππ and ππ are the closest pair
If ππ and ππ are nearest neighbors, they are connected with an edge in DT The circumcircle of ππ, ππ, and ππ is empty βΊ ππ, ππ, ππ is a triangle in DT
22
The number of edges/faces in a Delaunay Triangulation is linear in the number of vertices. The number of edges/vertices in a Voronoi Diagram is linear in the number of faces. The number of vertices/edges/faces in a Voronoi Diagram is linear in the number of sites.
23
24
ππ€: Number of vertices (nodes) ππ: Number of edges (arcs) ππ: Number of faces
25
3 ππ
3 ππ 1 3 ππ β€ π β 2
26
27
ππ ππ π ππ π ππ
28
ππ ππ π ππ π ππ
29
ππ ππ π ππ π ππ
30
ππ ππ π ππ π ππ
31
ππ ππ π ππ π ππ
β
32
33
34
π§ = 1 2 π¦ β πππ¦ 2 πππ§ β βπ§ + βπ§ + πππ§
πππ¦, πππ§ βπ§
35
36
37
38
This area is closer to some site than the beach line β¦ closer to some site than any future site We already know the nearest site to those areas
39
Each parabola is π¦-monotone At each π¦-coordinate, the beach line takes one value which is the minimum of all the parabolas Therefore, it is π¦-monotone
40
Figure Credits: http://www.cs.sfu.ca/~binay/813.2011/Fortune.pdf
Each breakpoint is equidistant from two sites A breakpoint is as close to some site as to the sweep line The sweep line is (closer) to the blue sites than future sites
41
42
A new arc appears An existing arc is removed
43
44
45
Lemma: The only way in which a new arc can appear on the beach line is through a site event Proof by contradiction
Case 1: An existing arc πΎπ breaks through the middle of an existing arc πΎπ Case 2: An existing arc πΎπ appears in between two arcs
Proof is in the book
An existing arc shrinks into a point and disappears This happens when three (or more) sites become closer to a point than the sweep line shielding the point from the sweep line
46
The sweep line will only go further down while the points stay This results in a vertex on the Voronoi Diagram Lemma: The only way in which an existing arc can disappear from the beach line is through a circle event
47
48
Circle event
Site event: A new site that adds a new arc to the
Circle event: The disappearance of an arc resulting in a vertex in VD. Can only be discovered along the way
49
Leaves store arcs Internal nodes store the breakpoints as a pair of sites ππ, ππ
50
51
π1 π2 π3 π½1 π½2 π½3
π1, π2 π1, π2 π2, π3 π2, π3 π1 π2 π3
52
53
54
π1 π2 π3 π½1 π½2 π½3
π1, π2 π1, π2 π2, π3 π2, π3 π1 π2 π3
π4
55
π1 π2 π3 π½1 π½2 π½3
π1, π2 π1, π2 π2, π3 π2, π3 π1 π2 π3
π4
π4, π2 π2, π4
56
π1 π2 π3 π½1 π½2 π½3
π1, π2 π1, π2 π2, π3 π2, π3 π1 π3
π4
π4, π2 π2, π4 π2, π4 π4, π2 π4 π2 π2
57
π1 π2 π3 π½1 π½2 π½3
π1, π2 π1, π2 π2, π3 π2, π3 π1 π3
π4
π4, π2 π2, π4 π2, π4 π4, π2 π4 π2 π2 π½1π½2π½3 are no longer adjacent β Remove the circle event that corresponds to π½2 π½1π½2π½4 are now adjacent β Create a new circle event for them Similarly, create a circle event for π½4π½2π½3 No circle event for the triple π½2π½4π½2 because they donβt correspond tot three different sites
π¦π, π§π are the coordinates of the circle center and π is the circle radius
58
59
60
π1 π2 π3 π½1 π½2 π½3
π1, π2 π2, π3 Circle event point π1, π2 π2, π3 π1 π2 π3
π4
π
π½4
π3, π4 π3, π4 π4
61
π1 π2 π3 π½1 π½2 π½3
π1, π2 π2, π3 Circle event point π1, π2 π2, π3 π1 π2 π3
π4
π
π½4
π3, π4 π3, π4 π4
62
π1 π2 π3 π½1 π½2 π½3
π1, π2 π2, π3 Circle event point π1, π3 π1 π3
π4
π
π½4
π3, π4 π3, π4 π4 (π1, π3, π4) are now adjacent in the tree, create a corresponding circle event
63
Consider all possible triangles π π3
Check if the circumcircle of the triangle is empty π π
Running time π π4
64
65
If (|P| <= 3)
return TrivialDT(P)
Split P into P1 and P2 DT1 = DelaunayTriangulation(P1) DT2 = DelaunayTriangulation(P1) Merge(DT1, DT2)
66
67
Pre-sort by x
68
P TrivialDT(P)
69
70
71
72
73
Upper tangent of πβ π
1 , πβ π2 Base LR edge
74
75
76
77
New Base LR edge
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
ππ ππ
118
ππ ππ
119
ππ ππ
120
ππ ππ
121
ππ ππ
122
123
124
125
126
127
π½1 π½2 π½3 π½4 π½5 π½6
1β€πβ€6 π½π < min 1β€πβ€6 π½π β²
128
π½1 π½2 π½3 π½4 π½5 π½6 ππ ππ ππ ππ π½1
β²
π½2
β²
π½3
β²
π½4
β²
π½5
β²
π½6
β²
ππ ππ ππ ππ Edge Flip
129
π π π π π π‘ π·
130
ππ ππ ππ ππ Illegal Edge
131
132
133
134
135
136
137
πβ1 πβ2
138
139
140
141
142
143
144
145