Voronoi Diagrams & Delaunay Triangulations O’Rourke: Chapter 5

30
UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Voronoi Diagrams & Delaunay Triangulations O’Rourke: Chapter 5 de Berg et al.: Chapters 7, 9 (and a touch of Ch. 8) Thursday, 2/25/10

description

UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010. Voronoi Diagrams & Delaunay Triangulations O’Rourke: Chapter 5 de Berg et al.: Chapters 7, 9 (and a touch of Ch. 8) Thursday , 2/25/10. Voronoi Diagrams. Applications Preview - PowerPoint PPT Presentation

Transcript of Voronoi Diagrams & Delaunay Triangulations O’Rourke: Chapter 5

Page 1: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

UMass Lowell Computer Science 91.504 Advanced Algorithms

Computational Geometry Prof. Karen Daniels

Spring, 2010

UMass Lowell Computer Science 91.504 Advanced Algorithms

Computational Geometry Prof. Karen Daniels

Spring, 2010

Voronoi Diagrams & Delaunay Triangulations

O’Rourke: Chapter 5

de Berg et al.: Chapters 7, 9 (and a touch of Ch. 8)Thursday, 2/25/10

Page 2: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Voronoi DiagramsVoronoi Diagrams

Applications PreviewDefinitions & Basic Properties

Delaunay TriangulationsAlgorithms

More on ApplicationsMedial Axis

Connection to Convex HullsConnection to Arrangements

Page 3: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Applications PreviewApplications Preview

• Nearest neighbors

• Minimum spanning tree

• Medial axis

http://www.ics.uci.edu/~eppstein/gina/scot.drysdale.html

Page 4: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Common 2D Computational Geometry StructuresCommon 2D Computational Geometry Structures

Voronoi Diagram

Delaunay Triangulation

Convex Hull

New Point

Combinatorial size in O(n)

triangle whose circumcircle’s center is just outside triangle

Page 5: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

BasicsBasics

• Voronoi region V(pi) is set of all points at least as close to pi as to any other site:

}|||:|{)( ijxpxpxpV jii

ji

jii ppHpV

),()(

Note:This definition is independent of dimension.

source: O’Rourke

Page 6: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Digression on Point/Line DualityDigression on Point/Line Duality

• Point in 2D plane has coordinates x and y• (Non-vertical) line has slope and y-intercept• One-to-one mapping of set of points to set of lines (and vice versa) is a

type of duality mapping• Example of one duality:

source: de Berg et al. Ch 8

)( line is *) (denoted point of dual yx pxpypp

),(*point is )( line of dual bmlbmxyl

This duality preserves:- Incidence - Order (above/below)

Page 7: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulations: Properties

Delaunay Triangulations: Properties

http://www.cs.cornell.edu/Info/People/chew/Delaunay.html

Page 8: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

2D Delaunay Triangulations: Properties

2D Delaunay Triangulations: Properties

• D1. D(P) is the straight-line dual of V(P) [by definition]• D2. D(P) is a triangulation if no 4 points of P are

cocircular: Every face is a triangle.• D3. Each face of D(P) corresponds to a vertex of V(P)• D4. Each edge of D(P) corresponds to an edge of V(P)• D5. Each node of D(P) corresponds to a region of V(P)• D6. The boundary of D(P) is the convex hull of the sites• D7. The interior of each face of D(P) contains no sites

source: O’Rourke

D3-D5 define a duality mapping between features of the Delaunay Triangulation and Voronoi Diagram.

P is the set of sites (no 4 cocircular).

Page 9: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

2D Delaunay Triangulations: Properties of Voronoi Diagrams2D Delaunay Triangulations:

Properties of Voronoi Diagrams

http://www.cs.cornell.edu/Info/People/chew/Delaunay.html

Page 10: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

2DVoronoi Diagram: Properties2DVoronoi Diagram: Properties

• V1. Each Voronoi region V(pi) is convex• V2. V(pi) is unbounded iff pi is on convex hull of point set• V3. If v is a Voronoi vertex at junction of V(p1), V(p2),

V(p3), then v is center of circle C(v) determined by p1, p2, and p3.

• V4. C(v) is circumcircle for Delaunay triangle for v• V5. Interior(C(v)) contains no sites (proof by contradiction)• V6. If pi is a nearest neighbor to pj, then (pi, pj) is an edge

of D(P)• V7. If there is some circle through pi and pj that contains

no other sites, then (pi, pj) is an edge of D(P). [reverse holds too] source: O’Rourke

Page 11: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Back to Delaunay Triangulation: Another Property (in 2D)

Back to Delaunay Triangulation: Another Property (in 2D)

• Let P be a set of points in the plane (in general position).• Let number of triangles in triangulation T be m.• Angle-Vector: Sorted angle list:• A(T) > A(T’) if • Angle-Optimal Triangulation T: for all triangulations

T’ of P• Theorem 9.9: Any angle-optimal triangulation of P is a Delaunay

triangulation of P. Furthermore, any Delaunay triangulation of P maximizes the minimum angle over all triangulations of P.

source: de Berg et al. Ch 8

),,()( 321 mTA

iijj ijmi ' and ' such that 31

)'()( TATA

Page 12: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

• Delaunay Triangulation:• Maximizes the minimum angle (as on previous slide)

• Minimizes maximum circumcircle radius• Minimizes maximum radius of an enclosing

circle*• Maximizes sum of inscribed circle radii• And more…

*Warning: Most of these 2D optimality properties to not extend to higher dimensions!(exception: minimize maximum radius of simplex-enclosing sphere)

Back to Delaunay Triangulation: More Optimality Properties (in 2D)Back to Delaunay Triangulation: More Optimality Properties (in 2D)

source: Handbook of Discrete & Computational Geometry

Page 13: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Voronoi Diagram Algorithms Voronoi Diagram Algorithms

• Half-Plane Intersection:• Construct each Voronoi region separately:

• Intersect n-1 halfplanes• Intersecting n halfplanes in 2D is dual* to constructing convex hull of n

points• O(n lg n) time

• Total time: O(n2 lg n)• Incremental Construction:

• Add one point at a time• If new point is inside some Voronoi circle, locally update diagram• O(n) work per point• Total time: O(n2)

• Divide-and-Conquer: O(n lg n)• Optimal but complex to implement

• Lift points onto 3D paraboloid *• Parabolic Sweep*: O(n lg n)

• Brief summary on next slide; detailed treatment in Ch. 7 of de Berg et al. *see other slides

source: O’Rourke

One strategy: Find Delaunay Triangulation then use duality (as in CGAL).

Page 14: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Voronoi Diagram Algorithms:

Fortune’s Parabolic Sweep

Voronoi Diagram Algorithms:

Fortune’s Parabolic Sweep• Plane-sweep complication: What if encounter Voronoi edges before corresponding site?• Solution:

• Expanding circles interpretation (z is time dimension)• 2 cones intersect in branch of hyperbola that projects down onto (potential) Voronoi edge• If cones opaque, then Voronoi diagram is view from z = • Sweep-line is intersection of slanted plane p with xy-plane• Because p slanted at same angle as cones, L hits site when p first hits cone for site• Invariant: Everything visible underneath p is always finished (that part of Voronoi diagram is done)• Maintain parabolic front = projection of intersection of p with cones onto xy-plane• Events

• Site event : new (degenerate, single-line) parabola forms. 2 (duplicate) intersection points with parabolic front form new degenerate Voronoi diagram edge

• Circle event: 2 parabolic front intersection points meet to form Voronoi vertex. • As parabolic front evolves, parabola intersection points trace out Voronoi diagram.

O(nlgn)

sweep line L at x = l

45 slope

time

xp

45

view from L z

parabolic front

source: O’Rourke

Page 15: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

• Lift points onto 3D paraboloid *• CGAL uses lifting for d-dimensional Delaunay

• Start with any triangulation & flip edges• Described in deBerg et al. *

• Randomized incremental with edge flipping• Described in deBerg et al. *• Used by CGAL for 2D and 3D (tetrahedra in 3D)

• Constrained Delaunay triangulation• User specifies line segments that must be in the

triangulation.• See Shewchuck paper for an algorithm description.• Available in CGAL for 2D only.

One strategy: Find Voronoi Diagram then use duality.

*see other slides

Page 16: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Application: Mesh Generation for Finite Element Modeling [Research Note for 17th Int. Meshing

Roundtable, 2008; also presented at Fall CG Workshop]

Application: Mesh Generation for Finite Element Modeling [Research Note for 17th Int. Meshing

Roundtable, 2008; also presented at Fall CG Workshop]

Doctoral student S. Ye

• Needed for signal integrity in printed circuit board interconnect routing• 2D constrained Delaunay triangulation is extruded into 3D to form triangular

prism mesh• “Angle optimality” of Delaunay triangulation is useful for this type of modeling.

Courtesy of Cadence Design Systems

Page 17: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

Start with any triangulation & flip edges

source: deBerg et al.

Termination is guaranteed due to finite # different triangulations and increasing triangle angles, but this version of the algorithm is slow…

Page 18: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

Randomized incremental with edge flipping:

source: deBerg et al.

Expected running time is in O(nlogn). See future slide.

***

****

* see future slide

Page 19: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

Cases for randomized incremental with edge flipping:

source: deBerg et al.

produces 3 calls to LEGALIZEEDGE

produces 4 calls to LEGALIZEEDGE

Page 20: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

Edge flipping:

source: deBerg et al.

Existing edges may become illegal

Page 21: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Delaunay Triangulation AlgorithmsDelaunay Triangulation Algorithms

• Edge Flipping: • Key contributor to O(nlogn) expected running

time is fast location of triangle containing point pr: DAG point location structure

• Making a leaf into an internal node yields at most 3 outgoing edges.

• Lemma 9.11: The expected number of triangles created by algorithm DELAUNAYTRIANGULATION is at most 9n+1.

• Key idea: Bound the expected degree of point pr.

• Use Lemma 9.11 together with ideas from randomized incremental framework

• Recall “conflict graph” used for randomized incremental convex hull construction.

• In Delaunay case, conflict arises when a point is in circumcircle of a triangle.

source: deBerg et al.

Page 22: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

How are Convex Hull, Delaunay Triangulation and Voronoi Diagram related?Delaunay Triangulation

How are Convex Hull, Delaunay Triangulation and Voronoi Diagram related?Delaunay Triangulation

• Project each point upwards onto paraboloid z= x2 + y2

• Construct 3D Convex Hull • Discard “top” faces• Project Convex Hull down to xy

plane to form Delaunay Triangulation

• View from z = -infinity to see Delaunay Triangulation

source: O’Rourke

Page 23: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

How are Convex Hull, Delaunay Triangulation and Voronoi Diagram related?Voronoi Diagram

How are Convex Hull, Delaunay Triangulation and Voronoi Diagram related?Voronoi Diagram

• Project each point upwards onto paraboloid z= x2 + y2

• At each projected point, construct plane tangent to paraboloid • tangent above (a,b) is

• z = 2ax + 2by - (a2 + b2)

• View from z = +infinity to see Voronoi Diagram• “first intersection” of planes

source: O’Rourke

Page 24: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

Voronoi Diagram Applications: Nearest NeighborsVoronoi Diagram Applications: Nearest Neighbors

Nearest Neighborhood query for point q with respect to points P = p1, p2 ,..., pn can be answered in O(logn) time using Voronoi diagram

All Nearest Neighbors:The Nearest Neighborhood Graph (NNG) of points P is a graph:- whose nodes correspond to the points

- an arc from pi to pj iff pj is a nearest neighbor of pi :

}|{|min|| kiikji pppp

)(PDNNG source: O’Rourke

So NNG can be constructed in O(nlogn) time.

Page 25: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Applications: Euclidean Minimum Spanning TreeMore Applications: Euclidean Minimum Spanning Tree

)(PDMST

MST can be used in TSP approximation algorithm.

source: O’Rourke

Page 26: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Applications: Relative Neighborhood Graph More Applications: Relative Neighborhood Graph

The Relative Neighborhood Graph (RNG) of points p1, p2 ,..., pn is a graph:- whose nodes correspond to the points

- 2 nodes p1, p2 share an arc iff they are at least as close to each other as to any other point:

Note: this produces a set of constraints (1 for each m)

It can be shown (O’Rourke exercise) that:- every edge of the RNG is an edge of the Delaunay triangulation- every edge of an MST is an edge of the RNG

)(PDRNG

|}|,|{|max|| , mjmijimji pppppp

LUNE forbidden region

RNGfor 4 sample points

RNGMST

source: O’Rourke

Page 27: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Applications: Largest Empty CircleMore Applications: Largest Empty Circle

Problem: Find a largest empty circle whose center is in the (closed) convex hull of a set of n sites S (empty in that it contains no sites in its interior, and largest in that

there is no other such circle with strictly larger radius).

Finite set of potential largest empty circle centers:

- Voronoi vertices

- Intersections of Voronoi edges and hull of sites.

source: O’Rourke

Page 28: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Applications: Medial AxisMore Applications: Medial Axis

Medial Axis Pruning: Robert Ogniewicz of Harvard uses medial axes for shape recognition. http://www.ics.uci.edu/~eppstein/gina/medial.html

source: O’Rourke

Page 29: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Applications: Medial AxisMore Applications: Medial Axis

• Medial Axis: of polygon P = set of points inside P that have > 1 closest point among P’s boundary points.• Tree whose leaves are vertices of P• Every point of medial axis is center of circle

touching boundary in at least 2 points.• Vertices of medial axis are centers of circles

touching 3 distinct boundary points.• “Grassfire” analogy: fire starts at boundary

• Medial axis represents “quench points” where fires meet each other

• This is also the Voronoi diagram of the polygon.

sources O’Rourke and de Berg et al.

Page 30: Voronoi  Diagrams & Delaunay Triangulations O’Rourke:  Chapter 5

More Delaunay Applications: Shewchuck TriangulationMore Delaunay Applications: Shewchuck Triangulation

http://www.cs.cmu.edu/~quake/triangle.demo.html