OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague...

49
OI-OPPA. European Social Fund Prague & EU: We invest in your future.

Transcript of OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague...

Page 1: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

OI-OPPA. European Social FundPrague & EU: We invest in your future.

Page 2: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

k-th order Voronoi diagrams

Petr EgertA4M39VG winter 2012/2013

Page 3: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

2

Outline

• Introduction• Relation to other VDs• Direct GVP construction• Iterative algorithm description• Questions

Page 4: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

3

Introduction

Page 5: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

4

k-th order Voronoi diagram

• Also called Higher Order Voronoi Diagram (HOVD)

• Notation Vork(S)

• Union of GVPs• Returns k nearest neighbours by finding the

appropriate GVP• Extendible to higher dimensions

– 2D case used here

Page 6: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

5

Generalized Voronoi Polygon

• GVP• Notation V(T)

– Each site in T closer to point p than any site not in T

– ie. V({1,2}) = area, where sites 1 and 2 are closer than any other sites

• Always convex• Can be empty

Page 7: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

6

Example

• k = 2

Page 8: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

7

Relation to other VDs

Page 9: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

8

Ordinary VD

• k = 1– Vor

1(S) = Ordinary Voronoi diagram

Page 10: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

9

Farthest point VD

• k = N - 1– Vor

n-1(S) = Farthest point Voronoi diagram

Page 11: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

10

Direct GVP construction

Page 12: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

11

Direct GVP construction●V(T) = intersection of all halfplanes, except for those created by bisections of T

1.Compute bisections of each site in T with all other sites, except for those in T

2.Intersect all halfplanes containing the given site● The resulting GVP can be empty

Page 13: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

12

Example - V({1,2,4})

Page 14: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

13

Example - V({1,2,4})

• Find bisections between 1 and all others– Ignore those within T, ie. H(1,2) and H(1,4)

Page 15: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

14

Example - V({1,2,4})

• Find bisections between 2 and all others– Ignore those within T, ie. H(2,1) and H(2,4)

Page 16: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

15

Example - V({1,2,4})

• Find bisections between 4 and all others– Ignore those within T, ie. H(4,1) and H(4,2)

Page 17: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

16

Example - V({1,2,4})

• Intersect all the halfplanes

Page 18: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

17

Example - V({1,2,4})

• The resulting GVP is found

Page 19: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

18

Example - V({1,2,4})

• Repeat for each combination get the whole diagram

Page 20: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

19

Pros and Cons

• Pros– Can construct a single GVP– Can construct order-k diagram directly– Higher order means less processing

• Cons– O( ) time complexity– Processing power wasted on empty GVPs

Nk

Page 21: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

20

Iterative algorithm

Page 22: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

21

Iterative algorithm

• Computes Vork(S) from Vor

k-1(S)

• Idea– In Vor

k-1(S) we already know k-1 closest sites

– To obtain k closest sites, it's enough to find the missing one

Page 23: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

22

The algorithm

• Start with a known Vork-1

(S)

– ie. ordinary Vor1(S) in the beginning

• Repartition each GVP of Vork-1

(S) using the next closest site in range

• Collapse neighbouring cells having the same closest sites

• Vork(S) is obtained

Page 24: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

23

GVP repartitioning• Idea

– Intersect V(T) with Vor1(S-T)

• Explanation– Ordinary VD created from (S-T) contains, for any

location, the closest site not already in T– Each given point p located inside V(T) is known to

be closest to T• This holds even if V(T) is subdivided

– Subdividing V(T) by Vor1(S-T) produces regions

closest to both T and the next closest site

Page 25: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

24

Example

Page 26: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

25

Example

• Start with Vor1(S)

Page 27: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

26

Example

• Repartition each GVP– Starting with V({1})

Page 28: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

27

Example

• Compute Vor1(S-T)

– T = {1}, computing Vor1({2,3,4})

Page 29: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

28

Example

• Intersect V(T) with Vor1(S-T)

– T = {1}

Page 30: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

29

Example

• New subdivision for V(T) is obtained

Page 31: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

30

Example

• Continue with V(T)– T={2}

Page 32: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

31

Example

• Compute Vor1(S-T)

– T = {2}, computing Vor1({1,3,4})

Page 33: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

32

Example

• Intersect V(T) with Vor1(S-T)

– T = {2}

Page 34: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

33

Example

• New subdivision for V(T) is obtained– T = {2}

Page 35: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

34

Example

• New subdivision for V(T) is obtained– T = {3}

Page 36: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

35

Example

• New subdivision for V(T) is obtained– T = {4}

Page 37: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

36

Example

• Collapse neighbouring cells with same T• Collapse neighbouring cells with same T

Page 38: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

37

Example

• Collapse neighbouring cells with same T• Collapse neighbouring cells with same T

Page 39: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

38

Example

• Vor2(S) is obtained

Page 40: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

39

Example

• Repartition each GVP– Starting with V({1,4})

Page 41: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

40

Example

• Compute Vor1(S-T)

– T = {1,4}, computing Vor1({2,3})

Page 42: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

41

Example

• Intersect V(T) with Vor1(S-T)

– T = {1,4}

Page 43: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

42

Example

• New subdivision for V(T) is obtained

Page 44: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

43

Example

• Repeat previous steps to obtain Vor3(S)

Page 45: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

44

Complexity

• Space– O(k(n-k))

• Computing Vork(S) from Vor

k-1(S)

– O(k(n-k))• Each of k(n-k) GVPs in Vor

k-1(S) needs to be reevaluated

• Computing Vork(S) from scratch

– O(n log n + k(k(n-k)))• n log n to build the first VD, then k iterations taking k(n-k) time

each

Page 46: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

45

Thanks for your time!

Page 47: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

46

Questions?

Page 48: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

47

References and image sources• Preperata F.P.- M.I.Shamos: Computational Geometry An

Introduction. Berlin, Springer-Verlag,1985.• http://www.iitg.ac.in/rinkulu/cg/slides/vor-higherorder.pdf

– R. Inkulu: Computational geometry lecture slides• http://cw.felk.cvut.cz/lib/exe/fetch.php/misc/projects/oppa_

oi_english/courses/ae4m39vg/lectures/07-voronoi-ii.pdf– P. Felkel: Computational geometry lecture slides

• http://www.pollak.org/en/otherstuff/voronoi/– Demonstration applet by Andreas Pollak

Page 49: OI-OPPA. European Social Fund Prague & EU: We invest in ... · OI-OPPA. European Social Fund Prague & EU: We invest in your future. k-th order Voronoi diagrams Petr Egert A4M39VG

OI-OPPA. European Social FundPrague & EU: We invest in your future.