COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms Divide-&-Conquer...

165
COSC 6114 Prof. Andy Mirzaian

Transcript of COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms Divide-&-Conquer...

Page 1: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

COSC 6114

Prof. Andy Mirzaian

Page 2: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi Diagram & Delaunay Triangualtion

Algorithms Divide-&-Conquer Plane Sweep Lifting into d+1 dimensions Edge-Flip Randomized Incremental Construction

Applications Proximity space partitioning and the post office problem Height Interpolation Euclidean: Minimum Spanning Tree, Traveling Salesman Problem, Minimum Weight Triangulation, Relative Neighborhood Graph, Gabriel Graph.

Extensions Higher Order Voronoi Diagrams Generalized metrics - Robot Motion Planning

Page 3: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

References:

• [M. de Berge et al] chapters 7, 9, 13

• [Preparata-Shamos’85] chapters 5, 6

• [O’Rourke’98] chapter 5

• [Edelsbrunner’87] chapter 13

• AAW

• Lecture Notes 16, 17, 18, 19

Page 4: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Introduction

Page 5: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi Diagram & Delaunay Triangulation

P = { p1, p2, … , pn} a set of n points in the plane.

Page 6: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi Diagram & Delaunay Triangulation

Voronoi(P): # regions = n, # edges 3n-6, # vertices 2n-5.

Nearest site proximity partitioning of the plane

Page 7: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Triangulation = Dual of the Voronoi Diagram.

Voronoi Diagram & Delaunay Triangulation

DT(P): # vertices = n, # edges 3n-6, # triangles 2n-5.

Page 8: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay triangles have the “empty circle” property.

Voronoi Diagram & Delaunay Triangulation

Page 9: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi Diagram & Delaunay Triangulation

Page 10: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi DiagramP = { p1, p2, … , pn} a set of n points in the plane.Assume: no 3 points collinear, no 4 points cocircular.

PB(pi, pj) perpendicular bisector of pipj.

pi

pj

H(p i, p j) half-p

lane

Voronoi Region of pi: n

ij1j

jii )p,p(H)p(V

pi

Voronoi Diagram of P: n

1ii )p(V)P(VD

Page 11: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Voronoi Diagram Properties

Each Voronoi region V(pi) is a convex polygon (possibly unbounded).

V(pi) is unbounded pi is on the boundary of CH(P).

Consider a Voronoi vertex v = V(pi) V(pj) V(pk).

Let C(v) = the circle centered at v passing through pi, pj, pk.

C(v) is circumcircle of Delaunay Triangle (pi, pj, pk).

C(v) is an empty circle, i.e., its interior contains no other sites of P.

pj = a nearest neighbor of pi V(pi) V(pj) is a Voronoi edge

(pi, pj) is a Delaunay edge.

more later …

Page 12: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Triangulation Properties

DT(P) is straight-line dual of VD(P).

DT(P) is a triangulation of P, i.e., each bounded face is a triangle

(if P is in general position).

(pi, pj) is a Delaunay edge an empty circle passing through pi and pj.

Each triangular face of DT(P) is dual of a Voronoi vertex of VD(P).

Each edge of DT(P) corresponds to an edge of VD(P).

Each node of DT(P), a site, corresponds to a Voronoi region of VD(P).

Boundary of DT(P) is CH(P).

Interior of each triangle in DT(P) is empty, i.e., contains no point of P.

more later …

Page 13: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

ALGORITHMS

Page 14: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A brute-force VD AlgorithmP = { p1, p2, … , pn} a set of n points in the plane.Assume: no 3 points collinear, no 4 points cocircular.

Voronoi Region of pi: n

ij1j

jii )p,p(H)p(V

Voronoi Diagram of P: n

1ii )p(V)P(VD

intersection of n-1 half-planes

• Voronoi region of each site can be computed in O(n log n) time.• There are n such Voronoi regions to compute.• Total time O(n2 log n).

Page 15: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Divide-&-Conquer Algorithm

• M. I. Shamos, D. Hoey [1975], “Closest Point Problems,” FOCS, 208-215.

• D.T. Lee [1978], “Proximity and reachability in the plane,” Tech Report No, 831, Coordinated Sci. Lab., Univ. of Illinois at Urbana.

• D.T. Lee [1980], “Two dimensional Voronoi Diagram in the Lp metric,” JACM 27, 604-618.

The first O(n log n) time algorithm to construct the Voronoi Diagram of n point sites in the plane.

Page 16: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

ALGORITHM Construct Voronoi Diagram (P)

INPUT: P = { p1, p2, … , pn} sorted on x-axis.

OUTPUT: CH(P) and DCEL of VD(P).

1. [BASIS]: if n1 then return the obvious answer.

2. [DIVIDE]: Let m n/2

Split P on the median x-coordinate into

L = { p1, … , pm} & R = { pm+1, … , pn}.

3. [RECUR]:

(a) Recursively compute CH(L) and VD(L).

(b) Recursively compute CH(R) and VD(R).

4. [MERGE]:

(a) Compute Upper & Lower Bridges of CH(L) and CH(R) & obtain CH(P).

(b) Compute the y-monotone dividing chain C between VD(L) & VD(R).

(c) VD(P) [C] [VD(L) to the left of C] [VD(R) to the right of C].

(d) return CH(P) & VD(P).

END.

O(1)

O(n)

T(n/2)

T(n/2)

O(n)

T(n) = 2 T(n/2) + O(n) = O( n log n).

Page 17: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

P = { p1, p2, … , pn} a set of n points in the plane.

Page 18: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD(P) = [C] [VD(L) to the left of C] [VD(R) to the right of C] .

Page 19: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD(L) and CH(L)

Page 20: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD(R) and CH(R)

Page 21: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Upper & Lower bridges between CH(L) and CH(R) & two end-rays of chain C.

Page 22: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1

2

3

4

5

6

7

8

9

(1,5)

(3,5)

(3,6)

(4,6)

(4,7)

(2,7)

Construct chain C.

Page 23: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1

2

3

4

5

6

7

8

9

Construct chain C.

Page 24: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1

2

3

4

5

6

7

8

9

Crop VD(L) & VD(R) at C.

Page 25: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1

2

3

4

5

6

7

8

9

VD(P) and CH(P)

Page 26: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Fortune’s Algorithm• Steve Fortune [1987], “A Sweepline algorithm for Voronoi

Diagrams,”Algorithmica, 153-174.

• Guibas, Stolfi [1987], “Ruler, Compass and computer: The design and analysis of geometric algorithms,”

Proc. of the NATO Advanced Science Institute, series F, vol. 40: Theoretical Foundations of Computer Graphics and CAD, 111-165.

O(n log n) time algorithm by plane-sweep. See AAW animation. Generalization: VD of line-segments and circles.

Page 27: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

The Waive Propagation View

• Simultaneously drop pebbles on calm lake at n sites.

• Watch the intersection of expanding waves.

Page 28: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Time as 3rd dimension

x

y x

z=time

y

a a

p

papex

of the cone

All sites have identical opaque cones.

Page 29: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Time as 3rd dimension

xz

y

• All sites have identical opaque cones.• cone(p) cone(q) = vertical hyperbola h(p,q).• Vertical projection of h(p,q) on the xy base plane is PB(p,q).

p q

base plane

Page 30: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Time as 3rd dimension

xz

y

Visible intersection of the cones viewed upward from z = - is VD(P).

base plane

Page 31: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Conic Sections: Focus-Directrix

focusf

directrix l

w

h

Eccentricity constant:

hw

fwe

0 = e point (focus)0 < e < 1 ellipse e = 1 parabola e > 1 hyperbola

Page 32: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

sweep plane

sweepline

a baseplane

x

y

Sweep Plane & Sweep Line

z

Page 33: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

sweep plane

sweep line l

aa

baseplanep

v

w u

Sweep Plane & Cone Intersection

Vertical projection of intersection of cone(p) & the sweep plane on the base plane is a parabola with focus p and directrix l.

xy

Page 34: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

p

Parabolic Evolution

l

focus p

l

xy

Page 35: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

p

Parabolic Evolution

l

focus p

l

xy

Page 36: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Time snapshots of moving parabola associated with site p

p

xy

1 2 3

1

2

3

swee

p lin

e

Page 37: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Each parabolic arc of the Front is in some Voronoi region.

Each “break” between 2 consecutive parabolic arcs lies on a Voronoi edge.

The parabolic front

Sweep plane opaque. So we don’t see future events. Any part of a parabola inside another one is invisible, since a point (x,y) is inside a

parabola iff at that point the cone of the parabola is below the sweep plane. Parabolic Front = visible portions of parabola; those that are on the boundary of

the union of the cones past the sweep. Parabolic Front is a y-monotone piecewise-parabolic chain.

(Any horizontal line intersects the Front in exactly one point.)

swee

p lin

e

Page 38: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

The breakpoints of the parabolic front trace out every Voronoi edge as the sweep line moves from x = - to x = + .

Every point of every Voronoi edge is a breakpoint of the parabolic front at some time during the sweep.

Proof: (a) Fig 1: Event w: Cu is an empty circle.

(b) Fig 2: At event w point u must be a breakpoint of the par. front. Otherwise: Some parabola Z covers u at v Focus of Z is on Cv and Cv is inside Cu Focus of Z is inside Cu

Cu is not an empty circle a contradiction.

Evolution of the parabolic front

p

q

uw

Cu

Fig 1.

Fig 2.

wuv

CuCv

p

q

Z

sweepline

sweepline

Page 39: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

SITE EVENT: Insert into the Parabolic Front.

CIRCLE EVENT: Delete from the Parabolic Front.

The Discrete Events

Page 40: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

SITE EVENT

A new parabolic arc is inserted into the front when sweep line hits a new site.

p

q

s

p

q

s

p

q

s

1 2 3

Page 41: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

SITE EVENT

p

q

s

p

q

s

p

q

s

A parabola cannot appear on the front by breaking through from behind.The following are impossible:

a

ba

b

t t+Dt

a

b

tt+Dtg

a

b

g

A new parabolic arc is inserted into the front when sweep line hits a new site.

Page 42: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Circle event w causes parabolic arc b to disappear. a and g cannot belong to the same parabola.

CIRCLE EVENT

w

p

q

s

a

g

b

uw

p

q

s

a

g

b w

p

q

s

a

g

u

Page 43: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

T: [SWEEP STATUS: a balanced search tree] maintains a description of the current parabolic front.

Leaves: arcs of the parabolic front in y-monotone order.Internal nodes: the break points.

DATA STRUCTURES (T & Q)

Operations: (a) insert/delete an arc. (b) locate an arc intersecting a given horizontal line (for site event). (c) locate the arcs immediately above/below a given arc (for circle event).

We also hang from this the part of the Voronoi Diagram swept so far.- Each leaf points to the corresponding site.- Each internal node points to the corresponding Voronoi edge.

x

y

sweepdirec.

Par(A) Par(B)Par(C) Par(D)

A B C D

T:

Page 44: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Q: [SWEEP SCHEDULE: a priority queue] schedule of future events:

all future site-events & some circle-events, i.e.,

those corresponding to 3 consecutive arcs of the current

parabolic front as represented by T. The others will be discovered & added to the sweep schedule before

the sweep lines advances past them. Conversely, not every 3 consecutive arcs of the current front specify

a circle-event. Some arcs may drop out too early.

DATA STRUCTURES (T & Q)

Page 45: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Event-driven simulation loop:

At each iteration remove the next event (with min x-coordinate) from Q &

simulate the effect of the sweep-line advancing past that event point.

Event Processing & Scheduling

Page 46: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Event-driven simulation loop:

At each iteration remove the next event (with min x-coordinate) from Q &

simulate the effect of the sweep-line advancing past that event point.

Event Processing & Scheduling

death(a) : pointing to a circle-event in Q as the meeting point of the Voronoi edges. (If the edges are diverging, then death(a) = nil.)

Remove circle-event death(a) if:(a) a is split in two by a site-event, or(b) whenever one of the two arcs adjacent to a is deleted by a circle-event.

a

Page 47: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Event-driven simulation loop:

At each iteration remove the next event (with min x-coordinate) from Q &

simulate the effect of the sweep-line advancing past that event point.

Event Processing & Scheduling

A circle-event update: each parabolic arc b (leaf of T) points to the earliest circle-event, death(b), in Q that would cause deletion of b at the corresponding Voronoi vertex.

death(b)

v

s

a

g

b

spurious circle-event

death(b’)

s

a

g

b’

b’’

death(b’’)

Page 48: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Event-driven simulation loop:

At each iteration remove the next event (with min x-coordinate) from Q &

simulate the effect of the sweep-line advancing past that event point.

Event Processing & Scheduling

( , ,a g d) do not define a circle-event: (a,c,d) is not a circle-event now, it is past the current sweep position.

a

b

a

g

b

cd

d

Page 49: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

|T| = O(n) : the front always has O(n) parabolic arcs, since splits occur at

most n times by site events.

Also by Davenport-Schinzel:

… a … b … a … b … is impossible.

[At most 2n-1 parabolic arcs in T.]

ANALYSIS

|Q| = O(n) : there are at most n site-events and O(n) triples of consecutive

arcs on the parabolic front to define circle-events.

Total # events = O(n), Time per event processing = O(log n).

THEOREM: Fortune’s algorithm computes Voronoi Diagram of n sites

in the plane using optimal O(n log n) time and O(n) space.

Page 50: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Triangulation

Page 51: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Terrain Height Interpolation

A perspective view of a terrain. A topographical map of a terrain.

Page 52: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Terrain Height Interpolation

A perspective view of a terrain. A topographical map of a terrain.

Terrain: A 2D surface in 3D such that each vertical line intersects it in at most one point.f : 2 . f(p) = height of point p in the domain A of the terrain.

Method: Take a finite sample set P A. Compute f(P), and interpolate on A.

P A

f

Page 53: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Triangulations of Planar Point Sets

P = {p1, p2, … , pn } 2.A triangulation of P is a maximal planar straight-line subdivision with vertex set P.

THEOREM: Let P be a set of n points, not all collinear, in the plane. Suppose h points of P are on its convex-hull boundary. Then any triangulation of P has 3n-h-3 edges and 2n-h-2 triangles.

Proof: m = # triangles

3m + h = 2E (each triangle has 3 edges; each edge incident to 2 faces)

Euler: n – E + (m+1) = 2

m = 2n - h - 2, E = 3n – h – 3.

Page 54: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph: Dual of Voronoi Diagram

Delaunay Graph DG(P) as dual of Voronoi Diagram VD(P).

Page 55: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph: Dual of Voronoi Diagram

Delaunay Graph DG(P) as strainght-line dual of Voronoi Diagram VD(P).

Page 56: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

THEOREM: Delaunay Graph of P is a straight-line plane graph, & a triangulation of P.

Proof: Follows from the following Lemmas.

Alternative Definition of Delaunay Graph: • A triangle D(pi , pj , pk) is a Delaunay triangle iff the circumscribing circle

C(pi , pj , pk) is empty. • Line segment (pi, pj) is a Delaunay edge iff there is an empty circle

passing through pi and pj, and no other point in P.

Page 57: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 1: Every edge of CH(P) is a Delaunay edge.

Proof: Consider a sufficiently large circle that passes through the 2 ends of CH edge e, and whose center is separated from CH(P) by the line aff(e).

e

Page 58: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 2: No two Delaunay triangles overlap.

Proof: Consider circumscribing circles of two such triangles. Line L separates the two triangles.

L

empty area

Page 59: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 3: pi & pj are Voronoi neighbors (pi , pj) is a Delaunay edge.

Proof: Consider the circle that passes through pi & pj and whose center is in the relative interior of the common Voronoi edge between V(pi) & V(pj).

V(pi)

V(pj)

pi

pj

Page 60: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 4: If pj and pk are two (rotationally) successive Voronoi neighbors of pi & pjpipk < 180, then D(pi , pj , pk) is a Delaunay triangle.

Proof: pj & pk must also be Voronoi neighbors. Now apply Lemma 3 to (pi , pj), (pi , pk), (pj , pk).

Page 61: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 4: If pj and pk are two (rotationally) successive Voronoi neighbors of pi & pjpipk < 180, then D(pi , pj , pk) is a Delaunay triangle.

Proof: pj & pk must also be Voronoi neighbors. Now apply Lemma 3 to (pi , pj), (pi , pk), (pj , pk).

COROLLARY 5: For each pi P, the Delaunay triangles incident to pi

completely cover a small open neighborhood of pi inside CH(P).

pi

pi

CH(P)

Page 62: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Delaunay Graph is a Triangulation

LEMMA 6: Every point inside CH(P) is covered by some Delaunay triangle in DG(P).

Proof: Let q be an arbitrary point in CH(P). Let (pi , pj) be the Delaunayedge immediately below q. ((pi , pj) exists because all convex-hull edges are Delaunay by Lemma 1.) From Corollary 5 let D(pi,pj,pk) be the next Delaunay triangle incident to pi as in the Figure below. Then, either q D(pi,pj,pk), or the choice of (pi , pj) is contradicted.

pi pj

pk

q

pi pj

pk q

pi pj

pkq

The THEOREM follows from Lemmas 2-6. We now use DT(P) to denotethe Delaunay triangulation of P.

Page 63: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Angles in Delaunay Triangulation

THEOREM: DT(P) is the unique triangulation of P that lexicographically maximizes A(T ).

Proof: Later.

DEFINITION:T = an arbitrary triangulation (with m triangles) of point set P.a1, a2, …, a3m = the angles of triangles in T, sorted in increasing order.A(T ) = (a1 , a2 , … , a3m) is called the angle-vector of T.

COROLLARY: DT(P) maximizes the smallest angle.

Useful for terrain approximation by triangulation & linear interpolation. Small angles (long skinny triangles) cause large approximation errors.

Page 64: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

DT & VD via CH

• K.Q. Brown [1979], “Voronoi diagrams from convex hulls,” IPL 223-228.

• K.Q. Brown [1980], “Geometric transforms for fast geometric algorithms,” PhD. Thesis, CMU-CS-80-101.

• Guibas, Stolfi [1987], “Ruler, Compass and computer: The design and analysis of geometric algorithms,” Proc. of the NATO Advanced Science Institute, series F, vol. 40: Theoretical Foundations of Computer Graphics and CAD, 111-165.

• Guibas, Stolfi [1985], “Primitives for the manipulation of general subdivisions and

the computation of Voronoi diagrams,” ACM Trans. Graphics 4(2), 74-123.

• [Edelsbrunner’87] pp: 302-306.

• Aurenhammer [1987], “Power diagrams: properties, algorithms, and applications,” SIAM J. Computing 16, 78-96.

Page 65: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

DT in d CH in d+1

2d

22

211d

1dd21d21

xxxx where

)x,x,,x,(xpoint )x,,x,(xpoint :λ Transform Lifting

y

x

z=l(x,y)

Paraboloid ofRevolution L

l: (x,y) (x,y, x2+y2)

Page 66: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

SUMMARY:

Consider a plane P in 3 and the paraboloid of revolution L.

(1) Projection of PL down to 2 is a circle C.(2) Every point of L below P projects down to interior of C.(3) Every point of L above P projects down to exterior of C.

2D (“Nearest-Point” and “Farthest-Point”)Delaunay Triangulation algorithm via 3D-convex-hull inO(n log n) time.

DT in 2 CH in 3

Page 67: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

DT in d CH in d+1

x

y

z

CH((P))

DT(P)

Page 68: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

DT in d CH in d+1

P = {p1, p2, … , pn } d.

l(P) = {l(p1), l(p2), …, l(pn)} d+1. Assume P is in general position.

THEOREM:

(1) Projection of lower convex-hull of l(P) down to d is the “nearest-point” DT(P).

(2) Projection of upper convex-hull of l(P) down to d is the “farthest-point” DT(P).

Page 69: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

. o tangent tis and (p)λ through passes

ax2ax2a x :)p( planehyper)a,,a,(a pd

1i

2idd111dd21

y

x

z=l(x,y)

Paraboloid ofRevolution L

l: (x,y) (x,y, x2+y2)

p

l(p)

P(p)

Page 70: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

. o tangent tis and (p)λ through passes

ax2ax2a x :)p( planehyper)a,,a,(a pd

1i

2idd111dd21

A d=1 example:

1

P(p)

rp

L: y = x2

d

d2

s

t

Observation: dist(s,t) = dist(p,r)2 .

Page 71: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

. o tangent tis and (p)λ through passes

ax2ax2a x :)p( planehyper)a,,a,(a pd

1i

2idd111dd21

A d=1 example:

1

P(q)

P(p)

q p

L: y = x2

Page 72: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

p

P(p)

q

P(q)l(q)

l(p)

PB(p,q)

d

Page 73: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

• The projection of P(p)P(q) down to d is the perpendicular-bisector of p & q.

• P(p) is above P(q) at points of d that are closer to q.

• P+(p) = the closed half-space in d above P(p).

THEOREM:

Voronoi Diagram in d is obtained by projecting down the

intersection of half-spaces P+(p) , i=1..n, in d+1.

Duality Reminder: Intersection of half-spaces Convex-Hull of Points.

Page 74: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in d Half-Spaces in d+1

LEMMA: The projection down to d of the intersection of any

non-vertical hyper-plane in d+1 with the paraboloid of revolution

L : xd+1 = x12 + x2

2 + … + xd2 is a sphere in d.

Proof:

d

1i

2i

d

1i

2i

2d

211d

dd111d

.a4/1)x(

:sphere

xxx: Rev. of P.

xaxax:hyperplane

2ia

Page 75: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

COROLLARY: Consider 4 points pi = (xi , yi), i=1..4 in 2 , and

their immage l(pi) = (xi , yi , xi2 + yi

2) in 3.

1. pi are cocircular in 2 l(pi) are coplanar in 3.2. Point D=p4 is inside the circumcircle of A=p1, B=p2, C=p3

a1 + a3 < 180 (a2 + a4 > 180) l(D) is below the plane passing through l(A), l(B), l(C). D(A,B,C,D) and D(A,B,C) have the same sign. i.e.,

P 2 l(P) 3

0

1yx

1yx

1yx

)C,B,A( assuming

0

1yxyx

1yxyx

1yxyx

1yxyx

)D,C,B,A(

33

22

11

24

2444

23

2333

22

2222

21

2111

A

B

CD

a2

a4

a1

a3

Incircle(A,B,C,D)

Page 76: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A simple O(n2) time DT Algorithm

D

C

AB

Step 1: Let T be an arbitrary triangulation of P 2. [e.g., use sweep in O(n log n) time] Step 2: while T has a quadrangle of the form below with A + B > 180

do flip diagonal CD (i.e., replace it with diagonal AB). [O(n2) iterations]

D

C

AB

flip CD

don’t flip CD

C

AB

D

Fact 1: 6 sorted angles are lexicographically increased

Page 77: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

Page 78: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

e1

FLIP e1

Page 79: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

Page 80: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

e2

FLIP e2

Page 81: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

Page 82: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

FLIP e3

e3

Page 83: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

Page 84: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

A snapshot of the Algorithm

Page 85: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

FACTS

Proof: (1) There are at most O(n2) edges in the tetrahedronization in 3D. After an edge is flipped out, it cannot reappear. O(n2) flips at most

(2) Euler: n nodes, e edges, f faces, t tetrahedra, h hull vertices: n – e + f– t = 1 & 4t + (2h –4) = 2f t = e – (n + h – 3) = O(n2).

FACT 1: The flip operation cd ab is like attaching the tetrahedron

(a,b,c,d) to the “lifted convex-hull” in 3D constructed so far [so its volume increases].

Page 86: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

FACTS

The O(n2) bound on the number of flips is tight:

flip “inside out”

Page 87: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

FACTS

FACT 2: Let Cabc denote the circumcircle of triangle (a,b,c).

before

adbacb

after

bcdacd

adbacbbcdacd

CCCC)ii(

CCCC)i(

b

a

cd

Page 88: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

FACTS

FACT 3: A flip lexicographically increases the sorted sequence of 6 angles of the pairs of triangles involved before and after the flip.

COROLLARY 4: Each flip lexicographically increases the angle-vector of the triangulation.

THEOREM: DT(P) is the unique triangulation of P that lexicographically maximizes A(T ).

Page 89: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Randomized Incremental Construction

• Guibas, Knuth, Sharir [1990], “Randomized Incremental Construction of Delaunay and Voronoi Diagrams,” Proc. 17th Annual Int’l Coll. Automata & Lang. Progr. (CALP’90), LNCS 443, Springer-Verlag, 414-431.

• Edelsbrunner, Shah [1992], “Incremental Topological Flipping works for regular Triangulations,” CG, 43-52.

Page 90: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Randomized Incremental DT Algorithm1. Randomly permute the given sites, say p1, p2, … , pn.2. Construct Delaunay Triangulation of p1, p2, p3.3. for i 4 .. n do

(a) Find triangle (or outer-face) of DT that contains pi. (b) Add pi to that face and triangulate it. (c) Perform repeated “Incircle-Test” and do edge-flips.

4. return resulting DT.end

flip

pi

Inserting a new site pi :

Page 91: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Step 3(c): Use the “Histroy DAG”

Maintain all versions of the DT on top of one another, plus

appropriate links between overlapping “old” & “new” triangles.

This hierarchical structure will be used to perform the

point-location step 3(a) also.

No more preprocessing needed for nearest-neighbor queries.

The Voronoi Diagram can also be constructed in a similar

randomized manner with a hierarchical representation of all

the past history of insertions.

Page 92: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

ALGORITHM Randomized Incremental DT Construction 1. Initialize DT to “bounding-box” triangle W1 W2 W3 (3 points at

). 2. for k 1 .. n do 3. select a random site P not yet selected.4. locate triangle ABC that contains P.5. replace ABC by PAB, PBC, PCA6. X A ; progress true7. repeat 8. Y 3rd vertex of triangle left of PX9. if X & Y are not both some Wi (at ) then do10. find Z P s.t. XYZ is a current triangle11. if Incircle(P,X,Y,Z) then do12. flip triangles PXY & ZXY to PXZ & PZY13. progress false14. end if15. if progress then X Y16. end if17. until X = A and progressend

P

A

B

C

X

Y

P Z

expected time = O(n log n)

expected space = O(n)

Page 93: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Triangulation

D1 D2

D3

split D1

D2

D3

p

r

s

flip rs

D5

D3

p

r

s

D4

flip rt

D5

D7

p

r

s

D6

t

t

D1 D2 D3

D1 D2 D3

D1 D2 D3

D5

D4

D1 D2 D3

D5

D4

D6 D7

History DAG

Page 94: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

• History DAG will be used for Nearest Site Point Location query answering.

• Each node in History DAG has out-degree at most 3.

• When inserting a new site, all Delaunay edges created due to edge-flips are incident to the new site.

pipi

Page 95: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

THEOREM 1: The randomized Delaunay Triangulation algorithm satisfies the following properties on all inputs of size n:

(a) The expected total number of structural changes (i.e., edge-flips …) that happen to the diagram is only O(n). [The worst-case is Q(n2).]

(b) Using the History DAG, the amortized expected cost per site insertion is O(log n), i.e., the overall expected time is O(n log n).

THEOREM 2: Suppose the Delaunay diagram of m sites is already computed and n additional sites are to be added. If the new sites are randomly and incrememntally inserted into the diagram, then the total number of structural changes has expected value O(m log n + n) [and this bound is tight].

Proof: See next slides.

Page 96: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

x

y=1

Worst-case Q(n2) edge-flips:

insert first

insert next

Note: In any triangulation of the n sites:

# triangles = 2n – h – 2 2n

# edges = 3n –h – 3 3n

where h 3 is the # hull vertices.

Page 97: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

LEMMA 1: Expected # triangles created by the RIA is at most 9n + 1 = O(n).

Proof: Pk = { p1, p2, …, pk } the first k points (random).

Tk = Delaunay Triangulation of Pk {W1, W2, W3}.

# edges of Tk 3(k+3) –6 = 3k + 3.

# edges of Tk excluding triangle (W1, W2, W3) 3k.

E[degree of pk in Tk ] (2 3k) / k = 6.

Backwards analysis:

pk can be any of the points in Pk with equal probability.

# triangles created at iteration k 2 [degree of pk in Tk] – 3.

E[# triangles created in iteration k] 2 6 –3 = 9.

E[# triangles created in all iter.] 9n. [by linearity of expectation]

(The one extra in 9n+1 is the initial “bounding triangle (W1, W2, W3).

Page 98: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Definition: Consider a triangle D = (pi , pj , pk). C(D) = circumcircle of triangle D. X(D) = set of points in P that are in the interior of

C( )D . width(D) = || X(D) ||.

pi

pj

pk

Random-Sampling technique of Clarkson-Shor.

width = 0 D is a Delaunay triangle.

Page 99: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Expected time for all point-locations = O( n + D width(D) )

[where D is a Delaunay triangle at some iteration]

Why?

Point-location for insertion of site p:

• Starting with (W1, W2, W3) in the History DAG, trace the path of all

triangles that contain p.

• Charge the cost of each visited triangle node to either (W1, W2, W3) or a

triangle D that was Delaunay at some time.

• The total charge will be as above. (See next slide.)

Expected time = point locations + History DAG construction

Expected time excluding point-location

= expected size of the History DAG

= expected # triangles created by RIA

= O(9n + 1) = O(n).

Page 100: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Expected time for all point-locations = O( n + D width(D) )

[where D is a Delaunay triangle at the end of some iteration]

Width(D) = W

D will be charged by at most W points, at most once for each.

Why? Suppose point-location of p visits a triangle D. So, p is inside D, hence p X(D).(i) If D is Delaunay at the time of its creation, then charge that visit to D.(ii) If D is not Delaunay at the time of its creation, then charge that visit to its neighbor D’. (D’ must have been Delaunay.) p D p X(D’).

D D’

Page 101: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

LEMMA 2: E[ D width(D) ] = O(n log n).

Proof: Pk = { p1, p2, …, pk } (random). Tk = DT of Pk {W1, W2, W3}.

n

1k 1kk

)(width)(width)1TT

[pk is incident to D.]

Definition: for a point q P - Pk : R(Pk,q) = # triangles D Tk s.t. q X(D).

R(Pk,q, pk) = # triangles D Tk s.t. q X(D), and pk is a vertex of D.

k1kk PPq

kk )p,q,P(R)(width)2TT

),(),,()3 3 qPRpqPRE kkkk

k1kk PPqkk

3 )q,P(R)(widthE)4TT

kPPq

kkn1

1kk )q,P(R)p,P(RE)5

)p,P(RE)(widthE)6 1kkk

)kn(3

1kk

TT

4262||||E||||E)p,P(RE)7 k1k1kk1kk TTTT

k.over sum Now .)(widthE)8k

)kn(12

1kk

TT

Page 102: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

THEOREM 3: The randomized incremental algorithm calculates the Delaunay Triangulation of a set of n points in the plane in expected time O(n log n) & expected space O(n).

Remark: This expected time is optimum, since there is a linear time reductionfrom sorting to DT (i.e., xi (xi, xi

2) ) and expected time for sorting in

the algebraic decision-tree model of computation is W(n log n).

Page 103: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Generalizations & Applications

Page 104: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

RIA for 3D Convex HullIncremental construction of 3D Convex Hulls: Generalize the following idea to CH of any set P of n points in 3D.

on tetrahedra addflip

)yx,y,x()y,x(

CHDT22

THEOREM 4: The expected overall # of faces that appear during the randomized incremental construction of the lower-CH of a set P of n points in 3D is O(n).

Proof: width(XYZ) = # points of P that lie below the plane of XYZ. The rest of the proof is again by the random-sampling technique of Clarkson-Shor.

THEOREM 5: The randomized incremental construction of 3D convex hull takes optimal expected time O(n log n) and expected space O(n). [Worst-case could be Q(n2) time and space.]

Page 105: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

RIA for Voronoi DiagramIDEA: radial triangulation of Voronoi regions:

THEOREM 6: The expected size of the structure is O(n). The structure can be built in expected O(n log n) time. The above point-location structure can be used to locate the final

radial triangle that contains an arbitrary query point q in expected O(log2 n) time.

• Now apply previous ideas on these type of triangles. Each radial triangle is determined by at most 4 sites.

• No need for further point-location preprocessing for nearest-neighbors queries. The constructed structure will have that.

Page 106: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

The Post Office ProblemPROBLEM: Preprocess a given set P of n points in the plane for:Nearest Neighbor Query: Given a query point q, determine which point in

P is nearest to q.

Shamos [1976]: Slab Method:Query Time: O(log n)Preprocessing Time: O(n2)Space: O(n2)

Kirkpatrick [1983]: Triangulation refinement method for planar point location:Query Time: O(log n)Preprocessing Time: O(n log n)Space: O(n)

Construct Voronoi Diagram. Each Voronoi region is convex, hence monotone. Triangulate the Voronoi regions in O(n) time. Then apply Kirkpatrick’s method.

Andoni, Indyk [2006] “Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions,” FOCS’06.

Page 107: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Largest Empty Circle ProblemPROBLEM: Determine the largest empty circle with center in CH(P).

O(n) Candidate centers. All can be found in O(n) time (after VD(P) is given):(1) Voronoi vertex inside CH(P),(2) Intersection of a Voronoi edge and an edge of CH(P).

Page 108: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Gabriel Graph

Relative Neighborhood Graph

Euclidean Minimum Spanning Tree

Nearest Neighbor Graph

Subgraphs of Delaunay Triangulation

Page 109: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Nearest Neighbor Graph: (p,q) is a directed edge in NNG rP-{p,q}: d(p,q) d(p,r).

NNG EMST RNG GG DTp

q

Delaunay Triangulation:

(p,q) is a DT edge empty circle through p and q.

pq

Gabriel Graph: (p,q) is a GG edge $ empty circle with diameter (p,q),

(i.e., (p,q) intersects its dual Voronoi edge).

pq

lune

(p,q

)

Relative Neighborhood Graph: (p,q) is an RNG edge rP-{p,q}: (p,q) is NOT the longest edge of triangle (p,q,r) (i.e., d(p,q) max{d(p,r), d(q,r)})

(i.e., lune(p,q) is empty).

Euclidean Minimum Spanning Tree: (p,q) is in EMST cycles: (p,q) is NOT the longest edge of the cycle.

Page 110: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Delaunay Triangulation

Page 111: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Gabriel Graph:

Page 112: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Gabriel Graph:

Page 113: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Relative Neighborhood Graph:

Page 114: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Euclidean Minimum Spanning Tree:

Page 115: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

NNG EMST RNG GG DT

Delaunay TriangulationNearest Neighbor Graph:

Page 116: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Euclidean Minimum Spanning Tree

• General (m edge, n vertex graph) MST algorithms (See also AAW):

Kruskal or Prim O(m log n) or O(m + n log n) time.

Yao or Cheriton-Tarjan: O(m log log n) time

Chazelle: O(m a(m,n)) time.

• EMST requires W(n log n) time in the worst-case.

[Linear time reduction from the Closest Pair Problem.]

• EMST in O(n log n) time:

(1) Compute DT in O(n log n) time (# edges in DT 3n –6).

(2) Apply Prim or Kruskal MST algorithm to DT.

• Next we will show EMST can be obtained from DT in only O(n) time.

Page 117: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Euclidean Minimum Spanning Tree

• D. Cheriton, R.E. Tarjan [1976]

“Finding minimum spanning trees,” SIAM J. Comp. 5(4), 724-742.

• Also appears in §6.1 of [Preparata-Shamos’85].

• Cheriton-Tarjan’s MST algorithm works on general graphs.

When applied to a planar graph with n vertices and arbitrary

edge-weights, it takes only O(n) time.

• The following graph operations preserve planarity:

(a) vertex or edge removal,

(b) edge contraction (shrink the edge & identify its two ends):

e

Page 118: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Cheriton-Tarjan: MST algorithm (overview)

Input: edge-weighted graph G=(V,E)

1. Q (* queue of sub-trees *)

for v V do enqueue (v, Q) (* n single-node trees in Q *)

2. while |Q| 2 do

- let T1 be the tree at the front of Q

- find edge (u,v) E with minimum weight s.t. u T1 and v T1

- let T2 be the tree (in Q) that contains v

- T MERGE (T1 , T2) by adding edge (u,v)

- remove T1 and T2 from Q

- add T to the end of Q

- CLEAN-UP after each stage (see next slide)

end

Page 119: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Cheriton-Tarjan

)T,MERGE(TT if)}T(stage),T(stagemin{1

1|T| if0)T(stage

2121

Invariants:

(a) stage numbers of trees in Q form a non-decreasing sequence.

(b) stage(T)=j implies T has at least 2j nodes. So, stage(T) log |T|.

(c) after completion of stage j (i.e., the first time stage(T) > j, TQ)

there are n/(2j) trees in Q.

CLEAN-UP:After the completion of each stage do “clean-up”, i.e., shrink G to

G*, where G* is G with each edge in the same tree contracted, i.e., each tree in Q is contracted to a single node, with only those edges (u,v)G* , uT, vT’, That are shortest incident edges between disjoint trees T, T’.

Page 120: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Cheriton-Tarjan: Algorithm

PROCEDURE MST of a Graph G=(V,E)

1. Q (* initialize queue *)

for v V do stage(v) 0 ; enqueue (v, Q)

j 1

2. while |Q| 2 do

- let T1 be the tree at the front of Q

- if stage(T1) = j then CLEAN-UP; j j+1

- (u,v) shortest edge, s.t. u T1 and v T1

- let T2 be the tree (in Q) that contains v

- T MERGE (T1 , T2) by adding edge (u,v)

- stage(T) 1 + min{ stage(T1), stage(T2)}

- remove T1 and T2 from Q

- add T to the end of Q

end

Page 121: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Cheriton-Tarjan: Analysis

FACTS:

(a) A planar graph with m vertices has O(m) edges.

(b) Shrunken version of a planar graph is also planar

(c) CLEAN-UP of stage j takes O(n/2j) time.

(d) # stages log n

(e) During stage j each of the < 3n/ 2j edges of G* are checked

at most twice (once from each end). So, stage j takes O(n/ 2j) time.

(f) Cheriton-Tarjan’s algorithm on planar graphs takes:

)n(O

2

n6O Time Total

nlog

1jj

Page 122: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

THEOREM: The MST of any weighted connected planar graph with n

vertices can be computed in optimal O(n) time.

COROLLARY: Given DT(P) of a set P of n points in the plane,

the following can be constructed in O(n) time:

(a) GG(P),

(b) RNG(P),

(c) EMST(P),

(d) NNG(P).

Proof: (a) & (d): obvious. (c): use Cheriton-Tarjan on DT(P). (b): see Exercise.

Page 123: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Traveling Salesman Problem (TSP)

Input: An nn positive distance matrix D=(dij), i,j = 1..n, where dij is the travel distance from city i to city j.

Output: A traveling salesman tour T. T starts from the home city (say, city 1) and visits each city exactly once and

returns to home city.

Goal: minimize total distance traveled on tour T:

.d)T(CT)j,i(

ij

09312

5023

9105

11270

D

TOPT (1, 3, 4, 2) ((1, 3), (3,4), (4,2), (2,1))

C(TOPT) = d13 + d34 + d42 + d21

= 2 + 5 + 3 + 5

= 15

Page 124: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Some Classes of TSP

• General TSP : distance matrix D is arbitrary

• Metric-TSP: D satisfies the metric axioms

• Euclidean-TSP: n cities as n points in the plane with Euclidean inter-city distances

These are all NP-hard.

Related Problems:• Minimum Spanning Tree• Hamiltonian Cycle• Graph Matching• Eulerian Graphs

Page 125: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Hamiltonian Cycle Problem (HCP)

HCP: Given a graph G(V,E), does G have a Hamiltonian Cycle (HC)?HC is any simple spanning cycle of G, i.e., a cycle that goesthrough each vertex exactly once.

HCP is known to be NP-hard.

Hamiltonian(skeleton of dodecahedron)

Non-Hamiltonian(Peterson graph)

Page 126: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Graph Matching

Definition: • A matching M in a graph G(V,E) is a subset of the edges of G

such that no two edges in M are incident to a common vertex.

• Weight of M is the sum of its edge weights.• A perfect matching is one in which every vertex is matched.

A perfect matching M of weight 5+2+3+6=16 in graph G.

FACT: Minimum weight maximum cardinality matching can be obtained in polynomial time [Jack Edmonds 1965].

57

9

2

3 8

6

4

1

73

Page 127: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Min Weight Euclidean Matching

Given 2n points in the Euclidean plane, match them in pairs with n matching edges of minimum total length.

O(n3) on general weighted graphs: Jack Edmonds [1965]

O(n2.5 log4 n): P.M. Vaidya [1989], SICOMP 18(6), 1201-1225.

Mirzaian [1993], “Minimum weight Euclidean matching and

weighted relative neighborhood graphs,” WADS, 506-517.

Page 128: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Eulerian Graph

Definition: A graph G(V,E) is Eulerian if it has an Euler walk. Euler Walk is a cycle that goes through each edge of G exactly once.

FACT 1: A graph G is Eulerian if and only if (a) G is connected and (b) every vertex of G has even degree.

An Euleriangraph G

An Eulerwalk of G

FACT 2: An Euler walk of an Eulerian graph can be found in linear time.

Page 129: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

General TSP

THEOREM: Let r >1 be any constant. r-approximation of general TSP is also NP-hard.

[So, there is no polynomial-time r-approximation algorithm for general TSP,unless P=NP.]

Proof: Reduction from Hamiltonian Cycle Problem (HCP).HCP: Given G(V,E), is G Hamiltonian?

E)j,i(ifnρ1

E)j,i(if1d ij

G is Hamiltonian C(TOPT) = n.G is not Hamiltonian C(TOPT) n + rn (1+r) n > r n.

Suppose there were a poly-time r-approx TSP algorithm producing a tour T.C(T)/C(TOPT) r G has HC if and only if C(T) = n.

This would provide a poly-time algorithm for the HCP!

Reduction: Let n = |V|. Define the TSP distance matrix as:

Page 130: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Metric & Euclidean TSP

Metric Traveling Salesman Problem (metric-TSP): special case of general TSP (distance matrix is metric) NP-hard 2-approximation: Rosenkrants-Stearns-Lewis [1974] 1.5-approximation: Christofides [1976]

Euclidean Traveling Salesman Problem (ETSP): special case of Metric-TSP (with Euclidean metric) NP-hardPTAS: Sanjeev Arora [1996] [CSE4101/5101 Lecture Note 10].

Page 131: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

2-approximation of metric-TSP

Rosenkrants-Stearns-Lewis [1974] (See also AAW)

C(T) 2 C(TOPT)

• Minimum Spanning Tree (MST)

FACT 2: C(T) 2 C(MST) 2 C(TOPT) .

• Bypass repeated nodes on the Euler walk.

• Euler walk around double-MST

FACT 1: Triangle inequality implies bypassing nodes cannot increase length of walk.

Page 132: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

r = 2 is tight (even for Euclidean instances)

EuclideanInstance

MST Euler walkof double MST

Tour T Tour TOPT

2)n(ρlim)1(On21)1(12)T(C

O2)n(ρn)T(C

n

22n

2n

n1

OPT )T(C)T(C

OPT

Page 133: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1.5-approximation for metric-TSP

Christofides [1976]: C(T) 1.5 C(TOPT)

• MST• Odd degree nodes in MST• M = Minimum weight

perfect matching on odd-degree nodes

• E = MST + M is Eulerian. Find an Euler walk of E.

• Bypass repeated nodes on the Euler walk to get a TSP tour T.

FACTS: • Any graph has even # of odd degree nodes. (Hence, M exists.)• C(MST) C(TOPT)• C(M) 0.5 C(TOPT) (See next slide.)• C(E) = C(MST) + C(M) 1.5 C(TOPT)• C(T) C(E) 1.5 C(TOPT)

Page 134: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

C(M) 0.5 C(TOPT)

Odd degree node in MST

TOPT

Page 135: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

C(M) 0.5 C(TOPT)

C(M) C(M1)

M1

Odd degree node in MST

TOPT

Page 136: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

C(M) 0.5 C(TOPT)

C(M) C(M2)

M2

Odd degree node in MST

TOPT

Page 137: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

C(M) 0.5 C(TOPT)

C(M) C(M1) C(M) C(M2) 2 C(M) C(M1) + C(M2) C(TOPT)

M1

M2

Odd degree node in MST

TOPT

Page 138: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

r = 1.5 is tight (even for Euclidean instances)

Euclidean instance:

MST:

MST + M:

Tour T:

Tour TOPT :

Page 139: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Open ProblemWeighted Relative Neighborhood Graph (WRNG):

• RNG of a set of circular disks• This arises in EMWM computation [Mirzaian’93]• weighted distance (triangle inequality not satisfied):

jiijij rrdd~

FACT: WRNG WGG WDT.WDT and WGG can be computed in O(n log n) time.

Open Problem: Can WRNG be computed in O(n log n) time?

Page 140: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Minimum Weight Triangulation• Problem: Given a set P of n points in the Euclidean plane,

find a triangulation of P with minimum total edge length.

• MWT is NP-hard: [LN16: Mulzer-Rote, SoCG’06]• See LN17 & LN18 also.• Delaunay Triangulation can give W(n) approximation ratio:

e

DT MWT

• Greedy Approximation: W() approx. ratio: - Start the triangulation T with no edges. - Repeatedly select the shortest edge e (from unselected edges that do not cross any selected edges) and add e to T.

Page 141: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

In general, dynamic programming can be used for triangulation of point sets or polygons.

Point sets:

1. Maximize the minimum angle: Delaunay Triangulation , O(n log n)2. Minimize the maximum angle: SoCG’89-90, O(n2 log n)3. Minimize the longest edge: Use RNG4. Minimize total edge length: MWT [LN16,17,18]

Page 142: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Extensions of Voronoi Diagrams Voronoi Diagram of line-segments, circles, …

Medial Axis

Order k Voronoi Diagram

Farthest Point Voronoi Diagram (order n-1 VD)

Weighted Voronoi Diagram & Power Diagrams

Generalized metric (e.g., Lp metric)

Page 143: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD of line-segments & circles

parabola

par

line

line

line

line

par

par

hyperbola

line

Page 144: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Medial Axis• MA: Locus of centers of empty circles that touch 2 or more data points. [Blum’76]

• Applications: pattern recognition, medical CAT scan imaging, …

• MA of polygons in linear time: convex polygons: [Aggarwal et al. 1989] simple polygons: [Chin-Snoeyink-Wang, Discrete Comp. Geom.1999]

Page 145: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Higher Order VD• [PrS85] § 6.3• [Ede87] § 13.3-13.5• [ORo98] § 6.6.• Aurenhammer [1987], “Power diagrams: properties, algorithms, and

applications,” SIAM J. Computing 16, 78-96.• D.T. Lee [1982], “On k-Nearest Neighbors Voronoi Diagram in the Plane,”

IEEE Trans. Computers, C-31, 478-487.

Page 146: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1

2

3

5

4

1,2

7

68

1,3

3,7

7,8

6,8

5,8

5,62,5

2,4

4,5

1,44,6

3,4 4,7

6,7

Example: Order 2 Voronoi Diagram

Some Voronoi regions of order 2

are empty, e.g. (5,7).

Order k Voronoi DiagramGiven a set of n sites in space, partition the space into regions where any two points belong to the same region iff they have the same set of k nearest sites.

Page 147: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Order k Voronoi Diagram of P:

Order k Voronoi Diagram

TPpTp

jik

n21

j

i

)p,p(H)T(V

k|T|},p,,p,p{PT

Voronoi region of T (a convex polyhedron, possibly empty)

pi

pj

H(p i, p j) half-s

pace

k|T|

PTkk )T(V)P(VD

k

n possible subsets of size k. Most have empty Voronoi regions.

In 2D only O(k(n-k)) of them are non-empty [D.T. Lee’82].

Page 148: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VDk in d k-belt of

arrangement of hyperplanes in d+1

k-belt = region between level k and level (k+1) in the arrangement.

Level 2

Level 3

2-belt

Page 149: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Example: VD2 in 1

p1 p2p3 p4

1,2

2,3

3,4

x

y y=x2

Page 150: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

ALGORITHM Order-k VD of P 2 1. For each point p P do

- lift p onto L: z = x2 + y2, call it l(p) - P(p) plane tangent to L at l(p)

2. Construct k-belt of the arrangement of the planes P(p), p P, in 3.

3. Project down this k-belt onto the base plane 2. This is the k-th order Voronoi Diagram of P.

FACT 1: In O(n3) time we can compute all k-levels of the arrangement and find the k-th order VD.

Improvement by [D.T. Lee 1982]:

FACT 2: [Preparata-Shamos’85]:k-th order VD of n points in the plane can be obtained in timeO(min { k2 , (n-k)2 } n log n).

COROLLARY 3: Complexity of the k nearest neighbors query problem is:O(k + log n) Query TimeO(k2 n log n) Preprocessing TimeO(kn) Space.

Page 151: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in Lp metric

L metric: || p1 – p2 || = max { | x1 – x2 | , |y1 – y2 | }

“unit circle”p1 p2

L1 metric: || p1 – p2 ||1 = | x1 – x2 | + |y1 – y2 |

“unit circle”p1 p2

PB

PB

Page 152: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

VD in Lp metricVoronoi Diagram in L metric in O(n log n) time & O(n) space.

Largest empty square in O(n log n) time.

Page 153: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Robot Motion Planning

A

B

robot

obstacle

Assume robot moves by translation only (no rotation).

Page 154: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Robot Motion PlanningApproach:1. Voronoi Diagram2. Minkowski Sum AB = { p + q | p A, q B }

=

q

p

-q

A

AN

=

p-qdiam

eter(A)

AAN

Page 155: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

Exercises

Page 156: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

1. (a) Draw the Voronoi diagram of 10 points all on a line. (b) Draw separately the Voronoi diagram of 10 points all on a circle. (c) Draw the Voronoi diagram of 10 random points in the plane using the L1 metric instead of the L2

metric. Show an example of a Voronoi cell that is not convex.

2. Let P and Q be two point sets in the plane, and let p P and q Q be the two points from these sets that minimize dist(p,q). True or false: line-segment (p,q) is an edge of DT(P Q). Explain.

3. Dynamic maintenance of Voronoi Diagrams: We are given the Voronoi Diagram VD(P) of a set P of n points in general position in the plane.(a) Show how to delete a given point p P, thereby constructing the Voronoi Diagram of P-{p}. Your method should take O(k log k) time where k is the number of edges on the boundary of the Voronoi region corresponding to p. (b) Optional: Can you improve the running time of your algorithm for part (a) to O(k)?(c) We are given a point qP and a Delaunay triangle in DT(P) whose circumscribing circle contains q. Show how to insert q, thereby constructing the Voronoi Diagram of P{q}. Your method should take O(k) time, where k is size of the combinatorial “change” in the VD. [Note: DT(P) is not given.]

4. Modified Delaunay Triangulation: We are given the Delaunay Triangulation of a set P of n pointin the plane. Suppose the x-coordinate of each point in P with positive x-coordinate is increased by 1. There are no other changes to the coordinates of the points in P. How fast can you algorithmicallyupdate the Delaunay Triangulation of the modified P? Describe and justify your answer in detail.

5. Let S be a set of n segments in the Euclidean plane. The distance between two segments s1, s2 is defined as d(s1, s2) = min { d(p, q) | p s1, q s2 }. Describe a randomized algorithm for computinga nearest (respectively, farthest) pair of segments in S whose expected running time is O(n log n).

Page 157: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

6. Farthest Point Voronoi Diagram: The following problems have to do with the farthest-point Voronoi diagram. For a set S of n points in the plane, define the farthest-point Voronoi diagram of S, denoted FVD(S), as the union of farthest-point cells, where we define for each point pS, FV(p) to be the set of all points that have p as their farthest neighbor in S.

(a) Give an example of a set S and a point pS such that FV(p) is empty.(b) Show that each non-empty region in a farthest-point Voronoi diagram is unbounded and associated with a point on the convex hull of S.(c) Show that FVD(S) in the plane is a tree.(d) Define the farthest-point Delaunay Triangulation FDT(S) as the graph-theoretic planar dual of FVD(S). Derive a relationship between FDT(S) and the convex hull of the 3-dimensional set of points defined by mapping each point (x,y) S to the point (x,y, x2 +y2). Use this fact to design a simple O(n log n) time algorithm for constructing FVD(S).(e) Prove that each vertex v of FVD(S) corresponds to a circle C determined uniquely by the sites defining v such that C contains all the points of S.(f) Show how to use FVD(S) to compute the smallest-radius circle that contains S. What is the running time of your method?

7. Minkowski Sum: Let A and B be two convex polygons in the plane, with m and n vertices respectively. If we regard a point in the plane as a vector, then the Minkowski sum of A and B is defined as A B = {a + b a A , b B}. Show that A B is a convex polygon with at most m + n vertices. How fast can one compute A B?

Page 158: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

8. Hausdorf Distance: The set distance between two sets of points A and B is defined as d(A,B) = min {d(p,q) | pA , qB } , where d(p,q) is the Euclidean distance between points p and q. The directed Hausdorf distance from a set of points A to a set of points B is

H(A,B) = max {d(p,B) | pA } , and the Hausdorf distance between a set of points A and a set of points B is

D(A,B) = max { H(A,B), H(B,A)}. [This metric is used to measure similarity between two sets of points.]Outline an efficient algorithm for computing the Hausdorf distance between two sets, A and B, each containing n points in the plane. What is the running time of your method?

9. Voronoi Diagram in L metric: The L distance is dist(p, q) = max( |px − qx |, | py − qy | ).(a) Given a point q, describe the set of points that are at L distance w from q.(b) Given two points p and q, describe the set of points that are equidistant from p and q in the L distance. [Hint: The bisector is a polygonal curve. As a function of the coordinates of p and q, indicate how many vertices this curve has and where these vertices are located. Give exact formula, and not just a high-level description.](c) Argue that the Voronoi diagram for n sites in the L metric has O(n) line-segments and vertices. [Hint: First show that each cell of the Voronoi diagram is connected. Take care in your application of Euler's formula, since some vertices may have degree two.](d) Assuming that the L Voronoi diagram is given, describe a method to compute the largest empty axis-aligned square centered at a query point q. Your method should involve O(n) space and O(log n) query time. [You are not required to show how to build the data structure, only to argue its existence.]

Page 159: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

10. Let P = {p1, p2, … , pn} be the vertices of a convex polygon, given in counterclockwise order. The purpose of this problem is to modify the randomized incremental Delaunay triangulation algorithm torun in O(n) expected time. Unlike the algorithm presented in class, we do not put all the sites within a large bounding triangle. We start with the triangle defined by three random sites from P. The remaining sites are inserted in random order; each new site is connected to the convex hull, and edge flips are performed until the circumcircle condition is satisfied. (See the figure below.)

(a) Give a backwards analysis to show that the expected number of edge-flips performed with each insertion is O(1).(b) Whenever a new site is added, we need to determine where along the current convex hull it is to be added. Explain how to do this in O(1) expected time. You are allowed to preprocess the sites in O(n) time.

Page 160: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

11. Given a set P of n points in the plane in general position (no 3 collinear & no 4 cocircular), the objective of this problem is to determine the pair of concentric circles C1 and C2 such that every point of P lies between these circles, and the area of the region between these two circles is minimized. [Note: There is a harder variant of this problem in which the goal is to minimize the width of this region.]Consider the subdivision S formed by overlaying NVD(P) and FVD(P), the nearest and farthest Voronoi diagrams of P, respectively. The vertices of S consist of the union of the vertices of the two Voronoi diagrams together with the points at which two edges, one from each diagram, intersect each other.

(a) Prove that the center of the optimum concentric circles cannot lie in the interior of any face of S.(b) Prove that the center of the optimum concentric circles cannot lie in the relative interior of any edge of S.(c) Using (a) and (b), give an O(k + n log n)-time algorithm for solving this problem, where k is the number of vertices of S. (Assume NVD(P) and FVD(P) can be computed in O(n log n) time.)(d) Show that the problem can be solved in O(n) time by using the fact that linear programming with O(n) constraints and a constant number of variables can be solved in O(n) time.

C1

C2

Page 161: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

12. Determining whether a general graph has a spanning tree of degree at most three is NP-complete. In this problem, we consider this problem for planar triangulations. Given a connected graph G = (V,E), a spanning subgraph of G is any graph G’= (V,E’) with E’ E. A spanning tree is a connected acyclic spanning subgraph of G. Recall that a triangulation of a point set V is a PSLG whose vertex set is V, whose external face consists of the edges of the convex hull of V , and whose internal faces are triangles. Prove that any triangulation of a set of points in the plane (viewed as a planar graph) has a spanning tree of degree at most three. See Fig. (a).

 

[Hint: First prove the following by induction on the number of vertices. Consider any PSLG triangulation whose external face is homeomorphic to a circle. Such a graph is characterized by three conditions: its internal faces are triangles, there are at least three vertices on its external face, and every vertex on its external face has exactly two neighbors on the external face. Prove that such a PSLG has a connectedspanning subgraph of degree at most three such that every edge of the external face is in that subgraph. See Fig. (b).]

(a)(b)

Page 162: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

13. The Delaunay triangulation has an interesting monotonicity property with respect to ray shooting. To illustrate it, let us consider a triangulation T spanning a set P of n points in the plane. Let p be an arbitrary point in the plane. For any triangles ti and tj in T, we write ti <p tj if there exists a ray starting at

p such that a traveller traversing along the ray from p passes through ti before tj (see Figure (a) below).

If there is no cyclic sequence (t1 , t2 , ... , tk , t1 ) of triangles in T satisfying t1 <p t2 <p ... <p tk <p t1 ,

k ³ 2, we say that T is monotone with respect to ray shooting at p. If T is monomtone with respect to ray shooting at every point in the plane, we say T is ray-shoot monotone. Figure (b) below shows that not every triangulation is ray-shoot monotone. In that example t1 <p t2 because of ray r1, t2 <p t3 because of

ray r2 , and t3 <p t1 because of ray r3. Thus, t1 <p t2 <p t3 <p t1 . Therefore, this triangulation is not

monotone with respect to ray shooting at point p, and hence it is not ray-shoot monotone. Prove Delaunay triangulations are ray-shoot monotone. [Hint: use the lifting method.]

Page 163: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

14. Computing geometric properties of a union of spheres is important to many applications in bioinformatics. The following problem is a 2-dimensional simplification of one of these problems.

(a) You are given a set P of atoms representing a protein, which for our purposes will be represented by a collection of circles in the plane, all of equal radius ra . Such a protein lives in a solution of water. We will

model a molecule of water by a circle of radius rb > ra . A water molecule cannot intersect the interior of

any protein atom, but it can be tangent to one. We say that an atom a P is solvent-accessible if there exists a placement of a water molecule that is tangent to a, and the water molecule does not intersect any other atoms in P. In the figure below, all atoms are solvent-accessible except for three (as indicated). Given a protein molecule P of n atoms, devise an O(n log n) time algorithm to determine all solvent-inaccessible molecules of P.

(b) Solve the problem when atoms in P are of non-uniform size, i.e., they are circles of varying radii.

Page 164: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

15. Kinetic Delaunay Triangulation: We are given a set P = {p1 , ... , pn} of n stationary points and a moving point p0, all in the plane. Point p0 moves on a line trajectory with a given constant speed, i.e., at time t, this point is at location p0(t) = a × t + b, where a and b are given 2-vectors. Assume P is in general position (i.e., no three points collinear and no four points cocircular), and the trajectory line of p0 does not hit P. Consider the kinetic set Qt = P È {p0(t)} and its time varying Delaunay Triangulation DT(Qt ). We want to preprocess Qt into a compact data structure so that for any given query time t, we can efficiently extract DT(Qt ) from it.(a) Derive a bound on the combinatorial size of changes in DT(Qt ) as t goes from -¥ to +¥.(b) Design and analyze the preprocessing and query answering algorithms and the data structure.

16. Relative Neighborhood Graph: Suppose we are given the Delaunay Triangulation DT(P) of a set Pof n points, in general position, in the plane. We know that a Delaunay edge e is in RNG iff lune(e) is empty. Consider a Delaunay edge e that is not in RNG. Then, there must be some point pP (distinct from two ends of e) such that plune(e). We say such a site p kills edge e.(a) Show that if a Delaunay edge e is killed by a site p, then there is a sequence of one or more Delaunay edges (e1, e2, … , ek), all killed by p, e = ek , (p, e1) is a Delaunay triangle, and for i = 1..k-1, ei and ei+1 are two edges of a (common) Delaunay triangle.(b) Start with the Delaunay triangulation and assume its edges are coloured blue. Consider a triangle incident to site p whose opposite side is a blue edge e killed by p. Update the triangulation by an edge-flip that (permanently) removes blue edge e and adds a new red edge incident to p. Is it possible to remove all Delaunay edges killed by p with repeated application of such an edge-flipping process?(c) Can we make the blue edge removals in part (b) permanent, while we continue applying the same process, restarting with different sites p? In other words, is it true that after the process in part (b) is sequentially applied to all sites p, the surviving blue edges form the RNG?(d) Show that given DT(P), RNG(P) can be computed in O(n) time. (e) What is the computational complexity of the Weighted RNG (WRNG)?

Page 165: COSC 6114 Prof. Andy Mirzaian. Voronoi Diagram & Delaunay Triangualtion Algorithms  Divide-&-Conquer  Plane Sweep  Lifting into d+1 dimensions  Edge-Flip.

END