13 Two Algorithms Delauney
13 Two Algorithms Delauney
3, 1980
1. I N T R O D U C T I O N
1 This work was supported in part by the National Science Foundation under grant
MCS-76-17321 and the Joint Services Electronics Program under contract DAAB-0772-0259.
2 Northwestern University Dept. of Electrical Engineering and Computer Science, Evanston,
Illinois 60201.
a General Electric Co., P.O. Box 2500, Daytona Beach, Florida 32015.
219
0091-703618010600-0219503.0010 9 1980 Plenum Publishing Corporation
220
DELAUNAY
Suppose that we are given a set V = {v~ ..... VN}, N >/3, of points in
the Euclidean plane. Assume that these points are not all colinear, and
that no four points are cocircular. Let d(v,, v~) denote the Euclidean distance
between points v~ and vs. The region V(i) = {x ~ E2 l d(x, v,) <~ d(x, vj),
j = 1,..., N} which is the locus of points closer to vertex v~ than to any
other vertex is called the Voronoi ~87~(or Dirichlet, Wigner-Seithz, Thiessen, ~a6~
or "S ''124~) polygon associated with the vertex v~.
Voronoi polygons may be thought of as the cells of a growth process.
Suppose that we let each vertex in V be the nucleus of a growing cell. Cells
will propagate outward from their nuclei, simultaneously and at a uniform
rate. The border of a growing cell will freeze in place at its points of contact
with the border of another growing cell.
Eventually, only the cells whose nuclei are on the convex hull of V are
still expanding. The remaining cells have completely partitioned (or tessellated) a region of the plane into a set of nonoverlapping closed convex polygons,
one polygon about each nucleus. These closed polygons, together with the
open polygons on the convex hull, define a Voronoi tessellation of the entire
plane.
Let us take a closer look at this process. Since all cells expand at the
same rate, the first point of contact between two cells must occur at the
midpoint between their nuclei. Likewise, every point of continuing contact
must be equidistant from the two nuclei. These points are on the common
edge (called a Voronoi edge) of two developing Voronoi polygons. This
Delaunay Triangulation
22t
\i
/
,,
222
Proof
C o r o l l a r y 1. Given a set V = (va ..... VN} of points, the edge (v~, vj)
on the boundary of the convex hull of V is a Delaunay edge.
L e m m a 3. Given a set V = {vl, ..., UN} of points, Av~vjv~ is a Delaunay
triangle of DT(V) if and only if its circumcircle does not contain any other
point of V in its interior.
The proofs of these lemmas can be found in Refs 12 and 32. The latter
property is called the circle criterion. It is often used as a rule for constructing
a triangulation. Triangulations may also be constructed according to the
MAX-MIN angle criterion, i.e., the minimum measure of angles of all the
triangles in the triangulation is maximized. We shall investigate the relationship between these two criteria.
The following analysis follows that given by Lawson c9,1~ (see also the
work of Sibson1331). Consider a very simple triangulation, that over the
vertices of a strictly convex quadrilateral. A quadrilateral is called strictly
convex if its four interior angles are each less than 180 ~ A quadrilateral
can be partitioned into two triangles in two possible ways. Each of the
criteria described above can be thought of as a rule for choosing a preferred
triangulation.
By examining the case of four cocircular points (Fig. 2), one can show
that the two criteria are equivalent. Suppose that for this example line
segment (vi, v~) is shorter than (v3, v~), (v4, vz), and (Vl, v~). Let the angular
measure of the arc v~, v3 be 20. Then the angles/_v3, vl, v2 and / v 3 , v4, v2
are each 0. Thus the two possible triangulations over the four points have
the same minimum angle. The choice of a preferred triangulation is then
arbitrary according to the M A X - M I N angle criterion. The Voronoi tessellation of the quadrilateral also exhibits a tie case. All four Voronoi polygons
meet at a single point.
Further analysis shows that moving one point, say point v~ in Fig. 2,
inside the circle causes /_v3, v4, v~ to increase and points v2 and v~ to be the
growth centers of Voronoi neighbors. Consequently, the two criteria and
the Voronoi tessellation of the polygon all now prescribe the connection of
vertices v2 and v~.
223
v~
Fig. 2. Lawson's example showing
a triangulation over four cocircular
points. The Voronoi tessellation is
shown as dashed lines.
A fourth criterion has been studied, that of choosing the minimum length
diagonal. Shamos and Hoey 1~2~ claim that a Delaunay triangulation is a
minimum edge length triangulation. Lawson ~9) and Lloyd ~1~1 prove by
counterexample that this is not the case (Fig. 3).
Lawson a~ gives the following local optimization procedure (LOP)
for constructing a triangulation. Let e be an internal edge (in contrast to an
edge on the convex hull) of a triangulation and Q be the quadrilateral formed
by the two triangles having e as their common edge. Consider the circumcircle of one of the triangles. This circle passes through three vertices of Q.
I f the fourth vertex of the quadrilateral is within the circle, replace e by the
other diagonal of Q, otherwise no action is taken. An edge of the triangulation is said to be locally optimal if an application of the LOP would not
swap it. Since for any set of vertices, the number of triangles in any triangulation is a constant, a linear ordering over the set of all triangles can be defined
as follows. To each triangle in the triangulation we assign a value, which is
14
224
the measure of its minimum angle. Let Nt denote the number of triangles.
For each triangulation we have an indicator vector of N~ components, each
component corresponding to the minimum angle of its corresponding
triangle. Triangles are sorted in nondecreasing order. Given any two triangulations T and T', define T < T' if and only if the associated indicator
vector of T is Iexicographically less than that of T'.
T h e o r e m 1r
Given a triangulation T, if an application of the
LOP to an edge e results in a swapping of the edge with any other edge e',
thus producing a new triangulation T', then T < T'; i.e., T' strictly follows
T in the linear ordering defined above.
225
8~8/9/3-s
226
THE
DELAUNAY
We will present two algorithms for constructing a Delaunay triangulation. The first is rather involved, but its running time is asymptotically
optimal. The second algorithm is simpler to understand, is simpler to
program, and requires less overhead. These features make it especially
attractive for small and medium-sized data sets (~'500 points or less).
The first algorithm is comparable to the one given by Lewis and
Robinson aS~ in that it divides the original data set into disjoint subsets.
After obtaining a solution for each of these subsets, it combines solutions
to yield the final result. Lewis and Robinson ~15~claim, without proof, that
their algorithm runs in O(N log N). But in fact, 6 the running time of their
algorithm is O(N~). The second algorithm that we will present is iterative.
It follows the idea proposed by Lawson. (9~ Nelson ~231gives a similar method.
3.1. Divide-and-Conquer
Shamos and Hoey ~2~ present an O(N log N) algorithm for constructing
the Voronoi diagram for a set of N points in the plane. Green and Sibson ~7~
also implement an algorithm for this purpose, but the running time is O(N 2)
in the worst case. Lee aSI modifies the procedure given by Shamos and Hoey
and extends the method to any L~ metric, 1 ~< p ~ oo.
Once the Voronoi diagram is obtained, its dual graph (i.e., the Delaunay
triangulation) can be constructed in an additional O(N) time. To eliminate
the need for a two-step procedure, we have developed the following algorithm
which constructs a triangulation directly. The running time of the algorithm
is shown to be O(N log N). Shamos and Hoey la~ show that the construction
of any triangulation over N points requires s
N) time. Thus, our
algorithm is asymptotically optimal.
We will begin by describing the data structures and notation to be used
in the sequel. For each point vi, we keep an ordered adjacency list of points
vii .... , vi~, where (Ui, V i s ) , j = 1,..., k, is a Delaunay edge. The list is
doubly linked and circular. PRED(vi, v~j) denotes the point vi~ which
6 There are at least four triangulation algorithms in the computer literature which claim
to be O(N log N), but which are in fact O(N2). A counterexample for several of these is
given in Appendix A.
227
v;
Fig. 5. Example illustrating a
doubly linked circular list.
appears clockwise (CW) of and immediately after the point vii 9The counterclockwise function SUCC operates in a similar manner. For example in
Fig. 5, v5 ~ PRED(vl , v6) and v5 = SUCC(vz , v4).
If the point vi is on the convex hull CH(V), then the first entry on its
adjacency list is the point denoted FIRST(vi), which appears after v~- if we
traverse the boundary of CH(V) in a CCW direction. Let l(vl, vj) denote the
line segment directed from vi to vj.
N o w we are ready to construct the Delaunay triangulation. First, we
sort the given set V of N points in lexicographically ascending order and
rename the indices so that vI < v~ < --- < VN, such that (x,:, yi) = v~ < vj
if and only if either x~ < x~- or x~ = xj and Yi < Yj 9 Next we divide V into
two subsets VI. and VR, such that VL = {Vl, ..., VtN/~J}and Va = {VLN/23+I,...,
VN}. Now we recursively construct the Delaunay triangulations DT(VL)
and DT(VR). To merge DT(VL) and DT(VR) to form DT(VLUVR), we make
use of the convex hull CH(VLUVR). The convex hull can be obtained in
O(N) time Cz61 from the union of the convex hulls CH(VL) and CH(VR).
The convex hulls can also be computed recursively. Forming the union of
CH(Vt.) and CH(VR) will result in two new hull edges which are the lower
and upper common tangents of CH(VL) and CH(VR). These two common
tangents are known to be in the final Delaunay triangulation.
The following subroutine finds the lower common tangent of CH(VL)
and CH(VR). For each convex hull CH(S), we maintain two points LM(S)
and RM(S), which are the leftmost and rightmost points of S, respectively.
Subroutine H U L L
(Comment: H U L L is input two convex hulls. It finds their lower common
tangent (Fig. 6). The upper common tangent can be found in an analogous
manner.)
828/9/3-5*
228
"
lower common t a n g e n t
Fig. 6. Illustration o f the
u p p e r a n d lower c o m m o n
(Comment:I(X, Y)
s u c c ( z , Y)
Y~--Z
ELSE
IF (Z" is-right-of I(X, Y)
Subroutine MERGE
229
the right endpoint (in Va) of the lower common tangent to a point
adjacent to the left endpoint (in VI.) of the lower common tangent.
The above process is repeated with the newly found edge taking the place
of the lower common tangent, and each succeeding new edge taking the place
of that. The subroutine continues in this manner until the upper common
tangent is reached.)
230
step 9:
step
step
step
step
10:
11 :
I2:
13:
step 14:
step 15:
step 16:
step 17:
step 18:
step 19:
step 20:
step 21 :
step 22:
step 23:
step 24:
ELSE
A +-- TRUE
ENDIF
Lz +-- SUCC(L, R)
IF (LI is-right-of I(R, L)
L 2 +-- SUCC(L, Lz)
DO UNTIL (QTEST(L, R, Lx, L2))
DELETE (L, L1)
LI +- L 2
L 2 +-- SUCC(L, L1)
END DO UNTIL
ELSE
B +-- TRUE
ENDIF
IF (A)
L.+-- Lz
ELSE
IF (B)
R+--R1
ELSE
IF (QTEST(L, R, R~, Lz))
R~--'R1
ELSE
L +--La
ENDIF
ENDIF
ENDIF
B T +- l(L, R)
END DO UNTIL
END MERGE
Delaunay Triangulation
23i
I KL
kt
Lz
Lt
~
\
(a)
Fig, 7.
(b)
/I
'
-~"
V~
IHustration for the merge process. Bold fines are new De]aunay edges introduced
by the MERGE algorithm.
where M represents the time required for the merge process. Since
M(N/2, N/2) = O(N), t(N) = O(N log N).
232
3.2. Iteration
Algorithm TRIBUILD
INITIALIZATION
-)
J
Fig. 8. Two possible bin ordering schemes.
233
ITERATION
Ii ""
\\
/I
\\
\\\
\\
(a)
/Y
(b)
(c)
(e)
(f)
\
(d)
/
\
(g)
234
M A X - M I N angle criterion within the quadrilateral (i.e., use the LOP within
the quadrilateral).
step 3: Each swap performed in step 2 may result in two new quadrilaterals
that need to be tested. If one of these quadrilaterals doesn't satisfy the
M A X - M I N angle criterion, swap its diagonal with its alternate.
step 4: This swapping procedure may propagate further outward. Lawson (1~
has shown that this process will always terminate.
step 5: If all points in V have been used then stop, otherwise go to step 1.
END T R I B U I L D
235
AND
APPLICATIONS
a/a)
236
et al. (5)]
4.4. Terrain Fitting
237
5. D I S C U S S I O N
238
APPENDIX
A- AN EXAMPLE FOR WHICH
ITERATIVE
ALGORITHMS
W O R K I N O ( N 2) W O R S T CASE T I M E
Consider 10 points on the p a r a b o l a y = 89 ~. The points in the diagram
are n u m b e r e d in the order in which they are added to the existing set.
t/
J
io 9
Let S = {1, 2, ..., 9}.
DT(S) is
given below.
iJ
B
239
Now when point 10 is added, all the edges incident with point 9 are deleted.
The resultant triangulation is given below. Thus, in general the total work
involved in updating the triangulation is ~=4 (i -- 1) = O(N 2) in the worst
case.
A P P E N D I X B: D A T A STRUCTURE FOR A T R I A N G U L A R
NETWORK
The data structure used by the iterative algorithm will be described
by an example.
1
Vertex
2
3
4
5
1
!8.
31
31
31
17
31
1
240
Triangle
Neighboring triangles
(counterclockwise):
Vertices
(counterclockwise):
N(T, 1)
N(T, 2)
N(T, 3)
V(T, 1)
V(T, 2)
V(T, 3)
The following conventions are used: Triangles N(T, 1), N(T, 2), and T meet
at vertex V(T, 1). Zero denotes a null triangle.
ACKNOWLEDGMENTS
REFERENCES
1. J. Besag, "Spatial interaction and the statistical analysis of lattice systems," ar. Royal
Stat. Soc. B 36(2):192-236 (1974).
2. D. J. Bogue, "The Structure of the Metropolitan Community," University of Michigan
Contributions of the Institute of Human Adjustment Social Science, University of
Michigan, Ann Arbor, Michigan (1949).
3. B. Delaunay, "Sur la sph6re vide," Bull. Acad. Science USSR VII: Class. Sci. Mat.
Nat. 793-800 (1934).
4. H. Fuchs and Z. M. Kedem, "The Highly Intelligent Tablet as an Efficient Printing
Device for Interactive Graphics," University of Texas (Dallas) (1979). Program in
Math. Science (1979).
5. M. R. Garey, D. S. Johnson, F. P. Preparata, and R. E. Tarjan, "Triangulating a
simple polygon," Inform. Proc. Letters 7:175-179 (June 1978).
6. E. N. Gilbert, "Random subdivision of space into crystals," Ann. Math. Stat. 33:
958-972 (1962).
7. P. J. Green and R. Sibson, "Computing Dirichlet tesselations in the plane," Computer
J. 21(2):168-173 (July 1978).
8. T. KIANG,"Random fragmentation in two and three dimensions," Z. Astrophysik
64:433-439 (1966).
241
9. C. L. Lawson, "Generation of a Triangular Grid with Applications to Contour Plotting," Technical Memo. 299, Jet Propulsion Laboratory, Pasadena, California
(February 1972).
10. C. L. Lawson, "Software for C~ surface interpolation," in Mathematical Software
III, J. Rice, Ed. (Academic Press, New York, 1977).
11. D. T. Lee, "On Finding k-Nearest Neighbors in the Plane," Technical Report Eng.
76-2216, Coordinated Science Laboratory, University of Illinois, Urbana, Illinois
(1976).
t2. D. T. Lee, "Proximity and Reachabitity in the Plane," Ph.D. Thesis, Coordinated
Science Laboratory Report ACT-12, University of Illinois, Urbana, Illinois (1978).
13. D. T. Lee, "Two-dimensional Voronoi diagrams in the L~-metric," J. ACM(accepted
for publication).
14. D. T. Lee and C. K. Wong, "Voronoi diagrams in Lz (L~) metrics with two-dimensional storage applications," SIAM J. Computing (accepted for publication).
15. B. A. Lewis and J. S. Robinson, "Triangulation of planar regions with applications,"
Computer or. 2I(4):324-332 (Nov. 1978).
16. E. L. Lloyd, "On Triangulation of a Set of Points in the Plane," Technical Report
MIT/LCS/TM-88, Laboratory for Computer Science, Massachusetts Institute of
Technology, Cambridge, Massachusetts (May 1977).
17. P. E. Lloyd and P. Dicken, Location in Space: A Theoretical Approach to Economic
Geography (Harper and Row, New York, 1972).
18. B. Matern, "Spatial variation," Medd. Statens Skogsforskninginstit. 36(5):1-144
(1960).
19. D. H. McLain, "Two dimensional interpolation from random data," Computer J.
19(2):178-181 (1976); Errata, Computer J. 19(4):384 (1976).
20. R. E. Miles, "Solution to problem 67-15 (Probability distribution of a network of
triangles)," SIAM Rev. 11:399-402 (1969).
21. R. E. Miles, "On the homogeneous planar Poisson point-process," Math. Biosciences
6:85-127 (1970).
22. J. Molnar, "Packing of congruent spheres in a strip," Acta Math. Acad. Sciences
Hungarieae Jomus 31(1-2):173-183 (1978).
23. J. M. Nelson, "A triangulation algorithm for arbitrary planar domains," AppL Math.
Modelling 2:151-159 (September 1978).
24. E. C. Pielou, Mathematical Ecology (Wiley, New York, 1977).
25. M. J. D. Powell and M. A. Sabin, "Piecewise quadratic approximations on triangles,"
AC~/I Trans. Math. Software 3(4):316-325 (December 1977).
26. F. P. Preparata and S. J. Hong, "Convex hulls of finite sets of points in two and
three dimensions," Comm. ACM 20(2):87-93 (February 1977).
27. D. Rhynsburger, "Analytic delineation of Thiessen polygons," Geographical Analysis
5(2):133-144 (April 1973).
28. C. A. Rogers, Packing and Covering (Cambridge University Press, 1964).
29. B. Schachter, A. Rosenfeld, and L. S. Davis, "Random mosaic models for textures,"
1EEE Trans. Systems, Man, and Cybernetics 8(9):694-702 (September i978).
30. B. J. Schacter, "Decomposition of polygons into convex sets," IEEE Trans. Computers
C-72(11):1078-1082 (November 1978).
31. M. I. SHAMOS,Computational Geometry (Springer-Verlag, New York, 1977).
32. M. I. Shamos and D. Hoey, "Closest-point problems," Proceedings of the 16th Annual
Symposium on the Foundations of Computer Science, pp. 151-162 (October 1975).
33. R. Sibson, "Locally equiangular triangulations," Computer J. 21(3):243-245 (August
1978).
242