Slide 9

advertisement
COSC 6114
Prof. Andy Mirzaian
Voronoi Diagram & Delaunay Triangualtion
Algorithms





Divide-&-Conquer
Plane Sweep
Lifting into d+1 dimensions
Edge-Flip
Randomized Incremental Construction
Applications




Proximity space partitioning and the post office problem
Height Interpolation
Euclidean: Minimum Spanning Tree, Traveling Salesman Problem,
Minimum Weight Triangulation, Relative Neighborhood Graph, Gabriel Graph.
Extensions
 Higher Order Voronoi Diagrams
 Generalized metrics - Robot Motion Planning
References:
• [M. de Berge et al] chapters 7, 9, 13
•
[Preparata-Shamos’85] chapters 5, 6
•
[O’Rourke’98] chapter 5
•
[Edelsbrunner’87] chapter 13
• AAW
•
Lecture Notes 16, 17, 18, 19
Introduction
Voronoi Diagram & Delaunay Triangulation
P = { p1, p2, … , pn} a set of n points in the plane.
Voronoi Diagram & Delaunay Triangulation
Nearest site proximity partitioning of the plane
Voronoi(P): # regions = n, # edges  3n-6, # vertices  2n-5.
Voronoi Diagram & Delaunay Triangulation
Delaunay Triangulation = Dual of the Voronoi Diagram.
DT(P): # vertices = n, # edges  3n-6, # triangles  2n-5.
Voronoi Diagram & Delaunay Triangulation
Delaunay triangles have the “empty circle” property.
Voronoi Diagram & Delaunay Triangulation
Voronoi Diagram
P = { p1, p2, … , pn} a set of n points in the plane.
Assume: no 3 points collinear, no 4 points cocircular.
PB(pi, pj) perpendicular bisector of pipj.
pi
pj
Voronoi Region of pi: V(p i ) 
pi
n
 H(p , p )
i
j
j 1
j i
Voronoi Diagram of P: VD (P) 
n
  V(p ) 
i
i 1
Voronoi Diagram Properties
 Each Voronoi region V(pi) is a convex polygon (possibly unbounded).
 V(pi) is unbounded

pi is on the boundary of CH(P).
 Consider a Voronoi vertex v = V(pi)  V(pj)  V(pk).
Let C(v) = the circle centered at v passing through pi, pj, pk.
 C(v) is circumcircle of Delaunay Triangle (pi, pj, pk).
 C(v) is an empty circle, i.e., its interior contains no other sites of P.
 pj = a nearest neighbor of pi  V(pi)  V(pj) is a Voronoi edge
 (pi, pj) is a Delaunay edge.
 more later …
Delaunay Triangulation Properties
 DT(P) is straight-line dual of VD(P).
 DT(P) is a triangulation of P, i.e., each bounded face is a triangle
(if P is in general position).
 (pi, pj) is a Delaunay edge   an empty circle passing through pi and pj.
 Each triangular face of DT(P) is dual of a Voronoi vertex of VD(P).
 Each edge of DT(P) corresponds to an edge of VD(P).
 Each node of DT(P), a site, corresponds to a Voronoi region of VD(P).
 Boundary of DT(P) is CH(P).
 Interior of each triangle in DT(P) is empty, i.e., contains no point of P.
 more later …
ALGORITHMS
A brute-force VD Algorithm
P = { p1, p2, … , pn} a set of n points in the plane.
Assume: no 3 points collinear, no 4 points cocircular.
Voronoi Region of pi: V(p i ) 
intersection of
n-1 half-planes
n
 H(p , p )
i
j
j 1
j i
Voronoi Diagram of P: VD (P) 
n
  V(p ) 
i
i 1
• Voronoi region of each site can be computed in O(n log n) time.
• There are n such Voronoi regions to compute.
• Total time O(n2 log n).
Divide-&-Conquer Algorithm
• M. I. Shamos, D. Hoey [1975],
“Closest Point Problems,” FOCS, 208-215.
• D.T. Lee [1978], “Proximity and reachability in the plane,”
Tech Report No, 831, Coordinated Sci. Lab., Univ. of Illinois at Urbana.
• D.T. Lee [1980], “Two dimensional Voronoi Diagram in the Lp metric,”
JACM 27, 604-618.
The first O(n log n) time algorithm to construct
the Voronoi Diagram of n point sites in the plane.
ALGORITHM Construct Voronoi Diagram (P)
INPUT:
P = { p1, p2, … , pn} sorted on x-axis.
OUTPUT: CH(P) and DCEL of VD(P).
O(1)
1.
[BASIS]:
if n1 then return the obvious answer.
2.
[DIVIDE]: Let m  n/2
Split P on the median x-coordinate into
O(n)
L = { p1, … , pm} & R = { pm+1, … , pn}.
3.
[RECUR]:
T(n/2)
(a) Recursively compute CH(L) and VD(L).
T(n/2)
(b) Recursively compute CH(R) and VD(R).
4.
[MERGE]:
(a) Compute Upper & Lower Bridges of CH(L) and CH(R) & obtain CH(P).
(b) Compute the y-monotone dividing chain C between VD(L) & VD(R).
O(n)
(c) VD(P)  [C]  [VD(L) to the left of C]  [VD(R) to the right of C].
(d) return CH(P) & VD(P).
END.
T(n) = 2 T(n/2) + O(n) = O( n log n).
P = { p1, p2, … , pn} a set of n points in the plane.
VD(P) = [C]  [VD(L) to the left of C]  [VD(R) to the right of C] .
VD(L) and CH(L)
VD(R) and CH(R)
Upper & Lower bridges between CH(L) and CH(R) & two end-rays of chain C.
Construct chain C.
(1,5)
(3,5)
5
8
1
3
6
(3,6)
(4,6)
4
(4,7)
2
(2,7)
9
7
Construct chain C.
5
8
1
3
6
9
4
7
2
Crop VD(L) & VD(R) at C.
5
8
1
3
6
9
4
7
2
VD(P) and CH(P)
5
8
1
3
6
9
4
7
2
Fortune’s Algorithm
• Steve Fortune [1987], “A Sweepline algorithm for Voronoi Diagrams,”
Algorithmica, 153-174.
• Guibas, Stolfi [1987],
“Ruler, Compass and computer: The design and analysis of geometric algorithms,”
Proc. of the NATO Advanced Science Institute, series F, vol. 40:
Theoretical Foundations of Computer Graphics and CAD, 111-165.
 O(n log n) time algorithm by plane-sweep.
 See AAW animation.
 Generalization: VD of line-segments and circles.
The Waive Propagation View
• Simultaneously drop pebbles on calm lake at n sites.
• Watch the intersection of expanding waves.
Time as 3rd dimension
z=time
p
y
a
x
y
a
p
apex
of the cone
All sites have identical opaque cones.
x
Time as 3rd dimension
z
x
y
p
q
base plane
• All sites have identical opaque cones.
• cone(p)  cone(q) = vertical hyperbola h(p,q).
• Vertical projection of h(p,q) on the xy base plane is PB(p,q).
Time as 3rd dimension
z
x
y
base plane
Visible intersection of the cones viewed upward from z = -  is VD(P).
Conic Sections: Focus-Directrix
Eccentricity constant:
focus
f
w
e
fw
hw
h
directrix l
0=e
0<e<1
e=1
e>1
point (focus)
ellipse
parabola
hyperbola
Sweep Plane & Sweep Line
sweep
plane
a
z
y
x
sweep
line
base
plane
Sweep Plane & Cone Intersection
sweep
plane
v
p
y
x
base
a
a
w
plane
u
Vertical projection of intersection of cone(p) & the sweep plane
on the base plane is a parabola with focus p and directrix l.
Parabolic Evolution
l
p
l
focus p
y
x
Parabolic Evolution
l
p
l
focus p
y
x
Time snapshots of moving parabola associated with site p
3
2
1
p
y
x
1
2
3
The parabolic front
 Sweep plane opaque. So we don’t see future events.
 Any part of a parabola inside another one is invisible, since a point (x,y) is inside a
parabola iff at that point the cone of the parabola is below the sweep plane.
 Parabolic Front = visible portions of parabola; those that are on the boundary of
the union of the cones past the sweep.
 Parabolic Front is a y-monotone piecewise-parabolic chain.
(Any horizontal line intersects the Front in exactly one point.)
 Each parabolic arc of the Front is in some
Voronoi region.
 Each “break” between 2 consecutive parabolic
arcs lies on a Voronoi edge.
Evolution of the parabolic front
 The breakpoints of the parabolic front trace out every Voronoi edge as the sweep
line moves from x = -  to x = +  .
 Every point of every Voronoi edge is
a breakpoint of the parabolic front at
some time during the sweep.
Fig 1.
p
u
Proof:
(a) Fig 1: Event w:
Cu is an empty circle.
(b) Fig 2: At event w point u must
be a breakpoint of the par. front.
Otherwise:
Some parabola Z covers u at v

Focus of Z is on Cv and Cv
is inside Cu

Focus of Z is inside Cu

Cu is not an empty circle

a contradiction.
Cu
w
sweep
line
q
Z
p
Fig 2.
u
Cu
v
w
Cv
q
sweep
line
The Discrete Events
 SITE EVENT:
Insert into the Parabolic Front.
 CIRCLE EVENT: Delete from the Parabolic Front.
SITE EVENT
A new parabolic arc is inserted into the front when sweep line hits a new site.
p
p
p
s
s
q
s
q
1
q
2
3
SITE EVENT
A new parabolic arc is inserted into the front when sweep line hits a new site.
p
p
p
s
s
s
q
q
q
A parabola cannot appear on the front by breaking through from behind.
The following are impossible:
b
b
a
a
b
b
a
a
t
t+Dt
g
t
g
t+Dt
CIRCLE EVENT
 Circle event w causes parabolic arc b to disappear.
 a and g cannot belong to the same parabola.
p
p
b
a
q
b
q
a
u
w
a
w
q
u
g
g
s
p
s
w
g
s
DATA STRUCTURES (T & Q)
T:
[SWEEP STATUS: a balanced search tree]
maintains a description of the current parabolic front.
Leaves: arcs of the parabolic front in y-monotone order.
Internal nodes: the break points.
T:
x
sweep
direc.
A
B
y
Par(A)
Par(B)
C
Par(C)
D
Par(D)
Operations:
(a) insert/delete an arc.
(b) locate an arc intersecting a given horizontal line (for site event).
(c) locate the arcs immediately above/below a given arc (for circle event).
We also hang from this the part of the Voronoi Diagram swept so far.
- Each leaf points to the corresponding site.
- Each internal node points to the corresponding Voronoi edge.
DATA STRUCTURES (T & Q)
Q: [SWEEP SCHEDULE: a priority queue] schedule of future events:
 all future site-events &
 some circle-events, i.e.,
 those corresponding to 3 consecutive arcs of the current
parabolic front as represented by T.
 The others will be discovered & added to the sweep schedule before
the sweep lines advances past them.
 Conversely, not every 3 consecutive arcs of the current front specify
a circle-event. Some arcs may drop out too early.
Event Processing & Scheduling
Event-driven simulation loop:
At each iteration remove the next event (with min x-coordinate) from Q &
simulate the effect of the sweep-line advancing past that event point.
Event Processing & Scheduling
Event-driven simulation loop:
At each iteration remove the next event (with min x-coordinate) from Q &
simulate the effect of the sweep-line advancing past that event point.
death(a) : pointing to a circle-event in Q as the meeting point of the
Voronoi edges. (If the edges are diverging, then death(a) = nil.)
Remove circle-event death(a) if:
(a) a is split in two by a site-event, or
(b) whenever one of the two arcs adjacent to a is deleted
by a circle-event.
a
Event Processing & Scheduling
Event-driven simulation loop:
At each iteration remove the next event (with min x-coordinate) from Q &
simulate the effect of the sweep-line advancing past that event point.
A circle-event update:
each parabolic arc b (leaf of T) points to the earliest circle-event, death(b),
in Q that would cause deletion of b at the corresponding Voronoi vertex.
a
a
spurious circle-event
death(b’)
death(b)
b’
v
b
s
s
b’’
death(b’’)
g
g
Event Processing & Scheduling
Event-driven simulation loop:
At each iteration remove the next event (with min x-coordinate) from Q &
simulate the effect of the sweep-line advancing past that event point.
(a,g,d) do not define a circle-event:
(a,c,d) is not a circle-event now, it is past the current sweep position.
a
b
a
b
c
d
d
g
ANALYSIS
|T| = O(n) : the front always has O(n) parabolic arcs, since splits occur at
most n times by site events.
Also by Davenport-Schinzel:
… a … b … a … b … is impossible.
[At most 2n-1 parabolic arcs in T.]
|Q| = O(n) : there are at most n site-events and O(n) triples of consecutive
arcs on the parabolic front to define circle-events.
Total # events = O(n),
Time per event processing = O(log n).
THEOREM: Fortune’s algorithm computes Voronoi Diagram of n sites
in the plane using optimal O(n log n) time and O(n) space.
Delaunay Triangulation
Terrain Height Interpolation
A perspective view of a terrain.
A topographical map of a terrain.
Terrain Height Interpolation
A perspective view of a terrain.
A topographical map of a terrain.
Terrain: A 2D surface in 3D such that each vertical line intersects it in at most one point.
f :   2  .
f(p) = height of point p in the domain A of the terrain.
Method: Take a finite sample set P  A. Compute f(P), and interpolate on A.
f
PA
Triangulations of Planar Point Sets
P = {p1, p2, … , pn }  2.
A triangulation of P is a maximal planar
straight-line subdivision with vertex set P.
THEOREM: Let P be a set of n points, not all collinear, in the plane.
Suppose h points of P are on its convex-hull boundary.
Then any triangulation of P has 3n-h-3 edges and 2n-h-2 triangles.
Proof:
m = # triangles
3m + h = 2E
(each triangle has 3 edges; each edge incident to 2 faces)
Euler: n – E + (m+1) = 2
 m = 2n - h - 2,
E = 3n – h – 3.
Delaunay Graph: Dual of Voronoi Diagram
Delaunay Graph DG(P) as dual of Voronoi Diagram VD(P).
Delaunay Graph: Dual of Voronoi Diagram
Delaunay Graph DG(P) as strainght-line dual of Voronoi Diagram VD(P).
Delaunay Graph is a Triangulation
Alternative Definition of Delaunay Graph:
• A triangle D(pi , pj , pk) is a Delaunay triangle iff the circumscribing circle
C(pi , pj , pk) is empty.
• Line segment (pi, pj) is a Delaunay edge iff there is an empty circle
passing through pi and pj, and no other point in P.
THEOREM: Delaunay Graph of P is
 a straight-line plane graph, &
 a triangulation of P.
Proof: Follows from the following Lemmas.
Delaunay Graph is a Triangulation
LEMMA 1: Every edge of CH(P) is a Delaunay edge.
Proof: Consider a sufficiently large circle that passes through the 2 ends
of CH edge e, and whose center is separated from CH(P) by the line aff(e).
e
Delaunay Graph is a Triangulation
LEMMA 2: No two Delaunay triangles overlap.
Proof: Consider circumscribing circles of two such triangles.
Line L separates the two triangles.
L
empty area
Delaunay Graph is a Triangulation
LEMMA 3: pi & pj are Voronoi neighbors  (pi , pj) is a Delaunay edge.
Proof: Consider the circle that passes through pi & pj and whose center is
in the relative interior of the common Voronoi edge between V(pi) & V(pj).
pj
V(pi)
pi
V(pj)
Delaunay Graph is a Triangulation
LEMMA 4: If pj and pk are two (rotationally) successive Voronoi neighbors
of pi & pjpipk < 180, then D(pi , pj , pk) is a Delaunay triangle.
Proof: pj & pk must also be Voronoi neighbors.
Now apply Lemma 3 to (pi , pj), (pi , pk), (pj , pk).
Delaunay Graph is a Triangulation
LEMMA 4: If pj and pk are two (rotationally) successive Voronoi neighbors
of pi & pjpipk < 180, then D(pi , pj , pk) is a Delaunay triangle.
Proof: pj & pk must also be Voronoi neighbors.
Now apply Lemma 3 to (pi , pj), (pi , pk), (pj , pk).
COROLLARY 5: For each pi P, the Delaunay triangles incident to pi
completely cover a small open neighborhood of pi inside CH(P).
CH(P)
pi
pi
Delaunay Graph is a Triangulation
LEMMA 6: Every point inside CH(P) is covered by some Delaunay
triangle in DG(P).
Proof: Let q be an arbitrary point in CH(P). Let (pi , pj) be the Delaunay
edge immediately below q. ((pi , pj) exists because all convex-hull
edges are Delaunay by Lemma 1.) From Corollary 5 let D(pi,pj,pk)
be the next Delaunay triangle incident to pi as in the Figure below.
Then, either q  D(pi,pj,pk), or the choice of (pi , pj) is contradicted.
pk
pk
q
pi
pj
pi
q
q
pj
pk
pi
The THEOREM follows from Lemmas 2-6. We now use DT(P) to denote
the Delaunay triangulation of P.
pj
Angles in Delaunay Triangulation
DEFINITION:
T = an arbitrary triangulation (with m triangles) of point set P.
a1, a2, …, a3m = the angles of triangles in T, sorted in increasing order.
A(T ) = (a1 , a2 , … , a3m) is called the angle-vector of T.
THEOREM: DT(P) is the unique triangulation of P that lexicographically
maximizes A(T ).
Proof: Later.
COROLLARY: DT(P) maximizes the smallest angle.
Useful for terrain approximation by triangulation & linear interpolation.
Small angles (long skinny triangles) cause large approximation errors.
DT & VD via CH
• K.Q. Brown [1979], “Voronoi diagrams from convex hulls,” IPL 223-228.
• K.Q. Brown [1980], “Geometric transforms for fast geometric algorithms,”
PhD. Thesis, CMU-CS-80-101.
• Guibas, Stolfi [1987],
“Ruler, Compass and computer: The design and analysis of geometric algorithms,”
Proc. of the NATO Advanced Science Institute, series F, vol. 40:
Theoretical Foundations of Computer Graphics and CAD, 111-165.
• Guibas, Stolfi [1985], “Primitives for the manipulation of general subdivisions and
the computation of Voronoi diagrams,” ACM Trans. Graphics 4(2), 74-123.
• [Edelsbrunner’87] pp: 302-306.
• Aurenhammer [1987], “Power diagrams: properties, algorithms, and applications,”
SIAM J. Computing 16, 78-96.
DT in d  CH in d+1
Lifting Transform
λ : point (x 1 , x 2 ,  , x d )  point (x 1 , x 2 ,  , x d , x d 1 )
where x d 1  x 12  x 22    x d2
z=l(x,y)
Paraboloid of
Revolution L
l: (x,y)  (x,y, x2+y2)
y
x
DT in 2  CH in 3
SUMMARY:
Consider a plane P in 3 and the paraboloid of revolution L.
(1) Projection of PL down to 2 is a circle C.
(2) Every point of L below P projects down to interior of C.
(3) Every point of L above P projects down to exterior of C.
2D (“Nearest-Point” and “Farthest-Point”)
Delaunay Triangulation algorithm via 3D-convex-hull in
O(n log n) time.
DT in d  CH in d+1
z
L
CH(l(P))
y
DT(P)
x
DT in d  CH in d+1
P = {p1, p2, … , pn }  d.
l(P) = {l(p1), l(p2), …, l(pn)}  d+1.
Assume P is in general position.
THEOREM:
(1) Projection of lower convex-hull of l(P) down to
“nearest-point” DT(P).
d is the
(2) Projection of upper convex-hull of l(P) down to d is the
“farthest-point” DT(P).
VD in d   Half-Spaces in d+1
d
p  (a 1 , a 2 ,  , a d )  hyper plane P ( p ) : x d 1  2a 1 x 1    2a d x d   a i2
i 1
passes through λ (p) and is tangent t o L.
z=l(x,y)
P(p)
Paraboloid of
Revolution L
l: (x,y)  (x,y, x2+y2)
l(p)
y
p
x
VD in d   Half-Spaces in d+1
d
p  (a 1 , a 2 ,  , a d )  hyper plane P ( p ) : x d 1  2a 1 x 1    2a d x d   a i2
i 1
passes through λ (p) and is tangent t o L.
Observation: dist(s,t) = dist(p,r)2 .
t
d2
L: y = x2
s
A d=1 example:
p
P(p)
d
r
1
VD in d   Half-Spaces in d+1
d
p  (a 1 , a 2 ,  , a d )  hyper plane P ( p ) : x d 1  2a 1 x 1    2a d x d   a i2
i 1
passes through λ (p) and is tangent t o L.
A d=1 example:
L: y = x2
P(q)
P(p)
1
q
p
VD in d   Half-Spaces in d+1
P(p)
P(q)
l(q)
l(p)
q
p
d
VD in d   Half-Spaces in d+1
• The projection of P(p)P(q) down to d is the
perpendicular-bisector of p & q.
• P(p) is above P(q) at points of d that are closer to q.
• P+(p) = the closed half-space in d above P(p).
THEOREM:
Voronoi Diagram in d is obtained by projecting down the
intersection of half-spaces P+(p) , i=1..n, in d+1.
Duality Reminder:
Intersection of half-spaces  Convex-Hull of Points.
VD in d   Half-Spaces in d+1
LEMMA: The projection down to d of the intersection of any
non-vertical hyper-plane in d+1 with the paraboloid of revolution
L : xd+1 = x12 + x22 + … + xd2 is a sphere in d.
Proof:
 hyperplane : x d 1  a 1 x 1    a d x d 


2
2 
P.
of
Rev.
L
:
x

x



x
d 1
1
d 

sphere :
d
 (x
i 1
i

ai
2
)  1/4
2
d
a
i 1
2
i
.
P  2  l(P)  3
COROLLARY: Consider 4 points pi = (xi , yi), i=1..4 in 2 , and
their immage l(pi) = (xi , yi , xi2 + yi2) in 3.
1. pi are cocircular in 2  l(pi) are coplanar in 3.
2. Point D=p4 is inside the circumcircle of A=p1, B=p2, C=p3
 a1 + a3 < 180 (a2 + a4 > 180)
 l(D) is below the plane passing through l(A), l(B), l(C).
 D(A,B,C,D) and D(A,B,C) have the same sign. i.e.,
x1
y1
x 12  y12 1
x
D ( A , B, C , D )  2
x3
y2
y3
x 22  y 22 1
0
x 32  y 32 1
x4
y4
x 24  y 24 1
x1
assuming
D ( A , B, C )  x 2
x3
y1 1
B
a3
C
a4
a2
D
a1
y2 1  0
y3 1
A
Incircle(A,B,C,D)
A simple O(n2) time DT Algorithm
Step 1: Let T be an arbitrary triangulation of P  2.
[e.g., use sweep in O(n log n) time]
Step 2: while T has a quadrangle of the form below with A + B > 180
do flip diagonal CD (i.e., replace it with diagonal AB). [O(n2) iterations]
C
C
flip CD
B
A
B
A
Fact 1: 6 sorted angles are
lexicographically increased
D
D
C
B
A
don’t flip CD
D
A snapshot of the Algorithm
A snapshot of the Algorithm
e1
FLIP e1
A snapshot of the Algorithm
A snapshot of the Algorithm
e2
FLIP e2
A snapshot of the Algorithm
A snapshot of the Algorithm
e3
FLIP e3
A snapshot of the Algorithm
A snapshot of the Algorithm
FACTS
FACT 1: The flip operation cd  ab is like attaching the tetrahedron
(a,b,c,d) to the “lifted convex-hull” in 3D constructed so far
[so its volume increases].
Proof:
(1) There are at most O(n2) edges in the tetrahedronization in 3D.
After an edge is flipped out, it cannot reappear.
 O(n2) flips at most
(2) Euler: n nodes, e edges, f faces, t tetrahedra, h hull vertices:
n – e + f– t = 1 & 4t + (2h –4) = 2f
 t = e – (n + h – 3) = O(n2).
FACTS
The O(n2) bound on the number of flips is tight:
flip “inside out”
FACTS
FACT 2: Let Cabc denote the circumcircle of triangle (a,b,c).
( i ) C acd  C bcd  C acb  C adb
( ii ) C acd  C bcd  C acb  C adb
 
after
before
a
c
d
b
FACTS
FACT 3: A flip lexicographically increases the sorted sequence of 6 angles
of the pairs of triangles involved before and after the flip.
COROLLARY 4: Each flip lexicographically increases the angle-vector of
the triangulation.
THEOREM: DT(P) is the unique triangulation of P that lexicographically
maximizes A(T ).
Randomized Incremental
Construction
• Guibas, Knuth, Sharir [1990],
“Randomized Incremental Construction of Delaunay and Voronoi Diagrams,”
Proc. 17th Annual Int’l Coll. Automata & Lang. Progr. (CALP’90), LNCS 443,
Springer-Verlag, 414-431.
• Edelsbrunner, Shah [1992],
“Incremental Topological Flipping works for regular Triangulations,” CG, 43-52.
Randomized Incremental DT Algorithm
1.
2.
3.
4.
end
Randomly permute the given sites, say p1, p2, … , pn.
Construct Delaunay Triangulation of p1, p2, p3.
for i  4 .. n do
(a) Find triangle (or outer-face) of DT that contains pi.
(b) Add pi to that face and triangulate it.
(c) Perform repeated “Incircle-Test” and do edge-flips.
return resulting DT.
Inserting a new site pi :
pi
Step 3(c): Use the “Histroy DAG”

Maintain all versions of the DT on top of one another, plus
appropriate links between overlapping “old” & “new” triangles.

This hierarchical structure will be used to perform the
point-location step 3(a) also.

No more preprocessing needed for nearest-neighbor queries.

The Voronoi Diagram can also be constructed in a similar
randomized manner with a hierarchical representation of all
the past history of insertions.
ALGORITHM Randomized Incremental DT Construction
1. Initialize DT to “bounding-box” triangle W1 W2 W3 (3 points at ).
2. for k 1 .. n do
B
3.
select a random site P not yet selected.
4.
locate triangle ABC that contains P.
C
5.
replace ABC by PAB, PBC, PCA
P
6.
X  A ; progress  true
A
7.
repeat
8.
Y  3rd vertex of triangle left of PX
Y
9.
if X & Y are not both some Wi (at ) then do
10.
find Z  P s.t. XYZ is a current triangle P
11.
if Incircle(P,X,Y,Z) then do
12.
flip triangles PXY & ZXY to PXZ & PZY
X
13.
progress  false
14.
end if
15.
if progress then X  Y
16.
end if
17.
until X = A and progress
end
expected time
= O(n log n)
expected space = O(n)
Z
Triangulation
D1
History DAG
D2
split D1
D1
D2
D3
D3
D1
D2
D3
s
p
D2
r
D1
D2
D3
flip rs
D3
D5
s
p
D4
D5
D4
r
t
D3
D1
D3
D2
flip rt
s
p
r
D6
D5
D5
D7
t
D4
D6
D7
• History DAG will be used for Nearest Site Point Location query answering.
• Each node in History DAG has out-degree at most 3.
• When inserting a new site, all Delaunay edges created
due to edge-flips are incident to the new site.
pi
pi
THEOREM 1: The randomized Delaunay Triangulation algorithm satisfies the
following properties on all inputs of size n:
(a) The expected total number of structural changes (i.e., edge-flips …) that
happen to the diagram is only O(n). [The worst-case is Q(n2).]
(b) Using the History DAG, the amortized expected cost per site insertion is
O(log n), i.e., the overall expected time is O(n log n).
Proof: See next slides.
THEOREM 2: Suppose the Delaunay diagram of m sites is already computed
and n additional sites are to be added. If the new sites are randomly and
incrememntally inserted into the diagram, then the total number of
structural changes has expected value O(m log n + n)
[and this bound is tight].
Worst-case Q(n2) edge-flips:
insert next
y=1
x
insert first
Note: In any triangulation of the n sites:
# triangles =
2n – h – 2  2n
# edges
=
3n –h – 3  3n
where
h 3
is the # hull vertices.
LEMMA 1: Expected # triangles created by the RIA is at most 9n + 1 = O(n).
Proof:
Pk = { p1, p2, …, pk } the first k points (random).
Tk = Delaunay Triangulation of Pk  {W1, W2, W3}.
# edges of Tk  3(k+3) –6 = 3k + 3.
# edges of Tk excluding triangle (W1, W2, W3)  3k.
 E[degree of pk in Tk ]  (2  3k) / k = 6.
Backwards analysis:
pk can be any of the points in Pk with equal probability.
# triangles created at iteration k  2  [degree of pk in Tk] – 3.
 E[# triangles created in iteration k]  2  6 –3 = 9.
 E[# triangles created in all iter.]  9n. [by linearity of expectation]
(The one extra in 9n+1 is the initial “bounding triangle (W1, W2, W3).
Random-Sampling technique of Clarkson-Shor.
Definition: Consider a triangle D = (pi , pj , pk).
C(D) = circumcircle of triangle D.
X(D) = set of points in P that are in the interior of C(D).
width(D) = || X(D) ||.
width = 0  D is a Delaunay triangle.
pj
pi
pk
Expected time = point locations + History DAG construction
Expected time excluding point-location
= expected size of the History DAG
= expected # triangles created by RIA
= O(9n + 1) = O(n).
Expected time for all point-locations = O( n + D width(D) )
[where D is a Delaunay triangle at some iteration]
Why?
Point-location for insertion of site p:
• Starting with (W1, W2, W3) in the History DAG, trace the path of all
triangles that contain p.
• Charge the cost of each visited triangle node to either (W1, W2, W3) or a
triangle D that was Delaunay at some time.
• The total charge will be as above. (See next slide.)
Expected time for all point-locations = O( n + D width(D) )
[where D is a Delaunay triangle at the end of some iteration]
Width(D) = W

D will be charged by at most W points, at most once for each.
Why?
Suppose point-location of p visits a triangle D. So, p is inside D, hence p  X(D).
(i) If D is Delaunay at the time of its creation, then charge that visit to D.
(ii) If D is not Delaunay at the time of its creation, then charge that visit to
its neighbor D’. (D’ must have been Delaunay.)
p  D  p  X(D’).
D
D’
LEMMA 2:
Proof:
1)
E[ D width(D) ] = O(n log n).
Pk = { p1, p2, …, pk } (random). Tk = DT of Pk  {W1, W2, W3}.
 width ( D ) 
D




width
(
D
)




k 1  DT k  T k 1

n
[pk is incident to D.]
Definition: for a point q  P - Pk : R(Pk,q) = # triangles D  Tk s.t. q  X(D).
R(Pk,q, pk) = # triangles D  Tk s.t. q  X(D), and pk is a vertex of D.
2)

width ( D ) 
DT k T k 1

qP  Pk
R ( Pk , q , p k )


4 ) E   width ( D )  
 DT k T k 1

3
k


6 ) E   width ( D )  
 DT k T k 1

3( n k )
k
 R (P
q  P  Pk
k
, q)
3)
E  R ( Pk , q , pk )  
5) ER ( Pk , p k 1 )  
1
n k
7 ) ER ( Pk , p k 1 )   E || T k  T k 1 ||   E || T k 1  T k ||   2  6  2  4
Now sum over k.
R ( Pk , q )
 R (P , q)
qP  Pk
E R ( Pk , p k 1 ) 

 12 ( n  k )
8)  E   width ( D )  
.
k
 DT k T k 1

3
k
k
THEOREM 3: The randomized incremental algorithm calculates the
Delaunay Triangulation of a set of n points in the plane in
expected time O(n log n) &
expected space O(n).
Remark: This expected time is optimum, since there is a linear time reduction
from sorting to DT (i.e., xi  (xi, xi2) ) and expected time for sorting in
the algebraic decision-tree model of computation is W(n log n).
Generalizations & Applications
RIA for 3D Convex Hull
Incremental construction of 3D Convex Hulls:
Generalize the following idea to CH of any set P of n points in 3D.
DT
CH
( x , y )  ( x , y, x 2  y 2 )
flip
add a tetrahedr on
THEOREM 4: The expected overall # of faces that appear during the randomized
incremental construction of the lower-CH of a set P of n points in 3D is O(n).
Proof: width(XYZ) = # points of P that lie below the plane of XYZ.
The rest of the proof is again by the random-sampling technique of Clarkson-Shor.
THEOREM 5: The randomized incremental construction of 3D convex hull takes
optimal expected time O(n log n) and expected space O(n).
[Worst-case could be Q(n2) time and space.]
RIA for Voronoi Diagram
IDEA: radial triangulation of Voronoi regions:
• Now apply previous ideas on these type of triangles.
Each radial triangle is determined by at most 4 sites.
• No need for further point-location preprocessing for nearest-neighbors queries.
The constructed structure will have that.
THEOREM 6:
 The expected size of the structure is O(n).
 The structure can be built in expected O(n log n) time.
 The above point-location structure can be used to locate the final
radial triangle that contains an arbitrary query point q in expected
O(log2 n) time.
The Post Office Problem
PROBLEM: Preprocess a given set P of n points in the plane for:
Nearest Neighbor Query: Given a query point q, determine which point in
P is nearest to q.
Shamos [1976]: Slab Method:
Query Time:
Preprocessing Time:
Space:
O(log n)
O(n2)
O(n2)
Kirkpatrick [1983]: Triangulation refinement method for planar point location:
Query Time:
O(log n)
Preprocessing Time:
O(n log n)
Space:
O(n)
Construct Voronoi Diagram. Each Voronoi region is convex, hence monotone.
Triangulate the Voronoi regions in O(n) time. Then apply Kirkpatrick’s method.
Andoni, Indyk [2006] “Near-optimal hashing algorithms for approximate nearest
neighbor in high dimensions,” FOCS’06.
Largest Empty Circle Problem
PROBLEM:
Determine the largest empty circle with center in CH(P).
O(n) Candidate centers. All can be found in O(n) time (after VD(P) is given):
(1) Voronoi vertex inside CH(P),
(2) Intersection of a Voronoi edge and an edge of CH(P).
Subgraphs of Delaunay Triangulation
 Gabriel Graph
 Relative Neighborhood Graph
 Euclidean Minimum Spanning Tree
 Nearest Neighbor Graph
NNG  EMST  RNG  GG  DT
Delaunay Triangulation:
p
(p,q) is a DT edge   empty circle through p and q.
q
Gabriel Graph:
(p,q) is a GG edge 
 empty circle with diameter (p,q),
(i.e., (p,q) intersects its dual Voronoi edge).
Relative Neighborhood Graph: (p,q) is an RNG edge 
rP-{p,q}: (p,q) is NOT the longest edge of triangle (p,q,r)
(i.e., d(p,q)  max{d(p,r), d(q,r)})
(i.e., lune(p,q) is empty).
Euclidean Minimum Spanning Tree: (p,q) is in EMST 
cycles: (p,q) is NOT the longest edge of the cycle.
Nearest Neighbor Graph: (p,q) is a directed edge in NNG 
rP-{p,q}: d(p,q)  d(p,r).
q
p
q
p
NNG  EMST  RNG  GG  DT
Delaunay Triangulation
NNG  EMST  RNG  GG  DT
Gabriel Graph:
NNG  EMST  RNG  GG  DT
Gabriel Graph:
NNG  EMST  RNG  GG  DT
Relative Neighborhood Graph:
NNG  EMST  RNG  GG  DT
Euclidean Minimum Spanning Tree:
NNG  EMST  RNG  GG  DT
DelaunayNeighbor
Nearest
Triangulation
Graph:
Euclidean Minimum Spanning Tree
• General (m edge, n vertex graph) MST algorithms (See also AAW):
Kruskal or Prim
O(m log n) or O(m + n log n) time.
Yao or Cheriton-Tarjan:
O(m log log n) time
Chazelle:
O(m a(m,n)) time.
• EMST requires W(n log n) time in the worst-case.
[Linear time reduction from the Closest Pair Problem.]
• EMST in O(n log n) time:
(1) Compute DT in O(n log n) time (# edges in DT  3n –6).
(2) Apply Prim or Kruskal MST algorithm to DT.
• Next we will show EMST can be obtained from DT in only O(n) time.
Euclidean Minimum Spanning Tree
• D. Cheriton, R.E. Tarjan [1976]
“Finding minimum spanning trees,” SIAM J. Comp. 5(4), 724-742.
• Also appears in §6.1 of [Preparata-Shamos’85].
• Cheriton-Tarjan’s MST algorithm works on general graphs.
When applied to a planar graph with n vertices and arbitrary
edge-weights, it takes only O(n) time.
• The following graph operations preserve planarity:
(a) vertex or edge removal,
(b) edge contraction (shrink the edge & identify its two ends):
e
Cheriton-Tarjan: MST algorithm (overview)
Input: edge-weighted graph G=(V,E)
1.
Q
(* queue of sub-trees *)
for v  V do enqueue (v, Q)
2.
(* n single-node trees in Q *)
while |Q|  2 do
- let T1 be the tree at the front of Q
- find edge (u,v)  E with minimum weight s.t. u  T1 and v T1
- let T2 be the tree (in Q) that contains v
- T  MERGE (T1 , T2) by adding edge (u,v)
- remove T1 and T2 from Q
- add T to the end of Q
- CLEAN-UP after each stage (see next slide)
end
Cheriton-Tarjan
if |T| 1
0
stage ( T )  
1  min{ stage ( T1 ), stage ( T2 )} if T  MERGE(T 1 , T2 )
Invariants:
(a) stage numbers of trees in Q form a non-decreasing sequence.
(b) stage(T)=j implies T has at least 2j nodes. So, stage(T)  log |T|.
(c) after completion of stage j (i.e., the first time stage(T) > j, TQ)
there are  n/(2j) trees in Q.
CLEAN-UP:
After the completion of each stage do “clean-up”, i.e., shrink G to
G*, where G* is G with each edge in the same tree contracted, i.e., each
tree in Q is contracted to a single node, with only those edges (u,v)G* ,
uT, vT’, That are shortest incident edges between disjoint trees T, T’.
Cheriton-Tarjan: Algorithm
PROCEDURE MST of a Graph G=(V,E)
1.
Q
(* initialize queue *)
for v  V do stage(v)  0 ; enqueue (v, Q)
j1
2.
while |Q|  2 do
- let T1 be the tree at the front of Q
- if stage(T1) = j then CLEAN-UP; j  j+1
- (u,v)  shortest edge, s.t. u  T1 and v T1
- let T2 be the tree (in Q) that contains v
- T  MERGE (T1 , T2) by adding edge (u,v)
- stage(T)  1 + min{ stage(T1), stage(T2)}
- remove T1 and T2 from Q
- add T to the end of Q
end
Cheriton-Tarjan: Analysis
FACTS:
(a) A planar graph with m vertices has O(m) edges.
(b) Shrunken version of a planar graph is also planar
(c) CLEAN-UP of stage j takes O(n/2j) time.
(d) # stages  log n
(e) During stage j each of the < 3n/ 2j edges of G* are checked
at most twice (once from each end). So, stage j takes O(n/ 2j) time.
(f) Cheriton-Tarjan’s algorithm on planar graphs takes:

Total Time  O

 log n 

j 1
6n 
  O( n )

2j 
THEOREM: The MST of any weighted connected planar graph with n
vertices can be computed in optimal O(n) time.
COROLLARY: Given DT(P) of a set P of n points in the plane,
the following can be constructed in O(n) time:
(a) GG(P),
(b) RNG(P),
(c) EMST(P),
(d) NNG(P).
Proof: (a) & (d): obvious. (c): use Cheriton-Tarjan on DT(P). (b): see Exercise.
Traveling Salesman Problem (TSP)
Input:
An nn positive distance matrix D=(dij), i,j = 1..n,
where dij is the travel distance from city i to city j.
Output: A traveling salesman tour T. T starts from the home city
(say, city 1) and visits each city exactly once and returns
to home city.
Goal:
minimize total distance traveled on tour T: C ( T ) 

( i , j )T
0
5
D
3

12
7
0
2
2
1
0
3
9
11
9 
5

0
d ij .
TOPT  (1, 3, 4, 2)  ((1, 3), (3,4), (4,2), (2,1))
C(TOPT) = d13 + d34 + d42 + d21
= 2
= 15
+5 + 3 +5
Some Classes of TSP
• General TSP :
distance matrix D is arbitrary
• Metric-TSP:
D satisfies the metric axioms
• Euclidean-TSP:
n cities as n points in the plane with
Euclidean inter-city distances
These are all NP-hard.
Related Problems:
• Minimum Spanning Tree
• Hamiltonian Cycle
• Graph Matching
• Eulerian Graphs
Hamiltonian Cycle Problem (HCP)
HCP:
Given a graph G(V,E), does G have a Hamiltonian Cycle (HC)?
HC is any simple spanning cycle of G, i.e., a cycle that goes
through each vertex exactly once.
HCP is known to be NP-hard.
Hamiltonian
(skeleton of dodecahedron)
Non-Hamiltonian
(Peterson graph)
Graph Matching
Definition:
• A matching M in a graph G(V,E) is a subset of the edges of G
such that no two edges in M are incident to a common vertex.
• Weight of M is the sum of its edge weights.
• A perfect matching is one in which every vertex is matched.
7
5
3
9
4
6
1
2
8
7
3
A perfect matching M of weight 5+2+3+6=16 in graph G.
FACT:
Minimum weight maximum cardinality matching can be obtained
in polynomial time [Jack Edmonds 1965].
Min Weight Euclidean Matching
Given 2n points in the Euclidean plane, match them in pairs
with n matching edges of minimum total length.
 O(n3) on general weighted graphs:
Jack Edmonds [1965]
 O(n2.5 log4 n): P.M. Vaidya [1989], SICOMP 18(6), 1201-1225.
 Mirzaian [1993], “Minimum weight Euclidean matching and
weighted relative neighborhood graphs,” WADS, 506-517.
Eulerian Graph
Definition: A graph G(V,E) is Eulerian if it has an Euler walk.
Euler Walk is a cycle that goes through each edge of G exactly once.
An Eulerian
graph G
An Euler
walk of G
FACT 1: A graph G is Eulerian if and only if
(a) G is connected and
(b) every vertex of G has even degree.
FACT 2: An Euler walk of an Eulerian graph can be found in linear time.
General TSP
THEOREM: Let r >1 be any constant.
r-approximation of general TSP is also NP-hard.
[So, there is no polynomial-time r-approximation algorithm for general TSP,
unless P=NP.]
Proof: Reduction from Hamiltonian Cycle Problem (HCP).
HCP: Given G(V,E), is G Hamiltonian?
Reduction: Let n = |V|. Define the TSP distance matrix as:
1
d ij  
1  ρn 
if (i , j)  E
if (i , j)  E
G is Hamiltonian
 C(TOPT) = n.
G is not Hamiltonian  C(TOPT)  n + rn  (1+r) n > r n.
Suppose there were a poly-time r-approx TSP algorithm producing a tour T.
C(T)/C(TOPT)  r  G has HC if and only if C(T) = n.
This would provide a poly-time algorithm for the HCP!
Metric & Euclidean TSP
 Metric Traveling Salesman Problem (metric-TSP):
 special case of general TSP (distance matrix is metric)
 NP-hard
 2-approximation: Rosenkrants-Stearns-Lewis [1974]
 1.5-approximation: Christofides [1976]
 Euclidean Traveling Salesman Problem (ETSP):
 special case of Metric-TSP (with Euclidean metric)
 NP-hard
PTAS: Sanjeev Arora [1996] [CSE4101/5101 Lecture Note 10].
2-approximation of metric-TSP
Rosenkrants-Stearns-Lewis [1974]
(See also AAW)
C(T)  2  C(TOPT)
•
Minimum Spanning Tree (MST)
•
Euler walk around double-MST
•
Bypass repeated nodes on the Euler walk.
FACT 1: Triangle inequality implies bypassing nodes cannot increase length of walk.
FACT 2: C(T)  2  C(MST)  2  C(TOPT) .
r = 2 is tight (even for Euclidean instances)
Euclidean
Instance
MST
C ( TOPT )  n
C ( T ) 2

n
2
Euler walk
of double MST
)
 1  ( n2  1) 2  1  2 n  O (1)
Tour TOPT
Tour T
ρ(n ) 
C(T)
C ( TOPT )
lim ρ ( n )  2
n 
 2  O  n1 )
1.5-approximation for metric-TSP
Christofides [1976]:
C(T)  1.5  C(TOPT)
•
•
MST
Odd degree nodes in MST
•
M = Minimum weight
perfect matching
on odd-degree nodes
•
E = MST + M is Eulerian.
Find an Euler walk of E.
•
Bypass repeated nodes
on the Euler walk to get a TSP tour T.
FACTS:
• Any graph has even # of odd degree nodes. (Hence, M exists.)
• C(MST)  C(TOPT)
•
C(M)  0.5  C(TOPT) (See next slide.)
•
C(E) = C(MST) + C(M)  1.5  C(TOPT)
•
C(T)  C(E)  1.5  C(TOPT)
C(M)  0.5  C(TOPT)
Odd degree node in MST
TOPT
C(M)  0.5  C(TOPT)
C(M)  C(M1)
Odd degree node in MST
M1
TOPT
C(M)  0.5  C(TOPT)
C(M)  C(M2)
Odd degree node in MST
M2
TOPT
C(M)  0.5  C(TOPT)
C(M)  C(M1)
C(M)  C(M2)
2  C(M)  C(M1) + C(M2)  C(TOPT)
Odd degree node in MST
M1
M2
TOPT
r = 1.5 is tight (even for Euclidean instances)
Euclidean instance:
MST:
MST + M:
Tour T:
Tour TOPT :
Open Problem
Weighted Relative Neighborhood Graph (WRNG):
• RNG of a set of circular disks
• This arises in EMWM computation [Mirzaian’93]
• weighted distance (triangle inequality not satisfied):
~
dij  d ij  ri  rj
FACT: WRNG  WGG  WDT.
WDT and WGG can be computed in O(n log n) time.
Open Problem: Can WRNG be computed in O(n log n) time?
Minimum Weight Triangulation
• Problem: Given a set P of n points in the Euclidean plane,
find a triangulation of P with minimum total edge length.
• MWT is NP-hard: [LN16: Mulzer-Rote, SoCG’06]
• See LN17 & LN18 also.
• Delaunay Triangulation can give W(n) approximation ratio:
e
DT
MWT
• Greedy Approximation: W( 𝑛) approx. ratio:
- Start the triangulation T with no edges.
- Repeatedly select the shortest edge e (from unselected edges
that do not cross any selected edges) and add e to T.
In general, dynamic programming can be used for triangulation of
point sets or polygons.
Point sets:
1.
2.
3.
4.
Maximize the minimum angle:
Minimize the maximum angle:
Minimize the longest edge:
Minimize total edge length:
Delaunay Triangulation , O(n log n)
SoCG’89-90, O(n2 log n)
Use RNG
MWT [LN16,17,18]
Extensions of Voronoi Diagrams
 Voronoi Diagram of line-segments, circles, …
 Medial Axis
 Order k Voronoi Diagram
 Farthest Point Voronoi Diagram (order n-1 VD)
 Weighted Voronoi Diagram & Power Diagrams
 Generalized metric (e.g., Lp metric)
VD of line-segments & circles
hyperbola
Medial Axis
• MA: Locus of centers of empty circles that touch 2 or more data points. [Blum’76]
• Applications: pattern recognition, medical CAT scan imaging, …
• MA of polygons in linear time:
convex polygons: [Aggarwal et al. 1989]
simple polygons: [Chin-Snoeyink-Wang, Discrete Comp. Geom.1999]
Higher Order VD
• [PrS85] § 6.3
• [Ede87] § 13.3-13.5
• [ORo98] § 6.6.
• Aurenhammer [1987], “Power diagrams: properties, algorithms, and
applications,” SIAM J. Computing 16, 78-96.
• D.T. Lee [1982], “On k-Nearest Neighbors Voronoi Diagram in the Plane,”
IEEE Trans. Computers, C-31, 478-487.
Order k Voronoi Diagram
Given a set of n sites in space, partition the space into regions where any two points
belong to the same region iff they have the same set of k nearest sites.
5,8
5,6
5
2,5
2
Example: Order 2 Voronoi Diagram
Some Voronoi regions of order 2
6,8
4,5
6
2,4
1,2
1,4
are empty, e.g. (5,7).
1
4
3,4
1,3
8
4,6
6,7
4,7
3
7,8
7
3,7
Order k Voronoi Diagram
T  P  {p1 , p 2 ,  , p n }, | T | k
Vk ( T ) 

pi
H(pi , p j )
p i T
p j P  T
pj
Voronoi region of T (a convex polyhedron, possibly empty)
Order k Voronoi Diagram of P:
VD k ( P ) 
 V
k
(T) 
TP
|T|  k
n
  possible subsets of size k. Most have empty Voronoi regions.
k
In 2D only O(k(n-k)) of them are non-empty [D.T. Lee’82].
VDk in d 
k-belt of
arrangement of hyperplanes in d+1
k-belt = region between level k and level (k+1) in the arrangement.
2-belt
Example: VD2 in 1
y
y=x2
1,2
x
p1
p2
p3
p4
2,3
3,4
ALGORITHM Order-k VD of P  2
1. For each point p  P do
- lift p onto L: z = x2 + y2, call it l(p)
- P(p)  plane tangent to L at l(p)
2.
Construct k-belt of the arrangement of the planes P(p), p  P, in
3.
Project down this k-belt onto the base plane 2.
This is the k-th order Voronoi Diagram of P.
3.
FACT 1: In O(n3) time we can compute all k-levels of the arrangement and
find the k-th order VD.
Improvement by [D.T. Lee 1982]:
FACT 2: [Preparata-Shamos’85]:
k-th order VD of n points in the plane can be obtained in time
O(min { k2 , (n-k)2 } n log n).
COROLLARY 3: Complexity of the k nearest neighbors query problem is:
O(k + log n)
Query Time
O(k2 n log n)
Preprocessing Time
O(kn)
Space.
VD in Lp metric
L metric: || p1 – p2 || = max { | x1 – x2 | , |y1 – y2 | }
“unit circle”
p1
p2
PB
L1 metric: || p1 – p2 ||1 = | x1 – x2 | + |y1 – y2 |
“unit circle”
p1
p2
PB
VD in Lp metric
Voronoi Diagram in L metric in O(n log n) time & O(n) space.
Largest empty square in O(n log n) time.
Robot Motion Planning
B
obstacle
A
robot
Assume robot moves by translation only (no rotation).
Robot Motion Planning
Approach:
1. Voronoi Diagram
2. Minkowski Sum
AB = { p + q |

p A, q B }
=
p-q
p
AN
-q

q
A
=
AAN
Exercises
1.
(a) Draw the Voronoi diagram of 10 points all on a line.
(b) Draw separately the Voronoi diagram of 10 points all on a circle.
(c) Draw the Voronoi diagram of 10 random points in the plane using the L 1 metric instead of the L2
metric. Show an example of a Voronoi cell that is not convex.
2.
Let P and Q be two point sets in the plane, and let p  P and q  Q be the two points from these sets
that minimize dist(p,q). True or false: line-segment (p,q) is an edge of DT(P  Q). Explain.
3.
Dynamic maintenance of Voronoi Diagrams:
We are given the Voronoi Diagram VD(P) of a set P of n points in general position in the plane.
(a) Show how to delete a given point p  P, thereby constructing the Voronoi Diagram of P-{p}.
Your method should take O(k log k) time where k is the number of edges on the boundary of the
Voronoi region corresponding to p.
(b) Optional: Can you improve the running time of your algorithm for part (a) to O(k)?
(c) We are given a point qP and a Delaunay triangle in DT(P) whose circumscribing circle contains q.
Show how to insert q, thereby constructing the Voronoi Diagram of P{q}. Your method should
take O(k) time, where k is size of the combinatorial “change” in the VD. [Note: DT(P) is not given.]
4.
Modified Delaunay Triangulation: We are given the Delaunay Triangulation of a set P of n point
in the plane. Suppose the x-coordinate of each point in P with positive x-coordinate is increased by 1.
There are no other changes to the coordinates of the points in P. How fast can you algorithmically
update the Delaunay Triangulation of the modified P? Describe and justify your answer in detail.
5.
Let S be a set of n segments in the Euclidean plane. The distance between two segments s 1, s2 is
defined as d(s1, s2) = min { d(p, q) | p s1, q  s2 }. Describe a randomized algorithm for computing
a nearest (respectively, farthest) pair of segments in S whose expected running time is O(n log n).
6.
Farthest Point Voronoi Diagram: The following problems have to do with the farthest-point Voronoi
diagram. For a set S of n points in the plane, define the farthest-point Voronoi diagram of S, denoted
FVD(S), as the union of farthest-point cells, where we define for each point pS, FV(p) to be the set of
all points that have p as their farthest neighbor in S.
(a) Give an example of a set S and a point pS such that FV(p) is empty.
(b) Show that each non-empty region in a farthest-point Voronoi diagram is unbounded and associated
with a point on the convex hull of S.
(c) Show that FVD(S) in the plane is a tree.
(d) Define the farthest-point Delaunay Triangulation FDT(S) as the graph-theoretic planar dual of FVD(S).
Derive a relationship between FDT(S) and the convex hull of the 3-dimensional set of points defined
by mapping each point (x,y) S to the point (x,y, x2 +y2). Use this fact to design a simple O(n log n)
time algorithm for constructing FVD(S).
(e) Prove that each vertex v of FVD(S) corresponds to a circle C determined uniquely by the sites defining
v such that C contains all the points of S.
(f) Show how to use FVD(S) to compute the smallest-radius circle that contains S.
What is the running time of your method?
7.
Minkowski Sum: Let A and B be two convex polygons in the plane, with m and n vertices respectively.
If we regard a point in the plane as a vector, then the Minkowski sum of A and B is defined as
A  B = {a + b  a A , b  B}. Show that A  B is a convex polygon with at most m + n vertices.
How fast can one compute A  B?
8.
Hausdorf Distance: The set distance between two sets of points A and B is defined as
d(A,B) = min {d(p,q) | pA , qB } , where d(p,q) is the Euclidean distance between points p and q.
The directed Hausdorf distance from a set of points A to a set of points B is
H(A,B) = max {d(p,B) | pA } ,
and the Hausdorf distance between a set of points A and a set of points B is
D(A,B) = max { H(A,B), H(B,A)}.
[This metric is used to measure similarity between two sets of points.]
Outline an efficient algorithm for computing the Hausdorf distance between two sets, A and B,
each containing n points in the plane. What is the running time of your method?
9.
Voronoi Diagram in L metric: The L distance is dist(p, q) = max( |px − qx |, | py − qy | ).
(a) Given a point q, describe the set of points that are at L distance w from q.
(b) Given two points p and q, describe the set of points that are equidistant from p and q in the L distance.
[Hint: The bisector is a polygonal curve. As a function of the coordinates of p and q, indicate how
many vertices this curve has and where these vertices are located. Give exact formula, and not just a
high-level description.]
(c) Argue that the Voronoi diagram for n sites in the L metric has O(n) line-segments and vertices.
[Hint: First show that each cell of the Voronoi diagram is connected. Take care in your application of
Euler's formula, since some vertices may have degree two.]
(d) Assuming that the L Voronoi diagram is given, describe a method to compute the largest empty
axis-aligned square centered at a query point q. Your method should involve O(n) space and O(log n)
query time. [You are not required to show how to build the data structure, only to argue its existence.]
10.
Let P = {p1, p2, … , pn} be the vertices of a convex polygon, given in counterclockwise order. The
purpose of this problem is to modify the randomized incremental Delaunay triangulation algorithm to
run in O(n) expected time. Unlike the algorithm presented in class, we do not put all the sites within
a large bounding triangle. We start with the triangle defined by three random sites from P. The remaining
sites are inserted in random order; each new site is connected to the convex hull, and edge flips are
performed until the circumcircle condition is satisfied. (See the figure below.)
(a) Give a backwards analysis to show that the expected number of edge-flips performed with each
insertion is O(1).
(b) Whenever a new site is added, we need to determine where along the current convex hull it is to be
added. Explain how to do this in O(1) expected time. You are allowed to preprocess the sites in O(n)
time.
11. Given a set P of n points in the plane in general position (no 3 collinear & no 4 cocircular), the objective of this
problem is to determine the pair of concentric circles C1 and C2 such that every point of P lies between these
circles, and the area of the region between these two circles is minimized.
[Note: There is a harder variant of this problem in which the goal is to minimize the width of this region.]
Consider the subdivision S formed by overlaying NVD(P) and FVD(P), the nearest and farthest Voronoi
diagrams of P, respectively. The vertices of S consist of the union of the vertices of the two Voronoi
diagrams together with the points at which two edges, one from each diagram, intersect each other.
C1
C2
(a) Prove that the center of the optimum concentric circles cannot lie in the interior of any face of S.
(b) Prove that the center of the optimum concentric circles cannot lie in the relative interior of any edge of S.
(c) Using (a) and (b), give an O(k + n log n)-time algorithm for solving this problem, where k is the number
of vertices of S. (Assume NVD(P) and FVD(P) can be computed in O(n log n) time.)
(d) Show that the problem can be solved in O(n) time by using the fact that linear programming with
O(n) constraints and a constant number of variables can be solved in O(n) time.
12.
Determining whether a general graph has a spanning tree of degree at most three is NP-complete.
In this problem, we consider this problem for planar triangulations. Given a connected graph G = (V,E),
a spanning subgraph of G is any graph G’= (V,E’) with E’ E. A spanning tree is a connected acyclic
spanning subgraph of G. Recall that a triangulation of a point set V is a PSLG whose vertex set is V,
whose external face consists of the edges of the convex hull of V , and whose internal faces are triangles.
Prove that any triangulation of a set of points in the plane (viewed as a planar graph) has a spanning
tree of degree at most three. See Fig. (a).
(a)
(b)
[Hint: First prove the following by induction on the number of vertices. Consider any PSLG triangulation
whose external face is homeomorphic to a circle. Such a graph is characterized by three conditions: its
internal faces are triangles, there are at least three vertices on its external face, and every vertex on its
external face has exactly two neighbors on the external face. Prove that such a PSLG has a connected
spanning subgraph of degree at most three such that every edge of the external face is in that subgraph.
See Fig. (b).]
13.
The Delaunay triangulation has an interesting monotonicity property with respect to ray shooting. To
illustrate it, let us consider a triangulation T spanning a set P of n points in the plane. Let p be an
arbitrary point in the plane. For any triangles ti and tj in T, we write ti <p tj if there exists a ray starting at
p such that a traveller traversing along the ray from p passes through ti before tj (see Figure (a) below).
If there is no cyclic sequence (t1 , t2 , ... , tk , t1 ) of triangles in T satisfying t1 <p t2 <p ... <p tk <p t1 ,
k  2, we say that T is monotone with respect to ray shooting at p. If T is monomtone with respect to ray
shooting at every point in the plane, we say T is ray-shoot monotone. Figure (b) below shows that not
every triangulation is ray-shoot monotone. In that example t1 <p t2 because of ray r1, t2 <p t3 because of
ray r2 , and t3 <p t1 because of ray r3. Thus, t1 <p t2 <p t3 <p t1 . Therefore, this triangulation is not
monotone with respect to ray shooting at point p, and hence it is not ray-shoot monotone.
Prove Delaunay triangulations are ray-shoot monotone. [Hint: use the lifting method.]
14.
Computing geometric properties of a union of spheres is important to many applications in bioinformatics.
The following problem is a 2-dimensional simplification of one of these problems.
(a) You are given a set P of atoms representing a protein, which for our purposes will be represented by a
collection of circles in the plane, all of equal radius ra . Such a protein lives in a solution of water. We will
model a molecule of water by a circle of radius rb > ra . A water molecule cannot intersect the interior of
any protein atom, but it can be tangent to one. We say that an atom a P is solvent-accessible if there
exists a placement of a water molecule that is tangent to a, and the water molecule does not intersect any
other atoms in P. In the figure below, all atoms are solvent-accessible except for three (as indicated).
Given a protein molecule P of n atoms, devise an O(n log n) time algorithm to determine all solventinaccessible molecules of P.
(b) Solve the problem when atoms in P are of non-uniform size, i.e., they are circles of varying radii.
15.
Kinetic Delaunay Triangulation: We are given a set P = {p1 , ... , pn} of n stationary points and a
moving point p0, all in the plane. Point p0 moves on a line trajectory with a given constant speed, i.e., at
time t, this point is at location p0(t) = a  t  b, where a and b are given 2-vectors. Assume P is in general
position (i.e., no three points collinear and no four points cocircular), and the trajectory line of p0 does not
hit P. Consider the kinetic set Qt = P  {p0(t)} and its time varying Delaunay Triangulation DT(Qt ). We
want to preprocess Qt into a compact data structure so that for any given query time t, we can efficiently
extract DT(Qt ) from it.
(a) Derive a bound on the combinatorial size of changes in DT(Qt ) as t goes from - to .
(b) Design and analyze the preprocessing and query answering algorithms and the data structure.
16.
Relative Neighborhood Graph: Suppose we are given the Delaunay Triangulation DT(P) of a set P
of n points, in general position, in the plane. We know that a Delaunay edge e is in RNG iff lune(e) is
empty. Consider a Delaunay edge e that is not in RNG. Then, there must be some point pP (distinct
from two ends of e) such that plune(e). We say such a site p kills edge e.
(a) Show that if a Delaunay edge e is killed by a site p, then there is a sequence of one or more Delaunay
edges (e1, e2, … , ek), all killed by p, e = ek , (p, e1) is a Delaunay triangle, and for i = 1..k-1, ei and ei+1
are two edges of a (common) Delaunay triangle.
(b) Start with the Delaunay triangulation and assume its edges are coloured blue. Consider a triangle
incident to site p whose opposite side is a blue edge e killed by p. Update the triangulation by an
edge-flip that (permanently) removes blue edge e and adds a new red edge incident to p. Is it possible
to remove all Delaunay edges killed by p with repeated application of such an edge-flipping process?
(c) Can we make the blue edge removals in part (b) permanent, while we continue applying the same
process, restarting with different sites p? In other words, is it true that after the process in part (b)
is sequentially applied to all sites p, the surviving blue edges form the RNG?
(d) Show that given DT(P), RNG(P) can be computed in O(n) time.
(e) What is the computational complexity of the Weighted RNG (WRNG)?
END
Download