geometric algorithms - faculteit wiskunde en...
TRANSCRIPT
Terrain Modeling
heightmeasurementsp = (xp, yp, zp)
projectionπ(p) = (px, py, 0)
Interpolation: triangulate & interpolate
Terrain Modeling
heightmeasurementsp = (xp, yp, zp)
projectionπ(p) = (px, py, 0)
Interpolation: triangulate & interpolate within triangles
Terrain Modeling
heightmeasurementsp = (xp, yp, zp)
projectionπ(p) = (px, py, 0)
Interpolation: triangulate & interpolate within triangles
What is a ‘good’ triangulation?
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.:
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
CH(P )
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
CH(P )
Thm 1: Let P be a set of n non-collinear points and let h bethe number of vertices of CH(P ).
Then every triangulation of P has t(n, h) triangles ande(n, h) edges.
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
CH(P )
Thm 1: Let P be a set of n non-collinear points and let h bethe number of vertices of CH(P ).
Then every triangulation of P has t(n, h) triangles ande(n, h) edges.
Compute t and e!
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
CH(P )
Thm 1: Let P be a set of n non-collinear points and let h bethe number of vertices of CH(P ).
Then every triangulation of P has t(n, h) triangles ande(n, h) edges.
Compute t and e!
Euler’s formula for connected plane graphs:# faces−# edges + # vertices = 2,also counting the outer face.
Triangulation of a Point Set
Def.: A triangulation of a point set P ⊂ R2 is a maximalplanar subdivision with vertex set P .
Obs.: • all inner faces are triangles
• outer face is complement of convex hull
CH(P )
Thm 1: Let P be a set of n non-collinear points and let h bethe number of vertices of CH(P ).
Then every triangulation of P has (2n− 2− h)triangles and (3n− 3− h) edges.
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
Lets look at the interpolation along an edge:
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
Lets look at the interpolation along an edge:
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
Lets look at the interpolation along an edge:
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
height 985 height 23
Lets look at the interpolation along an edge:
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
height 985 height 23
intuition: avoid ‘thin’ triangles!
Lets look at the interpolation along an edge:
Back to Height Interpolation
0
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
190
10
6
20
36
28
1240
1000
980
990
1008
890
0
4 23
19
height 985 height 23
intuition: avoid ‘thin’ triangles!
or: maximize the smallest angle within triangles!
Lets look at the interpolation along an edge:
Angle-Optimal Triangulations
Def.:
T A(T ) = (60◦, 60◦, 60◦, 60◦, 60◦, 60◦)
Let T be a triangulation of P with m triangles and 3mvertices. Its angle vector is A(T ) = (α1, . . . , α3m)where α1, . . . , α3m are the angles of T sorted byincreasing value.
Angle-Optimal Triangulations
Def.:
T A(T ) = (60◦, 60◦, 60◦, 60◦, 60◦, 60◦) T ′
A(T ′) = (30◦, 30◦, 30◦, 30◦, 120◦, 120◦)
Let T be a triangulation of P with m triangles and 3mvertices. Its angle vector is A(T ) = (α1, . . . , α3m)where α1, . . . , α3m are the angles of T sorted byincreasing value.
For two triangulations T and T ′ of P define orderA(T ) > A(T ′) as the lexicographical order.
Angle-Optimal Triangulations
Def.:
T A(T ) = (60◦, 60◦, 60◦, 60◦, 60◦, 60◦) T ′
A(T ′) = (30◦, 30◦, 30◦, 30◦, 120◦, 120◦)
Let T be a triangulation of P with m triangles and 3mvertices. Its angle vector is A(T ) = (α1, . . . , α3m)where α1, . . . , α3m are the angles of T sorted byincreasing value.
For two triangulations T and T ′ of P define orderA(T ) > A(T ′) as the lexicographical order.
T is angle optimal, if A(T ) ≥ A(T ′) for alltriangulations T ′ of P .
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
eT
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
mini αi = 30◦
eT
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
mini αi = 30◦
eT
flip(T , e)
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
mini αi = 30◦
eT ′ T
flip(T , e)e′
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
mini αi = 30◦mini αi = 60◦
eT ′ T
flip(T , e)e′
Edge Flips
Def.: Let T be a triangulation.An edge e of T is illegal,if thesmallest angle of the triangles incident to e can beincreased by flipping e.
mini αi = 30◦mini αi = 60◦
e
Obs.: Let e be an illegal edge in T and let T ′ = flip(T , e).Then A(T ′) > A(T ).
T ′ Tflip(T , e)
e′
Thales Theorem
a
Thm 2: if ab is a diameter, then the angle atany third point on the circle c is 90◦.
b
Thales Theorem
a
Thm 2: if ab is a diameter, then the angle atany third point on the circle c is 90◦.
bThm 2′: Let C be a circle, ` a line intersecting C in points a
and b, and p, q, r, s points lying on the same side of `.Suppose that p, q lie on C, r lies inside C, and s liesoutside C. Then ]arb > ]apb = ]aqb > ]asb,where ]abc denotes the smaller angle defined bythree points a, b, c.
ab
c c′e
d
∠aeb < ∠acb = ∠ac′b < ∠adb
c
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
proof sketch:
p
q
r
s C
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
proof sketch:
p
q
r
s
ϕpr
ϕps
ϕrq
ϕsq
θpr
θpsθrq
θsq
ϕpr > θpr
ϕps > θps
ϕrq > θrq
ϕsq > θsq
C
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
proof sketch:
p
q
r
s
ϕpr
ϕps
ϕrq
ϕsq
θpr
θpsθrq
θsq
ϕpr > θpr
ϕps > θps
ϕrq > θrq
ϕsq > θsqϕp
ϕq
ϕp = θrq + θsq
ϕq = θpr + θps
C
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
Def.: A triangulation without illegal edges is called legaltriangulation
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
Def.: A triangulation without illegal edges is called legaltriangulation
Are there legal triangulations?
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
Def.: A triangulation without illegal edges is called legaltriangulation
while T has illegal edge e doflip(T , e)
return T
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
Def.: A triangulation without illegal edges is called legaltriangulation
while T has illegal edge e doflip(T , e)
return Tterminates?
Legal Triangulations
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in Tand C the circumcircle of ∆prq. Then:
pq illegal ⇔ s ∈ int(C).If p, q, r, s form a convex quadrilateral and s 6∈ ∂C,then either pq or rs is illegal.
Def.: A triangulation without illegal edges is called legaltriangulation
while T has illegal edge e doflip(T , e)
return Tterminates, since A(T ) increases and#triangulations finite
Are we stuck?
We know: Every angle-optimal triangulation is legal.
But is every legal triangulation angle-optimal?
Motivation
?
It is a beautiful sunny day. You know where all of the locationsof ice cream parlors in town and would like to know which oneis closest. How can we determine the closest ice cream parlorfor every point on the map?
Motivation
?
It is a beautiful sunny day. You know where all of the locationsof ice cream parlors in town and would like to know which oneis closest. How can we determine the closest ice cream parlorfor every point on the map?
Motivation
?
It is a beautiful sunny day. You know where all of the locationsof ice cream parlors in town and would like to know which oneis closest. How can we determine the closest ice cream parlorfor every point on the map?
!
Motivation
?
It is a beautiful sunny day. You know where all of the locationsof ice cream parlors in town and would like to know which oneis closest. How can we determine the closest ice cream parlorfor every point on the map?
!
The solution is a subdivision of the plane, called Voronoidiagram.It has many applications, e.g., in geography, physics, robotics
Voronoi Diagrams
Definition: The Voronoi diagram of n points {p1, . . . , pn} in the plane isthe subdivision of the plane into n cells, such that a point q is in the cellof pi if and only if dist(q, pi) < dist(q, pj) for all i6=j.
Voronoi Diagrams
long history• Descartes 1644• Dirichlet 1850• Voronoi 1907
Definition: The Voronoi diagram of n points {p1, . . . , pn} in the plane isthe subdivision of the plane into n cells, such that a point q is in the cellof pi if and only if dist(q, pi) < dist(q, pj) for all i6=j.
Voronoi Diagrams
p
q
b(p, q)
h(p, q)
= {x ∈ R2 : |xp| = |xq|}
= {x : |xp| < |xq|}
bisector of p and q
open half plane
for 2 points
Voronoi Diagrams
p
q
b(p, q)
h(p, q) h(q, p)
= {x ∈ R2 : |xp| = |xq|}
= {x : |xp| < |xq|} = {x : |xq| < |xp|}
bisector of p and q
open half plane open half plane
for 2 points
Voronoi Diagrams
Questions: 1) What are Voronoi cells, edges and vertices?
2) Are Voronoi cells convex?
Voronoi Diagrams
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )Voronoi diagramp
p′
p′′
Voronoi Diagrams
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )Voronoi diagramp
p′
p′′
Voronoi Diagrams
V({p}) =
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )Voronoi diagram
• Voronoi cell
p
p′
p′′
Voronoi Diagrams
V({p}) =
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )Voronoi diagram
• Voronoi cell
p
p′
p′′
=V(p)
Voronoi Diagrams
V({p}) =
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}Voronoi diagram
• Voronoi cell
p
p′
p′′
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}Voronoi diagram
• Voronoi cell
p
p′
p′′
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}Voronoi diagram
• Voronoi cell
p
p′
p′′
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})∂V(p) ∩ ∂V(p′)=
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})∂V(p) ∩ ∂V(p′)= rel-int( )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=
i.e. without endpoints,
V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})∂V(p) ∩ ∂V(p′)= rel-int( )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=
i.e. without endpoints,
V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})∂V(p) ∩ ∂V(p′)= rel-int( )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}
• Voronoi vertexV({p, p′, p′′})
• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=
i.e. without endpoints,
V(p)
Voronoi Diagrams
V({p}) =
=⋂
q 6=p h(p, q)
Let P be a set of points in th plane and p, p′, p′′ ∈ P .
Vor(P )
V({p, p′})∂V(p) ∩ ∂V(p′)= rel-int( )
{x ∈ R2 : |xp| < |xq| ∀q ∈ P \ {p}
}
{x : |xp| = |xp′| and |xp| < |xq| ∀q 6= p, p′}
• Voronoi vertex= ∂V(p) ∩ ∂V(p′) ∩ ∂V(p′′)V({p, p′, p′′})
• Voronoi edge
Voronoi diagram
• Voronoi cell
p
p′
p′′
=
=
i.e. without endpoints,
V(p)
Characterization
Definition: Let q be a point. Define CP (q) as the largest diskwith center q containing no points of P in itsinterior.
q
Characterization
Definition: Let q be a point. Define CP (q) as the largest diskwith center q containing no points of P in itsinterior.
q
CP (q)
Characterization
Definition: Let q be a point. Define CP (q) as the largest diskwith center q containing no points of P in itsinterior.
q
CP (q)
Obs.: • A point q is a Voronoi vertex⇔ |CP (q) ∩ P | ≥ 3,• the bisector b(pi, pj) defines a Voronoi edge⇔∃q ∈ b(pi, pj) with CP (q) ∩ P = {pi, pj}.
Delaunay Triangulation
Def.: The graph G = (P,E) withE = {pq | V(p) und V(q) are adjacent}is called the dual graph of Vor(P ).
Let Vor(P ) be the Voronoi diagram of P .
Delaunay Triangulation
Def.: The graph G = (P,E) withE = {pq | V(p) und V(q) are adjacent}is called the dual graph of Vor(P ).
Let Vor(P ) be the Voronoi diagram of P .
G
Delaunay Triangulation
Def.: The graph G = (P,E) withE = {pq | V(p) und V(q) are adjacent}is called the dual graph of Vor(P ).
Let Vor(P ) be the Voronoi diagram of P .
Def.: The straight-line drawing of G is called Delaunay graphDG(P ).
DG(P )
Properties
Thm 3: DG(P ) has no crossing edges.
proof sketch:the bisector b(p, q) defines a Voronoi edge⇔∃r ∈ b(p, q) with CP (r) ∩ P = {p, q}.
the edge pq is inDG(P )⇔ there is an empty circle Cp,q with p and q on its boundary.
i.e.
C i j
pi
p j
in V ( pi)
in V ( p j)
pk
pl
⇒ pq can’t intersect another edge
Suppose pipj is crossed by pkpl. Every circlewith pk, pl has to contain either pi or pj .Contradiction.
Properties
Thm 3: DG(P ) has no crossing edges.
proof sketch:the bisector b(p, q) defines a Voronoi edge⇔∃r ∈ b(p, q) with CP (r) ∩ P = {p, q}.
the edge pq is inDG(P )⇔ there is an empty circle Cp,q with p and q on its boundary.
i.e.
Obs.: A voronoi vertex v in Vor(P ) of degree k correspondsto a convex k-gon inDG(P ).
Properties
Thm 3: DG(P ) has no crossing edges.
proof sketch:the bisector b(p, q) defines a Voronoi edge⇔∃r ∈ b(p, q) with CP (r) ∩ P = {p, q}.
the edge pq is inDG(P )⇔ there is an empty circle Cp,q with p and q on its boundary.
i.e.
Obs.: A voronoi vertex v in Vor(P ) of degree k correspondsto a convex k-gon inDG(P ).
If P is in general position (no 4 points ona circle), then all (inner) faces ofDG(P )are triangles.
Properties
Thm 3: DG(P ) has no crossing edges.
proof sketch:the bisector b(p, q) defines a Voronoi edge⇔∃r ∈ b(p, q) with CP (r) ∩ P = {p, q}.
the edge pq is inDG(P )⇔ there is an empty circle Cp,q with p and q on its boundary.
i.e.
Obs.: A voronoi vertex v in Vor(P ) of degree k correspondsto a convex k-gon inDG(P ).
If P is in general position (no 4 points ona circle), then all (inner) faces ofDG(P )are triangles.
A triangulation ofDG(P ) is called Delaunay triangulation.
Empty-Circle Property
Theorem about Voronoi diagrams:• a point q is a Voronoi vertex⇔ |CP (q) ∩ P | ≥ 3,• the bisector b(pi, pj) defines a Voronoi edge⇔∃q ∈ b(pi, pj) with CP (q) ∩ P = {pi, pj}.
Empty-Circle Property
Theorem about Voronoi diagrams:• a point q is a Voronoi vertex⇔ |CP (q) ∩ P | ≥ 3,• the bisector b(pi, pj) defines a Voronoi edge⇔∃q ∈ b(pi, pj) with CP (q) ∩ P = {pi, pj}.
Thm 4: Let P be a set of points.• points p, q, r are vertices of the same face inDG(P )⇔
circle through p, q, r is empty• edge pq is inDG(P )⇔ there is an empty circle Cp,q through p and q
Empty-Circle Property
Theorem about Voronoi diagrams:• a point q is a Voronoi vertex⇔ |CP (q) ∩ P | ≥ 3,• the bisector b(pi, pj) defines a Voronoi edge⇔∃q ∈ b(pi, pj) with CP (q) ∩ P = {pi, pj}.
Thm 4: Let P be a set of points.• points p, q, r are vertices of the same face inDG(P )⇔
circle through p, q, r is empty• edge pq is inDG(P )⇔ there is an empty circle Cp,q through p and q
Corollary: Let P be a set of points and T a triangulation of P . Tis a Delaunay triangulation⇔ circumcircle of every triangle is empty.
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
proof sketch:
"‘⇐"’ obvious, use
Lemma 1: Let ∆prq and ∆pqs be two adjacent triangles in T and C thecircumcircle of ∆prq. Then: pq illegal ⇔ s ∈ int(C).
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
proof sketch:
p
q
r
s
"‘⇒"’
• suppose s in the interior of circle of pqr• let pr be the edge maximizing ∠psr
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
t
proof sketch:
p
q
r
s
"‘⇒"’
• suppose s in the interior of circle of pqr• let pr be the edge maximizing ∠psr
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
t
proof sketch:
p
q
r
s
"‘⇒"’
• suppose s in the interior of circle of pqr• let pr be the edge maximizing ∠psr
• consider t adjacent to p and r• s also lies in the circle of prt
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
t
proof sketch:
p
q
r
s
"‘⇒"’
• suppose s in the interior of circle of pqr• let pr be the edge maximizing ∠psr
• consider t adjacent to p and r• s also lies in the circle of prt
Thales theorem: ∠tsr > ∠psrContradiction to choice of pr
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
Obs.: If P is in general position, then the Delaunaytriangulation of P is unique.
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
Obs.: If P is in general position, then the Delaunaytriangulation of P is unique.⇒ legal triangulation unique
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
Obs.: If P is in general position, then the Delaunaytriangulation of P is unique.⇒ legal triangulation uniquewe know: T angle optimal⇒T legal
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
Obs.: If P is in general position, then the Delaunaytriangulation of P is unique.⇒ legal triangulation uniquewe know: T angle optimal⇒T legal⇒ angle-optimal triangulation isDG(P )!
Legal vs Delaunay
Thm 5: Let P be a set of points in R2. A triangulation T of Pis legal if and only if T is a Delaunay triangulation.
Obs.: If P is in general position, then the Delaunaytriangulation of P is unique.⇒ legal triangulation uniquewe know: T angle optimal⇒T legal⇒ angle-optimal triangulation isDG(P )!
Is P not in general position, then the smallest anglein every triangulation of the "‘large"’ faces inDG(P )is the same.(proof uses Thales theorem)
Randomized Incremental Construction
DelaunayTriangulation(P )Initialize T as a large triangle ∆(p0, p−1, p−2) containing all
points from PCompute a random permutation of p1, . . . , pnfor r ← 1 to n do
Insert(pr, T )
Discard p0, p−1 and p−2 with all their incident edgesreturn T
Pp−1 p−2
p0
Randomized Incremental Construction
Insert(pr, T )Find triangle T containing prif pr lies in triangle pipjpk then
add edges from pr to pi, pj , pkLegalizeEdge(pr, pipj , T )LegalizeEdge(pr, pjpk, T )LegalizeEdge(pr, pkpi, T )
elseadd edges from pr to pl, pkLegalizeEdge(pr, pipl, T )LegalizeEdge(pr, plpj , T )LegalizeEdge(pr, pjpk, T )LegalizeEdge(pr, pkpi, T )
// pr lies of edge pipj
pi
pr
pk
pj
pi
pl pkpr
pj
Randomized Incremental Construction
LegalizeEdge(pr, pipj , T )if pipj is illegal then
let pipjph be the adjacent trianglereplace pipj by prphLegalizeEdge(pr, pjph, T )LegalizeEdge(pr, phpi, T )
// Edge flip ph
pj
pi
pr
Correctness
1. All edges inserted are legal• All edges inserted are adjacent to pr.
• All edges inserted are Delaunay edges.
pr pr
pj
pipr
pl
Correctness
1. All edges inserted are legal
2. All other edges are legalfollows from Lemma 1: an edge can only be illegal if it is incident to anew triangle.
• All edges inserted are adjacent to pr.
• All edges inserted are Delaunay edges.
pr pr
pj
pipr
pl
Initialization
Choose p0, p−1, p−2 far enough away from P , such that theylie in none of the circles of P and such that P lies in theirtriangle.
Pp−1 p−2
p0
Initialization
better:Treat p0, p−1, p−2 symbolically by modifying tests/predicatesused for point location and testing illegal edges.
Pp−1 p−2
p0
Search Structure
build search structure for point location:directed acyclic graph with• leaves: current triangles• inner nodes: deleted triangles
∆1
∆2
∆3
∆1 ∆2 ∆3
Search Structure
build search structure for point location:directed acyclic graph with• leaves: current triangles• inner nodes: deleted triangles
∆1
∆2
∆3
∆1 ∆2 ∆3
split
pr
pi
p j
∆2
∆3
∆1
∆1 ∆2 ∆3
Search Structure
build search structure for point location:directed acyclic graph with• leaves: current triangles• inner nodes: deleted triangles
∆1
∆2
∆3
∆1 ∆2 ∆3
split
pr
pi
p j
∆2
∆3
∆1
∆1 ∆2 ∆3
flip pi p j
pi
pk
∆4∆5
∆5∆4
∆1 ∆2 ∆3
Search Structure
build search structure for point location:directed acyclic graph with• leaves: current triangles• inner nodes: deleted triangles
∆1
∆2
∆3
∆1 ∆2 ∆3
split
pr
pi
p j
∆2
∆3
∆1
∆1 ∆2 ∆3
flip pi p j
pi
pk
∆4∆5
∆5∆4
∆1 ∆2 ∆3
flip pi pk
∆6
∆7
∆7∆6
∆5∆4
∆1 ∆2 ∆3
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
How many triangles are created when pr is inserted?proof:
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
How many triangles are created when pr is inserted?proof:
• Every point in p1, . . . , pr has the same probability 1/r to be the lastpoint.
backwards analysis:
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
How many triangles are created when pr is inserted?proof:
• Every point in p1, . . . , pr has the same probability 1/r to be the lastpoint.
backwards analysis:
• expected degree of pr is≤ 6
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
How many triangles are created when pr is inserted?proof:
• Every point in p1, . . . , pr has the same probability 1/r to be the lastpoint.
backwards analysis:
• expected degree of pr is≤ 6• number of triangles created at pr is≤ 2(degree(pr))− 3
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
How many triangles are created when pr is inserted?proof:
• Every point in p1, . . . , pr has the same probability 1/r to be the lastpoint.
backwards analysis:
• expected degree of pr is≤ 6• number of triangles created at pr is≤ 2(degree(pr))− 3
• overall≤ 2 ∗ 6− 3 = 9; plus 1 for the outer triangle
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
Lemma: The expected number of triangles which are visited inthe search structure during the construction is O(n log n).proof in the book.
Analysis
Lemma: The expected number of triangles created is at most9n+ 1 = O(n).
Lemma: The expected number of triangles which are visited inthe search structure during the construction is O(n log n).
Theorem: The Delaunay triangulation of n points can becomputed in O(n log n) expected time using randomizedincremental construction.