SlideShare une entreprise Scribd logo
1  sur  89
Télécharger pour lire hors ligne
Voronoi Diagrams
Outline
• Definitions and Examples
• Properties of Voronoi diagrams
• Complexity of Voronoi diagrams
• Constructing Voronoi diagrams
– Intuitions
– Data Structures
– Algorithm
• Running Time Analysis
• Demo
• Duality and degenerate cases
Post Office: What is the area of service?
q
q : free point
e
e : Voronoi edge
v
v : Voronoi vertex
pi
pi : site points
Definition of Voronoi Diagram
• 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.
Voronoi Diagram Example:
1 site
Two sites form a perpendicular
bisector
Voronoi Diagram is a line
that extends infinitely in
both directions, and the
two half planes on either
side.
Collinear sites form a series of
parallel lines
Non-collinear sites form Voronoi
half lines that meet at a vertex
A Voronoi vertex is
the center of an empty
circle touching 3 or
more sites.
v
Half lines
A vertex has
degree 3
Voronoi Cells and Segments
v
Voronoi Cells and Segments
v
Unbounded CellBounded Cell
Segment
vWhich of the following is true for
2-D Voronoi diagrams?
Four or more non-collinear sites are…
1. sufficient to create a bounded cell
2. necessary to create a bounded cell
3. 1 and 2
4. none of above
vWhich of the following is true for
2-D Voronoi diagrams?
Four or more non-collinear sites are…
1. sufficient to create a bounded cell
2. necessary to create a bounded cell
3. 1 and 2
4. none of above
Degenerate Case:
no bounded cells!
v
Summary of Voronoi Properties
A point q lies on a Voronoi edge between sites pi and pj
iff the largest empty circle centered at q touches only
pi and pj
– A Voronoi edge is a subset of locus of points equidistant
from pi and pj
e
e : Voronoi edge
v
v : Voronoi vertex
pi
pi : site points
Summary of Voronoi Properties
A point q is a vertex iff the largest empty circle
centered at q touches at least 3 sites
– A Voronoi vertex is an intersection of 3 more segments,
each equidistant from a pair of sites
e
e : Voronoi edge
v
v : Voronoi vertex
pi
pi : site points
Voronoi diagrams have linear
complexity {|v|, |e| = O(n)}
Intuition: Not all bisectors are Voronoi edges!
e
e : Voronoi edge
pi
pi : site points
Voronoi diagrams have linear
complexity {|v|, |e| = O(n)}
Claim: For n 3, |v| 2n 5 and |e| 3n 6
Proof: (Easy Case)
…
Collinear sites  |v| = 0, |e| = n – 1
Voronoi diagrams have linear
complexity {|v|, |e| = O(n)}
Claim: For n 3, |v| 2n 5 and |e| 3n 6
Proof: (General Case)
• Euler’s Formula: for connected, planar graphs,
|v| – |e| + f = 2
Where:
|v| is the number of vertices
|e| is the number of edges
f is the number of faces
Voronoi diagrams have linear
complexity {|v|, |e| = O(n)}
Claim: For n 3, |v| 2n 5 and |e| 3n 6
Proof: (General Case)
• For Voronoi graphs, f = n  (|v| +1) – |e| + n = 2
epi
p
To apply Euler’s Formula, we
“planarize”theVoronoidiagram
by connectinghalflines to
an extra vertex.
Voronoi diagrams have linear
complexity {|v|, |e| = O(n)}
Moreover,
and
so
together with
we get, for n 3
||2)deg(
)(
ev
PVorv
),(PVorv 3)deg(v
)1|(|3||2 ve
2||)1|(| nev
63||
52||
ne
nv
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Repeat for each site
Running Time:
O( n2 log n )
Constructing Voronoi Diagrams
• Half plane intersection O( n2 log n )
• Fortune’s Algorithm
– Sweep line algorithm
• Voronoi diagram constructed as horizontal line
sweeps the set of sites from top to bottom
• Incremental construction  maintains portion of
diagram which cannot change due to sites below
sweep line, keeping track of incremental changes for
each site (and Voronoi vertex) it “sweeps”
Constructing Voronoi Diagrams
What is the invariant we are looking for?
Maintain a representation of the locus of points q that
are closer to some site pi above the sweep line than to
the line itself (and thus to any site below the line).
e
v
pi
Sweep Line
q
Constructing Voronoi Diagrams
Which points are closer to a site above the sweep
line than to the sweep line itself?
Sweep Line
pi
q
The set of parabolic arcs form a beach-line that bounds
the locus of all such points
Equidistance
Constructing Voronoi Diagrams
Break points trace out Voronoi edges.
Equidistance
Sweep Line
pi
q
Constructing Voronoi Diagrams
Arcs flatten out as sweep line moves down.
Sweep Line
pi
q
Eventually, the middle arc disappears.
Constructing Voronoi Diagrams
Sweep Line
pi
q
We have detected a circle that is empty (contains no
sites) and touches 3 or more sites.
Constructing Voronoi Diagrams
Sweep Line
pi
q
Voronoi vertex!
Beach Line properties
• Voronoi edges are traced by the break
points as the sweep line moves down.
– Emergence of a new break point(s) (from
formation of a new arc or a fusion of two
existing break points) identifies a new edge
• Voronoi vertices are identified when two
break points meet (fuse).
– Decimation of an old arc identifies new vertex
Data Structures
• Current state of the Voronoi diagram
– Doubly linked list of half-edge, vertex, cell records
• Current state of the beach line
– Keep track of break points
– Keep track of arcs currently on beach line
• Current state of the sweep line
– Priority event queue sorted on decreasing y-coordinate
Doubly Linked List (D)
• Goal: a simple data structure that allows an
algorithm to traverse a Voronoi diagram’s
segments, cells and vertices
e
v
Cell(pi)
Doubly Linked List (D)
• Divide segments into uni-directional half-edges
• A chain of counter-clockwise half-edges forms a cell
• Define a half-edge’s “twin” to be its opposite half-edge of the
same segment
e
v
Cell(pi)
Doubly Linked List (D)
• Cell Table
– Cell(pi) : pointer to any incident half-edge
• Vertex Table
– vi : list of pointers to all incident half-edges
• Doubly Linked-List of half-edges; each has:
– Pointer to Cell Table entry
– Pointers to start/end vertices of half-edge
– Pointers to previous/next half-edges in the CCW chain
– Pointer to twin half-edge
Balanced Binary Tree (T)
• Internal nodes represent break points between two arcs
– Also contains a pointer to the D record of the edge being traced
• Leaf nodes represent arcs, each arc is in turn represented
by the site that generated it
– Also contains a pointer to a potential circle event
pi pj pk pl
< pj, pk>
< pi, pj> < pk, pl>
pi
pj
pk
pl
l
Event Queue (Q)
• An event is an interesting point encountered by the
sweep line as it sweeps from top to bottom
– Sweep line makes discrete stops, rather than a
continuous sweep
• Consists of Site Events (when the sweep line
encounters a new site point) and Circle Events
(when the sweep line encounters the bottom of an
empty circle touching 3 or more sites).
• Events are prioritized based on y-coordinate
Site Event
A new arc appears when a new site appears.
l
Site Event
A new arc appears when a new site appears.
l
Site Event
Original arc above the new site is broken into two
 Number of arcs on beach line is O(n)
l
Circle Event
An arc disappears whenever an empty circle touches
three or more sites and is tangent to the sweep line.
Sweep line helps determine that the circle is indeed empty.
Circle Event!
Sweep Line
pi
q
Voronoi vertex!
Event Queue Summary
• Site Events are
– given as input
– represented by the xy-coordinate of the site point
• Circle Events are
– computed on the fly (intersection of the two bisectors in
between the three sites)
– represented by the xy-coordinate of the lowest point of
an empty circle touching three or more sites
– “anticipated”, these newly generated events may be
false and need to be removed later
• Event Queue prioritizes events based on their y-
coordinates
Summarizing Data Structures
• Current state of the Voronoi diagram
– Doubly linked list of half-edge, vertex, cell records
• Current state of the beach line
– Keep track of break points
• Innernodes of binary search tree; representedby a tuple
– Keep track of arcs currently on beach line
• Leaf nodes of binary search tree; represented by a site that
generatedthearc
• Current state of the sweep line
– Priority event queue sorted on decreasing y-coordinate
Algorithm
1. Initialize
• Event queue Q  all site events
• Binary search tree T 
• Doubly linked list D 
2. While Q not ,
• Remove event (e) from Q with largest y-
coordinate
• HandleEvent(e, T, D)
Handling Site Events
1. Locate the existing arc (if any) that is above the
new site
2. Break the arc by replacing the leaf node with a
sub tree representing the new arc and its break
points
3. Add two half-edge records in the doubly linked
list
4. Check for potential circle event(s), add them to
event queue if they exist
Locate the existing arc that is above
the new site
pi pj pk pl
< pj, pk>
< pi, pj> < pk, pl>
• The x coordinate of the new site is used for the binary search
• The x coordinate of each breakpoint along the root to leaf path
is computed on the fly
pi
pj
pk
pl
lpm
Break the Arc
pi pj pk
< pj, pk>
< pi, pj> < pk, pl>
Corresponding leaf replaced by a new sub-tree
pi
pj
pk
pl
l
pm
pm pl
< pl, pm>
< pm, pl>
pl
Different arcs can be identified
by the same site!
Add a new edge record in the doubly
linked list
pi pj pk
< pj, pk>
< pi, pj> < pk, pl>
pm pl
< pl, pm>
< pm, pl>
pl
pi
pj
pk
pl
l
pm
New Half Edge Record
Endpoints
Pointers to two half-edge
records
l
pm
Checking for Potential Circle Events
• Scan for triple of consecutive arcs and
determine if breakpoints converge
– Triples with new arc in the middle do not have
break points that converge
Checking for Potential Circle Events
• Scan for triple of consecutive arcs and
determine if breakpoints converge
– Triples with new arc in the middle do not have
break points that converge
Checking for Potential Circle Events
• Scan for triple of consecutive arcs and
determine if breakpoints converge
– Triples with new arc in the middle do not have
break points that converge
Converging break points may not
always yield a circle event
• Appearance of a new site before the circle
event makes the potential circle non-empty
l
(The original circle event becomes a false alarm)
Handling Site Events
1. Locate the leaf representing the existing arc that is
above the new site
– Delete the potential circle event in the event queue
2. Break the arc by replacing the leaf node with a
sub tree representing the new arc and break points
3. Add a new edge record in the doubly linked list
4. Check for potential circle event(s), add them to
queue if they exist
– Store in the corresponding leaf of T a pointer to the
new circle event in the queue
Handling Circle Events
1. Add vertex to corresponding edge record in doubly
linked list
2. Delete from T the leaf node of the disappearing arc
and its associated circle events in the event queue
3. Create new edge record in doubly linked list
4. Check the new triplets formed by the former
neighboring arcs for potential circle events
A Circle Event
pi pj pk
< pj, pk>
< pi, pj> < pk, pl>
pi
pj
pk
pl
l
pm
pm pl
< pl, pm>
< pm, pl>
pl
Add vertex to corresponding edge record
pi pj pk
< pj, pk>
< pi, pj> < pk, pl>
pi
pj
pk
pl
l
pm
pm pl
< pl, pm>
< pm, pl>
pl
Half Edge Record
Endpoints.add(x, y)
Half Edge Record
Endpoints.add(x, y)
Link!
Deleting disappearing arc
pi pj pk
< pj, pk>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
Deleting disappearing arc
pi pj pk
< pj, pk>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
< pk, pm>
Create new edge record
pi pj pk
< pj, pk>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
< pk, pm>
New Half Edge Record
Endpoints.add(x, y)
A new edge is traced out by the new
break point < pk, pm>
Check the new triplets for
potential circle events
pi pj pk
< pj, pk>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
< pk, pm>
Q y…
new circle event
Minor Detail
• Algorithm terminates when Q = , but the
beach line and its break points continue to
trace the Voronoi edges
– Terminate these “half-infinite” edges via a
bounding box
Algorithm Termination
pi pj pk
< pj, pk>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
< pk, pm>
Q
Algorithm Termination
pi pj
< pj, pm>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
Q
Algorithm Termination
pi pj
< pj, pm>
< pi, pj>
pi
pj
pk
pl
l
pm
pm pl
< pm, pl>
Q
Terminate half-lines
with a bounding box!
Handling Site Events
1. Locate the leaf representing the existing arc
that is above the new site
– Deletethepotentialcircleevent in the event queue
2. Break the arc by replacing the leaf node with a
sub tree representing the new arc and break
points
3. Add a new edge record in the link list
4. Check for potential circle event(s), add them to
queue if they exist
– Storein the corresponding leafof T a pointerto the
new circle event in the queue
Running Time
O(log n)
O(1)
O(1)
O(1)
Handling Circle Events
1. Delete from T the leaf node of the
disappearing arc and its associated
circle events in the event queue
2. Add vertex record in doubly link list
3. Create new edge record in doubly
link list
4. Check the new triplets formed by the
former neighboring arcs for potential
circle events
Running Time
O(log n)
O(1)
O(1)
O(1)
Total Running Time
• Each new site can generate at most two new
arcs
beach line can have at most 2n – 1 arcs
at most O(n) site and circle events in the queue
• Site/Circle Event Handler O(log n)
 O(n log n) total running time
Is Fortune’s Algorithm Optimal?
• We can sort numbers using any algorithm that
constructs a Voronoi diagram!
• Map input numbers to a position on the number
line. The resulting Voronoi diagram is doubly
linked list that forms a chain of unbounded cells in
the left-to-right (sorted) order.
-5 1 3 6 7
Number
Line
70
Divide-and-Conquer approach
• Input : A set S of n planar points.
• Output : The Voronoi diagram of S.
• Step 1 If S contains less than 4 point, solve
directly and return.
• Step 2 Find a median line L perpendicular to the
X-axis which divides S into SL and SR such that
SL (SR) lies to the left(right) of L and the sizes of
SL and SR are equal.
71
Divide-and-Conquer approach
• Step 3 Construct Voronoi diagrams of SL and SR
recursively. Denote these Voronoi diagrams by
VD(SL) and VD(SR).
• Step 4 Construct a dividing piece-wise linear
hyperplane HP which is the locus of points
simultaneously closest to a point in SL and a point
in SR. Discard all segments of VD(SL) which lie
to the right of HP and all segments of VD(SR) that
lie to the left of HP. The resulting graph is the
Voronoi diagram of S.
72
How to merge two Voronoi diagrams ?
73
• Merging:
How to merge two Voronoi
diagrams ?
b15b45b14b13b34b46b36b23b26
74
Merges Two Voronoi Diagrams into
One Voronoi Diagram
• Input : (a) SL and SR where SL and SR are
divided by a perpendicular line L.
(b) VD(SL ) and VD(SR ).
• Output : VD(S) where S = SL ∩SR
• Step 1 Find the convex hulls of SL and SR . Let them
be denoted as Hull(SL) and Hull(SR), respectively. (A
special algorithm for finding a convex hull in this
case will by given later.)
75
Merges Two Voronoi Diagrams into
One Voronoi Diagram
• Step 2 Find segments and which join
HULL(SL ) and HULL(SR ) into a convex hull (Pa
and Pc belong to SL and Pb and Pd belong to SR)
Assume that lies above . Let x = a, y = b,
SG= and HP = .
• Step 3 Find the perpendicular bisector of SG.
Denote it by BS. Let HP = HP.{BS}. If SG = ,
go to Step 5; otherwise, go to Step 4.
dc PPba PP
ba PP dc PP
yxPP
dc PP
76
Merges Two Voronoi Diagrams into
One Voronoi Diagram
• Step 4 The ray from VD(SL ) and VD(SR) which
BS first intersects with must be a perpendicular
bisector of either or for some z. If this
ray is the perpendicular bisector of , then let
SG = ; otherwise, let SG = . Go to Step 3.
• Step 5 Discard the edges of VD(SL) which
extend to the right of HP and discard the edges
of VD(SR) which extend to the left of HP. The
resulting graph is the Voronoi diagram of S =
SL.SR.
zxPP zy PP
zy PP
zxPP yz PP
77
Merges Two Voronoi Diagrams into
One Voronoi Diagram
• Def : Given a point P and a set S of points,
the distance between P and S is the distance
between P and Pi which is the nearest
neighbor of P in S.
• The HP obtained from the above algorithm
is the locus of points which keep equal
distances to SL and SR .
• The HP is monotonic in y.
78
Merges Two Voronoi Diagrams into
One Voronoi Diagram
• # of edges of a Voronoi diagram 3n -
6, where n is # of points.
• Reasoning:
i. # of edges of a planar graph with n vertices
3n - 6.
ii. A Delaunay triangulation is a planar graph.
iii. Edges in Delaunay triangulation
edges in Voronoi diagram.
1 1
79
Construct Convex Hull from
Voronoi diagram
• After a Voronoi diagram is constructed, a
convex hull can by found in O(n) time.
Voronoi Diagram/Convex Hull Duality
Sites sharing a half-infinite edge are convex hull vertices
e
v
pi
81
Construct Convex Hull from
Voronoi diagram
• Step 1 : Find an infinite ray by examining
all Voronoi edges.
• Step 2 : Let Pi be the point to the left of the
infinite ray. Pi is a convex hull vertex.
Examine the Voronoi polygon of Pi to find
the next infinite ray.
• Step 3 : Repeat Step 2 until we return to the
Starting ray.
82
Time complexity
• Time complexity for merging 2 Voronoi
diagrams:
– Step 1: O(n)
– Step 2: O(n)
– Step 3 ~ Step 5: O(n)
(at most 3n - 6 edges in VD(SL) and VD(SR) and
at most n segments in HP)
T(n) = 2T(n/2) + O(n)=O(n log n)
Applications 1(Static Point Set)
Closest pair of points:
Go through edge list for VD(P) and determine minimum
All next neighbors :
Go through edge list for VD(P) for all points and get
next neighbors in each case
Minimum Spanning tree (after Kruskal)
1. Each point p from P defines 1-element set of
2. More than a set of T exists
2.1) find p,p´ with p in T and p´ not in T with d(p,
p´)
minimum.
2.2) connect T and p´ contained in T´ (union)
Theorem: The MST can be computed in time O(n log n)
Applications (dynamic object set)
Search for next neighbor :
Idea : Hierarchical subdivision of VD(P)
Step 1 : Triangulation of final Voronoi regions
Step 2 : Summary of triangles and structure of a search tree
Rule of Kirkpatrick :
Remove in each case points with degree < 12,
its neighbor is already far.
Theorem: Using the rule of Kirkpatrick a search tree
of logarithmic depth develops.
A a
b c a b c
A
Degenerate Cases
• Events in Q share the same y-coordinate
– Can additionally sort them using x-coordinate
• Circle event involving more than 3 sites
– Current algorithm produces multiple degree 3
Voronoi vertices joined by zero-length edges
– Can be fixed in post processing
Degenerate Cases
• Site points are collinear (break points
neither converge or diverge)
– Bounding box takes care of this
• One of the sites coincides with the lowest
point of the circle event
– Do nothing
Site coincides with circle event:
the same algorithm applies!
1. New site detected
2. Break one of the arcs an infinitesimal distance
away from the arc’s end point
Site coincides with circle event
Summary
• Voronoi diagram is a useful planar
subdivision of a discrete point set
• Voronoi diagrams have linear complexity
and can be constructed in O(n log n) time
• Fortune’s algorithm (optimal)

Contenu connexe

Tendances (20)

Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithm
 
Pixel relationships
Pixel relationshipsPixel relationships
Pixel relationships
 
Computer graphics unit 4th
Computer graphics unit 4thComputer graphics unit 4th
Computer graphics unit 4th
 
Z transform ROC eng.Math
Z transform ROC eng.MathZ transform ROC eng.Math
Z transform ROC eng.Math
 
Eigen value and eigen vector
Eigen value and eigen vectorEigen value and eigen vector
Eigen value and eigen vector
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
Chapter2 - Linear Time-Invariant System
Chapter2 - Linear Time-Invariant SystemChapter2 - Linear Time-Invariant System
Chapter2 - Linear Time-Invariant System
 
The Digital Image Processing Q@A
The Digital Image Processing Q@AThe Digital Image Processing Q@A
The Digital Image Processing Q@A
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
Basics of pixel neighbor.
Basics of pixel neighbor.Basics of pixel neighbor.
Basics of pixel neighbor.
 
Newton raphson method
Newton raphson methodNewton raphson method
Newton raphson method
 
Circular Convolution
Circular ConvolutionCircular Convolution
Circular Convolution
 
linear transformation
linear transformationlinear transformation
linear transformation
 
Chapter3 - Fourier Series Representation of Periodic Signals
Chapter3 - Fourier Series Representation of Periodic SignalsChapter3 - Fourier Series Representation of Periodic Signals
Chapter3 - Fourier Series Representation of Periodic Signals
 
Matrix transformation
Matrix transformationMatrix transformation
Matrix transformation
 
Digtial Image Processing Q@A
Digtial Image Processing Q@ADigtial Image Processing Q@A
Digtial Image Processing Q@A
 
Topological sort
Topological sortTopological sort
Topological sort
 
Ray tracing
 Ray tracing Ray tracing
Ray tracing
 
Mealy moore machine model
Mealy moore machine modelMealy moore machine model
Mealy moore machine model
 
Euler and hamilton paths
Euler and hamilton pathsEuler and hamilton paths
Euler and hamilton paths
 

En vedette

Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmDr Sandeep Kumar Poonia
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmDr Sandeep Kumar Poonia
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmDr Sandeep Kumar Poonia
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithmDr Sandeep Kumar Poonia
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmDr Sandeep Kumar Poonia
 
Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)nikhilarora2211
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsDr Sandeep Kumar Poonia
 

En vedette (19)

Lecture24
Lecture24Lecture24
Lecture24
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithm
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithm
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithm
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithm
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithm
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
 
RMABC
RMABCRMABC
RMABC
 
Splay tree
Splay treeSplay tree
Splay tree
 
Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)
 
Splay Tree
Splay TreeSplay Tree
Splay Tree
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
 
2-3 Tree
2-3 Tree2-3 Tree
2-3 Tree
 
Lecture26
Lecture26Lecture26
Lecture26
 
Soft computing
Soft computingSoft computing
Soft computing
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 

Similaire à Lecture25

Higher-Order Voronoi Diagrams of Polygonal Objects. Dissertation
Higher-Order Voronoi Diagrams of Polygonal Objects. DissertationHigher-Order Voronoi Diagrams of Polygonal Objects. Dissertation
Higher-Order Voronoi Diagrams of Polygonal Objects. DissertationMaksym Zavershynskyi
 
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay Triangulations
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay TriangulationsA New Approach to Output-Sensitive Voronoi Diagrams and Delaunay Triangulations
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay TriangulationsDon Sheehy
 
A sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi DiagramsA sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi DiagramsSweta Sharma
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational GeometryMinh-Tri Pham
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fillwahab13
 
Unit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxUnit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxIronMan665214
 
K12020 VARUN RAC PPT
K12020 VARUN RAC PPTK12020 VARUN RAC PPT
K12020 VARUN RAC PPTSourabh Gupta
 
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...Markov Chain Monitoring - Application to demand prediction in bike sharing sy...
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...Harshal Chaudhari
 
Computer Vision - Single View
Computer Vision - Single ViewComputer Vision - Single View
Computer Vision - Single ViewWael Badawy
 
Mesh Shape Editing
Mesh Shape EditingMesh Shape Editing
Mesh Shape Editingssuser24ddad
 
CAD Topology and Geometry Basics
CAD Topology and Geometry BasicsCAD Topology and Geometry Basics
CAD Topology and Geometry BasicsAndrey Dankevich
 
2-Vector.pptx
2-Vector.pptx2-Vector.pptx
2-Vector.pptxssfasf
 
972 B3102005 Cullity Chapter 2
972 B3102005 Cullity Chapter 2972 B3102005 Cullity Chapter 2
972 B3102005 Cullity Chapter 2praying1
 

Similaire à Lecture25 (20)

4763144.ppt
4763144.ppt4763144.ppt
4763144.ppt
 
Fortune's algorithm
Fortune's algorithmFortune's algorithm
Fortune's algorithm
 
Higher-Order Voronoi Diagrams of Polygonal Objects. Dissertation
Higher-Order Voronoi Diagrams of Polygonal Objects. DissertationHigher-Order Voronoi Diagrams of Polygonal Objects. Dissertation
Higher-Order Voronoi Diagrams of Polygonal Objects. Dissertation
 
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay Triangulations
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay TriangulationsA New Approach to Output-Sensitive Voronoi Diagrams and Delaunay Triangulations
A New Approach to Output-Sensitive Voronoi Diagrams and Delaunay Triangulations
 
A sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi DiagramsA sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi Diagrams
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational Geometry
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 
Unit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxUnit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptx
 
K12020 VARUN RAC PPT
K12020 VARUN RAC PPTK12020 VARUN RAC PPT
K12020 VARUN RAC PPT
 
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...Markov Chain Monitoring - Application to demand prediction in bike sharing sy...
Markov Chain Monitoring - Application to demand prediction in bike sharing sy...
 
Computer Vision - Single View
Computer Vision - Single ViewComputer Vision - Single View
Computer Vision - Single View
 
Mesh Shape Editing
Mesh Shape EditingMesh Shape Editing
Mesh Shape Editing
 
CAD Topology and Geometry Basics
CAD Topology and Geometry BasicsCAD Topology and Geometry Basics
CAD Topology and Geometry Basics
 
Network flows
Network flowsNetwork flows
Network flows
 
2-Vector.pptx
2-Vector.pptx2-Vector.pptx
2-Vector.pptx
 
972 B3102005 Cullity Chapter 2
972 B3102005 Cullity Chapter 2972 B3102005 Cullity Chapter 2
972 B3102005 Cullity Chapter 2
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
Robotics: 3D Movements
Robotics: 3D MovementsRobotics: 3D Movements
Robotics: 3D Movements
 
UNIT2.pptx
UNIT2.pptxUNIT2.pptx
UNIT2.pptx
 
co-ordinate systems
 co-ordinate systems co-ordinate systems
co-ordinate systems
 

Plus de Dr Sandeep Kumar Poonia

Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm Dr Sandeep Kumar Poonia
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Dr Sandeep Kumar Poonia
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Dr Sandeep Kumar Poonia
 
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functionsDr Sandeep Kumar Poonia
 

Plus de Dr Sandeep Kumar Poonia (16)

Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithm
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm
 
A new approach of program slicing
A new approach of program slicingA new approach of program slicing
A new approach of program slicing
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...
 
Enhanced abc algo for tsp
Enhanced abc algo for tspEnhanced abc algo for tsp
Enhanced abc algo for tsp
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...
 
Lecture23
Lecture23Lecture23
Lecture23
 
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functions
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Graph
GraphGraph
Graph
 

Dernier

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Dernier (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Lecture25

  • 2. Outline • Definitions and Examples • Properties of Voronoi diagrams • Complexity of Voronoi diagrams • Constructing Voronoi diagrams – Intuitions – Data Structures – Algorithm • Running Time Analysis • Demo • Duality and degenerate cases
  • 3. Post Office: What is the area of service? q q : free point e e : Voronoi edge v v : Voronoi vertex pi pi : site points
  • 4. Definition of Voronoi Diagram • 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.
  • 6. Two sites form a perpendicular bisector Voronoi Diagram is a line that extends infinitely in both directions, and the two half planes on either side.
  • 7. Collinear sites form a series of parallel lines
  • 8. Non-collinear sites form Voronoi half lines that meet at a vertex A Voronoi vertex is the center of an empty circle touching 3 or more sites. v Half lines A vertex has degree 3
  • 9. Voronoi Cells and Segments v
  • 10. Voronoi Cells and Segments v Unbounded CellBounded Cell Segment
  • 11. vWhich of the following is true for 2-D Voronoi diagrams? Four or more non-collinear sites are… 1. sufficient to create a bounded cell 2. necessary to create a bounded cell 3. 1 and 2 4. none of above
  • 12. vWhich of the following is true for 2-D Voronoi diagrams? Four or more non-collinear sites are… 1. sufficient to create a bounded cell 2. necessary to create a bounded cell 3. 1 and 2 4. none of above
  • 14. Summary of Voronoi Properties A point q lies on a Voronoi edge between sites pi and pj iff the largest empty circle centered at q touches only pi and pj – A Voronoi edge is a subset of locus of points equidistant from pi and pj e e : Voronoi edge v v : Voronoi vertex pi pi : site points
  • 15. Summary of Voronoi Properties A point q is a vertex iff the largest empty circle centered at q touches at least 3 sites – A Voronoi vertex is an intersection of 3 more segments, each equidistant from a pair of sites e e : Voronoi edge v v : Voronoi vertex pi pi : site points
  • 16. Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Intuition: Not all bisectors are Voronoi edges! e e : Voronoi edge pi pi : site points
  • 17. Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Claim: For n 3, |v| 2n 5 and |e| 3n 6 Proof: (Easy Case) … Collinear sites  |v| = 0, |e| = n – 1
  • 18. Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Claim: For n 3, |v| 2n 5 and |e| 3n 6 Proof: (General Case) • Euler’s Formula: for connected, planar graphs, |v| – |e| + f = 2 Where: |v| is the number of vertices |e| is the number of edges f is the number of faces
  • 19. Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Claim: For n 3, |v| 2n 5 and |e| 3n 6 Proof: (General Case) • For Voronoi graphs, f = n  (|v| +1) – |e| + n = 2 epi p To apply Euler’s Formula, we “planarize”theVoronoidiagram by connectinghalflines to an extra vertex.
  • 20. Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Moreover, and so together with we get, for n 3 ||2)deg( )( ev PVorv ),(PVorv 3)deg(v )1|(|3||2 ve 2||)1|(| nev 63|| 52|| ne nv
  • 21. Constructing Voronoi Diagrams Given a half plane intersection algorithm…
  • 22. Constructing Voronoi Diagrams Given a half plane intersection algorithm…
  • 23. Constructing Voronoi Diagrams Given a half plane intersection algorithm…
  • 24. Constructing Voronoi Diagrams Given a half plane intersection algorithm… Repeat for each site Running Time: O( n2 log n )
  • 25. Constructing Voronoi Diagrams • Half plane intersection O( n2 log n ) • Fortune’s Algorithm – Sweep line algorithm • Voronoi diagram constructed as horizontal line sweeps the set of sites from top to bottom • Incremental construction  maintains portion of diagram which cannot change due to sites below sweep line, keeping track of incremental changes for each site (and Voronoi vertex) it “sweeps”
  • 26. Constructing Voronoi Diagrams What is the invariant we are looking for? Maintain a representation of the locus of points q that are closer to some site pi above the sweep line than to the line itself (and thus to any site below the line). e v pi Sweep Line q
  • 27. Constructing Voronoi Diagrams Which points are closer to a site above the sweep line than to the sweep line itself? Sweep Line pi q The set of parabolic arcs form a beach-line that bounds the locus of all such points Equidistance
  • 28. Constructing Voronoi Diagrams Break points trace out Voronoi edges. Equidistance Sweep Line pi q
  • 29. Constructing Voronoi Diagrams Arcs flatten out as sweep line moves down. Sweep Line pi q
  • 30. Eventually, the middle arc disappears. Constructing Voronoi Diagrams Sweep Line pi q
  • 31. We have detected a circle that is empty (contains no sites) and touches 3 or more sites. Constructing Voronoi Diagrams Sweep Line pi q Voronoi vertex!
  • 32. Beach Line properties • Voronoi edges are traced by the break points as the sweep line moves down. – Emergence of a new break point(s) (from formation of a new arc or a fusion of two existing break points) identifies a new edge • Voronoi vertices are identified when two break points meet (fuse). – Decimation of an old arc identifies new vertex
  • 33. Data Structures • Current state of the Voronoi diagram – Doubly linked list of half-edge, vertex, cell records • Current state of the beach line – Keep track of break points – Keep track of arcs currently on beach line • Current state of the sweep line – Priority event queue sorted on decreasing y-coordinate
  • 34. Doubly Linked List (D) • Goal: a simple data structure that allows an algorithm to traverse a Voronoi diagram’s segments, cells and vertices e v Cell(pi)
  • 35. Doubly Linked List (D) • Divide segments into uni-directional half-edges • A chain of counter-clockwise half-edges forms a cell • Define a half-edge’s “twin” to be its opposite half-edge of the same segment e v Cell(pi)
  • 36. Doubly Linked List (D) • Cell Table – Cell(pi) : pointer to any incident half-edge • Vertex Table – vi : list of pointers to all incident half-edges • Doubly Linked-List of half-edges; each has: – Pointer to Cell Table entry – Pointers to start/end vertices of half-edge – Pointers to previous/next half-edges in the CCW chain – Pointer to twin half-edge
  • 37. Balanced Binary Tree (T) • Internal nodes represent break points between two arcs – Also contains a pointer to the D record of the edge being traced • Leaf nodes represent arcs, each arc is in turn represented by the site that generated it – Also contains a pointer to a potential circle event pi pj pk pl < pj, pk> < pi, pj> < pk, pl> pi pj pk pl l
  • 38. Event Queue (Q) • An event is an interesting point encountered by the sweep line as it sweeps from top to bottom – Sweep line makes discrete stops, rather than a continuous sweep • Consists of Site Events (when the sweep line encounters a new site point) and Circle Events (when the sweep line encounters the bottom of an empty circle touching 3 or more sites). • Events are prioritized based on y-coordinate
  • 39. Site Event A new arc appears when a new site appears. l
  • 40. Site Event A new arc appears when a new site appears. l
  • 41. Site Event Original arc above the new site is broken into two  Number of arcs on beach line is O(n) l
  • 42. Circle Event An arc disappears whenever an empty circle touches three or more sites and is tangent to the sweep line. Sweep line helps determine that the circle is indeed empty. Circle Event! Sweep Line pi q Voronoi vertex!
  • 43. Event Queue Summary • Site Events are – given as input – represented by the xy-coordinate of the site point • Circle Events are – computed on the fly (intersection of the two bisectors in between the three sites) – represented by the xy-coordinate of the lowest point of an empty circle touching three or more sites – “anticipated”, these newly generated events may be false and need to be removed later • Event Queue prioritizes events based on their y- coordinates
  • 44. Summarizing Data Structures • Current state of the Voronoi diagram – Doubly linked list of half-edge, vertex, cell records • Current state of the beach line – Keep track of break points • Innernodes of binary search tree; representedby a tuple – Keep track of arcs currently on beach line • Leaf nodes of binary search tree; represented by a site that generatedthearc • Current state of the sweep line – Priority event queue sorted on decreasing y-coordinate
  • 45. Algorithm 1. Initialize • Event queue Q  all site events • Binary search tree T  • Doubly linked list D  2. While Q not , • Remove event (e) from Q with largest y- coordinate • HandleEvent(e, T, D)
  • 46. Handling Site Events 1. Locate the existing arc (if any) that is above the new site 2. Break the arc by replacing the leaf node with a sub tree representing the new arc and its break points 3. Add two half-edge records in the doubly linked list 4. Check for potential circle event(s), add them to event queue if they exist
  • 47. Locate the existing arc that is above the new site pi pj pk pl < pj, pk> < pi, pj> < pk, pl> • The x coordinate of the new site is used for the binary search • The x coordinate of each breakpoint along the root to leaf path is computed on the fly pi pj pk pl lpm
  • 48. Break the Arc pi pj pk < pj, pk> < pi, pj> < pk, pl> Corresponding leaf replaced by a new sub-tree pi pj pk pl l pm pm pl < pl, pm> < pm, pl> pl Different arcs can be identified by the same site!
  • 49. Add a new edge record in the doubly linked list pi pj pk < pj, pk> < pi, pj> < pk, pl> pm pl < pl, pm> < pm, pl> pl pi pj pk pl l pm New Half Edge Record Endpoints Pointers to two half-edge records l pm
  • 50. Checking for Potential Circle Events • Scan for triple of consecutive arcs and determine if breakpoints converge – Triples with new arc in the middle do not have break points that converge
  • 51. Checking for Potential Circle Events • Scan for triple of consecutive arcs and determine if breakpoints converge – Triples with new arc in the middle do not have break points that converge
  • 52. Checking for Potential Circle Events • Scan for triple of consecutive arcs and determine if breakpoints converge – Triples with new arc in the middle do not have break points that converge
  • 53. Converging break points may not always yield a circle event • Appearance of a new site before the circle event makes the potential circle non-empty l (The original circle event becomes a false alarm)
  • 54. Handling Site Events 1. Locate the leaf representing the existing arc that is above the new site – Delete the potential circle event in the event queue 2. Break the arc by replacing the leaf node with a sub tree representing the new arc and break points 3. Add a new edge record in the doubly linked list 4. Check for potential circle event(s), add them to queue if they exist – Store in the corresponding leaf of T a pointer to the new circle event in the queue
  • 55. Handling Circle Events 1. Add vertex to corresponding edge record in doubly linked list 2. Delete from T the leaf node of the disappearing arc and its associated circle events in the event queue 3. Create new edge record in doubly linked list 4. Check the new triplets formed by the former neighboring arcs for potential circle events
  • 56. A Circle Event pi pj pk < pj, pk> < pi, pj> < pk, pl> pi pj pk pl l pm pm pl < pl, pm> < pm, pl> pl
  • 57. Add vertex to corresponding edge record pi pj pk < pj, pk> < pi, pj> < pk, pl> pi pj pk pl l pm pm pl < pl, pm> < pm, pl> pl Half Edge Record Endpoints.add(x, y) Half Edge Record Endpoints.add(x, y) Link!
  • 58. Deleting disappearing arc pi pj pk < pj, pk> < pi, pj> pi pj pk pl l pm pm pl < pm, pl>
  • 59. Deleting disappearing arc pi pj pk < pj, pk> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> < pk, pm>
  • 60. Create new edge record pi pj pk < pj, pk> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> < pk, pm> New Half Edge Record Endpoints.add(x, y) A new edge is traced out by the new break point < pk, pm>
  • 61. Check the new triplets for potential circle events pi pj pk < pj, pk> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> < pk, pm> Q y… new circle event
  • 62. Minor Detail • Algorithm terminates when Q = , but the beach line and its break points continue to trace the Voronoi edges – Terminate these “half-infinite” edges via a bounding box
  • 63. Algorithm Termination pi pj pk < pj, pk> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> < pk, pm> Q
  • 64. Algorithm Termination pi pj < pj, pm> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> Q
  • 65. Algorithm Termination pi pj < pj, pm> < pi, pj> pi pj pk pl l pm pm pl < pm, pl> Q Terminate half-lines with a bounding box!
  • 66. Handling Site Events 1. Locate the leaf representing the existing arc that is above the new site – Deletethepotentialcircleevent in the event queue 2. Break the arc by replacing the leaf node with a sub tree representing the new arc and break points 3. Add a new edge record in the link list 4. Check for potential circle event(s), add them to queue if they exist – Storein the corresponding leafof T a pointerto the new circle event in the queue Running Time O(log n) O(1) O(1) O(1)
  • 67. Handling Circle Events 1. Delete from T the leaf node of the disappearing arc and its associated circle events in the event queue 2. Add vertex record in doubly link list 3. Create new edge record in doubly link list 4. Check the new triplets formed by the former neighboring arcs for potential circle events Running Time O(log n) O(1) O(1) O(1)
  • 68. Total Running Time • Each new site can generate at most two new arcs beach line can have at most 2n – 1 arcs at most O(n) site and circle events in the queue • Site/Circle Event Handler O(log n)  O(n log n) total running time
  • 69. Is Fortune’s Algorithm Optimal? • We can sort numbers using any algorithm that constructs a Voronoi diagram! • Map input numbers to a position on the number line. The resulting Voronoi diagram is doubly linked list that forms a chain of unbounded cells in the left-to-right (sorted) order. -5 1 3 6 7 Number Line
  • 70. 70 Divide-and-Conquer approach • Input : A set S of n planar points. • Output : The Voronoi diagram of S. • Step 1 If S contains less than 4 point, solve directly and return. • Step 2 Find a median line L perpendicular to the X-axis which divides S into SL and SR such that SL (SR) lies to the left(right) of L and the sizes of SL and SR are equal.
  • 71. 71 Divide-and-Conquer approach • Step 3 Construct Voronoi diagrams of SL and SR recursively. Denote these Voronoi diagrams by VD(SL) and VD(SR). • Step 4 Construct a dividing piece-wise linear hyperplane HP which is the locus of points simultaneously closest to a point in SL and a point in SR. Discard all segments of VD(SL) which lie to the right of HP and all segments of VD(SR) that lie to the left of HP. The resulting graph is the Voronoi diagram of S.
  • 72. 72 How to merge two Voronoi diagrams ?
  • 73. 73 • Merging: How to merge two Voronoi diagrams ? b15b45b14b13b34b46b36b23b26
  • 74. 74 Merges Two Voronoi Diagrams into One Voronoi Diagram • Input : (a) SL and SR where SL and SR are divided by a perpendicular line L. (b) VD(SL ) and VD(SR ). • Output : VD(S) where S = SL ∩SR • Step 1 Find the convex hulls of SL and SR . Let them be denoted as Hull(SL) and Hull(SR), respectively. (A special algorithm for finding a convex hull in this case will by given later.)
  • 75. 75 Merges Two Voronoi Diagrams into One Voronoi Diagram • Step 2 Find segments and which join HULL(SL ) and HULL(SR ) into a convex hull (Pa and Pc belong to SL and Pb and Pd belong to SR) Assume that lies above . Let x = a, y = b, SG= and HP = . • Step 3 Find the perpendicular bisector of SG. Denote it by BS. Let HP = HP.{BS}. If SG = , go to Step 5; otherwise, go to Step 4. dc PPba PP ba PP dc PP yxPP dc PP
  • 76. 76 Merges Two Voronoi Diagrams into One Voronoi Diagram • Step 4 The ray from VD(SL ) and VD(SR) which BS first intersects with must be a perpendicular bisector of either or for some z. If this ray is the perpendicular bisector of , then let SG = ; otherwise, let SG = . Go to Step 3. • Step 5 Discard the edges of VD(SL) which extend to the right of HP and discard the edges of VD(SR) which extend to the left of HP. The resulting graph is the Voronoi diagram of S = SL.SR. zxPP zy PP zy PP zxPP yz PP
  • 77. 77 Merges Two Voronoi Diagrams into One Voronoi Diagram • Def : Given a point P and a set S of points, the distance between P and S is the distance between P and Pi which is the nearest neighbor of P in S. • The HP obtained from the above algorithm is the locus of points which keep equal distances to SL and SR . • The HP is monotonic in y.
  • 78. 78 Merges Two Voronoi Diagrams into One Voronoi Diagram • # of edges of a Voronoi diagram 3n - 6, where n is # of points. • Reasoning: i. # of edges of a planar graph with n vertices 3n - 6. ii. A Delaunay triangulation is a planar graph. iii. Edges in Delaunay triangulation edges in Voronoi diagram. 1 1
  • 79. 79 Construct Convex Hull from Voronoi diagram • After a Voronoi diagram is constructed, a convex hull can by found in O(n) time.
  • 80. Voronoi Diagram/Convex Hull Duality Sites sharing a half-infinite edge are convex hull vertices e v pi
  • 81. 81 Construct Convex Hull from Voronoi diagram • Step 1 : Find an infinite ray by examining all Voronoi edges. • Step 2 : Let Pi be the point to the left of the infinite ray. Pi is a convex hull vertex. Examine the Voronoi polygon of Pi to find the next infinite ray. • Step 3 : Repeat Step 2 until we return to the Starting ray.
  • 82. 82 Time complexity • Time complexity for merging 2 Voronoi diagrams: – Step 1: O(n) – Step 2: O(n) – Step 3 ~ Step 5: O(n) (at most 3n - 6 edges in VD(SL) and VD(SR) and at most n segments in HP) T(n) = 2T(n/2) + O(n)=O(n log n)
  • 83. Applications 1(Static Point Set) Closest pair of points: Go through edge list for VD(P) and determine minimum All next neighbors : Go through edge list for VD(P) for all points and get next neighbors in each case Minimum Spanning tree (after Kruskal) 1. Each point p from P defines 1-element set of 2. More than a set of T exists 2.1) find p,p´ with p in T and p´ not in T with d(p, p´) minimum. 2.2) connect T and p´ contained in T´ (union) Theorem: The MST can be computed in time O(n log n)
  • 84. Applications (dynamic object set) Search for next neighbor : Idea : Hierarchical subdivision of VD(P) Step 1 : Triangulation of final Voronoi regions Step 2 : Summary of triangles and structure of a search tree Rule of Kirkpatrick : Remove in each case points with degree < 12, its neighbor is already far. Theorem: Using the rule of Kirkpatrick a search tree of logarithmic depth develops. A a b c a b c A
  • 85. Degenerate Cases • Events in Q share the same y-coordinate – Can additionally sort them using x-coordinate • Circle event involving more than 3 sites – Current algorithm produces multiple degree 3 Voronoi vertices joined by zero-length edges – Can be fixed in post processing
  • 86. Degenerate Cases • Site points are collinear (break points neither converge or diverge) – Bounding box takes care of this • One of the sites coincides with the lowest point of the circle event – Do nothing
  • 87. Site coincides with circle event: the same algorithm applies! 1. New site detected 2. Break one of the arcs an infinitesimal distance away from the arc’s end point
  • 88. Site coincides with circle event
  • 89. Summary • Voronoi diagram is a useful planar subdivision of a discrete point set • Voronoi diagrams have linear complexity and can be constructed in O(n log n) time • Fortune’s algorithm (optimal)