Upload
victoria-dixon
View
225
Download
3
Tags:
Embed Size (px)
Citation preview
An Introduction to An Introduction to Computational Geometry:Computational Geometry:
Voronoi and Delaunay DiagramsVoronoi and Delaunay Diagrams
Joseph S. B. MitchellStony Brook University
Chapters 3,4: Devadoss-O’Rourke
Voronoi DiagramsVoronoi Diagrams
Georgy Voronoi1868-1908
Historical Origins and Diagrams in Historical Origins and Diagrams in NatureNature
33
René Descartes1596-1650 1644: GravitationalInfluence of stars
Dragonfly wing
Honeycomb
Constrained soap bubbles
Giraffe pigmentation
Ack: Streinu&Brock
Craigslist MapCraigslist Map
44
“A geometric pass at delineating areas within the United States potentially covered by each craigslist site -the United States of Craigslist.”
Source: idvsolutions.com
http://uxblog.idvsolutions.com/2011/07/chalkboard-maps-united-states-of.html
Voronoi USAVoronoi USA
55(source: http://www.reddit.com/r/MapPorn/comments/1hi07c/voronoi_map_thiessen_polygons_of_the_usa_based_on/)
Voronoi ApplicationsVoronoi Applications
Voronoi, together with point location Voronoi, together with point location search: nearest neighbor queriessearch: nearest neighbor queries
Facility location: Largest empty disk Facility location: Largest empty disk (centered at a Voronoi vertex)(centered at a Voronoi vertex)
Shape description/approximation: Shape description/approximation: medial axismedial axis
66[Lecture 12, David Mount notes]
Post Office ProblemPost Office ProblemPost officesQuery point
Starbucks
Voronoi DiagramVoronoi Diagram
Partition the plane according to the Partition the plane according to the equivalence classes: equivalence classes: V(Q) = { (x,y) : the V(Q) = { (x,y) : the closest sites of S to (x,y) is exactly the set closest sites of S to (x,y) is exactly the set Q Q S } S }• ||QQ| = 1 Voronoi cells (2-faces)| = 1 Voronoi cells (2-faces)• ||QQ| = 2 Voronoi edges (1-faces)| = 2 Voronoi edges (1-faces)• ||QQ| | 3 Voronoi vertices (0-faces) 3 Voronoi vertices (0-faces)
88
Q cocircular
Voronoi cell of pi is open, convex
“cell complex”
ExampleExample
99
Voronoi cell of p
pp
Join Join ppii to to ppjj iff there is an “empty circle” iff there is an “empty circle” through through ppii and and ppjj
Equivalent definition: “Dual” of the Equivalent definition: “Dual” of the Voronoi diagramVoronoi diagram
Applet [Chew] [Chew]
Delaunay DiagramDelaunay Diagram
1010
pi
pj
A witness to the Delaunayhood of (pi , pj)
If no 4 points cocircular (degenerate), then Delaunay diagram is a (very special) triangulation.
Voronoi/DelaunayVoronoi/Delaunay
1111
Delaunay: An Important, Delaunay: An Important, Practical TriangulationPractical Triangulation
Application: Piecewise-linear terrain Application: Piecewise-linear terrain surface interpolationsurface interpolation
1212
Terrain Interpolation from Terrain Interpolation from Point Sample DataPoint Sample Data
1313
Delaunay: An Important, Delaunay: An Important, Practical TriangulationPractical Triangulation
Application: Piecewise-linear terrain Application: Piecewise-linear terrain surface interpolationsurface interpolation
1414
Delaunay: An Important, Delaunay: An Important, Practical TriangulationPractical Triangulation
Application: Piecewise-linear terrain Application: Piecewise-linear terrain surface interpolationsurface interpolation
1515
Delaunay for Terrain Delaunay for Terrain InterpolationInterpolation
1616
Voronoi and DelaunayVoronoi and Delaunay
1717
Voronoi and DelaunayVoronoi and Delaunay
1818
Delaunay’s TheoremDelaunay’s Theorem
1919
Delaunay’s TheoremDelaunay’s Theorem
2020
Voronoi and Delaunay Voronoi and Delaunay PropertiesProperties
The planar dual of Voronoi, drawn with nodes at the The planar dual of Voronoi, drawn with nodes at the sites, edges straight segments, has no crossing sites, edges straight segments, has no crossing edges edges [Delaunay]. [Delaunay]. It is the Delaunay diagram, It is the Delaunay diagram, DD((SS) ) (defined by empty circle property).(defined by empty circle property).
Combinatorial size: Combinatorial size: 3 3nn-6 Voronoi/Delaunay edges; -6 Voronoi/Delaunay edges; 2 2nn-5 Voronoi vertices (Delaunay faces) -5 Voronoi vertices (Delaunay faces) O(O(nn))
A Voronoi cell is unbounded iff its site is on the A Voronoi cell is unbounded iff its site is on the boundary of CH(boundary of CH(SS))
CH(CH(SS) = boundary of unbounded face of ) = boundary of unbounded face of DD((SS)) Delaunay triangulation lexico-maximizes the angle Delaunay triangulation lexico-maximizes the angle
vector among all triangulationsvector among all triangulations• In particular, maximizes the min angleIn particular, maximizes the min angle
2121
2222
Angle Sequence of a Angle Sequence of a TriangulationTriangulation
2323
Angle Sequence of a Angle Sequence of a TriangulationTriangulation
2424
Legal Edges, TriangulationsLegal Edges, Triangulations
2525
Edge Flips (Swaps)Edge Flips (Swaps)
2626
Geometry of Geometry of Circles/TrianglesCircles/Triangles
Thale’s TheoremThale’s Theorem
2727
Legal/Illegal EdgesLegal/Illegal Edges
Equivalent:Equivalent:• alphaalpha22 + alpha + alpha66 > pi > pi
• InCircle(pInCircle(pii ,p ,pkk ,p ,pjj ,p ,pll ) )
2828
Legal/Illegal EdgesLegal/Illegal Edges
2929
Algorithm: Legalize Algorithm: Legalize TriangulationTriangulation
3030
Example: 4 pointsExample: 4 points
3131
Voronoi and Delaunay Voronoi and Delaunay PropertiesProperties
In any partition of In any partition of SS, , S=B S=B RR, into blue/red , into blue/red points, any blue-red pair that is shortest points, any blue-red pair that is shortest BB--RR bridge is a Delaunay edge.bridge is a Delaunay edge.
Corollaries:Corollaries:• DD((SS) is connected) is connected• MST MST D D((SS) ) (MST=“min spanning tree”)(MST=“min spanning tree”)
• NNG NNG D D((SS) ) (NNG=“nearest neighbor graph”)(NNG=“nearest neighbor graph”)
3232
Voronoi and Delaunay Voronoi and Delaunay PropertiesProperties
In any partition of In any partition of SS, , S=B S=B RR, into blue/red , into blue/red points, any blue-red pair that is shortest points, any blue-red pair that is shortest BB--RR bridge is a Delaunay edge.bridge is a Delaunay edge.• DD((SS) is connected) is connected• MST MST D D((SS) ) (MST=“min spanning tree”)(MST=“min spanning tree”)
• NNG NNG D D((SS) ) (NNG=“nearest neighbor graph”)(NNG=“nearest neighbor graph”)
Voronoi/Delaunay can be built in time O(Voronoi/Delaunay can be built in time O(n log nn log n))• Divide and conquerDivide and conquer• SweepSweep• Randomized incrementalRandomized incremental
VoroGlide VoroGlide applet
3333
Nearest Neighbor Graph: Nearest Neighbor Graph: NNGNNG
Directed graph NNG(S):Directed graph NNG(S):
3434
Minimum Spanning Tree; Minimum Spanning Tree; MSTMST
Greedy algorithms: Greedy algorithms: • Prim: grows a treePrim: grows a tree• Kruskal: grows a forest: O(e log v)Kruskal: grows a forest: O(e log v)
3535
Euclidean MSTEuclidean MST
One way to compute: Apply Prim or One way to compute: Apply Prim or Kruskal to the complete graph, with Kruskal to the complete graph, with edges weighted by their Euclidean edges weighted by their Euclidean lengths: O(nlengths: O(n22 log n) log n)
Better: Exploit the fact that MST is a Better: Exploit the fact that MST is a subgraph of the Delaunay (which has subgraph of the Delaunay (which has size O(n)):size O(n)):• Apply Prim/Kruskal to the Delaunay: Apply Prim/Kruskal to the Delaunay:
O(n log n), since e = O(n)O(n log n), since e = O(n)3636
Euclidean MSTEuclidean MST
3737
Traveling Salesperson Traveling Salesperson Problem: TSPProblem: TSP
3939
Approximation AlgorithmsApproximation Algorithms
PTAS for Geometric TSPPTAS for Geometric TSP
Voronoi AppletVoronoi Applet VoroGlide VoroGlide applet
4242
Voronoi and Delaunay: 1DVoronoi and Delaunay: 1D
Easy: Just sort the sites along the lineEasy: Just sort the sites along the line
Delaunay is a pathDelaunay is a path
Voronoi is a partition of the line into Voronoi is a partition of the line into intervalsintervals
Time: O(n log n)Time: O(n log n)
Lower bound: Lower bound: (n log n), since the Delaunay (n log n), since the Delaunay gives the sorted order of the input points, gives the sorted order of the input points, {x{x11 , x , x22 , x , x33 ,…} ,…}
4343
Voronoi and Delaunay: 2D Voronoi and Delaunay: 2D AlgorithmsAlgorithms
Naïve O(nNaïve O(n22 log n) algorithm: log n) algorithm: Build Voronoi cells one Build Voronoi cells one by one, solving n halfplane intersection problems (each in O(n by one, solving n halfplane intersection problems (each in O(n log n), using divide-and-conquer) log n), using divide-and-conquer)
Incremental: worst-case O(nIncremental: worst-case O(n22)) Divide and conquer (first O(Divide and conquer (first O(n log nn log n)))) Lawson Edge Swap (“Legalize”): DelaunayLawson Edge Swap (“Legalize”): Delaunay Randomized Incremental Randomized Incremental (expected O(n log n))(expected O(n log n)) Sweep [Fortune]Sweep [Fortune] Any algorithm that computes CH in Any algorithm that computes CH in RR3 3 , , e.g., e.g.,
QHullQHull4444
Qhull website
4545
Delaunay: Edge Flip AlgorithmDelaunay: Edge Flip Algorithm Assume: No 4 co-circular points, for simplicity.Assume: No 4 co-circular points, for simplicity. Start with any triangulationStart with any triangulation Keep a list (stack) of “illegal” edges:Keep a list (stack) of “illegal” edges:
• abab is is illegalillegal if InCircle( if InCircle(a,c,b,da,c,b,d))• iff the smallest of the 6 angles goes up if flipiff the smallest of the 6 angles goes up if flip
Flip any illegal edge; update legality status of Flip any illegal edge; update legality status of neighboring edgesneighboring edges
Continue until no illegal edgesContinue until no illegal edges TheoremTheorem: A triangulation is Delaunay iff there : A triangulation is Delaunay iff there
are no illegal edges (i.e., it is “locally Delaunay”)are no illegal edges (i.e., it is “locally Delaunay”) Only O(Only O(nn22 ) flips needed.) flips needed.
4646
Lawson Edge Swap“Legalize” [BKOS]
a
b
c
d
Locally non-Delauany
Connection to Convex Hulls in Connection to Convex Hulls in 3D3D
Delaunay diagram Delaunay diagram lower convex hull lower convex hull of the of the liftedlifted sites, ( sites, (xxi i , y , yii , x , xii 22 +y +yii 22 ), on ), on the paraboloid of revolution, the paraboloid of revolution, z=xz=x22 + y + y22
Upper hull Upper hull “furthest site Delaunay” “furthest site Delaunay” 3D CH 3D CH applet
4747
4848
4949
Delaunay in 2D is Convex Hull in Delaunay in 2D is Convex Hull in 3D3D
5050
Delaunay in 2D is Convex Hull in Delaunay in 2D is Convex Hull in 3D3D
5151
Voronoi and DelaunayVoronoi and Delaunay
Algorithms:Algorithms:• Straightforward incremental: O(Straightforward incremental: O(nn22 ))• Divide and conquer (first O(Divide and conquer (first O(n log nn log n))))• SweepSweep• Randomized incrementalRandomized incremental• Any algorithm that computes CH in Any algorithm that computes CH in RR3 3 , ,
e.g., QHulle.g., QHull
5252
Qhull website
Straightforward Incremental Straightforward Incremental Algorithm: VoronoiAlgorithm: Voronoi
5353
Straightforward Incremental Straightforward Incremental Algorithm: VoronoiAlgorithm: Voronoi
5454
5555
Fortune’s Sweep AlgorithmFortune’s Sweep Algorithm
Ack: Guibas&StolfiApplet
AMS 545 / CSE 555
5656
Parabolic FrontParabolic Front
Ack: Guibas&StolfiApplet
AMS 545 / CSE 555
5757
Site EventsSite Events
a) b) c)
Ack: Guibas&StolfiApplet
AMS 545 / CSE 555
5858
Circle EventsCircle Events
Ack: Guibas&StolfiApplet
AMS 545 / CSE 555
5959
Scheduling Circle EventsScheduling Circle Events
Ack: Guibas&StolfiApplet
AMS 545 / CSE 555
6060
6161
Incremental ConstructionIncremental Construction
Add sites one by one, modifying the Add sites one by one, modifying the Delaunay (Voronoi) as we go:Delaunay (Voronoi) as we go:• Join Join vvi i to 3 corners of triangle containing itto 3 corners of triangle containing it
• Do edge flips to restore local Do edge flips to restore local DelaunayhoodDelaunayhood
If added in random order, simple If added in random order, simple “Backwards analysis” shows expected “Backwards analysis” shows expected time O(time O(n log nn log n) ) [Guibas, Knuth, Sharir][Guibas, Knuth, Sharir]
6262
AMS 545 / CSE 555
ExampleExample
CS691G Computational Geometry - UMass CS691G Computational Geometry - UMass AmherstAmherst
6363
Voronoi ExtensionsVoronoi Extensions
Numerous ! Numerous ! [see Okabe, Boots, Sugihara, Chiu][see Okabe, Boots, Sugihara, Chiu]
Different metricsDifferent metrics Higher dimensions: Higher dimensions:
• Delaunay in Delaunay in RRd d lower CH in lower CH in RRd+1d+1 • O( O( n log n +n log n + nn (d+1)/2(d+1)/2 ) )
Order-Order-k, k, furthest-sitefurthest-site Other sites: Voronoi of polygons, “medial axis”Other sites: Voronoi of polygons, “medial axis” Additive/multiplicative weights; power diagramAdditive/multiplicative weights; power diagram -shapes: a powerful shape representation-shapes: a powerful shape representation
6464
GeoMagic, biogeometry at Duke
Furthest Site VoronoiFurthest Site Voronoi
6565
Medial Axis: Convex PolygonMedial Axis: Convex Polygon
6666
Medial Axis: Convex PolygonMedial Axis: Convex Polygon
6767
Medial Axis: Nonconvex Medial Axis: Nonconvex PolygonPolygon
6868
Medial Axis: Curved DomainMedial Axis: Curved Domain
6969
Straight SkeletonStraight Skeleton
7070
7171
VRONI: Fast, robust Voronoi of polygonal domains
Incremental algorithm
7272
7373
Computing offsets with a Voronoi diagram
Alpha Shapes, HullsAlpha Shapes, Hulls
7474
“Erase” with a ball of radius to get -shape. Straighten edges to get -hull
7575
Applet
-Shapes-Shapes
TheoremTheorem: For each Delaunay edge, : For each Delaunay edge, ee=(=(ppii,p,pjj), there exists ), there exists minmin((ee)>0 and )>0 and maxmax((ee)>0 such that )>0 such that e e --shape of shape of SS iff iff minmin((ee) ) maxmax((ee).).
Thus, every alpha-hull edge is in the Thus, every alpha-hull edge is in the Delaunay, and every Delaunay edge Delaunay, and every Delaunay edge is in some alpha-shape.is in some alpha-shape.