of 52 /52
Voronoi Diagrams and Delaunay Triangulations OβRourke, Chapter 5
• Author

others
• Category

## Documents

• view

1

0

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 nearest-neighbor

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 half-spaces defined by

the perpendicular bisectors:

π ππ =β©πβ π π»(ππ , ππ)

ππ

• Voronoi Diagrams

More Generally:

The Voronoi region associated to point ππ is the intersection of the half-spaces 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 1-to-1 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 straight-line

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 co-circular.

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 half-space 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 nearest-neighbor 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.