Successfully reported this slideshow.
Upcoming SlideShare
×

# A Sweepline Algorithm for Higher Order Voronoi Diagrams

1,113 views

Published on

We present an algorithm to construct order-k Voronoi diagrams with a sweepline technique. The sites can be points or line segments. The algorithm has O(k^2n log n) time complexity and O(nk) space complexity.

Demo: http://zavermax.github.io/

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### A Sweepline Algorithm for Higher Order Voronoi Diagrams

1. 1. Maksym Zavershynskyi joint work with Evanthia Papadopoulou Università della Svizzera Italiana Lugano, Switzerland Supported in part by the Swiss National Science Foundation (SNF) grant 200021-127137. Also by SNF grant 20GG21-134355 within the collaborative research project EuroGIGA/VORONOI of the European Science Foundation. A Sweepline Algorithm for Higher OrderVoronoi Diagrams Tuesday, July 16, 2013
2. 2. Nearest NeighborVoronoi Diagram The nearest neighborVoronoi diagram is the partitioning of the plane into regions, such that all points within a region have the same closest site. Tuesday, July 16, 2013
3. 3. Higher OrderVoronoi Diagram The order-kVoronoi diagram is the partitioning of the plane into regions, such that all points within an order-k region have the same k nearest sites. V2({s1, s2}, S) s1 s2 Tuesday, July 16, 2013
4. 4. Related Work • Structural complexity of the order-kVoronoi diagram: • for points [Lee’82] • line segments [Papadopoulou&Zavershynskyi’12] O(k(n − k)) O(k(n − k)) Tuesday, July 16, 2013
5. 5. Related Work • Iterative construction algorithm: • Time • Space • Can be used to construct all order-iVoronoi diagrams, for O k2 n log n O k2 (n − k) i = 1, . . . , k Tuesday, July 16, 2013
6. 6. Construction Algorithms Construction Time Reference ChazelleEdelsbrunner’87 Clarkson’87 Aurenhammer’90 Mulmuley’91 Boissonnat et al.’93 Agarwal et al.’98 Chan’98 Ramos’99 O n2 + b log2 n O n1+ k O nk2 + n log n O nk3 + n log n O n log3 n + nk log n O (n log n + nk log n) O n log n + nk2c log∗ k O nk2 log n Tuesday, July 16, 2013
7. 7. Construction Algorithms Construction Time Reference ChazelleEdelsbrunner’87 Clarkson’87 Aurenhammer’90 Mulmuley’91 Boissonnat et al.’93 Agarwal et al.’98 Chan’98 Ramos’99 O n2 + b log2 n O n1+ k O nk2 + n log n O nk3 + n log n O n log3 n + nk log n O (n log n + nk log n) O n log n + nk2c log∗ k O nk2 log n Expected For Points! Tuesday, July 16, 2013
8. 8. Construction Algorithms • Based on Fortune’s algorithm • For points and line segments • Deterministic • Simple • Easy to implement Sweepline approach? Tuesday, July 16, 2013
9. 9. The Algorithm Tuesday, July 16, 2013
10. 10. The Idea • Consider horizontal line l • Wave-curve w(s) is the locus of points equidistant from l to s Tuesday, July 16, 2013
11. 11. • Let be the set of line segments that intersect the upper halfplane. • Consider an arrangement of wave-curves The Idea S w(s), s ∈ S Tuesday, July 16, 2013
12. 12. The Idea • Consider k-level Ak • Lower envelope is 1-level Ak Tuesday, July 16, 2013
13. 13. The Idea • Consider k-level Ak • Lower envelope is 1-level Breakpoint Wave Tuesday, July 16, 2013
14. 14. The Idea • While the horizontal line moves down, the breakpoints of Ak and Ak+1 levels move along the edges of the order-kVoronoi diagram. Tuesday, July 16, 2013
15. 15. The Events • Simulate the discrete event points that change the topological structure of k-level while line l moves down. • We store the adjacency relations! Site Events Circle Events Tuesday, July 16, 2013
16. 16. Site Events • Occur when the line hits a new line segment. • We insert the corresponding wave-curve and update all levels. Tuesday, July 16, 2013
17. 17. Site Events a1, am1. . . , b1, bm2. . . , c1, cm3 . . . , . . . , d1, dm4 A1 : A2 : A3 : A4 : A1 A2 A3 A4 . . . , . . . , . . . , . . . , ai, bj, cr, ds, Adjacency relations: x Tuesday, July 16, 2013
18. 18. Site Events a1, am1. . . , b1, bm2. . . , c1, cm3 . . . , . . . , d1, dm4 A1 : A2 : A3 : A4 : A1 A2 A3 . . . , . . . , . . . , . . . , ai, bj, cr, ai, , ai, bj, bj, cr, cr, ds, ds, Adjacency relations: x, x, x, x, x, x, x A4 A5 : x, xds, Tuesday, July 16, 2013
19. 19. Circle Events • Occur when 3 wave-curves intersect at a common point a b c Tuesday, July 16, 2013
20. 20. Circle Events • Occur when 3 wave-curves intersect at a common point a b c Tuesday, July 16, 2013
21. 21. Circle Events • Occur when 3 wave-curves intersect at a common point a b c Tuesday, July 16, 2013
22. 22. Circle Events a b c Ai : Ai+1 : Ai+2 : a, b, c, c b, a, b c, a Adjacency relations: Tuesday, July 16, 2013
23. 23. Circle Events a b c Ai : Ai+1 : Ai+2 : a, b, c, c b, a, b c, a Adjacency relations: Tuesday, July 16, 2013
24. 24. Circle Events • Precompute the circle events of all triples of the consecutive waves. • A new triple appears - create the circle event • An old triple disappears - remove the circle event Tuesday, July 16, 2013
25. 25. Maintaining the ≤k-level • The breakpoints of k-level and (k+1)-level move along the edges of the order-kVoronoi diagram • We need to keep track of k-level! • A new wave may be introduced to k-level: • By Site Events • From (k-1)-level and (k-2)-level by Circle Events • We need to maintain ≤k-level! Tuesday, July 16, 2013
26. 26. Data Structures • Event queue: • Queue: Site Events, sorted by y-coordinate. • Balanced Binary Tree: Circle Events, sorted by y-coordinate of the bottom-most point of the circle. • Levels 1,...,k: • Balanced Binary Tree for each level: Sequence of waves that constitute the level. Tuesday, July 16, 2013
27. 27. Time and Space Analysis Tuesday, July 16, 2013
28. 28. Maximum Size of the ≤k-level? • The complexity of the ≤k-level in arrangement of Jordan curves [SharirAgarwal’95, Clarkson’87] • Complexity of the lower envelope [Fortune’87] • Therefore the complexity of the ≤k-level is: g≤k(n) = O k2 g1(n/k) g1(n) = O(n) g≤k(n) = O(kn) Tuesday, July 16, 2013
29. 29. Maximum Size of the Event Queue? • Event Queue: • Site Events • Circle Events Each Circle Event corresponds to a triple of consecutive waves in ≤k-level O(n) O(kn) Tuesday, July 16, 2013
30. 30. Time Complexity? • Site Event • For each i-level, i = 1,...,k • Find insertion point • Update adjacency relations at the point • For all Site Events: O(log |Ai|) ≤ O(log (i(n − i))) ≤ O(log n) O(nk)O(log n) = O(nk log n) Tuesday, July 16, 2013
31. 31. Number of Circle Events • Every processed Circle Event corresponds to some order-iVoronoi vertex, i = 1,...,k • Therefore total number of processed Circle Events is the total complexity of order-i Voronoi diagrams, i = 1,...,k k i=1 i(n − i) = O k2 n Tuesday, July 16, 2013
32. 32. Time Complexity • Circle Event • Remove Circle Event from the queue • Update adjacency relations relations on 3 levels: • For all Circle Events: O log O k2 n = O(log n) 3O(log n) = O(log n) O(k2 n)O(log n) = O(k2 n log n) Tuesday, July 16, 2013
33. 33. Results • Time complexity • Space complexity O(k2 n log n) O(kn) Tuesday, July 16, 2013
34. 34. Line Segments Forming a Planar Straight-Line Graph Tuesday, July 16, 2013
35. 35. Planar Straight-Line Graph • Weak general position assumption: “No more than 3 elementary sites touch the same circle” Tuesday, July 16, 2013
36. 36. Planar Straight-Line Graph Bisectors containing 2-dimensional portion d the maxi- A1, . . . , Ak. wing bound (2) of levels exity of the envelope of Voronoi di- e maximum s1 s2 b(s1, s2) b(s1, s2) Fig. 3: Bisector containing 2-dimensional portion Tuesday, July 16, 2013
37. 37. Planar Straight-Line Graph Bisectors intersecting non-transversely A1, . . . , Ak. owing bound (2) of levels exity of the envelope of Voronoi di- e maximum nk). rcle-event in ent waves at er of circle- A1, . . . , Ak, ed to run in ertion of the mber of site- n). When a insert it in on every list s1 s2 b(s1, s2) Fig. 3: Bisector containing 2-dimensional portion s1 s2 s3 s4 b(s1, s4) b(s2, s4) b(s3, s4)b(s1, s4) b(s2, s4), b(s3, s4) Fig. 4: Bisectors intersecting non-transversely Tuesday, July 16, 2013
38. 38. Planar Straight-Line Graph We want to keep the information on the shared endpoints without altering the structure of the order-k Voronoi diagram of disjoint line segments. Tuesday, July 16, 2013
39. 39. Planar Straight-Line Graph • - a minimal disk centered at point x that intersects at least k line segments, where p is an elementary site that touches the disk. Dp k(x) x Tuesday, July 16, 2013
40. 40. Planar Straight-Line Graph • - a minimal disk centered at point x that intersects at least k line segments, where p is an elementary site that touches the disk. Dp k(x) x p Dp 3(x) Sk(x) Tuesday, July 16, 2013
41. 41. Generalized Deﬁnition Deﬁnition: A set is called an order-k subset if type-1: type-2: and there exists a proper order-k disk , where p is an endpoint common at least two segments, that intersects exactly all line segments in . p - the representative of H, H ⊆ S |H| = k |H| k Dp k(x) Hp H Tuesday, July 16, 2013
42. 42. Generalized Deﬁnition The order-k Voronoi region deﬁned: type-1 - in the ordinary way. type-2 : Vk(Hp, S) = {x | ∃Dp k(x) ∩ Sk(x) = Hp} Tuesday, July 16, 2013
43. 43. Generalized Deﬁnition Order-1 1 2 3 45 6 7 8 V (a) V (d) V (f) V (g) V (b) V (5) V (4) V (3) V (2) V (1) V (6) V (7) V (8) V (c)V (e) a b c d e f g Tuesday, July 16, 2013
44. 44. Generalized Deﬁnition Order-2 1 2 3 456 7 8 V (1, 2) V (6, 5) V (3, 4) V (3, 8) V (2, 8) V (4, 5) V (7, 5) V (7, 8) V (c, 3) V (c, 8) V (e, 5) V (2, 7) V (d) V (g) V (1, 7) V (6, 7) a b c d e f g Tuesday, July 16, 2013
45. 45. Generalized Deﬁnition Order-3 1 2 3 456 7 8 V (2, 3, 8) V (3, 4, 8) V (3, 4, 5) V (4, 5, 6)V (d, 5) V (5, 6, 7) V (1, 6, 7) V (d, 2) V (g, 1) V (1, 2, 8) V (1, 2, 7) V (2, 7, 8) V (1, 7, 8) V (3, 7, 8) V (4, 5, 8) V (4, 5, 7) V (5, 7, 8) V (6, 7, 8) V (c, 7, 8) V (c, 3, 8) a b c d e f g V (e, 4, 5) Tuesday, July 16, 2013
46. 46. How we deﬁne the k-level? x a, b c d e π(x) = π− (x), π0 (x), π+ (x) π(x) = {a}, {b, c, d}, {e} Tuesday, July 16, 2013
47. 47. How we deﬁne the k-level? x a, b c d e π(x) = π− (x), π0 (x), π+ (x) Deﬁnition: k-level is a set of points x such that and|π− (x)| k |π− (x) ∪ π0 (x)| ≥ k A3 Tuesday, July 16, 2013
48. 48. The Idea 1 2 3 456 7 8 a b c d e f g A1 A2 A3 l x Fig. 8: Constructing order-3 Voronoi diagram via sweepline technique. Point x belongs to the order-k Voronoi region Maintain the ≤k-level! Tuesday, July 16, 2013
49. 49. SUMMARY We have developed an algorithm that constructs the order-kVoronoi diagram of line segments in time and space. • Simple • Easy to implement • Sweepline • Can output all order-iVoronoi diagrams for i = 1,...,k • Generalized to the case of line segments forming a planar straight-line graph. O(k2 n log n) O(kn) Tuesday, July 16, 2013