128
Algorithmische Geometrie Voronoi Diagram Martin Held FB Computerwissenschaften Universit ¨ at Salzburg A–5020 Salzburg, Austria May 28, 2008 Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back

Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

Algorithmische GeometrieVoronoi Diagram

Martin HeldFB Computerwissenschaften

Universitat SalzburgA–5020 Salzburg, Austria

May 28, 2008

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back

Page 2: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 1

Acknowledgments

These slides are partially based on notes and slides transcribed by various students —most notably Elias Pschernig, Christian Spielberger, Werner Weiser and FranzWilhelmstotter — for previous courses on “Algorithmische Geometrie”. Some figureswere derived from figures originally prepared by students of my lecture“Wissenschaftliche Arbeitstechniken und Prasentation”. I would like to express mythankfulness to all of them for their help. This revision and extension was carried out bymyself, and I am responsible for any errors.

I am also happy to acknowledge that we benefited from material published bycolleagues on diverse topics that are partially covered in this lecture. While some of thematerial used for this lecture was originally presented in traditional-style publications(such as textbooks), some other material has its roots in non-standard publicationoutlets (such as online documentations, electronic course notes, or user manuals).

Salzburg, January 2008 Martin Held

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back

Page 3: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 2

Voronoi Diagram

• Proximity Problems and Lower Bounds,

• Voronoi Diagram: Definition and Basic Facts,

• Voronoi Diagram: Properties,

• Delaunay Triangulation: Definition and Basic Facts,

• Algorithms for Constructing Voronoi Diagrams,

• Generalized Voronoi Diagram,

• Applications of Voronoi Diagrams.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00100.tex

Page 4: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 3

A Set of Proximity Problems

• Consider a set S := p1, p2, . . . , pn of n points in E2, i.e., in R2 under the Euclideanmetric.

• CLOSESTPAIR: Determine two points of S whose mutual distance is smallest.

• ALLNEARESTNEIGHBORS: Determine the “nearest neighbor” (point of minimum dis-tance within S) for each point in S.

• EUCLIDEANMINIMUMSPANNINGTREE (EMST): Construct a tree of minimum total(Euclidean) length whose vertices are the points of S. (No Steiner points allowed.)

• MAXIMUMEMPTYCIRCLE: Find a circle with largest radius which does not contain apoint of S in its interior and whose center lies within CH(S).

• TRIANGULATION: Join the points in S by non-intersecting straight-line segments sothat every region internal to the convex hull of S is a triangle.

• NEARESTNEIGHBORSEARCH: Given a query point q, which point p ∈ S is a nearestneighbor of q?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00200.tex

Page 5: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 4

Lower Bounds

• NEARESTNEIGHBORSEARCH: standard argument yields Ω(logn) comparisons.

• CLOSESTPAIR has an Ω(n logn) lower bound since ELEMENTUNIQUENESS is lin-early transformable to CLOSESTPAIR.

• ALLNEARESTNEIGHBORS has an Ω(n logn) lower bound since CLOSESTPAIR is lin-early transformable to ALLNEARESTNEIGHBORS.

• EMST: an EMST contains a closest pair, which establishes the Ω(n logn) lowerbound. (Also, SORTING can be transformed linearly to EMST.)

• MAXIMUMEMPTYCIRCLE in 1D solves MAXGAP, which establishes the Ω(n logn)lower bound.

• TRIANGULATION has an Ω(n logn) lower bound since CONVEXHULL is linearly trans-formable to TRIANGULATION. (Also, SORTING can be transformed linearly to TRIAN-GULATION.)

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00300.tex

Page 6: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 5

Lower Bounds: Summary of Reductions

• We have Ω(n logn) lower bounds due to a variety of reductions.

Element Uniqueness

Sorting

Closest Pair All Nearest Neighbors

EMST

Convex Hull Triangulation

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00400.tex

Page 7: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 6

Voronoi Diagram: Definition and Basic Facts

• If Voronoi diagram is available then proximity problems can be solved in O(n) time!

Element Uniqueness

Sorting

Closest Pair All Nearest Neighbors

EMST

Convex Hull Triangulation

Voronoi Diagram

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00500.tex

Page 8: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 7

Voronoi Diagram: Definition and Basic Facts (cont’d)

• Consider a set S := p1, · · · , pn of n distinct points in R2.

• General position assumed: no four points are co-circular!

• Def.: The bisector of two points u,v ∈R2 is the set of points of R2 which are equidis-tant to u and v:

b(u,v) := q ∈ R2 : d(u,q) = d(v,q),

where d(·, ·) denotes the Euclidean distance.

d d

u

v

q

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00600.tex

Page 9: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 8

Voronoi Diagram: Definition and Basic Facts (cont’d)

• Def.: The Voronoi region (VR, aka “Voronoi cell”) of a point pi ∈ S is the locus ofpoints of R2 whose distance to pi is not greater than the distance to any other pointof S:

V R (pi) := q ∈ R2 : d(pi,q)≤ d(S\pi,q).

V R (pi)

pi

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00700.tex

Page 10: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 9

Voronoi Diagram: Definition and Basic Facts (cont’d)

• Def.: A Voronoi polygon (VP) is defined as

V P (pi) := q ∈ R2 : d(pi,q) = d(S\pi,q).

• A Voronoi polygon forms the (polygonal) boundary of a Voronoi region.

• The segments of a Voronoi polygon are called Voronoi edges.

• Def.: The Voronoi diagram (VD) of S is defined as

V D(S) :=[

1≤i≤n

V P (pi).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00800.tex

Page 11: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 10

Voronoi Diagram: Definition and Basic Facts (cont’d)

V D(S)

The Voronoi diagram V D(S) of the point set S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd00900.tex

Page 12: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 11

Voronoi Diagram: Definition and Basic Facts (cont’d)

• A Voronoi edge always lies on a bisector. Thus, points on a Voronoi edge are equidis-tant to two points of S.

• Intersections of Voronoi edges are called Voronoi nodes.

p3

v

e2

p2

p1

e3

e1

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01000.tex

Page 13: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 12

Sample Voronoi Diagram

• Input S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01100.tex

Page 14: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 13

Sample Voronoi Diagram

• Input S, Voronoi region.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01200.tex

Page 15: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 14

Sample Voronoi Diagram

• Input S, Voronoi region, Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01300.tex

Page 16: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 15

Sample Voronoi Diagram

• Input S, Voronoi region, Voronoi diagram, Voronoi nodes.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01400.tex

Page 17: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 16

Voronoi Diagram: Definition and Basic Facts (cont’d)

• Lemma: The Voronoi region V R (pi) is the intersection of half-planes defined bybisectors between pi and the other points of S:

V R (pi) =\

1≤ j≤nj 6=i

H(pi, p j),

where H(pi, p j) is the half-space that contains pi.

• Thus, a Voronoi region is a convex polygonal area.

• Lemma: Every point of S has its own Voronoi region that is not empty.

• Lemma: The (topological) interiors of Voronoi regions of distinct points of S are dis-joint.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01500.tex

Page 18: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 17

Voronoi Diagram: Properties

• Lemma: A Voronoi node is the common intersection of exactly three Voronoi edges.It is equidistant to the three points of S which lie in the Voronoi regions it belongs to.

• Proof:

? Let a Voronoi node v be the intersection of k edges e1,e2, . . . ,ek, with k≥ 2, whichare ordered clockwise around v. Then e1 is equidistant to some points p1 and p2,e2 is equidistant to p2 and p3, and so on, and ek is equidistant to pk and p1.

? Thus, v is equidistant to p1, p2, . . . , pk.? Since a Voronoi region is convex, all points p1, p2, . . . , pk are distinct.? Based on our assumption that no more than three points are co-circular we con-

clude k ≤ 3.? However, k = 2 would mean e1 is equidistant to p1 and p2, and e2 is equidistant to

p2 and p1. Therefore, they would lie on the same bisector, and could not intersectin v.

• This means that a Voronoi Diagram is a 3-regular (planar) graph.

• Note that without the general-position assumption the degree of a Voronoi node canget as high as n.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01600.tex

Page 19: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 18

Voronoi Diagram: Properties (cont’d)

• Lemma: The circle C centered at a Voronoi node v that passes through the node’sthree equidistant points p1, p2, p3 ∈ S contains no other points of S in its interior.

• Proof:

? Assume that C contains another point p4 ∈ S in its interior.? Then v would be closer to p4 than to any of p1, p2, p3. Therefore, v would lie in the

Voronoi region of p4.? This is a contradiction because v lies in the Voronoi regions of p1, p2, p3.

p1

C

p4

p2

vp3

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01700.tex

Page 20: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 19

Voronoi Diagram: Properties (cont’d)

• Lemma: For pi ∈ S, every nearest neighbor of pi defines an edge of V P (pi).

• Proof:

? Let p j ∈ S be a nearest neighbor of pi, and let v be their midpoint.? Suppose that v does not lie on the boundary of V P (pi).? Then the line segment piv would intersect some edge of V P (pi). Assume that

it intersects the bisector of pipk in the point u. Now |piu| < |piv|, and therefore|pipk| ≤ 2|piu|< 2|piv|= |pip j|, and we would have pk closer to pi than p j, whichis a contradiction.

v upi

p j

Bisector of pip j

VP(pi)

Bisector of pipk

pk

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01800.tex

Page 21: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 20

Delaunay Triangulation: Definition and Basic Facts

• Def.: A Delaunay triangulation (DT) of S is a graph that is dual to the Voronoi diagramof S:

? The nodes of the graph are given by the points of S.? Two points are connected by a line segment, and form an edge of DT (S), exactly

if they share a Voronoi edge of V D(S).

• Thus, the interior faces of DT (S) are defined by triples of S which correspond tonodes of V D(S).

• DT (S) does indeed form a triangulation of S. (Proof: See Preparata&Shamos.)

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd01900.tex

Page 22: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 21

Delaunay Triangulation: Definition and Basic Facts (cont’d)

DT (S)

Delaunay Triangulation DT (S), with the underlying Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02000.tex

Page 23: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 22

Delaunay Triangulation: Definition and Basic Facts (cont’d)

• By definition, every edge of the Delaunay triangulation has a corresponding edge inthe Voronoi diagram.

• DT (S) is called the straight-line dual of V D(S).

• Note: An edge of DT (S) need not intersect its dual Voronoi edge.

• If no four points of a point set are co-circular then its Delaunay triangulation is unique.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02100.tex

Page 24: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 23

Complexity of Voronoi Diagram and Delaunay Triangulation

• Recall that a Delaunay triangulation forms a very special planar graph on n nodes,to which Euler’s formula

V −E +F = 2

can be applied. This implies that we have

? at least E ≥ F ∗3/2 edges,? at most F ≤ E ∗2/3 faces.

We conclude that

DT : ≤ 3n−6 edges and thus V D: ≤ 3n−6 edges,DT : ≤ 2n−4 faces and thus V D: ≤ 2n−5 nodes.

• Note: one Voronoi polygon may have n−1 edges but the entire Voronoi diagram of npoints can have only 3n−6 edges in total. Thus, V D(S) and DT (S) can be storedin O(n) space!

• Since every edge belongs to two Voronoi polygons, a Voronoi polygon has only sixedges on average.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02200.tex

Page 25: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 24

Proximity Problems Solved by Voronoi Diagrams

• The fact that the Voronoi polygons of nearest neighbors always have a Voronoi edgein common implies that it is sufficient to check all points in adjacent Voronoi regionsto find a nearest neighbor of a point pi.

• Thus, knowledge of the Voronoi diagram helps to solve CLOSESTPAIR and ALL-NEARESTNEIGHBORS in O(n) time.

• Lemma: The Voronoi polygon of pi is unbounded if and only if pi is a point of theconvex hull of the set S. (Proof: See Preparata&Shamos.) This means that thevertices of CH(S) are those points of S which have unbounded Voronoi polygons.

• Thus, knowledge of the Voronoi diagram allows to solve CONVEXHULL in O(n) time.

• A MAXIMUMEMPTYCIRCLE can be found in O(n) time by scanning all nodes of theVoronoi diagram; see later.

• After O(n logn) preprocessing for building a search data structure of size O(n) ontop of the Voronoi diagram, NEARESTNEIGHBORSEARCH queries can be handled inO(logn) time.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02300.tex

Page 26: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 25

Reductions Among Proximity Problems

• Lemma: The Voronoi diagram can be obtained in O(n) time from the Delaunay tri-angulation, and the Delaunay triangulation can be obtained in O(n) time from theVoronoi diagram.

Element Uniqueness

Sorting

Closest Pair All Nearest Neighbors

EMST

Convex Hull Delaunay Triangulation

Voronoi Diagram

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02400.tex

Page 27: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 26

Algorithms for Constructing Voronoi Diagrams

• Divide&Conquer Algorithm,

• Incremental Construction,

• Sweep-Line Algorithm,

• Construction via Lifting to 3D,

• Approximate Voronoi Diagram by Means of Graphics Hardware.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02500.tex

Page 28: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 27

Divide&Conquer Algorithm

• Preprocessing: sort the points of S by x-coordinates. This takes O(n logn) time.

• Divide-Step:

? Divide S into two subsets S1 and S2 of roughly equal size such that the points in S1

lie to the left and the points in S2 lie to the right of a vertical line.? This step can be carried out in O(n) time.

• Conquer-Step (aka “Merge”):

? Assume that V D(S1) and V D(S2) are known.? Clip those parts of V D(S1) that lie to the “right” of a so-called dividing chain.? Analogously for V D(S2).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02600.tex

Page 29: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 28

Divide&Conquer Algorithm (cont’d)

• The merge step is carried out by incrementally generating the dividing chain, and byclipping V D(S1) and V D(S2) appropriately.

S1 S2

V D(S2)V D(S1)

V D(S)

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02700.tex

Page 30: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 29

Divide&Conquer Algorithm: Merge

• First, find upper and lowerbridges of the convex hull.

? Bisector (ray) definedby upper bridge of con-vex hull is part of the di-viding chain.

? Bisector (ray) definedby lower bridge of con-vex hull is part of the di-viding chain.

V D(S1)V D(S2)

Convex Hull

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02800.tex

Page 31: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 30

Divide&Conquer Algorithm: Merge (cont’d)

• Build dividing chainfrom top to bottom:

? Start by walkingdown along theupper ray.

? Intersect the raywith V D(S1) andV D(S2).

? Pick the first in-tersection as newVoronoi node.

? The next ray is thenew bisector origi-nating at this node.

? Continue this jaggedwalk until the lowerray is reached.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd02900.tex

Page 32: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 31

Divide&Conquer Algorithm: Complexity Analysis

• The merge can be carried out in O(n) time, based on the Shamos-Hoey scanningscheme that prevents Voronoi edges from being searched for an intersection for morethan a constant number of times.

• If the merge is carried out in linear time then we get a familiar recurrence relation forthe time T :

T (n) = 2T (n2)+O(n), and thus T (n) = O(n logn).

• We conclude that a divide&conquer algorithm can compute V D(S) in optimalO(n logn) time.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03000.tex

Page 33: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 32

Incremental Construction

• We compute the Voronoi diagram V D(S) of a set S := p1, p2, . . . , pn of n pointsby inserting the i-th point pi into V D(p1, p2, . . . , pi−1), for 1≤ i≤ n.

• If we could achieve constant complexity per insertion then a linear algorithm wouldresult:−→ Best case: O(n).

• An insertion could, however, affect all other sites:−→ Worst case: O(n2), or even worse.

• Since, on average, every Voronoi region is bounded by six Voronoi edges there isreason to hope that a close-to-linear time complexity can be achieved.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03100.tex

Page 34: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 33

Incremental Construction: Basic Algorithm

1. Nearest-neighbor search among p1, p2, . . . , pi−1: Determine 1 ≤ j < i such thatthe new point pi lies in V R (p j).

pi

p j

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03200.tex

Page 35: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 34

Incremental Construction: Basic Algorithm (cont’d)

2. Construct the bisector b(pi, p j) between pi and p j, intersect it with V P (p j), and clipthat portion of V P (p j) which is closer to pi than to p j.

pi

p j

pi and p j

Bisector of

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03300.tex

Page 36: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 35

Incremental Construction: Basic Algorithm (cont’d)

3. Generate V P (pi) by a circular scan around pi, similar to the construction of thedividing chain in the divide&conquer algorithm.

pi

p j

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03400.tex

Page 37: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 36

Incremental Construction: Basic Algorithm (cont’d)

• The scan is finished once it returns to V R (p j). What is the complexity of oneinsertion?

pi

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03500.tex

Page 38: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 37

Incremental Construction: Complexity of Nearest-Neighbor Search

• The complexity mainly depends on the complexity of the nearest-neighbor searchand on the number of edges generated/deleted during the scan.

• Nearest-neighbor search by brute force:

? Compute all possible distances.? Not very practical: O(n) per nearest-neighbor query.

• Nearest-neighbor search akin to “steepest ascent”:

? Guess an initial candidate for p j.? Compare d(pi, p j) to the distances between pi and the neighbors of p j.? Select the closest neighbor point as new candidate p j.? Continue with the new point, until all neighbors have a distance from pi that is

larger than d(pi, p j).? This approach heavily depends on the availability of a good initial guess.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03600.tex

Page 39: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 38

Incremental Construction: Complexity of Nearest-Neighbor Search(cont’d)

• Nearest-neighbor search based on geometric hashing:

? Register p1, p2, pi−1 in a uniform grid.? Locate the grid cell that contains pi, and find nearest neighbor.? This approach works best for a uniform distribution of the points.

• Nearest-neighbor search based on a history DAG and randomized incremental in-sertion:

? Assume that the points are inserted in random order.? One can prove (using backwards analysis): the history DAG has O(n) expected

size, and supports nearest-neighbor queries in O(logn) expected time.? See the slides on triangulation for more on randomized incremental construction.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03700.tex

Page 40: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 39

Incremental Construction: Complexity of Incremental Merge

• Randomized incremental insertion:

? Again assume that the points are inserted in random order.? One can prove (using backwards analysis): the update necessary for inserting

one point can be done in O(1) expected time.? Note: This is independent of the point distribution, as long as the order is random!

• Worst-case insertion order:

? It is fairly easy to pick n points and number them “appropriately” such that theinsertion of the i-th point requires the generation of O(i) Voronoi edges!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03800.tex

Page 41: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 40

Incremental Construction: Overall Complexity

• Overall cost for computing the Voronoi diagram incrementally: we get O(n logn)expected time if randomized insertion is used, independent of the distribution of thepoints.

• If points are uniformly distributed then geometric hashing tends to answer a nearest-neighbor query in O(1) time.

• Thus, randomized incremental insertion of n uniformly distributed points can be as-sumed to generate the Voronoi diagram in linear or slightly super-linear time. (Andthis claim is supported by practical experiments.)

• However, the worst case still is O(n2), no matter how efficiently all nearest-neighborqueries are answered!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd03900.tex

Page 42: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 41

Geometric Hashing for Nearest-Neighbor Searching

• The bounding box of the input points is partitioned into rectangular cells of uniformsize by means of a regular grid.

• For every cell c, all points of p1, p2, . . . , pi−1 that lie in c are stored with c. (Alter-natively, only one point is stored per cell.)

• To find the point p j nearest to point pi:

? Determine the cell c that in which pi lies.? By searching in c (and possibly in its neighboring cells, if c is empty), we find a

first candidate for the nearest neighbor.? Let δ be the distance from pi to this point.? We continue searching in c and in those cells around c which are intersected by a

clearance circle with radius δ centered at pi.? Whenever a point that is closer is found, we update δ appropriately.? The search stops once no unsearched cell exists that is intersected by the clear-

ance circle.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04000.tex

Page 43: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 42

Geometric Hashing for Nearest-Neighbor Searching (cont’d)

• If all points are stored per cell then the true nearest neighbor is found. If only onepoint is stored per cell then this approach yields a (hopefully) good initial candidatefor the nearest neighbor.

• What is a suitable resolution of the grid? There is no universally valid answer. In anycase, the grid should not use more than O(n) memory!

• Personal experience:

? Grids of the form (w ·√

n)× (h ·√

n) seem to work nicely, with w ·h = c for someconstant c.

? The parameters w,h are chosen to adapt the resolution of the grid to the aspectratio of the bounding box of the points.

? By experiment: 1≤ c≤ 2.

• This basic scheme can be tuned considerably, e.g., by switching to 2D-trees if a smallsample of the points indicates that the points are distributed highly non-uniformly.

• Note: grid-based nearest-neighbor searching will work best for points that are dis-tributed uniformly, and will fail miserably if all points end up in one cell!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04100.tex

Page 44: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 43

Sweep-Line Algorithm

• Can a sweep-line algorithm be applied to compute the Voronoi diagram?

• Principal problem: when the sweep line reaches an extreme (e.g., top-most) vertexof V P (pi), it has not yet moved over pi.

• Thus, the information on the point sites is missing when a Voronoi polygon is firstencountered and Voronoi nodes are to be computed.

• This problem is independent of the sweep direction chosen. Thus, w.l.o.g., we movethe sweep line ` from top to bottom.

• Remarkable idea (by S. Fortune): rather than keeping the actual intersection of theVoronoi diagram with `, we maintain information on that part of the Voronoi diagramof the points above ` that is not affected by points below `.

• That part of the Voronoi diagram under construction lies above a beach line consist-ing of parabolic arcs: each parabolic arc is defined by ` and a point above `.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04200.tex

Page 45: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 44

Sweep-Line Algorithm: Beach Line

• The part of the Voronoi diagram that will not change any more as the sweep line con-tinues to move downwards lies above the beach line formed by the lower envelopeof parabolic arcs.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04300.tex

Page 46: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 45

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04400.tex

Page 47: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 46

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04500.tex

Page 48: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 47

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04600.tex

Page 49: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 48

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04700.tex

Page 50: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 49

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04800.tex

Page 51: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 50

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd04900.tex

Page 52: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 51

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05000.tex

Page 53: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 52

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05100.tex

Page 54: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 53

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05200.tex

Page 55: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 54

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05300.tex

Page 56: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 55

Animation of Sweep-Line Algorithm

• The beach line moves downwards as the sweep-line is moved from top to bottom.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05400.tex

Page 57: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 56

Animation of Sweep-Line Algorithm

• A full sweep reveals the complete Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05500.tex

Page 58: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 57

Sweep-Line Algorithm: Events

• The following two events need to be considered for the event-point schedule:

1. Site event:? The sweep line ` passes through an input point, and a new parabolic arc needs

to be inserted into the beach line.2. Circle event:

? A parabolic arc of the beach line vanishes, i.e., degenerates to a point v, and anew Voronoi node has to be inserted at v.

? What does this mean for the sweep line `? What is the appropriate y-position of` to catch this event?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05600.tex

Page 59: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 58

Sweep-Line Algorithm: Site Event

• If the sweep line ` passes through an input point then a new parabolic arc needs tobe inserted into the beach line. Initially, this arc is degenerate.

• This event occurs whenever the sweep line ` passes through an input point pi.

• It is responsible for the initialization of a new Voronoi region that will becomeV R (pi).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05700.tex

Page 60: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 59

Sweep-Line Algorithm: Circle Event

• If a parabolic arc of the beach line degenerates to a point v then a new Voronoi nodeneeds to be inserted at v.

• A circle event occurs when the sweep line ` passes over the south pole of a circlethrough the three defining input points pi, p j, pk of three consecutive parabolic arcsof the beach line.

• The center v of such a circle is equidistant to pi, p j, pk and also to `; it becomes anew node of the Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05800.tex

Page 61: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 60

Sweep-Line Algorithm: False Alarms

• Not all scheduled circle events correspond to valid new Voronoi nodes: a circle eventhas to be processed only if its defining three parabolic arcs still are consecutivemembers of the beach line at the time when the sweep line ` passes over the southpole of the circle.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd05900.tex

Page 62: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 61

Sweep-Line Algorithm: Event-Point Schedule and Sweep-LineStatus

• All input points are stored in sorted order (according to y-coordinates) in the event-point schedule.

• Whenever three parabolic arcs become consecutive for the first time – when a siteevent occurs – the y-coordinate of the corresponding circle event is inserted into theevent-point schedule at the appropriate place.

• Lemma: The beach line is monotone with respect to the x-axis.

• Parabolic arcs have to be inserted into the beach line when processing site events,and have to be deleted when processing circle events.

• Both structures are best represented as balanced binary search trees, since thisallows logarithmic insertion/deletion.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06000.tex

Page 63: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 62

Sweep-Line Algorithm: Analysis

• Lemma: An arc can appear on the beach line only through a site event.

• Corollary: The beach line is a sequence of at most 2n−1 parabolic arcs.

• Lemma: An arc can disappear from the beach line only through a circle event.

• Theorem: The sweep-line algorithm computes the Voronoi diagram of n points inO(n logn) time, using O(n) storage.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06100.tex

Page 64: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 63

Construction via Lifting to 3D• Consider the transformation that maps a

point p = (px, py) to the non-vertical planeh(p)≡ z = 2pxx+2pyy− (p2

x + p2y) in R3.

• This plane is tangent to the unit paraboloidz = x2 + y2 at the point (px, py, p2

x + p2y).

• Let h+(p) be the half-space defined byh(p) which contains the unit paraboloid.

• For S := p1, p2, . . . , pn, consider the con-vex polyhedron P := ∩1≤i≤nh+(pi).

• Lemma: The normal projection of the ver-tices and edges of P onto the xy-planeyields V D(S).

• Since P can be obtained in O(n logn) time,we have yet another O(n logn) algorithmfor computing Voronoi diagrams.

x

y

z

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06200.tex

Page 65: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 64

Approximate Voronoi Diagram by Means of Graphics Hardware

• Regard R2 as the xy-plane of R3, and construct upright circular unit cones at everypoint of S. (All cones point upwards, are of the same size and form the same anglewith the xy-plane!) Assign a unique color to every cone.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06300.tex

Page 66: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 65

Approximate Voronoi Diagram by Means of Graphics Hardware

• Look at the cones from below the xy-plane, and use normal projection to projectthem on the xy-plane. This yields a colored subdivision of the xy-plane, i.e., of R2,where each cell corresponds to a Voronoi region of a point of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06400.tex

Page 67: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 66

Generalized Voronoi Diagram

• We consider a set S of n “sites” (points, straight-line segments, and circular arcs).

• For technical reasons we assume that all end-points of all segments and arcs aremembers of S. Furthermore, the segments and arcs are allowed to intersect only atcommon end-points. Such a set of sites is called “admissible”.

• Intuitively, the Voronoi diagram of S partitions the Euclidean plane into regions thatare closer to one site than to any other.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06500.tex

Page 68: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 67

Generalized Voronoi Diagram: Cone of Influence

• Technical problem: we need to avoid “two-dimensional” bisectors.

• Def.: The cone of influence, CI(s), of

? a circular arc s is the closure of the cone bounded by the pair of rays originating inthe arc’s center and extending through its endpoints;

? a straight-line segment s is the closure of the strip bounded by the normals throughits endpoints;

? a point s is the entire plane.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06600.tex

Page 69: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 68

Generalized Voronoi Diagram: Definitions

• Consider an admissible set S of n sites, and two sites s1,s2 ∈ S.

• Definitions:

? The bisector b(s1,s2) gives the loci of points that are equidistant to s1 and s2 andthat belong to CI(s1)∩CI(s2).

? The Voronoi region of si is defined as

V R (si) := q ∈CI(si) : d(si,q)≤ d(S\si,q).

? The (generalized) Voronoi polygon of si is defined as

V P (si) := q ∈CI(si) : d(si,q) = d(S\si,q).

? The (generalized) Voronoi diagram of S is defined as

V D(S) :=[

1≤i≤n

V P (si).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06700.tex

Page 70: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 69

Generalized Voronoi Diagram: Bisectors

• Lemma: V D(S) is a planar graph and consists of O(n) parabolic, hyperbolic, ellipticand straight-line bisectors.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06800.tex

Page 71: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 70

Generalized Voronoi Diagram: Bisectors (cont’d)

• Lemma: V D(S) is a planar graph and consists of O(n) parabolic, hyperbolic, ellipticand straight-line bisectors.

r

d

d r

r

r

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd06900.tex

Page 72: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 71

Generalized Voronoi Diagram: Algorithms

• Several O(n logn) expected-time algorithms for polygons and/or line segments.

• Sweep-line algorithm (for points and line segments): O(n logn) worst-case time [For-tune 1987].

• Divide&conquer algorithm: O(n logn) worst-case time [Yap 1987].

• Randomized incremental construction: O(n logn) expected time [Held&Huber 2008].

• Note: the Voronoi diagram of a (convex) polygon can be constructed in linear time[Aggarwal et al. 1989, Chin et al. 1999]!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07000.tex

Page 73: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 72

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• How can we construct the (generalized) Voronoi diagram of the green sites?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07100.tex

Page 74: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 73

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07200.tex

Page 75: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 74

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S, and compute their Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07300.tex

Page 76: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 75

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S, and compute their Voronoi diagram. Insert segments.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07400.tex

Page 77: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 76

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S, and compute their Voronoi diagram. Insert segments,randomly.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07500.tex

Page 78: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 77

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S, and compute their Voronoi diagram. Insert segments,randomly, one after the other.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07600.tex

Page 79: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 78

Generalized Voronoi Diagram: Randomized IncrementalConstruction

• Start with the vertices of S, and compute their Voronoi diagram. Insert segments,randomly, one after the other. Same for the arcs.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07700.tex

Page 80: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 79

Generalized Voronoi Diagram: Medial Axis

• The medial axis is a subset of the Voronoi diagram; it contains only those points onthe Voronoi diagram which have at least two disjoint footprints on the boundary.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07800.tex

Page 81: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 80

Generalized Voronoi Diagram: Parameterization of Voronoi Edges

• We assign a clearance-based parameterization f : [a,b] → R2 to every edge e,where a is the minimum and b is the maximum clearance of points of e.

• The coordinates of a point p of e with clearance t are obtained by evaluating f : wehave p = f (t).

a

bt

t

u

v

p

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd07900.tex

Page 82: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 81

Applications of Voronoi Diagrams

• We do already know that the availability of the Voronoi diagram allows us to solvethe following problems in O(n) time:

? CLOSESTPAIR,? ALLNEARESTNEIGHBORS,? TRIANGULATION.

• In the sequel, we will study

? Statistical classification and shape estimation,? EUCLIDEANMINIMUMSPANNINGTREE (EMST),? approximate EUCLIDEANTRAVELINGSALESMANTOUR (ETST),? MAXIMUMEMPTYCIRCLE,? OFFSETTING,? FINDING A GOUGE-FREE PATH.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08000.tex

Page 83: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 82

Statistical Classification and Shape Estimation

• Given are sets of differently colored points in the plane. What is a suitable partitionof the plane according to the colors of the points?

• We can compute the Voronoi diagram and color every Voronoi cell with its point’scolor.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08100.tex

Page 84: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 83

Euclidean Minimum Spanning Tree

• Consider a set S := p1, p2, . . . , pn ⊂ R2, and assume that we want to compute aEuclidean minimum spanning tree of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08200.tex

Page 85: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 84

Euclidean Minimum Spanning Tree (cont’d)

• Obviously, we could apply standard techniques of graph theory by computing anEMST on the graph G := (V,E), where V := S and E := S× S, and where theEuclidean length of an edge is taken as its weight.

• Lemma [Prim]: Assume that G is connected, and let V1,V2 be a partition of V . Thereis a minimum spanning tree of G which contains the shortest of the edges with oneterminal in V1 and the other in V2.

• Prim’s algorithm starts with a small tree T and grows it until it contains all nodesof G . Initially, T contains just one arbitrary node of V . At each stage one nodenot yet in T but closest to (a node of) T is added to T . Prim’s algorithm can beimplemented to run in O(|V |2) time.

• Kruskal’s algorithm begins with a spanning forest, where each forest is initializedwith one node of V . It repeatedly joins two trees together by picking the shortestedge between them until a spanning tree of the entire graph is obtained. Kruskal’salgorithm can be implemented to run in O(|E| log |E|) time.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08300.tex

Page 86: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 85

Euclidean Minimum Spanning Tree (cont’d)

• Can we do any better than O(n2) when computing EMSTs?

• Lemma: DT (S) contains an EMST of S as sub-graph.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08400.tex

Page 87: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 86

Euclidean Minimum Spanning Tree (cont’d)

• Thus, there is no need to consider the full graph on S.

• Rather, we can apply Kruskal’s algorithm to DT (S), and obtain an O(n logn) algo-rithm for computing EMSTs.

• Lemma: An EMST of S can be computed from the Delaunay triangulation of S in timeO(n).

• Proof: Observe that DT (S) is a planar graph, and use Cheriton and Tarjan’s “clean-up refinement” of Kruskal’s algorithm.

• Note: an EMST is unique if all inter-point distances on S are distinct.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08500.tex

Page 88: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 87

Approximate Traveling Salesman Tour

• The EUCLIDEANTRAVELINGSALESMANPROBLEM (ETSP) asks to compute a shortestclosed path on S ⊂ E2 that visits all points of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08600.tex

Page 89: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 88

Approximate Traveling Salesman Tour

• Theorem: TSP and ETSP are N P -hard.

• Let OPT be the true length of a TSP tour, and let APX be the length of an approximatesolution.

• Def.: An approximation algorithm provides a constant-factor approximation if a con-stant c ∈ R+ exists such that APX≤ c ·OPT holds for all inputs.

• Constant-factor approximations to ETSP:

? Doubling-the-EMST heuristic: c = 2; runs in O(n logn) time.? Christofides’ heuristic: c = 3/2; runs in O(n3) time.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08700.tex

Page 90: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 89

Approximate Traveling Salesman Tour (cont’d)

• Note that the Euclidean metric obeys the triangle inequality.

• Recent polynomial-time approximation schemes (PTAS):

? Arora (1996), Mitchell (1996), Rao and Smith (1998).? c = 1+ ε (for ε ∈ R+).? Common to these algorithms is the fact that O(1/ε) appears as exponent of n or

logn.

• Hardness of approximation for non-Euclidean TSPs with symmetric metric:

? Papadimitriou and Vempala (2000): No polynomial-time constant-factor approxi-mation algorithm which achieves c≤ (1+1/219) exists, unless P = N P .

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08800.tex

Page 91: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 90

Approximate TST: Doubling-the-EMST Heuristic

• Compute the Euclidean minimum spanning tree T (S) of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd08900.tex

Page 92: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 91

Approximate TST: Doubling-the-EMST Heuristic (cont’d)

• Select an arbitrary node v of T (S) as root.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09000.tex

Page 93: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 92

Approximate TST: Doubling-the-EMST Heuristic (cont’d)

• Compute an in-order traversal of T (S) rooted at v to obtain a tour C (S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09100.tex

Page 94: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 93

Approximate TST: Doubling-the-EMST Heuristic (cont’d)

• By-pass points already visited, thus shortening C (S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09200.tex

Page 95: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 94

Approximate TST: Doubling-the-EMST Heuristic (cont’d)

• Apply 2-opt moves (at additional computational cost).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09300.tex

Page 96: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 95

Approximate TST: Doubling-the-EMST Heuristic (cont’d)

• Time complexity: O(n logn) for computing the EMST T (S).

• Factor of approximation: c = 2.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09400.tex

Page 97: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 96

Approximate TST: Christofides’ Heuristic

• Compute the Euclidean minimum spanning tree T (S) of S.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09500.tex

Page 98: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 97

Approximate TST: Christofides’ Heuristic

• Compute a minimum Euclidean matching M on the vertices of odd degree in T (S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09600.tex

Page 99: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 98

Approximate TST: Christofides’ Heuristic (cont’d)

• Compute an Eulerian tour C on T ∪M .

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09700.tex

Page 100: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 99

Approximate TST: Christofides’ Heuristic (cont’d)

• By-pass points already visited, thus shortening C .

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09800.tex

Page 101: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 100

Approximate TST: Christofides’ Heuristic (cont’d)

• Apply 2-opt moves (at additional computational cost).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd09900.tex

Page 102: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 101

Approximate TST: Christofides’ Heuristic (cont’d)

• Time complexity: O(n3) for computing the Euclidean matching.

• Factor of approximation: c = 32.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10000.tex

Page 103: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 102

Maximum Empty Circle

• Restrict V D(S) to CH(S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10100.tex

Page 104: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 103

Maximum Empty Circle (cont’d)

• Determine the largest circle centered at an intersection of V D(S) and CH(S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10200.tex

Page 105: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 104

Maximum Empty Circle (cont’d)

• Determine the largest circle centered at an interior node of V D(S).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10300.tex

Page 106: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 105

Maximum Empty Circle (cont’d)

• Pick the largest circle among those two categories of circles.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10400.tex

Page 107: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 106

Maximum Inscribed Circle

• Similarly, scanning the Voronoi nodes interior to a polygon yields a maximum in-scribed circle in O(n) time.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10500.tex

Page 108: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 107

Offsetting: Minkowski Sum and Difference

• Let A,B be sets, and a,b denote points of A respectively B.

• We define the translation of A by the vector b as

Ab := a+b : a ∈ A.

• The Minkowski sum of A and B is defined as

A⊕B :=[b∈B

Ab.

• The Minkowski difference of A and B is defined as

AB :=\b∈B

A−b.

• Note: In general, (A⊕B)B 6= A.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10600.tex

Page 109: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 108

Offsetting: Sample Minkowski Sum

• Let A be a curve, and B be a circular disk centered at the origin. What is A⊕B?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10700.tex

Page 110: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 109

Offsetting: Sample Minkowski Difference

• Let A be a polygon, and B be a circular disk centered at the origin. What is AB?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10800.tex

Page 111: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 110

Offsetting: Topological Changes

• Minkowski sums and differences of an area A with a circular disk B centered at theorigin are also called offsets (in CAD/CAM) and buffers (in GIS).

• Note: the boundary of an offset may contain circular arcs even if the input is purelypolygonal.

• Note: offsetting may cause topological changes!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd10900.tex

Page 112: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 111

Computation of Offset Patterns

• How can we compute offset patterns reliably and efficiently?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11000.tex

Page 113: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 112

Conventional Offsetting

• How can we compute even just one individual offset?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11100.tex

Page 114: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 113

Conventional Offsetting (cont’d)

• First, we compute offset segments (resp. arcs) for every input segment (resp. arc).

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11200.tex

Page 115: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 114

Conventional Offsetting (cont’d)

• In order to get one closed loop, we insert trimming arcs.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11300.tex

Page 116: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 115

Conventional Offsetting (cont’d)

• Next, all self-intersections are determined.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11400.tex

Page 117: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 116

Conventional Offsetting (cont’d)

• Finally, all incorrect loops of the offset are removed.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11500.tex

Page 118: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 117

Voronoi-Based Offsetting

• We start with analyzing the positions of the end-points of the offset segments.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11600.tex

Page 119: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 118

Voronoi-Based Offsetting (cont’d)

• This looks familiar!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11700.tex

Page 120: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 119

Voronoi-Based Offsetting (cont’d)

• Indeed, all end-points of offset segments lie on the Voronoi diagram!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11800.tex

Page 121: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 120

Voronoi-Based Offsetting (cont’d)

• Thus, a linear-time scan of the Voronoi diagram reveals the end-points of one offset.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd11900.tex

Page 122: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 121

Voronoi-Based Offsetting (cont’d)

• Details of the scan to determine one offset.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12000.tex

Page 123: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 122

Finding a Gouge-Free Path

• Can we move the disk within the polygon from the blue to the red position?

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12100.tex

Page 124: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 123

Finding a Gouge-Free Path (cont’d)

• Retraction method: project red and blue centers onto the Voronoi diagram.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12200.tex

Page 125: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 124

Finding a Gouge-Free Path (cont’d)

• Scan the Voronoi diagram to find a way from blue to red.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12300.tex

Page 126: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 125

Finding a Gouge-Free Path (cont’d)

• Make sure to check the clearance while moving through a bottleneck.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12400.tex

Page 127: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 126

Finding a Gouge-Free Path (cont’d)

• Indeed, this disk can be moved from blue to red!

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12500.tex

Page 128: Algorithmische Geometrie Voronoi Diagrame-maxx.ru/bookz/files/held.pdfM. Held: Algorithmische Geometrie (SS 2008) 7 Voronoi Diagram: Definition and Basic Facts (cont’d) • Consider

M. Held: Algorithmische Geometrie (SS 2008) 127

Bottlenecks and Locally Inner-Most Points

• A linear-time scan of the VD reveals all bottlenecks and locally inner-most points.

Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back vd12600.tex