fbpx
Wikipedia

Fortune's algorithm

Fortune's algorithm is a sweep line algorithm for generating a Voronoi diagram from a set of points in a plane using O(n log n) time and O(n) space.[1][2] It was originally published by Steven Fortune in 1986 in his paper "A sweepline algorithm for Voronoi diagrams."[3]

Fortune's algorithm animation

Algorithm description edit

The algorithm maintains both a sweep line and a beach line, which both move through the plane as the algorithm progresses. The sweep line is a straight line, which we may by convention assume to be vertical and moving left to right across the plane. At any time during the algorithm, the input points left of the sweep line will have been incorporated into the Voronoi diagram, while the points right of the sweep line will not have been considered yet. The beach line is not a straight line, but a complicated, piecewise curve to the left of the sweep line, composed of pieces of parabolas; it divides the portion of the plane within which the Voronoi diagram can be known, regardless of what other points might be right of the sweep line, from the rest of the plane. For each point left of the sweep line, one can define a parabola of points equidistant from that point and from the sweep line; the beach line is the boundary of the union of these parabolas. As the sweep line progresses, the vertices of the beach line, at which two parabolas cross, trace out the edges of the Voronoi diagram. The beach line progresses by keeping each parabola base exactly half way between the points initially swept over with the sweep line, and the new position of the sweep line. Mathematically, this means each parabola is formed by using the sweep line as the directrix and the input point as the focus.

The algorithm maintains as data structures a binary search tree describing the combinatorial structure of the beach line, and a priority queue listing potential future events that could change the beach line structure. These events include the addition of another parabola to the beach line (when the sweep line crosses another input point) and the removal of a curve from the beach line (when the sweep line becomes tangent to a circle through some three input points whose parabolas form consecutive segments of the beach line). Each such event may be prioritized by the x-coordinate of the sweep line at the point the event occurs. The algorithm itself then consists of repeatedly removing the next event from the priority queue, finding the changes the event causes in the beach line, and updating the data structures.

As there are O(n) events to process (each being associated with some feature of the Voronoi diagram) and O(log n) time to process an event (each consisting of a constant number of binary search tree and priority queue operations) the total time is O(n log n).

Pseudocode edit

Pseudocode description of the algorithm.[4]

let   be the transformation  , where   is the Euclidean distance between z and the nearest site let T be the "beach line" let   be the region covered by site p. let   be the boundary ray between sites p and q. let   be a set of sites on which this algorithm is to be applied. let   be the sites extracted from S with minimal y-coordinate, ordered by x-coordinate let DeleteMin(X) be the act of removing the lowest and leftmost site of X (sort by y unless they're identical, in which case sort by x) let V be the Voronoi map of S which is to be constructed by this algorithm   create initial vertical boundary rays     while not IsEmpty(Q) do p ← DeleteMin(Q) case p of p is a site in  : find the occurrence of a region   in T containing p, bracketed by   on the left and   on the right create new boundary rays   and   with bases p replace   with   in T delete from Q any intersection between   and   insert into Q any intersection between   and   insert into Q any intersection between   and   p is a Voronoi vertex in  : let p be the intersection of   on the left and   on the right let   be the left neighbor of   and let   be the right neighbor of   in T if  , create a new boundary ray   else if p is right of the higher of q and s, create   else create   endif replace   with newly created   in T delete from Q any intersection between   and   delete from Q any intersection between   and   insert into Q any intersection between   and   insert into Q any intersection between   and   record p as the summit of   and   and the base of   output the boundary segments   and   endcase endwhile output the remaining boundary rays in T 

Weighted sites and disks edit

Additively weighted sites edit

As Fortune describes in ref.,[1] a modified version of the sweep line algorithm can be used to construct an additively weighted Voronoi diagram, in which the distance to each site is offset by the weight of the site; this may equivalently be viewed as a Voronoi diagram of a set of disks, centered at the sites with radius equal to the weight of the site. the algorithm is found to have   time complexity with n being the number of sites according to ref.[1]

Weighted sites may be used to control the areas of the Voronoi cells when using Voronoi diagrams to construct treemaps. In an additively weighted Voronoi diagram, the bisector between sites is in general a hyperbola, in contrast to unweighted Voronoi diagrams and power diagrams of disks for which it is a straight line.

References edit

  1. ^ a b c de Berg, Mark; van Kreveld, Marc; Overmars, Mark; Schwarzkopf, Otfried (2000), Computational Geometry (2nd revised ed.), Springer-Verlag, ISBN 3-540-65620-0 Section 7.2: Computing the Voronoi Diagram: pp.151–160.
  2. ^ Austin, David, Voronoi Diagrams and a Day at the Beach, Feature Column, American Mathematical Society.
  3. ^ Steven Fortune. A sweepline algorithm for Voronoi diagrams. Proceedings of the second annual symposium on Computational geometry. Yorktown Heights, New York, United States, pp.313–322. 1986. ISBN 0-89791-194-6. ACM Digital LibrarySpringerLink
  4. ^ Kenny Wong, Hausi A. Müller, An Efficient Implementation of Fortune's Plane-Sweep Algorithm for Voronoi Diagrams, CiteSeerX 10.1.1.83.5571.

External links edit

  • Steven Fortune's C implementation
  • Fortune's algorithm implemented in JavaScript

fortune, algorithm, sweep, line, algorithm, generating, voronoi, diagram, from, points, plane, using, time, space, originally, published, steven, fortune, 1986, paper, sweepline, algorithm, voronoi, diagrams, animation, contents, algorithm, description, pseudo. Fortune s algorithm is a sweep line algorithm for generating a Voronoi diagram from a set of points in a plane using O n log n time and O n space 1 2 It was originally published by Steven Fortune in 1986 in his paper A sweepline algorithm for Voronoi diagrams 3 Fortune s algorithm animation Contents 1 Algorithm description 1 1 Pseudocode 2 Weighted sites and disks 2 1 Additively weighted sites 3 References 4 External linksAlgorithm description editThe algorithm maintains both a sweep line and a beach line which both move through the plane as the algorithm progresses The sweep line is a straight line which we may by convention assume to be vertical and moving left to right across the plane At any time during the algorithm the input points left of the sweep line will have been incorporated into the Voronoi diagram while the points right of the sweep line will not have been considered yet The beach line is not a straight line but a complicated piecewise curve to the left of the sweep line composed of pieces of parabolas it divides the portion of the plane within which the Voronoi diagram can be known regardless of what other points might be right of the sweep line from the rest of the plane For each point left of the sweep line one can define a parabola of points equidistant from that point and from the sweep line the beach line is the boundary of the union of these parabolas As the sweep line progresses the vertices of the beach line at which two parabolas cross trace out the edges of the Voronoi diagram The beach line progresses by keeping each parabola base exactly half way between the points initially swept over with the sweep line and the new position of the sweep line Mathematically this means each parabola is formed by using the sweep line as the directrix and the input point as the focus The algorithm maintains as data structures a binary search tree describing the combinatorial structure of the beach line and a priority queue listing potential future events that could change the beach line structure These events include the addition of another parabola to the beach line when the sweep line crosses another input point and the removal of a curve from the beach line when the sweep line becomes tangent to a circle through some three input points whose parabolas form consecutive segments of the beach line Each such event may be prioritized by the x coordinate of the sweep line at the point the event occurs The algorithm itself then consists of repeatedly removing the next event from the priority queue finding the changes the event causes in the beach line and updating the data structures As there are O n events to process each being associated with some feature of the Voronoi diagram and O log n time to process an event each consisting of a constant number of binary search tree and priority queue operations the total time is O n log n Pseudocode edit Pseudocode description of the algorithm 4 let z displaystyle scriptstyle z nbsp be the transformation z z x z y d z displaystyle scriptstyle z z x z y d z nbsp where d z displaystyle scriptstyle d z nbsp is the Euclidean distance between z and the nearest site let T be the beach line let R p displaystyle scriptstyle R p nbsp be the region covered by site p let C p q displaystyle scriptstyle C pq nbsp be the boundary ray between sites p and q let S displaystyle scriptstyle S nbsp be a set of sites on which this algorithm is to be applied let p 1 p 2 p m displaystyle scriptstyle p 1 p 2 p m nbsp be the sites extracted from S with minimal y coordinate ordered by x coordinate let DeleteMin X be the act of removing the lowest and leftmost site of X sort by y unless they re identical in which case sort by x let V be the Voronoi map of S which is to be constructed by this algorithm Q p 1 p 2 p m S displaystyle Q gets p 1 p 2 dots p m S nbsp create initial vertical boundary rays C p 1 p 2 0 C p 2 p 3 0 C p m 1 p m 0 displaystyle scriptstyle C p 1 p 2 0 C p 2 p 3 0 dots C p m 1 p m 0 nbsp T R p 1 C p 1 p 2 0 R p 2 C p 2 p 3 0 R p m 1 C p m 1 p m 0 R p m displaystyle T gets R p 1 C p 1 p 2 0 R p 2 C p 2 p 3 0 dots R p m 1 C p m 1 p m 0 R p m nbsp while not IsEmpty Q do p DeleteMin Q case p of p is a site in V displaystyle scriptstyle V nbsp find the occurrence of a region R q displaystyle scriptstyle R q nbsp in T containing p bracketed by C r q displaystyle scriptstyle C rq nbsp on the left and C q s displaystyle scriptstyle C qs nbsp on the right create new boundary rays C p q displaystyle scriptstyle C pq nbsp and C p q displaystyle scriptstyle C pq nbsp with bases p replace R q displaystyle scriptstyle R q nbsp with R q C p q R p C p q R q displaystyle scriptstyle R q C pq R p C pq R q nbsp in T delete from Q any intersection between C r q displaystyle scriptstyle C rq nbsp and C q s displaystyle scriptstyle C qs nbsp insert into Q any intersection between C r q displaystyle scriptstyle C rq nbsp and C p q displaystyle scriptstyle C pq nbsp insert into Q any intersection between C p q displaystyle scriptstyle C pq nbsp and C q s displaystyle scriptstyle C qs nbsp p is a Voronoi vertex in V displaystyle scriptstyle V nbsp let p be the intersection of C q r displaystyle scriptstyle C qr nbsp on the left and C r s displaystyle scriptstyle C rs nbsp on the right let C u q displaystyle scriptstyle C uq nbsp be the left neighbor of C q r displaystyle scriptstyle C qr nbsp and let C s v displaystyle scriptstyle C sv nbsp be the right neighbor of C r s displaystyle scriptstyle C rs nbsp in T if q y s y displaystyle scriptstyle q y s y nbsp create a new boundary ray C q s 0 displaystyle scriptstyle C qs 0 nbsp else if p is right of the higher of q and s create C q s displaystyle scriptstyle C qs nbsp else create C q s displaystyle scriptstyle C qs nbsp endif replace C q r R r C r s displaystyle scriptstyle C qr R r C rs nbsp with newly created C q s displaystyle scriptstyle C qs nbsp in T delete from Q any intersection between C u q displaystyle scriptstyle C uq nbsp and C q r displaystyle scriptstyle C qr nbsp delete from Q any intersection between C r s displaystyle scriptstyle C rs nbsp and C s v displaystyle scriptstyle C sv nbsp insert into Q any intersection between C u q displaystyle scriptstyle C uq nbsp and C q s displaystyle scriptstyle C qs nbsp insert into Q any intersection between C q s displaystyle scriptstyle C qs nbsp and C s v displaystyle scriptstyle C sv nbsp record p as the summit of C q r displaystyle scriptstyle C qr nbsp and C r s displaystyle scriptstyle C rs nbsp and the base of C q s displaystyle scriptstyle C qs nbsp output the boundary segments C q r displaystyle scriptstyle C qr nbsp and C r s displaystyle scriptstyle C rs nbsp endcase endwhile output the remaining boundary rays in TWeighted sites and disks editAdditively weighted sites edit As Fortune describes in ref 1 a modified version of the sweep line algorithm can be used to construct an additively weighted Voronoi diagram in which the distance to each site is offset by the weight of the site this may equivalently be viewed as a Voronoi diagram of a set of disks centered at the sites with radius equal to the weight of the site the algorithm is found to have O n log n displaystyle O n log n nbsp time complexity with n being the number of sites according to ref 1 Weighted sites may be used to control the areas of the Voronoi cells when using Voronoi diagrams to construct treemaps In an additively weighted Voronoi diagram the bisector between sites is in general a hyperbola in contrast to unweighted Voronoi diagrams and power diagrams of disks for which it is a straight line References edit a b c de Berg Mark van Kreveld Marc Overmars Mark Schwarzkopf Otfried 2000 Computational Geometry 2nd revised ed Springer Verlag ISBN 3 540 65620 0 Section 7 2 Computing the Voronoi Diagram pp 151 160 Austin David Voronoi Diagrams and a Day at the Beach Feature Column American Mathematical Society Steven Fortune A sweepline algorithm for Voronoi diagrams Proceedings of the second annual symposium on Computational geometry Yorktown Heights New York United States pp 313 322 1986 ISBN 0 89791 194 6 ACM Digital LibrarySpringerLink Kenny Wong Hausi A Muller An Efficient Implementation of Fortune s Plane Sweep Algorithm for Voronoi Diagrams CiteSeerX 10 1 1 83 5571 External links editSteven Fortune s C implementation Fortune s Voronoi algorithm implemented in C Fortune s algorithm implemented in JavaScript Retrieved from https en wikipedia org w index php title Fortune 27s algorithm amp oldid 1180697652, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.