Delaunay triangulations: properties, algorithms, and complexity

Olivier Devillers 1-1 Delaunay triangulations: properties, algorithms, and complexity

Extra question: what is the difference between an algorithm and a program?

Olivier Devillers 1-2 Algorithm

Recipe to go from the input to the output

Formalized description in some language

May use data structure

Proof of correctness

Complexity analysis 2 Delaunay : definition, empty circle property

3-1 Delaunay Triangulation: definition, empty circle property

Point set

3-2 Delaunay Triangulation: definition, empty circle property

Point set

Query

3-3 Delaunay Triangulation: definition, empty circle property

Point set

Query

3-4 Delaunay Triangulation: definition, empty circle property

Point set

Query

3-5 Delaunay Triangulation: definition, empty circle property

Point set

Query

Nearest neighbor

3-6 Delaunay Triangulation: definition, empty circle property

Point set

Voronoi diagram

3-7 Delaunay Triangulation: definition, empty circle property

Point set

Voronoi diagram

3-8 Delaunay Triangulation: definition, empty circle property

Point set

Voronoi diagram

3-9 Delaunay Triangulation: definition, empty circle property

Point set

Voronoi diagram

3-10 Delaunay Triangulation: definition, empty circle property

Point set

Voronoi diagram

Delaunay triangulation

3-11 Delaunay Triangulation: definition, empty circle property

Point set

Delaunay triangulation

Empty circle property 3-12 Delaunay Triangulation: definition, empty circle property

Point set

Delaunay triangulation

Empty circle property 3-13 Delaunay Triangulation: size

4-1 Delaunay Triangulation: size

Vertices Edges Faces

Euler relation n e + t +1 =2

4-2 Delaunay Triangulation: size

Vertices Edges Faces

Euler relation n e + t +1 =2

triangular faces 3t + k =2e

4-3 Delaunay Triangulation: size

Vertices Edges Faces

Euler relation n e + t +1 =2

triangular faces 3t + k =2e

t =2n k 2 < 2n e =3n k 3 < 3n

4-4 Delaunay Triangulation: size

Vertices Edges Faces

Euler relation n e + t +1 =2

triangular faces 3t + k =2e

d(p)=2e =6n 2k 6 p S X2

1 E(d(p)) = n d(p) < 6 p S X2 average on the choice of point p in set of points S 4-5 Delaunay Triangulation: max-min angle

5-1 Delaunay Triangulation: max-min angle

Triangulation Delaunay

5-2 Delaunay Triangulation: max-min angle

Triangulation Delaunay

smallest angle

5-3 Delaunay Triangulation: max-min angle

Triangulation Delaunay

smallest angle

5-4 Delaunay Triangulation: max-min angle

Triangulation Delaunay

smallest angle

5-5 Delaunay Triangulation: max-min angle

Triangulation Delaunay

smallest angle second smallest angle 5-6 Delaunay Triangulation: max-min angle

Proof

6-1 Delaunay Triangulation: max-min angle Definition Delaunay edge

6-2 Delaunay Triangulation: max-min angle Definition Delaunay edge

empty circle 9

6-3 Delaunay Triangulation: max-min angle Definition locally Delaunay edge w.r.t. a triangulation

6-4 Delaunay Triangulation: max-min angle Definition locally Delaunay edge w.r.t. a triangulation

circle 9 not enclosing the two neighbors

neighbor = visible from the edge 6-5 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 ()

7-1 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 () Proof:

choose an edge

7-2 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 () Proof:

choose an edge

edges of the are locally Delaunay

7-3 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 () Proof:

choose an edge

edges of the quadrilateral are locally Delaunay

7-4 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 () Proof:

choose an edge

edges of the quadrilateral are locally Delaunay

Vertices visible through one edge are outside circle

7-5 Delaunay Triangulation: max-min angle Lemma ( edge: locally Delaunay) Delaunay 8 () Proof:

choose an edge

edges of the quadrilateral are locally Delaunay

Vertices visible through one edge are outside circle

Induction all vertices outside circle ! 7-6 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle ()

Two possible triangulation

8-1 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle () Case 1: smallest angle in corner

8-2 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle () Case 1: smallest angle in corner

<

asmallerangle other triangulation 8-3 9 2 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle () Case 2: smallest angle along diagonal

8-4 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle () Case 2: smallest angle along diagonal

8-5 Delaunay Triangulation: max-min angle Lemma For four points in convex position Delaunay maximize the smallest angle () Case 2: smallest angle < along diagonal

asmallerangle other triangulation 8-6 9 2 Delaunay Triangulation: max-min angle 6n 3k 4 Map: Triangulations R smallest angle ↵1 !

9-1 Delaunay Triangulation: max-min angle 6n 3k 4 Map: Triangulations R smallest angle ↵1 ! second smallest angle ↵2

9-2 Delaunay Triangulation: max-min angle 6n 3k 4 Map: Triangulations R smallest angle ↵1 ! second smallest angle ↵2 third smallest angle ↵3

9-3 Delaunay Triangulation: max-min angle 6n 3k 4 Map: Triangulations R smallest angle ↵1 ! second smallest angle ↵2 (↵1,↵2,↵3,...,↵6n 3k 4) third smallest angle ↵3

9-4 Delaunay Triangulation: max-min angle 6n 3k 4 Map: Triangulations R smallest angle ↵1 ! second smallest angle ↵2 (↵1,↵2,↵3,...,↵6n 3k 4) third smallest angle ↵3

sort triangulations in lexicographic order

9-5 Delaunay Triangulation: max-min angle Theorem: Delaunay maximizes minimum angles (in lexicographic order)

10 - 1 Delaunay Triangulation: max-min angle Theorem: Delaunay maximizes minimum angles (in lexicographic order) Proof: Let T be the triangulation maximizing angles

10 - 2 Delaunay Triangulation: max-min angle Theorem: Delaunay maximizes minimum angles (in lexicographic order) Proof: Let T be the triangulation maximizing angles

= convex quadrilateral (from 2 T ) )8 2 the diagonal maximizes smallest angle (in quad)

10 - 3 Delaunay Triangulation: max-min angle Theorem: Delaunay maximizes minimum angles (in lexicographic order) Proof: Let T be the triangulation maximizing angles

= convex quadrilateral (from 2 triangles T ) )8 2 the diagonal maximizes smallest angle (in quad)

= edge, it is locally Delaunay )8

10 - 4 Delaunay Triangulation: max-min angle Theorem: Delaunay maximizes minimum angles (in lexicographic order) Proof: Let T be the triangulation maximizing angles

= convex quadrilateral (from 2 triangles T ) )8 2 the diagonal maximizes smallest angle (in quad)

= edge, it is locally Delaunay )8

= T = Delaunay )

10 - 5 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

11 - 1 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

project on parabola

11 - 2 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

project on parabola

compute Delaunay triang.

11 - 3 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

project on parabola

compute Delaunay triang.

find lowest point

11 - 4 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

project on parabola

compute Delaunay triang.

find lowest point

enumerate x coordinates in ccw CH order

11 - 5 Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

O(n) project on parabola

f(n) compute Delaunay triang.

O(n) find lowest point

O(n) enumerate x coordinates in ccw CH order

Lower bound on sorting

= f(n)+O(n) ⌦(n log n) 11 - 6 ) Delaunay triangulation Lower bound

A stupid algorithm for sorting numbers

O(n) project on parabola

f(n) compute Delaunay triang.

O(n) find lowest point

O(n) enumerate x coordinates in ccw CH order

Lower bound on sorting

= f(n)+O(n) ⌦(n log n) 11 - 7 ) Delaunay Triangulation: predicates

12 - 1 Delaunay Triangulation: predicates Orientation predicate

r pqr +? q 111 xq xp xr xp = xp xq xr > 0 yq yp yr yp yp yq yr q pqr -? p 111 xp xq xr < 0 r yp yq yr p pqr 0? q

111 r xp xq xr =0 yp yq yr p 12 - 2 Delaunay Triangulation: predicates Incircle predicate r s

q p

pqr ccw

query s inside circumcircle

12 - 3 Delaunay Triangulation: predicates

r s

q p

pqr ccw triangle

query s cocircular

12 - 4 Delaunay Triangulation: predicates

r

s

q p

pqr ccw triangle

query s outside circumcircle

12 - 5 Delaunay Triangulation: predicates

r

q p

pqr ccw triangle

query s

12 - 6 Delaunay Triangulation: predicates

Space of circles

? 2 2 p =(x, y) p =(x, y, x + y )

12 - 7 Delaunay Triangulation: predicates

Space of circles

s inside/outside of circle through pqr ? ? ? plane through p q r above/below s?

incircle predicate 3D orientation predicate

12 - 8 Delaunay Triangulation: predicates

Space of circles

s inside/outside of circle through pqr ? ? ? plane through p q r above/below s?

incircle predicate 1111 xp xq xr xs 3D orientation predicate sign yp yq yr ys 2 2 2 2 2 2 2 2 x + y x + y x + y x + y p p q q r r s s 12 - 9 Delaunay Triangulation: data structure

Data structure for (Delaunay) triangulation

Representing incidences

Representing hull boundary

Representing user’s data put colors in triangles

13 Delaunay Triangulation: very naive algorithm

14 - 1 Delaunay Triangulation: very naive algorithm

For each triple of points (p, q, r) If pqr ccw Delaunay = true; For each point s If s in circle pqr Delaunay = false; Output pqr 14 - 2 Delaunay Triangulation: very naive algorithm

For each triple of points (p, q, r) If pqr ccw Delaunay = true; Correctness: easy For each point s If s in circle pqr Delaunay = false; Output pqr 14 - 3 Delaunay Triangulation: very naive algorithm

For each triple of points (p, q, r) If pqr ccw Delaunay = true; Correctness: easy For each point s Complexity: O(n4) If s in circle pqr Delaunay = false; Output pqr 14 - 4 Delaunay Triangulation: very naive algorithm

For each triple of points (p, q, r) If pqr ccw Delaunay = true; Correctness: easy For each point s Complexity: O(n4) If s in circle pqr Delaunay = false; Output pqr does not compute incidences 14 - 5 Delaunay Triangulation: incremental algorithm

15 - 1 Delaunay Triangulation: incremental algorithm

New point

15 - 2 Delaunay Triangulation: incremental algorithm

New point

Locate

15 - 3 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 4 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 5 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 6 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 7 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 8 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 9 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 10 Delaunay Triangulation: incremental algorithm

New point

Locate

e.g.: visibility walk 15 - 11 Delaunay Triangulation: incremental algorithm not unique New point

Locate

e.g.: visibility walk 15 - 12 Delaunay Triangulation: incremental algorithm not unique New point

Locate

e.g.: visibility walk 15 - 13 Delaunay Triangulation: incremental algorithm Visibility walk terminates

15 - 14 Delaunay Triangulation: incremental algorithm Visibility walk terminates

15 - 15 Delaunay Triangulation: incremental algorithm Visibility walk terminates

May loop

15 - 16 Delaunay Triangulation: incremental algorithm Visibility walk terminates

May loop

Not Delaunay 15 - 17 Delaunay Triangulation: incremental algorithm Visibility walk terminates

Delaunay Triangulation: pencils of circles

Power of a point w.r.t a circle 2 2 (x + y 2a0x 2b0y + c0) +(1 ) (x2 + y2 2ax 2by + c ) =0

blue yields smaller power

equal power black yields smaller power 15 - 18 Delaunay Triangulation: incremental algorithm Visibility walk terminates

15 - 19 Delaunay Triangulation: incremental algorithm Visibility walk terminates

Green power < Red power

15 - 20 Delaunay Triangulation: incremental algorithm Visibility walk terminates

Green power < Red power Power decreases 15 - 21 Delaunay Triangulation: incremental algorithm Visibility walk terminates

Green power < Red power Power decreases Visibility walk terminates 15 - 22 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 1 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 2 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 3 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 4 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 5 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 6 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 7 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 8 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 9 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 10 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 11 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 12 Delaunay Triangulation: incremental algorithm

New point

Locate

Search conflicts

16 - 13 Delaunay Triangulation: incremental algorithm

New point

16 - 14 Delaunay Triangulation: incremental algorithm

New point

16 - 15 Delaunay Triangulation: incremental algorithm

Proof of correctness

circle of new triangle 17 - 1 Delaunay Triangulation: incremental algorithm

Proof of correctness

circle of new triangle ⇢ [ 17 - 2 Delaunay Triangulation: incremental algorithm

Complexity

Locate

Search conflicts

18 - 1 Delaunay Triangulation: incremental algorithm

Complexity

Locate

Search conflicts ] triangles in conflict

] triangles neighboring triangles in conflict

18 - 2 Delaunay Triangulation: incremental algorithm

Complexity

Locate

Search conflicts ] triangles in conflict

] triangles neighboring triangles in conflict

degree of new point in new triangulation

18 - 3 Delaunay Triangulation: incremental algorithm

Complexity

Locate Walk may visit all triangles < 2n Search conflicts

degree of new point in new triangulation

18 - 4 Delaunay Triangulation: incremental algorithm

Complexity

Locate O(n) per insertion

Search conflicts

18 - 5 Delaunay Triangulation: incremental algorithm

Complexity

Locate O(n) per insertion

Search conflicts

O(n2) for the whole construction

18 - 6 Delaunay Triangulation: incremental algorithm

Complexity

Locate

Search conflicts

18 - 7 Delaunay Triangulation: incremental algorithm

Complexity

Locate

Search conflicts

Insertion: ⌦(n)

Whole construction: ⌦(n2)

18 - 8 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right

19 - 1 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right

19 - 2 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right Certified Delaunay triangles

19 - 3 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right Certified Delaunay triangles

19 - 4 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right Certified Delaunay triangles

19 - 5 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right Certified Delaunay triangles Certified Delaunay edges

19 - 6 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right

19 - 7 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right New point Locate vertically

I I

H H

19 - 8 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right New point Locate vertically Create edge

I I

H H

19 - 9 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right

Closing a triangle ?

19 - 10 Delaunay Triangulation: sweep-line algorithm

Discover the points from left to right

Next circle event Close triangle

19 - 11 Delaunay Triangulation: sweep-line algorithm Circle events Point events Complexity processed Number

Triangulation

List of events (x sorted)

List of boundary edges (ccw sorted) 20 - 1 Delaunay Triangulation: sweep-line algorithm Circle events Point events Complexity processed Number 2n n create create 2 triangles one edge Triangulation per event per event 3 deletions 2 deletions   2 insertions 2 insertions List of events (x sorted)   per event per event

List of boundary edges replace locate, then (ccw sorted) 2edgesby1 insert 2 edges per event per event 20 - 2 Delaunay Triangulation: sweep-line algorithm Circle events Point events Complexity processed Number 2n n create create 2 triangles one edge TriangulationO(1) per operation per event per event 3 deletions 2 deletions   per operation 2 insertions 2 insertions List(log of eventsn) (x sorted)   O per event per event

List of boundary edges replace locate, then n) per operation O(log (ccw sorted) 2edgesby1 insert 2 edges per event per event 20 - 3 Delaunay Triangulation: sweep-line algorithm Circle events Point events Complexity processed Number 2n n create create 2 triangles one edge TriangulationO(1) per operation per event per event 3 deletionsO(n log2 ndeletions)   per operation 2 insertions 2 insertions List(log of eventsn) (x sorted)   O per event per event

List of boundary edges replace locate, then n) per operation O(log (ccw sorted) 2edgesby1 insert 2 edges per event per event 20 - 4 Delaunay Triangulation: predicates

21 - 1 Delaunay Triangulation: predicates

x comparisons

21 - 2 Delaunay Triangulation: predicates

x comparisons y comparisons

21 - 3 Delaunay Triangulation: predicates

x comparisons y comparisons

more intricate than orientation and incircle

21 - 4 Delaunay Triangulation: divide & conquer (sketch)

22 - 1 Delaunay Triangulation: divide & conquer (sketch)

Divide

22 - 2 Delaunay Triangulation: divide & conquer (sketch)

Divide Recurse

22 - 3 Delaunay Triangulation: divide & conquer (sketch)

Divide Recurse Conquer

22 - 4 Delaunay Triangulation: divide & conquer (sketch)

Divide Recurse Conquer O(n log n)

22 - 5 Delaunay Triangulation: divide & conquer (sketch)

Divide Recurse Conquer O(n log n)

balanced linear time easier conquer

22 - 6 Jump and walk Use randomness hypotheses

23 - 1 Jump and walk Use randomness hypotheses

23 - 2 Jump and walk Use randomness hypotheses

23 - 3 Jump and walk Use randomness hypotheses Hopefully shorter walk

Designed for random points O(p3 n) expected location time

23 - 4 Jump and walk (no distribution hypothesis) Randomized

24 - 1 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= k

24 - 2 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= k n Walk length = O k choose k = p2 n

24 - 3 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= k Delaunay hierarchy n Walk length = O k choose k = p2 n

24 - 4 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= k n Delaunay hierarchy k1 n Walk length = O k choose k = p2 n

24 - 5 Jump and walk (no distribution hypothesis) Randomized n [] of in ]= k Delaunay hierarchy E k n + 1 k1 k2 n Walk length = O k choose k = p2 n

24 - 6 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= n k Delaunay hierarchy k + 1 + k2 + ... k1 k2 k3 n Walk length = O k choose k = p2 n

24 - 7 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= n k Delaunay hierarchy k + 1 + k2 + ... k1 k2 k3 n k Walk length = O k i = ↵ choose ki+1 choose k = p2 n

24 - 8 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= n k Delaunay hierarchy k + 1 + k2 + ... k1 k2 k3 n k Walk length = O k i = ↵ choose ki+1 choose k = p2 n

point location in O (↵ log↵ n)

24 - 9 Jump and walk (no distribution hypothesis) Randomized n E [] of in ]= n k Delaunay hierarchy k + 1 + k2 + ... k1 k2 k3 n k Walk length = O k i = ↵ choose ki+1 choose k = p2 n

point location in O (↵ log↵ n)

point location in O (p↵ log↵ n)

24 - 10 Technical detail

Walk length = O ] = O n ( of in ) k

25 - 1 Technical detail

Walk length = O ] = O n ( of in ) k

random point

not a random point

25 - 2 Technical detail

Walk length = O ] = O n ( of in ) k

random point

not a random point 1 1 E [d ]= dNN(q)= dv n n q q v=NN(q) X 1 X X1 = dv 6dv 36 n  n  25 - 3 v v X q;v=XNN(q) X Technical detail d

Walk length = O ] P = O n ( of in ) k

random point

not a random point 1 1 E [d ]= dNN(q)= dv n n q q v=NN(q) X 1 X X1 = dv 6dv 36 n  n  25 - 4 v v X q;v=XNN(q) X Randomization

Drawbacks of random order non locality of memory access data structure for point location

Hilbert sort

26 27 - 1 27 - 2 27 - 3 27 - 4 Drawbacks of random order non locality of memory access data structure for point location Hilbert sort Walk should be fast Last point is not at all a random point no control of degree of last point 28 Biased Random Insertion Order (BRIO)

29 - 1 Biased Random Insertion Order (BRIO)

29 - 2 Biased Random Insertion Order (BRIO)

29 - 3 Biased Random Insertion Order (BRIO)

29 - 4 Biased Random Insertion Order (BRIO)

29 - 5 Biased Random Insertion Order (BRIO)

29 - 6 Algorithm

Recipe to go from the input to the output

Formalized description in some language

May use data structure

Proof of correctness

Complexity analysis 30 - 1 Algorithm Program

Recipe to go from the input to the output Implementation of an algorithm Formalized description in some language Translation in a programming language (C++) May use data structure May use software library Proof of correctness Debugging Complexity analysis 30 - 2 Running time Algorithm may be difficult to transform into Program

Recipe to go from the input to the output Implementation of an algorithm Formalized description in some language too complicatedTranslation in a programming language (C++) May use data structure too complicated May use software library inexistant Proof of correctness Computation model Debugging O notation big Complexity analysis

30 - 3 Running time actual computer(cache, prediction. . . ) The31 end