Computational Geometry Lecture 10: Voronoi diagrams Computational - - PowerPoint PPT Presentation

computational geometry
SMART_READER_LITE
LIVE PREVIEW

Computational Geometry Lecture 10: Voronoi diagrams Computational - - PowerPoint PPT Presentation

Motivation Voronoi diagrams Voronoi diagrams Computational Geometry Lecture 10: Voronoi diagrams Computational Geometry Lecture 10: Voronoi diagrams Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation Voronoi diagram Given


slide-1
SLIDE 1

Motivation Voronoi diagrams

Voronoi diagrams

Computational Geometry

Lecture 10: Voronoi diagrams

Computational Geometry Lecture 10: Voronoi diagrams

slide-2
SLIDE 2

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Given some trees, seen from above, which region will they occupy?

Computational Geometry Lecture 10: Voronoi diagrams

slide-3
SLIDE 3

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Given some trees, seen from above, which region will they occupy?

Computational Geometry Lecture 10: Voronoi diagrams

slide-4
SLIDE 4

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Given ambulance posts in a country, in case of an emergency somewhere, where should the ambulance come from?

Computational Geometry Lecture 10: Voronoi diagrams

slide-5
SLIDE 5

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Given ambulance posts in a country, in case of an emergency somewhere, where should the ambulance come from?

Computational Geometry Lecture 10: Voronoi diagrams

slide-6
SLIDE 6

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Voronoi diagram induced by a set of points (called sites): Subdivision of the plane where the faces correspond to the regions where one site is closest

Computational Geometry Lecture 10: Voronoi diagrams

slide-7
SLIDE 7

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Computational Geometry Lecture 10: Voronoi diagrams

slide-8
SLIDE 8

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Voronoi diagram

Question: Why is the Voronoi diagram not really a subdivision?

Computational Geometry Lecture 10: Voronoi diagrams

slide-9
SLIDE 9

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we tested the soil at a number of sample points and classified the results

sand clay chalk limestone clay clay sand chalk

Computational Geometry Lecture 10: Voronoi diagrams

slide-10
SLIDE 10

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we tested the soil at a number of sample points and classified the results

sand clay chalk limestone clay clay sand chalk

Computational Geometry Lecture 10: Voronoi diagrams

slide-11
SLIDE 11

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we tested the soil at a number of sample points and classified the results

sand clay chalk limestone clay clay sand chalk

Computational Geometry Lecture 10: Voronoi diagrams

slide-12
SLIDE 12

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we measured the lead concentration at a number of sample points

14 13 22 6 7 15 18 11 20

Computational Geometry Lecture 10: Voronoi diagrams

slide-13
SLIDE 13

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we measured the lead concentration at a number of sample points

14 13 22 6 7 15 18 11 20

?

Computational Geometry Lecture 10: Voronoi diagrams

slide-14
SLIDE 14

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we measured the lead concentration at a number of sample points

14 13 22 6 7 15 18 11 20

?

Computational Geometry Lecture 10: Voronoi diagrams

slide-15
SLIDE 15

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we measured the lead concentration at a number of sample points

14 13 22 6 7 15 18 11 20

?

Computational Geometry Lecture 10: Voronoi diagrams

slide-16
SLIDE 16

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Suppose we measured the lead concentration at a number of sample points

14 13 22 6 7 15 18 11 20

?

A1 A2 A3 A4 A5

Computational Geometry Lecture 10: Voronoi diagrams

slide-17
SLIDE 17

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Let AT = A1 +A2 +···+A5 The interpolated value is A1 AT 13+ A2 AT 11+···+ A5 AT 20

14 13 22 6 7 15 18 11 20

?

A1 A2 A3 A4 A5

Computational Geometry Lecture 10: Voronoi diagrams

slide-18
SLIDE 18

Motivation Voronoi diagrams Voronoi diagrams Spatial interpolation

Spatial interpolation

Crater on Mars generated by natural neighbor interpolation

Computational Geometry Lecture 10: Voronoi diagrams

slide-19
SLIDE 19

Motivation Voronoi diagrams Properties Construction

Some observations

Edges are parts of bisectors Some edges are half-infinite Some cells are unbounded Question: Which ones?

Computational Geometry Lecture 10: Voronoi diagrams

slide-20
SLIDE 20

Motivation Voronoi diagrams Properties Construction

Some observations

Every Voronoi cell is the intersection of n−1 half-planes, if there are n sites ⇒ all cells are convex and have up to n−1 edges in the boundary

p

Computational Geometry Lecture 10: Voronoi diagrams

slide-21
SLIDE 21

Motivation Voronoi diagrams Properties Construction

Structure

The Voronoi diagram of n sites has the following structure: If all n sites lie on a line, then the Voronoi cell boundaries are parallel lines, so the “graph” is disconnected Otherwise, the Voronoi cell boundaries form a connected “graph”

Computational Geometry Lecture 10: Voronoi diagrams

slide-22
SLIDE 22

Motivation Voronoi diagrams Properties Construction

Complexity

Theorem: The Voronoi diagram on f sites in the plane has at most 2n−5 Voronoi vertices and at most 3n−6 Voronoi edges (including lines and half-lines) Proof: If the sites are colinear, then it is trivial Otherwise, we will use Euler’s formula for planar graphs

Computational Geometry Lecture 10: Voronoi diagrams

slide-23
SLIDE 23

Motivation Voronoi diagrams Properties Construction

Complexity

Euler’s formula for planar graphs: A connected planar graph with nv vertices, ne edges, and nf faces satisfies: nv −ne +nf = 2 However, a Voronoi diagram is not a proper graph

Computational Geometry Lecture 10: Voronoi diagrams

slide-24
SLIDE 24

Motivation Voronoi diagrams Properties Construction

Complexity

We make it proper by connecting all half-infinite edges to a new vertex v∞ nv = no. of Voronoi vertices VV +1 ne = no. of Voronoi edges VE nf = no. of Voronoi cells = n, the number of sites

v∞

Computational Geometry Lecture 10: Voronoi diagrams

slide-25
SLIDE 25

Motivation Voronoi diagrams Properties Construction

Complexity

Substitution in Euler’s formula nv −ne +nf = 2 gives (VV +1)−VE +n = 2 Every edge is incident to exactly 2 vertices, and every vertex is incident to at least 3 edges Sum-of-degree-of-all-vertices = 2·VE Sum-of-degree-of-all-vertices ≥ 3·VV = 2·VE ≥ 3·VV

Computational Geometry Lecture 10: Voronoi diagrams

slide-26
SLIDE 26

Motivation Voronoi diagrams Properties Construction

Complexity

The combination of (VV +1)−VE +n = 2 and = 2·VE ≥ 3·VV gives the desired bounds VV ≤ 2n−5 and VE ≤ 3n−6

Computational Geometry Lecture 10: Voronoi diagrams

slide-27
SLIDE 27

Motivation Voronoi diagrams Properties Construction

Empty circle property

Every Voronoi vertex is the center of an empty circle through 3 sites Every point on a Voronoi edge is the center of an empty circle through 2 sites

Computational Geometry Lecture 10: Voronoi diagrams

slide-28
SLIDE 28

Motivation Voronoi diagrams Properties Construction

Degeneracies

All sites lie on a line More than 3 points lie on a circle

Computational Geometry Lecture 10: Voronoi diagrams

slide-29
SLIDE 29

Motivation Voronoi diagrams Properties Construction

Algorithms for Voronoi diagrams

Compute the intersection of n−1 half-planes for each site, and “merge” the cells into the diagram Divide-and-conquer (1975, Shamos & Hoey) Plane sweep (1987, Fortune) Randomized incremental construction (1992, Guibas, Knuth & Sharir)

Computational Geometry Lecture 10: Voronoi diagrams

slide-30
SLIDE 30

Motivation Voronoi diagrams Properties Construction

Plane sweep for Voronoi diagrams

Plane sweep: Note that the Voronoi diagram above the sweep line may be affected by sites below the sweep line Maintain and grow the portion of Voronoi diagram above the sweep line that is known for sure

Computational Geometry Lecture 10: Voronoi diagrams

slide-31
SLIDE 31

Motivation Voronoi diagrams Properties Construction

Plane sweep for Voronoi diagrams

Plane sweep: Note that the Voronoi diagram above the sweep line may be affected by sites below the sweep line Maintain and grow the portion of Voronoi diagram above the sweep line that is known for sure

Computational Geometry Lecture 10: Voronoi diagrams

slide-32
SLIDE 32

Motivation Voronoi diagrams Properties Construction

Beach line

The beach line separates the known and unknown part of the Voronoi diagram, it is the minimum of the parabolas defined by sites above the sweep-line and the sweep-line itself

Computational Geometry Lecture 10: Voronoi diagrams

slide-33
SLIDE 33

Motivation Voronoi diagrams Properties Construction

Beach line

The beach line changes continuously, even one parabola does

Computational Geometry Lecture 10: Voronoi diagrams

slide-34
SLIDE 34

Motivation Voronoi diagrams Properties Construction

Beach line

Question: The beach line has break points, what do they represent?

Computational Geometry Lecture 10: Voronoi diagrams

slide-35
SLIDE 35

Motivation Voronoi diagrams Properties Construction

Beach line

The break points move and trace out the Voronoi diagram edges

Computational Geometry Lecture 10: Voronoi diagrams

slide-36
SLIDE 36

Motivation Voronoi diagrams Properties Construction

Status

Status: The ordered sequence of parabolic arcs that define the beach line; each is defined by a site (and the sweep-line) Break points are defined by two sites (and the sweep-line) Since the beach line is x-monotone, we can store the status in a balanced binary search tree on x-coordinate

Computational Geometry Lecture 10: Voronoi diagrams

slide-37
SLIDE 37

Motivation Voronoi diagrams Properties Construction

Status

pi pj pk pi pj pk pi pj, pk pi, pj pk, pi pj, pk pi, pj pk, pi

Computational Geometry Lecture 10: Voronoi diagrams

slide-38
SLIDE 38

Motivation Voronoi diagrams Properties Construction

Other data structures

The sweep algorithm also needs an event list and a data structure to store the Voronoi diagram computed so far The Voronoi diagram will be computed inside a large bounding box so that a doubly-connected edge list can be used

Computational Geometry Lecture 10: Voronoi diagrams

slide-39
SLIDE 39

Motivation Voronoi diagrams Properties Construction

Events

The events are where the status changes = where the beach line changes When the sweep-line reaches a new site When a break point reaches the end of the edge it traces

Computational Geometry Lecture 10: Voronoi diagrams

slide-40
SLIDE 40

Motivation Voronoi diagrams Properties Construction

Site events

The sweep-line reaches a new site, a site event: a new parabola starts

Computational Geometry Lecture 10: Voronoi diagrams

slide-41
SLIDE 41

Motivation Voronoi diagrams Properties Construction

Site events

The sweep-line reaches a new site, a site event: a new parabola starts

Computational Geometry Lecture 10: Voronoi diagrams

slide-42
SLIDE 42

Motivation Voronoi diagrams Properties Construction

Site events

The sweep-line reaches a new site, a site event: a new parabola starts

Computational Geometry Lecture 10: Voronoi diagrams

slide-43
SLIDE 43

Motivation Voronoi diagrams Properties Construction

Site events

The sweep-line reaches a new site, a site event: a new parabola starts Two new break points appear on the beach line A new Voronoi edge is discovered

Computational Geometry Lecture 10: Voronoi diagrams

slide-44
SLIDE 44

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-45
SLIDE 45

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-46
SLIDE 46

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-47
SLIDE 47

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-48
SLIDE 48

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-49
SLIDE 49

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-50
SLIDE 50

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-51
SLIDE 51

Motivation Voronoi diagrams Properties Construction

The other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-52
SLIDE 52

Motivation Voronoi diagrams Properties Construction

The other events

Parabolic arcs may disappear from the beach line

Computational Geometry Lecture 10: Voronoi diagrams

slide-53
SLIDE 53

Motivation Voronoi diagrams Properties Construction

The other events

We discover an empty circle and a Voronoi vertex

Computational Geometry Lecture 10: Voronoi diagrams

slide-54
SLIDE 54

Motivation Voronoi diagrams Properties Construction

Circle events

At a circle event: A parabolic arc disappears from the beach line Two adjacent break points come together A Voronoi vertex is discovered as the vertex incident to two known Voronoi edges A new break point starts to be traced The sweep line reached the bottom of an empty circle through 3 sites

Computational Geometry Lecture 10: Voronoi diagrams

slide-55
SLIDE 55

Motivation Voronoi diagrams Properties Construction

Circle events

Circle events can only happen for three sites that have adjacent parabolic arcs on the beach line

Computational Geometry Lecture 10: Voronoi diagrams

slide-56
SLIDE 56

Motivation Voronoi diagrams Properties Construction

Site and circle events

The only way for a new parabolic arc to appear on the beach line is through a site event The only way for a parabolic arc to disappear from the beach line is through a circle event There are no other events

Computational Geometry Lecture 10: Voronoi diagrams

slide-57
SLIDE 57

Motivation Voronoi diagrams Properties Construction

Site and circle events

There are n site events and they are known in advance Question: How can we know circle events before they occur?

Computational Geometry Lecture 10: Voronoi diagrams

slide-58
SLIDE 58

Motivation Voronoi diagrams Properties Construction

Detecting circle events

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6

Computational Geometry Lecture 10: Voronoi diagrams

slide-59
SLIDE 59

Motivation Voronoi diagrams Properties Construction

Detecting circle events

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6 C(p1, p2, p3) C(p2, p3, p4) C(p4, p5, p6)

Computational Geometry Lecture 10: Voronoi diagrams

slide-60
SLIDE 60

Motivation Voronoi diagrams Properties Construction

Detecting circle events

A circle event occurs if the sweep line reaches the bottom of an empty circle defined by three sites that have consecutive parabolic arcs on the beach line We will make sure that any three sites that have consecutive arcs on the beach line and whose circle has its lowest point below the sweep line have this lowest point as circle event in the event list

Computational Geometry Lecture 10: Voronoi diagrams

slide-61
SLIDE 61

Motivation Voronoi diagrams Properties Construction

Detecting circle events

In the status structure we can see all triples of consecutive parabolic arcs that can give circle events

p5 p6 p4, p5 p5, p6 p1 p2 p3 p4 p2, p3 p1, p2 p3, p4

Computational Geometry Lecture 10: Voronoi diagrams

slide-62
SLIDE 62

Motivation Voronoi diagrams Properties Construction

False alarms

We may have stored a circle event in the event list, but it may be that it never happens ... This is called a false alarm There are two reasons for false alarms: site events and other circle events

Computational Geometry Lecture 10: Voronoi diagrams

slide-63
SLIDE 63

Motivation Voronoi diagrams Properties Construction

False alarms

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6 C(p1, p2, p3) C(p2, p3, p4) α3 will disappear

An arc that was involved in a circle event may disappear

Computational Geometry Lecture 10: Voronoi diagrams

slide-64
SLIDE 64

Motivation Voronoi diagrams Properties Construction

False alarms

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6 C(p2, p3, p4) p7

The circle of a circle event may turn out not to be empty

Computational Geometry Lecture 10: Voronoi diagrams

slide-65
SLIDE 65

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

A site event that disrupts three consecutive parabolic arcs

p5 p6 p4, p5 p5, p6 p1 p2 p3 p4 p2, p3 p1, p2 p3, p4 circle event C(p2, p3, p4)

Computational Geometry Lecture 10: Voronoi diagrams

slide-66
SLIDE 66

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6 C(p2, p3, p4) p7

Computational Geometry Lecture 10: Voronoi diagrams

slide-67
SLIDE 67

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

A site event that disrupts three consecutive parabolic arcs

p3 p7 p5 p6 p4, p5 p5, p6 p1 p2 p3 p4 p2, p3 p1, p2 p3, p4 circle event C(p2, p3, p4) gone p3, p7 p7, p3

Computational Geometry Lecture 10: Voronoi diagrams

slide-68
SLIDE 68

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

A circle event that disrupts three consecutive parabolic arcs

p5 p6 p4, p5 p5, p6 p1 p2 p3 p4 p2, p3 p1, p2 p3, p4 circle event C(p2, p3, p4) circle event C(p1, p2, p3)

Computational Geometry Lecture 10: Voronoi diagrams

slide-69
SLIDE 69

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

p1 p2 p3 p4 p5 p6 α1 α2 α3 α4 α5 α6 C(p1, p2, p3) C(p2, p3, p4) α3 will disappear

Computational Geometry Lecture 10: Voronoi diagrams

slide-70
SLIDE 70

Motivation Voronoi diagrams Properties Construction

Detecting false alarms

A circle event that disrupts three consecutive parabolic arcs

p5 p6 p4, p5 p5, p6 p1 p2 p4 p2, p4 p1, p2 circle event C(p1, p2, p3) gone

Computational Geometry Lecture 10: Voronoi diagrams

slide-71
SLIDE 71

Motivation Voronoi diagrams Properties Construction

The data structures

Recall we have a status structure T , an event list, and a DCEL We need pointers from T into the DCEL to be able to update it efficiently We need pointers from the leaves of T into the event list to be able to remove circle events if they are false alarms

Computational Geometry Lecture 10: Voronoi diagrams

slide-72
SLIDE 72

Motivation Voronoi diagrams Properties Construction

The data structures

A leaf of T has a pointer to all events in which the parabolic arc participates Easy question: How many can there be, at most?

Computational Geometry Lecture 10: Voronoi diagrams

slide-73
SLIDE 73

Motivation Voronoi diagrams Properties Construction

Global algorithm

Algorithm VoronoiDiagram(P) 1. Initialize the event queue Q with all site events, initialize an empty status structure T and an empty doubly-connected edge list D 2. while Q is not empty 3. do remove the event with largest y-coordinate from Q 4. if the event is a site event, occurring at site pi 5. then HandleSiteEvent(pi) 6. else HandleCircleEvent(γ), where γ is the leaf of T representing the arc that will disappear 7. When all events are handled, we must still fix the doubly-connected edge list with respect to the bounding box, and to add face information

Computational Geometry Lecture 10: Voronoi diagrams

slide-74
SLIDE 74

Motivation Voronoi diagrams Properties Construction

Site event actions

At a site event, at a site pi on the sweep line ℓ: Find the parabolic arc α vertically above pi in T Remove the false alarm with α in the middle from the event list (if it exists) Update T: one arc is split and a new one for pi appears in between, and break points are updated Make two new half-edges for the detected Voronoi edge in the DCEL Add new circle events for the new consecutive triples (if the circle has its lowest point below ℓ)

Computational Geometry Lecture 10: Voronoi diagrams

slide-75
SLIDE 75

Motivation Voronoi diagrams Properties Construction

Circle event actions

At a circle event, for circle C(pi,pj,pk) whose bottom is on the sweep line ℓ, and γ is the leaf of T whose arc disappears: Remove the false alarms that involve the parabolic arc corresponding to γ Update T: remove the leaf γ and update break points Make a new vertex object for the Voronoi vertex, two new half-edge objects, and connect six half-edges and the vertex in the DCEL Add new circle events for the new consecutive triples (if the circle has its lowest point below ℓ)

Computational Geometry Lecture 10: Voronoi diagrams

slide-76
SLIDE 76

Motivation Voronoi diagrams Properties Construction

Analysis

Any event removes at most two false alarms and generates at most two new circle events Any event is handled in O(logn) time There are n site events and at most 2n−5 circle events (because a new Voronoi vertex is detected)

Computational Geometry Lecture 10: Voronoi diagrams

slide-77
SLIDE 77

Motivation Voronoi diagrams Properties Construction

Result

Theorem: The Voronoi diagram of a set of n point sites in the plane can be computed in O(nlogn) time

Computational Geometry Lecture 10: Voronoi diagrams