CS6100: Topics in Design and Analysis of Algorithms Voronoi Diagram John Augustine CS6100 (Even 2012): Voronoi Diagram
Definition & Properties Let P = ( p 1 , p 2 , . . . , p n ) be a set of points (or sites) in the plane. The Voronoi diagram of P , denoted Vor ( P ) , is a subdivision of the plane into n cells, one for each point in P , such that for any point q in the cell corresponding to a point p i ∈ P , ∀ p j ∈ P \ { p i } , dist ( q, p i ) ≤ dist ( q, p j ) . The cell corresponding to p i ∈ P is denoted V ( p i ) . CS6100 (Even 2012): Voronoi Diagram 1
Observation: Consider two points p i and p j . Let h ( p i , p j ) be the half space induced by the perpendicular bisector of p i p j in which p i is contained. � V ( p i ) = h ( p i , p j ) . p j ∈ P \{ p i } 1. If all points are collinear, Vor ( P ) Theorem consists of n − 1 parallel lines. Otherwise, Vor ( P ) is connected and its edges are either segments or half lines. Proof Sketch. First part follows from previous observation. So for rest of proof assume ∃ three non-collinear points. CS6100 (Even 2012): Voronoi Diagram 2
p k e p i p j To show that edges of Vor ( P ) are either line segments or half lines, we consider ( for the sake of contradiction) a Voronoi edge e that is a line. It must be the perpendicular bisector of two points, say, p 1 and p 2 . From our assumption that not all points are collinear, there must be a third point that is not collinear to p 1 and p 2 . Show, in this context, that e cannot be a line, a contradiction that will prove our lemma. CS6100 (Even 2012): Voronoi Diagram 3
Complexity of Voronoi Diagrams How complex can Voronoi diagrams be? More precisely, how many vertices, edges and faces can a Voronoi diagram have? Notice that a single cell can have O ( n ) vertices. Does that mean that the total number of vertices is Ω( n 2 ) ? Theorem 2. For a points set P with cardinality n ≥ 3 , Number of vertices n v of Vor ( P ) ≤ 2 n − 5 Number of edges n e of Vor ( P ) ≤ 3 n − 6 . CS6100 (Even 2012): Voronoi Diagram 4
Proof Sketch. If all points are collinear, the theorem holds trivially. Therefore, assume that they are not all collinear. Euler’s Formula: If a connected plane graph (i.e., a planar graph that is embedded on a plane) has m v nodes, m e edges and m f faces, then, m v − m e + m f = 2 . To apply Euler’s formula, we add an artificial vertex to Vor ( P ) as shown below. v ∞ CS6100 (Even 2012): Voronoi Diagram 5
Note that the number of faces is equal to the number of sites. Applying Euler’s formula, we get ( n v + 1) − n e + n = 2 . (1) Twice the total number of edges is the total degree. Notice that each vertex has degree at least 3. Therefore, total degree is at least 3( n v + 1) . Stated using notations, we get 2 n e ≥ 3( n v + 1) . (2) The required inequalities follow. We define the largest empty circle of q with respect to P (denoted C P ( q ) ) as the largest circle centered at q that does not enclose any point in P . Theorem 3. For the Voronoi diagram Vor ( P ) of a set P of points, 1. A point q is a vertex in Vor ( P ) iff C P ( q ) has three or more sites on its boundary. CS6100 (Even 2012): Voronoi Diagram 6
2. The perpendicular bisector of p i p j defines an edge in Vor ( P ) iff there is a point q on the bisector such that C P ( q ) contains p i and p j , but no other point in P . Proof Sketch. 1. Note that a vertex q in Vor ( P ) is equidistant to at least three points in P , and, no other point in P is closer to q . C P ( q ) q 2. Use the definition of Voronoi diagram. CS6100 (Even 2012): Voronoi Diagram 7
Plane Sweep Algorithm to Compute the Voronoi Diagram Given: A set P of points in the 2D plane. We sweep a horizontal line ℓ from top to bottom. As an invariant, we construct the Voronoi diagram above up to ℓ . We need to be careful here. We only maintain parts of vor ( P ) that cannot be changed by points below ℓ . What are those points? These are the points above ℓ that are closer to a site above ℓ than to ℓ itself. For a single site above ℓ , the locus of points equidistant from both ℓ and the site is a parabola. CS6100 (Even 2012): Voronoi Diagram 8
For multiple sites, the locus of points locus of points closer to some site above ℓ is bounded by multiple parabolic arcs. ℓ The sequence of parabolic arcs is called the beach line. In other words, each site above ℓ induces a parabola. Consider any vertical line. The lowest point at which the line touches some parabola is on the beach line. Clearly, the beach line is x -monotone. CS6100 (Even 2012): Voronoi Diagram 9
Notice that a parabola might appear several times in the beach line. ℓ When does a new parabolic arc appear? ℓ ℓ ℓ When ℓ reaches a site, a new parabolic arc appears. Can a parabolic arc appear some other way? Lemma 1. The only way a new parabolic arc appears on the beach line is when ℓ reaches a new site. CS6100 (Even 2012): Voronoi Diagram 10
Proof Idea. There are two other ways a parabola β j can possibly enter the beachline (that we need to show it can’t). β j β j ℓ ℓ β j breaks through middle of an arc. This implies that β j was tangential to the other arc at some point. This is not possible. Why? When two points share either x or y coordinates, then easy to see they intersect twice. Assume therefore that p 1 is above but not directly above p 2 and β 1 and β 2 are the two parabolas about them Think of the parabola about a point p 1 w.r.t. ℓ as locus of the center of circle that goes through p 1 and touches ℓ tangentially. CS6100 (Even 2012): Voronoi Diagram 11
When such a circle encloses p 2 , it is centred at a part where β 1 and β 2 overlap. p 1 p 2 CS6100 (Even 2012): Voronoi Diagram 12
When such a circle does not enclose p 2 , it is centred at a part where β 1 and β 2 do not overlap. Notice that there are two extremities of β 1 at which this occurs. This implies that β 1 and β 2 must meet at 2 points. CS6100 (Even 2012): Voronoi Diagram 13
β j breaks through between two arcs. β j ℓ p j p j β j C p k p k p i p i q q β k β i C ℓ ℓ Notice in the left figure that the circle C through the three points p i , p j , and p k meet at q and its lowest point is on ℓ . What happens when ℓ is pulled down infinitesimally, but C touches p j and is maintained tangentially to ℓ ? Answer: Either p i or p k penetrate the circle. CS6100 (Even 2012): Voronoi Diagram 14
Corollary 1. The beach line consists of at most 2 n − 1 arcs. Proof. Each new site creates one new parabolic arc and splits another into two. CS6100 (Even 2012): Voronoi Diagram 15
Circle Event p j p j p j p i p k p i p k p i p k α ′ α ′′ q α q ℓ ℓ ℓ Notice that the 3 arcs α , α ′ , and α ′′ correspond to distinct sites. α , α ′ , and α ′′ intersect at q , which is equidistant from corresponding sites and ℓ . Therefore, there is a circle C centered at q touching p i , p j , and p k and ℓ . The point at which C touches ℓ is called a circle event. At a circle event, a parabolic arc disappears. Vertices in Vor ( P ) are captured by circle events. CS6100 (Even 2012): Voronoi Diagram 16
How do we find circle events? Check each time three parabolas become Answer: adjacent. But this might not always lead to circle events. 1. The breakpoint loci might be moving away from each other. 2. The circle event that is induced by a triple might be removed by the entry of a new site/parabola. We call these defnfalse alarms. CS6100 (Even 2012): Voronoi Diagram 17
Required Datastructures Voronoi diagram is stored as a DCEL. We use a large bounding box. Beach line is stored in a dynamic balanced binary search tree T . Recall that beachline is x -monotone and has complexity ≤ 2 n − 1 . Internal nodes of T store two arcs ( p i , p j ) . This can be used to detect the place where a new arc has to be inserted in O (log n ) time. Each leaf of T stores a pointer to the circle event that will make the leaf disappear. Each internal node has a pointer to a half edge in the DCEL. The event queue Q is a dynamic priority queue based on y -coordinates. Site events are static and known a priori. Circle events are dynamic. Also, need to watch for false alarms in circle events. CS6100 (Even 2012): Voronoi Diagram 18
Algorithm V ORONOI D IAGRAM ( P ) Input. A set P : = { p 1 ,..., p n } of point sites in the plane. Output. The Voronoi diagram Vor ( P ) given inside a bounding box in a doubly-connected edge list D . 1. Initialize the event queue Q with all site events, initialize an empty status structure T and an empty doubly-connected edge list D . 2. while Q is not empty 3. do Remove the event with largest y -coordinate from Q . 4. if the event is a site event, occurring at site p i then H ANDLE S ITE E VENT ( p i ) 5. else H ANDLE C IRCLE E VENT ( γ ) , where γ is the leaf of T representing the arc that 6. will disappear 7. The internal nodes still present in T correspond to the half-infinite edges of the Voronoi diagram. Compute a bounding box that contains all vertices of the Voronoi diagram in its interior, and attach the half-infinite edges to the bounding box by updating the doubly-connected edge list appropriately. 8. Traverse the half-edges of the doubly-connected edge list to add the cell records and the pointers to and from them. CS6100 (Even 2012): Voronoi Diagram 19
Recommend
More recommend