CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9:...

23
CS 763 F20 A. Lubiw, U. Waterloo Lecture 9: Voronoi Diagrams Voronoi diagram Given points P = {p 1 , . . . , p n } in the plane, the Voronoi region of p i is p i is called a site. The Voronoi diagram consists of all the Voronoi regions To see that the Voronoi diagram consists of straight line segments: CS763-Lecture9 1 of 23 . . i . - i - - in : - . , noise ( ( : Hctigpj ) - points closer totithanpj it . -_ half-plane pi . t.tt - i Epi )=j±?HCpi , pj ) i t%p ; HE ,pj )

Transcript of CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9:...

Page 1: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Voronoi diagram

Given points P = {p1, . . . , pn} in the plane, the Voronoi region of pi is

pi is called a site.

The Voronoi diagram consists of all the Voronoi regions

To see that the Voronoi diagram consists of straight line segments:

CS763-Lecture9 1 of 23

.

.

- i

•.

- i-- in :

-

.

, noise(

(

:

Hctigpj ) - points closer totithanpj it .

-_ half-plane pi. t.tt -

i

✓ Epi)=j±?HCpi , pj ) i t%p;HE,pj)

Page 2: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

CS 763 Computational GeometryPost Office Problem: find the closest post office. O(n) ?

Application: Post Office Problem

Given n points in the plane (post offices) preprocess to handle query: which post office is closest to query point p

Voronoi Diagram

CS 763 Computational GeometryPost Office Problem: find the closest post office. O(n) ?

Compute the Voronoi diagram.Query becomes: which region contains p ?This is Planar Point Location.

— also closest airfield for airplane in flight.

Recall

CS763-Lecture9 2 of 23

Page 3: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

History

Georgy Voronoy, 1908, Russian/Ukrainian mathematician

but Voronoi diagrams were used before that:- Descartes 1644- Dirichlet 1850, “Dirichlet tessellation” - used to prove

unique reducibility of quadratic forms

also used in- crystallography - crystals growing outward from “seeds” form Voronoi regions- epidemiology, 1854, mapping cholera by proximity to infected water pump in London- geography and meteorology - “Thiessen polygons” 1911- condensed matter physics - “ Wigner–Seitz cells”- natural sciences - “Blum’s transform” = medial axis of polygon, used to describe shapes- aviation, to identify nearest airfield

dual structure: Delaunay triangulation

Boris Delone (but used French transliteration “Delaunay”), 1934

https://en.wikipedia.org/wiki/Voronoi_diagram

CS763-Lecture9 3 of 23

Page 4: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Descartes 1644

CS763-Lecture9 4 of 23

Page 5: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Some nice illustrations, including Voronoi diagram of moving points

http://datagenetics.com/blog/may12017/index.html

http://datagenetics.com/blog/may12017/anim2.gif

https://www.youtube.com/watch?v=z3yy5aBv0ug

CS763-Lecture9 5 of 23

Page 6: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

http://i.stack.imgur.com/gcajM.gif

CS763-Lecture9 6 of 23

Page 7: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Voronoi diagram of US Starbucks

Jim Davenport

CS763-Lecture9 7 of 23

Page 8: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Voronoi diagram of capital cities

CS763-Lecture9 8 of 23

Page 9: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

http://www.flong.com/projects/zoo/

CS763-Lecture9 9 of 23

Page 10: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

http://blog.kleebtronics.com/voronoi/

CS763-Lecture9 10 of 23

Page 11: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Terminology site

Voronoi vertex

Voronoi edge

Properties

- empty circle property

- degrees of Voronoi vertices?

- shape of Voronoi cells?

- when is a cell unbounded?

- number of vertices/edges/cells

Voronoi cell

CS763-Lecture9 11 of 23

Con next slide)

Page 12: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Terminology site

Voronoi vertex

Voronoi edge

Properties

- empty circle property

- degrees of Voronoi vertices?

- shape of Voronoi cells?

- when is a cell unbounded?

- number of vertices/edges/cells

Voronoi cell

empty circle = no sites inside

CS763-Lecture9 12 of 23

Voronoi vertex thefor each stain, makeancircle centered at vertexthrough the 3 Cor more? I equally close sitesThen this circle has no other site inside it\ degree =3 assuming no 4 co -circularpoints .

\convex polygons (may be unbounded )

} on next sides\ # cells =#sites = n

Page 13: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Properties of Voronoi diagram

V(pi ) is unbounded iff pi is on the convex hull of the sites

There are ≤ 2n Voronoi vertices and ≤ 3n Voronoi edges

CS 763 F20

CS763-Lecture9 13 of 23

÷:

missin":c::y÷÷÷÷÷÷"'

iii. insideinf . ray invcpi) ' .Asx -70 on the ray , get empty

half-planeEuler :r-etf-zf-n-ftsites.fiNote : deal with infinite edges by adding a'

'

point at

, infinity" where all infinite edges go .

( every vertex has degree 33i t '

i s 2e=Edegr 230I s

to '

s

- 2=v- etf Ev - EwtnEpt at infinity vs In -27

CE 3cm - 2) .

Page 14: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Delaunay triangulation

The Voronoi diagram can be captured by a purely combinatorical structure (versus computing coordinates of Voronoi vertices)

Given points P = {p1, . . . , pn } in the plane, the Delaunay triangulation isa graph with vertices p1, . . . , pn and edge (pi , pj ) iff V(pi ) and V(pj ) share an edge.

is the planar dual of

CS 763 F20

Voronoi edgesDelaunay edges

siteNote: a Voronoi edge and its corresponding Delaunay edge do not always cross.

CS763-Lecture9 14 of 23

Page 15: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Delaunay triangulation

CS 763 F20

Properties

- it is a triangulation

- edge/face iff empty circle through those sites

- what is the boundary ?

Voronoi edgesDelaunay edges

site

CS763-Lecture9 15 of 23

(next slide

Page 16: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Delaunay triangulation

CS 763 F20

Properties

- it is a triangulation

- edge/face iff empty circle through those sites

- what is the boundary ?

Voronoi edgesDelaunay edges

site

CS763-Lecture9 16 of 23

✓ Delaunay triangulation

.

:c:::::'

namesima :::÷.

Page 17: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Properties of Delaunay triangulations

(pi , pj ) is an edge iff there is an empty circle through pi pj

Proof

CS763-Lecture9 17 of 23

-- -

n

pi i n

Cpi ,p;) is an edge of DCP)

i•*. I

if vcpi) and V Cpj) share i i,

>C l i

a boundary points ( using no not - --

4 co- circular) Pj

if the circle centered atx through pi and pjis empty ( has no other sites )

DX

⑤ Ya'm't Vusi)happen Yf⇒Kpi

Page 18: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Properties of Delaunay triangulations

No two Delaunay edges cross

Note that this must be proved — it is not true for general planar maps

Proof

CS763-Lecture9 18 of 23

Suppose cu , v) and Gc , y)

care Delaunay edges that cross

u ••① 4479 are sites ,÷:G- Consider circles through u and ✓

One , say C ,is empty (by previous prop .)

where are a and y ?Must lie outside C and Ky crosses urso one to either side

claim : then # an empty circle though x andy .

Needs a bit more proof . DX

Page 19: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Properties of Delaunay triangulations

Sites form a face iff there is an empty circle through themi.e., (since we assumed no 4 sites on a circle)pi pj pk form a face iff there is an empty circle through them

Proof

CS763-Lecture9 19 of 23

Suppose there is an empty circle BE-

'

-

⇐ M'

By above we have ff\3 edges pi Pj pjpkpkpi ATE

and nothing crosses them*s'.- -

-

t Pk

so this d is a face

⇒Suppose pistz.pk form a face .

pi.• bgkia.fm?iirtdeisthrgpgs.h3 points*

q No site inside d.(because it is a face>Pi can there be a site q ?

No , because otherwise there isno empty circle through pi and pj .

Page 20: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Properties of Delaunay triangulations

The boundary of the Delaunay triangulation is the convex hull of the sites

Proof

CS763-Lecture9 20 of 23

ideae= cu ,

o) is an edge of CH

?! . . . . . . , if perpendicular bisector•

°

!! .'

'

iq

is unbounded Vor . edgea a @

( v int. large empty circles

i. through u and riff no o in Dlp) on thatside of ur

iff Cup is boundary edgeof triangulation .

Page 21: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

An alternative definition of Delaunay triangulation:

for each empty circle through 3 points, add a triangle

(part of)

CS 763 F20

Delaunay triangulation

CS763-Lecture9 21 of 23

withoutgoing via Voroui diagram

Page 22: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

Application of Delaunay triangulations: finding all nearest neighbours

Given n points in the plane find, for each point, its nearest neighbour — gives nearest neighbour graph, a directed graph of out-degree 1.

Many applications, e.g.

in statistical analysis:find hierarchical clusters usingnearest neighbour chain algorithm

https://demonstrations.wolfram.com/NearestNeighborNetworks/

CS 763 F20

More on this in the next lecture.

CS763-Lecture9 22 of 23

Page 23: CS 763 Computational Geometryalubiw/CS763/CS763-Lecture9-final.pdf · (nextslide. Lecture 9: Voronoi Diagrams A. Lubiw, U. Waterloo Delaunay triangulation CS 763 F20 Properties -

CS 763 F20 A. Lubiw, U. WaterlooLecture 9: Voronoi Diagrams

References

- [CGAA] Chapters 7, 9

- [Zurich notes] Chapters 5, 7 (they start with Delaunay)

- [O’Rourke] Chapter 5

- [Devadoss-O’Rourke] Chapter 4.

Summary

- Voronoi diagram and Delaunay triangulation definitions, relationships, properties

CS763-Lecture9 23 of 23