computing delaunay triangulation and voronoi diagram
play

Computing Delaunay Triangulation and Voronoi Diagram Lekcija 10 - PowerPoint PPT Presentation

Computing Delaunay Triangulation and Voronoi Diagram Lekcija 10 Sergio Cabello sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Includes slides by Antoine Vigneron Sergio Cabello RC Computing Vor Del Outline RIC of the


  1. Computing Delaunay Triangulation and Voronoi Diagram Lekcija 10 Sergio Cabello sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Includes slides by Antoine Vigneron Sergio Cabello RC – Computing Vor – Del

  2. Outline ◮ RIC of the Delaunay triangulation • randomized • expected O ( n log n ) time ◮ Fortune’s algorithm to construct Voronoi diagram • sweep line algorithm • worst-case O ( n log n ) time Sergio Cabello RC – Computing Vor – Del

  3. Incircle test C c b inCircle ( a , b , c , d ) < 0 d a ◮ assume triangle abc is counterclockwise ◮ let C be the circumcircle of abc ◮ we want to design a test inCircle ( · ) such that • inCircle ( a , b , c , d ) = 0 if d ∈ C • inCircle ( a , b , c , d ) > 0 if d is outside C • inCircle ( a , b , c , d ) < 0 if d is inside C Sergio Cabello RC – Computing Vor – Del

  4. Expression ◮ we use the following expression: a x 2 + a y 2  1 a x a y  b x 2 + b y 2 1 b x b y   inCircle ( a , b , c , d ) = det c x 2 + c y 2   1 c x c y   d x 2 + d y 2 1 d x d y ◮ why does it work? • we next see proof with geometric interpretation • another possible path: algebra Sergio Cabello RC – Computing Vor – Del

  5. R 3 Orientation of vectors in I ◮ the orientation of ( − → u , − → v , − → w ) is given by the sign of   u x u y u z det v x v y v z   w x w y w z → − z w Orientation ( − → u , − → v , − → w ) > 0 → − v Orientation ( − → v , − → u , − → w ) < 0 O y ⇐ right thumb rule x − → u Sergio Cabello RC – Computing Vor – Del

  6. Orientation of a tetrahedron ◮ orientation of tetrahedron abcd = orientation of ( − → ac , − → ab , − → ad ) d Orientation ( abcd ) = Orientation ( − → ac , − → ab , − → ad ) > 0 c a ⇐ right thumb rule b Sergio Cabello RC – Computing Vor – Del

  7. Orientation of a tetrahedron ◮ Orientation ( abcd )  b x − a x b y − a y b z − a z  = det c x − a x c y − a y c z − a z   d x − a x d y − a y d z − a z  1 a x a y a z  0 b x − a x b y − a y b z − a z   = det   0 c x − a x c y − a y c z − a z   0 d x − a x d y − a y d z − a z ◮ developing with respect to first column Sergio Cabello RC – Computing Vor – Del

  8. Orientation of a tetrahedron ◮ add first row to the other rows ◮ Orientation ( abcd )   1 a x a y a z 1 b x b y b z   = det   1 c x c y c z   1 d x d y d z R 2 ◮ note that it generalizes the predicate to test right turns in I Sergio Cabello RC – Computing Vor – Del

  9. Paraboloid P R 3 , let P be the paraboloid with equation z = x 2 + y 2 ◮ in I z y O x Sergio Cabello RC – Computing Vor – Del

  10. Property ◮ let H be a non–vertical plane ◮ H has equation z = α x + β y + γ ◮ the projection of H ∩ P onto plane Oxy has equation x 2 + y 2 = α x + β y + γ • this is a circle ◮ property: the projection of H ∩ P onto plane Oxy is a circle Sergio Cabello RC – Computing Vor – Del

  11. Property z P H y O x a circle Sergio Cabello RC – Computing Vor – Del

  12. Proof z P ˆ c ˆ b a ˆ H c y O a b x Sergio Cabello RC – Computing Vor – Del

  13. Proof ◮ let p = ( p x , p y ) ◮ we lift p onto P and obtain ˆ p = ( p x , p y , p 2 x + p 2 y ) ◮ the transformation p → ˆ p is called the lifting map Sergio Cabello RC – Computing Vor – Del

  14. Proof ◮ we lift a , b , c and d : a = ( a x , a y , a 2 x + a 2 ˆ y ) ˆ b = ( b x , b y , b 2 x + b 2 y ) c = ( c x , c y , c 2 x + c 2 ˆ y ) ˆ d = ( d x , d y , d 2 x + d 2 y ) a , ˆ ◮ we denote by H the plane through { ˆ b , ˆ c } a , ˆ c , ˆ ◮ inCircle ( a , b , c , d ) = 0 means that Orientation(ˆ b , ˆ d ) = 0 • so ˆ d ∈ H • we project to horizontal • we obtain that d is in the circumcircle of abc Sergio Cabello RC – Computing Vor – Del

  15. Proof: first case a , ˆ c , ˆ ◮ a , b , c , d cocircular if ˆ b , ˆ d coplanar z P ˆ c ˆ d ˆ b ˆ a H c d y O a b x Sergio Cabello RC – Computing Vor – Del

  16. Proof: other cases a , ˆ c , ˆ ◮ inCircle ( a , b , c , d ) > 0 means that Orientation(ˆ b , ˆ d ) > 0 • then ˆ d is above H • so d is outside the circumcircle of abc a , ˆ c , ˆ ◮ inCircle ( a , b , c , d ) < 0 means that Orientation(ˆ b , ˆ d ) < 0 • then ˆ d is below H • so d is inside the circumcircle of abc Sergio Cabello RC – Computing Vor – Del

  17. Lifts and Delaunay triangulation Lifting DT ( P ) z P y x Sergio Cabello RC – Computing Vor – Del

  18. Circumcircle property ◮ P = { p 1 , p 2 , . . . p n } is a set of points in the plane in general position ◮ we denote ˆ P = { ˆ p 1 , ˆ p 2 , . . . ˆ p n } ◮ last lecture: triangle p i p j p k is a face of DT ( P ) iff its circumcircle is empty • it means that ∀ p ∈ P \ { p i , p j , p k } , ˆ p is above the plane through ˆ p i ˆ p j ˆ p k p k is a facet of the lower hull of ˆ • in other words, ˆ p i ˆ p j ˆ P Theorem The edges of the Delaunay triangulation of P are the projection of the edges of the lower hull of ˆ P onto the plane z = 0 Sergio Cabello RC – Computing Vor – Del

  19. Geometric property abcd convex quadrilateral. b d d b or c a a c Sergio Cabello RC – Computing Vor – Del

  20. Geometric property ◮ let acbd be a convex quadrilateral with diagonal ab ◮ then either • c is inside the circumcircle of abd and d is inside the circumcircle of abc • or c is outside circumcircle of abd and d is outside the circumcircle of abc Sergio Cabello RC – Computing Vor – Del

  21. Proof (by picture) a , ˆ c , ˆ d define a tethraedra in R 3 ˆ b , ˆ ˆ a c ˆ ˆ b ˆ a ˆ d c ˆ ˆ b ˆ a a d d d c c OR b b Concave Convex Sergio Cabello RC – Computing Vor – Del

  22. Edge flip: definition b b d d c c a a ab is illegal cd is locally Delaunay ◮ Defined only for convex quadrilaterals. ◮ Why not concave? What is wrong in the proof? Sergio Cabello RC – Computing Vor – Del

  23. Definitions R 2 in general position: no 4 cocircular ◮ P a set of n points in I ◮ T a triangulation of P ◮ ab an edge of T ◮ let ( c , d ) ∈ P 2 such that abc and abd are triangles of T ◮ ab is illegal iff acbd convex quadrilateral and d is inside the circumcircle of abc ◮ otherwise ab is locally Delaunay: acbd non-convex quadrilateral or d is outside the circumcircle of abc ◮ deciding if ab is locally Delaunay or illegal is done computing the sign of CCW ( abc ) and the sign of inCircle ( a , b , c , d ) Sergio Cabello RC – Computing Vor – Del

  24. Definition ◮ if ab is illegal, we can perform an edge flip: remove ab from T and insert cd ◮ now cd is locally Delaunay d b a c Sergio Cabello RC – Computing Vor – Del

  25. Definition ◮ if ab is illegal, we can perform an edge flip: remove ab from T and insert cd ◮ now cd is locally Delaunay d a b c Sergio Cabello RC – Computing Vor – Del

  26. Edge flip: interpretation ˆ a a ˆ ˆ ˆ b b ˆ c ˆ c a ˆ a ˆ d d d d c c b b the lifted triangulation gets lower the upper envelope becomes convex Sergio Cabello RC – Computing Vor – Del

  27. Characterization Theorem T be a triangulation of P. T = DT ( P ) if and only if all the edges of T are locally Delaunay Dokaz. ◮ if T is Delaunay, then clearly all edges are locally Delaunay because of circumcircle property ◮ other direction: • 2-dimensional proof in the book • use the lifting map: locally Delaunay ⇔ locally convex ⇔ globally convex ⇔ globally Delaunay Sergio Cabello RC – Computing Vor – Del

  28. First algorithm – Idea ◮ draw a triangulation T of P ◮ if all the edges of T are locally Delaunay, we are done ◮ otherwise, pick an illegal edge and flip it ◮ repeat this process until all edges are locally Delaunay Sergio Cabello RC – Computing Vor – Del

  29. Pseudocode Algorithm SlowDelaunay (P) R 2 Input: a set P of n points in I Output: DT ( P ) 1. compute a triangulation T of P 2. initialize a stack containing all the edges of T 3. while stack is non–empty 4. do pop ab from stack and unmark it 5. if ab is illegal then 6. do flip ab to cd 7. for xy ∈ { ac , cb , bd , da } 8. do if xy is not marked 9. then mark xy and push it on stack 10. return T Sergio Cabello RC – Computing Vor – Del

  30. Analysis ◮ it is not obvious that this program halts! ◮ in fact runs in Θ( n 2 ) time ◮ proof using lifting map • each time we flip an edge, the lifted triangulation gets lower • so an edge can be flipped only once: afterward it remains above the lifted triangulation • there are O ( n 2 ) edges • so the algorithm runs in O ( n 2 ) time ◮ show a lower bound of Ω( n 2 ) for this algorithm Sergio Cabello RC – Computing Vor – Del

  31. Randomized incremental algorithm Sergio Cabello RC – Computing Vor – Del

  32. Preliminary ◮ let ( p 1 , p 2 , p 3 . . . p n ) be a random permutation of P ◮ let p − 3 p − 2 p − 1 be a large triangle containing P p − 1 P p − 3 p − 2 ◮ for all i we denote P i = { p − 3 , p − 2 , p − 1 , p 1 , p 2 , . . . p i } Sergio Cabello RC – Computing Vor – Del

  33. First step p − 1 p 1 p − 3 p − 2 Sergio Cabello RC – Computing Vor – Del

Recommend


More recommend