560 likes | 965 Views
COMPUTATIONAL GEOMETRY -- VORONOI DIAGRAM. Sophie Che. THE LARGEST EMPTY CIRCLE PROBLEM. An application of Voronoi Diagram. S : site points. v : Voronoi vertex. v. Largest Empty Circle. e : Voronoi edge. e. Definitions & Basic Properties. Of Voronoi Diagram. p i. Definition.
E N D
COMPUTATIONAL GEOMETRY-- VORONOI DIAGRAM Sophie Che
THE LARGEST EMPTY CIRCLE PROBLEM An application of Voronoi Diagram
S : site points v : Voronoi vertex v Largest Empty Circle e : Voronoi edge e
Definitions &Basic Properties Of Voronoi Diagram
pi Definition
FORMAL DEFINITION • Let P be a set of n distinct points (sites) in the plane. • The Voronoi diagram of P is the subdivision of the plane into n cells, one for each site. • A point q lies in the cell corresponding to a site pi P iff Euclidean_Distance(q, pi) < Euclidean_distance(q, pj) for each pi P, j i.
STRUCTURE • 2 sites • Perpendicular Bisector • 3 sites • Non-collinear sites • Half lines meeting at a Voronoi vertex • 4 sites • A bounded cell
pi STRUCTURE (CONT’D) • More sites… V(pi) = 1 j n, j i h(pi,pj)
COMPLEXITY (SIZE) • Intuitively: n2 • n sites • At most n-1 vertices and edges per cell • Actually: O(n) • For n 3, |v| 2n 5, |e| 3n 6
LINEAR COMPLEXITY – PROOF • Euler’s Formula: • For planar graphs, |V| – |E| + F = 2 • Connecting all half-infinite edges to an extra vertex (|v| + 1) – |e| + n = 2 • Plus, |v| 2n 5 |e| 3n 6 p e pi
Delaunay Triangulation Dual graph of Voronoi Diagram
Delaunay Triangulation • Dual graph • Nodes: site points • Edges: “neighboring” sites in VD • Properties • Planar graph • Linear complexity
Delaunay Properties • DT is the straight-line dual of VD. • DT is a triangulation if no four sites are cocircular. • Each face of DT corresponds to a vertex of VD. • Each edge of DT corresponds to an edge of VD. • Each node of DT corresponds to a cell of VD. • The boundary of DT is the convex hull of the sites. • The interior of each face of DT contains no sites.
Voronoi Properties • Each Voronoi cell is convex. • The cell of pi is unbounded iffpi is on the convex hull of the sites. [c.f. D6] • If v is a Voronoi vertex at the junction of p1, p2 and p3, then v is the center of the circle C(v) determined by p1, p2 and p3. • C(v) is the circumcircle for the Delaunay triangle corresponding to v. • The interior of C(v) contains no sites. [c.f. D7] • If pi is a nearest neighbor to pj, then pipj is an edge of DT. • If there is some circle through pi and pj that contains no other sites, then pipj is an edge of DT.
VORONOI VERTEX • A Voronoi vertex is an intersection of 3 (or more) segments, each equidistant from a pair of sites • A point q is a Voronoi vertex iff its largest empty circle centered at q touches at least 3 (or more) sites pk pi q pj
VORONOI EDGE • A Voronoi edge is a subset of locus of points equidistant from pi and pj • A point q lies on a Voronoi edge between sites pi and pjiffits largest empty circle centered at q touches onlypi and pj pi pj q
Algorithms To compute a Voronoi Diagram
HALF-PLANE INTERSECTION • For each site pi, Compute the common intersection of the half-planes h(pi, pj), with j≠i
HALF-PLANE INTERSECTION • For each site pi, Compute the common intersection of the half-planes h(pi, pj), with j≠i
HALF-PLANE INTERSECTION • For each site pi, Compute the common intersection of the half-planes h(pi, pj), with j≠i • O(nlogn) time per Voronoi cell • O( n2 log n ) in total
INCREMENTAL CONSTRUCTION • Incremental insertion • Obtain VDn from VDn-1 • Steps: • Locate pi in some Voronoi cell of pj; • Draw bisector between piand pj; • Expand boundary of Voronoi cell of pi; pj pi
INCREMENTAL CONSTRUCTION • Incremental insertion • Obtain VDn from VDn-1 • Steps: • Locate pi in some Voronoi cell of pj; • Draw bisector between piand pj; • Expand boundary of Voronoi cell of pi; pj pi
INCREMENTAL CONSTRUCTION • Incremental insertion • Obtain VDn from VDn-1 • Steps: • Locate pi in some Voronoi cell of pj; • Draw bisector between piand pj; • Expand boundary of Voronoi cell of pi; pj pi
INCREMENTAL CONSTRUCTION • Incremental insertion • Obtain VDn from VDn-1 • O(n) time per point insertion • O(n2) in total • Demo
GENERAL SWEEP LINE FRAMEWORK • Sweep a horizontal line (sweep line) from top to bottom over the plane • Incremental construction • Maintain unchangedinformation • Handle changes atcertain special points(event points) l
FORTUNE’S ALGORITHM • Problems: • What to maintain? • Intersections? • Beach line • unchanged information – Distance l
BEACH LINE • Sequence of Parabolic arcs Set of points equidistant from nearest site above sweep line & sweep line itself • breakpoints lie on Voronoi edges • How to store it?? • Sites consist of the line l breakpoint Equidistance arc
FORTUNE’S ALGORITHM • Demo A visual implementation of Fortune's Voronoi algorithm
EVENTS NEEDED TO BE HANDLED – SITE EVENT • When the sweep line reaches a new site… l
EVENTS NEEDED TO BE HANDLED – SITE EVENT • When the sweep line reaches a new site… l
EVENTS NEEDED TO BE HANDLED – SITE EVENT • When the sweep line reaches a new site… A new arc appears l
HANDLING SITE EVENTS • Find where it projects on beach line • Insert its arc in proper position in the list of beach line
EVENTS NEEDED TO BE HANDLED – CIRCLE EVENT • When the sweep line encounters the bottom of an empty circle touching 3 or more sites… pi pj pk l
EVENTS NEEDED TO BE HANDLED – CIRCLE EVENT • When the sweep line encounters the bottom of an empty circle touching 3 or more sites… An arc disappears pi pj pk y l
HANDLING CIRCLE EVENTS • Remove pj from beach line • Create a Voronoi vertex y • Center of empty circle is a Voronoi vertex • Tie two Voronoi edges into y • Create a Voronoi edge between pi and pk
RUNNING TIME ANALYSIS • How many arcs in beach line? • Each site split at most 1 existing arc into 2 At most 2n-1 arcs • How many events? • Site events • O(n) – number of sites • Circle events • O(n) – number of arcs
RUNNING TIME ANALYSIS – DATA STRUCTURE • Beach line – sites that consist of the line A binary search tree • Event queue A priority queue
RUNNING TIME ANALYSIS – SITE EVENT • Find where it projects on beach line • O(log n) • Insert its “arc” in proper position in the list of beach line • O(1)
RUNNING TIME ANALYSIS – CIRCLE EVENT • Remove pj from beach line • O(log n) • Create a Voronoi vertex y • O(1) • Tie two Voronoi edges into y • O(1) • Create a Voronoi edge between pi and pk • O(1)
TOTAL RUNNING TIME • Each site/circle event handler O(log n) • At most O(n) site and circle events O(n log n) total running time
IS FORTUNE’S ALGORITHM OPTIMAL? • Sorting n real numbers is reducible to computing Voronoi diagrams Lower bound O(n log n) • Fortune’s algorithm is optimal!
SUMMARY • VD is a useful planar subdivision of a discrete point set • VD has linear complexity/size • O(n) edges and O(n) vertices • Can be constructed in O(n log n) time • Fortune’s algorithm (optimal)
THANK YOU Questions ??
SPECIAL CASES Collinear sites Co-circle sites v
LINEAR COMPLEXITY – PROOF • Case 1: collinear |v| = 0, |e| = n – 1