Voronoi Diagrams and Delaunay Triangulationsmisha/Spring16/11.pdfΒ Β· 2. Compute the Voronoi Diagram...
Embed Size (px)
Transcript of Voronoi Diagrams and Delaunay Triangulationsmisha/Spring16/11.pdfΒ Β· 2. Compute the Voronoi Diagram...

Voronoi Diagrams
and
Delaunay Triangulations
OβRourke, Chapter 5

Outline
β’ Preliminaries
β’ Voronoi Diagrams / Delaunay Triangulations
β’ Lloydβs Algorithm

Preliminaries
Claim:
Given a connected planar graph with π vertices, πΈedges, and πΉ faces*, the graph satisfies:
π β πΈ + πΉ = 2
*The βexternalβ face also counts. (Can think of this as a graph on the sphere.)

Preliminaries
Proof:
1. Show that this is true for trees.
2. Show that this is true by induction.

Preliminaries
Proof (for Trees):
If a graph is a connected tree, it satisfies:
π = πΈ + 1.
Since there is only one (external) face:
π β πΈ + πΉ = (πΈ + 1) β πΈ + 1 = 2

Preliminaries
Proof (by Induction):
Suppose that we are given a graph πΊ. If itβs a tree, we are done.
Otherwise, it has a cycle.
Removing an edge on the cycle
gives a graph πΊβ² with: The same vertex set (πβ² = π)
One less edge (πΈβ² = πΈ β 1)
One less face (πΉβ² = πΉ β 1)
By induction:
2 = πβ² β πΈβ² + πΉβ² = π β πΈ + πΉ

Preliminaries
Note:
Given a planar graph πΊ, we can get a planar graph πΊβ² with triangle faces:
Triangulate the interior polygons
Add a βvirtual pointβ outsideand triangulate the
exterior polygon.

Preliminaries
Note:
The new graph has: πβ² = π + 1, πΈβ² β₯ πΈ, πΉβ² β₯ πΉ
πβ² β πΈβ² + πΉβ² = 2
3πΈβ² = 2πΉβ²

Preliminaries
Note:
The new graph has: πβ² = π + 1, πΈβ² β₯ πΈ, πΉβ² β₯ πΉ
πβ² β πΈβ² + πΉβ² = 2
3πΈβ² = 2πΉβ²
This gives:
πΈβ² = 3πβ² β 6 πΉβ² = 2πβ² β 4β β
πΈ β€ 3π β 3 πΉ β€ 2π β 2
The number of edges/faces of a planar graph is
linear in the number of vertices.

Preliminaries
Definition:
Given a set of points {π1, β¦ , ππ} β βπ, the nearest
neighbor graph is the directed graph with an edge
from ππ to ππ, whenever:
ππ β ππ β₯ ππ β ππ β1 β€ π β€ π.
Naively, the nearestneighbor
can be computed in π(π2) timeby testing all possible neighbors.

Outline
β’ Preliminaries
β’ Voronoi Diagrams / Delaunay Triangulations
β’ Lloydβs Algorithm

Voronoi Diagrams
Definition:
Given points π = π1, β¦ , ππ , the Voronoi region of point ππ, π(ππ) is the set of points at least as close to ππ as to any other point in π:
π ππ = π₯ ππ β π₯ β€ ππ β π₯ β1 β€ π β€ π

Voronoi Diagrams
Definition:
The set of points with more than one nearest
neighbor in π is the Voronoi Diagram of π: The set with two nearest neighbors make up the
edges of the diagram.
The set with three or more nearest neighbors make up the vertices of the diagram.
The points π are called the sites of the Voronoi diagram.

Voronoi Diagrams
2 Points:
When π = π1, π2 , the regions are defined by the perpendicular bisector:
π1
π2π»(π2, π1)
π»(π1, π2)

Voronoi Diagrams
3 Points:
When π = π1, π2, π3 , the regions are defined by the three perpendicular bisectors:
π1
π2
π1
π2
π3

Voronoi Diagrams
3 Points:
When π = π1, π2, π3 , the regions are defined by the three perpendicular bisectors:
π1
π2
π1
π2
π3
The three bisectors intersect at a point
The intersection can be outside the triangle.
The point of intersection is center of the circle
passing through the three points.

Voronoi Diagrams
More Generally:
The Voronoi region associated to point ππ is the intersection of the halfspaces defined by
the perpendicular bisectors:
π ππ =β©πβ π π»(ππ , ππ)
ππ

Voronoi Diagrams
More Generally:
The Voronoi region associated to point ππ is the intersection of the halfspaces defined by
the perpendicular bisectors:
π ππ =β©πβ π π»(ππ , ππ)
ππ
β Voronoi regions are convex polygons.

Voronoi Diagrams
More Generally:

Voronoi Diagrams
More Generally:
Voronoi faces can be unbounded.
Voronoi regions are in 1to1 correspondence with points.
Most Voronoi vertices have valence 3.

Voronoi Diagrams
Properties: Each Voronoi region is convex.
π ππ is unbounded β ππ is on the convex hull of π.
If π£ is a at the junction of π(π1),β¦, π(ππ),with π β₯ 3, then π£ is the center of a circle, πΆ(π£),with π1, β¦ , ππ on the boundary.
The interior of πΆ(π£) containsno points.

Delaunay Triangulation
Definition:
The Delaunay triangulation is the straightline
dual of the Voronoi Diagram.
Note:
The Delaunay edges donβt
have to cross their Voronoi
duals.

Delaunay Triangulation
Properties: The edges of π·(π) donβt intersect.
π·(π) is a triangulation if no 4 points are cocircular.
The boundary of π·(π) is the convex hull of π.
If ππ is the nearest neighbor of ππthen ππππ is a Delaunay edge.
There is a circle through ππand ππ that does not contain
any other points
β ππππ is a Delaunay edge.
The circumcircle of ππ, ππ,
and ππ is emptyβ Ξππππππ is Delaunay triangle.

Delaunay Triangulation
Note:
Assuming that the edges of π·(π) do not cross, we get a planar graph.
β 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.

Delaunay Triangulation
Properties: The boundary of π·(π) is the convex hull of π.
Proof:
Suppose that ππππ is an edge of the hull of π.
Consider circles with center on the
bisector that intersect ππ and ππ.
As we move out along the
bisector the circle converges to
the halfspace to the right of ππππ.ππ
ππ

Delaunay Triangulation
Properties: The boundary of π·(π) is the convex hull of π.
Proof:
Suppose that ππππ is an edge of the hull of π.
β There is an (infinite) region onthe bisector that is closer to ππand ππ than to any other points.
β There is a Voronoi edgebetween ππ and ππ.
β The dual edge is in π·(π).ππ
ππ

Delaunay Triangulation
Properties: If ππ is the nearest neighbor of ππ then ππππ is a
Delaunay edge.
Proof:
ππ is the nearest neighbor of ππ iff. the circle around ππwith radius ππ β ππ is empty of other points.
β The circle through (ππ + ππ)/2 with radius
ππ β ππ /2 is empty of other points.
β (ππ + ππ)/2 is on the Voronoi diagram.
β (ππ + ππ)/2 is on a Voronoi edge.
ππ
ππ

Delaunay Triangulation
Properties: If ππ is the nearest neighbor of ππ then ππππ is a
Delaunay edge.
Implications:
The nearest neighbor graph is a subset of the Delaunay
triangulation.
We will show that the Delaunay triangulation can be
computed in π(π log π ) time.
βWe can compute the nearestneighbor graph in π π log π .

Delaunay Triangulation
Properties: There is a circle through ππ and ππ that does not
contain any other points β ππππ is a Delaunay edge.
Proof (β):
If ππππ is a Delaunay edge, then the Voronoi regions
π(ππ) and π(ππ) intersect at an edge.
Set π£ to be some point on the interior of the edge.
π£ β ππ = π£ β ππ = π and π£ β ππ > π βπ β π, π.
The circle at π£ with radius π is empty of other points.

Delaunay Triangulation
Properties: There is a circle through ππ and ππ that does not
contain any other points β ππππ is a Delaunay edge.
Proof (β):
If there is a circle through ππ and ππ, empty of other
points, with center π₯, then π₯ β π ππ β© π ππ .
Since no other point is in or on the circle
there is a neighborhood of centers
around π₯ on the bisector with circlesthrough ππ and ππ empty of other points.
π₯ is on a Voronoi edge.
π₯
ππ
ππ

Delaunay Triangulation
Properties: The edges of π·(π) donβt intersect.
Proof:
Given an edge ππππ in π·(π), there is a circle with ππand ππ on its boundary and empty of other points.
Let be ππππ be an edge in π·(π) that intersect ππππ:
ππ and ππ cannot be in the circle.
β ππ and ππ are not in the triangle Ξπππππππβ ππππ intersects either πππππ or πππππ.
β ππππ intersects either πππππ or πππππ.
β One of πππππ or πππππ one of πππππ or πππππ.
πππ
ππ
ππ
ππ πππππ

Delaunay Triangulation
Properties: The edges of π·(π) donβt intersect.
Proof:
Given an edge ππππ in π·(π), there is a circle with ππand ππ on its boundary and empty of other points.
Let be ππππ be an edge in π·(π) that intersect ππππ:
ππ and ππ cannot be in the circle.
β ππ and ππ are not in the triangle Ξπππππππβ ππππ intersects either πππππ or πππππ.
β ππππ intersects either πππππ or πππππ.
β One of πππππ or πππππ one of πππππ or πππππ.
πππ
ππ
ππ
ππ πππππ
But πππππ is in the Voronoi region of ππ and πππππ is
in the Voronoi region of ππ, so they cannot intersect.

Outline
β’ Preliminaries
β’ Voronoi Diagrams / Delaunay Triangulations Naive Algorithm
Fortuneβs Algorithm
β’ Lloydβs Algorithm

Naive Algorithm
Delaunay( {π1, β¦ , ππ} ) for π β 1, π
Β»for π β 1, πβ for π β [1, π)β’ (π, π) β Circumcircle( ππ , ππ , ππ )
β’ isTriangle β trueβ’ for π β [1, π)
β’ if( ππ β π < π ) isTriangle β falseβ’ if( isTriangle ) Output( ππ , ππ , ππ )
Complexity: π(π4)

Voronoi Diagrams and Cones
Key Idea:
We can think of generating Voronoi regions
by expanding circles centered at points of π.
When multiple circles overlap a point, track
the one that is closer.

Voronoi Diagrams and Cones
Key Idea:
We can visualize the Voronoi regions by
drawing right cones over the points, with axes
along the positive π§axis.
Circles with radius π are the projections of the intersections of the plane π§ = π plane with the cones, onto the π₯π¦plane.
π₯
π§
πππ

Voronoi Diagrams and Cones
Key Idea:
To track the closer circle, we can render the
cones with an orthographic camera looking
up the π§axis.
π₯
π§
π

Voronoi Diagrams and Cones
Key Idea:
To track the closer circle, we can render the
cones with an orthographic camera looking
up the π§axis.
Visualization
cones.bat

Fortuneβs Algorithm
Approach:
Sweep a line and maintain the solution for all
points behind the line.

Fortuneβs Algorithm
Why This Shouldnβt Work:
The Voronoi region behind the line can
depend on points that are in front of the line!
(Looking up the π§axis, we seethe cone before the apex.)
Key Idea:
We can finalize points
behind the line that are
closer to a site than to
the line.

Fortuneβs Algorithm
Given a site π β π and theline with height π¦0, we canfinalize the points satisfying:
(π₯, π¦) π¦ β π¦02 > π β (π₯, π¦) 2
Points on the boundary satisfy:
π¦ β π¦02 = π β (π₯, π¦) 2
Setting π§ = π β (π₯, π¦) , this gives:π§ = π¦ β π¦0
π
π¦ = π¦0

Fortuneβs Algorithm
Formally:
βWe can describe thepoints on the boundary as
the π₯π¦coordinates of the points in 3D with:
1. π§ = π β (π₯, π¦)
2. π§ = π¦ β π¦0
Sweep the cones
with a plane parallel
to the π₯axis making a 45β
angle with the π₯π¦plane.
Points on the right cone,
centered at π,centered around the positive π§axis
Points on the plane,
making a 45β angle with the π₯π¦plane,passing through the line π¦ = π¦0 and π§ = 0
π
π¦ = π¦0

Fortuneβs Algorithm

Fortuneβs Algorithm
Sweep with a plane ππ¦, parallel to the π₯axis,
making a 45β angle with the π₯π¦plane.
βRenderβ the cones and the plane with an
orthographic camera looking up the π§axis.
At each point, we see: The part of ππ¦ that is in front of the line (since it is
below the π₯π¦plane and hence below the cones).
The part of the cones that are behind the line and below ππ¦.

Fortuneβs Algorithm
As π¦ advances, the algorithm maintains a set of parabolic fronts (the projection of the
intersections of ππ¦with the cones).
At any point, the
Voronoi diagram is
finalized behind the
parabolic fronts.

Fortuneβs Algorithm
As π¦ advances, the algorithm maintains a set of parabolic fronts (the projection of the
intersections of ππ¦with the cones).
At any point, the
Voronoi diagram is
finalized behind the
parabolic fronts.Implementation:β’ The fronts are maintained in order.
β’ As π¦ intersects a site, its front is inserted.β’ Complexity π(π log π).

Outline
β’ Preliminaries
β’ Voronoi Diagrams / Delaunay Triangulations
β’ Lloydβs Algorithm

Lloydβs Algorithm
Challenge:
Solve for the position of points π = {π1, β¦ , ππ}inside the unit square minimizing:
πΈ π = 0,1 2π2(π, π) ππ
where π π, π = minπππ β π.

Lloydβs Algorithm
Approach:
1. Initialize the points to random positions.
2. Compute the Voronoi Diagram of the
points, clipped to the unit square.
3. Set the positions of the points to the
centers of mass of the corresponding
Voronoi cells.
4. Go to step 2.

Lloydβs Algorithm

Lloydβs Algorithm
2. Compute the Voronoi Diagram of the
points, clipped to the unit square.
Since:
0,1 2π2(π, π) ππ =
πΉπβπ π
πΉπ
ππ β π2ππ
this provides the assignment of points in
0,1 2 to points in π that minimize the energy.

Lloydβs Algorithm
3. Set the positions of the points to the
centers of mass of the corresponding
Voronoi cells.
Since:
arg minπβ 0,1 2
πΉ
π β π 2ππ = πΆ(πΉ)
with πΆ(πΉ) the center of mass of face πΉ, repositioning to the center reduces the
energy.