Voronoi Diagrams.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Polygon Triangulation
Voronoi Diagram – Fortune ’ s Algorithm Reporter: GI1 11 號 蔡逸凡 Date: 2004/10/28 Reference: Computational Geometry ch7 ISBN:
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hull obstacle start end Convex Hull Convex Hull
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
The Divide-and-Conquer Strategy
Department of Geoinformation Science Technische Universität Berlin WS 2006/07 Geoinformation Technology: Voronoi Diagrams Alexandra Stadler Institute for.
Overlay of Two Subdivisions
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Voronoi Diagram Presenter: GI1 11號 蔡逸凡
Lecture 7: Voronoi Diagrams Presented by Allen Miu Computational Geometry September 27, 2001.
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 5: Voronoi Diagrams Wednesday,
Voronoi Diagrams Computational Geometry, WS 2006/07 Lecture 10 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Delaunay Triangulation.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Brute-Force Triangulation
1 PQ Trees, PC Trees, and Planar Graphs Hsu & McConnell Presented by Roi Barkan.
UNC Chapel Hill M. C. Lin Point Location Chapter 6 of the Textbook –Review –Algorithm Analysis –Dealing with Degeneracies.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
Triangulating a monotone polygon
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Week Aug-24 – Aug-29 Introduction to Spatial Computing CSE 5ISC Some slides adapted from Worboys and Duckham (2004) GIS: A Computing Perspective, Second.
Finding maximal planar subgraphs Wen-Lian Hsu 1/33.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
3/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Delaunay Triangulations I Carola Wenk Based on: Computational.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Polygon Triangulation
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
Geometric Data Structures
(Slides mostly by Allen Miu)
Algorithm design techniques Dr. M. Gavrilova
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry Capter:1-2.1
Chapter 7 Voronoi Diagrams
I. The Problem of Molding
Computational Geometry
Overlay of Two Subdivisions
Presentation transcript:

Voronoi Diagrams

Post Office: What is the area of service? 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

Voronoi Cells and Segments Unbounded Cell Bounded Cell Segment

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 pi : site points e : Voronoi edge v : Voronoi vertex v pi

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 pi : site points e : Voronoi edge v : Voronoi vertex v pi

Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Intuition: Not all bisectors are Voronoi edges! pi : site points e : Voronoi edge e pi

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 To apply Euler’s Formula, we “planarize” the Voronoi diagram by connecting half lines to an extra vertex. p e pi

Voronoi diagrams have linear complexity {|v|, |e| = O(n)} Moreover, and so together with we get, for n  3

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 Half plane intersection algorithm: O(n log n) Repeat for each site Running Time: O( n2 log n )

Constructing Voronoi Diagrams 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? e q pi Sweep Line v 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).

Constructing Voronoi Diagrams Which points are closer to a site above the sweep line than to the sweep line itself? q pi Equidistance Sweep Line The set of parabolic arcs form a beach-line that bounds the locus of all such points

Constructing Voronoi Diagrams Break points trace out Voronoi edges. q pi Equidistance Sweep Line Break points do not trace out edges continuously in the actual algorithm. The sweep line stops at discrete event points as will be shown later.

Constructing Voronoi Diagrams Arcs flatten out as sweep line moves down. q pi Sweep Line

Constructing Voronoi Diagrams Eventually, the middle arc disappears. q pi Sweep Line

Constructing Voronoi Diagrams We have detected a circle that is empty (contains no sites) and touches 3 or more sites. q pi Voronoi vertex! Sweep Line

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 Discrete sweep steps, rather than a continuous sweep

Doubly Linked List (D) Goal: a simple data structure that allows an algorithm to traverse a Voronoi diagram’s segments, cells and vertices e Cell(pi) v

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 Vertex 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> pj pi pl pk 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

A new arc appears when a new site appears. Site Event A new arc appears when a new site appears. l

A new arc appears when a new site appears. 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. q pi Circle Event! Voronoi vertex! Sweep Line Sweep line helps determine that the circle is indeed empty.

Event Queue Summary Site Events are Circle 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 Inner nodes of binary search tree; represented by a tuple Keep track of arcs currently on beach line Leaf nodes of binary search tree; represented by a site that generated the arc Current state of the sweep line Priority event queue sorted on decreasing y-coordinate

Algorithm Initialize While Q not , Event queue Q  all site events Binary search tree T   Doubly linked list D   While Q not , Remove event (e) from Q with largest y-coordinate HandleEvent(e, T, D)

Handling Site Events Locate the existing arc (if any) that is above the new site Break the arc by replacing the leaf node with a sub tree representing the new arc and its break points Add two half-edge records in the doubly linked list Check for potential circle event(s), add them to event queue if they exist

Locate the existing arc that is above the new site 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 < pj, pk> pj pi pl pk < pi, pj> < pk, pl> pm l pi pj pk pl

Break the Arc Corresponding leaf replaced by a new sub-tree < pj, pk> < pi, pj> < pk, pl> < pl, pm> pj pi pj pk pi pl pk < pm, pl> pm l Different arcs can be identified by the same site! pl pm pl

Add a new edge record in the doubly linked list New Half Edge Record Endpoints   < pj, pk> Pointers to two half-edge records < pi, pj> < pk, pl> < pl, pm> pj pi pj pk pi pl pk < pm, pl> pm pm l l pl pm pl

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 Locate the leaf representing the existing arc that is above the new site Delete the potential circle event in the event queue Break the arc by replacing the leaf node with a sub tree representing the new arc and break points Add a new edge record in the doubly linked list 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 Add vertex to corresponding edge record in doubly linked list Delete from T the leaf node of the disappearing arc and its associated circle events in the event queue Create new edge record in doubly linked list Check the new triplets formed by the former neighboring arcs for potential circle events

A Circle Event < pj, pk> < pi, pj> < pk, pl> < pl, pm> pi pi pj pk pl pk pj < pm, pl> pm l pl pm pl

Add vertex to corresponding edge record Link! < pj, pk> Half Edge Record Endpoints.add(x, y) Half Edge Record Endpoints.add(x, y) < pi, pj> < pk, pl> < pl, pm> pi pi pj pk pl pk pj < pm, pl> pm l pl pm pl

Deleting disappearing arc < pj, pk> < pi, pj> pi pi pj pk pl pk pj < pm, pl> pm l pm pl

Deleting disappearing arc < pj, pk> < pi, pj> < pk, pm> < pm, pl> pi pi pj pk pl pk pj pm pm pl l

Create new edge record < pj, pk> < pi, pj> < pk, pm> New Half Edge Record Endpoints.add(x, y) < pi, pj> < pk, pm> < pm, pl> pi pi pj pk pl pk pj pm pm pl l A new edge is traced out by the new break point < pk, pm>

Check the new triplets for potential circle events < pj, pk> < pi, pj> < pk, pm> < pm, pl> pi pi pj pk pl pk pj pm pm pl l 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 < pj, pk> < pi, pj> < pk, pm> < pm, pl> pi pi pj pk pl pk pj pm pm pl Q  l

Algorithm Termination < pj, pm> < pm, pl> < pi, pj> pi pi pj pl pk pm pl pj pm Q  l

Algorithm Termination < pj, pm> < pm, pl> < pi, pj> pi pi pj pl pk pm pl pj pm Terminate half-lines with a bounding box! Q  l

Handling Site Events O(log n) O(1) O(1) O(1) Running Time Locate the leaf representing the existing arc that is above the new site Delete the potential circle event in the event queue Break the arc by replacing the leaf node with a sub tree representing the new arc and break points Add a new edge record in the link list 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 O(log n) O(1) O(1) O(1)

Handling Circle Events Running Time Delete from T the leaf node of the disappearing arc and its associated circle events in the event queue Add vertex record in doubly link list Create new edge record in doubly link list Check the new triplets formed by the former neighboring arcs for potential circle events 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

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)