HANDBOOK OF COMPUTATIONAL GEOMETRY
This Page Intentionally Left Blank
HANDBOOK OF C O M PU TAT I O NAL GEOMETRY
E d i t e d by
J.R. Sack Carleton University, Ottawa, Canada
J. Urrutia Universidad Nacional Aut6noma de M~xico, M(xico
N 2000 ELSEVIER Amsterdam
• Lausanne
• New
York
• Oxford
• Shannon
• Singapore
• Tokyo
E L S E V I E R S C I E N C E B.V. S a r a B u r g e r h a r t s t r a a t 25 P.O. B o x 211, 1000 A E A m s t e r d a m , T h e N e t h e r l a n d s
©
2000 Elsevier Science B.V.
A l l rights r e s e r v e d .
T h i s w o r k is p r o t e c t e d u n d e r c o p y r i g h t b y E l s e v i e r S c i e n c e , a n d the f o l l o w i n g t e r m s a n d c o n d i t i o n s a p p l y to its use: Photocopying Single photocopies of single chapters may be made for personal use as allowed by national copyright laws. Permission of the Publisher and payment of a fee is required for all other photocopying, including multiple or systematic copying, copying for advertising or promotional purposes, resale, and all forms of document delivery. Special rates are available for educational institutions that wish to make photocopies for nonprofit educational classroom use. Permissions may be sought directly from Elsevier Science Rights & Permissions Department, PO Box 800, Oxford OX5 I DX, UK; phone: (+44) 1865 843830, fax: (+44) 1865 853333, email:
[email protected] You may also contact Rights & Permissions directly through Elsevier's home page (http://www.elsevier.nl), selecting first 'Customer Support', then 'General Information', then 'Permissions Query Form'. In the USA, users may clear permissions and make payments through the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA; phone: (978) 7508400, fax: (978) 7504744, and in the UK through the Copyright Licensing Agency Rapid Clearance Service (CLARCS), 90 Tottenham Court Road, London W1P 0LP, UK; phone: (+44) 171 631 5555; fax: (+44) 171 631 5500. Other countries may have a local reprographic rights agency for payments. Derivative Works Tables of contents may be reproduced for internal circulation, but permission of Elsevier Science is required for external resale or distribution of such material. Permission of the Publisher is required for all other derivative works, including compilations and translations. Electronic Storage or Usage Permission of the Publisher is required to store or use electronically any material contained in this work, including any chapter or part of a chapter. Except as outlined above, no part of this work may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of the Publisher. Address permissions requests to: Elsevier Science Rights & Permissions Department, at the mail, fax and email addresses noted above. Notice No responsibility is assumed by the Publisher for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions or ideas contained in the material herein. Because of rapid advances in the medical sciences, in particular, independent verification of diagnoses and drug dosages should be made.
First e d i t i o n
2000
Library of Congress CataloginginPublication Data A c a t a l o g r e c o r d f r o m the L i b r a r y o f C o n g r e s s has b e e n a p p l i e d for.
ISBN: 0 444 82537 1
G T h e p a p e r u s e d in this p u b l i c a t i o n m e e t s the r e q u i r e m e n t s o f A N S I / N I S O Z 3 9 . 4 8  1 9 9 2 ( P e r m a n e n c e o f Paper). P r i n t e d in T h e N e t h e r l a n d s
Computational Geometry is a young and vibrant field of Computer Science born in the early 1970’s. Since its beginning, Computational Geometry has attracted the interest of a large number of researchers, due to its numerous and strong interactions with various fields of Science and Engineering such as Algorithms and Data Structures, Combinatorial Mathematics, Euclidean Geometry, and Optimization. Recently the demand for efficient geometric computing in a variety of areas of applied sciences such as Geographical Information Systems, Visualization, Robotics, Computer Graphics, and CAD has further fueled research in Computational Geometry. This has resulted in a wealth of powerful techniques and results of interest to researchers and practitioners. The need for a comprehensive source of information on the fundamental techniques and tools developed in Computational Geometry is evident. This handbook will be an important source of information for all of us interested in one way or another in Computational Geometry. Readers whose objectives are to use a method for their applications will be able to find and choose different approaches and techniques to solve a large number of problems, most of them described in a comprehensive and concise manner. Researchers interested in theoretical results will find this handbook an invaluable and comprehensive source of information in which most of the results, tools and techniques available in our field are to he tound. This handbook presents chapters which survey in detail most of the research available to date in this field. The handbook contains survey papers in the following fundamental topics: Arrangements, Voronoi Diagrams, Geometric Data Structures (incl. point location, convex hulls, etc.), Spatial Data Structures, Polygon Decomposition, Randomized Algorithms, Derandomization, Parallel Computational Geometry (deterministic and randomized). Visibility, Art Gallery and Illumination Problems, Closest Point Problems, Link Distance Problems. Similarity of Geometric Objects. DavenportSchinzel Sequences, and Spanning Trees and Spanners. There are also three chapters devoted to applications of Computational Geometry to other fields of science: Geographical Information Systems, Geometric Shortest Paths and Network Optimization, and Mesh Generation. In addition, there is a chapter devoted to robustness and numerical issues, and chapters on Animation and Graph Drawing. We would like to thank for the enthusiasm shown by all the contributors to this handbook, as well as express our gratitude to the numerous anonymous referees whose invaluable contributions made this project possible. We are grateful to Arjen Sevenster of Elsevier Science for his enthusiastic support which made this handbook a reality. Finally, we thank Anil Maheshwari for his help. J.R. Sack J. Urrutia
This Page Intentionally Left Blank
List of Contributors Agarwal, P.K., Duke University, Durham, NC (Chs. 1 , 2 ) Alt, H., Freie Univer.sitat Berlin, Berlin (Ch. 3) Asano, T., Japan Advanced Institute ofscience and Technology, Ishikawu (Ch. 19) Atallah, M.J., Purdue University, West Lafayetre, IN (Ch. 4) Aurenhammer, F., Technische Universitat Grae, Graz (Ch. 5 ) Bern, M., Xerox Palo Alto Research Center; Pa10 Alto, CA (Ch. 6 ) Chen, D.Z., University of Notre Dame, Notre Dame, IN (Ch. 4) De Floriani, L., Universita di Genova, Genova (Ch. 7 ) Djidjev, H.N., University cf Wanvick, Coventry (Ch. 12) Dobkin, D.P., Princeton University, Princeton, NJ (Ch. 8) Eppstein, D., University of California, Iwine, CA (Ch. 9) Ghosh, S.K., Tutu Institute qf Fundcimental Research, Bombay (Ch. 19) Goodrich, M.T., Johns Hopkins University, Baltimore, M D (Ch. 10) Guibas, L.J., Stanford University Stcmti,rd. CA (Ch. 3 ) Hausner, A,, Princeton Universitj: Princeton. NJ (Ch, 8 Kzil, J.M., Utiitzer,sitvc!f’Sa.skutc,hc~varr, Suskutonn. SK (Ch. i 1 ) Klein, K., F p t n Universitiit Hugen, f f u g r n (Ch. S 1 Magillo, P., I h ~ r r . s i t idi~ G m m u Grrrow (CII.7 ) Mahebhwari, A,, Carieron University, Ottawa, ON (Ch. 12j MatouSek, J., Charles Universiq, Prtiha (Ch. 13) Mitchell, J.S.B.. State Universiq ($New York, Stony Brook, NY (Ch. 15) Mulmuley, K., The University of Chicago, Chicago, IL, and l.l.i?,Bombay (Ch. 16) Nievergelt, J., ETH Zurich, Zurich (Ch. 17) Plassmann, P., Pennsylvnnia State University, University Park, PA (Ch. 6 ) Puppo, E., Universitu di Genova, Genova (Ch. 7 ) Ramaiyer, K., Infbrmix Sfhvare, Oakland, CA (Ch. 10) Reif, J.H., Duke University, Durham, NC (Ch. 18) Sack, J.R., Carleton University, Ottawa, ON (Ch. 12) Schirra, S., ~ ~ i x  p l ~ i t i c k  l n s t i t uInfiirmatik, tfur Saarbrucken (Ch. 14) Sen, S., Indian Institute of Technology, New Delhi (Ch. IS) Sharir, M., Tel Aviv University, Tel Aviv, and New York University, New York, NY (Chs. 1,2) Shermer, T.C., Simon Fruser University, Burnaby, BC (Ch. 19) Smid, M., University ofMagdeburg, Magdeburg (Ch. 20) Tamassia, R., Brown UniversiQ, Providence, RI (Ch. 21) Urrutia, J., Universidad Nacional Autcinonza de MPxico, MPxico (Ch. 22) Widmayer, P., ETH Zurich, Zurich (Ch. 17) vii
This Page Intentionally Left Blank
Contents Preface List of Contributors
V
vii
1. DavenportSchinzel sequences and their geometric applications l? K. Aganval and M. Sharir 2. Arrangements and their applications l? K. Aganval and M. Sharir 3. Discrete geometric shapes: M a h i n g , interpolation, and approximation H . Alt and L.J. Guibas 4. Deterministic parallel computational geometry M.J. Atallah and D.Z. Chen 5 . Voronoi diagrams E Aurenhammer and R. Klein 6. Mesh generation M. Bern and P. Plassmann 7. Applications of computational geometry to geographic information systems L. de Floriani, l? Magillo and E. Puppo 8. Making geometry visible: An introduction to the animation of geometric algorithms A. Hausner and D.P. Dobkin 9. Spanning trees and spanners D. Eppste in 10. Geometric data structures M. 7: Goodrich and K. Ramaiyer 1 1. Polygon decomposition J.M. Keil 12. Link distance problems A. Maheshwari, J.R. Sack and H.N. Djidjev 13. Derandomization in computational geometry J. Matoufek 14. Robustness and precision issues in geometric computation S. Schirra 15. Geometric shortest paths and network optimization J.S. B. Mitchell 16. Randomized algorithms in computational geometry K. Mulmuley ix
1 49 121
155 20 1 29 1
333 389 425 463 49 1 519 559 597
633 703
x
Contents
17. Spatial data structures: Concepts and design choices
725
J. Nievergelt and P. Widmayer
18. Parallel computational geometry: An approach using randomization
765
J.H. Reif and S. Sen
19. Visibility in the plane
829
T. Asano, S.K. Ghosh and T.C. Shermer
20. Closestpoint problems in computational geometry
877
M. Smid
21. Graph drawing
937
R. Tamassia
22. Art gallery and illumination problems
973
J. Urrutia
Author Index Subject Index
I1 135
CHAPTER 1
DavenportSchinzel Sequences and Their Geometric Applications* Pankaj K. Agarwal Center for Geometric Computing, Department of Computer Science, Box 90129, Duke University, Durham, NC 277080129, USA Email:
[email protected] Micha Shark School of Mathematical Sciences, Tel Aviv University, Tel Aviv 69978, Israel, and Courant Institute of Mathematical Sciences, New York University, New York, NY 10012, USA Email:
[email protected] tau. ac. il
Contents 1. Introduction 2. DavenportSchinzel sequences and lower envelopes 2.1. Lower envelopes of totally defined functions 2.2. Lower envelopes of partially defined functions 2.3. Constructing lower envelopes 3. Simple bounds and variants 4. Sharp upper bounds on A^ («) 4.1. Ackermann's function — A review 4.2. The upper bound for A.3(«) 4.3. Upper bounds onXgin) 5. Lower bounds on A^Cn) 6. DavenportSchinzel sequences and arrangements 6.1. Complexity of a single face 6.2. Computing a single face 6.3. Zones 6.4. Levels in arrangements
.
.
. . . ,
3 4 4 7 8 9 11 11 12 16 16 20 21 23 27 28
*Both authors have been supported by a grant from the U.S.Israeli Binational Science Foundation. Pankaj Agarwal has also been supported by a National Science Foundation Grant CCR9301259, by an Army Research Office MURI grant DAAH049610013, by a Sloan fellowship, and by an NYI award and matching funds from Xerox Corporation. Micha Sharir has also been supported by NSF Grants CCR9122103 and CCR9311127, by a MaxPlanck Research Award, and the Israel Science Fund administered by the IsraeU Academy of Sciences, and the G.I.F., the GermanIsraeli Foundation for Scientific Research and Development.
HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved 1
2
RK. Agarwal and M. Sharir
7. Miscellaneous applications 7.1. Applications of D5(n, 2)sequences 7.2. Motion planning 7.3. Shortest paths 7.4. Transversals of planar objects 7.5. Dynamic geometry 7.6. Hausdorff distance and Voronoi surfaces 7.7. Visibility problems 7.8. Union of Jordan regions 7.9. Extremal {0, l}matrices 8. Concluding remarks References
Abstract An {n,s) DavenportSchinzel sequence, for positive integers n and 5, is a sequence composed of n distinct symbols with the properties that no two adjacent elements are equal, and that it does not contain, as a (possibly noncontiguous) subsequence, any altemation a b' a • b " of length s \2 between two distinct symbols a and b. The close relationship between DavenportSchinzel sequences and the combinatorial structure of lower envelopes of collections of functions make the sequences very attractive because a variety of geometric problems can be formulated in terms of lower envelopes. A nearlinear bound on the maximum length of DavenportSchinzel sequences enable us to derive sharp bounds on the combinatorial structure underlying various geometric problems, which in turn yields efficient algorithms for these problems.
29 30 31 34 35 36 37 38 39 40 41 41
DavenportSchinzel sequences and their geometric applications
3
1. Introduction DavenportSchinzel sequences, introduced by H. Davenport and A. Schinzel in the 1960s, are interesting and powerful combinatorial structures that arise in the analysis and construction of the lower (or upper) envelope of collections of univariate functions, and therefore have applications in a variety of geometric problems that can be reduced to computing such an envelope. In addition, DavenportSchinzel sequences play a central role in many related geometric problems involving arrangements of curves and surfaces. For these reasons, they have become one of the major tools in the analysis of combinatorial and algorithmic problems in geometry. DEFINITION 1.1. Let n and s be two positive integers. A sequence U = {u\,.. ..Um) of integers is an {n,s) DavenportSchinzel sequence (a DS(n, s)sequence for short) if it satisfies the following conditions: (i) I ^Ui ^n for each / < m, (ii) Ui 7^ M/+1 for each / < m, and (iii) there do not exist 5* + 2 indices 1 ^ /i < 12 < • " 1, there exists a polynomial Cs (q) o f degree at most s  1, such that ~2s+l (n) 4. The first superlinear bound on )vs (n) was obtained by Hart and Sharir [80], who proved that )v3(n) = ; 2 ( n ~ ( n ) ) . Their original proof transforms DS(n, 3)sequences into certain path compression schemes on rooted trees. A more direct proof for the lower bound on )~3(n) was given by Wiernik and Sharir [154] they describe an explicit recursive scheme for constructing a DS(n, 3)sequence of length £2 ( n a ( n ) ) . See also [ 100]
DavenportSchinzel sequences and their geometric applications
17
for another proof of the same lower bound. We sketch Wiernik and Sharir's construction, omitting many details, which can be found in [142,154]. Let [Ck{m)]k^\ be a sequence of functions from N to itself, defined by C\(m) = I, Q ( l ) = 2Q_i(2), Ck(m) = Ck(m l)Ck\{Ck(m
1)),
m ^ 1, k^2, k^2,m^2.
It can be shown that, for all /: > 4, m ^ 1, Aki(m) ^ Ck(m) ^ Akim + 3).
(5.1)
In what follows, let /x = Q ( m — 1), y — Ck\ (Ck(m — 1)), and y = fx  v. For each k,m^ 1, we construct a sequence Sk(m) that satisfies the following two properties: (PI) Sk(m) is composed of Nk(m) = m • Ckim) distinct symbols. These symbols are named (d,l),ford= I,.. .,m, I = 1 , . . . , y, and are ordered in lexicographical order, so that (d, I) < (d\ /O if I < I' or 1 = 1' and d < d\ (P2) Sk(jn) contains y fans of size m, where each fan is a contiguous subsequence of the form ((1, /)(2, /) • • • (m, /)), for / == 1 , . . . , y. Since fans are pairwise disjoint, by definition, the naming scheme of the symbols of Sk(m) can be interpreted as assigning to each symbol the index / of the fan in which it appears, and its index d within that fan. The construction of Skim) proceeds by double induction on k and m, as follows. 1. k=l: The sequence is a single fan of size m: S\{m) — ((1, 1)(2, 1) • • (m, 1)). Properties (PI) and (P2) clearly hold here (Ci (m) = 1). 2. k = 2: The sequence contains a pair of disjoint fans of size m, with a block of elements following each of these fans. Specifically, S2(m) = ((1, 1) (2, 1) •. • (m  1, 1) (m, 1) (m  1, 1) • • • (1, 1) (1,2)(2,2). ( m  l , 2 ) ( m , 2 ) ( m  1 , 2 ) ••• (1,2)>. Indeed, S2(m) contains C2(m) = 2 fans and is composed of 2m distinct symbols. 3. k^3,m = I: The sequence is identical to the sequence for ^^ = ^ — 1 and m' = 2, except for renaming of its symbols and fans: Sk\(2) contains Q_i(2) = ^Ck(l) fans, each of which consists of two symbols; the symbol renaming in Sk(l) causes each of these two elements to become a 1element fan. Properties (PI) and (P2) clearly hold. 4. The general case k^3,m> 1: (i) Generate inductively the sequence S' = Sk(m — I); by induction, it contains /x fans of size m — 1 each and is composed of (m — I)  /JL symbols. (ii) Create v copies of S' whose sets of symbols are pairwise disjoint. For each j ^ V, rename the symbols in the jth copy 5y of S' as (d,i, j) where I ^d ^m — I is the index of the symbol in the fan of S' containing it, and 1 ^ / < /x is the index of this fan in S'.
RK. Agarwal and M. Sharir
18
fan I
fan^
fan^
SL
S'2 S[
5* fan^
faru^
fan^
Fig. 5. Lower bound construction: merging the subsequences.
(iii) Generate inductively the sequence S* = Sk\iiJi) whose set of symbols is disjoint from that of any S'; by induction, it contains v fans of size fi each. Rename the symbols of S* as (m, /, /) (where / is the index of that symbol within its fan, and j is the index of that fan in 5*). Duplicate the last element (m, /x, j) in each of the y fans of S*. (iv) For each 1 ^ / ^ //, 1 ig / ^ y, extend the /th fan of S' by duplicating its last element (m — 1, /, y), and by inserting the corresponding symbol (m, /, j) of S* between these duplicated appearances of (m — \,i, j). This process extends the (m — l)fans of S' into mfans and adds a new element after each extended fan. (v) Finally construct the desired sequence Sk{m) by merging the v copies S^ of S' with the sequence S*. This is done by replacing, for each 1 ^ y ^ y, the jih fan of S* by the corresponding copy 5" of S\ as modified in (iv) above. Note that the duplicated copy of the last element in each fan of S* (formed in step (iii) above) appears now after the copy S' that replaces this fan; see Figure 5 for an illustration of this process. It is easily checked that S^ (m) consists of Nk{m) = v(m  l)/xf
MQI(M)
=mCk{m)
symbols, and it can also be shown that Sk (m) is a DS(Nk (m), 3)sequence satisfying properties (PI) and (P2). If we let a^ (m) denote the length of Sk(m), then a\(m) = m, (72 ( m ) = 4 m — 2,
DavenportSchinzel sequences and their geometric applications
19
o^^(l) = ^^l(2),
Gkim) = vak{m\)
+ ak\{ix) + v{ii + \).
The third term in the last equation is due to the duphcation of the rightmost symbol of each fan of 5'* and of each S' (see Steps 4(iii)(iv)). Using a double induction on k and m, one can prove that (Jk(m) > (km — 2)Ck(m) + 1. THEOREM PROOF.
5.1 ([80,154]). X3(n) =
^(na(n)).
Choose mk = Q + i (^  3). Then
nk = Nk(mk) =
Ck^iik2)^Ak+i(k^l),
where the last inequality follows from (5.1). Therefore a(nk) ^k \ 1, and hence >^3(nk) ^ cfkimk) ^ krik  2Ck(mk) ^ (k  2)nk ^ nk{a(nk)  3). As shown in [142], this bound can be extended to any integer n, to prove that A3(«) = D Q(na(n)). Generalizing the above construction and using induction on s — basically replacing each chain of the sequence Sk{m) by a DS{n, s — 2)~sequence, which, in turn, is constaicted recursively ~— Sharir [138] proved that A2^ + i(/i) — QCnainY). Later Agarwal et al. [11] proved that the upper bounds slated in Theorem 4.5 are almost optimal. In particular, using a rather mvolved doublymductive scheme, they constructed a DS{n, 4)sequence of length i2(n2^^^"'). Then, by recurring on s, they generalized their construction of DSin, 4)sequences to higherorder sequences. The following theorem summarizes their result. THEOREM 5.2 ([11]).
(i) k4(n)=:Q(n'2''^''^). (ii) For ^ > 1, there exists a polynomial Qsiq) of degree at most s — I, such that
OPEN PROBLEM
1. Obtain tights bounds on Xsin) for ^ > 4, especially for odd values
ofs. Wiemik and Sharir [154] proved that the DS{n, 3)sequence Sk(m) constructed above can be realized as the lower envelope sequence of a set of n segments, w^hich leads to the following fairly surprising result: 5.3 ([154]). The lower envelope ofn segments can have Q (na(n)) breakpoints in the worst case.
THEOREM
20
RK. Agarwal and M. Sharir
Shor [145] gave a simpler example of n segments whose lower envelope also has Q (na(n)) breakpoints. These results also yield an ^{na(n)) lower bound on many other unrelated problems, including searching in totally monotone matrices [94] and counting the number of distinct edges in the convex hull of a planar point set as the points are being updated dynamically [151]. Shor has also shown that there exists a set of n degree4 polynomials whose lower envelope has Q{na(n)) breakpoints [146] (which is somewhat weak, because the upper bound for this quantity is X4(n) = 0(n • 2"^^^^)). We conclude this section by mentioning another open problem, which we believe is one of the most challenging and interesting problems related to DavenportSchinzel sequences. OPEN PROBLEM 2. Is there a natural geometric realization of higher order sequences? For example, can the lower envelope ofn conic sections have f2(n2^^^^) breakpoints!
6. DavenpoiitSrhinzel sequences and arrangements In this section we consider certain geometric and topological structures induced by a family of arcs in the plane, where DavenportSchinzel sequences play a major role in their analysis. Specifically, let T = {yi,..., y,;} be a collection of n Jordan arcs in the plane, each pair of which intersect in at most .v points, for some fixed constant s.^ DEFINITION 6.1. The arrangement AiF) of F is the planar subdivision induced by the arcs of JT; that is, AiF) is a planar map whose vertices are the endpoints of the arcs of F and their pairwise intersection points, whose edges are maximal (relatively open) connected portions of the y, 's that do not contain a vertex, and whose/ac^5' are the connected components of R^ — (J T. The combinatorial complexity of a face is the number of vertices (or edges) on its boundary, and the combinatorial complexity of A(F) is the total complexity of all of its faces. The maximum combinatorial complexity of ^4(7") is clearly &(sn^) = 0(n^), and A(F) can be computed in time 0(n^ log«), under an appropriate model of computation, using the sweepline algorithm of Bentley and Ottmann [29]. A slightly faster algorithm, with running time 0(nks^2(f^)), is mentioned in Section 6.3. Many applications, however, need to compute only a small portion of the arrangement, such as a single face, a few faces, or some other substructures that we will consider shortly. Using D^sequences, one can show that the combinatorial complexity of these substructures is substantially smaller than that of the entire arrangement. This fact is then exploited in the design of efficient algorithms, whose running time is close to the bound on the complexity of the substructures that these algorithms aim to construct. In this section we review combinatorial and algorithmic results related to these substructures, in which Z)5sequences play a crucial role. ^ A Jordan arc is an image of the closed unit interval under a continuous bijective mapping. Similarly, a closed Jordan curve is an image of the unit circle under a similar mapping, and an unbounded Jordan curve is an image of the open unit interval (or of the entire real line) that separates the plane.
DavenportSchinzel sequences and their geometric applications
21
'75 73
,77
"74
S
~ + ; + + ~ ;+


+ ~  ~   " ~ + ~4  ~ 2/   \ 31 2
Fig. 6. A single face and its associated boundary sequence; all arcs are positively oriented from left to right.
6.1. Complexi~ o f a single face It is well known that the complexity of a single face in an arrangement of n lines is at most n [124], and a linear bound on the complexity of a face in an arrangement of rays is also known (see Alevizos et al~ [14,15]). The result of Wiernik and Sharir [154] on the lower envelopes of segments implies that the unbounded face in an arrangement of n line segments has Kg(n~(n)) vertices in the worst case. A matching upper bound was proved by Pollack et al. [123], which was later extended by Guibas et al. [75] to general Jordan arcs. The case of closed or unbounded Jordan curves was treated in [135]. THEOREM 6.2 ([75,135]). Let F be a set of n Jordan arcs in the plane, each pair of which intersect in at most s points, f o r some fixed constant s. Then the combinatorial complexity of any single face in ,,4(/') is O(~,s+2(n)). I f each arc in Y' is a Jordan curve (closed or unbounded), then the complexity of a single face is at most/,s (n). PROOF (Sketch). We only consider the first part of the theorem; the proof of the second part is simpler, and can be found in [135,142]. Let f be a given face in A ( F ) , and let C be a connected component of its boundary. We can assume that C is the only connected component of Of. Otherwise, we repeat the following analysis for each connected component and sum their complexities. Since each arc appears in at most one connected component, the bound follows. For each arc Yi, let ui and vi be its endpoints, and let yi+ (respectively, y/) be the directed arc yi oriented from u i to vi (respectively, from vi to u i). Without loss of generality, assume that C is the exterior boundary component of f . Traverse C in counterclockwise direction (so that f lies to our left) and let S = (sl, s2 . . . . . st) be the circular sequence of oriented arcs in F in the order in which they appear along C
22
RK. Agarwal and M. Sharir
(if C is unbounded, 5 is a linear, rather than circular, sequence). More precisely, if during our traversal of C we encounter an arc yi and follow it in the direction from «/ to vi (respectively, from Vi to w/) then we add y^ (respectively, yf) to S. See Figure 6 for an illustration. Note that in this example both sides of an arc yi belong to the outer connected component. Let § 1 , . . . , ?2n denote the oriented arcs of F. For each §/ we denote by $/1 the nonoriented arc yj coinciding with ^/. For the purpose of the proof, we transform each arc yt into a very thin closed Jordan curve y^ by taking two nonintersecting copies of yi lying very close to one another, and by joining them at their endpoints. This will perturb the face / slightly but can always be done in such a way that the combinatorial complexity of C does not decrease. Note that this transformation allows a natural identification of one of the two sides of y* with y^ and the other side with yf. It can be shown (see [75,142]) that the portions of each arc §/ appear in 5 in a circular order that is consistent with their order along the oriented ^/. In particular, there exists a starting point in S (which depends on ^/) so that if we read S in circular order starting from that point, we encounter these portions of f, in their order along ^/. For each directed arc 5,, consider the linear sequence V, of all appearances of f/ in 5, arranged in the order they appear along $/. Let )[X/ and y/ denote respectively the index in S of the first and of the last element of V/. Consider S = {s\,.. .,St) SLS s. linear, rather than a circular, sequence (this change is not needed if C is unbounded). For each arc §,, if /x, > v, we split the symbol §/ into two distinct symbols ^/1, §,2, and replace all appearances of §/ in S between the places fjii and t (respectively, between 1 and y,) by §,1 (respectively, by f/2). Note that the above claim implies that we can actually split the arc ^/ into two connected subarcs, so that all appearances of §n in the resulting sequence represent portions of the first subarc, whereas all appearances of ^,2 represent portions of the second subarc. This splitting produces a sequence S^, of the same length as S, composed of at most 4n symbols. With all these modifications, one can then prove that 5* is a DS{4n, s j 2)sequence. This is done by showing that each quadruple of the form (a • "b • a • b) in S* corresponds, in a unique manner, to an intersection point between the two arcs of F that a and b represent. See [75,142] for more details. This completes the proof of the first part of the theorem. D Theorem 6.2 has the following interesting consequence. Let T = {yi,...,}/,,} be a set of n closed Jordan curves, each pair of which intersects in at most s points. Let K = conv(r) be the convex hull of the curves in F. Divide the boundary of K into a minimum number of subarcs, ai, ^ 2 , . . . , a^?, such that the relative interior of each a/ has a nonempty intersection with exactly one of the curves yj. Then the number m of such arcs is at most Xs(n); see [135] for a proof. Recently, Arkin et al. [20] showed that the complexity of a single face in an arrangement of line segments with h distinct endpoints is only 0(h logh) (even though the number of segments can be &(h^)). A matching lower bound is proved is by Matousek and Valtr [106]. The upper bound by Arkin et al. does not extend to general arcs. HarPeled [78] has also obtained improved bounds on the complexity of a single face in many special cases.
DavenportSchinzel
sequences and their geometric applications
23
6.2. Computing a single face Let r be a collection of n Jordan arcs, as above, and let x be a point that does not lie on any arc of F. We wish to compute the face of A{r) that contains x. We assume that each arc in F has at most a constant number of points of vertical tangency, so that we can break it into 0(1) Xmonotone Jordan arcs. We assume a model of computation allowing infiniteprecision real arithmetic, in which certain primitive operations involving one or two arcs (e.g., computing the intersection points of a pair of arcs, the points of vertical tangency of an arc, the intersections of an arc with a vertical line, etc.) are assumed to take constant time. If /" is a set of n lines, or a set of n rays, then a single face can be computed in time 0{n log^). In the case of lines, this is done by dualizing the lines to points and using any optimal convex hull algorithm [124]; the case of rays is somewhat more involved, and is described in [14,15]. However, these techniques do not extend to arrangements of more general Jordan arcs. Pollack et al. [123] presented an 0{na{n) log^n)time algorithm for computing the unbounded face in certain arrangements of line segments, but the first algorithm that works for general arcs was given by Guibas et al. [75]. Later, several other efficient algorithms — both randomized and deterministic — have been proposed. We first present randomized (Las Vegas) algorithms^ for computing a single face, and then review the deterministic solution of [75], and mention some other related results. Randomized algorithms have recently been designed for many geometric problems; see, e.g., [45,115, 136]. They are often much simpler than their deterministic counterparts, and are sometimes more efficient, as the present case will demonstrate. The efficiency of a Las Vegas randomized algorithm will be measured by its expected running time in the worst case, where the expectation is taken with respect to the internal randomizations performed by the algorithm. Randomized algorithms. The randomized algorithms that we will describe actually compute the socalled vertical decomposition of / . This decomposition, which we denote by / , is obtained by drawing a vertical segment from each vertex and from each point of vertical tangency of the boundary of / in both directions, and extend it until it meets another edge of / , or else all the way to ±oo. The vertical decomposition partitions / into "pseudotrapezoidal" cells, each bounded by at most two arcs of F and at most two vertical segments. To simplify the presentation, we will refer to these cells simply as trapezoids; see Figure 7 for an illustration. We first present a rather simple randomized divideandconquer algorithm due to Clarkson [42] (see also [142]). The basic idea of the algorithm is as follows: Randomly choose a subset F\ assuming that yo intersects every arc of F in at most some constant number of points. P R O O F . Split every arc y G F into two subarcs at each intersection point of y and yo, and leave sufficiently small gaps between these pieces. In this manner all faces in the zone of yo are merged into one face, at the cost of increasing the number of arcs from n to 0(n). Now we can apply Theorem 6.2 to conclude the proof. D If F is a set of n lines and yo is also a line, then after splitting each line of F at their intersection points with yo we obtain a collection of 2n rays, and therefore the complexity of the unbounded face is 0 ( n ) . In fact, in this case one can show that the edges of the zone form a DS(4n, 2) sequence, thereby obtaining an upper bound of 8n — 1 on the complexity of the zone. Applying a more careful analysis, Bern et al. [31] proved the following theorem. T H E O R E M 6.8 ([31]). The complexity of the zone of a line in an arrangement ofn lines is at most 5.5/1, and this bound is tight within an additive constant term, in the worst case. See [14,31,37,56] for other results and applications of zones of arcs. An immediate consequence of Theorem 6.7 is an efficient algorithm for computing the arrangement A{F). Suppose we add the arcs of F one by one and maintain the arrangement of the arcs added so far. Let Ft be the set of arcs added in the first / stages, and let y/+i
28
P.K. Agarwal and M. Sharir
be the next arc to be added. Then in the (/ + l)st stage one has to update only those faces of AiPi) which He in the zone of yz+i, and this can easily be done in time proportional to the complexity of the zone; see Edelsbrunner et al. [56] for details. By Theorem 6.7, the total running time of the algorithm is 0{nXs+2(n)), and, by Theorem 6.8, the arrangement of a set of n lines can be computed in 0{n^) time. If the arcs of F are added in a random order, then the expected running time of the above algorithm is 0{n \ogn + k), where k is the number of vertices in A{r) [35,46,115], which is at most quadratic in n. The latter time bound is worstcase optimal. Theorem 6.7 can also be used to obtain an upper bound on the complexity of any m faces of A{r). Specifically, let {/i,..., /^} be a subset of m distinct faces in A{r), and let Uf denote the number of vertices in a face / of A{r). Then, using the CauchySchwarz inequahty, 1/2 i=\
^ i
^
/
X 1/2
^feA(r)
^
where kj is the number of arcs in F that appear along the boundary of / . It is easily verified that
X! '^/^Z ^Y^ feAif)
yer
Y^
^f = C)(nAs+2(«)).
fe7.oneiy,r\{y})
Hence, we obtain the following result. 6.9 ([56,78]). Let F be a set ofn arcs satisfying the conditions stated earlier. The maximum number of edges bounding any m distinct faces ofA(F) is 0(m' ^'^)^s\2(n)).
THEOREM
It should be noted that Theorem 6.9 is weaker than the best bounds known for the complexity of m distinct faces in arrangements of several special types of arcs, such as lines, segments, and circles (see [21,33,43]), but it applies to arrangements of more general arcs.
6.4. Levels in arrangements Let F be a. set of n jcmonotone, unbounded Jordan curves, each pair of which intersects in at most s points. The level of a point p eE? in A(F) is the number of curves of F lying strictly below p, and the level of an edge e e AiF) is the common level of all the points lying in the relative interior of e. For a nonnegative integer k 0, his algorithm constructs a graph G^, whose nodes are points in R^, and whose edges connect some pairs of these points by straight segments. The size of Ge is 0(n^ \oginp) + n^Xs{n)/e^), where ^ is a fixed constant and p is the ratio of the length of the longest edge in O to the (straight) distance between p and q. He then reduces the problem to that of constructing a shortest path in Ge (where the weight of an edge is its Euclidean length), and shows that the ratio between the length of the path obtained in this manner and the actual collisionfree shortest path between p and q is at most 1+6:. The running time of his algorithm is 0{{n^Xs{n)/e'^) \og{n/s) + n^ \og{np) \og{n log/))). A special case of shortest paths in 3space, which has been widely studied, is when O consists of a single convex poly tope and p,q lie on its surface (see, for example, [38, 109,143]). A shortest path on the surface of a convex poly tope can be represented by the sequence of edges that it crosses, and we refer to such a sequence of edges as a shortestpath edge sequence. It is known that there are 6)(n'*) shortest path edgesequences [111, 133]. Agarwal et al. [4] have shown that the exact set of all shortestpath edge sequences can be computed in time 0{n^Xs (n) \ogn), for some constant ^ > 0, improving a previous algorithm by Schevon and O'Rourke [134]. Baltsan and Sharir [28] considered the special case where O consists of two disjoint convex poly topes (and p and q lie anywhere in the free space). Using DavenportSchinzel sequences to bound the number of candidate paths that one has to consider, they presented an algorithm with running time 0{n?''k\Q{n)\ogn) to find an exact collisionfree shortest path between p and q.
DavenportSchinzel
sequences and their geometric
applications
35
If the moving object is not a point and the object is allowed to rotate, the problem of computing a shortest path becomes significantly more difficult, even in the planar case. (In fact, even the notion of shortest path becomes much vaguer now.) Suppose we want to compute an optimal path for moving a line segment y =: pq (allowing both translations and rotations) amid polygonal obstacles with a total of n edges. Assume that the cost of a path is defined as the total distance traveled by one of its endpoints, say, /?, and restrict the problem further by requiring that p moves along polygonal paths that can bend only at obstacle vertices. This rather restricted version of the problem was studied by Papadimitriou and Silverberg [120], who gave an 0(n^ logn)time algorithm for computing a shortest path in the above setting. Sharir [139] improved the running time to 0(n^a(n)\og^n), using DavenportSchinzel sequences and planar arrangements.
7.4. Transversals ofplanar objects Let S = {Si, S2,..., Sn}hea collection of n compact convex sets in the plane. A line that intersects all sets of S is called a transversal (or a stabber) of S. Note that a line intersects a set if and only if it intersects its convex hull, so convexity is usually not a real restriction. For each set Si e S, let S* denote the set of points dual to the lines that intersect St, using a standard duality transform [54]. Sf is bounded from above by a convex xmonotone curve Ai and from below by a concave xmonotone curve Bf; see Figure 9. The stabbing region of S (or the space of all transversals) is the intersection 5* = 0/^=1 ^f ^ ^ definition, <S* is the set of points dual to all nonvertical transversals of S [23,59]. The complexity of 5* can be measured by the number of its vertices, where a vertex is an intersection point between the boundaries of two regions S* and 5* that lies on 95*. Since «S* is the region lying between the lower envelope of the set ^ = {A,  1 < / ^n} and the upper envelope of the set B = {Bi \ 1 < / ^ n}. Corollary 2.3 implies that the complexity of 5* is 0(ks (n)), and that it can be computed in time 0(Xs (n) log n), where s is the maximum number of common upper tangents or of common lower tangents between any two objects of S [23]. If 5 is a set of n convex polygons with a total of m vertices, then
Fig. 9. A convex set R and its stabbing region /?*
36
RK. Agarwal and M. Sharir
A and B are sets of n piecewiselinear curves, with a total of m segments, so Corollary 3.4 implies that the complexity of 5* is 0{ma{n)), and one can also show that <S* can be computed in time 0{m\ogn). For any 0 < A: < «, a line i is called a ktransversal if it intersects at least n — k objects of S. If we define K2i\ to be the region lying above A/ and K2i to be the region lying below Bi, then the point dual to t lies in the interior of at most k Kj's. Theorem 6.12 implied that the complexity of the space of all /:transversals of S is 0((^ + l)^ks(ln/(k + 1)J)) [140,142]. Next, suppose that <S is a set of pairwise disjoint convex objects. We say that a directed transversal i induces a geometric permutation {iiJi^ j, in) of 5 if ^ intersects the objects of S in the order ( 5 / , , . . . , 5/„). A directed transversal t is called extremal if it is tangent to two objects Si^, Si^ and these objects are contained in the closed halfplane that lies to the left of t. Edelsbrunner and Sharir [62] proved that, there is an extremal transversal inducing each geometric permutation. Let L'^ = (^i,..., ^m) be the (circular) sequence of all orientations, sorted in clockwise order, of the extremal directed transversals of 5 . It is shown in [62] that U can be mapped to a Z)5(n, 2)cycle, which implies that the number of geometric permutations of 5 is at most In —2. This bound is known to be tight in the worst case; see [26,87]. Other results on geometric permutations can be found in [25,27,65], and see [73] for a comprehensive survey on geometric transversal theory.
7.5. Dynamic geometry In this section we consider various problems related to a set of points in the plane, each moving along some predefined trajectory. As mentioned in the introduction, Atallah's paper [22] on dynamic geometry problems was the first paper in computational geometry to apply DavenportSchinzel sequences. We assume that we are given a collection S = [p\,...,pn}ofn points in the plane such that the coordinates of each /?/ are functions of time. Let pi (t) = (jc, (0, yi (0) denote the position of the point /?/ at time t, and let S(t) denote the configuration of S at time t. We assume that Xi(t), yi(t), for 1 ^ / ^ n, are polynomials of maximum degree 5, for some constant s, or similarly wellbehaved functions. We want to study how various geometric structures defined by S change with time. We first bound the number of times the nearest neighbor of some point /?/ of S changes. For every 7 7^/, let
gij(t)=d\pi(t),
pj(t)) = {xi(t)xj(t)f
+ (yiit) 
yj(t))\
and let Gi(t) = miny// gijit). By definition, the nearest neighbor of pi(t) changes only at breakpoints of G/. Since each gij is a polynomial of degree at most 2s, G/ has at most A,2.s (n) breakpoints. This bound is almost tight, because the nearest neighbor of a point can change ^(n) times, in the worst case. The same technique can also be used to bound the number of times at which the closest pair of points in S(t) changes. For this, consider the function G(t) — min/ [0, 27r), where S is the unit circle of orientations, as follows. For each 0 eS, if the ray r^ in the x jplane emanating from ^* in direction 0 does not intersect
DavenportSchinzel sequences and their geometric applications
39
^*, then hi{0) is undefined. Otherwise, let p^ be the intersection point of r  and e*. We define hi (0) to be the polar angle (i.e., the angle with the zaxis) of the ray emanating from ^ and passing through p, where p e ei is the point whose projection is p*. For a subset E ^S,WQ define hE(0) = minhi(0) eieE
to be the lower envelope of the /i/'s. We call the graph of HE the upper rim of E. Intuitively, the upper rim of E corresponds to the 'skyline' of E seen from ^. Using DS{n, 3)sequences, it is easily seen that HE has 0(£'a(£')) breakpoints. We construct a balanced binary tree T that stores a collection of upper rims of subsets of edges of U. Let E\ = {e\,..., en/2} and let E2 = {^«/2+i,..., ^«}. The root of T stores the upper rim HE^ and the two subtrees of the root represent recursively the search structures for the "nearer" half Ei and for the "farther" half E2 of the edges of X". It is easily seen that the total storage (and preprocessing time) that T requires is 0(na(n)\ogn). We can now process each rayshooting query as follows. Let p be a given ray emerging from ^ in direction (0,(p), where 0 is the horizontal orientation of the ray and (p is its azimuth. We perform a binary search through T by first comparing p with the topmost upper rim /z^,, stored at the root u of T. We compute, in O(logn) time, the value of /z^, (0). If 0, Matousek at al. [105] proved, using DS(n, 4)sequences, that the complexity of the union K is 0(A,4(/i)). This bound for the above fairly restricted problem implies the main result of [105], that the complexity of the union of n "fat" triangles, namely, triangles satisfying the property that each of their angles is at least some fixed constant angle, is 0{n log log n). Note that the union of n arbitrary triangles can have Q{n^) vertices in the worst case. See also [9,89] for other results involving fat triangles that exploit DavenportSchinzel sequences. 7.9. Extremal (0, \}'matrices Let M = [Mij} be an m X n matrix such that M/y G {0, 1} for all 1 < / ^ m and \ ^ j we call M a (0, 1}matrix. A configuration
^n\
is a M X i; matrix with 1 's and blanks as its entries. We say that M does not contain C if there is no submatrix A of M that contains the 1entries of C, that is, there are no
DavenportSchinzel
sequences and their geometric applications
41
u rows i\ < 12 < " • < iu and v columns ji < J2 < "  < jv such that Mij^ = 1 for all (s, t) for which Cst is 1. An upper bound on the number of I's in M for various C is useful in solving certain combinatorial problems in geometry, and also in bounding the time and storage complexity of certain geometric algorithms; see, for example, Bienstock and Gyori [32], Efrat and Sharir [64], and Pach and Sharir [117]. Let Co be the 2 x 4 configuration 1
1 1
1
By definition, a matrix M does not contain Co if there are no two rows /1 < (2 and four distinct columns ji < 72 < 73 < 7*4 such that
Fiiredi and Hajnal [71] have shown that the number of I's in a (0, 1 }matrix M that does not contain Co is 0{ma{m) + n). They prove the upper bound by transforming M to a DS{n, 3)sequence, and they construct anm x n matrix, using a recursive scheme similar to the one used in Section 5, to prove the lower bound.
8. Concluding remarks In this chapter we surveyed the basic results on the DavenportSchinzel sequences and some of their immediate applications to a variety of geometric problems. It is impossible to include all the results and all the applications in a survey paper. We refer the interested readers to the book by the authors [142] and the survey paper by Valtr [153] for details and for many other applications of DavenportSchinzel sequences. Finally, A natural question to ask is whether the theory of DavenportSchinzel sequences can be extended to higher dimensions. Lower envelopes and minimization diagrams have a natural extension to higher dimensions, and they are discussed in a companion chapter in this volume. However, no purely combinatorial generalization of DavenportSchinzel sequences to higher dimensions has been proposed so far.
References [1] W. Ackermann, Zum Hilbertschen Aufbau der reellen Zahlen, Math. Ann. 99 (1928), 118133. [2] R. Adamec, M. Klazar and P. Valtr, Generalized DavenportSchinzel sequences with linear upper bound. Discrete Math. 108 (1992), 219229. [3] P.K. Agarwal, N. Amenta, B. Aronov and M. Sharir, Largest placements and motion planning of a convex polygon. Algorithms for Robotic Motion and Manipulation, J.P. Laumond and M. Overmars, eds, A.K. Peters (1997), 143154. [4] P.K. Agarwal, B. Aronov, J. O'Rourke and C.A. Schevon, Star unfolding ofapolytope with applications, SIAM J. Comput. 26 (1997), 16791713. [5] P.K. Agarwal, B. Aronov and M. Sharir, Motion planning for a convex polygon in a polygon environment. Discrete Comput. Geom. 22 (1999), 201221.
42
RK. Agarwal and M. Sharir
[6] RK. Agarwal, M. de Berg, J. Matousek and O. Schwarzkopf, Constructing levels in arrangements and higher order Voronoi diagrams, SIAM J. Comput. 27 (1998), 654667. [7] RK. Agarwal, A. Efrat, M. Sharir and S. Toledo, Computing a segment center for a planar point set, J. Algorithms 15 (1993), 314323. [8] RK. Agarwal, L.J. Guibas, J. Hershberger and E. Veach, Maintaining the extent of a moving point set, Proc. 5th Workshop Algorithms Data Struct., Lecture Notes Comput. Sci. 1272, SpringerVerlag (1997), 3144. [9] RK. Agarwal, M.J. Katz and M. Sharir, Computing depth orders and related problems, Comput. Geom. 5 (1995), 187206. [10] RK. Agarwal and M. Sharir, Redblue intersection detection algorithms, with applications to motion planning and collision detection, SIAM J. Comput. 19 (1990), 297321. [11] RK. Agarwal, M. Sharir and P. Shor, Sharp upper and lower bounds on the length of general DavenportSchinzel sequences, J. Combin. Theory Ser. A 52 (1989), 228274. [12] RK. Agarwal, M. Sharir and S. Toledo, Applications of parametric searching in geometric optimization, J. Algorithms 17 (1994), 292318. [13] G. Albers and T. Roos, Voronoi diagrams of moving points in higher dimensional spaces, Proc. 3rd Scand. Workshop Algorithm Theory, Lecture Notes in Comput. Sci. 621, SpringerVerlag (1992), 399^09. [14] P. Alevizos, J.D. Boissonnat and P.P. Preparata, An optimal algorithm for the boundary of a cell in a union of rays, Algorithmica 5 (1990), 573590. [15] P. Alevizos, J.D. Boissonnat and P.P. Preparata, An optimal algorithm for the boundary of a cell in a union of rays: Corrigendum, Algorithmica 6 (1991), 292293. [16] N. Alon and E. Gyori, The number of small semispaces of a finite set of points in the plane, J. Combin. Theory Ser. A 41 (1986), 154157. [17] H. Alt, B. Behrends and J. Blomer, Approximate matching of polygonal shapes, Ann. Math. Artif. Intell. 13(1995), 251266. [18] N.M. Amato, M.T. Goodrich and E.A. Ramos, Computing faces in segment and simplex arrangements, Proc. 27th Annu. ACM Sympos. Theory Comput. (1995), 672682. [19] H. Aonuma, H. Imai, K. Imai and T. Tokuyama, Maximin location of convex objects in a polygon and related dynamic Voronoi diagrams, Proc. 6th Annu. ACM Sympos. Comput. Geom. (1990), 225234. [20] E.M. Arkin, D. Halperin, K. Kedem, J.S.B. Mitchell and N. Naor, Arrangements of segments that share endpoints: Single face results. Discrete Comput. Geom. 13 (1995), 257270. [21] B. Aronov, H. Edelsbrunner, L.J. Guibas and M. Sharir, The number of edges of many faces in a line segment arrangement, Combinatorica 12 (1992), 261274. [22] M.J. Atallah, Some dynamic computational geometry problems, Comput. Math. Appl. 11 (1985), 11711181. [23] M.J. Atallah and C. Bajaj, Efficient algorithms for common transversals. Inform. Process. Lett. 25 (1987), 8791. [24] E Aurenhammer, Voronoi diagrams: A survey of a fundamental geometric data structure, ACM Comput. Surv. 23 (1991), 345405. [25] D. Avis, J.M. Robert and R. Wenger, Lower bounds for line stabbing. Inform. Process. Lett. 33 (1989), 5962. [26] D. Avis and R. Wenger, Algorithms for line transversals in space, Proc. 3rd Annu. ACM Sympos. Comput. Geom. (1987), 300307. [27] D. Avis and R. Wenger, Polyhedral line transversals in space. Discrete Comput. Geom. 3 (1988), 257265. [28] A. Baltsan and M. Sharir, On the shortest paths between two convex polyhedra, J. ACM 35 (1988), 267287. [29] J.L. Bentley and T.A. Ottmann, Algorithms for reporting and counting geometric intersections, IEEE Trans. Comput. C28 (1979), 643647. [30] M. Bern, D. Dobkin, D. Eppstein and R. Grossman, Visibility with a moving point of view, Algorithmica 11 (1994), 360378. [31] M. Bern, D. Eppstein, P. Plassman and F. Yao, Horizon theorems for lines and polygons. Discrete and Computational Geometry: Papers from the DIMACS Special Year, J. Goodman, R. Pollack and W Steiger, eds, Amer. Math. Soc, Providence, RI (1991), 4566.
DavenportSchinzel
sequences and their geometric applications
43
[32] D. Bienstock and E. Gyori, An extremal problem on sparse 01 matrices, SIAM J. Discrete Math. 4 (1991), 1727. [33] R. Canham, A theorem on arrangements of lines in the plane, Israel J. Math. 7 (1969), 393397. [34] J. Canny and J.H. Reif, New lower bound techniques for robot motion planning problems, Proc. 28th Annu. IEEE Sympos. Found. Comput. Sci. (1987), 4960. [35] B. Chazelle, H. Edelsbrunner, L. Guibas, M. Sharir and J. Snoeyink, Computing a face in an arrangement of line segments and related problems, SIAM J. Comput. 22 (1993), 12861302. [36] B. Chazelle and L.J. Guibas, Fractional cascading: I. A data structuring technique, Algorithmica 1 (1986), 133162. [37] B. Chazelle and D.T. Lee, On a circle placement problem. Computing 36 (1986), 116. [38] J. Chen and Y. Han, Shortest paths on a polyhedron, Proc. 6th Annu. ACM Sympos. Comput. Geom. (1990), 360369. [39] L.P. Chew, Nearquadratic bounds for the L\ Voronoi diagram of moving points, Proc. 5th Canad. Conf. Comput. Geom. (1993), 364369. [40] L.P. Chew and K. Kedem, A convex polygon among polygonal obstacles: Placement and highclearance motion, Comput. Geom. Theory & Appl. 3 (1993), 5989. [41] J. Choi, J. Sellen and C.K. Yap, Approximate Euclidean shortest path in 3space, Proc. 10th Annu. ACM Sympos. Comput. Geom. (1994), 4 1 ^ 8 . [42] K. Clarkson, Computing a single face in arrangements of segments. Unpublished manuscript (1990). [43] K. Clarkson, H. Edelsbrunner, L. Guibas, M. Sharir and E. Welzl, Combinatorial complexity bounds for arrangements of curves and spheres, Discrete Comput. Geom. 5 (1990), 99160. [44] K.L. Clarkson, Approximation algorithms for shortest path motion planning, Proc. 19th Annu. ACM Sympos. Theory Comput. (1987), 5665. [45] K.L. Clarkson, Randomized geometric algorithms. Computing in Euclidean Geometry, D.Z. Du and F.K. Hwang, eds, World Scientific, Singapore (1992), 117162. [46] K.L. Clarkson and P.W. Shor, Applications of random sampling in computational geometry, II, Discrete Comput. Geom. 4 (1989), 387421. [47] R. Cole and M. Sharir, Visibility problems for polyhedral terrains, J. Symbolic Comput. 7 (1989), 1130. [48] H. Davenport, A combinatorial problem connected with differential equations II, Acta Arithmetica 17 (1971), 363372. [49] H. Davenport and A. Schinzel, A combinatorial problem connected with differential equations, Amer. J. Math. 87 (1965), 684689. [50] M. de Berg, K. Dobrindt and O. Schwarzkopf, On lazy randomized incremental construction. Discrete Comput. Geom. 14 (1995), 261286. [51] M. de Berg, H. Everett and L. Guibas, The union of moving polygonal pseudodiscs  Combinatorial bounds and applications, Comput. Geom. 11 (1998), 6981. [52] T. Dey, Improved bounds for ksets and kth levels. Discrete Comput. Geom. 19 (1998), 373382. [53] A. Dobson and S. Macdonald, Lower bounds for lengths of DavenportSchinzel sequences, Utilitas Math. 6(1974), 251257. [54] H. Edelsbrunner, Algorithms in Combinatorial Geometry, SpringerVerlag, Heidelberg (1987). [55] H. Edelsbrunner, L. Guibas, J. Hershberger, J. Pach, R. Pollack, R. Seidel, M. Sharir and J. Snoeyink, Arrangements of Jordan arcs with three intersections per pair. Discrete Comput. Geom. 4 (1989), 523539. [56] H. Edelsbrunner, L. Guibas, J. Pach, R. Pollack, R. Seidel and M. Sharir, Arrangements of curves in the plane: Topology, combinatorics and algorithms, Theoret. Comput. Sci. 92 (1992), 319336. [57] H. Edelsbrunner and L.J. Guibas, Topologically sweeping an arrangement, J. Comput. Syst. Sci. 38 (1989), 165194. Corrigendum in 42 (1991), 249251. [58] H. Edelsbrunner, L.J. Guibas and M. Sharir, The complexity and construction of many faces in arrangements of lines and of segments. Discrete Comput. Geom. 5 (1990), 161196. [59] H. Edelsbrunner, H.A. Maurer, P.P. Preparata, A.L. Rosenberg, E. Welzl and D. Wood, Stabbing line segments, BIT 22 (1982), 274281. [60] H. Edelsbrunner, J. O'Rourke and R. Seidel, Constructing arrangements of lines and hyperplanes with applications, SIAM J. Comput. 15 (1986), 341363.
44
RK. Agarwal and M. Sharir
[61] H. Edelsbrunner, R. Seidel and M. Sharir, On the zone theorem for hyperplane arrangements, SIAM J. Comput. 22 (1993), 418^29. [62] H. Edelsbrunner and M. Sharir, The maximum number of ways to stab n convex nonintersecting sets in the plane is In  2, Discrete Comput. Geom. 5 (1990), 3542. [63] A. Efrat, Finding approximate matching ofpoints and segments under translation. Unpublished manuscript (1995). [64] A. Efrat and M. Sharir, A nearlinear algorithm for the planar segment center problem. Discrete Comput. Geom. 16 (1996), 239257. [65] P. Egyed and R. Wenger, Ordered stabbing ofpairwise disjoint convex sets in linear time. Abstracts 1st Canad. Conf. Comput. Geom. (1989), 23. [66] D. Eppstein, Geometric lower bounds for parametric optimization problems. Discrete Comput. Geom. 20 (1998), 463476. [67] R Erdos, L. Lovasz, A. Simmons and E. Straus, Dissection graphs of planar point sets, A Survey of Combinatorial Theory, J.N. Srivastava, ed., NorthHolland, Amsterdam (1973), 139154. [68] H. Everett, J.M. Robert and M. van Kreveld, An optimal algorithm for the (^k)levels, with applications to separation and transversal problems, Intemat. J. Comput. Geom. Appl. 6 (1996), 247261. [69] S.J. Fortune, A sweepline algorithm for Voronoi diagrams, Algorithmica 2 (1987), 153174. [70] J.J. Fu and R.C.T. Lee, Voronoi diagrams of moving points in the plane, Intemat. J. Comput. Geom. Appl. 1 (1991), 2332. [71] Z. Furedi and R Hajnal, DavenportSchinzel theory of matrices. Discrete Math. 103 (1992), 233251. [72] D. Gardy and D. GouyouBeauchamps, Enumeration of some DavenportSchinzel sequences. Report 564, Universite de ParisSud, Paris (1990). [73] J.E. Goodman, R. Pollack and R. Wenger, Geometric transversal theory. New Trends in Discrete and Computational Geometry, J. Pach, ed.. SpringerVerlag, HeidelbergNew YorkBerlin (1993), 163198. [74] L. Guibas, J.S.B. Mitchell and T. Roos, Voronoi diagrams of moving points in the plane, Proc. 17th Intemat. Workshop GraphTheoret. Concepts Comput. Sci., Lecture Notes in Comput. Sci. 570, SpringerVerlag (1991), 113125. [75] L.J. Guibas, M. Sharir and S. Sifrony, On the general motion planning problem with two degrees of freedom. Discrete Comput. Geom. 4 (1989), 491521. [76] P. Gupta, R. Janardan and M. Smid, Fast algorithms for collision and proximity problems involving moving geometric objects, Proc. 2nd Annu. European Sympos. Algorithms, Lecture Notes in Comput. Sci. 855, SpringerVerlag (1994), 278289. [77] D, Halperin and M. Sharir, New bounds for lower envelopes in three dimensions, with applications to visibility in terrains. Discrete Comput. Geom. 12 (1994), 313326. [78] S. HarPeled, The Complexity of Many Cells in the Overlay of Many Arrangements, M.S. thesis, Dept. Computer Science, Tel Aviv University, Tel Aviv, Israel (1995). [79] S. HarPeled, TM. Chan, B. Aronov, D. Halperin and J. Snoeyink, The complexity of a single face of a Minkowski sum, Proc. 7th Canad. Conf. Comput. Geom. (1995), 9196. [80] S. Hart and M. Sharir, Nonlinearity of DavenportSchinzel sequences and of generalized path compression schemes, Combinatorica 6 (1986), 151177. [81] J. Hershberger, Finding the upper envelope ofn line segments in 0{n \ogn) time. Inform. Process. Lett. 33 (1989), 169174. [82] D.P. Huttenlocher and K. Kedem, Computing the minimum Hausdorjf distance for point sets under translation, Proc. 6th Annu. ACM Sympos. Comput. Geom. (1990), 340349. [83] D.P. Huttenlocher, K. Kedem and J.M. Kleinberg, On dynamic Voronoi diagrams and the minimum Hausdorff distance for point sets under Euclidean motion in the plane, Proc. 8th Annu. ACM Sympos. Comput. Geom. (1992), 110120. [84] D.P. Huttenlocher, K. Kedem and M. Sharir, The upper envelope of Voronoi surfaces and its applications. Discrete Comput. Geom. 9 (1993), 267291. [85] H. Hwang, R. Chang and H. Tu, The separability problem in dynamic computational geometry, UnpubUshed manuscript (1990). [86] K. Imai, S. Sumino and H. Imai, Minimax geometric fitting of two corresponding sets of points, Proc. 5th Annu. ACM Sympos. Comput. Geom. (1989), 266275.
DavenportSchinzel
sequences and their geometric applications
45
[87] M. Katchalski, T. Lewis and A. Liu, The different ways of stabbing disjoint convex sets. Discrete Comput. Geom. 7 (1992), 197206. [88] N. Katoh, T. Tokuyama and K. Iwano, On minimum and maximum spanning trees of linearly moving points. Discrete Comput. Geom. 13 (1995), 161176. [89] M.J. Katz, 3D vertical ray shooting and 2D point enclosure, range searching and arc shooting amidst convex fat objects. Research Report 2583, INRIA, BP93, 06902 SophiaAntipolis, France (1995). [90] K. Kedem, R. Livne, J. Pach and M. Sharir, On the union of Jordan regions and collisionfree translational motion amidst polygonal obstacles, Discrete Comput. Geom. 1 (1986), 5971. [91] K. Kedem and M. Sharir, An efficient motion planning algorithm for a convex rigid polygonal object in 2dimensional polygonal space. Discrete Comput. Geom. 5 (1990), 4375. [92] K. Kedem, M, Sharir and S. Toledo, On critical orientations in the KedemSharir motion planning algorithm for a convex polygon in the plane. Discrete Comput. Geom. 17 (1997), 227240. [93] J. Ketonen and R. Solovay, Rapidly growing Ramsey functions, Ann. of Math. 113 (1981), 267314. [94] M.M. Klawe, Superlinear bounds on matrix searching, Proc. 1st ACMSIAM Sympos. Discrete Algorithms (1990) 485^93. [95] M. Klazar, A general upper bound in extremal theory of sequences. Comment. Math. Univ. Carolin. 33 (1992), 737746. [96] M. Klazar, Two results on a partial ordering of finite sequences. Comment. Math. Univ. Carolin. 34 (1993), 667675. [97] M. Klazar, A linear upper bound in extremal theory of sequences, J. Combin. Theory Ser. A 68 (1994), 454^64. [98] M. Klazar, Combinatorial Aspects of DavenportSchinzel Sequences, PhD thesis. Department of Applied Mathematics, Charles University, Prague, Czech Republic (1995). [99] M. Klazar and P. Valtr, Generalized DavenportSchinzel sequences, Combinatorica 14 (1994), 463^76. [100] P. Komjath, A simplified construction of nonlinear DavenportSchinzel sequences, J. Combin. Theory Ser. A 49 (1988), 262267. [101] D. T. Lee, Twodimensional Voronoi diagrams in the Lpmetric, J. ACM 27 (1980), 604618. [102] D. Leven and M. Sharir, Intersection and proximity problems and Voronoi diagrams. Advances in Robotics 1: Algorithmic and Geometric Aspects of Robotics, J.T. Schwartz and C.K. Yap, eds, Lawrence Erlbaum Associates, Hillsdale, NJ (1987), 187228. [103] D. Leven and M. Sharir, On the number of critical free contacts of a convex polygonal object moving in twodimensional polygonal space. Discrete Comput. Geom. 2 (1987), 255270. [104] L. Lovasz, On the number of halving lines, Annal. Univ. Scie. Budapest, de Rolando Eotvos Nominatae, Sectio Math. 14 (1971), 107108. [105] J. Matousek, J. Pach, M. Sharir, S. Sifrony and E. Welzl, Fat triangles determine linearly many holes, SIAM J. Comput. 23 (1994), 154169. [106] J. Matousek and P. Valtr, The complexity of the lower envelope of segments with h endpoints. Intuitive Geometry, CoUoq. Math. Societ y Janos Bolyai, NorthHolland, Amsterdam (1997), 407411. [107] N. Megiddo, Dynamic location problems, Oper. Res. 6 (1986), 313319. [108] W. Mills, Some DavenportSchinzel sequences, Congressus Numer. IX: Proc. 3rd Manitoba Conf. on Numer. Math, and Computing, R. Thomas and H. WiUiams, eds (1973), 307313. [109] J.S.B. Mitchell, D.M. Mount and C.H. Papadimitriou, The discrete geodesic problem, SIAM J. Comput. 16 (1987), 647668. [110] C. Monma and S. Suri, Transitions in geometric minimum spanning trees. Discrete Comput. Geom. 8 (1992), 265293. [ I l l ] D.M. Mount, The number of shortest paths on the surface of a polyhedron, SIAM J. Comput. 19 (1990), 593611. [112] R. MuUin and R. Stanton, A maptheoretic approach to DavenportSchinzel sequences. Pacific J. Math. 40 (1972), 167172. [113] K. Mulmuley, Hidden surface removal with respect to a moving point, Proc. 23rd Annu. ACM Sympos. Theory Comput. (1991), 512522. [114] K. Mulmuley, On levels in arrangements and Voronoi diagrams. Discrete Comput. Geom. 6 (1991), 307338.
46
RK. Agarwal and M. Sharir
[115] K. Mulmuley, Computational Geometry: An Introduction Through Randomized Algorithms, PrenticeHall, Englewood Cliffs, NJ (1994). [116] T. Ottmann and D. Wood, Dynamical sets of points, Comput. Vision Graph. Image Process. 27 (1984), 157166. [117] J. Pach and M. Sharir, On vertical visibility in arrangements of segments and the queue size in the BentleyOttmann line sweeping algorithm, SIAM J. Comput. 20 (1991), 460470. [118] J. Pach, W. Steiger and E. Szemeredi, An upper bound on the number of planar ksets. Discrete Comput. Geom. 7 (1992), 109123. [119] C.H. Papadimitriou, An algorithm for shortestpath motion in three dimensions. Inform. Process. Lett. 20 (1985), 259263. [120] C.H. Papadimitriou and E.B. Silverberg, Optimal piecewise linear motion of an object among obstacles, Algorithmica 2 (1987), 523539. [121] J. Paris and L. Harrington, A mathematical incompleteness in Peano arithmetic. Handbook of Mathematical Logic, J. Barwise, ed., NorthHolland, Amsterdam (1977), 11331142. [122] C. Peterkin, Some results on DavenportSchinzel sequences, Congressus Numer. IX: Proc. 3rd Manitoba Conf. on Numer. Math, and Computing, R. Thomas and H. Williams, eds (1973), 337344. [123] R. Pollack, M. Sharir and S. Sifrony, Separating two simple polygons by a sequence of translations. Discrete Comput. Geom. 3 (1988), 123136. [124] P.P. Preparata and M.I. Shamos, Computational Geometry: An Introduction, SpringerVerlag, New York (1985). [125] E. Ramos, Intersection of unitballs and diameter of a point set in R^, Comput. Geom. 8 (1997), 5765. [126] H. Rogers, Theory of Recursive Functions and Effective Computability, McGrawHill, New York (1967). [ 127] T. Roos, Voronoi diagrams over dynamic scenes, Proc. 2nd Canad. Conf. Comput. Geom. (1990), 209213. [128] T. Roos, Dynamic Voronoi diagrams, PhD thesis, Bayerische JuliusMaximiliansUniv., Wurzburg, Germany (1991). [129] T. Roos, Tighter bounds on Voronoi diagrams of moving points, Proc. 5th Canad. Conf. Comput. Geom. (1993), 358363. [130] D. Roselle, An algorithmic approach to DavenportSchinzel sequences, Utilitas Math. 6 (1974), 9193. [131] D. Roselle and R. Stanton, Results on DavenportSchinzel sequences, Congressus Numer. I, Proc. Louisiana Conf. on Combinatorics, Graph Theory, and Computing, R. Mullin et al., eds (1970), 249267. [132] D. Roselle and R. Stanton, Some properties of DavenportSchinzel sequences. Acta Arith. 17 (1971), 355362. [133] C. Schevon and J. O'Rourke, The number of maximal edge sequences on a convex polytope, Proc. 26th AUerton Conf. Commun. Control Comput. (1988), 4957. [134] C. Schevon and J. O'Rourke, An algorithm for finding edge sequences on a polytope. Technical Report JHU89/03, Dept. Comput. Sci., Johns Hopkins Univ., Baltimore, MD (1989). [135] J.T. Schwartz and M. Sharir, On the twodimensional DavenportSchinzel problem, J. Symbolic Comput. 10(1990), 371393. [136] R. Seidel, Backwards analysis of randomized geometric algorithms. New Trends in Discrete and Computational Geometry, J. Pach, ed.. SpringerVerlag, Heidelberg, Germany (1993), 3768. [137] M. Sharir, Almost linear upper bounds for the length of general DavenportSchinzel sequences, Combinatorica7(1987), 131143. [138] M. Sharir, Improved lower bounds on the length of DavenportSchinzel sequences, Combinatorica 8 (1988), 117124. [ 139] M. Sharir, A note on the PapadimitriouSilverberg algorithm for planning optimal piecewise linear motion of a ladder. Inform. Process. Lett. 32 (1989), 187190. [140] M. Sharir, On ksets in arrangements of curves and surfaces. Discrete Comput. Geom. 6 (1991), 593613. [141] M. Sharir, Almost tight upper bounds for lower envelopes in higher dimensions. Discrete Comput. Geom. 12 (1994), 327345. [142] M. Sharir and P.K. Agarwal, DavenportSchinzel Sequences and Their Geometric Applications, Cambridge University Press, New York (1995). [143] M. Sharir and A. Schorr, On shortest paths in polyhedral spaces, SIAM J. Comput. 15 (1986), 193215. [144] M. Sharir and S. Toledo, Extremal polygon containment problems, Comput. Geom. 4 (1994), 99118.
DavenportSchinzel
sequences and their geometric applications
Al
[145] P. Shor, Geometric realization of superlinear DavenportSchinzel sequences: I. Line segments. Unpublished manuscript (1990). [146] P. Shor, Private communication (1990). [147] R. Stanton and P. Dirksen, DavenportSchinzel sequences, Ars Combinatorica 1 (1976), 4351. [148] R. Stanton and D. Roselle, A result on DavenportSchinzel sequences. Combinatorial Theory and Its Applications, Colloq. Math. Society Janos Bolyai, Vol. 4, P. Erdos et al., eds, NorthHolland, Amsterdam (1969), 10231027. [149] E. Szemeredi, On a problem of Davenport and Schinzel, Acta Arith. 25 (1974), 213224. [150] H. Tamaki and T. Tokuyama, How to cut pseudoparabolas into segments. Discrete Comput. Geom. 19 (1998), 265290. [151] A. Tamir, Improved complexity bounds for center location problems on networks by using dynamic data structures, SIAM J. Discrete Math. 1 (1988), 377396. [152] J.R. Sack and J. Urrutia, eds, Handbook on Computational Geometry, Elsevier Science B.V., Amsterdam, the Netherlands (1999). [153] P. Valtr, Generalization of DavenpartSchinzel sequences. Contemporary Trends in Discrete Mathematics, J. Nesetril et al., eds., DIMACS Ser. Discrete Math. Theoret. Comput. Sci., 349389. [154] A. Wiemik and M. Sharir, Planar realizations of nonlinear DavenportSchinzel sequences by segments. Discrete Comput. Geom. 3 (1988), 1547.
This Page Intentionally Left Blank
CHAPTER 2
Arrangements and Their Applications^ Pankaj K. Agarwal Center for Geometric Computing, Department of Computer Science, Box 90129, Duke University, Durham, NC 277080129, USA Email:
[email protected] Micha Sharir School of Mathematical Sciences, Tel Aviv University, Tel Aviv 69978, Israel; and Courant Institute of Mathematical Sciences, New York University, New York, NY 10012, USA Email: sharir®math. tau. ac. il
Contents 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Introduction Preliminaries Lower envelopes Single cells Zones Levels Many cells and incidences Generalized Voronoi diagrams Union of geometric objects Decomposition of arrangements 10.1. Triangulating hyperplane arrangements 10.2. Vertical decomposition 10.3. Other decomposition schemes 10.4. Cuttings 11. Representation of arrangements 12. Computing arrangements 13. Computing substructures in arrangements 13.1. Lower envelopes
51 53 58 66 68 71 76 79 81 84 84 84 87 88 88 90 93 93
*Work by P.A. was supported by Army Research Office MURI grant DAAH049610013, by a Sloan fellowship, by an NYI award, and by a grant from the U.S.Israeli Binational Science Foundation. Work by M.S. was supported by NSF Grants CCR9122103 and CCR9311127, by a MaxPlanck Research Award, and by grants from the U.S.Israeli Binational Science Foundation, the Israel Science Fund administered by the Israeli Academy of Sciences, and the G.I.F., the GermanIsraeli Foundation for Scientific Research and Development.
HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved
49
50
RK. Agarwal and M. Sharir
13.2. Single cells 13.3. Levels 13.4. Marked cells 13.5. Union of objects 14. Applications 14.1. Range searching 14.2. Terrain visualization 14.3. Transversals 14.4. Geometric optimization 14.5. Robotics 14.6. Molecular modeling 15. Conclusions References
95 96 97 97 98 98 99 100 101 104 105 106 106
Abstract The arrangement of a finite collection of geometric objects is the decomposition of the space into connected cells induced by them. We survey combinatorial and algorithmic properties of arrangements of arcs in the plane and of surface patches in higher dimensions. We present many applications of arrangements to problems in motion planning, visualization, range searching, molecular modeling, and geometric optimization. Some results involving planar arrangements of arcs have been presented in Chapter 1 of this Handbook, and are extended in this chapter to higher dimensions.
Arrangements and their applications
51
1. Introduction The arrangement of a finite collection F of geometric objects in M^, denoted by A{r), is the decomposition of the space into relatively open connected cells of dimensions 0 , . . . , J induced by /", where each cell is a maximal connected set of points lying in the intersection of a fixed subset of F. Besides being interesting in their own right, because of the rich geometric, combinatorial, algebraic, and topological structures that arrangements possess, they also lie at the heart of several geometric problems arising in a wide range of applications including robotics, computer graphics, molecular modeling, and computer vision. Before proceeding further, we present a few such examples. (a) Assume that we have a robot system B with d degrees of freedom, i.e., we can represent each placement of 5 as a point in R^, and we call the space of all placements the configuration space of B. Suppose the threedimensional workspace of B is cluttered with polyhedral obstacles whose shapes and locations are known. B is allowed to move freely in a motion that traces a continuous path in the configuration space, but B has to avoid collision with the obstacles. For each combination of a geometric feature (vertex, edge, face) of an obstacle and a similar feature (face, edge, vertex) of B, define their contact surface as the set of all points in E^ that represent placements of B at which contact is made between these specific features. Let F be the set of all contact surfaces. Let Z be a point corresponding to a given imiidX free placement of B, i.e., a placement at which it does not intersect any obstacle. Then the set of all free placements of B that can be reached from Z via a collisionfree continuous motion corresponds to the cell containing Z in the arrangement of the contact surfaces. Thus, the problem of determining whether there exists a collisionfree path from an initial configuration / to a final configuration F is equivalent to determining whether / and F lie in the same cell of A{F). This close relationship between arrangements and motion planning has led to considerable work on arrangements; see, for example, [22,54,211,221,242,243,250,254,330]. If we want to compute the set of all placements reachable from the initial placement / , the combinatorial complexity of the cell in A{F) containing / , i.e., the total number of lowerdimensional faces appearing on its boundary, serves as a trivial lower bound for the running time. It turns out that in many instances one can design motionplanning algorithms whose performance almost matches this bound. (b) A molecule can be modeled as an arrangement of spheres, where the radius of each sphere depends on the atom that it models and the position of each sphere depends on the molecular structure. In the van der Waals model, a molecule is a family of possibly overlapping spheres, where the radius of each sphere is determined by the van der Waals radius of the corresponding atom in the molecule. Lee and Richards [251] proposed another model, called solvent accessible model, which is used to study the interaction between the protein and solvent molecules. Also in this model, a molecule is modeled as a sphere, but the balls representing the solvent molecules are shrunk to points and the balls representing atoms in the protein are inflated by the same amount [313]. Even though these models ignore various properties of molecules, they have been useful in a variety of applications. Many problems in molecular modeling can be formulated as problems related to arrangements of spheres. For example, computing the "outer surface" of the molecule corresponds to computing the
52
RK. Agarwal and M. Sharir
unbounded cell of the corresponding arrangement of spheres. See [145,146,216,222,277] for more details on applications of arrangements in molecular biology. (c) Arrangements are also attractive because of their relationship with several other structures. For example, using the duality transform, a point /? = ( p i , . . . , pd) in R^ can be mapped to the hyperplane X!/=i ^iPi — 1' ^^^ ^^^^ versa. This facilitates the formulation of several problems related to point configurations in terms of arrangements of hyperplanes. See [110,142] for a small sample of such problems. The GrassmannPlucker relation transforms /^flats in R^ to hyperplanes or points in R", for u = (f^\) — 1 [74,226]; e.g., lines in M? can be mapped to hyperplanes or points in R^. Therefore many problems involving lines in R^ have been solved using hyperplane arrangements in R^ [107, 139,301,334]. The wellknown combinatorial structure oriented matroids of rank A: + 1 are closely related to arrangements of pseudohyperplanes in R^ [74,314], and zonotopes in R^ correspond to hyperplane arrangements in R^~' [142,362]. Several applications of arrangements in singularity theory, algebraic group theory, and other fields of mathematics can be found in [288,290,291]. Study of arrangements of lines and hyperplanes has a long, rich history. The first paper on this topic is perhaps by J. Steiner in 1826 [337], in which he obtained bounds on the number of cells in arrangements of lines and circles in the plane and of planes and spheres in R^. His results have since been extended in several ways [3234,87,315,356,360,361]. A summary of early work on arrangements of hyperplanes can be found in the monograph and the survey paper by Griinbaum [198,199]. Most of the work on hyperplane arrangements until the 1980s dealt with the combinatorial structure of the entire arrangement or of a single cell in the arrangement (i.e., a convex polyhedron), and with the algebraic and topological properties of the arrangement [179,289291]. Various substructures and algorithmic issues of hyperplane arrangements, motivated by problems in computational and combinatorial geometry, have received attention mostly during the last fifteen years. Although hyperplane arrangements possess a rich structure, many applications (e.g., the motionplanning problem and the molecular models described above) call for a systematic study of higherdimensional arrangements of patches of algebraic surfaces. For more than a century, researchers in algebraic geometry have studied arrangements of algebraic surfaces, but their focus has largely been on algebraic and combinatorial issues rather than on algorithmic ones. Considerable progress has been made on all fronts during the last fifteen years. It is beyond the scope of a survey paper, or even of a book, to cover all aspects of arrangements. In this chapter we will survey combinatorial and algorithmic problems on arrangements of (hyper)surfaces (or of surface patches) in real affine space R^. (Hyperplane arrangements in complex space have also been studied; see, e.g., [75,291].) We will assume that J is a small constant, that the surfaces are algebraic and their degree is bounded by a constant, and that any surface patch is a semialgebraic set defined by a Boolean combination of a constant number of polynomials of constant maximum degree. There has also been some recent work on combinatorial and algorithmic issues involving arrangements of more general surfaces, known as semiPfaffian sets, which include graphs of trigonometric, exponential, or logarithmic functions on bounded domains [189,245]. We also note that a study of algebraic and topological problems on arrangements of algebraic surfaces can be found in [76]. In this survey we will mostly review the known results on the com
Arrangements
and their applications
53
Fig. 1. An arrangement of lines.
binatorial complexity of various substructures of arrangements, the known algorithms for computing these substructures, and the geometric applications that benefit from these results. Many other combinatorial problems related to arrangements are discussed in [74, 180,192,293,294,332,306,336,362]. An excellent source on combinatorial and algorithmic results on arrangements of hyperplanes is the book by Edelsbrunner [142]. The book by the authors [330] covers some of the topics discussed here in more detail. Other survey papers on arrangements include [205,213,220,327]. This survey is organized as follows. In Section 2 we define arrangements formally, state the assumptions we will be making in this survey, and discuss the known bounds on the complexity of entire arrangements. Sections 310 discuss combinatorial complexities of various substructures of arrangements. Section 11 discusses several methods for representing arrangements. Section 12 describes algorithms for computing the entire arrangement, and Section 13 reviews algorithms for computing various substructures of arrangements. We discuss a few applications of arrangements in Section 14.
2. Preliminaries Let F = {yi,..., y^} be a collection of n (hyper)surfaces or surface patches in M^. The set r induces a decomposition of R^ into connected cells (or faces), called the arrangement of r and denoted A{r), so that each cell is a maximal connected subset of the intersection of a fixed (possibly empty) subset of surface patches that avoids all other surface patches. Thus a Jdimensional cell is a maximal connected region that does not meet any surface patch of r. The combinatorial complexity of A{r) is the total number of cells, of all dimensions, in A{r). The combinatorial complexity of a ^dimensional cell C in A{r) is the number of cells of A{r) of dimension less than k that are contained in the boundary ofC. We assume that F satisfies the following assumptions. (Al) Each Yi G T is a semialgebraic set of constant description complexity. The local dimension of every point 'mythd —\} A subset of M is called a real semialgebraic set if it is obtained as a finite Boolean combination of sets of the
54
RK. Agarwal and M. Sharir
(A2) Each Yi ^ ^ i^ of the form {Qt = 0) A Ft (Pi, at, 0, Pi^crt^O,..., P/.a/^O). Here u is a constant; atj G {^, ^ } ; F/ is a Boolean formula; Q/, Pi,,..., Pi^^ G R[xi,...,xHn^(p(n^O{nkg(n)). Next, we derive a recurrence for 0 ( F ) , which will solve to 0(n^^^). Fix a regular vertex V of J\4(F). Let V be the corresponding vertex of L(F) (since v is an inner vertex, v is well defined). Suppose v is one of the two intersection points of three surface patches, say, yi, ]/2, K3. Assume, without loss of generality, that if \yi Ci y2 H y^\ = 2, then the xicoordinate of the other intersection point of yi,y2, and ys is larger than that of v. Since i) is a regular vertex, one of the three pairwiseintersection curves yS/j, say fin, lies above L(F) in the halfspace x\ < X](v) in a sufficiently small neighborhood of v. We mark on
62
P.K. Agarwal and M. Sharir
P\2 the intersection points of ^12 with other surface patches of F and the points that he above the boundaries of other surface patches in F. We fix a parameter t = t(e) and follow fin in the (—j^i)direction, starting from 0, until one of the following three events occurs:^ (CI) wereachtheleftendpointof ^12; (C2) P\2 appears on L(F); or (C3) we crossed t marked points on )^i2. We call V a vertex of type (C/), for f = 1, 2, 3, if we first reach an event of type (Ci). If (CI) occurs, we charge v to the left endpoint of yS 12. Since each endpoint is charged at most twice, the total number of regular vertices of type (CI) is 0(n^). If (C2) occurs, then we must have passed above the boundary of 5/3 while following P\2 because ^^12 hes strictly above ya in the halfspace x\ < x\(v). Let w be the marked point on ^612 lying above dy^ that we have visited. We charge i; to u;. Suppose w lies above an edge e of dy^. We can define Ce and Fe as above; then if is a vertex of A(Fe). Since (C2) occurred before (C3), at most t marked points lie on )6i2 between v and w, which implies that less than t arcs of Fe lie below w. As shown in [326], the number of vertices of A(Fe) that he above at most t arcs is 0(tXg (n)). Summing over all edges of domain boundaries, the number of marked points on intersection arcs to which a vertex of type (C2) is charged is 0{ntXq{n)). Since each marked point is charged 0(1) times, the number of type (C2) vertices is 0(ntXq (n)). Finally, if (C3) occurs, then we charge l/t to each marked point on ^12 that we visited. Each marked point will be charged only 0 ( 1 / 0 units, and each such marked point lies above at most t surface patches of F. Theorem 6.1 in Section 6 implies that the number of such marked points, summed over all intersection curves, is O(rV*(«/0) The total number of vertices of type (C3) is thus
0(1/0 • O(rV*(n/0) = 0{t^Hn/t) + nkc^n)). Hence, we obtain the following recurrence for 0(«): 0(^) ^ Af^0(  I \ BtnXqin), where A and B are constants (depending on b). The solution of the above recurrence is (t>(n) =
0{tn^^^''^'^kq(n)).
If t = t(e) is chosen sufficiently large, then (pin) = 0(n^~^^). This proves the theorem for d = 3,s = 2. For 5 > 2, Sharir [326] introduces the notion of index of a regular vertex. The index of a vertex v e f^i^^ yi is the number of points of H/^i Yi whose x\ coordinates are less than that of i;. For 0 < 7 < 5, let (j)^J\F) be the number of regular vertices in L(F) of index j . Then0(r) = j:}i;)0O)(r). ^ If the x\ coordinate of the other intersection point of yi,y2, and 73 were smaller than that of O, we would have traced ^12 in the (+jci)direction.
Arrangements and their applications
63
Modifying the above argument slightly, Sharir derived a system of recurrences for the quantities 0^^^(r), for j < s. There are three main differences. First, the tracing of ^\2 is always done in the decreasing X]direction. Second, the value of the parameter t now depends on j and is denoted by tj. Third, there is one more stopping criterion: (C4) P\2 intersects yy, let z be the (first) intersection point. Using the fact that the index of z is < j — 1 and that at most tj surface patches lie below z, Sharir derives the following recurrence for (p^J^n) = msLX\r\=n 0^^H^)0 O  ) ( ^ ) ^ A ,  . > * ( j ^ ) + 5 , ( f  0 O   i ) ^ ^— I
\ntjXq(n)\.
By expanding this system of recurrences and by choosing the values of tj carefully, Sharir proved that the solution of this system satisfies 0*(n) = O(n2+"). The theorem is proved in higher dimensions by induction on d, using a similar charging scheme. See the original paper by Sharir for details. D OPEN PROBLEM 1. Let F be a set ofn surface patches in M^ satisfying Assumptions (Al) and (A2). Is K(n,d) = 0{n^~^Xq (n)), where q is a constant depending on d and bl
Bounds in special cases. As noted above, sharper bounds are known on the complexity of lower envelopes in some special cases; see [319,330]. For example, if F is a set of pseudoplanes in M^, i.e., each triple of surfaces intersects in at most one point and the intersection of a pair of surfaces in F is a single (closed or unbounded) Jordan curve, then K{r) = 0(n). On the other hand, if F is a set of pseudospheres, i.e., each triple intersects in at most two points and the intersection curve of any pair is a single Jordan curve, then K(r) = 0(n^). If r is a. family of hypersurfaces in R*^, a sharper bound on K(r) can be proved using the socalled linearization technique. Here is a sketch of this technique. Let F = {yi,..., y^^} be a collection of hypersurfaces of degree at most b, i.e., each yi is the zero set of a Jvariate polynomial Qt of degree at most b. Let Q = { Q i , . . . , 2«}. We say that F admits a linearization of dimension k if, for some p > 0, there exists a (d + /?)variate polynomial g(x, a) = V^o(a) + V^i(a)^i(x) + V^2(a)^2(x) +
h i/k\(sL)(pki(x) + ^^^(x),
forxG R^,a e E^, so that, for each 1 < / < n, we have Qi(x) = g(x,ai) for some a/ e W. Here each V^y(a), for 0 ^ j ^ /:, is a /7variate polynomial, and each (pj(x), for 1 < j < ^ + 1, is a Jvariate polynomial. It is easily seen that such a polynomial representation always exists for p < d^'^^ — let the ^'s be the monomials that appear in at least one of the polynomials of Q, and let x/fj (a) = aj (where we think of a as the vector of coefficients of the monomials). We define a transform ^ : M*^ ^ M^ that maps each point in M.^ to the point ^(x) = {(pi(x), (p2(x),..., (pk(x));
64
RK. Agarwal and M. Sharir
the image (p(Er) is a Jdimensional algebraic surface 17 in R'^. For each function Qt (x) = g(x, a/), we define a A:variate Hnear function hi (y) = iAo(a/) + TAI (a/) ji + • • • + i/^jti (aOy^^i + jk. Let / / = {/i/ = 0 I 1 ^ / ^ n} be a set of n hyperplanes in R^. Let § be a vertex of L{r). If § is incident to y i , . . . , y j , then Q\{^) = ••• = Qd{^) = 0 and 2 J + I ( § ) O ^ J + I O , . . . , Qn(^)crnO, where cr, G {>, 0.
4. Single cells Lower envelopes are closely related to other substructures in arrangements, notably cells and zones. The lower envelope is a portion of the boundary of the bottommost cell of the arrangement, though the worstcase complexity of L{r) can be larger than that of the bottommost cell of A{r). In two dimensions, it was shown in [206] that the complexity of a single face in an arrangement of n arcs, each pair of which intersect in at most s points, is 0(Xs+2(w))» and so has the same asymptotic bound as the complexity of the lower envelope of such a collection of arcs. This suggest that the complexity of a single cell in an arrangement of n surface patches in E^ satisfying the Assumptions (Al) and (A2) is close to 0{n^~^). The Upper Bound Theorem impfies that the complexity of a single cell in arrangement of hyperplanes in R^ is 0{n^^f^^), and the linearization technique described in Section 3 implies that the complexity of a single cell in an arrangement of n spheres is 0(«^^/^^). However, the lowerbound construction for lower envelopes implies a lower bound of Q (n^~ ^«(«)) for the complexity of a single cell for arrangements of simplices.
Fig. 5. A single cell in an arrangement of segments.
Pach and Sharir [295] were the first to prove a subcubic upper bound on the complexity of a single cell in arrangements of triangles in R^. This bound was improved by Aronov and Sharir [52] to 0(n^/^), and subsequendy to 0(n^ log n) [54]. The latter approach extends to higher dimensions; that is, the complexity of a single cell in an arrangement ofn (d — 1)simplices in R^ is 0(n^~^ log«). A simpler proof was given by Tagansky [342]. These approaches, however, do not extend to nonlinear surfaces even in R^. Halperin [211,212] proved nearquadratic bounds on the complexity of a single cell in arrangement of certain classes of n bivariate surface patches, which arise in motionplanning applications. Halperin and Sharir [221] proved a nearquadratic bound on the
Arrangements and their applications
67
complexity of a single cell in an arrangement of the contact surfaces that arise in a rigid motion of a simple polygon amid polygonal obstacles in the plane, i.e., the surfaces that represent the placements of the polygon at which it touches one of the obstacles. The proof borrows ideas from the proof of Theorem 3.1. A nearoptimal bound on the complexity of a single cell in the arrangement of an arbitrary collection of surface patches in R^ satisfying Assumptions (Al) and (A2) was finally proved by Halperin and Sharir [219]: THEOREM 4.1 (Halperin and Sharir [219]). Let F be a set of surface patches in E^ satisfying Assumptions (Al) and (A2). For any £ > 0, the complexity of a single cell in A(F) IS 0(n^^')Jor any s > 0, where the constant of proportionality depends on s and on the maximum degree of the surface patches and of their boundaries.
The proof proceeds along the same lines as the proof of Theorem 3.1. However, they establish the following two additional results to "bootstrap" the recurrences that the proof derives. Let C be the cell of A(F) whose complexity we want to bound. (a) There are only O(n^) vertices v of the cell C that are locally xextreme (that is, there is a neighborhood N of v and a connected component C^ of the intersection of A^ with the interior of C, such that v lies to the left (in the xdirection) of all points of C\ or v lies to the right of all these points). (b) There are only 0(n^+^) vertices on popular faces of C, that is, 2faces / for which C lies locally near / on both sides of / . Property (a) is proved by an appropriate decomposition of C into 0(n^) subcells, in the style of a Morse decomposition of C (see [281]), so that each subcell has at most two points that are locally xextreme in C. Property (b) is proved by applying the machinery of the proof of Theorem 3.1, where the quantity to be analyzed is the number of vertices of popular faces of C, rather than all inner vertices. Once these two results are available, the proof of Theorem 3.1 can be carried through, with appropriate modifications, to yield a recurrence for the number of vertices of C, whose solution is 0(n^+^). We refer the reader to the original paper for more details. To extend the above proof to higher dimension appropriate extensions of both properties (a) and (b) have to be established. The extension of (a) requires topological considerations related to Morse theory, and the extension of (b) requires an inductive argument, in which bounds on the number of vertices of popular faces of all dimensions need to be derived, using induction on the dimension of the faces. Recently, Basu [67] showed that the topological complexity, i.e., the sum of the Betti numbers, of a single cell in an arrangement of n surface patches satisfying Assumptions (A1)(A2) is 0(n^~^). Using this result and the ideas in [219], he showed that the combinatorial complexity of a set of n surface patches in W^ satisfying Assumptions (Al) and (A2) is 0(n^~^~^^). He also showed that under certain geometric assumptions on surface patches the combinatorial complexity of a single cell is alsoO(n^i). The linearization technique in the previous section can be extended to bound the complexity of a cell as well, namely, one can prove the following.
68
RK. Agarwal and M. Sharir
THEOREM 4.2. Let r be a collection of n hypersurfaces in M^, of constant maximum degree b. If F admits a linearization of dimension k, then the combinatorial complexity of a cell ofA(r) is 0(n^^^'^^), where the constant ofproportionality depends on k, d, and b.
5. Zones Let F be a set of n surfaces in R^. The zone of a variety a (not belonging to F), denoted as zone(a; T), is defined to be the set of Jdimensional cells in A(r) that intersect a. The complexity of zone(a; F) is defined to be the sum of complexities of the cells of A(F) that belong to zone(a; F), where the complexity of a cell in A(F) is the number of faces of all dimensions that are contained in the closure of the cell. The complexity of a zone was first studied by Edelsbrunner et al. [157]; see also [110]. The "classical" zone theorem [142,159] asserts that the maximum complexity of the zone of a hyperplane in an arrangement of n hyperplanes in W^ is 0(n^~^), where the constant of proportionality depends on d. The original proof given by Edelsbrunner et al. [157] had some technical problems. A correct, and simpler, proof was given by Edelsbrunner et al. [159]. Their technique is actually quite general and can also be applied to obtain several other interesting combinatorial bounds involving arrangements. For example, the proof by Aronov and Sharir for the complexity of a single cell in arrangements of simphces [54] used a similar approach. Other results based on this technique can be found in [4,50,51]. We therefore describe the technique, as applied in the proof of the zone theorem: THEOREM 5.1 (Edelsbrunner, Seidel and Sharir [159]). The maximum complexity of the zone of a hyperplane in an arrangement of n hyperplanes
This result is easy to prove for d = 2; see Chapter 1. For a set F of n hyperplanes in R*^ and another hyperplane b, let r^ (b; F) denote the total number of ^faces contained on the boundary of cells in zone(b; F); each such /:face is counted once for each cell that it bounds. Let Ti^(n,d) = maxr^(b\ F), where the maximum is taken over all hyperplanes b and all sets F of n hyperplanes in R^. The maximum complexity of zone(b; F) is at most Ylk=o ^^ (^' ^) Thus the following lemma immediately implies the upper bound in Theorem 5.1. LEMMA
5.2. For each d and O^k
^d,
Tk(n,d) = 0{n'^^), where the constants ofproportionality depend on d and k. PROOF. We use induction on d. As just noted, the claim holds for d = 2. Assume that the claim holds for all 3, the same application of the zone theorem yields only Ylc l^l/c = 0(«^), where fc is the number of hyperplanes of F meeting the boundary of C. Using the same induction scheme as in the proof of Theorem 5.1, Aronov et al. [50] showed that
J2
C2 = 0(n^logLfJ^).
CeAiF)
It is believed that the right bound is 0(n^). Note that such a result does not hold for arrangements of simplices or of surfaces because the complexity of single cell can be Q{n^~^). The zone theorem for hyperplane arrangements can be extended as follows. THEOREM 5.3 (Aronov, Pellegrini and Sharir [51]). Let F be a set ofn hyperplanes in W^. Let a be a pdimensional algebraic variety of some fixed degree, or the relative boundary of any convex set with affine dimension /? + 1, for 0 ^ p ^ d. The complexity of the Zone(a; F) is 0(n^^^~^^^^^^ log^n), where ^ = d \ p (mod 2), and the bound is almost tight (up to the logarithmic factor) in the worst case.
In particular, for p = J — 1, the complexity of the zone is 0(n^~^ logn), which is almost the same as the complexity of the zone of a hyperplane in such an arrangement.
Arrangements and their applications
71
The proof proceeds along the same lines of the inductive proof of Theorem 5.1. However, the removal and reinsertion of a hyperplane y e F splits a face / of zone (a; F \ {y}) into two subfaces, both lying in zone (a; F), the charging scheme used in the proof of Theorem 5.1 becomes inadequate, because f C\ y need not belong to the zone of cr Pi y in the {d — 1)dimensional crosssection of A{F) along y. What is true, however, is that / n y is a face incident to a popular facet of zone {a \ F) along y, that is, a facet g ^ y whose two incident cells belong to the zone. Thus the induction proceeds not by decreasing the dimension of the arrangement (as was done in the proof of Theorem 5.1), but by reapplying the same machinery to bound the number of vertices of popular facets of the original zone (a; F). This in turn requires similar bounds on the number of vertices of lowerdimensional popular faces. We refer the reader to Aronov et al. [51] for more details. In general, the zone of a surface in an arrangement of n surfaces in W^ can be transformed to a single cell in another arrangement of 0(n) surface patches in M^. For example. Let 7^ be a set of n (d— l)simplices in R^, and let cr be a hyperplane. We split each y e F into two polyhedra at the intersection of A and a (if the intersection is nonempty), push these two polyhedra slightly away from each other, and, if necessary, retriangulate each polyhedron into a constant number of simplices. In this manner, we obtain a collection F^ of 0(n) simplices, and all cells of the zone of a in A(F) now fuse into a single cell of A(F^). Moreover, by the general position assumption, the complexity of the zone of cr in F is easily seen to be dominated by the complexity of the new single cell of A(F^). (The same technique has been used earlier in [150], to obtain a nearlinear bound on the complexity of the zone of an arc in a twodimensional arrangement of arcs.) Hence, the following theorem is an easy consequence of the result by Aronov and Sharir [54]. 5.4. The complexity of the zone of a hyperplane in an arrangement of n (d — \)simplices in R^ is 0(n^~^ logn).
THEOREM
Using a similar argument one can prove the following. THEOREM 5.5 (Basu [67]; Halperin and Sharir [219]). Let F be a collection ofn surface patches in M.^, satisfying Assumptions (Al) and (A2). The combinatorial complexity of the zone in A{F) of an algebraic surface a of some fixed degree is 0{n^~^^^), for any £ > 0, where the constant of proportionality depends on e, on the dimension on the maximum degree of the given surfaces and their boundaries, and on the degree of a.
Once the bound on the complexity of a single cell in an arrangement of general algebraic surfaces is extended to higher dimensions, it should immediately yield, using the same machinery, to a similar bound for the zone of a surface in such an arrangement.
6. Levels The level of a point p eW^ m an arrangement A{F) of a set F of surface patches satisfying (A1)(A3) is the number of surfaces of F lying vertically below p. For 0 < A: < n, we define klevel (resp. /n)). Applying Dey's result, the number of /:sets in a dense point set is 0(n^^^). Recently Alt et al. [38] have proved that if the points in S lie on a constant number of pairwise disjoint convex curves, then the number of ^sets in S is 0(n). See [118,174,235,236] for more results on planar ksets and their generalization. The following question is related to the complexity of levels in arrangements of lines: Let F be a set of n lines in the plane. Let FI be an xmonotone polygonal path whose vertices (the points at which 77 bends) are a subset of the vertices of A(r) and whose edges are contained in the lines of P. What is the maximum number of vertices in 77? Matousek [261] proved that there exists a set F of n lines in the plane that contains an Xmonotone path with Q(n^^^) vertices. No subquadratic upper bound is known for this problem.
76
RK. Agarwal and M. Sharir Table 1 Upper bounds on A:levels Objects
Bound
Source
Lines in B? Segments in M^ Planes in M^ Triangles in 'M? Hyperplanes in M^ Parabolas in M^ (Vertical axis)
0(«(Jt +1)^/3) 0{n{k + \)^/^a{n/{k+\))) 0{n{k + \)^^^) 0{r?{k+\)^/'^a{n/{k+\))) 0{n^d/2\^\d/l\Ed^^ 0(«23/12)
[134] [8,134] [8] [8,236] [352] [344]
Agarwal et al. [8] proved a nontrivial upper bound on the complexity of the ^level in an arrangement of segments. Combining their argument with that of Dey's, one can prove that the maximum complexity of the k\t\t\ in a planar arrangement of n segments is 0{n{k f \y/^a{n/{k + 1))). Very little is known on the complexity of a single level in an arrangement of n arcs in the plane. Recently, Tamaki and Tokuyama [344] proved that the complexity of any level in an arrangement of parabolas, each with a vertical axis, is 0^^23/12^ (Their bound actually applies io pseudoparabolas, i.e., graphs of continuous, totally defined, univariate functions, each pair of which intersect at most twice.) OPEN PROBLEM 3. (i) What is the maximum complexity of a level in an arrangement of n lines in the planel (ii) What is the maximum complexity of a level in an arrangement of n xmonotone Jordan arcs, each pair of which intersect in at most s points, for some constant s > \1
Barany et al. [64] proved an 0{n^~^) bound on the complexity of the k\t\t\ in arrangements of n planes in M^, for any k, for some absolute constant y > 0. The bound was improved by Aronov et al. [46] and Eppstein [173] to OC/i^/"^ poly log /i), and then by Dey and Edelsbrunner [135] to 0(«^/^). The best bound known, due to Agarwal et al. [8], is 0{n{k \ 1)^/^). They also proved a bound on the complexity of the A:level for arrangements of triangles in M^. A nontrivial bound on the complexity of the /clevel in an arrangement of n hyperplanes in J > 3 dimensions, of the form 0(n^~^''), for some constant Sd that decreases exponentially with d, was obtained in [36,352]. This has later been slightly improved to 0(n^^^'^^k^^^'^^~^'^) in [8]. Table 1 summarizes the known upper bounds on /:levels.
7. Many cells and incidences In the previous two sections we bounded the complexity of families of Jdimensional cells in A(r) that satisfied certain conditions (e.g., cells intersected by a surface, the cells of level at most k). We can ask a more general question: What is the complexity of any m distinct cells in AiF)! A single cell in an arrangement of lines in the plane can have n
Arrangements
and their applications
11
Table 2 Complexity of many cells Objects
Complexity
Source
Lines in M^ Segments in M^ Unit circles in M^
0{m^l^n^l^ +n) Q^^2/3^2/3 __ ^^^^^^ _^ ^ logm) Oim^^^n^^^a^^^in)+n)
[121] [48] [121]
Circles in M^
Q(^^3/5^4/54Q'(«)/5 _^ ^>,
Arcs in M^ Planes in M^ Hyperplanes in M^, J ^ 4
0(^Xq (n)) 0{m^/^n + n^) 0(m ^/^^^/^ log/^«) ;6 = ( L ^ / 2 J  l ) / 2
^21]
[150] [7] [50]
edges, but can the total complexity of m cells in an arrangement of lines be f2(mn)l This is certainly false for m = Q{n^). We can also formulate the above problem as follows: Let P be a set of m points and F a set of n surfaces in W^ satisfying Assumptions (Al) and (A2). Define C(P, F) to be the set of cells in A(F) that contain at least one point of P. Define /x(P, F) = Y1CGC(P r) 1^1 and fji(m,n,G) = max/x(P, F), where the maximum is taken over all sets P of m points and over all sets F of n surfaces in a given class G. Let L be the set of all lines in the plane. Canham [89] proved that /x(m,fi,L) = 0(m^ + n), from which it easily follows that /x(m, n, L) = 0{m^ {n). Although this bound is optimal for m ^ ^ , it is weak for larger values of m. Clarkson et al. [121] proved that iji(m,n,lj) = &(m^^^n^^^ + n). Their technique, based on random sampling, is general and constructive. It has led to several important combinatorial and algorithmic results on arrangements [121,204,205]. For example, following a similar, but considerably more involved, approach, Aronov et al. [48] proved that /x(m, n, E) = 0(m^/^n^/^ + m logn + na(n)), where E is the set of all line segments in the plane. An improved bound can be attained if the number of vertices in the arrangement of segments is small. Hershberger and Snoeyink [232] proved an 0(m^/^n^/^ + n) upper bound on the complexity of m distinct cells in the arrangements of n segments in the plane where the segments satisfy certain additional conditions. Although Clarkson et al. [121] proved nontrivial bounds on the complexity of m distinct cells in arrangements of circles (see Table 2 above), no tight bound is known. OPEN PROBLEM 4. What is the maximum complexity of m distinct cells in an arrangement ofn circles in the planel
Complexity of many cells in hyperplane arrangements in higher dimensions was first studied by Edelsbrunner and Haussler [155]. Let H be the set of all hyperplanes in M^. They proved that the maximum number of (d — 1)dimensional faces in m distinct cells in an arrangement of n hyperplanes in W^ is 0(m^^^n^^^ + n^~^). Refining an argument by Edelsbrunner et al. [153], Agarwal and Aronov [7] improved this bound to 0{m^^^n^/^ + n^~^). By a result of Edelsbrunner and Haussler [155], this bound is tight in the worst case.
78
RK. Agarwal and M. Sharir
Aronov et al. [50] proved that /x(m,n,H) = OCm^/^n^/^log^n), where ^ = ([d/l] l)/2. They also proved several lower bounds on /x(m,n,H): For odd values of d and m ^n, />6(m,n,H) = ©(m^L^/^J); for m of the form 6)(n^2^) where 0 < i^ < [d/2i is an integer, /x(m, n, H) = ^(m^/^n^^/^^); and for arbitrary values of m, /x(m,«, H) = ^(m^/^n^/^i/4). Agarwal [4], Guibas et al. [201], and Halperin and Sharir [217] obtained bounds on "special" subsets of cells in hyperplane arrangements. A problem closely related to, but somewhat simpler than, the manycells problem is the incidence problem. Here is a simple instance of this problem: Let 7" be a set of n lines and P a. set of m points in the plane. Define X(P, F) = ^Z^er 1^ f^ ^h set T(m, n) = max J ( P , F), where the maximum is taken over all sets P of m distinct points and over all sets F of n distinct lines in the plane. Of course, this problem is interesting only when the lines in F are in highly degenerate position. If n = m^ \mi1, then a finite projective plane of order m has n points and n lines and each line contains m\l = Q (n^/^) points, so the number of incidences between n points and n lines is Q(n^^^). Szemeredi and Trotter [339] proved that such a construction is infeasible in R^. In a subsequent paper, Szemeredi and Trotter [340] proved that l(m, n) = 0{ni^f^n^f^ \m\n). Their proof is, however, quite intricate, and an astronomic constant is hidden in the bigO notation. Their bound is asymptotically tight in the worst case, as shown in [165]. A considerably simpler proof, with a small constant of proportionality in the bound, was given by Clarkson et al. [121], based on the randomsampling technique. In fact, the bound on many cells in arrangements of lines immediately yields a similar bound on X(m, n) [121], but the proof can be somewhat simplified for the incidence problem. Here we present an even more elegant and simpler proof, due to Szekely [338], for the bound on J(m, n) using Lemma 6.4: THEOREM 7.1 (Szemeredi and Trotter [340]). Let F be a set ofn lines and P a set ofm points in the plane. Then
X(P, F) = 0(n?l^n^l^ + m h «). PROOF. We construct a geometric graph G = (V, £) whose vertices are the points of P. We connect two vertices /?, ^ by an edge if the points p and q are consecutive along a line in F. Each edge of G is a portion of a line of F, and no two edges overlap. Therefore at most (2) pairs of edges cross each other. Note that X(P, F) ^ \E\\n. \f\E\^ 4m, there is nothing to prove. Otherwise, by Lemma 6.4,
0 n\
\E\^
1
\3
which implies that J ( P , F) = 0(m^l^n^l^ + «).
D
Valtr [348] has studied the incidence problem and its generalization for dense point sets, where the ratio of the maximum and the minimum distances in P is at most O(v^). The incidence problem has been studied for other curves as well. Of particular interest is the number of incidences between points and unit circles in the plane [121,335] because of its close relationship with the following major open problem in combinatorial geometry.
Arrangements and their applications
79
which was originally introduced by Erdos in 1946 [175]: Let S be a set ofn points in the plane. How many pairs of points in S are at distance 1? Spencer et al. [335] had proved, by modifying the proof of Szemeredi and Trotter [340], that the number of incidences between m points and n unit circles is Oim^^^n^^^ \ m \ n). The proofs by Clarkson et al. [121] and by Szekely [338] have been extended to this case. The incidence bound implies that the number of unit distances between the points of S is 0(/i^/^). However, the best known lower bound on the number of unit distances is only ^i+^((iogiog^)/iog") [175] (see also [294]). OPEN PROBLEM
5. How many pairs of points in a given planar set of points are at dis
tance 1? Furedi [188] showed that if points in S are in convex position, then the number of pairs at distance 1 is 0{n log^); the best known lower bound is 7n — 12 by Edelsbrunner and Hajnal [154]. The best known upper bound on the unit distances in R^ is 0{n^^^) [121]. Let 5* be a set of n points in M^ so that no four points of P lie on a circle, then the number of pairs of points in S at unit distance is 0{n^^^^) [204]. We can state the incidence problem in higher dimensions. If we do not make any additional assumptions on points and surfaces, the maximum number of incidences between m points and n planes is obviously mn: Take a set of n planes passing through a common line and place m points on this line. Agarwal and Aronov [7] proved that if F is a set of n planes and P is a set of m points in M^ so that no three points in P are colinear, then 1{P, F) = 0{m^^^n'^^^ \m\n). Edelsbrunner and Sharir [160] showed that if /" is a set of n unit spheres in R^ and P is a set of m points so that none of the points in P lies in the interior of any sphere, then X{P, F) = 0{m^/^n^'^ \m\n). See [204,297] for other results on incidences in higher dimensions.
8. Generalized Voronoi diagrams An interesting application of the new bounds on the complexity of lower envelopes is to generalized Voronoi diagrams in higher dimensions. Let 5 be a set of n pairwisedisjoint convex objects in R^, each of constant description complexity, and let p be some metric. For a point x G R^, let ^(x) denote the set of objects nearest to x, i.e., 0(x) = {seS\
p(x, s) < p{x, s') W e S}.
The Voronoi diagram Yorp(S) of S under the metric p (sometimes also simply denoted as Yor(S)) is a partition of R'^ into maximal connected regions C of various dimensions, so that the set 0(x) is the same for all x € C. Let yt be the graph of the function x^+i = p(x, Si). Set F = {yt \ 1 ^ / ^n}. Edelsbrunner and Seidel [158] observed that Vorp(5) is the minimization diagram of F. In the classical case, in which p is the Euclidean metric and the objects in S are singletons (points), the graphs of these distance functions can be replaced by a collection of n hyperplanes in R^+^, using the linearization technique, without affecting the minimization
80
P.K. Agarwal and M. Sharir
diagram. Hence the maximum possible complexity of Vor(5) is 0{n 1^^/^^), which actually can be achieved (see, e.g., [248,322]). In more general settings, though, this reduction is not possible. Nevertheless, the bounds on the complexity of lower envelopes imply that, under reasonable assumption on p and on the objects in 5, the complexity of the diagram is 0(n^+^), for any e >0. While this bound is nontrivial, it is conjectured to be too weak. For example, this bound is nearquadratic for planar Voronoi diagrams, but the complexity of almost every planar Voronoi diagram is only 0(n), although there are certain distance functions for which the corresponding planar Voronoi diagram can have quadratic complexity [59]. In three dimensions, the abovementioned bound for point sites and Euclidean metric is 0(n^). It has been a longstanding open problem to determine whether a similar quadratic or nearquadratic bound holds in E^ for more general objects and metrics (here the new results on lower envelopes only give an upper bound of 0(n^~^^)). The problem stated above calls for improving this bound by roughly another factor of n. Since we are aiming for a bound that is two orders of magnitude better than the complexity of A(r), it appears to be a considerably more difficult problem than that of lower envelopes. The only hope of making progress here is to exploit the special structure of the distance functions p(x,s). Fortunately, some progress on this problem was made recently. It was shown by Chew et al. [115] that the complexity of the Voronoi diagram is 0(n^a(n)\ogn) for the case in which the objects of S are lines in E? and the metric p is a convex distance function induced by a convex polytope with a constant number of facets (see [115] for more details). Note that such a distance function is not necessarily a metric, because it will fail to be symmetric if the defining polytope is not centrally symmetric. The L i and Loo metrics are special cases of such distance functions. The best known lower bound for the complexity of the diagram in this special case is ^{n^a(n)). Dwyer [140] has shown that the expected complexity of the Voronoi diagram of a set of n random lines in R'^ is 0(n^^^). In another recent paper [80], it is shown that the maximum complexity of the LiVoronoi diagram of a set of n points in R^ is G(n^). Finally, it is shown in [341] that the complexity of the threedimensional Voronoi diagram of point sites under a general polyhedral convex distance function (induced by a polytope with 0(1) facets) is 0(«^ log«). OPEN PROBLEM 6. (i) Is the complexity of the Voronoi diagram of a set S ofn lines under the Euclidean metric in R? close to n^l (ii) Is the complexity of the Voronoi diagram of a set S ofpairwise disjoint convex polyhedra in M^, with a total ofn vertices, close to n^ under the polyhedral convex distance functions!
An interesting special case of these problems involves dynamic Voronoi diagrams for moving points in the plane. Let 5 be a set ofn points in the plane, each moving along some line at some fixed velocity. The goal is to bound the number of combinatorial changes of the Euclidean Vor(5) over time. This dynamic Voronoi diagram can easily be transformed into a threedimensional Voronoi diagram, by adding the time f as a third coordinate. The points become lines in M^, and the metric is a distance function induced by a horizontal disk (that is, the distance from a point pixQ, yo, to) to a line i is the Euclidean distance from p to the point of intersection of i with the horizontal plane ^ = ^o) Here too the open
Arrangements and their applications
81
problem is to derive a nearquadratic bound on the complexity of the diagram. Cubic or nearcubic bounds are known for this problem, even under more general settings [184,203, 328], but subcubic bounds are known only in some very special cases [114]. Next, consider the problem of bounding the complexity of generalized Voronoi diagrams in higher dimensions. As mentioned above, when the objects in S are n points in R^ and the metric is Euclidean, the complexity of Vor(5) is 0(n'^^/^^). As d increases, this becomes significantly smaller than the naive 0{n^^^) bound or the improved bound, 0(n^+^), obtained by viewing the Voronoi diagram as a lower envelope in IR^+^. The same bound of Q^^r^/21^ has recently been obtained in [80] for the complexity of the Loodiagram of n points in W^ (it was also shown that this bound is tight in the worst case). It is thus tempting to conjecture that the maximum complexity of generalized Voronoi diagrams in higher dimensions is close to this bound. Unfortunately, this was recently shown by Aronov to be false [44], by presenting a lower bound of Q{n^~^). The sites used in this construction are convex polytopes, and the distance is either Euclidean or a polyhedral convex distance function. For d = 3, this lower bound does not contradict the conjecture made above, that the complexity of generalized Voronoi diagrams should be at most nearquadratic in this case. Also, in higher dimensions, the conjecture mentioned above is still not refuted when the sites are singleton points. Finally, for the general case, the construction by Aronov still leaves a gap of roughly a factor of n between the known upper and lower bounds. 9. Union of geometric objects Let /C = {^1,..., ^„} be a set of n connected Jdimensional sets in M^. In this section, we want to study the complexity of ^ = U/^=i ^i • Most of the work to date on this problem has been in two or three dimensions. Union of planar objects. Let us assume that each Ki is a Jordan region, bounded by a closed Jordan curve yi. Kedem et al. [241] have proved that if any two boundaries yi intersect in at most two points, then dK contains at most 6n ~ 12 intersection points (provided n ^ 3), and that this bound is tight in the worst case. An immediate corollary of their result is that the number of intersection points on the boundary of the union of a collection of homothets of some fixed convex set is linear, because the boundaries of any two such homothetic copies in general position can intersect in at most two points. The bound also holds when the homothets are not in general position. On the other hand, if pairs of boundaries may intersect in four or more points, then dK may contain Q{n^) intersection points in the worst case; see Figure 9. This raises the question of what happens if any two boundaries intersect in at most three points. Notice that in general this question is meaningless, since any two closed curves must intersect in an even number of points (assuming nondegenerate configurations). To make the problem interesting, let T be a collection of n Jordan arcs, such that both endpoints of each arc yt e F lie on the ;caxis, and such that Ki is the region between yt and the Xaxis. Edelsbrunner et al. [149] have shown that the maximum combinatorial complexity of the union K is G{na{n)). The upper bound requires a rather sophisticated analysis of the topological structure of K, and the lower bound follows from the construction by Wiemik and Sharir for lower envelopes of segments [357].
82
PK. Agarwal and M. Sharir
Fig. 9. Union of Jordan regions.
Next, consider the case when earh v io . • , . arbitrary, then a simple modTficTtiontf J . I . % " ^ ' ' ' " * ' P'^"^' ^^ * ^ trianglesear may have quadratic L ^ e x ^ nTwor^^^^^^^^ ' " ^'^"^^ ' ^^'^'^^t K be "thin," that is, some of thefr anglesTr^v^^^^^^^ '^tT'^ * ^ «  g l e s have to that if the given triangles are all i f m e a n i r t h r l f T ! ' ' '' ''• ^'"'1 ^^^^ ^^ow n fixed constant ^o, then their u n i o n l ^ a s onfv . ' u ' ' ' ' " ' ' ' ' ' ' '^ '"^^^ ^'^"^ ^ components of R2 y ^ . .™ . l ^ "^'"' ""•"''^'" "^ ''«'^* (ie., connected constants Of p r o p o ^ . l ^ a m y ^ : i % r ; ^ ^ ^ ^ ^ ^ ^ ^ complexity of the union of « fat wedgesTs 0 ^ ; ? T T^'^.i^' '' "'• ^^^^ P^^^^'l *at the un:on Of fat Objects. M. Bern asJ d l h T f l ' : : ; ^ ^ ^el^^^^^ OPEN PROBLEM 7. Let A = (A,
A \ h
the aspect ratio of the smallest rctangle i l ' l l l " ^ V " " " ' ' . ^ " " ' " ' '''"''• ^ ^ «'' ^^ ?/ie complexity o / U L , 4 , ? ^«^to««5 4 , . Suppose £ « ^ , a, ^ 0(n). What is
//cr^;e"rii^:^^^^^^
r H ^'" ^ ^ ^ "«
constant number . of points He e f ^ n e ' 1 . t u " ' ' ' " ' ' '"^''"^^^^'" ^' "^^'^ «ome t " '"^^^ ' '^°"^*^"^ « ^^^^ that for each object of S the^atio bet "eerthe ,^^^ .nscribed disk is at most a. T h e r Z w e d th ' I ' ' ' " " " ' ' " ^ '"^"^ ^"'^ *^^ l^^g^^t for any . > 0, where the constLt of 1 I 'complexity of the union K is 0(„i+^) 167] for sHghtly improved rltsnson^^^^^^^^^ ^'^T^' ^" ^' ^' ^^ «^  « [166! requires as an imtial but import ntsubs^P n a . '''''l''^'^^ '^ ^^' objects. Their proo the union: these are vertice^ o f X . Z l ^ u " ' " ^ ' • ^ ° ' '*^^ """^ber of regular vertices of exactly twice. In fact, the a n a l y r b X a t a n d T h f " ' '\'"° ' " " " ' ' " ' ^ ^ '^at intersect vertices of the union. Nevertheli m^^^L?. K ! " " " ' ' " ^^^ ""'"^'^ ^^^''^^ '^' i^^8"l^ shown that, for an arbitrary coltSoTo^^^^^^^^ ' P™'''™' ''^'^•' '^"'^ ^^arir [296] have cross in a constant number of l^ronehar/;';^^^^^^^^ the number of regular (resp. irregular) vertices o n l ^ h H " ' " ' ^ ' " ' ^ ^^^^P' ^) ^^ eenusedmn70]toobtamtLrL::l;^rnrre7hel^^^^^^^^^^^^^^^
Arrangements and their applications
83
interesting in their own right, and some additional results concerning them have recently been obtained by Aronov et al. [49]. First, if there are only regular vertices (i.e., every pair of boundaries intersect at most twice), then the inequality obtained by [296] implies that the complexity of the union in this case is at most 6^ — 12, so the result by Pach and Sharir extends the older results of Kedem et al. [241]. In general, though, / can be quadratic, so the above inequality only yields a quadratic upper bound on the number of regular vertices of the union. However, it was shown in [49] that in many cases R is subquadratic. This is the case when the given regions are such that every pair of boundaries cross at most a constant number of times. If in addition all the regions are convex, the upper bound is close toO(«^/2). Aronov and Sharir [55] proved that the complexity of the union of n convex polygons in M^ with a total of s vertices is 0(n^ + sain)). Union in three and higher dimensions. Little is known about the complexity of the union in higher dimensions. It was recently shown in [80] that the maximum complexity of the union of n axisparallel hypercubes in M^ is 6)(n^^/^^), and this improves to 0{n^^/^^) if all the hypercubes have the same size. However, the following problem remains open. OPEN PROBLEM
8. What is the complexity of the union ofn congruent cubes in M?l
Aronov and Sharir [53] proved that the complexity of the union of n convex polyhedra in R^ with a total of s faces is 0{n^ + sn log^ n). The bound was improved by Aronov et al. [57] to 0{n^ +sn\ogs). Unions of objects also arise as subproblems in the study of generalized Voronoi diagrams, as follows. Let S and p be as in the previous section (say, for the 3dimensional case). Let K denote the region consisting of all points x G R^ whose smallest distance from a site in S is at most r, for some fixed parameter r > 0. Then K = \^^^^ B(s,r), where B(s,r) = {x eM? \ p(x,s) ^r}. We thus face the problem of bounding the combinatorial complexity of the union of n objects in R^ (of some special type). For example, if 5 is a set of lines and p is the Euclidean distance, the objects are n congruent infinite cylinders in R^. In general, if the metric p is a distance function induced by some convex body P, the resulting objects are the Minkowski sums s 0 (—rP), for s e S, where A^B = {x\y\xeA, y e B]. Of course, this problem can also be stated in any higher dimension. Since it has been conjectured that the complexity of the whole Voronoi diagram in M? should be nearquadratic, the same conjecture should apply to the (simpler) structure K (whose boundary can be regarded as a level curve of the diagram at height r; it does indeed correspond to the crosssection at height r of the lower envelope in R^ that represents the diagram). Recently, this conjecture was confirmed by Aronov and Sharir in [56], in the special case where both P and the objects of S are convex polyhedra. They specialized their analysis of the union of convex polytopes to obtain an improved bound in the special case in which the polyhedra in question are Minkowski sums of the form /?/ 0 P, where the Ri 's are fz pairwisedisjoint convex polyhedra, P is a convex polyhedron, and the total number of faces of these Minkowski sums is s. The improved bounds are 0(ns logn) and ^{nsa(n)). If P is a cube, then the complexity of the Minkowski sum is 0(n^a(n)) [223].
84
P.K. Agarwal and M. Sharir
Agarwal and Sharir [26] showed that if 5 is a set of n Hnes and P is a sphere in M^, i.e., /C is a set of n congruent cyhnders, then the complexity of K is 0(n^/^"^^), for any ^ > 0. This bound was later improved and extended in [27]. They proved that the complexity of the Minkowski sum of a ball with a set of n triangles in M^ is 0{n^^^). OPEN PROBLEM
9. What is the complexity of the union ofn infinite cylinders of different
radii in M? ?
10. Decomposition of arrangements Many applications call for decomposing each cell of the arrangement into constant size cells; see Sections 12 and 13 for a sample of such applications. In this section we describe a few general schemes that have been proposed for decomposition of arrangements.
10.1. Triangulating hyperplane arrangements Each /:dimensional cell in an arrangement of hyperplanes is a convex polyhedron, so we can triangulate it into /:simplices. If the cell is unbounded, some of the simplices in the triangulation will be unbounded. A commonly used scheme to triangulate a convex polytope V is the socalled bottomvertex triangulation, denoted 7^^. It recursively triangulates every face of 7^ as follows. An edge is a onedimensional simplex, so there is nothing to do. Suppose we have triangulated all 7dimensional cells of 7^ for j < k. We now triangulate a A:dimensional cell C as follows. Let v be the vertex of C with the minimum A:jcoordinate. For each (k — 1)dimensional simplex A lying on the boundary of C but not containing v (A was constructed while triangulating a (/: — 1)dimensional cell incident to C), we extend A to a /:dimensional simplex by taking the convex hull of A and v; see Figure 10(i). (Unbounded cells require some care in this definition; see [117].) The number of simplices in P ^ is proportional to the number of vertices in V. If we want to triangulate the entire arrangement or more than one of its cells, we compute the bottomvertex triangulation / ^ for each face / in the increasing order of their dimension. Let A^^ (F) denote the bottomvertex triangulation of A(r). A useful property of A^iF) is that each simplex A e A^ (F) is defined by a set D(A) of at most d(d + 3)/2 hyperplanes of F , in the sense that A e A'^iDiA)). Moreover, if IC(A) c r is the subset of hyperplanes intersecting Z\, then A e A^(R), for a subset R ^ F, if and only if D(A) c R and IC(A) Pi /? = 0. A disadvantage of bottomvertex triangulation is that some vertices may have large degree. Methods for obtaining lowdegree triangulations have been proposed in two and three dimensions [137].
10.2. Vertical decomposition Unfortunately, the bottomvertex triangulation scheme does not work for arrangements of surfaces. Collins [124] described a general decomposition scheme, called cylindrical
Arrangements
and their applications
85
Fig. 10. (i) Bottom vertex triangulation of a convex polygon; (ii) vertical decomposition of a cell in an arrangement of segments.
algebraic decomposition, that decomposes A(r) into (bn)^ cells, each semialgebraic of constant description complexity (however, the maximum algebraic degree involved in defining a cell grows exponentially with d) and homeomorphic to a ball of the appropriate dimension. Moreover, his algorithm produces a cell complex, i.e., closures of any two cells are either disjoint or their intersection is the closure of another lowerdimensional cell of the decomposition. This bound is quite far from the known trivial lower bound of Q(n^), which is a lower bound on the size of the arrangement. A significantly better scheme for decomposing arrangements of general surfaces is their vertical decomposition. Although vertical decompositions of polygons in the plane have been in use for a long time, it was extended to higher dimensions only in the late 1980s. We describe this method briefly. Let C be a 3; for J = 3 the two bounds nearly coincide. Improving the upper bound appears to be very challenging. This problem has been open since 1989; it seems difficult enough to preempt, at the present state of knowledge, any specific conjecture on the true maximum complexity of the vertical decomposition of arrangements in J > 3 dimensions. OPEN PROBLEM 10. What is the complexity of the vertical decomposition of the arrangement ofn surfaces in M^ satisfying Assumptions (A1)(A2)?
The bound stated above applies to the vertical decomposition of an entire arrangement of surfaces. In many applications, however, one is interested in the vertical decomposition of only a portion of the arrangement, e.g., a single cell, the lower envelope, the zone of some surface, a specific collection of cells of the arrangement, etc. Since, in general, the complexity of such a portion is known (or conjectured) to be smaller than the complexity of the entire arrangement, one would like to conjecture that a similar phenomenon applies to vertical decompositions. Schwarzkopf and Sharir [320] showed that the complexity of the vertical decomposition of a single cell in an arrangement of n surface patches in R^, as above, is 0(«^"^^), for any 6: > 0. A similar nearquadratic bound has been obtained by Agarwal et al. [9] for the vertical decomposition of the region enclosed between the envelope and the upper envelope of two sets of bivariate surface patches. Another recent result by Agarwal et al. [14] gives a bound on the complexity of the vertical decomposition of A^k{F) for a set F of surfaces in M^, which is only slightly larger that the worstcase complexity of A^k (F). OPEN PROBLEM 11. What is the complexity of the vertical decomposition of the minimization diagram ofn surfaces in W^ satisfying Assumptions (A1)(A2)?
Agarwal and Sharir [25] proved a nearcubic upper bound on the complexity of the vertical decomposition in the special case when the surfaces are graphs of trivariate polynomials and the intersection surface of any pair of surfaces is jc}^monotone. In fact, their bound holds for a more general setting; see the original paper for details. An interesting special case of vertical decomposition is that of hyperplanes. For such arrangements, the vertical decomposition is a too cumbersome construct, because, as described above, one can use the bottomvertex triangulation (or any other triangulation) to decompose the arrangement into 0(n^) simplices. Still, it is probably a useful exercise to understand the complexity of the vertical decomposition of an arrangement of n hyperplanes in M^. A result by Guibas et al. [202] gives an almost tight bound of 0(n^logn) for this quantity in R^, but nothing significantly better than the general bound is known for d > 4. Another interesting special case is that of triangles in 3space. This has been studied by [130,342], where almost tight bounds were obtained for the case of a single
Arrangements
and their applications
87
Table 3 Combinatorial bounds on the maximum complexity of the vertical decomposition of n surfaces. In the second row, K is the combinatorial complexity of the arrangement Objects
Bound
Source
SurfacesinR^, J > 3 Triangles in R Surfaces in R^, single cell Triangles in M , zone w.r.t. an algebraic surface Surfaces in M^, (^ i^)level Hyperplanes in M"^
0(«2^4x^(«)) 0(n^a(n)\ognhK) 0(n^+^) 0(n^log^n)
[103,330] [130,342] [320] [342]
0(n'^+'k) 0(n logn)
[14] [202]
cell (0(n^log^n)), and for the entire arrangement (0(n^a(n) logn + K)), where K is the complexity of the undecomposed arrangement). The first bound is slightly better than the general bound of [320] mentioned above. Tagansky [342] also derives sharp complexity bounds for the vertical decomposition of many cells in an arrangement of simplices, including the case of all nonconvex cells.
10.3. Other decomposition schemes Linearization, defined in Section 3, can be used to decompose the cells of the arrangement A{r) into cells of constant description complexity as follows. Suppose F admits a Hnearization of dimension k, i.e., there is a transformation ^ :M^ > M^ that maps each point X G M^ to a point ^(x) e E^, each surface yt G T to a hyperplane hi C M^, and E^ to a Jdimensional surface U c E^. Let H = {hi \ I ^ i ^ n). We compute the bottomvertex triangulation J^ {H) of A{H). For each simplex A e A^(H), let Z = Z^ Pi T, and let zl* = (p~^(A) be the back projection of A onto E^; Z\* is a semialgebraic cell of constant description complexity. Set E = {A"" \ A e A'^(H)}. S is a decomposition of A(r) into cells of constant description complexity. If a simplex A G A ^ (H) intersects U, then A lies in the triangulation of a cell in zone(U; H). Therefore, by Theorem 5.3, \S\ = 0(n^(^~^^^^^^ log^ n), where y = (d \k) (mod 2). Hence, we can conclude the following. THEOREM 10.2. Let F be a set of hypersurfaces in M.^ of degree at most b. If F admits a linearization of dimension k, then A{F) can be decomposed into 0(nL^^+^^/^J log^ n) cells of constant description complexity, where y = d \ k (mod 2).
As shown in Section 3, spheres in E^ admit a linearization of dimension J + 1 ; therefore, the arrangement of n spheres in E^ can be decomposed into 0(n^ logn) cells of constant description complexity. Aronov and Sharir [52] proposed another scheme for decomposing arrangements of triangles in E^ by combining vertical decomposition and triangulation. They first decompose
88
RK. Agarwal and M. Sharir
each threedimensional cell of the arrangement into convex polyhedron, using an incremental procedure, and then they compute a bottomvertex triangulation of each polyhedron. Other specialized decomposition schemes in M^ have been proposed in [221,271].
10.4. Cuttings All the decomposition schemes described in this section decompose M^ into cells of constant description complexity, so that each cell lies entirely in a single face of A{r). In many applications, however, it suffices to decompose M^ into cells of constant description complexity so that each cell intersects only a few surfaces of F. Such a decomposition lies at the heart of divideandconquer algorithms for numerous geometric problems. Let r be a set of n surfaces in R^ satisfying Assumptions (A1)(A2). For a parameter r ^ n, a family E = {A\,..., As) of cells of constant description complexity with pairwise disjoint interiors is called a {\/r)cutting of A{r) if the interior of each cell in E is crossed by at most n/r surfaces of F and E covers R^. If F is a set of hyperplanes, then E is typically a set of simplices. Cuttings have led to efficient algorithms for a wide range of geometric problems and to improved bounds for several combinatorial problems. For example, the proof by Clarkson et al. [121] on the complexity of m distinct cells in arrangements of lines uses cuttings; see the survey papers [3,265] for a sample of applications of cuttings. Clarkson [116] proved that a (l/r)cutting of size 0(r^ log^ r) exists for a set of hyperplanes in R^. The bound was improved by Chazelle and Friedman [108] to O(r^); see also [1,259,263]. An easy counting argument shows that this bound is optimal for any nondegenerate arrangement. There has been considerable work on computing optimal (1/r)cuttings efficiently [1,100,224,259,263]. Chazelle [100] showed that a (l/r)cutting for a set of n hyperplanes in R^ can be computed in time 0(nr^~^). Using Haussler and Welzl's result on ^nets [227], one can show that if, for any subset /? c r , there exists a canonical decomposition of A(R) into at most g(\R\) cells of constant description complexity, then there exists a (l/r)cutting of A(F) of size 0(^(rlogr)). By the result of Chazelle et al. [103] on the vertical decomposition of A(F), there exists a (l/r)cutting of size 0((r logr)^'^~'^+^) of A(F). On the other hand, if F admits a linearization of dimension k, then there exists a (l/r)cutting of size 0((rlogr)L(^+^)/2Jlogr).
11. Representation of arrangements Before we begin to present algorithms for computing arrangements and their substructures, we need to describe how we represent arrangements and their substructures. Planar arrangements of fines can be represented using any standard data structure for representing planar graphs such as quadedge, wingededge, and halfedge data structures [207, 244,354]. However, representation of arrangements in higher dimensions is challenging because the topology of ceUs may be rather complex. Exactly how an arrangement is represented largely depends on the specific application for which we need to compute it. For
Arrangements and their applications
89
example, representations may range from simply computing a representative point within each cell, or the vertices of the arrangement, to storing various spatial relationships between cells. We first review representations of hyperplane arrangements and then discuss surface arrangements. Hyperplane arrangements. A simple way to represent a hyperplane arrangement A{r) is by storing its lskeleton [141]. That is, we construct a graph (V, E) whose nodes are the vertices of the arrangement. There is an edge between two nodes vi, Vj if they are endpoints of an edge of the arrangement. Using the lskeleton of A{r), we can traverse the entire arrangement in a systematic way. The incidence relationship of various cells in A{r) can be represented using a data structure called incidence graph. A /^dimensional cell C is called a subcell of a (/: + 1)dimensional cell C if C lies on the boundary of C\ C is called the supercell of C. We assume that the empty set is a (—1)dimensional cell of v4(r), which is a subcell of all vertices of A{r)\ and M^ is a (J + 1)dimensional cell, which is the supercell of all Jdimensional cells of A{r). The incidence graph of A{r) has a node for each cell of A{r), including the (— 1)dimensional and {d + 1)dimensional cells. There is a (directed) arc from a node C to another node O if C is a subcell of C^; see Figure 11. Note that the incidence graph forms a lattice. Many algorithms for computing the arrangement construct the incidence graph of the arrangement. A disadvantage of 1skeletons and incidence graphs is that they do not encode ordering information of cells. For examples, in planar arrangements of lines or segments, there is a natural ordering of edges incident to a vertex or of the edges incident to a twodimensional face. The quadedge data structure encodes this information for planar arrangements. Dobkin and Laszlo [138] extended the quadedge data structure to M^, which was later extended to higher dimensions [83,255,256]. Dobkin et al. [136] described an algorithm for representing a simple polygon as a short Boolean formula, which can be used to store faces of segment arrangements to answer various queries efficiently. Surface arrangements. Representing arrangements of surface patches is considerably more challenging than representing hyperplane arrangements because of the complex topology that cells in such an arrangement can have. A very simple representation of A{r) is to store a representative point from each cell of A{r) or to store the vertices of A{r). An even coarser representation of arrangements of graphs of polynomials is to store all realizable sign sequences. It turns out that this simple representation is sufficient for some applications [35,77]. The notion of lskeleton can be generalized to arrangements of surfaces. However, all the connectivity information cannot be encoded by simply storing vertices and edges of the arrangement. Instead we need a finer onedimensional structure, known as the roadmap. Roadmaps were originally introduced by Canny [90,92] to determine whether two points lie in the same connected component of a semialgebraic set; see also [195,197,230]. They were subsequently used for computing a semialgebraic description of connected components of a semialgebraic set [71,94,231]. We can extend the notion of roadmaps to entire arrangements. Roughly speaking, a roadmap 7l{r) of A{r) is a onedimensional semialgebraic set that satisfies the following two conditions. (Rl) For every cell C in A{r), C Pi lZ{r) is nonempty and connected.
90
RK. Agarwal and M. Sharir
(R2) Let Cu) be the crosssection of a cell C G A(r) at the hyperplane x\=w. For any w; G R and for cell C e A{r), C^^^ impHes that every connected component of Cyo intersects 1Z(r). We can also define the roadmap of various substructures of arrangements. See [69,90] for details on roadmaps. A roadmap does not represent "ordering" of cells in the arrangement or adjacency relationship among various cells. If we want to encode the adjacency relationship among higher dimensional cells of ^ ( F ) , we can compute the vertical decomposition or the cylindrical algebraic decomposition of A(r) and compute the adjacency relationship of cells in the decomposition [43,317]. Brisson [83] describes the celltuple data structure that encodes topological structures, ordering among cells, the boundaries of cells, and other information for cells of surface arrangements. Many querytype applications (e.g., point location, ray shooting) call for preprocessing A{r) into a data structure so that various queries can be answered efficiently. In these cases, instead of storing various cells of an arrangement explicitly, we can store the arrangement implicitly, e.g., using cuttings. Chazelle et al. [104] have described how to preprocess arrangements of surfaces for pointlocation queries; Agarwal et al. [9] have described data structures for storing lower envelopes in R"* for pointlocation queries.
12. Computing arrangements We now review algorithms to compute the arrangement A{r) of a set F of n surface patches satisfying Assumptions (A1)(A2). As in Chapter 1, we need to assume here an appropriate model of computation in which various primitive operations on a constant number of surfaces can be performed in constant time. We will assume an infiniteprecision real arithmetic model in which the roots of any polynomial of constant degree can be computed exactly in constant time. Constructing arrangements of hyperplanes and simplices. Edelsbrunner et al. [157] describe an incremental algorithm that computes in time O(n^) the incidence graph of A{r), for a set Fofn hyperplanes in R^. Roughly speaking, their algorithm adds the hyperplanes of F one by one and maintains the incidence graph of the arrangement of the hyperplanes added so far. Let 7^ be the set of hyperplanes added in the first / stages, and let )//+i be the next hyperplane to be added. In the (/ + l)st stage, the algorithm traces )//+i through A(Fi). If a /:face / of A(Fi) does not intersect y/, then / remains a face of A(Fi^]). If / intersects y/+i, then / G zone(yi^\; Fi) and / is split into two /:faces f'^, f~, lying in the two open halfspaces bounded by y/+i, and a (/: — l)face f = f C\yi^\. The algorithm therefore checks the faces of zone{yiJ^\; Fi) whether they intersect y/+i. For each such intersecting face, it adds corresponding nodes in the incidence graph and updates the edges of the incidence graph. The (/ + l)st stage can be completed in time proportional to the complexity of zone (yi^\; Fi), which is 0(/^~^); see [142,157]. Hence, the overall running time of the algorithm is 0(n^). A drawback of the algorithm just described is that it requires 0(n^) "working" storage because it has to maintain the entire arrangement constructed so far in order to determine
Arrangements
and their
applications
91
(ii)
(i)
Fig. 11. (i) Incidence graph of the arrangement of 2 Hnes. (ii) Adding a new line; incremental changes in the incidence graph as the vertex v, the edge 5, and the face A' are added.
which of the cells intersect the new hyperplane. An interesting question is whether A{r) can be computed using only 0{n) working storage. Edelsbrunner and Guibas [148] proposed the topological sweep algorithm that can construct the arrangement of n lines in O(n^) time using 0{n) working storage. Their algorithm, which is a generalization of the sweepline algorithm of Bentley and Ottmann [72], sweeps the plane by a pseudoline. The algorithm by Edelsbrunner and Guibas can be extended to enumerate all vertices in an arrangement of n hyperplanes in R^ in 0(n^) time using 0(n) space. See [41,58,161] for other topologicalsweep algorithms. Avis and Fukuda [61] developed an algorithm that can enumerate in 0(n^k) time, using 0(n) space, all k vertices of the arrangement of a set F of n hyperplanes in M.^ in which every vertex is incident to d hyperplanes. Their algorithm is useful when there are many parallel hyperplanes in F. See also [62,186] for some related results. Using the randomsampling technique, Clarkson and Shor [120] developed an 0(n log n + k) expected time algorithm for constructing the arrangement of a set Fofn line segments in the plane; here k is the number of vertices in A(F); see also [284,285]. Chazelle and Edelsbrunner [102] developed a deterministic algorithm that can construct A(F) in time 0(n logn j k), using 0(n f k) storage. The space complexity was improved to 0(n), without affecting the asymptotic running time, by Balaban [63]. If F is a set of n triangles in R^, A (F) can be constructed in 0(n^ logn + k) expected time using a randomized incremental algorithm [106,330]. De Berg et al. [130] proposed a deterministic algorithm with 9
II
0(n a(n) logn + klogn) running time for computing A (F).
92
RK. Agarwal and M. Sharir
Chazelle and Friedman [109] described an algorithm that can preprocess a set F of n hyperplanes into a data structure of size 0(n^/log^ n) so that a pointlocation query can be answered in O(logn) time. Their algorithm was later simplified by Matousek [267] and Chazelle [100]. Mulmuley and Sen [287] developed a randomized dynamic data structure of size 0(n^) for point location in arrangements of hyperplanes that can answer a pointlocation query in 0(\ogn) expected time and can insert or delete a hyperplane in 0(n^~^ logn) expected time. Hagerup et al. [210] described a randomized parallel algorithm for constructing the arrangement of hyperplanes under the CRCW model. Their algorithm runs in 0(\ogn) time using 0(n^/logn) expected number of processors. A deterministic algorithm under the CREW model with the same worstcase performance was proposed by Goodrich [193]. There has been some work on constructing arrangements of lines and segments using floatingpoint (finite precision) arithmetic. Milenkovic [279] developed a general technique called doubleprecision geometry that can be applied to compute arrangements of lines and segments in the plane. For example, if the coefficients of each line in a set Fofn lines are represented using at most b bits, then his technique can compute A(r) in 0(n^ logn) time using at most b\20 bits of precision. A careful implementation of the algorithm by Edelsbrunner et al. [157] requires 3b bits of precision. Because of finiteprecision arithmetic, Milenkovic's technique computes the coordinates of vertices approximately, and therefore produces a planar geometric graph, which is an arrangement of pseudolines. If the approximate arithmetic used by his algorithm makes relative error e, then the maximum error in the coordinates of vertices of A(r) computed by his algorithm is 0(^/s). Fortune and Milenkovic [182] showed that the sweepline and incremental algorithms can be implemented so that the maximum error in the coordinates of vertices is at most 0(ne). For all practical purposes this approach is better than the one described in [279]. See [196,200, 222,278,280,308] for a few additional results on constructing arrangements using floatingpoint arithmetic. Constructing arrangements of surfaces. The algorithm by Edelsbrunner et al. [157] for computing hyperplane arrangements can be extended to computing the vertical decomposition A (F) for a set F of n arcs in the plane. In the (/ + l)st step, the algorithm traces }//+i through zone{yi^\; Fi) and updates the trapezoids of A (Fj) that intersect )//+i. The running time of the (/ + l)st stage is 0(Ks\2(i))^ where s is the maximum number of intersection points between a pair of arcs in F. Hence, the overall running time of the algorithm is 0(nks\2(n)) [150]. Suppose F is a set of arcs in the plane in general position. If the arcs in F are added in a random order and a "history dag," as described in Chapter 1, is used to efficiently find the trapezoids of ^ (Fi) that intersect y/+i, the expected running time of the algorithm can be improved to 0(n logn J k), where k is the number of vertices in A(F) [106,330]. Very little is known about computing the arrangement of a set F of surfaces in higher dimensions. Chazelle et al. [103] have shown that A (F) can be computed in randomized expected time 0(«^^~^+^), using the randomsampling technique. Their algorithm can be made deterministic without increasing its asymptotic running time, but the deterministic algorithm is considerably more complex.
Arrangements and their applications
93
There has been some work for computing arrangements under the more reahstic model of precise rational arithmetic model used in computational real algebraic geometry [76]. Canny [93] had described an {nb)^^^''iix^t algorithm for computing a sample point from each cell of the arrangement of a set of n hypersurfaces in R^, each of degree at most b. The running time was improved by Basu et al. [70] to n^+'^iy^i^) ^ Basu et al. [69] described an n^'^ ^ b^^^ ^ time algorithm for computing the roadmap of a semialgebraic set defined by n polynomials, each of degree at most b. Although their goal is to develop the roadmap of a semialgebraic set, their algorithm first constructs the road map of the entire arrangement of the surfaces defining the semialgebraic set and then outputs the appropriate portion of the map.
13. Computing substructures in arrangements 13.1. Lower envelopes Let r be a set of surface patches satisfying Assumptions (A1)(A2). We want to compute the minimization diagram A^(F) of F. We described in Chapter 1 the algorithms for computing the minimization diagram of a set of arcs in the plane. In this chapter we will focus on minimization diagrams of sets of surface patches in higher dimensions. There are again several choices, depending on the application, as to what exactly we want to compute. The simplest choice is to compute the vertices or the 1skeleton of A4(r). A more difficult task is to compute all the faces of MiF) and represent them using any of the mechanisms described in the previous section. Another challenging task, which is required in many applications, is to store F into a data structure so that Lr(x), for any point x G M^""^ can be computed efficiently. For collections F of surface patches in M?, the minimization diagram A4(F) is a planar subdivision. In this case, the latter two tasks are not significantly harder than the first one, because we can preprocess M (F) using any optimal planar pointlocation algorithm [ 132]. Several algorithms have been developed for computing the minimization diagram of bivariate (partial) surface patches [21,78,79,128,328,330]. Some of these techniques use randomized algorithms, and their expected running time is 0(n^+^), which is comparable with the maximum complexity of the minimization diagram of bivariate surface patches. The simplest algorithm is probably the deterministic divideandconquer algorithm presented by Agarwal et al. [21]. It partitions F into two subsets A , A of roughly equal size, and computes recursively the minimization diagrams A^i, M2 of Fi and F2, respectively. It then computes the overlay A^* of A^i and M.2' Over each face / of A^* there are only (at most) two surface patches that can attain the final envelope (the one attaining L(Fi) over / and the one attaining L(F2) over / ) , so we compute the minimization diagram of these two surface patches over / , replace / by this refined diagram, and repeat this step for all faces of A^*. We finally merge any two adjacent faces / , /^ of the resulting subdivision if the same surface patches attain L(F) over both / and f\ The cost of this step is proportional to the number of faces of Al*. By the result of Agarwal et al. [21], A^* has 0(n^+^) faces. This imphes that the complexity of the above divideandconquer algorithm is 0(n^+^). If r is a set of triangles in M^, the running time of the algorithm is 0(n^a(n)) [151].
94
P.K. Agarwal and M. Sharir
This divideandconquer algorithm can also be used to compute S{r, F'), the region lying above all surface patches of one collection F' and below all surface patches of another collection T, in time Oin^^^), where n = \F\ + \F'\ [21]. A more difficult problem is to devise outputsensitive algorithms for computing M{F), whose complexity depends on the actual combinatorial complexity of the envelope. A rather complex algorithm is presented by de Berg [127] for the case of triangles in R^, whose running time is 0{n^^^^^ + n^^^^^k'^f^), where k is the number of vertices in M{F). If the triangles in F are pairwise disjoint, the running time can be improved to The algorithm by Edelsbrunner et al. [151] can be extended to compute in 0{n^~^a{n)) time all faces of the minimization diagram of {d — l)simplices in R^ for d^A. However, little is known about computing the minimization diagram of more general surface patches in J ^ 4 dimensions. Let F be a set of surface patches in R^ satisfying Assumptions (A1)(A2). Agarwal et al. [9] showed that all vertices, edges, and 2faces of A^(r) can be computed in randomized expected time 0(n^~^+^). We sketch their algorithm below. Assume that F satisfies Assumptions (A1)(A5). Fix a (J — 2)tuple of surface patches, say y i , . . . , y^2, and decompose their common intersection H t i ^ // i^^o smooth, x\X2monotone, connected patches, using a stratification algorithm. Let 77 be one such piece. Each surface yi ,fori^d—l, intersects 77 at a curve $,, which partitions 77 into two regions. If we regard each yi as the graph of a partially defined (d — l)variate function, then we can define Ki c 77 to be the region whose projection on the hyperplane 7/ : Xd = 0 consists of points X at which y, (x) ^ yi (x) = • • • = yjii^) The intersection Q = n / > j  i ^i is equal to the portion of 77 that appears along the lower envelope L(F).Wc repeat this procedure for all patches of the intersection Pr, y, and for all (d — 2)tuples of surface patches. This will give all the vertices, edges and 2faces of L(F). Since 77 is x 1^2monotone 2manifold, computing Q is essentially the same as computing the intersection ofn — d\2 planar regions. Q can thus be computed using an appropriate variant of the randomized incremental approach [106,128]. It adds ^/ = y/ D 77 one by one in a random order (^ may consist of 0(1) arcs), and maintains the intersection of the regions Ki for the arcs added so far. Let Qr denote this intersection after r arcs have been added. We maintain the "vertical decomposition" of Qr (within 77), and represent Qr as a collection of pseudotrapezoids. We maintain additional data structures, including a history dag and a unionfind structure, and proceed exactly as in [106,128] (See Chapter 1). We omit here the details. We define the weight of a pseudotrapezoid r to be the number of surface patches y/, for / > J — 1, whose graphs either cross r or hide r completely from the lower envelope (excluding the up to four function graphs whose intersections with 77 define r). The cost of the above procedure, summed over all (d — 2)tuples of 7^, is proportional to the number of pseudotrapezoids that are created during the execution of the algorithm, plus the sum of their weights, plus an overhead term of 0(n^~') needed to prepare the collections of arcs §/ over all twodimensional patches 77. Modifying the analysis in the papers cited above, Agarwal et al. prove the following. 13.1 (Agarwal, Aronov and Sharir [9]). Let F be a set ofn surface patches in W^ satisfying Assumptions (A1)(A2). The vertices, edges, and 2faces of M{F) can be computed in randomized expected time 0{n^~^^^),for any 6: > 0. THEOREM
Arrangements and their applications
95
For d = A, the above algorithm can be extended to compute the incidence graph (or celltuple structure) of M.{r). Their approach, however, falls short of computing such representations for J > 4. Agarwal et al. also show that the threedimensional pointlocation algorithm by Preparata and Tamassia [307] can be extended to preprocess a set of trivariate surface patches in time 0(n^+^) into a data structure of size 0(n^+^) sothatLr(x), for any point x G M^, can be computed in 0(log^ n) time. OPEN PROBLEM 12. Let r be a set of n surface patches in R^, for d > 4, satisfying Assumptions (A1)(A3). How fast can F be preprocessed, so that Lr(x), for a query point X G M^~^ can be computed efficiently!
13.2. Single cells Computing a single cell in an arrangement of n hyperplanes in M^ is equivalent, by duality, to computing the convex hull of a set of n points in E^ and is a widely studied problem; see, e.g., [142,324] for a summary of known results. For J > 4, an 0(nL^/^^) expectedtime algorithm for this problem was proposed by Clarkson and Shor [120] (see also [323]), which is optimal in the worst case. By derandomizing this algorithm, Chazelle [101] developed an 0(«^^/^^)time deterministic algorithm. A somewhat simpler algorithm with the same running time was later proposed by Bronnimann et al. [85]. These results imply that the Euclidean Voronoi diagram of a set of n points in W^ can be computed in time 0(n ^^/^^). Since the complexity of a cell may vary between 0(1) and 0(n^^^^^), outputsensitive algorithms have been developed for computing a single cell in hyperplane arrangements [111,246,321]. For J < 3, Clarkson and Shor [120] gave randomized algorithms with expected time 0(nlogh), where h is the complexity of the cell, provided that the planes are in general position. Simple deterministic algorithms with the same worstcase bound were developed by Chan [95]. Seidel [321] proposed an algorithm whose running time is 0(n^ + h logn); the first term can be improved to 0(n^~^/^^^/^^+^^ log^ n) [266] or to 0((n/i)^"^/^L^/^J+^Hog''n) [96]. Chan et al. [99] described another outputsensitive algorithm whose running time is 0((n + (nf) ^ ~ ^/ ^^^'^'^ + fn^~^l ^^/^^) log*^ n). Avis et al. [60] described an algorithm that can compute in 0(nf) time, using 0(n) space, all / vertices of a cell in an arrangement of n hyperplanes in M^; see also [82,185]. All these outputsensitive bounds hold only for simple arrangements. Although many of these algorithms can be extended to nonsimple arrangements, the running time increases. As mentioned in Chapter 1, Guibas et al. [206] developed an 0(A^+2(^) log^ n)time algorithm for computing a single face in an arrangement of n arcs, each pair of which intersect in at most s points. Later a randomized algorithm with expected time 0(A,^+2 W log n) was developed by Chazelle et al. [106]. Since the complexity of the vertical decomposition of a single cell in an arrangement of n surface patches in M? is 0(n^+^) [320], an application of the randomsampling technique yields an algorithm for computing a single cell in time 0(n^^^) in an arrangement of n surface patches in M? [320]. If F is a set of triangles, the running time can be improved to 0(n^ log^ n) [128]. Halperin [211,212] developed faster algorithms for computing a single cell in arrangements of "special" classes of bivariate surfaces that arise in motionplanning applications.
96
P.K. Agarwal and M. Sharir
13.3. Levels Let T be a set of n arcs in the plane, each pair of which Constructing the ^klevel intersect in at most 5" points. A^k (^) can be computed by a simple divideandconquer algorithm as follows [326]. Partition F into two subsets Fi, F2, each of size at most \n/2'], compute recursively A^k(^\), A^ki^^i), and then use a sweepline algorithm to compute A^k(^) from A^k(J"\) and A^ki^i) The time spent in the merge step is proportional to the number of vertices in A^ki^)^ A^k(^2) and the number of intersections points between the edges of two subdivisions, each of which is a vertex of A(F) whose level is at most 2k. Using Theorem 6.1, the total time spent in the merge step is 0(Xs\2(n)klogn). Hence, the overall running time of the algorithm is 0(Xs\2(n)k\og^ n). If we use a randomized incremental algorithm that adds arcs one by one in a random order and maintains A^kin)^ where Fi is the set of arcs added so far, the expected running time of the algorithm is 0(ks\2(n)k login/k)); see, e.g., [286]. Everett et al. [178] showed that if F is a set of n lines, the expected running time can be improved to 0(n \ogn + nk). Recently Agarwal et al. [13] gave another randomized incremental algorithm that can compute A^k(^) in expected time 0(ks\2(n)(k \\ogn)). In higher dimensions, little is known about computing A^ki^)^ for collections F of surface patches. For d = 3, Mulmuley [286] gave a randomized incremental algorithm for computing the ^/:level in an arrangement of n planes whose expected running time is 0(nk^ login/k)). The expected running time can be improved to 0(n log'^ n f nk^) using the algorithm by Agarwal et al. [13]. There are, however, several technical difficulties in extending this approach to computing levels in arrangements of surface patches. Using the randomsampling technique, Agarwal et al. [14] developed an Oin^^^k) expectedtime algorithm for computing A^ki^)^ for a collection F of n surface patches in R^. Their algorithm can be derandomized without affecting the asymptotic running time. For J > 4, Agarwal et al.'s and Mulmuley's algorithms can compute the ^/:level in arrangements of n hyperplanes in expected time Oin^^^'^^k^^^^^). These algorithms do not extend to computing the ^/:level in surface arrangements because no nontrivial bound is known for the complexity of a triangulation of A^k i^) in four and higher dimensions. Constructing a single level Edelsbrunner and Welzl [ 164] gave an 0(/i logn\b log^ n)time algorithm to construct the /:level in an arrangement of n lines in the plane, where b is the number of vertices of the /:level. This bound was slightly improved by Cole et al. [123] to 0(« Xogn + b log^ k) and then recently by Chang [98] to 0(« \ogn + b \og^^^ n) for any ^ > 0. HaarPeled [225] gave on 0((n + b)ain)\ogn) expected time algorithm. However, these algorithms do not extend to computing the /:level in arrangements of curves. The approach by Agarwal et al. [13] can compute the /:level in an arrangement of lines in randomized expected time OinXo^n + nk^^^Xo^^^n), and it extends to arrangements of curves and to arrangements of hyperplanes. Agarwal and Matousek [19] describe an outputsensitive algorithm for computing the /:level in an arrangement of planes. The running time of their algorithm, after a slight improvement by Chan [96], is OinXogb + b^^^), where b is the number of vertices of the A:level. Their algorithm can compute the klt\tX in an arrangement of hyperplanes in R^ in time 0(nlogZ? + («Z?)^^/(L^/^J+^^+^ + Z?ni2/(L^/2J+J)+^). As in the case ofsingle cells, all the outputsensitive algorithms assume that the hyperplanes are in general position.
Arrangements and their applications
97
13.4. Marked cells Let F be a set of n lines in the plane and S a set of m points in the plane. Edelsbmnner et al. [152] presented a randomized algorithm, based on the randomsampling technique, for computing C(S, F), the set of cells in A(r) that contain at least one point of S, whose expected running time is 0(m^^^~^n^^^^^^ {mlogn\nlognlogm), for any ^ > 0. A deterministic algorithm with running time 0{m^/^n^^^ \og^ n \n log^ n^m logn) was developed by Agarwal [2]. However, both algorithms are rather complicated. A simple randomized divideandconquer algorithm, with 0((my/n + n) logn) expected running time, was recently proposed by Agarwal et al. [20]. Using random sampling, they improved the expected running time to 0(m^/^n^/^ log^^^(n/^/m) \ (m\n) logn). If we are interested in computing the incidences between F and 5, the best known algorithm is by Matousek whose expected running time is o(m^/^f2^/^2^^^''§*^'^+''^^ + (m f n)log(m + n)) [268]. An Q{m^/^n^^^ ^ {m\n) log(m + n)) lower bound for this problem is proved by Erickson [177] under a restricted model of computation. Matousek's algorithm can be extended to higher dimensions to count the number of incidences between m points and n hyperplanes in M^ in time 0((mn)^i/^^+^>2^^^^g*^^+^>> + (m + w) log(m + n)) [268]. The above algorithms can be modified to compute marked cells in arrangements of segments in the plane. The best known randomized algorithm is by Agarwal et al. [20] whose running time is 0{m^^^n^^^ log^(n/v^) + (m + nlogm + na{n)) logn). Little is known about computing marked cells in arrangements of arcs in the plane. Using a randomized incremental algorithm, C{S, F) can be computed in expected time 0{ks+2(n)\f^^ogn), where s is the maximum number of intersection points between a pair of arcs in F [330]. If F is a set of n unitradius circles and 5 is a set of m points in the plane, the incidences between F and S can be computed using Matousek's algorithm [268]. Randomized incremental algorithms can be used to construct marked cells in arrangements of hyperplanes in higher dimensions in time close to their worstcase complexity. For example, if F is a set of n planes in M^ and ^ is a set of m points in M^, then the incidence graph of cells in C{S, F) can be computed in expected time 0{nm^/^ logn) [128]. For J > 4, the expected running time is 0(m^/^n^/^log^ n), where y = {[_d/2\ — l)/2. De Berg et al. [133] describe an efficient pointlocation algorithm in the zone of a /cflat in an arrangement of hyperplanes in R^. Their algorithm can answer a query in 0(log n) time using 0(nL^^+^V^J log^n) space, where y =d\k (mod2).
13.5. Union of objects Let r be a set of n semialgebraic simply connected regions in the plane, each of constant description complexity. The union of F can be computed in 0 ( / ( n ) log^ n) time by a divideandconquer technique, similar to that described in Section 13.3 for computing A^k{F). Here f(m) is the maximum complexity of the union of a subset of F of size m. Alternatively, \JF can be computed in 0 ( / ( n ) l o g n ) expected time using the lazy randomized incremental algorithm by De Berg et al. [128]. As a consequence, the union of n convex fat objects, each of constant description complexity, can be computed in 0(n^"^^) time, for any ^ > 0; see Section 9.
98
RK. Agarwal and M. Sharir
Aronov et al. [57] modified the approach by Agarwal et al. [9] so that the union of n convex polytopes in R^ with a total of s vertices can be computed in expected time 0{sn log n log s\rv'). The same approach can be used to compute the union of n congruent cylinders in time 0{n^^^). (Again, consult Section 9 for the corresponding bounds on the complexity of the union.) Many applications call for computing the volume or surface area of [J /" instead of its combinatorial structure. Overmars and Yap [292] showed that the volume of the union of n axisparallel boxes in R^ can be computed in 0(n^^^ logn) time. Edelsbrunner [144] gave an elegant formula for the volume and the surface area of the union of n balls in R^, which can be used to compute the volume efficiently.
14. Applications In this section we present a sample of applications of arrangements. We discuss a few specific problems that can be reduced to bounding the complexity of various substructures of arrangements of surfaces or to computing these substructures. We also mention a few general areas that have motivated several problems involving arrangements and in which arrangements have played an important role.
14.1. Range searching A typical rangesearching problem is defined as follows: Preprocess a set Sofn points in R*^, so that all points of S lying in a query region can be reported {or counted) quickly. A special case of range searching is halfspace range searching, in which the query region is a halfspace. Because of numerous applications, range searching has received much attention during the last twenty years. See [16,269] for recent surveys on range searching and its applications. If we define the dual of a point p = (a\,..., aj) to be the hyperplane p* :xcj = —a\xi — • • • — ad~\Xd\ + ad, and the dual of a hyperplane h : Xd = b\x\ \ h bd\Xdi + bd to be the point h* = (b\,..., bd), then p lies above (resp. below, on) h if and only if the hyperplane p* lies above (resp. below, on) the point h*. Hence, halfspace range searching has the following equivalent "dual" formulation: Preprocess a set F of n hyperplanes in R^ so that the hyperplanes of H lying below a query point can be reported quickly, or the level of a query point can be computed quickly. Using the pointlocation data structure for hyperplane arrangements given in [100], the level of a query point can be computed in O(logn) time using 0(n^/ \og^ n) space. This data structure can be modified to report all t hyperplanes lying below a query point in time 0(\ogn + t). Chazelle et al. [110] showed, using results on arrangements, that a twodimensional halfspace rangereporting query can be answered in 0(logn + t) time using 0(n) space. In higher dimensions, by constructing (l/r)cuttings for A^k(F), Matousek [264] developed a data structure that can answer a halfspace rangereporting query in time 0(\ogn + t) using 0(n^^^'^^ log^n) space, for some constant c. He also developed a data structure that can answer a query in time 0(n^~^^^^^^^ log'^n + t) using 0(nlog\ogn) space [264]. See also [6,112]. Using
Arrangements and their applications
99
linearization, a semialgebraic rangesearching query, where one wants to report all points of S lying inside a semialgebraic set of constant description complexity, can be answered efficiently using some of the halfspace rangesearching data structures [18,359]. Point location in hyperplane arrangements can be used for simplex range searching [113], ray shooting [17,18,271], and several other geometric searching problems [29].
14.2. Terrain visualization Let i^ be di polyhedral terrain in Mr" with n edges; that is, E is the graph of a continuous piecewiselinear bivariate function, so it intersects each vertical line in exactly one point. The orthographic view of X" in direction Z? G §^ is the decomposition of 77, a plane normal to the direction h and placed at infinity, into maximal regions so that the rays emerging in direction b from all points in such a region hit the same face of U, or none of them hit iJ. The perspective view of U from a point a G M^ is the decomposition of S^ into maximal connected regions so that, for each region /? c S^ and for all points b e R, either the first intersection point of E and the ray r emanating from a in direction b lie in the same face of E (which depends on R), or none of these rays meet E. The orthographic (resp. perspective) aspect graph of E represents all topologically different orthographic (resp. perspective) views of E. For background and a survey of recent research on aspect graphs, see [81]. Here we will show how the complexity bounds for lower envelopes can be used to derive nearoptimal bounds on the aspect graphs of polyhedral terrains. A pair of parallel rays (pi, p2) is called critical if for each / = 1, 2, the source point of Pi lies on an edge at of E, pi passes through three edges of E (including a/), and pi does not intersect the (open) region lying below E. It can be shown that the number of topologically different orthographic views of E is 0(n^) plus the number of critical pairs of parallel rays. Fix a pair a\, a2 of edges of E. Agarwal and Sharir [23] define, for each pair (a\, ^2) of edges of E, a collection J'a^aj of n trivariate functions, so that every pair (pi, P2) of critical rays, where pi emanates from a point on a/ (for / = 1, 2), corresponds to a vertex of A4(Tai,a2) They also show that the graphs of the functions in J'ai,a2 satisfy Assumptions (A1)(A2). Using Theorem 3.1 and summing over all pairs of edges of iJ, we can conclude that the number of critical pairs of rays, and thus the number of topologically different orthographic views of E, is O(n^+0. Using a more careful analysis, Halperin and Sharir [218] proved that the number of different orthographic views is n De Berg et al. [131] have constructed a terrain for which there are Q(n^a(n)) topologically different orthographic views. If E is an arbitrary polyhedral set with n edges, the maximum possible number of topologically different orthographic views of E is 0(n^) [304]. De Berg et al. [131] showed that if i7 is a set of k pairwisedisjoint convex polytopes with a total of n vertices, then the number of orthographic views is 0{n^k^)\ the best known lower bound is Q {n^0). Agarwal and Sharir extended their approach to bound the number of perspective views of a terrain. They argue that the number of perspective views of E is proportional to the number of triples of rays emanating from a common point, each of which passes through three edges of E before intersecting the open region lying below E. Following a similar
100
RK. Agarwal and M. Sharir
approach to the one sketched above, they reduce the problem to the analysis of lower envelopes of O(n^) families of 5variate functions, each family consisting of 0(n) functions that satisfy Assumptions (A1)(A2). This leads to an overall bound of 0{n^^^) for the number of topologically different perspective views of E. This bound is also known to be almost tight in the worst case, as follows from another lowerbound construction given by De Berg et al. [131]. Again, in contrast, if U is an arbitrary polyhedral set with n edges, the maximum possible number of topologically different perspective views of i:is6)(n^) [304].
14.3. Transversals Let 5 be a set of n compact convex sets in R^. A hyperplane h is called a transversal of S if h intersects every member of 5. Let T{S) denote the space of all hyperplane transversals of S. We wish to study the structure of T{S). To facilitate this study, we apply the dual transform described in Section 14.1. Let h \ Xd = a\x\ \h ad\Xd~\ + ^j be a hyperplane that intersects a set ^ G 5. Translate h up and down until it becomes tangent to s. Denote the resulting upper and lower tangent hyperplanes by Xd=a\x\
H
Vad\Xd\ +Us{a\,..
.,ad\)
Xd=a\x\
H
\ad\Xd\ + L,.(ai,..., aj_i),
and
respectively. Then we have Ls{a\,...,ad\) 0 in R^. The results in [21] concerning the complexity of the vertical decomposition of S(r, F') imply that T{S) can be constructed in 0{n^^^) time. No sharp bounds are known on T{S) in higher dimensions. However, in four dimensions, using the algorithm by Agarwal et al. [9] for point location in the minimization diagram of trivariate functions, we can preprocess S into a data structure of size 0(«^+^) so that we can determine in O(logn) time whether a hyperplane /? is a transversal of S. The problem can be generalized by considering lowerdimensional transversals. For example, in R^ we can also consider the space of all line transversals of S (lines that meet
Arrangements and their applications
101
every member of S). By mapping lines in R^ into points in R"^, and by using an appropriate parametrization of the lines, the space of all line transversals of S can be represented as the region in M^ enclosed between the upper envelope and the lower envelope of two respective collections of surfaces. Pellegrini and Shor [302] showed that if 5* is a set of triangles in R^, then the space of line transversals of S has ^320(Viogn) complexity. The bound was slightly improved by Agarwal [4] to 0(n^ logn). He reduced the problem to bounding the complexity of a family of cells in an arrangement of 0{n) hyperplanes in R^. Agarwal et al. [10] proved that the complexity of the space of line transversals for a set of n balls in R^ is 0(^z^+^). Their argument works even if 5* is a set of homothets of a convex region of constant description complexity in R^. Smorodinsky et al. [333] showed that n disjoint balls in R^ can be stabbed by a line in 0{n^~^) different ways.
14.4. Geometric optimization In the past few years, many problems in geometric optimization have been attacked by techniques that reduce the problem to constructing and searching in various substructures of surface arrangements. Hence, the area of geometric optimization is a natural extension, and a good application area, of the study of arrangements. See [24] for a recent survey on geometric optimization. One of the basic techniques for geometric optimization is the parametric searching technique, originally proposed by Megiddo [275]. This technique reduces the optimization problem to a decision problem, where one needs to compare the optimal value to a given parameter. In most cases, the decision problem is easier to solve than the optimization problem. The parametric searching technique proceeds by a parallel simulation of a generic version of the decision procedure with the (unknown) optimum value as an input parameter. In most applications, careful implementation of this technique leads to a solution of the optimization problem whose running time is larger than that of the decision algorithm only by a polylogarithmic factor. See [24] for a more detailed survey of parametric searching and its applications. Several alternatives to parametric searching have been developed during the past decade. They use randomization [25,97,262], expander graphs [238], and searching in monotone matrices [183]. Like parametric searching, all these techniques are based on the availability of an efficient procedure for the decision problem. When applicable, they lead to algorithms with running times that are similar to, and sometimes slightly better than, those yielded by parametric searching. These methods have been used to solve a wide range of geometric optimization problems, many of which involve arrangements. We mention a sample of such results. Slope selection. Given a set S of n points in R^ and an integer k, find the line with the ^th smallest slope among the lines passing through pairs of points of 5. If we dualize the points in 5 to a set F of lines in R^, the problem becomes that of computing the ^th leftmost vertex of A{r). Cole et al. [122] developed a rather sophisticated 0(n log n)time algorithm for this problem, which is based on parametric searching. (Here the decision problem is to determine whether at most k vertices of A{r) lie to the left of a given vertical
102
RK. Agarwal and M. Sharir
line.) A considerably simpler algorithm, based on (l/r)cuttings, was later proposed by Bronnimann and Chazelle [84]. See also [237,262]. Distance selection. Given a set 5 of n points in R^ and a parameter k ^ (2), find the A:th largest distance among the points of S [12,238]. The corresponding decision problem reduces to point location in an arrangement of congruent disks in R^. Specifically, given a set r of m congruent disks in the plane, we wish to count efficiently the number of containments between disks of F and points of S. This problem can be solved using parametric searching [12], expander graphs [238], or randomization [262]. The best known deterministic algorithm, given by Katz and Sharir [238], runs in 0(«^/^ log^"^^ n) time. Segment center. Given a set S of n points in R^ and a line segment e, find a placement of e that minimizes the largest distance from the points of 5 to ^ [15,169]. The decision problem reduces to determining whether given two families F and F' of bivariate surfaces, S{F, F'), the region lying between Lp and Up', is empty. Exploiting the special properties of F and F\ Efrat and Sharir [169] show that the complexity of S{F, F') is 0{n\ogn). They describe an 0(n*"^^)time algorithm to determine whether S{F, F') is empty, which leads to an 0(n'"^^)time algorithm for the segmentcenter problem. Extremal polygon placement. Given a convex mgon P and a closed polygonal environment Q with n vertices, find the largest similar copy of P that is fully contained in Q [331]. Here the decision problem is to determine whether P, with a fixed scaling factor, can be placed inside Q\ this is a variant of the corresponding motionplanning problem for P inside Q, and is solved by constructing an appropriate representation of the 3dimensional free configurafion space, as a collection of cells in a corresponding 3dimensional arrangement of surfaces. The running time of the whole algorithm is only slightly larger than the time needed to solve the fixedsize placement problem. The best running time is 0{mnk(i{mn)\og'mn\o^n) [11]; see also [243,331]. If Q is a convex ngon, the largest similar copy of P that can be placed inside Q can be computed in 0{mn^\ogn) time [5]. Diameter in 3D. Given a set S of n points in R^^, determine the maximum distance between a pair of points in S. The problem is reduced to determining whether S lies in the intersection of a given set Fofn congruent balls. A randomized algorithm with 0(n logn) expected time was proposed by Clarkson and Shor [120]. A series of papers [105,272, 310,309] describe nearlineartime deterministic algorithms. The best known deterministic algorithm runs in 0(n log^ n) time [73,309]. Width in 3D. Given a set S of n points in R^^, determine the smallest distance between two parallel planes enclosing S between them. This problem has been studied in a series of papers [9,25,105], and the currently best known randomized algorithms computes the width in 0(n^/^+^) expected time [25]. The technique used in attacking the decision problems for this and the two following problems reduce them to point location in the region above the lower envelope of a collection of trivariate functions in R^.
Arrangements and their applications
103
Biggest stick in a simple polygon. Compute the longest line segment that can fit inside a given simple polygon with n edges. The current best solution is 0(n^/^"^^) [25] (see also [9,28]). Minimumwidth annulus. Compute the annulus of smallest width that encloses a given set of n points in the plane. This problem arises in fitting a circle through a set of points in the plane. Again, the current best solution is 0{n^^'^^^) [25] (see also [9,28]). Geometric matching. Consider the problem where we are given two sets S\, S2 of n points in the plane, and we wish to compute a minimumweight matching in the complete bipartite graph Si x S2, where the weight of an edge (p,q) is the Euclidean distance between p and q. One can also consider the analogous nonbipartite version of the problem, which involves just one set S of 2n points, and the complete graph on S. The goal is to explore the underlying geometric structure of these graphs, to obtain faster algorithms than those available for general abstract graphs. Vaidya [347] had shown that both the bipartite and the nonbipartite versions of the problem can be solved in time close to 0(n^^^). A fairly sophisticated application of vertical decomposition in threedimensional arrangements, given in [14], has improved the running time for the bipartite case to 0(n^^^). Recently, Varadarajan [350] proposed an 0(n^^^log'^ n)timt algorithm for the nonbipartite case. Center point. A center point of a set S of n points in the plane is a point TT G M^ so that each line i passing through n has the property that at least [n/?>\ points lie in each halfplane bounded hy I. It is well known that such a center point always exists [142]. If we dualize 5 to a set F of n lines in the plane, then n*, the line dual to n, lies between Ain/3\ (r) and Ai2n/3] (^). Cole et al. [123] described an 0(n log^ n)timc algorithm for computing a center point of S, using parametric searching. The problem of computing the set of all center points reduces to computing the convex hull of Ak(r) for a given k. Matousek [260] described an 0(n log^ n)time algorithm for computing the convex hull of Ak(r) for any k ^n; recall, in contrast, that the best known upper bound for Ak(r) is 0(n(k + 1)^/^); see [119] for an approximation algorithm. Ham sandwich cuts. Let Si, S2,. , Sd be d sets of points in R^, each containing n points. Suppose n is even. A ham sandwich cut is a hyperplane h so that each open halfspace bounded by h contains at most n/2 points of 5*/, for / = 1 , . . . , d. It is known [142, 358] that such a cut always exists. Let Ft be the set of hyperplanes dual to 5/. Then the problem reduces to computing a vertex of the intersection of An/2(^i) and .4^/2(^2)Megiddo [276] developed a lineartime algorithm for computing a ham sandwich cut in the plane if Si and ^2 can be separated by a line. For arbitrary point sets in the plane, a lineartime algorithms was later developed by Lo et al. [257]. Lo et al. also described an algorithm for computing a ham sandwich cut in M^ whose running time is 0(i/n/2 (^) log^ n), where ij/kin) is the maximum complexity of the /^level in an arrangement of n lines in the plane. By Dey's result on /^levels [134], the running time of their algorithm is Oin'^/Hog^n).
104
P.K. Agarwal and M. Sharir
14.5. Robotics As mentioned in the introduction, motion planning for a robot system has been a major motivation for the study of arrangements. Let 5 be a robot system with d degrees of freedom, which is allowed to move freely within a given two or threedimensional environment cluttered with obstacles. Given two placements / and F of B, determining whether there exists a collisionfree path between these placements reduces to determining whether / and F lie in the same cell of the arrangement of the family F of "contact surfaces" in W^, regarded as the configuration space of B (see the introduction for more details). If / and F lie in the same cell, then a path between / and F in R^ that does not intersect any surface of F corresponds to a collisionfree path of B in the physical environment from / to F. Schwartz and Sharir [317] developed an n^ time algorithm for this problem. If J is a part of the input, the problem was later proved to be PSPACEcomplete [91,312]. Canny [90,92] gave an n^^^^time algorithm to compute the roadmap of a single cell in an arrangement A(F) of a set F of n surfaces in R^ provided that the cells in A(F) form a Whitney regular stratification of R^ (see [194] for the definition of Whitney stratification). Using a perturbation argument, he showed that his approach can be extended to obtain a Monte Carlo algorithm to determine whether two points lie in the same cell of A(F). The algorithms was subsequently extended and improved by many researchers see [69, 195,230]. The best known algorithm, due to Basu et al. [69], can compute the roadmap in time n^^^tf^(^ \ Much work has been done on developing efficient algorithms for robots with a small number of degrees of freedom, say, two or three [211,221,242]. The result by Schwarzkopf and Sharir [320] gives an efficient algorithm for computing a collisionfree path between two given placements for fairly general robot systems with three degrees of freedom. See [214,318,329] for surveys on motionplanning algorithms. It is impractical to compute the roadmap, or any other explicit representation, of a single cell in A(F) if d is large. A general Monte Carlo algorithm for computing a probabilistic roadmap of a cell in A(F) is described by Kavraki et al. [240]. This approach avoids computing the cell explicitly. Instead, it samples a large number of random points in the configuration space and only those configurations that lie in the free configuration space (FP) are retained (they are called milestones); we also add / and F as milestones. The algorithm then builds a "connectivity graph" whose nodes are these milestones, and whose edges connect pairs of milestones if the line segment joining them in configuration space lies in F P (or if they satisfy some other "local reachability" rule). Various strategies have been proposed for choosing random configurations [40,66,234,239]. The algorithm returns a path from / to F if they lie in the same connected component of the resulting network. Note that this algorithm may fail to return a collisionfree path from I to F even if there exists one. This technique nevertheless has been successful in several realworld applications. Assembly planning is another area in which the theory of arrangements has led to efficient algorithms. An assembly is a collection of objects (called parts) placed rigidly in some specified relative positions so that no two objects overlap. A subassembly of an assembly A is a subset of objects in A in their relative placements in A. An assembly operation is a motion that merges some subassemblies of A into a new and larger subassembly. An assembly sequence for A is a sequence of assembly operations that starts with the individual parts separated from each other and ends up with the full assembly A. The goal of assembly
Arrangements and their applications
105
planning is to compute an assembly sequence for a given assembly. A classical approach to assembly sequencing is disassembly sequencing, which separates an assembly into its individual parts [233]. The reverse order of a sequence of disassemblying operations yields an assembly sequence. Several kinds of motion have been considered in separating parts of an assembly, including translating a subassembly along a straight line, arbitrary translational motion, rigid motion, etc. A common approach to generate a disassembly sequence is the socalled nondirectional blocking graph approach. It partitions the space of all allowable motions of separation into a finite number of cells so that within each cell the set of "blocking relations" between all pairs of parts remains fixed. The problem is then reduced to computing representative points in cells of the arrangement of a family of surfaces. This approach has been successful in many instances, including polyhedral assembly with infinitesimal rigid motion [201]; see also [214,215]. Other problems in robotics that have exploited arrangements include fixturing [311], MEMS (micro electronic mechanical systems) [77], path planning with uncertainty [129], and manufacturing [30]. 14.6. Molecular modeling In the introduction, we described the Van der Waals model, in which a molecule M is represented as a collection F of spheres in R^. (See [125,145,277] for other geometric models of molecules.) Let i7 = 9(IJ T). 17 is called the "surface" of M. Many problems in molecular biology, especially those that study the interaction of a protein with another molecule, involve computing the molecular surface, a portion of the surface (e.g., the socalled active site of a protein), or various features of the molecular surface [147,216,253, 351]. We briefly describe two problems in molecular modeling that can be formulated in terms of arrangements. The chemical behavior of solute molecules in a solution is strongly dependent on the interactions between the solute and solvent molecules. These interactions are critically dependent on those molecular fragments that are accessible to the solvent molecules. Suppose we use the Van der Waals model for the solute molecule and model the solvent by a sphere S. By rolling S on the molecular surface i7, we obtain a new surface U\ traced by the center of the rolling sphere. If we enlarge each sphere of F by the radius of 5, U^ is the boundary of the union of the enlarged spheres. As mentioned above, several methods have been proposed to model the surface of a molecule. The best choice of the model depends on the chemical problem the molecular surface is supposed to represent. For example, the Van der Waals model represents the space requirement of molecular conformations, while isodensity contours and molecular electrostatic potential contour surfaces [277] are useful in studying molecular interactions. An important problem in molecular modeling is to study the interrelations among various molecular surfaces of the same molecule. For example, let X" = { U i , . . . , iJ^j be a family of molecular surfaces of the same molecule. We may want to compute the arrangement A{IJ), or we may want to compute the subdivision of Et induced by
[EjCMJill^Ji^i^m}. Researchers have also been interested in computing "connectivity" of a molecule, e.g., computing voids, tunnels, and pockets of 17. A void of U is a bounded component of
106
RK. Agarwal and M. Sharir
^^ \ (U ^ ) ' ^ tunnel is a hole through  J F that is accessible from the outside, i.e., an "inner" part of a noncontractible loop in R^ \  J F ; and ?i pocket is a depression or cavity on E. Pockets are not holes in the topological sense and are not well defined; see [126,147] for some of the definitions proposed so far. Pockets and tunnels are interesting because they are good candidates to be binding sites for other molecules. Efficient algorithms have been developed for computing 17, connectivity of i7, and the arrangement A{r) [145,216,351]. Halperin and Shelton [222] describe an efficient perturbation scheme to handle degeneracies while constructing A{r) or U. Some applications require computing the measure of different substructures of A{r), including the volume of U, the surface area of E, or the volume of a void of E. Edelsbrunner et al. [146] describe an efficient algorithm for computing these measures; see also [144,145].
15. Conclusions In this survey we reviewed a wide range of topics on arrangements of surfaces. We mentioned a few old results, but the emphasis of the survey was on the tremendous progress made in this area during the last fifteen years. We discussed combinatorial complexity of arrangements and their substructures, representation of arrangements, algorithms for computing arrangements and their substructures, and several geometric problems in which arrangements play pivotal roles. Although the survey covered a broad spectrum of results, many topics on arrangements were either not included or very briefly touched upon. For example, we did not discuss arrangements of pseudolines and oriented matroids, we discussed algebraic and topological issues very briefly, and we mentioned a rather short list of applications that have exploited arrangements. There are numerous other sources where more details on arrangements and their applications can be found; see e.g. the books [74, 281,291,294,330] and the survey papers [192,213,283,293].
Acknowledgments The authors thank Boris Aronov, Saugata Basu, Bernard Chazelle, Herbert Edelsbrunner, Jeff Erickson, Leo Guibas, Dan Halperin, Sariel HarPeled, Jifi Matousek, Ricky Pollack, MarieFrancoise Roy, Raimund Seidel, and Emo Welzl for several useful discussions, for valuable comments on an earlier version of the paper, and for pointing out a number of relevant papers.
References [1] RK. Agarwal, Partitioning arrangements of lines: I. An efficient deterministic algorithm. Discrete Comput. Geom. 5 (1990), 449483. [2] RK. Agarwal, Partitioning arrangements of lines: II. Applications, Discrete Comput. Geom. 5 (1990), 533573. [3] RK. Agarwal, Geometric partitioning and its applications, Computational Geometry: Papers from the DIMACS Special Year, I.E. Goodman, R. Pollack and W. Steiger, eds, Amer. Math. Soc, Providence, RI (1991), 137.
Arrangements
and their applications
107
[4] P.K. Agarwal, On stabbing lines for polyhedra in 3d, Comput. Geom. Theory Appl. 4 (1994), 177189. [5] P.K. Agarwal, N. Amenta and M. Sharir, Placement of one convex polygon inside another. Discrete Comput. Geom. 19 (1998), 95104. [6] P.K. Agarwal, L. Arge, J. Erickson, P.G. Franciosa and J.S. Vitter, Efficient searching with linear constraints, Proc. Annu. ACM Sympos. Principles Database Syst. (1998), 169178. [7] P.K. Agarwal and B. Aronov, Counting facets and incidences. Discrete Comput. Geom. 7 (1992), 359369. [8] P.K. Agarwal, B. Aronov, T.M. Chan and M. Sharir, On levels in arrangements of lines, segments, planes and triangles. Discrete Comput. Geom. 19 (1998), 315331. [9] P.K. Agarwal, B. Aronov and M. Sharir, Computing envelopes in four dimensions with applications, SIAM J. Comput. 26 (1997), 17141732. [10] P.K. Agarwal, B. Aronov and M. Sharir, Line traversals of balls and smallest enclosing cylinders in three dimensions. Discrete Comput. Geom. 21 (1999), 373388. [11] P.K. Agarwal, B. Aronov and M. Sharir, Motion planning for a convex polygon in a polygonal environment. Discrete Comput. Geom. 22 (1999), 201221. [12] P.K. Agarwal, B. Aronov, M. Sharir and S. Suri, Selecting distances in the plane, Algorithmica 9 (1993), 495514. [13] P.K. Agarwal, M. de Berg, J. Matousek and O. Schwarzkopf, Constructing levels in arrangements and higher order Voronoi diagrams, SIAM J. Comput. 27 (1998), 654667. [14] P.K. Agarwal, A. Efrat and M. Sharir, Vertical decomposition of shallow levels in ?>dimensional arrangements and its applications, Proc. 11th Annu. Sympos. Comput. Geom. (1995), 3950. [15] P.K. Agarwal, A. Efrat, M. Sharir and S. Toledo, Computing a segment center for a planar point set, J. Algorithms 15 (1993), 314323. [16] P.K. Agarwal and J. Erickson, Geometric range searching and its relatives. Advances in Discrete and Computational Geometry, B. Chazelle, J.E. Goodman and R. Pollack, eds, Amer. Math. Soc, Providence, RI (1998), 156. [17] P.K. Agarwal and J. Matousek, Ray shooting and parametric search, SIAM J. Comput. 22 (1993), 794806. [18] P.K. Agarwal and J. Matousek, On range searching with semialgebraic sets. Discrete Comput. Geom. 11 (1994), 393^18. [19] P.K. Agarwal and J. Matousek, Dynamic halfspace range reporting and its applications, Algorithmica 13 (1995), 325345. [20] P.K. Agarwal, J. Matousek and O. Schwarzkopf, Computing many faces in arrangements of lines and segments, SIAM J. Comput. 27 (1998), 491505. [21] P.K. Agarwal, O. Schwarzkopf and M. Sharir, The overlay of lower envelopes and its applications. Discrete Comput. Geom. 15 (1996), 113. [22] P.K. Agarwal and M. Sharir, Redblue intersection detection algorithms, with applications to motion planning and collision detection, SIAM J. Comput. 19 (1990), 297321. [23] P.K. Agarwal and M. Sharir, On the number of views of polyhedral terrains. Discrete Comput. Geom. 12 (1994), 177182. [24] P.K. Agarwal and M. Sharir, Efficient algorithms for geometric optimization, ACM Comput. Surv. 30 (1998), 412^58. [25] P.K. Agarwal and M. Sharir, Efficient randomized algorithms for some geometric optimization problems. Discrete Comput. Geom. 16 (1996), 317337. [26] P.K. Agarwal and M. Sharir, Motion planning of a ball amidst segments in three dimensions, Proc. 10th ACM SIAM Sympos. Discrete Algo. [27] P.K. Agarwal and M. Sharir, Pipes, cigars, and kreplach: The union of Minkowski sums in three dimensions, Proc. 15th Annual Sympos. on Comput. Geom. (1999), 143153. [28] P.K. Agarwal, M. Sharir and S. Toledo, Applications of parametric searching in geometric optimization, J. Algorithms 17 (1994), 292318. [29] P.K. Agarwal, M. van Kreveld and M. Overmars, Intersection queries in curved objects, J. Algorithms 15 (1993), 229266. [30] H.K. Ahn, M. de Berg, P. Bose, S.W. Cheng, D. Halperin, J. Matousek and O. Schwarzkopf, Separating an object from its cast, Proc. 13th Annu. Sympos. Comput. Geom. (1997), 221230.
108
RK. Agarwal and M. Sharir
[31] M. Ajtai, V. Chvatal, M. Newborn and E. Szemeredi, Crossingfree subgraphs, Ann. Discrete Math. 12 (1982), 912. [32] G.L. Alexanderson and J.E. Wetzel, Dissections of a plane oval, Amer. Math. Monthly 84 (1977), 442449. [33] G.L. Alexanderson and J.E. Wetzel, Simple partitions of space. Math. Mag. 51 (1978), 220225. [34] G.L. Alexanderson and J.E. Wetzel, Arrangements ofplanes in space. Discrete Math. 34 (1981), 219240. [35] N. Alon, Tools from higher algebra. Handbook of Combinatorics, R.L. Graham, M. Grotschel and L. Lovasz, eds, Elsevier, Amsterdam (1995), 17491783. [36] N. Alon, I. Barany, Z. Fiiredi and D. Kleitman, Point selections and weak snetsfor convex hulls, Combin. Probab. Comput. 1 (1992), 189200. [37] N. Alon and E. Gyori, The number of small semispaces of a finite set of points in the plane, J. Combin. Theory Ser. A 41 (1986), 154157. [38] H. Alt, S. Felsner, F. Hurtado and M. Noy, Point sets with few ksets, Proc. 14th Symp. Comput. Geom. (1998), 200205. [39] H. Alt, R. Fleischer, M. Kaufmann, K. Mehlhom, S. Naher, S. Schirra and C. Uhrig, Approximate motion planning and the complexity of the boundary of the union of simple geometric figures, Algorithmica 8 (1992), 391^06. [40] N. Amato, O.B. Bayazit, L.K. Dale, C. Jones and D. Vallejo, OBPRM: An obstaclebased PRM for 3D workspaces, Proc. Workshop on Algorithmic Foundations of Robotics, P.K. Agarwal, L.E. Kavraki and M. Mason, eds, A.K. Peters, Wellesley, MA (1998), 155168. [41] E.G. Anagnostou, L.J. Guibas and V.G. Polimenis, Topological sweeping in three dimensions, Proc. 1st Annu. SIGAL Intemat. Sympos. Algorithms, Lecture Notes in Comput. Sci. 450, SpringerVerlag (1990), 310317. [42] A. Andrzejak, B. Aronov, S. HarPeled, R. Seidel and E. Welzl, Results on ksets and jfacets via continuous motion arguments, Proc. 14th Symp. Comput. Geom. (1998), 192199. [43] D.S. Amon, G.E. Collins and S. McCallum, Cylindrical algebraic decomposition II: The adjacency algorithm for the plane, SIAM J. Comput. 13 (1984), 878889. [44] B. Aronov, A lower bound on Voronoi diagram complexity. Unpublished manuscript (1998). [45] B. Aronov, M. Bern and D. Eppstein, Arrangements of convex polytopes. Unpublished manuscript (1995). [46] B. Aronov, B. Chazelle, H. Edelsbrunner, L.J. Guibas, M. Sharir and R. Wenger, Points and triangles in the plane and halving planes in space. Discrete Comput. Geom. 6 (1991), 435^42. [47] B. Aronov and T. Dey, Polytopes in arrangements, Proc. 15th Annual Sympos. on Comput. Geom. (1999), 154162. [48] B. Aronov, H. Edelsbrunner, L.J. Guibas and M. Sharir, The number of edges of many faces in a line segment arrangement, Combinatorica 12 (1992), 261274. [49] B. Aronov, A. Efrat, D. Halperin and M. Sharir, On the number of regular vertices on the union of Jordan regions, Proc. 6th Scandinavian Workshop on Algorithm Theory (1998), 322334. [50] B. Aronov, J. Matousek and M. Sharir, On the sum of squares of cell complexities in hyperplane arrangements, J. Combin. Theory Ser. A 65 (1994), 311321. [51] B. Aronov, M. Pellegrini and M. Sharir, On the zone of a surface in a hyperplane arrangement. Discrete Comput. Geom. 9 (1993), 177186. [52] B. Aronov and M. Sharir, Triangles in space or building {and analyzing) castles in the air, Combinatorica 10(1990), 137173. [53] B. Aronov and M. Sharir, The union of convex polyhedra in three dimensions, Proc. 34th Annu. IEEE Sympos. Found. Comput. Sci. (1993), 518527. [54] B. Aronov and M. Sharir, Castles in the air revisited. Discrete Comput. Geom. 12 (1994), 119150. [55] B. Aronov and M. Sharir, The common exterior of convex polygons in the plane, Comput. Geom. 8 (1997), 139149. [56] B. Aronov and M. Sharir, On translational motion planning of a convex polyhedron in 3space, SIAM J. Comput. 26 (1997), 17851803. [57] B. Aronov, M. Sharir and B. Tagansky, The union of convex polyhedra in three dimensions, SIAM J. Comput. 26 (1997), 16701688. [58] T. Asano, L.J. Guibas and T. Tokuyama, Walking on an arrangement topologically, Intemat. J. Comput. Geom. Appl. 4 (1994), 123151.
Arrangements
and their applications
109
[59] F. Aurenhammer, Voronoi diagrams: A survey of a fundamental geometric data structure, ACM Comput. Surv. 23 (1991), 345405. [60] D. Avis, D. Bremner and R. Seidel, How good are convex hull algorithms!, Comput. Geom. 7 (1997), 265302. [61] D. Avis and K. Fukuda, A pivoting algorithm for convex hulls and vertex enumeration of arrangements andpolyhedra. Discrete Comput. Geom. 8 (1992), 295313. [62] D. Avis and K. Fukuda, Reverse search for enumeration. Discrete Appl. Math. 65 (1996), 2 1 ^ 6 . [63] I.J. Balaban, An optimal algorithm for finding segment intersections, Proc. 11th Annu. ACM Sympos. Comput. Geom. (1995), 211219. [64] I. Barany, Z. Fiiredi and L. Lovasz, On the number of halving planes, Combinatorica 10 (1990), 175183. [65] I. Barany and W. Steiger, On the expected number ofksets. Discrete Comput. Geom. 11 (1994), 243263. [66] J. Barraquand and J.C. Latombe, Robot motion planning: A distributed representation approach, Intemat. J. Robot. Res. 10 (1991), 628649. [67] S. Basu, On the combinatorial and topological complexity of a single cell, Proc. 39th Annual JEEE Sympos. on Foundations of Comp. Sci. (1999), 606616. [68] S. Basu, R. Pollack and M.F Roy, On the number of cells defined by a family ofpolynomials on a variety, Mathematika 43 (1994), 120126. [69] S. Basu, R. Pollack and M.F. Roy, Computing roadmaps of semialgebraic sets, Proc. 28th Annu. ACM Sympos. Theory Comput. (1996), 168173. [70] S. Basu, R. Pollack and M.F. Roy, On computing a set of points meeting every semialgebraically connected component of a family ofpolynomials on a variety, J. Complexity 13 (1997), 2837. [71] S. Basu, R. Pollack and M.F. Roy, Complexity of computing semialgebraic descriptions of the connected components of a semialgebraic set. Unpublished manuscript (1998). [72] J.L. Bentley and T.A. Ottmann, Algorithms for reporting and counting geometric intersections, IEEE Trans. Comput. C28 (1979), 643647. [73] S. Bespamyatnikh, An efficient algorithm for the threedimensional diameter problem, Proc. 9th Annu. ACMSIAM Sympos. Discrete Algorithms (1998), 137146. [74] A. Bjomer, M. Las Vergnas, N. White, B. Sturmfels and G.M. Ziegler, Oriented Matroids, Cambridge University Press, Cambridge (1993). [75] A. Bjomer and G.M. Ziegler, Combinatorial stratification of complex arrangements, J. Amer. Math. Soc. 5 (1992), 105149. [76] J. Bochnak, M. Coste and M.F. Roy, Geometric Algebrique Reelle, SpringerVerlag, Heidelberg, West Germany (1987). [77] K.F Bohringer, B. Donald and D. Halperin, The area bisectors of a polygon and force equilibria in programmable vector fields, Proc. 13th Annu. Sympos. Comput. Geom. (1997), 457^59. [78] J.D. Boissonnat and K. Dobrindt, Randomized construction of the upper envelope of triangles in R , Proc. 4th Canad. Conf. Comput. Geom. (1992), 311315. [79] J.D. Boissonnat and K. Dobrindt, Online construction of the upper envelope of triangles and surface patches in three dimensions, Comput. Geom. 5 (1996), 303320. [80] J.D. Boissonnat, M. Sharir, B. Tagansl^y and M. Yvinec, Voronoi diagrams in higher dimensions under certain polyhedral distance functions. Discrete Comput. Geom. 19 (1998), 485^19. [81 ] K. W. Bowyer and C.R. Dyer, Aspect graphs: An introduction and survey of recent results. Int. J. of Imaging Systems and Technology 2 (1990), 315328. [82] D. Bremner, K. Fukuda and M. Marzetta, Primaldual methods for vertex and facet enumeration, Proc. 13th Annu. ACM Sympos. Comput. Geom. (1997), 4956. [83] E. Brisson, Representing geometric structures in d dimensions: Topology and order. Discrete Comput. Geom. 9 (1993), 387426. [84] H. Bronnimann and B. Chazelle, Optimal slope selection via cuttings, Proc. 6th Canad. Conf. Comput. Geom. (1994), 99103. [85] H. Bronnimann, B. Chazelle and J. Matousek, Product range spaces, sensitive sampling and derandomization, Proc. 34th Annu. IEEE Sympos. Found. Comput. Sci. (1993), 400409. [86] U.A. Brousseau, A mathematician's progress, Math. Teacher 59 (1966), 722727. [87] R.C. Buck, Partition of space, Amer. Math. Monthly 50 (1943), 541544.
110
RK. Agarwal and M. Sharir
[88] C. Bumikel, K. Mehlhom and S. Schirra, On degeneracy in geometric computations, Proc. 5th ACMSIAM Sympos. Discrete Algorithms (1994), 1623. [89] R. Canham, A theorem on arrangements of lines in the plane, Israel J. Math. 7 (1969), 393397. [90] J. Canny, The Complexity of Robot Motion Planning, MIT Press, Cambridge, MA (1987). [91] J. Canny, Some algebraic and geometric computations in PSPACE, Proc. 20th Annu. ACM Sympos. Theory Comput. (1988), 460467. [92] J. Canny, Computing roadmaps in general semialgebraic sets, Comput. J. 36 (1993), 409^18. [93] J. Canny, Improved algorithms for sign determination and existential quantifier elimination, Comput. J. 36(1993), 504514. [94] J.F. Canny, D. Grigor'ev and N. Vorobjov, Finding connected components of a semialgebraic set in subexponential time, Appl. Algebra Emg. Commun. Comput. 2 (1992), 217238. [95] T.M. Chan, Optimal outputsensitive convex hull algorithms in two and three dimensions. Discrete Comput. Geom. 16 (1996), 361368. [96] T.M. Chan, Outputsensitive results on convex hulls, extreme points and related problems. Discrete Comput. Geom. 16 (1996), 369387. [97] T.M. Chan, Geometric applications of a randomized optimization technique, Proc. 14th ACM Symp. Comput. Geom. (1998), 269278. [98] T. Chan, Remarks on klevel algorithms in the plane. Unpublished manuscript (1999). [99] T.M. Chan, J. Snoeyink and C.K. Yap, Primal dividing and dual pruning: Outputsensitive construction of 4dpolytopes and 3d Voronoi diagrams. Discrete Comput. Geom. 18 (1997), 433^54. [100] B. Chazelle, Cutting hyperplanes for divideandconquer. Discrete Comput. Geom. 9 (1993), 145158. [101] B. Chazelle, An optimal convex hull algorithm in any fixed dimension, Discrete Comput. Geom. 10 (1993), 377^09. [102] B. Chazelle and H. Edelsbrunner, An optimal algorithm for intersecting line segments in the plane, J. ACM 39 (1992), 154. [103] B. Chazelle, H. Edelsbrunner, L.J. Guibas and M. Sharir, A singlyexponential stratification scheme for real semialgebraic varieties and its applications, Proc. 16th Internal. Colloq. Automata Lang. Program., Lecture Notes Comput. Sci. 372, SpringerVerlag (1989), 179192. [104] B. Chazelle, H. Edelsbrunner, L.J. Guibas and M. Sharir, A singlyexponential stratification scheme for real semialgebraic varieties and its applications, Theoret. Comput. Sci. 84 (1991), 77105. [105] B. Chazelle, H. Edelsbrunner, L.J, Guibas and M. Sharir, Diameter, width, closest line pair and parametric searching. Discrete Comput. Geom. 10 (1993), 183196. [106] B. Chazelle, H. Edelsbrunner, L.J. Guibas, M. Sharir and J. Snoeyink, Computing a face in an arrangement of line segments and related problems, SIAM J. Comput. 22 (1993), 12861302. [107] B. Chazelle, H. Edelsbrunner, L.J. Guibas, M. Sharir and J. Stolfi, Lines in space: Combinatorics and algorithms, Algorithmica 15 (1996), 428447. [108] B. Chazelle and J. Friedman, A deterministic view of random sampling and its use in geometry, Combinatorica 10 (1990), 229249. [109] B. Chazelle and J. Friedman, Point location among hyperplanes and unidirectional rayshooting, Comput. Geom. 4 (1994), 5362. [110] B. Chazelle, L.J. Guibas and D.T. Lee, The power of geometric duality, BIT 25 (1985), 7690. [ I l l ] B. Chazelle and J. Matousek, Derandomizing an outputsensitive convex hull algorithm in three dimensions, Comput. Geom. 5 (1995), 2732. [112] B. Chazelle and F.P. Preparata, Half space range search: An algorithmic application of ksets. Discrete Comput. Geom. 1 (1986), 8393. [113] B. Chazelle, M. Sharir and E. Welzl, Quasioptimal upper bounds for simplex range searching and new zone theorems, Algorithmica 8 (1992), 407^29. [114] L.P. Chew, Nearquadratic bounds for the L \ Voronoi diagram of moving points, Comput. Geom. 7 (1997), 7380. [115] L.P. Chew, K. Kedem, M. Sharir, B. Tagansky and E. Welzl, Voronoi diagrams of lines in 3space under polyhedral convex distance functions, J. Algorithms 29 (1998), 238255. [116] K.L. Clarkson, New applications of random sampling in computational geometry. Discrete Comput. Geom. 2 (1987), 195222. [117] K.L. Clarkson, A randomized algorithm for closestpoint queries, SIAM J. Comput. 17 (1988), 830847.
Arrangements
and their applications
111
[118] K. Clarkson, A bound on local minima of arrangements that implies the upper bound theorem. Discrete Comput. Geom. 10 (1993), 427433. [119] K. Clarkson, D. Eppstein, G.L. Miller, C. Sturtivant and S.H. Teng, Approximating center points with iterative Radon points, Intemat. J. Comput. Geom. Appl. 6 (1996), 357377. [120] K.L. Clarkson and P.W. Shor, Applications of random sampling in computational geometry, II, Discrete Comput. Geom. 4 (1989), 387421. [121] K.L. Clarkson, H. Edelsbrunner, L.J. Guibas, M. Sharir and E. Welzl, Combinatorial complexity bounds for arrangements of curves and spheres. Discrete Comput. Geom. 5 (1990), 99160. [122] R. Cole, J. Salowe, W. Steiger and E. Szemeredi, An optimaltime algorithm for slope selection, SIAM J. Comput. 18 (1989), 792810. [123] R. Cole, M. Sharir and C.K. Yap, On khulls and related problems, SIAM J. Comput. 16 (1987), 6177. [124] G.E. Collins, Quantifier elimination for real closed fields by cylindrical algebraic decomposition, Proc. 2nd GI Conference on Automata Theory and Formal Languages, Lecture Notes in Comput. Sci. 33, SpringerVerlag, Berlin, West Germany (1975), 134183. [125] M.L. Connolly, Analytical molecular surface calculation, J. Appl. Cryst. 16 (1983), 548558. [126] T.H. Connolly, Molecular interstitial skeleton. Computer Chem. 15 (1991), 3745. [127] M. de Berg, Ray Shooting, Depth Orders and Hidden Surface Removal, SpringerVerlag, Berlin, Germany (1993). [128] M. de Berg, K. Dobrindt and O. Schwarzkopf, On lazy randomized incremental construction. Discrete Comput. Geom. 14 (1995), 261286. [129] M. de Berg, L. Guibas, D. Halperin, M. Overmars, O. Schwarzkopf, M. Sharir and M. Teillaud, Reaching a goal with directional uncertainty, Theoret. Comput. Sci. 140 (1995), 301317. [130] M. de Berg, L.J. Guibas and D. Halperin, Vertical decompositions for triangles in 3space, Discrete Comput. Geom. 15 (1996), 3561. [131] M. de Berg, D. Halperin, M. Overmars and M. van Kreveld, Sparse arrangements and the number of views ofpolyhedral scenes, Intemat. J. Comput. Geom. Appl. 7 (1997), 175195. [132] M. de Berg, M. van Kreveld, M. Overmars and O. Schwarzkopf, Computational Geometry: Algorithms and Applications, SpringerVerlag, Berlin, Germany (1997). [133] M. de Berg, M. van Kreveld, O. Schwarzkopf and J. Snoeyink, Point location in zones of kflats in arrangements, Comput. Geom. 6 (1996), 131143. [134] T.K. Dey, Improved bounds on planar ksets and related problems. Discrete Comput. Geom. 19 (1998), 373382. [135] T.K. Dey and H. Edelsbrunner, Counting triangle crossings and halving planes. Discrete Comput. Geom. 12(1994), 281289. [136] D.R Dobkin, L.J. Guibas, J. Hershberger and J. Snoeyink, An efficient algorithm for finding the CSG representation of a simple polygon, Comput. Graph. 22 (1988), 3140. Proc. SIGGRAPH '88. [137] D.P. Dobkin and D.G. Kirkpatrick, Fast detection of polyhedral intersection, Theoret. Comput. Sci. 27 (1983), 241253. [138] D.P. Dobkin and M.J. Laszlo, Primitives for the manipulation of threedimensional subdivisions, Algorithmica4(1989), 332. [139] D.P. Dobkin and S. Teller, Computer graphics. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, PL (1997), 779796. [140] R.A. Dwyer, Voronoi diagrams of random lines and flats. Discrete Comput. Geom. 17 (1997), 123136. [141] H. Edelsbrunner, Edgeskeletons in arrangements with applications, Algorithmica 1 (1986), 93109. [142] H. Edelsbrunner, Algorithms in Combinatorial Geometry, SpringerVerlag, Heidelberg (1987). [143] H. Edelsbrunner, The upper envelope of piecewise linear functions: Tight complexity bounds in higher dimensions. Discrete Comput. Geom. 4 (1989), 337343. [144] H. Edelsbrunner, The union of balls and its dual shape. Discrete Comput. Geom. 13 (1995), 415^40. [145] H. Edelsbrunner, Geometry of modeling biomolecules, Proc. Workshop on Algorithmic Foundations of Robotics, PK. Agarwal, L.E. Kavraki and M. Mason, eds, A.K. Peters, Wellesley, MA (1998), 265277. [146] H. Edelsbrunner, M. Facello, P. Fu and J. Liang, Measuring proteins and voids in proteins, Proc. 28th Ann. Hawaii Internat. Conf. System Sciences, Biotechnology Computing, Vol. V (1995), 256264.
112
RK. Agarwal and M. Sharir
[147] H. Edelsbrunner, M. Facello and J. Liang, On the definition and the construction of pockets in macromolecules. Tech. Report IULUENG951736, Department of Computer Science, University of Illinois at UrbanaChampaign (1995). [148] H. Edelsbrunner and L.J. Guibas, Topologically sweeping an arrangement, J. Comput. Syst. Sci. 38 (1989), 165194. Corrigendum in 42 (1991), 249251. [149] H. Edelsbrunner, L.J. Guibas, J. Hershberger, J. Pach, R. Pollack, R. Seidel, M. Sharir and J. Snoeyink, Arrangements of Jordan arcs with three intersections per pair, Discrete Comput. Geom. 4 (1989), 523539. [150] H. Edelsbrunner, L.J. Guibas, J. Pach, R. Pollack, R. Seidel and M. Sharir, Arrangements of curves in the plane: Topology, combinatorics and algorithms, Theoret. Comput. Sci. 92 (1992), 319336. [151] H. Edelsbrunner, L.J. Guibas and M. Sharir, The upper envelope ofpiecewise linear functions: Algorithms and applications. Discrete Comput. Geom. 4 (1989), 311336. [152] H. Edelsbrunner, L.J. Guibas and M. Sharir, The complexity and construction of many faces in arrangements of lines and of segments. Discrete Comput. Geom. 5 (1990), 161196. [153] H. Edelsbrunner, L.J. Guibas and M. Sharir, The complexity of many cells in arrangements of planes and related problems. Discrete Comput. Geom. 5 (1990), 197216. [154] H. Edelsbrunner and P. Hajnal, A lower bound on the number of unit distances between the vertices of a convex polygon, J. Combin. Theory Ser. A 56 (1991), 312316. [155] H. Edelsbrunner and D. Haussler, The complexity of cells in threedimensional arrangements. Discrete Math. 60 (1986), 139146. [156] H. Edelsbrunner and E.P. Miicke, Simulation of simplicity: A technique to cope with degenerate cases in geometric algorithms, ACM Trans. Graph. 9 (1990), 66104. [157] H. Edelsbrunner, J. O'Rourke and R. Seidel, Constructing arrangements of lines and hyperplanes with applications, SIAM J. Comput. 15 (1986), 341363. [158] H. Edelsbrunner and R. Seidel, Voronoi diagrams and arrangements. Discrete Comput. Geom. 1 (1986), 25^4. [159] H. Edelsbrunner, R. Seidel and M. Sharir, On the zone theorem for hyperplane arrangements, SIAM J. Comput. 22 (1993), 418^29. [160] H. Edelsbrunner and M. Sharir, A hyperplane incidence problem with applications to counting distances, Applied Geometry and Discrete Mathematics: The Victor Klee Festschrift, P. Gritzman and B. Sturmfels, eds, AMS Press, Providence, RI (1991), 253263. [161] H. Edelsbrunner and D.L. Souvaine, Computing medianofsquares regression lines and guided topological sweep, J. Amer. Statist. Assoc. 85 (1990), 115119. [162] H. Edelsbrunner, P. Valtr and E. Welzl, Cutting dense point sets in half. Discrete Comput. Geom. 17 (1997), 243255. [163] H. Edelsbrunner and E. Welzl, On the number of line separations of a finite set in the plane, J. Combin. Theory Ser. A 40 (1985), 1529. [164] H. Edelsbrunner and E. Welzl, Constructing belts in twodimensional arrangements with applications, SIAM J. Comput. 15 (1986), 271284. [165] H. Edelsbrunner and E. Welzl, On the maximal number of edges of many faces in an arrangement, J. Combin. Theory Ser. A 41 (1986), 159166. [166] A. Efrat, The complexity of the union of {a, fi)covered objects, Proc. 15th Annual Sympos. on Comput. Geom. (1999), 134142. [167] A. Efrat and M. Katz, On the union ofacurved objects, Proc. 14th Annual Sympos. on Comput. Geom. (1998), 206213. [168] A. Efrat, G. Rote and M. Sharir, On the union of fat wedges and separating a collection of segments by a line, Comput. Geom. 3 (1993), 277288. [169] A. Efrat and M. Sharir, A nearlinear algorithm for the planar segment center problem. Discrete Comput. Geom. 16 (1996), 239257. [170] A. Efrat and M. Sharir, On the complexity of the union of fat objects in the plane, Proc. 13th Annu. ACM Sympos. Comput. Geom. (1997), 104112. [171] I. Emiris and J. Canny, A general approach to removing degeneracies, SIAM J. Comput. 24 (1995), 650664.
Arrangements
and their applications
113
[172] I.Z. Emiris, J.F. Canny and R. Seidel, Efficient perturbations for handling geometric degeneracies, Algorithmica 19 (1997), 219242. [173] D. Eppstein, Improved bounds for intersecting triangles and halving planes, J. Combin. Theory Ser. A 62 (1993), 176182. [174] D. Eppstein, Geometric lower bounds for parametric optimization problems. Discrete Comput. Geom. 20 (1998), 463^76. [175] P. Erdos, On a set of distances ofn points, Amer. Math. Monthly 53 (1946), 248250. [176] P. Erdos, L. Lovasz, A. Simmons and E. Straus, Dissection graphs of planar point sets, A Survey of Combinatorial Theory, J.N. Srivastava, ed., NorthHolland, Amsterdam, Netherlands (1973), 139154. [177] J. Erickson, New lower bounds for Hopcroft's problem. Discrete Comput. Geom. 16 (1996), 389^18. [178] H. Everett, J.M. Robert and M. van Kreveld, An optimal algorithm for the (^k)levels, with applications to separation and transversal problems, Internat. J. Comput. Geom. Appl. 6 (1996), 247261. [179] M. Falk and R. Randell, On the homotopy theory in arrangements. Complex Analytic Singularities, NorthHolland, Amsterdam (1987), 101124. [180] S. Felsner, On the number of arrangements ofpseudolines. Discrete Comput. Geom. 18 (1997), 257267. [181] S. Fortune, Progress in computational geometry. Directions in Computational Geometry, R. Martin, ed., Information Geometers (1993), 81128. [182] S. Fortune and V. Milenkovic, Numerical stability of algorithms for line arrangements, Proc. 7th Annu. ACM Sympos. Comput. Geom. (1991), 334341. [183] G.N. Frederickson and D.B. Johnson, The complexity of selection and ranking inX + Y and matrices with sorted rows and columns, J. Comput. Syst. Sci. 24 (1982), 197208. [184] J.J. Fu and R.C.T. Lee, Voronoi diagrams of moving points in the plane, Internat. J. Comput. Geom. Appl. 1 (1991), 2332. [185] K. Fuioida, T. Liebling and F. Margot, Analysis of backtrack algorithms for listig all vertices and all faces of a convex polyhedron, Comput. Geom. 8 (1997), 112. [186] K. Fukuda, S. Saito and A. Tamura, Combinatorial face enumeration in arrangements and oriented matroids. Discrete Appl. Math. 31 (1991), 141149. [187] K. Fukuda, S. Saito, A. Tamura and T. Tokuyama, Bounding the number of kfaces in arrangements of hyperplanes. Discrete Appl. Math. 31 (1991), 151165. [188] Z. Fliredi, The maximum number of unit distances in a convex ngon, J. Combin. Theory Ser. A 55 (1990), 316320. [189] A. Gabrielov and N. Vorobjov, Complexity of stratification of semipfaffian sets. Discrete Comput. Geom. 14 (1995), 7191. [190] J.E. Goodman and R. Pollack, On the number of ksubsets of a set ofn points in the plane, J. Combin. Theory Ser. A 36 (1984), 101104. [191] J.E. Goodman and R. Pollack, Semispaces of configurations, cell complexes of arrangements, J. Combin. Theory Ser. A 37 (1984), 257293. [192] J.E. Goodman and R. Pollack, Allowable sequences and order types in discrete and computational geometry. New Trends in Discrete and Computational Geometry, J. Pach, ed., SpringerVerlag (1993), 103134. [193] M.T. Goodrich, Constructing arrangements optimally in parallel. Discrete Comput. Geom. 9 (1993), 371385. [194] M. Goresky and R. MacPherson, Stratified Morse Theory, SpringerVerlag, Heidelberg, Germany, 1987. [195] L. Goumay and J.J. Risler, Construction of roadmaps in semialgebraic sets, Appl. Algebra Engrg. Comm. Comput. 4 (1993), 239252. [196] D.H. Greene and F.F. Yao, Finiteresolution computational geometry, Proc. 27th Annu. IEEE Sympos. Found. Comput. Sci. (1986), 143152. [197] D. Grigor'ev and N. Vorobjov, Counting connected components of a semialgebraic set in subexponential time, Comput. Complexity 2 (1992), 133186. [198] B. Griinbaum, Arrangements of hyperplanes, Congr. Numer. 3 (1971), 41106. [199] B. Griinbaum, Arrangements and Spreads, Amer. Math. Soc, Providence, RI (1972). [200] L. Guibas and D. Marimont, Rounding arrangements dynamically, Proc. 11th Annu. ACM Sympos. Comput. Geom. (1995), 190199.
114
RK. Agarwal and M. Sharir
[201] LJ. Guibas, D. Halperin, H. Hirukawa, J.C. Latombe and R.H. Wilson, A simple and efficient procedure for assembly partitioning under infinitesimal motions, Proc. IEEE Intemat. Conf. Robot. Autom. (1995), 25532560. [202] L.J. Guibas, D. Halperin, J. Matousek and M. Sharir, On vertical decomposition of arrangements ofhyperplanes in four dimensions. Discrete Comput. Geom. 14 (1995), 113122. [203] L.J. Guibas, J.S.B. Mitchell and T. Roos, Voronoi diagrams of moving points in the plane, Proc. 17th Intemat. Workshop GraphTheoret. Concepts Comput. Sci., Lecture Notes in Comput. Sci. 570, SpringerVerlag (1991), 113125. [204] L.J. Guibas, M.H. Overmars and J.M. Robert, The exact fitting problem for points, Comput. Geom. 6 (1996), 215230. [205] L.J. Guibas and M. Sharir, Combinatorics and algorithms of arrangements. New Trends in Discrete and Computational Geometry, J. Pach, ed.. SpringerVerlag, Heidelberg, Germany (1993), 936. [206] L.J. Guibas, M. Sharir and S. Sifrony, On the general motion planning problem with two degrees of freedom. Discrete Comput. Geom. 4 (1989), 491521. [207] L.J. Guibas and J. Stolfi, Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams, ACM Trans. Graph. 4 (1985), 74123. [208] D. Gusfield, Bounds for the parametric spanning tree problem, Proc. West Coast Conf. Combinatorics, Graph Theory and Comput. (1979), 173181. [209] H. Hadwiger, Eulers Charakteristik und kombinatorische Geometric, J. Reine Angew. Math. 134 (1955), 101110. [210] T. Hagerup, H. Jung and E. Welzl, Efficient parallel computation of arrangements of hyperplanes in d dimensions, Proc. 2nd ACM Sympos. Parallel Algorithms Architect. (1990), 290297. [211] D. Halperin, Algorithmic Motion Planning via Arrangements of Curves and of Surfaces, PhD thesis. Computer Science Department, TelAviv University, Tel Aviv (1992). [212] D. Halperin, On the complexity of a single cell in certain arrangements of surfaces related to motion planning. Discrete Comput. Geom. 11 (1994), 134. [213] D. Halperin, Arrangements, Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 389412. [214] D. Halperin, L.E. Kavraki and J.C. Latombe, Robotics, Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 755778. [215] D. Halperin, J.C. Latombe and R.H. Wilson, A general framework for assembly planning: The motion space approach, Unpubhshed manuscript (1997). [216] D. Halperin and M.H. Overmars, Spheres, molecules and hidden surface removal, Comput. Geom. 11 (1998), 83102. [217] D. Halperin and M. Sharir, On disjoint concave chains in arrangements ofipseudo) lines. Inform. Process. Lett. 40 (1991), 189192. [218] D. Halperin and M. Sharir, New bounds for lower envelopes in three dimensions, with applications to visibility in terrains. Discrete Comput. Geom. 12 (1994), 313326. [219] D. Halperin and M. Sharir, Almost tight upper bounds for the single cell and zone problems in three dimensions. Discrete Comput. Geom. 14 (1995), 385^10. [220] D. Halperin and M. Sharir, Arrangements and their applications in robotics: Recent developments, Proc. Workshop on Algorithmic Foundations of Robotics, K. Goldberg, D. Halperin, J.C. Latombe and R. Wilson, eds, A.K. Peters, Wellesley, MA (1995), 495511. [221] D. Halperin and M. Sharir, A nearquadratic algorithm for planning the motion of a polygon in a polygonal environment. Discrete Comput. Geom. 16 (1996), 121134. [222] D. Halperin and C. Shelton, A perturbation scheme for spherical arrangements with application to molecular modeling, Comput. Geom. 10 (1998), 273287. [223] D. Halperin and C.K. Yap, Combinatorial complexity of translating a box in polyhedral 3space, Comput. Geom. Theory Appl. 9 (1998), 181196. [224] S. HarPeled, Constructing cuttings in theory and practice, Proc. 14th Symp. Comput. Geom. (1998), 327336. [225] S. HarPeled, Talking a walk in a planar arrangement, Proc. 40th Annual Sympos. Foundations of Comp. Sci. (1999), to appear. [226] J. Harris, Algebraic Geometry (A First Course), SpringerVerlag, Berlin, Germany (1992).
Arrangements
and their applications
115
[227] D. Haussler and E. Welzl, Epsilonnets and simplex range queries. Discrete Comput. Geom. 2 (1987), 127151. [228] J. Heintz, T. Reico and M.F. Roy, Algorithms in real algebraic geometry and applications to computational geometry. Discrete and Computational Geometry: Papers from the DIMACS Special Year, J.E. Goodman, R. Pollack and W. Steiger, eds, AMS Press, Providence, RI (1991), 137163. [229] J. Heintz, M.F. Roy and P. Solemo, On the complexity of semialgebraic sets, Proc. IFIP San Francisco (1989), 293298. [230] J. Heintz, M.F. Roy and P. Solemo, Single exponential path finding in semialgebraic sets II: The general case. Algebraic Geometry and its Applications, C. Bajaj, ed.. SpringerVerlag, New York (1993), 467^81. [231] J. Heintz, M.F. Roy and P. Solemo, Description of the connected components of a semialgebraic set in single exponential time. Discrete Comput. Geom. 11 (1994), 121140. [232] J.E. Hershberger and J.S. Snoeyink, Erased arrangements of lines and convex decompositions ofpolyhedra, Comput. Geom. 9 (1998), 129143. [233] L.S. Homem de Mello and A.C. Sanderson, A correct and complete algorithm for the generation of mechanical assembly sequences, IEEE Trans. Robot. Autom. 7 (1991), 228240. [234] D. Hsu, L.E. Kavraki, J.C. Latombe, R. Motwani and S. Sorkin, On finding narrow passages with probabilistic roadmap planners, Proc. 1998 Workshop on the Algorithmic Foundations of Robotics, P.K. Agarwal, L.E. Kavraki and M. Mason, eds, A.K. Peters, Wellesley, MA (1998), 141153. [235] N. Katoh, H. Tamaki and T. Tokuyama, Parametric polymatroid optimization and its geometric applications, Proc. 10th ACMSIAM Sympos. Discrete Algorithms (1999), 517526. [236] N. Katoh and T. Tokuyama, Lovdsz lemma for the threedimensional klevel of concave surfaces and its applications, Proc. 40th Annual Sympos. Foundations of Comp. Sci. (1999), to appear. [237] M.J. Katz and M. Sharir, Optimal slope selection via expanders. Inform. Process. Lett. 47 (1993), 115122. [238] M.J. Katz and M. Sharir, An expanderbased approach to geometric optimization, SIAM J. Comput. 26 (1997), 13841408. [239] L.E. Kavraki, J.C. Latombe, R. Motwani and P. Raghavan, Randomized query processing in robot path planning, Proc. 27th Annu. ACM Sympos. Theory Comput. (1995), 353362. [240] L.E. Kavraki, P. Svestka, J.C. Latombe and M.H. Overmars, Probabilistic roadmaps for path planning in high dimensional configuration spaces, IEEE Trans. Robot. Autom. 12 (1996), 566580. [241] K. Kedem, R. Livne, J. Pach and M. Sharir, On the union of Jordan regions and collisionfree translational motion amidst polygonal obstacles. Discrete Comput. Geom. 1 (1986), 5971. [242] K. Kedem and M. Sharir, An efficient motion planning algorithm for a convex rigid polygonal object in 2dimensional polygonal space. Discrete Comput. Geom. 5 (1990), 4375. [243] K. Kedem, M. Sharir and S. Toledo, On critical orientations in the KedemSharir motion planning algorithm for a convex polygon in the plane. Discrete Comput. Geom. 17 (1997), 227240. [244] L, Kettner, Designing a data structure for polyhedral surfaces, Proc. 14th Symp. Comput. Geom. (1998), 146154. [245] A.G. Khovanskii, Fewnomials, Amer. Math. Soc, Providence, RI (1991). [246] D.G. Kirkpatrick and R. Seidel, The ultimate planar convex hull algorithm!, SIAM J. Comput. 15 (1986), 287299. [247] M. Klawe, M. Paterson and N. Pippenger, Inversions with ^2^+'^^^+^^°S«) transpositions at the median. Unpublished manuscript (1982). [248] V. IGee, On the complexity of ddimensional Voronoi diagrams. Arch. Math. 34 (1980), 7580. [249] M. Las Vergnas, Convexity in oriented matroids, J. Comb. Theory, Ser. B 29 (1980), 231243. [250] J.C. Latombe, Robot Motion Planning, Kluwer Acad. Publ., Boston (1991). [251] B. Lee and F.M. Richards, The interpretation of protein structure: Estimation of static accessibility, J. Molecular Biology 55 (1971), 379400. [252] F.T. Leighton, Complexity Issues in VLSI, MIT Press, Cambridge, MA (1983). [253] T. Lengauer, Algorithmic research problems in molecular bioinformatics, Proc. 2nd IEEE Israeli Sympos. Theory of Comput. and Systems (1993), 177192. [254] D, Leven and M. Sharir, On the number of critical free contacts of a convex polygonal object moving in twodimensional polygonal space. Discrete Comput. Geom. 2 (1987), 255270.
116
RK. Agarwal and M. Sharir
[255] P. Lienhardt, Topological models for boundary representation: A comparison with ndimensional generalized maps, Comput. Aided Design 23 (1991), 5982. [256] P. Lienhardt, Ndimensional generalized combinatorial maps and cellular quasimanifolds, Intemat. J. Comput. Geom. Appl. 4 (1994), 275324. [257] C.Y. Lo, J. Matousek and W.L. Steiger, Algorithms for hamsandwich cuts, Discrete Comput. Geom. 11 (1994), 433^52. [258] L. Lovasz, On the number of halving lines, Ann. Uni. Sci. Budapest de Rolando Eotvos Nominatae, Sectio Math. 14(1971), 107108. [259] J. Matousek, Construction of enets. Discrete Comput. Geom. 5 (1990), 427448. [260] J. Matousek, Computing the center of planar point sets. Computational Geometry: Papers from the DIMACS Special Year, J.E. Goodman, R. Pollack and W. Steiger, eds, Amer. Math. Soc, Providence, RI (1991), 221230. [261] J. Matousek, Lower bounds on the length of monotone paths in arrangements. Discrete Comput. Geom. 6 (1991), 129134. [262] J. Matousek, Randomized optimal algorithm for slope selection. Inform. Process. Lett. 39 (1991), 183187. [263] J. Matousek, Efficient partition trees. Discrete Comput. Geom. 8 (1992), 315334. [264] J. Matousek, Reporting points in halfspaces, Comput. Geom. 2 (1992), 169186. [265] J. Matousek, Epsilonnets and computational geometry. New Trends in Discrete and Computational Geometry, J, Pach, ed.. SpringerVerlag, Heidelberg, Germany (1993), 6989. [266] J. Matousek, Linear optimization queries, J. Algorithms 14 (1993), 432^148. [267] J. Matousek, On vertical ray shooting in arrangements, Comput. Geom. 2 (1993), 279285. [268] J. Matousek, Range searching with efficient hierarchical cuttings. Discrete Comput. Geom. 10 (1993), 157182. [269] J. Matousek, Geometric range searching, ACM Comput. Surv. 26 (1994), 421^61. [270] J. Matousek, J. Pach, M. Sharir, S. Sifrony and E. Welzl, Fat triangles determine linearly many holes, SIAM J. Comput. 23 (1994), 154169. [271] J. Matousek and O. Schwarzkopf, On ray shooting in convex polytopes. Discrete Comput. Geom. 10 (1993), 215232. [272] J. Matousek and O. Schwarzkopf, A deterministic algorithm for the threedimensional diameter problem, Comput. Geom. 6 (1996), 253262. [273] P. McMullen and G.C. Shephard, Convex Polytopes and the Upper Bound Conjecture, Cambridge University Press, Cambridge (1971). [274] J. Mecke, Random tesselations generated by hyperplanes. Stochastic Geometry, Geometric Statistics, Stereology, Teubner, Leipzig (1984), 104109. [275] N. Megiddo, Applying parallel computation algorithms in the design of serial algorithms, J. ACM 30 (1983), 852865. [276] N. Megiddo, Partitioning with two lines in the plane, J. Algorithms 6 (1985), 430^33. [277] P.G. Mezey, Molecular surfaces, Reviews in Computational Chemistry, K.B. Lipkowitz and D.B. Boyd, eds. Vol. 1, VCH Publishers (1990). [278] V. Milenkovic, Calculating approximate curve arrangements using rounded arithmetic, Proc. 5th Annu. ACM Sympos. Comput. Geom. (1989), 197207. [279] V. Milenkovic, Double precision geometry: A general technique for calculating line and segment intersections using rounded arithmetic, Proc. 30th Annu. IEEE Sympos. Found. Comput. Sci. (1989), 500505. [280] V. Milenkovic, Robust polygon modeling, Comput. Aided Design 25 (1993). [281] J.W. Milnor, Morse Theory, Princeton University Press, Princeton, NJ (1963). [282] J.W. Milnor, On the Betti numbers of real algebraic varieties, Proc. Amer. Math. Soc. 15 (1964), 275280. [283] B. Mishra, Computational real algebraic geometry. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, PL (1997), 537558. [284] K. Mulmuley, A fast planar partition algorithm, I, J. Symbolic Comput. 10 (1990), 253280. [285] K. Mulmuley, A fast planar partition algorithm, II, J. ACM 38 (1991), 74103. [286] K. Mulmuley, On levels in arrangements and Voronoi diagrams. Discrete Comput. Geom. 6 (1991), 307338.
Arrangements
and their applications
111
[287] K. Mulmuley and S. Sen, Dynamic point location in arrangements of hyperplanes. Discrete Comput. Geom. 8 (1992), 335360. [288] P. Orlik, Introduction to Arrangements, Amer. Math. Soc, Providence, RI (1989). [289] P. Orlik, Arrangements in topology, Discrete and Computational Geometry: Papers from the DIMACS Special Year, J.E. Goodman, R. Pollack and W. Steiger, eds, AMS Press, Providence, RI (1991), 263272. [290] P. Orlik and L. Solomon, Combinatorics and topology of complements of hyperplanes. Invent. Math. 59 (1980), 7794. [291] P. Orlik and H. Terao, Arrangements of Hyperplanes, SpringerVerlag, Berlin, West Germany (1991). [292] M.H. Overmars and C.K. Yap, New upper bounds in Klee's measure problem, SIAM J. Comput. 20 (1991), 10341045. [293] J. Pach, Finite point configurations. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 318. [294] J. Pach and P.K. Agarwal, Combinatorial Geometry, Wiley, New York, NY (1995). [295] J. Pach and M. Sharir, The upper envelope of piecewise linear functions and the boundary of a region enclosed by convex plates: Combinatorial analysis. Discrete Comput. Geom. 4 (1989), 291309. [296] J. Pach and M. Sharir, On the boundary of the union of planar convex sets. Discrete Comput. Geom. 21 (1999), 321328. [297] J. Pach and M. Sharir, On the number of incidences between points and curves. Combinatorics, Probability and Computing 7 (1998), 121127. [298] J. Pach, W. Steiger and E. Szemeredi, An upper bound on the number of planar ksets. Discrete Comput. Geom. 7 (1992), 109123. [299] G.W Peck, On ksets in the plane. Discrete Math. 56 (1985), 7374. [300] M. Pellegrini, Lower bounds on stabbing lines in 3space, Comput. Geom. 3 (1993), 5358. [301] M. Pellegrini, Ray shooting and lines in space. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 599614. [302] M. Pellegrini and P. Shor, Finding stabbing lines in 3space, Discrete Comput. Geom. 8 (1992), 191208. [303] I.G. Petrovskii and O.A. Oleinik, On the topology of real algebraic surfaces, Isvestia Akad. Nauk SSSR. Ser. Mat. 13 (1949), 389^02. In Russian. [304] H. Plantinga and C.R. Dyer, Visibility, occlusion and the aspect graph. Internal. J. Comput. Vision 5 (1990), 137160. [305] R. Pollack and M.F Roy, On the number of cells defined by a set of polynomials, C. R. Acad. Sci. Paris 316 (1993), 573577. [306] A. Postnikov and R. Stanley, Deformation of Coxeter hyperplane arrangements. Unpublished manuscript (1999). [307] F.P. Preparata and R. Tamassia, Efficient point location in a convex spatial cellcomplex, SIAM J. Comput. 21 (1992), 267280. [308] S. Raab, Controlled perturbation of arrangement of polyhedral surfaces with applications of swept volumes, Proc. 15th Annual Sympos. on Comput. Geom. (1999), 163172. [309] E. Ramos, Construction of 1d lower envelopes and applications, Proc. 13th Annu. Sympos. Comput. Geom. (1997), 5766. [310] E. Ramos, Intersection of unitballs and diameter of a point set in R , Comput. Geom. 8 (1997), 5765. [311] A. Rao and K. Goldberg, Placing registration marks, IEEE Transactions on Industrial Electronics 41 (1994). [312] J.H. Reif, Complexity of the generalized movers problem. Planning, Geometry and Complexity of Robot Motion, J. Hopcroft, J. Schwartz and M. Sharir, eds, Ablex Pub. Corp., Norwood, NJ (1987), 267281. [313] FM. Richards, Areas, volumes, packing and protein structure, Annu. Rev. Biophys. Bioeng. 6 (1977), 151176. [314] J. RichterGebert and G.M. Ziegler, Oriented matroids. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 111132. [315] S. Roberts, On thefiguresformed by the intercepts of a system of straight lines in a plane and an analogous relations in space of three dimensions, Proc. London Math. Soc. 19 (1888), 405^22. [316] R. Schneider, Tessellations generated by hyperplanes. Discrete Comput. Geom. 2 (1987), 223232. [317] J.T. Schwartz and M. Sharir, On the "piano movers" problem II: General techniques for computing topological properties of real algebraic manifolds. Adv. Appl. Math. 4 (1983), 298351.
118
RK. Agarwal and M. Sharir
[318] J.T. Schwartz and M. Sharir, Algorithmic motion planning in robotics, Algorithms and Complexity, Handbook of Theoretical Computer Science, J. van Leeuwen, ed., Vol. A, Elsevier, Amsterdam (1990) 391^30. [319] J.T. Schwartz and M. Sharir, On the twodimensional DavenportSchinzel problem, J. Symbolic Comput. 10 (1990), 371393. [320] O. Schwarzkopf and M. Sharir, Vertical decomposition of a single cell in a threedimensional arrangement of surfaces and its applications. Discrete Comput. Geom. 18 (1997), 269288. [321] R. Seidel, Constructing higherdimensional convex hulls at logarithmic cost per face, Proc. 18th Annu. ACM Sympos. Theory Comput. (1986), 404^13. [322] R. Seidel, Exact upper bounds for the number offaces in ddimensional Voronoi diagrams, Applied Geometry and Discrete Mathematics: The Victor Klee Festschrift, R Gritzman and B. Sturmfels, eds, AMS Press, Providence, RI (1991), 517530. [323] R. Seidel, Smalldimensional linear programming and convex hulls made easy. Discrete Comput. Geom. 6 (1991), 423434. [324] R. Seidel, Convex hull computations. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 361376. [325] R. Seidel, The nature and meaning of perturbations in geometric computing. Discrete Comput. Geom. 19 (1998), 117. [326] M. Sharir, On ksets in arrangements of curves and surfaces. Discrete Comput. Geom. 6 (1991), 593613. [327] M. Sharir, Arrangements of surfaces in higher dimensions: Envelopes, single cells and other recent developments, Proc. 5th Canad. Conf. Comput. Geom. (1993), 181186. [328] M. Sharir, Almost tight upper bounds for lower envelopes in higher dimensions. Discrete Comput. Geom. 12 (1994), 327345. [329] M. Sharir, Algorithmic motion planning. Handbook of Discrete and Computational Geometry, J.E. Goodman and J. O'Rourke, eds, CRC Press LLC, Boca Raton, FL (1997), 733754. [330] M. Sharir and PK. Agarwal, DavenportSchinzel Sequences and Their Geometric Applications, Cambridge University Press, New York, NY (1995). [331] M. Sharir and S. Toledo, Extremal polygon containment problems, Comput. Geom. 4 (1994), 99118. [332] PW. Shor, Stretchability of pseudolines is NPhard, Applied Geometry and Discrete Mathematics: The Victor Klee Festschrift, P Gritzman and B. Sturmfels, eds, AMS Press (1991), 531554. [333] S. Smorodinsky, J. Mitchell and M. Sharir, Sharp bounds on geometric premutations ofpairwise disjoint balls in M^, Proc. 15th Annual Sympos. on Comput. Geom. (1999), 400406. [334] D.M.Y. Sommerville, Analytical Geometry in Three Dimensions, Cambridge University Press, Cambridge (1951). [335] J. Spencer, E. Szemeredi and W.T. Trotter, Unit distances in the Euclidean plane. Graph Theory and Combinatorics, B. Bollobas, ed., Academic Press, New York, NY (1984), 293303. [336] R. Stanley, Hyperplane arrangements, interval orders, and trees, Proc. Nat. Acad. Sci. 93 (1996), 26202625. [337] J. Steiner, Einige Gesetze liber die Theilung der Ebene und des Raumes, J. Reine Angew. Math. 1 (1826), 349364. [338] L. Szekely, Crossing numbers and hard Erdos problems in discrete geometry. Combinatorics, Probability and Computing 6 (1997), 353358. [339] E. Szemeredi and W. Trotter, Jr., A combinatorial distinction between Euclidean and projective planes, European J. Combin. 4 (1983), 385394. [340] E. Szemeredi and W. Trotter, Jr., Extremal problems in discrete geometry, Combinatorica 3 (1983), 381392. [341] B. Tagansky, The Complexity of Substructures in Arrangements of Surfaces, PhD thesis, Tel Aviv University, Tel Aviv (1996). [342] B. Tagansky, A new technique for analyzing substructures in arrangements of piecewise linear surfaces, Discrete Comput. Geom. 16 (1996), 455479. [343] H. Tamaki and T. Tokuyama, A characterization of planar graphs by pseudoline arrangements, Proc. 8th Annu. Intemat. Sympos. Algorithms Comput., Lecture Notes in Comput. Sci. 1350, SpringerVerlag (1997), 123132. [344] H. Tamaki and T. Tokuyama, How to cut pseudoparabolas into segments. Discrete Comput. Geom. 19 (1998), 265290.
Arrangements
and their applications
119
[345] R. Thorn, Sur I'homologie des varietes algebriques reelles, Differential and Combinatorial Topology, S.S. Cairns, ed., Princeton Univ. Press, Princeton, NJ (1965). [346] G. Toth, Point sets with many ksets, in preparation. [347] PM. Vaidya, Geometry helps in matching, SIAM J. Comput. 18 (1989), 12011225. [348] P. Valtr, Lines, linepoint incidences and crossing families in dense sets, Combinatorica 16 (1996), 269294. [349] M. van Kreveld, On fat partitioning, fat covering and the union size ofpolygons, Comput. Geom. 9 (1998), 197210. [350] K.R. Varadarajan, A divideandconquer algorithm for mincost perfect matching in the plane, Proc. 39th Annual Sympos. on Foundations of Comp. Sci. (1998), 320329. [351] A. Varshney, F.P. Brooks, Jr. and W.V. Wright, Computing smooth molecular surfaces, IEEE Comput. Graph. Appl. 15 (1994), 1925. [352] S. Vrecica and R. Zivaljevic, The colored Tverberg's problem and complexes of injective functions, J. Combin. Theory Sen A 61 (1992), 309318. [353] H.E. Warren, Lower bound for approximation by nonlinear manifolds. Trans. Amer. Math. Soc. 133 (1968), 167178. [354] K. Weiler, Edgebased data structures for solid modeling in a curved surface environment, IEEE Comput. Graph. Appl. 5 (1985), 2140. [355] E. Welzl, More on ksets of finite sets in the plane. Discrete Comput. Geom. 1 (1986), 95100. [356] J.E. Wetzel, On the division of the plane by lines, Amer. Math. Monthly 85 (1978), 648656. [357] A. Wiemik and M. Sharir, Planar realizations of nonlinear DavenportSchinzel sequences by segments. Discrete Comput. Geom. 3 (1988), 15^7. [358] D.E. Willard, Polygon retrieval, SIAM J. Comput. 11 (1982), 149165. [359] A.C. Yao and F.F. Yao, A general approach to Ddimensional geometric queries, Proc. 17th Annu. ACM Sympos. Theory Comput. (1985), 163168. [360] T. Zaslavsky, Facing up to Arrangements: FaceCount Formulas for Partitions of Space by Hyperplanes, Amer. Math. Soc, Providence, RI (1975). [361] T. Zaslavsky, A combinatorial analysis of topological dissections. Adv. Math. 25 (1977), 267285. [362] G.M. Ziegler, Lectures on Polytopes, SpringerVerlag, Heidelberg, Germany (1994).
This Page Intentionally Left Blank
CHAPTER 3
Discrete Geometric Shapes: Matching, Interpolation, and Approximation* Helmut Alt Institut fiir Informatik, Freie Universitdt Berlin, Takustrafie 9, D14195 Berlin, Germany
Leonidas J. Guibas Computer Science Department, Stanford University, Stanford, CA 94305, USA
Contents 1. Introduction 2. Point pattern matching 2.1. Exact point pattern matching 2.2. Approximate point pattern matching 3. Matching of curves and areas 3.1. Optimal matching of line segment patterns 3.2. Approximate matching 3.3. Distance functions for nonpoint objects 4. Shape simplification and approximation 4.1. Twodimensional results 4.2. Three dimensions 5. Shape interpolation References
123 124 124 126 133 133 136 139 142 142 145 146 150
Abstract In this chapter we survey geometric techniques which have been used to measure the similarity or distance between shapes, as well as to approximate shapes, or interpolate between shapes. Shape is a modality which plays a key role in many disciplines, ranging from computer vision to molecular biology. We focus on algorithmic techniques based on computational geometry that have been developed for shape matching, simplification, and morphing.
*Partially supported by Deutsche Forschungsgemeinschaft (DFG), Grant No. Al 253/42. HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved 121
This Page Intentionally Left Blank
Discrete geometric shapes: Matching, interpolation, and approximation
123
1. Introduction The matching and analysis of geometric patterns and shapes is of importance in various appHcation areas, in particular in computer vision and pattern recognition, but also in other disciplines concerned with the form of objects such as cartography, molecular biology, and computer animation. The general situation is that we are given two objects A, B and want to know how much they resemble each other. Usually one of the objects may undergo certain transformations like translations, rotations or scalings in order to be matched with the other as well as possible. Variants of this problem include partial matching, i.e. when A resembles only some part of B, and a data structures version where, for a given object A, the most similar one in a fixed preprocessed set of objects has to be found, e.g., in character or traffic sign recognition. Another related problem is that of simplification of objects. Namely, given an object A find the most simple object A' resembling A within a given tolerance. For example, A could be a smooth curve and A' a polygonal line with as few edges as possible. We also will discuss shape interpolation ("morphing"), a problem that has become very interesting recently, especially in computer animation. The objective is to find for two given shapes A and B a continuous transformation that transforms A into B via natural intermediate shapes. First, it is necessary to formally define the notions of objects, resemblance, matching, and transformations. Objects are usually finite sets of points ("point patterns") or "shapes" given in two dimensions by polygons. Generalizations to, for example, polyhedral surfaces in three and higher dimensions are possible, but most of the work has concentrated on two or three dimensions. In order to measure "resemblance" various distance functions have been used, in particular much work has been based on the socalled Hausdorff distance. For two compact subsets A, B of the Jdimensional space M^, we define the onesided Hausdorff distance from A to B as 5//(A, B) = maxmina — b\\, aeA beB
where  •  is the Euclidean distance in M^ (if not explicitly stated otherwise). The (bidirectional) Hausdorff distance between A and B then is defined as SH{A, B) = max(5//(A, B), 8H(B, A)). The Hausdorff distance simply assigns to each point of one set the distance to its closest point on the other and takes the maximum over all these values. It performs reasonably well in practice but may fail if there is noise in the images. An variant intended to be more robust will be presented in Section 2.2.3. What kind of geometric transformations are allowed to match objects A and B depends on the application. The most simple kind are certainly translations. The matching problem usually becomes much more difficult if we allow rotations and translations (these transfor
124
H. Alt and L.J. Guibas
mations are called rigid motions, or Euclidean transformations). In most cases reflections can be included as well without any further difficulty. Scaling means the linear transformation that "stretches" an object by a certain factor X about the origin and is represented by the matrix (^ J) in two dimensions. We call combinations of translations and scalings homotheties and combinations of Euclidean transformations and scalings similarities. The most general kind of transformations we will consider are arbitrary ajfine transformations which can occur, e.g., in orthographic 2dimensional projections of 3dimensional objects. Considerable research on these topics has been done in computational geometry in recent years. This chapter will give a survey on these results.
2. Point pattern matching In this section we present a variety of geometric techniques for matching points sets exactly or approximately, under some allowed transformation group. We discuss methods of both theoretical and practical interest.
2.1. Exact point pattern matching A seemingly very natural question is whether two finite sets A, 5 C M^ of n points each can be matched exactly by say, rigid motions, i.e. whether are A and B congruent. Of course unless we assume that the input consists of points on a grid, this problem is numerically very unstable. Nevertheless, studying it assuming a "real RAM" model of computation gives some insight into the nature of matching problems and may help in designing algorithms for more realistic cases. Furthermore, it could be possible to implement the algorithms for rational inputs directly using arbitrary precision computations as they are provided, for example, by the LEDA library [24] but to our knowledge this possibility has not been investigated in detail yet. In two dimensions exact pointpattern matching can easily be reduced to string matching, as is shown by the following algorithm which was invented independently by several authors, for example Atkinson [19]. 1. Determine the centroids CA, CB (i.e. arithmetic means) of the sets A and B, respectively. 2. Determine the polar coordinates of all points in A using CA as the origin. Then sort A lexicographically with respect to these polar coordinates (angle first, length second) obtaining a sequence (0i, r i ) , . . . , (0«, r^). Let u be the sequence (i/^i, r i ) , . . . , {\lrn, rti) where T/^/ = 0/ — 0(/+i) mod «• Compute in the same way the corresponding sequence i; of the set B. 3. Determine whether i; is a cyclic shift of w, i.e. a substring of uu by some fast stringmatching algorithm. It is easy to see that A and B are congruent exactly if the algorithm gives a positive answer. The running time is 0{n \ogn) because of the sorting in step 2; all other operations take linear time.
Discrete geometric shapes: Matching, interpolation, and approximation
125
For exact point pattern matching in three dimensions the following algorithm is given byAltetal. [13]: 1. Determine the centroid CA and project all points of A onto the unit sphere around CA obtaining a set A' of points on the sphere. Label each point a e A' with the sorted list of distances from CA of all points that have been mapped onto a. 2. Compute the 3d convex hull CA of A \ 3. In addition to the labeling of step 2 attach to each point a e A^ an adjacency list of vertices connected to a by an edge of CA sorted in clockwise order (seen from outside). This list should contain all distances of a to adjacent points and all angles between neighboring edges. 4. Execute steps 13 with set B, as well. 5. The hulls CA and CB can be considered as labeled planar graphs. The point sets A and B are congruent exactly if these graphs are isomorphic. This isomorphism can be decided by a variant of the partition algorithm of Hopcroft (see [10], Section 4.13). A detailed analysis shows that the running time of this algorithm is 0(n logn). Using similar techniques it can be shown that the matching problem in arbitrary dimension d can be reduced to n problems in dimension d — 1. Consequently we have that the exact point pattern matching problem can be solved for patterns of n points in time 0(n log w) in 2 dimensions and in time 0(n^~^ logn) for arbitrary dimension d ^3. An alternative approach yielding the same bound for dimension 3 was developed by Atkinson [19]. Concerning transformations other than rigid motions, in some cases there are obvious optimal algorithms for exact point pattern matching in arbitrary dimensions. For translations, for example, it suffices to match those two points with the lexicographically smallest coordinate vectors and then to check, whether the other points match as well. If scaling of the pattern B to be matched is allowed, one can first determine the diameters dA, ds of both sets. Their ratio dA/ds gives the correct scaling factor for B. Therefore, there is an easy reduction of homotheties to translations and of similarities to rigid motions. Reflections can easily be incorporated by trying to match the set B as well as the set B' which is B reflected through some arbitrary hyperplane, for example, jci = 0. Exact point pattern matching under arbitrary ajfine transformations is considered by Sprinzak and Werman [88]. First the sets A and B are brought into "canonical form" by transforming their second moment matrices into unit matrices. Then it is shown that A, B can be matched under affine transformations exactly if their canonical forms can be matched under rotations. Since the canonical forms can be computed in linear time the asymptotic time bounds for matching under linear transformations are the same as the ones for rigid motions described above. A natural generalization of deciding whether two point patterns A and B are congruent is to ask for the largest subsets of both that are and to find the corresponding rigid motion. Akutsu et al. [20] address this problem and solve it by a voting algorithm. More specifically, to any pair (/?, ^) G A x ^ all pairs (r, 5") G A x 5 are determined where the lengths of the line segments ~pr and 'qs are the same. In this case the rigid motion that maps ~pf to qs gets a vote. In the end the rigid motion that obtained the most votes is the one matching the largest subsets. The running time of the deterministic version of this algorithm is
126
H. Alt and LJ. Guibas
0((X(n,m) \n^) logn). Here A(w, m) is a combinatorial geometric quantity related to the number of possible occurrences of a fixed length line segment in a set of points and it has an upper bound of 0(n^^^m^^^). Also a more efficient MonteCarlo algorithm based on random sampling is given that produces an approximate solution to the problem.
2.2. Approximate point pattern matching More realistic than exact point pattern matching is approximate point pattern matching. Here, given two finite sets of points A, 5 , the problem is to find a transformation matching each point b e B into the ^neighborhood (e ^ 0) of some point A G A. On the other hand each point in A should lie in the ^neighborhood of some transformed point of B. Clearly, there are many variants to this problem. The first distinction we make is whether A and B must have the same number of points and the matching must be a oneonemapping, or whether several points in one set may be matched to the same point in the other. Obviously in the latter case we consider matching with respect to the Hausdorjfdistance. 2.2.1. Onetoone matching. Alt et al. [13] give polynomial time algorithms for many variants of oneonematching of finite point sets. These variants are obtained by the following characteristics: • Different types of transformations that are allowed. • Solving either the decision problem: given e, is there a matching? or the optimization problem: find the minimal e allowing a matching. • A fixed oneonemapping between A and B is either already given or one should be found. • Different metrics, a concept generalized by Arkin et al. [11] to arbitrary "noise regions" around the points. We will demonstrate the techniques used with the example of solving the decision problem, for a given £ as a Euclidean tolerance, of matching under arbitrary rigid motions without a predetermined oneonemapping between the point sets A = [a\,...,an} and B = {bu...,bn}. First, it can be shown by an easy geometric argument that, if there exists a valid matching of 5 to A then there is one where two points Z?/, bj of B are matched exactly to the boundaries of the 6:neighborhoods Us{ak), Ugiai) of two points in A. Consider this configuration for all 4tuples of points ak, ai, Z?/, bj. Mapping bi, bj onto the boundaries of Us(ak) and Ue(ai) respectively in general leaves one degree of freedom which is parametrized by the angle 0 e [0, 27t) between the vector bi — ak and a horizontal line. Considering any other point bm ^ B,m^i, j , for all possible values of 0, that point will trace an algebraic curve Cm (of degree 6, in fact; see Figure 1). Being an algebraic curve of constant degree, any Cm intersects the boundary of any Ueiar) at most a constant number of times, in fact, at most 12 times. So there are at most 6 intervals of the parameter 0 where the image of bm lies inside Us(ar). All interval boundaries of this kind are collected. They partition the parameter space [0, In) into 0(n^) intervals, so that for all 0 in one interval the same points of B are mapped into the same neighborhoods of points of A. All these relationships are represented as edges in a
Discrete geometric shapes: Matching, interpolation,
and approximation
127
Fig. 1. Curve of point bm when bt, bj are moved on the boundaries of Usia^), Ueiag).
bipartite graph whose two sides of nodes are A and B. Clearly, the decision problem has a positive solution exactly if there is some (/) for which the corresponding graph has a perfect matching. This is checked by finding the graph for the first subinterval of [0, 27r) and constructing a maximum matching for it. Then, while traversing the subintervals from left to right, the maximum matching is updated until a perfect matching is found or it turns out that none exists. Observe, that this procedure is carried out 0(n^) times for all 4tuples ak, ai, bi, bj. A detailed analysis shows that the total running time of the algorithm is O(w^). In addition, determining the intersection points of the curves of degree 6 with circles could cause nontrivial numerical problems. However, simpler and faster algorithms were found for easier variants of the oneonematching problem. For the case of translation only, Efrat and Itai [39] improve the bounds of [13] using geometric arguments to speed up the bipartite graph matching involved (for fixed sets, they can compute what they call the optimum bottleneck matching in time 0(n^^ logn)). Arkin et al. [11] give numerous efficient algorithms mostly assuming that the 6:neighborhoods or other noiseregions of the points are disjoint. For example, the problem considered above is shown to be solvable in 0(n^ log n) time under this assumption. Also a generalization from rigid motions to similarity transformations is given in that article. Heffeman and Schirra [59] take an alternative approach to reduce the complexity of the decision problem in point pattern matching, which they call approximate decision algorithms. They only require the algorithm to give a correct answer if the given tolerance s is not too close to the optimal solution; more precisely, it has to lie outside the interval [^opt • oi, ^opt + )^] for fixed a, fi ^0. This way, using network flow algorithms, they can reduce the running time for solving the problem described above to 0(n^^). Behrends [22] also considers approximate decision algorithms. Assuming in addition that the £neighborhoods are disjoint, he obtains a running time of 0(n^logn). The best results
128
H. Alt and L.J. Guibas
Fig. 2. Voronoi surface of A.
in the case that the mapping between A and B is predetermined, are due to Imai, Sumino, and Imai [66] who analyze the lower envelope of multivariate functions in order to find the optimal solution. 2.2.2. Point pattern matching with respect to Hausdorjfdistance. Now A and B may have different cardinalities, let A = {^i,..., «„} and B = {b\,... .bm] The Hausdorffdistance between A and B can be computed straightforwardly in time 0(nm). It is more efficient to construct the Voronoidiagrams VD(A) and VD(B) and to locate each point of A in VD(B) and vice versa in order to determine its nearest neighbor in the other set. This way the running time can be reduced to 0((n \ m) \og(n + m)) (see [2]). Algorithms for optimally matching A, B under translations for arbitrary L,;metrics in 2 and 3 dimensions using Voronoi diagrams are given by Huttenlocher, Kedem, and Sharir [56]. The idea of these algorithms is as follows: The Voronoisurface of the set A is the graph of the function d{x) =min \\x — a\\ aeA
which assigns to each point x the distance to the nearest point in A. Clearly, d{x) is the lower envelope of all da {x) =  jc — a , where aeA. For example, for L2 and dimension 2 the graph of da{x) is an infinite cone in 3dimensional space whose apex lies in a (see Figure 2). The graph of J(JC) is piecewise composed of these cones and the projection of the boundaries of these pieces is the Voronoi diagram of A. If B is translated by some vector t the distance of any b e B to its nearest neighbor in A is 8b(t) =min\\a — (b\t)\\ =min\\(a — b) — t\\= aGA
aGA
min dx(t) xeAb
Discrete geometric shapes: Matching, interpolation, and approximation
129
SO the graph of 8t> is the Voronoi surface of A translated by the vector —b. The directed Hausdorff distance IH{B \t, A) is the function /(0=max5/,(0 beB
and, consequently, the upper envelope of m Voronoi surfaces, namely those of A — /?i, A — Z?2,..., A — Z?^. On the other hand we consider g{t) =
lH{A,B^t).
Since git) = ^//(A + (—t), B) we can define g{t) by upper envelopes like / ( / ) , interchanging the roles of A and B and replacing thy—t. The Hausdorffdistance between A and 5 + f is then /i(0=max(/(0,^(0). Again, for L2 the graph of h is composed of piecewise "conic" segments. We are searching for mmth{t). This minimum is found by determining all local minima of h(t). By the bounds on the number of these minima derived in [56], algorithms are obtained for matching 2 and 3dimensional finite point sets under translations minimizing the Hausdorff distance. In 2 dimensions their running times are 0(nm(n + m) lognm) for the Liand Loometric and 0(nm(n + m)a(nm) login + m)) for other L^metrics, r = 2, 3 , . . . . In 3 dimensions time Oiinm)^in + m)^+^) is obtained for the L2metric. At first glance it is not clear how the technique described earlier can be generalized from translations to arbitrary rigid motions. However, this is done by Huttenlocher et al. in [54] by considering so called dynamic Voronoi diagrams. Here, it is assumed that we have a point set consisting of k rigid subsets of n points each. Each of the subsets may move according to some continuous function of time. The dynamic Voronoi diagram is the subdivision of the 3dimensional spacetime such that every cross section obtained by fixing some time t equals the Voronoi diagram at time t. The authors investigate how many topological changes the Voronoi diagram can undergo as time passes which gives upper bounds on the complexity of the dynamic Voronoi diagram. These results are applied to matching under rigid motion by representing the optimal solution as DiA, B) = minSn(reiA),
B{x)
where x € R^ is the translation vector, and re is the rotation around the origin by angle 0 e [0, 27r). For fixed 0 we have the situation described before in the case of translations. The (directed) optimal Hausdorffdistance can be determined by finding the minimum of the upper envelope of m Voronoi surfaces, namely the ones of r^ (A) — b\,.. .,
[email protected] (A) — bm. The minimum algorithm keeps track of this for changing values of © by considering the dynamic Voronoi diagram of these sets where © is identified with the time parameter. As a consequence, an optimal match of two point sets under arbitrary rigid motions can be found in time 0((m + n)^ logimn)).
130
H. Alt and L.J. Guibas
Matching of point patterns under translations in higher dimensions is investigated by Chew et al. [27]. For the decision problem in case of the Loometric, the space of feasible translations is an intersection of unions of unit boxes. This space is maintained using a modification of the data structure of orthogonal partition trees by Overmars and Yap [79]. This gives algorithms for the decision problem which are used to solve the optimization problem by parametric search [74,32]. In particular, for the Loometric an algorithm of running time 0(n^^^~^^/^log^n) is obtained where n is the number of points in both patterns. For Jdimensional point patterns under the L2metric, the matching takes time 0(nr^^/2^+4og^n). The methods described before are probably quite difficult to implement and numerically unstable due to the necessary computation of intersection points of algebraic surfaces. A much simpler but practically more promising method is given by Goodrich et al. in [48]. For a "pattern" P and a "background" B of m and n points, respectively, it approximates the optimal directed Hausdorffdistance min7 5//(r(P), B) up to some constant factor. T ranges over all possible transformations which are translations in arbitrary dimensions or rigid motions in 2 or 3 dimensions. The approximation factors are between 2 + ^ for translations in R^ and 8 + 6^ for rigid motions in M^. The running times are considerably faster than the ones of algorithms computing the optimum exactly. The algorithm for rigid motions in R^ essentially works as follows: 1. Fix a pair (p,q) of diametrically opposing points in P. 2. Match the pair by some rigid motion as good as possible to each pair of points of B. 3. For each such rigid motion determine the distance of the image of each point in P to its nearest neighbor. Choose that match where the maximum of these distances is minimized. In higher dimensions the nearest neighbor search is done approximately by the data structure of Arya et al. [12]. 2.2.3. Practical variations PercentileBased Hausdorff Distance
As was mentioned above, the Hausdorffdistance is probably the most natural function for measuring the distance between sets of points. Furthermore, it can easily be applied to partial matching problems. In fact, suppose that sets A and B are given where A is a large "image" and 5 is a "model" of which we want to know whether it matches some part of A. This is the case exactly if there is some allowable transformation T such that the oneway Hausdorffdistance 8H(T(B), A) is small. In fact, many of the matching algorithms with respect to Hausdorffdistance presented previously can be applied to partial matching as well. An application of this property to the matching of binary images is given by Huttenlocher et al. in [55] where a discrete variant of the Voronoidiagram approach for matching under translation with respect to Hausdorffdistance is used. In the same article a modification of the Hausdorffdistance is suggested for the case that it is not necessary to match B completely to some part of A but only at least k of the m points in 5 . In fact, the distance measure being used is hk(B, A) = mmkTmn\\a — b\\,
Discrete geometric shapes: Matching, interpolation, and approximation
131
where min/: denotes the kih smallest rather than the largest value. This percentile definition allows us to overcome the sensitivity of the Hausdorffdistance to outliers, which is very important in practice. The paper [55] is also interesting in that the authors show how to adapt some of the conceptual geometric ideas presented earlier to their rasterized context so as to obtain, after several other optimizations they invented, efficient practical algorithms for the partial Hausdorff matching described above. Alignment and Geometric Hashing
A number of other techniques for point pattern matching have been developed and used in computer vision and computational molecular biology. In computer vision the point pattern matching problem arises in the context of modelbased recognition [38,21] — in this case we are interested in knowing whether a known object (we will call it the model M) appears in an image of a scene (which we will denote by S). Both the model and the scene are subjected to a feature extraction process whose details need not concern us here. The outcome of this process is to represent both M and 5 as a collection of geometric objects, most commonly points. The same principle applies to the molecular biology applications — typically molecular docking [77]. In that context we are trying to decide if the pattern, usually a small molecule (the ligand), can sterically fit into a cavity, usually the active site of some protein. Again through a feature extraction process, both the ligand and the active site can be modeled by point sets. The dimensionalities of the point sets M and 5, as well as the transformation group we are allowed to use in matching M to 5, are application dependent. In computer vision S is always 2D while M can be either 2D or 3D; both are 3D in the biology context. To illustrate the methods of alignment and of geometric hashing we use below an example in which both M and S are planar point sets of cardinalities m and s respectively. In the example we will assume that the allowed transformation group when matching M to 5 is the group of similarities, i.e. Euclidean transformations and scalings. We are interested in oneway matches from M to 5, in the sense of the oneway percentile Hausdorff distance: we will be looking for transformations that place many (most) points of M near points of S. The extension of these ideas to the case of other dimensions and other transformation groups is in general straightforward; the one exception is when the allowed transformations include a (dimensionreducing) projection — about which more below. In the alignment method [62], two points a and b of M are first chosen to define a reference coordinate frame [a; b] for the model. We can think of the first point as the origin (0,0) and the second point as the unit along the xaxis (1,0). This choice also fixes the _yaxis and thus an orthogonal coordinate system in which all points of M can be represented by two real values. Note that this representation of the points in M is invariant under translations, rotations, and scalings. We now align the points of a and b of M with two chosen points p and q of S respectively. Up to a reflection, this fixes a proposed similarity mapping M to 5 (we will ignore the reflection case in what follows). In order to test the goodness of this proposed transformation, we express all points of S using coordinates in the frame [p; q]. Now that we have a common coordinate system for two sets, we just check for every point of M to see if there is a point of S nearby (within
132
H. Alt and LJ. Guibas
some preselected error tolerance). The number of points on M that can thus match in this verification step is the score for the particular transformation we are considering. The alignment method consists of trying in this way to align pairs of points of M with pairs of points of S and in the process discover those transformations that have the highest matching score. If we could assume that all points of M are present in S, in principle we could get by with matching and verifying a specific pair from M with all its counterparts in S. Because of occlusions, however, this assumption cannot be made in practice and usually we need to try many pairs of points from M before the correct match is found. Alignment is thus an exhaustive method and its worstcase combinatorial complexity is bad, Oinr's^) — even assuming only a linear 0(m) verification cost (0(m log^) would be a more theoretically correct bound). Things get worse as the size of the frames we need to consider increases with higher dimensions or larger transformation groups. Thus in the vision context a lot of attention must be given to the feature extraction process, so that only the most critical and significant features of each of M and S are used during the ahgnment. Since we may want to match the same model M into many scenes or, conversely, we may be looking for the presence of any one of a set of models Mi, M 2 , . . . , M^ in a given scene, it makes sense to try to speed up the matching computation through the use of preprocessing. This leads to to the idea of geometric hashing [72,70,71]. Let us describe geometric hashing in the same context as the in the above alignment problem, but with several models Mi, M 2 , . . . , M^. As above, for each model M/ and each frame [a\ Z?] of two points for that model, we calculate coordinates for all other points of M/ in that frame. The novel aspect of geometric hashing is that these coordinates are then used as a key to hash into a global hash table. We record at that hash table entry the model index and frame pair the entry came from. The computation of this hash table completes the preprocessing phase of the algorithm. Note that there is a hash table entry for each triplet (model, frame for that model, other point in that model); multiple triplets may hash to the same table entry, in which case they are linked together in a standard fashion. At recognition time, we choose a frame pair [p\q] in the scene S and compute the coordinates of all points of S in that frame. Using then these coordinates as a key, we then hash into the global hash table and 'vote' for each (model, frame) pair stored at that hash table entry. If we were lucky to choose two scene points which correspond to two points [a, Z?] in an instance of some model M/, we can then expect that the pair (M/, [a\ bY) will get many votes during that process, thus signahng the presence of M, in the scene and also indicating the matching transformation involved. In general, of course, we cannot expect to be so lucky in choosing p and q the first time around, so we will have to repeat the voting experiment several times. In the worst case, preprocessing for a model M of size m costs O(m^) and the recognition by voting also costs 0{s^) (we assume throughout that the cost of accessing the hash table is constant). Note that by appropriately rounding the coordinates used as a key to the hash table we can allow for a certain error tolerance in matching points of M and S. Also, once some promising (model, frame) pairs have been identified, the votes for the winner actually give us a proposed correspondence between model and scene points. The matching transformation can then be calculated more accurately using a leastsquares fit [71]. As was mentioned above for the alignment problem, these ideas also extend to matching point sets in 3D, as well to other transformation groups, such as the group of affine maps.
Discrete geometric shapes: Matching, interpolation, and approximation
133
One noteworthy aspect of this in the vision case is the dimensionreducing projection maps that must be allowed in matching (as when M is 3D but S is 2D). This makes the problem harder, as the projection map is not invertible and a point in S has an inverse image which is a line in 3D. This can be handled in geometric hashing by having each point of S, after a frame has been chosen, generate samples along a line of possible matching points from M in 3D and vote for each of them separately [72]. Geometric hashing has been successfully used in both identifying CAD/CAM models in scenes, as well in the molecular docking problem [72,70,71,77,78]. Performance in practice tends to be much better than the above combinatorial worstcase bounds would indicate. Recent theoretical studies also suggest that randomization can improve the above bounds for alignment and geometric hashing, especially in cases where the model is not present in the the scene, or when the point sets involved have limited 'selfsimilarity' [65]. 3. Matching of curves and areas Apart from point patterns, research has been done in recent years also on the resemblance of more complex patterns and shapes, mostly in two dimensions. These objects usually are assumed to be given by polygonal chains or one or more simple polygons representing their boundary. As a measure for their resemblance usually the Hausdorffdistance is used, though some articles are concerned with other variants, as described in Section 2.2.3. 3.1. Optimal matching of line segment patterns Throughout this section we will assume, if not explicitly stated otherwise, that the input to the algorithms consists of two sets A, B of n, m line segments in two dimensions, respectively. The aim is to find an optimal match between A and B, i.e. a transformation T minimizing the Hausdorffdistance 8H(A, T(B)). Here, A and B are identified with the sets of points lying on their line segments and the metric underlying the Hausdorffdistance is L2. Notice that while there is a straightforward 0(nm) algorithm for computing the Hausdorff distance between fixed finite point sets A and B, this is no longer the case for sets of line segments. In the case of convex polygons Atallah [18] gave a linear time algorithm. For arbitrary sets of line segments an asymptotically optimal 0(nlogn) algorithm was given by Alt et al. in [2]. This algorithm is based on the fact, that the Hausdorff distance can only occur at endpoints of line segments or at intersection points of line segments of A with the Voronoi diagram of B or vice versa. Furthermore, for any Voronoi cdgQ this can happen only at the two extreme intersection points with line segments of the other set. These points are then determined by a line sweep algorithm. In [2] it was also observed that the matching problem under translations or rigid motions can be solved in polynomial time. These results are based on the fact that if the transformation has k degrees of freedom (e.g. ^ = 3 for rigid motions) then in the optimal position the Hausdorffdistance essentially must occur in at least k\l different places. More sophisticated techniques leading to asymptotically faster, but probably practically quite complicated algorithms are used by Agarwal et al. [16] for translations and Chew et
134
H. Alt and L.J. Guibas
Fig. 3. The set Ag
al. [29] for arbitrary rigid motions. Both articles start with essentially the same idea. They first solve the decision problem whether for given A, B, and ^ > 0 there exists a transformation T such that 5//(A, T{B)) ^ e. Let us consider the oneway Hausdorffdistance in detail; with just a few technical details it can be extended to the two way Hausdorff distance. Let Cs be the disk of radius e around the origin and A^ the Minkowski sum A 0 Q . Clearly, As is the union of so called "racetracks" ([16]), i.e. rectangles of width 2e with semidisks of radius e attached at their ends (see Figure 3). Now, for a transformation T the oneway Hausdorffdistance 8H(T(B), A) ^S exactly if T(B) C Ag. Let us consider the case of translations first. Suppose r is a translation vector not satisfying the inclusion above. So we have 5 f f ^ A^, in particular t \bi gl Ag for some line segment bi e B. This is equivalent to r G A^ 0 (—^/), where A^ denotes the complement B? \ A^ of A^. Conversely, a translation t moves B into A^ exactly if r G Ag 0 {—bi) for / = 1 , . . . , m. The latter set we will denote by A^, (see Figure 4) so there is a one way match exactly if the set
S^^A^ i=\
is nonempty. Figure 4 shows that in the construction of the sets A^, / =: 1 , . . . , m, we use the circular arcs and line segments bounding As and, additionally, these curves translated by the vector bi; altogether there are 0(nm) circular arcs and line segments. Each A^ is a union of some of the cells of the arrangement A defined by these curves. The decision problem for translations can be solved by a sweep line algorithm. While sweeping across the arrangement the algorithm computes the depth of the cells, i.e. the number of different A^ that cover a cell. Clearly, S is nonempty, exactly if there is a cell of depth m. Since the complexity of the arrangement is 0{{mn)^) the sweep line algorithm solves the decision problem for translations in 0((mn)^log(mn)) time (see [16]). In the case of rigid motions (see [29]) we assume that first the set B is rotated around the origin and then translated in order to match the set A. For each orientation 0 € [0, 2n) we consider the sets A^.{0) which are defined like A?, only that bi is rotated by angle 0 around the origin. Likewise the arrangement A(0) depends on the orientation 0.
Discrete geometric shapes: Matching, interpolation,
and
approximation
135
h
Fig. 4. The set Af (shaded).
b) Fig. 5. Orientations where the arrangement changes: (a) double event; (b) triple event.
^(0) and the depth of its cells can be determined as described before. Then while increasing 0 the algorithm keeps track of the changes that occur in the arrangement and of the depth of the newly appearing cells. The arrangement only changes topologically for orientations 0 where two sets of the form {aj 0 £) 0 (—^j) touch each other, a socalled "double event" (see Figure 5(a)), or the boundaries of three of them intersect in one point, a "triple event" (see Figure 5(b)). Altogether, there are O(m^n^) events. The algorithm determines them and sorts them in a preprocessing phase. Then it makes use of a suitable data structure where all local changes in the arrangement due to an event can be processed in constant time. In this
136
H. Alt and LJ. Guibas
manner, starting from ^(0) all arrangements are inspected whether for some 0 there is a cell in A{0) of depth m. If so, a positive answer is given to the decision problem. Altogether the algorithm requires Oirri^n^ log(mn)) time. In both cases the algorithms for the decision problem can be turned into ones for the optimization problem hy parametric search (see [74,32]) on the parameter e. For matching by translation, Agarwal et al. [16] describe a parallel algorithm which first computes the arrangement A. Then it determines the depth of its cells by considering the dual graph, finding an Eulerian path in it and using that to traverse the cells systematically. This parallel algorithm is used to direct the parametric search. Altogether, an 0((mn)^log^(mn)) algorithm for finding the optimal matching under translations is obtained. For optimal matching by rigid motions Chew et al. [29] use an EREWPRAM sorting algorithm for the events to direct the parametric search. Whenever this algorithm attempts to compare two events 0\ (s), 62(8), the set of critical parameters e is determined and sorted. Then a binary search is done on these critical parameters in each step involving the decision algorithm described before to determine the interval containing the optimal e. Altogether an 0((mn)^ \og^(mn)) algorithm is obtained for optimal matching under rigid motions. With essentially the same ideas and the usage of dynamic Voronoi diagrams efficient algorithms for point pattern matching are obtained in [29], as was mentioned in Section 2. Huttenlocher et al. [56] also extend the Voronoi diagram approach described in Section 2 to sets of fine segments. This method leads to rather complicated surfaces if the Hausdorffdistance with respect to the L2metric is considered. However, if the underlying metric is L\ or Loo the situation is simpler and an 0({mn)^a(mn)) algorithm can be obtained.
3.2. Approximate matching As we have seen in the previous sections the algorithms for finding the optimal solution of the matching problem use quite sophisticated techniques from computational geometry and, therefore, are probably too complicated to implement. Also the asymptotic running times are, although polynomial, rather high. One approach to overcome these problems are approximation algorithms for the optimization problem. These are algorithms that do not necessarily find the optimal solution, but find one whose distance is within a constant factor c of the optimum. Again, if not explicitly stated otherwise we will consider matching of sets of line segments with respect to Hausdorffdistance based on the L2metric. Approximation algorithms in this context were considered first by Alt et al. [2,3] using so called reference points. These are points rA, rg that are assigned to the sets A and B and have the property that when B is transformed to match A optimally then the distance of the transformed r^ to r^ is also bounded by a constant factor a times the Hausdorffdistance of the matching. The factor a is called the quality of the reference point. A reference point can be found very easily in the case of translations as allowable transformations. In fact, to a set A assign the point r^ = (^min' ^min^ where x^^^ (Jmin) ^^ ^^^ lowest Xcoordinate (jcoordinate) of any point in A. So rA is the lower left comer of the smallest axesparallel rectangle enclosing A. Observe that if in an optimal match A and the translated image B^ of B have Hausdorffdistance 8 then \x^ — Xj?  ^ 8 and
Discrete geometric shapes: Matching, interpolation, and
approximation
137
^min ~ ^^minl ^ ^ (^^^ Figure 6). Consequently, the distance of TA and r^/, which is the image of fB under the translation, is at most \/28. So r^ is a reference point for A of quality
V2. Now, suppose that instead of finding the optimal translation of B to match A we use just the one that matches rs to r^ obtaining an image B^^ of B. Then, since B^ is obtained from B^^ by translation by the vector r^/ — r^, SH(B\ B") < V25. Consequently SH{A,B')
^
8H{A,B')^8H{B\B')
< (v^+l)5. So the Hausdorffdistance of the match found by the reference points is at most by a factor V2 + 1 ^ 2.4 worse than the optimal one. In general, matching with respect to a reference point of quality a for translations yields a match that is at most a factor a + \ worse than the optimal one. Observe that the approximation algorithm has linear running time, since only the reference points need to be determined. So it is much faster and much simpler than the best known algorithm for finding the optimal match which has running time
Oiimnflog^mn) [16]. Reference points for rigid motions are not that easy to find. Obviously the one for translations given above does not work any more. Nor do the seemingly obvious choices like the center of gravity of the convex hull of a set A or the center of the smallest enclosing circle. It was shown by Alt et al. [2] that for an arbitrary bounded set A the center of gravity of the boundary of the convex hull is a reference point with respect to rigid motions. However, the upper bound given for the quality of this reference point is rather large, in fact, it is 47r + 4 ^ 1 6 . 6 .
138
H. Alt and L.J. Guibas
Aichholzer et al. in [1] found a better reference point. In fact, imagine that the axesparallel wedge determining the reference point for translations given above is circled around the set A always keeping the bounding halflines tangent to A. Then its apex describes a closed curve. For the "average point" on this curve no particular direction is preferred, so it might be a candidate for a reference point under rigid motions. Formalizing and slightly simplifying this idea, we obtain the following definition for arbitrary bounded sets A: ^2n
s{A):=
1 r"" /
n Jo
hAm
/cos0\
. l]d(t>^
ysmcpj
where HA (0) is the so called support function of A which assigns to 0 the largest extent of A in direction 0. The point s(A) is the so called Steinerpoint of A. The Steiner point is well investigated in the field of convex geometry [85,52] as well as in functional analysis [80]. Using these results it is shown in [1] that the Steiner point is a reference point not only for translations and rigid motions, but even for similarities and not only for two but for arbitrary dimensions. Its quality is A/n ^ 1.27 in two, 1.5 in three and between >J2/n\/d and V2/7rV^ + 1 in d dimensions. Usually the Steiner point is defined for convex bodies only, it can be extended to arbitrary bounded sets by taking the Steiner point of the convex hull. In the case of sets of line segments we obtain convex polygons for which the Steiner point can easily be computed. In fact it is the weighted average of the vertices where each vertex is weighted by its exterior angle divided by In. Furthermore, Przeslawski and Yost [80] showed that for translations there is no reference point whose quality is better than the one of the Steiner point. In the case of translations the usage of a reference point for approximate matching was obvious. In the case of rigid motions first the two reference points are matched by a translation and then the optimal matching is sought under rotations around the common reference point. This is easier than the general optimization problem since the matching of the reference points reduces the number of degrees of freedom by two (in two dimensions). In the case of similarities, figure B is first stretched by the factor dA/ds, where dA and dg are the diameters of A and B, respectively. Then the algorithm for rigid motions is applied. In [1] it is shown that from reference points of quality a approximation algorithms are obtained yielding a solution within a factor of a + 1 of the optimal one in the case of rigid motions and within a factor of a + 3 of the optimum in the case of similarities. The running times for both approximate matching algorithms are Oinm Xoginm) log*(nm)). Finally it should be mentioned that by an idea due to Schirra [82] it is possible to get the approximation constant of reference point based matching with respect to translations or rigid motions arbitrarily close to 1. In fact, suppose that the quality of the reference point is a. This means that in the optimal match the reference point r^ is mapped into the a5neighborhood UofrA In order to achieve an approximation constant 1 + ^ for a given s, we place onto U a sufficiently small grid so that no point in U has distance greater than eS from the nearest grid point. Instead of placing rg onto TA only we place it onto each grid point and proceed as described before. Since at some point rg is placed at a distance of at most e^ of its optimal position, the approximation constant is at most \\ e. Notice,
Discrete geometric shapes: Matching, interpolation,
and
approximation
139
Fig. 7. Two curves with small Hausdorffdistance 8.
that for a constant s only constantly many grid points are considered so the running time only changes by a constant factor.
3.3. Distance functions for nonpoint objects In some applications, the simplicity of the Hausdorffdistance can be a disadvantage. In fact, when the distance between curves is measured the Hausdorffdistance may give a wrong picture. Figure 7 shows an example where two curves have a small Hausdorffdistance although they have no resemblance at all. The reason for this problem is that the Hausdorffdistance is only concerned with the point sets but not with the course of the curves. A distance considering the curves' courses can informally be illustrated as follows: Suppose a man is walking his dog, he is walking on one curve, the dog on the other. Both are allowed to control their speed but not to go backward. What is the shortest length of a leash that is possible? Formally, this distance measure between two curves in Jdimensional space can be described as follows 8F{f g) = inf max \\f{a(t))  g{p(t)) \\ where / , ^ : [0, 1] ^ M*^ are parameterizations of the two curves and a, ^ : [0, 1] ^ [0, 1] range over all continuous and monotone increasing functions. This distance measure is known under the name Frechetdistance. The Frechetdistance seems considerably more difficult to handle than the Hausdorffdistance and no matching algorithms have been developed yet. The following algorithm for measuring the Frechetdistance between two polygonal chains has been given by Alt andGodau[8,9]. Let P and Q be the given polygonal chains consisting of n and m line segments respectively. First we consider the decision problem, so in addition to P and Q some 6: > 0 is given and we want to decide whether (5/r(P, Q) ^s. We first consider the m x ndiagram DsiP, Q) shown in Figure 8 which indicates by the white area for which points p e P, ^ ^ Q \\p — ^W ^ £' The horizontal direction of the diagram corresponds to the natural parameterization of P and the vertical one to that of Q. One square cell of the diagram corresponds to a pair of edges one from P and one from Q and can easily be computed since it is the intersection of the bounding square with an ellipse.
140
H. Alt and L.J. Guibas
Fig. 8. P, Q, 6 and the diagram D^iP, Q).
0 i
Fig. 9. Turning function of a simple polygon.
Now it follows from the definition that S^iP, Q) ^ e exactly if there is a monotone increasing curve from the lower left to the upper right comer of the diagram. These considerations lead to an algorithm of running time 0(mn) for the decision problem. Then Cole's variant of parametric search [33] can be used to obtain an algorithm of running time 0(mnlog(mn)) to compute the Frechetdistance between P and Q. In practice, it seems more reasonable to determine 8f(P, Q) bit by bit using binary search where in each step the algorithm for the decision problem is applied. Arkin et al. [6] consider a distance function between shapes in two dimensions that is based on the slope of the bounding curves. In fact, for a given shape A some starting point O on the bounding curve is chosen and the curve is then parametrized with the natural parameterization HA (i.e. parameterization by arc length) which is normalized so that the parameter interval is [0,1]. To each parameter r € [0,1] the angle &A{t) between the counterclockwise tangent of A in the point n^CO and a horizontal line is assigned. 0A is called the turning function of A. OA is piecewise constant for simple polygons (see Figure 9), it is invariant under translations and, because of the normalization of the parameterization under scaling. A rotation of A corresponds simply to a shift in 6)direction and a change of the origin to a shift in ^direction. Now, as a distance measure between shapes A and B the L^metric {p e N) between
Discrete geometric shapes: Matching, interpolation, and approximation
141
&A and GB is being used, i.e. we define 8,(A,B)=(j
\0A(s)eB(s)\'ds\
.
Then this distance measure is made invariant under translations and the choice of the starting point 0: ^P
dp(A,B)=
min
( f
ISAis + t)  0B(S) ^ 0\^ ds]
It is shown that dp is a metric for all /? € N. An algorithm is given for computing d2(A, B) where A, B are simple polygons with n and m edges, respectively. It can be shown that the minimum in the definition of dp can occur for at most 0(mn) "critical" values of ^ By considering partial derivatives with respect to G it is shown that for any fixed t the optimal 0 can easily be computed. Altogether, an 0(mn logmn) algorithm is obtained. An extension of this algorithm to deal with scaling as well was given by Cohen and Guibas [28]. The drawback of this distance measure is its sensitivity to noise, especially nonuniformly distributed noise, but it works properly if the curves are sufficiently smooth. A generalization of this distance to a distance measure that is invariant under affine transformations is given by Huttenlocher and Kedem [53]. With respect to this distance, matching of two polygons with n and m vertices under affine transformations is possible in time 0(mn log mn). A different idea is to represent shapes by their areas rather than by their boundaries. In this context the probably most natural distance measure between two shapes is the area of their symmetric difference. However, this measure seems to be much more difficult to handle than Hausdorffdistance. Within computational geometry it was first considered in a paper by Alt et al. [4] in connection with the very special problem of optimally approximating a convex polygon by an axesparallel rectangle. Meanwhile some more results on the symmetric difference have been obtained. In fact, de Berg et al. in [34] consider matching algorithms maximizing the area of overlap of convex polygons which is the same as minimizing the symmetric difference. They obtain an algorithm of running time 0((n + m) \og{n + m)) for translations where n and m are the numbers of vertices of the two polygons. In addition, it is shown that if just the two centers of gravity are being matched by a translation this yields a position of two convex figures where the area of overlap is within a constant factor of the maximal one. A lower bound of 9/25 and an upper bound of 4/9 is obtained for this constant, so the center of gravity is a reference point with respect to maximizing the overlap under translations. As can easily be seen this does not imply directly that it is a reference point with respect to the area of the symmetric difference. However, this can be shown, as well. In fact, Alt et al. [7] show that if the centers of gravity of two convex figures are matched the area of the symmetric difference is at most 11/3 times the minimal one. It is demonstrated with an example that this bound is tight. The center of gravity is also a reference point for other sets of transformations such as rigid motions, homotheties, similarities, and arbitrary affine mappings.
142
H. Alt and L.J. Guibas
4. Shape simplification and approximation In manipulating shape representations, it is often advantageous to reduce the complexity of the representation as much as possible, while still staying geometrically close to the original data. There is a vast literature on shape simplification and approximation, both within computational geometry and in the various applied disciplines where shape representation and manipulation issues arise. In this section we cannot possibly attempt to survey all the approaches taken and the results obtained. We will focus on a small subset of results giving efficient algorithms for shape simplification under precise measures of the approximation involved.
4.1. Twodimensional results To focus our attention, let us consider the problem of simplifying a shape represented as a polygonal chain in the plane. Our goal is to find another polygonal chain with a smaller number of links and which stays close to the original. Let the original chain be C, defined by n vertices v\,V2, •• .Vn (we assume in this discussion that C is open), and let the desired approximating chain A be defined by m vertices ifi, w;2, • • •, w;^. A number of variations on the problem are possible, depending on exactly how the error, or distance, between C and A is measured, and on whether the Wj 's need to be a subset of the u/ 's, or can be arbitrary points of the plane. In general we have to solve one of two problems in finding A: The min# problem: Find an A which minimizes m (the combinatorial complexity of A), given some a priori bound e on the maximum allowed distance between C and A, or The mine problem: For a given m, find an A which minimizes the distance e between CandA. In order to illustrate some of the ideas involved in solving these problems, let us further assume that both C and A are jcmonotone chains — in other words, C and A are piecewise linear continuous functions C{x) and A{x). For such chains a very natural measure of distance is the socalled uniform or Chebyshev metric defined as J(A, C) = maxA(jc)  C(JC),
where the max is taken over the support on the xaxis for C Let us consider the case when the vertices of A can be arbitrary points, i.e. need not be vertices of C. Imai and Iri [63,64], and Hakimi and Schmeichel [57] gave optimal 0(n) algorithms for the min# problem in this context. Their methods can be viewed as an extension of the lineartime algorithm of Suri [87] for computing a minimum link path between two given points inside a simple polygon (here the polygon is the chain C appropriately 'fattened' vertically by the allowed error s) and make crucial use of the concept of weakvisibility from an edge inside a simple polygon [17]. Similar ideas were also used by Aggarwal et al. [5] to give an
Discrete geometric shapes: Matching, interpolation, and approximation
I A3
0{n\ogk) algorithm for finding a convex polygon with the smallest number k of sides nested between two given convex polygons of total complexity n. For the min6: variant of the chain simplification problem, Hakimi and Schmeichel gave an 0{n^ \ogn) algorithm by cleverly limiting the critical values of 6" to a set of size 0{n^) and then using a certain kind of binary search. More recently, Goodrich [49] used a number of new geometric insights to reduce the set of critical e values to 0{n) and thus obtained an 0{n\ogn) algorithm through several applications of pipelined parametric searching techniques. For a survey of results when A and C are not constrained to be jcmonotone, see the paper of Eu and Toussaint [41] and related work by Hershberger and Snoeyink [60], and Guibas et al. [46]. In general, algorithms for the min# problem have linear complexity, while those for the min^ have quadratic complexity. Next let us consider the problem variant where the vertices of A have to be a subset of the vertices of C Now we do not require that A or C be xmonotone (so we revert to using the Hausdorff distance function). One of the oldest and most popular algorithms for this problem is the heuristic DouglasPeucker [37] line simplification algorithm from the Geographical Information Systems community; Hershberger and Snoeyink showed how to implement this algorithm to run in 0{n\ogn) time [58]. A more formal approach to the problem was initiated in the papers by Imai and Iri cited above. For the min# variant, Imai and Iri reduce the problem to a graphtheoretic problem as follows. A line segment vJiTj joining vertices vi and Vj of C is called a shortcut for the subchain f /, i;/+i,..., f y of C. A shortcut is allowed if the error it induces is at most the prescribed error e\ the error of the shortcut 'vTv] is defined to be the maximum distance from Wv] to a point Vk, where i ^ A: ^ j . It is easy to see that this is also the Hausdorff distance from IJrv] to the subchain f/, f/+i,..., f J. Our goal is to replace C by a chain consisting of allowed shortcuts. So we consider a directed acyclic graph G whose nodes V are the vertices fi, i'2,..., f,2 of C and whose edges E are the pairs {vt, Vj) if and only if / < j and the shortcut vt Vj is allowed. A shortest (in terms of the number of edges) path from vi to Vn corresponds to a minimum vertex simplification of C; such a path can be found in time linear in the size of G by topological sorting [31]. The size of G is O(n^) and it can be computed by an obvious method in 0(n^) time. Thus constructing G is the bottleneck in the computation. Mellonan and O'Rourke [75] showed how to reduce the construction time to 0(n^ logn), and Chan and Chin [26] further reduced it to optimal O(w^). The Chan and Chin algorithm starts from the observation that the error of a shortcut WvJ, i < j , is the maximum of the errors of two halflines: the one starting at vt and going towards Vj (call it Uj), and of the one starting at Vj and going towards vt (call it Ijt). To compute the graph G we intersect the graphs G\ and G2, where Gi contains the edge (f/, Vj) if and only if / < j and the error of Uj is less than s and G2 contains the edge {vi, Vj) if and only if / < j and the error of Ijt is less than e. We show how to compute G\ in O(n^) time; the computation of G2 is entirely symmetric by reversing the number of the vertices of C We examine the vertices of Gi in the sequence v\,V2,  • .,Vn. When we process vertex Vi, we calculate in turn the errors determined by all halflines Uj, where j takes on the values / + 1, / f 2 , . . . , n. Let Dk denote a closed disk of radius e centered at Vk. The error of Uj is at most e if and only if Uj intersects all disks Dk with i ^k ^ j . Thus the algorithm works by maintaining the cone of halflines from vt which intersect the disks
144
H. Alt and L.J. Guibas
^z+l
Fig. 10. The computation of the allowed shortcuts starting at Vj.
D/+1, D/+2, • • •, ^y (which is nothing but the intersection for the corresponding cones for all these disks separately). When we process fy+i it suffices to update this cone, which is a constant time computation. If the cone stays nonempty, then (f,, fy+1) is in G i; otherwise we are done with Vi as all further halflines will also have error which is too large. Thus the computation of G i, and therefore of G and of our desired shortest path can be done in 0(n^) time. Figure 10 illustrates the situation with the disks and the cone of vi a some intermediate point. Methods based on the ImaiIri graph construction seem inherently quadratic as, if e is large enough, the graph will have Q{n^) allowed shortcuts. However, Varadarajan [89] was able to use graph chque compression techniques such as those proposed by Feder and Motwani [44] to obtain an 0(«^/'^"^'^) algorithm for this min# problem in the case of Xmonotone chains. Varadarajan gave a randomized and a more complex deterministic algorithm for the min^ version of this problem as well, with the same time bound. In the general (nonxmonotone) case of the above chain simplification problems it is quite possible that A may end up being selfintersecting, even though C itself is simple. This is clearly undesirable in many application contexts. Even worse, one is often simplifying several chains at once, as in the case of boundaries between regions in, say, a geographical map. In this case it is important that the topological structure of the regions be maintained after simplification, so the simplifications of disjoint chains are not allowed to end up crossing each other. Guibas et al. [46] showed that the min# problem is NPhard in this case, when the positions of the approximating vertices can be arbitrary. When the vertices of the approximating chain have to be a subset of the original chain and we are in the xmonotone setting, de Berg et al. [35] gave an 0{n(n + m) log^i) algorithm for the min# problem for a chain C of n vertices so that the resulting approximating chain A is guaranteed to be simple and to be on the same side of each of m given points as C is. Using this algorithm as a local subroutine, they give a method for polygonal subdivision simpHfication which is guaranteed to avoid topological inconsistencies (but which need not be globally optimal).
Discrete geometric shapes: Matching, interpolation, and approximation
145
4.2. Three dimensions Unfortunately the situation is not an equally happy one in three dimensions. Nearly all natural extensions of the above problems are NPhard, so most of the extant work todate has focused on approximation algorithms. The analog of an xmonotone chain in 3D is that of a polyhedral terrain, which is just a continuous bivariate (and possibly nontotal) function z = T{x,y) which happens to be piecewise linear. The complexity of a terrain can be measured by its total number of vertices, edges, and faces. The numbers of these are linearly related by Ruler's relation, so most often we will use the number of faces as our measure of the complexity of a terrain. There is a plethora of techniques in the literature for simplifying polyhedral terrains, by effectively deleting vertices which lie in relatively flat neighborhoods (and retriangulating the hole thus created). Unfortunately not much has been proved about such methods. In fact, Agarwal and Suri [14] have shown that even the simpler problem of deciding the approximability within a vertical tolerance 6: of a collection of n isolated points by a polyhedral terrain with at most k faces is NPhard. Similarly, though more surprisingly. Das and Joseph [36] showed that finding a convex polytope of at most k facets nested between two other convex polytopes P and Q with a total of n facets is also NPhard, thus settling an old question first posed by Klee. With these results in sight, researchers turned their effort to approximation algorithms. Mitchell and Suri [76] formalized the nested convex polytope problem as a setcover problem by considering the regions defined on the outer polytope by tangent planes to the inner polytope. They showed that the greedy method of set covering computes a nested polytope with 0(/c \ogn) facets, where K is the complexity of an optimal nested polytope. The same approach also works for the approximation by a convex surface of n points themselves sampled from another convex surface. These algorithms run in O(n^) time. These results were extended by Clarkson [30], who gave a randomized algorithm with expected time complexity 0(/cn^+^) for computing a nested polytope of size 0(/clog/c). Bronnimann and Goodrich [23] further improved the set cover algorithm using VCdimension ideas to obtain a deterministic algorithm that computes a nested polytope which is to within a constant factor of the optimal one. The set cover formulation, unfortunately, does not work for the terrain approximation problem, as we cannot independently select faces in the approximating surface. Agarwal and Suri in the paper cited above formulate instead the terrain fitting problem as a geometric partitioning problem: first we project all the points to be approximated on the x jplane; then we seek a disjoint collection of triangles in the xjplane which cover all these points and such that each triangle satisfies a certain legality constraint w.r.t. the points it covers. This constraint, which can be formulated as a linear program, is that the triangle can be lifted to 3D so that it 6:approximates all the points it contains. Agarwal and Suri gave an approximation algorithm which solves this problem and produces a covering set of legitimate triangles whose size is 0(/c log/c), where again K is the minimum number of triangles possible. Unfortunately their algorithm has a very high complexity 0(n^).
146
H. Alt and LJ. Guibas
5. Shape interpolation Shape interpolation, more commonly known as morphing, has recently become a topic of active research interest in computer graphics, computer animation and entertainment, solid reconstruction, and image compression. The general problem is that of continuously transforming one geometric shape into another in a way that makes apparent the salient similarities between the two shapes and 'smoothes over' their dissimilarities. Some of the relevant graphics papers are [68,83,67,84]. The morphing transformation may be thought of as taking place either in the time domain, as in animation, or in the space domain, as in surface reconstruction from planar sections. The latter area has already an extensive literature of its own [43], and computational geometric techniques have been used with good results [90,25] (though the problem is not always solvable [50]). In general there are numerous ways to interpolate between two shapes and little has been said about criteria for comparing the quality of different morphs and notions of optimality. Often, the class of allowable or desirable morphing transforms in only vaguely specified, with the result that the problem ends up being either under or overconstrained. In this section we will survey the rather small amount of work in this area which relates to Computational Geometry. Let P and Q be the two shapes we wish to morph. For now we do not specify how the shapes P and Q are described, or what is the ambient space (2D, 3D, etc.). Most morphing algorithms operate according to the following paradigm: firstly relevant 'features' of P and Q are identified and matched pairwise; secondly, smooth motions are planned that will bring into alignment these pairs of corresponding features; and thirdly the whole morphing transformation is generated, while respecting other global constraints which the shapes P, Q, and their interpolants must satisfy. This paradigm works well when the class of shapes to be morphed consists of fairly similar objects. In cases, however, when we want to be able to morph a great variety of different shapes, the above process is commonly subdivided into a series of stages. The shapes P and Q are first 'canonicalized' by mapping them into their canonical forms K(P) and K(Q) respectively — these canonical forms are more standardized and therefore easier to morph to each other. The whole transformation is then done by going from P to /c(P) to /c((2) to Q. As the above description makes clear, there are numerous connections between the problems of shape matching and shape interpolation, and several of the matching techniques already discussed are applicable to the morphing problem, especially in the feature matching stage. It is not so obvious, but it is equally true that morphing techniques can also be used for shape comparison problems. In a certain sense, the optimum morph from P to Q is the transformation that distorts P as little as possible in order to make it look like Q. In a morphing algorithm we can assign a notion of 'work' or cost to the distortions the algorithm needs to perform. The minimum work then required to morph P into Q can then serve as a measure of the distance from shape P to shape Q. Note that such a distance function based on morphing clearly satisfies the triangle inequality. To make these matters concrete, let us discuss a few simple examples in 2D and 3D. Let P be an open simple polygonal chain of m vertices P = p\p2 • Pm and Q be an open simple polygonal chain of n vertices Q = qxqi•qn This problem was considered by Sederberg and Greenwood [83]. According to our paradigm above, we first need to establish a correspondence between the 'features' of P and Q — for polygonal chains the
Discrete geometric shapes: Matching, interpolation,
and
approximation
Ul
Fig. 11. An example of matching polygonal chain vertices.
natural notion is that of vertices (though other choices also make sense in applications). Now since m might be different from n, in general this will have to be a manytoone, or onetomany mapping. But where should these duplicate vertices be added? We can represent all possible ways to pair up vertices of P with vertices of Q in sequence by considering monotone paths in the [l..m] x [\..n\ grid. An example is shown in Figure 11, which shows a particular matching between a chain P of 8 vertices and a chain 2 of 10 vertices. A diagonal move on the monotone path corresponds to advancing on both P and Q, while a horizontal move corresponds to advancing on Q only (and thus duplicating the corresponding vertex of P. We can choose an optimum correspondence, by selecting the path n to be of minimal cost in some appropriate sense. For example, we may want to minimize the sum of the distances of all the corresponding pairs of vertices. Sederberg and Greenwood developed a physicsbased measure of the energy required to stretch and bend P into Q once the correspondence by n is given. The optimal n under such measures can be computed by classical dynamic programming techniques [31] in time 0(mn). Similar ideas have been used to fit polyhedral sleeves to polygonal slices in parallel planes [25]. Once we have the correspondence, we can then move corresponding vertices to each other through linear interpolation. Implicitly, at each time t, this defines an interpolating polygonal chain Rt and thus our construction of a morph between the polygonal chains is complete. Note also that in order to extend this method to closed polygonal chains we
148
H. Alt and L.J. Guibas
(a)
(b) Fig. 12. Examples of polygonal chain morphs: (a) a good case, (b) a bad case.
must decide first on an appropriate 'origin' for each chain, and this is not a trivial matter. Figure 12 shows some successful and unsuccessful examples of this method, depending on the origin chosen. Note in particular that the interpolating chain Rf can selfintersect, even though neither P and Q do. Sederberg et al. also proposed another simple method for polygon interpolation based on interpolating side lengths and angles, once a vertex correspondence is established [84] — but now the challenge becomes to get the polygons to 'close up'. Preserving structural properties during a morph, such as the simplicity of a chain in the example above, is a difficult problem. Guibas and Hershberger [45], consider how to morph two parallel polygons to each other while maintaining simplicity. The setting is now that P and Q are two simple polygons in the plane of n sides each, and there is a 11 correspondence between the sides of P and Q so that corresponding sides are parallel. The goal is to continuously deform P io Q while at all times the interpolating polygon Rt has its corresponding sides parallel to those of P and Q and stays simple. In this case the very statement of the problem provides the correspondence between features of the polygons. Even so, the two polygons P and Q can look quite different and the existence of a morph which remains parallel and simple is not obvious; see Figure 13 (a morph between these two spiraling polygons can happen by simulating the way recording tape can move from one reel to another). Guibas and Hershberger showed that this is, nevertheless, always possible and gave an algorithm which uses 0(n^^^^^) primitive operations called 'parallel moves'; this was later improved to O(nlogn) by Hershberger and Suri [61]. A parallel move is a translation of a side of a polygon parallel to itself, with appropriate modifications of the polygon at the endpoints of the edge. Guibas and Hershberger first showed that parallel moves can be used to take each polygon to a fractallike canonical or reduced form in which portions of the polygon's boundary have been shrunk to microstructures of widely different scales.
Discrete geometric shapes: Matching, interpolation,
and
approximation
149
I
L 1
Q Fig. 13. These oppositely spiraling parallel polygons are still morphable.
A polygon in this canonical form corresponds, roughly speaking, to a binary tree whose leaf weights are the angles of the original polygon. Once P and Q are in this canonical form, the corresponding trees can be morphed into each other through a series of standard tree rotation transformations; certain validity conditions have to hold throughout this process. These tree rotations can be realized geometrically through parallel moves on the polygons. The fractallike structure of the canonical form helps in arguing that the translations required to implement particular rotations do not interfere with other parts of the polygon. Clearly the GuibasHershberger morph solves only a limited problem and even for that the canonical form used introduces unnecessarily large distortions into the interpolating shapes. Different polygon morphing techniques were developed by Shapira and Rappoport [86], based on the starskeleton representation of a polygon (a decomposition of the polygon into starshaped pieces). Such methods do much better in preserving the metric properties of the polygons, but unfortunately they still do not preserve global constraints, such as simplicity — plus they are expensive, requiring O(n^) time. Another idea for morphing polygons can be based on the compatible triangulations result of Aronov, Seidel, and Souvaine [15]. They showed that P and Q can always be 'compatibly'triangulated by adding O(n^) Steiner points (compatibility means that the triangulations are combinatorially equivalent). The use of conformal mappings has also been suggested. Let us now also look at some work in three dimensions. The only case that has been extensively studied is that of morphing convex polytopes [67]. If P and Q are convex polyhedra, a natural way to construct a matching between their surfaces is to match points on the two polyhedra that admit of the same (outwards) normal. In general, this will match all points on each face of P to a vertex of Q and vice versa, as well as matching (the points of) certain pairs of edges, one from P and one from g . If we place the origin at an arbitrary point of space and compute the vector sums of corresponding pairs of points from P and 2 , the resulting set of points will form the boundary of another convex polytope, called the Minkowski sum of P and Q and denoted by P 0 2 [69,73]. Armed with this concept, we can then morph P to Q by constructing the mixed volume {\ — t)P ®tQ, diSi varies in the range 0 < f ^ 1. This type of morph was exploited by Kaul and Rossignac [68,81]. The same technique works, of course, in 2D or dimensions higher than three. A nice way to visualize this morph in 2D is to think of P and Q as two convex polygons placed on
150
H. Alt and LJ.
Guibas
parallel planes in 3D. One then constructs the convex hull of the union of P and Q by adding a 'sleeve' wrapping around P and Q. The sections of this sleeve by a plane moving parallel to itself from that containing P to that containing Q gives us the morph. The 'kinetic framework' of [51] allows the extension of this type of morph to general polygons in the plane. Also, since regular subdivisions of the plane or alpha shapes [40] can be viewed as projections of convex polytopes in one dimension higher, the above method also gives us some possibilities for morphing such subdivisions or alpha shapes. Other approaches to morphing 2D or 3D shapes are given in [47,67,42].
References [1] O. Aichholzer, H. Alt and G. Rote, Matching shapes with a reference point, Intemat. J. Comput. Geom. Appl. 7 (1997), 349363. [2] H. Alt, B. Behrends and J. Blomer, Approximate matching of polygonal shapes, Proc. 7th Annu. ACM Sympos. Comput. Geom. (1991), 186193. [3] H. Alt, B. Behrends and J. Blomer, Approximate matching ofpolygonal shapes, Ann. Math. Artif. Intell. 13 (1995), 251266. [4] H. Alt, J. Blomer, M. Godau and H. Wagener, Approximation of convex polygons, Proc. 17th Intemat. CoUoq. Automata Lang. Program., Lecture Notes in Comput. Sci. 443, SpringerVerlag (1990), 703716. [5] A. Aggarwal, H. Booth, J. O'Rourke, S. Suri and C.K. Yap, Finding minimal convex nested polygons. Inform. Comput. 83(1) (October 1989), 98110. [6] E.M. Arkin, L.P. Chew, D.P. Huttenlocher, K. Kedem and J.S.B. Mitchell, An efficiently computable metric for comparing polygonal shapes, IEEE Trans. Pattern Anal. Mach. Intell. 13 (3) (1991), 209216. [7] H. Alt, U. Fuchs, G. Rote and G. Weber, Matching convex shapes with respect to the symmetric difference, Proc. 4th Annual European Symp. on AlgorithmsESA'96, Springer Lecture Notes in Comput. Sci. 1136 (1996), 320333. [8] H. Alt and M. Godau, Measuring the resemblance of polygonal curves, Proc. 8th Annu. ACM Sympos. Comput. Geom. (1992), 102109. [9] H. Alt and M. Godau, Computing the Frechet distance between two polygonal curves, Intemat. J. Comput. Geom. Appl. 5 (1995), 7591. [10] A.V. Aho, I.E. Hopcroft and J.D. Ullman, The Design and Analysis of Computer Algorithms, AddisonWesley, Reading, MA (1974). [11] E.M. Arkin, K. Kedem, J.S.B. Mitchell, J. Sprinzak and M. Werman, Matching points into pairwisedisjoint noise regions: Combinatorial bounds and algorithms, ORSA J. Comput. 4 (4) (1992), 375386. [12] S. Arya, D.M. Mount, N.S. Netanyahu, R. Silverman and A. Wu, An optimal algorithm for approximate nearest neighbor searching, Proc. 5th ACMSIAM Sympos. Discrete Algorithms (1994), 573582. [13] H. Alt, K. Mehlhom, H. Wagener and E. Welzl, Congruence, similarity and symmetries of geometric objects. Discrete Comput. Geom. 3 (1988), 237256. [14] P.K. Agarwal and S.Suri, Surface approximation and geometric partitions, Proc. 5th ACMSIAM Sympos. Discrete Algorithms (1994), 2433. [15] B. Aronov, R. Seidel and D. Souvaine, On compatible triangulations of simple polygons, Comput. Geom. 3 (1) (1993), 2735. [16] P.K. Agarwal, M. Sharir and S. Toledo, Applications of parametric searching in geometric optimization, J. Algorithms 17 (1994), 292318. [17] D. Avis and G.T. Toussaint, An optimal algorithm for determining the visibility of a polygon from an edge, IEEE Trans. Comput. C30 (1981), 9101014. [18] M.J. Atallah, A linear time algorithm for the Hausdorff distance between convex polygons. Inform. Process. Lett. 17 (1983), 207209. [19] M.D. Atkinson, An optimal algorithm for geometrical congruence, J. Algorithms 8 (1987), 159172.
Discrete geometric shapes: Matching, interpolation,
and approximation
151
[20] T. Akutsu, H. Tamaki and T. Tokuyama, Distribution of distances and triangles in a point set and algorithms for computing the largest common point set, Proc. 13th Annu. ACM Sympos. Comput. Geom. (1997), 314323. [21] H.S. Baird, ModelBased Image Matching Using Location, Distinguished Dissertation Series, MIT Press (1984). [22] B. Belirends, Algorithmen zur Erkennung der eKongruenz von Punktmengen und Polygonen, M.S. thesis, Freie Univ. Berlin, Institute for Computer Science (1990). [23] H. Bronnimann and M.T. Goodrich, Almost optimal set covers in finite VCdimension, Discrete Comput. Geom. 14 (1995), 263279. [24] C. Burnikel, J. Konnemann, K. Mehlhom, S. Naher, S. Schirra and C. Uhrig, Exact geometric computation in LEDA, Proc. 11th Annu. ACM Sympos. Comput. Geom. (1995), C18C19. [25] G. Barequet and M. Sharir, Piecewiselinear interpolation between polygonal slices, Proc. 10th Annu. ACM Sympos. Comput. Geom. (1994), 93102. [26] W.S. Chan and F. Chin, Approximation of polygonal curves with minimum number of line segments or minimum error, Intemat. J. Comput. Geom. Appl. 6 (1996), 5977. [27] L.P. Chew, D. Dor, A. Efrat and K. Kedem, Geometric pattern matching in ddimensional space, Proc. 2nd Annu. European Sympos. Algorithms, Lecture Notes in Comput. Sci. 979, SpringerVerlag (1995), 264279. [28] S.D. Cohen and L.J. Guibas, Partial matching of planar polylines under similarity transformations, Proc. 8th ACMSIAM Sympos. Discrete Algorithms (January 1997), 777786. [29] L.P. Chew, M.T. Goodrich, D.P Huttenlocher, K. Kedem, J.M. Kleinberg and D. Kravets, Geometric pattern matching under Euclidean motion, Comput. Geom. 7 (1997), 113124. [30] K.L. Clarkson, Algorithms for polytope covering and approximation, Proc. 3rd Workshop Algorithms Data Struct., Lecture Notes in Comput. Sci. 709, SpringerVeriag (1993), 246252. [31] T.H. Cormen, C.E. Leiserson and R.L. Rivest, Introduction to Algorithms, MIT Press, Cambridge, MA (1990). [32] R. Cole, Slowing down sorting networks to obtain faster sorting algorithms, Proc. 25th Annu. IEEE Sympos. Found. Comput. Sci. (1984), 255260. [33] R. Cole, Slowing down sorting networks to obtain faster sorting algorithms, J. ACM 34 (1987), 200208. [34] M. de Berg, O. Devillers, M. van Kreveld, O. Schwarzkopf and M. Teillaud, Computing the maximum overlap of two convex polygons under translation, Proc. 7th Annu. Intemat. Sympos. Algorithms Comput. (1996). [35] M. de Berg, M. van Kreveld and S. Schirra, A new approach to subdivision simplification, Proc. 12th Internal. Sympos. Comput.Assist. Cartog. (1995), 7988. [36] G. Das and D. Joseph, The complexity of minimum convex nested polyhedra, Proc. 2nd Canad. Conf. Comput. Geom. (1990), 296301. [37] D.H. Douglas and T.K. Peucker, Algorithms for the reduction of the number of points required to represent a digitized line or its caricature, Canadian Cartographer 10 (2) (December 1973), 112122. [38] W. Eric and L. Grimson, Object Recognition by Computer: The Role of Geometric Constraints, MIT Press (1990). [39] A. Efrat and A. Itai, Improvements on bottleneck matching and related problems using geometry, Proc. 12th Annu. ACM Sympos. Comput. Geom. (1996), 301310. [40] H. Edelsbrunner and E.P Miicke, Threedimensional alpha shapes, ACM Trans. Graph. 13 (1) (January 1994), 4372. [41] D. Eu and G. Toussaint, On approximating polygonal curves in two and three dimensions, Comput. Vision Graph. Image Process. 56 (1994), 231246. [42] H. Edelsbrunner and R. Waupotitsch, A combinatorial approach to cartograms, Proc. 11th Annu. ACM Sympos. Comput. Geom. (1995), 98108. [43] H. Fuchs, Z.M. Kedem and S.P. Uselton, Optimal surface reconstruction from planar contours, Comm. ACM 20 (1977), 693702. [44] T. Feder and R. Motwani, Clique partitions, graph compression and speeding up algorithms, Proc. 23rd ACM Symp. Theory of Computing (1991), 123133. [45] L. Guibas and J. Hershberger, Morphing simple polygons, Proc. 10th Annu. ACM Sympos. Comput. Geom. (1994), 267276.
152
H. Alt and LJ.
Guibas
[46] LJ. Guibas, J.E. Hershberger, J.S.B. Mitchell and J.S. Snoeyink, Approximating polygons and subdivisions with minimum link paths, Intemat. J. Comput. Geom. Appl. 3(4) (December 1993), 383^15. [47] A. Glassner, Metamorphosis ofpolyhedra, Manuscript (1991). [48] M.T. Goodrich, J.S. Mitchell and M.W. Orietsky, Practical methods for approximate geometric pattern matching under rigid motion, Proc. 10th Annu. ACM Sympos. Comput. Geom. (1994), 103112. [49] M.T. Goodrich, Efficient piecewiselinear function approximation using the uniform metric. Discrete Comput. Geom. 14 (1995), 445462. [50] C. Gitlin, J. O'Rourke and V. Subramanian, On reconstructing polyhedra from parallel slices, Intemat. J. Comput. Geom. Appl. 6 (1) (1996), 103122. [51] L.J. Guibas, L. Ramshaw and J. Stolfi, A kinetic framework for computational geometry, Proc. 24th Annu. IEEE Sympos. Found. Comput. Sci. (1983), 100111. [52] B. Grunbaum, Convex Polytopes, Wiley, New York, NY (1967). [53] D.P. Huttenlocher and K. Kedem, Computing the minimum Hausdorff distance for point sets under translation, Proc. 6th Annu. ACM Sympos. Comput. Geom. (1990), 340349. [54] D.P. Huttenlocher, K. Kedem and J.M. Kleinberg, On dynamic Voronoi diagrams and the minimum Hausdorff distance for point sets under Euclidean motion in the plane, Proc. 8th Annu. ACM Sympos. Comput. Geom. (1992), 110120. [55] D.P. Huttenlocher, G.A. Klanderman and W.J. Rucklidge, Comparing images using the Hausdorff distance, IEEE Trans, on Pattern Analysis and Machine Intelligence 15 (1993), 850863. [56] D.P. Huttenlocher, K. Kedem and M. Sharir, The upper envelope of Voronoi surfaces and its applications. Discrete Comput. Geom. 9 (1993), 267291. [57] S.L. Hakimi and E.F. Schmeichel, Fitting polygonal functions to a set ofpoints in the plane, CVGIP: Graph. Models Image Process. 53 (2) (1991), 132136. [58] J. Hershberger and J. Snoeyink, Speeding up the DouglasPeucker line simplification algorithm, Proc. 5th Inti. Symp. Spatial Data Handling. IGU Commission on GIS (1992), 134143. [59] P.J. Heffeman and S. Schirra, Approximate decision algorithms for point set congruence, Comput. Geom. 4 (1994), 137156. [60] J. Hershberger and J. Snoeyink, Computing minimum length paths of a given homotopy class, Comput. Geom. 4 (1994), 6398. [61] J. Hershberger and S. Suri, Morphing binary trees, Proc. 6th ACMSIAM Sympos. Discrete Algorithms (1995), 396404. [62] D. Huttenlocher and S. Ullman, Recognizing solid objects by alignment with an image, Intemat. J. Computer Vision 5 (1990), 195212. [63] H. Imai and M. Iri, Computationalgeometric methods for polygonal approximations of a curve, Comput. Vision Graph. Image Process. 36 (1986), 3 1 ^ 1 . [64] H. Imai and M. Iri, Polygonal approximations of a curveformulations and algorithms. Computational Morphology, G.T. Toussaint, ed., NorthHolland, Amsterdam, Netherlands (1988), 7186. [65] S. Irani and P. Raghavan, Combinatorial and experimental results for randomized point matching algorithms, Proc. 12th Annu. ACM Sympos. Comput. Geom. (1996), 6877. [66] K. Imai, S. Sumino and H. Imai, Minimax geometric fitting of two corresponding sets of points, Proc. 5th Annu. ACM Sympos. Comput. Geom. (1989), 266275. [67] J. Kent, W. Carlson and R. Parent, Shape transformation for polyhedral objects. Computer Graphics (SIGGRAPH '92 Proceedings), Vol. 26 (1992), 4754. [68] A. Kaul and J. Rossignac, Solidinterpolating deformations: Construction and animation of PIPs, Proc. Eurographics '91 (1991), 493505. [69] J.C. Latombe, Robot Motion Planning, Kluwer Acad. Publ., Boston (1991). [70] Y. Lamdan, J.T. Schwartz and H.J. Wolfson, Object recognition by affine invariant matching. Proceedings of Computer Vision and Pattern Recognition (1988), 335344. [71] Y Lamdan, J.T. Schwartz and H.J. Wolfson, On recognition o/3d objects from 2d images. Proceedings of the 1988 IEEE International Conference on Robotics and Automation (1988), 14071413. [72] Y Lamdan and H.J. Wolfson, Geometric hashing: A general and efficient modelbased recognition scheme, Second Intemational Conference on Computer Vision (1988), 238249. [73] L.A. Lyustemik, Convex Figures and Polyhedra, D.C. Heath, Boston, MA (1966).
Discrete geometric shapes: Matching, interpolation,
and approximation
153
[74] N. Megiddo, Applying parallel computation algorithms in the design of serial algorithms, J. ACM 30 (1983), 852865. [75] A. Melkman and J. O'Rourke, On polygonal chain approximation. Computational Morphology, G.T. Toussaint, ed., NorthHolland, Amsterdam, Netherlands (1988), 8795. [76] J.S.B. Mitchell and S. Suri, Separation and approximation ofpolyhedral objects, Comput. Geom. 5 (1995), 95114. [77] R. Norel, D. Fischer, H. Wolfson and R. Nussinov, Molecular surface recognition by a computer visionbased technique. Protein Engineering 7 (1994), 3 9 ^ 6 . [78] R. Norel, S.L. Lin, H. Wolfson and R. Nussinov, Shape complimentarity at proteinprotein interfaces, Biopolymers 34 (1994), 933940. [79] M.H. Overmars and C.K. Yap, New upper bounds in Klee's measure problem, SIAM J. Comput. 20 (1991), 10341045. [80] K. Przeslawski and D. Yost, Continuity properties of selectors and Michael's theorem, Michigan Math. J. 36(1989), 113134. [81] J. Rossignac and A. Kaul, Agrels and bips: Metamorphosis as a Bezier curve in the space of polyhedra, Eurographics '94 Proceedings, Vol. 13 (1994), 179184. [82] S. Schirra, Uber die Bitkomplexitdt der sKongruenz, M.S. thesis, Univ. des Saarlandes, Computer Science Department (1988). [83] T. Sederberg and E. Greenwood, A physically based approach to 2D shape blending. Computer Graphics (SIGGRAPH '92 Proceedings), Vol. 26 (1992), 2534. [84] T. Sederberg, P. Gao, G. Wang and H. Mu, 2D shape blending: An intrinsic solution to the vertex path problem. Computer Graphics (SIGGRAPH '93 Proceedings), Vol. 27 (1993), 1518. [85] G.C. Shephard, The Steiner point of a convex poly tope, Canadian J. Math. 18 (1966), 12941300. [86] M. Shapira and A. Rappoport, Shape blending using the skeleton representation, IEEE Computer Graphics and Appl. 16 (1995), 4450. [87] S. Suri, A linear time algorithm for minimum link paths inside a simple polygon, Comput. Vision Graph. Image Process. 35 (1986), 99110. [88] J. Sprinzak and M. Werman, Affine point matching. Pattern Recogn. Lett. 15 (1994), 337339. [89] K. Varadarajan, Approximating monotone polygonal curves using the unfirm metric, Proc. 12th ACM Symp. Computational Geometry (1996). [90] E. Welzl and B. Wolfers, Surface reconstruction between simple polygons via angle criteria, J. Symbolic Comput. 17 (1994), 351369.
This Page Intentionally Left Blank
CHAPTER 4
Deterministic Parallel Computational Geometry Mikhail J. Atallah* Department of Computer Sciences, Purdue University, West Lafayette, IN 47907, USA Email:
[email protected] Danny Z. Chen^ Department of Computer Science and Engineering, University of Notre Dame, Notre Dame, IN 46556, USA Email:
[email protected] Contents 1. Introduction 2. PRAM models 3. Basic subproblems 3.1. Sorting and merging 3.2. Parallel prefix 3.3. List ranking 3.4. Tree contraction 3.5. Brent's theorem 3.6. Euler tour technique 3.7. Lowest common ancestors (LCA) 4. Inherently sequential geometric problems 4.1. Planesweep triangulation 4.2. Weighted planar partitioning 4.3. Visibility layers 4.4. Open problems 5. Parallel divide and conquer 5.1. Twoway divide and conquer 5.2. "Rootish" divide and conquer 5.3. Example: visibility in a polygon 6. Cascading 6.1. A rough sketch of cascading 6.2. Cascading merge sort
157 157 159 160 160 160 160 161 161 162 163 163 163 163 164 164 164 165 165 168 168 169
* Portions of the work of this author were supported by the National Science Foundation under Grant CCR9202807, and by sponsors of the COAST Laboratory. ^The work of this author was supported in part by the National Science Foundation under Grant CCR9623585. HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved
155
156
M.J. Atallah and D.Z. Chen
7. Fractional cascading in parallel 8. Cascading with labeling functions 8.1. The 3dimensional maxima problem 8.2. The twoset dominance counting problem 8.3. Other applications of cascading 9. Cascading without concurrent reads 10. Matrix searching techniques 10.1. Row minima 10.2. Tube minima 10.3. Generalized monotone matrices 11. Other useful PRAM techniques 11.1. Geometric hierarchies 11.2. From CREW to EREW 11.3. Arrayoftrees 11.4. Deterministic geometric sampling 11.5. Outputsensitive algorithms 11.6. Stratified decomposition trees 11.7. Pruneandsearch 12. Further remarks References
172 176 176 178 179 180 181 181 184 187 187 187 187 188 189 189 190 191 191 192
Abstract We describe general methods for designing deterministic parallel algorithms in computational geometry. We focus on techniques for sharedmemory parallel machines, which we describe and illustrate with examples. We also discuss some open problems in this area.
Deterministic parallel computational geometry
157
1. Introduction Many problems in computational geometry come from application areas (such as pattern recognition, computer graphics, operations research, computeraided design, robotics, etc.) that require realtime speeds. This need for speed makes parallelism a natural candidate for helping achieve the desired performance. For many of these problems, we are already at the limits of what can be achieved through sequential computation. The traditional sequential methods can be inadequate for those applications in which speed is important and that involve a large number of geometric objects. Thus, it is important to study what kinds of speedups can be achieved through parallel computing. As an indication of the importance of this research direction, we note that four of the eleven problems used as benchmark problems to evaluate parallel architectures for the DARPA Architecture Workshop Benchmark Study of 1986 were computational geometry problems. In parallel computation, it is the rule rather than the exception that the known sequential techniques do not translate well into a parallel setting; this is also the case in parallel computational geometry. The difficulty is usually that these techniques use methods which either seem to be inherently sequential, or would result in inefficient parallel implementations. Thus new paradigms are needed for parallel computational geometry. The goal of this chapter is to give a detailed look at the currently most successful techniques in parallel computational geometry, while simultaneously highlighting some open problems, and discussing possible extensions to these techniques. It differs from [33] in that it gives a much more detailed coverage of the sharedmemory model at the expense of the coverage of networks of processors. Since it is impossible to describe all the parallel geometric algorithms known, our focus is on general algorithmic techniques rather than on specific problems; no attempt is made to list exhaustively all of the known deterministic parallel complexity bounds for geometric problems. For more discussion of parallel geometric algorithms, the reader is referred to [15,139]. The rest of the chapter is organized as follows. Section 2 briefly reviews the PRAM parallel model and the notion of efficiency in that model. Section 3 reviews basic subproblems that tend to arise in the solutions of geometric problems on the PRAM, Section 4 is about inherently sequential (i.e. nonparallelizable) geometric problems, Section 5 discusses the parallel divide and conquer techniques. Section 6 discusses the cascading technique, Section 7 discusses parallel fractional cascading, Section 8 discusses cascading with labeling functions. Section 9 discusses cascading in the EREW model. Section 10 discusses parallel matrix searching techniques, Section 11 discusses a number of other useful PRAM techniques, and Section 12 concludes.
2. PRAM models The PRAM (Parallel Random Access Machine) has so far been the main vehicle used to study the parallel algorithmics of geometric problems, and hence it is the focus of this chapter. This section briefly reviews the PRAM model and its variants. The PRAM model of parallel computation is the sharedmemory model in which the processors operate synchronously [153], as illustrated in Figure 1. A step on a PRAM
158
MJ. Atallah and D.Z. Chen Processors
Shared Memory Cell 1
p, ^
Cell 2 Cell 3
P2
P3
• • •

• • •
r^ Fig. 1. The PRAM model.
consists of each processor reading the content of a cell in the shared memory, writing data in a cell of the shared memory, or performing a computation within its own registers. Thus all communication is done via the shared memory. There are many variants of the PRAM, differing from one another in the way read and/or write conflicts are treated. The CREW (Concurrent Read Exclusive Write) version of this model allows many processors to simultaneously read the content of a memory location, but forbids any two processors from simultaneously attempting to write in the same memory location (even if they are trying to write the same thing). The CRCW (Concurrent Read Concurrent Write) version of the PRAM differs from the CREW one in that it also allows many processors to write simultaneously in the same memory location: In any such commonwrite contest, only one processor succeeds, but it is not known in advance which one. (There are other versions of the CRCW PRAM but we shall not concern ourselves with these here.) The EREW PRAM is the weakest version of the PRAM: It forbids both concurrent reading and concurrent writing. The PRAM has been extensively used in theoretical studies as a vehicle for designing parallel algorithms. Although it captures important parameters of a parallel computation, the PRAM does not account for communication and synchronization (more recent variations of the model do account for these factors, but we do not discuss them since essentially no parallel geometric algorithms have yet been designed for them). The PRAM is generally considered to be a rather unrealistic model of parallel computation. However, although there are no PRAMs commercially available, algorithms designed for PRAMs can often be efficiently simulated on some of the more realistic parallel models. The PRAM enables the algorithm designer to focus on the structure of the problem itself, without being distracted by architecturespecific issues. Another advantage of the PRAM is that, if one can give strong evidence (in the sense explained in the next paragraph) that a problem has no fast parallel solution on the PRAM, then there is no point in looking for a fast solution to it on more realistic parallel models (since these are weaker than the PRAM). We now review some basic notions concerning the speed and efficiency of PRAM computations. The time x processor product of a PRAM algorithm is called its work (i.e., the total number of operations performed by that algorithm). A parallel algorithm is said to run
Deterministic parallel computational geometry
159
in poly logarithmic time if its time complexity is 0(log^ n), where n is the problem size and ^ is a constant independent of n (i.e., k = 0{\)). A problem solvable in polylogarithmic time using a polynomial number of processors is said to be in the class NC. It is strongly believed (but not proved) that not all problems solvable in polynomial time sequentially are solvable in polylogarithmic time using a polynomial number of processors (i.e., it is believed that P ^ NC). As in the theory of NPcompleteness, there is an analogous theory in parallel computation for showing that a particular problem is probably not in NC: By showing that the membership of that problem in NC would imply that P = NC. Such a proof consists of showing that each problem in P admits an NC reduction to the problem at hand (an NC reduction is a reduction that takes polylogarithmic time and uses a polynomial number of processors). Such a problem is said to be Vcomplete. For a more detailed discussion of the class NC and parallel complexity theory, see (for example) [189] or [156]. A proof establishing Pcompleteness of a problem is viewed as strong evidence that the problem is "inherently sequential". Once one has established that a geometric problem is in NC, the next step is to design a PRAM algorithm for it that runs as fast as possible, while being efficient in the sense that it uses as few processors as possible. Ideally, the parallel time complexity of the PRAM algorithm should match the parallel lower bound of the problem (assuming such a lower bound is known), and its work complexity should match the best known sequential time bound of the problem. A parallel lower bound for a geometric problem is usually established by showing that such an algorithm can be used to solve some other (perhaps nongeometric) problem having that lower bound. For example, it is well known [94] that computing the logical OR of n bits has an Q (logn) time lower bound on a CREW PRAM. This can easily be used to show that detecting whether the boundaries of two convex polygons intersect also has an Q(\ogn) time lower bound in that same model, by encoding the n bits whose OR we wish to compute in two concentric regular ngons such that the /th bit governs the relative positions of the /th vertices of the two ngons. Interestingly, if the word "boundaries" is removed from the previous sentence then the lower bound argument falls apart and it becomes possible to solve the problem in constant time on a CREW PRAM, even using a sublinear number of processors [43,224]. Before reviewing the techniques that have resulted in many PRAM geometric algorithms that are fast and efficient in the above sense, a word of caution is in order. From a theoretical point of view, the class NC and the requirement that a "fast" parallel algorithm should run in polylogarithmic time, are eminently reasonable. But from a more practical point of view, not having a polylogarithmic time algorithm does not entirely doom a problem to being "nonparallelizable". One can indeed argue [221] that, e.g., a problem of sequential complexity G){n) that is solvable in 0{^) time by using ^ processors is "parallelizable" in a very real sense, even if no polylogarithmic time algorithm is known for it.
3. Basic subproblems This section reviews some basic subproblems that tend to be used as subroutines in the design of PRAM geometric algorithms.
160
M.J. Atallah and D.Z. Chen
3.1. Sorting and merging Sorting is probably the most frequently used subroutine in parallel geometric algorithms. Fortunately, for PRAM models we know how to sort n numbers optimally: 0(log«) time and n processors on the EREW PRAM [87,12]. Merging on the PRAM is easier than sorting [211,222,54,147]; on the CREW PRAM it is O(loglogn) time with n/\og\ogn processors, and O(logn) time with n/\ogn processors on the EREW PRAM.
3.2. Parallel prefix Given an array A of n elements and an associative operation denoted by +, the parallel prefix problem is that of computing an array Bofn elements such that B(i) = J2k=i Mk)Parallel prefix can be performed in O(logn) time and n/\ogn processors on an EREW PRAM [159,164], 0(log«/loglogn) time and n\og\ogn/\ogn processors on a CRCW PRAM [92]. Computing the smallest element in array A is a special case of parallel prefix: In the CRCW model, this can be done faster than general parallel prefix — in 0(1) time with n^~^^ processors for any positive constant e or, alternatively, in O(loglogn) time with n/loglogn processors [211].
3.3. List ranking List ranking is a more general version of the parallel prefix problem: The elements are given as a linked list, i.e., we are given an array A each entry of which contains an element as well as a pointer to the entry of A containing the predecessor of that element in the linked list. The problem is to compute an array B such that B(i) is the "sum" of the first / elements in the linked list. This problem is considerably harder than parallel prefix, and most tree computations as well as many graph computations reduce, via the Euler tour technique (described below), to solving this problem. EREW PRAM algorithms that run in O(logn) time and n/ \ogn processors are known for list ranking [90,24].
3.4. Tree contraction Given a (not necessarily balanced) rooted tree 7, the problem is to reduce T to a 3node tree by a sequence of rake operations. A rake operation can be applied at a leaf v by removing V and the parent of v, and making the sibling of i; a child of f's grandparent (note that rake cannot be applied at a leaf whose parent is the root). This is done as follows: Number the leaves 1,2,..., etc., in left to right order, and apply the rake operation first to all the oddnumbered leaves that are left children, then to the other oddnumbered leaves. Renumber the remaining leaves and repeat this operation, until done. The number of iterations performed by such an algorithm is logarithmic because the number of leaves is reduced by half at each iteration. Note that applying the rake to all the oddnumbered leaves at the same time would not work, as can be seen by considering the situation where
Deterministic parallel computational
geometry
161
Fig. 2. The Euler tour of a tree T.
V is an oddnumbered left child, w is an oddnumbered right child, and the parent of v is the grandparent of w (what goes wrong in that case is that i; wants to remove its parent p and simultaneously w wants its sibling to become child of p). Tree contraction is an abstraction of many other problems, including that of evaluating an arithmetic expression tree [175]. Many elegant optimal EREW PRAM algorithms for it are known [1,90,128, 158], running in 0(logn) time with n/logn processors.
3.5. Brent's theorem This technique is frequently used to reduce the processor complexity of an algorithm without any increase in the time complexity. THEOREM 3.1 (Brent). Any synchronous parallel algorithm taking time T that consists of a total ofW operations can be simulated by P processors in time 0{{W/P) + T).
There are actually two qualifications to the above Brent's theorem [60] before one can apply it to a PRAM: (i) At the beginning of the /th parallel step, we must be able to compute the amount of work Wt done by that step, in time 0{Wi/P) and with P processors, and (ii) we must know how to assign each processor to its task. Both (i) and (ii) are generally (but not always) easily satisfied in parallel geometric algorithms, so that the hard part is usually achieving W operations in time T.
3.6. Euler tour technique "Wrapping a chain" around a tree defines an Euler tour of that tree. More formally, if T is an undirected tree, the Euler tour of T is obtained in parallel by doing the following for every node vofT\ Letting WQ,W\, .. .,Wk\ be the nodes of T adjacent to f, in the order in which they appear in the adjacency list of i;, we set the successor of each (directed)
162
MJ. Atallah and D.Z. Chen
edge {wi, v) equal to the (directed) edge (u, u;(/+i)mod k) See Figure 2 for an illustration. Most tree computations as well as many graph computations reduce, via the Euler tour technique, to the list ranking problem [216], as the following examples demonstrate. 1. Rooting an undirected tree at a designated node i;: Create the Euler tour of the tree, "open" the tour at v (thus making the tour an Euler path), then do a parallel prefix along the linked list of arcs described by the successor function (with a weight of 1 for each arc). For each undirected edge [x,y] of the tree, if the prefix sum of the directed edge {x,y)m the Euler tour is less than that of the directed edge (y, x), then set X to be the parent of y. This parallel computation of parents makes the tree rooted at V. 2. Computing postorder numbers of a rooted tree, where the lefttoright ordering of the children of a vertex is the one implied by the Euler path: Do a list ranking on the Euler path, where each directed edge (jc, j ) of the Euler path has a weight of unity if y is the parent of x, and a weight of zero if x is the parent of y. 3. Computing the depth of each node of a rooted tree: Do a list ranking on the Euler path, where each directed edge {x,y) of the Euler path has a weight of — 1 if y is the parent of x, and a weight of hi if JC is the parent ofy. 4. Numbering of descendants of each node: Same computation as for postorder numbers, followed by making use of the observation that the number of descendants of i; equals the fist rank of (f, parent(i;)) minus that of (parent(i;), i;). These examples of reductions of so many problems to list ranking demonstrate the importance of the list ranking problem. See [216,153] for other examples, and for more details about the above reductions.
3.7. Lowest common ancestors (LCA) The problem is to preprocess a rooted tree T so that a lowest common ancestor (LCA) query of any two nodes x,y of T can be answered in constant time by one processor. The preprocessing is to be done in logarithmic time and n/\ogn EREW PRAM processors. The problem is easy when T is a simple path (list ranking does the job), or when it is a complete binary tree (it is then solved by comparing the binary representations of the inorder numbers of x and y, specifically finding the leftmost bit where they disagree). For a general tree, the problem is reduced to that of the range minima: Create an Euler tour of the tree, where each node v knows its first and last appearance on that tour as well as its depth (i.e., the distance from the root) in the tree. This reduces the problem of answering an LCA query to determining, in constant sequential time, the smallest entry in between two given indices /, j in an array. This last problem is called the rangeminima problem. The book [153] contains more details on the reduction of LCA to range minima, a solution to range minima, and references to the relevant literature for this problem. The above list of basic subproblems is not exhaustive in that (i) many techniques that are basic for general combinatorial problems were omitted (we have focused only on those most relevant to geometric problems rather than to general combinatorial problems), and (ii) among the techniques applicable to geometric problems, we have postponed covering the more specialized ones.
Deterministic parallel computational geometry
163
4. Inherently sequential geometric problems Most of the problems shown to be Pcomplete to date are not geometric (most are graph or algebra problems). This is no accident: Geometric problems in the plane tend to have enough structures to enable membership in NC. Even the otherwise Pcomplete problem of linear programming [119,120] is in NC when restricted to the plane. In the rest of this section, we mention the (very few) planar geometric problems that are known to be Pcomplete, and also a problem that is conjectured to be Pcomplete. Several of the problems known to be Pcomplete involve a collection of line segments in the plane. The Pcompleteness proofs of the three problems in the following subsections were given in [28]; for the third problem see also [149]. The proofs consist of giving NC reductions from the monotone circuit value problem and planar circuit value problem, which are known to be Pcomplete [129,160,181]. These reductions typically involve the use of geometry to simulate a circuit, by utilizing the relative positions of objects in the plane. 4.1. Planesweep triangulation One is given a simple nvertex polygon P (which may contain holes) and asked to produce the triangulation that would be constructed by the following sequential algorithm: Sweep the plane from left to right with a vertical line L, such that each time L encounters a vertex f of P one draws all diagonals of P from v that do not cross previously drawn diagonals. This problem is a special case of the wellknown polygon triangulation problem (see [124, 193]), and it clearly has a polynomial time sequential solution. 4.2. Weighted planar partitioning Suppose one is given a collection of n nonintersecting line segments in the plane, such that each segment s is given a distinct weight w{s), and asked to construct the partitioning of the plane produced by extending the segments in the sorted order of their weights. The extension of a segment "stops" at the first segment (or segment extension) that is "hit" by the extension. This problem has applications to "art gallery problems" [98,186], and is Pcomplete even if there are only 3 possible orientations for the line segments. It is straightforward to solve it sequentially in O(nlog^n) time (by using the dynamic pointlocation data structure of [194]), and in 0(n \ogn) time by a more sophisticated method [98]. 4.3. Visibility layers One is given a collection of n nonintersecting line segments in the plane, and asked to label each segment by its "depth" in terms of the following layering process (which starts with / = 0 ) : Find the segments that are (partially) visible from point (0, +oo), label each such segment as being at depth /, remove each such segment, increment /, and repeat until no segments are left. This is an example of a class of problems in computational geometry known as layering problems or onion peeling problems [63,165,187], and is Pcomplete even if all the segments are horizontal.
164
M.J. Atallah and D.Z. Chen
*:' I *
Fig. 3. The convex layers of a point set in the plane.
4.4. Open problems Perhaps the most famous open problem in the area of geometric Pcompleteness is that of the convex layers problem [63]: Given n points in the plane, mark the points on the convex hull of the n points as being layer zero, then remove layer zero and repeat the process, generating layers 1,2,..., etc. See Figure 3 for an example. Some recent work has shown that a generalization of the convex layers problem, called multilist ranking [114], is indeed Pcomplete. Although the results in [114] shed some light on the convex layers problem, the Pcompleteness of the convex layers problem remains open. In view of the Pcompleteness of the abovementioned visibility layers problem, it seems reasonable to conjecture that the convex layers problem is also Pcomplete; however not all layering problems are Pcomplete. For example, the layers of maxima problem (defined analogously to convex layers but with the words "maximal elements" playing the role of "convex hull") is easily shown to be in NC by a straightforward reduction to the computation of longest paths in a directed acyclic graph [31] (each input point is a vertex, and there is a directed edge from point p to point q iff both the x and y coordinates of p are ^ those of ^, respectively).
5. Parallel divide and conquer As in sequential algorithms, divide and conquer is a useful technique in parallel computation. Parallel divide and conquer comes in many flavors which we discuss next.
5.1. Twoway divide and conquer The sequential divide and conquer algorithms that have efficient PRAM implementations are those for which the "conquer" step can be done extremely fast (e.g., in constant time). Take, for example, an 0{n \ogn) time sequential algorithm that works by recursively solving two problems of size n/2 each, and then combining the answers they return in linear time. In order for a PRAM implementation of such an algorithm to run in O(logn) time with n processors, the n processors must be capable of performing the "combine" stage in constant time. For some geometric problems this is indeed possible (e.g., the convex hull
Deterministic parallel computational geometry
165
problem [43,224]). The time complexity T(n) and processor complexity P(n) of such a PRAM implementation then obey the recurrences T(n)^T(n/2)^cu P(n)^max{n,2P(n/2)}, with boundary conditions T(l) < C2 and P ( l ) = 1, where c\ and C2 are positive constants. These imply that T(n) = 0(logn) and P(n) = n. But for many problems, such an attempt at implementing a sequential algorithm fails because of the impossibility of performing the "conquer" stage in constant time. For these, the next approach often works.
5.2. ''Rootish " divide and conquer By "rootish", we mean partitioning a problem into n^/^ subproblems to be solved recursively in parallel, for some positive constant integer k (usually, k = 2). For example, instead of dividing the problem into two subproblems of size n/2 each, we divide it into (say) ^/n subproblems of size ^/n each, which we recursively solve in parallel. That the conquer stage takes O(logn) time (assuming it does) causes no harm with this subdivision scheme, since the time and processor recurrences in that case would be T(n)^T{^/n)\cilogn, P(n) < maxjw, ^/nP(^^/n)], with boundary conditions T(l) ^C2 and P ( l ) = 1, where ci and C2 are positive constants. These imply that T(n) = O(logn) and P(n) = n. The problems that can be solved using rootish divide and conquer scheme include the convex hull of points [4,42,131], the visibility of nonintersecting planar segments from a point [53], the visibility of a polygonal chain from a point [36], the convex hull of a simple polygon [71], detecting various types of weak visibility of a simple polygon [69,7274], triangulating useful classes of simple polygons [71,132], and the determination of monotonicity of a simple polygon [76]. This scheme also finds success in other computational models such as the hypercube [32,70]. The scheme is useful in various ways and forms, and sometimes with recurrences very different from the abovementioned ones, as the next example demonstrates.
5.3. Example: visibility in a polygon Given a source point q and a simple nvertex polygonal chain P in the plane, this visibility problem is that of finding all the points of P that are visible from ^ if P is "opaque". We seek an algorithm that takes 0(log n) time and uses 0(n/ log n) FREW PRAM processors,
166
MJ. Atallah and D.Z. Chen
Fig. 4. The visibility chain VIS{C) of a polygonal chain C from the point q = (0, oo).
which is optimal to within a constant factor because (i) there is an obvious Q{n) sequential lower bound for the problem, and (ii) an Q(\ogn) lower bound on its EREW PRAM time complexity can be obtained by reducing to it the problem of computing the maximum of n entries, a problem with a known logarithmic time lower bound [94]. This is one instance of a problem in which one has to use a hybrid of twoway divide and conquer and rootish divide and conquer, in order to obtain the desired complexity bounds. The recursive procedure we sketch below follows [36] and takes two input parameters (one of which is the problem size) and uses either fourthroot divide and conquer or twoway divide and conquer, depending on the relative sizes of these two parameters. The role played by the geometry is central to the "combine" step (other algorithms of this kind can be found in [68,7174,130132] for solving many problems on polygons and point sets). We call VisChain the recursive procedure for computing the visibility chain of a simple polygonal chain from the given source point q (see Figure 4 for an example of the visibility chain VIS{C) from the point q = (0, oo)). The procedure is outlined below. Let \C\ denote the number of vertices of a polygonal chain C. The initial call to the procedure is VisChaiii(P,«, log«), where P is a simple polygonal chain and n = \P\. VisChain(C,m,J) Input: A simple polygonal chain C, m = C, and a positive integer d of our choice. Output: The visibility chain of C, V75(C), from the point ^. Step 1. If m ^ J, then compute VIS{C) with one processor in 0(m) time, using any of the known sequential lineartime algorithms. Step 2. \i d <m ^(f, then divide C into two subchains C\ and C2 of equal length and recursively call VisChain(Ci, \C\\,d) and VisChain(C2, IC2I, J^, then partition C into g = (m/d)^^^ subchains Ci, C2, •.., Cg of length m^/4ji/4 ^^^^ jj^ parallel, call VisChain(Ci, Ci , J), VisCham(C2, IC2I, J), . . . , VisChain(Q,  Q , J). Then compute VIS(C) from VlSiCi), VlSiCi),..., VIS(Cg),
Deterministic parallel computational geometry
167
in O(logm) time and using m/d processors (we henceforth use g to denote
im/dy^^). end. The main difficulty Hes in the "conquer" steps: Even though Q and Cj do not intersect, there can be more than one intersection between their visibihty chains VIS{Ci) and VIS{Cj), and we have (cf. Step 3 above) only g^ = (m/dy^^ processors to compute these intersections between each pair (VIS(Ci), VIS(Cj)). Doing this in O(logm) time may appear impossible at first sight: the length of each of VlS(Ci) and VIS(Cj) can be nr'^^d^/^, and there is a wellknown linear lower bound [65] on the work needed for computing the two intersections of two arbitrary simple polygonal chains that intersect twice. This seems to imply that, since we have only {m/d)^^^ processors assigned to the task, it will take nr"I^d^I^{mId)~'^ 1^ ~ m^l^d^l^ time rather than the claimed O(logm). What enables us to achieve O(logm) time is the fact that both Ci and Cj are subchains of a simple polygonal chain. Observe that, if we could perform the various steps of the above algorithm within the claimed bounds, then it would indeed run in 0{d + logm) time with 0{m/d) processors since its time and processor complexities would satisfy the following recurrences:
t(m,d)
=
p(m,d)
=
c\m if m ^ J, t{m/2,d) + C2(\ogmf ifd<m^d^, t{rrv'/^d^'^, d) + C3 logm if d^ < m, \max[l, m/d) max{2p{m/2,d), m/d] [m^x{(m/dy^'^p{m^^^d^^'^,d),m/d}
ifm^J, ifd<m^d^, ifd^<m.
where ci, C2, C3 are constants. From the above recurrences, the following bounds for t(m,d) and p(m,d) are easy to prove by induction: r a\d t(m d) < 1 a2d \ ^2(logmy log J [ a s J + ^slogm p{m ,d) = m/d,
if m ^d. ifd <m ^d^ ifd' ' < m,
where CYI, 0^2, y^2, 0^3, y^3 are constants. Choosing d to be logm, the above implies that r(m, logm) = O(logm) and p(m, logm) = 0(m/logm). Hence the call VisChain(P, n, logn) would compute VIS(P)in O(logn) time using 0(n/logn) processors. Thus it suffices to show how, with m/d processors, to do the "combine" part of Step 2 in 0((logm)^) time, and more importantly, how to implement the "combine" part of Step 3 in O(logm) time. The geometric facts that make this possible are: • If C^ is a subchain of a chain C then VIS(C) H VIS(C^) has at most three connected components (i.e., at most three separate portions of VIS(C^) appear in VIS(C)). • If C^ and C^^ are two subchains of C that are disjoint except that they may share one endpoint, then there are at most two intersections between VIS(C^) and VIS(C'^).
168
MJ. Atallah and D.Z. Chen
Although the above limits to two the number of possible intersections between the visibility chains of two subchains of C that are disjoint (except possibly at a common endpoint), the linearwork lower bound we mentioned earlier for detecting intersections between polygonal chains [65] holds even for two chains that intersect each other no more than twice. The solution in [36] exploits the fact that the two chains are subchains of a simple chain in order to get around the lower bound when solving the twointersection case. Specifically, it shows how to compute, for each C/, the (at most two) portions of VIS{Ci) that are hidden. Once one has done this (in parallel) for every / G { 1 , . . . , g}, it is easy to "stitch" the resulting g' ^ 3g pieces of VIS{C) and create VIS{C)\ first split the trees representing VIS{C\), VIS{C2),.. •, VIS(Cg), in order to discard all portions of the V75(C/)'s that are invisible in VIS(C); then the problem essentially becomes that of sorting (by the polar angles) the 0(g) endpoints of those portions of the V 7 5 ( 0 ' s that are visible in VIS{C), which can be done in time O(logm) using 0(g) EREW PRAM processors [87]. There are g^ processors available, more than enough to do this sorting.
6. Cascading Cascading is a sampling and iterative refinement method that was introduced by Cole [87] for the sorting problem, and was further developed in [37,130] for the solutions of geometric problems. It has proved to be a fundamental technique, one that enables optimal solutions when most other techniques fail. Since its details are intricate even for sorting, the next subsection gives a rough sketch — too broad to be useful but enough to give the reader a feel for the main idea (later subsections give a more detailed description and illustrate with examples).
6.1. A rough sketch of cascading Since this technique works best for problems that are solved sequentially by divide and conquer, we use such a hypothetical problem to illustrate the discussion: Consider an 0(nlogn) time sequential algorithm that works by recursively solving two subproblems of size n/2 each, followed by an 0(n) time conquer stage. Let T be the tree of recursive calls for this algorithm, i.e., a node of this recursion tree at height h corresponds to a subproblem of size equal to the number of leaves in its subtree (=2^). A "natural" way of parallelizing such an algorithm would be to mimic it by using n processors to process r in a bottom up fashion, one level at a time, completing level h before moving to level h \1 of T (where by "level h'\ we mean the set of nodes of T whose height is h). Such a parallelization will yield an O(logn) time algorithm only if processing each level can be done in constant time. It can be quite nontrivial to process one level in constant time, so this natural parallelization can be challenging. However, it is frequently the case that processing one level cannot be done in constant time, and it is precisely in these situations that the cascading idea can be useful. In order to be more specific when sketching this idea, we assume that the hypothetical problem being solved is about a set 5 of n points, with the points stored in the leaves of T.
Deterministic parallel computational geometry
169
In a nutshell, the general idea of cascading is as follows. The computation proceeds in a logarithmic number of stages, each of which takes constant time. Each stage involves activity by the n processors at more than one level, so the computation diffuses up the tree T, rather than working on only one level at a time. For each node i; G T, let h{v) be the height of f in T, L{v) be the points stored in the leaves of the subtree of f in T, and let I(L(v)) be the information we seek to compute for node v (the precise definition of /(•) varies from problem to problem). The ultimate goal is for every v eT to compute the I(L(v)) array. Each v eT lies "dormant" and does nothing until the stage number exceeds a certain value (usually /i(i;)), at which time node v "wakes up" and starts computing, from stage to stage, I(V) for a progressively larger subset L^ of L(i;), a subset L^ that (roughly) doubles in size from one stage to the next of the computation. I(L^) can be thought of as an approximation of the desired I(L(v)), an approximation that starts out being very rough (when L^ consists of, say, a single point) but gets repeatedly refined from one stage to the next. When V eventually becomes equal to L(v), node v becomes inactive for all the future stages (i.e., it is done with its computation, since it now has I(L(v))). There are many (often intricate) implementation details that vary from one problem to the next, and many times the scheme substantially deviates from the above rough sketch, but the above nevertheless gives the general idea of cascading. The cascading technique has been used to solve many problems (not just geometric ones). The next section explains in more detailed the basic version of the technique, for the problem of sorting. Some of the geometric problems for which it has been used are covered later, in order to illustrate variants of the method. The exposition follows [37], with proofs and details omitted.
6.2. Cascading merge sort In this section we sketch the cascading technique for the merge sorting problem; later we show how it can be modified to solve geometric problems. Suppose we are given a binary tree T (not necessarily complete) with items, taken from some total order, placed at the leaves of T, so that each leaf contains at most one item. For simplicity, we assume that the items are distinct. We wish to compute for each internal node u G T the sorted list U{v) that consists of all the items stored in descendant nodes of i;. We show how to construct U{v) for every node in the tree in 0(height(r)) time using \T\ processors, where \T\ denotes the number of nodes in T. Without loss of generality, we assume that every internal node i; of r has two children (otherwise we can add an extra leaf child that is empty, i.e., does not store any items from the total order). Let two sorted (nondecreasing) lists A = (ai, ^2, • • •, ^w) and J5 = (Z?i, Z?2,..., ^m) be given. We define the rank of an element at in B to be the number of elements in B that are less than at. We say that A is ranked in B if for every element in A we know its rank in B. We say that A and B are cross ranked if A is ranked in B and B is ranked in A. We define A U 5 to be the sorted merged list of all the elements in A or 5 . If ^ is a subset of A, then we define A — 5 to be the sorted list of the elements in A that are not in B. Let r be a binary tree. For any node v inT the altitude, denoted alt(i;), is height(r) — depth(f). Desc(i;) denotes the set of descendant nodes of i; (including v itself).
170
MJ. Atallah and D.Z. Chen
Let a sorted list L and a sorted list J be given. We say that L is a ccover of / if between each two adjacent items in (—oo, L, oo) there are at most c items from / . We let SAMPc(L) denote the sorted list consisting of every cth element of L, and call this list the csample of L. That is, SAMPdL) consists of the cth element of L followed by the (2c)th element of L, and so on. The algorithm for constructing Uiv) for each v eT proceeds in stages. Intuitively, in each stage we will be performing a portion of the merge of [/(lchild(i')) and L^(rchild(i;)) to give the list U(v). After performing a portion of this merge we will gain some insight into how to perform the merge at u's parent. Consequently, we will pass some of the elements formed in the merge at f to f's parent, so we can begin performing the merge at u's parent. Specifically, we denote the list stored at a node i; in 7 at stage s by Us(v). Initially, Uo(v) is empty for every node except the leaf nodes of T, in which case Uo(v) contains the item stored at the leaf node v (if there is such an item). We say that an internal node v is active at stage s if [s/Sj ^ alt(i;) ^ 5, and we say v is full at stage s if alt(i;) = [s/Sj. As will become apparent below, if a node v is full, then Us(v) = U(v). For each active node f G r we define the list U^^_^^ (v) as follows: SAMP4(Us(v)) if alt(u) > 5/3, ^ ; + i ( ^ ) = SAMP2(Us(v)) if alt(i;) = (s  l ) / 3 , I SAMP\ (Us (v)) if alt(i;) = (s  2)/3. At stage 5 + 1 we perform the following computation at each internal node v that is currently active: PerStage Computation(v, s \ I): Form the two lists L^^!^j(lchild(i;)) and U^^_^^(rchi\d(v)), and compute the new list Us+iiv) := ^;^i(lchild(u)) U ^;^,(rchild(i;)). This formalizes the notion that we pass information from the merges performed at the children of v in stage s to the merge being performed at v in stage 5 + 1. Note that until V becomes full U^^_^^(v) will be the fist consisting of every fourth element of Us(v). This continues to be true about U^^_^^(v) up to the point that v becomes full. If Sy is the stage at which v becomes full (and Us(v) = U(v)), then at stage Sy h 1, U'^_^^(v) is the twosample of Us(v), and, at stage Sy f 2, U^^_^^ (v) = Us(v) (= U(v)). Thus, at stage Sy + 3, parent(i;) is full. Therefore, after 3 * height(r) stages every node has become full and the algorithm terminates. We have yet to show how to perform each stage in 0(1) time using n processors. The next lemma states that the number of items in Us+\ (v) can be only a little more than twice the number of items in Us (v), a property that is essential to the construction. LEMMA
6.1. For any stage s ^0 and any node v eT, \ f/s + i i'^) I ^ 2ms (^) I + 4.
The next lemma states that the way in which the UsivYs grow is "well behaved."
Deterministic parallel computational geometry
111
L E M M A 6.2. Let [a, b] be an interval with a,b e (—oo,U!.(v), oo). If [a,b] intersects k h I items in (—00, U'^{v), 00), then it intersects at most 8/: + 8 items in Us(v) for all k^ I ands ^ 1. C O R O L L A R Y 6.3. The list (00,
U!,(v), 00) is a Acoverfor
U[_^^{v), for all
s^O.
This corollary is used in showing that we can perform each stage of the merge procedure in 0 ( 1 ) time. In addition to this corollary, we also need to maintain the following rank information at the start of each stage s: 1. For each item in U^(v): its rank in 6^^^(sibling(i;)). 2. For each item in U^^ (v): its rank in Us (v) (and hence, implicitly, its rank in U^^_^ 1 (f ))• The lemma that follows states that the above information is sufficient to allow us to merge L^^^^j(lchild(i;)) and t/^^^j(rchild(i;)) into the list Us\i(v) in 0 ( 1 ) time using IUsii (v)I processors. L E M M A 6.4 (The Merge Lemma). Suppose one is given sorted lists As, ^ ^ ^ ^ j , ^^, ^v+P C[, and C^^p where the following (input) conditions are true: 1. AS =
B'^\JC^\
2. A'^^^ is a subset of As', 3. B^^ is a c\ coverfor ^^^^; 4. Cy is a C2~coverfor C'^\ 5. B[. is ranked in B'.^\ 6. C'^ is ranked in C^^j; 7. B'^ and C^ are cross ranked. Then in 0 ( 1 ) time using ^^ 1 J + I ^^411 processors can compute the following {output computations): 1. the sorted list A^+i = 5^^^ U C^^^; 2. the ranking of A'^ in A^+i; 3. the cross ranking of B^^.^ and C^.^.
in the CREW PRAM model, one
We apply this lemma by setting As = Us(v), A^_^j = U^^^^iv), A^+i = Us^i(v), B'^ = f/;(x), 5;,^^ = K^iM, C; = [/;(y), and C;^i = f/;+i(y), where x = leftchild(i;) and y = rightchild(i;). Note that assigning the lists of Lemma 6.4 in this way satisfies input conditions 14 from the definitions. The ranking information we maintain from stage to stage satisfies input conditions 57. Thus, in each stage s we can construct the list L^^+i (v) in 0 ( 1 ) time using \Us\i(v)\ processors. Also, the new ranking information (of output computations 2 and 3) gives us the input conditions 57 for the next stage. By Corollary 6.3 we have that the constants c\ and C2 (of input conditions 3 and 4) are both equal to 4. Note that in stage s it is only necessary to store the lists for .y — 1; we can discard any lists for stages previous to that. The method for performing all these merges with a total of  T  processors is basically to start out with 0 ( 1 ) virtual processors assigned to each leaf node, and each time we pass k elements from a node v to the parent of v (to perform the merge at the parent), we also pass O(^) virtual processors to perform the merge. When f's parent becomes full, then we no longer "store" any processors at v. There can be at most 0(n) elements present
172
M.J. Atallah and D.Z. Chen
in active nodes of T for any stage s (where n is the number of leaves of 7), since there are n elements present on the full level, at most n/2 on the level above that, n/8 on the level above that, and so on. Thus, we can perform the entire cascading procedure using 0{n) virtual processors, or n actual processors (by a simple simulation argument). This also implies that we need only 0{n) storage for this computation, in addition to that used for the output, since once a node v becomes full we can consider the space used for U{v) to be part of the output. Equivalently, if we are using the generalized merging procedure in an algorithm that does not need a U{v) list once u's parent becomes full, then we can implement that algorithm in 0(n) space by deallocating the space for a U{v) list once it is no longer needed. It will often be more convenient to relax the condition that there is at most one item stored at each leaf. So, suppose there is an unsorted set A{v) (which may be empty) stored at each leaf. In this case one can construct a tree T' from T by replacing each leaf v of T with a complete binary tree with A(i;) leaves, and associating each item in A{v) with one of these leaves. T' would now satisfy the conditions of the method outhned above. We incorporate this observation in the following theorem, which summarizes the discussion of this section: 6.5. Suppose one is given a binary tree T such that there is an unsorted set A{v) {which may he empty) stored at each leaf. Then one can compute, for each node V eT, the list U(v), which is the union of all items stored at descendants ofv, sorted in an array. This computation can be implemented in 0(height(r) + log(maXi;  A(i;))) time using a total ofn\N processors in the CREW PRAM computational model, where n is the number of leaves of T and N is the total number of items stored in T. THEOREM
The next three sections give specific examples of other applications and extensions of the cascading technique. 7. Fractional cascading in parallel Fractional cascading is a fundamental technique that has a large number of different applications in geometry [67]. First we briefly review the problem. Given a directed graph G = (V, E), such that every node v contains a sorted list C(v) (called a catalogue), the fractional cascading problem is to construct an 0{n) space data structure that, given a walk (vi,V2,.. •,Vni) in G and an arbitrary element x, enables a single processor to locate X quickly in each C(f/), where « =  y  + l^l + ^y^y \C(v)\. Fractional cascading problems arise naturally from a number of computational geometry problems. As a simple example of a fractional cascading problem, suppose one has five different EngHsh dictionaries and would like to build a data structure that would allow one to look up a word w in all the dictionaries. Chazelle and Guibas give an elegant 0(n) time sequential method for constructing a fractional cascading data structure from any graph G, as described above, achieving a search time of 0(logn + m log J(G)), where d(G) is the maximum degree of any node in G. However, their approach does not appear to be "parallelizable." In this section, which follows [37], we show how to construct a data structure achieving the same performance as that of Chazelle and Guibas in O(logn) time using fn/logn']
Deterministic parallel computational geometry
173
processors. The method begins with a preprocessing step similar to one used by Chazelle and Guibas where we "expand" each node of G into two binary trees — one for its inedges and one for its outedges — so that each node in our graph has indegree and outdegree at most 2. We then perform a cascading merge procedure in stages on this graph. Each catalogue Civ) is "fed into" the node v in samples that double in size with each stage and these lists are in turn sampled and merged along the edges of G. Lists continue to be sampled and "pushed" across the edges of G (even in cycles) for a logarithmic number of stages, at which time we stop the computation and add some links between elements in adjacent lists. We show that this gives us a fractional cascading data structure, and that the computation can be implemented in O(logn) time and 0{n) space using \n/\ogn'\ processors. We show below how to perform the computations in 0(log n) time and 0(n) space using n processors. It is possible to get the number of processors down to \n/ \ogn\ by a careful application of Brent's theorem. Define In(i', G) (resp. Out(i;, G)) to be the set of all nodes winV such that {w,v) G E (resp. (u, w) e E). The degree of a vertex v, denoted by d(v), is defined as d(v) = max{In(i;, G), Out(i;, G)}. The degree of G, denoted by J(G), is defined as d(G) = maxyQv{d(v)]. A sequence (vi, f2, • • •, Vm) of vertices is a walk if (vi, f/+i) e E for all /G{l,2,...,m~l}. As mentioned above, we begin the construction by preprocessing the directed graph G to convert it into a directed graph G = (V, E) such that d{G) < 2 and such that an edge (f, w) in G corresponds to a path in G of length at most 0(log J(G)). Specifically, for each node f G y we construct two complete binary trees T^^ and T^^^. Each leaf in T^^ (resp., T^^^) corresponds to an edge coming into v (resp., going out of v). So there are In(i;, G)\ leaves in TJ" and Out(i;, G)\ leaves in 7;^^^ We call 7;^^ the fanin tree for v and r°"^ the fanout tree for v. An edge ^ = (f, if) in G corresponds to a node e in G such that e is a leaf of the fanout tree for v and e is also a leaf of the fanin tree for w. The edges in T^^ are all directed up towards the root of TJ", and the edges in T^^^ are all directed down towards the leaves of T^^^. For each v e V we create a new node v' and add a directed edge from i;^ to f, a directed edge from the root of T^ to v^ and an edge from v^ to the root of T^^^. We call v^ the gateway for v. Note that d(G) = 2. We assume that for each node v we have access to the nodes in ln(v, G) as well as those in Out(i;, G). We structure fanout trees so that a processor needing to go from f to u; in G, with {v,w) eE, can correctly determine the path down T^^^ to the leaf corresponding to {v,w). More specifically, the leaves of each fanout tree are ordered so that they are listed from left to right by increasing destination name, i.e., if the leaf in T^^^ for e = (f, u) is to the left of the leaf for / = (f, w), then u <w. (The leaves of TJ" need not be sorted, since all edges are directed towards the root of that tree.) If we are not given the Out(i;, G) sets in sorted order, then we must perform a sort as a part of the T^^^ construction, which can be done in 0(log J(G)) time using n processors using Cole's merge sorting algorithm [87]. We also store in each internal node z of T^^^ the leaf node u that has the smallest name of all the descendents of z. The above preprocessing step is similar to a preprocessing step used in the sequential fractional cascading algorithm of Chazelle and Guibas. This is where the resemblance to the sequential algorithm ends, however.
174
M.J. Atallah and D.Z. Chen
The goal for the rest of the computation is to construct a special sorted list B{v), which we call the bridge list, for every node v eV. We shall define these bridge lists so that B{v) = C{v) if V is in V, and, if i; is in V but not in V, then for every (u, w) e E if 2i single processor knows the position of a search item x in B{v), then it can find the position of X in B{w) in 0(1) time. The construction of the 5(i;)'s proceeds in stages. Let Bs{v) denote the bridge fist stored at node i; € V at the end of stage s. Initially, BQ{V) = 0 for all u in V. Intuitively, the perstage computation is designed so that if v came from the original graph G (i.e., v e V), then V will be "feeding" Bs(v) with samples of the catalogue C(v) that double in size with each stage. These samples are then cascaded back into the gateway v^ for i; and from there back through the fanin tree for v. We will also be merging any samples "passed back" from the fanout tree for v with B^ (v^), and cascading these values back through the fanin tree for v as well. We iterate the perstage computation for [log A^l stages, where N is the size of the largest catalogue in G. We will show that after we have completed the last stage, and updated some ranking pointers, G will be a fractional cascading data structure for G. More details follow. Recall that Bo(v) = 0 for all i; G V. For stage 5 ^ 0 we define B^_^j (v) and Bs\\(v) as follows: , _ I SAMP4{Bs(v)) ^.+1 ^^) I SAMPcis){C(v)) B;,_^,(U;I)
Bs^\(v)
=
^;+,(w;) 10
if i; G y  V, if i; G y.
U 5;+,(u;2)
if Out(i;, G) = [wuW2], ifOut(i;,G) = {M;}, ifOut(i;,G) = 0,
where c(s) = 2^^^^^^' and A^ is the size of the largest catalogue. The perstage computation, then, is as follows: PerStage Computation(v, 5 + 1 ) : Using the above definitions, construct Bv+i (v) for all i; G V in parallel (using \Bs\i(v)\ processors for each v). The function c(s) is defined so that if i; G V, then as the computation proceeds the list B[_^i (v) will be empty for a while, then at some stage 5 + 1 it will consist of a single element of C(v) (the (2'^'^^^^~^)th element), in stage 5* + 2 at most three elements (evenly sampled), in stage 5 + 3 at most five elements, in stage 5 + 4 at most nine elements, and so on. This continues until the final stage (stage flog A^l), when B^^_^^ (v) = C(v). Intuitively, the c(s) function is a mechanism for synchronizing the processes of "feeding" the C(v) lists into the nodes of G so that all the processes complete at the same time. We show below that each stage can be performed in 0(1) time, resulting in a running time of the cascading computations that is 0(log N) (plus the time it takes time to compute the value of N: namely, O(logn)). The following important lemma is similar to Lemma 6.1 in that it guarantees that the bridge lists do not grow "too much" from one stage to another. LEMMA
7.1. For any stage s ^0 and any node v eT,\ Bs+\ {v) \^2\Bs{v)\\
4.
Deterministic parallel computational geometry COROLLARY
7.2. The list (00, B[.(v), oo) is a 4coverfor B[_^^(v), for s ^ 0 .
COROLLARY
7.3. The list (—oc, Bs(v),oc)
is a 14cover for Bs(w), for s ^0
175
and
(v, w) e E. The first of these two corollaries implies that we can satisfy all the ccover input conditions for the Merge Lemma (Lemma 6.4) for performing the merge operations for the computation at stage s in 0(1) time using ris processors, where ris = Xluev \^s{'^)\' We use the second corollary to show that when the computation completes we will have a fractional cascading data structure (after adding the appropriate rank pointers). We maintain the following rank information at the start of each stage s: 1. For each item in B[^ {v): its rank in B^^(w) if In(i', G) O In(w;, G) is nonempty, i.e., if there is a vertex u such that (u,v) e E and (u,w) e E. 2. For each item in 5^ (v): its rank in B^ (v) (and thus, implicitly, its rank in B^^_^y(v)). By having this rank information available at the start of each stage s we satisfy all the ranking input conditions of the Merge Lemma. Thus, we can perform each stage in 0(1) time using ris processors. Moreover, the output computations of the Merge Lemma allow us to maintain all the necessary rank information into the next stage. Note that in stage s it is only necessary to store the lists for 5* — 1; we can discard any lists for stages previous to that, as in the generalized cascading merge. Recall that we perform the computation for [log A^] stages, where N is the size of the largest catalogue. When the computation completes, we take B(v) = Bs(v) for all v eV, and for each (v,w)eEwe rank B(v) in B(w). We can perform this ranking step by the following method. Assign a processor to each element b in B(v) for all f G F in parallel. The processor for b can find the rank of b in each 5^ (w) such that w e Out(i', G) in 0(1) time because Bs(v) contains B'^{w) as a proper subset {B'^{w) was one of the lists merged to make Bs {v)). This processor can then determine the rank of b in B{w) = Bs (w) for each w e Out(i;, G) in 0(1) time by using the ranking information we maintained (from B'^{w) io Bs{w)) for stage s (rank condition 2 above). Given a walk W = {v\,.. .,Vm), and an arbitrary element x, the query that asks for locating x in every C{vi) is called the multilocation of x in ( f i , . . . , f^). To perform a multilocation of jc in a walk ( f i , . . . , f;^) we extend the walk VF in G to its corresponding walk W = (iTi,... , ^ ) in G and perform the corresponding multilocation in G, similar to the method given by Chazelle and Guibas for performing multilocations in their data structure. The multilocation begins with the location of x in B(v^\) = B{v[), the gateway bridge list for i^i, by binary search. For each other vertex in this walk we can locate the position of X in B(v^i) given its position in J5(i^_i) in 0(1) time. The method is to follow the pointer from x 's predecessor in i5(i^ _ 1) to the predecessor of that element in B(vi) and then locate x in B(vi) by a linear search from that position (which will require at most 13 comparisons by Corollary 7.3). In addition, if t^ corresponds to a gateway v\ then we can locate X in C(i;) in 0(1) time given its position in B{v') by a similar argument. Since each edge in the walk W corresponds to a path in W of length at most 0(log J(G)), this implies that we can perform the multilocation of x in (i^i,..., fw) in 0(log \B{v[)\\m log J(G)) time. In other words, G is a fractional cascading data structure. The next lemma states that G uses 0{n) space.
176
MJ. Atallah and D.Z. Chen
LEMMA 7.4. Let n y denote the amount of space that is added to G because of the presence of a particular catalogue C{v), v eV. Then n^ ^ 2C(i;). COROLLARY 7.5. The total amount of space used by the fractional cascading data structure is 0(n), where n = \V\\\E\\ Y.y^y \C(v)\.
Note that the upper bound on the space of the fractional cascading data structure holds even if G contains cycles. This corollary, then, implies that we can construct a fractional cascading data structure G from any catalogue graph G in O(logn) time and 0(n) space using n processors, even if G contains cycles. See [37] for details of how to assign these n processors to their respective jobs. In fact [37] establishes the following stronger result. 7.6. Given a catalogue graph G = (V, E), such that d(G) is 0(1) or one is given each Out(i;, G) set in sorted order, one can build a fractional cascading data structure for G in O(logn) time and 0{n) space using \n/ log/i] processors in the CREW PRAM model, where n = \V\\\E\\^^^y\C{v)\. This bound is optimal THEOREM
8. Cascading with labeling functions The merging procedure of Section 6.2 can be combined with divideandconquer strategies based on merging lists with labels defined on their elements. This gives rise to variants of cascading that resulted in efficient parallel solutions to many geometric problems. We illustrate some of these here. For most of these problems this approach gives an efficient sequential alternative to the known sequential algorithms (which typically use the planesweeping paradigm), as well as giving rise to efficient parallel algorithms. We begin with the 3dimensional maxima problem. 8.1. The 3dimensional maxima problem Let V = {p\, /72, •••,/?«} be a set of points in R^^. For simplicity, we assume that no two input points have the same x (resp., y, z) coordinate. We denote the JC, y, and z coordinates of a point p by x{p), y{p), and z{p), respectively. We say that a point /?/ \dominates another point pj if x{pi) > x(pj), 2dominates pj if x{pi) > x(pj) and y{pi) > y(Pj), and 3dominates pj if x(pi) > x(pj), y(pi) > y(Pj), and z(pi) > z(pj)> A point pt e V is said to be a maximum if it is not 3dominated by any other point in V. The 3dimensional maxima problem, then, is to compute the set, M, of maxima in V. We show how to solve the 3dimensional maxima problem efficiently in parallel in the following algorithm. The method is based on cascading a divideandconquer strategy in which the merging step involves the computation of two labeling functions for each point. The labels we use are motivated by the optimal sequential planesweeping algorithm of Kung, Luccio, and Preparata [163]. Specifically, for each point pi we compute the maximum zcoordinate from all points which 1dominate pi and use that label to also compute the maximum zcoordinate from all points which 2dominate pi. We can then test if pi is a maximum point by comparing z(pi) to this latter label.
Deterministic parallel computational geometry
177
Without loss of generality, assume the input points are given sorted by increasing >'coordinates, i.e., y{pi) < _y(/7/+i). Let 7 be a complete binary tree with leaf nodes v\, V2,. ",Vn (in this order). In each leaf node vi we store the list B{vi) — (—oo, /?/), where — oo is a special symbol such that x{—od) < x(pj) and y(—oo) < y(pj) for all points pj in V. Initializing T in this way can be done in 0(log/i) time using n processors. We then perform a generalized cascadingmerge from the leaves of T as in Theorem 6.5, basing comparisons on increasing xcoordinates of the points (not their Jcoordinates). Using the notation of Section 6.2, we let U(v) denote the sorted array of the points stored in the descendants of v e T sorted by increasing xcoordinates. For each point pi in U(v) we store two labels: zod(pi, v) and ztd(pi, v), where zod(/?/, v) is the largest zcoordinate of the points in U(v) that 1dominate /?/, and ztd(pi, v) is the largest zcoordinate of the points in U(v) that 2dominate pi. Initially, zod and ztd labels are only defined for the leaf nodes of T. That is, zod(/?/, f/) = ztd(pi ,Vi) = —oc and zod(—oo, Vi) = ztd(—oo, Vi) = z(pi) for all leaf nodes Vi in T (where U(vi) = (—oo, pt)). In order to be more explicit in how we refer to various ranks, we let pred(/7/, v) denote the predecessor of pi in U{v) (which would be — oo if the xcoordinates of the input points are all larger than x{pi)). As we are performing the cascadingmerge, we update the labels zod and ztd based on the equations in the following lemma: LEMMA 8.1. Let pt be an element ofU(v) and let u = lchild(i') and w = rchild(i;). Then we have the following:
.,
^
zod(/7/, v) =
, max lzod(pi, u), zod(pred(/?/, w),w)] ' max \zod{pxtd{pi,u), u), zod(pi, w)]
ztd(p/ i;) = max{ztd(/7/,w), zod(pred(p/, w;), w)}
\zid{pi,w)
if pt e U{u), if pi e U{w),
(1)
ifpieU{u),
^2)
ifpteUiw).
We use these equations during the cascading merge to maintain the labels for each point. By Lemma 8.1, when v becomes full (and we have U{u), U(w), and U(v) = U(u)U U{w) available), we can determine the labels for all the points in U{v) in 0(1) additional time using t/(i^) processors. Thus, the running time of the cascadingmerge algorithm, even with these additional label computations, is still O(logn) using n processors. Moreover, after u's parent becomes full we no longer need U{v) any more, and can deallocate the space it occupies, resulting in an 0(n) space algorithm, as outlined in Section 6.2. After we complete the merge, and have computed L^(root(r)), along with all the labels for the points in U(jooi{T)), note that a point pt e U(root(T)) is a maximum if and only if ztd(pi,root(T)) < z(pi) (there is no point that 2dominates pi and has zcoordinate greater than z(pi)). Thus, after completing the cascading merge we can construct the set of maxima by compressing all the maximum points into one contiguous list using a simple parallel prefix computation. We summarize in the following theorem: THEOREM 8.2. Given a set V ofn points in R^, one can construct the set M of maximal points in V in O(logn) time and 0(n) space using n processors in the CREW PRAM model, and this is optimal.
178
MJ. Atallah and D.Z. Chen
(The optimality follows from the fact that [163] have shown that this problem has an ^ in log n) sequential lower bound.) It is worth noting that one can use roughly the same method as that above as the basis step of a recursive procedure for solving the general ^dimensional maxima problem for ^ > 3. The resulting time and space complexities are 0{(\ogn)^~^) time using n processors in the CREW PRAM model. Next, we address the twoset dominance counting problem. 8.2. The twoset dominance counting problem In the twoset dominance counting problem we are given a set A = {^i, ^2, • • •»^m} and a set 5 = {ri, r 2 , . . . , r/} of points in the plane, and wish to know for each point r/ in B the number of points in A that are 2dominated by r/. For simplicity, we assume that the points have distinct x (resp. y) coordinates. The approach to this problem is similar to that of the previous subsection, in that we will be performing a cascading merge procedure while maintaining two labeling functions for each point. In this case the labels maintain for each point Pi (from A or B) how many points of A are 1dominated by /?/ and also how many points of A are 2dominated by pi. As in the previous solution, the first label is used to maintain the second. The details follow. Let y = {/?i, /72,..., p/+m} be the union of A and B with the points listed by increasing >'coordinate, i.e., y{pi) < y(pi^\). We can construct Y in O(logn) time using n processors [87], where n = I \ m. The method for solving the twoset dominance counting problem is similar to the method used in the previous subsection. As before, we let T be a complete binary tree with leaf nodes v\,V2,.. .,Vn, in this order, and in each leaf node Vi we store the list Uivi) = (—00, /?/), (—00 still being a special symbol such that jc(—00) < x(pi) and y(—oo) < y(pi) for all points pi in Y). We then perform a generaUzed cascadingmerge from the leaves of T as in Theorem 6.5, basing comparisons on increasing xcoordinates of the points (not their 3;coordinates). We let U(v) denote the sorted array of the points stored in the descendants of v e T sorted by increasing jccoordinate. For each point /?/ in U(v) we store two labels: nod(/7/, v) and ntd(/?/, v) The label nod(/7/, v) is the number of points in U(v) that are in A and are 1dominated by Pi, and the label ntd(/7/, v) is the number of points in U(v) that are in A and are 2dominated by pi. Initially, the nod and ntd labels are only defined for the leaf nodes of T. That is, nod(/7/, u/) = nod(—00, Vi) = ntd(/7/, Vi) = ntd(—00, Vi) = 0. For each pi G 7 we define the function ^A(Pi) as follows: ^A(Pi) = I if Pi e A, and ^A(Pi) = 0 otherwise. (We also use pred(/?/, v) to denote the predecessor of p in U(v).) As we are performing the cascadingmerge, we update the labels nod and ntd based on the following lemma. LEMMA 8.3. Let pi be an element ofU(v) and let u = lchild(i') and w = rchild(i;). Then we have the following:
nod{pi,v)
=
nod{pi, u) + nod(pred(/7/,w),w) \^A (pred(/?/, w)) if Pi e U(u), nod(pred(/7/, w), M) + nod(p/, w;) + h \ logm then node i; does nothing during stage t. Thus before stage h the node v hes "dormant", then at stage t = h it first "wakes up" and computes ij/yiRo, *), then at the next stage t = h \1 it computes i/yiRi, *), etc. At stage t = h\ logm it computes ^v(R\ogm, *), after which it is done. See [46] for the details of what information v stores and how it uses its \I{v)\ + logn processors to perform stage t in constant time. In [46] a method is also given for avoiding the use of the "concurrent read" capability of the CREW PRAM, thus making the results hold in the EREW PRAM model.
10.2. Tube minima In what can be viewed as the threedimensional version of the above row minima problem [8], one is given an w i x ^2 x «3 matrix A and one wishes to compute, for every 1 ^ / < ni and 1 ^ 7 ^ ^3, the «! x n^ matrix OA such that OA(i, j) is the smallest index k that minimizes A(i,k,j) (that is, among all the k's that minimize A(i,k,j), OA(i,j) is the smallest). The matrix A is such that OA satisfies the following sorted property:
OA(iJ)^OA(iJ\l), OA(iJ)^OA(i\lJ). Furthermore, for any submatrix A^ of A, OA' also satisfies the sorted property. Given such a matrix A, the problem of computing array OA is called by Aggarwal and Park [8] "computing the tube minima" of A. Many geometric applications of this problem are mentioned in [8]. There are many nongeometric applications to this problem as well. These include parallel string editing [25], constructing Huffmann codes in parallel [48], and other treeconstruction problems. (In [48], the problem was given the name "multiplying two concave matrices".) The best CREW PRAM algorithms for this problem run in 0(logn) time and n^/logn processors [8,25], and the best CRCW PRAM algorithm runs in O(loglogn) time and n^/ log logn processors [27] (where n = n\ =n2 = n^). Both the CREW and the CRCW bounds are easily seen to be optimal.
Deterministic parallel computational geometry
185
We sketch the CRCW solution, which is an example of rootish divide and conquer. A crucial ingredient in the solution is the judicious use of the "aspect ratio condition": intuitively, the idea is to allow the aspect ratio of the subproblems solved recursively to deteriorate, but not too much, and in a controlled fashion. We sketch a version of the algorithm that has the right time complexity, but does too much work (hence uses too many processors). The procedure is recursive, and requires that Aht I x h x i with h ^ i^. We call this last condition the aspect ratio requirement; we assume it to be true initially, and we maintain it through the recursion (doing so without damaging the time complexity or the work complexity is, in fact, the main difficulty in this preliminary algorithm). The preliminary CRCW PRAM algorithm runs in O(log log ^) time and has work (that is, number of operations) complexity 0((£/z + l^)(\ogif). Before describing the algorithm, we need a few definitions and a review of some properties. Let X (resp., Y) be a subset of the row (resp., height) indices of A, and let Z be a contiguous interval of the column indices of A. The problem induced by the triplet (X, Z, Y) is that of finding OA' for the \X\ x \Z\ x \Y\ submatrix A^ of A induced by X, Z and Y. That is, it consists of finding, for each pair u, v with u e X and v eY, the smallest index k e Z such that A(u,k, v) is minimized. This k need not equal OA(U, V) since we are minimizing only over Z. However, the following property holds [8,25]. Assume X (resp., Y) is a contiguous interval of row (resp., height) indices of A. Let x, z, y (resp., x\ z\ yO be the smallest (resp., largest) indices in X, Z, Y respectively. If 6A(X, y) = Z and OA(X\ y^) = z\ then the solution to the triplet (X, Y, Z) gives the correct value of OA(U,V) for ail u e X and V eY (this follows from the sortedness of OA)The first stage of the computation partitions the row indices of A into l^^^ contiguous intervals Xi, X 2 , . . . , X^ip of size €^/^ each. Similarly, the height indices of A are partitioned into €^/^ contiguous intervals Fi, F2,..., F^i/3 of size £^^^ each. An endpoint of an interval Xi (resp., 7/) is the largest or smallest index in it. For each pair v, w such that V is an endpoint of Xi and w is an endpoint of Yj, we assign /ji+(i/6) processors which compute, in constant time, the index OA {V,W). (Computing the minimum of h entries using ^i+(i/6) processors is known to take constant time [211].) The total number of processors used in this step of the algorithm is 0(€^/^€^/^/z^+^^/^^), which is 0(ih) because h ^ i^. Let X (resp., x^) be the smallest (resp., largest) index in Xi, and let y (resp., y^) be the smallest (resp., largest) index in Yj. Let Zij be the interval [a, b] where a = OA(x,y) and b = 6A{x\y^). In the sequel, when we want to define such a Zij, we shall simply say "let Z/y denote the interval of column indices of A defined by the set OA(V, W) such that V G Xi and w G F / ' ; we do so for simplicity of expression, although it is an abuse of language (because Z/j might include an index k that is not the OA(M, V) of any pair u eXi, V e Yj). After the above stage of the computation we know the beginning and end of each such interval Zij. As already observed, for any pair of indices u, v where u e Xi and V eYj, we have ^A(W, V) e Zij. Thus it suffices to solve all of the subproblems defined by triplets (Xi, Zij, Yj). However, some of these triplets might violate the aspect ratio condition because their Zij is too large (larger than \Xi\^ = t^l^)'. Each such troublesome triplet (we call it a bad triplet) will be further partitioned into kij = \\Zij\ll^l^^ smaller
186
MJ. Atallah and D.Z. Chen
subproblems, by partitioning Ztj into kij pieces of size i^^^ each (except that possibly the kij\h piece might be smaller). Specifically, if Z^. . denotes the A:th piece from this partition of Ztj, then the kih subproblem spawned by the bad triplet (X/, Ztj, Yj) is {Xi, Z^. ., Yj). Of course such a spawned subproblem (X/, Z] •, Yj) no longer has the property that OA{U, V) G Z\J for u e Xi and v ^Yj. However, the answer returned by solving such an (X/, Z^ ., Yj) is not meaningless: We can obtain ^A(W, V) for u e Xi and V e Yj by choosing the best among the kij candidates returned by the kij subproblems (k)
(Xi, Z^ •, Fy), 1 < ^ < kij. We are now ready to give the details of the second stage of the computation. The second stage of the computation "fills in the blanks" by doing one parallel recursive call on a number of problems, defined as follows. In what follows, we describe these problems one at a time, but one should keep in mind that they are all solved in parallel. The first class of problems to be solved recursively are the good ones, those defined by triplets (Xi, Zij, Yj) where \Zij\ ^ i^^^. The Zij of such a good problem is not large enough to violate the aspect ratio constraint (because it satisfies \Zij  ^ X/ p). The second class of problems to be solved recursively are those spawned by the bad triplets (X/, Zij, Yj), namely subproblems (X/, z[^j, Yj), I ^k^ kij. By definition, each such (X/, z f ] , Yj) satisfies the aspect ratio requirement. When these recursive calls return, we need not do further work for the good triplets, but for the bad ones we only have the answers for the kij subproblems they spawned. We can use these kij subanswers to get the correct answers in constant time, however. For each bad triplet (X/, Zij, Yj), we need to compute, for every pair u e Xi and v e Yj, the minimum among /:/,y entries. We do so by using kijh^^^ processors for each such pair u e Xi and i; e Yj (this is enough, since we are then computing the minimum of kij entries using ^ ki~^ ' processors). Since there are 1^1^ such u, V pairs per bad triplet, the total work done for this "bad triplet postprocessing" is upperbounded by i'^^^h^^^ J2i / ^ij '•> ^^^^ since ^l/3_i
H^^^j =
E
^l/3_i
E^'''+/^ ^
E
i^h/i^^')=o(h/i),
this work is 0(l'^^^h^f^h/i) = 0(M) (where the fact that h^i^ was used). The bottom of the recursion is as usual: We stop when t is some small enough constant (note that, by the aspect ratio condition, a constant t implies a constant h, since h ^ l^). Analysis of the above shows that the time complexity satisfies T(l, h) = 0(loglog£), and the work complexity satisfies W(l, h)0((lh + f)(\ogl)^). The above algorithm does too much work. We refer the reader to [27] for a solution that uses the above algorithm to achieve an optimal amount of work without requiring any aspect ration condition.
Deterministic parallel computational geometry
187
10.3. Generalized monotone matrices Aggarwal et al. [7] considered some generalizations of monotone matrices. An m x n array A is called staircase monotone if the following conditions hold: 1. Every entry of A is either a real number or oo. 2. A[/, 7] = 00 implies that A[i, /] = 00 for all / with / > 7, and A[k, 7] = 00 for all k with k > i. 3. For any 1 < z < ^ ^ m and 1 ^ 7 < / < n, A[i, 7] + A[k, I] < A[/, /] + A[k, j] if all the four entries involved are finite. Clearly, monotone matrices are a special case of staircase monotone matrices. It was indicated in [71 that staircase monotone matrices, like monotone matrices, appear in numerous applications (see [7] for references). Efficient parallel algorithms for computing rowmaxima in n x n staircase monotone matrices were presented in [7]. In particular, the algorithms take O(logn) time and n processors on the CRCW PRAM, and O (log n log log n) time and n/loglogn processors on the CREW PRAM. Using these parallel rowmaxima algorithms for twodimensional staircase monotone matrices, several geometric problems were solved efficiently, such as the largestarea empty rectangle among points contained in a given rectangle, the nearestvisible neighbors or farthestvisible neighbors between two nonintersecting convex polygons, and other related problems [7]. 11. Other useful PRAM techniques There are other geometric techniques on the PRAM that we did not describe in detail, yet are also very useful. In particular, the following techniques are noteworthy. 11.1. Geometric hierarchies The paradigm of geometric hierarchies has proved extremely useful and general in computational geometry, both sequential [157,116118] and parallel [100,99]. Generally speaking, the method consists of building a sequence of descriptions of the geometric objects under consideration, where an element of the sequence is simpler and smaller (by a constant factor) than its predecessor, and yet "close" enough that information about it can be used to obtain in constant time information about the predecessor. This "information" could be, for example, the location of a query point in the planar subdivision, assuming that the elements of the sequence are progressively simpler subdivisions of the plane (in that case, pointers exist between faces of a subdivision and those of its predecessor — these pointers are part of the data structure representing the sequence of subdivisions). This technique turns out to be useful for other models than the PRAM. 11.2. From CREW to EREW In order to turn a CREW PRAM algorithm into an EREW PRAM one, one needs to get rid of the read conflicts, the simultaneous reading from the same memory cell by many
188
MJ. Atallah and D.Z. Chen
processors. Such read conflicts often occur in the conquer stage, and can take the form of concurrent searching of a data structure by many processors (e.g., see [36,68,71]). To avoid read conflicts during such concurrent searching, the scheme of [190] can be helpful: LEMMA 11.1 (Paul, Vishkin, Wagener). Suppose T is a 23 tree with m leaves, suppose a\, a2, . . . , ak are data items that may or may not be stored in {the leaves of) T, and suppose each processor Pj wants to search for aj in T, j = 1,2,.. .,k. Then in 0(logm + log k) time, the k processors can perform their respective searches without read conflicts.
Many types of searches can be accommodated by the above lemma. The following tends to occur in geometric applications: • Type 1: Searching for a particular item in the tree, and • Type 2: Searches of the type "find the tih item starting from item p in the tree". The search tree need not be a 23 tree: The requirements for the concurrent searching scheme of [190] to be applicable are that (i) each node of the tree has 0(1) children, and (ii) the k searches should be "sortable" according to their ranks in the sorted order of the leaves of the tree. (The scheme of [190] has other requirements, but they are needed only for the concurrent insertions and deletions that it can also handle, not for searching.) Requirement (i) is usually satisfied in geometric applications. Requirement (ii) is also clearly satisfied for the searches of Type 1. It can be made to be satisfied for searches of Type 2 by sorting the queries according to the leaf orders of their targets (this requires first doing a search of Type 1 to determine the leaf order of /?).
11.3. Arrayoftrees The arrayoftrees data structure was originally developed in a nongeometric framework [47] for designing parallel algorithms, and was later generalized in [133,140] for parallelizing a number of sweeping algorithms for geometric problems. The arrayoftrees data structure can be viewed as a parallel version of the persistence paradigm of Driscoll et al. [121]. Suppose a sequence Sofn operations is to be performed in an online fashion, and S contains m ^n setmodifying operations (e.g., insert, delete, extractminimum, etc.). The idea in [47] is to maintain m relevant "snapshots" of a sequential data structure for evaluating S online, with O(logm) time per operation. Of course, storing explicitly the m copies of the sequential data structure (with one copy for each setmodifying operation) would be very expensive. Hence, a single "compressed" structure T for the m logical data structures is used, such that this structure can be built and processed in O(logm) time with m processors. Actually, the structure T can be considered as an array of m trees that share nodes, such that the tth tree stores the information that is present right after the tth setmodifying operation in S is performed (hence the name "arrayoftrees"). T is represented as a complete binary tree with m leaves. A node of T, called a supernode, contains a number of minornodes that are nodes of the m individual trees represented by T. The arrayoftrees data structures were generalized in [133,140], becoming a general technique for parallelizing sweeping algorithms for geometric problems. Note that the
Deterministic parallel computational geometry
189
"sweeping" paradigm has been widely used in designing sequential geometric algorithms [124,165,193]. The arrayoftrees based parallel methods in [133,140] address those geometric problems for which the sweeping can be described either as a single sequence of data operations or as a related collection of operation sequences. These methods establish efficient parallel bounds for a number of geometric problems, such as computing the intersections of line segments in the plane [133], several types of hiddensurface elimination, CSG evaluation, and construction of the contour of a collection of rectangles [140].
11.4. Deterministic geometric sampling A general type of geometric structure that has proven very useful in designing efficient randomized as well as deterministic geometric algorithms is the geometric partition (e.g., see [82,84,148]). The general framework is that given a collection X of n geometric objects in the 2 [138,142], intersections of planar line segments [19], arrangements of lines and hyperplanes [135], lower envelope of constant degree algebraic functions of one variable [196], various Voronoi diagrams [22,196], etc. More interestingly, the parallel geometric algorithms based on deterministic geometric sampling techniques often are also efficient in the sense of being outputsensitive (see Subsection 11.5 for more discussion of this type of parallel geometric algorithms).
11.5. Outputsensitive algorithms Parallel outputsensitive algorithms are those whose complexity bounds depend on not only the size of the input but also the size of the output. For example, when computing the
190
M.J. Atallah and D.Z. Chen
intersections of n line segments in the plane, the time and number of processors used by an algorithm may depend on n as well as the number of the actual intersections between the given line segments [19,133,202]. There have been quite a few interesting deterministic outputsensitive PRAM algorithms for geometric problems. Notable examples of such algorithms are 3dimensional convex hull [18], intersections of planar line segments [19, 133,202], lower envelope of constant degree algebraic functions of one variable [196], various Voronoi diagrams [22,196], rectilinear hiddensurface elimination [140], contour construction for a collection of rectangles [140], construction of the visibility graph of a simple polygon [143], etc. The above parallel outputsensitive geometric algorithms are in general based on the paradigm that the pool of virtual processors (in a slightly different PRAM model) can grow as the computation progresses, provided that the processor allocation happens globally [133,202], In this paradigm, r new processors are allowed to be allocated in time t only if an relement array that stores pointers to the r tasks on which these new processors are to begin performing in time r + 1 has been constructed. This PRAM model is essentially the same as the "standard" PRAM, with the exception that in the "standard" PRAM, processors are requested and allocated only once (at the beginning of the computation).
11.6. Stratified decomposition trees The stratified decomposition tree was used in [143] for solving efficiently in parallel visibility and shortest path problems on a simple polygon. These polygon problems include shortest path queries, visibility from an edge, visibility graph, finding the convex rope, finding allfarthest neighbors, etc. [143]. Given a triangulation of an «vertex simple polygon P, let T be a centroid decomposition tree of the graphtheoretic planar dual of the triangulation (the centroid decomposition tree T can be constructed from the triangulation of P in 0(log/i) time and n/\ogn processors [91]). The tree T represents a decomposition of P into subpolygons. Let J be a chosen integer parameter. A contraction operation is first performed on T, such that for each node vofT, the subtree Ty of T rooted at v is "contracted" into a single node at v if and only if the subtree T^ of T rooted at every child w; of i; has less than d vertices but Ty has at least d vertices. Let T^^ be the contracted tree obtained from T. Then mark every vertex vofT^^ if f is at a level / * J of T'^ for / = 0, 1,..., or if i; is a leaf of T'\ Let the marked vertices form a "compressed" version S{T") of T" based on their ancestordescendant relation in T'\ The tree S{T'') so obtained is the stratified decomposition tree for P (the name "stratified decomposition tree" refers to the "layering" of the marked vertices in T^O By storing appropriate information about certain shortest paths in the subpolygons associated with the vertices of S(T"), the stratified decomposition tree can be used for answering shortest path queries in P and for solving other problems [143]. By choosing d = r \\og^ n'\ for a certain constant r, the stratified decomposition tree can be built in O(logw) time using n/\ogn CREW PRAM processors [143].
Deterministic parallel computational geometry
191
11.7. Pruneandsearch Pmneandsearch techniques have been used by many sequential geometric algorithms [193]. In parallel, Cole [86] gave an efficient pruneandsearch algorithm for solving the selection problem [57,95] on the EREW PRAM. Cole's parallel selection algorithm takes 0(logn log* n) time and O(^) work. When the ^th smallest element is to be selected from an nelement set S, Cole's algorithm [86] performs the following main steps: 1. Use k to find in S two "good" approximations to the ^th smallest element with ranks k\ and k2 respectively, such that k\ ^k ^k2 and k2 — k\ is sufficiently small. 2. Eliminate from S all the elements whose ranks are not in the range of [^i, ^2], and recursively solve the problem on the remaining elements in S. 3. When \S\ is 0{n/\ogn), use Cole's parallel merge sort [87] to finish the selection. Cole's selection algorithm consists of 0(log*n) recursion levels, with O(logn) time per level. A key feature of Cole's parallel selection algorithm is that the approximations are determined based on an already known rank k. But, this feature could limit the applicability of Cole's parallel pruneandsearch technique. For certain problems such as twovariable linear programming [122,174] and weighted selection [95], finding in parallel good approximations based on rank information as in [86] can be difficult, since useful rank information is not as readily available as for the selection problem. Actually, an EREW PRAM algorithm for twovariable linear programming can be obtained by a straightforward parallelization of a sequential pruneandsearch algorithm [122, 174]: Select the median of the candidate elements, eliminate a constant fraction of these elements, and recurse on the remaining elements. By using Cole's EREW PRAM algorithm for approximate median selection [86], one can simulate in parallel this sequential pruneandsearch procedure, until the number of the remaining elements is 0{n/ logn) (at that point, one can simply apply a parallel algorithm for computing common intersection of halfplanes such as [71]). Such a parallel pruneandsearch algorithm for twovariable linear programming takes 0(log/z loglog^) time and Oin) work on the EREW PRAM. In fact, Deng [113] gave an O(logn) time, 0(n) work algorithm on the CRCW PRAM for twovariable linear programming that is based on such a parallelization of the sequential pruneandsearch procedure. A more general parallel pruneandsearch technique was recently developed in [78]. This technique is different from Cole's [86] in that it does not depend on any given rank information. This new parallel pruneandsearch technique has led to 0(logn log* n) time, 0{n) work algorithms for twovariable linear programming and other problems on the EREW PRAM. This is an improvement over the EREW PRAM algorithms of [123,142] when applied to the twovariable case (the algorithms in [123,142] are based on more sophisticated parallel techniques). A key procedure used in the pruneandsearch algorithms [78] is the parallel algorithm of Chen et al. for partitioning sorted sets [75]. 12. Further remarks In addition to the open problems in parallel computational geometry that we already mentioned earlier, the following open problems are likely to receive attention in the future:
192
MJ. Atallah and D.Z. Chen
• 0(log n) time, optimalwork deterministic construction on the CREW or EREW PRAM for Voronoi diagrams in the plane. The current best parallel bounds are 0(log n log log n) time and j ^ ^ CREW PRAM processors [89], or 0(log^ n) time and n/logn EREW PRAM processors [22,196]. • O(logn) time, optimalwork deterministic construction on the CREW or EREW PRAM for 3dimensional convex hull. The current best parallel bounds are 0(logn) time and 0(«^+^) work on the CREW PRAM [21] (for any constant e > 0), or O(log^n) time and 0(n logn) work on the EREW PRAM [18,136]. • 0(\ogn) time, optimalwork deterministic EREW PRAM solutions for linear programming in any fixed dimension d ^ 2. The current best EREW PRAM bounds are 0(logn log* n) time and 0(n) work for J = 2 [78], and 0(logn(loglog/i)^~^) time and 0(n) work for any fixed J > 3 [142]. • 0(log n) time, optimalwork deterministic EREW PRAM solution for the row minima in ann xn totally monotone matrix. The current best EREW PRAM bounds are O(logn) time and 0(n\ogn) work [46] (and O(logn) time and 0(n) work, but a randomized solution [195]). The following are additional promising directions for future research: • Outputsensitive PRAM algorithms. Most geometric problems remain open when being looked at from the parallel outputsensitive perspective, that is, time and work optimal algorithms are yet to be found. This is the case with the known deterministic outputsensitive PRAM solutions [18,19,22,133,140,143,196,202]. Recently, there are also several randomized outputsensitive PRAM algorithms [83,127,134,146,196]. • Robust parallel algorithms. Recall that robust algorithms are such that their correctness is not destroyed by roundoff errors. Most existing parallel geometric algorithms misbehave if implemented with rounded arithmetic. There has been recently an increasing interest in designing efficient and robust sequential algorithms for geometric problems (see [169] for a list of references), and it is natural for this activity to spread to the design of parallel geometric algorithms as well.
References [1] K. Abrahamson, N. Dadoun, D.A. Kirkpatrick and T. Przytycka, A simple parallel tree contraction algorithm, J. Algorithms 10 (1989), 287302. [2] P.K. Agarwal, A deterministic algorithm for partitioning arrangements of lines and its applications, Proc. 5th Annual ACM Symp. on Computational Geometry (1989), 1122. [3] P.K. Agarwal, Intersection and Decomposition Algorithms for Planar Arrangements, Cambridge University Press, New York (1991). [4] A. Aggarwal, B. Chazelle, L. Guibas, C. O'Dunlaing and C. Yap, Parallel computational geometry, Algorithmica 3 (1988), 293328. [5] A. Aggarwal and M.D. Huang, Network complexity of sorting and graph problems and simulating CRCW PRAMS by interconnection networks. Lecture Notes in Comput. Sci. 319: VLSI Algorithms and Architectures, 3rd Aegean Workshop on Computing, SpringerVerlag (1988) 339350. [6] A. Aggarwal, M.M. Klawe, S. Moran, P. Shor and R. Wilber, Geometric applications of a matrix searching algorithm, Algorithmica 2 (1987), 209233. [7] A. Aggarwal, D. Kravets, J.K. Park and S. Sen, Parallel searching in generalized Monge arrays with applications, Proc. 2nd ACM Symp. Parallel Algorithms and Architectures (1990), 259268.
Deterministic parallel computational
geometry
193
[8] A. Aggarwal and J. Park, Parallel searching in multidimensional monotone arrays, Proc. 29th Annual IEEE Symp. on Foundations of Computer Science (1988), 497512. (To appear in J. Algorithms.) [9] A. Aggarwal, B. Schieber and T. Tokuyama, Finding a minimum weight klinkpath in graphs with Monge property and applications, Proc. 9th Annual Symp. on Computational Geometry (1993), 189197. [10] A. Aggarwal and S. Suri, Fast algorithms for computing the largest empty rectangle, Proc. 3rd ACM Symp. on Computational Geometry (1987), 278290. [11] A. Aggarwal and J.S. Vitter, The input/output complexity of sorting and related problems, Comm. ACM 31(1988), 11161127. [12] M. Ajtai, J. Komlos and E. Szemeredi, Sorting in clogn parallel steps, Combinatorica 3 (1983), 119. [13] M. Ajtai and N. Megiddo, A deterministic Poly(loglogN)time Nprocessor algorithm for linear programming in fixed dimension, SIAM J. Comput. 25 (1996), 11711195. [14] S.G. Akl, A constanttime parallel algorithm for computing convex hulls, BIT 22 (1982), 130134. [15] S.G. Akl and K.A. Lyons, Parallel Computational Geometry, PrenticeHall, Englewood Cliffs, NJ (1993). [16] N. Alon and N. Megiddo, Parallel linear programming infixed dimension almost surely in constant time, Proc. 31st Annual IEEE Symp. on Foundation of Computer Science (1990), 574582. [17] N.M. Amato, Finding a closest visible vertex pair between two polygons, Algorithmica 14 (1985), 183201. [18] N.M. Amato, M.T. Goodrich and E.A. Ramos, Parallel algorithms for higherdimensional convex hulls, Proc. 35th IEEE Symp. on Foundations of Computer Science (1994), 683694. [19] N.M. Amato, M.T. Goodrich and E.A. Ramos, Computing faces in segment and simplex arrangements, Proc. 27th ACM Symp. on Theory of Computing (1995), 672682. [20] N.M. Amato and F.P. Preparata, The parallel 3D convexhull problem revisited, Intemat. J. Comput. Geom. Appl. 2 (1992), 163174. [21] N.M. Amato and F.P. Preparata, A timeoptimal parallel algorithm for threedimensional convex hulls, Algorithmica 14 (1995), 169182. [22] N.M. Amato and E.A. Ramos, On computing Voronoi diagrams by dividepruneandconquer, Proc. 12th Annual ACM Symp. on Computational Geometry (1996), 166175. [23] R. Anderson, P. Beame and E. Brisson, Parallel algorithms for arrangements, Proc. 2nd ACM Symp. Parallel Algorithms and Architectures (1990), 298306. [24] R. Anderson and G.L. Miller, Deterministic parallel list ranking, Algorithmica 6 (1991), 859868. [25] A. Apostolico, M.J. Atallah, L. Larmore and H.S. McFaddin, Efficient parallel algorithms for string editing and related problems, SIAM J. Comput. 19 (1990), 968988. [26] M.J. Atallah, Parallel techniques for computational geometry. Proceedings of the IEEE 80 (1992), 14251448. [27] M.J. Atallah, A faster parallel algorithm for a matrix searching problem, Algorithmica 9 (1993), 156167. [28] M.J. Atallah, P. Callahan and M.T. Goodrich, Pcomplete geometric problems, Intemat. J. Comput. Geom. Appl. 3 (1993), 443^62. [29] M.J. Atallah and D.Z. Chen, Parallel rectilinear shortest paths with rectangular obstacles, Comput. Geom.: Theory and Applications 1 (1991), 79113. [30] M.J. Atallah and D.Z. Chen, On parallel rectilinear obstacleavoiding paths, Comput. Geom.: Theory and Applications 3 (1993), 307313. [31] M.J. Atallah and D.Z. Chen, Computing the allpairs longest chains in the plane, Intemat. J. Comput. Geom. Appl. 5 (1995), 257271. [32] M.J. Atallah and D.Z. Chen, Optimal parallel hypercube algorithms for polygon problems, IEEE Trans. Comput. 44 (1995), 914922. [33] M.J. Atallah and D.Z. Chen, Parallel computational geometry. Current and Future Trends in Parallel and Distributed Computing, A. Zomaya, ed.. International Thomson (1996), 162197. [34] M.J. Atallah, D.Z. Chen and O. Daescu, Efficient parallel algorithms for planar stgraphs, Proc. 8th Annual Int. Symp. on Algorithms and Computation (1997), 223232. [35] M.J. Atallah, D.Z. Chen and K.S. Klenk, Parallel algorithms for longest increasing chains in the plane and related problems, Proc. of the Ninth Canadian Conference on Computational Geometry (1997), 5964. [36] M.J. Atallah, D.Z. Chen and H. Wagener, An optimal parallel algorithm for the visibility of a simple polygon from a point, J. ACM 38 (1991), 516533.
194
M.J. Atallah and D.Z. Chen
[37] MJ. Atallah, R. Cole and M.T. Goodrich, Cascading divideandconquer: A technique for designing parallel algorithms, SIAM J. Comput. 18 (1989), 499532. [38] MJ. Atallah, F. Dehne, R. Miller, A. RauChaplin and J.J. Tsay, Multisearch techniques for implementing data structures on a meshconnected computer, J. Parallel Distribut. Comput. 20 (1994), 113. [39] M.J. Atallah and A. Fabri, On the multisearching problem for hypercubes. Technical Report 93029, Dept. of Computer Sciences, Purdue University (1993). [40] M.J. Atallah, G.N. Frederickson and S.R. Kosaraju, Sorting with efficient use of specialpurpose sorters. Inform. Process. Lett. 27 (1988), 1315. [41] M.J. Atallah and M.T. Goodrich, Efficient plane sweeping in parallel, Proc. 2nd Annual ACM Symp. on Computational Geometry, Yorktown Heights, New York (1986), 216225. [42] M.J. Atallah and M.T. Goodrich, Efficient parallel solutions to some geometric problems, J. Parallel Distribut. Comput. 3 (1986), 492507. [43] M.J. Atallah and M.T. Goodrich, Parallel algorithms for some functions of two convex polygons, Algorithmica 3 (1988), 535548. [44] M.J. Atallah and S.E. Hambrusch, Solving tree problems on a meshconnected processor array. Inform, and Control 69 (1986), 168187. [45] M.J. Atallah, S.E. Hambrusch and L.E. TeWinkel, Parallel topological sorting of features in a binary image, Algorithmica 6 (1991), 762769. [46] M.J. Atallah and S.R. Kosaraju, An efficient parallel algorithm for the row minima of a totally monotone matrix, J. Algorithms 13 (1992), 394^13. [47] M.J. Atallah, S.R. Kosaraju and M.T. Goodrich, Parallel algorithms for evaluating sequences of set manipulation operations, J. ACM 41 (1994), 10491088. [48] M.J. Atallah, S.R. Kosaraju, L. Larmore, G.L. Miller and S. Teng, Constructing trees in parallel, Proc. 1st Annual ACM Symp. on Parallel Algorithms and Architectures, Santa Fe, New Mexico (1989), 421431. [49] M.J. Atallah and J.J. Tsay, On the paralleldecomposibility of geometric problems, Algorithmica 8 (1992), 209231. [50] R. Beigel and J. Gill, Sorting n objects with a ksorter, IEEE Trans. Comput. 39 (1990), 714716. [51] B. Berger, J. Rompel and P.W. Shor, Efficient NC algorithms for set cover with applications to learning and geometry, Proc. 30th Annual IEEE Symp. Found. Comput. Sci. (1989), 54^59. [52] O. Berkman, B. Schieber and U. Vishkin, A fast parallel algorithm for finding the convex hull of a sorted point set, Intemat. J. Comput. Geom. Appl. 6 (1996), 231242. [53] P. Bertolazzi, C. Guerra and S. Salza, A parallel algorithm for the visibility problem from a point, J. Parallel Distribut. Comput. 9 (1990), 1114. [54] G. Bilardi and A. Nicolau, Adaptive bitonic sorting: An optimal parallel algorithm for shared memory machines, SIAM J. Comput. 18 (1989), 216228. [55] G.E. Blelloch, Scans as primitive parallel operations, Proc. Int. Conf. on Parallel Processing (1987), 355362. [56] G.E. Blelloch, Scan primitives and parallel vector models, PhD thesis, Massachusetts Institute of Technology (1988). [57] M. Blum, R.W. Floyd, V.R. Pratt, R.L. Rivest and R.E. Tarjan, Time bounds for selection, J. Comput. System Sci. 7 (1973), 448461. [58] A. Borodin and I.E. Hopcroft, Routing, merging, and sorting on parallel models of computation, J. Comput. System Sci. 30 (1985), 130145. [59] L. Boxer and R. Miller, Dynamic computational geometry on meshes and hypercubes, J. Supercomputing 3(1989), 161191. [60] R.P Brent, The parallel evaluation of general arithmetic expressions, J. ACM 21 (1974), 201206. [61] P.B. Callahan, Optimal parallel allnearestneighbors using the wellseated pair decomposition, Proc. 34th Annual IEEE Sympos. Found. Comput. Sci. (1993), 332340. [62] V. Chandru, S.K. Ghosh, A. Maheshwari, V.T Rajan and S. Saluja, NCalgorithms for minimum link path and related problems, J. Algorithms 19 (1995), 173203. [63] B.M. Chazelle, On the convex layers of the planar set, IEEE Trans. Inform. Theory IT31 (1985), 509517. [64] B.M. Chazelle, Computational geometry on a systolic chip, IEEE Trans. Comput. C33 (1984), 774785. [65] B.M. Chazelle and D.P Dobkin, Intersection of convex objects in two and three dimensions, J. ACM 34 (1987), 127.
Deterministic parallel computational
geometry
195
[66] B.M. Chazelle and J. Friedman, A deterministic view of random sampling and its use in geometry, Combinatorica 10 (1990), 229249. [67] B.M. Chazelle and L.J. Guibas, Fractional cascading: I. A data structuring technique, Algorithmica 1 (1986), 133162. [68] D.Z. Chen, Parallel techniques for paths, visibility and related problems, PhD thesis. Technical Report 92051, Department of Computer Sciences, Purdue University (July 1992). [69] D.Z. Chen, Determining weak external visibility of polygons in parallel, Proc. 6th Canadian Conf. on Computational Geometry (1994), 375380. [70] D.Z. Chen, Optimal hypercube algorithms for triangulating classes of polygons and related problems, Proc. 7th Int. Conf. on Parallel and Distributed Computing Systems (1994), 174179. [71] D.Z. Chen, Efficient geometric algorithms on the EREWPRAM, IEEE Trans. Parallel Distribut. Systems 6 (1995), 41^7. [72] D.Z. Chen, An optimal parallel algorithm for detecting weak visibility of a simple polygon. Internal. J. Comput. Geom. Appl. 5 (1995), 93124. [73] D.Z. Chen, Optimally computing the shortest weakly visible subedge of a simple polygon, J. Algorithms 20 (1996), 459^78. [74] D.Z. Chen, Determining weak visibility of a polygon from an edge in parallel. Internal. J. Comput. Geom. Appl., to appear. [75] D.Z. Chen, W. Chen, K. Wada and K. Kawaguchi, Parallel algorithms for partitioning sorted sets and related problems, Proc. 4th Annual European Symp. on Algorithms (1996), 234245. [76] D.Z. Chen and S. Guha, Testing a simple polygon for monotonicity optimally in parallel. Inform. Process. Lett. 47(1993), 325331. [77] D.Z. Chen and X. Hu, Efficient approximation algorithms for fioorplan area minimization, Proc. of 33rd ACM/IEEE Design Automation Conf. (1996), 483^86. [78] D.Z. Chen and J. Xu, Twovariable linear programming in parallel (1998), submitted. [79] W. Chen, K. Wada and K. Kawaguchi, Parallel robust algorithms for constructing strongly convex hulls, Proc. 12th Annual ACM Symp. on Computational Geometry (1996), 133140. [80] W. Chen, K. Wada, K. Kawaguchi and D.Z. Chen, Finding the convex hull of discs in parallel, Internat. J. Comput. Geom. Appl., to appear. [81] A. Chow, Parallel Algorithms for Geometric Problems, PhD thesis, Computer Science Dept., University of Illinois at UrbanaChampaign (1980). [82] K.L. Clarkson, New applications of random sampling in computational geometry. Discrete Comput. Geom. 2 (1987), 195222. [83] K.L. Clarkson, R. Cole and R.E. Tarjan, Randomized parallel algorithms for trapezoidal diagrams, Internat. J. Comput. Geom. Appl. 2 (1992), 117133. [84] K.L. Clarkson and P. W. Shor, Applications of random sampling in computational geometry, II, Discrete Comput. Geom. 4 (1989), 387^21. [85] E. Cohen, R. Miller, E.M. Sarraf and Q.F. Stout, Efficient convexity and domination algorithms for fineand mediumgrain hypercube computers, Algorithmica 7 (1992), 5175. [86] R.J. Cole, An optimally efficient selection algorithm. Inform. Process. Lett. 26 (1987/1988), 295299. [87] R. Cole, Parallel merge sort, SIAM J. Comput. 17 (1988), 1107^5. [88] R. Cole and M.T. Goodrich, Optimal parallel algorithms for pointset and polygon problems, Algorithmica 7 (1992), 323. [89] R. Cole, M.T. Goodrich and C. O'Diinlaing, A nearly optimal deterministic parallel Voronoi diagram algorithm, Algorithmica 16 (1996), 569617. [90] R. Cole and U. Vishkin, Approximate and exact parallel scheduling with applications to list, tree and graph problems, Proc. 27th Annual IEEE Symp. on Foundations of Comp. Sci. (1986), 4 8 7 ^ 9 1 . [91] R. Cole and U. Vishkin, The accelerated centroid decomposition technique for optimal parallel tree evaluation in logarithmic time, Algorithmica 3 (1988), 329346. [92] R. Cole and U. Vishkin, Faster optimal parallel prefix sums and list ranking. Inform, and Control 81 (1989), 334352. [93] R. Cole and O. Zajicek, An optimal parallel algorithm for building a data structure for planar point location, J. Parallel Distribut. Comput. 8 (1990), 280285.
196
MJ. Atallah and D.Z. Chen
[94] S. Cook and C. Dwork, Bounds on the time for parallel RAM's to compute simple functions, Proc. 14th ACM Annual Symp. on Theory of Computing (1982), 231233. [95] T.H. Coraien, C.E. Leiserson and R.L. Rivest, Introduction to Algorithms, McGrawHill (1990). [96] R. Cypher and C.G. Plaxton, Deterministic sorting in nearly logarithmic time on the hypercube and related computers, J. Comput. System Sci. 47 (1993), 501548. [97] R. Cypher and J.L.C. Sanz, Optimal sorting on feasible parallel computers, Proc. International Conference on Parallel Processing (1988), 339350. [98] J. Czyzowicz, I. Rival and J. Urrutia, Galleries, light matchings and visibility graphs, Proc. Workshop on Algorithms and Data Structures, Lecture Notes in Comput. Sci. 382, SpringerVerlag (1989), 316324. [99] N. Dadoun, Geometric hierarchies and parallel subdivision search, PhD thesis, U. of British Columbia (1990). 100] N. Dadoun and D. Kirkpatrick, Parallel processing for efficient subdivision search, Proc. 3rd ACM Symp. Computational Geom. (1987), 205214. 101] N. Dadoun and D. Kirkpatrick, Parallel construction of subdivision hierarchies, J. Comput. System Sci. 39 (1989), 153165. 102] A. Datta, A. Maheshwari and J.R. Sack, Optimal parallel algorithms for direct dominance problems, Nordic J. Comput. 3 (1996), 7187. 103] M. de Berg, M. van Kreveld, M. Overmars and O. Schwartzkopf, Computational Geometry: Algorithms and Applications, SpringerVerlag (1997). 104] F. Dehne, Solving visibility and separability problems on a mesh of processors. The Visual Computer 3 (1988), 356370. 105] F. Dehne, Computing the largest empty rectangle on one and two dimensional processor arrays, J. Parallel Distribut. Comput. 9 (1990), 6368. 106] F. Dehne, A. Fabri and A. RauChaplin, Scalable parallel computational geometry for coarse grained multicomputers, Intemat. J. Comput. Geom. Appl. 6 (1996), 379400. 107] F. Dehne, A. Ferreira and A. RauChaplin, Parallel fractional cascading on a hypercube multiprocessor, Comput. Geom.: Theory and Applications 2 (1992), 141167. 108] F. Dehne, A.L. Hassenklover and J.R. Sack, Computing the configuration space for a robot on a mesh of processors. Parallel Comput. 12 (1989), 221231. 109] F. Dehne, A.L. Hassenklover, J.R. Sack and N. Santoro, Computational geometry algorithms for the systolic screen, Algorithmica 6 (1991), 734—761. 110] F Dehne and A. RauChaplin, Implementing data structures on a hypercube multiprocessor, with applications in parallel computational geometry, J. Parallel Distribut. Comput. 8 (1990), 367375. I l l ] F. Dehne, J.R. Sack and I. Stojmenovic, A note on determining the ?>dimensional convex hull of a set of points on a mesh ofprocessors, Proc. Scandinavian Workshop on Algorithms and Theory (1988), 154162. 112] F. Dehne and I. Stojmenovic, An O(yrt) time algorithm for the ECDF searching problem for arbitrary dimensions on a mesh of processors. Inform. Process. Lett. 28 (1988), 6770. 113] X. Deng, An optimal parallel algorithm for linear programming in the plane. Inform. Process. Lett. 35 (1990), 213217. 114] A. Dessmark, A. Lingas and A. Maheshwari, Multilist ranking: Complexity and applications, Theoret. Comput. Sci. 141 (1995), 337350. 115] O. Devillers and A. Fabri, Scalable algorithms for bichromatic line segment intersection problems on coarse grained multicomputers, Intemat. J. Comput. Geom. Appl. 6 (1996), 487506. 116] D.P. Dobkin and D.G. Kirkpatrick, Fast detection of polyhedral intersections, Theoret. Comput. Sci. 27 (1983), 241253. 117] D.P. Dobkin and D.G. Kirkpatrick, A linear time algorithm for determining the separation of convex polyhedra, J. Algorithms 6 (1985), 381392. 118] D.P. Dobkin and D.G. Kirkpatrick, Determining the separation of preprocessed polyhedra — a unified approach, Proc. of the Int. CoUoq. on Automata, Lang, and Programming (1990), 154—165. 119] D.P. Dobkin, R.J. Lipton and S. Reiss, Linear programming is logspace hard for P, Inform. Process. Lett. 9 (1979), 9697. 120] D.P Dobkin and S. Reiss, The complexity of linear programming, Theoret. Comput. Sci. 11 (1980), 118. 121] J.R. DriscoU, N. Samak, D.D. Sleator and R.E. Tarjan, Making data structures persistent, Proc. 18th Annual ACM Symp. on Theory of Computing (1986), 109121.
Deterministic parallel computational
geometry
197
[122] M.E. Dyer, Linear time algorithms for two and threevariable linear programs, SIAM J. Comput. 13 (1984), 3 1 ^ 5 . [123] M.E. Dyer, A parallel algorithm for linear programming infixed dimension, Proc. 11th Annual Symp. on Computational Geometry (1995), 345349. [124] H. Edelsbrunner, Algorithms in Combinatorial Geometry, SpringerVerlag, New York (1987). [125] H. ElGindy and M.T. Goodrich, Parallel algorithms for shortest path problems in polygons. The Visual Computer 3 (1988), 371378. [126] G.N. Frederickson and D.B. Johnson, The complexity of selection and ranking in X {Y and matrices with sorted columns, J. Comput. System Sci. 24 (1982), 197208. [127] M. Ghouse and M.T. Goodrich, Fast randomized parallel methods for planar convex hull construction, Comput. Geom.: Theory and Applications, to appear. [128] A. Gibbons and W. Rytter, An optimal parallel algorithm for dynamic expression evaluation and its applications, Proc. Symp. on Found, of Software Technology and Theoretical Comp. Sci., SpringerVerlag (1986), 453^69. [129] L.M. Goldschlager, The monotone and planar circuit value problems are log space complete for P, SIGACT News 9 (1977), 2529. [ 130] M.T. Goodrich, Efficient parallel techniques for computational geometry, PhD thesis. Department of Computer Sciences, Purdue University (1987). [131] M.T. Goodrich, Finding the convex hull of a sorted point set in parallel. Inform. Process. Lett. 26 (1987), 173179. [132] M.T. Goodrich, Triangulating a polygon in parallel, J. Algorithms 10 (1989), 327351. [133] M.T. Goodrich, Intersecting line segments in parallel with an outputsensitive number ofprocessors, SIAM J. Comput. 20 (1991), 737755. [134] M.T. Goodrich, Using approximation algorithms to design parallel algorithms that may ignore processor allocation, Proc. 32nd IEEE Symp. on Foundations of Computer Science (1991), 711722. [135] M.T. Goodrich, Constructing arrangements optimally in parallel. Discrete Comput. Geom. 9 (1993), 371385. [136] M.T. Goodrich, Geometric partitioning made easier, even in parallel, Proc. 9th Annual ACM Symp. Computational Geometry (1993), 7382. [137] M.T. Goodrich, Planar separators and parallel polygon triangulation, J. Comput. System Sci. 51 (1995), 374389. [138] M.T. Goodrich, Fixeddimensional parallel linear programming via relative Epsilonapproximations, Proc. 7th Annual ACMSIAM Symp. Discrete Algorithms (1996), 132141. [139] M.T. Goodrich, Parallel computational geometry, CRC Handbook of Discrete and Computational Geometry, I.E. Goodman and J. O'Rourke, eds, CRC Press, Inc. (1997), 669682. [140] M.T. Goodrich, M. Ghouse and J. Bright, Sweep methods for parallel computational geometry, Algorithmica 15, 126153. [141] M.T. Goodrich, C. O'Dunlaing and C. Yap, Computing the Voronoi diagram of a set of line segments in parallel, Algorithmica 9 (1993), 128141. [142] M.T. Goodrich and E.A. Ramos, Boundedindependence derandomization of geometric partitioning with applications to parallel fixeddimensional linear programming. Discrete Comput. Geom., to appear. [143] M.T. Goodrich, S.B. Shauck and S. Guha, Parallel method for visibility and shortest path problems in simple polygons, Algorithmica 8 (1992), 461^86. [144] S. Guha, Parallel computation of internal and external farthest neighbours in simple polygons, Intemat. J. Comput. Geom. Appl. 2 (1992), 175190. [145] S. Guha, Optimal mesh computer algorithms for simple polygons, Proc. 7th International Parallel Processing Symp., Newport Beach, California (April 1993), 182187. [146] N. Gupta and S. Sen, Faster outputsensitive parallel convex hulls for d ^3: Optimal sublogarithmic algorithms for small outputs, Proc. 12th Annual ACM Symp. Computational Geometry (1996), 176185. [147] T. Hagerup and C. Riib, Optimal merging and sorting on the EREWPRAM, Inform. Process. Lett. 33 (1989), 181185. [148] D. Haussler and E. Welzl, Epsilonnets and simplex range queries. Discrete Comput. Geom. 2 (1987), 127151.
198
M.J. Atallah and D.Z. Chen
[149] J. Hershberger, Upper envelope onion peeling, Proc. 2nd Scandinavian Workshop on Algorithm Theory, SpringerVerlag (1990), 368379. [150] J. Hershberger, Optimal parallel algorithms for triangulated simple polygons, Proc. 8th Annual ACM Symp. Computational Geometry (1992), 3 3 ^ 2 . [151] J.A. Holey and O.H. Ibarra, Triangulation in a plane and 3d convex hull on meshconnected arrays and hypercubes. Tech. Rep., University of Minnesota, Dept. of Computer Science (1990). [152] J.W. Hong and H.T. Kung, I/O complexity: The redblue pebble game, Proc. 13th Annual ACM Symp. on Theory of Computing (1981), 326333. [153] J. Jaja, An Introduction to Parallel Algorithms, AddisonWesley, Reading, MA (1992). [154] C.S. Jeong and D.T. Lee, Parallel geometric algorithms for a meshconnected computer, Algorithmica 5 (1990), 155177. [155] S.L. Johnsson, Combining parallel and sequential sorting on a Boolean ncube, Proc. International Conf. on Parallel Processing (1984), 444448. [156] R.M. Karp and V. Ramachandran, Parallel algorithms for sharedmemory machines. Handbook of Theoretical Computer Science, J. van Leeuwen, ed.. Vol. 1, Elsevier Science Publishers (1990). [157] D.G. Kirkpatrick, Optimal search in planar subdivisions, SIAM J. Comput. 12 (1983), 2835. [158] S.R. Kosaraju and A. Delcher, Optimal parallel evaluation of treestructured computations by raking. Lecture Notes in Comput. Sci. 319: VLSI Algorithms and Architectures, 3rd Aegean Workshop on Computing, SpringerVerlag (1988), 101110. [159] C.R Kruskal, L. Rudolph and M. Snir, The power of parallel prefix, IEEE Trans. Comput. C34 (1985), 965968. [160] C.R Kruskal, L. Rudolph and M. Snir, A complexity theory of efficient parallel algorithms. Lecture Notes in Comput. Sci. 317, Proc. 15th Coll. on Autom., Lang, and Prog., SpringerVerlag (1988), 333346. [161] V. Kumar and V. Sinch, Scalability ofparallel algorithms for the allpairs shortestpath problem, J. Parallel Distribut. Comput. 13 (1991), 124138. [162] M. Kunde, Optimal sorting on multidimensional meshconnected computers, Proc. 4th Symp. on Theoretical Aspects of Computer Science, Lecture Notes in Comput. Sci., Springer (1987), 408^19. [163] H.T. Kung, F. Luccio and F.P. Preparata, On finding the maxima of a set of vectors, J. ACM 22(4) (1975), 469^76. [164] R.E. Ladner and M.J. Fischer, Parallel prefix computation, J. ACM 27 (1980), 831838. [165] D.T. Lee and F.P. Preparata, Computational geometry — a survey, IEEE Trans. Comput. C33 (1984), 8721101. [166] D.T. Lee, F.P. Preparata, C.S. Jeong and A.L. Chow, SIMD parallel convex hull algorithms. Tech. Rep. AC9102, Northwestern University, Dept. of Electrical Eng. and Computer Science (1991). [167] F.T. Leighton, An Introduction to Parallel Algorithms and Architectures: Arrays, Trees, Hypercubes, Morgan Kaufmann Publishers, San Mateo, CA (1992). [168] C. Levcopoulos, J. Katajainen and A. Lingas, An optimal expected time algorithm for Voronoi diagrams, Proc. 1st Scandinavian Workshop on Algorithm Theory, SpringerVerlag (1988). [169] Z. Li and V. Milenkovic, Constructing strongly convex hulls using exact or rounded arithmetic, Algorithmica 8 (1992), 345364. [170] A. Lingas, A. Maheshwari and J.R. Sack, Optimal parallel algorithms for rectilinear link distance problems, Algorithmica 14 (1995), 261289. [171] P.D. MacKenzie and Q. Stout, Asymptotically efficient hypercube algorithms for computational geometry, Proc. 3rd Symp. on the Frontiers of Massively Parallel Computation (1990), 811. [ 172] J.M. Marberg and E. Gafni, Sorting in constant number of row and column phases on a mesh, Proc. 24th Annual AUerton Conf. on Communication, Control and Computing, Monticello, Illinois (1986), 603612. [173] J. Matousek, Epsilonnets and computational geometry. New Trends in Discrete and Computational Geometry, J. Pach, ed., Algorithms and Combinatorics, Vol. 10, SpringerVerlag (1993), 6989. [174] N. Megiddo, Linear time algorithms for linear programming in R^ and related problems, SIAM J. Comput. 12 (1983), 759776. [175] G.L. Miller and J.H. Reif, Parallel tree contraction and its applications, Proc. 26th IEEE Symp. on Foundations of Comp. Sci. (1985), 478489. [176] R. Miller and S.E. Miller, Convexity algorithms for digitized pictures on an Intel iPSC hypercube. Supercomputer J. 31 (VI3) (1989), 4553.
Deterministic parallel computational
geometry
199
[ 177] R. Miller and Q.F. Stout, Geometric algorithms for digitized pictures on a meshconnected computer, IEEE Trans. PAMI 7 (1985), 216228. [178] R. Miller and Q.F. Stout, Efficient parallel convex hull algorithms, IEEE Trans. Comput. C37 (1988), 16051618. [179] R. Miller and Q.F. Stout, Mesh computer algorithms for computational geometry, IEEE Trans. Comput. C38 (1989), 321340. [180] R. Miller and Q.F. Stout, Parallel Algorithms for Regular Architectures, The MIT Press, Cambridge, Massachusetts (1991). [181] S. Miyano, S. Shiraishi and T. Shoudai, A list of Pcomplete problems. Technical Report RIFISTRCS17, Kyushu University (1989). [ 182] R. Motwani, J. Naor and M. Naor, The probabilistic method yields deterministic parallel algorithms, Proc. 30th Annual IEEE Symp. Found. Comput. Sci. (1989), 813. [183] H. Mueller, Sorting numbers using limited systolic coprocessors. Inform. Process. Lett. 24 (1987), 351354. [184] K. Mulmuley, Computational Geometry: An Introduction through Randomized Algorithms, PrenticeHall, New Jersey (1994). [185] D. Nassimi and S. Sahni, Data broadcasting in SIMD computers, IEEE Trans. Comput. 30 (1981), 101106. [186] J. O'Rourke, Art Gallery Theorems and Algorithms, Oxford University Press (1987). [187] J. O'Rourke, Computational geometry, Ann. Rev. Comp. Sci. 3 (1988), 389411. [188] J. O'Rourke, Computational Geometry in C, Cambridge University Press (1993). [189] I. Parberry, Parallel Complexity Theory, Pitman, London (1987). [190] W. Paul, U. Vishkin and H. Wagener, Parallel dictionaries on 23 trees, Proc. 10th Coll. on Autom., Lang. and Prog., Lecture Notes in Comput. Sci. 154, Springer, Berlin (1983), 597609. [191] CO. Plaxton, Load balance, selection and sorting on the hypercube, Proc. 1st Annual ACM Symp. on Parallel Algorithms and Architectures (1989), 6473. [192] C.G. Plaxton, On the network complexity of selection, Proc. 30th Annual IEEE Symp. on Foundations of Computer Science (1989), 396401. [193] F.P. Preparata and M.I. Shamos, Computational Geometry: An Introduction, SpringerVerlag (1985). [194] F.P. Preparata and R. Tamassia, Fully dynamic techniques for point location and transitive closure in planar structures, Proc. 29th IEEE Symp. on Foundations of Computer Science (1988), 558567. [195] R. Raman and U. Vishkin, Optimal parallel algorithms for totally monotone matrix searching, Proc. 5th Annual ACMSIAM Symp. on Discrete Algorithms (1994), 613621. [196] E.A. Ramos, Construction ofld lower envelopes and applications, Proc. 13th Annual ACM Symp. Computational Geometry (1997), 5766. [197] J.H. Reif and S. Sen, Optimal randomized parallel algorithms for computational geometry, Algorithmica 7(1992), 91117. [198] J.H. Reif and S. Sen, Polling: A new random sampling technique for computational geometry, SIAM J. Comput. 21 (1992), 466485. [199] J.H. Reif and S. Sen, Randomized algorithms for binary search and load balancing on fixed connection networks with geometric applications, SIAM J. Comput. 23 (1994), 633651. [200] J.H. Reif and Q.F. Stout, Manuscript. [201] J.H. Reif and L. Valiant, A logarithmic time sort for linear size networks, J. ACM 34 (1987), 6076. [202] C. Riib, Linesegment intersection reporting in parallel, Algorithmica 8 (1992), 119144. [203] K.W. Ryu and J. Jaja, Efficient algorithms for list ranking andfor solving graph problems on the hypercube, IEEE Trans. Parallel and Distributed Systems 1 (1990), 8390. [204] S. Sairam, R. Tamassia and J.S. Vitter, An efficient parallel algorithm for shortest paths in planar layered digraphs, Algorithmica 14 (1995), 322339. [205] J.L.C. Sanz and R. Cypher, Data reduction and fast routing: A strategy for efficient algorithms for messagepassing parallel computers, Algorithmica 7 (1992), 7789. [206] B. Schieber, Computing a minimumweight klink path in graphs with the concave Monge property, Proc. 6th Annual ACMSIAM Symp. on Discrete Algorithms (1995), 405411. [207] C.P. Schnorr and A. Shamir, An optimal sorting algorithm for meshconnected computers, Proc. 18th ACM Symp. on Theory on Computing (1986), 255261.
200
MJ. Atallah and D.Z. Chen
[208] S. Sen, A deterministic Poly (log log «) time optimal CRCW PRAM algorithm for linear programming in fixed dimension. Technical Report 9508, Dept. of Computer Science, University of Newcastle (1995). [209] S. Sen, Parallel multidimensional search using approximation algorithms: With applications to linearprogramming and related problems, Proc. 8th ACM Symp. Parallel Algorithms and Architectures (1996), 251260. [210] M. Sharir and P.K. Agarwal, DavenportSchinzel Sequences and Their Geometric Applications, Cambridge University Press, New York (1995). [211] Y. Shiloach and U. Vishkin, Finding the maximum, merging, and sorting in a parallel computation model, J. Algorithms 2 (1981), 88102. [212] I. Stojmenovic, Manuscript (1988). [213] Q.F. Stout, Constanttime geometry on PRAMs, Proc. 1988 Int'l. Conf. on Parallel Computing, Vol. HI, IEEE, 104107. [214] R. Tamassia and J.S. Vitter, Parallel transitive closure and point location in planar structures, SIAM J. Comput. 20 (1991), 708725. [215] R. Tamassia and J.S. Vitter, Optimal cooperative search in fractional cascaded data structures, Algorithmica 15 (1996), 154171. [216] R.E. Tarjan and U. Vishkin, Finding biconnected components and computing tree functions in logarithmic parallel time, SIAM J. Comput. 14 (1985), 862874. [217] CD. Thompson and H.T. Kung, Sorting on a meshconnected parallel computer, Comm. ACM 20 (1977), 263271. [218] G.T. Toussaint, Solving geometric problems with rotating calipers, Proc. IEEE MELECON '83, Athens, Greece (May 1983). [219] J.J. Tsay, Optimal mediumgrained parallel algorithms for geometric problems. Technical Report 942, Dept. of Computer Sciences, Purdue University (1990). [220] J.J. Tsay, Parallel algorithms for geometric problems on networks ofprocessors, Proc. 5th IEEE Symp. on Parallel and Distributed Processing, Dallas, Texas (Dec. 1993), 200207. [221] P. Vaidya, Personal communication. [222] L. Valiant, Parallelism in comparison problems, SIAM J. Comput. 4 (1975), 348355. [223] V.N. Vapnik and A.Y. Chervonenkis, On the uniform convergence of relative frequencies of events to their probabilities. Theory Probab. Appl. 16 (1971), 264280. [224] H. Wagener, Optimally parallel algorithms for convex hull determination. Manuscript (1985). [225] H. Wagener, Optimal parallel hull construction for simple polygons in 0(log log^i) time, Proc. 33rd Annual IEEE Sympos. Found. Comput. Sci. (1992), 593599. [226] D.E. Willard and Y.C. Wee, Quasivalid range querying and its implications for nearest neighbor problems, Proc. 4th Annual ACM Symp. on Computational Geometry (1988), 3443. [227] C.K. Yap, Parallel triangulation of a polygon in two calls to the trapezoidal map, Algorithmica 3 (1988), 279288.
CHAPTER 5
Voronoi Diagrams^ Franz Aurenhammer Institutfiir Grundlagen der Informationsverarbeitung, Technische Universitdt Graz, Klosterwiesgasse 32/2, A8010 Graz, Austria
Rolf Klein Praktische Informatik VI, Fern Universitdt Hagen, Informatikzentrum, D58084 Hagen, Germany
Contents 1. Introduction 2. Definitions and elementary properties 3. Algorithms 3.1. A lower bound 3.2. Incremental construction 3.3. Divide & conquer 3.4. Sweep 3.5. Lifting to 3space 4. Generalizations and structural properties 4.1. Characterization of Voronoi diagrams 4.2. Optimization properties of Delaunay triangulations 4.3. Higher dimensions, power diagrams, and orderA: diagrams 4.4. Generalized sites 4.5. Generalized spaces and distances 4.6. General Voronoi diagrams 5. Geometric applications 5.1. Distance problems 5.2. Subgraphs of Delaunay triangulations 5.3. Geometric clustering 5.4. Motion planning 6. Concluding remarks and open problems References
* Partially supported by the Deutsche Forschungsgemeinschaft, grant Kl 655 22. HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V All rights reserved
201
203 204 209 209 211 215 217 220 221 221 225 229 239 248 260 264 264 270 275 278 280 281
This Page Intentionally Left Blank
Voronoi diagrams
203
1. Introduction The topic of this chapter, Voronoi diagrams, differs from other areas of computational geometry, in that its origin dates back to the 17th century. In his book on the principles of philosophy [87], R. Descartes claims that the solar system consists of vortices. His illustrations show a decomposition of space into convex regions, each consisting of matter revolving round one of the fixed stars; see Figure 1. Even though Descartes has not explicitly defined the extension of these regions, the underlying idea seems to be the following. Let a space M, and a set S of sites p in M he given, together with a notion of the influence a site p exerts on a point x of M. Then the region of p consists of all points x for which the influence of p is the strongest, over all seS. This concept has independently emerged, and proven useful, in various fields of science. Different names particular to the respective field have been used, such as medial axis transform in biology and physiology, WignerSeitz zones in chemistry and physics, domains of action in crystallography, and Thiessen polygons in meteorology and geography. The mathematicians Dirichlet [95] and Voronoi [253,252] were the first to formally introduce this concept. They used it for the study of quadratic forms; here the sites are integer lattice points, and influence is measured by the Euclidean distance. The resulting structure has been called Dirichlet tessellation or Voronoi diagram, which has become its standard name today. Voronoi [253] was the first to consider the dual of this structure, where any two point sites are connected whose regions have a boundary in common. Later, Delaunay [86] obtained the same by defining that two point sites are connected iff (i.e. if and only if) they lie on a circle whose interior contains no point of S. After him, the dual of the Voronoi diagram has been denoted Delaunay tessellation or Delaunay triangulation. Besides its applications in other fields of science, the Voronoi diagram and its dual can be used for solving numerous, and surprisingly different, geometric problems. Moreover, these structures are very appealing, and a lot of research has been devoted to their study (about one out of 16 papers in computational geometry), ever since Shamos and Hoey [232] introduced them to the field. The reader interested in a complete overview over the existing literature should consult the book by Okabe et al. [210] who list more than 600 papers, and the surveys by Aurenhammer [27], Bemal [39], and Fortune [124]. Also, Chapters 5 and 6 of Preparata and Shamos [215] and Chapter 13 of Edelsbrunner [104] could be consulted. Within one chapter, we cannot review all known results and applications. Instead, we are trying to highlight the intrinsic potential of Voronoi diagrams, that lies in its structural properties, in the existence of efficient algorithms for its construction, and in its adaptability. We start in Section 2 with a simple case: the Voronoi diagram and the Delaunay triangulation of n points in the plane, under the Euclidean distance. We state elementary structural properties that follow directly from the definitions. Further properties will be revealed in Section 3, where different algorithmic schemes for computing these structures are presented. In Section 4 we complete our presentation of the classical twodimensional case, and turn to generalizations. Next, in Section 5, important geometric applications of the Voronoi diagram and the Delaunay triangulation are discussed. The reader who is mainly
204
F. Aurenhammer
and R. Klein
Fig. 1. Descartes' decomposition of space into vortices.
interested in these applications can proceed directly to Section 5, after reading Section 2. Finally, Section 6 concludes the chapter and mentions some open problems.
2. Definitions and elementary properties Throughout this section we denote by 5 a set of w ^ 3 point sites /?, ^, r , . . . in the plane. For points p = (pi, p2) and x = (x\,X2) let d(p,x) = ^J{p\ — x\)'^ \ {p2 — xi)^ denote their Euclidean distance. By ~pq we denote the line segment from p to q. The closure of a set A will be denoted by A. DEFINITION 2.1. For p,q
eSlei
B(p,q) = {x \d(p,x)
= d(q,x)]
Voronoi diagrams
205
be the bisector of p and q. B{p,q) is the perpendicular Une through the center of the Hne segment ~pq. It separates the halfplane D{p, q) = i^x\ d(p, x) < d(q, x)] containing p from the halfplane D(q, p) containing q. We call
YR(p,S)=
P I D(p,q) qeS,q^p
the Voronoi region of p with respect to S. Finally, the Voronoi diagram of S is defined by V{S)=
U
VR(/7,5)nVR(^,5).
p,q^S,p^q
By definition, each Voronoi region VR(/^, S) is the intersection of n — 1 open halfplanes containing the site p. Therefore, VR(/7, S) is open and convex. Different Voronoi regions are disjoint. The common boundary of two Voronoi regions belongs to V{S) and is called a Voronoi edge, if it contains more than one point. If the Voronoi edge e borders the regions of p and q then e C B{p, q) holds. Endpoints of Voronoi edges are called Voronoi vertices', they belong to the common boundary of three or more Voronoi regions. There is an intuitive way of looking at the Voronoi diagram V{S). Let x be an arbitrary point in the plane. We center a circle, C, at x and let its radius grow, from 0 on. At some stage the expanding circle will, for the first time, hit one or more sites of S. Now there are three different cases. LEMMA 2.L If the circle C expanding from x hits exactly one site, p, then x belongs to VR(/7, S).IfC hits exactly two sites, p and q, then x is an interior point of a Voronoi edge separating the regions of p and q. If C hits three or more sites simultaneously, then x is a Voronoi vertex adjacent to those regions whose sites have been hit. PROOF. If only site p is hit then p is the unique element of S closest to x. Consequently, X e Dip, r) holds for each site r e S with r ^ p.lfC hits exactly p and q, then x is contained in each halfplane D(p,r), D(q,r), where r ^ {p,q}, and in B(p,q), the common boundary of D(p, q) and D{q, p). By Definition 2.1, x belongs to the closure of the regions of both p and q, but of no other site in 5. In the third case, the argument is analogous.
n This lemma shows that the Voronoi regions form a decomposition of the plane; see Figure 2. Conversely, if we imagine n circles expanding from the sites at the same speed, the fate of each point x of the plane is determined by those sites whose circles reach x first. This "expanding waves" view has been systematically used by Chew and Drysdale [66] and Thurston [248].
206
F. Aurenhammer
and R. Klein
Fig. 2. A Voronoi diagram of 11 points in the Euclidean plane.
The Voronoi vertices are of degree at least three, by Lemma 2.1. Vertices of degree higher than three do not occur if no four point sites are cocircular. The Voronoi diagram V(S) is disconnected if all point sites are colinear; in this case it consists of parallel lines. From the Voronoi diagram of S one can easily derive the convex hull of 5, i.e. the boundary of the smallest convex set containing S. LEMMA 2.2. A point p of S lies on the convex hull of S iff its Voronoi region VR(/7, S) is unbounded.
The Voronoi region of p is unbounded iff there exists some point q e S such that V(S) contains an unbounded piece of B{p, q) as a Voronoi edge. Let x e B(p, q), and let C(x) denote the circle through p and q centered at x, as shown in Figure 3. Point x belongs to V(S) iff C(x) contains no other site. As we move x to the right along B(p, q), the part of C(x) contained in halfplane R keeps growing. If there is another site r in R,it will eventually be reached by C(JC), causing the Voronoi edge to end at x. Otherwise, all other sites of S must be contained in the closure of the left halfplane L. Then p and q both lie on the convex hull of 5. D PROOF.
Sometimes it is convenient to imagine a simple closed curve F around the "interesting" part of the Voronoi diagram, so large that it intersects only the unbounded Voronoi edges; see Figure 2. While walking along F, the vertices of the convex hull of S can be reported in cyclic order. After removing the halflines outside F, a connected embedded planar graph with n \ I faces results. Its faces are the n Voronoi regions and the unbounded face outside F. We call this graph the finite Voronoi diagram.
207
Voronoi diagrams
L
I
R
B(p,q)
Fig. 3. As jc moves to the right, the intersection of circle C{x) with the left half plane shrinks, while C(x) H /? grows.
One virtue of the Voronoi diagram is its small size. LEMMA 2.3. The Voronoi diagram V{S) has 0(n) many edges and vertices. The average number of edges in the boundary of a Voronoi region is less than 6. PROOF. By the Euler formula (see, e.g. [129]) for planar graphs, the following relation holds for the numbers u, e, / , and c of vertices, edges, faces, and connected components.
V— e+ f =
l+c.
We apply this formula to the finite Voronoi diagram. Each vertex has at least three incident edges; by adding up we obtain e ^ 3^/2, because each edge is counted twice. Substituting this inequality together with c = 1 and f = n^l yields v^2n
—2
and
^ ^ 3 n —3.
Adding up the numbers of edges contained in the boundaries of all w + 1 faces results in 2e ^6n — 6 because each edge is again counted twice. Thus, the average number of edges in a region's boundary is bounded by {6n — 6)/(n f 1) < 6. The same bounds apply to V{S). U Now we turn to the Delaunay tessellation. In general, a triangulation of 5 is a planar graph with vertex set S and straight line edges, which is maximal in the sense that no further straight line edge can be added without crossing other edges. Each triangulation of S contains the edges of the convex hull of S. Its bounded faces are triangles, due to maximality. Their number equals 2n — k — 2, where k denotes the size of the convex hull. We call a connected subset of edges of a triangulation a tessellation of S
208
F. Aurenhammer
and R. Klein
Fig. 4. Voronoi diagram and Delaunay tessellation.
if it contains the edges of the convex hull, and if each point of S has at least two adjacent edges. 2.2. The Delaunay tessellation DT(S) is obtained by connecting with a line segment any two points p,q of 5 for which a circle C exists that passes through p and q and does not contain any other site of S in its interior or boundary. The edges of DTC^S) are called Delaunay edges. DEFINITION
The following equivalent characterization is a direct consequence of Lemma 2.1. LEMMA 2.4. Two points of S are joined by a Delaunay edge iff their Voronoi regions are edgeadjacent.
Since each Voronoi region has at least two neighbors, at least two Delaunay edges must emanate from each point of 5. By the proof of Lemma 2.2, each edge of the convex hull of S is Delaunay. Finally, two Delaunay edges can only intersect at their endpoints, because they allow for circumcircles whose respective closures do not contain other sites. This shows that DT(5) is in fact a tessellation of S. Two Voronoi regions can share at most one Voronoi edge, by convexity. Therefore, Lemma 2.4 implies that DTC^") is the graphtheoretical dual of V(S), realized by straight hne edges. An example is depicted in Figure 4; the Voronoi diagram V(S) is drawn by solid lines, and DTC^S) by dashed lines. Note that a Voronoi vertex (like w) need not be contained in its associated face of DTC^S). The sites p,q,r,s art cocircular, giving rise to a Voronoi vertex V of degree 4. Consequently, its corresponding Delaunay face is bordered by four edges. This cannot happen if the points of S are in general position.
Voronoi diagrams
209
THEOREM 2.1. If no four points of S are cocircular then DT(^), the dual of the Voronoi diagram V{S), is a triangulation of S, called the Delaunay triangulation. Three points of S give rise to a Delaunay triangle iff their circumcircle does not contain a point of S in its interior.
3. Algorithms In this section we present several ways of computing the Voronoi diagram and its dual, the Delaunay tessellation. For simplicity, we assume of the n point sites of S that no four of them are cocircular, and that no three of them are colinear. According to Theorem 2.1 we can then refer to DT(5) as to the Delaunay triangulation. All algorithms presented herein can be made to run without the general position assumption. Also, they can be generalized to metrics other than the Euclidean, and to sites other than points. This will be discussed in Subsections 4.5 and 4.4. Data structures well suited for working with planar graphs like the Voronoi diagram are the doubly connected edge list, DCEL, by Muller and Preparata [202], and the quad edge structure by Guibas and Stolfi [136]. In either structure, a record is associated with each edge e that stores the following information: the names of the two endpoints of e; references to the edges clockwise or counterclockwise next to e about its endpoints; finally, the names of the faces to the left and to the right of e. The space requirement of both structures is 0(n). Either structure allows to efficiently traverse the edges incident to a given vertex, and the edges bounding a face. The quad edge structure offers the additional advantage of describing, at the same time, a planar graph and its dual, so that it can be used for constructing both the Voronoi diagram and the Delaunay triangulation. From the DCEL of V(S) we can derive the set of triangles constituing the Delaunay triangulation in linear time. Conversely, from the set of all Delaunay triangles the DCEL of the Voronoi diagram can be constructed in time 0(n). Therefore, each algorithm for computing one of the two structures can be used for computing the other one, within 0(n) extra time. It is convenient to store structures describing the finite Voronoi diagram, as introduced before Lemma 2.3, so that the convex hull of the point sites can be easily reported by traversing the bounding curve F; see Figure 2. 3,1. A lower bound Before constructing the Voronoi diagram we want to establish a lower bound for its computational complexity. Suppose that n real numbers x i , . . . , x^ are given. From the Voronoi diagram of the point set S = [pi = (xi ,Xi^)\l^i^n} one can derive, in linear time, the vertices of the convex hull of 5, in counterclockwise order. From the leftmost point in S on, this vertex sequence contains all points pt, sorted by increasing values of Xf; see Figure 5(i). This argument due to Shamos [231] shows that constructing the convex hull and, a fortiori, computing the Voronoi diagram, is at least as difficult as sorting n real numbers, which requires 0(n logn) time in the algebraic computation tree model.
F. Aurenhammer
210
\
Y
Fig. 5. Proving the Q(n\ogn)
and R. Klein
.Y
lower bound for constructing the Voronoi diagram (i) by transformation from sorting, and (ii) by transformation from ^closeness.
However, a fine point is lost in this reduction. After sorting n points by their xvalues, their convex hull can be computed in linear time [101], whereas sorting does not help in constructing the Voronoi diagram. The following result has been independently found by Djidjev and Lingas [96] and by Zhu and Mirzaian [262]. 3.1. It takes time Q{n\ogn) to construct the Voronoi diagram of n points Pn whose Xcoordinatesare strictly increasing.
THEOREM
p\,...,
PROOF. By reduction from the ecloseness problem which is known to be in 0(nlogn). Let y\,.. .,yn be positive real numbers, and let £ > 0. The question is if there exist / / j such that \yi — yj\ < e holds. We form the sequence of points pi = (is/n, yi), 1 ^ / < n, and compute their Voronoi diagram; see Figure 5(ii). In time 0(«), we can determine the Voronoi regions that are intersected by the >^axis, in bottomup order (such techniques will be detailed in Subsection 3.3). If, for each /?/, its projection onto the >'axis lies in the Voronoi region of pt then the values yi are available in sorted order, and we can easily answer the question. Otherwise, there is a point pi whose projection lies in the region of some other point pj. Because of
\yi yj\^
d{(0, yi), Pj) < J((0, yd, pi) = ^ ^ ^,
in this case the answer is positive.
D
On the other hand, sorting n arbitrary point sites by xcoordinates is not made easier by their Voronoi diagram, as Seidel [225] has shown.
Voronoi diagrams
211
With Definition 2.1 in mind one could think of computing each Voronoi region as the intersection ofn — l halfplanes. This would take time G{n logn) per region, see [215]. In the following subsections we describe various algorithms that compute the whole Voronoi diagram within this time; due to Theorem 3.1, these algorithms are worstcase optimal. 3.2. Incremental construction A natural idea first studied by Green and Sibson [133] is to construct the Voronoi diagram by incremental insertion, i.e. to obtain V{S) from V(5 \ {p}) by inserting the site p. As the region of p can have up to n — 1 edges, for n = \S\, this leads to a runtime of 0{n^). Several authors have finetuned the technique of inserting Voronoi regions, and efficient and numerically robust implementations are available nowadays; see Ohya et al. [209] and Sugihara and Iri [242]. In fact, runtimes of 0{n) can be expected for well distributed sets of sites. The insertion process is, maybe, better described, and implemented in the dual environment, for the Delaunay triangulation: construct DT/ = DT({/7i,..., p /  i , p/}) by inserting the site pi into DT/_i. The advantage over a direct construction of V(S) is that Voronoi vertices that appear in intermediate diagrams but not in the final one need not be constructed and stored. We follow Guibas and Stolfi [136] and construct DT/ by exchanging edges, using Lawson's [176] original edge flipping procedure, until all edges invalidated by pi have been removed. To this end, it is useful to extend the notion of triangle to the unbounded face of the Delaunay triangulation. If 'pq is an edge of the convex hull of S we call the supporting halfplane H not containing S an infinite triangle with edge 'pq. Its circumcircle is H itself, the limit of all circles through p and q whose center tend to infinity within H\ compare Figure 3. As a consequence, each edge of a Delaunay triangulation is now adjacent to two triangles. Those triangles of DT/_i (finite or infinite) whose circumcircles contain the new site. Pi, are said to be in conflict with pi. According to Theorem 2.1, they will no longer be Delaunay triangles. Let ^ be an edge of DT/_i, and let T{q,rJ)ht the triangle adjacent to 'qr that lies on the other side of ^ than pi\ see Figure 6. If its circumcircle C{q,r, t) contains pi then each circle through q, r contains at least one of pi,t\ see Figure 3 again. Consequently, 'qr cannot belong to DT/, due to Definition 2.2. Instead, ^ will be a new Delaunay edge, because there exists a circle contained in C(^, r, t) that contains only pi and t in its interior or boundary. This process of replacing edge 'qr by p7? is called an edge flip. The necessary edge flips can be carried out efficiently if we know the triangle T(q,s,r) of DTj_i that contains pt, see Figure 7. The line segments connecting pt to q, r, and s will be new Delaunay edges, by the same argument from above. Next, we check if, e.g. edge 'qr must be flipped. If so, the edges 'qt and Jr are tested, and so on. We continue until no further edge currently forming a triangle with, but not containing pi, needs to be flipped, and obtain DT/. LEMMA 3.1. If the triangle ofDTti containing pi is known, the structural work needed for computing DT/ from DT/_i is proportional to the degree d of pi in DT/.
212
F. Aurenhammer
and R. Klein
t
C(q,r,t) Fig. 6. If triangle T(q,r, t) is in conflict with pj then former Delaunay edge qr must be replaced by pit.
(iii) Fig. 7. Updating DT/_i after inserting the new site pj. In (ii) the new Delaunay edges connecting pi to q,r,s have been added, and edge ^ has already been flipped. Two more flips are necessary before the final state shown in (iii) is reached.
PROOF. Continued edge flipping replaces d — 2 conflicting triangles of DT/_i by d new triangles in DT/ that are adjacent to pi; compare Figure 7. D
Lemma 3.1 yields an obvious O(n^) time algorithm for constructing the Delaunay triangulation ofn points: we can determine the triangle of DT/_i containing pi within linear time, by inspecting all candidates. Moreover, the degree of pi is trivially bounded by n. The last argument is quite crude. There can be single vertices in DT/ that do have a high degree, but their average degree is bounded by 6, as Lemma 2.3 and Lemma 2.4 show. This fact calls for randomization. Suppose we pick pn at random in 5, then choose pn\ randomly from S — {pn}, and so on. The result is a random permutation {p\, pi^ ^ Pn) of the site set S.
Voronoi diagrams
213
If we insert the sites in this order, each vertex of DT/ has the same chance of being pi. Consequently, the expected value of the degree of /?/ is 0(1), and the expected total number of structural changes in the construction of DT^ is only 0(w), due to Lemma 3.1. In order to find the triangle that contains /?/ it is sufficient to inspect all triangles that are in conflict with pi. The following lemma shows that the expected total number of all conflicting triangles so far constructed is only logarithmic. LEMMA 3.2. For each h < i, let dh denote the expected number of triangles in DT/^ \ DT/j_i that are in conflict with pi. Then,
^J/,=O(log0. Let C denote the set of triangles of DT/j that are in conflict with pi. A triangle T eC belongs to DT/^ \ DT/^i iff it has pu as a vertex. As ph is randomly chosen in DT/^, this happens with probability 3//z. Thus, the expected number of triangles in C \ Tflhi equals 3 • \C\/h. Since the expected size of C is less than 6 we have dh < 18//z, hence PROOF.
i : l = \ 4 < i8El=\ i/h = e(iogi).
n
Suppose that 7 is a triangle of DTj adjacent to pt, see Figure 7(iii). Its edge Jr is in DT/_i adjacent to two triangles: To its father, F, that has been in conflict with pi; and to its stepfather, SF, who is still present in DT/. Any further site in conflict with T must be in conflict with its father or with its stepfather, as illustrated by Figure 8. This property can be exploited for quickly accessing all conflicting triangles. The Delaunay tree due to Boissonnat and Teillaud [46] is a directed acyclic graph that contains one node for each Delaunay triangle ever created during the incremental construction. Pointers run from fathers and stepfathers to their sons. The triangles of DT3 are the sons of a dummy root node. When P/+1 must be inserted, a Delaunay tree including all triangles up to DT/ is available. We start at its root and descend as long as the current triangle is in conflict with /?/+i. The above property guarantees that each conflicting triangle of DT/ will be found. The expected number of steps this search requires is O(log0, due to Lemma 3.2. Once DT/+1 has been computed, the Delaunay tree can easily be updated to include the new triangles. Thus, we have the following result. THEOREM 3.2. The Delaunay triangulation of a set ofn points in the plane can be constructed in expected time 0{n\ogn), using expected linear space. The average is taken over the different orders of inserting the n sites.
As a nice feature, the insertion algorithm is online. That is, it is capable of constructing DT/ from DT/_i without knowledge of /7/+1,..., p^. Note also that we did not make any assumptions concerning the distribution of the sites in the plane; the incremental algorithm achieves its 0{n\ogn) time bound for every pos
214
F. Aurenhammer
and R. Klein
Fig. 8. The circumcircle of T is contained in the union of the circumcircles of F and SF.
sible input set. Only under a "poor" insertion order can a quadratic number of structural changes occur, but this is unlikely. Randomized geometric algorithms are presented in more detail in a separate chapter of this book. Though conceptually simple, they tend to be tricky to analyze. Since Clarkson and Shor [74] introduced their technique, many researchers have been working on generalizing and simplifying the methods used. To mention but a few results, Boissonnat et al. [43] and Guibas et al. [135] have refined the methods of storing the past in order to locate new conflicts quickly, Clarkson et. al. [73] have generaHzed and simplified the analytic framework, and Seidel [230] systematically applied the technique of backward analysis first used by Chew [62]. The method in [135] for storing the past is briefly described in Subsection 4.3.3 for constructing a generalized planar Voronoi diagram. If the set S of sites can be expected to be well distributed in the plane, bucketing techniques for accessing the triangle that contains a new site /?/ have been used for speedup. Joe [152], who implemented Sloan's algorithm [238], and Su and Drysdale [240], who used a variant of Bendey et al.'s spiral search [36], report on fast experimental runtimes. The arising issues of numerical stability have been addressed in Fortune [123], Sugihara [241], and JUnger et al. [154]. A technique similar to incremental insertion is incremental search. It starts with a single Delaunay triangle, and then incrementally discovers new ones, by growing triangles from edges of previously discovered triangles. This basic idea is used, e.g., in Maus [189] and in Dwyer [103]. It leads to efficient expectedtime Delaunay algorithms in higher dimensions; see [103]. The paper [240] gives a thorough experimental comparison of available Delaunay triangulation algorithms.
Voronoi diagrams
215
3.3. Divide & conquer The first deterministic worstcase optimal algorithm for computing the Voronoi diagram has been presented by Shamos and Hoey [232]. In their divide & conquer approach, the set of point sites, S, is split by a dividing line into subsets L and R of about the same sizes. Then, the Voronoi diagrams V(L) and V(R) are computed recursively. The essential part is in finding the split line, and in merging V(L) and V(R), to obtain V(S). If these tasks can be carried out in time 0(n) then the overall running time is 0(n logn). During the recursion, vertical or horizontal split lines can be found easily if the sites in S are sorted by their x and ycoordinates beforehand. The merge step involves computing the set B(L, R) of all Voronoi edges of V(S) that separate regions of sites in L from regions of sites in R. Suppose that the split line is vertical, and that L lies to its left. LEMMA 3.3. The edges of B{L, R) form a single ymonotonepolygonal chain. In V{S), the regions of all sites in L are to the left of B(L, R), whereas the regions of the sites of R are to its right. PROOF. Let b be an arbitrary edge of B(L, R), and let / G L and r e Rhe the sites whose regions are adjacent to b. Since / has a smaller xcoordinate than r, b cannot be horizontal, and the region of / must be to its left. D
Thus, V(S) can be obtained by glueing together B(L, R), the part of V(L) to the left of B(L, R), and the part of V(R) to its right; see Figure 9, where V(R) is depicted by dashed lines. The polygonal chain B(L, R) is constructed by finding a starting edge at infinity, and by tracing B(L,R) through V(L) and V(R). Due to Shamos and Hoey [232], an unbounded starting edge of B(L, R) can be found inO(n) time by determining a line tangent to the convex hulls of L and R, respectively. Here we describe an alternative method by Chew and Drysdale [66] since that method also works for generalized Voronoi diagrams (Subsection 4.5.2). The unbounded regions of V(L) and V(R) are scanned simultaneously in cyclic order. For each nonempty intersection VR(/, L) n VR(r, R), we test if it contains an unbounded piece of B(l,r).lf so, this must be an edge of B(L, R), by Definition 2.1. Since B(L, R) has two unbounded edges, by Lemma 3.3, this search will be successful. It takes time  V(L)\ +  V(R)\ = 0(n). Now we describe how B(L, R) is traced. Suppose that the current edge b of B(L, R) has just entered the region VR(/, L) at point v while running within VR(r, R), see Figure 10. We determine the points VL and VR where b leaves the regions of / resp. of r. The point VL is found by scanning the boundary of VR(/, L) counterclockwise, starting from v. In our example, VR is closer to v than VL, SO that it must be the endpoint of edge b. From VR, B{L,R) continues with an edge Z?2 separating / and r2. Now we have to determine the points UL,2 and VR^2 where b2 hits the boundaries of the regions of / and r2 The crucial observation is that VL,2 cannot be situated on the boundary segment of VR(/, L) from v to VL that we have just scanned; this can be inferred from the convexity of VR(/, S). Therefore, we need to scan the boundary of VR(/, L) only from VL on, in counterclockwise direction.
216
F. Aurenhammer and R. Klein B(L,R)
V(R)
Fig. 9. Merging V{L) and V{R) into V{S).
The same reasoning applies to V{R)\ only here, region boundaries are scanned clockwise. Even though the same region might be visited by B{L, R) several times, no part of its boundary is scanned more than once. The edges of V(L) that are scanned all lie to the right of B{L, R). This part of V(L), together with B(L, R), forms a planar graph each of whose faces contains at least one edge of B(L, R) in its boundary. As a consequence of Lemma 2.3, the size of this graph does not exceed the size of B(L, R), times a constant. The same holds for V(R). Therefore, the cost of constructing B(L, R) is bounded by its size, once a starting edge is given. This leads to the following result. THEOREM 3.3. The divide SL conquer algorithm allows the Voronoi diagram ofn point sites in the plane to be constructed within time 0(n logn) and linear space, in the worst case. Both bounds are optimal.
Of course, the divide & conquer paradigm can also be applied to the computation of the Delaunay triangulation DT(5). Guibas and Stolfi [136] give an implementation that uses the quadedge data structure and only two geometric primitives, an orientation test and an incircle test. Fortune [123] showed how to perform these tests accurately with finite precision.
Voronoi diagrams
217
Bd.rs) K /
\ \ I
, / /
/ B(l,r2) '
/
/ /
'
'
B(l,r)
IVR(I,L)
"B(r2,r3)
b^
•r2
B(r,r2)
Fig. 10. Computing the chain B(L, R).
Dwyer's implementation [102] uses vertical and horizontal split lines in turn, and Katajainen and Koppinen's [157] merges square buckets in a quadtree order. Both papers report on favorable results. Divide & conquer algorithms are candidates allowing for cffLcitnt parallelization. Several theoretically efficient algorithms for computing in parallel the Voronoi diagram or the Delaunay triangulation have been proposed. We refer to the recent paper by Blelloch et al. [41] for references and for a practical parallel algorithm for computing DT(5). They highlight an algorithm by Edelsbrunner and Shi [116] that uses the lifting map for S (see Subsection 3.5) to construct a chain of Delaunay edges that divides S. They show experimentally that their implementation is comparable in work to the best sequential algorithms.
3.4. Sweep The wellknown line sweep algorithm by Bentley and Ottmann [34] computes the intersections of n line segments in the plane by moving a vertical line, H, across the plane. The line segments currently intersected by H are stored in bottomup order. This order must be updated whenever H reaches an endpoint of a line segment, or an intersection point. To discover the intersection points in time, it is sufficient to check, after each update of the order, those pairs of line segments that have just become neighbors on H. It is tempting to apply the same approach to Voronoi diagrams, by keeping track of the Voronoi edges that are currently intersected by the vertical sweep line. The problem is in discovering new Voronoi regions in time. By the time the sweep line hits a new site it has been intersecting Voronoi edges of its region for a while.
218
F. Aurenhammer
and R. Klein
Pe Pe
'
H
V
H'
Fig. 11. Voronoi diagrams of the sweep line, H, and of the points to its left.
Fortune [125] was the first to find a way around this difficulty. He suggested a planar transformation under which each point site becomes the leftmost point of its Voronoi region, so that it will be the first point hit during a lefttoright sweep. His transformation does not change the combinatorial structure of the Voronoi diagram. Later, Seidel [228] and Cole [75] have shown how to avoid this transformation. They consider the Voronoi diagram of the point sites to the left of the sweep line H and of H itself, considered an additional site; see Figure 11. Because the bisector of a line and a nonincident point is a parabola, the boundary of the Voronoi region of / / is a connected chain of parabola segments whose top and bottommost edges tend to infinity. This chain is called the wavefront, W. Let /? be a point site to the left of H. Any point to the left of, or on, the parabola B(p, H) is not farther from p than from //; hence, it is a fortiori closer to p than to any site to the right of H. Consequently, as the sweep line moves on to the right, the waves must follow because the sets D(pi, H) grow. On the other hand, each Voronoi edge to the left of W that currently separates the regions of two point sites /?/, pj will be (part of) a Voronoi edge in
y{s). During the sweep, there are two types of events that cause the structure of the wavefront to change, namely when a new wave appears in W, or when an old wave disappears. The
Voronoi diagrams
219
first happens each time the sweep line hits a new site, e.g. pe in Figure 11. At that very moment B(H, pe)is2i horizontal line through pe, according to Definition 2.1. A little later, its left halfline unfolds into a parabola that must be inserted into the wavefront by gluing it onto the wave of p4 (which now contributes two segments to W). Let p,q be two point sites whose waves are neighbors in W. Their bisector, B(p,q), gives rise to a Voronoi edge to the left of W. Its prolongation into the region of H is called a spike. In Figure 11 spikes are depicted as dashed lines; one can think of them as tracks along which the waves are moving. A wave disappears from W when it arrives at the point where its two adjacent spikes intersect. Its former neighbors become now adjacent in the wavefront. In Figure 11, the wave of p3 would disappear at point i;, if the new site, p^, did not exist. But after the wave of p^ has been inserted, there will be a previous event at v\ where the lower part of the wave of p4 disappears. While keeping track of the wavefront one can easily maintain the Voronoi diagram of H and of the point sites to its left. As soon as all point sites have been detected and all spike intersections have been processed, V(S) is obtained by removing the wavefront and extending all spikes to infinity. Even though one wave may contribute several segments to the wavefront, the following holds. LEMMA
3.4. The size of the wavefront is 0(n).
Since any two parabolic bisectors B(p, H), B(q, H) can cross at most twice, the size of the wavefront is bounded by A2(n) = 2n — 1, where Xs{n) denotes the maximum length of a DavenportSchinzel sequence over n symbols in which no two symbols appear s times each in alternating positions; see [21]. D PROOF.
The wavefront can be implemented by a balanced binary tree that stores the segments in bottomup order. This enables us to insert a wave, or remove a wave segment, in time OiXogn). Before the sweep starts, the point sites are sorted by increasing xcoordinates and inserted into an event queue. After each update of the wavefront, newly adjacent spikes are tested for intersection. If they intersect at some point f, we insert into the event queue the time, i.e. the position x of the sweep line, when the wave segment between the two spikes arrives at v. Since the point f is a Voronoi vertex of V(5), there are only 0(n) many events caused by spike intersections. In addition, each of the n sites causes an event. For each active spike we need to store only its first intersection event. Thus, the size of the event queue never exceeds 0(n). We obtain the following result. THEOREM 3.4. Plane sweep provides an alternative way of computing the Voronoi diagram ofn points in the plane within 0(n logn) time and linear space.
McAllister et al. [191] have pointed out a subtle difference between the sweep technique and the two methods mentioned before. The divide & conquer algorithm computes 0 (n log n) many vertices, even though only a linear number of them appears in the final diagram. The randomized incremental construction method performs an expected 0 (n log n)
220
F. Aurenhammer
and R. Klein
tz XgX^ +^2
Fig. 12. Lifting circles onto the paraboloid.
number of conflict tests. Both tasks, constructing a Voronoi vertex and testing a subset of sites for conflict, are usually handled by subroutines that deal directly with point coordinates, bisector equations etc. They can become quite costly if we consider sites more general than points, and distance measures more general than the Euclidean distance; see Sections 4.4, 4.5, and 4.6. The sweep algorithm, on the other hand, processes only 0(n) many spike events.
3.5. Lifting to 3space The following approach employs the powerful method of geometric transformation. Let P = [{x\,X2,xi) I x^ h x  = X3} denote the paraboloid depicted in Figure 12. For each point x = {x\,X2) in the plane, let x' = {x\,X2,x]\ jc) denote its lifted image on P. LEMMA
3.5. Let C bea circle in the plane. Then C' is a planar curve on the paraboloid P.
PROOF.
Suppose that C is given by the equation r^ = (X\ C\)^
\(X2 02)^
=x]+xl
2x\C\
 2X2C2 + c] + C^.
By substituting jc^ h jc = JC3 we obtain x^ — 2x\c\ — 2x2C2 + Cj + ^2 — r
=0
for the points of C. This equation defines a plane in 3space.
D
This lemma has an interesting consequence. By the lower convex hull of a set of points in 3space we mean that part of the convex hull which is visible from the {xi, jC2)plane.
Voronoi diagrams
221
THEOREM 3.5. The Delaunay triangulation of S equals the projection onto the {x\, X2)plane of the lower convex hull of S'. PROOF. Let p,q,r denote three point sites of S. By Lemma 3.5, the hfted image, C\ of their circumcircle C Hes on a plane, E, that cannot be vertical. Under the lifting mapping, the points inside C correspond to the points on the paraboloid P that lie below the plane E. By Theorem 2.1, p,q,r define a triangle of the Delaunay triangulation iff their circumcircle contains no further site. Equivalently, no lifted site s^ is below the plane E that passes through p\ q\ r'. But this means that p\ q', r' define a face of the lower convex hull of S'.
D
Because there exist Oiji log/t) time algorithms for computing the convex hull of/i points in 3space, see, e.g. Preparata and Shamos [215], we have obtained another optimal algorithm for the Voronoi diagram. The connection between Voronoi diagrams and convex hulls has first been studied by Brown [49] who used the inversion transform. The simpler lifting mapping has been used, e.g., in Edelsbrunner and Seidel [113]. We shall see several applications and generalizations in Subsection 4.3. In [113] also the following fact is observed. For each point p of 5, consider the paraboloid Pp = {(xi, X2, ^3)  {x\ — pi)^ + (^2 — P2)^ = X3}. If these paraboloids were opaque, and of pairwise different colors, an observer looking upwards from ^3 = — oc would see the Voronoi diagram V(S). In fact, the projection X = {x\, X2) of a point (x\, X2, X3) e Pp 0 Pq belongs to B{p, q); and there is no site s closer to x than p and q iff (xi, X2, X3) lies below all paraboloids Ps. Instead of the paraboloids Pp one could use the surfaces {(xi,X2, f((xi — pi)^ + (x2 — P2)^))] generated by any function / that is strictly increasing. For example, f(x) = ^ gives rise to cones of slope 45° with apices at the sites. This setting illustrates the concept of circles expanding from the sites at equal speed, as mentioned after the proof of Lemma 2.1. Coordinate X3 represents time. In order to visualize a Voronoi diagram on a graphic screen one can feed the n surfaces to a zbuffer, and eliminate by brute force those parts not visible from below. Finally, we would like to mention a nice connection between the two ways of obtaining the Voronoi diagram by means of paraboloids explained above; it goes back to [113]. For a point w = (wi, W2, W3), let 'W denote its mirror image (wi, W2, —w^). If we apply to 3space the mapping which sends x to (x\, X2, ^3 — (xi — p\)^ — (x2 — P2)^) then, for each point p in the plane, the paraboloid Pp corresponds to the tangent plane of the paraboloid "P at the point —"{p'), where p' denotes the lifted image of p\ compare the plane equation derived in the proof of Lemma 3.5, letting c = p and r = 0.
4. Generalizations and structural properties 4.1. Characterization of Voronoi diagrams The process of constructing the Voronoi diagram for n point sites can be seen as an assignment of a planar convex region to each of the sites, according to the nearestneighbor
222
F. Aurenhammer and R. Klein
rule. We now address the following, in some sense inverse, question: Given a partition of the plane into n convex regions (which are then necessarily polygonal), do there exist sites, one for each region, such that the nearestneighbor rule is fulfilled? In other words, when is a given convex partition the Voronoi diagram of some set of sites? Whether a given set of sites induces a given convex partition as its Voronoi diagram is, of course, easy to decide by exploiting symmetry properties among the sites. For the same reason, it is easy to check whether a given triangulation is Delaunay, by exploiting the empty circumcircle property of its triangles, stated in Theorem 2.1. Conditions for a given graph to be isomorphic to the Delaunay triangulation of some set of sites are mentioned, e.g., in the survey article by Fortune [124]. Below we concentrate on the recognition of Voronoi diagrams without knowing the sites. Questions of this kind arise in facility location and in the recognition of biological growth models (as report, e.g., in Suzuki and Iri [245]) and, in particular, in the socalled gerrymander problem mentioned in Ash and Bolker [20]: When the sites are regarded as polling places and election law requires that each person votes at the respective closest polling place, the election districts form a Voronoi diagram. If the legislature draws the district lines first, how can we tell whether election law is satisfied? Let Ri and Rj be two of the given regions. Assume that they share a common edge, and let hij be the line containing that edge. Further, let a/y denote the reflection at line htj. LEMMA 4.1. A convex partition R\,..., Rn of the plane defines a Voronoi diagram if and only if there exists a point pi for each region Ri such that the following holds. (1) Pi e Ri {containment condition), (2) crij(pi) = pj if Rj is adjacent to Ri (reflection condition). PROOF. If we do have a Voronoi diagram then its defining sites exist and obviously fulfill (1) and (2). To prove the converse, assume that points p\,..., pn fulfilling both conditions exist. Take any region Ri and any point x therein. We show that d(x, pi) is a minimum. To get a contradiction, suppose pj, j ^ i, is closest to x. Consider an edge of Rj that is intersected by xpj, and let Rk be the region adjacent to Rj at that edge; see Figure 13. Note that k = i may happen. By convexity of Rj and by (1), the line hjk separates pj from X. Hence by (2) we gQtd(x, pk) 0, and ^/pow(x, p) expresses the distance of x to the touching point of a line tangent to the sphere and through x. The locus of equal power with respect to two weighted sites p and ^ is a hyperplane called the power hyperplane of p and q. Let h(p,q) denote the closed halfspace bounded by this hyperplane and containing the points of less power with respect to p. The power cell of p is given by
cell(/7)= P I h{p,q). qeS\[p}
232
F. Aurenhammer
and R. Klein
Fig. 18. Power diagram for circles in the plane.
In analogy to the classical Voronoi regions, the power cells define a partition of Jspace into convex polyhedra, the socalled power diagram, PD{S), of S. See Figure 18 for a planar example. PD(S) coincides with the Voronoi diagram of S if all weights are the same. In contrast to Voronoi regions, power cells might be empty if general weights are used; see cell(/7) in Figure 18. PD(S) is a facetoface cell complex in Jspace that consists of polyhedral faces of various dimensions j , for 0 ^ 7 ^ d. In the nondegenerate case, exactly d \ I edges, ( J ) facets (faces of dimension d — I), and d + 1 cells meet at each vertex of PD(S). For storing a Jdimensional cell complex, the celltuple structure in Brisson [48] seems appropriate. This data structure represents the incidence and ordering information in a cell complex in a simple uniform way. When each weighted site p e S is interpreted as the sphere cTp = (p, ^Jw{p)), we can make the following nice observation. The part of Op that contributes to the union of all these spheres, Une^ ^p^ is just the part of cr^ within cell(/7). This means that PD(S) defines
Voronoi diagrams
233
a partition of this union into simplyshaped and algorithmically tractable pieces. Several algorithms concerning the union (and also the intersection) of spheres are based on this partition; see Avis et al. [32], Aurenhammer [24], and Edelsbrunner [106]. Power diagrams (and thus Voronoi diagrams) are, in a strong sense, equivalent to the boundaries of convex polyhedra in one dimension higher. This is a fact with farranging implications and has been observed in Brown [49], Klee [165], Edelsbrunner and Seidel [113], Paschinger [213], and Aurenhammer [22]. The power function pow(x, p) can be expressed by the hyperplane 7t(p):Xd^i = 2x^p  p^p + w(p) in (d + l)space, in the sense that a point x lies in cell(p) of PD(S) iff, at x, 7t(p) is vertically above all hyperplanes 7t(q) for q e S\ {p}. Hence PD(S) corresponds, by vertical projection, to the upper envelope of these hyperplanes, which is the surface of a convex polyhedron, 17(5), in (d + 1)space. Conversely, it is not difficult to see that every upper envelope of n nonvertical hyperplanes in (d + 1)space corresponds to the power diagram of n appropriately weighted sites in dspact. The following upper bound is a direct consequence of the upper bound theorem for convex polyhedra proved in McMuUen [193]. The bound is trivially sharp for power diagrams, but is achieved also for Voronoi diagrams, as was shown in Seidel [224]. 4.4. Let S be a set ofn point sites in dspace. Any power diagram for S, and in particular, the Voronoi diagram for S, realizes at most fj faces of dimension j , for
THEOREM
Y^ /i\/n
— d^i — 2\
^^y /d — i ^ l\ /n — d \ i — 2\
where a = \^'] and b = [f J. The numbers fj are 0(n^^^),for 0 < j < J — 1. For algorithmic issues, power diagrams can be brought in connection to convex hulls in (d + 1)space, by exploiting a duality (actually, polarity) between upper envelopes of hyperplanes (or intersections of upper halfspaces) and convex hulls of points. This connection is best described by generalizing the lifting map in Subsection 3.5 to weighted points. A site p e S with weight w(p) is transformed into the point Up) = (\p^ T p ^ w(p)J r ^) in (d h 1)space. There is a interelation cdillQd polarity between the transforms k and n. The point k(p) is called the pole of the hyperplane 7t(p) which, in turn, is called the polar hyperplane ofk(p). Polarity defines a onetoone correspondence between arbitrary points and nonvertical hyperplanes in (d + 1)space. It is well known that polarity preserves the relative position of points and hyperplanes. To show the connection to convex hulls, consider an arbitrary face / of the polyhedron n(S). Let / be the intersection of m = d — j\l hyperplanes 7r(/7i),..., 7t(pm), such
234
F. Aurenhammer and R. Klein
that / is of dimension j . Each point x e f lies on these but above all other hyperplanes n(q) defined by S. Hence the polar hyperplane of x has the points X(pi),..., X{pm) on it and the remaining points X{q) above it. This shows that the points X(/7i),..., X(pm) span a face of dimension d — j of the convex hull of the point set {Xip) \ p e S}. We conclude that each 7dimensional face of /7(5), and thus of PD(S), is represented by a (J — 7)dimensional face of this convex hull. This implies a duaUty between power diagrams in Jspace and convex hulls in (d + l)space. In the special case of an unweighted point set 5 in the plane, the parts of the convex hull that are visible from the plane project to the vertices, edges, and triangles of the Delaunay triangulation of S, and we obtain Theorem 3.5 of Section 3.5. A triangulation which can be obtained by projecting a convex hull is called a regular triangulation in Edelsbrunner and Shah [115]. Regular triangulations are just those being dual to planar power diagrams. Once the convex hull of {k(p) \ p e S] has been computed, the faces of PD(S), as well as their incidence and ordering relations, can be obtained in time proportional to the size of PD(S). 4.5. Let Cd\\ (n) be the time needed to compute a convex hull ofn points in (d +1)space. A power diagram (and in particular, the Voronoi diagram) of a given npoint set in dspace can be computed in Cj+i (n) time. THEOREM
Worstcase optimal convex hull algorithms working in general dimensions have been designed by Clarkson and Shor [74], Seidel [229], and Chazelle [58], yielding Q+i(«) = 0(n logn h n^2^). So Theorem 4.5 is asymptotically optimal in the worst case. Note, however, that power diagrams in Jspace may as well have a fairly small size, 0(/i), which emphasizes the use of outputsensitive convex hull algorithms. The algorithm in Seidel [226] achieves C^+i (n) = 0(n^ + / log / ) , where / is the total number of faces of the convex hull constructed. The latest achievements are C4 = 0((n h / ) log^ / ) in Chan et al. [56] and C5 = 0((n + / ) log'^ / ) in Amato and Ramos [15]. Space constraints preclude our discussion of power diagrams. Still, some remarks are in order to point out their central role within the context of Voronoi diagrams. For a detailed discussion and references, see Aurenhammer and Imai [30]. The regions of a Voronoi diagram are usually defined by a set of sites and a distance function. If the regions are polyhedral, then any such Voronoi diagram can be shown to be the power diagram of a suitable set of weighted point sites. For instance, this is the case for the furthest site Voronoi diagram, whose regions consist of all points having the same furthest site in the given set. A polyhedral cell complex in Jspace is called simple if exactly d\l cells meet at each vertex. For example, the Voronoi diagram of a set of point sites in Jspace is simple if no d \2 sites are cospherical. If J ^ 3, any simple cell complex can be shown to be a power diagram. The class of power diagrams is closed under taking crosssections with a hyperplane. That is, the diagram obtained from intersecting a power diagram in Jspace with a hyperplane is again a power diagram, in (d — 1)space. Moreover, the class of power diagrams is closed under the modifications to higher order defined in Subsection 4.3.3.
Voronoi diagrams
235
Several generalized Voronoi diagrams in Jspace have an embedding in a power diagram in {d + 1)space, in the sense that they can be obtained by intersecting a power diagram with certain simple geometric objects and then projecting the intersection. For example, the additively weighted Voronoi diagram (i.e., the closestpoint Voronoi diagram for spheres, or the JohnsonMehl model [153]), and the multiplicatively weighted Voronoi diagram (or the Apollonius model) have this property. In all situations mentioned above, a set of weighted sites for the corresponding power diagram can be computed easily. Thus general methods of handling Voronoi diagrams and cell complexes become available. For example, the Voronoi diagram for spheres in 3space, and the multiplicatively weighted Voronoi diagram in the plane, can both be computed in 0{n^) time which is optimal. The latter diagram is investigated in detail in Aurenhammer and Edelsbrunner [28] and in Sakamoto and Takagi [223]. 4.3.3. Higherorder Voronoi diagrams and arrangements. Higherorder Voronoi diagrams are natural and useful generalizations of classical Voronoi diagrams. Given a set S of n point sites in Jspace, and an integer k between 1 and n — 1, the orderk Voronoi diagram of S, Vk{S), partitions the space into regions such that each point within a fixed region has the same k closest sites. V\ (S) just is the classical Voronoi diagram of S. The regions of Vk (S) are convex polyhedra, as they arise as the intersection of halfspaces bounded by symmetry hyperplanes of the sites. A subset Mofk sites in S has a nonempty region in Vk(S) iff there is a sphere that encloses M but no site in 5 \ M. In fact, the region of M in Vk(S) just is the set of centers of all such spheres. Figure 19 illustrates a planar order2 Voronoi diagram. Two differences to the classical Voronoi diagram are apparent. A region need not contain its defining sites, and the bisector of two sites may contribute more than one facet. In the extreme case of k = n — 1, the furthestsite Voronoi diagram of S is obtained. It contains, for each site p e S, the region of all points x for which p is the furthest site in S. Exact upper bounds on the size of furthestsite Voronoi diagrams in Jspace are derived in Seidel [227]. The family of all higherorder Voronoi diagrams for a given set S of sites in Jspace is closely related to an arrangement of hyperplanes in (d \1)space; see Edelsbrunner and Seidel [113]. We describe this relationship in the more general setting of power diagrams, by defining an order/: power diagram, PDk(S), for a set S of weighted point sites in an analogous way. See Aurenhammer [22,27] for more details. Recall from Subsection 4.3.2 that the power function with respect to a site p e S can be expressed by a hyperplane 7t(p) in (d + l)space. The set of hyperplanes {nip) \ p e S} dissects (d + 1)space into a polyhedral cell complex called an arrangement. Arrangement cells are convex, and can be classified according to their relative position with respect to the hyperplanes in [7z{p) \ p ^ S). A cell C is said to be of level k if exactly k hyperplanes are vertically above C. For example, the upper envelope of [n^p) \ p e S} bounds the only cell, 11 (S), of level 0. All cells of level 1 share some facet with n(S), so that their vertical projection gives the (order1) power diagram PD(S). More generally, the cells of level k project to the regions of PDk(S), for each k between 1 and n — 1. To see this, let x be a point in some ^level cell C. Then k hyper
236
F. Aurenhammer and R. Klein
Fig. 19. Region of {p,q} in V2('^)
planes 7r(/?i),..., Tr(pk) are above x, and n — k hyperplanes 7T(pk\\),..., 7t(pn) are below X. That means that, for the vertical projection x^ of x onto Jspace, we have pow(x^ Pi) < pow(jc', pj) for 1 ^ / ^ /: and k \ I ^ j ^ n. Hence x^ is a point in the region of {p\,..., pk) in PDk(S). Hyperplane arrangements are wellinvestigated objects, concerning their combinatorial as well as their algorithmic complexity; see Edelsbrunner et al. [112,114]. We obtain: THEOREM 4.6. Let S be a set ofn {weighted or unweighted) point sites in dspace. The family of all higherorder power diagrams {or Voronoi diagrams) for S realizes a total of 0 (^^+1) faces, and it can be computed in optimal G {n^^ ^) time.
Clarkson and Shor [74] proved that the number of arrangement cells with levels up to a given value oik is 0{n^^^'^^k^^^'^^). The collection of these cells can be constructed within this time for J > 4, with the algorithm in Mulmuley [203]. A modification by Agarwal et al. [2] achieves roughly 0{nk^) time also in 3space. An outputsensitive construction algorithm is given in Mulmuley [204]. All these results apply to families of order/: diagrams in one dimension lower.
Voronoi diagrams
237
Most practical applications ask for the computation of a single order^ Voronoi diagram Vk(S) in the plane, for a given value of k. (Typically, k does not depend on \S\=n but is a small constant.) As for the classical Voronoi diagram V(S), edges are pieces of perpendicular bisectors of sites. Vertices are centers of circles that pass through three sites. However, these circles are no longer empty; they enclose either /: — 1 or ^ — 2 sites. Lee [181] showed that this diagram has 0(k(n — k)) regions, edges, and vertices. It is easy to see that the regions of ViiS) are in onetoone correspondence with the edges of V(S). Hence ViiS) realizes at most 3^ — 6 regions in the plane. Considerable efforts have been made to compute the single planar order^ Voronoi diagram efficiently. Different approaches have been taken in Lee [181], Chazelle and Edelsbrunner [59], Aurenhammer [26], Clarkson [71], and Agarwal et al. [2]. In the last two papers randomized runtimes of 0(^n^+^) and (roughly) 0(k(n — k)\ogn) are achieved, respectively, which is close to optimal. Below we describe a (roughly) 0(k^(n — k) \ogn) time randomized incremental algorithm by Aurenhammer and Schwarzkopf [31], that can be modified to handle arbitrary online sequences of site insertions, site deletions, and knearest neighbor queries. Though not being most time efficient, the algorithm profits by its simplicity and flexibility. The heart of the algorithm is a duality transform that relates the diagram Vk (S) to a certain convex hull in 3space. This transform allows us to insert and also delete sites in a simple fashion by computing convex hulls. Let M c S be any subset of k sites. M is transformed into a point q(M) in 3space, by taking the centroid of M and lifting it up vertically. More precisely.
Now consider the set Qk (5) of all points that can be obtained from S in this way. That is, e^(5) = { ^ ( M )  M c 5 } . LEMMA
4.2. The part of the convex hull of Qk (S) that is visible from the plane is dual to
Vkisy The lemma can be proved by first mapping each ^subset M of 5 into a nonvertical plane 7t{M) in 3space,
PGM
peM
and then considering the upper envelope HkiS) of all these planes. It is not difficult to show that the facets of Flk (S) project vertically to the regions of Vk(S). The lemma follows from observing the polarity (cf. Subsection 4.3.2) between the planes 7t(M) and the points To construct Vk(S), we could just compute Qk(S), determine its convex hull, and then dualize its triangles, edges, and vertices that are visible from the plane. However, Qk (S)
238
F. Aurenhammer and R. Klein
contains a point for each /^subset of 5, and thus has cardinaHty (^) = 0 (n^). Only 0(k(n — k)) points He on the convex hull, as Vk{S) has this many regions. We use randomized incremental insertion of sites in order to compute this convex hull efficiently. Let S = [p\,..., pn), and let C/ denote the visible part of the convex hull of Qk{{p\,...,/?/}), for ^ 41 ^ / ^n. Points of Qk (S) lying on the triangular surface C/ are called corners of C/. We start by determining Q + i . Qk({p\, ", Pk+\}) contains k\\ points which can be calculated in time 0{k), so Oiklogk) time suffices. The generic step of the algorithm is the insertion of site /?/ into C/_ i, for / > /: + 2. (1) Identify all triangles of C/_i which are destroyed by pi and cut them out. Let B be the set of comers on the boundary of the hole. (2) Calculate the set P of all new comers created by pi. (3) Compute the convex hull of P U J5, and fill the hole with the visible part Ft of this convex hull. This gives C/. Each triangle A of C/_i is dual to a vertex of Vk{S). This vertex is the center of a circle that passes through three sites m S, A will be destroyed if this circle encloses pt. The destroyed triangles of C/_i form a connected surface I^i\. Hence, if we know one of them in advance, iJ/_i can be identified in time proportional to the number ni of its triangles. Moreover, the set P of new comers can be calculated easily from the edges of Uii, as each such edge gives rise to a unique comer. LEMMA 4.3. Given C/_i we can construct Ci in time 0(/2/ log/i/), provided we know a triangle ofCi\ that is destroyed by /?/.
When looking for a starting triangle of X',!, we profit from another nice property of the duality transform: If the vertical projection A' of a triangle A of C/_i contains pt then A is destroyed by the insertion of pi. This leaves us with the problem of locating pt in the triangulation given by the planar projection of C/_ i. In fact, we get the desired pointlocation stmcture nearly for free. Adapting a technique used in Guibas et al. [135] for constmcting Delaunay triangulations, we do not remove the triangles of C/_ i that get destroyed by the insertion of pi, but mark them as old. When marked old, each triangle gets a pointer to the newly constmcted part Ft of C/. The next site then is located by scanning through the 'construction history' of C/. The structure for point location within each surface Fy, j ^ /, which is needed in addition, is a byproduct of the randomized incremental convex hull algorithm in [135], which we used for computing Fj. In summary, the order/: Voronoi diagram for n sites in the plane can be computed in expected time 0{{k^{n — k))\ogn + nk\o^n), and optimal 0(k(n — k)) deterministic space, by an online randomized incremental algorithm. Full details and the following extensions are given in [31]. Deletion of a site can be done in the reverse order of insertion, again by computing a convex hull. The historybased point location structure used by the algorithm can be adapted to support ^nearest neighbor queries (see Subsection 5.1.1). A dynamic data stmcture is obtained, allowing for insertions and deletions of sites in expected time 0(k^ \ogn \ klog^ n), and A:nearest neighbor queries in expected time 0(klog^n). This promises a satisfactory performance for small values of k.
Voronoi diagrams
239
4.4. Generalized sites It is commonly agreed that most geometric scenarios can be modeled with sufficient accuracy by polygonal objects. Two typical and prominent examples are the description of the workspace of a robot moving in the plane, and the geometric information contained in a geographical map. In both applications, robot motion planning and geographical information systems, the availability of proximity information for the scenario is crucial. This is among the reasons why considerable attention has been paid to the study of Voronoi diagrams for polygonal objects. Still, in some applications the scenario can be modeled more appropriately when curved objects, for instance, circular arcs are also allowed. Many Voronoi diagram algorithms working for line segments can be modified to work for curved objects as well. 4.4.1. Line segment Voronoi diagram and medial axis. Let G be a planar straight line graph on n points in the plane, that is, a set of noncrossing fine segments spanned by these points. For instance, G might be a tree, or a collection of disjoint line segments or polygons, or a complete triangulation of the points. The number of segments of G is maximum, 3n — 6, in the last case. We will discuss several types of diagrams for planar straight line graphs in the present and following subsections. The classical type is the {closestpoint) Voronoi diagram, V(G), of G. It consists of all points in the plane which have more than one closest segment in G. V{G) is known under different names in different areas, for example, as the line Voronoi diagram or skeleton of G, or as the medial axis when G is a simple polygon. Applications in such diverse areas as biology, geography, pattern recognition, computer graphics, and motion planning exist; see, e.g. Kirkpatrick [161] and Lee [180] for references. See Figure 20. V{G) is formed by straight line edges and parabolically curved edges, both shown as dashed lines. Straight edges are part of either the perpendicular bisector of two segment endpoints, or of the angular bisector of two segments. Curved edges consist of points equidistant from a segment endpoint and a segment's interior. There are two types of vertices, namely of type 2 having degree two, and of type 3 having degree three (provided G is in general position). Both are equidistant from a triple of objects (segment or segment endpoint), but for type2 vertices the triple contains a segment along with one of its endpoints. Together with G's segments, the edges of V(G) partition the plane into regions. These can be refined by introducing certain normals through segment endpoints (shown dotted in Figure 20), in order to delineate/ace^ each of which is closest to a particular segment or segment endpoint. Two such normals start at each segment endpoint where G forms a reflex angle, and also at each terminal of G which is an endpoint belonging to only one segment in G. A normal ends either at a type2 vertex of V(G) or extends to infinity. It is well known that the number of faces, edges and vertices of V{G) is linear in n, the number of segment endpoints for G. The number of vertices is shown to be at most An — 3 in Lee and Drysdale [182]. An exact bound, that also counts the 'infinite' vertices at unbounded edges and segment normals, is given below.
240
F. Aurenhammer
and R. Klein
..6
Fig. 20. Line segment Voronoi diagram.
LEMMA 4.4. Let G be a planar straight line graph on n points in the plane, and let G realize t terminals and r reflex angles. The number of {finite and infinite) vertices of V{G) is exactly 2n \1 \ r — 2. PROOF. Suppose first that G consists of e disjoint segments (that do not touch at their endpoints). Then there are e regions, and each type3 vertex belongs to three of them. By the Euler formula for planar graphs, there are exactly 2^ — 2 such vertices, if we also count those at infinity. To count the number of type2 vertices, observe that each segment endpoint is a terminal and gives rise to two segment normals each of which, in turn, yields one (finite or infinite) vertex of type 2. Hence there are 4e such vertices, and 6^ — 2 vertices in total. Now let G be a general planar straight line graph with e segments. We simulate G by disjoint segments, by shortening each segment slightly such that the segment endpoints are in general position. Then we subtract from 6^ — 2 the number of vertices which have been generated by this simulation.
Voronoi diagrams
241
Consider an endpoint p that is incident to J ^ 2 segments of G. Obviously, p gives rise to d copies in the simulation. The Voronoi diagram of these copies has d — 2 finite vertices, which are new vertices of type 3. As the sum of the degrees J > 2 in G is 2e — /, we get 2e — t — 2(n — t) new vertices in this way. Each convex angle at p gives rise to two new normals emanating at the respective copies of /?, and thus to two (finite) type2 vertices. A possible reflex angle at p gives rise to one (finite or infinite) type3 vertex, on the perpendicular bisector of the corresponding copies of p. There are r reflex angles in G, and thus 2e — t — r convex angles. This gives D r + 2(2^ — t — r) new vertices in addition. The lemma follows by simple arithmetic. Surprisingly, the number of edges of G does not influence the bound in Lemma 4.4. The maximum number of vertices, ?>n — 2, is achieved, for example, if G is a set of disjoint segments {t = n and r = 0), or if G is a simple polygon P (t = 0 and r =n). In the latter case, the majority of appHcations concerns the part of V(P) interior to P. This part is commonly called the medial axis of P. The medial axis of an ngon with r reflex interior angles has a treelike structure and realizes exactly n \ r — 2 vertices and at most 2(n + r) — 3 edges. Lee [180] first mentioned this bound, and also listed some applications of the medial axis. An interesting application to NC pocket machining is described in Held [139]. Several algorithms for computing V{G), for general or restricted planar straight line graphs G, have been proposed and tested for practical efficiency. V (G) can be computed in 0{n logn) time and 0{n) space by divide & conquer (Kirkpatrick [161], Lee [180], and Yap [261]), plane sweep (Fortune [125]), and randomized incremental insertion (Boissonnat et al. [43] and Klein et al. [170]). Burnikel et al. [51] give an overview of existing methods, and discuss implementation details of an algorithm in Sugihara et al. [243] that first inserts all segment endpoints, and then all the segments, of G in random order. An algorithm of comparable simplicity and practical efficiency (though with a worstcase running time of 0(n^)) is given in Gold et al. [130]. They first construct a Voronoi diagram for point sites by selecting one endpoint for each segment, and then maintain the diagram while expanding the endpoints, one by one, to their corresponding segments. During an expansion, the resulting topological updates in the diagram can be carried out efficiently. In fact, Voronoi diagrams for moving point sites are wellstudied concepts; see, e.g. Guibas et al. [134] and Roos [221]. An efficient 0{n\o^n) work parallel algorithm for computing V(G) is given in Goodrich et al. [132]. This is improved to O(logn) parallel (randomized) time using 0(n) processors in Rajesekaran and Ramaswami [218]. (The latter result also implies an optimal parallel construction method for the classical Voronoi diagram.) If G is a connected graph then V{G) can be computed in randomized time 0{n log* n)\ see Devillers [88]. Recently, 0{n) time randomized, and deterministic, algorithms for the medial axis of a simple polygon have been designed by Klein and Lingas [169] and Chin et al. [68], settling open questions of long standing. The case of a convex polygon is considerably easier; see Subsection 4.4.3. Some of the algorithms above also work for curved objects. The planesweep algorithm in Fortune [125] elegantly handles arbitrary sets of circles (i.e., the additively weighted
242
F. Aurenhammer and R. Klein
Voronoi diagram, or JohnsonMehl model) without modification from the point site case. Yap [261] allows sets of disjoint segments of arbitrary degreetwo curves. A randomized incremental algorithm for general curved objects is given in Alt and Schwarzkopf [12]. They show that complicated curved objects can be partitioned into 'harmless' ones by introducing new points. All these algorithms achieve an optimal running time, 0{n \ogn). In dimensions more than two, the known results are sparse. The complexity of the Voronoi diagram for n line segments in Jspace may be as large as Q{n^~^), as was observed by Aronov [17]. By the relationship of Voronoi diagrams to lower envelopes of hypersurfaces (see Subsection 4.6), the results in Sharir [234] imply an upper bound of roughly O(n^). No better upper bounds are known even for line segments in 3space. The Voronoi diagram for n spheres in Jspace has a size of only 0(nL^/^^+^), by its relationship to power diagrams proved in Aurenhammer and Imai [30]. A case of particular interest in several applications is the medial axis M(P) of a (generally nonconvex) polyhedron P in 3space. M(P) contains pieces of parabolic and hyperbolic surfaces and thus has a fairly complicated structure. A practical and numerically stable algorithm for computing M(P) is proposed in Milenkovic [198]. 4.4.2. Straight skeletons. In comparison to the Voronoi diagram for point sites, which is composed of straight edges, the occurrence of curved edges in the line segment Voronoi diagram V(G) is a disadvantage in the computer representation and construction, and sometimes also in the application, of V(G). There have been several attempts to linearize and simplify V(G), mainly for the sake of efficient point location and motion planning; see Canny and Donald [54], Kao and Mount [155], de Berg et al. [80], and McAlhster et al. [191]. The compact Voronoi diagram in [191] is particularly suited to these applications. It is defined for the case where G is a set of k disjoint convex polygons. Its size is only 0(k), rather than 0(n), and it can be computed in time 0(k logn); see Subsection 5.1.1 for more details. As a different alternative to V(G), we now describe the straight skeleton, S(G), of a planar straight line graph G. This structure is introduced, and discussed in much more detail, in Aichholzer and Aurenhammer [9]. 5(G) is composed of angular bisectors and thus does not contain curved edges. In general, its size is even less than that of V(G). Beside its use as a type of skeleton for G, 5(G) applies, for example, to the reconstruction of terrains from a given geographical map as will be sketched later. 5(G) is defined as the interference pattern of certain wavefronts propagated from the segments and segment endpoints of G. Let F be a connected component (called SL figure) of G. Imagine F as being surrounded by a belt of (infinitesimally small) width e. For example, a single segment s gives rise to a rectangle of length l^l  26: and width 2s, and a simple polygon P gives rise to two homothetic copies of P with minimum distance 2s. In general, if F partitions the plane into c connected faces then F gives rise to c simple polygons called wavefronts for F. The wavefronts arising from all the figures of G are now propagated simultaneously, at the same speed, and in a selfparallel manner. Wavefront vertices move on angular bisectors of wavefront edges which, in turn, may increase or decrease in length during the propagation. This situation continues as long as wavefronts do not change combinatorially. Basically, there are two types of changes.
Voronoi diagrams
243
Fig. 21. Straight skeleton.
(1) Edge event: A wavefront edge collapses to length zero. (The wavefront may vanish due to three simultaneous edge events.) (2) Split event: A wavefront edge splits due to interference or selfinterference. In the former case, two wavefronts merge into one, whereas a wavefront splits into two in the latter case. After either type of event, we are left with a new set of wavefronts which are propagated recursively. The edges of 5(G) are just the pieces of angular bisectors traced out by wavefront vertices. Each vertex of 5(G) corresponds to an edge event or to a split event. S{G) is a unique structure defining a polygonal partition of the plane; see Figure 21. During the propagation, each wavefront edge e sweeps across a certain area which we call ihtface of e. Each segment of G gives rise to two wavefront edges and thus to two faces, one on each side of the segment. Each terminal of G (endpoint of degree one) gives rise to one face. Faces can be shown to be monotone polygons and thus are simply connected. This gives a total of 2m + ^ = 0(^2) faces, if G realizes m edges and t terminals. There is also an exact bound on the number of vertices of S{G).
244
F. Aurenhammer and R. Klein
4.5. Let G be a planar straight line graph on n points, t of which are terminals. The number of (finite and infinite) vertices of S(G) is exactly 2n\t — 2.
LEMMA
From Lemma 4.4 in the previous subsection it is apparent that 5(G) has r vertices less than V{G) if G has r reflex angles. In particular, if G is a simple polygon with r reflex interior angles, then the part of S{G) interior to G is a tree with only n — 2 vertices, whereas the medial axis of G has n\r — 2 vertices. A wavefront model similar to that yielding S{G) is sometimes used to define the Voronoi diagram V{G) of G (cf. the expanding waves view in Section 2). There, the propagation speed of all points on the wavefront is the same, whereas, in the model for 5(G), the speed of each wavefront vertex is controlled by the angle between its incident wavefront edges. The sharper the angle, the faster is the movement of the vertex. This behaviour may make 5(G) completely different from the Voronoi diagram of G. It can be shown that, without prior knowledge of its structure, S(G) cannot be defined by means of distances from G. Moreover, S{G) does not fit into the framework of abstract Voronoi diagrams described in Subsection 4.6: The bisecting curve for two segments of G would be the interference pattern of the rectangular wavefronts they send out, but these curves do not fulfill condition (ii) in Definition 4.2. As a consequence, the welldeveloped machinery for constructing Voronoi diagrams (see Section 3) does not apply to S{G). An algorithm that simulates the wavefront propagation by maintaining a triangulation of the wavefront vertices is given in [9]. The method is simple and practically efficient but has a worstcase running time of 0(/i^ log«). S{G) has a threedimensional interpretation, obtained by defining the height of a point X in the plane as the unique time when x is reached by a wavefront. In this way, S{G) lifts up to a polygonal surface EG, where points on G have height zero. In a geographical application, G may delineate rivers, lakes, and coasts, and Ec represents a corresponding terrain with fixed slope. EG has the nice property that every raindrop that hits a terrain facet / runs off to the segment or terminal of G defining / ; see Aichholzer et al. [8]. This may have applications in the study of rain water fall and its impact on the floodings caused by rivers in a given geographic area. The concept of 5(G) can be generalized by tuning the propagation speed or angle of the individual wavefront edges, in order to achieve prescribed facet slopes for EG, or individual elevations for the terrain points on G. The size of 5(G), and its construction algorithm, remain unaffected. When restricted to the interior of a simple polygon P, Ep is used in [8] as a canonical construction of a roof of given slope above P. For rectilinear (and axisaligned) polygons P, the medial axis of P in the Loometric will do the job. 5(P) coincides with this structure for such polygons, and thus generalizes this roof construction technique to general shapes of P. Straight skeletons can be generalized to higher dimensions without much difficulties. They retain their piecewiselinear shape and thus, for example, offer a simpler alternative to the medial axis of a nonconvex polyhedron in 3space. 4.4.3. Convex polygons. Voronoi diagrams for a single convex polygon have a particularly simple structure. Tailormade algorithms for their construction have been designed.
Voronoi diagrams
245
Let C be a convex ngon in the plane. The medial axis M{C) of C is a tree whose edges are pieces of angular bisectors of C's sides. In fact, M{C) coincides with the part of the straight skeleton S{C) interior to C. M{C) realizes exactly n faces, n — 2 vertices, and 2/1 — 3 edges. There is a simple randomized incremental algorithm by Chew [62] that computes M{C) in 0{n) time. The algorithm first removes, in random order, the halfplanes whose intersection is C. Removing a halfplane means removing the corresponding side e, and extending the two sides adjacent to e so that they become adjacent in the new convex polygon. This can be done in constant time per side. The adjacency history of C is stored. That is, for each removed side e, one of its formerly adjacent sides is recorded. In a second stage, the sides are put back in reversed (still randomized) order, and the medial axis is maintained during these insertions. Let us focus on the insertion of the /th side et. We have to integrate the face, /(e/), of Ci into the medial axis of the / — 1 sides that have been inserted before et. From the adjacency history, we already know a side e' of the current polygon that will be adjacent to et after its insertion. Hence we know that the angular bisector of et and e' will contribute an edge to /(e/). Having a starting edge available in 0(1) time, the face /(^/) now can be constructed in time proportional to its size. We construct /(^/) edge by edge, by simply tracing and deleting parts of the old medial axis interior to / ( ^ / ) . As the medial axis of an /gon has 2/ — 3 edges, and each edge belongs to two faces, the expected number of edges of a randomly chosen face is less than 4. Thus fiei) can be constructed in constant expected time, which gives an 0{n) randomized algorithm for computing M{C). The same technique also applies to the Voronoi diagram for the vertices of a convex ngon C, that is, to the Voronoi diagram of a set Sofn point sites in convex position. By Lemma 2.2, all regions in V{S) are unbounded, and the edges of V{S) form a tree. Hence V{S) has the same numbers of edges and (finite) vertices as the medial axis of C. For each p e S, its region VR(/?, S) shares an unbounded edge with the regions YR(p\ S) and YR(p^\ 5), where p' and p^^ are adjacent to p on the convex hull of S (which is the polygon C). An adjacency history can be computed in 0(n) time, by removing the sites in random order and maintaining their convex hull. For each site that is reinserted, the expected number of edges is less than 4. So an 0(n) randomized construction algorithm is obtained. The diagrams V(S) and M(C) can also be computed in deterministic linear time; see Aggarwal et al. [4]. The details of this algorithm are much more involved, however. 4.4.4. Constrained Voronoi diagrams and Delaunay triangulations. In certain situations, unconstrained proximity among a set of sites is not enough information to meet practical needs. There might be reasons for not considering two sites as neighbors although they are geometrically close to each other. For example, two cities that are geographically close but separated by high mountains might be far from each other from the point of view of a truck driver. The concepts described below have been designed to model constrained proximity among a set of sites.
F. Aurenhammer
246
and R. Klein
Fig. 22. Bounded Voronoi diagram extended, and its dual.
Let 5 be a set of n point sites in the plane, and let L be a set of noncrossing line segments spanned by S. Note that \L\ ^3n — 6. The segments in L are viewed as obstacles: we define the bounded distance between two points x and y in the plane as
b{x,y) =
d{x,y)
\ixyr\L = 9i,
oo
otherwise,
where d stands for the Euclidean distance. In the resulting bounded Voronoi diagram y ( 5 , L), regions of sites that are close but not visible from each other are clipped by segments in L. Regions of sites being segment endpoints are nonconvex near the corresponding segment; see Figure 22. The dual of V{S, L) is not a full triangulation of S, even if the segments in L are included. However, V{S, L) can be modified to dualize into a triangulation which includes L and, under this restriction, is as much 'Delaunay' as possible. The modification is simple but nice. For each segment € G L, the regions clipped by I from the right are extended to the left of £, as if only the sites of these regions were present. The regions clipped by I from the left are extended similarly; see Figure 22. Of course, extended regions may overlap now, so they fail to define a partition of the plane. If we dualize now by connecting sites of regions that share an edge, a full triangulation that includes L is obtained: the constrained Delaunay triangulation Yyi{S, L). It is clear that the number of edges of DT(5', L) is at most 3n — 6, and that, in general, the number of edges of V(5, L) is even less. Hence both structures have a linear size.
Voronoi diagrams
247
The original definition of DT(5, L) in Lee and Lin [183] is based on a modification of the empty circle property: DTC^, L) contains L and, in addition, all edges between sites p,q e S that have b(p,q) < oo and that lie on a circle enclosing only sites r e S with at least one of b(r, p), b(r, q) = oo. Algorithms for computing V(S, L) and DTC^", L) have been proposed in Lee and Lin [183], Chew [63], Wang and Schubert [255], Wang [254], Seidel [228], and Kao and Mount [156]. The last two methods seem best suited to implementation. For an application of DT(»S, L) to quality mesh generation see Chew [65]. We sketch the 0(n logn) time plane sweep approach in [228]. If only V{S, L) is required then the plane sweep algorithm described in Subsection 3.4 can be applied without much modification. If DT(5, L) is desired then the extensions of V{S, L) as described above are computed in addition. To this end, an additional sweep is carried out for each segment i e L. The sweep starts from the line through i in both directions. It constructs, on the left side of this line, the (usual) Voronoi diagram of the sites whose regions in V(S, L) are clipped by I from the right, and vice versa. The special case where S and L are the sets of vertices, and sides, of a simple polygon has received special attention, mainly because of its applications to visibility problems in polygons. The bounded Voronoi diagram V{S, L) is constructable in 0(n) randomized time in this case; see Klein and Lingas [167]. If the Limetric instead of the Euclidean metric is used to measure distances, the same authors [169] give a deterministic linear time algorithm. Both algorithms, as well as the linear time medial axis algorithms in [168] and in [68], first decompose the polygon into smaller parts called histograms. These are polygons whose vertices, when considered in cyclic order, appear in sorted order in some direction. An alternative concept that forces a set L of line segments spanned by S into DT(*S') is the conforming Delaunay triangulation. For each segment i E L that does not appear in DTC^), new sites on I are added such that i becomes expressible as the union of Delaunay edges in DT(5' U C), where C is the total set of added sites. For several site adding algorithms, \C\ depends on the size as well as on the geometry of L. See, e.g., the survey article by Bern and Eppstein [37] and references therein. Edelsbrunner and Tan [118] show that \C\= 0(k^n) is always sufficient, and construct a set of sites with this size in time
0{k^n\n^)Jork=\L\. A different, and more complicated, type of constrained Voronoi diagram is the geodesic Voronoi diagram. Here, the distance between a point site p and a point x in the plane is equal to the length of the shortest obstacleavoiding path between p and x. The obstacles are usually modeled by a set of noncrossing line segments. If all segment endpoints are sites then the bounded Voronoi diagram is obtained. However, this is typically not the case. The fact that computing geodesic distances is not a constanttime operation complicates the construction of geodesic Voronoi diagrams. The only known subquadratic algorithm is by Mitchell [199]. An 0((^ h k) log(n + k)) time algorithm for the geodesic Voronoi diagram of k sites inside a simple ngon is given in Papadopoulou and Lee [212], improving over an earlier approach in Aronov [16].
248
F. Aurenhammer and R. Klein
4.5. Generalized spaces and distances So far we have mainly discussed Voronoi diagrams of sites in Jspace, that are defined with respect to the Euchdean distance function. Now we want to generaUze both the space in which the sites are situated and the distance measure used; but we shall only discuss the case of point sites. The main questions are which of the structural properties the standard Voronoi diagram enjoys will be preserved, and will the remaining properties be strong enough to apply one of the algorithmic approaches for computing the Voronoi diagram introduced in Section 3. 4.5.1. Generalized spaces. Since the surface of earth is not flat, it seems very natural to ask about Voronoi diagrams of point sites on curved surfaces in 3space. The distance between two points on the surface is the minimum Euclidean length of a curve that connects the points and runs entirely inside the surface. Such a curve will be called a shortest path. Brown [50] has addressed the Voronoi diagram of points on the surface of the twodimensional sphere. Here great circles play the role of lines in the Euchdean plane. In fact, the bisector of two points is a great circle, and the shortest paths are segments of great circles, too. (One can show that the only other metric space in which all bisector segments are shortest paths is the hyperbolic space; see Busemann [52].) For each pair of antipodal points on the sphere there is a continuum of shortest paths connecting them. But this does not affect the Voronoi diagram of n points; it can be computed in optimal 0(/i log n) time and linear space, by adaption of the algorithms mentioned in Section 3. Quite different is the situation on the surface of a cone. In order to determine the bisector of two points, p and q, we can cut the cone along a halfline emanating from the apex, and unfold it; in Figure 23 the halfline diametrically opposed to p has been chosen. Since curve length does not change in this process, each shortest path on the cone that does not cross the cut is transformed into a shortest path in the plane, i.e. into a line segment. In order to represent those shortest paths that cross the cut, we add to the unfolded cone two more copies, as shown in Figure 23(ii). Now the shortest path on the cone from some point x to site q corresponds to the shortest one of the line segments 'qx, q'x, and q^'x. This explains why the unfolded bisector B(p,q) consists of segments of the planar bisectors of p,q and
p,q\ In spite of this strong connection to the plane, the Voronoi diagram of points on a cone has structural properties surprisingly different from the planar Voronoi diagram. If the unfolded cone forms a wedge of angle less than 180° then the bisector of two points can be a closed curve. If three points p,q,r are placed, in this order, on a halfline emanating from the apex of such a cone, the bisector B(q, r) fully encircles B{p, q) which in turn encircles the apex. This causes the Voronoi region of q in V{{p,q, r}) to be not simply connected. Also, the closures of two Voronoi regions can have more than one Voronoi edge in common. Such a situation is shown in Figure 24, on the unfolded cone. The bisectors of the three points cross twice, at the Voronoi vertices v and w\ the latter happens to lie on the cut. (It is interesting to observe that none of these phenomena occurs on the sphere, although there, too, bisectors are closed curves and cross twice.) Despite these fundamental differences to the plane, the Voronoi diagram of n points on the surface of a cone can be constructed in optimal time and space, using a sweep circle that
Voronoi diagrams
249
Fig. 23. A cone sliced and unfolded, showing the bisector of p and q.
Fig. 24. The common border of the Voronoi regions of q and r consists of two Voronoi edges.
expands from the apex; see Dehne and Klein [83]. This approach works without unfolding the cone. Mazon and Recio [190] have independently pointed out the algebraic background of the unfolding procedure illustrated by Figure 23(i), and obtained the following generalization.
250
F. Aurenhammer and R. Klein
Let P denote the Euclidean plane or twodimensional sphere, and let G be a discrete group of motions on P: a group of bijections that leave the distance between any pair of points of P invariant, such that for each point p e P there exists a constant c satisfying
Pl^gip)"^
\pgip)\
^c
for all motions g eG. Examples in the plane are the group generated by a rotation of rational angle about some given point, or the group generated by two translations that move each point afixeddistance to the right and a fixed distance upwards, respectively. In the 19th century, mathematicians have completely classified all discrete groups. Two points p, p^ e P axQ equivalent if there exists a motion in G that takes pio p'', the equivalence class, [/?], of p is called the orbit of p. The quotient space, P/G, consists of all orbits. In order to geometrically represent P/G one starts with a connected subset of P that contains a representative out of every orbit; equivalent points must be on the boundary. Such a set is called a fundamental domain, if it is convex. The following lemma provides a nice way of obtaining a fundamental domain; a proof can be found in Ehrlich and Im Hof[120]. 4.6. Let p be a point of P that is left fixed only by the unit element ofG. Then its Voronoi region VR(/7, [p]) is a fundamental domain.
LEMMA
In Figure 23(ii), for example, the point set {p, p\ p") is the orbit of p under a clockwise rotation by 120°. The Voronoi region VR(/7, {/?, p\ p'^]) equals the master copy of the unfolded cone, as drawn by solid lines. Each interior point x is the only point of [x] contained in this region, only the points on the boundary (i.e. the cut) of the unfolded cone are mapped into each other by rotation. If we identify these two halflines we obtain the cone depicted in Figure 23(i), a model of the quotient space of the Euclidean plane over the cyclic group of order 3. In a similar way we would obtain a rectangle as fundamental domain of the group of two translations mentioned above, and identifying opposite edges would result in a torus. If we want to compute the Voronoi diagram of a set S of point sites on a surface associated with such a quotient space P/G,WQ can proceed as follows. Let So denote a set of representatives of 5 in a fundamental domain D c P. First, we compute the Voronoi diagram V([5o]), where [So] denotes the union of the orbits of the elements of 5o, an infinite but periodic set. Due to [190], ^([^o]) can be obtained by applying the motions in G to the Voronoi diagram of a finite set of points of 5o and translated copies of ^oTHEOREM
4.7. There exists a finite subset U of [So] such that V([So]) = [V(U) (1 D]
holds. If one removes from y([5o]) all Voronoi edges that separate points of the same orbit and intersects the resulting structure with the fundamental domain D, the desired diagram V(S) results, after identifying equivalent points. Although the set ^o can be constructed effectively, it seems hard to establish an upper bound for the efficiency of this step.
Voronoi diagrams
Fig. 25. By dc ip,q) = ,.
251
/. a convex distance function dc with unit circle C is defined.
To mention a few other spaces considered, Ehrlich and Im Hof [120] have studied, from a differential geometrist's point of view, structural properties of the Voronoi diagram in such Riemannian manifolds where any two points are connected by a unique shortest path. In order to compute the Voronoi diagram of n points on SL polyhedral surface in 3space containing m vertices, one can make use of its discrete structure and apply the continuous Dijkstra technique usually employed for computing shortest paths. It allows the Voronoi diagram to be computed in O(A^^logiV) time and O(N^) space, where A^ = max(m, n); see Mitchell et al. [200]. 4.5.2. Convex distance functions. In numerous appHcations the Euclidean metric does not provide an appropriate way of measuring distance. In the following subsections we consider the Voronoi diagram of point sites under distance measures different from the Euclidean metric. We start with convex distance functions, a concept that generalizes the Euchdean distance but slightly. Whereas this generalization does not cause serious difficulties in the plane, surprising changes will occur as we move to 3space. Let C denote a compact, convex set in the plane that contains the origin in its interior. Then a convex distance function can be defined in the following way. In order to measure the distance from a point p to some point q, the set C is translated by the vector p. The half line from p through q intersects the boundary of C at a unique point q'\ see Figure 25. Now one puts
d{p,q) dc(p,q) = ~ . d{p,q') By definition, C equals the unit circle of d, that is, the set of all points q satisfying dc(0,q) ^ 1. The value of dc(p,q) does not change if both p and q are translated by the same vector. One can show that the triangle inequality dc(p,r) ^dc(p,q) \dc(q,r) is fulfilled, with equality holding for colinear points p,q,r.ln general, we have dc(p,q) = dc'iq, p), where C' denotes the reflected image of C about the origin. We can define the Voronoi diagram based on an arbitrary convex distance function by associating with each site p all points x of the plane such that dc(p,x) = 0, ay^^  2Py^j,y + yy^^ = 0, where
p = x^Xy + y^yv
y = ^l + yl'
Mesh generation
303
Software designed to solve these systems often includes an additional source term on the righthand sides of the harmonic system in (4) to control the local point spacing in the domain [129]. The elliptic method just discussed, though motivated by conformal mapping, does not compute true conformal mappings. A true conformal mapping induces a structured mesh with certain advantages; for example, the Laplacian is the limit of the secondorder difference on such a grid. True conformal mapping, however, does not seem to be widely used in mesh generation, perhaps because algorithms to compute such mappings are relatively slow, or because they do not allow local control of point spacing. In the case that ^ is a simple polygon, the SchwarzChristoffel formula offers an explicit form for the conformal mappings from the unit disk D io Q. Such a mapping can in turn be used to find conformal mappings from ^ to a square or rectangle. Let the points in the complex plane defining the polygon (in counterclockwise order) be z i , . . . , Z/i, the interior angles at these points be a i , . . . , a ^ , and define the normalized angles as P/^=ak/7t — 1. Using coi,.. .,(On as the preimages of z\, •  •,Zn on the edge of the disk, the SchwarzChristoffel formula gives the form of the conformal mapping as f{a,) = A\B
f](l§M)^^df •^^
(5)
k=\
There are several programs available to solve for the unknown cok values: SCPACK by Trefethen [133], the SC Toolbox by Driscoll [47], and CRDT by DriscoU and Vavasis [48]. One difficulty in the numerical solution is "crowding", enormous variation in spacing between the (Dk points. CRDT, the latest and apparently best SchwarzChristoffel algorithm, overcomes this difficulty by repeatedly remapping so that crowding does not occur near the points being evaluated.
5. Unstructured twodimensional meshes We have already mentioned the advantages of unstructured meshes: flexibility in fitting complicated domains, rapid grading from small to large elements, and relatively easy refinement and derefinement. Unlike structured mesh generation, unstructured mesh generation has been part of mainstream computational geometry for some years, and there is a large literature on the subject. We consider three principled approaches to unstructured mesh generation in some detail; these approaches use Delaunay triangulation, constrained Delaunay triangulation, and quadtrees. Then we discuss mesh refinement and improvement. In the final section, we describe some geometric problems abstracted from unstructured mesh generation.
5.1. Delaunay triangulation Our first approach to unstructured mesh generation partitions the task into two phases: placement of mesh vertices, followed by triangulation. (Added points are called Steiner
304
M. Bern and P. Plassmann
points to distinguish them from the domain's original vertices.) If the placement phase is smart enough, the triangulation phase can be especially simple, considering only the input vertices and Steiner points and ignoring the input edges. The placement phase typically places vertices along the domain boundary before adding them to the interior. The boundary should be lined with enough Steiner points that the Delaunay triangulation of all vertices will conform to the domain. This requirement inspires a crisp geometric problem, called conforming Delaunay triangulation: given a polygonal domain Q, add Steiner points so that each edge of .^ is a union of edges in the Delaunay triangulation. An algorithm due to Saalfeld [112] lines the edges of Q with a large number of Steiner points, uniformly spaced except near the endpoints. A more efficient solution [96] covers the edges of Q by disks that do not overlap other edges. Edelsbrunner and Tan [52] gave the best theoretical result, an algorithm that uses 0{n^) Steiner points for an ^vertex multiple domain. They also gave an Q{n^) lower bound example. There are several approaches to placing interior Steiner points. One approach [84] combines the vertices from a number of structured meshes. A second approach [10,95] adds Steiner points in successive layers, working in from the domain boundary as in advancing front mesh generation (Section 7.2). Figure 6 shows an example. A third approach [88, 137] chooses interior points at random according to some distribution, which may be interpolated from a coarse quadtree or "background" triangulation. An independent random sample is likely to produce some badly shaped triangles [26], so the generator should oversample and then filter out points too close to previously chosen points [88]. Finally, there are deterministic methods that achieve essentially the same effect as random sampling with filtering; these methods [29,120] define birth and death rules that depend upon the density of neighboring points. All of these methods can give anisotropy. The first and second approaches, structured submeshes and advancing front, offer local control of element shapes and orientations. These approaches may space points improperly where structured meshes or advancing fronts collide, but this flaw can usually be corrected by filtering points and later smoothing the mesh. The third and fourth approaches trade direct control over element shapes for ease of fitting complicated geometries. Nevertheless, one can achieve anisotropy with these approaches by computing the Delaunay triangulation within a stretched space [29,36,43]. For example, Bossen [29] uses a "background" triangulation to define local affine transformations; Delaunay flips (described below) are then made with respect to transformed circles. Stretched Delaunay triangulations have many more large angles than ordinary Delaunay triangulations, but this should not pose a problem unless the stretching exceeds the desired amount (Section 3). The triangulation phase uses the wellknown Delaunay triangulation. The Delaunay triangulation of a point set S = [s\,S2,.. .,Sn} is defined by the empty circle condition: a triangle siSjSk appears in the Delaunay triangulation DT(5) if and only if its circumcircle encloses no other points of S. See Figure 7(a). There is an exception for points in special position: if an empty circle passes through four or more points of 5, we may triangulate these points — complete the triangulation — arbitrarily. So defined, DT(5) is a triangulation of the convex hull of 5. For our purposes, however, we can discard all triangles that fall outside the original domain Q.
Mesh
generation
305
Fig. 6. Delaunay triangulation of points placed by an advancing front (T. Barth).
Fig. 7. (a) Delaunay triangulation. (b) A reversed quadrilateral.
There are a number of practical Delaunay triangulation algorithms [56]. We describe only one, called the edge flipping algorithm, because it is most relevant to our subsequent discussion. Its worstcase running time of O(n^) is suboptimal, but it performs quite well in practice. The edge flipping algorithm starts from any triangulation of S and then locally optimizes each edge. Let e be an internal (nonconvexhull) edge and Qe be the triangulated quadrilateral formed by the triangles sharing e. Quadrilateral Qe is reversed if the two angles without the diagonal sum to more than 180°, or equivalently, if each triangle circumcircle contains the opposite vertex as in Figure 7(b). If Qe is reversed, we "flip" it by exchanging e for the other diagonal. compute an initial triangulation of S place all internal edges onto a queue while the queue is not empty do remove the first edge e if quadrilateral Qe is reversed then flip it and add the outside edges of Qe to the queue endif endwhile An initial triangulation can be computed by a sweepline algorithm. This algorithm adds the points of S by xcoordinate order. Upon each addition, the algorithm walks around the
306
M. Bern and P. Plassmann ^4.
Fig. 8. A sweepline algorithm for computing an initial triangulation.
convex hull of the alreadyadded points, starting from the rightmost previous point and adding edges until the slope reverses, as shown in Figure 8. The following theorem [45] guarantees the success of edge flipping: a triangulation in which no quadrilateral is reversed must be a completion of the Delaunay triangulation.
5.2. Constrained Delaunay triangulation There is another way, besides conforming Delaunay triangulation, to extend Delaunay triangulation to polygonal domains. The constrained Delaunay triangulation of a (possibly multiple) domain ^ does not use Steiner points, but instead redefines Delaunay triangulation in order to force the edges of Q into the triangulation. A point p is visible to a point q'mQ li the open line segment pq Hes within Q and does not intersect any edges or vertices of ^ . The constrained Delaunay triangulation CDT(^) contains each triangle not cut by an edge of i?, that has an an empty circumcircle, where empty now means that the circle does not contain any vertices of Q visible to points inside the triangle. The visibility requirement means that external proximities, where ^ wraps around to nearly touch itself, have no effect. Figure 9 provides an example; here vertex v is not visible to any point in the interior of triangle abc. The edge flipping algorithm can be generalized to compute the constrained Delaunay triangulation, only this time we do not allow edges of I? onto the queue. Obtaining an initial triangulation is somewhat more difficult for polygonal domains than for point sets. The textbook by Preparata and Shamos [103] describes an 0(«logn)time algorithm for computing an initial triangulation. This algorithm first adds edges to Q to subdivide it into easytotriangulate "monotone" faces. Ruppert [111], building on work of Chew [38], gave a meshgeneration algorithm based on constrained Delaunay triangulation. (Subsequently, Mitchell [90] sharpened Ruppert's analysis, and Shewchuk [117,118] further refined the algorithm and made an implementation available on the Web.) Ruppert's algorithm computes the constrained Delaunay triangulation at the outset and then adds Steiner points to improve the mesh, thus uniting the two phases of the approach described in the last section. In choosing this approach, the
Mesh
generation
307
Fig. 9. The constrained Delaunay triangulation of a polygon with holes.
Fig. 10. A mesh computed by Ruppert's algorithm (J. Ruppert).
user gives up some control over point placement, but obtains a more efficient mesh with fewer and "rounder" triangles. The first step of Ruppert's mesh generator cuts off all vertices of the domain Q at which the interior angle measures less than 45°. The cutting line at such a vertex v should not introduce a new small feature to ^ ; it is best to cut off an isosceles triangle whose base is about halfway from v to its closest visible neighbor. If v has degree greater than two, as might be the case in a multiple domain, then the bases of the isosceles triangles around v should match up so that no isosceles triangle receives a Steiner point on one of its legs. Next the algorithm computes the constrained Delaunay triangulation of the modified domain. The algorithm then goes through the loop given below. The last line of the loop repairs a constrained Delaunay triangulation after the addition of a new Steiner point c. To accomplish this step, there is no need to recompute the entire triangulation. The removed
308
M. Bern and P. Plassmann
old triangles are exactly those with circumcircles containing c, which can be found by searching outwards from the triangle that contains c, and the new triangles that replace the removed triangles must all be incident to the new vertex c. while there exists a triangle t with an angle smaller than 20° do let c be the center of r's circumcircle if c lies within the diameter semicircle of a boundary edge e then add the midpoint m of ^ else add c endif recompute the constrained Delaunay triangulation endwhile The loop is guaranteed to halt with all angles larger than 20°. At this point, the cutoff isosceles triangles are returned to the domain, and the mesh is complete. Ruppert's algorithm comes with a strong theoretical guarantee: all new angles, that is, angles not present in the input, are greater than 20°, and the total number of triangles in the mesh is at most a constant times the minimum number of triangles in any such nosmallangle mesh. To prove this efficiency result, Ruppert shows that each triangle in the final mesh is within a constant factor of the local feature size at its vertices. The local feature size at point p e Q is defined to be the radius of the smallest circle centered at p that touches two nonadjacent edges of the boundary; this is a spacing function intrinsic to the domain.
5.3. Quadtrees A quadtree mesh generator [8,25,143] starts by enclosing the entire domain ^ inside an axisaligned square. It splits this root square into four congruent squares, and continues splitting squares recursively until each minimal — or leaf — square intersects ^ in a simple way. Further splits may be dictated by a userdefined spacing function or balance condition. Quadtree squares are then warped and cut to conform to the boundary. A final triangulation step gives an unstructured triangular mesh. We now describe a particular quadtree mesh generator due to Bern, Eppstein, and Gilbert [25]. As first presented, the algorithm assumes that ^ is a polygon with holes; however, the algorithm can be extended to multiple and even to curved domains. In fact, the quadtree approach handles curved domains more gracefully than the Delaunay and constrained Delaunay approaches, because the splitting phase can automatically adapt to the curvature of enclosed boundary pieces. The algorithm of Bern et al. splits squares until each leaf square contains at most one connected component of ^ ' s boundary, with at most one vertex. Mitchell and Vavasis [91] improved the splitting phase by "cloning" squares that intersect Q in more than one connected component, so that each copy contains only a single connected component of Q. The algorithm then splits squares near vertices of Q two more times, so that each vertex lies within a buffer zone of equal size squares. Next the mesh generator imposes a balance condition: no square should be adjacent to one less than onehalf its size. This causes more splits to propagate across the quadtree, increasing the total number of leaf squares by a constant factor (at most 8). Squares are
Mesh
generation
309
Fig. 11. A mesh computed by a quadtreebased algorithm (S. Mitchell).
then warped to conform to the domain Q. Various warping rules work; we give just one possibihty. In the following pseudocode, \b\ denotes the side length of square b. for each vertex u of i? do let y be the closest quadtree vertex to v move y iov endfor for each leaf square b still crossed by an edge e do move the vertices of b that are closer than \b\/Aio eio their closest points on e endfor discard faces of the warped quadtree that lie outside Q Finally, the cells of the warped quadtree are triangulated so that all angles are bounded away from 0°. Figure 11 gives a mesh computed by a variant of the quadtree algorithm. This figure shows that cloning ensures appropriate element sizes around holes and "almost holes". Notice that a quadtreebased mesh exhibits preferred directions — horizontal and vertical. If this artifact poses a problem, mesh improvement steps can be used to redistribute element orientations. The quadtree algorithm enjoys the same efficiency guarantee as Ruppert's algorithm. In fact, the quadtree algorithm was the first to be analyzed in this way [25].
5.4. Mesh refinement and derefinement Adaptive mesh refinement places more grid points in areas where the PDF solution error is large. Local error estimates based on an initial solution are known as a posteriori error estimates [7] and can be used to determine which elements should be refined. For elliptic
310
M. Bern and P. Plassmann
problems these estimators asymptotically bound the true error and can be computed locally using only the information on an element [138]. One approach to mesh refinement [71] iteratively inserts extra vertices into the triangulation, typically at edge bisectors or triangle circumcenters as in Section 5.2. New vertices along the boundaries of curved domains should be computed using the curved boundary rather than the current straight edge, thereby giving a truer approximation of the domain as the mesh refines [36]. Iterative vertex insertion may be viewed as a mesh improvement step (Section 5.5), and indeed several generators [29,119,139] have combined insertion/deletion, flipping, and smoothing into a single loop. Iterative vertex insertion gives a finer mesh, but not a nesting or edge conforming, refinement of the original mesh, meaning a mesh that includes the boundaries of the original triangles. Nesting refinements simplify the interpolation step in the multigrid method (Section 2.2). To compute such a refinement, we turn to another approach. This approach splits triangles in need of refinement, by adding the midpoints of sides. The pseudocode below gives the overall approach. solve the differential equation on the initial mesh TQ estimate the error on each triangle while the maximum error on a triangle is larger than the given tolerance do based on error estimates, mark a set of triangles Sk to refine * divide the triangles in Sk, along with adjacent invalid triangles to get T^^i solve the differential equation on T^+i estimate the error on each triangle k = k+\ endwhile There are a number of popular alternatives for step *, in which the current mesh Tk is adaptively refined. In regular refinement [11,12], the midpoints of the sides of a marked triangle are connected, as in Figure 12(b), to form four similar triangles. Unmarked triangles that received two or three midpoints are split in the same way. Unmarked triangles that received only one midpoint are bisected by connecting the midpoint to the opposite vertex as in Figure 12(a). Before the next iteration of •, bisected triangles are glued back together and then marked for refinement; this precaution guarantees that each triangle in Tk^\ will either be similar to a triangle in To or be the bisection of a triangle similar to a triangle in TQ. Thus, regular refinement — regardless of the number of times through the refinement loop — produces a mesh with minimum angle at least half the minimum angle in 7b. Hence the angles in T^+i are bounded away from 0 and n. Rivara [107109] proposed several alternatives for step • based on triangle bisection. One method refines each marked triangle by cutting from the opposite vertex to the midpoint of the longest edge. Neighboring triangles are now invalid, meaning that one side contains an extra vertex; these triangles are then bisected in the same way. Bisections continue until there are no remaining invalid triangles. Refinement can propagate quite far from marked triangles; however, propagation cannot fall into an infinite loop, because along a propagation path each bisected edge is longer than its predecessor. This approach, like the previous one, produces only a finite number of different triangle shapes — similarity
Mesh
generation
311
Fig. 12. A triangle divided by (a) bisection, and (b) regular refinement.
Fig. 13. The bisection algorithm given in the pseudocode splits invalid children of refined triangles to their subdivision points, rather than to their longest edges.
classes — and the minimum angle is again at least half the smallest angle in TQ. Quite often longestedge refinement actually improves angles. A second Rivara refinement method is given in the pseudocode below and illustrated in Figure 13. This method does not always bisect the longest edge, so bisections tend to propagate less, yet the method retains the same final angle bound as the first Rivara method. Qi = Sk {Q denotes "marked" triangles to be refined} Ri =0 {R denotes children of refined triangles} while (Q/U/?/) 7^0 do bisect each triangle in Qi across its longest edge bisect each triangle in Rt across its subdivided edge add all invalid children of Qi triangles to Ri^\ add all other invalid triangles to 2/+i /= /+1 endwhile We now discuss the reverse process: coarsening or derefinement of a mesh. This process helps reduce the total number of elements when tracking solutions to timevarying differential equations. Coarsening can also be used to turn a single highly refined mesh into a sequence of meshes for use in the multigrid method [98]. Figure 14 shows a sequence of meshes computed by a coarsening algorithm due to OllivierGooch. The algorithm marks a set of vertices to delete from the fine mesh, eliminates all marked vertices, and then retriangulates the mesh. The resulting mesh is node
312
M. Bern and P. Plassmann
Fig. 14. A sequence of meshes used by the multigrid method for solving the Unear systems arising in modeUng airflow over an airfoil (C. OUivierGooch).
conforming, meaning that every vertex of the coarse mesh appears in the fine mesh, but not edge conforming. One difficulty is that the shapes of the triangles degrade as the mesh is coarsened, due to increasing disparity between the interior and boundary point densities. Meshes produced by refinement methods are typically easier to coarsen than are less hierarchical meshes such as Delaunay triangulations. Teng, Talmor, and Miller [87] have recently devised an algorithm using Delaunay triangulations of wellspaced point sets, which produces a sequence of boundedaspectratio, nodeconforming meshes of approximately minimum depth.
5.5. Mesh improvement The most common mesh improvement techniques are flipping and smoothing. These techniques have proved to be very powerful in two dimensions, and together they can transform very poor meshes into very good ones, so long as the mesh starts with enough vertices. Flipping exchanges the diagonals of a triangulated quadrilateral as in the edge flipping algorithm for computing Delaunay triangulation (Section 5.1), only the criterion for making the exchange need not be the Delaunay empty circle test. Flipping can be used to regularize vertex degrees, minimize the maximum angle, or improve almost any other quality measure of triangles. For quality measures optimized by the Delaunay triangulation (Section 5.6.1), flipping computes a true global optimum, but for other criteria it computes only a local optimum. Mesh smoothing adjusts the locations of mesh vertices in order to improve element shapes and overall mesh quality [2,3,33,55,100]. In mesh smoothing, the topology of the mesh remains invariant, thus preserving important features such as the nonzero pattern of the linear system. Laplacian smoothing [55,77] is the most commonly used smoothing technique. This method sweeps over the entire mesh several times, repeatedly moving each adjustable vertex to the arithmetic average of the vertices adjacent to it. Variations weight each adjacent vertex by the total area of the elements around it, or use the centroid of the incident elements rather than the centroid of the neighboring vertices [139]. Laplacian smoothing is computationally inexpensive and fairly effective, but it does not guarantee improvement
Mesh
generation
313
Fig. 15. (a) A mesh resulting from bisection refinement without smoothing, (b) The same mesh after local optimizationbased smoothing.
in element quality. In fact, Laplacian smoothing can even invert an element, unless the algorithm performs an explicit check before moving a vertex. Another class of smoothing algorithms uses optimization techniques to determine new vertex locations. Both global and local optimizationbased smoothing offer guaranteed mesh improvement and validity. Global techniques simultaneously adjust all unconstrained vertices; such an approach involves an optimization problem as large as the number of unconstrained vertices, and consequently, is computationally very expensive [33,100]. Local techniques adjust vertices one by one — or an independent set of vertices in parallel [58] — resulting in a cost more comparable to Laplacian smoothing. Many quality measures, including maximum angle and area divided by sum of squared edge lengths, can be optimized by techniques related to linear programming [2]. Figure 15 shows the results of a local optimizationbased smoothing algorithm developed by Freitag et al. [58]. The algorithm was applied to a mesh generated adaptively during the finite element solution of the linear elasticity equations on a twodimensional rectangular domain with a hole. The mesh on the left was generated using the bisection algorithm for refinement; the edges from the coarse mesh are still evident after many levels of refinement. The mesh on the right was generated by a similar algorithm, only with vertex locations optimized after each refinement step. Overall, the global minimum angle has improved from 11.3°to21.7° and the average minimum element angle from 35.7° to 41.1°.
5.6. Theoretical questions We have mentioned some theoretical results — conforming Delaunay triangulation, nosmallangle triangulation — in context. In this section, we describe some other theoretical work related to mesh generation.
314
M. Bern and P. Plassmann
5.6.1. Optimal triangulation. Computational geometers have studied a number of problems of the following form: given a planar point set or polygonal domain, find a best triangulation, where "best" is judged according to some specific quality measure such as maximum angle, minimum angle, maximum edge length, or total edge length. If the input is a simple polygon, most optimal triangulation problems are solvable by dynamic programming in time 0(f2^), but if the input is a point set, polygon with holes, or multiple domain, these problems become much harder. The Delaunay triangulation — constrained Delaunay triangulation in the case of polygonal domains — optimizes any quality measure that is improved by flipping a reversed quadrilateral; this statement follows from the theorem that a triangulation without reversed quadrilaterals must be Delaunay. Thus Delaunay triangulation maximizes the minimum angle, along with optimizing a number of more esoteric quality measures, such as maximum circumcircle radius, maximum enclosing circle radius, and "roughness" of a piecewiselinear interpolating surface [105]. As mentioned in Section 5.5, edge flipping can also be used as a general optimization heuristic. For example, edge flipping works reasonably well for minimizing the maximum angle [53], but it does not in general find a global optimum. A more powerful local improvement method called edge insertion [23,53] exactly solves the minmax angle problem, as well as several other minmax optimization problems. Edge insertion starts from an arbitrary triangulation and repeatedly inserts candidate edges. If minimizing the maximum angle is the goal, the candidate edge e subdivides the maximum angle; in general the candidate edge is always incident to a "worst vertex" of a worst triangle. The algorithm then removes the edges that are crossed by e, forming two polygonal holes alongside e. Holes are retriangulated by repeatedly removing ears (triangles with two sides on the boundary, as shown in Figure 16) with maximum angle smaller than the old worst angle Lcab. If retriangulation runs to completion, then the overall triangulation improves and edge be is eliminated as a future candidate. If retriangulation gets stuck, then the overall triangulation is returned to its state before the insertion of e, and e is eliminated as a future candidate. Each candidate insertion takes time 0{n), giving a total running time of 0(«^). compute an initial triangulation with all (2) edge slots unmarked while 3 an unmarked edge e cutting the worst vertex a of worst triangle abc do add e and remove all edges crossed by e try to retriangulate by removing ears better than abc if retriangulation succeeds then mark be else mark e and undo e's insertion endif endwhile Edge insertion can compute the minmax "eccentricity" triangulation or the minmax slope interpolating surface [23] in time 0{n^). By inserting candidate edges in a certain order and saving old partial triangulations, the running time can be improved to 0{n^ log n) for minmax angle [53] and maxmin triangle height. We close with some results for two other optimization criteria: maximum edge length and total length. Edelsbrunner and Tan [51] showed that a triangulation of a point set that minimizes the maximum edge length must contain the edges of a minimum spanning tree.
Mesh generation
315
Fig. 16. Edge insertion retriangulates holes by removing sufficiently good ears. Dotted lines indicate the old triangulation.
The tree divides the input into simple polygons, which can be filled in by dynamic programming, giving an 0(n^)time algorithm (improvable to 0(n^)). Whether a triangulation minimizing total edge length — "minimum weight triangulation" — can be solved in polynomial time is still open. The most promising approach [46] incrementally computes a set of edges that must appear in the triangulation. If the required edges form a connected spanning graph, then the triangulation can be completed with dynamic programming as in the minmax problem. 5.6.2. Steiner triangulation. The optimal triangulation problems just discussed have limited applicability to mesh generation, since they address only triangulation and not Steiner point placement. Because exact Steiner triangulation problems appear to be intractable, typical theoretical results on Steiner triangulation prove either an approximation bound such as the guarantees provided by the mesh generators in Sections 5.2 and 5.3, or an order of complexity bound such as Edelsbrunner and Tan's 0{n^) algorithm for conforming Delaunay triangulation. The mesh generators in Sections 5.2 and 5.3 give constantfactor approximation algorithms for what we may call the nosmallangle problem: triangulate a domain Q using a minimum number of triangles, such that all new angles are bounded away from 0°. The provable constants tend to be quite large — in the hundreds — although the actual performance seems to be much better. The number of triangles in a nosmallangle triangulation depends on the geometry of the domain, not just on the number of vertices n; an upper bound is given by the sum of the aspect ratios of triangles in the constrained Delaunay triangulation. We can also consider the nolargeangle problem: triangulate Q using a minimum number of triangles, such that all new angles are bounded away from 180°. The strictest bound on large angles that does not imply a bound on small angles is nonobtuse triangulation: triangulate a domain Q such that the maximum angle measures at most 90°. Moreover, a nonobtuse mesh has some desirable numerical and geometric properties [9,135]. Bern, Mitchell, and Ruppert [27] developed a circlebased algorithm for nonobtuse triangulation
316
M. Bern and P. Plassmann
Fig. 17. Steps in circlebased nonobtuse triangulation.
of polygons with holes; this algorithm gives a triangulation with 0(n) triangles, regardless of the domain geometry. Figure 17 shows the steps of this algorithm: the domain is packed with nonoverlapping disks until each uncovered region has either 3 or 4 sides; radii to tangencies are added in order to split the domain into small polygons; and finally small polygons are triangulated with right triangles, without adding any new subdivision points. It is currently unknown whether multiple domains admit polynomialsize nonobtuse triangulations. Mitchell [93], however, gave an algorithm for triangulating multiple domains using 0{n^ log n) triangles with maximum angle 157.5^. Tan [ 126] improved the maximum angle bound to 132° and the complexity to the optimal O(n^).
6. Hexahedral meshes Mesh generation in three dimensions is not as well developed as in two, for a number of reasons: lack of standard data representations for threedimensional domains, greater software complexity, and — most relevant to this article — some theoretical difficulties. This section and the next one survey approaches to threedimensional mesh generation. We have divided this material according to element shape, hexahedral or tetrahedral. This classification is not completely strict, as many hexahedral mesh generators use triangular prisms and tetrahedra in a pinch. Careful implementations of numerical methods can handle degenerate hexahedra such as prisms [66,67]. In this section, we describe three approaches to hexahedral mesh generation that vary in their degree of structure and strictness.
6.1. Multiblock meshes We start with the approach that produces meshes with the most structure (and quite often the highest quality elements). A multiblock mesh contains a number of small structured
Mesh
generation
317
Fig. 18. A multiblock hexahedral mesh of a submarine, showing (a) block structure, and (b) a vertical slice through the mesh (ICEM CFD).
meshes that together form a large unstructured mesh. Typically a user must supply the topology of the unstructured mesh, but the rest of the process is automated. Figure 18 shows a multiblock mesh created by ICEM Hexa, a system developed by ICEM CFD Engineering. In this system the user controls the placement of the block comers, and then the mesh generator projects the implied block edges onto domain curves and surfaces automatically. Due to the need for human interaction, multiblock meshes are not well suited to adaptive meshing, nor to rapidly iterated design and simulation.
6.2. Cartesian meshes We move on to a recently developed "quick and dirty" approach to hexahedral mesh generation. The Cartesian approach offers simple data structures, explicit orthogonality of mesh edges, and robust and straightforward mesh generation. The disadvantage of this approach is that it uses nonhexahedral elements around the domain boundary, which then require special handling. A Cartesian mesh is formed by cutting a rectangular box into eight congruent boxes, each of which is split recursively until each minimal box intersects the domain ^ in a simple way or has reached some small target size. (This construction is essentially the same as an octree, described in Section 7.3.) Requiring neighboring boxes to differ in size by at most a factor of two ensures appropriate mesh grading. Boxes cut by the boundary are classified into a number of patterns by determining which of their vertices lie interior and exterior to Q. Each pattern corresponds to a different type of nonhexahedral element. Boxes adjacent to ones half their own size can similarly be classified as nonhexahedral elements, or alternatively the solution value at their subdivision vertices can be treated as implicit variables using Lagrange multipliers [1]. Recent fluid dynamics simulations have used Cartesian meshes quite successfully in both finite element and finite volume formulations [41,42,144]. The approach can be adapted even to very difficult meshing problems. For example, Berger and Oliger [21] and Berger
318
M Bern and P. Plassmann
Fig. 19. A twodimensional Cartesian mesh for a biplane wing (W. Coirier).
and Colella [20] have developed adaptive Cartesianbased methods for rotational IBiows and flows with strong shocks.
6.3. Unstructured hexahedral meshes Hexahedral elements retain some advantages over tetrahedral elements even in unstructured meshes. Hexahedra fit manmade objects well, especially objects produced by CAD systems. The edge directions in a boxshaped hexahedron often have physical significance; for example, hexahedra show a clear advantage over tetrahedra for a stress analysis of a beam [19]. The face normals of a box meet at the center of the element; this property can be used to define control volumes for finite volume methods. These advantages are not inherent to hexahedra, but rather are properties of boxshaped elements, which degrade as the element grows less rectangular. Thus it will not suffice to generate an unstructured hexahedral mesh by transforming a tetrahedral mesh. Armstrong et al. [4] are currently developing an unstructured hexahedral mesh generator based on the medial axis transform. The medial axis of a domain is the locus of centers of spheres that touch the boundary in two or more faces. This construction is closely related to the Voronoi diagram of the faces of the domain; Srinivasan et al. [124] have previously applied this construction to twodimensional unstructured mesh generation. The medial axis is a natural tool for mesh generation, as advancing fronts meet at the medial axis in the limit of small, equalsized elements. By precomputing this locus, a mesh generator can more gracefully handle the junctures between sections of the mesh. Tautges and Mitchell [127] are developing an allhexahedral mesh generation algorithm called whisker weaving. Whisker weaving is an advancing front approach that fixes the topology of the mesh before the geometry. It starts from a quadrilateral surface mesh.
Mesh generation
319
which can itself be generated by an advancingfront generator within each face [28]. The algorithm forms the planar dual of the surface mesh, and then finds closed loops in the planar dual around the surface of the polyhedron. Each loop will represent the boundary of a layer of hexahedra in the eventual mesh. A layer of hexahedra can be represented by its dual, called a sheet, which has one vertex per hexahedron and edges between adjacent hexahedra. As the algorithm runs, it fills in sheets from the boundary inwards. This approach to hexahedral meshing raises an interesting theoretical question: which quadrilateral surface meshes can be extended to hexahedral volume meshes? Mitchell [94] and Thurston [132] (see also Eppstein [54]) answered this question in a topological sense by showing that any surface mesh on a simple polyhedron with an even number of quadrilaterals can be extended to a volume mesh formed by (possibly curved) topological cubes. The geometric question remains open.
7. Tetrahedral meshes Tetrahedra have several important advantages over hexahedra: unique linear interpolation from vertices to interior, greater flexibility in fitting complicated domains, and ease of refinement and derefinement. In order to realize the last two of these advantages, tetrahedral meshes are almost always unstructured. Most of the approaches to unstructured triangular mesh generation that we surveyed in Section 5 can be generalized to tetrahedral mesh generation, but not without some new difficulties. Before describing Delaunay, advancing front, and octree mesh generators we discuss three theoretical obstacles to unstructured tetrahedral meshing, ways in which M^ differs from M^. First, not all polyhedral domains can be triangulated without Steiner points. Figure 20(a) gives an example of a nontetrahedralizable polyhedron, a twisted triangular prism in which each rectangular face has been triangulated so that it bends in towards the interior. None of the top three vertices is visible through the interior to all three of the bottom vertices; hence no tetrahedron formed by the vertices of this polyhedron can include the bottom face. Chazelle [37] gave a quantitative bad example, shown in Figure 20(b). This polyhedron includes ^(n) grooves that nearly meet at a doublyruled curved surface; any triangulation of this polyhedron must include Q{n^) Steiner points and Q(n^) tetrahedra. Bad examples such as these appear to rule out the possibility of generalizing constrained Delaunay triangulation to three dimensions. Second, the very same domain may be tetrahedralized with different numbers of tetrahedra. For example, a cube can be triangulated with either five or six tetrahedra. As we shall see below, the generalization of the edge flip to three dimensions exchanges two tetrahedra for three or vice versa. This variability does not usually pose a problem, except in the extreme cases. For example, n points in M? can have a Delaunay triangulation with Q{n^) tetrahedra, even though some other triangulation will have only 0(n). Finally, tetrahedra can be poorly shaped in more ways than triangles. In two dimensions, there are only two types of failure, angles close to 0° and angles close to 180°, and no failures of the first kind implies no failures of the second. In three dimensions, we can classify poorly shaped tetrahedra according to both dihedral and solid angles [22]. There are then
320
M. Bern and P. Plassmann
Fig. 20. (a) Schonhardt's twisted prism cannot be tetrahedralized without Steiner points, (b) Chazelle's polyhedron requires Q{n ) Steiner points.
Needle
Wedge
Fig. 21. The five types of bad tetrahedra.
five types of bad tetrahedra, as shown in Figure 21. A needle permits arbitrarily small solid angles, but not large solid angles and neither large nor small dihedral angles. A wedge permits both small solid and dihedral angles, but neither large solid nor large dihedral angles, and so forth. Notice that a sliver or a cap can have all face angles bounded away from both 0° and 180°, although the tetrahedron itself may have arbitrarily small solid angles and interior volume. An example is the sliver with vertex coordinates (0, 0,0), (0, 1, £), (1,0, e), and (1, 1,0), where ^ ^ 0. Many measures of tetrahedron quality have been proposed [75], most of which have a maximum value for an equilateral tetrahedron and a minimum value for a degenerate tetrahedron. One suitable measure, which forbids all five types of bad tetrahedra, is the minimum solid angle. A weaker measure, which forbids all types except slivers, is the ratio of the minimum edge length to the radius of the circumsphere [88].
7.1. Delaunay triangulation As in two dimensions, point placement followed by Delaunay triangulation is a popular approach to mesh generation, especially in aerodynamics. The same point placement methods
Mesh
generation
321
Fig. 22. In three dimensions, an edge flip exchanges three tetrahedra sharing an edge for two tetrahedra sharing a triangle, or vice versa.
work fairly well: combining structured meshes [68], advancing front [10,78,79], and random scattering with filtering [137]. As in two dimensions, the placement phase must put sufficiently many points on the domain boundary to ensure that the Delaunay triangulation will be conforming. Although the threedimensional conforming Delaunay triangulation problem is not too hard for most domains of practical interest, we do not know of published solutions. The first two point placement methods suffer from the same liability in three dimensions as in two: points may be improperly spaced at junctures between fronts or patches. All three methods suffer from a new sort of problem: even a well spaced point set may include sliver tetrahedra in its Delaunay triangulation, because a sliver does not have an unusually large circumsphere compared to the lengths of its edges. For this reason, some Delaunay mesh generators [10] include a special postprocessing step that finds and removes slivers. Chew (personal communication) has recently devised an algorithm that removes slivers by adding Steiner points at a random location near their circumcenters. The triangulation phase of mesh generation also becomes somewhat more difficult in three dimensions. The generalization of edge flipping exchanges the two possible triangulations of five points in convex position, as shown in Figure 22. We call a flip a Delaunay flip if, after the flip, the triangulation of the five points satisfies the empty sphere condition — no circumsphere encloses a point. In three dimensions, it is no longer true that any tetrahedralization can be transformed into the Delaunay triangulation by a sequence of Delaunay flips [69], and it is currently unknown whether any tetrahedralization can be transformed into the Delaunay triangulation by arbitrary flips. Nevertheless, there are provably correct, incremental Delaunay triangulation algorithms based on edge flipping [50,70, 104]. There are other practical threedimensional Delaunay triangulation algorithms as well. Bowyer [30] and Watson [136] gave incremental algorithms with reasonable expectedcase performance. Barber [15] implemented a randomized algorithm in arbitrary dimension. This algorithm can be used to compute Delaunay triangulations through a wellknown reduction [31] which "lifts" the Delaunay triangulation of points in W^ to the convex hull of points in IR^+^
322
M. Bern and P. Plassmann
Fig. 23. The surface of a tetrahedral mesh computed by an advancing front generator (ANSYS, Inc.).
7.2. Advancing front We have already mentioned an advancing front approach to placing Steiner points for Delaunay triangulation. A pure advancing front mesh generator [77,79,97,101] places the elements themselves, rather than just the Steiner points. This approach gives more direct control of element shapes, especially near the boundary, which is often a region of special interest. Advancing front generators seem to be especially popular in aerodynamics simulations [64,65,79,85,101]. We describe an advancing front algorithm of Lohner and Parikh [79,80] as it contains the essential ideas. Desired element size (and perhaps stretching directions) are defined at the vertices of a coarse "background" tetrahedralization and interpolated to the rest of the domain. The background mesh can also be defined by an octree, the threedimensional generahzation of a quadtree. To get started, the boundaries of the domain are triangulated; the initial front consists of the boundary faces. The algorithm then iteratively chooses a face of the front and builds a tetrahedron over that face. The algorithm attempts to fill in clefts left by the last layer of tetrahedra before starting the next layer; within a layer, the algorithm chooses small faces first in order to minimize collisions. The fourth vertex of the tetrahedron will be either an already existing vertex or a vertex specially created for the tetrahedron. In the latter case, the algorithm tries to choose a smart location for the new vertex; for example, the new vertex may be placed along a normal to the base face at a distance determined by aspect ratios and length functions ultimately derived from the background triangulation [59]. In either case, cleft or new vertex, the tetrahedron must be tested for collisions before final acceptance. Figure 23 shows the surface of a fairly isotropic tetrahedral mesh computed by an advancing front mesh generator developed by ANSYS, Inc. This generator, like the one just described, places elements directly.
Mesh
generation
323
Fig. 24. The surface of a tetrahedral mesh derived from an octree (M. Yerry and M. Shephard).
Marcum and Weatherill [81] have devised an algorithm somewhere between pure advancing front and advancingfront point placement followed by Delaunay triangulation. Their algorithm starts with a coarse mesh, and then uses advancing front to place additional Steiner points, simply subdividing the coarse tetrahedra to maintain a triangulation. This mesh is then improved first by Delaunay and then by minmaxsolidangle flips. Other researchers agree that applying flips in this order is more effective than using either type of flip alone. 7.3. Octrees An octree is the natural generalization of a quadtree. An initial bounding cube is split into eight congruent cubes, each of which is split recursively until each minimal cube intersects the domain .Q in a simple way. As in two dimensions, a balance condition ensures that no cube is next to one very much smaller than itself; balancing an unbalanced quadtree or octree expands the number of boxes by a constant multiplicative factor. The balance condition need not be explicit, but rather it may be a consequence of an intrinsic local spacing function [134]. Shephard and his collaborators [114116,142] have developed several octreebased mesh generators for polyhedral domains. Their original generator [142] tetrahedralizes leaf cubes using a collection of predefined patterns. To keep the number of patterns manageable, the generator makes the simplifying assumption that each cube is cut by at most three facets of the input polyhedron. Perucchio et al. [102] give a more sophisticated way to conform to boundaries. Buratynski [32] uses rectangular octrees and a hierarchical set of warping rules. The octree is refined so that each domain edge intersects boxes of only one size. Boxes are warped to domain vertices, then edges, and finally faces. Mitchell and Vavasis [91] generalized the quadtree mesh generator of Bern et al. [25] to three dimensions. The generalization is not straightforward, primarily because vertices of
324
M. Bern and P. Plassmann
Fig. 25. The tetrahedron on the left is bisected to form two new tetrahedra.
polyhedra may have very complicated local neighborhoods. This algorithm is guaranteed to avoid allfivetypes of bad tetrahedra, while producing a mesh with only a constant times the minimum number of tetrahedra in any such boundedaspectratio tetrahedralization. So far this is the only threedimensional mesh generation algorithm with such a strong theoretical guaranty. Vavasis [134] has recently released a modified version of the algorithm (called QMG for "Quality Mesh Generator"), including a simple geometric modeler and equation solver to boot. The modified algorithm includes a more systematic set of warping rules; in particular, the new warping method for an octree cube cut by a single facet generalizes to any fixed dimension [92].
7.4. Refinement and improvement We discuss improvement before refinement, because less is known on the subject. As we mentioned above, edge flipping generalizes to three dimensions, and flipping first by the Delaunay empty sphere criterion and then by the minmax solid angle criterion seems to be fairly effective. Laplacian smoothing also generalizes, although experimental results [57] indicate that it is no longer as effective as in two dimensions. Optimizationbased smoothing [2,57] appears to be more powerful than simple Laplacian smoothing. Freitag and OllivierGooch [57] recommend combining Delaunay flipping with smoothing for maxmin dihedral angle or maxmin dihedralangle sine. We now move on to refinement and discuss two different refinement algorithms based upon the natural generalization of bisection to three dimensions. To bisect tetrahedron vov\V2V2> across edge V{)V\, we add the triangle foi 1^21^3, where VQ\ is the midpoint of VQV\, as shown in Figure 25. This operation creates two child tetrahedra, uofo 11^21^3 and VQ\V\V2V^, and bisects the faces VQV\V2 and fofi 1^3, which, unless they lie on the domain boundary, are each shared with an adjacent tetrahedron. Two tetrahedra that share a face must agree on how it is to be bisected; otherwise an invalid mesh will be constructed. A single bisection of a tetrahedron can approximately square the minimum solid angle, unlike in two dimensions where the minimum angle of a triangle is decreased by no more than a factor of two. Consider the wedge tetrahedron with vertex coordinates (0,^,0),
Mesh
generation
325
Fig. 26. The first three levels of longestedge bisection of the canonical tetrahedron. Note that the tetrahedra generated at each level are similar. For the final level of refinement we show only the four tetrahedra obtained from fo^^oi ^2^3 Four similar tetrahedra are obtained from vo\v\V2V2>.
(0,—e, 0),(1,0,^), and (1, 0, — e). Bisection of the longest ^dgt of this tetrahedron creates a new tetrahedron with minimum soHd angle about s^. Rivara and Levin [110] suggested an extension of longestedge Rivara refinement (Section 5.4) to three dimensions. Notice that splitting the longest edge in a tetrahedron also splits the longest edge on the two subdivided faces, and thus the bisection of shared faces is uniquely defined. (Ties can be broken by vertex labels.) Neighboring invalid tetrahedra, meaning all those sharing the subdivided longest edge, are refined recursively. Rivara and Levin provide experimental evidence suggesting that repeated rounds of longestedge refinement cannot reduce the minimum solid angle below a fixed threshold, but this guarantee has not been proved. The guarantee would follow if it could be shown that the algorithm generates only a finite number of tetrahedron similarity classes. A bisection algorithm first introduced by Bansch [14] does indeed generate only a finite number of similarity classes. Before describing the algorithm, we sketch the argument of Liu and Joe [74] which motivates the algorithm. The key observation is that there exists an affine transformation that maps any tetrahedron to a canonical tetrahedron for which longestedge bisection generates only a finite number of similarity classes. Consider the canonical tetrahedron tc with coordinates (  1 , 0 , 0 ) , (1,0, 0), (0, 1/V2, 0), and (0, 0,1). In Figure 26 we illustrate the first three levels of longestedge bisection of tc = V{)V\ V2V^. It can be shown that all the tetrahedra generated at each level of refinement are similar and that the eight tetrahedra generated after three levels of refinement are similar to tc. Refinement in the canonical space induces a refinement in the original space with only a finite number of different similarity classes. A subtlety: the similarity classes in the original space correspond to homothets (identical up to scaling and translation), not similarity classes, in the canonical space. Hence the number of similarity classes turns out to be 36 rather than 8 [5,83]. Bansch [14], Liu and Joe [76], and Arnold et al. [5] give essentially equivalent [71] algorithms for generating the bisection order; we follow Bansch's presentation. Each face in each tetrahedron elects one of its edges to be its refinement edge, so that two conditions hold: the choice for a face is consistent between the two tetrahedra that share it, and exactly
326
M. Bern and P. Plassmann
one edge in each tetrahedron — the global refinement edge — is chosen by pairs of faces of the tetrahedron. These conditions hold initially if each face picks its longest edge and ties are broken in any consistent manner, for example, by vertex or edge label order. In the pseudocode below, a child face is a triangle like vo\V2V\ in Figure 25, and a new face is one like V{)\V2V^. mark the refinement edge of every face in the current mesh let 7b be the set of marked tetrahedra; / = 0 while (7/ ^ 0) do bisect each tetrahedron in 7/ across its global refinement edge pick the old edge in each child face as its refinement edge pick the longest edge in each new face as its refinement edge /= /+1 let Ti be the set of invalid tetrahedra enddo
8. Conclusions We have described the current state of the art in mesh generation for finite element methods. Practical issues in mesh generation are — roughly in order of importance — algorithm robustness, fit with underlying physics, element quality, and mesh efficiency. Unstructured triangular and tetrahedral mesh generation already makes frequent use of data structures and algorithms familiar in computational geometry. We expect this trend to continue. We also expect — and recommend — computational geometers to focus some attention on structured meshes and hexahedral meshes. We close with a short list of open problems of both practical and theoretical interest. It is no coincidence that these problems focus on threedimensional mesh generation. 1. Is the flip graph for a point set in B? connected? In other words, is it possible to convert any triangulation of a point set (even a point set in convex position) into any other using only flips (Figure 22)? 2. Is there a smoothing algorithm guaranteed to remove slivers? A sliver (Figure 21) is the only type of bad tetrahedron with well spaced vertices and small circumspheres. 3. Is there an algorithm for conforming Delaunay triangulation in R^? In other words, place vertices on the boundary of a polyhedron, so that the Delaunay triangulation of all vertices, original and new, contains the polyhedron. 4. Is there an algorithm for unstructured tetrahedral mesh generation that guarantees an Mmatrix for the finite element formulation of Poisson's equation? 5. Give an algorithm for computing the blocks in a multiblock mesh. Such an algorithm should give a small number of nicely shaped blocks, quadrilaterals in R^ and hexahedra in R^. 6. Can any quadrilateral surface mesh with an even number of quadrilaterals be extended to a hexahedral volume mesh?
Mesh generation
327
Ackonwledgements We would like to thank Lori Freitag, Paul Heckbert, Scott Mitchell, Carl OllivierGooch, Jonathan Shewchuk, and Steve Vavasis for help in preparing this survey.
References [1] M. Aftosmis, J. Melton and M. Berger, Adaptation and surface modeling for Cartesian mesh methods, AIAA Paper 951725, 12th AIAA CFD Conf., San Diego, CA (June 1995). [2] N. Amenta, M.W. Bern and D. Eppstein, Optimal point placement for mesh smoothing, Proc. 8th ACMSIAM Symp. Disc. Algorithms (1997), 528537. [3] E. Amezua, M.V. Hormaza, A. Hernandez and M.B.G. Ajuria, A method of the improvement of 3d solid finiteelement meshes. Adv. Eng. Software 22 (1995), 4553. [4] C.G. Armstrong, D.J. Robinson, R.M. McKeag, T.S. Li and S.J. Bridgett, Medials for meshing and more, Proc. 4th International Meshing Roundtable, Sandia National Laboratories (1995). [5] D.N. Arnold, A. Mukherjee and L. Pouly, Locally adapted tetrahedral meshes using bisection. Manuscript (1997). [6] I. Babuska and A. Aziz, On the angle condition in the finite element method, SIAM J. Numer. Anal. 13 (1976), 214227. [7] I. Babuska and W.C. Rheinboldt, Error estimates for adaptive finite element computations, SIAM J. Numer. Anal. 15 (1978), 736754. [8] PL. Baehmann, S.L. Wittchen, M.S. Shephard, K.R. Grice and M.A. Yerry, Robust geometricallybased automatic twodimensional mesh generation. Internal. J. Numer. Methods Eng. 24 (1987), 10431078. [9] B.S. Baker, E. Grosse and C.S. Rafferty, Nonobtuse triangulation ofpolygons. Discrete Comput. Geom. 3 (1988), 147168. [10] T.J. Baker, Automatic mesh generation for complex threedimensional regions using a constrained Delaunay triangulation, Eng. Comput. 5 (1989), 161175. [11] R.E. Bank, PLTMG: A Software Package for Solving Elliptic Partial Differential Equations, Users' Guide 6.0, SIAM Pubhcations, Philadelphia, PA (1990). [12] R.E. Bank, A.H. Sherman and A. Weiser, Refinement algorithms and data structures for regular local mesh refinement. Scientific Computing, R. Stepleman et al., eds, IMACS/NorthHoUand Publishing Company, Amsterdam (1983), 317. [13] R.E. Bank and R.K. Smith, Mesh smoothing using a posteriori error estimates, SIAM J. Num. Anal., to appear. ftp://math.ucsd.edU/pub/scicomp/reb/ftpfiles/a67.ps.Z. [14] E. Bansch, Local mesh refinement in 2 and 3 dimensions. Impact Comput. Sci. Eng. 3 (1991), 181191. [15] C.B. Barber, D.P. Dobkin and H.T. Huhdanpaa, The Quickhull algorithm for convex hulls. Submitted to ACM Trans. Math. Software. See http: //www.geom.umn.edu/software/qhull/ (1995). [16] W.D. Barfield, An optimal mesh generator for Lagrangian hydrodynamic calculations in two space dimensions, J. Comput. Phys. 6 (1970), 417^29. [17] R. Barrett, M. Berry, T.F. Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine and H. Van der Vorst, Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM, Philadelphia (1994). [18] T.J. Barth, Aspects of unstructured grids and finitevolume solvers for the Euler and NavierStokes equations. Technical Report, von Karman Institute for Fluid Dynamics, Lecture Series 199405 (1994). [19] S.E. Benzley, E. Perry, K. Merkley, B. Clark and G. Sjaardema, A comparison of allhexahedral and alltetrahedral finite element meshes for elastic and elastoplatic analysis, Proc. 4th International Meshing Roundtable, Sandia National Laboratories (1995), 179191. [20] M.J. Berger and P. Colella, Local adaptive mesh refinement for shock hydrodynamics, J. Comput. Phys. 82 (1989), 6484. [21] M.J. Berger and J. Oliger, Adaptive mesh refinement for hyperbolic partial differential equations, J. Comput. Phys. 53 (1984), 484512.
328
M. Bern and P. Plassmann
[22] M. Bern, L.R Chew, D. Eppstein and J. Ruppert, Dihedral bounds for mesh generation in high dimensions, Proc. 6th ACMSIAM Symp. Disc. Algorithms (1995), 189196. [23] M. Bern, H. Edelsbrunner, D. Eppstein, S. Mitchell and T.S. Tan, Edgeinsertion for optimal triangulations. Discrete Comput. Geom. 10 (1993), 4765. [24] M. Bern and D. Eppstein, Mesh generation and optimal triangulation. Computing in Euclidean Geometry, 2nd ed., D.Z. Du and EK. Hwang, eds. World Scientific, Singapore (1995), 47123. [25] M. Bern, D. Eppstein and J.R. Gilbert, Provably good mesh generation, J. Comput. System Sci. 48 (1994), 384^09. [26] M. Bern, D. Eppstein and F. Yao, The expected extremes in a Delaunay triangulation, Intemat. J. Comput. Geom. Appl. 1 (1991), 7992. [27] M. Bern, S. Mitchell and J. Ruppert, Linearsize nonobtuse triangulation of polygons. Discrete Comput. Geom. 14 (1995), 411^28. [28] T.D. Blacker, Paving: A new approach to automated quadrilateral mesh generation, Intemat. J. Numer. Methods Eng. 32 (1991), 811847. [29] F. Bossen, Anisotropic mesh generation with particles. Technical Report CMUCS96134, CarnegieMellon University, School of Computer Science (1996). http: //ltswww.epfl.ch/~bossen/. [30] A. Bowyer, Computing Dirichlet tessellations. Computer J. 24 (1981), 162166. [31] K.Q. Brown, Voronoi diagrams from convex hulls. Inform. Process. Lett. 9 (1979), 223228. [32] E.K. Buratynski, A fully automatic threedimensional mesh generator for complex geometries, Intemat. J. Numer. Methods Eng. 30 (1990), 931952. [33] S. Canann, M. Stephenson and T. Blacker, Optismoothing: An optimizationdriven approach to mesh smoothing. Finite Elements in Analysis and Design 13 (1993), 185190. [34] G.F. Carey and J.T Oden, Finite Elements: Computational Aspects, PrenticeHall (1984). [35] J.E. Castillo, Mathematical Aspects of Grid Generation, Society for Industrial and Applied Mathematics, Philadelphia (1991). [36] M.J. CastroDiaz, F. Hecht and B. Mohammadi, New progress in anisotropic grid adaptation for inviscid and viscid flows simulations, Proc. 4th Intemational Meshing Roundtable, Sandia National Laboratories (1995). [37] B. Chazelle, Convex partitions of polyhedra: A lower bound and worstcase optimal algorithm, SIAM J. Comput. 13 (1984), 488507. [38] L.R Chew, Guaranteedquality triangular meshes. Technical Report TR89983, Comp. Science Dept., Comell University (1989). [39] RG. Ciarlet, The Finite Element Method for Elliptic Problems, NorthHolland (1978). [40] RG. Ciarlet and PA. Raviart, Maximum principle and uniform convergence for the finite element method, Comput. Methods Appl. Mech. Eng. 2 (1973), 1731. [41] W.J. Coirier, An adaptivelyrefined, Cartesian cellbased scheme for the Euler and NavierStokes equations, NASA Technical Memorandum 106754, NASA (October 1994). [42] W.J. Coirier and K.G. Powell, An accuracy assessment of Cartesianmesh approaches for the Euler equations, J. Comput. Phys. 117 (1995), 121131. [43] E.F D'Azevedo and R.B. Simpson, On optimal interpolation triangle incidences, SIAM J. Sci. Stat. Comput. 10 (1989), 10631075. [44] L. De Floriani and B. Falcidieno, A hierarchical boundary model for solid object representation, ACM Transactions on Graphics 7 (1988), 4260. [45] B. Delaunay, Sur la sphere vide, Izv. Akad. Nauk SSSR, VII Seria, Otd. Mat. i Estestv. Nauk 7 (1934), 793800. [46] M.T. Dickerson and M.H. Montague, A (usually?) connected subgraph of the minimum weight triangulation, Proc. 12th ACM Symp. Comp. Geometry (1996), 204213. [47] T.A. DriscoU, A Matlab toolbox for SchwarzChristojfel mapping, ACM Trans. Math. Software, to appear. [48] T.A. DriscoU and S.A. Vavasis, Numerical conformal mapping using crossratios and Delaunay triangulation. Available under http: //www.cs.comell.edu/Info/People/vavasis/vavasis.html (1996). [49] A.S. Dvinsky, Adaptive grid generation from harmonic maps. Numerical Grid Generation in Computational Fluid Dynamics '88, S. Sengupta, J. Hauser, PR. Eiseman and J.F. Thompson, eds, Pineridge Press Limited, Swansea, U.K. (1988).
Mesh generation
329
[50] H. Edelsbrunner and N.R. Shah, Incremental topological flipping works for regular triangulations, Proc. 8th ACM Symp. Comp. Geometry (1992), 4352. [51] H. Edelsbrunner and T.S. Tan, A quadratic time algorithm for the minmax length triangulation, Proc. 32nd IEEE Symp. Foundations of Comp. Science (1991), 414^23. [52] H. Edelsbrunner and T.S. Tan, An upper boundfor conforming Delaunay triangulations, Discrete Comput. Geom. 10 (1993), 197213. [53] H. Edelsbrunner, T.S. Tan and R. Waupotitsch, A polynomial time algorithm for the minmax angle triangulation, SIAM J. Sci. Stat. Comp. 13 (1992), 9941008. [54] D. Eppstein, Linear complexity hexahedral mesh generation, Proc. 12th ACM Symp. Comp. Geom. (1996), 5867. [55] D.A. Field, Laplacian smoothing and Delaunay triangulations, Comm. Appl. Numer. Methods 4 (1988), 709712. [56] S. Fortune, Voronoi diagrams and Delaunay triangulations. Computing in Euclidean Geometry, 2nd ed., FK. Hwang and D.Z. Du, eds. World Scientific, Singapore (1995), 225265. [57] L. Freitag and C. OUivierGooch, A comparison of tetrahedral mesh improvement techniques, Proc. 5th International Meshing Roundtable, Sandia National Laboratories (1996), 87100. http://sass577.endo. sandia.gov:80/9225/Personnel/samitch/roundtable96/. [58] L.A. Freitag, M.T Jones and RE. Plassmann, An efficient parallel algorithm for mesh smoothing, Proc. 4th International Meshing Roundtable, Sandia National Laboratories (1995), 4758. [59] P.J. Frey, H. Borouchaki and P.L. George, Delaunay tetrahedralization using an advancingfront approach, Proc. 5th International Meshing Roundtable, Sandia National Laboratories (1996), 3146. http://www.cs.cmu.edu/~ph. [60] PL. George, Automatic Mesh Generation, Wiley, New York (1991). [61] PL. George, F Hecht and E. Saltel, Fully automatic mesh generator for 3D domains of any shape. Impact of Com. in Sci. andEng. 2 (1990), 187218. [62] A.S. Glassner, Maintaining wingededge models, Graphics Gems II, E.J. Arvo, ed.. Academic Press Professional, Boston, MA (1991), 191201. [63] L.J. Guibas and J. Stolfi, Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams, ACM Trans. Graphics 4 (1985), 74123. [64] O. Hassan, K. Morgan, E.J. Probert and J. Peraire, Mesh generation and adaptivity for the solution of compressible viscous highspeed flows, Intemat. J. Numer. Methods Eng. 38 (1995), 11231148. [65] O. Hassan, K. Morgan, E.J. Probert and J. Peraire, Unstructured tetrahedral mesh generation for threedimensional viscous flows, Intemat. J. Numer. Methods Eng. 39 (1996), 549567. [66] T. J.R. Hughes, The Finite Element Method: Linear Static and Dynamic Finite Element Analysis, PrenticeHall, Inc., Englewood Cliffs, NJ (1987). [67] T.J.R. Hughes and J.E. Akin, Techniques for developing 'special' finite element shape functions with particular reference to singularities, Intemat. J. Numer. Methods Eng. 15 (1980), 733751. [68] A. Jameson, T.J. Baker and N.P. Weatherill, Calculation ofinviscid transonic flow over a complete aircraft, Proc. AIAA 24th Aerospace Sciences Meeting, Reno (1986). [69] B. Joe, Threedimensional triangulations from local transformations, SIAM J, Sci. Stat. Comput. 10 (1989), 718741. [70] B. Joe, Construction of threedimensional Delaunay triangulations using local transformations, Comput. Aided Geom. Design 8 (1991), 123142. [71] M.T. Jones and RE. Plassmann, Adaptive reflnement of unstructured finiteelement meshes. Finite Elements in Analysis and Design 25 (12) (March 1997), 4160. [72] M.S. Khaira, G.L. Miller and T.J. Sheffler, Nested dissection: A survey and comparison of various nested dissection algorithms. Technical Report CMUCS92106R, School of Computer Science, Camegie Mellon University, Pittsburgh, Pennsylvania (1992). [73] P. Knupp and S. Steinberg, Fundamentals of Grid Generation, CRC Press (1994). [74] A. Liu and B. Joe, On the shape of tetrahedra from bisection. Math. Comput. 63 (207) (1994), 141154. [75] A. Liu and B. Joe, Relationship between tetrahedron shape measures, BIT 34 (1994), 268287. [76] A. Liu and B. Joe, Quality local refinement of tetrahedral meshes based on bisection, SIAM J. Sci. Comput. 16 (6) (1995), 12691291.
330
M. Bern and P. Plassmann
[77] S.H. Lo, A new mesh generation scheme for arbitrary planar domains, Intemat. J. Numer. Methods Eng. 21 (1985), 14031426. [78] S.H. Lo, Volume discretization into tetrahedra, Computers and Structures 39 (1991), 493511. [79] R. Lohner and P. Parildi, Threedimensional grid generation via the advancingfront method, Intemat. J. Numer. Methods Fluids 8 (1988), 11351149. [80] R. Lohner, Progress in grid generation via the advancing front technique, Eng. Comput. 12 (1996), 186210. [81] D.L. Marcum and N.P. Weatherill, Unstructured grid generation using iterative point insertion and local reconnection, AIAA J. 33 (9) (1995), 16191625. [82] C.W. Mastin, Elliptic grid generation and conformal mapping. Mathematical Aspects of Grid Generation, Jose E. Castillo, ed.. Society for Industrial and AppUed Mathematics, Philadelphia (1991), 918. [83] J.M. Maubach, The number of similarity classes created by local nsimplicial bisection refinement. Manuscript (1996). [84] D.J. Mavriplis, Unstructured and adaptive mesh generation for high Reynolds number viscous flows. Technical Report 9125, ICASE, NASA Langley Research Center (1991). [85] D.J. MavripUs, Unstructured mesh generation and adaptivity. Technical Report ICASE 9526, NASA Langley, Hampton VA (1995). Abstract at http: //techreports.larc.nasa.gov/cgibin/NTRS. [86] D.J. Mavriplis, Mesh generation and adaptivity for complex geometries and flows. Handbook of Computational Fluid Mechanics, R. Peyret, ed.. Academic Press, London (1996). [87] G.L. Miller, D. Talmor and S.H. Teng, Optimal coarsening of unstructured meshes, Proc. 8th ACMSIAM Symp. Disc. Algorithms (1997). [88] G.L. Miller, D. Talmor, S.H. Teng and N. Walkington, A Delaunay based numerical method for three dimensions: Generation, formulation and partition, Proc. 36th IEEE Symp. on Foundations of Comp. Science (1995), 683692. [89] G.L. Miller, S.H. Teng and S.A. Vavasis, A unified geometric approach to graph separators, Proc. 32nd IEEE Symp. on Foundations of Comp. Science (1991), 538547. [90] S.A. Mitchell, Cardinality bounds for triangulations with bounded minimum angle. Sixth Canadian Conference on Computational Geometry (1994). [91] S.A. Mitchell and S. Vavasis, Quality mesh generation in three dimensions, Proc. 8th ACM Symp. Comp. Geom. (1992), 212221. [92] S.A. Mitchell and S. Vavasis, An aspect ratio bound for triangulating a dgrid cut by a hyperplane, Proc. 12th ACM Symp. Comp. Geom. (1996), 4857. [93] S.A. Mitchell, Refining a triangulation of a planar straightline graph to eliminate large angles, Proc. 34th IEEE Symp. on Foundations of Comp. Science (1993), 583591. [94] S.A. Mitchell, A characterization of the quadrilateral meshes of a surface which admit a compatible hexahedral mesh of the enclosed volume, Proc. 13th Symposium on Theoretical Aspects of Computer Science (STAGS '96), LNCS, SpringerVerlag (1996). [95] J.D. Miiller, Proven angular bounds and stretched triangulations with the frontal Delaunay method, Proc. 11th AIAA Comp. Fluid Dynamics, Orlando (1993). [96] L.R. Nackman and V. Srinivasan, Point placement for Delaunay triangulation ofpolygonal domains, Proc. 3rd Canadian Conf. Comp. Geometry (1991), 3 7 ^ 0 . [97] NguyenVanPhai, Automatic mesh generation with tetrahedral element, Intemat. J. Numer. Methods Eng. 18 (1982), 273289. [98] C.F OUivierGooch, Multigrid acceleration of an upwind Euler solver on unstructured meshes, AIAA J. 33 (10) (1995), 18221827. [99] S. Owen, Meshing research corner, http: //www.ce.cmu.edu /NetworkZ /sowen/www/mesh.html (1995). [100] V.N. Parthasarathy and S. Kodiyalam, A constrained optimization approach to finite element mesh smoothing. Finite Elements in Analysis and Design 9 (1991), 309320. [101] J. Peraire, J. Peiro, L. Formaggia, K. Morgan and O.C. Zieniewicz, Finite element Euler computations in three dimensions, Intemat. J. Numer. Methods Eng. 26 (1988), 21352159. [102] R. Pemcchio, M. Saxena and A. Kela, Automatic mesh generation from solid models based on recursive spatial decomposition, Internat. J. Numer. Methods Eng. 28 (1989), 24692502. [103] F.P Preparata and M.I. Shamos, Computational Geometry: An Introduction, SpringerVerlag (1985).
Mesh generation
331
[104] V.T. Rajan, Optimality of the Delaunay triangulation in R^, Proc. 7th ACM Symp. Comp. Geometry (1991), 357363. [105] S. Rippa, Minimal roughness property of the Delaunay triangulation, Comput. Aided Geom. Design 7 (1990), 489^97. [106] S. Rippa, Long and thin triangles can be good for linear interpolation, SIAM J. Numer. Anal. 29 (1992), 257270. [107] M.C. Rivara, Algorithms for refining triangular grids suitable for adaptive and multigrid techniques, Intemat. J. Numer. Methods Eng. 20 (1984), 745756. [108] M.C. Rivara, Design and data structure of fully adaptive, multigrid, finiteelement software, ACM Trans. Math. Software 10 (3) (1984), 242264. [109] M.C. Rivara, Mesh refinement processes based on the generalized bisection ofsimplices, SIAM J. Numer. Anal. 21 (3) (1984), 604613. [110] M.C. Rivara and C. Levin, A 3d refinement algorithm suitable for adaptive and multigrid techniques, Comm. Appl. Numer. Methods 8 (1992), 281290. [ I l l ] J. Ruppert, A Delaunay refinement algorithm for quality 2dimensional mesh generation, J. Algorithms 18 (3) (1995), 548585. [112] A. Saalfeld, Delaunay edge refinements, Proc. 3rd Canadian Conf. Comp. Geometry (1991), 3336. [113] R. Schneiders, Finite element mesh generation, http: //wwwusers.informatik.rwthaachen.de/ ~roberts/ meshgeneration.html (1995). [114] W.J. Schroeder and M.S. Shephard, A combined octree/Delaunay method for fully automatic 3D mesh generation, Intemat. J. Numer. Methods Eng. 29 (1990), 3755. [115] M. Shephard and M. Georges, Automatic threedimensional mesh generation by the finite octree technique, Intemat. J. Numer. Methods Eng. 32 (1991), 709749. [116] M.S. Shephard, F. Guerinoni, I.E. Flaherty, R.A. Ludwig and PL. Baehmann, Finite octree mesh generation for automated adaptive threedimensional flow analysis, Proc. 2nd Int. Conf. Numer. Grid Generation in Computational Fluid Mechanics (1988), 709718. [117] J.R. Shewchuk, Triangle: A twodimensional quality mesh generator and Delaunay triangulator, see http: //www.cs.cmu.edu/%7Equake/triangle.html (1995). [118] J.R. Shewchuk, Adaptive precision floatingpoint arithmetic and fast robust geometric predicates in C, Proc. 12th ACM Symp. Comp. Geometry (1996). [119] K. Shimada, Physicallybased mesh generation: Automated triangulation of surfaces and volumes via bubble packing, PhD thesis, ME Dept., MIT (1993). [120] K. Shimada and D.C. Gossard, Computational methods for physicallybased FE mesh generation, Proc. IFIP TC5AVG5.3 8th Int. Conference on PROLAMAT, Tokyo (1992). [121] R.B. Simpson, Anisotropic mesh transformations and optimal error control, Appl. Numer. Math. 14 (13) (1994), 183198. [122] B. Smith, P. Bj0rstad and W. Gropp, Domain Decomposition: Parallel Multilevel Algorithms for Elliptic Partial Differential Equations, Cambridge University Press, New York (1996). [123] PW. Smith and S.S. Sritharan, Theory of harmonic grid generation. Complex Variables 10 (1988), 359369. [124] V. Srinivasan, L.R. Nackman, J.M. Tang and S.N. Meshkat, Automatic mesh generation using the symmetric axis transformation ofpolygonal domains. Technical Report RC 16132, Comp. Science, IBM Research Division, Yorktown Heights, NY (1990). [125] G. Strang and G.J. Fix, An Analysis of the Finite Element Method, PrenticeHall (1973). [126] T.S. Tan, An optimal bound for conforming quality triangulations, Proc. 10th ACM Symp. Comp. Geometry (1994), 240249. [127] T.J. Tautges and S.A. Mitchell, The whisker weaving algorithm for constructing allhexahedral finite element meshes, Proc. 4th Intemational Meshing Roundtable, Sandia National Laboratories (1995). [128] J.W. Thomas, Numerical Partial Diff^erential Equations: Finite Difference Methods, Springer, New York (1995). [129] J.F. Thompson, Numerical Grid Generation, Elsevier, Amsterdam (1982). [130] J.F. Thompson, Z.U.A. Warsi and C.W. Mastin, Numerical Grid Generation: Foundations and Applications, NorthHolland (1985).
332
M. Bern and P. Plassmann
[131] J.F. Thompson and N.P. Weatherill, Aspects of numerical grid generation: Current science and art, Proc. 11th AIAA Applied Aerodynamics Conference (1993), 10291070. [132] W. Thurston, Re: Hexahedral decompostion of polyhedra, a posting to sci.math newsgroup, http: //www.ics.uci.edu/~eppstein/junkyard/Thurstonhexahedra (1993). [133] L.N. Trefethen, Numerical computation of the Schwarz—Christojfel transformation, SI AM J. Sci. Statist. Comput. 1 (1980), 82102. [134] S. Vavasis, QMG: Mesh generation and related software, http: //www.cs.comell.edu/Info/People/vavasis/ qmghome.html (1995). [135] S.A. Vavasis, Stable finite elements for problems with wild coefficients. Technical Report TR931364, Dept. of Comp. Science, Cornell University (1993). [136] D.F. Watson, Computing the ndimensional Delaunay tessellation with application to Voronoi polytopes. Computer J. 24 (1981), 167171. [137] N.P. Weatherill and O. Hassan, Efficient threedimensional Delaunay triangulation with automatic point creation and imposed boundary constraints. Internal. J. Numer. Methods Eng. 37 (1994), 20052039. [138] A. Weiser, Localmesh, localorder, adaptive finite element methods with a posteriori error estimates for elliptic partial differential equations. Technical Report 213, Yale University, New Haven, Connecticut (1981). [139] W. Welch, Serious putty: Topological design for variational curves and surfaces, PhD thesis, CS Dept, Carnegie Mellon University (Dec. 1995). CMUCS95217, ftp: //reports.adm.cs.cmu.edu/usr/anon/1995/ CMUCS95217A.ps, 217B.ps, 217C.ps. [140] J. Xu, Iterative methods by space decomposition and subspace correction, SI AM Review 34 (4) (1992), 581613. [141] J. Xu and L. Zikatanov, A monotone finite element scheme for convection diffusion equations. Math. Comput., to appear. [142] M.A. Yerry and M.S. Shephard, Automatic threedimensional mesh generation by the modifiedoctree technique, Internat. J. Numer. Methods Eng. 20 (1984), 19651990. [143] M.A. Yerry and M.S. Shephard, A modified quadtree approach to finite element mesh generation, IEEE Comput. Graphics Appl. 3 (1983), 3 9 ^ 6 . [144] D.P. Young, R.G. Melvin, M.B. Bieterman and J.E. Bussoletti, A locally refined rectangular grid finite element method: Application to computational fluid dynamics and computational physics, J. Comput. Phys. 92(1991), 166. [145] R. Young and I. MacPhedran, Internet finite element resources, http: //www.engr.usask.ca/~macphed/ finite/fe_resources/fe_resources.html (1995).
CHAPTER 7
Applications of Computational Geometry to Geographic Information Systems Leila de Floriani, Paola Magillo and Enrico Puppo Dipartimento di Informatica e Scienze delVInformazione  Universita di Genova, Via Dodecaneso, 35 16146 Genova, Italy Email: (deflo, magillo,puppo) @ disi. unige. it
Contents 1. Introduction 2. Map data modeling 2.1. Twodimensional spatial entities and relations 2.2. Raster and vector models 2.3. Subdivisions as cell complexes 2.4. Topological data structures 2.5. Multiresolution data structures 3. Map data processing 3.1. Spatial queries 3.2. Map overlay 3.3. Geometric problems in map generalization 3.4. Map labeling 3.5. Other analysis issues 4. Terrain data modeling and processing 4.1. Classical terrain models 4.2. Construction and conversion algorithms 4.3. Terrain generalization 4.4. Multiresolution terrain models 5. Terrain analysis 5.1. Visibility 5.2. Topographic features 5.3. Drainage networks 5.4. Path problems 6. Threedimensional GIS 7. Concluding remarks References
335 336 336 338 339 340 341 342 342 343 347 349 350 351 352 354 356 358 364 364 370 371 372 373 374 377
HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved
333
This Page Intentionally Left Blank
Applications
of computational
geometry to geographic information systems
335
1. Introduction During the last decade, Geographical Information Systems (GISs) have gained a great impact over a variety of important application fields [171]. According to Goodchild, Kemp, and Poiker [119] "a GIS can be seen as a system of hardware, software and procedures designed to support the capture, management, analysis, modeling and display of spatiallyreferenced data for solving complex planning and management problems." Geographic data are characterized by spatial properties (location, shape, size) and nonspatial properties, called attributes, usually expressed in textual or numerical form. GIS as a discipline involves many different issues, such as hardware and software equipment for data acquisition, data standards, storage and transmission, database management issues (such as integrity and consistency), etc. In this chapter, we consider only issues related to representation and processing of the geometric aspects of geographic data, with a special emphasis on the application of computational geometry techniques. In the past, classical information retrieval methods were adopted to handle geographic data, while the importance of geometric aspects was often underestimated: geometric problems in GIS were solved through ad hoc empirical methods. Such solutions often suffered from lack of foundations, both from a geometric point of view (e.g., the result of an operation defined just as the output of a certain algorithm), and from a computer science perspective (e.g., no complexity analysis), and sometimes had poor practical performances. The needs for a solid theoretical background and for high performances in geometric reasoning have become urgent in GIS. This makes GIS a field of primary importance for application of computational geometry. Representation and manipulation of spatial entities in a geographic information system involve modeling and computational issues. The need to store and process huge data sets yields a demand for data structures and algorithms that achieve a good tradeoff between a high computational efficiency and low storage space. In this chapter, we review classical as well as new problems in geometric modeling and computational geometry arising in GIS. We follow a broad classification of classical geometric data in a GIS into map data and terrain data. Such a classification is not standard in the GIS community, but it is convenient here to identify data characterized by different spatial dimensionality, and different classes of problems. The map data are located on the surface of the Earth and are basically twodimensional, i.e., they are points, lines, and polygonal regions, which are combined together to form either subdivisions or arrangements, sometimes organized into layers. The terrain data are related with the threedimensional configuration of the surface of the Earth. The geometry of a terrain is modeled as a 2^dimensional surface, i.e., a surface in a 3D space described by a bivariate function. In addition to these two kinds of classical GIS data, we also cover new research issues in GIS related to the management of fully threedimensional data. The first part of this chapter is devoted to the map data. The representation of map data involves designing models and data structures capable of encoding geometric structures more general than those studied in the geometric modeling literature, like regions with holes, nonregular structures, isolated points, and line features. Spatial indices also play an important role in the design of efficient methods for geometric queries of map data. Geometric aspects of map data processing involve query operations (e.g., point location, range search); spatial joins (map overlay); and more specific operations based on geometric
336
L. de Floriani et al.
search, such as map generahzation, map labehng, map conflation (i.e., reconcihation of two variants of a map of the same area), computation of optimal paths. Terrain representation and processing are an even richer source for geometric problems. The construction of terrain models involves conversions among raw point and line data, raster grids, triangulated surfaces, and contour line representations. Algorithms for converting among different representations involve several problems in computational geometry, from point location to computation of Voronoi diagrams, Delaunay and other optimal triangulations of points and lines. Terrain analysis and visualization include several geometric operations, such as contour line extraction, computation of drainage networks and topographic features, extraction of models at resolution variable on the domain, computation of paths on a surface. The problems related to terrain visibility which have been extensively studied in computational geometry, are of primary interest in geographic data processing. The rest of this chapter is organized as follows. In Section 2, we deal with map data modeling in GIS. We first define geographic maps mathematically in terms of spatial entities and relations, and then introduce two major map models used in GIS (the raster and the vector model). Since the vector map data are much a stronger source of applications for computational geometry techniques, the attention is focused on this kind of map representations. Computational issues related to map data processing and analysis are treated in Section 3. In Section 4, we consider terrain data modeling and processing. We describe classical terrain models used in GIS and review basic issues in converting the terrain data among the various possible formats. The survey also covers approximate and multiresolution terrain models. In Section 5, we examine some of the most classical terrain analysis problems: visibility problems, extraction of topographic features, computation of drainage networks and determination of optimal paths on a terrain. Issues on a threedimensional GIS are briefly discussed in Section 6. Finally, Section 7 gives a summary of the chapter, by providing a list of computational geometry techniques and tools that can be useful in GIS, as well as a list of open geometric problems in GIS. This survey is far from being complete. Several problems and geometric structures are just mentioned here and the reference is given to available publications, or to other chapters of this book. In particular, we do not cover parallel algorithms (treated in Chapter 4) and raster representations, since techniques used to manipulate raster data are more typical of digital geometry [165] than of classical Computational Geometry. 2. Map data modeling 2.1. Twodimensional spatial entities and relations Twodimensional entities considered in the context of geographic data processing are points, lines, and regions embedded in a twodimensional space. Datasets covering small portions of the Earth are often projected onto a flat surface and modeled using classical Cartesian coordinates. Several kinds of projections can be used [119]: azimuthal projections using a plane tangent to the Earth in the center of the area to be mapped, conical projections, cylindrical projections using a cylinder tangent to the Earth along the Equator (Mercator projection) or along the line of longitude (Transverse Mercator projection).
Applications
of computational
geometry to geographic information
systems
337
rail
Fig. 1. A toy example of a geographic map.
A more challenging problem is defining a global reference system. Various conventions are used for such a purpose. One approach involves subdividing the Earth surface into zones, each of which is projected separately (the Universal Transverse Mercator uses 60 different zones); other approaches use a spherical coordinate system based on longlat coordinates, or projection onto an ellipsoid [75,76,182]. However, in the sequel we will always assume the local convention that the map data are embedded in a Euclidean plane. GIS entities are more general than those usually adopted in Computational Geometry. In some cases, lines may not be simple; regions may not be simply connected (i.e., they may contain holes), and may have intQmsil features, i.e., dangling lines (cuts), and isolated points (punctures). Figure 1 shows a toy example of a geographic map. The presence of holes and features may affect the design of data structures and algorithms for processing geographic entities. Most computational methods in GIS deal only with piecewiselinear geometric entities. Although data structures and techniques for representing and manipulating curved entities also exist, they are beyond the scope of this chapter. Spatial relations are defined on pairs of spatial entities, and depend on their relative positions in space. There is a flourishing literature on the definition, classification, evaluation, and study of invariants of spatial relations [42,43,58,85,86,130,155,156,291,292]. In spite of all such work, a homogeneous and complete characterization (e.g., based on an algebraic approach) is still missing. It is not uncommon to find practical contexts and applications for which none of the models proposed in the literature is satisfactory. However, spatial relations are usually classified as follows: • topological relations are characterized in terms of the geometric intersections between boundaries, interiors, and complements of entities: examples are incidence, adjacency, containment, overlapping, etc. (see [42] for a survey); • metric relations are defined in terms of distance between entities: examples are the nearest neighbors and range queries;
338
L. de Floriani et al.
• directional relations are characterized in terms of a relative position of entities with respect to some oriented direction: examples are before, after, rightof, leftof, north, south, etc.; • order relations are defined by properties that induce a partial order on sets of entities. An example is given by containment [157]. Spatial relations play a central role in GISs because many tasks involve the evaluation of spatial relations between a query object and a collection of spatial entities. A broad classification of spatial datasets, which is convenient for both modeling and computational purposes, is as follows: • collections of spatial entities (sometimes organized into distinct layers) that can take any possible relative position on the plane, and intersect arbitrarily; • subdivisions of a compact planar domain into a set of nonoverlapping entities. Collections may define arrangements which are more general than those studied in computational geometry, since they can contain irregular entities of any shape and dimension. Similarly, subdivisions are more also general than those used in computational geometry, since they may contain multiplyconnected regions with features. Subdivisions are simpler than collections. The combinatorial complexity of a subdivision is linear in the total size of its entities, while the arrangement induced by a collection may have a quadratic complexity. A pair of entities in a collection may assume any possible topological relationship, while possible topological relations in the context of subdivision consist just of adjacency and incidence among its constituent entities, and inclusion of features.
2.2. Raster and vector models There is a longrunning debate in the GIS community on whether it is better to represent spatial information based on a vector or on a raster model. Neither model appears to be superior in all tasks. As outlined by Frank [106]: "A traditional view is to differentiate between an entity based view — space is constructed from objects that fill space — and a space oriented view, where each point in space has some properties. This view is philosophically well established...". The vector and raster approaches seem to correspond to these two alternative views of spatial concepts. In a vector model, spatial entities are represented explicitly through their geometry and attributes. Either collections or subdivisions may be represented, and topological relations among entities can be stored explicitly. An explicit representation can support an arbitrarily good level of accuracy. The vector model is obviously entitybased, hence it is well suited to access a spatial database by using spatial entities as search keys. On the other hand, efficient spaceoriented access may require sophisticated search structures and techniques. Early representations in vector data modeling, called spaghetti models, are collections of unrelated simple polygonal lines and points. In a spaghetti model, regions are not explicitly encoded, while they are implicitly described by their boundaries. The spaghetti model may encode either a collection or a subdivision, since it is just a collection of entities without any stored relation. The drawback is an almost total lack of support for efficient query processing. More effective data structures are discussed separately in the following subsections.
Applications
of computational
geometry to geographic information systems
339
In a raster model, the domain is regularly subdivided into a large number of atomic regions, similar to the pixels in a digital image. Each pixel carries information about the portion of space it covers. Points are identified with the pixels they lie in, while lines and regions are obtained as aggregations of pixels (digital lines and regions) on the basis of membership attributes. Therefore, spatial entities are not explicitly represented in a raster, while they can be obtained as relations that cluster pixels according to their common attribute. The raster model intrinsically defines a subdivision of the domain, while a collection can be obtained by using multiple members for pixels (i.e., each pixel may belong to more than one entity). The raster representation is obviously spaceoriented, and it provides direct access to information about a given location or extent of space. It has the disadvantage of providing an approximate geometry, whose accuracy is dependent on the resolution of the grid, but, on the other hand, its regular structure greatly helps organizing spatial information. Not all operations are supported in both models (e.g., some systems compute buffer zones around vector features by converting to the raster domain and back). In general, raster models are more suitable to support queries by location, while vector models are more suitable to support queries by content [244]. As a consequence, many commercial systems adopt hybrid representations, which permit using either model depending on the specific task and data analyzed. Hybrid models involve the use of algorithms to convert from one model to the other. The techniques used to store, process and analyze data in the raster model, as well as conversion algorithms, are more typical of digital geometry [165], and image processing [220,234] than of classical Computational Geometry. Therefore, in the sequel we will focus on models and methods for vector models. 2.3. Subdivisions as cell complexes The algebraic topology provides a wellestablished theory on subdivisions of a topological space into cells. In the mathematical literature there are different definitions of cell complexes, none of which is general enough to model regions and features as those manipulated in GISs. However, many models have been developed on the basis of classical cell complexes, and some efforts have been undertaken to extend the classical theory to entities manipulated in a GIS. Simplicial complexes are a special class of cell complexes with good combinatorial properties that make them easy to construct and manipulate. Simplicial complexes have been used in GISs for encoding generic subdivisions by triangulating each region and including all point and line features as vertices and edges [102,291]. Although the approach is theoretically sound and elegant, it may not be practical: geographic data mainly contain large regions with complicate boundaries and features, and fragmentation into triangles causes a relevant increase in storage requirements. A similar approach, with similar drawbacks, consists of using complexes with convex cells, such as trapezoidal decompositions [94]. Regular cell complexes, in which regions are generic, simplyconnected polygons without features, correspond to planar subdivisions commonly used in computational geometry. Regular cell complexes are suitable to model maps that do not contain point or linea features.
340
L. de Floriani et al
The most general cell structure provided by the algebraic topology is the CWcomplex [183]: its Euclidean realization in two dimensions is a subdivision in which the interior of each region is homeomorphic to an open disk. Such structures admit some features, such as cuts incident into the generalized boundary of a region, and holes incident into such cuts. However, regions must be simply connected: punctures, generic cuts, and "islands" are not admitted. Each region can be fragmented into a minimal number of simplyconnected components: such a fragmentation usually yields only a modest increase in storage. Although some efforts have been undertaken to generalize CWcomplexes to support GIS data [46, 218,240,292], no substantial progress in the direction of data structures and computational techniques has been made so far. On a different perspective, some authors have proposed approaches based on integer geometry, motivated by robustness issues: points in a map, including endpoints and intersections of lines, are constrained to lie at the nodes of an integer grid. In particular, an algebra based on discrete generalized maps, called realms, has been specified and implemented in [128,129].
2.4. Topological data structures Data structures for encoding both entities and topological relations in a subdivision are usually referred to as topological data structures. The Hterature offers a number of data structures for encoding regular subdivisions of the plane or of a surface, which support an efficient evaluation of spatial relations therein. According to Lienhardt [177] and Brisson [25], the models underlying data structures for cell complexes can be classified into: • explicitcell representations, where the entities encoded directly correspond to the cells of the complex; • implicitcell representations, where basic elements of a single type are used, on which element functions act, while cells are implicitly represented. The incidence graph [79] is the prototypical data structure of the former class: nodes correspond to the cells (in two dimensions, vertices, edges, and faces), while arcs linking cells of different dimension correspond to incidence relations. The symmetric structure described in Woo [290] is an implementation of such a graph for the boundary representation of solids. Implicitcell representations are composed of a set of basic elements (e.g., darts, celltuples, etc.) plus a set of functions acting on such elements (e.g., involutions, switch operators, etc.). Examples of data structures within such a class are the DoublyConnected Edge List (DCEL) by Preparata and Shamos [221 ], the wingededge by Baumgart [16], the halfedge structure by Mantyla [187], the vertexedge and faceedge structures by Weiler [285], and, in a generic dimension d, the celltuple structure [25], and the generalized maps [177]. The quadedge structure [123] can be viewed as a specialization of the celltuple structure in two dimensions (see Chapter 10 for a treatment of data structures for planar subdivisions). Some special structures have been developed in the literature for triangulations and trapezoidal decompositions, which can exploit nice characteristics of such subdivisions. A widely used data structure for triangulations consists of storing, for each triangle, its
Applications
of computational
geometry to geographic information systems
341
three vertices and its three edgeadjacent triangles [172]. A similar data structure, called the quadview data structure, has been recently proposed in the context of GIS to encode a trapezoidal map [94]. The data structures proposed to encode general subdivisions with features are basically extensions of incidence graphs to nonregular situations. For instance, data structures adopted in [58,136,198] are variations on the DCEL, which is extended to handle holes and features.
2.5. Multiresolution data structures Multiresolution modeling offers interesting capabilities for spatial representation and reasoning in a GIS: from support to map generalization and automated cartography, to efficient browsing over large GISs, to structured solutions in wayfinding and planning. Early approaches were based on a common practice in cartography, i.e., to have a collection of different maps of the same area at different scales, hence encoding information at different levels of detail and accuracy. Such approaches are often referred to in the GIS literature as multiple representations. Some research has also been undertaken, concerning assessment of consistency of different representations [87]. In [274] some hierarchical data structures, called reactive, are proposed, and some others are reviewed for multiresolution representation of lines and maps. The specific purpose of such structures is to allow one to retrieve a more or less detailed/accurate description of the objects. A description of the whole domain at a low level of detail is retrieved from a reactive model through a breadthfirst traversal of the first levels of a tree, while a description of a portion of the domain at a high level of detail is retrieved through a depthfirst traversal. Examples of such structures are the reactive tree, based on the Rtree; the BLGtree for line generalization; and the GAPtree, to support the generalization of area partitionings [275]. More recent approaches have tried to achieve multiresolution on the basis of an integrated data model, which can include information on maps at different levels of resolution together with explicit relations among them. The possibility of developing models that can support a multiresolution representation of maps through hierarchical structures based on trees of cells has been outlined in [107]. Independently, a first hierarchical model that is formally defined on a mathematical basis has been proposed in [19]: such a model is described by a tree of maps at different resolutions, where each map is a refined description of a simple region of its parent node in the tree. In [223], a more complete multiresolution model for maps represented by generalized subdivisions has been proposed, which deals with combinatorial and metric aspects of geographic maps separately, and formally relates all different representations of an entity through the various levels of resolution. The topological structure of a geographic map is completely captured by a purely combinatorial structure called an abstract cell complex. The map generalization, i.e., an operation that relates two consistent maps at different details, is expressed by a continuous mapping between the abstract cell complexes representing the two maps (see also Section 3.3). The appropriate rules permit us to control such functions in order to guarantee that the generalization occurs through gradual changes. The metric aspects concerning changes in accuracy can be controlled separately through
342
L. de Floriani et ah
the concept of line homotopy. The iterative apphcation of simphfication mappings satisfying both topological and metric constraints permits us to define a sequence of generalized maps of the same area. This sequence provides means to organize the various maps, together with the mappings relating them, either in a multilayered or in a tree structure.
3. Map data processing 3.1. Spatial queries Spatial queries are queries in a spatial database that can be answered on the basis of geometric information only, i.e., the spatial position and extent of the objects involved. A spatial query is defined by a query space S, i.e., either the whole spatial database, or a portion of it obtained through suitable filters; by a query object q that can either belong or not belong to the database; and by a spatial relation J)i. A generic query is thus defined as follows: return all objects s e S that are in relation ^ with q. A classification of spatial queries follows directly from the classification of spatial relations (see Section 2.1). Computational techniques that can be adopted to answer spatial queries depend on the nature of the query space (and on the model which encodes it), on the nature of the query object, and on the nature of the relation. However, a simple exhaustive study of all possibilities shows that most spatial queries can be eventually reduced to few basic problems in computational geometry. In [58] a study is presented on the formalization and solution of topological and metric queries on geographic maps encoded through a cell complex. It is shown that topological queries are solved by map traversal when the query object belongs to the map, while they are always reduced to point location, line intersection, or polygon intersection, when the query object does not belong to the map (see Chapter 10 for a survey). An efficient algorithm has been proposed in [53], which is specific for map traversal in GISs, and provides the basis for the solution of several topological queries on a map. This algorithm traverses a planar subdivision and reports all its regions, without making use of mark bits in the data structure or a stack. Thus, it is especially suitable for a map stored in a readonly GIS database. On the contrary, metric queries are not directly supported by the topological structure of the map and need auxiliary structures — such as spatial indices, or Voronoi diagrams — to be answered efficiently. The use of Voronoi diagrams [ 11 ] for answering spatial queries in GIS has been discussed by Gold and Roos [114117]. The Voronoi diagram is seen as an intermediate model between the raster and the vector models. As observed by Gold in [116], "the Voronoi model has the complete tiling property of the raster model, but the tiles are based on the proximal region around each object". Both static and dynamic algorithms for constructing a Voronoi diagram of 0, 1 and 2dimensional entities in the plane have been developed in the computational geometry literature (see Chapter 5). Gold and Roos
Applications of computational geometry to geographic information systems
343
show that the Voronoi diagram is a persistent, locally modifiable data structure suitable for algorithms like navigation queries, buffer zone generation, polygon labeling, intersection of a map with a line segment, interpolation of a surface at a new point [115,117], etc. Techniques based on spatial indexes are treated in Chapter 17. The interested reader can also refer to the two books by Samet [242,243]. Queries on collections of entities can benefit by less support from relations provided explicitly by data structures. In principle, computational geometry algorithms working on arrangements may give solutions to some such queries, but such algorithms are not applied in practice, perhaps because they are difficult to code and have an intrinsically high computational complexity. Popular techniques for processing collections of entities are based on spatial indexes, which are simple to code and perform well in the average case. In [97] a thorough analysis of the average case complexity in accessing quadtrees is presented. In [8,140,141], several algorithms for spatial queries based on spatial indexes are presented. Refer to Chapter 17 and [243,274] for more details on searching techniques based on spatial indexes. Spatial queries can also be combined with queries related to nongeometric attributes of objects. In this case, a rigorous analysis should take into account both geometric and nongeometric issues. The efficient treatment of such hybrid queries, and the development of suitable integrated models and techniques, as well as of methods for analyzing their performances, are hot open issues that require interdisciplinary research. 3.2. Map overlay It is common practice in GISs to organize information into layers (e.g., land use, hydrography, road network, etc.), and to produce maps by overlaying layers of interest. The overlay process is the basic tool for solving complex spatial queries (the socalled spatial join). In such queries, the input maps are not only overlapped, but also combined on the basis of their attributes (e.g., by using Boolean expressions). Here, we deal only with the geometric aspect of map overlay, where techniques from computational geometry can be applied. Overlay of maps in raster format reduces to combining the attribute values of corresponding pixels and does not involve computational geometry techniques. Conventional transformations are used to align raster grids having different orientations or cell sizes [98]. Here, we focus on the overlay of vector maps. In GIS, there are several cases of overlay, such as overlay between two subdivisions (also called areatoarea overlays), linetoarea overlays, pointtoarea overlays. Moreover, both in areatoarea and in linetoarea overlays, input datasets may be collections of possibly intersecting regions and lines. Two maps may be combined to intersect, form a union, or one map may be used to update another; multiple maps may be combined using Boolean expressions. On the other hand, in computational geometry overlay problems have been studied in a much more standard form: • segment intersection problem: find all the intersection points within an arbitrary set of segments; • redblue intersection problem: find the intersection points of two sets of segments, where no intersections exist within the same set;
344
L. de Floriani et al.
• superimposing plane subdivisions', given two subdivisions U\ and 1^2, compute a subdivision E' whose edges and regions are obtained as the intersection between edges and regions of Ui and ^2Segment intersection algorithms can be used to overlap line maps (e.g., road networks). Redblue algorithms apply to map layers consisting of general subdivisions with features (see Section 2.4). Some algorithms for plane subdivisions have further restrictions, for instance, to trapezoidal maps [95], to convex regions (e.g., a triangulated map) [207]. In all overlay problems, the number of intersections is /: = Q{n^) in the worst case, where n is the input size. The problem complexity is bounded by 0{n \k). A brute force solution consists of computing the intersections between every pair of entities from the two given layers, and works in &{n^). Methods developed in the GIS community mainly consist of heuristic "filters" which try to reduce the number of tested pairs by superimposing a hierarchical spatial index. The filter is based on a decomposition of the plane into blocks, and on distributing the objects to be intersected (the edges and regions of each layer) among the various blocks. Pairs of objects which lie in disjoint blocks of space can be discarded from consideration since they cannot intersect. Then, an exhaustive search for intersections is applied within each block. The filter, however, is not guaranteed to be effective, i.e., some redundant tests are still possible. Nevertheless, these techniques show a good practical behavior. Even if they turn into an exhaustive intersection search in the worst case, their efficiency has been widely experimented in practice. For some methods, a theoretical analysis of the average randomized case is available (e.g., see [93]). Filtering methods can be subdivided into (i) methods decomposing the space into disjoint blocks, eventually splitting objects that cross several blocks; and (ii) methods decomposing the space into possibly overlapping blocks, storing each object in exactly one block. The simplest decomposition scheme based on disjoint blocks is a uniform grid [104, 105]. The resolution of the grid determines the efficiency of the filter. Uniform grids show a poor performance when data are irregularly distributed. Quadtrees [242,243,210] are adaptive grids, based on a recursive partition of an initial square into four sectors. In this way, a different grid resolution can be achieved in each part of the domain according to the local density of data. Many variants of quadtreelike structures have been proposed, depending on the type of data to be stored: either the regions or the edges of a map. Boolean operations are easily done on maps with a superimposed quadtreelike structure. The two input quadtrees are traversed synchronously, by visiting nodes corresponding to the same portion of space at the same time; a quadtree for the result of the Boolean operation is also incrementally built (see [243]). Binary space partitioning (BSP) is a technique bom in the image processing field and lately applied to GIS [273]. Still based on a recursive subdivision of space, it uses a more flexible scheme. At each step, the current block is subdivided into two parts by an arbitrary straight line. The resulting structure can be described as a binary tree whose nodes correspond to convex polygons. BSPtrees support algorithms for performing Boolean operations on objects stored in them [205]. Methods based on overlapping blocks filter candidate pairs by comparing bounding boxes. The bounding box of a twodimensional entity is the smallest axisparallel rectangle that completely contains it.
Applications
of computational
geometry to geographic information systems
345
Structures of the Rtree family [127,235,250,17,92] consist of trees with a degree bounded by a predefined constant value, where data objects are stored at the leaves and every internal node represents the bounding box of all the objects stored in its children. The bounding boxes associated with different nodes (even within the same layer) may overlap. A separate Rtree is built for any map layer. The intersections between two layers are computed while descending the trees: at each step, tests on the bounding boxes are performed, and the results of such tests are used to cut off some branches of the trees which are guaranteed to produce no intersection. Intuitively, an "ideal" Rtree should be balanced, its bounding boxes should be as disjoint as possible, and the amount of empty space enclosed in them should be low. In fact, these properties enhance the efficiency of the filter. The numerous existing variants of Rtrees are characterized by different criteria used to evaluate the "good quality" of an Rtree, and by different construction strategies. Common criteria try to minimize the area covered by the rectangles [127], or to avoid overlapping rectangles [250], or to aggregate objects based on their spatial proximity [235,92]. Since many Rtrees support dynamic insertions and deletions of objects, there is a tradeoff between update time and the quality of the tree produced. R*trees [17] seem to be the most efficient ones in practice. In computational geometry, the purpose has been to find algorithms with a good theoretical complexity [18,32,30,31,41,124,207]. Some of such techniques, especially the plane sweep paradigm (see below) have been integrated in GIS environments [166,167]. The classification of the major existing approaches can be as follows: • an approach based on a segment tree, i.e., a special data structure which hierarchically partitions the plane according to the configuration of input segments [213,31]; • a randomized incremental approach [41,22], which computes all the intersections generated by a generic set of segments by adding the segments one at a time; • a sweepline approach, which finds the intersections while translating a line through the plane and monitoring the segments intersected by such a line [18,30,32,207]; • an algorithm based on topological sweep, i.e., a sweeping process driven by the topological structure of the input subdivisions [95,124]. The problem of overlapping subdivisions encoded through hierarchical models is faced in [184]. A segment tree is a binary tree whose leaves represent, in the lefttoright order, the vertical strips defined by every pair of consecutive vertical lines drawn through the segment endpoints. Data segments are associated with nodes of the tree in an appropriate way. Then, it is sufficient to test intersections only between segments associated with the same node. Space requirements are reduced by dynamically constructing only a portion of the tree at a time: a single roottoleaf path [31], or a single level [213]. In incremental algorithms, segment intersections are reported while constructing a trapezoidal decomposition of the plane. The trapezoidal decomposition induced by a set S of segments is obtained by drawing a vertical line through each segment endpoint or intersection point, until another segment of S is encountered in both directions. The efficiency in locating the trapezoids of the current decomposition affected by the insertion of a new segment is obtained by means of special auxiliary data structures which encode the history of the construction [41,22].
346
L. de Floriani et al. Table 1 Major map overlay algorithms. For each algorithm, the worstcase time complexity and the input requirements are indicated. Parameters n and k denote the input and the output size, respectively; the time complexity for incremental algorithms has been computed through a randomized analysis Algorithm
Approach
Input
Time
[22,41] [31,213] [18] [207] [32] [30] [95,124]
Incremental Segment tree Sweepline Sweepline SweepUne Sweepline Topological sweep
Segments Redblue segments Segments Plane subdivisions with convex regions Redblue segments Segments Plane subdivisions
0{n\ogn+k) 0{n\ogn+k) 0{{n + k)\ogn) 0{n\ogn + k) 0{n\ogn+k) 0{n\o%n + k)
0(n+k)
Sweepline algorithms are evolutions of the classical sweepline method of Bentley and Ottman [18] for reporting the intersections in a set of segments. The basic idea is moving a vertical line lefttoright on the plane, and monitoring the segments intersected by such a line. The key observation is that, if two segments intersect, they must appear in consecutive positions along the line at some instant. Specialized sweepline algorithms have been defined by relaxing the straightness condition of the line and/or the lefttoright order in intersection reporting; also, some algorithms require additional properties on the input segments [31,32,207]. The topological sweeping [95,124] exploits the topological relations among the edges of a plane subdivision in order to advance the sweepline. In practice, the sweepline is replaced by a cut on the graph induced by the edges of the two input maps and their intersection points, which is progressively moved lefttoright. The algorithms developed in computational geometry are summarized in Table 1. All the above approaches have a computational complexity of 0(n \ogn J k), where n is the size of the two maps and k is the output size (for randomized algorithms this is an expected time complexity). The only exception is the topological sweep method which leads to 0(n\ k) worstcase optimal algorithms. Andrews et al. [7] provide an experimental comparison of computational geometry overlay algorithms and GIS overlay algorithms. The compared approaches are the uniform grid [104,105], the quadtree [242,243], the BSP tree [273] from the GIS literature, and Bentley and Ottman's sweep [18], the trapezoidal sweep [32], and the hereditary segment tree [213] from the computational geometry literature. The results show that filtering heuristics typically perform better because they take advantage of the typical characteristics of GIS data (short segments with a low number of intersections per segment). On large datasets, however, the grid tends to increase running time, and quadtrees and BSP trees may introduce a serious space overhead. Asymptotically efficient computational geometry methods do not perform well on GIS data. An exception is the algorithm by Chan [32], which is competitive with GISbased approaches, even on large data sets. The segment tree algorithm is the best one on artificial datasets, but the worst one on real GIS data.
Applications
of computational
geometry to geographic information systems
347
3.3. Geometric problems in map generalization The map generalization is known in cartography as a process of selection and representation of details to be shown on a map on a given scale. The map generalization involves different tasks, such as removing objects, simplifying geometry, aggregating several objects into one, etc. In GIS, generalization is more generally intended as a reduction of "information density" in a geographic database while preserving its overall structure and semantics. Generalization is a complex task, both conceptually and computationally. It involves geometric aspects of geographic entities (shape, structure, and detail), as well as nongeometric ones (role and relevance in the map context). In traditional cartography, generalization processes are classified into the following basic operations [232]: • selection decides whether an entity should appear (i.e., be explicitly represented) or not in the simplified map; • aggregation merges different entities into a single one; • collapse reduces the dimensionality of an entity (e.g., a small region collapses to a point, a thin region collapses to a line); • symbolization transforms a geometric entity into a symbol; • simplification reduces the accuracy in representing the shape of an entity; • exaggeration modifies the shape of an entity to highlight features that would become hardly visible on a small scale; • displacement also modifies the shape to set apart entities that would become too close to each other. Selection and aggregation are usually controlled through nongeometric rules. Symbolization is also nongeometric, except for the problem of avoiding overlapping symbols, which is discussed separately in Section 3.4. The remaining operations are primarily geometric, since they affect the shape of entities explicitly represented in the map at reduced resolution. Simplification is by far the most studied problem in the generalization. The best known and used algorithm is probably an early refinement heuristic proposed by Douglas and Peucker for a simple open polygonal chain [72]. Starting from an initial approximating sequence, at each cycle the algorithm inserts the point that maximizes the distance from the current approximation as long as the maximum error gets below a given threshold. A straightforward implementation runs in O(n^) time in the worst case; a sophisticated implementation running in 0(^log*n) time has been proposed recently [139]. The GIS literature is full of other heuristics proposed for the same purpose, which are usually compared empirically (see [192] for a survey and experimental comparisons; [176,214] for more recent examples). A rigorous approach to the problem is due to Imai and Iri [149] who first gave a formalization of line simplification as an optimization problem. Namely, given an input curve and some metric to measure the error in approximating it, they outline two basic problems: (i) minimizing the number of vertices of the output chain for a given threshold error; (ii) minimizing the error of the output chain for a given number of vertices. Imai and Iri give algorithms, and list results by other authors to cover both problems under four different metrics. Other results are also referred to by Guibas et al. [125]. All algorithms have a superquadratic time complexity for generic polygonal chains, but for a special metric, a sub
348
L. de Floriani et al.
quadratic time complexity can be achieved [147]. Problem (i) can be solved in linear time for the special case in which the input is the image of a piecewiselinear function [148]. An elegant definition of problem (i) is also suggested by Guibas et al. [125]: a homotopy class is obtained by convolving the input line with a disk having a radius equal to the given threshold. The solution is a polygonal chain with minimum links, which is homotopic to the input line into such a region. Linear algorithms for computing homotopy paths inside simple polygons were proposed by Suri [258], Ghosh [113], and Hershberger and Snoeyink [138]. All such algorithms follow a greedy approach. Guibas et al. also study problem (i) as a problem of ordered stabbing [125]. Only disks centered at vertices of the input chain are considered: the solution must be a minimumlink chain stabbing such discs in order. For such a problem, they give an 0{n\ogn) suboptimal greedy algorithm, as well as an optimal quadratic algorithm based on dynamic programming; finally, they give a linear time optimal solution for the special case in which discs in the input are all disjoint. All the algorithms cited above cannot be considered as ultimate solutions to the problem, because they cannot guarantee that the output will be free of selfcrossings. A negative result by Guibas at al. [125] shows that the problem of finding a minimumlink simple polygon for a given homotopy type is NPhard. In the same paper, the problem of line simplification is also studied in the context of a map: given a plane straightline graph induced by a set of noncrossing polygonal chains, find a minimumUnk approximation (in the homotopy class of the map, as outlined above for lines). Also, this problem is NPhard: the difficult part is in positioning vertices that have more than two incident edges. A more general problem of subdivision simplification has been recently faced by Weibel [287] and de Berg et al. [51]. Weibel [287] defines constraints on the simpHfication process based on cartographies principles, classified into metric, topological, semantic (like preservation of class membership) and gestalt principles (constraints used by cartographers). De Berg et al. [51] face the problem of simplification with the main purpose of reducing the complexity of a subdivision. They propose a nearly quadratic algorithm for the following problem: given a polygonal line, a set of feature points, and a real number ^ > 0, compute a simplification that guarantees (i) a maximum error e, (ii) that feature points remain on the same side of the simplified chain as of the original chain, and (iii) that the simplified chain has no selfintersection. Relatively little research has been conducted on merging areal features. The earlier techniques were usually rasterbased involving mathematical morphology operators such as dilation and erosion. Collapse problems, like reduction either of a ribbonshaped area to a center line, or of an areal feature to a point, are faced by using the medial axis transform (see [281] for a survey, and [74,160] for algorithms on medial axis). Jones et al. [154,281] describe the implementation of a few generalization operators based on a triangulated spatial model of a map built on the constrained Delaunay triangulation of the map vertices and edges (see [173,248]). Such operators allow detection of conflicts and their resolution, dimensionality reduction through skeleton generation, boundary simplification and merging of nearby objects. On a more general perspective, Saalfeld [241] has recently suggested that the basic operations of map generalization can be expressed in terms of graph drawing. Although such an approach seems to be promising, so far it is just a challenge launched to experts in graph drawing, while no algorithms based on it have been proposed yet. Another approach to the
Applications of computational geometry to geographic information systems
349
map generalization has been recently proposed by Puppo and Dettori [68,223], which is based on functions defined between cell complexes (describing maps) and continuous under the finite topology. This approach is mainly intended to giving consistency control of operations that affect the topology of the map, and to the definition of multiresolution models. By following the approach of Puppo and Dettori, algorithms for geometric consistency have been recently proposed by Delis and Hadzilacos [67]. To summarize, we remark that while only empirical or manuallyassisted solutions to the map generalization are used in practice, only partial solutions to a few theoretical subproblems have been proposed. A unifying framework that can formally incorporate all operations involved in the map generalization is still an open issue.
3.4. Map labeling Map labeling is a problem of critical importance in cartography. It consists of positioning labels on the map under the following constraints: they must be legibly referred to spatial entities; they cannot overlap; they cannot cover relevant features of the map. In manual cartography, this task is estimated to take about 50% of the time to draw a map; hence the importance of finding automatic procedures to place labels. Map labeling is often subdivided into three subproblems, namely, labeling areas (e.g., countries, lakes), labeHng lineal features (e.g., rivers, roads), and labeling points (e.g., cities). According to some authors [70], there exists a hierarchical relationship that permits to solve such problems separately: area features are placed before point features, which in turn come before line features. However, most literature has been devoted to studying point labeling. Informally, point feature labeling is defined as follows: given a set of points spatially located, and a set of labels referred to each point, find the choice of label positions that minimizes the total number of labellabel and labelpoint overlap. Labels are modeled as rectangles of variable size. Most cartographers agree on constraining a label to have the referred point either at one of its four comers, or at one of the midpoints of its four edges. Many solutions to point labeling have been based on greedy techniques with backtracking to escape invalid configurations (see, e.g., [70,152] and references therein). Different heuristics were adopted to speedup algorithms, which, however, have an exponential time complexity in the worst case. Cromley [47] and Zoraster [296] independently proposed an approach based on integer programming and iterative solutions based on relaxation. Christensen et al. [38] give an extensive survey and an empirical analysis of several computational techniques for map labeling. Moreover, they propose an algorithm based on gradient descent and another one based on simulated annealing. Both such algorithms are based on iteration: starting from an arbitrary configuration, they make local improvements. With a gradient descent, the local change that gives the best improvement is performed at each iteration. However, this method can get stuck at local minima without achieving the optimal solution. In the algorithm based on simulated annealing, local minima are avoided through a stochastic approach. At each iteration, local random changes are performed, which are discarded with an increasing probability if they worsen the cost of the configuration. Christensen et al. show how to manage the cost to include not only the number of conflicts, but
350
L. de Floriani et al.
also placement preferences, and possibly deletions of labels in excess to escape from illegal configurations. Formann and Wagner [99] have studied a version of point labeling, where only four positions per label are allowed; they have shown that the problem is NPcomplete through reduction to 3satisfiabiHty. They also propose an optimal algorithm running in 0{n log^ n) time for arbitrary rectangles, and in 0{n \ogn) time for equallysized squares, when only two possible positions per label are allowed. On this basis, they propose an approximate solution for the case of four possible positions that can be found in 0{n \ogn) time and ensures correct placement of labels whose size is at least 50% of the optimal. They also show that this is the best approximation ratio that can be achieved in polynomial time for this specific problem. Kucera et al. [168] studied the same problem, but developed an exact super polynomial algorithm that can be applied to sets with up to approximately 100 points. Wagner and Wolff [279,280] have noted that in practice the approach of Formann and Wagner hardly ever results in label sizes significantly larger than half the optimum. They study variations of the problem and find a practical way to improve the size of the squares. Recently, Agarwal et al. [4] have been investigating the problem of computing a large nonintersecting subset in a set of rectangles in the plane. An exhaustive bibliography on the map labeling problem can be found at http://www.inf. fuberlin.de/maplabeling/papers.html. 3.5. Other analysis issues In this subsection, we will deal with other issues that have received some attenfion in both computational geometry, and GIS: namely, map conflation, path planning, and construction of cartograms. The path problem in the context of terrain models will be discussed in Subsection 5.4. Refer also to Chapter 15 for further details. Maps provide approximations of the real locations and extents of geographic objects. The representation of the same object may differ in two maps for small changes in its shape and displacement. Map conflation is an operation aimed at reconciling two variants of the map of the same area, in order to compile a map that would integrate information from both [238]. The dissertation of Saalfeld [241] provides both a mathematical modeling framework, and a collection of algorithms for building a conflation system. Basic issues in this context are plane graph matching, and geometric transformations on planar regions. Plane graph matching does not involve the graph isomorphism: heuristics for feature matching, and neighborhood relations are used. Geometric transformations and final merging of the two maps is performed by using a triangulation of the maps [237]. The computation of optimal paths has been studied in GIS mainly for road networks. In these cases, problems can be modeled in a graphtheoretical setting, and generally do not involve geometric computation. Such methods cannot be applied, for instance, in planning a new road across a region: the road will not, in general, follow the existing edge of the map, but rather it will traverse the interior of the region along a path that did not exist before. Path computation involves geometric calculations and cannot be modeled as a discrete graph theoretic problem (see the work of Mitchell and Suri [197] for a survey).
Applications
of computational
geometry to geographic information systems
351
The Weighted Region Problem consists of finding an optimal path in a planar subdivision, where a nonnegative cost is associated with each edge and region. Such a cost is the cost of travelling one unit of length across the region/along the edge, and may be based on soil, vegetation, etc. Costs can also be infinite, and thus model obstacles which cannot be traversed. The problem is relevant both to motion, and to planning situations such as building highways, railways, pipelines, etc. The weighted region problem has been intensively studied by Mitchell. In [196] the algorithm is proposed that finds an approximated shortest weighted cost path from a fixed point in 0(n^ logn), where n is the size of the problem. In recent paper [189], Mata and Mitchell propose the algorithm that can deal with an arbitrary pair of points, and has an improved time complexity (an n^ factor instead of n^). Such an algorithm has been successfully implemented. The 0(n^) algorithm for a special instance of the above problem in which only regions with weights in the set {0, 1, foo} is described in [112]. In [266] algorithms for the weighted region path problem working on a raster model as well as the implementation of the algorithm of Mitchell and Papadimitriou based on constrained Delaunay triangulation (see [173]) are described and compared. A cartogram is a geographic map that is purposely distorted so its spatial properties represent quantities not directly associated with the position on the globe [71]. Distortions should act as homeomorphisms, i.e., continuity of the map should be preserved. Some automatic methods for generating cartograms have been developed that use iterative techniques for computing differential equations involving force fields [71,263]. Recently, Edelsbrunner and Waupotitsch [82] have proposed a combinatorial algorithm that is based on a sequence of local piecewise linear homeomorphic changes, acting on tiling of the map made of regular triangles.
4. Terrain data modeling and processing Terrain processing requires input, data models, and algorithms different from those needed for 2D data. Terrain processing is also a major source of geometric problems, which stimulate the use of computational geometry, both in applying existing techniques, and in developing new ones. The term Digital Terrain Model (DTM) is used generically to denote a model representing terrain relief on the basis of a finite number of samples [193]. Elevation data are acquired either through sampling technologies (onsite measurements or remote sensing: tacheometers, photogrammetry, SAR, etc.), or through digitization of existing contour maps [215]. Raw data come in the form of elevations at a set of points, either regularly distributed, or scattered on a twodimensional domain; chains of points may form polygonal lines, approximating either lineal features, or contour lines. On the basis of sampled data, different models can be built: contour maps, rasters, and mathematical surface representations. Mathematical models are either global (i.e., defined through a single function interpolating all data), or local (i.e., piecewise defined on a partition of the domain into patches). Regularly distributed data generally lead to regular square grids, while scattered data generally lead to triangulated irregular networks. Since we are concentrating on models and methods rooted in computational geometry, we will not cover
352
L. de Floriani et al.
raster models and digital geometry techniques to process them, as well as global mathematical models and algebraic techniques. In the rest of this section, we will deal essentially with general problems related with construction and storage of DTMs, while more specific problems regarding their analysis will be described in the next section. The interested reader can also refer to a survey by van Kreveld [270] for more detailed issues about DTMs, and in particular algorithms on TINs, and to a survey by Magillo and Puppo [185] for issues on parallel algorithms for terrain processing. 4.1. Classical terrain models A topographic surface (or terrain) cr is the image of a real bivariate function / defined on a compact and connected domain ^ in the Euclidean plane, i.e., a = {(x, y^ f(x,y)), (x, y) e Q}. Given a real value ^, a set Ca(q) = {(x,y) e Q, f(x,y) = q] is the set of contours of a at height q, and it is formed by a set of simple lines (provided that / has no relative maxima, minima, saddles, or horizontal plateaus at height q). A Digital Terrain Model {DTM) is a model providing information on such a surface on the basis of a finite set of data. Terrain data are measures of elevation at a set of points y — {uo,..., fA^} C A?, plus possibly a set of noncrossing straightline segments E — {e^,.. ..CM} having their endpoints in W. Data points in V can either be scattered or form a regular grid. Lines in E can possibly form a collection of polygonal chains. Three classes of DTMs are usually considered in the context of GIS [216]: • Polyhedral terrains', a polyhedral terrain is the image of a piecewiselinear function / . A polyhedral terrain model can be described on the basis of a partition of the domain Q into polygonal regions having their vertices in V (and such that the segments of E appear as borders of regions). The image of / over each region is a planar patch. The most commonly used polyhedral terrain models are Triangulated Irregular Networks (TINs), in which all regions are triangles. • Gridded elevation models: a gridded elevation model is defined by a domain partition into regular polygons induced by a regular grid over Q. The most commonly used gridded model is the Regular Square Grid (RSG), in which all regions are squares. Function / is usually a bilinear function interpolating the vertices of the grid. In some cases, an RSG is treated as a raster, and a constant function is used over each region. This is said to be a stepped model, and it is obviously noncontinuous across the edges of the grid. • Contour maps: given a sequence Q = [qo,.. .,qh} of real values, a digital contour map of cr is an approximation of the collection of contours Ca,Q = [Ca (qi), / = 0 , . . . , h}. Contours in digital contour maps are often represented as point sequences; a line interpolating points of a contour can be obtained in different ways: from the simplest case of a polygonal chain to spline curves of various orders. Contour maps are easily transposed onto paper and best understood by humans, but are not suitable for performing a complex computeraided terrain analysis. This is due to the complete lack of information about terrain morphology between two contour lines. An automated terrain analysis is performed on RSGs or TINs. As for maps, some operations are better supported by RGSs, and others by TINs. Advantages and disadvantages of the two models are illustrated in [27,9].
Applications
of computational
geometry to geographic information systems
353
Triangulated Irregular Networks are the most interesting models for application of computational geometry techniques. A TIN is based on a triangulation T of the domain with vertices at the projection on the xy plane of data points (or of a subset of them) and sometimes including a set of straightline segments as a subset of the edges of T. The resulting piecewiselinear surface interpolates data elevations at all points and lines whose projections are vertices and edges of the triangulation, respectively. Data structures describing a TIN are those for encoding triangulations in the plane (see Section 2.4). There also exists a flourishing literature on TINs using smooth patches at each triangle, in order to achieve C^ continuity of the resulting surface [206]. Building smooth patches is easy, though expensive because of numerical computation involved, if surface normals are provided (or estimated) at each datum. There are different strategies to define a TIN having its vertices at a given set of data. In general, the connection topology of vertices is required to satisfy some optimality criterion. Optimality criteria can be defined either for the underlying triangulation, or for the surface itself. A measure can be assigned to each triangle of triangulation (e.g., its area, the minimum/maximum/mean size of its edges, or its angles). Then, the key for comparing triangulations can be the sum, or the maximum, or the minimum, or a lexicographically ordered vector of the measures of all triangles. The most commonly used triangulation is the Delaunay triangulation which is optimal according to the following criteria: it maximizes the minimum angle of its triangles [172,221], it minimizes the maximum circumcircle [48], and it minimizes the maximum containing circle [227]. Optimality criteria defined on the approximating surface have also been considered in the context of scattered data interpolation. Triangulations defined by such criteria are referred to as datadependent triangulations, since the optimization also depends on the zvalues of data points, rather than simply on their xy coordinates. Dyn, Levin, and Rippa [78] consider optimality criteria that can be defined through some cost function of the resulting surface. Examples of optimality criteria are the following: • threedimensional criteria: criteria like the maxmin angle, the minmax angle, or the minimum edge length are considered on triangles and edges of the surface, rather than on their projections on the plane; • nearly C^ criteria: the piecewiselinear surface that is as close as possible to a C^ approximation on the edges of the triangulation is selected; • variational criteria: the unknown surface is assumed as the one minimizing some functional defined over a suitable space of functions. One example of such a functional is the roughness, defined by the Sobolev seminorm of the function. Surprisingly, the surface with minimum roughness is always given by the Delaunay triangulation of projected points, independently of the zvalues of its vertices [230]. When the data set also includes a set of line segments, it is also important that such segments appear as either edges, or chains of edges in the TIN. In this case, either constrained [173,248] or conforming [83,239] triangulations are used. A constrained triangulation T of a set V of points and a set E of straightline segments is a triangulation of V that contains £" as a subset of its edges. A constrained Delaunay triangulation is a constrained triangulation satisfying a weaker version of the circumcircle property. A conforming triangulation r of a set V of points, and a set E of straightline segments is a triangulation of V such that every segment of E may be decomposed into a chain of edges of T. In other
354
L. de Floriani et al.
words, the constraint segments are broken into pieces in the conforming triangulation in order to avoid long and thin triangles. See Chapter 5 for details. For the conforming and constrained triangulations, only optimality criteria defined on the underlying triangulation have been considered so far. A survey of Delaunay triangulations (both nonconstrained and constrained) for TIN creation is provided in [264].
4.2. Construction and conversion algorithms Raw data can come in the form of a set of points V, and possibly of a set of lines E. In case the points of V are distributed regularly, an RSG is implicitly provided. Since sometimes DTMs are derived from digitizing the existing contour maps, contours may also play the role of raw data. Hence, we have the following possible construction and conversion problems. Note that a clear distinction between conversion and construction techniques cannot be done since sometimes models and raw data are the same (e.g., regular distributed data points and RSGs). 1. RSG from sparse points. There are three possible approaches for constructing an RSG from a set V of scattered points [216]: (a) pointwise methods: the elevation at each grid point p is estimated on the basis of a subset of data that are neighbors of p. There are different criteria to define the neighbors that must be considered, e.g.: the closest k points, for some fixed k\ all the points inside a given circle centered at p, and of some given radius; the neighbors of p in the Voronoi diagram of V U {/7}; etc. The basic geometric structure for all such tasks is the Voronoi diagram of the given data points. If raw data include line segments, then a Voronoi diagram of segments, or a bounded Voronoi diagram [248] can be used. (b) global interpolation methods: a unique interpolating function (usually, a polynomial) is computed, which interpolates elevations at all points of V. The RSG is obtained by sampling such a function at grid nodes. (c) pathwise interpolation methods: the domain is subdivided into a number of patches, which can be either disjoint or partially overlapping, and either of regular or irregular shape. The terrain is approximated first within each patch through a function that depends only on data inside the patch. The elevation at grid nodes inside each patch is estimated by sampling the corresponding function. 2. RSG from TIN. Some systems first compute a TIN from sparse data points (and, possibly, fines), then they convert such a representation into an RSG [284]. This conversion is indeed a special case of patch interpolation methods described above. After computing the TIN, elevations at RSG nodes can be efficiently evaluated by scanline conversion algorithms that run in linear time [98]. 3. RSG from contours. Early methods performed this conversion as follows: a number of straight lines at given directions (at least a horizontal and a vertical line) are drawn through each node of the grid, and their intersections with the contour lines are computed; terrain profiles along each line are approximated by some function interpolating contours at intersection points; the elevation at the grid node is computed as an average of its approximate elevations along the various profiles. The underlying
Applications
4.
5.
6.
7.
8.
9.
of computational
geometry to geographic information systems
355
geometric problem is to find intersections between the contour map, and the fines through each grid node: redblue intersection algorithms can be used for this purpose (see Section 3.2). More recent approaches perform this conversion in two steps: contours are first converted into a TIN, then such a TIN is scanconverted to produce the final RSG [216]. Carrara et al. [29] provide an experimental analysis of four different methods for deriving an RSG from contour lines; the results on RSG's accuracy in preserving a coastline are reported in [28]. Eklund and Martensson [88] compare the accuracy of RGSs generated from contour lines and from scattered points. TIN from points. A TIN is obtained from sparse data points by computing the triangulation having vertices at data points. In case raw data also include line segments, the constrained or the conforming triangulation is computed. Thus, the basis for TIN construction are algorithms for building the Delaunay triangulation, the datadependent triangulation [78,230], the constrained Delaunay [173] and the conforming Delaunay triangulation [83,239]. The interested reader is referred to Chapter 5, and to [11] for further details. TIN from RSG. This conversion is usually aimed at data compression: the adaptivity of the TIN to surface characteristics is exploited to produce a model of terrain that can be described on the basis of a reduced subset of elevation data from the input RSG. Hence, RSG to TIN conversion involves approximation. The construction of approximated TINs is treated in detail in Subsection 4.3. TIN from contours. A TIN conforming to a given contour map should be based on a triangulation that conforms to the set of contours. This problem has been studied in the literature both in the context of GIS, and, more generally, in the reconstruction of threedimensional object models. The constrained Delaunay triangulation, using projections of the contours on the x~ y plane as input constraints, gives a conforming TIN, but it may produce artifacts, due to triangles having all vertices on the same contour line. Many algorithms adopt heuristics to avoid artifacts. In [37], flat triangles are avoided by adding the medial axis of each pair of adjacent contour lines to the dataset before computing the triangulation. Specific algorithms developed for TINs are described in [38,110]. More general algorithms for 3D objects produce a triangulated surface from a sequence of crosssections, resulting from the intersection of the object with a collection of parallel planes [159,109,111,255]. Contours from points. As for RSG from contours, this conversion is usually done in two steps: an RSG or a TIN is built first from raw data, then contours are extracted from such a model. Contours from RSG. If the RSG is a bilinear model, then all square regions can be processed independently: possible intersections of the four edges of each region with contour lines are found in constant time. Contour segments inside each region are obtained by connecting intersection points at corresponding elevations. In the second step, corresponding contour segments from adjacent regions must be sewn together to form contour lines by a contour following technique. Contours from TIN. Building contours from a TIN is completely similar to constructing contours from a bilinear model. Contour segments for triangular regions
356
L. de Floriani et ah
can be found independently while contour extraction needs contour following. In [13,180,269], efficient structures based on interval trees [269], kdtrees [180], and segment trees [13] are proposed, which permit us to extract contours from a TIN in 0 (log n\k)ov 0(>/n + k) time, where n is the size of the TIN, and k is the size of the resulting contour map. The search structure, however, can be a serious storage overhead. Van Kreveld et al. [272] reduce the storage requirements by observing that a contour can be traced directly if one mesh element through which the contour passes is known. They give an algorithm which constructs the so called contour tree, a tree that captures the contour topology of a TIN, or an RGS, in 0(n logn) with less additional storage than a previous algorithm proposed by de Berg and van Kreveld [54]. The problem of efficiently transmitting and compressing a TIN has been recently addressed by Snoeyink and van Kreveld [256] for the case of TINs based on Delaunay triangulations. Given a 2D Delaunay triangulation, they show that one can determine a permutation of the data in 0(n) time such that the Delaunay triangulation can be reconstructed from the permuted data in 0(n) time. More general methods for compressing triangular meshes (not just TINs), which exploit the compactness of triangle strips, have also been proposed by other authors [36,55,89,262].
4.3. Terrain generalization The more data are available, the better a terrain can be represented. Modem acquisition techniques provide huge datasets that permit to represent terrain accurately. However, a high representation accuracy is paid for in terms of high costs for storage and processing. Generalization techniques provide the means to bring such costs into manageable bounds, by tradingoff representation costs and accuracy. An approximate terrain model is a model built by using a reduced set of data. The approximation error e is measured with respect to a reference model built on the whole data set: a common choice is the maximum difference between the elevation at a data point, and its interpolated elevation in the model. The accuracy of an approximated representation with respect to the reference model — which has no relation with the accuracy of samples with respect to reality — can be defined as the inverse of the error, namely, \/{\\ e). An application can optimize the performance by adopting an approximate terrain model whose accuracy is within a required threshold. In some cases, the threshold may be variable through the surface domain. For instance, a higher accuracy may be needed in the proximity of important features, for the purpose of terrain analysis; the accuracy may be decreasing with distance from a given viewpoint, for the purpose of landscape visualization. However, it is easy to transform a generalization problem with a variable threshold into a problem with the constant threshold by performing a simple rescale of the input data through the inverse of the threshold function [194]. The ideal aim of terrain generalization is to achieve an optimal ratio between the accuracy and size of representation. As for line simplification, there are two different optimization criteria: • minimizing the number of vertices of the model for a given accuracy; • maximizing the accuracy for a given number of vertices.
Applications of computational geometry to geographic information systems
357
For the first problem a negative result has been proven by Agarwal and Suri [1]: they consider a polyhedral terrain (for simplicity, a TIN), and show that the problem of approximating it at a given accuracy with another TIN having a minimum number of triangles and vertices at arbitrary positions is NPhard. It follows that also the second problem is NPhard. It was conjectured that such problems remain NPcomplete even if vertices of the approximate terrain are constrained to lie at original data points. Only for the first problem, there exist algorithms that can achieve a suboptimal solution in polynomial time, while guaranteeing some bounds on its size. A first algorithm proposed by Agarwal and Suri [1] can build an approximate solution in 0(n^) time, having 0(klogk) triangles, where k is the number of triangles in the optimal solution. More recently, a randomized algorithm was proposed by Agarwal and Desikan [6] that can achieve size 0(k^ log^ k) in 0(n^+^ h k^ log^ k log  ) expected time. Both algorithms build a simplicialpartition, defined as a set of disjoint triangles whose union covers all point data, and such that each triangle is compatible with the required accuracy. Such a set of triangles is completed to form a TIN. Finding a simplicial partition involves sophisticated techniques whose implementation is hardly feasible in practice; however, a simplified implementation of the latter algorithm has given empirical results that are comparable to those obtained with other methods. An algorithm that solves the first problem with a greedy technique has been proposed by Silva et al. [253]. The approximate TIN is built incrementally by iteratively cutting triangles (ears or bites) from hollow polygons that span the domain: at each step the algorithm considers a polygon, and bites from it a triangle of maximal area that is compatible with the required accuracy. It is conjectured in that also this algorithm might guarantee a bound on the size of the solution, but proving this fact is still an open issue. This algorithm works with simple data structures, and requires a small amount of memory. Most other algorithms use iterative methods based on heuristics, which try to select a "good" subset of the input dataset as a set of vertices for the approximate model. Such methods can be used either for the first or for the second problem, depending on the test adopted to stop iteration. Refinement heuristics start from a grid whose vertices are a very small subset of input data. New data points are iteratively inserted as vertices of the model, until the required constraints are satisfied. Simplification heuristics work in the opposite direction, by iteratively discarding points from an initial model built over the whole data set. In this case, points are selected at each iteration in order to cause the least possible increase in the error. Some authors have also adopted techniques that extract morphological features from the initial dataset in order to obtain constraints for the approximate TIN [33, 217,245,257,283] (see also Section 5.2). Approximate RSGs can only be obtained by subsampling the grid, while TINs are much more flexible because of their irregular structure. Many possible approximate models at different accuracies, with different sizes, can be built from a given TIN. In the case of contour maps, there are limited possibilities to vary the resolution by removing lines, while line simplification permits to obtain a wide range of different resolutions, and data sizes. Refinement methods. In [101], Fowler and Little propose a method that starts from an RSG and builds an approximate TIN in two steps. First, point features are selected using the method described in [217], and an initial TIN is built based on the Delaunay triangulation
358
L. de Floriani et ah
of such points. Then, the model is refined by iteratively adding the point corresponding to the maximum approximation error and updating the Delaunay triangulation. A similar algorithm (not involving point features) was also developed by Franklin, and an efficient implementation is available in the public domain [108]. A similar strategy was applied in [257] by using a different method for feature selection, and a data dependent triangulation: the local optimization procedure (edge swapping) applied after each point insertion tries to minimize the error of the current model. However, convergence to a global minimum is not guaranteed. Variants of the same strategy, modified for a number of data dependent triangulations were also applied in [231]. Simplification methods. Lee proposed a simplification technique based on the Delaunay triangulation [174]. A Delaunay TIN is built first over the whole dataset. Then, vertices of the TIN are iteratively dropped, based on a criterion symmetric to the one of Fowler and Little: at each iteration, the point whose deletion causes the least increase in the error is dropped, and the triangulation is updated consequently. Another simplification algorithm based on the hierarchical triangulation scheme of Kirkpatrick [161] has been proposed by de Berg and Dobrindt [50] with the purpose of building a multiresolution model (see Section 4.4). In this case, a maximal set of independent vertices is dropped at each iteration, and holes are filled by a Delaunay triangulation. Variants of the above algorithms have been analyzed and compared by De Floriani et al. [63]. A number of other simplification methods have been proposed for the more general case of free form surfaces. For surveys on such methods, see [135,226]. 4.4. Multiresolution terrain models Approximation algorithms reviewed in the previous section are usually time intensive: the construction of an approximate TIN from a dataset of 1OOK points can take minutes, or even hours, on stateoftheart workstations, depending on the algorithm used. On the other hand, many applications need to access and process terrain models at different accuracies in a realtime context. For example, in a flight simulator, a terrain must be rendered at a high detail only close to the observer. Since the viewpoint is continuously moving, the required accuracy is changing from frame to frame, while the system cannot wait until a suitable terrain approximation is recomputed each time from scratch. The ability to provide a representation whose accuracy is variable over the domain is often called selective refinement. A socalled LOD {levelofdetail) model is a simple sequence of approximate representations at increasing levels of detail. LOD models are standard technology in graphics languages and packages, such as Openlnventor™ [209,288], and VRML [277], and are used to improve efficiency of the rendering on the basis of distance from the observer. However, such models cannot support selective refinement. In order to overcome such limitations, more sophisticated multiresolution terrain models have been developed in the literature. A multiresolution model must: • perform selective refinement for any given accuracy in short (real) time; • provide always conforming meshes, i.e., avoid cracks due to abrupt transition between different levels of detail within a mesh;
Applications
of computational
geometry to geographic information systems
359
.^^
SIMPLIFICATION
Fig. 2. The sequence local modifications generated during the incremental refinement/simplification of a triangulation.
• have a size not much higher than the size of the model at full resolution. In the following, we describe a general framework, called a Multiresolution Mesh (MM) [62,224]. Multiresolution models proposed in the literature will be reviewed next as instances of such a framework. Existing multiresolution models based on domain decomposition are all obtained from an initial model, which is progressively modified by a generalization algorithm (either by refinement or simplification). In a straightforward approach, a modification simply replaces a whole terrain representation with another one. More general modifications are local, i.e., they affect only a small part of the surface. Figure 2 shows a sequence of triangulated grids generated through incremental refinement/simplification and the sequence of modifications corresponding to the refinement process (including the initial grid). Two successive modifications can be either independent, if they affect disjoint parts of the mesh, or the second modification may depend on the first one, if some of the grid elements introduced by the first one are removed by the second one. Dependency means that the second modification cannot occur if the first one did not occur before. Each local modification can be represented by the set of mesh elements it introduces, which is called a component. Dependency relations define a partial order on the set of components, which can be represented by a DAG (see Figure 3). The collection of such components, plus the partial order, form a Multiresolution Mesh (MM), which is at the heart of any multiresolution model. An MM has several interesting properties that have been investigated in detail in [224]. In particular, any consistent (i.e., dependencyclosed) subset of components defines a mesh representing the terrain at a given level of detail: such a mesh is obtained by performing the corresponding local modifications in any temporal sequence consistent with the dependency relation. Moreover, it is also true that any possible mesh made of elements belonging to any component of the MM can be obtained from some consistent subset. Therefore, selective refinement on an MM consists of finding the consistent subset that is most suitable to a given LOD.
360
L. de Floriani et al.
Fig. 3. The MM corresponding to the sequence of local updates in Figure 2.
We generically refer to the capability of an MM to provide a larger or smaller number of consistent subsets (hence, different meshes) as its expressive power. The internal structure of any specific MM determines its expressive power. An MM with few large components with many mutual dependencies will have an expressive power much lower than an MM with many, small components with few mutual dependencies. If an MM is obtained through refinement, any local modification increases resolution (and size) of the mesh locally. In this case the MM is said increasing. Even if an MM is built through simplification, it is possible to reverse modifications composing it, in order to obtain an increasing MM. All multiresolution models proposed in the literature can be interpreted as increasing MMs: in practice, every model is characterized by special rules used for generating the local updates of the MM, by the data structures adopted, by the operations supported, and by the efficiency of accessing algorithms. However, viewing the model as an MM helps understanding its expressive power independently of the specific data structures and algorithms. Multiresolution models can be subdivided in two major classes, according to their structure: • treelike models are based on nested subdivisions; in order to give an interpretation of such models as MMs, the corresponding tree structure must be suitably translated into a DAG; • evolutionary models directly store the evolution of a mesh through a refinement/simplification process; since such models are based on the concept of local modification, they are all straightforward specializations of the MM. Treelike models. Early hierarchical models are based on the recursive subdivision of a domain either into four quadrants {quadtree) [242], or into four equilateral triangles {quaternary triangulation) [77,118,120]. The resulting hierarchy is represented by a quaternary
Applications
of computational
geometry to geographic information systems
361
tree. The main drawback with such models is a poor expressive power, due to the impossibility to combine elements from different levels of the tree into a conforming mesh. A surface corresponding to a nonconforming mesh is affected from cracks between elements from different levels. If a quadtree (or a quaternary triangulation) is regarded as a special instance of an MM, it is easy to see that all nodes at each level of the tree must be clustered to form a single component, hence giving a pyramid of full regular grids. The basic problem with these models is that all edges of a region are split when the region is refined. In order to avoid cracks in the surface, the refinement of one region enforces refinement of its neighbors, and so on, propagating through the whole domain. Von Herzen and Barr [278] proposed a method to build conforming meshes from a quadtree that works in two steps: the extracted mesh is locally balanced first, by allowing adjacent elements to differ for no more than one level in the tree; next, each element is triangulated through a fixed pattern that depends on the levels of its neighbors. Lately, other authors have worked on similar concepts: hierarchies of right triangles are based on the recursive split of a right triangle into two, by joining the midpoint of its longest edge to its opposite vertex [73,90,134,178]. The hierarchy is described by a binary tree, and it can be interpreted as an MM by clustering triangles at the same level that are adjacent along their longest edges: components of the MM are either squares or diamonds, each formed by four adjacent triangles, except border components. Because the resulting MM is made of a high number of small components, it has a high expressive power. This model has been used successfully for rendering terrains in flight simulation through selective refinement [73,90,178]. All models based on regular subdivisions can be encoded by extremely compact and efficient data structures, by exploiting their algebraic properties (see [90,134,242] for details). On the other hand, such models can be used only if data points are distributed on a square grid. Other treelike models have been developed, based on irregular triangulations, which can work on arbitrary datasets, and can achieve a better ratio between size and accuracy of an extracted mesh, because no constraint is imposed on the vertex distribution [61, 246]. A triangle is refined by inserting a nonfixed number of points, either inside it, or on its edges, on the basis of an errordriven refinement criterion. Edges that survive across different levels of the hierarchy permit to combine surface patches from different levels of the tree. Components of an MM corresponding to one such model are obtained by clustering nodes that refine adjacent triangles inserting vertices on their common edges. Each level of the tree is partitioned into a set of components, each bounded by edges that are not refined at that level. In general, a model with many refined edges will lead to an MM with few large components, hence reducing its expressive power. On the other hand, a model with few refined edges may contain many slavery triangles: this gives unpleasant visual effects, and stability problems in numerical computation. In [61], a comprehensive analysis of treelike models is presented, covering several issues about data structures, neighbor finding, and selective refinement. Evolutionary models. Multiresolution is obtained by recording the evolution of a mesh through a sequence of local modifications (either refinement or simplification). Interpreting
362
L. de Floriani et al.
an evolutionary model as an MM is straightforward: each modification step performed by the algorithm generates a new component. The forerunner of evolutionary models is the Delaunay pyramid proposed in [56]. Such a model is based on a sequence of Delaunay triangulations at increasing resolutions, obtained according to a predefined sequence of decreasing error thresholds. The transition from a triangulation to the next is obtained by iterative refinement [101]. The corresponding MM is obtained by decomposing such global modification into maximal local independent modifications. The expressive power of the model may be low because it does not trace the insertion of single vertices: the MM may have a relatively small number of large components. The model proposed in [50] is also based on a sequence of Delaunay triangulations, but it is built bottomup: each level is obtained from the previous one by eliminating an independent set of vertices of bounded degree. The corresponding MM is formed by a large number of components, namely one for each decimated vertex; moreover, the height of the DAG is logarithmic in the number of nodes. This property guarantees a good worstcase complexity of geometric search algorithms such as point location. The data structure is a direct implementation of the DAG. The algorithm for selective refinement proposed in [50] achieves outputsensitive optimal time, but it does not guarantee that the desired threshold will be fulfilled everywhere. Evolutionary models based on a totally ordered sequences of local updates, rather than a DAG, can be encoded by very compact data structures. In order to perform selective refinement, the basic idea is to scan the list of updates, performing only those relevant to achieve the required accuracy. Unfortunately, a straight scan is not sufficient, since skipping an update may prevent performing some later update that is necessary to fulfill the accuracy. Therefore, dependencies between updates must be computed onthefly, thus involving complex, and computationally expensive algorithms. An extremely compact model based on the Delaunay triangulation is proposed in [162]. In this case, a greedy refinement/decimation through online insertion/deletion of single vertices into a Delaunay triangulation is performed. The data structure stores only the simplest mesh, plus the sorted sequence of vertices inserted to refine it, each tagged with the approximation error of triangles incident at such vertex at time of its insertion. A mesh at uniform accuracy can be extracted through an online algorithm for Delaunay triangulation that inserts vertices from the sequence until the desired accuracy is obtained. An algorithm for selective refinement is also outlined, which perform complex tests based on the circumcircle criterion to find out vertex dependencies. A similar model, called Progressive Meshes {PM), is proposed in [145], based on a different update strategy. In this case, the basic local modification is vertex split, which expands a vertex to an edge. As for the previous model, the data structure stores only the simplest mesh, and the sequence of vertex splits. The extraction at uniform accuracy is faster than in [162] because no numerical computation is required. In the attempt to obtain efficient algorithms for selective refinement from a PM, more sophisticated data structures encoding also vertex dependencies have been proposed in [146,186,293]. In [293], a progressive mesh is built by collapsing independent sets of edges, following a technique similar to that used in [50].
Applications
of computational
geometry to geographic information systems
363
The MultiTriangulation (MT) is a straightforward implementation of the MM framework, where every component is a triangulation [62,224]. An explicit data structure encodes all components of an MT as nodes, and maintains all arcs of the DAG describing the MT: every arc (7/, Tj) is labeled by the set of triangles of 7/ covered by Tj. Each leaf of the DAG is connected to an additional drain node, and each new arc is labeled with triangles of its source node that survive in the drain node. Based on this arc labeling, the explicit data structure represents triangles on arcs rather than on nodes of an MT. This data structure supports the extraction of a mesh by collecting all triangles labeling arcs in a given cut of the DAG. An algorithm for selective refinement that finds the minimal triangulation for a given arbitrary threshold was described first in [224], and improved in [63]. The time complexity is linear in the size of the visited consistent subset. Independently, a similar algorithm was proposed in [26], achieving similar results. A dynamic algorithm proposed recently [65] permits to update a mesh extracted from an MT after a small change in the threshold function. Such an algorithm only visits the portion of DAG separating the old and the new solution, respectively. This algorithm is especially efficient for generating gradually changing levels of detail in an interactive environment (e.g., flight simulation). A cheaper, but less efficient implicit data structure for MTs built through refinement/simplification of a Delaunay triangulation has been proposed in [64]. In this case, each component consists of a fan of triangles incident at a vertex, and is represented in the structure by storing just the vertex. Implicit data structures can be defined for MT obtained as progressive meshes, and for the hierarchy of right triangles as well. Although the storage cost is reduced by these structures, empirical results show that the algorithm for selective refinement may run about ten times slower, and also the size of the output mesh may be about twice larger [64]. The HyperTriangulation (HyT) proposed in [40] can be also considered an implementation of an MT, but the data structure is completely different. Based on the observation that the boundary edges of a component T coincide with those of the triangulation covered by r , components in a hypertriangulation are interpreted in a threedimensional space, where the third dimension corresponds to a resolution axis. Each component forms a "dome" in such a space, resting on the components it covers through its boundary edges. The data structure stores the triangles of the MT, and triangle adjacencies in the complex formed by such domes. Adjacency information supports algorithms based on domain traversal. Such an algorithm is used to perform selective refinement for threshold functions that are monotonically increasing with distance from a given viewpoint. The time complexity in the worst case is 0(n logn) where n is the size of the HyT. Empirical results of the extraction algorithm show a performance of about lOOK triangles per second on stateoftheart workstations. Methods based on wavelets. In the literature, also other kinds of multiresolution models have been proposed, which follow afunctional approach rather than a geometric one. The basic idea is that a function can be decomposed into a simpler part at low resolution, together with a collection of perturbations, called wavelet coefficients, which define its details at progressively finer levels of resolution.
364
L. de Floriani et ah
Wavelets have been widely used for multiresolution representation and compression of signals and images (see, e.g., [259,260] for a survey), while their applications to surfaces is quite recent (see [181] for a survey, and [122] for an application to terrain surfaces). The discrete computation of wavelets requires a recursive subdivision of the domain into regular shapes, like equilateral triangles, or squares. Therefore, resulting hierarchies correspond to either quaternary triangulations, or quadtrees. The use of tools from numerical analysis is predominant, while computational geometry techniques do not play a relevant role in this context. 5. Terrain analysis Complex analyses of terrain models include [286]: • computation of visibility maps, and solution of visibilityrelated problems; • terrain generalization, and feature extraction; • computation of watershed, and drainage networks; • realistic visualization; • path planning. Terrain generalization issues have been treated in Section 4.3 for building approximated and multiresolution models. Related issues will also be considered in Section 5.2 on topographic features. Rendering of DTMs and related information includes procedures for orthographic display (contours, hillshading, etc.), perspective display as well as advanced visualization techniques (interactive scene navigation, animation, etc.). Terrain visualization issues are related to viewshed computation problems (see Subsection 5.1). Also, some modeling issues related to effective realtime rendering of a DTM have been discussed in Section 4.4: approximate and variable resolution terrain models directly support compression for efficient rendering, and animation. 5.1. Visibility Visibihty problems are concerned with the computation of visibility information from a viewpoint which can lie outside or inside the domain, or with the use of visibility to solve optimization problems (see also Chapter 19). Examples of visibihty computations are finding the horizon or computing the visible portions of the surface from a given viewpoint; in the latter case, the problem is a special case of the Hidden Surface Removal (HSR) for terrains. Visibility computation algorithms are the basis for solving optimization problems. Examples of optimization problems related to visibility are finding the minimum number of towers of a given height necessary to view an area of the terrain, or finding the minimum path with specified visibility characteristics (e.g., hidden paths, scenic paths). Applications include the location of fire towers, radar sites, radio, TV or telephone transmitters, path planning, navigation and orientation (see [203] for a survey). Visibility computation problems can be classified into: • visibility queries, which consist of determining whether a given entity located on the terrain is visible from a viewpoint, and possibly which portions of it are visible;
Applications of computational geometry to geographic information systems
365
• computation of visibility structures, which provide information about the visibiUty of the terrain itself, i.e., which portions of the terrain are either visible, or invisible from a given viewpoint; knowing suitable visibility structures for a terrain also helps answering visibiHty queries. A visibility query related to a point Q simply requires to determine whether Q is visible or not. For a nonpoint query object (a line, a region) one may ask for either a Boolean answer (e.g., "visible" means "at least partially visible"), or for a partition of the object into visible and nonvisible portions. The basic visibility structure for a terrain is the viewshed which is the collection of the surface portions visible from a viewpoint V. Another visibility structure is the horizon of a viewpoint V, which informally corresponds to the 'distal boundary' of the viewshed. Such reduced information can replace the viewshed in some applications, with the advantage of lower storage costs. More precisely, the horizon determines, the farthest point on the terrain that is visible from V, for every radial direction around V in the xy plane. The result of visibility computations is affected by interpolation conventions adopted in the underlying terrain model. On TINs, a piecewise linear interpolation over each triangle is the standard choice. On RSGs, different GIS packages may use bilinear functions, or step functions, or other interpolation conventions; a common approach is considering a linear approximation of the edges, while disregarding the interior of the cells. Therefore, results can be different even in different implementations of the same algorithm [96]. The reminder of this subsection contains a survey of visibility algorithms. Algorithms working on TINs receive a special attention since they provide more interesting examples of applications of techniques from computational geometry. Visibility query algorithms. The simplest visibility query problem consists in determining the mutual visibility of two points P and Q on a terrain. In a "bruteforce" approach, this reduces to finding either the terrain edges (for a TIN), or grid cells (for an RSG) intersected by the vertical plane passing through segment PQ. For each intersected element (edge or cell) e, a test is performed to decide whether e lies above PQ, and the two points are reported as not visible in case of a positive answer for at least one of such tests. A point visibility query can also be regarded as a special instance of the ray shooting problem on a polyhedral terrain. Given a polyhedral terrain T, a viewpoint V and a view direction (^, of), the ray shooting problem consists of determining the first face of T hit by a ray emanating from V with direction {0,a).A method for answering repeated ray shooting queries from a fixed viewpoint on a terrain has been proposed by Cole and Sharir [45], with a logarithmic query time. They build a balanced binary tree, in which every node stores a partial horizon, computed for a subset of the edges of the terrain. A ray shooting query, represented by a view direction (^, a), reduces to traversing a path on such tree, driven by a height comparison between the given ray and the horizon stored in the currently visited node. The data structure has size 0{na{n) log n), where a(n) is the inverse of Ackermann's function (which is almost a constant). Viewshed algorithms. On RSGs, the viewshed is usually represented in a discrete way, by marking each grid cell as visible or invisible [96]. Extended viewsheds are often considered, i.e., viewsheds enriched with additional information: for example, tagging each
366
L. de Floriani et al.
grid element with the number of viewpoints from which it is visible. Although a discrete viewshed is sometimes considered also for a TIN [175], viewshed computation in this case is usually performed by computing the visible portions of individual triangles. The continuous approach on RSGs is not used for two reasons: the size of the grid, and the complexity of geometric computations involving quadratic interpolating functions. Visibility for an RSG cell can be computed easily by walking from the viewpoint to the given element, along the elements intersected by a lineofsight, until either visibility is blocked, or the target is reached. This method performs redundant computations, since rays to different cells of the grid may overlap partially, van Kreveld [271 ] proposes a sweepline approach to compute discrete viewsheds on an RSG in 0{n \ogn) time on a v ^ x V^ grid. Visibility computation on RSGs is conceptually simple, but it becomes computationally intensive due to the size of the grid. Viewshed computation on a TIN is related to the Hidden Surface Removal (HSR) problem in a threedimensional scene. The general quadratic upper bound to HSR for a polyhedral scene [247] applies also to the special case of a polyhedral terrain, thus giving a worstcase space complexity equal to G(n^) for the viewshed of a TIN with n vertices. The HSR problem for a threedimensional scene has been extensively studied in the literature [49,158,191,211,247]. Some specific algorithms for polyhedral terrains have been developed [222,229]. Another approach to HSR reduces to computing the upper envelope of a set of disjoint polygons in space [23,69,80]. The upper envelope of a set of polygons in 3D defines a partition of the xy plane into maximal connected regions, each of which is labeled with a polygon: the polygon n labeling a region R is the polygon with maximum height over R. The visible image of a polyhedral terrain with respect to a viewpoint V is equal to the upper envelope of the set of its faces, whose height is considered with respect to their distance from the viewplane. Computing the viewshed on a TIN reduces to computing the upper envelope of a set of semidisjoint triangles. The approaches used in existing algorithms for viewshed, HSR, or upper envelope computation can be classified as follows: • an approach in which the faces are processed in fronttoback order from the viewpoint; • a divideandconquer approach; • a sweepline approach; • an online approach, which processes faces incrementally in any order; • an approach based on special data structures for answering ray shooting queries. Some algorithms also combine different approaches together. In the following, we provide a brief survey of existing algorithms, according to the above classification; the reviewed algorithms are summarized in Table 2. ThQ fronttoback approach is the most popular method for performing HSR in a scene. A scene is fronttoback sortable with respect to a viewpoint if there exists an ordered sequence of its faces such that no face coming later in the sequence can obscure a face preceding it. Not all scenes are sortable: terrains are always sortable for viewpoints lying outside the domain, while Delaunaybased TINs are guaranteed to be sortable also for internal viewpoints [57]. There are standard techniques for making a generic PTM sortable by splitting some of its faces. Most fronttoback algorithms process faces in increasing distance order from the viewpoint, and maintain at each step the "contour" of the current visible image (i.e., the bound
Applications
of computational
geometry to geographic information systems
367
Table 2 Major existing algorithms for region visibility computation Algorithm
Approach
Input
Sortable
[80] [158] [222,229] [208,247] [121] [49] [211] [69] [49]
Divideandconquer Divideandconquer, fronttoback Fronttoback Sweepline Sweepline Sweepline, ray shooting Backtofront, incremental Online Online, ray shooting
Triangles Polygons PTM Polygons Polygons Polygons Triangles Triangles Polygons
No Yes Yes No Yes No Yes No No
ary of the union of the projections of the faces processed so far). When a new face is projected onto the viewplane, its edges are tested for intersections only against the edges of the contour. When the scene is a terrain, the contour is the same as the horizon, restricted to the subset of terrain faces which have been already examined. The algorithms by Reif and Sen [229], and Preparata and Vitter [222] are based on such approach, and run in 0((^ + k) log^ n) time, where n is the size of the terrain model, and k is the size of the computed visible image. The algorithm proposed by Overmars and Sharir in [211] represents a very effective method for computing the visible image of a sortable set of triangles. This algorithm combines the incremental and the divideandconquer approaches: triangles are added in backtofront order, in groups, and at each step the visible image of the new set of triangles is merged with the old visible image. The algorithm works in 0(n^/clogn + k), time, where c is the maximum contour size; for a polyhedral terrain, c = 0(na(n)), and thus we have an 0(n^/na(n)logn f k) complexity. The divideandconquer approach includes the worstcase optimal algorithm by Edelsbrunner, Guibas and Sharir [80], which computes the upper envelope of a set of n disjoint triangles in optimal 0{n^) time, and can be used for determining the viewshed on a TIN. The method proposed by Katz, Overmars and Sharir [158] applies a divideandconquer strategy in a sortable threedimensional scene to achieve an outputsensitive complexity. A balanced binary tree is built, whose leaves correspond to the faces (the lefttoright order on the leaves reflects the fronttoback order on the corresponding faces), and every internal node represents the union of the faces stored in its subtree. Then, the visible portion of the object associated with each node are computed during a traversal of the tree; at the end of the traversal, the visible portion of each face are found in the leaves of the tree. The time complexity is outputsensitive and, for a sortable PTM, it is equal to 0{{na{n) + d) logn), where n and d are, respectively, the input and the output size. Sweepline algorithms first project the whole scene onto the viewplane, and then traverse it by moving a vertical line from left to right. The time complexity is equal to 0((w + k)\ogn), where k is the number of intersection points between terrain edges projected onto the viewplane [121,208,247]. The algorithm by de Berg [49] computes the viewshed
368
L. de Floriani et ah
on a TIN in an outputsensitive way, by combining a sweeping technique with the use of efficient data structure for answering ray shooting queries. Online incremental algorithms operate on a generic set of polygons or triangles, without any assumption about properties of the scene. An online randomized algorithm for computing the upper envelope of a set of triangles in the space (and thus the viewshed of a TIN) has been proposed by Boissonnat and Dobrindt [23]. The expected time complexity is equal to 0{n^ \ogn) for disjoint triangles. Horizon algorithms. The horizon of a viewpoint on a PTM is equal to the upper envelope of the set of segments obtained by projecting the terrain edges onto a viewplane. The upper envelope of a set of segments in the plane (in our case, the viewplane) is a piecewise linear, possibly noncontinuous line formed by the collection of points belonging to some of the segments and lying below no other segment in the given set. The size of the upper envelope of p segments in the plane is &{pa{p)) [45]. Thus, the complexity of the horizon of a polyhedral terrain with n vertices is equal to 0{na{n)). Computing the horizon of a viewpoint on a polyhedral terrain reduces to the computation of the upper envelope of a set of possibly intersecting segments in the plane. Upper envelope algorithms have been proposed based either on a divideandconquer or on an incremental paradigm. The classical divideandconquer scheme [10] runs in 0{pa(p) log p) time. A more sophisticated technique, which apphes special care to split the set of segments into subsets with certain characteristics, achieves an optimal 0(p log p) computational complexity [137]. A simple incremental approach has a complexity of 0(p^a(p)), since adding the ith segment can cause the modification of each of the ia(i) intervals of the current envelope, while a randomized incremental algorithm proposed in [60] has an expected time complexity of 0(pa(p) log p) for inserting all the given segments in random order. Visibility computation on hierarchical models. Visibility computation problems have been addressed in the context of hierarchical terrain models by De Floriani and Magillo [66]. In this framework, two issues have been considered: the computation of visibility information, related to a terrain representation at a certain resolution level, and the update of such information, as the required resolution changes. Distancebased and sweepline viewshed algorithms can work on a hierarchical terrain model by performing a traversal of its treelike structure. Dynamic algorithms can be used to update viewsheds and horizons after local changes in the level of detail of a terrain representation (i.e., replacement of a subset of terrain faces and edges with a finer/coarser description) [69,66]. Visibilityrelated problems. Examples of interesting application problems on a terrain, which can be solved based on visibility information, are: • problems requiring the placement of observation points on a topographic surface according to certain requirements; • lineofsight communication problems; • problems regarding the computation of visibility paths on a terrain, with certain properties.
Applications
of computational
geometry to geographic information systems
369
Puppo and Marzano [225] investigate the connection between visibilityrelated problems in a discrete setting, and classical problems in graph theory: they show that graph algorithms can provide efficient and practical solutions to many visibilityrelated problems, belonging to all three classes listed above. Viewpoint placement problems require placing several observation points on a terrain in such a way that each point of the terrain (or of a focus area on it) is visible from at least one observation point. Applications include the location of fire towers, artillery observers, and radar sites. For a single observation point, algorithms running in polynomial time are known. If the height of the viewpoint is fixed, an existing solution can be determined in 0(n logn) time, while the point with the lowest elevation, from which the entire terrain is visible, can be determined in 0(n\og^n) time [252], on a polyhedral terrain model with n vertices. Recently Zhu [295] improved the complexity to 0(n log* n). The more general problem of determining the smallest number of observation points, which collectively see the entire terrain is known as the guard allocation problem and it is usually addressed by constraining viewpoints to be placed on the vertices of a polyhedral terrain. The problem has an exponential complexity, and it is equivalent to setcovering. Several heuristic algorithms to minimize the number of viewpoints, with fixed or variable height, are discussed in [175]. In the same paper, also the inverse problems are considered, that is, finding the optimal locations of viewpoints to maximize the visible area, assuming that the number and, possibly, the height of viewpoints as fixed. Bose et al. [24] reduce the guard allocation problem to a graph coloring problem and provide efficient heuristics to place viewpoints located at the vertices or on the edges. Lineofsight communication problems consist of finding a visibility network connecting two or more sites, such that every two consecutive nodes of the network are mutually visible. Applications are in the location of microwave transmitters for telephone, FM radio, television and digital data networks. Usually, sites are restricted to be at terrain vertices. Finding the minimum number of relay towers necessary for lineofsight communication between two sites can be formulated as a shortest path search in a graph where nodes are terrain vertices and arcs represent pair of mutually visible vertices, called a visibility graph. The problem of constructing a lineofsight network between several sites is addressed in [59] by reducing it to the computation of a minimum Steiner tree on the visibility graph; memory requirements are kept low by computing the arcs of the graph online. Visibility paths can be defined on a terrain, with applicationdependent visibility characteristics. A smuggler's path is the shortest path, connecting two given points, such that no point on the path is visible from a predefined set of viewpoints. Conversely, a path where every point can be seen from all viewpoints is known as a scenic path [203]. Simple solutions can be obtained on a TIN by restricting the viewpoints to be vertices, and the path to pass along edges. The solution (if there exists) can be determined by first computing the vertices which are visible/invisible from all the viewpoints, and then applying a standard shortest path algorithm to the edges connecting them.
370
L. de Floriani et al
5.2. Topographic features Topographic features are special points, lines and regions that have a specific meaning for describing the shape of the terrain: they correspond to local differential properties of the terrain surface. A point of the surface belongs to some characteristic class depending on the structure of the surface in its neighborhood. Point features are peaks, pits 2iXid passes. A peak is a point of relative maximum, a pit is a point of relative minimum, a pass is a saddle point for the surface, i.e., a point where there is a local maximum in one direction and a local minimum in a different direction. Lineal features are ridges and valleys. A ridge is a curve consisting of ridge points: a point lies on a ridge if its neighborhood can be subdivided by a line passing through it, and such that the surface in each halfneighborhood is monotonically decreasing when moving away from the line. A ridge occurs where there is a local maximum in the surface in one direction; a valley occurs where there is a local minimum in one direction. Based on point and lineal features. Wolf [289] proposes the use of weighted surface networks for terrain description. A weighted surface network is a graph whose vertices and edges are point and lineal features, respectively; each edge is weighted with the height difference between its two endpoints. Wolf also suggests a method for contracting such networks, thus providing also a tool for terrain generalization. Areal features are maximal regions on the terrain where the surface is flat, convex or concave. Such features are related to the curvature of the surface along two independent directions. For smooth surfaces they depend on the sign of the second derivative. According to this classification, any point on a terrain can be labeled to belong to one of the above features by applying differential geometry tools. An interesting classification of topographic features can be found in [283]. In the discrete case, algorithms are essentially based on the analysis of the neighborhood of the points in the domain. In the literature, most methods have been developed for RSGs with the stepped model, because the neighborhood of each pixel is directly implied from the grid structure. The interpolation is commonly assumed to be constant on each grid cell, that is actually considered as a pixel in an image. The classical algorithm by Peucker and Douglas [217] classifies each pixel based on the height difference from its eight neighbors in the grid. In [254] the method is improved to find also ridges and valleys wider than one pixel. Methods developed in the image processing literature can also be used [132, 163,169]. Falcidieno and Spagnuolo [91] consider a virtual triangulation of the grid, where each cell is subdivided into four right triangles, and apply a method suitable for TINs (see below). Mc Cormack et al. [190] identify depressions and plateaus by propagating "seeds" consisting of connected regions of pixels with the same elevation, and bounded by pixels with a higher and lower elevation, respectively. Watson et al. [283], and Haralick [132] use RSGs with surface interpolation techniques. In the case of TINs, point and lineal features are vertices and chains of edges in the underlying triangulation, respectively. Areal features are connected collections of triangles defining convex, concave or flat regions. A characterization of features on a TIN can be found in [103]. An algorithm for surface characterization from a TIN, based on the local analysis of the dihedral angle formed by adjacent triangular patches, is proposed in [91].
Applications
of computational
geometry to geographic information systems
371
Each TIN edge is labeled as convex, concave or flat depending on the slopes of its two incident triangles. Then, a triangle can be labeled based on the types of its edges (e.g., a triangle is convex if its three edges are convex), and convex, concave and flat surface regions are computed by aggregating triangles labeled in the same way. A compact representation of a TIN obtained by merging triangles into regions of uniform curvature is proposed as well.
5.3. Drainage networks Terrain drainage characteristics provide information on water resources, flood areas, erosion, and natural resource management. Manual quantification of terrain drainage characteristics is a tedious and timeconsuming task. Thus, efforts have been undertaken to compute such characteristics from a terrain model. On a terrain water flows downstream according to gravity and collects into streams, which join and form rivers. The collection of all streams and rivers forms the drainage network of the terrain. A drainage network can be seen as a forest in which the arcs are directed towards the pits. Hence, the computation of a drainage network is strongly related to the computation of point and lineal features of the underlying terrain (see [294] for a survey). If we consider a terrain as a continuous surface, a drainage network can be characterized in terms of differential geometry (see [163,164]). There is no accepted definition of the drainage network on an RSG. As noted by Yu et al. [294], the network is defined as the result of an algorithmic process. As for the case of feature extraction, local methods based on image processing techniques are applied on RSGs [72,276]. Mark [188] proposes a global approach: all the cells are sorted in order of decreasing elevation and, initially, each cell is assigned one unit of fluid. Each cell in order adds its fluid to the lowest of its eight neighbors. At the end, cells receiving more than a certain quantity of fluid are declared to be on the drainage network. In this way, also the accumulation of water flowing in the terrain is modeled. Quantifying the accumulation of water is also useful for identifying drainage basins, i.e., surface regions formed by pixels whose water flow reaches the same pit. The general assumption is that water flows from higher to lower heights. Flat regions and plateaus cause disturbs in water flow computation because the direction of flow is not well defined. Similar problems occur at depressions: in a real terrain, water cannot accumulate infinitely, thus it is necessary to determine the overflow points and directions for a depression. Many algorithms use simple heuristics based on local modification of the flow [150,200,143]. Mc Cormack et al. [190] note that the local modification of a drainage network without knowledge of its overall structure may have unpredictable effects. Therefore, they propose a featurebased approach to computation of drainage networks and basins on an RGS, which identifies inflow and outflow points for each depression and plateau, and defines the flow through the flat region as a line connecting them. On a TIN, a definition of a drainage network, as a collection of all valley edges has been proposed by Frank et al. [103]. This definition has the drawback of possibly producing
372
L. de Floriani et al.
interrupted streams, because the actual location of a stream may not coincide with a triangle edge in the TIN. In addition, there is no concept of flow, so basins cannot be modeled. Yu et al. [294] introduce a broader definition of drainage network on a TIN, which also allows streams to pass through the interior of a triangle. Their definition is based on the following four assumptions: (i) at any point, water follows the steepest descent; (ii) watercourses can merge (thus the drainage network is a forest); (iii) watercourses end only at local minima; (iv) at any point there is a unique direction of steepest descent. The drainage network is defined as the collection of those points on the terrain that receive water from a region whose area exceeds a certain threshold value. They propose an algorithm for computing the network which runs in 0(n + k) time, where n is the size of the TIN and k the size of the drainage network. In [52] it has been proved that the complexity of the drainage network, as defined in [294], in a TIN with n vertices may be 0{rv'). By contrast, the drainage network defined according to Frank et al. [103] has a linear space complexity.
5.4. Path problems In this subsection, we deal with path problems on a terrain model (for path computation on a map see Subsection 3.5). Refer also to Chapter 15. Different optimality criteria for paths can be defined on a terrain [268]: measures of the quality of a path include the Euclidean length, the maximal height along the path, the total height difference, and the maximal slope of the path. Several results appeared in the computational geometry literature on the shortest geodesic path problem. In particular algorithms have been proposed for computing such path on convex [201,251] and on nonconvex [34,195] polyhedra. The best result is due to Chen and Han [34] who propose an O(n^) algorithm. Since polyhedral terrains are approximations of real surfaces, simpler and more practical algorithm which find an approximation to the optimal solution are sufficient and more desirable. Approximate algorithms for convex polyhedra are described in [3,35,133,170], and for general polyhedra in [5]. Lanthier et al. [170] consider the problem of computing an approximate shortest path between two points on a TIN when each face has an associated weight. This is an instance of the weighted region problem discussed in Subsection 3.5. They propose practical algorithms based on the placement of Steiner points at edges of a polyhedral terrain, and on shortest paths on graphs. A good feature of such algorithms is that execution time and space requirements can be traded for accuracy, thus such algorithms can be used to build a sequence of shortest paths with increasing accuracy. Experimentally, the complexity of such an approach is 0{n logn), while a worst case analysis leads to O(n^) and 0{rv' \ogn) complexities. A heuristic technique based on discarding the parts of the terrain where the shortest path cannot pass through has been proposed in [15]; this approach, however, applies to regular triangulations, like quaternary ones. In [268] algorithms are presented for the other quality measures discussed at the beginning of this subsection. In [54], algorithms are presented for answering path queries on a TIN in O(logn) time (with a preprocessing time of 0{n\ogn)). Such algorithms support queries like deciding whether there exists a path between two points whose height de
Applications of computational geometry to geographic information systems
373
creases monotonically, or deciding whether there is a path joining two points and staying below a given height. 6. Threedimensional GIS Classical GISs deal with just two dimensions: terrains are not true threedimensional objects, since most part of modeling and reasoning is done in their twodimensional domain. Adding true three dimensionality to GIS is a more recent research area, in which computational geometry is directly involved. Threedimensional capabilities in a GIS system are required in cadastral and architectural applications for representation of buildings, and in geosciences and environmental modeling for representing the structure of either earth, or atmosphere (e.g., levels of rocks in geology; air flow, temperature and pressure in metereology). Threedimensional geographic data can be handled with techniques inherited from 3D geometric modeling and CAD systems (see, e.g., the book by Mantila [187,199]). The shape of manmade objects (buildings, etc.) is usually regular and completely known, and directly modeled with classical CAD techniques. When representing physical phenomena (e.g., in geology), complex structures are known only at a finite set of sampled points, and interpolation must be used in order to recover a complete model of a threedimensional area. The situation is similar to the case of terrain modeling, in one dimension higher. Jones [153] provides an overview of data models for threedimensional objects in geology. While a uniform and dense sampling of twodimensional domains is easily achieved, threedimensional sampling is usually sparse because of high costs. Thus, a regular threedimensional grid would result in a useless waste of memory. Adaptive regular grids, such as octrees and their variants, are more appropriate. The octree [242] is a threedimensional generalization of the quadtree. It is based on a recursive partition of a cubic universe into nested cubes of different sizes, which can be unfolded as a tree with degree eight. Each cubic cell is assigned an attribute value (e.g., a type of rock, a pressure value, etc.). Drawbacks of this representation are the necessity of a regular distribution of data points, and the rough approximation of boundaries between zones characterized by different attribute values: this is not admissible when information about the surface separating two different attributes (e.g., the surface between two different types of soil), must be maintained in the 3D model. Irregular tetrahedralizations (i.e., the 3D extensions of triangulations) are also used. They provide an objectcentered decomposition and adapt to the distribution of the sampled data. In particular, the Delaunay tetrahedralization extends the empty circle property of the Delaunay triangulation to an empty sphere property. A tetrahedral complex has the advantage of being able to include surface constraints (e.g., the contact surface between two layer of rock), as specific faces, edges, or vertices of the complex. Efficient algorithms to build Delaunay tetrahedralizations of a point set in 3D are available in the computations geometry literature. Such algorithms can be classified into indirect algorithms (which compute the Delaunay tetrahedralization of a given set of points in 3D space by projecting the convex hull of a transformed set of points in 4D), incremental algorithms, based on the progressive insertion of points into an initial tetrahedralization [282,
374
L. de Floriani et al.
151,81], and algorithms which start from a single tetrahedron and progressively add new tetrahedra adjacent to the existing ones [12]. The problem of computing a constrained Delaunay tetrahedralization has been shown to be NPcomplete [236]. Heuristic algorithms have been proposed which compute a conforming Delaunay tetrahedralization: the idea is replacing each data segment with a set of points, in such a way that the original segment will be a chain of edges in the output tetrahedraUzation [21]. Although there is no bound to the number of points which must be added to guarantee that all given segments are included in the resulting tetrahedralization, these methods seem good in practice. For details refer also to Chapter 5. The Delaunay tetrahedralization has also been applied to reconstructing the boundary surface of solid objects. Input data for this problem are scattered points and/or segments lying on the object boundary. A common approach starts with the Delaunay tetrahedralization of the whole data, whose domain is the convex hull of the data set, and progressively removes tetrahedra in order to move internal points, or internal segments, on the boundary. The sculpturing method [20,21] deletes tetrahedra iteratively based on heuristic considerations and topological constraints. The alphashape approach [84] deletes all tetrahedra which can be "erased" by a sphere of a given radius, under the constraint that the sphere cannot pass through the data point. The radius is chosen through a binary search as the smallest value able to guarantee the consistency of the resulting shape. The alphashape method cannot resolve deep and narrow holes in the surface: such problem can be solved by applying the sculpturing method in a final step [14]. The method proposed by Veltkamp [267] for scattered segments is based on a different geometric structure, called the yneighborhoodgraph. The yneighborhood graph is a parametric graph that provides a continuous spectrum of graphs ranging from the empty to the complete graph (and including the Delaunay tetrahedralization as well). A suitable value of the parameter is chosen in order to obtain a feasible approximation of the object shape. A completely different approach is used in [144]: based on the available points, a function in 3D space is defined which pointwise estimates the distance from the unknown surface; then, a conventional algorithm (e.g., marching cubes) is used to extract the isosurface corresponding to the zero value of the function, which provides the final surface approximation.
7. Concluding remarks Computational geometry offers rigorous and powerful tools for solving a variety of geometric problems in GIS. In this survey, we have reviewed issues concerning efficient data structures to store geometric information on geographic data, and algorithms for basic spatial queries, overlay, map generalization, labeling, construction and conversion of terrain models, terrain approximation and multiresolution, visibility, extraction of topographic features, drainage networks, paths, as well as a handful of other specific problems. At the state of the art, computational geometry tools are effective for many such problems, yet GIS practitioners often adopt heuristics that are less rigorous and efficient. This gap between theory and practice used to be justified by the difficulty of coding computational geometry algorithms, and especially because practical performance often did not follow from theoretical efficiency. Indeed, the search for asymptotic efficiency in the
Applications
of computational
geometry to geographic information systems
375
worst case (which hardly occurs) sometimes leads to very involved algorithms that perform poorly on real data configurations. Although in some cases this is still true, recent advances, and research trends in computational geometry show that many theoretically rigorous tools either are, or will become soon, competitive also in practical applications [261]. The following issues have great relevance in making computational geometry effective, and easily available to practitioners. • Randomized algorithms use more realistic models for evaluating the computational complexity, and may provide solutions as easy to program as bruteforce approaches, and with provably good performance on realworld data. This class of algorithms is consolidated in computational geometry, and textbooks are already available [202]. Refer also to Chapter 16. • Robustness in numerical computation is of primary importance, since errors due to floatingpoint arithmetic can compromise not only the accuracy, but even the correctness of results [142]. The problem of robustness has been faced by developing either methods for exact arithmetic [100], or algorithms that guarantee a correct result with finite precision [126], ox adaptive precision [179] in geometric computations. • Computational geometry libraries provide standard implementations of geometric algorithms, together with application programming interfaces that make such tools easily usable by practitioners. Developing and engineering libraries is perhaps the most successful way to export computational geometry technologies to applied fields. For instance, the LEDA library [204] provides a carefully engineered platform for developing discrete and geometric algorithms that is already used in industrial environments; the CGAL library [212] is under development, which can be integrated with LEDA, and offers tools for geometric robustness and specific algorithms for computational geometry; another geometric library under development is GeomLib [2]. From the point of view of researchers in computational geometry, the field of GIS is a highly stimulating arena, and a plentiful source of open problems. Strategic directions reported by the Computational Geometry Working Group [261] clearly indicate a list of hot issues — such as robustness, finegrain complexity analysis, implementation, experimental evaluation, externalmemory algorithms, dynamic and realtime computing, approximation algorithms, and parallel and distributed computing — all of which are relevant, and in some cases vital to GIS applications. The following open issues in GIS offer excellent cues for research. • Realistic map models should be based on decompositions more general than planar subdivisions or CW complexes, in order to capture situations like regions with holes, and point and lineal features. Also, efficient data structures to encode such maps should be developed. • Realistic queries in spatial databases always involve both geometric, and nongeometric aspects. A solution for such queries necessarily involves both geometric algorithms, and information retrieval techniques. A separate treatment of geometric and nongeometric issues often leads to inefficient solutions. An integrated approach to hybrid queries is currently lacking, and not even models for the evaluation of performances in resolving hybrid queries have been proposed yet. • The management of large spatial datasets in external memory is also very important, and related to the previous issue. Most algorithms and data structures in computational ge
376
•
•
•
•
•
•
•
L. de Floriani et ah
ometry have been studied and developed for the primary storage, while this assumption is hardly realistic for any problem in GIS. Map generalization is an important task that involves many challenging geometric problems, and also requires the integration of geometric and nongeometric information. A comprehensive approach to generalization is still lacking. Serious achievements towards the automation of such task will probably require managing knowledge at a level much beyond the scope of geometry. However, a high benefit would come from an integrated treatment at least of all geometric problems. Compression and progressive transmission of data is relevant, especially in the context of webaware applications. While for terrains different techniques already exist, either based on geometric compression, or on wavelets, the compression and progressive transmission of maps is a more complex issue, since it involves both geometrical and topological approximation. Multiresolution is currently a topic of great interest. Most of the work in multiresolution modeling of terrains (and, more generally, of surfaces) has been dealing with the problem of selective refinement, while most of the problems related with query processing, and terrain analysis at variable resolution are still an open issue. Facing such problems with a multiresolution approach may be vital to cope with the huge (practically worldwide) terrain databases that are becoming available. In the field of map processing, multiresolution is at an even earlier stage. As we discussed in Section 2.5, there are only a few empirical approaches based on heuristics, and few theoretically oriented works, based either on graph manipulation, or on transformations of cell complexes. The gap between theory and practice is still quite large. Important open problems are related to the design and development of efficient data structures, construction of multiple representations, and algorithms for answering spatial queries in a multiresolution framework, especially concerning spatial join (overlay), visibility, path computation, etc. Many optimization and approximation problems in GIS (e.g., terrain approximation, map labeling, some visibilityrelated problems) are intractable. Approximated algorithms that can run in reasonable time, and can guarantee bounds on the size of the result are very important to provide practical solutions to such problems. The field of 3D GIS, which is quite recent, offers many other cues of research. Much preliminary work is still needed in order to achieve a level of standardization sufficient at least to establish a common basis for researchers. In 3D, a classification of the different types of data, and of the relevant queries on them has still to be provided. Although both the kind of information and the queries will be often strictly dependent on the specific application (e.g., modeling geological phenomena, or modeling buildings in an architectural environment), a serious analysis from practice to theory may lead to identifying general modehng and computational issues that offer a key to a more integrated approach to spatial information handling. Besides the issues listed above, there are plenty of specific problems that still need to be investigated, such as intersectionfree line and map simplification, conflation and rubber sheeting of maps, edge matching and change detection, progressive transmission of maps and terrains, etc.
Applications
of computational
geometry to geographic information systems
377
References [1] P.K. Agarwal and S. Suri, Surface approximation and geometric partitions. Proceedings 5th ACMSIAM Symposium on Discrete Algorithms (1994), 2433. [2] P.K. Agarwal, M.T. Goodrich, S.R. Kosaraju, F.P. Preparata, R. Tamassia and J.S. Vitter, Applicable and robust geometric computing (1995), available from http://www.cs.brown.edu/cgc/. [3] P.K. Agarwal, A. HarPeled, M. Sharir and K.R. Varadarajan, Approximating shortest paths on a convex polytope in three dimensions, J. ACM (1997). [4] P.K. Agarwal, M. van Kreveld and S. Suri, Label placement by maximum independent sets in rectangles. Proceedings 9th Canadian Conference on Computational Geometry (August 1997). [5] P.K. Agarwal and K.R. Varadarajan, Approximating shortest paths on a polyhedron. Proceedings 38th IEEE Symposium on Foundations of Computer Science (1997). [6] P.K. Agarwal and P.K. Desikan, An efficient algorithm for terrain simplification. Proceedings 8th ACMSIAM Symposium on Discrete Algorithms (1997). [7] D.S. Andrews, J. Snoeyink, J. Boritz, T. Chan, G. Denham, J. Harrison and C. Zhu, Further comparison of algorithms for geometric intersection problems. Proceedings 6th International Symposium on Spatial Data Handling (1994), 709724. [8] W.G. Aref and H. Samet, Uniquely reporting spatial objects: Yet another operation for comparing spatial data structures. Proceedings 5th International Symposium on Spatial Data Handling, Charleston, SC (1992), 178189. [9] S. Aronoff, Geographic Information Systems: A Management Perspective, WDL Publications, Ottawa (1989). [10] M. Atallah, Dynamic computational geometry. Proceedings 24th IEEE Symposium on Foundations of Computer Science, IEEE Computer Society, Baltimora (1983), 9299. [11] F. Aurenhammer, Voronoi diagrams —A survey of fundamental geometric data structures, ACM Comput. Surveys 23 (3) (1991), 366405. [12] D. Avis and B.K. Battacharya, Algorithms for computing ddimensional Voronoi diagrams and their duals. Advances in Computing Research 1, F.P. Preparata, ed., JAI Press (1983), 159180. [13] C.L. Bajaj, V. Pascucci and D.R. Schikore, Fast isocontouring for improved interactivity. Proceedings 1996 SPIE Symposium on Volume Visualization, San Francisco (1996), 3 9 ^ 6 . [14] C.L. Bajaj, F. Bernardini, J. Chen and D.R. Schikore, Automatic Reconstruction of 3D CAD Models, Theory and Practice of Geometric Modeling, W. StraBer, R. Klein and R. Rau, eds. SpringerVerlag (1996). [15] R. Barrera and J. VazquesGomez, A shortest path algorithm for hierarchical terrain models. Proceedings AUTOCARTO 9 (1989), 156163. [16] B. Baumgart, A polyhedral representation for computer vision. Proceedings of the AFIPS National Computer Conference (1975), 589596. [17] N. Beckmann, H.P. Kriegel, R. Schneider and B. Seeger, The R*tree: An efficient and robust access method for points and rectangles. Proceedings ACM SIGMOD (1990), 8190. [18] J.L. Bentley and T.A. Ottman, Algorithms for reporting and counting geometric intersections, IEEE Transactions on Computers 28 (9) (1979), 643647. [19] M. Bertolotto, L. De Floriani and E. Puppo, Multiresolution topological maps. Advanced Geographic Data Modelling — Spatial Data Modelling and Query Languages for 2D and 3D Applications, M. Molenaar and S. De Hoop, eds. Publication on Geodesy — New Series 40 (1994), 179190. [20] J.D. Boissonnat, Geometric structures for threedimensional shape representation, ACM Trans, on Graphics 3 (4) (1984), 266286. [21] J.D. Boissonnat, O.D. Faugeras and E. Le BrasMehlman, Representing stereo data with the Delaunay triangulation, Artif. Intell. 44 (1990), 4189. [22] J.D. Boissonnat, O. Devillers, R. Schott, M. Tailland and M. Yvinec, Application of random sampling to online algorithms in computational geometry. Discrete Comput. Geom. 8 (1992), 5171. [23] J.D. Boissonnat and K. Dobrindt, Online construction of the upper envelope of triangles in M^, Proceedings 4th Canadian Conference on Computational Geometry, C.A. Wang, ed.. Memorial, Newfoundland (1992), 311315. [24] P. Bose, T. Shermer, G. Toussaint and B. Zhu, Guarding polyhedral terrains, Comput. Geom. 7 (3) (1997), 173185.
378
L. de Floriani et al.
[25] E. Brisson, Representing geometric structures in d dimensions: Topology and order. Discrete Comput. Geom. 9 (4) (1993), 387^26. [26] RJ.C. Brown, A/fl5? algorithm for selective refinement of terrain meshes. Proceedings COMPUGRAPHICS 96, GRASP (December 1996), 7082. [27] P. A. Burrough, Principles of Geographic Information Systems for Land Resources Assessment, Clarendon Press, Oxford (1986). [28] S.J. Carver and C.F. Brunson, Vector to raster conversion error and feature complexity: An empirical study using simulated data, Intemat. J. Geogr. Inform. Systems 8 (3) (1994), 261270. [29] A. Carrara, G. Bitelli and R. Carla, Comparison of techniques for generating digital terrain models from contour lines, Intemat. J. Geogr. Inform. Sci. 11 (5), 451474. [30] B. Chazelle and H. Edelsbrunner, An optimal algorithm for intersecting line segment in the plane, J. ACM 39(1) (1992), 154. [31] B, Chazelle, H. Edelsbrunner, L.J. Guibas and M. Sharir, Algorithms for bichromatic linesegment problem and polyhedral terrains, Algorithmica 11, SpringerVerlag, New York (1994), 116132. [32] T. Chan, A simple trapezoidal sweep algorithm for reporting red/blue segment intersections. Proceedings 6th Canadian Conference on Computational Geometry (1994), 263268. [33] Z.T. Chen and J.A. Guevara, Systematic selection of very important points (VIP) from digital terain model for constructing triangular irregular networks. Proceedings AUTOCARTO 8, Baltimore, MD, USA (1987), 5056. [34] J. Chen and Y. Han, Shortest paths on a polyhedron. Proceedings 6th ACM Symposium on Computational Geometry (1990), 360369. [35] J. Choi, J. Sellen and C.K. Yap, Approximate Euclidean shortest path in 3space, Proceedings 10th ACM Symposium on Computational Geometry (1994), 4 1 ^ 8 . [36] M.M. Chow, Optimized geometry compression for realtime rendering. Proceedings IEEE Visualization '97 (1997), 347354. [37] J. Christensen, Fitting a triangulation to contour lines. Proceedings AUTOCARTO 8, Baltimore, Maryland (1987), 5767. [38] J. Christensen, J. Marks and S. Stuart, An empirical study of algorithms for pointfeature placement, ACM Trans, on Graphics 14 (3) (1995), 203232. [39] A. Ciampalini, P. Cignoni, C. Montani and R. Scopigno, Multiresolution decimation based on global error. The Visual Computer 13 (5) (1997), 228246. [40] P. Cignoni, E. Puppo and R. Scopigno, Representation and visualization of terrain surfaces at variable resolution. The Visual Computer 13 (1997). [41] K.L. Clarkson and P.W. Shor, Application of random sampling in computer geometry. Discrete Comput. Geom. 4 (5) (1989), 387421. [42] E. Clementini and P. Di Felice, A comparison of methods for representing topological relationships. Inform. Sci. 3 (1995), 149178. [43] E. Clementini and P. Di Felice, A model for representing topological relationships between complex geometric features in spatial databases. Inform. Sci. 90 ( 1 ^ ) (1996), 121136. [44] J. Cohen, A. Varshney, D. Manocha, G. Turk, H. Weber, P. Agarwal, F Brooks and W. Wright, Simplification envelopes, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '96) (1996), 119128. [45] R. Cole and M. Sharir, Visibility problems for polyhedral terrains, J. Symbolic Comput. 17 (1989), 1130. [46] J.P. Corbett, Topological principles in cartography. Technical Report 48, U.S. Bureau of Census, USA (1979). [47] R.G. Cromley, A spatial allocation analysis of the point annotation problem. Proceedings 2nd International Symposium on Spatial Data Handling, Seattle, WA (July 1986), 3849. [48] E.F. D'Azavedo and R.B. Simpson, On optimal interpolation triangle incidences, SIAM J. Sci. Statist. Comput. 20 (6) (1989), 10631075. [49] M. de Berg, Ray shooting, Depth Orders and Hidden Surface Removal, Lecture Notes in Comput. Sci. 703, SpringerVerlag, New York (1993). [50] M. de Berg and K.T.G. Dobrindt, On the levels of detail in terrains, 11th ACM Symposium on Computational Geometry, Vancouver, BC (Canada), June 57 (1995).
Applications
of computational
geometry to geographic information systems
379
[511 M. de Berg, M. van Kreveld and S. Shirra, A new approach to subdivision simplification. Technical Papers, ACSM/ASPRS Annual Convention 4 (AUTOCARTO 12) (1995), 7988. [52J M. de Berg, P. Bose, K. Dobrindt, M. van Kreveld, M. Overmars, M. de Groot, T. Roos, J. Snoeyink and S. Yu, The complexity of rivers in triangulated terrains. Proceedings 8th Canadian Conference on Computational Geometry, Ottawa (1996), 325330. [53] M. de Berg, M. van Kreveld, R. van Oostrum and M. Overmars, Simple traversal of a subdivision without extra storage, Internat. J. Geogr. Inform. Sci. 11 (4) (.Tune 1997), 359373. [54] M. de Berg and M. van Kreveld, Trekking in the alps without freezing or getting tired, Algorithmica 18, 306323. [55] M. Deering, Geometry compression. Computer Graphics (SIGGRAPH'95) (1995), 1320. [56] L. De Floriani, A pyramidal data structure for trianglebased surface description, IEEE Comput. Graphics Appl 8 (March 1989), 6778. [57] L. De Floriani, B. Falcidieno, G. Nagy and C. Pienovi, On sorting triangles in a Delaunay tesselation, Algonthmica 6 (1991), 522535. [58] L. De Floriani, P. Marzano and E. Puppo, Spatial queries and data models. Spatial Information Theory — A theoretical basis for GIS, A.U. Frank and I. Campari, eds, Lecture Notes in Comput. Sci. 716, SpringerVerlag (1993), 113138 [59] L. De Floriani, P. Marzano and E. Puppo, Lineof sight communication on a terrain models, Internat. J. Geogr. Inform. Systems 8 (4) (1994), Taylor & Francis, London, 329342. [60] L. De Floriani and P. Magillo, Horizon computation on a hierarchical terrain model. The Visual Computer: An International Journal of Computer Graphics 11 (1995), 134149. [61] L. De Floriani and E. Puppo, Hierarchical triangulation for multiresolution surface description, ACM Trans, on Graphics 14 (4) (1995), 363411. [62] L. De Floriani, P. Magillo and E. Puppo, A formal approach to multire solution modeling. Geometric Modeling: Theory and Practice, W. StraBer, R. Klein and R. Rau, eds, SpringerVerlag (1996). [63] L. De Floriani, P. Magillo and E. Puppo, Building and traversing a surface at variable resolution. Proceedings IEEE Visualization 97, Phoenix, AZ (USA) (October 1997), 103110. [64] L. De Floriani, P. Magillo and E. Puppo, Efficient encoding and retrieval of triangle meshes at variable resolution. Technical Report DISITR9701, Department of Computer and Information Sciences, University of Genova, Genova, Italy (1997). [65] L. De Floriani, P. Magillo and E. Puppo, Efficient implementation of multitriangulations. Proceedings IEEE Visualization 98, Triangle Park, North Carolina (October 1998), 4350. [66] L. De Floriani and P. Magillo, Visibility computations on hierarchical triangulated terrain models, Geoinformatica 1 (3) (1997), 219250. [67] V. Delis and T. Hadzilacos, On the assessment of generalization consistency. Proceedings 5th Symposium on Spatial Databases (SSD97), Berlin (July 1997). [68] G. Dettori and E. Puppo, How generalization interacts with the topological and geometric structure of maps. Proceedings 7th International Symposium on Spatial Data Handling, Delft (The Netherlands) (August 1996). [69] K. Dobrindt and M. Yvinec, Remembering conflicts in history yields dynamic algorithms. Proceedings 4th Annual International Symposium on Applied Computing (ISAAC '93), Lecture Notes in Comput. Sci. 762 (1993), 2130. [70] J.S. Doerschler and H, Freeman, A rulebased system for densemap name placement. Communications of the ACM 35 (1) (1992), 6879. [71] J. A. Dougenik, N.R. Chrisman and D.R. Niemeyer, Ad algorithm to construct continuous area cartograms. Professional Geographer 37 (1985), 7581. [72] D.H. Douglas and T.K. Peucker, Algorithms for the reduction of the number ofpoints required to represent a digitized line or its caricature. The Canadian Cartographer 10 (2) (1973), 112122. [73] M. Duchaineau, M. Wolinsky, D.E. Sigeti, M.C. Miller, C. Aldrich and M.B. MineedWeinstein, ROAMing terrain: Realtime optimally adapting meshes. Proceedings IEEE Visualization'97 (1997), 8188. [74] R.O. Duda and RE. Hart, Pattern Classification and Scene Analysis, Wiley, New York (1973). [75] G. Dutton, Geodesic modelling of planetary relief Cartographica 21 (1988), 188207. [76] G. Dutton, Polyhedral hierarchical tessellation: The shape of GIS to come, Geo Info Systems 2 (1) (1991), 4955.
380
L. de Floriani et al
[77] G. Dutton, Improving locational specificity of map data — a multiresolution, metadatadriven approach and notation, Intemat. J. Geogr. Inform. Systems 10 (3) (1996), 253268. [78] N. Dyn, D. Levin and S. Rippa, Data dependent triangulations for piecewise linear interpolation, IMA J. Numer. Anal. 10 (1990), 137154. [79] H. Edelsbrunner, Algorithms in Combinatorial Geometry, SpringerVerlag (1987). [80] H. Edelsbrunner, L.J. Guibas and M. Sharir, The upper envelope of piecewise linear functions: Algorithms and applications. Discrete Comput. Geom. 4 (1989), 311336. [81] H. Edelsbrunner and N.R. Shah, Incremental topological flipping works for regular triangulations. Proceedings 8th Annual ACM Symposium on Computational Geometry (1992), 4352. [82] H. Edelsbrunner and R. Waupotitsch, A combinatorial approach to cartograms, Comput. Geom. 7 (1997), 343360. [83] H. Edelsbrunner and T.S. Tan, An upper bound for conforming Delaunay triangulations. Discrete Comput. Geom. 10(1993), 197213. [84] H. Edelsbrunner and E.R Mucke, Threedimensional alpha shapes, ACM Trans, on Graphics 13 (1) (1994), 4372. [85] M. Egenhofer and R. Franzosa, Pointset topological spatial relations, Intemat. J. Geogr. Inform. Systems 5 (2) (1991), 161174. [86] M. Egenhofer, E. Clementini and R Di Felice, Topological relations between regions with holes, Intemat. J. Geogr. Inform. Systems 8 (2) (1994), 129142. [87] M. Egenhofer, E. Clementini and R Di Felice, Evaluating inconsistencies among multiple representations, Proceedings 6th Intemational Symposium on Spatial Data Handling, Edinburgh, Scotland (1994), 901920. [88] L. Eklundh and U. Martensson, Rapide generation of digital elevation models from topographic maps, Intemat. J. Geogr. Inform. Systems 9 (3) (1995), 329340. [89] F. Evans, S. Skiena and A. Varshney, Optimizing triangle strips for fast rendering. Proceedings IEEE Visualization '96 (1996), 319326. [90] W. Evans, D. Kirkpatrick and G. Townsend, Right triangular irregular networks. Technical Report 9709, University of Arizona (1997). [91] B. Falcidieno and M. Spagnuolo, A new method for the characterization of topographic surfaces, Intemat. J. Geogr. Inform. Systems 5 (4) (1991), 397^12. [92] C. Faloutsos and I. Kamel, Hilbert Rtree: An improved Rtree using fractals. Proceedings Intemational Conference on Very Large Data Bases (VLDB) (1994). [93] C. Faloutsos and I. Kamel, Beyond uniformity and independence: Analysis of Rtrees using the concept of fractal dimension. Proceedings ACM SIGACTSIGMODSIGART PODS (1994), 413. [94] U. Finke and K.H. Hinrichs, The quad view data structure — A representation for planar subdivisions. Advances in Spatial Databases, M.J. Egenhofer and J.R. Herring, eds. Lecture Notes in Comput. Sci. 951, Springer (1995), 2 9 ^ 6 . [95] U. Finke and K.H. Hinrichs, Overlaying simply connected planar subdivisions in linear time, Procceedings 11th Canadian Conference on Computational Geometry (1995), 119126. [96] P.F Fisher, Algorithm and implementation uncertainty in viewshed analysis, Internat. J. Geogr. Inform. Systems 7 (4) (1993), 331347. [97] P. Flajolet, G.H. Gonnet, C. Puech and J.M. Robson, Analytic variations on quedtrees, Algorithmica 10 (6) (1993), 473500. [98] D.J. Foley, A. Van Dam, S.K. Feiner and J.F Hughes, Computer Graphics: Principles and Practice, AddisonWesley, Reading, MA (1990). [99] M. Formann and F. Wagner, A packing problem with applications to lettering of maps. Proceedings 7th ACM Symposium on Computational Geometry (1991), 281288. [100] S. Fortune and C. Van Wyk, Efficient exact arithmetic for computational geometry. Proceedings 9th ACM Symposium on Computational Geometry (1993), 163172. [101] R.F Fowler and J.J. Little, Automatic extraction of irregular digital terrain models. Computer Graphics 13(1979), 199207. [102] A.U. Frank and W. Kuhn, Cell graph: A provable correct method for the storage of geometry. Proceedings 2nd Symposium on Spatial Data Handhng (SDH'86), Seattle, WA (1986), 411^36.
Applications
of computational
geometry to geographic information systems
381
[103] A.U. Frank, B. Palmer and V.B. Robinson, Formal methods for the accurate definition of some fundamental terms in physical geography. Proceedings 2nd International Symposium on Spatial Data Handling (1986), 585599. [104] W.R. Franklin, Efficient intersection calculations in large databases. Proceedings International Cartographic Association 14th World Conference, Budapest (1989), A62A63. [105] W.R. Franklin, M. Kankanhalli and C. Narayanaswami, Geometric computing and the uniform grid data technique. Computer Aided Design 21 (7) (1989), 410420. [106] A.U. Frank, Spatial concepts, geometric data models, and data structures. Computers and Geosciences 18 (4) (1992), 409417. [107] A. Frank and S. Timpf, Multiple representations for cartographic objects in a multiscale tree —An intelligent graphical zoom. Computers & Graphics 18 (6) (1994), 823829. [108] W.R. Franklin, Triangulated irregular network to approximate digital terrain. Technical Report, ECSE Dept., RPI, Troy (NY) (1994). Manuscript and code available on ftp://ftp.cs.rpi.edu/pub/franklin/. [109] H. Fuchs, S.P. Uselton and Z. Zedem, Optimal surface reconstruction from planar contours, Comm. ACM 20 (10) (1977), 693702. [110] A.B, Garcia, C.G. Niciera, J.B.O. Mere and A.M. Diax, A contourline based triangulation algorithm. Proceedings 5th International Symposium on Spatial Data Handling (1992), 411^21. [ I l l ] S. Ganapathy and T.G. Dennehy, A new general triangulation method for planar contours. Computer Graphics 16 (3) (1982), 6975. [112] L. Gewali, A. Meng, J.S.B. Mitchell and S. Ntafos, Path planning in O/l/oo weighted regions with applications. Proceedings 4th Symposium on Computational Geometry (1988), 266278. [113] S.K. Ghosh, Computing the visibility polygon from a convex set and related problems, J. Algorithms 12 (1991), 7595. [114] C. Gold, Problems with handling spatial data — the Voronoi approach, CISM J. 45 (1991), 6580. [115] CM. Gold, An objectbased dynamic spatial model, and its application in the development of a userfriendly digitizing system. Proceedings 5th International Symposium on Spatial Data Handling, Charleston, IGU Commission on GIS (1992), 495504. [116] C. Gold, Dynamic data structures. Advanced Geographic Data Modelling — Spatial Data Modelling and Query Languages for 2D and 3D AppHcations, M. Molenaar and S. De Hoop, eds, Netherlands Geodetic Commission, Publication on Geodesy — New Series 40 (1994), 121128. [117] C. Gold and T. Roos, Surface modeling with guaranteed consistency — an objectbased approach. Proceedings IGIS'94: Geographic Information Systems, J. Nievergelt, T. Roos, H.J. Schack and P. Widmayer, eds. Lecture Notes in Comput. Sci. 884, SpringerVerlag (1994), 7085. [118] D. Gomez and A. Guzman, A digital model for threedimensional surface representation, Geoprocessing 1 (1979), 5370. [119] M.F. Goodchild, K.K. Kemp and T.K. Poiker, NCGIA Core Curriculum, National Center for Geographic Information Analysis, University of California, Santa Barbara, USA (1989), also available at http://www.env.gov.bc.ca/ tclover/giscourse/ToC.html. [120] M.F. Goodchild and Y. Shiren, A hierarchical data structure for global geographic information systems. Computer Vision, Graphics and Image Process. 54 (1992), 3 1 ^ 4 . [121] M.T. Goodrich, A polygonal approach to hidden line and hidden surface elimination. Graphical Models and Image Process. 54 (1) (1992), 112. [122] M.H. Gross, O.G. Staadt and R. Gatti, Efficient triangular surface approximation using wavelets and quadtree data structures, IEEE Trans. Visualization and Computer Graphics 2 (2), 130143. [123] L.J. Guibas and J. Stolfi, Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams, ACM Trans, on Graphics 4 (1985), 74123. [124] L.J. Guibas and R. Seidel, Computing convolutions by reciprocal search. Discrete Comput. Geom. 2 (1987), 175193. [125] L.J. Guibas, J.E. Hershberger, J.S.B. Mitchell and J.S. Snoeyink, Approximating polygons and subdivisions with minimumlink paths, Intemat. J. Comput. Geom. Appl. 3 (4) (1983), 383415. [126] L.J. Guibas and D.H. Marimont, Rounding arrangements dynamically. Proceedings 11th ACM Symposium on Computational Geometry (1995), 190199. [ 127] A. Guttman, Rtrees: A dynamic index structure for spatial searching. Proceedings ACM SIGMOD (1984), 4757.
382
L. de Floriani et al.
[128] R.H. Giiting and M. Schneider, Realms: A foundation for spatial data types in database systems. Proceedings 3rd International Symposium on Large Spatial Databases, Singapore (1993), 1435. [129] R.H. Giiting, T. Ridder and M. Schneider, Implementation of the ROSE algebra: Efficient algorithms for realmbased spatial data types. Proceedings 4th International Symposium on Large Spatial Databases, Portland, ME, Lecture Notes in Comput. Sci. 951, SpringerVerlag (1995), 216239. [130] T. Hadzilacos and N. Tryfona, A model for expressing topological integrity constraints in geographic databases. Lecture Notes in Comput. Sci. 639, SpringerVerlag (1992), 252268. [131] B. Hamman, A data reduction scheme for triangulated surfaces, Comput. Aided Geom. Design 11 (1994), 197214. [132] R.M. Haralick, Ridges and valleys on digital images. Computer Vision, Graphics and Image Process. 22 (1983), 2838. [133] S. HarPeled, M. Sharir and K.R. Varadarajan, Approximate shortest paths on a convex polytope in three dimensions. Proceedings 12th Annu. ACM Sympos. Comput. Geom. (1996), 329338. [134] D.J. Hebert and H.J. Kim, Image encoding with triangulation wavelets. Proceedings SPIE 2569 1 (1995), 381392. [135] P. Heckbert and M. Garland, Survey of polygonal surface simplification algorithms, Siggraph'97 Course Notes (1997). [136] J. Herring, TIGRIS: Topologically integrated GIS, Proceedings AUTOCARTO 8, ASPRS/ACSM, Baltimore, MD (March 1987), 282291. [137] J. Hershberger, Finding the upper envelope ofn line segments in 0{n logn) time. Inform. Process. Lett. 33 (1989), 169174. [138] J. Hershberger and J. Snoeyink, Computing minimum length paths of a given homotopy class, Comput. Geom. 4 (1994), 6397. [139] J. Hershberger and J. Snoeyink, Cartographic line simplification and polygon CSG formulae in 0(n log* n) time, Proceedings 5th Annual Workshop on Algorithms and Data Structures, Halifax, Nova Scotia, Canada (August 1997). [140] G.R. Hjaltason and H. Samet, Ranking in spatial databases. Advances in Spatial Databases, Lecture Notes in Comput. Sci. 951, SpringerVerlag (1995), 8395. [141] E.G. Hoel and H. Samet, Efficient processing of spatial queries in line segment database. Advances in Spatial Databases, Lecture Notes in Comput. Sci. 525, SpringerVerlag (1991). [142] CM. Hoffmann, The problems of accuracy and robustness in computational geometry, IEEE Computer 22 (3) (1989), 3141. [ 143] C. Hoffmann, Geometric and Solid Modeling: An Introduction, The Morgan Kaufmann Series in Computer Graphics and Geometric Modeling, Morgan Kaufmann, San Mateo, California (1989). [144] H. Hoppe, T. DeRose, T. Duchamp, J. McDonald and W. Stuetzle, Surface reconstruction from unorganized points. Proceedings SIGGRAPH '92 Computer Graphics Proceedings, Annual Conference Series, ACM SIGGRAPH (1992), 7178. [145] H. Hoppe, Progressive meshes, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '96) (1996), 99108. [146] H. Hoppe, Viewdependent refinement of progressive meshes, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '97) (1997). [147] H. Imai and M. Iri, Computationalgeometric methodsfiyrpolygonal approximations of a curve, Comput. Vision, Graphics and Image Process. 36 (1986), 3 1 ^ 1 . [148] H. Imai and M. Iri, An optimal algorithm for approximating a piecewise linear function, J. Inform. Process. 9 (3) (1986), 159162. [149] H. Imai and M. Iri, Polygonal approximation of a curve —formulations and algorithms. Computational Morphology, G.T. Toussaint, ed.. Machine Intelligence and Pattern Recognition 6, NorthHolland (1988), 7186. [150] S.K. Jenson and J.O. Dominique, Extracting topographic structure from digital elevation data for geographic information system analysis, Photogramm. Eng. Remote Sensing 54 (1988), 15931600. [151] B. Joe, Construction of threedimensional Delaunay triangulations using local transformations, Comput. Aided Geom. Design 8 (2) (1991), 123142. [152] C. Jones, Cartographic name placement with Prolog, IEEE Comput. Graphics Appl. 9 (5) (1989), 3647.
Applications
of computational
geometry to geographic information systems
383
[153] C.B. Jones, Data structures for threedimensional spatial information systems in geology, Internat. J. Geogr. Inform. Systems 3(1) (1989), 1532. [154] C.B. Jones, G.L. Bundy and J.M. Ware, Map generalization with a triangulated data structure, Carthography and Geographic Information Systems 22 (4) (1995), 317331. [155] J. A. Jorge and D. Vaida, A fuzzy relational path algebra for distances and directions. Proceedings EC AI96 Workshop on Representation and Processing of Spatial Expressions, Budapest, Hungary (1996). [156] W. Kainz, Spatial relationships — Topology versus order. Proceedings 4th International Symposium on Spatial Data Handling, Zurich, Switzerland (July 1990), 814819. [. .r/] W. Kainz, M.J. Egenhofer and J. Greasley, Modeling spatial relations and operations with partially ordered sets, Internat. J. Geogr. Inform. Systems 7 (3) (1993), 215225. [158] M.J. Katz, M.H. Overmars and M. Sharir, Efficient hidden surface removal for objects with small union size. Proceedings 7th ACM Symposium on Computational Geometry, ACM Press, New York (1991), 3 1 40. [159] E. Keppel, Approximating complex surfaces by triangulation of contour lines, IBM J. Research and Development 19 (1) (1975), 211. [160] D.G. Kirkpatrick, Efficient computation of continuous skeletons. Proceedings 20th IEEE Symposium on Foundations of Computer Science (1979), 1827. [161] D.G. Kirkpatrick, Optimal search in planar subdivisions, SIAM J. Comput. 12 (1) (1983), 2835. [162] R. Klein and W. StraBer, Generation of multiresolution models from CAD data for real time rendering. Theory and Practice of Geometric Modeling, W. StraBer, R. Klein and R. Rau, eds. SpringerVerlag (1996). [163] J.J. Koenderik and A.J. van Doom, Local features of smooth shapes: Ridges and courses. Geometric Methods in Computer Vision II, Vol. 2031, SPIE (1993), 213. [164] J.J. Koenderik and A.J. van Doom, Twoplusonedimensional differential geometry, Pattern Recogn. Lett. 15 (1994), 439443. [165] T.Y. Kong and A. Rosenfeld, Digital topology: Introduction and survey, Comput. Vision, Graphics and Image Process. 48 (1989), 357393. [166] H.P. Kriegel, T. Brinkhoff and R. Schneider, The combination of spatial access methods and Computational Geometry in Geographic Database Systems, Proceedings 2nd Symposium on Spatial Databases (1991), 521. [167] H.P. Kriegel, T. Brinkhoff and R. Schneider, An efficient map overlay algorithm based on Spatial Access Methods and Computational Geometry, Proceedings International Workshop on DBMSs for Geographical Apphcations, Capri, Italy (May 1991), 1617. [168] L. Kucera, M. Melhom, B. Preis and E. Schwarzenecker, Exact algorithms for a geometric packing problem. Proceedings 10th Symposium on Theoret. Aspects of Computer Science, Lecture Notes in Comput. Sci. 665, SpringerVerlag (1993), 317322. [169] LS. Kweon and T. Kanade, Extracting topological terrain features from elevation maps, Comput. Vision, Graphics and Image Process. 59 (2) (1994), 171182. [ 170] M. Lanthier, A. Maheshwari and J.R. Sack, Approximating weighted shortest paths on polyhedral surfaces. Proceedings ACM Symposium on Computational Geometry, Nice, France (1997), 274283. [171] R. Laurini and D. Thompson, Fundamentals of Spatial Information Systems, Academic Press, London (1992). [172] C.L. Lawson, Software for C^ surface interpolation. Mathematical Software III, J.R. Rice, ed.. Academic Press Inc. (1977), 161164. [173] D.T. Lee and A.K. Lin, Generalized Delaunay triangulation for planar graphs. Discrete Comput. Geom. 1 (1986), 201217. [174] J. Lee, A drop heuristic conversion method for extracting irregular networks for digital elevation models. Proceedings GIS/LIS '89, Orlando, FL, USA (1989), 3039. [175] J. Lee, Analyses of visibility sites on topographic surfaces. Internal. J. Geogr. Inform. Systems 5 (1991), 413429. [176] Z. Li and S. Openshaw, Algorithms for automated line generalization based on a natural principle of objective generalization, Intemat. J. Geogr. Inform. Systems 6 (5) (1992), 373389. [177] P. Lienhardt, Topological models for boundary representations: a comparison with ndimensional generalized maps, Comput. Aided Design 23 (1) (1991), 5982.
384
L. de Floriani et al.
[178] P. Lindstrom, D. KoUer, W. Ribarsky, L.F. Hodges, N. Faust and G.A. Turner, Realtime, continuous level of detail rendering of height fields, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '96), ACM Press, New Orleans, LA, USA (1996), 109118. [179] G. Liotta, F.P. Preparata and R. Tamassia, Robust proximity queries: An illustration of degreedriven algorithm design. Proceedings 13th ACM Symposium on Computational Geometry (1997), 156165 [180] Y. Livnat, H.W. Shen and C.R. Johnson, A near optimal isosurface extraction algorithm using the span space, IEEE Trans. Visuahzation and Comput. Graphics 2 (1996), 7384. [181] M. Lounsbery, T.D. DeRose and J. Warren, Multiresolution analysis of surfaces of arbitrary topological type, ACM Trans, on Graphics 16 (1) (1997), 3473. [182] H. Lukatela, Hipparchus data structures: Points, lines and regions in spherical Voronoi grid. Proceedings AutoCarto 9 (1989), 164170. [183] A.T. Lundell and S. Weingram, The Topology ofCW Complexes, Van Nostrand Reinhold Comp. (1969). [184] P. Magillo and L. De Floriani, Maintaining multiple levels of detail in the overlay of hierarchical subdivisions. Proceedings 8th Canadian Conference on Computational Geometry (1996), 190195. [185] P. Magillo and E. Puppo, Algorithms for parallel terrain modelling and visualisation. Parallel Processing Algorithms for GIS, Ch. 16, R.G. Healey, S. Dowers B.M. Gittings and M.J. Mineter, eds, Taylor & Francis (1998). [186] A. Maheshwari, P. Morin and J.R. Sack, Progressive TINs: Algorithms and applications. Proceedings 5th ACM Workshop on Advances in Geographic Information Systems, November 1516, Las Vegas, Nevada (1997). [187] M. Mantyla, An Introduction to Solid Modeling, Computer Press (1988). [188] D.M, Mark, Topological properties of geographic surfaces: Applications in computer carthography. Proceedings 1st International Advanced Study Symposium on Topological Data Structures for GIS 5, G. Dutton,ed.. Harvard (1994). [189] C.S. Mata and J.S.B. Mitchell, A new algorithm for computing shortest paths in a weighted planar subsivision. Proceedings ACM Symposium on Computational Geometry, Nice, France (June 1997), 264273. [190] I.E. Mc Cormack, M.N. Gahegan, S.A. Roberts, J. Hogg and B.S. Hoyle, Featurebased derivation of drainage networks, Intemat. J. GIS 7 (3) (1993), 263279. [191] M. McKenna, Worst case optimal hidden surface removal, ACM Trans. Graphics 6, ACM Press, New York (1987), 1928. [192] R. McMaster, Automated line generalization, Cartographica 24 (1984), 74111. [193] C. Miller and R.A. LaFlamme, The digital terrain model — theory and applications, Photogramm. Eng. 24 (3) (1958), 433442. [ 194] G. Misund, Varioscale TIN based surfaces. Proceedings 7th Int. Symp. on Spatial Data Handling, August 1216, Delft (NL) (1996), 6.356.46. [195] J.S.B. Mitchell, D.M. Mount and CH. Papamitridiou, The discrete geodesic problem, SIAM J. Comput. 16 (1987), 647668. [196] J.S.B. Mitchell and C.H. Papamitridiou, The weighted region problem: Finding shortest paths through a weighted planar subsivision, J. ACM 38 (1) (January 1991), 1823. [197] J.S.B. Mitchell and S. Suri, A survey of computational geometry, Handbooks in Operations Research and Management Science, Vol. 7, Ch. 7, M.O. Ball et al., eds, Elsevier Science B.V (1995), 439^58. [198] M. Molenaar, Single valued vector maps — a concept in GIS, GeoInformationssysteme 2(1) (1989). [199] M.E. Mortenson, Geometric Modeling, Wiley, New York (1985). [200] D.G. Morris and R.G. Heerdegen, Automatically derived catchment boundaries and channel networks and their hydrological applications, Geomorphology 1 (1988), 131141. [201] D.M. Mount, On finding shortest paths on convex polyhedra. Technical Report 1495, Department of Computer Science, University of Maryland, Baltimore, MD (1985). [202] K. Mulmuley, Computational Geometry: An Introduction through Randomized Algorithms, Prentice Hall (1994). [203] G. Nagy, Terrain visibility, Comput. Graphics 18 (6) (1994). [204] S. Naher, The LEDA user manual. Version 3.1 (Jan. 16, 1995). Available by anonymous ftp from ftp.mpisb.mpg.de in directory /pub/LEDA. [205] B. Naylor, J. Amanatides and W. Thibault, Merging BSPtrees yelds polyhedral set operations, Comput. Graphics (Proceedings SIGGRAPH 1990) 24, F Baskett, ed. (1990), 115124.
Applications
of computational
geometry to geographic information systems
385
[206] G. Nielson, Scattered data modeling, IEEE Comput. Graphics Appl. 13 (1) (1993), 6070. [207] J. Nievergelt and F.P. Preparata, Plane sweep algorithms for intersecting geometric figures, Comm. ACM 25 (10) (1982), 739747. [208] O. Nurmi, A fast linesweep algorithm for hidden line elimination, BIT 25 (1985), 466472. [209] Openlnventor Architecture Group, Inventor Mentor: Openlnventor Reference Manual, AddisonWesley (1994). [210] J. Orenstein, An algorithm for computing the overlay of kdimensional spaces. Proceedings 2nd Symposium on Advanced in Spatial Databases, Lecture Notes in Comput. Sci. 525, O. Giinter and H.J. Schek, eds (1991), 381^00. [211] M. Overmai's and M. Sharir, A simple outputsensitive algorithm for hidden suiface removal, ACM Trans, on Graphics 11 (1992), 111. [212] M.H. Overmars, Designing the computational geometry algorithms library CGAL, Appl. Comput. Geom. (Proc. WACG'96), Lecture Notes in Comput. Sci., SpringerVerlag (1997). [213] L. Palazzi and J. Snoeyink, Counting and reporting red/blue segment intersections. Lecture Notes in Comput. Sci. 709, F. Dehne, J.R. Sack, N. Santoro and S. Whitesides, eds. SpringerVerlag, New York (1993), 530540. [214] J. Persson and E. Jungert, Generation of multiresolution maps from run lengthencoded data, Intemat. J. Geogr. Inform. Systems 6 (6) (1992), 497510. [215] G. Petrie and T.J.M. Kennie, eds, Terrain Modelling in Survey and Civil Engineering, Whittles Publishing — Thomas Telford, London (1990), 112127. [216] G. Petrie, Modelling, interpolation and contouring procedures. Terrain Modelling in Survey and Civil Engineering, G. Petrie and T.J.M. Petrie, eds. Whittles Publishing — Thomas Telford, London (1990), 112127. [217] T.K. Peucker and D.H. Douglas, Detection of surfacespecific points by local parallel processing of discrete terrain elevation data, Comput. Graphics and Image Process. 4 (1975), 375387. [218] S. Pigot, Generalized singular 3cell complexes. Proceedings 6th International Symposium on Spatial Data Handling, Edinburgh, Scotland (1994), 89111. [219] M. Pilouk, K. Tempfli and M. Molenaar, A tetrahedronbased 3D vector data model for geoinformation. Advanced Geographic Data Modelling — Spatial Data Modelling and Query Languages for 2D and 3D Apphcations, M. Molenaar and S. De Hoop, eds, Pubhcation on Geodesy — New Series 40 (1994), 129140. [220] W.K. Pratt, Digital Image Processing, Wiley (1978). [221] F.P Preparata and M.I. Shamos, Computational Geometry: An Introduction, SpringerVerlag, Berlin (1985). [222] F.P. Preparata and J.S. Vitter, A simplified technique for hiddenline elimination in terrains. Proceedings STAGS'92, Paris, A. Finkel and M. Jantzen, eds, Lecture Notes in Comput. Sci. 577, SpringerVerlag, Berlin (1992), 135144. [223] E. Puppo and G. Dettori, Towards a formal model for multiresolution spatial maps, Advances in Spatial Databases, Lecture Notes in Computer Science 951, M.J. Egenhofer and J.R. Herring, eds, SpringerVerlag (1995), 152169. [224] E. Puppo, Variable resolution terrain surfaces. Proceedings Canadian Conference on Computational Geometry, Ottawa (Canada) 1215 August, 1996; appeared in longer version as Variable resolution triangulations, Comput. Geom. 11 ( 3 ^ ) (1998), 219238. [225] E. Puppo and P. Marzano, Discrete visibility problems and graph algorithms, Intemat. J. Geogr. Inform. Sci. 11 (2) (1997), 139162. [226] E. Puppo and R. Scopigno, Simplification, LOD, and multire solution — Principles and applications, Eurographics '97 Tutorial (1997). [227] V.T. Rajan, Optimality of the Delaunay triangulation in R^, Discrete Comput. Geom. 12 (1994), 189. [228] J. Raper, ed., Three Dimensional Applications in Geographic Information Systems, Taylor & Francis (1989). [229] J.H. Reif and S. Sen, An efficient outputsensitive hiddensurface removal algorithm and its parallelization. Proceedings 4th ACM Symposium on Computational Geometry, Urbana, ACM Press, New York (1988), 193200.
386
L. de Floriani et al.
[230] S. Rippa, Minimal roughness property ofDelaunay triangulation, Comput. Aided Geom. Design 7 (1990), 489^97. [231] S. Rippa, Adaptive approximations by piecewise linear polynomials on triangulations of subsets of scattered data, SIAM J. Sci. Statist. Comput. 13 (1) (1992), 11231141. [232] A.H. Robinson, R.D. Sale, J.L. Morrison and RC. Muehrcke, Elements of Cartography, 5th ed., Wiley, New Yorlc (1984). [233] J.G. Rolme, B. Wyvill and X. Wu, Fast line scanconversion, ACM Trans, on Graphics 9 (1990), 376388. [234] A. Rosenfeld and A. Kak, Digital picture processing. Computer Science and Mathematics, Vol. 1 and 2, 2nd ed.. Academic Press (1982). [235] N. Roussopoulos and D. Leifker, Direct spatial search on pictorial databases using packed Rtrees, Proceedings SIGMOD Conference (1985), 1731. [236] J. Ruppert and R. Seidel, On the difficulty of tetrahedralizing ?>dimensional nonconvex polyhedra. Proceedings 5th ACM Symposium on Computational Geometry (1989), 380393. [237] A. Saalfeld, Joint triangulations and triangulation maps. Proceedings Third Symposium on Computational Geometry, Waterioo, Canada (June 1987), 195204. [238] A. Saalfeld, Conflation: Automatic map compilation, Internat. J. Geogr. Inform. Systems 2 (3) (1988), 217228. [239] A. Saalfeld, Delaunay edge refinements. Proceedings 3rd Canadian Conference on Computational Geometry (1991), 3336. [240] A. Saalfeld, Comflation: Automated map compilation. Technical Report CARTR670, Center for Automation Research (May 1993). [241] A. Saalfeld, Map generalization as a graph drawing problem. Graph Drawing (Proceedings GD '94), R. Tamassia and I.G. Tollis, eds. Lecture Notes in Comput. Sci. 894, SpringerVerlag (1995), 444451. [242] H. Samet, The Design and Analysis of Spatial Data Structures, AddisonWesley, Reading, MA (1990). [243] H. Samet, Applications of Spatial Data Structures, AddisonWesley, Reading, MA (1990). [244] H. Samet, Objectbased and imagebased representations of objects by their interiors. Advances in Image Understanding — A Festschrift for Azriel Rosenfeld, K. Bowyer and N. Ahuja, eds, IEEE Computer Society Press, Los Alamitos, CA (1996), 316332. 1245] L.L. Scarlatos, An automatic critical line detector for digital elevation matrices. Proceedings 1990 ACSMASPRS Annual Convention 2, Denver, CO (1990), 4352. [246] L.L. Scarlatos and T. Pavlidis, Hierarchical triangulation using cartographic coherence, CVGIP: Graphical Models and Image Processing 54 (2) (1992), 147161. [247] A. Schmitt, Time and space bounds for hidden line and hidden surface algorithms. Proceedings Eurographics'81, NorthHolland, Amsterdam (1981), 4356. [248] L. Schubert and CA. Wang, An optimal algorithm for constructing the Delaunay triangulation of a set of line segments. Proceedings 3rd ACM Symposium on Computational Geometry, Waterloo (June 1987), 223232. [249] W.J. Schroeder, J. A. Zarge and W. Lorensen, Decimation of triangle mesh, ACM Comput. Graphics 26 (2) (July 1992), 6570. [250] T. Sellis, N. Roussopoulos and C. Faloutsos, The R^tree: A dynamic index for multidimensional objects. Proceedings 13th International Conference on Very Large Data Bases (VLDB) (1987), 507518. [251] M. Sharir and A. Shorr, On shortest paths on polyhedral spaces, SIAM J. Comput. 15 (1986), 193215. [252] M. Sharir, The shortest watchtower and related problems for polyhedral terrains. Inform. Process. Lett. 29 (1988), 265270. [253] C.T. Silva, J.S.B. Mitchell and A.E. Kaufman, Automatic generation of triangular irregular networks using greedy cuts. Proceedings IEEE Visualization '95 (1995), 201208. [254] A.K. Skidmore, Terrain position as mapped from gridded digital elevation model. Internal. J. Geogr. Inform. Systems 4(1) (1990), 3349. [255] K.R. Sloan and L.D. Hrechanyk, Surface reconstruction from sparse data. Proceedings Conference on Pattern Recognition and Image Processing (1981), 4 5 ^ 8 . [256] J. Snoeyink and M. van Kreveld, Lineartime reconstruction ofDelaunay triangulations with applications. Proceedings 5th European Symposium on Algorithms (1997). [257] D.A. Southard, Piecewise linear surface models from sampled data. Proceedings Computer Graphics International 91, Boston, MA, 2228 June (1991).
Applications
of computational
geometry to geographic information systems
387
[258] S. Suri, A linear time algorithm for minimum link paths inside a simple polygon, Comput. Vision, Graphics and Image Process. 35 (1986), 99110. [259] E.J. StoUnitz, T.D. DeRose and D.H. Salesin, Wavelets for computer graphics: A primer Part /, IEEE Computer Graphics and Applications (May 1995), 7684. [260] E.J. StoUnitz, T.D. DeRose and D.H. Salesin, Wavelets for computer graphics: A primer Part II, IEEE Computer Graphics and AppUcations (July 1995), 7585. [261] R. Tamassia, ed.. Strategic directions in computational geometry working group report, ACM Comput. Surveys 28 (4) (1996). [262] G. Taubin and J. Rossignac, Geometric compression through topological surgery, IBM Res. Report RC20340 (Januar>' 1996). [263] W.R. Tobler, A continuous transformation useful for districting, Ann. New York Acad. Sci. 219 (1973), 215220. [264] V.J.D. Tsai, Delaunay triangulations in TIN creation: An overview and a lineartime algorithm, Intemat. J. GIS 7 (6) (1993), 501524. [265] G. Turk, Retiling polygonal surfaces, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '92) 26 (2) (1992), 5564. [266] J. van Bemmelen, W. Quak, M. van Heldcen and P. van Oosterom, Vector vs. rasterbased algorithms for cross country movement planning. Proceedings AUTOCARTO 11, Minneapolis (1993), 309317. [267] R.C. Veltkamp, 3D computational morphology, EUROGRAPHICS '93 (1993), 115127. [268] M. van Kreveld, On quality paths on polyhedral terrains. Proceedings IGIS'94: Geographic Information Systems, J. Nievergelt, T. Roos, H.J. Schack and P. Widmayer, eds. Lecture Notes in Comput. Sci. 884, SpringerVerlag (1994), 113122. [269] M. van Kreveld, Efficient methods for isoline extraction from a TIN, Intemat. J. Geogr. Inform. Science 10 (5) (1996), 523540. [270] M. van Kreveld, Digital elevation models and TIN algorithms. Notes for CISM Advanced School on Algorithmic Foundations of GIS (1996). [271] M. van Kreveld, Variations on sweep algorithms: Efficient computation of extended viewsheds and class intervals. Proceedings Symposium on Spatial Data Handling (1996), 13A.1513A.27. [272] M. van Kreveld, R. van Oostrum and C. Bajaj, Contour trees and small seed sets for isosurface traversal. Proceedings 13th Annual ACM Symposium on Computational Geometry (1997), 212219. [273] P. van Oosterom, A modified binary space partition for geographic information systems, Intemat. J. Geogr. Inform. Systems 4 (2) (1990), 133146. [274] P. van Oosterom, Reactive Data Structures for Geographic Information Systems, Oxford University Press (1993). [275] P. van Oosterom and V. Schaukelaars, The development of an interactive multiscale GIS, Intemat. J. GIS 9 (5) (1995), 489507. [276] I. Vincent and P. Soille, Watersheds in digital spaces: An efficient algorithm based on immersion simulations, IEEE Transactions on Pattern Analysis and Machine Intelligence 13 (1991), 583598. [277] The Virtual Reality Modeling Language Specification — Version 2.0 (August 1996), http://vag.vrml.org/. [278] B. Von Herzen and A.H. Barr, Accurate triangulations of deformed, intersecting surfaces, ACM Computer Graphics Proceedings, Annual Conference Series (SIGGRAPH '87) 21 (4) (July 1987), 103110. [279] F. Wagner and A. Wolff, An efficient and effective approximation algorithm for the map labeling problem. Proceedings 3rd European Symposium on Algorithms, Lecture Notes in Comput. Sci. 979 (1995), 420433. [280] F. Wagner and A. Wolff, Map labeling heuristics: Provably good and practically useffil. Proceedings 11th Annual ACM Symposium on Computational Geometry (1995), 109118. [281] J.M. Ware, C.B. Jones and G.L. Bundy, A triangulated spatial model for cartographic generalization of areal objects. Spatial Information Theory, A. Frank and W. Kuhn, eds, Lecture Notes in Comput. Sci. 988, SpringerVerlag (1995), 173191. [282] D.F. Watson, Computing the ndimensional Delaunay tessellation with application to Voronoi poly topes. The Comput. J. 24 (1981), 728746. [283] L.T. Watson, TJ. Laffey and R.M. Haralick, Topographic classification of digital image intensity surfaces using generalized splines and the discrete cosine transformation, Comput. Vision, Graphics and Image Process. 29 (1985), 143167.
388
L. de Floriani et al.
[284] H. Webb, Creation of digital terrain models using analytical photogrammetry and their use in civil engineering. Terrain Modelling in Survey and Civil Engineering, G. Petrie and T.J.M. Petrie, eds. Whittles Publishing — Thomas Telford, London (1990), 7384. [285] K. Weiler, Edgebased data structures for solid modeling in a curvedsurface environment, IEEE Computer Graphics and Applications 5(1) (January 1985), 2 1 ^ 0 . [286] R. Weibel and M. Hellen, A framework for digital terrain modeling. Proceedings 4th International Conference on Spatial Data Handhng, Zurich (1990), 219229. [287] R. Weibel, A typology of constraints for line simplification. Proceedings 7th International Symposium on Spatial Data Handling (SDH'96) (1996), 9A.19A.14. [288] J. Wemecke, The Inventor Mentor: Programming ObjectOriented 3D Graphics with Open Inventor, AddisonWesley (1994). [289] G.W Wolf, Metric surface networks. Proceedings 4th International Symposium on Spatial Data Handling, Zurich (1990), 844846. [290] T.C. Woo, A combinatorial analysis of boundary data structure schemata, IEEE Comput. Graphics Appl. 5 (3) (1985), 1927. [291] M.F. Worboys, A generic model for planar geographic objects, Intemat. J. Geogr. Inform. Systems 6 (5) (1992), 353372. [292] M.F. Worboys and P. Bokafos, A canonical model for a class ofareal spatial objects. Advances in Spatial Database (SSD93), D. Abel and B.C. Ooi, eds. Lecture Notes in Comput. Sci., SpringerVerlag (1993), 3652. [293] J.C. Xia and A. Varshney, Dynamic viewdependent simplification for polygonal models. Proceedings IEEE Visualization '96, R. Yagel and G. Nielson, eds, S. Francisco, CA (1996), 327334. [294] S. Yu, M. Van and J. Snoeyink, Drainage queries in TINs: From local to global and back again. Proceedings Symposium on Spatial Data Handling (SDH'96) (1996), 13A.113A.14. [295] B. Zhu, Computing the shortest watchtower of a polyhedral terrain in 0{n log w) time, Comput. Geom. 8 (1997), 181193. [296] S. Zoraster, Integer programming applied to the map label placement problem, Cartographica 22 (3) (1986), 1627.
CHAPTER 8
Making Geometry Visible: An Introduction to the Animation of Geometric Algorithms Alejo Hausner and David R Dobkin* Computer Science Department, Princeton University, Princeton, NJ 08544 USA Email: {ah, dpd] @ cs.princeton. edu
Contents 1. Introduction Which would you prefer? Who should read this? It's interactive, not static You've already seen it The need for animation How can algorithm animation help you? It will improve further Chapter overview 2. General systems 2.1. Sorting out sorting 2.2. BALSA and Zeus 2.3. "Descendants" of BALSA 3. Geometryoriented systems 3.1. Twodimensional systems 3.2. Beyond two dimensions 4. Visualizations 4.1. Mathematical visualization 4.2. Demonstrations 4.3. Algorithm animations 4.4. Interactive visualizations 5. Design issues relevant to algorithm animation systems 5.1. Scope 5.2. Author and audience 5.3. Expressiveness
391 391 391 391 391 392 392 392 393 393 393 395 397 401 401 402 405 406 406 407 410 413 413 413 414
*This work has been supported in part by NSF Grants CCR9643913 and CCR9731535 and by the US Army Research Office under Grant DAAH049610181 and by Dimacs, an NSF Science and Technology Center. HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V All rights reserved
389
390 5.4. User interaction 6. Techniques 6.1. Abstraction 6.2. A few animation techniques 6.3. Problems specific to 3D 7. Conclusion The future References
A. Hausner and D.P. Dobkin 415 416 416 416 417 419 420 420
Abstract This chapter surveys the field of geometric algorithm animation, which has flourished in the past five years. Algorithm animation uses moving pictures to explain a computer algorithm to students learning programming, to algorithm researchers, and to programmers involved in debugging. We examine systems used to create animations of algorithms, focusing on those that specialize in geometry. We also consider a selection of animations, pointing out some useful techniques, and continue with some consideration of general design issues and specific animation techniques, closing with a look at the future.
An introduction to the animation of geometric algorithms
391
1. Introduction Which would you prefer? Imagine yourself learning a complicated new algorithm that solves a geometric problem. You might read a book or a research paper that explains the algorithm. You probably will have to pore over the algorithm's code, which is a difficult way to learn complicated algorithms ! Even if the author had provided you with simplified pseudocode, you might still need a long time to understand the details of the algorithm. Now suppose an animation of the algorithm is available. Instead of having to imagine what is happening to the algorithm's variables, you see colored shapes which represent the program's data. These shapes move and change as the program runs. A triangle is not presented to you as the coordinates of three points, but is drawn on the screen, changing as the program works on it. As you choose different inputs, the animation will be different. You can slow the animation down, to better understand complicated parts, or speed it up to skip what you already understand, or even run it backwards to recall where things used to be. Which scenario would you prefer, reading about the algorithm or watching it in action? If you prefer the animation, then this chapter is for you. Who should read this? Anyone who explores geometry and computation may find algorithm animation useful. Explorers of geometry can be mathematicians, users or designers of geometric algorithms, or students. All of them need explanatory tools, whether they are learning about the subject or searching for new solutions to a problem. Computerbased geometric visualization and algorithm animation can provide such an aid. Visualization is the creation of images to describe an abstract idea. Computergenerated images have advantages over handdrawn ones. They are accurate, can be modified with ease, and in the case of threedimensional geometric objects, they can be examined from any angle. Ifs interactive, not static Algorithm animation visualizes the activity of an algorithm through moving images. As in conventional animation, the movement of images is not real, but is simulated by presenting the viewer with a sequence of still images. Unlike conventional animation, however, in algorithm animation the sequence of images is not fixed. Each image represents the state of the algorithm at some point in time. Since the inputs to an algorithm can vary, its behavior will vary and hence so will the animation of that behavior. You \e already seen it In a way, algorithm animation is as old as Euclid. It is not too farfetched to say that a constructive geometric proof is a form of animated algorithm. For example, the proof that one
392
A. Hausner and D.P. Dobkin
can construct an equilateral triangle with a given side (Proposition 1) instructs the reader to draw two circles centered at the sides' endpoints and to draw lines to the circles' intersection. The computer in this case is a person armed with compass and straightedge, who is following instructions and reaching a result, so the procedure qualifies as an algorithm.
The need for animation Some explorers of geometry devote their time to designing algorithms that solve geometric problems. Even though their solutions will run on a computer, they often find themselves working "in the dark", needing to visualize not just the objects they are manipulating but also the process by which the algorithm modifies the objects. Geometric algorithms are often more difficult to design, program and debug than other algorithms. This is because the designers often lack the means to see the objects their algorithms are manipulating, and are forced to pore over printouts of point coordinates. Algorithm animation can help.
How can algorithm animation help you ? There are several reasons for animating an algorithm. First, a theoretician who is devising geometric algorithms needs a medium for disseminating his/her ideas. Although research papers satisfy this role, a wellcrafted animation on videotape can communicate an idea more quickly than a printed description. If the author makes an interactive animation available on the worldwide web, people can learn the algorithm more easily. Second, a teacher who is presenting an algorithm to students can benefit in the same way. However, the audience in this case will not consist of experts as in the first case, so the animation must be prepared with more care. Third, animating an algorithm can stimulate the designer into finding new variations. In effect, such an animation explains the algorithm to its author! A geometric algorithm may need to handle special or degenerate cases, and animation often helps to identify these cases. Finally, algorithm animation can help with debugging of general programs, although this application turns out to have limited scope.
It will improve further Algorithm animation is a young discipline, and will probably change in the next few years. The changes will come both from improvements in software and hardware. Although animation as a medium can make an algorithm more understandable, it also has some limitations. For example, there are some algorithms that are rather complicated, and are difficult to understand even with a wellcrafted video. In an animation where many things are happening simultaneously, the user will want to stop and ask questions, such as "why didn't the scan line advance when that point was processed?". Hypertext documents allow the viewer to ask such questions, but in the past they have portrayed either fixed images or fixed animations, and this limitation has reduced their explanatory powers. There are situations where the user wants to interact with a running algorithm, and also wants
An introduction to the animation of geometric algorithms
393
to see or hear other information about it. There is a great potential for improvement in algorithm animation through webbased programming languages like Java, which present the user with running programs and not just static images. Animation places great demands on computer resources. If a prepared animation is made available over the internet, it will need large amounts of storage space, and more importantly, a very highspeed connection to the net, lest the users spend hours downloading a fiveminute movie. On the other hand, if the user does not download the data but rather runs a program that creates an animation in real time, he/she may need a very fast computer, lest a complicated fiveminute animation take 30 minutes to run. A similar problem exists if the user requests a threedimensional scene stored as VRML data. If the scene is complicated, the rendering speed will suffer, and hence, so will the user. Increases in storage, communication bandwidth and processing power will make possible new algorithm animations and geometric visualizations.
Chapter overview Algorithm animation has its roots in educational film and in mathematical visualization. It has also been influenced by recent developments in scientific data visualization, which is at present an extremely diverse and active field. Early efforts in algorithm animation in the late 1970's resulted in an educational film [2] which is still used today. The middle 1980's saw the development of systems [8,20] which allow a user to run algorithms and see animations interactively. Recent efforts have added color and sound [10,13], as well as the use of objectoriented programming [9,1,29,15]. Section 2 provides a survey of systems used to create animations of general algorithms. Excellent overviews of the field [27,36] are available, so here we will concentrate on questions that a designer of similar systems must face. Geometric algorithms present special opportunities and difficulties, and systems to make animations for them have also evolved [29,17,37]. Section 3 gives a survey of these systems. Again, the survey will not be exhaustive but will focus on technique. The past five years have seen the field of algorithm animation flourish. Rather than require the audience to install the animation software on their own computers, researchers have found it convenient to use video tape to record representative sessions. Section 4 surveys these video recordings. The videos selected for discussion use interesting animation techniques. Whether a researcher is creating animations or is planning a system to assist in their creation, he/she must consider some general issues. These are covered in Section 5. Finally, Section 6 presents some techniques which can be used in an algorithm animation to convey ideas more clearly. 2. General systems 2.1. Sorting out sorting The most wellknown example of an early algorithm animation is the film "Sorting out Sorting", created by Ronald Baecker [2] and presented at Siggraph' 81. It explains concepts
394
A. Hausner and D.R
Linear insertion '•.••cr^^r.^:
Dobkin
Bubblesort
:,."••:,••:
•:.'•'•••:.]
Straight Selection
..
. . . . . . • . . •  • , • .
••
•••;•••:
. . . . . . . . . . . . . . •
. • • • • • • " . • • ' . '
:'/^r.':.;:^^:V.;
' • • • • ;
•••••••
:
'.;.
•.•;
••ir;.>.:.
.•
^ . < :
• ' • ' i  ' . . 
.'••,'•',•••.•:
'
:.
.•^'••••.•.•r^"*=^
• • " • ' . • •
i '
1
• ••
""..r":'
•
.••:•
v^'.u...^j^'.^•;.:;•.••.•,..
1 •'
'
• • • . • • ' : ' • • • / . ; • • :
'
. : • : • ' = ' : ; ;
••
 •
T . " ' . : : "
.""...•
• ,
..
r T . " •.••• •.
•;
•
••:"1"
'^^ ."•
.'•
••
•
• • • • . ' . •
••.•••
.••
• ' [ •  " •
• • • ^ :
•"•
.' • •
. . ' •
.
•
••
.
•"•
:':••
•:•*•.••••
'
•••.••••.••
• • :
• ' • : •
••••••..•
.;••••'•
•
. \
. . A .
..'
•
'
> V ' '  : ' "  " . " ^ ' ^ ' . 
!:"• " i l "  ^ " " " " "
' v ' ^ . • ; • • • • > . : : > . : ; • •
•
• . • • " : •
' • \ . : . 
'•'•
\ \ .
:': .r*'.'.
^ ^
••"
"••.•• ."'J" ^'.
• •'
.••;'•
.••"
"•.•f\
••"...••.•
'
•
.
r•
, . 5 :  ^   \ :  ^ : V v ' 
"  • " • ' ' . ' ! • • • '
".
t . \
C ' . 
•".*,'•
^ :  '  " • • :•"
••"•
. . • . . • ' . •
'•''
' • " • ' :
'.._,•.•_!( JN V; • ^ ' •• '••'y.. ••
• J
. • r ' " '
•  . . • . • . . . . . •
. V 1
y
. . . . ; ..
i
;•
..
— ••
Shellsort
Quicksort
h^:>;i;f •;
• . . • ^ ^ • ' : • • • ' • . •
> '  ^ 
•
,. •
•
'
^
:
•
•
•
•
/
'
.'
••••y^'{V;;;'."V=^'.
.
It.',•^•.•*•
••
. ' '. • f' V
,'
Heapsort • : . \ •: ,..•.•.'••: ''• i.\.
• •.;,;"^''wM^' ;
•:.
: • ^ • • ^ • .
' . .
•..•\;.r".v.T^;'••:/• • •.
. .
.
Tree Selection
•.., :)y^.^
;
^
Shakersort
:'•:•: • ^ • ; i ; : ; ^ : • v ' • • ' r • * ^
• • ' ^ • . , / ; ,  /  : '
•••
.•
Binary Insertion
• ."^
/."•i.r.•;
• ' ^ ;  v ; ; ; .  . • . ; ; : . ; / . • •
''.'.
• • •
'^ • '_i.'r. • •. •"
•
H•'^^ rN \
.
•
:; /5S$^\r
I'iput Generators t
Proxinity Probiens i
Extract Components o
Gaps and Co^'ers o
Fonts t>
TrangLlatlons o
Segments >
Vc4oroi Diagrams >
Rays f>
^
Cir'^ies I
Proximity Problems
(Uiairatar (brute forciT;!
Polygons >
Diameter (Preparata & 5hanos)
Movie t>
Closest Pairi.brute force)
Externa Classes (examples) c
Closest Pair (Divide & Conrjue)
Settlnqs...
Closest Pair lusinn Vxonoi I'ia'irarn)
). n
Callahan [31] gave an improved reduction from minimum spanning trees to bichromatic closest pairs, based on the wellseparated pair decomposition described below. With his results, the minimum spanning tree can be computed with a time slower than that of the bichromatic closest pair by an O(logn) factor. Like the reduction above, this factor disappears for time bounds of the form Q{n^^^). For rectilinear {L\ and Loo) metrics, bichromatic closest pair problems can be solved in linear time after a preprocessing stage in which, for each of a constant number of different axes, we sort the points according to their projections along the axis. Therefore, rectilinear minimum spanning trees can be computed in 0{n \ogn) time in any dimension.
432
D. Eppstein
Fig. 2. A fair split tree.
Approximate MSTs. The method above for high dimensional minimum spanning trees takes close to quadratic time when the dimension is large. We describe now a method for approximating the minimum spanning tree, within any desired accuracy, much more quickly. This method is due to Callahan [31,32], and is based on his technique of wellseparated pair decomposition. Similar minimum spanning tree approximation algorithms with worse tradeoffs between time and approximation quality were previously found by Vaidya [128] and Salowe [116]. As we noted above, Callahan also uses this technique to compute exact minimum spanning trees from bichromatic pairs. We will see more applications of Callahan's method later in the construction of spanners. Callahan's method is to recursively partition the given set of sites by axisparallel hyperplanes. This produces a binary tree 7, in which each node corresponds to a subset of points contained in some Jdimensional box. For any node i; of 7, corresponding to some set S{v) of points, define R{v) to be the smallest axisaligned box containing the same point set, and let i{v) denote the length of the longest edge of R{v). Then Callahan calls T a fair split tree if it satisfies the following properties: • For each leaf node vofT, \ S(v)  = 1. • For each internal node v, one can choose the axisparallel hyperplane separating its children's points to be at distance at least l{v)/3 from the sides of R{v) parallel to it. Figure 2 depicts a fair split tree. Such a tree can be constructed in time 0(nlogn) (for any fixed dimension) via any of several algorithms, for instance using methods for quadtree construction [26]. Callahan now defines a wellseparated pair decomposition (for a given parameter s)to be a collection of pairs of nodes of a fair split tree, having the properties that • For any pair of sites (p, q) in the input, there is exactly one pair of nodes (P, Q) in the decomposition for which p is in S{P) and q is in S{Q). • For each pair (P, Q) in the decomposition, there is a length r such that S{P) and S{Q) can be enclosed by two radiusr balls, separated by a distance of at least sr. The connection between this definition, minimum spanning tree edges, and bichromatic pairs, is explained by the following result. LEMMA
6 (Callahan). Let pq be a minimum spanning tree edge, and (P, Q) be a pair of
Spanning trees and spanners
433
nodes in a wellseparated decomposition of the input (with s = 2) for which p is in S(P) and q is in S{Q). Then pq must be the bichromatic closest pair connecting S(P) and SiQ). PROOF. This follows from the wellknown fact that the minimum spanning tree solves the bottleneck shortest path problem, of connecting two points p and ^ by a path with the shortest possible maximum edge length. If there were a shorter edge p^q^ connecting S(P) and S(Q), one could find a path pp^q'q using shorter edges than pq, contradicting this property of minimum spanning trees. D
As a consequence one can find minimum spanning trees by solving a collection of bichromatic closest pair problems for the pairs of a wellseparated pair decomposition, then compute a minimum spanning tree on the resulting graph. However for this approach to be useful, one must bound the complexity of the well separated pair decomposition. Callahan constructs his well separated pair decomposition as follows. The method is recursive, and constructs a collection of pairs of sets covering all edges connecting two point sets, each represented by a node of T. Initially, we call this recursive algorithm once for the two children of each node of T. The recursive algorithm, if presented with wellseparated nodes P and Q of T, simply returns one pair (P, Q). Otherwise, it swaps the two nodes if necessary so that P is the one with the larger bounding box, and calls itself recursively on node pairs (Pi, Q) and (P2, Q) where P/ are the two children of P. Intuitively, each node of T is then involved only in a small number of pairs, corresponding to nodes with similar sized bounding boxes within a similar distance from the node. LEMMA 7 (Callahan). The procedure described above results in a wellseparated pair decomposition consisting ofO(n) pairs, and can be performed in time 0(n) given a fair split tree of the input.
This information is not enough to reduce the problem of finding exact minimum spanning trees to that of bichromatic closest pairs; it may be, for instance, that the decomposition involves ^(n) pairs (P, Q) for which \S(P)\ = 1 and \S(Q)\ = ^{n)\ the total size of all subproblems would then be quadratic. (Callahan does use this decomposition in a more complicated way to reduce minimum spanning trees to bichromatic closest pairs). However if we only want an approximate minimum spanning tree, the problem becomes much easier. 3 (Callahan). For any fixed s, one can compute in 0(n logn) time a tree having total length within a factor of{\ \ e) of the Euclidean minimum spanning tree. THEOREM
PROOF. Compute a wellseparated pair decomposition for s = max(2,4/s) and form a graph G by choosing an edge pq for each pair (P, Q) in the decomposition. Note that pq can have length at most r(4 + s) and any other edge connecting the same pair of sets must have length at least rs, so pq approximates the bichromatic closest pair of the sets P and Q within a (1 h ^) factor. Replacing each edge of the true minimum spanning tree by the corresponding edge in G produces a subgraph 5 of G with weight within (I ^ s) of the minimum spanning tree.
434
D. Eppstein
We now prove by induction on the length of the longest edge in the corresponding minimum spanning tree path that any two sites are connected by a path in S. Specifically, let e = pq he the longest edge in the minimum spanning tree path connecting the sites; then the corresponding edge in G connects two points p^q^ in the same pair (P, Q) of the decomposition. There is a path of edges all shorter than e from one of the two sites to p^ (via the minimum spanning tree to p, then within the cluster to p\ using the fact that ^ > 2 to prove that this last step is shorter than e). By the induction hypothesis, one can find such a path using only edges in S. Similarly there is a path of edges in S all shorter than e from q^ to the other site. Therefore S is connected, and must be a spanning tree. The minimum spanning tree of G must then be shorter than S, so it approximates the true minimum spanning tree of the sites within a (I\ e) factor. D By choosing more carefully the representative edges from each pair in the decomposition, Callahan achieves a time bound of 0(/i(log n\e~^^'^\oge~^))for this approximation algorithm. Incremental and offline MSTs. In some applications one wishes to compute the minimum spanning trees of a sequence of point sets, each differing from the previous one by a small change, such as the insertion or deletion of a point. This can be done using similar ideas to the static algorithms described above, of constructing a sparse graph that contains the geometric minimum spanning tree. Such a graph will also change dynamically, and we use a dynamic graph algorithm to keep track of its minimum spanning tree. As with the static problem, the specific graph we use may be a Yao graph, Delaunay triangulation, or bichromatic closest pair graph, depending on the details of the problem. We start with the simplest dynamic minimum spanning tree problem, in which only insertions are allowed to a planar point set. In this case, the graph of choice is the Yao graph described earlier, in which we compute for each point the nearest neighbor in each of six 60° wedges. LEMMA 8. Given a set S ofn points, and a given 60° wedge of angles, in 0(n \ogn) time we can construct a data structure which can determine in 0(log/i) time the nearest point in S to a query point x, and forming an angle from x within the given wedge. PROOF. We construct a Voronoi diagram for the convex distance function consisting of the Euclidean distance for points within the wedge, and infinite distance otherwise. This diagram can be found in time 0{n \ogn) using any of several algorithms [41,56,104]. We then perform planar point location in this diagram; again, various algorithms are possible [58, 92,99,119]. D
We can then apply the statictodynamic transformation for decomposable search problems [21] to this data structure, producing an incremental data structure in which we can insert points to S and answer the same sorts of queries, both in time 0(log^ n). 4. We can maintain the Euclidean minimum spanning tree of a set ofpoints in the plane, subject to point insertions only, in time 0(log^ n) per update. THEOREM
Spanning trees and spanners
435
We maintain a sparse graph G containing the minimum spanning tree. We then use the above data structure to determine for each new point six candidate edges by which it might be connected to the minimum spanning tree, and add these edges to G. Insertions to a dynamic graph minimum spanning tree problem can be handled in logarithmic time each, using a data structure of Sleator and Tarjan [124]. D PROOF.
A more complicated technique based on the same Yao graph idea can be used to handle an offline sequence of both insertions and deletions, in the same time bound [61]. Fully dynamic MSTs. The fully dynamic case, in which we must handle both insertions and deletions online (without knowing the sequence of events in advance) is much harder. A method of Eppstein [62] can be used to maintain the solution to a bichromatic closest pair problem; combining this with the reduction of Lemma 5 and a fully dynamic graph minimum spanning tree algorithm [69] gives a method with amortized running time 0(n^/^log^n + ^i2/(r6f/2i+i)+e^ p^j, update, where d denotes the dimension of the problem. Recently Henzinger and King [81] further improved this to OCn^/^log'^+^n +ni2/(r^/2Hi)+6:) Agarwal et al. [3] extended the nearest neighbor searching methods used by these data structures to more general algebraic distance functions in two dimensions, and in particular to planar Lp metrics. In rectilinear metrics, bichromatic closest pairs can be maintained in polylogarithmic time, so the total time per update can be simplified to 0{n^^^ log^^^ n). However these time bounds are too large, and the algorithms too complicated, to be of practical interest. We instead describe in more detail a technique that works well in a certain average case setting defined by Mulmuley [108] and Schwarzkopf [120]. We define a signature of size n to be a set 5 of n input points, together with a string s of length at most In consisting of the two characters " + " and "—". Each " + " represents an insertion, and each "—" represents a deletion. In each prefix of s, there must be at least as many " + " characters as there are "—" characters, corresponding to the fact that one can only delete as many points as one has already inserted. Each signature determines a space of as many as (n!)^ update sequences, as follows. One goes through the string s from left to right, one character at a time, determining one update per character. For each "h" character, one chooses a point x from S uniformly at random among those points that have not yet been inserted, and inserts it as an update in the dynamic problem. For each "—" character, one chooses a point uniformly at random among those points still part of the problem, and updates the problem by deleting that point. For any signature, we define the expected time for a given algorithm on that signature to be the average time taken by that algorithm among all possible update sequences determined by the signature. The algorithm is not given the signature, only the actual sequence of updates. We then define the expected time of the algorithm on inputs of size n to be the maximum expected time on any signature of size n. In other words, we choose the signature to force the worst case behavior of the algorithm, but once the signature is chosen the algorithm can expect the update sequence to be chosen randomly from all sequences consistent with the signature. Note that this generalizes the concept of a randomized incremental, since the expected case model for such algorithms is generated by signatures containing only the "h" character. To demonstrate the power of this expected case model, and derive a fact we will need in our minimum spanning tree algorithm, we prove the following result. Compare this
436
D. Eppstein
with the Gin) worst case bound on the amount of change per update in the Delaunay triangulation. LEMMA 9 (Mulmuley). For any signature of size n, the expected number of edges in a dynamic planar Delaunay triangulation that change per update isO{\).
We first consider the change per insertion. Suppose after an insertion at some step / of the algorithm, there are exactly j points remaining. Since the Delaunay triangulation is a planar graph, it will have at most ?>j — 6 edges. Each edge will have just been added to the graph if and only if one of its endpoints was the point just inserted, which will be true with probability 2/j. So the expected number of additional edges per insertion is at most (3j — 6) • 2/j = 0(1). The number of existing edges removed in the insertion is at most proportional to the number of edges added, and can possible be even smaller if the convex hull becomes less complex as a result of the insertion. Thus the total change per insertion is 0(1). The total change per deletion can be analyzed by a similar argument that examines the graph before the deletion, and computes the probability of each edge being removed in the deletion. D
PROOF.
This fact can then be used to show that the Delaunay triangulation can be maintained efficiently. Deletions can be performed in time proportional to the complexity of the change [5]. Insertions can also be performed in this amount of time as long as the point to be inserted can be located within the existing Delaunay triangulation. This point location can be performed using a data structure based on the history of the structure of the Delaunay triangulation, similar to that used by Guibas et al. [78], and which can be shown to have logarithmic expected search time in this expected case model. With some care, this structure can be updated quickly after each deletion. THEOREM 5. The minimum spanning tree of a planar point set can be maintained fully dynamically for any signature of size n in expected time O(logn) per update. PROOF. AS shown by Mulmuley, by Schwarzkopf, and by Devillers et al. [51], we can maintain the Delaunay triangulation in this time bound. Since the Delaunay triangulation is a planar graph, we can find its minimum spanning tree using a data structure of Eppstein etal. [70]. D OPEN PROBLEM 1. Can we maintain the Euclidean minimum spanning tree dynamically in poly logarithmic worst case or amortized time per update?
Kinetic MSTs. Instead of allowing only one point at a time to change arbitrarily, one can also consider an alternative form of dynamism, in which all points move simultaneously but predictably. The simplest form of this problem is one in which a set of n points each have a linear motion (as a function of a parameter which we refer to conventionally as time). One can ask how many times the minimum spanning tree of these moving points changes, ask for an algorithm to compute this sequence of changes, or find the value of the time parameter that optimizes some given function of the MST.
Spanning trees and spanners
437
Note that two linearly moving points have a quadratically varying Euclidean distance, so one can not directly apply known combinatorial bounds or algorithms for graphs with linearly varying edge weights [52,64,71,79]. However, several insights from the graph case carry over to the geometric setting; in particular, for point sets in general position (no three simultaneous equal distances) the MST changes must be in the form of swaps between two equallength edges. If one draws an arrangement of curves, one curve graphing the weight function of each potential edge in the MST, then these changes only occur at times corresponding to arrangement vertices. Hence there can be O(n^) MST changes total, in any metric with the property that the distance between two moving points is a piecewise algebraic function with bounded degree and a bounded number of breakpoints. It is easy to find point sets for which the MST changes Q{n^) times (simply pass n/2 moving points along a line containing n/2 fixed points). Katoh et al. [86] showed that the Yao graph, and hence the Euclidean MST of a linearly moving point set, can only change 0(/2^2"^"^) times, that the rectilinear MST can change 0{n^^^a{n)) times, and that the rectilinear maximum spanning tree can change 0{n^) times. For Euclidean maximum spanning trees the best bound on the number of changes is currently only 0(n^'^^^) [126]. The 0{n^f^a(n)) bound on rectilinear MST changes follows by partitioning the problem into a sequence of 0{na{n)) sparse graph problems; it therefore follows from the recent breakthrough results of Dey [52] that this bound can be improved to 0{n^^^a{n)). All of these results are largely independent of the dimension. Note that only in the case of rectilinear maximum spanning trees are these bounds tight. OPEN PROBLEM 2. What is the maximum number of changes in the Euclidean minimum spanning tree ofn linearly moving pointsl How quickly can we compute that sequence of changesl
Finally, this problem of moving points can be combined with the dynamic point sets described earlier in kinetic geometry, a framework in which a system of linearly moving points can be updated by inserting, deleting, or changing the motion of points [19]. Basch et al. [20] describe results on proximity problems of moving points in this framework.
2.2. Maximum weight spanning trees For graphs, the maximum spanning tree problem can be transformed to a minimum spanning tree problem and vice versa simply by negating edge weights. But for geometric input, the maximum spanning tree is very different from the minimum spanning tree, and different algorithms are required to construct it. This problem was first considered by Monma et al. [106], and has applications in certain clustering problems [16]. We first examine the edges that can occur in the maximum spanning tree. One might guess, by analogy to the fact that the minimum spanning tree is a subgraph of the Delaunay triangulation, that the maximum spanning tree is a subgraph of the farthest point Delaunay triangulation. Unfortunately this is far from being the case — the farthest point Delaunay triangulation can only connect convex hull vertices, and it is planar whereas the maximum
438
D. Eppstein
spanning tree has many crossings. However we will make use of the farthest point Delaunay triangulation in constructing ih^ farthest neighbor forest, formed by connecting each site to the site farthest away from it. The first fact we need is a standard property of graph minimum or maximum spanning trees. LEMMA 10. The farthest neighbor forest is a subgraph of the maximum spanning tree. LEMMA 11 (Monma et al. [106]). Let each tree of the farthest neighbor forest be twocolored. Then for each such tree, the convex hull vertices of any one color form a contiguous nonempty interval of the convex hull vertices. The trees of the forest can be given a cyclic ordering such that the intervals adjacent to any such interval come from adjacent trees in the ordering.
12 (Monma et al. [106]). Let e = (x,y) be an edge in the maximum spanning tree but not in the farthest neighbor forest, with x in some farthest point neighbor tree T. Then x and y are both convex hull vertices, and y is in a tree adjacent to T in the cyclic ordering of Lemma 11. LEMMA
Putting these pieces of information together, we have the following result. THEOREM 6 (Monma et al. [106]). The maximum spanning tree of a planar point set can be constructed in 0(n \ogn) time by computing the farthest neighbor forest, determining the cyclic ordering of Lemma 11, finding the longest edge between each adjacent pair of trees in the cyclic ordering, and removing the shortest such edge.
The farthest neighbor forest and the longest edge between adjacent trees can be computed easily via point location in the farthest point Voronoi diagram. Eppstein [63] considered the same problem from the average case dynamic viewpoint discussed above. His algorithm performs a similar sequence of steps dynamically: maintaining a dynamic farthest neighbor forest, keeping track of the intervals induced on the convex hull and of the cyclic ordering of the intervals, and recomputing longest edges as necessary between adjacent intervals using a dynamic geometric graph based on the rotating caliper algorithm for static diameter computation. THEOREM 7 (Eppstein). The Euclidean maximum spanning tree can be maintained in expected time 0(log'^ n) per update.
Just as higher dimensional minimum spanning trees are closely related to bichromatic nearest neighbors, higher dimensional maximum spanning trees can be related to bichromatic farthest neighbors. Agarwal et al. [4] used this idea to give a randomized algorithm for the threedimensional maximum spanning tree with expected time complexity 0(/i^/^log^/^n), almost matching the bound for the corresponding minimum spanning tree problem. The same authors also provide fast approximation algorithms to three and higherdimensional maximum spanning tree problems.
Spanning trees and spanners
439
Since the maximum spanning tree involves many edge crossings, it is also natural to consider the problem of finding the maximum planar spanning tree, that is, the maximum weight spanning tree not involving any edge crossings. The exact complexity of this problem appears to be unknov^n, but Alon et al. [7] point out that it can be approximated to within a factor of two simply by choosing a tree with a star topology (in which one hub vertex is connected to all n — 1 others). Choosing the best possible hub can be done in 0(n^) time; Alon et al. show that a constant factor approximation to the maximum noncrossing spanning tree can be found in 0(n) time by choosing a suboptimal hub. OPEN PROBLEM 3. What is the complexity of finding the exact maximum weight noncrossing spanning treel If it is NPhard, how well can it be approximated in polynomial timel
2.3. Lowdegree spanning trees For points in the plane (with the Euclidean metric), any minimum spanning tree has degree at most six, and a perturbation argument shows that there always exists a minimum spanning tree with degree at most five [107]. In general the degree of a minimum spanning tree in any dimension is bounded by the kissing number (maximum number of disjoint unit spheres that can be simultaneously tangent to a given unit sphere) [114]. However it is interesting to consider the construction of trees with even smaller degree bounds. As an extreme example, the traveling salesman path problem asks us to find a spanning tree with degree at most two. As is well known, one can approximate this to within a factor of two by performing an Euler tour of the graph formed by doubling the edges of a minimum spanning tree. Christofides' heuristic [42] reduces the approximation ratio to 3/2 by forming a smaller Eulerian graph, the union of a minimum spanning tree and a matching on its odd degree vertices. These techniques do not take much advantage of the geometry of the problem, and work for any metric space. Very recently, Arora [11,12] has discovered a polynomial time approximation scheme for the planar Traveling Salesman Problem. The basic idea, like that of many recent geometric approximation algorithms, is to use dynamic programming on a structure similar to Callahan's fair split tree. Arora shows that, for any point set, there exists a tour approximating the TSP and a recursive decomposition in which each box is crossed only a small number of times by this approximate tour. One can then find the best possible subtour for each small subset of edges crossing each box, by combining similar information from smaller boxes. The time to approximate the TSP within a factor of 1 + 6: is 0{n log^^^^'^^ n). This approximation strategy generalizes to higher dimensional traveling salesman problems as well, with a time bound of the form 0(n log^^^^/^^ n). For any fixed dimension and fixed value of s this is within a polylogarithmic factor of linear, but with an impractically high exponent in the poly log. One can also consider degree bounds between two and five. KhuUer et al. [90] consider this problem for degree bounds of three and four; they show that one can find constrained spanning trees with length 3/2 and 5/4 times the MST length respectively. They also show
440
D. Eppstein
that in any dimension one can find a degreethree tree with total length at most 5/3 that of the minimum spanning tree. The methods of Khuller et al. are based, like the 2approximation to the TSP, on modifications to the minimum spanning tree to reduce its degree. For instance, their algorithm for the planar degreethree tree problem roots the minimum spanning tree, then finds for each vertex v the shortest path starting at v and visiting all the (at most four) children of v. The union of these paths is the desired degreethree tree. The exact solution to the planar degreethree spanning tree problem is NPhard [111] but apparently the complexity of the degreefour problem remains open. O P E N PROBLEM 4. Is it NFhard to find the minimum weight degreefour spanning tree of a planar point setl
It is also natural to consider maximization versions of these boundeddegree spanning tree problems. Barvinok [18] shows that the adjacency matrix of a complete geometric graph (using a polyhedral approximation to the Euclidean distance function) has "low combinatorial rank" and uses this to approximate the maximum traveling salesman problem within any factor (1 — £) in polynomial time. Little seems to be known about similar boundeddegree maximum spanning tree problems with larger degree bounds. Alon et al. [7] consider the maximum noncrossing traveling salesman problem, and its generalization to the construction of a maximum boundeddegree noncrossing spanning tree. They show that this can be approximated by linking the edges of a heavy noncrossing matching formed by projecting the points onto a line, splitting the points into two sets by their median on this line, and matching points of one set with those of the other. The approximation ratio of this method for the noncrossing traveling salesman problem is l/n — s; this ratio is not worked out explicitly for the other boundeddegree spanning tree problems but remains a constant. The time used by Alon et al. to find this long noncrossing path is 0(n logn). As with the other noncrossing problems considered by Alon et al., the complexity of finding exact solutions apparently remains open.
2.4. kpoint spanning trees We next consider the kminimum spanning tree problem: given n points in the Euclidean plane, find the shortest tree spanning k of the points (Figure 3(a)). Up to constant factors in the approximation ratio, the /:MST problem is equivalent to the problem of finding a path connecting k points (the /:TSP problem) or a Steiner tree connecting k points. The choice of Euclidean metric is also not critical. However we will use the A:MST formulation for simplicity. The /:MST problem was introduced independently by Zelikovsky and Lozevanu [133], and by Ravi et al. [113]. Many similar ^point selection problems with other optimization criteria can be solved in polynomial time [50, 68] but the /:MST problem is NPcomplete [113,133] (as are obviously the /:TSP and /:Steiner tree variants), so one must resort to some form of approximation. In a sequence of many papers, the approximation ratio was reduced to Oik^^"^) [113], O(logi^) [75,102], 0(log)^/loglogw) [651,0(1) [27], 2V2 [105], and finally 1f 6: [11]. We describe the 2 ^ 2
Spanning trees and spanners
441
~l
Fig. 3. (a) 6point minimum spanning tree, (b) Guillotine partition.
approximation algorithm, but the other results use similar methods. In particular, the 1+6: approximation results of Arora can be seen as a more complicated generalization of this method. For related work on nongeometric ^MST problems see [17,28,37,113,133]. Mitchell [105] first restricts his attention to the rectilinear metric in the plane; the weight of a tree in this metric differs by its Euclidean weight by a factor of at most \/2, so this simplification entails only that factor loss in the overall approximation ratio of his algorithm. With this restriction, one can look for a rectilinear tree in which vertices are connected by paths of horizontal and vertical line segments. Most of the approximation algorithms for the geometric /:MST problem work by using dynamic programming to construct a suitable recursive partition of the plane, and Mitchell's is no exception. Mitchell applies the concept of a guillotine subdivision, previously used e.g. in VLSI design; this is a recursive partition of the plane into rectangles, in which each rectangle is subdivided by a vertical or horizontal line segment into two smaller rectangles (Figure 3(b)). For a given rectilinear tree, the span of a line segment in the subdivision is the shortest contiguous subsegment containing all the points where the segment intersects the tree. (In other words, this span is a onedimensional convex hull of the intersection of the line segment with the rectilinear tree.) The key technical result of Mitchell, the proof of which is too complicated to repeat here, is the following: 13 (Mitchell). For any rectilinear graph G, we can find a guillotine subdivision S, such that each edge of G is covered by the spans of segments in S, and such that the weight of these spans is at most twice the weight ofG. LEMMA
Let G be the optimum rectilinear ^point spanning tree; then the lemma shows that there exists a guillotine subdivision, for which the spans of segments form a connected region of the plane covering at least k points, and with weight at most twice that of G. Conversely, if we construct the minimum weight guillotine subdivision with these properties, we can simply take a minimum spanning subgraph of this region of the plane to produce a rectilinear ^point spanning tree with the same weight, which will then be twice that of the optimum rectilinear tree. (Actually, in general this process will form a Steiner tree rather
442
D. Eppstein
than a spanning tree. One must instead be more careful, and find a guillotine subdivision for which the minimum spanning subtree of the given k points has minimum total weight.) Thus we have reduced the problem to one of finding an optimum guillotine subdivision. This can be done by dynamic programming: there are 0{n^) combinatorially distinct ways of forming a rectangle containing one or more of the sites. For each of these different rectangles, for each possible number of sites within the rectangle, and for each of the (polynomially many) distinct ways of connecting those sites to the boundary of the rectangle, we find the optimal guillotine partition within that rectangle by combining information from 0{n) pairs of smaller rectangles. The result is a polynomial time algorithm for finding the optimum guillotine partition. 8 (Mitchell). In polynomial time, one can find a spanning tree of a subset ofk out ofn given planar sites, having total weight at most 2 V2 times the optimum.
THEOREM
The complexity of this method, while polynomial, is very high {0{n^^k^) or 0(^2 logn + nk^^)) but can be reduced somewhat (to 0{n^k^) or 0{n \ogn + nk^^)) at the expense of increasing the approximation ratio to a larger constant [105]. Further work remains to be done on reducing the time complexity of this algorithm to a more practical range. In this direction, Eppstein [65] showed that an 0(log/c) approximation could be found in time 0{n\ogn + nkXogk) by combining a similar dynamic programming approach with techniques based on quadtrees. Arora [11,12] showed that the approximation factor could be reduced to 1 + £. He shows that there exists a partition similar to the guillotine partition above, and a tree in which each partition edge is crossed a small number of times, such that the total length of this tree is within this 1 + s factor of optimal. He then uses very similar dynamic programming methods to find such a tree. Arora also reduces the time complexity of this approach to 0{n log^^^/^^ n) which, while still high, is at least within a polylogarithmic factor of linear. 2.5. Minimum diameter spanning trees The previous spanning tree problems have all been based on the weight of the tree constructed. We now consider other criteria for the quality of a tree. The diameter of a tree is just the length of its longest path. Since geometric spanning trees are often used in applications such as VLSI, in which the time to propagate a signal through the tree is proportional to its diameter, it makes sense to look for a spanning tree of minimum diameter. Ho et al. [82] give an algorithm for this problem, based on the following fact: LEMMA 14 (Ho et al.). Any point set has some minimum diameter spanning tree in which there are at most two interior points. PROOF. We start with any minimum diameter spanning tree T, and perform a sequence of diameterpreserving transformations until it is in the above form. Let P be the longest path in the given tree, and number its vertices ui, f2,. •., i^/?. We first form a forest by removing all edges of P from 7, and for each vertex v of P, let Ty denote the tree in this forest containing v. For any other vertex w, let Pu denote the
Spanning trees and spanners
443
Fig. 4. (a) Minimum diameter spanning tree corresponds to cover by two circles, (b) Point set with high diameter minimum spanning tree.
vertex v such that u is in Ty. Then we construct a new tree T' by adding to P an edge from each vertex u to Pu. T' has the same diameter as the original tree, since the distance between any two vertices can not increase except when they are in the same tree Ty, and in that case (by the assumption that P is a diameter path) the distance of each point to v is less than the distance from v to the endpoints of P. Now suppose that P has four or more edges and the length of the path v\V2v?> is at most half the length of P. (If not, we can reverse P and consider the three vertices at its other end.) Form a tree T^^ by removing every edge uv2 and reconnecting each such vertex u to V3. This can only decrease the lengths of paths already going through U3 in 7^ so the only pairs of vertices with increased path lengths are those newly connected to V3. But the length of any such path is at most twice the length of the path i'ii'2t'3, so the diameter of T^^ is no more than that of T. Each repetition of this transformation decreases the number of edges in P until it is at most three, and preserves the property that each vertex is within one edge of P, so we will eventually reach a tree of the form specified in the lemma. D
9 (Ho et al.). We can find a minimum diameter spanning tree of any point set in time Oirr').
THEOREM
PROOF. We simply try all single interior vertices and pairs of interior vertices. For the latter case, we still need to determine how to assign each remaining point to one of the two interior vertices. If the diameter path of the tree is fi1^21^3^4, and we know the lengths of v\V2 and 1^3i;4, we can perform this assignment by drawing two circles, centered at the two interior vertices, with those lengths as radii (Figure 4(a)); these circles must together cover the whole point set and each point can be assigned to the interior vertex corresponding to the circle covering it. Ho et al. show that, if we sort the points by their distances from V2 and U3, the space of all minimal pairs of covering circles can be searched in linear time. These sorted orders can be precomputed in a total of 0{n log n) time. Q
Ho et al. also consider optimization of combinations of diameter and total weight; they show that it is NPcomplete to find a tree satisfying given bounds on these two measures. It is also of interest to combine these criteria with a bound on vertex degree. Of course for
444
D. Eppstein
degreetwo trees, minimum diameter and minimum weight are equivalent to the travehng salesman problem. The minimum weight spanning tree itself can have very high diameter (an Q(^/n) factor away from optimal); for instance a point set spaced nearly uniformly in a unit square can have a path of length Q {y/n) as its minimum spanning tree (Figure 4(b)). Conversely an upper bound of 0 ( v ^ ) follows from results on the worst case length of the minimum spanning tree of n points [24,125]. One can achieve a better diameter by relaxing the requirement of minimum weight; as we describe later, for two and threedimensional point sets, one can find a subgraph of the complete Euclidean graph with degree three and total weight 0(1) times that of the minimum spanning tree, for which shortest paths in the subgraph have length within 0(1) of the Euclidean distance [44]. A singlesource shortest path tree in such a graph is a degreethree tree that has both weight and diameter within a constant of the minimum. Similar problems of constructing spanning trees combining diameter, weight, and bottleneck shortest path bounds were considered by Salowe et al. [118] and Khuller et al. [91]. 2.6. Minimum dilation spanning trees Of the various common geometric network design quality criteria, only dilation (largest ratio of network distance to Euclidean distance) is underrepresented among research on the tree problems. Dilation has been studied for nongeometric tree design problems [30], and as we will see, is very prominent in work on other classes of graphs. The lack of work on tree dilation is likely because there is little to do in terms of worst case bounds: LEMMA
15. Any spanning tree on the vertices of a regular polygon has dilation Q{n).
PROOF. AS with any tree, we can find a vertex v, the removal of which partitions the tree into components the largest of which has at most 2/i/3 vertices. Therefore there is some pair of vertices from different components, adjacent to each other along the boundary of the polygon, and separated from v by at least n/6 polygon edges. The path in this tree D connecting this pair passes through v, and so has dilation Q{n).
Conversely, the minimum spanning tree has dilation 0(«) by its bottleneck shortest path property. However, the minimum spanning tree is not always good in terms of dilation; an example similar to that of Figure 4(b) shows that it can have dilation Q{n) even when dilation O(v^) is possible, it is easy to construct spanning trees with dilation O(v^). OPEN PROBLEM 5. Is it possible to construct the exact minimum dilation geometric spanning tree, or an approximation to it, in polynomial time? Does the minimum dilation spanning tree have any edge crossings! How well is it approximated by the minimum spanning treel
3. Planar graphs We now discuss problems of constructing planar graphs having a given planar point set as vertices. Note that any such problem (in which the graph is required only to be connected)
Spanning trees and spanners
445
requires Qinlogn) time in the randomized algebraic decision tree model, since element distinctness is reducible to sorting, sorting is reducible to convex hulls, and convex hulls can be found in linear time from a connected planar graph spanning the input points [103].
3.1. Minimum weight triangulation The minimum weight triangulation problem asks to find a triangulation (that is, a maximal planar straightline graph on the given set of vertices) that minimizes the total Euclidean edge length. This problem is not known to be NPhard, nor is it known to be solvable in polynomial time, and the complexity of minimum weight triangulation is one of the few problems left from Garey and Johnson's original list of open problems [74]. However, a generalized problem with nonEuclidean distances is NPcomplete [100]. We describe here two very recent developments in the theory of minimum weight triangulations. First, Levcopoulos and Krznaric [96] have shown that one can find a triangulation with total length approximating the minimum to within a (large) constant factor; no such approximation was previously known. Second, Dickerson and Montague have found a method of finding in polynomial time a subgraph of the exact minimum weight triangulation which, empirically, is usually quite large; enough so that moderate sized instances of the problem can now be solved exactly. It is possible that their method in fact gives a polynomial time algorithm for the problem. MWT approximation. The two best approximations known to the MWT are those of Plaisted and Hong [112] and of Levcopoulos and Krznaric [96]. Although dissimilar in many ways, an important basic idea is shared by both papers. Rather than finding a triangulation directly, they consider the problem of finding a minimum weight partition into convex polygons with vertices at the input points (MC for short). We first sketch Plaisted and Hong's work. Let v be an interior vertex of a planar straightline graph with convex faces (such as the MWT of S). We can find a star of three or four edges forming no reflex angles at v as follows: choose the first star edge arbitrarily, and choose each successive edge to form the maximal nonreflex angle with the previous edge. Conversely, if each interior vertex of a planar straightline graph has no reflex angles, the graph must have convex faces. Thus motivated, Plaisted and Hong try to build a graph on S with convex faces by piercing together local structures — stars. For each point st in the interior of the convex hull of 5, they find the minimum weight star of three or four edges. This collection of minimum weight stars, together with the convex hull of 5, forms a graph with total edge length less than twice that of MC and therefore of the MWT. Unfortunately, the resulting graph may not be planar. Plaisted and Hong use a complicated case analysis to remove crossings from this graph, ending up with a planar straightline graph with convex faces having total edge length at most 12 times that of the MWT. The ring heuristic (connecting every other vertex of a convex polygon P to form a polygon P' with [n/2J vertices and a smaller perimeter, and triangulating P' recursively; see Figure 5(a)) can be used to convert this convex partition to a triangulation, at the cost of a logarithmic factor in total length (and hence in the approximation ratio). Olariu et al. [110] showed that this O(logn) bound is tight.
446
D. Eppstein
Fig. 5. (a) Ring heuristic triangulation of a convex polygon, (b) Greedy triangulation can have Q{^) weight than minimum.
larger
We now outline the results of Levcopoulos and Krznaric [96]. Their idea is to start with a proof that the greedy triangulation (in which one considers the possible edges in increasing order by weight, adding an edge to the triangulation exactly when it does not cross any previously added edge) achieves approximation ratio O(v^); an Q{^) lower bound was previously known [95,101] and is depicted in Figure 5(b). Rather than proving this directly, Levcopoulos and Krznaric again work with convex partitions. They define a greedy convex partition GC by constructing stars using only the edges in the greedy triangulation. Unlike the construction of Plaisted and Hong, the result is planar (since it is a subgraph of a planar graph) so no crossings need be removed. The first step of their proof is a lemma that the weight of GC approximates MC within a factor of O(v^). Given any graph G such as MC or GC, define maxG(f) to be the length of the longest edge incident to i; in G; for any planar graph the sum of these quantities is within a constant of the total graph weight. Then if the greedy partition is heavier than the minimum partition by a factor of/:, Levcopoulos and Krznaric choose v to maximize maxGc(i^) — maxMc(^) among all vertices with maxcc {v) = Q{k maxMC i^)) Some simple algebra shows that the weight of GC is 0{n maxGc(i^)) They then use the properties of the greedy triangulation (and the details of their construction of GC from their triangulation) to construct a fan of Q{k) edges resembling that in Figure 5(b), in which the short edge of the fan corresponds roughly with maxA/c(i^) and the long edge corresponds with maxGc(i^) From this fan one can find a convex chain of Q{k) vertices such that any star at one of these vertices involves an edge of length ^(maxGc(i^)). As a consequence the weight of MC is Q{kmdiXGciv)). Combining these two bounds we see that the weight ratio k of GC to MC is 0(n/k). Therefore k = 0(y/n), and this gives an O(v^) approximation of MC by the greedy convex partition. Levcopoulos and Krznaric then show that for any convex partition C formed by edges of the greedy triangulation, C can be triangulated by adding diagonals of total length 0(\MWT\\\C\). Since the overall greedy triangulation we started with, restricted to each cell of C, forms a greedy triangulation of that cell, and since the greedy triangulation forms a constant approximation to the MWT of a convex polygon [97], the result is that the length of the greedy triangulation is 0(\MWT\ + \MC\^/n) = (\MWT\^). To improve this 0(^/n) approximation, Levcopoulos and Krznaric modify the greedy triangulation. Their algorithm MGREEDY adds edges one at a time to a planar straightline graph G, as follows. Let wf be the smallest edge not crossing anything already in G (so
Spanning trees and spanners
441
that the greedy algorithm would next add uvtoG). Then MGREEDY tests the following six conditions: • Some pair of edges uw and wv are already in G, with uwv forming an empty triangle. • Some edge wx crosses uv, with edge vx already in G and vwx forming an empty triangle. • Angle vwu is at least 135°. • \wx\ < l.lwi;. • If /7 is the intersection point of lines vx and uw, then \xp\ < 0.5\wp. • There is an edge uy already in G, such that triangle vuy is empty and angle wuy is reflex. If all six conditions hold for some two vertices w and x, then the algorithm adds edge wx to G; otherwise it adds uv. A similar construction of a convex partition and a fan in it now holds in this modified algorithm as it did in the greedy triangulation. However now the fan can only have 0(1) edges before forming a situation in which the six conditions above hold. The result is that the convex partition is a constant factor approximation to the minimum weight convex partition, and the modified greedy triangulation is a constant factor approximation to the minimum weight triangulation. As Levcopoulos and Krznaric show, these approximations can be constructed in time 0(n logn), or even 0(n) if the Delaunay triangulation is already known. OPEN PROBLEM 6. What is the best possible approximation ratio for a polynomial time approximation to the minimum weight triangulation!
Exact MWT construction. Instead of approximating the minimum weight triangulation, a number of authors have attacked the problem of constructing the exact minimum weight triangulation, by finding conditions sufficient to guarantee that certain edges belong to the MWT. If enough MWT edges could be found in this way, so that the resulting subgraph of the MWT connected all the vertices, the remaining regions of the plane could be treated as simple polygons and triangulated in polynomial time by dynamic programming [93]. This approach gained in credibility when Edelsbrunner and Tan [59] used it to solve a closely related problem, the min max weight triangulation. In this problem, the quality of a triangulation is measured by the length of its longest edge; the min max weight triangulation is the one minimizing this quantity. LEMMA 16 (Edelsbrunner and Tan). There exists some min max weight triangulation that contains the edges of the relative neighborhood graph of the sites. COROLLARY
1. The min max weight triangulation can be found in polynomial time.
The dynamic programming idea described above would lead to an 0(n?) time bound, but Edelsbrunner and Tan reduced this to O(n^). Recall that the relative neighborhood graph is defined in terms of a forbidden region characterization: an edge is in the graph if and only if the lune (formed by intersecting the two circles with that edge as radius) contains no other sites. Several authors have proven
448
D. Eppstein
similar forbidden region characterizations for the minimum weight triangulation. Yang et al. [ 131 ] show that if the region formed as the union of the same two radius circles is empty, the edge belongs to the MWT. (In particular, the two closest sites are connected by an edge in the MWT [76].) Keil [88], Yang [130], and Cheng and Xu [38] prove similar results for an alternate union of two circles, for which the given edge is a chord. Aichholzer et al. [6] provided a different type of characterization of minimum weight triangulation edges, which leads to an algorithm capable of finding the MWT for certain very large subsets. They define a light edge to be one that is not crossed by any other edge of smaller weight. It is not the case that all light edges need be part of the MWT, but they show that if the set of all light edges forms a triangulation, that triangulation must be the one minimizing the total edge weight (or any other monotonic functional of edge weights). Aichholzer et al. note that the characterizations of Keil, Yang et al. [88,130,131] all produce edges that must be Hght. The best computational results so far for exact minimum weight triangulation construction have been found by Dickerson and Montague [53,54]. They define a locally minimal triangulation to be one in which for every two adjacent triangles forming a convex quadrilateral, the common side of the triangles is the shortest diagonal of the quadrilateral. Clearly, the minimum weight triangulation is locally minimal; their idea is to identify edges belonging to all locally minimal triangulations. The technique is simply to maintain a set S of edges that might possibly be part of a locally minimal triangulation. Initially S consists all pairs of vertices, then in a sequence of passes Dickerson and Montague remove from S any edge that is not the short diagonal of a quadrilateral (not containing other sites) all sides of which still belong to S. Eventually no more edges can be removed, and the process terminates. They then define another set S' of all those edges remaining in S and not crossed by any other edge in S. LEMMA 17 (Dickerson and Montague). All edges in S' belong to all locally minimal triangulations.
Since only O(n^) edges can be removed from 5, this heuristic runs in polynomial time. In computational experiments, Dickerson and Montague have shown that for moderate sized inputs (between 100 and 200 points), the set of edges in S' is very likely to form a connected subgraph of the minimum weight triangulation. The minimum weight triangulation itself can then be found by dynamic programming. 7. Is the graph found by Dickerson and Montague always connected! Can one test in polynomial time whether a given edge belongs to some locally minimal triangulation! Can one find the exact minimum weight triangulation in polynomial timel OPEN PROBLEM
3.2. Lowdilation planar graphs We next consider the problem of constructing planar networks with low dilation (maximal ratio between graph and geometric distance). Clearly it will not always be possible to find networks with dilation very close to 1; for instance, any planar graph connecting the vertices of a square has dilation \/2.
Spanning trees and spanners
449
Fig. 6. (a) Diamond property: one of two isosceles triangles on edge is empty, (b) Graph violating good polygon property: ratio of diagonal to boundary path is high.
The initial work on this problem has been to show that various previously studied graphs had constant dilation. Chew [39] showed that the rectilinear Delaunay triangulation has dilation at most \/T0 (Note that the dilation here is measured in the Euclidean metric even though the triangulation itself is defined with the rectilinear metric. There is a factor of V2 lost in the translation; the rectilinear Delaunay triangulation has rectilinear dilation \f5.) Chew also pointed out that by placing points around the unit circle, one could find examples for which the Euclidean Delaunay triangulation was made to have dilation as much as n/l. In the joumaL version of his paper [40], Chew added a further result, that the graph obtained by Delaunay triangulation for a convex distance function based on an equilateral triangle has dilation at most 2. Chew's conjecture that the Euclidean Delaunay dilation was constant was proved by Dobkin et al. [55], who showed that the Delaunay triangulation has dilation at most (pn where cp is the golden ratio (1 + V5)/2. Keil and Gutwin [89] further improved this bound to g^^^f .^. ^ 2.42. Das and Joseph [46] then showed that these constant dilation bounds were not unusual; in fact such bounds hold for a wide variety of planar graph construction algorithms, satisfying the following two simple conditions: • Diamond property. There is some angle of < TT, such that for any edge ^ in a graph constructed by the algorithm, one of the two isosceles triangles with ^ as a base and with apex angle a contains no other site. This property gets its name because the two triangles together form a diamond shape, depicted in Figure 6(a). For instance, because of its emptycircle property, the Delaunay triangulation satisfies the diamond property with ot = 7T/2. • Good polygon property. There is some constant d such that for each face / of a graph constructed by the algorithm, and any two sites M, V that are visible to each other across the face, one of the two paths around / from u to v has dilation at most d. Figure 6(b) depicts a graph violating the good polygon property, because two nearby sites have no short boundary path connecting them. The good polygon property is satisfies by any triangulation (with d = 1). Intuitively, if one tries to connect two vertices by a path in a graph that passes near the straight line segment between the two, there are two natural types of obstacle one encounters. The line segment one is following may cross an edge of the graph, or a face of
450
D. Eppstein
Fig. 7. Fractal )6skeleton with unbounded dilation.
the graph; in either case the path must go around these obstacles. The two properties above imply that neither type of detour can force the dilation of the pair of vertices to be high. THEOREM 10 (Das and Joseph). Any planar graph construction algorithm satisfying the diamond and good polygon properties produces graphs with bounded dilation.
The proof is too complicated to summarize here, but is in some ways similar to the proof of Dobkin et al. [55] that the Delaunay triangulation has bounded dilation. Das and Joseph go on to show that not only Delaunay triangulations but also the greedy and minimum weight triangulations possess these two properties, and hence have bounded dilation. (The bound, while constant, is quite high and could presumably be strengthened.) It seems clear that similar results should also hold for some other triangulation methods developed since their paper, such as the min max edge length triangulation and the min max angle triangulation [60]. Constant dilation of greedy and related triangulations plays a key role in Levcopoulos and Krznaric's recent constantfactor approximation algorithm for the minimum weight triangulation [96], and Drysdale [29] has pointed out that the diamond property of minimum weight triangulation can be very helpful in pruning the edges that could potentially take part in it, and speed up exact solution methods for this triangulation. Another set of natural candidates for bounded dilation are the pskeletons, formed by including an edge ab when no other site c forms an angle acb larger than some particular bound (depending on the parameter P). When the angle bound is 90° this is the Gabriel graph, a subgraph of the Delaunay triangulation and the relative neighborhood graph, and a supergraph of the minimum spanning tree. Skeletons with larger angle bounds have been used to find sets of edges guaranteed to be part of the minimum weight triangulation [38,88, 130]. As p approaches zero, these skeletons contain more and more edges, until eventually one forms the complete geometric graph; this limiting behavior along with the fact that the definition of ySskeletons is closely related to Das and Joseph's diamond property hint together that these graphs might have bounded dilation. But Eppstein [67] has recently shown that a fractal construction leads to ^Sskeletons in the form of paths with unbounded dilation, for any fi >0. (Figure 7.) Curiously, there has been little or no published work on using dilation as the direct basis for constructing planar graphs (rather than constructing graphs some other way and mea
Spanning trees and spanners
451
suring the dilation of the result). Obviously, the minimum dilation planar graph should be a triangulation, since it is never harmful to add diagonals. It seems that it should have useful properties similar to those of the Delaunay triangulation, min max angle triangulation, min max edge length triangulation, minimum weight triangulation, and other optimal triangulations, but this has apparently not been studied. For many optimal triangulation problems, the version of the problem in which one optimally completes the triangulation of a convex or simple polygon can be solved by dynamic programming [93], however even this is not obvious for the minimum dilation triangulation. A solution to this subproblem might have implications in allowing the powerful edge insertion method [22,60] to be applied to the point set version of the problem. OPEN PROBLEM 8. Is it possible to construct in polynomial time the minimum dilation triangulation of a point set, or of a simple polygon!
Clearly there still also remains a wide gap between the best upper and lower bounds (2 and \/2 respectively) on dilation of planar graphs. OPEN PROBLEM
9. What is the worst case dilation of the minimum dilation triangula
tionl The rectilinear case of Open Problem 9 is solved: Arikati et al. [10] showed that for the L\ (or equivalently Loo) planar metrics there is always a planar 2spanner, and that some point sets have no better spanner. 3.3. Planar dilation and weight Levcopoulos and Lingas [98] and Das and Joseph [46] brought the total weight of the graph, as well as its dilation, into the equation. Clearly the weight should be measured in terms of the minimum spanning tree, for as Das and Joseph [46] observe, any graph with bounded dilation should at least be connected. Das and Joseph [46] form a planar graph by applying a greedy triangulation algorithm to the polygons remaining between the minimum spanning tree and the convex hull of the sites. They then consider the greedy edges in decreasing order of weight, removing each edge if it is unnecessary to achieve the desired dilation. They then apply their diamond property and good polygon property criteria to bound the dilation of the resulting pruned graph. Because they only prune the greedy edges, the total weight of the spanner they construct is close to three times that of the minimum spanning tree. Althofer et al. [8,9] later generalized this pruning strategy to arbitrary graphs. Given any graph, and any parameter r > 0, their method again considers the edges of the graph in decreasing order by weight, removing each edge if it is not necessary to achieve dilation \\t. Obviously the result is a subgraph with dilation 1 f ^, but they prove further that the total weight of this subgraph is 1 \0{n/t) times that of the graph's minimum spanning tree, and that the number of edges is 0(^^~^^^^/^^). For planar graphs these bounds are much better: The weight is 1 + 0 ( 1 / 0 times that of the minimum spanning tree, and the number of edges is n(l + 0 ( 1 / 0 ) 
452
D. Eppstein
Althofer et al. then apply this method to the Delaunay triangulation, which as we have seen is a planar graph with constant dilation that also contains the Euclidean minimum spanning tree. The result is a planar spanner with constant dilation, few edges, and weight arbitrarily close to that of the minimum spanning tree. Levcopoulos and Lingas [98] proved the same result by a similar but more complicated method of pruning the Delaunay triangulation; their pruning method works only for planar graphs, but has the further advantage that it runs in linear time. The same pruning method can be used to trade weight and dilation in the other direction, and find graphs with dilation arbitrarily close to that of the Delaunay triangulation, and weight a large constant times that of the minimum spanning tree.
4. General graphs Most of the work on general geometric network design problems, in which the network to be constructed is not of some restricted class, has been on dilation of sparse graphs, since it is trivial to find a graph with low weight or diameter, or to find a nonsparse graph with low dilation.
4.1. Dilation only As we saw, for planar graphs, the dilation can not approach one. By considering nonplanar graphs, it is possible to find sparse graphs approximating the complete Euclidean graph arbitrarily closely. Specifically, Keil [87] showed that variations of the Yao graph construction (in which one partitions the space around each point into wedges with a given fixed opening angle, and connects the point to the nearest neighbor in each wedge) produce graphs with dilation arbitrarily close to 1, with 0{n) edges, and that can be constructed in time 0{n \ogn). No better time bound is possible in the randomized algebraic decision tree model of computation, since spanners could be used to solve the element distinctness problem [35]. THEOREM 11 (Keil). The Yao graph, formed by wedges of opening angle 0 < 60°, produces graphs with dilation 1 + 0(l/6>). PROOF. TO find a path in this graph from u to v, one at each step determines the wedge containing v and moves along a graph edge to the nearest vertex (w;) in that wedge. The worst case for the algorithm occurs when uv and uw are similar in length but widely separated in angle, in which case the distance to v is reduced by (1 — 0(1/0))uw. For 0 < 60° this reduction must be positive, and repeating the process brings us eventually to V. The total distance traveled is proportional to 1/(1  0(1/^)) = 1 + O(l/0) times the total reduction in distance to v, which is exactly the original distance from u to v. D
Althofer et al. [8,9] observed that this result holds in any dimension, and Ruppert and Seidel [115] modify the technique so that orthogonal range searching methods can be used in its construction, improving its running time in high dimensions to 0(n log*^"^ n).
Spanning trees and spanners
453
Callahan [31] improved the dependence between the number of edges and the dilation, as well as the construction time, in this result: THEOREM 12. If one forms a wellseparated pair decomposition, and chooses a representative edge from each pair, the resulting graph has 0{n) edges and can be made to have dilation arbitrarily close to one {as a function of the separation parameter of the decomposition). PROOF. We find a short path between two sites u and v by the following recursive process: by the definition of a wellseparated pair decomposition, the decomposition includes some pair ([/, V) of sets of sites for which w is in t/ and i; is in V. Find the edge u'W representing the pair {U, V), and form a path by recursively connecting u to u', following edge u'v', and connecting v' to v. If the parameter of separation in the decomposition is s, and the length of wi; is r, the length of u'v' can be at most r{s \ A)/s, and the length of uu' and vv' can be at most 2r/s. Therefore this recursive algorithm produces a path with length satisfying the recurrence
L{r) ^ r(l + A/s) + 2L{2r/s). If ^ > 4, this solves to 0(r), and for any e > 0 one can choose a sufficiently large s for which the solution to this recurrence i s r ( l + £ ) . D As in his approximation to the Euclidean minimum spanning tree, Callahan further shows that the dependence on e can be reduced by choosing more carefully the representative edge for each pair in the well separated pair decomposition. Similar constructions of sparse spanners with a larger dependence on the dilation were also given by Salowe [116] and Vaidya [129].
4.2. Dilation and weight Note that the smalldilation graphs described above may have very high weight. As we have already seen, it is possible for planar sites to construct smalldilation graphs with weight arbitrarily close to that of the minimum spanning tree. The greedy algorithm of Althofer et al. [8,9] (described in the section on planar graphs) was defined for any graph, and so produces spanners with nontrivial weight bounds in any dimension; but in general the results proved by those authors are far from the constant factor over minimum spanning tree weight that one would hope for. Das et al. [45] showed that applying this greedy algorithm to the complete Euclidean graph in three dimensions again produces a spanner with any given dilation t > \, and total weight 0(1) times that of the minimum spanning tree (where the constant depends on t). Chandra [33] showed that for random point sets in higher dimensions, the weight is again 0(1) times that of the minimum spanning tree. Das and Narasimhan [48] apply this greedy approach to a sparse spanner produced by clustering techniques; the dilation of the result is the product of the dilations from these two steps, which is still typically some constant. This idea speeds
454
D. Eppstein
Fig. 8. Isolation property: a cylinder around each edge is not crossed by any other edge.
up the greedy method to run in time 0{n log^ n), and produces results similar to those of Althofer et al. Chandra et al. [34] showed that, for any graph, one can construct a spanner with dilation 0(log^ n) and weight 0 ( l ) times that of the minimum spanning tree. For geometric graphs in any dimension, they construct spanners with constant dilation and weight O(logn) times that of the minimum spanning tree. They actually give two methods for this second result. One method is simply to apply the greedy algorithm; they show an O(logn) weight factor based on the gap property: the endpoints of any two edges are separated by a distance at least proportional to the smaller of the two edge lengths. The other method combines known sparse (but heavy) spanners with approximations to the traveling salesman path; the algorithm then partitions the path recursively into smaller pieces and combines spanners from representative points on each piece. Arya and Smid [141 modify and speed up the first, greedy, method: instead of adding edges incrementally when necessary to preserve the dilation, and proving that the result satisfies the gap property, they add edges unless the gap property would be violated, and show that the resulting graph has bounded dilation. With this modified greedy method they show that a graph with bounded dilation and weight 0(log/i) times that of the minimum spanning tree can be constructed in time 0{n \og^ n). Finally, Das, Narasimhan, and Salowe [49] extended the results of Das et al. [45], and showed that in any dimension the greedy algorithm produces spanners with both constant dilation and weight a constant times that of the minimum spanning tree. The dilation bound is immediate; the weight bound is reminiscent of the methods of Das and Joseph [46] in that the authors describe a collection of general conditions under which such a bound applies; further their isolation property is very similar to the diamond property of Das and Joseph. • Isolation property. There exists a constant c, such that any edge of length t produced by the given algorithm can be placed within a cylinder of radius and height c • i (Figure 8), such that the axis of the cylinder is a subset of the edge, and the cylinder does not intersect any other edge of the graph. Note that, unlike the diamond property, the cylinders are required to avoid the edges of the graph, and not just the other sites. Also note that in this definition the cylinders around each edge may intersect each other, but one can shrink them by a factor of two to avoid intersections. The exact shape of the cylinders is also unimportant.
Spanning trees and spanners
455
LEMMA 18 (Das et al.). Any geometric graph satisfying the isolation property has weight at most a constant times that of the minimum spanning tree. The proof is based on separating the edges of the graphs into groups of nearly parallel edges, and charging the length in each group to edges in the Steiner minimal tree of the sites. Das et al. also prove similar results for the leapfrog property, a generalization of the isolation property for which they give a more complicated definition. They then show that graphs produced by a version of the greedy algorithm have this property. This then proves that the greedy algorithm produces spanners with weight 0(1) times that of the minimum spanning tree. 4.3. Dilation, weight, and degree Perhaps the ultimate results in highdimensional spanners combine dilation, weight, and vertex degree. Clearly the degree bound must be at least three, since degreetwo graphs may be forced to have very large dilation. Further, for any fixed bound d on the degree, one must have dilation bounded away from one by some function of d, even in the plane, as can be seen by considering the vertices of a regular d + 2gon. Chandra et al. [34] showed that their version of the greedy method, when applied to polyhedral approximations to the Euclidean graph, produces a spanner with degree bounded by some function of the dilation, dimension, and the particular approximation. Their bound is not stated explicitly but is roughly exponential in the dimension. As we have seen these spanners also have low weight. Salowe [117] produces another boundeddegree spanner algorithm by modifying the Yao graph construction described earlier (which may have unbounded degree). The idea is simply to add edges to the spanner in order by weight, adding an edge (w, v) if there is no other edge (w, w) or (u, w) already added and having an angle close to that of (w, f). Salowe also reports that a similar degree bound applies to the spanner of Ruppert and Seidel [115] but this appears to be erroneous. However it should be possible to keep track of the next edge to be added to the graph at each step of this construction (that is, the shortest edge within a certain range of angles, connecting two points not already incident to edges in that range) by combining Ruppert and Seidel's modified Yao graph orthogonal range searching technique [115] with a method of Eppstein [62] for maintaining bichromatic closest pairs dynamically. The result would be an 0{n log^^^^ n) time algorithm to construct this bounded degree spanner. As we have already seen, Arya and Smid [14] achieved a similar time bound for an alternate bounded degree spanner. Yet another boundeddegree spanner construction is credited by Vaidya [129] to Feder and Nisan. Finally, Arya et al. [13] improved the time bounds of all these methods. The results of Arya et al. include an 0{n \ogn) time algorithm for constructing a spanner with bounded dilation, bounded degree, and weight a constant factor times the minimum spanning tree. They also give an 0{n log n) algorithm for constructing a spanner with bounded dilation on paths of O(logn) edges, bounded degree, and weight 0(log^ n) times that of the minimum spanning tree. (The idea of finding short paths with few edges was also previously considered by Arya, Mount, and Smid [15].) Therefore for any fixed dilation, one can quickly
456
D. Eppstein
find spanners with bounded degree. Further work on the problem has turned this tradeoff around, and asked how small a degree is possible to achieve bounded dilation. Salowe [117] was the first to find degree bounds that did not grow with the dimension of the problem; he showed that in any dimension, there is a degreefour graph with constant dilation. Salowe starts with any one of the bounded degree methods discussed above. Salowe's method for reducing the degree to four is then to cluster points using the nearest neighbor forest, and use these clusters to roughly halve the degree of any spanner construction method. Starting with the initial bounded degree spanner method described above and iterating this degree reduction process produces his result. This paper also contains a convenient classification of the spanner literature in terms of five parameters (dilation, time, number of edges, weight, and degree) and the class of metric space for which the spanners are defined. Salowe's paper does not however include a bound on the total weight of his spanners. Das and Heffeman [44] improved this degreefour bound, by showing that in any dimension, there is a graph with maximum degree three, at most dn edges (for any J > 1), constant dilation (depending on d), and total weight O(logn) times the minimum spanning tree weight. They state that in dimensions two and three the weight can be further reduced to 0(1) times the minimum spanning tree weight. Their technique involves similar nearestneighborforest based clustering methods to those of Salowe, applied somewhat more carefully, and combined with the greedy spanners constructed by Chandra et al. [34]. The weight bound comes from summing the weight of the greedy spanner with that of the nearest neighbor forest (which as a subgraph of the minimum spanning tree has small weight). Combining this with the recent result of Das et al. [49] on constant weight bounds for the greedy spanner construction yields the following result. THEOREM 13 (Das, Heffeman, Narasimhan, and Salowe). For sites in any fixed dimension, and for any constant d ^ \, one can construct in time 0(n logn) a graph with constant dilation, degree three, at most dn edges, and weight a constant factor times that of the minimum spanning tree.
References [1] Active Geometry Group, Johns Hopkins U., Extracting the geometry of the vascular tree. Manuscript, available online at http://blaze.cs.jhu.edu/grad/lundberg/agg/projects/vasc.html. [2] P.K. Agarwal, H. Edelsbrunner, O. Schwarzkopf and E. Welzl, Euclidean minimum spanning trees and bichromatic closest pairs. Discrete Comput. Geom. 6 (1991), 407^22. [3] P.K. Agarwal, A. Efrat and M. Sharir, Vertical decomposition of Shallow levels in 3dimensional arrangements and its applications, Proc. 11th ACM Symp. Comp. Geom. (1995), 3950. [4] P.K. Agarwal, J. Matousek and S. Suri, Farthest neighbors, maximum spanning trees and related problems in higher dimensions, Comput. Geom. 1 (1992), 189201. [5] A. Aggarwal, L.J. Guibas, J. Saxe and P.W. Shor, A linear time algorithm for computing the Voronoi diagram of a convex polygon. Discrete Comput. Geom. 4 (1989), 591604. [6] O. Aichholzer, F. Aurenhammer, M. Taschwer and G. Rote, Triangulations intersect nicely. Discrete Comput. Geom. 16 (1996), 339359. [7] N. Alon, S. Rajagopalan and S. Suri, Long noncrossing configurations in the plane. Fund. Inform. 22 (1995), 385394.
Spanning trees and spanners
457
[8] I. Althofer, G. Das, D. Dobkin and D. Joseph, Generating sparse spanners for weighted graphs, Proc. 2nd Scand. Worksh. Algorithm Theory, Springer LNCS 447 (1990), 2637. [91 I. Althofer, G. Das, D. Dobkin, D. Joseph and J. Soares, On sparse spanners of weighted graphs. Discrete Comput. Geom. 9 (1993), 81100. [101 S. Arikati, D.Z. Chen, L.R Chew, G. Das, M. Smid and CD. Zaroliagis, Planar spanners and approximate shortest path queries among obstacles in the plane, Proc. 4th Eur. Symp. Algorithms, Springer LNCS 1136(1996), 514528. [11] S. Arora, Polynomial time approximation schemes for Euclidean TSP and other geometric problems, Proc. 37th IEEE Symp. Foundations of Comp. Sci. (1996), 211. [12] S. Arora, Nearly linear time approximation schemes for Euclidean TSP and other geometric problems. Manuscript (1997). [13] S. Arya, G. Das, D.M. Mount, J.S. Salowe and M. Smid, Euclidean spanners: Short, thin, and lanky, Proc. 27th ACM Symp. Theory of Computing (1995), 489^98. Available onhne at http ://w WW. cs. umd. edu/~ mount/Papers/stoc95. ps. [14] S. Arya and M. Smid, Efficient construction of a bounded degree spanner with low weight, Proc. 2nd Eur. Symp. Algorithms, Springer LNCS 855 (1994), 4859. [15] S. Arya, D. Mount and M. Smid, Randomized and deterministic algorithms for geometric spanners of small diameter, Proc. 35th IEEE Symp. Foundations of Comp. Sci. (1994), 703712. Available online at http://www.cs.umd.edu/~mount/Papers/focs94.ps. [16] T. Asano, B. Bhattacharya, M. Keil and F. Yao, Clustering algorithms based on minimum and maximum spanning trees, Proc. 4th ACM Symp. Comp. Geom. (1988), pp. 252257. [17] B. Awerbuch, Y. Azar, A. Blum and S. Vempala, Improved approximation guarantees for minimumweight ktrees and prizecollecting salesmen, Proc. 27th ACM Symp. Theory of Computing (1995), 2111%Z. Available online at http://wwwcgi.cs.cmu.edU/afs/cs.cmu.edu/Web/People/avrim/Papers/prizetsp.ps.Z. [18] A.I. Barvinok, Two algorithmic results for the traveling salesman problem. Manuscript (1994). [19] J. Basch, L.J. Guibas and J. Hershberger, Data structures for mobile data, Proc. 8th ACMSIAM Symp. Discrete Algorithms (1997), lM156. [20] J. Basch, L.J. Guibas and L. Zhang, Proximity problems on moving points, Proc. 11th ACM Symp. Comput. Geom. (1997), 344351. [21] J.L. Bentley and J. Saxe, Decomposable searching problems I: Statictodynamic transformation, J. Algorithms 1 (1980), 301358. [22] M. Bern, H. Edelsbrunner, D. Eppstein, S. Mitchell and T.S. Tan, Edgeinsertion for optimal triangulations. Discrete Comput. Geom. 10 (1993), 4765. [23] M. Bern and D. Eppstein, Mesh generation and optimal triangulation. Computing in Euclidean Geometry, D.Z. Du and F.K. Hwang, eds, World Scientific (1992); 2nd ed. (1995), 47123. [24] M. Bern and D. Eppstein, Worstcase bounds for subadditive geometric graphs, Proc. 9th ACM Symp. Comp. Geom. (1993), 183188. [25] M. Bern and D. Eppstein, Approximation algorithms for geometric problems. Approximation algorithms for NPHard Problems, D. Hochbaum, ed., PWS Pubhshing (1996), 296345. [26] M. Bern, D. Eppstein and S.H. Teng, Parallel construction of quadtrees and quality triangulations, Proc. 3rd Worksh. Algorithms and Data Structures, Springer LNCS 709 (1993), 188199. [27] A. Blum, P. Chalasani and S. Vempala, A constantfactor approximation for the kMST problem in the plane, Proc. 27th ACM Symp. Theory of Computing (1995), 294302. Available online at http://wwwcgi.cs.cmu.edu/afs/cs.cmu.edu/Web/People/avrim/Papers/planarktrees.ps.Z. [28] A. Blum, R. Ravi and S. Vempala, A constantfactor approximation algorithm for the kMST problem, Proc. 28th ACM Symp. Theory of Computing (1996). [29] H. Bronnimann, Computational Geometry Tribune, No. 3, available online at http://www.inria.fr/prisme/ personnel/bronnimann/cgt/cgt3.ps.Z. [30] L. Cai and D. Cornell, Tree spanners, SIAM J. Discrete Math. 8 (1995), 359388. [31] P.B. Callahan, The WellSeparated Pair Decomposition and its Applications, PhD thesis, Johns Hopkins U. (1995). Available online at ftp://ftp.cs.jhu.edU/pub/callahan/dissertation.ps.Z. [32] P.B. Callahan and S.R. Kosaraju, A decomposition of multidimensional point sets with applications to knearest neighbors and nbody potential fields, J. ACM 42 (1995), 6790.
458
D. Eppstein
[33] B. Chandra, Constructing sparse spanners for most graphs in higher dimensions. Inform. Process. Lett. 51 (1994), 289294. [34] B. Chandra, G. Das, G. Narasimhan and J. Soares, New sparseness results on graph spanners, Intemat. J. Comput. Geom. Appl. 5 (1995), 125144. [35] D.Z. Chen, G. Das and M. Smid, Lower bounds for computing geometric spanners and approximate shortest paths, Proc. 8th Canad. Conf. Comput. Geom., Carleton Univ. Press. (1996), 155160. [36] D. Cheriton and R.E. Tarjan, Finding minimum spanning trees, SIAM J. Comput. 5 (1976), 310313. [37] S.Y. Cheung and A. Kumar, Efficient quorumcast routing algorithms, Proc. IEEE Conf. Computer Communications, Vol. 2 (1994), 840847. [38] S. Cheng and Y. Xu, Approaching the largest ^skeleton within the minimum weight triangulation, Proc. 12th ACM Symp. Comp. Geom. (1996), 196203. [39] L.P. Chew, There is a planar graph almost as good as the complete graph, Proc. 2nd ACM Symp. Comp. Geom. (1986), 169177. [40] L.P. Chew, There are planar graphs almost as good as the complete graph, J. Comput. System. Sci. 39 (1989), 205219. [41] L.P. Chew and R.L. Drysdale, Voronoi diagrams based on convex distance functions, Proc. 1st ACM Symp. Comp. Geom. (1985), 235244. [42] N. Christofides, Worstcase analysis of a new heuristic for the traveling salesman problem. Report 388, Grad. Sch. Industrial Admin., Carnegie Mellon U. (1975). [43] C. Chiang, M. Sarrafzadeh and C.K. Wong, A powerful global router based on Steiner minmax trees, Proc. IEEE Int. Conf. CAD (1989), 25. [44] G. Das and P.J. Heffeman, Constructing degree3 spanners with other sparseness properties, Proc. 4th Int. Symp. Algorithms and Computation, Springer LNCS 762 (1993), 1120. [45] G. Das, P.J. Heffeman and G. Narasimhan, Optimally sparse spanners in ^dimensional Euclidean space, Proc. 9th ACM Symp. Comp. Geom. (1993), 5362. [46] G. Das and D. Joseph, Which triangulations approximate the complete graph? Proc. Int. Symp. Optimal Algorithms, Springer LNCS 401 (1989), 168192. [47] G. Das, S. Kapoor and M. Smid, On the complexity of approximating Euclidean traveling salesman tours and minimum spanning trees, Proc. 16th Conf. Found. Software Tech. and Theor. Comput. Sci., Springer LNCS 1180 (1996), 6475. [48] G. Das and G. Narasimhan, A fast algorithm for constructing sparse Euclidean spanners, Proc. 10th ACM Symp. Comp. Geom. (1994), 132139. [49] G. Das, G. Narasimhan and J. Salowe, A new way to weigh malnourisheed Euclidean graphs, Proc. 6th ACMSIAM Symp. Discrete Algorithms (1995), 215222. [50] A. Datta, H.P. Lenhof, C. Schwarz and M. Smid, Static and dynamic algorithms for kpoint clustering problems, J. Algorithms 19 (1995), 474503. [51] O. Devillers, S. Meiser and M. Teillaud, Fully dynamic Delaunay triangulation in logarithmic expected time per operation, Comput. Geom. 2 (1992), 5580. [52] T. Dey, Improved bounds for ksets and kth levels. Manuscript (1997). [53] M. Dickerson and M. Montague, A (usually?) connected subgraph of the minimum weight triangulation, Proc. 12th ACM Symp. Comp. Geom. (1996), 204213. Available online at ftp://ams.sunysb. edu/pub/geometry/msiworkshop/95/dickerso.ps.gz. See also http://www.middlebury.edu/~dickerso/ mwtskel.html. [54] M. Dickerson and M. Montague, The exact minimum weight triangulation, Proc. 12th ACM Symp. Comp. Geom. (1996). [55] D.P Dobkin, S.J. Friedman and K.J. Supowit, Delaunay graphs are almost as good as complete graphs. Discrete Comput Geom. 5 (1990), 399407. [56] R.L. Drysdale, A practical algorithm for computing the Delaunay triangulation for convex distance functions, Proc. 1st ACMSIAM Symp. Discrete Algorithms (1990), 159168. [57] D.Z. Du and F.K. Hwang, The state of the art in Steiner ratio problems. Computing in Euclidean Geometry, D.Z. Du and RK. Hwang, eds. World Scientific (1992); 2nd ed. (1995), 195224. [58] H. Edelsbrunner, L.J. Guibas and J. Stolfi, Optimal point location in a monotone subdivision, SIAM J. Comput. 15 (1986), 317340.
Spanning trees and spanners
459
[59] H. Edelsbrunner and T.S. Tan, A quadratic time algorithm for the minmax length triangulation, Proc. 32nd IEEE Symp. Foundations of Comp. Sci. (1991), 414^23. [60] H. Edelsbrunner, T.S. Tan and R. Waupotitsch, A polynomial time algorithm for the minmax angle triangulation, SIAM J. Sci. Statist. Comput. 13 (1992), 994^1008. [61] D. Eppstein, Offline algorithms for dynamic minimum spanning tree problems, J. Algorithms 17 (1994), 237250. [62] D. Eppstein, Dynamic Euclidean minimum spanning trees and extrema of binary functions. Discrete Comput. Geom. 13 (1995), 237250. [63] D. Eppstein, Average case analysis of dynamic geometric optimization, Comput. Geom. 6 (1996), 4568. [64] D. Eppstein, Geometric lower bounds for parametric matroid optimization. Discrete Comput. Geom., to appear. [65] D. Eppstein, Faster geometric kpoint MST approximation, Comput. Geom. 8 (1997), 231240. [66] D. Eppstein, Faster circle packing with application to nonobtuse triangulation, Intemat. J. Comput. Geom. Appl. 7 (5) (1997), 485491. [67] D. Eppstein, Betaskeletons have unbounded dilation. Tech. Rep. 9615, UC Irvine, Dept. Inf. & Comp. Sci. (1996). [68] D. Eppstein and J. Erickson, Iterated nearest neighbors and finding minimal polytopes. Discrete Comput. Geom. 11 (1994), 321350. [69] D. Eppstein, Z. Galil, G.F. Italiano and A. Nissenzweig, Sparsification  A technique for speeding up dynamic graph algorithms, Proc. 33rd IEEE Symp. Foundations of Comp. Sci. (1992), 6069. [70] D. Eppstein, G.F. Italiano, R. Tamassia, R.E. Tarjan, J. Westbrook and M. Yung, Maintenance of a minimum spanning forest in a dynamic plane graph, J. Algorithms 13 (1992), 3354. [71] D. FemandezBaca, G. Slutski and D. Eppstein, Using sparsification for parametric minimum spanning tree problems, Nordic J. Comput. 3 (1996), 352366. [72] M. Fredman and D.E. Willard, Transdichotomous algorithms for minimum spanning trees and shortest paths, Proc. 31st IEEE Symp. Foundations of Comp. Sci. (1990), 719725. [73] H.N. Gabow, Z. Galil, T. Spencer and R.E. Tarjan, Efficient algorithms for finding minimum spanning trees in undirected and directed graphs, Combinatorica 6 (1986), 109122. [74] M.R. Garey and D.S. Johnson, Computers and Intractability: A Guide to the Theory of NPCompleteness, W.H. Freeman (1979). [75] N. Garg and D.S. Hochbaum, An 0(log k) approximation for the k minimum spanning tree problem in the plane, Proc. 26th ACM Symp. Theory of Computing (1994), 432^38. [76] P.D. Gilbert, New results in planar triangulations. Report R850, U. Illinois Coordinated Science Lab. (1979). [77] D. Grigoriev, M. Karpinski, F. Meyer auf der Heide and R. Smolensky, A lower bound for randomized algebraic decision trees, Proc. 28th ACM Symp. Theory of Computing (1996), 612619. [78] L.J. Guibas, D.E. Knuth and M. Sharir, Randomized incremental construction of Delaunay and Voronoi diagrams, Algorithmica 7 (1992), 381^13. [79] D. Gusfield, Bounds for the parametric spanning tree problem, Proc. Humboldt Conf. Graph Th., Combinatorics and Computing, Utilitas Mathematica (1979), 173183. [80] S. Haruyama and D. Fussell, A new areaefficient power routing algorithm for VLSI layout, Proc. IEEE Int. Conf. CAD (1987), 3 8 ^ 1 . [81] M.R. Henzinger and V. King, Maintaining minimum spanning trees in dynamic graphs. Tech. Rep. DCS251IR, Univ. of Victoria, Dept. of Computer Science (1997). [82] J.M. Ho, D.T. Lee, C.H. Chang and C.K. Wong, Minimum diameter spanning trees and related problems, SIAM J. Comput. 20 (1991), 987997. [83] M.A.B. Jackson, A. Srinivasan and E.S. Kuh, Clock routing for highperformance IC's, Proc. 27th ACM/IEEE Design Automation Conf. (1990), 573579. [84] A. Kahng, J. Cong and G. Robins, Highperformance clock routing based on recursive geometric matching, Proc. 28th ACM/IEEE Design Automation Conf. (1991), 322327. [85] D. Karger, P.N. Klein and R.E. Tarjan, A randomized lineartime algorithm to find minimum spanning trees, J. ACM 42 (1995), 321328. [86] N. Katoh, T. Tokuyama and K. Iwano, On minimum and maximum spanning trees of linearly moving points. Discrete Comput. Geom. 13 (1995), 161176.
460
D. Eppstein
[87] J.M. Keil, Approximating the complete Euclidean graph, Proc. 1st Scand. Worksh. Algorithm Theory, Springer LNCS 318 (1988), 208213. [88] J.M. Keil, Computing a subgraph of the minimum weight triangulation, Comput. Geom. 4 (1994), 1326. [89] J.M. Keil and C.A. Gutwin, The Delaunay triangulation closely approximates the complete Euclidean graph. Discrete Comput. Geom. 7 (1992), 1328. [90] S. Khuller, B. Raghavachari and N. Young, Low degree spanning trees of small weight, SIAM J. Comput. 25 (1996), 355368. [91] S. Khuller, B. Raghavachari and N. Young, Balancing minimum spanning trees and shortestpath trees, Algorithmica 14 (1995), 305321. [92] D. Kirkpatrick, Optimal search in planar subdivision, SIAM J. Comput. 12 (1983), 2835. [93] G.T. Klincsek, Minimal triangulations of polygonal domains, Ann. Discrete Math. 9 (1980), 121123. [94] E. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, Wiley (1985). [95] C. Levcopoulos, An Q{y/n) lower bound for nonoptimality of the greedy triangulation. Inform. Process. Lett. 25 (1987), 247251. [96] C. Levcopoulos and D. Krznaric, Quasigreedy triangulations approximating the minimum weight triangulation, Proc. 7th ACMSIAM Symp. Discrete Algorithms (1996), 392401. [97] C. Levcopoulos and A. Lingas, On approximation behavior of the greedy triangulation for convex polygons, Algorithmica 2 (1987), 175193. [98] C. Levcopoulos and A. Lingas, There are planar graphs almost as good as the complete graphs and as short as minimum spanning trees, Proc. Int. Symp. Optimal Algorithms, Springer LNCS 401 (1989), 913. [99] R.J. Lipton and R.E. Tarjan, Applications of a planar separator theorem, SIAM J. Comput. 9 (1980), 615627. [100] E.L. Lloyd, On triangulations of a set ofpoints in the plane, Proc. 18th IEEE Symp. Foundations of Comp. Sci. (1977), 228240. [101] G.K. Manacher and A.L. Zobrist, Neither the greedy nor the Delaunay triangulation approximates the optimum. Inform. Process. Lett. 9 (1979), 3134. [102] C.S. Mata and J.S.B. Mitchell, Approximation algorithms for geometric tour and network design problems, Proc. 11th ACM Symp. Comp. Geom. (1995), 360369. [103] D. McCallum and D. Avis, A linear algorithm for finding the convex hull of a simple polygon, Inform. Process. Lett. 9 (1979), 201206. [104] K. Mehlhom, S. Meiser and C. O'Dunlaing, On the construction of abstract Voronoi diagrams. Discrete Comput. Geom. 6 (1991), 211224. [105] J.S.B. Mitchell, Guillotine subdivisions approximate polygonal subdivisions: A simple new method for the geometric kMSTproblem, Proc. 7th ACMSIAM Symp. Discrete Algorithms (1996), 402408. [106] C. Monma, M. Paterson, S. Suri and F. Yao, Computing Euclidean maximum spanning trees, Algorithmica 5 (1990), 407^19. [107] C. Monma and S. Suri, Transitions in geometric spanning trees. Discrete Comput. Geom. 8 (1992), 265293. [108] K. Mulmuley, Randomized multidimensional search trees: Dynamic sampling, Proc. 7th ACM Symp. Comp. Geom. (1991), 121131. [109] C. O'Dunlaing and C.K. Yap, A "retraction" method for planning the motion of a disc, J. Algorithms 6 (1985), 104111. [110] S. Olariu, S. Toida and M. Zubair, On a conjecture by Plaisted and Hong, J. Algorithms 9 (1988), 597598. [ I l l ] C.H. Papadimitriou and U. V. Vazirani, On two geometric problems related to the traveling salesman problem, J. Algorithms 5 (1984), 231246. [112] D.A. Plaisted and J. Hong, A heuristic triangulation algorithm, J. Algorithms 8 (1987), 405^37. [113] R. Ravi, R. Sundaram, M.V. Marathe, D.J. Rosenkrantz and S.S. Ravi, Spanning trees short and small, Proc. 5th ACMSIAM Symp. Discrete Algorithms (1994), 546555. [114] G. Robins and J.S. Salowe, Lowdegree minimum spanning trees. Discrete Comput. Geom. 14 (1995), 151165. [115] J. Ruppert and R. Seidel, Approximating the ddimensional complete Euclidean graph, 3rd Canad. Conf. Comp. Geom. (1991), 207210.
Spanning trees and spanners
461
[116] J.S. Salowe, Constructing multidimensional spanner graphs, Intemat. J. Comput. Geom. Appl. 1 (1991), 99107. [117] J.S. Salowe, Euclidean spanner graphs with degree four. Discrete Appl. Math. 54 (1994), 5566. [118] J.S. Salowe, D.S. Richards and D.E. Wrege, Mixed spanning trees: A technique for performancedriven routing, Proc. 3rd Great Lakes Symp. VLSI Design Automation of High Performance VLSI Systems, IEEE (1993), 6266. [119] N. Samak and R.E. Tarjan, Planar point location using persistent search trees, Comm. ACM 29 (1986), 669679. [120] O. Schwarzkopf, Dynamic maintenance of geometric structures made easy, Proc. 32nd IEEE Symp. Foundations of Comp. Sci. (1991), 197206. [121] Sedgewick and J. Vitter, Shortest paths in Euclidean graphs, Algorithmica 1 (1986), 3148. [122] M.L Shamos and D. Hoey, Closestpoint problems, Proc. 16th IEEE Symp. Foundations of Comp. Sci. (1975), 151162. [123] N. Sherwani, Algorithms for VLSI Physical Design Automation, Kluwer (1993). [124] D.D. Sleator and R.E. Tarjan, A data structure for dynamic trees, J. Comput. System. Sci. 24 (1983), 362381. [125] J.M. Steel and T.L. Snyder, Worstcase growth rates of some classical problems of combinatorial optimization, SIAM J. Comput. 18 (1989), 278287. [126] H. Tamaki and T. Tokuyama, How to cut pseudoparabolas into segments, Proc. 11th ACM Symp. Comput. Geom. (1995), 230237. [127] R. Tsay, Exact zero skew, Proc. IEEE Int. Conf. CAD (1991), 336339. [128] P.M. Vaidya, Minimum spanning trees in kdimensional space, SIAM J. Comput. 17 (1988), 572582. [129] P.M. Vaidya, A sparse graph almost as good as the complete graph on points in K dimensions. Discrete Comput. Geom. 6 (1991), 369381. [130] B.T. Yang, A better subgraph of the minimum weight triangulation. Inform. Process. Lett. 56 (1995), 255258. [131] B.T. Yang, Y.F. Xu and Z.Y You, A chain decomposition algorithm for the proof of a property on minimum weight triangulations, Proc. Int. Symp. Algorithms and Computation, Springer LNCS 834 (1994), 423427. [132] A.C. Yao, On constructing minimum spanning trees in kdimensional space and related problems, SIAM J. Comput. 11 (1982), 721736. [133] A.A. Zelikovsky and D.D. Lozevanu, Minimal and bounded trees, Proc. Tezele Cong. XVIII Acad. RomanoAmericane, Kishinev (1993) 2526.
This Page Intentionally Left Blank
CHAPTER 10
Geometric Data Structures Michael T. Goodrich* Center for Geometric Computing, Department of Computer Science, Johns Hopkins University, Baltimore, MD 21218 Email: goodrich@cs.jhu.edu
Kumar Ramaiyer^ Informix Software, Inc., 1111, Broadway, Suite 2000, Oakland, CA 94607 Email: rk@ Informix, com
Contents 1. Introduction 1.1. Problem classification and goals 1.2. Chapter outline 2. Embedded planar graphs 2.1. The Doubly Connected Edge List (DCEL) 2.2. The wingededge representation 2.3. The quadedge representation 2.4. Well known PSLGs 3. Planar point location and ray shooting 3.1. The slab method 3.2. The trapezoid method 3.3. The chain method 3.4. Improving the chain method via fractional cascading 4. Dynamic point location 4.1. The interlaced trees technique 5. Convex hulls and convex polytopes 5.1. Jdimensional representations 5.2. 2dimensional dynamic maintenance 5.3. 3dimensional subdivision hierarchies
465 465 466 466 467 468 469 469 471 471 473 474 475 480 481 482 482 483 483
*This research supported by the NSF under Grant CCR9625289, and by ARC under grant DAAH049610013. Author's homepage: h t t p : //www. c s . j h u . e d u / g o o d r i c h / . ^This research supported by the NSF under Grant CCR9300079, and by ARC under grant DAAH049610013. Author's homepage: h t t p : //www. c s . j h u . e d u / g r a d / k u m a r / . HANDBOOK OF COMPUTATIONAL GEOMETRY Edited by J.R. Sack and J. Urrutia © 1999 Elsevier Science B.V. All rights reserved
463
464
M T. Goodrich and K. Ramaiyer
6. Rectilinear data structures 6.1. kD trees and quadtrees 6.2. Segment trees 6.3. Range trees 7. General techniques 7.1. Fractional cascading 7.2. Persistence 7.3. Static to dynamic conversions 7.4. Internalmemory to externalmemory conversions References
484 484 485 485 485 486 486 486 487 487
Geometric data structures
465
1. Introduction Computational geometry problems often require preprocessing geometric objects into a simple and spaceefficient structure so that the operations on the geometric objects can be performed repeatedly in an efficient manner. We refer to this as the "geometric data structuring" approach. This approach has been widely used by several researchers to design very elegant data structures to solve a number of geometry problems [15,22,26,32,36,4345,56,63]. Classic data structures hke lists, trees, and graphs are by themselves not sufficient to represent geometric objects as either they are generally one dimensional in nature or do not capture the rich structural properties of the geometric objects in the domain. For example, in a planar subdivision the clockwise and counterclockwise orderings of edges around a vertex are often useful for solving many problems involving subdivisions (e.g, see Guibas and Stolfi [41]). Similarly, facial ordering and connectivity information of subdivisions is often needed and requires special representation. If one is given a collection of horizontal segments in M^, for example, one may like to represent the endpoints, and also some representation of the "aboveness" partial order (e.g., see Edesbrunner [34]). Higher dimensional geometric objects define even richer relationships and likewise cannot be easily represented by the classical data structures, and require careful study. Even with this short list of examples one can see that geometric data requires the representation of relationships that cannot be represented using strictly numeric or combinatoric data structures. Indeed, it is the interplay of numeric and combinatoric data that makes the design of efficient geometric data structures an interesting and challenging research domain.
1.1. Problem classification and goals Data structuring problems involving geometric objects vary and are often classified as follows: Static: In this case all the geometric objects in the problem domain are given as part of the input. Online: In this case new geometric objects are allowed to be added to the problem domain, but cannot be deleted. Dynamic: In this most general case new geometric objects are allowed to be added and some existing objects are allowed to be deleted from the problem domain. In addition, data structures used for storing geometric objects should ideally achieve all of the following goals: • • • • •
capture structural information, allow for efficient query processing, allow for efficient updates, optimize the space required, and store objects efficiently so as to minimize the number of I/O accesses, when the input size is very large.
466
M. T. Goodrich and K. Ramaiyer
1.2. Chapter outline In this chapter we review and highUght research on geometric data structures, describing important examples for each of the above problem classifications. In each case we review we sketch how well it achieves the basic goals of geometric data structure design. In the next section, we describe methods for representing embedded straight line graphs, which arise in a number of computational geometry contexts, including the construction and maintenance of fundamental geometric structures, including convex hulls, Voronoi diagrams, Delaunay triangulations, and arrangements. In Section 3, we review several methods for performing an important search operation in such subdivisions — the point location search, and we give a short review of dynamic methods for solving this problem in Section 4. In Section 5, we discuss some methods for representing convexity, and, in Section 6, we describe some data structures for representing data that is rectilinear (i.e., aligned with the coordinate axes). Finally, in Section 7, we discuss some general techniques for designing geometric data structures. Since geometric data structures are fundamental in the design and implementation of geometric computations, there are necessarily a number of interesting geometric data structures that we will not be discussing in this chapter. Fortunately, many of these are covered in other chapters of this Handbook [60]. In particular, a number of spatial and rectilinear structures for higherdimensional spaces are discussed in Chapter 17. In addition, general techniques for designing randomized geometric data structures are covered in Chapters 13 and 16. Data structures for shortest paths and ray shooting are discussed in Chapters 15 and 12. In addition, the important and related visibility graph structure is discussed in Chapter 22. Other visibility related questions are covered in Chapter 19. An interesting variation of the data structuring problem is covered in Chapters 15 and 20, where one is allowed to answer queries approximately. There are also a host of interesting data structures that are based upon ^nets and spanning trees with low stabbing numbers, which are topics covered in Chapters 1, 2, and 13. Finally, fundamental to the issue of geometric representations is the issue of numeric stability, which is covered in Chapter 14. We highlight in the following sections various geometric data structures and we also discern some of the general principles behind data structure design for geometric structures.
2. Embedded planar graphs A graph G = (V, £") is said to be embedded in a surface S when it is drawn on S so that no two edges intersect. A graph i^ planar if it can be embedded in the plane; di plane graph has already been embedded in the plane [42], in which case it makes sense to define the set F of faces of G. A planar graph can always be embedded in the plane so that all its edges are straightline segments [37] and such an embedded graph is called planar straight line graph (PSLG). The planar graphs play an important role in many twodimensional computational geometry problems, for an embedded planar graph represents a planar subdivision, which is a structure that arises in several useful applications, including include arrangements of lines, Voronoi diagrams, Delaunay triangulations, and general triangulations.
Geometric data
structures
467
A measure of the usefulness of an embedded graph representation is that such a representation should allow for efficient traversal of edges around a vertex (in clockwise and counterclockwise directions), and it should allow for the efficient access of all edges bounding a face and all the faces incident on a vertex. In addition, it is very important for such a representation to preserve the topology of the embedding of the planar graph, as a given planar graph may have several embeddings. Once the embedding of a planar graph is given in the form of a planar straight line graph, one of the simplest representation is to represent the graph as a collection of simple polygons. This representation is not flexible enough for traversal, however. Representations for embedded planar graphs that do allow for efficient traversals include the doubly connected edge list or DCEL [57], the wingededge structure [3], and the quadedge structure [41]. Let us therefore review each of these representations.
2.1. The Doubly Connected Edge List (DCEL) Muller and Preparata [50,57] designed a PSLG representation, which they called the doublyconnected edge hst (or DCEL). The DCEL for a PSLG G = (V, E, F) has a collection of edge nodes. This representation treats each edge as a directed edge; hence, it imposes an orientation on each edge. Each edge node e = (va, vt) is a structure consisting of six fields: • Vo, representing the origin vertex (u^), • Vj, representing the destination vertex {vh), • Fu representing the left face as we traverse on e from VQ to Vj, • Fr, representing the right face as we traverse on e from Vo to Vj, • CCWo, representing the counterclockwise successor of e around Vo, and • CCWd, representing the counterclockwise successor of e around V^. The Figure 1 shows the DCEL representation of the edge e\ in the subdivision given. From the DCEL representation in linear time one can easily extract the edges around faces (in clockwiseorder) and the edges around a vertex (in counterclockwise order). To
Vo Vd
Fi
F,
^1
n
^2
fl
fl
^2
^3
^1
fl
/o
^3
V4
^2
h
/o
CCWoCCWd ^2
Fig. 1. A DCEL representation of an embedded planar graph.
^3
468
M.T. Goodrich and K. Ramaiyer
get the other ordering information efficiently, however, one needs to dupHcate the edges of the PSLG with opposite orientations from their original orientations and store a DCEL for this orientation as well. Once edges are duplicated and oriented in the opposite direction, one can access the edges bounding a face in counterclockwise direction and edges around a vertex in clockwise direction in linear time. The total size of the DCEL representation is 0{\V\^\F\ + \E\).
2.2. The wingededge representation The wingededge representation was proposed by Baumgart [3] and is similar to the DCEL. Given a PSLG G = (V, E, F), the wingededge representation stores an array for the vertices. This array stores for each vertex an arbitrary edge incident on that vertex. The wingededge representation also stores an array for faces, which stores for each face an arbitrary edge bounding that face. For each edge e = (va, Vb) it stores the following information: • Vo, representing the origin vertex (Va), • Vj, representing the destination vertex (vt,), • F/, representing the left face as seen from Vo to Vd, • Fr, representing the right face as seen from Vo to Vd, • CWo, representing the clockwise successor of e around Vo, • CCWo, representing the counterclockwise successor of e around Vo, • CWd, representing the clockwise successor of e around Vd, and • CCWd, representing the counterclockwise successor of e around Vd. Thus four successor edges are stored for each edge. This allows one to do all the accesses we outUned earlier as efficiently as in a (doubleorientation) DCEL. Figure 2 shows the wingededge representation for a PSLG. The total storage needed for the wingededge is 0 (  y I +  F  + l^l), but the constant factor is sUghtly better than for a doubleorientation DCEL.
VQ Vd F F, CCWpCCWd CWQ CW^ ^1
V2
/2
/l
V3
V\
/2
/o
V4
V2
/l
/o
•
•
•
.
^2
^3
•
€4
^5
•
•
Fig. 2. A wingededge representation of an embedded planar graph.
Geometric data
structures
469
Fig. 3. A quadedge representation of an embedded planar graph. The graph and the representation are shown. The thick edges are the edges of the graph and the graydotted edges are the edges of the dual graph.
2.3. The quadedge representation Guibas and Stolfi [41] proposed the quadedge representation for the embedded planar graphs. Their structure is isomorphic to the wingededge structure, but it is given semantics general enough to represent an undirected graph embedded in an arbitrary twodimensional manifold. Their structure also simultaneously represents the graphtheoretic primal and the dual of a planar graph. Figure 3 shows an example representation. The total space required for the quadedge structure is 0 (  y  f \F\ + l^"!), with the constants being essentially the same is for the wingededge representation.
2.4. Well known PSLGs As a motivation for the use of these subdivision representation, let us briefly review some of the wellknown geometric structures that are special cases of PSLGs. These structures are treated in greater detail in other chapters of this Handbook. Line arrangements. Given a set of lines in the plane, the intersection of lines form a structure that is referred to as the arrangement. This structure is a planar subdivision. This is a very useful structure and has number of applications. Since any two nonparallel lines intersect, if the given set of n lines does not contain any pair of parallel lines, then the number of intersections is 0(n^) and hence the size of arrangement is 0(n^). There are algorithms for computing the arrangement of lines in 0(n^) time, which is of course optimal. Figure 4 shows an example arrangement of lines. The arrangement is a PSLG and can be represented using one of the data structures discussed in the previous section.
470
M. T. Goodrich and K. Ramaiyer
Fig. 4. Arrangements of lines in a plane.
Fig. 5. The Voronoi diagram and Delaunay triangulation of a point set. The thick edges represent the triangulation and the thin edges represent the Voronoi diagram.
Voronoi diagrams and Delaunay triangulations. Given a collection of points and a metric, say L2, one can define a geometric structure called the Voronoi diagram. This is a very useful geometric structure for answering number of useful questions one can ask about a collection of points, including closest pairs and nearest neighbors. The Voronoi diagram for a set of points is a PSLG. Each face in the graph contains an unique point from the given set. Each face is a locus of points in the plane which are closer to the point inside it, than to any other point in the given set. A related structure, the Delaunay triangulation, is the graphtheoretic planar dual of the Voronoi diagram in which the faces and vertices are interchanged while preserving the incidence relationships (which forms a triangulation if the original points are in general position). Figure 5 shows a Voronoi diagram. Both the Delaunay triangulation and the Voronoi diagram have a wide variety of uses; and they are PSLG's. We can therefore use
Geometric data structures
All
one of the above representations (DCEL, quadedge, or wingededge) to store Voronoi diagrams and Delaunay triangulations. Interestingly, the quadedge representation has the added advantage of being able to simultaneously represent both the Voronoi diagram and the Delaunay triangulation of a point set using a single representation. In the next section we study how to perform searches like point location or ray shooting in PSLG structures such as arrangements and Voronoi diagrams.
3. Planar point location and ray shooting The planar point location problem is one of the fundamental computational geometry problems and has several applications. This problem has been studied by several researchers [22,31,32,36,44,45,56,63], and there are a number of efficient solutions. The problem in its widely studied form is stated as follows: Given a planar subdivision in the form of a PSLG (using one of the representations discussed in the previous section), preprocess the subdivision and store it in a data structure so as to answer queries of the form "given a query point p find the face of the subdivision containing p'\ This query is typically answered by performing a vertical ray shooting query from /?, where one determines the first segment(s) in the PSLG hit by vertical rays emanating out of p. The important criteria for judging solutions to the point location problem are the space occupied by the data structure and the query time it allows. The preprocessing time is also an important criterion, but is generally not considered as critical as the others, since it amounts to a onetime cost. Variations of the problem as stated above include methods for special types of subdivision i.e., introducing constraints on the shapes of the faces of the subdivision and the connectivity of the underlying planar graph. Different subdivisions that have been studied over the years include general subdivisions (which may not even be connected), connected subdivisions, monotone and convex subdivisions (where each face is respectively a monotone polygon or convex polygon), and rectilinear subdivisions (where only horizontal and vertical edges are used). We outline below the various data structures used for solving the point location problem.
3.1. The slab method The "slab" method proposed by Dobkin and Lipton [31] is historically the first nontrivial method to solve the point location problem, and it is suitable for the most general types of subdivisions. The idea is very simple. Since general subdivisions can be of an arbitrary nature, their basic idea is to partition the subdivision into a collection of vertical slabs so that each slab contains only triangles and trapezoids. The partition is done as follows: one draws vertical lines through each of the vertices of the subdivision. This partitions the subdivision into 0(n) slabs. The slabs have the property
472
M.T. Goodrich andK.
Ramaiyer
Fig. 6. The slab method: Partitioning the subdivision into vertical slabs consisting of trapezoids.
that none of the edges inside the slab cross each other and the edges either cross the vertical boundaries of the slab or two or more edges meet at a vertex through which the vertical boundary Hne of the slab passes through. Thus, each slab contains a collection of triangles and trapezoids with vertical boundaries. Dobkin and Lipton store this collection of slabs in a data structure to perform point location as follows: the slabs are totally ordered lefttoright by the JCcoordinates of the vertices and hence can be stored using any balanced binary search tree structure. Call this search tree A. The edges within each slab are totally ordered by the "above" relationship, i.e., given a point and the supporting Hne of an edge inside the slab, one can find out whether the point is above or below the edge. ^ This total order relationship (in each slab) can also be stored using a balanced binary search tree. Let us call the collection of search trees for all the slabs as B. The point location is done as follows: given a query point /? = (XQ, yo), we first use the xcoordinate of p, i.e., JCQ to identify the slab in which the point lies by doing a binary search in A. Once the slab is identified, the corresponding binary tree in B storing the trapezoids within the slab is searched by performing "aboveness" comparisons. Summary: Space: Since 0{n) binary search trees (each of size 0(«)) need to be stored in B, the total space requirement is 0(«^). Query Time: To locate a point we need to perform two binary searches, and hence the query time complexity is O(logn). This is the unittime operation that is used in the complexity measure. This operation can be implemented either by checking the point against the equation of the supporting hne or by checking whether the vertices of the edge e = {v\, V2) and the query point v^, make a "left turn" or "right turn" in the order f 1, 1*2, and 1^3.
Geometric data
structures
Al?>
3.2. The trapezoid method The slab method was improved by Preparata [56] to achieve an 0(log n) query time method with only 0(n logn) space. His method is commonly referred to as the trapezoid method, and is in principle the same as slab method as it also partitions the subdivisions into simple trapezoids. But rather than drawing 0(n) vertical lines, a recursive structure is built. The method for constructing a point location data structure using the trapezoid method is as follows. One inductively assumes one is given a trapezoid r with vertical sides containing the subdivision (initially we can use a bounding rectangle). Identify in r the "spanning" edges i.e., the edges which intersect both the vertical boundaries of r. If there are no spanning edges, then partition r again vertically at the median vertex and recurse on each side. If there are spanning edges, then partition the slab into a number of trapezoids using the spanning edges, i.e., each trapezoid has a spanning edge as its top and bottom boundaries and the vertical boundaries of the slab as its two side boundaries. Then order these trapezoids by the "above" relationship discussed in the previous section and recursively partition each such nontrivial trapezoid. Thus, one recursively partitions the subdivision, first vertically and then using the spanning edges. The vertical cuts are global and can be organized using a single binary search tree. The trapezoids within a container trapezoid r are organized using a biased search tree [4] which has the property that the depth of an item / with weight wi is 0(log W/wi), where W is the sum of the weights of all the items in the tree. Each trapezoid is assigned a weight proportional to the number of vertices within the trapezoid. Hence the resulting structure storing the subdivision is a compound structure in which the primary tree is a balanced binary search tree organizing the vertical cuts and the secondary structure is a
'
1
I
I
I
1 1 1 1
'
1
I
I
I
I I
1 1
till >
1
1
> 1
i ,
I 1 1 1 i 1 1 / , . . . , , . _
1
1
1
1 1 1
Fig. 7. Trapezoid method: The vertical cuts are shown in the tree as triangular nodes and the spanning cuts are shown as circular nodes.
474
M. T. Goodrich and K. Ramaiyer
biased search tree storing the trapezoids. The Figure 7 shows an example subdivision and the resulting data structure. The worstcase depth of a leaf node u in this compound structure is calculated as follows: the depth in the primary structure is O(logn), since vertical cuts are always at median Xcoordinates. Suppose the depths in the different levels of secondary structures from the leaf u (weight of w = Wo = 1) to the root are 0(log Wi/Wo),0(log W2/W1),..., 0(log W/Wjt). These values form a telescoping sum that reduces to 0(log W). But the total weight W at the root is 0{n \ogn)\ hence, the worstcase depth of a leaf node in the compound structure is O(logn). Summary: Space: 0{n\ogn) as there are O(logn) levels and in each level, structures of total size 0(M) are stored. Query Time: To locate a point we need to perform alternate binary searches in the primary tree and the second tree. As argued above this is bounded by O(logn).
3.3. The chain method Lee and Preparata [45] introduced an alternative approach. Unlike the slab method and the trapezoid method, which partition the subdivision into trapezoids, their method partitions the subdivision into regions separated by "chains". A chain is a sequence of edges that either forms a cycle or a path such that the end vertices belong to the boundary of the unbounded region. This way the chain, whether it is a cycle or a path, partitions the subdivision into two parts. The method then is to first find a ^'median" chain so as to partition the subdivision into roughly two equal parts. Then recursively one finds chains in each of the subdivision to construct a "balanced tree" of chains. The point location method then proceeds by discriminating the point against the chain at the root to find the partition containing the point and then recurses at the appropriate child in the tree. The important work involved in searching such a data structure is therefore the discrimination of a point against a chain. It is easy to see that discrimination of a point against a general chain is as difficult as point location in a simple polygon and hence is not really any simpler. So Lee and Preparata restricted each chain to be monotone, thus restricting their method to monotone subdivisions (which really is not a big restriction, since we can convert a general subdivision to a monotone subdivision by a vertical decomposition construction). For any monotone chain there exists a straight line such that the line orthogonal to the line intersects the chain at most once, and this property can be exploited for point location. The Figure 8 shows the partition of a subdivision into monotone chains. The edges are shared by different chains, but the data structure stores only one copy of each edge. Lee and Preparata's point location data structure is a compound data structure that has as its primary data structure a binary tree with a separating chain associated with each vertex and the secondary data structure storing the description of each chain. The primary and secondary data structure are both balanced binary search trees, actually. During a point
Geometric data structures
475
Fig. 8. Chain method: Partition of the subdivision into monotone chains (with respect to jaxis).
location discrimination of a point versus a monotone chain is done using the description of the chain in the secondary data structure. The discrimination of point versus monotone chain (say with respect to vertical line) is done in the obvious way. The projection of ycoordinates of the vertices of the chain on the vertical line partition the line into intervals which enables a binary search and the query point is located within one of the intervals (so that the point can then be compared with the straight line supporting the edge corresponding to the interval to find out which side of the chain the point lies in). Thus, each chain discrimination can be done in O(logn) time. Summary: Space: Each edge belongs potentially to more than one chain. But by storing each edge to the highest chain in the primary data structure to which the edge belongs, the space required for the data structure can be made to be 0(f2). Query Time: The discrimination of a point with respect to a monotone chain takes O(logfz), and the depth of the primary data structure is O(logn). Thus, point location takes 0(log^ n) time using the chain method.
3.4. Improving the chain method via fractional cascading Edelsbrunner, Guibas, and Stolfi [36] propose an improvement to the chain method using a technique called fractional cascading. This technique is applicable in any general situation where there are repeated similar searches along the nodes of a path in a directed graph in which the degree of each node is bounded by constant and the set of items searched in each node are drawn from the same universe. Under these conditions one can do better than performing several independent binary searches. The list stored in each node of the graph is augmented with extra elements from the lists in the successors so as to correlate the searches in a node and its successors. We now describe the fractional cascading technique and show how to improve the chain method. In chain method, a sequence (0(logn)) of pointversusmonotone chain discriminations are performed. In each such discrimination, a search is performed using the same query point, but against different chains. Moreover, the set of _ycoordinates of the vertices of the edges against with the comparison is made is a fixed set i.e., the ycoordinates of
476
M. T. Goodrich and K. Ramaiyer
the vertices of the subdivision. Hence the conditions are favorable to apply the fractional cascading technique. In order to be concrete let us therefore review in detail how the fractional cascading technique can be applied in this case. Consider a node u in the primary structure with children i; and w. Let Cu,Cv, and Cw be the chain lists in the nodes w, v, and w respectively before augmentation. The problem is to compute appropriate augmented lists Tu,Ty, and Ty^ Stored in the nodes w, i>, and w respectively. We perform this augmentation bottom up. Assume Ty and T^j are already constructed. For an appropriate constant d {d = 4 works, for example), we select every dth element from Ty and Tyj, respectively, and copy the elements to the list Cu to form the augmented list Tu. These copied elements are referred to as bridge elements in Tu. Moreover each element / in Tu stores additional pointers as follows: Left Bridge (Pi): Pointer to the closest bridge element (not to the left of /) copied from left child. Right Bridge (Pr)' Pointer to the closest bridge element (not to the left of /) copied from right child. Proper (Pp): Pointer to the closest element from Cu not to the left of /. Predecessor: Pointer to the predecessor element in Tu. Bridge (P/?): Pointer to the corresponding element in Ty or Tuj (only for elements copied into Cu). The distance between two bridge elements in Tu is at most d. To perform the search, we first do a binary search using the the given query point in the list stored in the root to identify which child to search. Suppose we need to search the left child. We then follow the Left Bridge pointer of the successor element of the query point in the T list of root. From the Left Bridge we follow the Bridge pointer to the T list of the left child. We then use the Predecessor pointers to find the two elements in the T list of left child which encompass the given query point. We select the successor and then use the Proper pointer to identify the element in the C list so as to perform comparisons for branching to next level. The Figure 9 shows an example where the list at a parent node is augmented with elements from the lists in two children. Every fourth element is copied from the child to the parent. For sake of exposition, we use lists of integers. The total number of pointers traversed for crossing one level is J + 3 pointers i.e., one Left Branch pointer, one Bridge pointer, at most d Predecessor pointers, and one Proper pointer. Initial search takes O(logw) time and the subsequence searches together take 0(d\ogn) time. If d is chosen as constant, then the total search time is O(logn). Summary: Space: Edelsbrunner, Guibas, and Stolfi [36] show the total space requirement is 0(n) for an appropriate constant value of d. Query Time: O(logn), as argued above. The preprocessing time is 0(n logn).
Geometric data
3 7 10 12 13 17 25 33 34 35
structures
All
W \ 1 2 5 9 15 18 19 22 28 30 31
Fig. 9. Fractional cascading: Augmentation of list in a parent node with elements from the lists in two children. The left bridge and right bridge pointers for element 20 are shown. Similarly the proper pointer for element 9 is shown. Also the bridge pointers are shown.
Subdivision hierarchies. Historically, the method of Edelsbrunner, Guibas, and Stolfi is not the first to simultaneously achieve O(^) space and an O(logn) query time. Kirkpatrick [44] discovered earlier an elegant method, based upon a technique we call the subdivision hierarchy method, for performing point location. This method is also applicable for searching in higherdimensional structures and is even amenable to parallelization [2325]. The method requires that the subdivision is triangulated and also that the outer face is a triangle. The triangulation, however, can be done in linear time using Chazelle's method [14] if the original subdivision is connected. The method then proceeds as follows: 1. Identify a maximal independent set in the PSLG representing the subdivision using a greedy heuristic with the condition that the degree of vertices in the independent set is bounded by a constant c. Also the independent set should not include any vertices of the outer face. 2. Remove the vertices of the independent set and the edges attached to them. Retriangulate each of the star polygons which contain the vertices of the independent set. 3. Repeat the process until only the outer face remains. The Figure 10 shows the process of removal of independent set of vertices and retriangulation for an example subdivision. Now the point location data structure is constructed as follows: We have a layered directed acyclic graph in which one layer represents an intermediate triangulation of the subdivision in the above recursive process. We assign one node of the dag to each triangle. After removing the independent set and retriangulating, some of the triangles are destroyed and new triangles are introduced inside each star polygon. We introduce a node for each new triangle and introduce pointers from the node representing the new triangle to all the nodes representing the triangles which are destroyed within the star polygon. In the limiting case we have one node representing the outer face and three nodes representing the
478
M. T. Goodrich and K. Ramaiyer
Fig. 10. A subdivision hierarchy: The figure shows removal of independent set and retriangulation. The independent set vertices selected at a step are shown as hollow circles.
Fig. 11. A subdivision hierarchy: Organizing triangles in a dag for searching. The last three levels of a hierarchy are shown.
three triangles destroyed in the previous step. The resulting data structure thus is a layered dag as shown in the Figure 11. Kirkpatrick shows that in the layered dag: • The degree of each node is constant, and • A fraction of the vertices are removed at each step. Hence the total depth of the dag is O(log^i). This follows from a theorem in graph theory which states that there are "large" independent sets of constant degree vertices in a planar graph, which allows one to find maximal independent sets of size which is a fraction of the current number of vertices. The point location algorithm proceeds by first locating the point inside the outer triangle.
Geometric data structures
479
At any step in the search algorithm one has located the query point in a triangle t on some level in the dag. One then follows the pointers in the dag to search all the triangles in the next level that were destroyed to form t. The query point can be located within the unique triangle from among these candidates in 0(1) time, and this defines the invariant for the next level. Since there are only O(logn) levels in the dag, the point location takes O(logn) time. Summary: Space: The space occupied by the dag is O(^). Query Time : O(logn) as argued above. The preprocessing time is 0{n) given the triangulated subdivision, as it takes only constant time to retriangulate each star polygon. Indeed, using Chazelle's triangulation method [14], the preprocessing for Kirkpatrick's method can be implemented in linear time any time the original subdivision is connected. The sweep method and persistence. There is actually one more wellknown method for achieving 0(log^)time queries and 0(n) space for planar point location. In particular, Samak and Tarjan [63] use the idea of persistence to build such a spaceefficient point location data structure. Intuitively, they combine the techniques of the slab method, plane sweeping, and persistence to build a very elegant point location data structure. A similar method was also discovered by Cole [22]. A persistent data structure allows one to perform updates and queries. Updates must be performed on the most recent version of the data structure (in ^ocdi)lt&partial persistence), but the queries can be done on past versions, i.e., any previous version of the data structure that was modified by updates. Samak and Tarjan [63] modified the slab method as follows: given a subdivision construct slabs by dropping vertical lines through each of the vertices. Now perform a plane sweeping from the left most slab to the right most. The event points for the sweep are the vertices of the subdivision. A search structure is built for the edges within each slab which is maintained during the sweep. The structure changes at each event point with the insertion and deletion of edges. Samak and Tarjan [63] interpreted these changes at the event points as persistent updates. As a result they maintain a single persistent structure during the sweep which is updated at every event point. This persistent stmcture need be only partially persistent as updates occur only on the latest version during the sweep. The point location query is then performed as follows: using the Xcoordinate of the query point the appropriate version of the persistent structure (slab) is identified for searching. Then a persistent search is performed on the corresponding "past" version to identify the face. By implementing the sweep using a partiallypersistent redblack tree, Samak and Tarjan show how to construct an 0(n) space data stmcture that allows O(logn) time persistent searches and updates. Moreover, they show that each update adds only 0(1) amortizedspace to the data structure.
480
M T. Goodrich and K. Ramaiyer
Summary: Space: The space occupied by the persistent structure is 0(n), since there are 0{n) updates and each requires 0(1) amortized space. Query Time: O(logn), as mentioned above.
4. Dynamic point location An important variant of the point location problem is to allow for environments that request incremental updates to the subdivision. In this variant one studies how to best reflect the changes to the subdivision (e.g., deletion and insertion of edges or vertices) in the data structure storing the subdivision. The goal, of course, is to continue to efficiently support point location queries while also also performing updates in an efficient manner. In addition, the space required by the data structure should be kept as small as possible. In this section we review some dynamic data structures used for performing dynamic planar point location, where edges are allowed to be inserted or deleted from a subdivision. The goal here is to efficiently maintain the data structure under the update operations and allow for fast point location queries. The basic problems in performing updates are the following: 1. Propagation of new information or modification of old information efficiently. Suppose one is deleting an edge. If the edge is represented in several nodes of the data structure, then one needs to remove that information from all the nodes. For example in the slab method, if an edge spans multiple slabs, then one needs to remove that information from each of the binary trees storing that edge. A reverse problem occurs when such a long edge is inserted into the subdivision. 2. Restructuring of the data structure to maintain the invariants assumed by the algorithm. For example in the trapezoid method, we have the invariant that each node represents a trapezoid and adjacent nodes are separated by a "spanning edge". Suppose a spanning edge is deleted. Then the two adjacent trapezoids (which are represented as two different nodes) must now be collapsed into a single trapezoid and represented by a single node. Similarly if a new spanning edge is inserted, then the corresponding node must be split into two different nodes. 3. Dynamization of the techniques (fractional cascading, persistence, etc.) used to achieve good space bounds. Preparata and Tamassia [59] present a method for dynamic point location in a convex subdivision. They construct the data structure by dynamizing the structure used in the static trapezoid method. They put a restriction that the vertices lie on a fixed set of A^ horizontal lines, however. The data structure in this case uses space O(NlogN). Still, they achieve an impressive time of 0(logn + log A^) for queries and an update time of 0(\ognlogN). The data structure consists of a primary component that is any balanced binary search tree and the secondary component that is a biased binary search trees [4]. Preparata and Tamassia [58] also dynamized the chainmethod for performing point location on a monotone subdivision. They construct a data structure that allows for insertion and deletion of vertices, insertion and deletion of monotone chain of edges, and
Geometric data structures
481
point location queries. The update operation is required to leave the subdivision monotone. They achieve an 0(\o^ n) query time, O(logn) time for inserting or deleting a vertex, and 0(log^ n \k) time for inserting or deleting a monotone chain of k edges. The space requirement is 0(n). Chiang and Tamassia [21] later improved the above results for dynamic point location in a monotone subdivision. They further dynamized the trapezoid method to achieve 0(log«) time for queries and 0(log^ n) time for updates. The space required for the data structure is 0{n logn). Their data structure is a compound structure with the primary component being a BB[Qf] tree [10,48,51] and the secondary component being biased binary search trees [4]. Mehlhorn and Naher [49] dynamize fractional cascading to support insertions and deletions in O(loglogn) amortized time and queries in Oilogn + /: log logn), where k is the length of the path traversed. Hence their dynamization adds a 0(log logn) overhead to the static method. Dietz and Raman [27] improve the update time from amortized to worstcase. Cheng and Janardan [18] present methods for dynamic point location for any connected subdivision. They have two schemes. In one scheme, they achieve an 0(log^ n) query time, O(logn) time for insertion and deletion of vertices, and 0{k\og{n + k)) and O(^logn) times for insertion and deletion, respectively, of an arbitrary ^edge chain inside a region. The space requirement is 0(n). In their other scheme they speedup the insertion and deletion of ^edge monotone chain to 0(log^n log logn + k), but increase the other bounds slightly. Their general approach is based on the a new search strategy using priority search trees [47] taken together with the technique of dynamization as proposed by Willard and Lueker [46,66] and Overmars [53]. The main idea of this technique is that rather than updating the data structure immediately with each update request they perform only local updates and spread the restructuring over a sequence of future operations. They perform global rebuilding of the entire data structure periodically so that the structure does not go out balance too much. They also make use of BB[Qf] trees. Goodrich and Tamassia [38] present a method for dynamic method for point location in monotone subdivisions. They improve the update times by paying a penalty on the query time. In particular, they achieve O(logn) time for insertion and deletion of vertices, 0(logn h k) for the insertion and deletion of a monotone chain of k edges, and 0(log^ n) time for queries. The space requirement is 0(n). Their data structure consists of two interlaced spanning trees, each of which is represented using linkcut trees [65]. In order to be concrete about one dynamic point location method, we briefly review their method. 4.1. The interlaced trees technique Let 5 be a PSLG that is connected and monotone (and will remain that way throughout the update process). Goodrich and Tamassia [38] first construct a spanning tree T for the triangulation with the property that its roottoleaf paths are monotone with respect to the }^axis. Then they construct a graphtheoretic dual of the triangulation such that it excludes the edges dual to the monotone spanning tree constructed above. This defines the spanning tree D for the dual graph of 5, and these two trees "interlace." Each node of D represents a triangle of S and each edge of D corresponds to a nontree edge of S, with respect to T (since edges dual to edges of T are ignored while constructing
482
M. T. Goodrich and K. Ramaiyer
D), and hence determines a unique cycle in S. Moreover this cycle partitions S into two regions, one inside the cycle and the other outside the cycle. This property allows one to perform searching the subdivision where we need to do pointversuscycle discrimination. The main idea behind point location is as follows: since each edge of D represents a cycle of 5, it partitions S into two regions. Given a query point, we can compare it against the edges of the cycle to determine whether it is inside or outside the cycle in 0(logn) time, since T is monotone. Depending on this test, we proceed to an appropriate edge of D, which is either inside or outside the cycle of 5, for further discrimination. To perform such a search efficiently, one needs to balance the tree D. The authors use the linkcut tree data structure [65] to be able to implement a recursive centroid search [13,40] in D to eliminate a constant fraction of the triangular faces with each cycle test. This allows one to perform searches in 0(log^ n) time since the depth of the centroid decomposition tree is O(logn) and in each step one needs to perform an O(logn) time pointversuschain discrimination. Summary: Space: The space occupied by the structure is 0{n) (again from fractional cascading method). Query Time: 0(log^ n), as mentioned above. Update Time : The authors show how to use linkcut tree primitives to implement updates in 0(log«) time.
5. Convex hulls and convex polytopes Convex hulls and convex polytopes are fundamental geometric data structures and have been well studied. In this section we discuss the data structure representations of convex hulls and polytopes and also how they are maintained dynamically when the points are inserted and deleted.
5.1. ddimensional representations Given a collection of points in Jdimension, where J is a fixed constant, there are algorithms (both randomized and deterministic) for computing the convex hull of the points in this collection. Alternately, some of the algorithms exploit the duality between a point and a hyperplane in d dimensions, and compute the intersection of a collection of halfspaces determined by the origin and a set of hyperplanes, which by this duality directly gives the information about the convex hull of the input set of (primal) points. A convex polytope is represented by the information about faces, edges, and vertices and the relationship between them. Each face of the convex polytope is a convex set. The (d — 1)dimensional faces of a Jdimensional polytope are called facets, its (d — 2) and lower dimensional faces are called subfacets, its onedimensional faces are edges, and
Geometric data structures
483
its zerodimensional faces are vertices. In a convex poly tope arises from a convex hull computation, then each vertex is a point in the input set. A Jdimensional convex polytope is represented generally using an incidence graph [35]. Dobkin and Laszlo [30] define such a representation for 3dimensional convex poly topes and Brisson [11] extends this to Jdimensional convex polytopes, for fixed J ^ 2. In addition to the above definitions, we refer to the {d — 2)dimensional face as a ridge. In the incidence graph, f o r — 1 ^ ^ < J — l , a ^face / and a (/: + l)face g are incident upon each other if / belongs to the boundary of ^. In this case, / is called a subface of g and g is called the super face of / .
5.2. 2dimensional dynamic maintenance Let us now consider the problem of maintaining a convex hull of points in the plane when the underlying point set changes. The online problem, where the points are only allowed to be inserted, is easier than the dynamic problem, where one allows deletion of points as well. In the online case the convex hull can only expand in area. If a new point is determined to fall inside the existing convex hull, then one does not need to do any additional work. But if the point falls outside, then one must compute the tangets from the new point to the current convex hull. These tangents are added to the convex hull and the chain of points on the convex hull between the two tangents are deleted. This can be done in amortized O(logn) time, where n is the number of points on the convex hull, as shown by Preparata [55]. When the deletion of points is allowed things get more complicated, since one needs