by eyal dushkin 22.3.10 [ed] chapter 1. i. introduction reminder – voronoi diagrams let s be a...

51
DELAUNAY TRIANGULATIONS By Eyal Dushkin 22.3.10 [Ed] Chapter 1

Post on 19-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

DELAUNAY TRIANGULATIONSBy Eyal Dushkin

22.3.10

[Ed] Chapter 1

I. Introduction

II. Algorithms

III. Faster Algorithms IV.

Perturbation

AGENDA

I. Introduction

Reminder – Voronoi Diagrams Let S be a set of sites in the plane. Each point in the plane is influenced by

each point of S. We would like to decompose the plane into

regions. We define the Voronoi region of as

the set of points that are at least as close to p as to any other point in S; that is,

2x R

2p R

2 | .{ }pV x R q S x p x q

*

*Thanks to Max

I. Introduction

Reminder – Voronoi Diagrams

*Thanks to Max

( , ) ( , ) { x | d(p, x) d(q, x)} -Voronoi region (or cell) p q S p q S

VR p S D p q

, ,

( ) , , - Voronoi diagramp q S p q

V S VR p S VR q S

p

q

VR(p, S)VR(q, S)

V(S)

*

I. Introduction

Voronoi and Delaunay Dual Graph - a dual graph of a given

planar graph G is a graph which has a vertex for each face of G, and an edge for each edge in G joining two neighboring regions, for a certain embedding of G.

I. Introduction

Voronoi and Delaunay We get a dual diagram if we draw a

straight Delaunay edge connecting points if and only if their Voronoi regions intersect along a common line segment.

2,p q R

I. Introduction

Delaunay Overview In general the Delaunay edges decompose

the convex hull of S into triangular regions, referred to as Delaunay triangles.

It’s true that no two Delaunay edges cross each other, but to avoid an argument, we draw each Delaunay edge from one endpoint straight to the midpoint of the shared Voronoi edge and then straight to the other endpoint.

How many edges? To count them, use Euler’s relation on planar graph !

I. Introduction

Delaunay – Number of Edges

Euler’s relation – A planar graph with n>2 vertices has: At most (3n-6) edges At most (2n-4) faces

Proved by Maxim using (Holds on finite & connected planar graph without any edge intersections)

2v e f

I. Introduction

Number of Edges – “Another” Proof Euler’s relation – A planar graph with

n>2 vertices has: At most (3n-6) edges At most (2n-4) faces

(Holds on finite & connected planar

graph without any edge intersections) Each face is bounded with at least 3

edges, and every edge touches at most two faces, thus

Now continue as Maxim did (v = n, ) ■

2v e f

3

2e f

3

2e f

I. Introduction

Number of Edges - Is that surprising? Euler’s relation – A planar graph with n>2 vertices has:

At most (3n-6) edges At most (2n-4) faces

There is a bijection between: Delaunay edges and Voronoi edges Delaunay faces and Voronoi vertices

Result: (3n-6) is an upper bound on Voronoi edges & (2n-4) is an upper bound on Voronoi vertices.

I. Introduction

Duality - Bijection There is a bijection between Delaunay

edges and Voronoi edges – Each Delaunay edge corresponds to the perpendicular Voronoi edge.

There is a bijection between Delaunay faces and Voronoi vertices – Each face represents a Delaunay triangle corresponds to the center of the Circumscribed circle of the triangle.

I. Introduction

Duality - Bijection

I. Introduction

Degeneracy There is an ambiguity in the definition of Delaunay

triangulation if four or more Voronoi regions meet at a common point u.

The probability of picking even just four points is zero because the circle defined by first three points has zero measure in R2.

We’ll assume general position avoiding the above.

I. Introduction

Delaunay – Circles and Power For now we assume general position. Given a Delaunay triangle, abc, consider the circumcircle,

which is the unique circle passing through a, b and c. Its center is the corresponding Vornoi vertex and its radius is r = ||u-a|| = ||u-b|| = ||u-c||; We this circle empty because it encloses no point of S. It turns out that empty circles characterize Delaunay triangles.

Claim – Let S⊆R2 be finite and in general position; a, b, c ∈ S. abc is a Delaunay triangle if and only if the circumcircle of abc is empty.

a b cu V V V

I. Introduction

Delaunay – Circles and Power Claim – Let S⊆R2 be finite and in general position; a, b, c ∈

S. abc is a Delaunay triangle if and only if the circumcircle of abc is empty.

Proof:

The circumcircle of abc is empty abc is a Delaunay triangle: The circumcircle is empty (and hits 3 sites) , thus its

center is a Voronoi vertex. The distances r from the center to a, b, c are equal. Because the circumcircle is empty, r is also the smallest distance from the center, thus Vp and Vq intersect along a common line.

abc is a Delaunay triangle The circumcircle of abc is empty: abc is a Delaunay triangle. Assume that the

circumcircle isn’t empty, thus (WLOG) exists a point p in sector - the distance from this to the center of the circumcircle is smallest than the distance of a and b to the center.

ab

I. Introduction

Delaunay – Circles and Power Let x ∈ R2 be an arbitrary fixed viewpoint. We say a

triangle abc lies in front of another triangle def if there is a half-line starting at x that first passes through abc and then through def.

We write

x

abc def

I. Introduction

Delaunay – Circles and Power The set of Delaunay triangles together with forms a

relation. General Relations can have cycles, i.e. sequences

for example: The red point is the view point. Lets take a look on the skinny

triangles.

Acyclicity Lemma – The in-front relation for the set of Delaunay triangles defined by a finite set S⊆R2 is acyclic.

0 1 0... k

I. Introduction

Power of a point Let P∈R2 , and given a circle U with radius R

and a center O we define the power of a point:

The power equals the square length of a tangent line segment connecting P with U (PT2).

2 2( )U P P O R

I. Introduction

Power of a point The power equals the square of the radius of a circle

centered on the given point that intersects the given circle orthogonally.

I. Introduction

Power of a point Given two circles, the set of points with equal power from

both is a line, denoted by bisector of points with equal power from both.

Why is it a line? Algebraic Proof – Given P = (x,y) write equation;

(x-Ux) 2 + (y-Uy) 2 – r12 = R2 ; (x-Ux’) 2 + (y-Uy’) 2 – r22 = R2 (2Ux’ – 2Ux)x + (2Uy’ – 2Uy)y = r22 – r12 (It’s of course a

linear equation) ■

I. Introduction

Power of a point Given two circles, the set of points with equal power from

both is a line, denoted by bisector of points with equal power from both.

(2Ux’ – 2Ux)x + (2Uy’ – 2Uy)y = r22 – r12 defines a linear equation.

The line divides the plane to two parts; one part contains the set of points x satisfies while the other contains the set of points x satisfies .

2 2( )U P P O R

1 2( ) ( )U Ux x

1 2( ) ( )U Ux x

I. Introduction

Acyclicity Lemma

“The in-front relation for the set of Delaunay triangles defined by a finite set

S⊆R2 is acyclic”Proof: Define τ0 :=abc and write π0(x) for the power from the

circumcircle of abc

Define τk :=def and write πk(x) for the power from the circumcircle of def

S is finite, thus we can choose a half-line that starts at x, passes through abc and def, and contains no point of S. It intersects a sequence of Delaunay triangles:

abc= τ0 τ1 … τk=def.

For any two consecutive triangles, the bisector of the two circumcircles contains the common edge. Because the third point of τi+1 lies outside the circumcircle of τi we have πi(x) < πi+1(x). Thus π0(x) < πk(x). ■

( ) ( )Circumcircle of abc Circumcircle of defabc def x x

I. Introduction

Acyclicity Lemma For any two consecutive triangles, the bisector of the two

circumcircles contains the common edge. Because the third point of τi+1 lies outside the circumcircle of τi we have πi(x) < πi+1(x). Thus π0(x) < πk(x). ■

τ0

τ1

τ2

τ3

τ4

2 Points p1, p2 that clearly satisfy π0(p1) = π1(p1) = π0(p2) = π1(p2) = 0; hence generate a bisector.

Third point z is outside of circumcircle of π1 according to Circumcircle Claim. So π1(z)>0.But π0(z) = 0. Thus x leans on the side of pointsπ0(x) < π1(0).

II. Algorithms

II. Algorithms

Some Claims Circumcircle Claim – Let S⊆R2 be finite and in general

position; a, b, c ∈ S. abc is a Delaunay triangle if and only if the circumcircle of abc is empty.

Supporting Circle Claim - Let S⊆R2 be finite and in general position and let a, b∈ S. Then ab is a Delaunay edge if and only if there is an empty circle that passes through a and b.

The Voronoi edge is the dashed line segment of centers of empty circles passing through the endpoints of ab.

II. Algorithms

Delaunay Lemma Triangulation – A collection of triangles together with edges

& vertices. Definitions – A triangulation K triangulates S if the triangles

decompose the convex hull of S and the set of vertices is S.

An edge ab ∈ K is locally Delaunay if:

1. It belongs to only one triangle and therefore bounds the convex hull OR

2. It belongs to two triangles, abc and abd, and d lies outside the circumcircle of abc.Locally Delaunay Not Locally

Delaunay

II. Algorithms

Delaunay Lemma If every edge of K is locally Delaunay, then K is the

Delaunay triangulation of S.

Proof: Given abc ∈ K and a vertex p ∈ K different from a, b, c. We show that

p lies outside the circumcircle of abc. Choose a point x inside abc such that the segment from x

to p contains no vertex other than p.

Let abc = τ0 τ1 … τk the sequence of triangles that intersect xp.

πi(x) is the power from the circumcircle of τi.

π0(p) > π1(p) > … > πk(p) since all edges along xp are all locally Delaunay.

But (!) πk(p) = 0. Thus π0(p) > 0, which is equivalent to p’s lying outside the circumcircle of abc.

Edge-flip algorithm

II. Algorithms

Let’s present an algorithm of using edge flips as elementary operations to convert an arbitrary triangulation K to the Delaunay triangulation.

We use a stack to maintain the invariant that unless an edge is locally Delaunay, it resides on the stack.

a

b

c

d

Edge-flip algorithm

II. Algorithms

Let n be the number of points. Space Complexity – O(n) due to upper bound of (3n-6) to

the number of edges. If ab is not locally Delaunay, then the union of the two

triangles is convex and dc is locally Delaunay – If d lies inside the circumcircle of acd then if we fix the circumcircle upon a&c and start squeezing till we reach d, so it certainly wouldn’t contain b. Assuming abcd is not a circum quadrilateral.

Running Time?

Edge-flip Interpretation

II. Algorithms

Before proving the algorithm terminates, we interpret a flip as a tetrahedron in three-dimensional space. Let be the vertical projections of points a, b, c, d in the -plane onto the paraboloid defined as the graph of ∏:

Lifted Circle Claim – Point d lies inside the circumcircle of abc if and only if point lies vertically below the plane passing through .

ˆ ˆb dˆ ˆa, , c, 1 2x x

2 23 1 2x x x

d̂ b̂ˆ ˆa, , c

Edge-flip Interpretation

II. Algorithms

Lifted Circle Claim – Point d lies inside the circumcircle of abc if and only if point lies vertically below the plane passing through .

Proof: Let U be the circumcircle of abc and H the plane passing through

. Transform the entire space by mapping every point (x1, x2 , x3)

to (x1, x2 , x3-x1²-x2²). Points are mapped back to a, b, c, d.

The paraboloid ∏ becomes the x1x2-plane. The plane H becomes a

paraboloid that passes through a, b, c. It intersects the x1x2-plane in

the circumcircle of abc. H partitions ∏ into a patch below ∏,

above ∏ and a curve in H. The curve is projected onto the circumcircle,

the patch below is projected onto the open disk inside the circle.

Thus belongs to patch below H <--> d lies inside the circumcircle of

abc.

ˆ ˆb dˆ ˆa, , c,

1 2x x

b̂ˆ ˆa, , c

ˆ ˆb dˆ ˆa, , c,

Edge-flip Interpretation

II. Algorithms

Edge-flip algorithm Anaylsis

II. Algorithms

Flipping ab to cd is like gluing the tetrahedron from below to

and . Once we glue , we cannot glue another tetrahedron right below . In other words, once we flip ab we cannot introduce ab again by some other flip.

This implies that the number of flips is at most as the number of edges connecting n points, namely .

ˆ ˆˆ ˆb da c ˆˆ ˆba cˆ ˆˆbda ˆ ˆˆ ˆb da c

ˆˆba

2

2( )

nO n

MaxMin angle property

II. Algorithms

A flip substitutes two new triangles for two old triangles. Therefore a flip changes six of the angles.

1 2

1

1

2

2

MaxMin angle property

II. Algorithms

A flip substitutes two new triangles for two old triangles. Therefore a flip changes six of the angles.

We claim that for each of the six new angles there’s an old angle that is at least as small. Indeed, take a look (WLOG) at and . Both lean on the same edge, but is outside the yellow circle, hence smaller.

This implies that the smallest angle in K is no larger than the smallest angle in Delaunay triangulation.

1 22" "

1 2

1

1 2

1

12

2

MaxMin angle Lemma

II. Algorithms

Among all triangulations of a finite set S⊆R2, the Delaunay triangulation maximizes the minimum angle.

A flip graph G = (V, E) is a directed graph whose vertex represents a triangulation and two triangulations are connected by an edge (u, v) if and only if there is a flip that changes the triangulation u to v.

The sink is always a Delaunay triangulation. Allowing flips from both direction we can go from any

triangulation to any triangulation in less than flips. Minimize the max angle seems to be harder. using

edge insertion (more powerful method than edge flips).

2n2( log )O n n

III. Better Algorithms

Randomized Construction

Incremental Algorithm

Growing Star

Expectations

III. Better Algorithms

Incremental Algorithm - Reminder The idea is to create the Dalaunay graph by inserting in

each step a new point p. Meaning construct by inserting to

.

When we add a point the triangulation, it can either lie inside or outside the convex hull. To reduce the outside case to the inside case, we start with a triangulation D0 that consists of a single and sufficiently large triangle xyz.

1: ( ,..., )i iDT DT p p ip 1iDT

ip

1iDT iDT

ip

Thanks, Max !

Those triangles of whose circumcircles contain are said to be in conflict with . Therefore, they will no longer be Delaunay triangles.

Let be an edge of and let T(q, r, t) be a triangle adjacent to that lies on the other side of .

If its circumcircle contains then each circle through q and r contains at least one of t, . Therefore, won’t belong to , instead will be a new Delaunay edge.This we call edge flip.

Incremental Algorithm - Reminder

1iDT ip

ip

1iDT

ip

qr

qr

ip

ip qr

iDT

ip t

III. Better Algorithms

Thanks, Max !

Incremental Algorithm - Reminder

III. Better Algorithms

Incremental Algorithm - Reminder

III. Better Algorithms

Thanks, Max !

1iDT

ip

iDT

ip

ipip

No more flips are needed

Connect the containing triangle vertices

Flipping the necessary edges of the containing triangle

Incremental Algorithm - Analysis

III. Better Algorithms

First some definitions: Growing Star – The growing star of pi

consists of all triangles that contain pi.

Link of a Vertex – The link of pi consists of all edges of triangles in the star that are disjoint from pi.

Incremental Algorithm - Analysis

III. Better Algorithms

Right after pi added, the link consists of three edges, namely the edges of the triangle that contains pi. These edges are marked and pushed on the stack to start the edge-flipping.

Each flip replaces a link edge by an edge with end point pi. At the same time it removes one triangle in the star and one outside the star and it adds the two triangles that cover the same quadrangle to the star. The net effect is one more triangle in the star.

The number of edge flips is therefore three less than the number of edges in the final link.

We’ll use the above observation to do the analysis.

ip

Links: 3

Stars: 3ip

Links: 4

Stars: 41

Incremental Algorithm – Analysis

III. Better Algorithms

We temporarily ignore the time needed to find the triangles τi. The rest of the time is proportional to the number of flips needed to add p1 to pn .

Assuming randomly chosen input sequence, i.e. every permutation of n points is equally likely.

The expected number of flips equals is the total number of flips needed to construct the Delaunay triangulation for all n! input permutations divided by n!.

Analysis: Given triangle Dn we want to find point pn. We know that the sum of degrees

of all possible last points is the same as the sum of degrees of all points pi. The sum of degrees of all points pi equals twice the number of edges, 2e. 2e ≤ (3n-6) < 3n . In average, deg pi = 6.

Thus the expected number of flips for the last point is 3 (The initial link consists of 3 edges).

Therefore the expected number of flips to add any point is at most three.

deg 6ip n

Incremental Algorithm – Searching and Charging

III. Better Algorithms

We use the evolution of the Delaunay triangulation to find the triangle Di-1 that contains point pi. Instead of deleting a triangle when it is split of flipped away, we just make it the parent of the new triangles.

Splitting a triangle generates a parent with three children. Flipping and edge generates two parents sharing the same

two children. abc is the parent of abc, bcd, cad.

abc is the parent of both bcd and adc.

Incremental Algorithm – Searching and Charging

III. Better Algorithms

The evolution from D0 to Dn consists of n splits and an expected number of at most 3n flips. The resulting directed acyclic graph (DAG) has an expected size of at most 1 + 3n + 2 · 3n = 9n + 1 nodes.

It has a unique source, triangle xyz.

Its sinks are the triangles in Dn.

How to use DAG to find the triangle?

Incremental Algorithm – Searching and Charging

III. Better Algorithms

Consider adding the point pi. To find the triangle τi-1 ∈ Di-1, we search a path of triangles in the history DAG such that all contain pi. The path begins as xyz and ends at τi-1 .

Triangles σ0 ∈ D0, … , σi ∈ Di will be the triangles that contain pi.

Let Gj be the set of triangles removed from Dj during the insertion of pj+1.

Let Hj be the set of triangles removed from Dj during the hypothetical insertion of pi.

We have σj = σj+1 if Gj and Hj are disjoint.

If σj ≠ σj+1 then Xj = Gj∩Hj ≠ ∅ and all triangles on the portion of the path from σj to σj+1 are generated by flips that remove triangles in Xj .

The cost for searching pi is at most proportional to the sum of card Xj .

( 2)

?jj i

X

Incremental Algorithm – Searching and Charging

III. Better Algorithms

We again hypothetically first insert

pi to Dj and then insert pj+1 into the

Delaunay triangulation of Sj ∪ {pi }.

Yj – Triangles removed during insertion

of pj+1.

Zj⊆ Yj - Triangles that don’t belong to Dj.

Each triangle in Zj is created during the insertion of pi so pi must be on of his vertices.

We have: Xj = Gj – (Yj - Zj )

Now we’ll write cardinalities by using corresponding lower-case letter.

xj = gj – yj + zj

But (!) the expected values of gj and yj-1 are the same, because both count triangles removed by insertion a random jth point.

Thus:

.

.

2 2 2

0 10 0 0

( ) ( ) ( ) ( ) ( )i i i

j j j j i jj j j

E x E g E y E z E g g E z

Incremental Algorithm – Searching and Charging

III. Better Algorithms

To compute Zj we use the fact that among (j+2) points, every pair is equally likely to be pj+1 and pi. If pj+1 and pi are not connected by an edge in the Delaunay triangulation of Sj ∪ {p i

} ∪ {pj+1 } then Zj = ∅.

In general, a triangle in the Delaunay of Sj∪{p i } has a probability at most 3/(j+1) of being in the star of p i .

The expected number of triangles removed by inserting p j+1 is at most four .

Thus , and .

To summarize, the randomized incremental algorithm construct the Delaunay triangulation of n points in R2 in the expected time O(nlog n) and with the amount of O(n) space.

12( )

( 1)jE zj

2 2

0 0

12( ) 1 ln( 1)

( 1)

i i

jj j

E x ij

Thank You