computational geometry – voronoi diagram computational geometry -- voronoi diagram sophie che
Post on 18-Dec-2015
242 Views
Preview:
TRANSCRIPT
Computational Geometry – Voronoi Diagram
THE LARGEST EMPTY CIRCLE PROBLEM
An application of Voronoi Diagram2
Computational Geometry – Voronoi Diagram
LARGEST EMPTY CIRCLE
4
e : Voronoi edge
vv : Voronoi vertex
S : site points
e
04/18/23 19:42
Computational Geometry – Voronoi Diagram
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.
7
04/18/23 19:42
Computational Geometry – Voronoi Diagram
STRUCTURE
8
04/18/23 19:42
2 sites Perpendicular
Bisector
3 sites Non-collinear sites Half lines meeting at
a Voronoi vertex
4 sites A bounded cell
Computational Geometry – Voronoi Diagram
STRUCTURE (CONT’D)
9
More sites…
V(pi) = 1 j n, j i h(pi,pj)
pi
04/18/23 19:42
Computational Geometry – Voronoi Diagram
COMPLEXITY (SIZE)
10
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
04/18/23 19:42
Computational Geometry – Voronoi Diagram
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
11
)1|(|33)deg(||2)()(
vvePVorvPVorv
epi
p
04/18/23 19:42
Computational Geometry – Voronoi Diagram
DELAUNAY TRIANGULATION
13
Dual graph Nodes: site points Edges:
“neighboring” sites in VD
Properties Planar graph Linear complexity
04/18/23 19:42
Computational Geometry – Voronoi Diagram
DELAUNAY PROPERTIES
1. DT is the straight-line dual of VD.2. DT is a triangulation if no four sites are
cocircular.3. Each face of DT corresponds to a vertex of
VD.4. Each edge of DT corresponds to an edge of
VD.5. Each node of DT corresponds to a cell of VD.6. The boundary of DT is the convex hull of the
sites.7. The interior of each face of DT contains no
sites.14
04/18/23 19:42
Computational Geometry – Voronoi Diagram
VORONOI PROPERTIES
1. Each Voronoi cell is convex.
2. The cell of pi is unbounded iff pi is on the convex hull of the sites. [c.f. D6]
3. 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.
4. C(v) is the circumcircle for the Delaunay triangle corresponding to v.
5. The interior of C(v) contains no sites. [c.f. D7]
6. If pi is a nearest neighbor to pj, then pipj is an edge of DT.
7. If there is some circle through pi and pj that contains no other sites, then pipj is an edge of DT.
15
04/18/23 19:42
Computational Geometry – Voronoi Diagram
VORONOI VERTEX
16
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
qpi
pj
04/18/23 19:42
Computational Geometry – Voronoi Diagram
VORONOI EDGE
17
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 pj iff its largest empty circle centered at q touches only pi and pj
q
pi
pj
04/18/23 19:42
Computational Geometry – Voronoi Diagram
HALF-PLANE INTERSECTION
20
For each site pi,
Compute the common intersection of the half-planes h(pi, pj), with j≠i
04/18/23 19:42
Computational Geometry – Voronoi Diagram
HALF-PLANE INTERSECTION
21
For each site pi,
Compute the common intersection of the half-planes h(pi, pj), with j≠i
04/18/23 19:42
Computational Geometry – Voronoi Diagram
HALF-PLANE INTERSECTION
22
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
04/18/23 19:42
Computational Geometry – Voronoi Diagram
INCREMENTAL CONSTRUCTION
23
Incremental insertion Obtain VDn from VDn-
1
Steps: Locate pi in some
Voronoi cell of pj; Draw bisector
between pi and pj; Expand boundary of
Voronoi cell of pi;
04/18/23 19:42
pi
pj
Computational Geometry – Voronoi Diagram
INCREMENTAL CONSTRUCTION
24
Incremental insertion Obtain VDn from VDn-
1
Steps: Locate pi in some
Voronoi cell of pj; Draw bisector
between pi and pj; Expand boundary of
Voronoi cell of pi;
04/18/23 19:42
pi
pj
Computational Geometry – Voronoi Diagram
INCREMENTAL CONSTRUCTION
25
Incremental insertion Obtain VDn from VDn-
1
Steps: Locate pi in some
Voronoi cell of pj; Draw bisector
between pi and pj; Expand boundary of
Voronoi cell of pi;
pi
04/18/23 19:42
pj
Computational Geometry – Voronoi Diagram
INCREMENTAL CONSTRUCTION
26
Incremental insertion Obtain VDn from VDn-
1
O(n) time per point insertion
O(n2) in total
Demo
04/18/23 19:42
Computational Geometry – Voronoi Diagram
GENERAL SWEEP LINE FRAMEWORK
Sweep a horizontal line (sweep line) from top to bottom over the plane
Incremental constructionMaintain unchanged
informationHandle changes at
certain special points(event points)
27
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
FORTUNE’S ALGORITHM
28
Problems:What to maintain?
Intersections?
Beach lineunchanged
information – Distance
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
BEACH LINE
29
Sequence of Parabolic arcsSet of points
equidistantfrom nearest site
above sweep line& sweep line itself
breakpoints lie on Voronoi edges
How to store it?? Sites consist of the
line
Equidistancebreakpoint
arc
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
FORTUNE’S ALGORITHM
Demo
A visual implementation of Fortune's Voronoi algorithm
30
04/18/23 19:42
Computational Geometry – Voronoi Diagram
EVENTS NEEDED TO BE HANDLED – SITE EVENT
31
When the sweep line reaches a new site…
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
EVENTS NEEDED TO BE HANDLED – SITE EVENT
32
When the sweep line reaches a new site…
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
EVENTS NEEDED TO BE HANDLED – SITE EVENT
33
When the sweep line reaches a new site…
A new arc appears
l
04/18/23 19:42
Computational Geometry – Voronoi Diagram
HANDLING SITE EVENTS
Find where it projects on beach line
Insert its arc in proper position in the list of beach line
34
04/18/23 19:42
Computational Geometry – Voronoi Diagram
EVENTS NEEDED TO BE HANDLED – CIRCLE EVENT
35
When the sweep line encounters the bottom of an empty circle touching 3 or more sites…
l
pi pj pk
04/18/23 19:42
Computational Geometry – Voronoi Diagram
EVENTS NEEDED TO BE HANDLED – CIRCLE EVENT
36
When the sweep line encounters the bottom of an empty circle touching 3 or more sites…
An arc disappears
l
y
pi pj pk
04/18/23 19:42
Computational Geometry – Voronoi Diagram
HANDLING CIRCLE EVENTS
Remove pj from beach line
Create a Voronoi vertex yCenter of empty circle is a Voronoi vertex
Tie two Voronoi edges into y
Create a Voronoi edge between pi and pk 37
04/18/23 19:42
Computational Geometry – Voronoi Diagram
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 sitesCircle events
O(n) – number of arcs 38
04/18/23 19:42
Computational Geometry – Voronoi Diagram
RUNNING TIME ANALYSIS – DATA STRUCTURE
Beach line – sites that consist of the line A binary search tree
Event queue A priority queue
39
04/18/23 19:42
Computational Geometry – Voronoi Diagram
RUNNING TIME ANALYSIS – SITE EVENT
Find where it projects on beach lineO(log n)
Insert its “arc” in proper position in the list of beach lineO(1)
40
04/18/23 19:42
Computational Geometry – Voronoi Diagram
RUNNING TIME ANALYSIS – CIRCLE EVENT
Remove pj from beach lineO(log n)
Create a Voronoi vertex yO(1)
Tie two Voronoi edges into yO(1)
Create a Voronoi edge between pi and pk
O(1)41
04/18/23 19:42
Computational Geometry – Voronoi Diagram
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
42
04/18/23 19:42
Computational Geometry – Voronoi Diagram
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!
43
04/18/23 19:42
Computational Geometry – Voronoi Diagram
SUMMARY
VD is a useful planar subdivision of a discrete point set
VD has linear complexity/sizeO(n) edges and O(n) vertices
Can be constructed in O(n log n) timeFortune’s algorithm (optimal)
44
04/18/23 19:42
top related