An Introduction to Computational Geometry: Voronoi and Delaunay Diagrams
Joseph S. B. Mitchell Stony Brook University
Chapters 3,4: Devadoss-O’Rourke Voronoi Diagrams
Georgy Voronoi 1868-1908 Historical Origins and Diagrams in Nature
René Descartes 1596-1650 1644: Gravitational Dragonfly wing Influence of stars Giraffe pigmentation
Honeycomb 3 Ack: Streinu&Brock Constrained soap bubbles http://uxblog.idvsolutions.com/2011/07/chalkboard-maps-united-states-of.html Craigslist Map “A geometric pass at delineating areas within the United States potentially covered by each craigslist site -the United States of Craigslist.”
Source: idvsolutions.com
4 Voronoi USA
5 (source: http://www.reddit.com/r/MapPorn/comments/1hi07c/voronoi_map_thiessen_polygons_of_the_usa_based_on/) Voronoi Applications
Voronoi, together with point location search: nearest neighbor queries Facility location: Largest empty disk (centered at a Voronoi vertex) Shape description/approximation: medial axis
[Lecture 12, David Mount 6 notes] Starbucks Post Office Problem Query point Post offices Voronoi Diagram
Partition the plane according to the equivalence classes: V(Q) = { (x,y) : the closest sites of S to (x,y) is exactly the set Q S } • |Q| = 1 Voronoi cells (2-faces) • |Q| = 2 Voronoi edges (1-faces) • |Q| 3 Voronoi vertices (0-faces) Q cocircular
Voronoi cell
of pi is open, convex
8 “cell complex” Example
p p
Voronoi cell of p
9 Delaunay Diagram
Join pi to pj iff there is an “empty circle” A witness to the through pi and pj Delaunayhood of (pi , pj)
If no 4 points cocircular pi (degenerate), then pj Delaunay diagram is a (very special) triangulation.
Equivalent definition: “Dual” of the Voronoi diagram
Applet [Chew] 10
Voronoi/Delaunay
11 Delaunay: An Important, Practical Triangulation Application: Piecewise-linear terrain surface interpolation
12 Terrain Interpolation from Point Sample Data
13 Delaunay: An Important, Practical Triangulation Application: Piecewise-linear terrain surface interpolation
14 Delaunay: An Important, Practical Triangulation Application: Piecewise-linear terrain surface interpolation
15 Delaunay for Terrain Interpolation
16 Voronoi and Delaunay
17 Voronoi and Delaunay
18 Delaunay’s Theorem
19 Delaunay’s Theorem
20 Voronoi and Delaunay Properties
The planar dual of Voronoi, drawn with nodes at the sites, edges straight segments, has no crossing edges [Delaunay]. It is the Delaunay diagram, D(S) (defined by empty circle property). Combinatorial size: 3n-6 Voronoi/Delaunay edges; 2n-5 Voronoi vertices (Delaunay faces) O(n) A Voronoi cell is unbounded iff its site is on the boundary of CH(S) CH(S) = boundary of unbounded face of D(S) Delaunay triangulation lexico-maximizes the angle vector among all triangulations • In particular, maximizes the min angle 21
22 Angle Sequence of a Triangulation
23 Angle Sequence of a Triangulation
24 Legal Edges, Triangulations
25 Edge Flips (Swaps)
26 Geometry of Circles/Triangles
Thale’s Theorem
27 Legal/Illegal Edges
Equivalent:
• alpha2 + alpha6 > pi
• InCircle(pi ,pk ,pj ,pl )
28 Legal/Illegal Edges
29 Algorithm: Legalize Triangulation
30 Example: 4 points
31 Voronoi and Delaunay Properties
In any partition of S, S=B R, into blue/red points, any blue-red pair that is shortest B-R bridge is a Delaunay edge. Corollaries: • D(S) is connected • MST D(S) (MST=“min spanning tree”) • NNG D(S) (NNG=“nearest neighbor graph”)
32 Voronoi and Delaunay Properties
In any partition of S, S=B R, into blue/red points, any blue-red pair that is shortest B-R bridge is a Delaunay edge. • D(S) is connected • MST D(S) (MST=“min spanning tree”) • NNG D(S) (NNG=“nearest neighbor graph”) Voronoi/Delaunay can be built in time O(n log n) • Divide and conquer • Sweep • Randomized incremental VoroGlide applet
33 Nearest Neighbor Graph: NNG Directed graph NNG(S):
34 Minimum Spanning Tree; MST
Greedy algorithms: • Prim: grows a tree • Kruskal: grows a forest: O(e log v)
35 Euclidean MST
One way to compute: Apply Prim or Kruskal to the complete graph, with edges weighted by their Euclidean lengths: O(n2 log n) Better: Exploit the fact that MST is a subgraph of the Delaunay (which has size O(n)): • Apply Prim/Kruskal to the Delaunay: O(n log n), since e = O(n)
36 Euclidean MST
37 Traveling Salesperson Problem: TSP 39 Approximation Algorithms PTAS for Geometric TSP Voronoi Applet
VoroGlide applet
42 Voronoi and Delaunay: 1D
Easy: Just sort the sites along the line Delaunay is a path Voronoi is a partition of the line into intervals
Time: O(n log n) Lower bound: (n log n), since the Delaunay gives the sorted order of the input points,
{x1 , x2 , x3 ,…} 43 Voronoi and Delaunay: 2D Algorithms Naïve O(n2 log n) algorithm: Build Voronoi cells one by one, solving n halfplane intersection problems (each in O(n log n), using divide-and-conquer) Incremental: worst-case O(n2) Divide and conquer (first O(n log n)) Lawson Edge Swap (“Legalize”): Delaunay Randomized Incremental (expected O(n log n)) Sweep [Fortune] Any algorithm that computes CH in R3 , 44 e.g., QHull Qhull website
45 Delaunay: Edge Flip Algorithm Lawson Edge Swap “Legalize” [BKOS] Assume: No 4 co-circular points, for simplicity. Start with any triangulation d Keep a list (stack) of “illegal” edges: b • ab is illegal if InCircle(a,c,b,d) Locally non-Delauany • iff the smallest of the 6 angles goes up if flip a c Flip any illegal edge; update legality status of neighboring edges Continue until no illegal edges Theorem: A triangulation is Delaunay iff there are no illegal edges (i.e., it is “locally Delaunay”) Only O(n2 ) flips needed.
46 Connection to Convex Hulls in 3D
Delaunay diagram lower convex hull of 2 2 the lifted sites, (xi , yi , xi +yi ), on the paraboloid of revolution, z=x2 + y2 Upper hull “furthest site Delaunay” 3D CH applet
47
48
49 Delaunay in 2D is Convex Hull in 3D
50 Delaunay in 2D is Convex Hull in 3D
51 Voronoi and Delaunay
Algorithms: • Straightforward incremental: O(n2 ) • Divide and conquer (first O(n log n)) • Sweep • Randomized incremental • Any algorithm that computes CH in R3 , e.g., QHull Qhull website
52 Straightforward Incremental Algorithm: Voronoi
53 Straightforward Incremental Algorithm: Voronoi
54 Fortune’s Sweep Algorithm
AMS 545 / CSE 555 55
Applet Ack: Guibas&Stolfi Parabolic Front
AMS 545 / CSE 555 56
Applet Ack: Guibas&Stolfi Site Events
a) b) c)
AMS 545 / CSE 555 57 Applet Ack: Guibas&Stolfi Circle Events
AMS 545 / CSE 555 58
Applet Ack: Guibas&Stolfi Scheduling Circle Events
AMS 545 / CSE 555
59
Applet Ack: Guibas&Stolfi 60 61 Incremental Construction
Add sites one by one, modifying the Delaunay (Voronoi) as we go:
• Join vi to 3 corners of triangle containing it • Do edge flips to restore local Delaunayhood If added in random order, simple “Backwards analysis” shows expected time O(n log n) [Guibas, Knuth, Sharir] AMS 545 / CSE 555 62 Example
CS691G Computational Geometry - UMass 63 Amherst Voronoi Extensions
Numerous ! [see Okabe, Boots, Sugihara, Chiu] Different metrics Higher dimensions: • Delaunay in Rd lower CH in Rd+1 • O( n log n + n (d+1)/2 ) Order-k, furthest-site Other sites: Voronoi of polygons, “medial axis” Additive/multiplicative weights; power diagram -shapes: a powerful shape representation 64 GeoMagic, biogeometry at Duke Furthest Site Voronoi
65 Medial Axis: Convex Polygon
66 Medial Axis: Convex Polygon
67 Medial Axis: Nonconvex Polygon
68 Medial Axis: Curved Domain
70 VRONI: Fast, robust Voronoi of polygonal domains
Incremental algorithm 71 72 Computing offsets with a Voronoi diagram
73 Alpha Shapes, Hulls
“Erase” with a ball of radius to get -shape. Straighten edges to get -hull
74 75 -Shapes
Theorem: For each Delaunay edge,
e=(pi,pj), there exists min(e)>0 and max(e)>0 such that e -shape of S iff min(e) max(e). Thus, every alpha-hull edge is in the Delaunay, and every Delaunay edge is in some alpha-shape.
Applet