Download as pdf or txt
Download as pdf or txt
You are on page 1of 406

et-

COMPUTATIONAL
GEOMETRY

ELECT L'^l
OCI 2 4 1995

19951023 140
Stony Brook, New York
June 6-8, 1994

Sponsored by the AGM Special Interest Groups

for Graphics and Algorithms and Computation Theory

PRESS
rTT? TUTC rnPV FOR REPRnni:r.TTON PURPOSES
MfllTfft rnpv - form Approved
OMB NO 0704-01»»
REPORT DOCUMENTATION PAGE
- -■--i^--^r^rs^.^^^^?^li£:
C
•ffsvs^tsrfo ^'asyirsaaySiaus*.»«----' ~ »^3. T.: " -T „ . mm
«PORT TYPE AND DATES CUVIRIU
1. AGENCY USt ONLY ((.*"• Wan») 2. «»OUT OAT!
Jun 95 Final Q Mav 94 - « MPV 95
1
S. rUNOING NUMIIRS
4. TITLE AND SUSTITlf

Symposium on Computational Geometry


DAAH04-94-G-0225
* AUTHOR(S)

Joseph Mitchell
7 PERFORMING ORGANUAJiON
T PERFORMING ORGANISATION NAMEIS) AND ADO«»*»» REPORT NUMIER

State University of New York at. Stony Brook


Stony Brook, NY 11794-3600

10. SPONSORING MONITORING


t. SPONSORING/MONITORING AGENU NAME») AHO AU»«»»», AGENCY REPORT NUMSER

U.S. Army Research Office


ARO 33022.1-MA-CF

11. SUPPUMENTARY NO i is fWinES contained in this report are those of the


The views, opinions and/or fladtti J™'™ ff lcial Department of the Army
author(s) and should not be construed as *"°*"^by other documentation.
position, policy, or decision, unless so designated by ^
W DISTRIBUTION/AVAILASRJTY JTATtauwi

Approved for public release; distribution unlimited.

13. ABSTRACT (MSMimumiOOworM

This proceedings contains the 42 contributed papers which were selected from a total of
113 submitted extended abstracts. The program committee met in Arlington, Virginia, on
January 21-22 1994 The selection was based on the quality and originality of the results
and their relevance to computational geometry. The papers generally represent preliminary
reports of ongoing research and it is expected that most of them will eventually appear m
more polished form in refereed journals.

U. SUSJECT TERMS

1«. SECURITY CLASSIFICATION


17. SECURITY CLASSIFICATION It. SECURITY CLASSIFICATION
Of REPORT Of THIS RAGE OF *■*""«*£!„..«
UNCLASSIFIED UNCLASSIFIED
UNCLASSIFIED
StinOAfd form 29» (»« *•»*>
NSN ;S*0-01.2SO-S500
-8- itt-102
PROCEEDINGS OF THE TENTH ANNUAL SYMPOSIUM ON

COMPUTATIONAL
GEOMETRY

/\

<

Accesion For
NTIS CRA&I [5
\ / DTIC TAB □
Unannounced fj
\/ Justification

By _
Distribution/

Availability Codes
Avai! and/or
Dist Special
Stony Brook, New York
June 6-8, 1994
/w
Sponsored by the ACM Special Interest Groups

for Graphics and Algorithms and Computation Theory

acm
PR ESS
-!'0'r; lu j,
The Association for Computing Machinery
1515 Broadway
New York, N.Y. 10036

Copyright 0 1994 by the Association for Computing Machinery, Inc. Copying without fee
is permitted provided that the copies are not made or distributed for direct commercial
advantage,and credit to the source is given. Abstracting with credit is permitted. For other
copying of articles that carry a code at the bottom of the first page, copying is permitted
provided that the per-copy fee indicated in the code is paid through the Copyright Clearance
Center, 222 Rosewood Drive, Danvers, MA 01923. For permission to republish write to:
Director of Publications, Association for Computing Machinery. To copy otherwise or
republish, requires a fee and/or specific permission.

ACM ISBN: 089791-648-4

Additional copies may be ordered prepaid from:

ACM Order Department Phone: 1-800-342-6626


P.O. Box 12114 (U.S.A. and Canada)
Church Street Station 1-212-626-0500
New York, N.Y. 10257 (All other countries)
Fax: 1-212-944-1318
E-mail: acmpubs@acm.org

ACM Order Number: 429940

Printed in the U.S.A.


Foreword

This volume contains papers presented at the Tenth Annual Symposium on Computa-
tional Geometry, held June 6-8, 1994, in Stony Brook, New York. The Symposium was
sponsored by the Special Interest Groups for Graphics (SIGGRAPH) and for Algorithms
and Computation Theory (SIGACT) of the Association for Computing Machinery and was
partially funded with the generous support of the agencies shown below.
This proceedings contains the 42 contributed papers which were selected from a total of
113 submitted extended abstracts. The program committee met in Arlington, Virginia, on
January 21-22, 1994. The selection was based on the quality and originality of the results
and their relevance to computational geometry. The papers generally represent preliminary
reports of ongoing research and it is expected that most of them will eventually appear in
more polished form in refereed journals. The program committee wishes to thank all people
that helped us in refereeing the papers.
This year, for the second time, a video review of computational geometry was created.
Descriptions of the accepted videos appear in these proceedings. For more details see the
introduction on page 381.
The program committee wishes to thank all the authors who submitted abstracts in response
to the call for papers.

Program Committee Symposium Sponsored By

Tetsuo Asano ACM Special Interest Groups for


Steve Fortune Graphics (SIGGRAPH) and for
Pat Hanrahan Algorithms & Computation Theory (SIGACT)
Rolf Klein
Kurt Mehlhorn (Chair) U.S. Army Research Office
Ketan Mulmuley
Marco Pellegrini Army Center for the Mathematics of
Roberto Tamassia Nonlinear Systems at Stony Brook
Gert Vegter
Army Center of Excellence for Symbolic
Methods in Algorithmic Mathematics
(ACSyAM), Cornell University

Conference Chairs

Joseph S.B. Mitchell


Steven S. Skiena

iii
Tenth Annual Symposium on Computational Geometry

June 6-8, 1994


State University of New York
Stony Brook, NY

Table of Contents

SESSION 1: CHAIRED BY TETSUO ASANO

Vertical decompositions for Triangles in 3-Space


Marc de Berg, Leonidas J. Guibas, Dan Halperin 1

Almost Tight Upper Bounds for the Single Cell and Zone Problems in Three Dimensions
Dan Halperin, Micha Sharir 11

On Translational Motion Planning in 3-Space


Boris Aronov, Micha Sharir 21

Motion Planning amidst Fat Obstacles


A. Frank van der Stappen, Marc H. Overmars 31

Approximate Euclidean Shortest Path in 3-Space


Joonsoo Choi, Jürgen Seilen, Chee K. Yap 41

SESSION 2: CHAIRED BY KETAN MULMULEY

The Realization Problem for Euclidean Minimum Spanning Trees is NP-hard


Peter Eades, Sue Whitesides 49

Optimal Parallel Randomized Algorithms for the Voronoi Diagram of Line Segments in the Plane
and Related Problems
Sanguthevar Rajasekaran, Suneeta Ramaswami 57

Constructing Levels in Arrangements and Higher Order Voronoi Diagrams


Pankaj Agarwal, Jifi Matousek, M. de Berg, 0. Schwarzkopf 67

Computing Many Faces in Arrangements of Lines and Segments


Pankaj Agarwal, Jifi Matousek, Otfried Schwarzkopf 76

SESSION 3: CHAIRED BY PAT HANRAHAN

Matching Shapes with a Reference Point


Helmut Alt, Oswin Aichholzer, Günter Rote 85

Piecewise-Linear Interpolation between Polygonal Slices


Gill Barequet, Micha Sharir 93
Practical Methods for Approximate Geometric Pattern Matching under Rigid Motions
Joseph S. B. Mitchell, Michael T. Goodrich, Mark W. Orletzky 103

SESSION 4: CHAIRED BY PAT HANRAHAN


Spheres, Molecules, and Hidden Surface Removal
Dan Halperin, Marc H. Overmars 113

Determining the Castability of Simple Polyhedra


Prosenjit Bose, David Bremner, Marc van Kreveld 123

A Fast Algorithm for Constructing Sparse Euclidean Spanners


Gautam Das, Gin Narasimhan 132

SESSION 5: CHAIRED BY KURT MEHLHORN


Dynamic Maintenance of Maximas of 2-d Point Sets
Sanjiv Kapoor 140

Biased Finger Trees and Three-Dimensional Layers of Maxima


Mikhail J. Atallah, Michael T. Goodrich, Kumar Ramaiyer 150

An Algorithm for Approximate Closest-Point Queries


Kenneth L. Clarkson 160

New Techniques for Exact and Approximate Dynamic Closest-Point Problems


Sanjiv Kapoor, Michiel Smid 165

Competitive Searching in a Generalized Street


Amitava Datia, Christian Icking 175

SESSION 6: CHAIRED BY MARCO PELLEGRINI


A Tight Lower Bound for the Steiner Ratio in Minkowski Planes
Biao Gao, Ding-Zhu Du, Ronald L. Graham 183

Bounding the Number of Geometric Permutations Induced by fc-Traversals


Jacob E. Goodman, Richard Pollack, Rephael Wenger 192

Applications of the Crossing Number


Jdnos Pach, Farhad Shahrokhi, Mario Szegedy 198

Cutting Dense Point Sets in Half


Herbert Edelsbrunner, Pavel Valtr, Emo Welzl 203

SESSION 7: CHAIRED BY STEVEN FORTUNE


Fast Greedy Triangulation Algorithms
Matthew T. Dickerson, Robert L. S. Drysdale, Scott A. McElfresh, Emo Welzl 211
Linear-Size Nonobtuse Triangulation of Polygons
Marshall Bern, Scott Mitchell, Jim Ruppert 221

Bounds on the Size of Tetrahedralizations


Bernard Chazelle, Nadia Shouraboura 231

SESSION 8: CHAIRED BY STEVEN FORTUNE

An Optimal Bound for Quality Conforming Triangulations


Tiow-Seng Tan 240

On the Maximum Degree of Minimum Spanning Trees


Gabriel Robins, Jeffrey S. Salowe 250

Optimal Linear-Time Algorithm for the Shortest Illuminating Line Segment in a Polygon
Gautam Das, Giri Narasimhan 259

SESSION 9: CHAIRED BY GERD VEGTER

Morphing Simple Polygons


Leonidas J. Guibas, John Hershberger 267

A New Technique to Compute Polygonal Schema for 2-Manifolds with Application to


Null-Homotopy Detection
Tamal K. Dey 277

Triangulating Topological Spaces


Herbert Edelsbrunner, Nimish R. Shah 285

Almost Optimal Set Covers in Finite VC-Dimension


Herve Brönnimann, Michael T. Goodrich 293

An Efficient Algorithm for the Euclidean Two-Center Problem


Jerzy W. Jaromczyk, Miroslaw Kowaluk 303

SESSION 10: CHAIRED BY ROBERTO TAMASSIA

On Geometric Optimization with Few Violated Constraints


Jifi Matousek 312

Efficient Piecewise-Linear Function Approximation Using the Uniform Metric


Michael T. Goodrich 322

Applications of Weighted Voronoi Diagrams and Randomization to Variance-Based fc-Clustering


Mary Inaba, Hiroshi Imai, Naoki Katoh 332

Bounded Boxes, Hausdorff Distance, and a New Proof of an Interesting Helly Theorem
Nina Amenta 340
SESSION 11: CHAIRED BY ROLF KLEIN

Computing Envelopes in Four Dimensions with Applications


Pankaj K. Agarwal, Boris Aronov, Micha Sharir 348

Query-Sensitive Ray Shooting


Joseph S. B. Mitchell, David Mount, Subhash Sun 359

Efficient Algorithms for Generalized Intersection Searching on Non-Iso-Oriented Objects


Prosenjit Gupta, Ravi Janardan, Michiel Smid 369

VIDEO REVIEW

Introduction
Marc Brown, John Hershberger 381

An 0(n log n) Implementation of the Douglas-Peucker Algorithm for Line Simplification


John Hershberger, Jack Snoeyink 383

Computing the Rectangle Discrepancy


David P. Dobkin, Dimitrios Gunopulos 385

An Animation of a Fixed-Radius All-Nearest Neighbors Algorithm


Hans-Peter Lenhof, Michiel Smid 387

GASP-A System to Facilitate Animating Geometric Algorithms


Ay eilet Tal, David P. Dobkin 388

Penumbral Shadows
Adrian Mariano, Linus Upson 390

Collision Detection for Interactive Environments


Jonathan D. Cohen, Ming C. Lin, Dinesh Manocha, Madhav K. Ponamgi 391

Almost Optimal Polyhedral Separators


Herve Brönnimann 393

Interactive Visualization of Weighted Three-Dimensional Alpha Hulls


Amitabh Varshney, Frederick P. Brooks, Jr., William V. Wright 395

INDEX OF AUTHORS 397

Vlll
Vertical Decompositions for Triangles in 3-Space^
Mark de Berg* Leonidas J. Guibas* Dan Halperin§

Abstract boil down to the study of certain cells in such an ar-


rangement. A famous example is the motion planning
We prove that, for any constant e > 0, the complexity problem in robotics. Here the underlying arrangement
of the vertical decomposition of a set of n triangles in is the arrangement in configuration space of the con-
three-dimensional space is 0(n2+e + K), where K is the straint surfaces defined by the obstacles and the robot.
complexity of the arrangement of the triangles. For a Because of these numerous applications, much research
single cell the complexity of the vertical decomposition has been devoted to bounding the combinatorial com-
is shown to be 0(n2+£), These bounds are almost tight plexity of arrangements, and of certain important sub-
in the worst case. sets of arrangements such as zones and single cells.
We also give a deterministic output-sensitive algo- For most algorithmic uses, however, a raw arrange-
rithm for computing the vertical decomposition that ment is an unwieldy structure. The difficulty is that
runs in 0(n2 logn + V logn) time, where V is the com- cells in an arrangement can have very complex topolo-
plexity of the decomposition. The algorithm is reason- gies, so navigating around them is difficult. What we
ably simple (in particular, it tries to perform as much of often want is a further refinement of the cells into pieces,
the computation in two-dimensional spaces as possible) such as simplices, that are each homeomorphic to a ball
and thus is a good candidate for efficient implementa- and have constant description complexity. Ideally, the
tions. number of cells after the refinement should be propor-
tional to the overall complexity of the arrangement. For
arrangements of hyperplanes the well-known bottom
1 Introduction vertex triangulation [12] meets this criterion. For more
general arrangements such refined decompositions are
The study of arrangements plays a fundamental role in
more difficult to find. For example, for algebraic hyper-
geometric computing. An arrangement is the partition
surfaces of constant maximum degree in d-dimensional
of a Euclidean space into cells, as induced by a collection
space (d > 3) the best decomposition technique known
of possibly highly inter-penetrating objects. A surpris-
so far results in 0(n2d~3ß{n)) cells [8], where ß(n) is an
ing number of seemingly unrelated geometric problems
extremely slowly growing function,1 whereas the com-
*Mark de Berg was supported by the Dutch Organization for plexity of the arrangement itself is only 0(nd).
Scientific Research (N.W.O.), and by ESPRIT Basic Research Ac- In this paper we study decompositions for arrange-
tion No. 7141 (project ALCOM 11:Algorithms and Complexity).
Leonidas Guibas was supported by NSF grant CCR-9215219, by
ments of triangles in 3-dimensional space. The sim-
a grant from the Stanford SIMA Consortium, and by grants from plest way to decompose such an arrangement is to com-
the Digital Equipment, Mitsubishi, and Toshiba Corporations. pute the bottom vertex triangulation of the arrange-
Dan Halperin was supported by a Rothschild Postdoctoral Fellow- ment of the planes containing the triangles. The result-
ship, by a grant from the Stanford Integrated Manufacturing As-
sociation (SIMA), by NSF/ARPA Research Grant IRI-9306544,
ing decomposition has size 0(n3), which is optimal in
and by NSF Grant CCR-9215219. the worst case. In many applications, however, the ac-
t Department of Computer Science, Utrecht University, tual complexity of the arrangement of triangles is much
P.O.Box 80.089, 3508 TB Utrecht, the Netherlands. smaller. So the challenge is to obtain a decomposition
* Department of Computer Science, Stanford University, Stan-
whose size is sensitive to the complexity of the arrange-
ford, CA 94305.
5 Robotics Laboratory, Department of Computer Science, Stan- ment of the triangles.
ford University, Stanford, CA 94305. Such a complexity-sensitive decomposition was given
by Aronov and Sharir [2]: their Slicing Theorem states
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for that one can decompose an arrangement of n triangles
direct commercial advantage, the ACM copyright notice and the in 3-space into 0(n2a(n) + K) tetrahedra, where K is
title of the publication and its date appear, and notice is given J
that copying is by permission of the Association of Computing To be precise: ß{n) = 2a(") , where c is a constant depend-
Machinery. To copy otherwise, or to republish, requires a fee ing on the dimension and the degree of the surfaces. Here and
and/or specific permission. throughout the paper, a(n) is the extremely slowly growing func-
tional inverse of Ackermann's function.
10th Computational Geometry 94-6/94 Stony Brook, NY USA
© 1994 ACM 0-89791 -648-4/94/0006..$3.50
refined into a convex subdivision V3(T) where each cell
has constant complexity, without increasing the asymp-
totic complexity of the subdivision—see below for de-
tails. We call the refined subdivision the full vertical
decomposition2 for T.
In this paper we prove bounds on the maximum com-
binatorial complexity of vertical decompositions, which
are sensitive to the complexity of the arrangement of
Figure 1: The vertical wall for the fat edge in the Slicing the triangles. More precisely, we show that, for any
Theorem and in the vertical decomposition. constant e > 0, the complexity of the vertical decompo-
sition of a set T of n triangles in 3-space is 0(n2+e + K),
where K is the complexity of the arrangement A(T)
induced by T. Our proof uses an interesting combina-
the complexity of the arrangement. This result is close tion of efficient hierarchical cuttings [6, 21], the counting
to optimal: Q(K) is clearly a lower bound on any de- scheme used in hereditary segment trees [9], the Slicing
composition, and Chazelle [5] shows that there are ar- Theorem [2], and random sampling [13, 19]. Our proof
rangements of complexity 0(n) such that any decompo- can be adapted to show that the vertical decomposi-
sition into convex cells has size fi(n2). (The triangles in tion of a single cell in an arrangement of triangles has
Chazelle's example form the boundary of a simple poly- 0(n2+e) complexity. We also give an example of a set
tope.) The Slicing Theorem obtains a decomposition by T of triangles whose vertical decomposition has com-
adding vertical walls for each of the triangle boundary plexity 0(n2a2(n)), whereas the complexity of A(T) is
edges, one after the other. The wall of an edge e is ob- only Q(na(n)). This shows that our bound is close to
tained by "flooding" the zone of e in an arrangement on optimal.
the vertical plane H{e) containing e; this arrangement Secondly, we present a deterministic algorithm for
is defined by intersections of H(e) with the triangles and constructing V(T) which runs in time 0(n2 log n +
with already added walls. See Figure 1(a); the dashed Vlogn), where V is the complexity of V(T). The al-
segment in this figure is a previously added wall. Af- gorithm is reasonably simple (in particular, it tries to
ter adding the walls one is left with convex cells that perform as much of the computation in two-dimensional
can easily be decomposed into tetrahedra. The Slic- spaces as possible) and thus is a good candidate for ef-
ing Theorem decomposition has the unpleasant charac- ficient implementations. The algorithm is also inter-
teristic that it depends on the order in which triangle esting as it is a three-dimensional version of a Bentley-
boundary edges are treated. Thus the tetrahedra in the Ottmann style sweep and may be adaptable to compute
decomposition are not defined "locally", and it is not other partial or total information about the arrange-
canonical in the sense of Chazelle and Friedman [10]. ment. Our approach is related to a space sweep al-
This means that the decomposition cannot be used in gorithm that has recently been developed to compute
randomized incremental algorithms. It also makes it a decomposition of certain arrangements for motion
difficult to compute the decomposition efficiently. planning problems [17], and to the space sweep meth-
A decomposition which does not have this problem— ods used to construct point location data structures for
and one which we think is more intuitive—is the fol- monotone subdivisions [14, 25].
lowing [11, 22, 23]. This decomposition is also obtained
by erecting vertical walls. This time the wall for edge
e simply consists of those points in H(e) that can be 2 Preliminaries
connected to e with a vertical segment that does not
cross any of the triangles in T. See Figure 1(b). This Let T — {ii,..., tn} be a collection of n (possibly in-
gives us a first decomposition Vi (T). Secondly, walls are tersecting) triangles in B3. Let A(T) denote the ar-
erected from the intersection edges between pairs of tri- rangement induced by T, namely, the subdivision of 3-
angles to produce a finer decomposition V2(T). Observe space into cells of dimensions 0,1,2 and 3, induced by
that the wall erected from an edge is not obstructed by the triangles in T. We assume that the triangles in T
other walls, so the decomposition does not depend on are in general position. (For details, see, e.g., [2]). By
the order in which the edges are treated. We call this standard arguments (see, e.g., [26]) the combinatorial
decomposition the vertical decomposition for T and de- bound that we derive in Section 3 holds for degenerate
note it by V(T) = V2(T). Note that the cells in V2(T) arrangements as well. However, the algorithm described
need not be convex; in fact, they need not even be sim- 2
Mulmuley [23] calls Vs(T) the vertical decomposition, and he
ply connected. But the decomposition can easily be calls V2(X) the cylindrical decomposition.
in Section 4 will have to undergo several technical ad- lope of n segments in the plane is 0(na(n)) [18]. A
justments (which we do not discuss in this paper) to similar argument holds for the part of W(e, T) below e.
accommodate for degenerate arrangements. Hence, a single wall has complexity 0(na(n)). Since
The combinatorial complexity (or complexity in short) there are 3n triangle boundary edges we have
of an arrangement A is defined to be the overall num-
Observation 3.1 The total complexity of the walls
ber of cells of various dimensions in A; we denote the
W(e,T) for all boundary edges e of the triangles in T
complexity of A by |.4|.
is 0(n2a(n)).
Central to the concept of vertical decompositions is
the following notion of visibility: two points p, q £ H3 Notice that the total number of edges in E(T)—and
(vertically) see each other with respect to T if and only thus the total number of walls—is 0(n2). It follows
if the segment pq connecting them is vertical and the that the maximum complexity of V(T) is 0(n3a(n)),
interior of pq does not intersect any triangle in T. Usu- as was noted in [23]. However, it is not clear whether
ally the set T is clear from the context and we just say it is possible that all walls have Q(na(n)) complexity.
that that p and q see each other. This definition is ex- Indeed, below we show that this cannot happen when
tended to objects other than points as follows: two sets K is large. When K = 0(na(n)), however, most walls
P, Q C H3 see each other if and only if there are points can have large complexity.
p £ P, q £ Q that see each other.
We define two three-dimensional entities related to a Theorem 3.1 There exists a set Tofn triangles in 1R
3D curve 7. Let H(j) be the vertical surface that is with \A(T)\ = 6(na(n)) and |V(T)| = 6(n2a2(n)).
the union of all the vertical lines which contain a point
of 7. Let the vertical wall extended from the 3D curve Proof: Let 5' be a set of \n/2\ line segments
7, denoted W(j,T), be defined as follows: W(j,T) = in the 2/2-plane whose upper envelope has complexity
{p £ R3 : p sees 7}. In other words, W(j,T) is the 6(na(n)) [28], and such that 5' lies completely below
union of all vertical segments of maximal length that the plane z = 0. Now extend each segment in the in-
direction to obtain a set T' of infinitely long strips, that
have a point of 7 as an endpoint and whose interior
does not intersect any triangle in T. Note that some of is, let T' = {[-00 : 00] x s : s £ 5'}. (The construction
can easily be modified to use bounded triangles instead
these segments can be rays.
of infinitely long strips.) The upper envelope of T' con-
sists of 6(nc*(n)) lines that are parallel to the z-axis.
In the same way we can construct a set T" of fn/2]
3 The Combinatorial Bound strips whose lower envelope consists of Q(na(n)) lines
Let T = {ti,...,tn} be a set of triangles in M3, as that are parallel to the y-axis, and that lie completely
denned above. We investigate the maximum combina- above the plane z = 0. For the set T = T'DT" we have
torial complexity of V(T) = V2(T) as a function of n, \A(T)\ = 0(no(n)), and |V(T)| = Q(n2a2(n)). U
the number of triangles in T, and K, the complexity of Next, we will establish an upper bound on the complex-
A(T). Note that the complexity of V(T) is at least K. ity of the vertical decompositions of sets of triangles in
We denote by E{T) the set of segments in 3-space 3-space. We already know that the total complexity
which are either an edge of a triangle in T or the in- of the walls erected for the triangle boundary edges is
tersection of two triangles in T. We call the segments 0(n2a(n)) so now consider a wall erected from an inter-
in E(T) edges; when we discuss edges of triangles in section edge e. Let 5(e) be the set of segments which are
T we will explicitly say triangle boundary edges, and the intersections of the other triangles with the vertical
when we discuss intersections between triangles we will surface H(e).
say intersection edges. For an edge e £ E(T) we define As remarked before, the part of W(e,T) above e is
its vertical wall to be W(e, T). Let W(T) := {W(e, T) : bounded by the lower envelope of (the parts of) the
e £ E(T)} be the collection of all the vertical walls. The segments in 5(e) lying above e, and the part of W(e, T)
vertical decomposition for T is the subdivision induced below e is bounded by the upper envelope of (the parts
by the set TU W(T). of) the segments in 5(e) lying below e. The complexity
Let us first consider the complexity of a single wall of W(e, T) is therefore linear in the number of points of
W(e,T). Recall that H(e) is the vertical surface con- the following types:3
taining e. By definition, the part of W(e,T) which is
above e is bounded by the lower envelope of the seg- 1. endpoints of a segment / £ 5(e) which are con-
ments which are intersections of the other triangles in tained in e
T with H(e) and which lie above e. See also Figure 1(b). 3
If the wall has constant complexity this may not be true, but
It is well known that the complexity of the lower enve- the total complexity of all constant complexity walls is 0(n ).
2. endpoints of a segment I G S(e) which lie strictly Using this lemma we can prove an almost tight upper
above e and are vertically visible from e bound on b(n). A basic ingredient in the proof are effi-
cient hierarchical cuttings [6, 21], which we define next.
3. intersections between two segments l\,l2 G S(e)
Let H be a set of n hyperplanes in ¥ld. A (l/r)-cutting
which are vertically visible from e
for H is a subdivision of lRd into disjoint simplices such
The first type of feature is the intersection of the two that the interior of each simplex is intersected by at
triangles that define e and the triangle that defines /, most n/r hyperplanes in H. The size of a cutting is
that is, it is a vertex of A(T). Each vertex participates the number of simplices it consists of. We say that a
in a constant number of walls so the total number of cutting E' C-refines a cutting E if every simplex of E' is
type 1 features over all the walls is O(K). For type 2 completely contained in a single simplex of E and every
we note that the endpoint of I is the intersection of simplex of E contains at most C simplices of E'. Now let
a boundary edge e' of the triangle that defines / with C, p be constants and r a parameter with 1 < r < n. A
H(e). So there is a visibility between e and e', which sequence E = E0, E1;..., E/. of cuttings is called an effi-
implies that e defines a feature of W(e', T). Recall that cient hierarchical (l/r)-cutting (for H) if E0 is the single
the sum of the complexities of the walls erected from "simplex" IR**, every E; (1 < i < k) is a (l//9!')-cutting
triangle boundary edges is 0(n2a(n)). Hence, the total of size 0(pld) which C-refines E,-_i, and pk~1 < r < pk.
number of type 2 features is also 0(n2a(n)). In the Notice that the last condition implies that k — 6(logr).
remainder of this section we bound the total number of We call the simplex in E,-_i that contains a certain sim-
type 3 features. plex s G E; the parent of s, denoted by parent(s).

Lemma 3.2 b(n) = 0(n22a(nHogn).


The bipartite case
We first study the following "bipartite" version of the Proof: Project the triangles of 7\ and T2 vertically
problem. Let h be a fixed non-vertical plane, let T\ be onto the plane h. Construct an efficient hierarchical
a set of n triangles lying completely below h, and let (l/6n)-cutting S = E0, E1;..., Sfc for the 6n lines con-
T2 be a set of n triangles lying completely above h. We taining the projected triangle edges. For a simplex
want to bound the number of pairs t\ G E(T1),e2 G s G E,-, let Tf-(s) c T be the set of triangles in
E(T2) that can see each other. Let b(Ti,T2) denote this 7\ whose projection fully contains s but whose pro-
number, and let b(n) be the maximum value of b(Ti,T2) jection does not contain parent(s), and let T*(s) be
over all sets Tj and T2 of n triangles each, as defined the set of triangles whose projection intersects s but
above. Our example which proves Theorem 3.1 also does not contain it. Let Ti(s) := Tf(s) UT*(s). De-
shows that bin) = Q(n2a2(n)). We now establish upper fine Tf(s), Tf(s), and T2(s) analogously. Finally, let
bounds for b(n). Recall that we only need to consider T^(s) := Tf(s)VTf(s), T*(s) := T*(s) U T2X(S)
visibilities between intersection edges, as the remaining and T(s) := Ti(s) U T2(s). In the remainder we only
number of visibilities is 0(n2a(n)). work with "clipped" triangles, that is, for each triangle
t G T(s) we only consider the part that projects onto s.
We say that a planar curve 7 is convex if and only
if 7 is contained in the boundary of its convex hull. In
other words, any line intersects 7 at most twice. The Consider a visibility between intersection edges e\ G
following simple lemma is crucial in our upper bound E{TX) and e2 G E(T2). Let t(ei) and i'(ea) be the two
proof. triangles that define e1; that is, e\ = i(ei)n<'(e1). Simi-
larly, let e2 = £(e2)nt'(e2). We denote the projection of
Lemma 3.1 Let 7 be a convex curve in the plane h. e,- onto h by ej. The basic observation behind our proof
Then the number of visibilities between segments in is the fact that there must be a simplex s in some cutting
E{Ti) and 7 is 0(n2a(-n*>), for i = 1,2. E; such that ejnei" G s, t(ei), i'(ei), t(e2), t'{e2) G T(s),
and at least one of these triangles is in Tc(s). This im-
Proof: Recall that H(y) is the vertical surface con-
plies that we only have to count for each simplex s G S
taining 7. Define t* = tn H(j) and T* = {t* :t£T1).
the number of visibilities where at least one of the in-
The curve 7 sees a segment e G E(T\) if and only if
volved triangles is in Tc(s). (A similar observation is
e(~)H(-y) is a vertex of the upper envelope of T*. The in-
often made when one uses hereditary segment trees [9]:
tersection tiDtj of two triangles intersects H(-y) at most
only long-long and long-short intersections need to be
twice. Hence, the upper envelope of the set {in H(j) :
considered, not short-short intersections.)
t G Tj} has complexity A4(n) = 0(n2a^) [1]. A simi-
So let us count the number of such visibilities for a
lar argument holds for E{T2). □
given simplex s. Let ns := \T(s)\. Consider some trian-
gle t G Ti{s). We shall count the number of visibilities
involving intersections of t and triangles t' G Tf(s). To simplex will be intersected by 0(nlogr/r) triangles in
this end we consider the intersection of t with the upper T (with high probability). Finally, note that the ex-
envelope of Tf(s)\ an intersection between t and a part pected complexity of A(R) is 0(r2 + Kr3/n3). O
of some t' G Tf(s) that is not on the upper envelope
can never be visible from above. The upper envelope
of Tf(s) is on the boundary of a convex polyhedron, Theorem 3.2 Let T be a set ofn triangles in H3 with
and the projection of the intersection of t with the up- \A(T)\ = K. Then, for any constant e > 0, the complex-
per envelope of Tf(s) is contained in a convex curve. ity of the vertical decomposition for T is 0(n2+£ + K).
Lemma 3.1 now tells us that the total number of vis- Proof: Define f(n, m) to be the maximum number of
ibilities involving intersections of t and some triangle visibilities between edges in E(T) over all sets T of n
t' € Tf(s) is 0(ns2a(n<)). A similar argument holds triangles where m is the number of triple intersections
of course for the triangles in T2(s), so the total number of the triangles in T. We shall prove that, for any e > 0,
of visibilities at s that involve at least one triangle in f(n,m) = 0(n2+e + m).
Tc(s) is 0(n22Q("'>).
Fix a large enough constant r = r(e). We distinguish
To obtain the total number of visibilities we have to
two cases.
sum over all simplices s in the hierarchical cutting. Each
triangle t G T(s) has an edge intersecting parent(s). case (i): m > n3/r
Hence, for a simplex s G E; we have ns < n/p'-1. Thus Because of Lemma 3.3 and r is a constant f(n,m) =
the total number of visibilities can be bounded as fol- 0(n2+e + m).
lows: case (ii): m < n3/r
EsO(n^2^)) = 2«<»>£o<,-<feE.e3.-0(n2) Because m < n3/r, Lemma 3.4 implies that there exists
a (ci logr/r)-cutting S for T of size c2r2a(r), for some
= 2-(")Eo<J-<feO(p20'0((n//>i-1)2)
constants ci,c2. Let T(s) C T denote the subset of
= n22<*<»>Eo<,-<fcO(l) triangles that intersect the interior of a simplex s G E.
There are two types of visibilities between intersection
= 0(n22a(n>logn)
edges of the triangles in T: visibilities such that there is
D a set T(s) that contains all four triangles involved, and
visibilities where there is no such set T(s). The first type
of visibilities is counted recursively. For visibilities of
the second type we observe that the segment connecting
The general case the two intersection edges must intersect a facet of some
simplex s € E. By Lemma 3.2 the number of such
Before we can prove a bound on the complexity of ver-
visibilities for a fixed facet is at most c3n22a(nHogn,
tical decompositions which is sensitive to the complex-
for some constant C3.
ity of the arrangement, we need to prove the following
Define ns :— \T(s)\ and define ms to be the num-
worst-case bound.
ber of triple intersections in A(T(s)). Notice that
Lemma 3.3 The complexity of the vertical decompo- ns < c±nlogr/r and J2s€Ems — m> anc* ^at tnere
sition of a set ofn triangles in IR,3 is 0(n3). are 4c2r2a(r) facets of simplices in E. We can now use
induction to prove that there is a constant c such that
Proof: The proof is basically the same as the proof f(n, m) < n2+e + crm:
of Theorem 3.2 below, with the "intersection-sensitive"
cuttings of Lemma 3.4 replaced by Chazelle's hierarchi- f(n,m) <
n
cal cuttings.
<4c2r2a(r)c3n22Q(nHogn + £ f(ns,ms)
We need one more ingredient before we can prove the seE
main theorem of this section. < 4c2r a(r)c3n 2 (") log n + £ [n2+e + crms]
2 2 Q

Lemma 3.4 Let T be a set ofn triangles in H3 with <4c2r2a(r)c3n22a(n>logn + £ (ani°&£)2+e + crm
\A(T)\ = K, and let r be a parameter with 1 < r < n.
There exists an 0(logr /r)-cutting of size 0{r2a(r) + < ra2+er4c2r
2
a(r)c32''',')logn + c2a(r)(ci log r)' i + Qrm
Kr3/n3) for T.
Proof: Let R C T be a random sample of size r. By < n2+£ + crm.
the Slicing Theorem [2] we can triangulate A(R) into
0(r2a(r)+ \A(R)\) simplices. By e-net theory [19] each
We apply a similar analysis to the case of a single Computing the decomposition Vi(T)
cell. A single cell in an arrangement of n triangles can be
decomposed into 0(n2 log n) simplices; this follows from As before, we denote the complexity of the arrangement
the Slicing Theorem and a bound on the complexity of A(T) by K. Wre start with computing the one-step de-
a single cell [3]. In the inductive analysis above we now composition of the arrangement. To transform A(T)
have to recurse only on the 0(r2 logr) simplices of the into Vi(T) we have to add the vertical wall W(e,T) for
single cell in the arrangement of a sample of size r, where each boundary edge e of a triangle in T. In Observa-
in each subproblem we still deal with a single cell. We tion 3.1 we have already seen that the complexity of
get the following result. all these walls is 0(n2a(n)). Recall that the proof of
this observation was based on the fact that each wall
Corollary 3.1 For any constant e > 0, the maximum W(e,T) is bounded from above (below) by the lower
combinatorial complexity of the vertical decomposition (upper) envelope of the intersections of other triangles
of a single cell in an arrangement of n triangles in 3- with the vertical flat surface H(e); see Figure 1(b). This
space is 0(', ,2 + c fact also implies that we can compute a single wall in
O(rilogn) time [20], leading to the following lemma.

4 The Algorithm Lemma 4.1 The set of walls W(e,T) for all bound-
ary edges e of the triangles in T can be computed in
Let T = {<!,..., tn} be a collection of triangles as de- 0(n2 logn) time.
fined in Section 2. To simplify the description of our
algorithm, we will assume that the entire collection T of For each triangle boundary edge e we split the por-
triangles is contained inside a bounding simplex, whose tion between e and the upper boundary of W(e,T)
faces are special triangles in T. They are special in the by exhibiting extra vertical edges emanating from each
sense that they violate the general position assumption. breakpoint of the upper boundary until they hit e (some
Also, unlike all the other triangles in T, we will be in- of these edges are degenerate, since the corresponding
terested in only one side of each of these four triangles breakpoint lies on e). We repeat the analogous proce-
(the side that faces the interior of the simplex). dure for the lower boundary, and represent the collec-
As mentioned in the introduction, we will consider a tion of vertices, edges and faces on W(e,T) by a quad-
decomposition carried out in three steps: first we extend edge structure. The structure size is proportional to the
a vertical wall from every boundary edge of any trian- complexity of W(e, T); it can be computed in time that
gle in T, thus we obtain Vi(T); in addition, we extend is proportional to its size.
a vertical wall from every intersection edge of two tri- Next, we define a pair of two-dimensional arrange-
angles in T, and we get V2(T); and finally we refine the ments of segments for each triangle £,-. We consider
subcells of V2(T) into constant size subcells, to produce each triangle to be two-sided, and let t~ denote the side
MT)- of t{ facing downward and tf be the side of t( facing
The data structure that we obtain after carrying out upward. We will use the notation t* to refer to either
the entire algorithm provides a comprehensive and con- side of t{. For the bounding simplex, we need only one
venient representation of the arrangement: each sub- side of each triangle—the side facing the internal part of
cell in this representation has "constant description the simplex. The arrangement on tf is defined by a set
complexity"—it is bounded by up to six planar walls, F(tf) consisting of two types of segments: intersections
which are quadrilaterals—it is homeomorphic to a ball, of ti with other triangles of T and boundary pieces of
and the structure provides connectivity information be- some W(e,T) that lie on tf. The second type of seg-
tween adjacent cells across vertical walls (we discuss the ments in T(tf) are, in other words, the contribution of ti
connectivity issue in detail in the full version of the pa- to the upper envelopes which bound some wall W(e, T)
per). A significant advantage of the one-step decomposi- from below. Similarly, the arrangement on t~ is defined
tion Vi (T) is that in return for a relatively low overhead by the set of segments T(t^) consisting of intersections
it already captures the 3D structure of the arrangement of ti with other triangles of T, and boundary pieces of
and it makes the next steps of the algorithm fairly sim- some W(e,T) that lie on tj. For each segment in T(t*)
ple. we attach the label denoting its origin: either the la-
For the most part, our algorithm solves two- bel of the other triangle intersecting r,- or the edge e on
dimensional subproblems and it mainly uses structures whose envelope it appears. Let n* = \T(t*)\. We will
describing two-dimensional arrangements of segments. use the abbreviation A* to denote the two-dimensional
We will represent two-dimensional subdivisions using arrangement A(T(t*)).
the quad-edge structure [16], and augment it with ad- The next step of the algorithm is to compute, for each
ditional three-dimensional data as necessary. side of each triangle ti G T, the arrangement induced
by r(<*). To this end we use a standard plane sweep al-
gorithm that detects all the intersection points between
segments4 [24]. (At this point one may use the optimal =>
algorithm by Chazelle and Edelsbrunner [7]. However,
due to other steps of the algorithm, this will not make a
difference in the overall running time of the algorithm.
Also, the sweep paradigm is more appropriate for the
generalization that we propose in the sequel.)

Lemma 4.2 After having computed all walls of trian-


gle boundary edges, all the two-dimensional arrange-
ments A* can be computed in time 0(\Vi(T)\ logn).

Again, we represent each two-dimensional arrange-


ment by a quad-edge structure. Figure 2: Examples of changes to Ay when sweeping
It is easy to verify that after the first step of the de- over a vertex of Vi(T).
composition, the entire three-dimensional arrangement
is connected, that is, there are no "floating" parts. In
particular, the two-dimensional boundary of each three-
of Vi(T) and the other on the floor of that cell. To this
dimensional cell is connected. The shape of each 3D cell
end we perform a space sweep with a plane Py parallel
may still be rather convoluted; it need not even be xy-
to the zz-plane over Vi(T), from y = — oo to y — +oo.
monotone. Therefore, instead of handling each 3D cell
Throughout the sweep we maintain dynamic data struc-
at a time we carry out a space sweep over the entire
tures that describe Ay. (Below we will indicate which
decomposition Vi(T). (A similar approach has recently
data structures we need.) Roughly, our goal is to up-
been used to obtain a decomposition of certain arrange-
date each face of any arrangement Af with all the edges
ments related to a motion planning problem [17]; see
of ceiling faces that are visible when looking vertically
also [14, 25] for dynamic maintenance of a monotone
upward from that face, and similarly, to update each
subdivision in a space-sweep.)
face of any arrangement AJ with all the edges of floor
Let Pyi denote the plane y = yx. Let Ayi = A(PVl n
faces that are visible when looking vertically downward
Vi (T)) be the two-dimensional arrangement of segments
from that face.
induced on the plane PVl by intersecting it with5 Vi(T).
The arrangement Ay changes continuously as we
We use Ay to denote this arrangement for an arbitrary
sweep the plane Py. At a finite number of "events",
y-value. We will be using the following property of the
however, the combinatorial structure of Ay changes.
one-step decomposition (whose simple proof is omitted
It is not difficult to see that these events are exactly
here).
the vertices of Vi(T). At such an event the follow-
Lemma 4.3 Every face in Ay is x-monotone, that is, ing changes to Ay can occur: (i) a vertex of Ay may
every z-vertical line intersects any face of Ay in at most (dis)appear; (ii) an edge of Ay may (dis)appear; and
one connected component. (iii) a face of Ay may (dis)appear. In fact, several such
changes occur simultaneously at each event. Two ex-
amples are given in Figure 2. By the general position
Transforming Vi(T) into V2(T) assumption, each event involves only a constant number
We now proceed to describe the second step of the algo- of changes to a constant number of faces in Ay.
rithm. The major difficulty in transforming V\{T) into
Since our goal is to detect vertical visibilities between
V2(T) is to efficiently detect the vertical visibilities of
two (intersection) edges in Vi(T), we wish to detect
pairs of intersection edges, one on the ceiling of a cell
when there is a vertical segment connecting two inter-
4
From this point on, when discussing two-dimensional arrange- section edges that does not intersect any triangle in T.
ments, we will distinguish between a segment and an edge. A Consider the sweep plane Py when it contains such a
segment is a maximal portion of a line that appears in the ar-
rangement, possibly intersected by other segments. An edge is
vertical segment connecting intersection edges e\ and
a maximal portion of a segment not intersected by any other e2. Then the intersection of e\ and e-i with Py must
segment. define two vertices of Ay which are on the boundary of
6
With a slight abuse of notation, we use Vi(T) to denote the the same face and lie on a common vertical line. Thus
subdivision of 3-space after the one-step decomposition, and also
to denote the collection of triangles and walls that induce this we define a new type of event in our space sweep, called
subdivision. a vertical event, which occurs when two vertices of the
same face become aligned along a vertical line. not a segment on t*. See footnote 4 for the difference.)
We maintain all the events in a priority queue Q, Since we have attached to each vertex some additional
ordered by increasing y-coordinate. The operations we information, we can compare e(v) with each of e(uj)
will perform on Q are insert an event, delete an event, and e(«2) to see if their projections onto the xy-plane
and fetch the next event, that is, fetch the event with intersect. If they intersect, we have detected a poten-
minimum y-value (we delete each event after it has been tial vertical visibility between two intersection edges; we
handled). We also need to perform membership check add this event to Q, with the y-coordinate of the inter-
of an event in the queue, to avoid inserting the same section point. We say potential because when we will
event several times. Such a queue can be implemented come to handle this event, we may find that this "verti-
so that the time for each operation is O(logm), where m cal visibility" is obscured by another triangle (or trian-
is the maximum number of events held simultaneously gles) in a manner that we were unable to predict when
in the queue [24]. Observe that we can insert all the the event was inserted into the queue. Therefore, we
events where the structure of Ay changes—the vertices distinguish between two types of events: actual events,
of Vi(T)—into Q before we start the sweep. To each which are either the events corresponding to features of
event that we insert into the queue, we attach some Vi(T), or additional events that indeed correspond to a
local geometric and combinatorial information relevant vertical visibility, and false events, which are potential
to that event. The vertical events, however, have to vertical visibilities that are found out to be obscured
be computed on the fly. Next we describe the data when handled,
structures which we need to represent Ay in order to be When we handle an actual event q which corresponds
able to compute the vertical events. to vertical visibility of a pair of vertices u and v on the
lower and upper chains respectively, each of u and v now
Let / = f(y) be a face of Ay. Recall that / is x- have new neighbors on the reciprocal chain, so we check
monotone. We split the vertices on the boundary of / these new neighbors for potential additional events as
into two x-monotone chains: the lower chain L(f), and above.
the upper chain U(f). The vertices in each chain are The next lemma proves the correctness of our ap-
ordered by increasing ^-coordinate, and we implement proach.
each chain as a balanced binary tree. Whenever a ver-
Lemma 4.4 The set of events that is computed during
tex on the boundary of / disappears or newly appears,
the sweep contains the set of visibilities between pairs
we update the relevant chain by deletion or insertion re-
of intersection edges. The false events can be efficiently
spectively. When an existing face disappears, we "free"
distinguished from the actual events. Each false event
its attached chains. When a face newly appears, we
can be charged to an actual event, and no actual event
allocate a pair of new structures for its lower and up-
gets charged more than a constant number of times this
per chains. When a face / is split into two faces (for
way.
instance when an endpoint of a segment penetrates the
face) we create new pairs of chains for these faces. These Proof: First we claim that no vertical visibility is
are easily constructed by splitting the chains of / and missed by our algorithm. The reason is that before a
adding a small number of new vertices. Similarly, when pair of edges of V\{T) become vertically visible, their
two faces merge into one, we create the two chains of corresponding cross-sections must become neighbors (in
the new face by join operations on the chains of the the sense defined above) in L(f) and U(f) for some face
merged faces plus possibly a few deletions of vertices. / of Ay. This is similar to a basic argument in the
All these operations (insertion, deletion, split and join) Bentley-Ottmann algorithm for detecting intersections
can be carried out in 0(log n) time each, using red-black of line segments [4], [24, Section 7.2].
trees [15], [27, Chapter 4]. Once we handle a vertical visibility event it is easy
To detect vertical visibilities between vertices on the to determine whether it is actual or false by checking
boundary of / we proceed as follows. Whenever a new whether the lower and upper chains involved in this
vertex v is created on the lower chain of / (the opera- event belong to the same face. The event is actual if
tions for a new vertex on the upper chain are symmet- and only if both chains belong to the same face. This
ric), we look for its "neighbors" in the upper chain of /, could be done, for example, by maintaining cross point-
that is, we look for the two vertices of U(f) whose pro- ers between the roots of the trees describing the chains.
jection onto the a>axis lie nearest to the projection of v We charge each false event q' to the actual event q
onto the i-axis. Let Mj and «2 be the two neighbors of that has "spawned" it. Every vertical visibility event
v on the upper chain. Each vertex w on the boundary is added to the queue Q only at actual events (a false
of / is the cross-section of Py with an edge e(w) of some event does not create new events). Since no event cre-
A*. (It is important here that e(w) is an edge of A*, ates more than a constant number of additional events,
no actual event will be charged more than a constant the asymptotic complexity of the decomposition or the
number of times for false events. algorithm.
a For lack of space, several details and proofs have been
omitted throughout—they are discussed in the full ver-
sion of the paper. The main algorithmic result of the
To represent the decomposition V2(T), we augment paper is summarized in the following theorem:
the two-dimensional arrangements A* with information
on all the edges that are vertically visible from A*. Theorem 4.1 Given a collection T of n triangles in
More precisely, we add to Af all the edges that are general position in three-dimensional space, the time
visible when looking vertically upward from tf. Simi- needed to compute the full vertical decomposition of
larly, we add to A~ all the edges that are visible when the arrangement A(T) is 0(n2 log n + V log n), where V
looking vertically downward from t~. We also record is the combinatorial complexity of the vertical decom-
on these arrangements the intersection of these edges position.
with the original edges of the corresponding A*. Note
that these intersection points correspond exactly to the Remark It is, in fact, possible to compute vertical
events computed during the space sweep. decompositions with a somewhat lower overhead term
than the algorithm above achieves, using rather involved
Lemma 4.5 The space sweep algorithm described multi-level data structures. The alternative approach is
above for transforming Vi(T) into V2(T) runs in time described in the full version of the paper.
O(Vlogn), where V = |V2(T)|.

Proof: We have seen that every event can be handled 5 Concluding Remarks
with a constant number of operations on some chains
U(f) and L(f), and on Q. Thus every event takes We have proved bounds on the maximum combinatorial
O(logn) time. It remains to observe that every event is complexity of the vertical decomposition of sets of trian-
either a feature of V2(T), or it can be charged to a fea- gles in 3-space that are sensitive to the complexity of the
ture of V2(T) such that no feature of V2(T) gets charged arrangement of triangles. We have also given a simple
more than a constant number of times (Lemma 4.4). □ deterministic output-sensitive algorithm for computing
the vertical decomposition.
While there are various technical details that still
need to be verified, we believe that our algorithm will
We denote the arrangement A* after updating it in work with roughly the same time bound for the case of
the above process by B*. Every face on every B* rep- low-degree algebraic surface patches in 3-space. We are
resents a vertical cylindrical cell which has the same currently studying the full details of this extension. The
xy-projection as that face, and has a unique triangle generalization of the combinatorial result seems more
bounding it on the top and a unique triangle bounding difficult and currently we do not see how to adapt our
it on the bottom. proof to this case.
Another open problem is to tighten the small gap that
Transforming V2(T) into V3(r) remains between the upper and lower bounds for verti-
cal decompositions. We believe that the n£-factor in the
The final step of our algorithm is to refine each B* fur- upper bound is only an artifact of our proof technique
ther to obtain the full vertical decomposition, in the and that the lower bound is closer to the truth than the
following standard manner. Consider the projection of upper bound.
B* onto the xy-plane. We extend a y-vertical segment
from each vertex of the projected arrangement upward
and downward until it reaches another segment, or the References
boundary of the projection of t{. By projecting the seg-
ments we have added back to t*, we obtain a refine- [1] P. K. Agarwal, M. Sharir, and P. Shor. Sharp
ment of B* into trapezoids. Finally, we extend each of upper and lower bounds on the length of general
these newly added segments into vertical walls inside Davenport-Schinzel sequences. J. Combin. Theory
the respective three-dimensional cells to obtain Vz(T). Ser. A, 52:228-274, 1989.
Adding the y-vertical extensions to all the arrangements
B* can be carried out by a plane sweep of each of the [2] B. Aronov and M. Sharir. Triangles in space or
arrangements B*. This last step of the decomposition, building (and analyzing) castles in the air. Combi-
where we transform V2(T) into V3(T), does not increase natorica, 10(2):137-173, 1990.
[3] B. Aronov and M. Sharir. Castles in the air revis- [16] L. J. Guibas and J. Stolfi. Primitives for the ma-
ited. In Proc. 8th Annu. ACM Sympos. Comput. nipulation of general subdivisions and the compu-
Geom., pages 146-156, 1992. tation of Voronoi diagrams. A CM Trans. Graph.,
4:74-123, 1985.
[4] J. L. Bentley and T. A. Ottmann. Algorithms
for reporting and counting geometric intersections. [17] D. Halperin and M. Sharir. Near-quadratic bounds
IEEE Trans. Comput, C-28:643-647, 1979. for the motion planning problem for a polygon in a
polygonal environment. In Proc. 34th Annu. Sym-
[5] B. Chazelle. Convex partitions of polyhedra: a
pos. on Foundations of Computer Science, pages
lower bound and worst-case optimal algorithm. 382-391, 1993.
SUM J. Comput, 13:488-507, 1984.
[18] S. Hart and M. Sharir. Nonlinearity of Davenport-
[6] B. Chazelle. An optimal convex hull algorithm and Schinzel sequences and of generalized path com-
new results on cuttings. In Proc. 32nd Annu. IEEE pression schemes. In Proc. 25th Annu. IEEE Sym-
Sympos. Found. Comput. Sei., pages 29-38, 1991. pos. Found. Comput. Sei., pages 313-319, 1984.
[7] B. Chazelle and H. Edelsbrunner. An optimal al- [19] D. Haussler and E. Welzl. Epsilon-nets and simplex
gorithm for intersecting line segments in the plane. range queries. Discrete Comput. Geom., 2:127-151,
J. ACM, 39:1-54, 1992. 1987.
[8] B. Chazelle, H. Edelsbrunner, L. Guibas, and [20] J. Hershberger. Finding the upper envelope of n
M. Sharir. A singly-exponential stratification line segments in 0(n log n) time. Inform. Process.
scheme for real semi-algebraic varieties and its Lett, 33:169-174, 1989.
applications. In Proc. 16th Internat. Colloq.
Automata Lang. Program., volume 372 of Lec- [21] J. Matousek. Range searching with efficient hierar-
ture Notes in Computer Science, pages 179-192. chical cuttings. In Proc. 8th Annu. ACM Sympos.
Springer-Verlag, 1989. Comput. Geom., pages 276-285, 1992.

[9] B. Chazelle, H. Edelsbrunner, L. J. Guibas, and [22] K. Mulmuley. Hidden surface removal with respect
M. Sharir. Lines in space: combinatorics, algo- to a moving point. In Proc. 23rd Annu. ACM Sym-
rithms, and applications. In Proc. 21st Annu. ACM pos. Theory Comput., pages 512-522, 1991.
Sympos. Theory Comput., pages 382-393, 1989.
[23] K. Mulmuley. Randomized multidimensional
[10] B. Chazelle and J. Friedman. A deterministic view search trees: further results in dynamic sampling.
of random sampling and its use in geometry. Com- In Proc. 32nd Annu. IEEE Sympos. Found. Com-
binatorica, 10(3):229-249, 1990. put. Sei, pages 216-227, 1991.

[11] K. Clarkson, H. Edelsbrunner, L. Guibas, [24] F. P. Preparata and M. I. Shamos. Computational


M. Sharir, and E. Welzl. Combinatorial complex- Geometry: an Introduction. Springer-Verlag, New
ity bounds for arrangements of curves and spheres. York, NY, 1985.
Discrete Comput. Geom., 5:99-160, 1990.
[25] F. P. Preparata and R. Tamassia. Efficient point
[12] K. L. Clarkson. A randomized algorithm for location in a convex spatial cell-complex. SIAM J.
closest-point queries. SI AM J. Comput., 17:830- Comput., 21:267-280, 1992.
847, 1988.
[26] M. Sharir. Almost tight upper bounds for lower en-
[13] K. L. Clarkson and P. W. Shor. Applications of velopes in higher dimensions. In Proc. 34th Annu.
random sampling in computational geometry, II. IEEE Sympos. Found. Comput. Sei. (FOCS 93),
Discrete Comput. Geom., 4:387-421, 1989. pages 498-507, 1993.

[14] M. Goodrich and R. Tamassia. Dynamic trees and [27] R. E. Tarjan. Data Structures and Network Algo-
dynamic point location. In Proc. 23rd Annu. ACM rithms. Society for Industrial and Applied Mathe-
Sympos. Theory Comput, pages 523-533, 1991. matics, Philadelphia, PA, 1987.

[15] L. J. Guibas and R. Sedgewick. A dichromatic [28] A. Wiernik and M. Sharir. Planar realizations
framework for balanced trees. In Proc. 19th Annu. of nonlinear Davenport-Schinzel sequences by seg-
IEEE Sympos. Found. Comput. Sei., Lecture Notes ments. Discrete Comput. Geom., 3:15-47, 1988.
in Computer Science, pages 8-21, 1978.

10
Almost Tight Upper Bounds for the Single Cell and Zone
Problems in Three Dimensions*
Dan Halperin1 Micha Sharir*

Abstract surfaces are assumed to satisfy). We denote by .4(E) the


arrangement of E, i.e., the decomposition of 3-space into
We consider the problem of bounding the combinato- (relatively open) cells of various dimensions, each being
rial complexity of a single cell in an arrangement of a maximal connected set contained in the intersection
n low-degree algebraic surface patches in 3-space. We of a fixed subcollection of E and not meeting any other
show that this complexity is 0(n2+e), for any e > 0, surface; we will denote j-dimensional cells of .4(E), for
where the constant of proportionality depends on e and j = 0,1,2, as vertices, edges, and faces, respectively,
on the maximum degree of the given surfaces and of and the unqualified term cell will be used to denote
their boundaries. This extends several previous results, 3-dimensional cells of .4(E). The combinatorial com-
almost settles a 7-year-old open problem, and has ap- plexity of a cell C is the number of lower-'dimensional
plications to motion planning of general robot systems cells appearing on its boundary. The problem studied
with three degrees of freedom. As a corollary of the in this paper is to obtain a sharp upper bound on the
above result, we show that the overall complexity of combinatorial complexity of a single cell in such an ar-
all the three-dimensional cells of an arrangement of n rangement.
low-degree algebraic surface patches, intersected by an One of the main motivations for studying this prob-
additional low-degree algebraic surface patch a (the so- lem is its applications to robot motion planning. Let B
called zone of a in the arrangement) is 0(n2+e), for any be an arbitrary robot system with 3 degrees of freedom,
c > 0, where the constant of proportionality depends on moving in some environment V filled with obstacles.
s and on the maximum degree of the given surfaces and Any placement of B can be represented by a point in
of their boundaries. 3-space, whose coordinates are the 3 parameters con-
trolling the degrees of freedom of J5; this space is called
the configuration space of B. We want to compute the
1 Introduction free portion of this space, denoted as FP, and consist-
ing of those placements of B at which it does not meet
Let E = {<7i,... ,<7n} be a given collection of n low-
any obstacle. We note that the boundary of FP con-
degree algebraic surface patches in 3-space (see below
sists of placements at which B makes contact with some
for a more precise statement of the properties that these
obstacles, but does not penetrate into any of them. Un-
•Work on this paper by the first author has been sup- der reasonable assumptions concerning B and V, we
ported by a Rothschild Postdoctoral Fellowship, by a grant from can represent the subset of 'contact placements' of B
the Stanford Integrated Manufacturing Association (SIMA), by (including those placements at which B makes contact
NSF/ARPA Research Grant IRI-9306544, and by NSF Grant
CCR-9215219. Work on this paper by the second author has with an obstacle but may also penetrate into other ob-
been supported by NSF Grant CCR-91-22103, and by grants from stacles) as the union of a collection of a finite number
the U.S.-Israeli Binational Science Foundation, the G.I.F., the of surface patches, all algebraic of constant maximum
German-Israeli Foundation for Scientific Research and Develop- degree (and whose relative boundaries are also algebraic
ment, and the Israel Science Fund administered by the Israeli
Academy of Sciences. of constant maximum degree).
'Robotics Laboratory, Department of Computer Science, Stan- For example, if B is an arbitrary polygonal object
ford University.
* School of Mathematical Sciences, Tel Aviv University, and
with k sides, and V is an open planar polygonal re-
Courant Institute of Mathematical Sciences, New York University. gion bounded by m edges, the configuration space of
B is a 3-dimensional space, each point of which repre-
Permission to copy without fee all or part of this material is sents a possible placement of B by the parametrization
granted provided that the copies are not made or distributed for (i,y,tanf), where (x,y) are the coordinates of some
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given fixed reference point on B, and 8 is the orientation of
that copying is by permission of the Association of Computing B. In this case, each 'contact surface' is either the lo-
Machinery. To copy otherwise, or to republish, requires a fee cus of all placements of B at which some specific corner
and/or specific permission.
of B touches some specific edge of V, or the locus of
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

11
placements at which some side of B touches some ver- case of (d- l)-simplices, where an 0(nd_1 logn) bound
tex of V. Each of the resulting 0(km) contact surfaces has been established in [5], and several special cases in
is a 2-dimensional algebraic surface patch of degree at three dimensions that arise in motion planning for vari-
most 4, and its relative boundary consists of a constant ous specific robot systems B with three degrees of free-
number of algebraic arcs, of constant maximum degree dom, including the case of a moving polygon mentioned
as well. above, where an 0(n2+£) bound is proved in [17], some
If B is placed at a free placement Z and moves con- restricted cases of that problem, where slightly more
tinuously from Z, then it remains free as long as the improved bounds are obtained [15], and a few other sys-
corresponding path traced in configuration space does tems (see [15]).
not hit any contact surface. Moreover, once this path The single cell problem is a generalization of the re-
crosses a contact surface, B becomes non-free (assum- lated problem of bounding the complexity of the lower
ing, as is customary, general position of B and V). It envelope of S, i.e., the portion of the union of the sur-
follows that the connected component of FP that con- faces of E, consisting of those points w for which no
tains Z is the cell that contains Z in the arrangement surface of £ passes below w. This problem, also rather
A(T.) of the contact surfaces. (The entire FP is the difficult, is nevertheless easier to analyze, and recent re-
union of a collection of certain cells in this arrange- sults [16, 26] show that the combinatorial complexity
ment.) Hence, bounding the combinatorial complexity of such an envelope is 0(nd~1+e), for any e > 0, where
of a single cell in such an arrangement is a major prob- the constant of proportionality depends on s, d, and the
lem one has to tackle, prior to the design of efficient maximum algebraic degree of the given surfaces and of
algorithms for computing such a cell. their relative boundaries.
Here is a brief history of the single-cell problem. In In this paper we derive an improved upper bound for
two dimensions, it has been shown in [14] that the com- the complexity of a single cell in an arrangement A(E)
plexity of a single face in an arrangement of n Jordan of algebraic surfaces in 3-space, as above. This bound,
arcs, each pair of which intersect in at most some con- in 3 dimensions, is the same as the bound for lower
stant number, s, of points, is 0(As+2(n)), where \{m) envelopes just mentioned; that is, it is 0(n2+e), for any
is the maximum length of Davenport-Schinzel sequences e > 0, where the constant of proportionality depends,
of order q composed of m symbols, and is nearly linear as above, on e and on the maximum algebraic degree
in m for any fixed q (see [1, 18] for more details). Thus of the given surfaces and of their relative boundaries.
the maximum complexity of a single face is nearly linear This almost establishes the conjecture mentioned above
in the number of arcs (for any fixed s), as opposed to the in three dimensions.
complexity of the entire arrangement of the arcs, which Our analysis adapts the proof technique of [17], which
can be quadratic in the worst case. Efficient algorithms in turn is based on the analysis technique of [16, 26] for
for computing a single face in a 2-D arrangement are the case of lower envelopes. The lesson one can learn
given in [14] and in [8]. from the analysis in [17] is that in the case of a single
cell one needs the following two preliminary results to
In higher dimensions, a prevailing conjecture (see, 'bootstrap' the recurrences appearing in the analysis:
e.g., [22]) is that the complexity of a single cell in an
arrangement A(E) as above is at most close to 0(nd~l), (a) a sharp bound on the number of 'x-extreme' ver-
which is again roughly one order of magnitude smaller tices of the cell C (vertices whose x coordinate is
than the maximum complexity of the entire arrange- smallest or largest in a small neighborhood of the
ment, which can be Q(nd) (see [23]). A stronger version vertex within the closure of C), and
of the conjecture asserts that the maximum complexity
of a single cell in such an arrangement is 0(nd~2Xs(n)), (b) a sharp bound on the number of vertices bounding
where s is some constant that depends on the maximum 'popular' faces of C (faces that are adjacent to C
degree of the given surfaces and of their boundaries. on both 'sides'; see [3, 5, 17] and below).
These conjectures have been proved only for a few Bounds on these quantities were obtained in [17] us-
special cases of arrangements. They are largely open in ing special properties of the surfaces that arise in the
the general case stated above. In fact, no bounds better case studied there. A main technical contribution of
than 0{nd) are known for the general case, even in three the present paper is a derivation of such bounds in the
dimensions. The special cases for which better bounds general algebraic setting assumed above. The bound
are known include the case of hyperplanes, where the (a) is obtained using considerations which are related
complexity of a single cell, being a convex polytope to Morse theory (see e.g. [20]), but are simpler to derive
bounded by at most n hyperplanes, is 0(n'-'i/'2-l) (by in 3 dimensions. The bound (b) is obtained by applying
the Upper Bound Theorem [21]), the case of spheres, the new probabilistic technique of [16, 17, 26] to count-
where an 0(n^/'2^) bound is easy to obtain by lifting ing only the vertices of popular faces (this idea is in the
the spheres into hyperplanes in (d+l)-space [11, 24], the spirit of the methodology used in [3, 5]). Once these

12
two bounds are available, the rest of the proof is rather Theorem 2.1 The number of x-extreme vertices of C
similar to those used in [16, 17, 26], although certain is 0(n2).
non-trivial adjustments are required.
The paper is organized as follows. In Section 2 we Proof. For each x0 £ IR, let nXo denote the plane
give several preliminary results, including the analysis x = XQ . We call a point w £ dC critical if there exists
of the number of x-extreme vertices of a single cell. The a neighborhood N of w and a connected component K
main analysis is presented in Section 3. The application of C n N so that K f~l nXo is disconnected, where x0 is
of the main result to the zone problem, as mentioned the x-coordinate of w, but K C\ ~KX is connected either
in the abstract, is discussed in Section 4, and the paper for all x < x0 or for all x > xo sufficiently close to XQ .
concludes in Section 5 with further applications of our We first claim that the number of x-extreme vertices
results and some open problems. of C is proportional to 2 plus the number of critical
points of C. We prove this by an argument borrowed
from [6].
2 Preliminaries We sweep C by moving the plane irx in the direction
of increasing x, and keep track of the number I of con-
Let E = {<7i,..., an} be a given collection of n surface nected components of C n irx. This number is initially
patches in 3-space that satisfy the following conditions: (at x = -co) 0(n2), since this is an upper bound on the
(i) Each <7; is monotone in the xy-direction (that is, ev- overall complexity of any planar cross section of the en-
ery vertical line intersects c; in at most one point). tire arrangement .4(E). I increases by 1 when TTX sweeps
Moreover, each cr,- is a portion of an algebraic sur- through a local minimum of C, or when a connected
face of constant maximum degree b. component of C (1 irx splits into two subcomponents; /
decreases by 1 when 7r sweeps through a local maximum
(ii) The vertical projection of <7; onto the xj/-plane is of C, or when two components of CC\itx merge into a sin-
a planar region bounded by a constant number of gle component. (The general position assumption im-
algebraic arcs of constant maximum degree (say, b plies that only two components can merge into, or split
too). from, a component of C at any given x.) The number of
(iii) The relative interiors of any triple of the given events at which components can split or merge is equal,
surfaces intersect in at most s points (by Bezout's by definition, to the number Q of critical points of C.
theorem [19] and by Property (iv) below, we always Consider the following dynamic scheme for assign-
have s < b3). ing weights to each component of C f~l irx. Initially,
at x = —oo, we assign weight —1 to each component
(iv) The surface patches in E are in general position; of C n TTX. When irx sweeps through a local minimum
one way of defining this is to require that the co- point of C, a new component of C PI TTX is created, and
efficients of the polynomials defining the surfaces is also assigned weight — 1. When two components of
and their boundaries are algebraically independent C n 7rx merge, we assign to the new component weight
over the rationals (i.e., no multivariate polynomial 2 plus the sum of the weights of the merged compo-
with rational coefficients vanishes when substitut- nents. When a component shrinks and disappears, its
ing into it some of the given coefficients), thereby final weight is added to a global count M. When a com-
excluding all kinds of 'degenerate' configurations; ponent is split into two subcomponents, each of them
see [16, 17, 26] for more details. is assigned weight 1 + y, where w is the weight of the
We remark that the somewhat restrictive condition (iv) split component.
and the first part of condition (i) are not essential for the We claim that, at any given time during the sweep,
analysis. If the first part of condition (i) does not hold, the weight of any component of C D irx is always at least
we can decompose each surface into a constant number — 1, and the weight of a component that was formed by
of xy-monotone pieces by cutting it along the locus of one or more preceding splitting and merging operations
points with z-vertical tangency. If condition (iv) does is non-negative. Both claims are easy to prove by in-
not hold, we can argue, by applying, as in [26], a small duction on the sweep events. If C has no critical points
random perturbation of the polynomials, that the com- then it has at most one local minimum and at most one
plexity of a single cell in a degenerate arrangement of local maximum, and the claim holds trivially in this
surfaces is at most proportional to the worst-case com- case; so suppose C does have critical points. In this
plexity of a single cell in arrangements of surfaces in case it is easily verified, using induction on the sweep
general position. events, that the weight of each component of CC\irx that
We are also given a point Z not lying on any surface, shrinks to a point as we reach a local maximum of C is
and define C — Cz(E) to be the cell of the arrangement nonnegative, so the value of M is always nonnegative.
4(E) that contains Z; by definition, C is an open set in Similarly, all components that survive as x reaches +oo
H3. have nonnegative weight.

13
Suppose that, at some point during the sweep, there these curves split irXo locally near w. However, this is
are sx local minima of C to the left of irx, that Cri7r_oo easily seen to contradict the criticality of w, and thus
has t components, that the number of splittings and implies that the total number of critical points of C is
mergings of cross-sectional components to the left of TTX 0(n2), as asserted. □
is Qx < Q, and that the current value of the count
M is Mx. Then, as is easily verified by induction on
the sweep events, the total weight of the components 3 Complexity of a Single Cell
of C D T\X plus Mx is equal to 2QX — sx — t. Hence,
since at x — -fco the total weight of the components of We call a vertex v of ./4(E) an inner vertex if v is formed
by the intersection of the relative interiors of three dis-
C n T\X plus Mx is nonnegative, we have 20, — s — t > 0,
tinct surfaces of E. We concentrate on bounding the
where s is the total number of local minima of C. This
number of inner vertices of Cz(E), and later on jus-
implies that s < 2Q. A symmetric argument applies to
tify the use of this reduced measure of complexity. Our
the number of local maxima of C, and thus the claim is
main result is:
established.
It therefore remains to estimate the number of critical Theorem 3.1 The number of inner vertices o/Oz(E)
points of C. For any fixed surface u£S, the general is 0(n2+£), for any e > 0, where the constant of pro-
position assumption is easily seen to imply that there portionality depends on e and on the maximum degree
are only 0(1) critical points that lie only on a and on no and shape of the surfaces.
other surface, so the total number of such points, over
all a G E, is only 0(n). The number of critical points Proof. Let v be an inner vertex of C = Oz(E), which
that lie on the boundary of one surface of E and on a is incident to three surfaces CTI, a-i and a%. We may
second surface, summed over all pairs of such surfaces, assume that v is not a singular point on any of these
is easily seen to be only 0(n2). surfaces, and that these surfaces meet transversally at
Consider next critical points that lie in the relative v. If, say, v is a singular point of <j\, then it lies on the
interior of an intersection curve jij = a{ C\ <jj, for some algebraic curve of bounded degree consisting of all sin-
pair of surfaces aj, aj G E and on no other surface gular points on aL. The number of intersection points
of E. If such a point to is a singular point1 on, say of this curve with, say a2, is constant (under the as-
er,-, then w is an intersection point between the curve sumption of general position), which implies that the
of singular points on <7; and aj, and, by the general number of such vertices is only 0(n2). The assumption
position assumption, the number of such points, over concerning transversality is also justified by the general
all pairs a, aj G E, is clearly 0{n2). We thus may position assumption.
assume that w is nonsingular on both surfaces, and, by For technical reasons, we distinguish between differ-
the general position assumption, that <7; and aj meet ent sides of v, adapting the notation of [17] (see also
transversally at w. But then the criticality of w is easily [3, 5, 13]). Formally, the three tangent planes to the
seen to imply that the tangent vector to 7,-j at w must surfaces a\ at v partition 3-space into 8 octants, and a
be orthogonal to the rr-axis, and the number of points side R of v is any one of these octants. We call the pair
on jij with this property is 0(1) (under the general (v, R) a 0-border. We say that (v, R) is a 0-border of
position assumption). Hence the total number of such C if, when we move from v in any direction that points
points, over all pairs oi, aj G E, is also 0(n2). into R by any sufficiently small distance, we enter C.
Our goal is to count the number of inner 0-borders of
Finally, suppose that w is a critical point that is also
C, which means that we count each vertex v of C with
a point of intersection of three surfaces <7,-, aj, a^ G E.
multiplicity, once for each side of v that lies in C (in the
Arguing as above, we can rule out the case where w is
above sense). We define K(E) to be the number of inner
singular on either of these surfaces. Consider now the
0-borders on 9Cz(E). We also denote by n{n) the max-
three intersection curves 7; = irXo fl <7,-, jj — irXo 0 aj,
imum possible value of K(E), taken over all collections
7k = ftx0 HtTj;, where x0 is the ^-coordinate of w. These
E, as above, with a total of n surfaces, and over all cells
curves meet at w, they are all smooth at w, and KDTTXO
of .4(E).
lies on a single side of each of the curves. The number
In the foregoing analysis, the notion of a side needs
of critical points of this kind, for which any two of these
also to be extended to edges and faces bounding C. For
curves are tangent to each other at w, is easily seen,
an edge e, formed by the intersection of two surfaces a,
using an argument similar to the one given above, to be
a', we can assume (by reasons similar to those used in
only 0{n2). Otherwise, Kr\irXo must be fully contained,
the preceding arguments) that no point on e is singular
locally near w, in just one of the six regions into which
on either of these surfaces, and that a and a1 cross each
1
A point v is singular on an algebraic surface in IR , defined
other transversally at each point of e. Then at each
by P = 0, for some polynomial P, if all the partial derivatives point z G e, the plane normal to e at z is split by the
dP/dx;, for i = 1,..., d, vanish at v; see [7, 19]. two tangent planes to a, a' at z into 4 quadrants. A

14
side of e can be thought of as a continuous mapping
(in the Hausdorff sense) that maps each point z G e
to one of the quadrants at z (or, rather, to make the
Hausdorff continuity well defined, to the intersection of
such a quadrant with the unit ball around z). Similarly,
a side of a face / can be defined as a continuous mapping
from each point z £ / to one of the two unit vectors
normal to / at z. If a vertex v is incident to an edge
e and lies on another surface a crossing e transversally,
then a side R of v is consistent with a side Q of e if the
limit of Q(z), as z approaches v, is contained in (the
closure of) R, and R is the positive cone spanned by
the limit of Q(z) and by the vector normal to a at z Figure 1: The popular face / borders the cell C on both
and pointing in the direction of e. Consistency between its sides
sides of a vertex and an incident face, or between sides of
an edge and an incident face, can be defined in a similar
manner. If v is a non-singular vertex of «4(E), incident
to two edges ei, e2, which are contained in the same ular faces of C; in the previous paper [17] such a bound
intersection curve of a pair of surfaces, we say that a was derived using special properties of the surfaces that
side R\ of e\ is consistent with a side R2 of e2 if the two arose in the specific motion planning application that
was studied there; here we apply a new technique for
limits of Ri(z) as z approaches v along ei, and of Rz(z)
as z approaches v along e2, coincide. If R[, R'2 are the obtaining the desired bound in general arrangements.
two sides of v consistent with Ri, R2, respectively, we We first obtain an upper bound for the complexity n(n)
in terms of the function n, and then proceed to derive
say that R'2 is the side of v opposite to R[ across the
third surface defining v. Given an edge e and a side R an upper bound for 7r(n).
of e, we say that (e, R) is a 1-border of C if, when we Thus, up to an additive term of ir(n), it suffices, for
move from any point z £ e in a direction contained in the bound on «(n) that we seek, to consider only inner
R(z), we enter C. Similarly, we can define 2-borders vertices v (or, rather, inner 0-borders (v, R)) which are
(/, R) of C, for a face / and a side R of /. not incident to any popular face of C.
Let (v,R) be such a 0-border, and let us continue
Let (v, R) be an inner 0-border of C (non-singular, to follow the notations introduced above. For each
formed by the transversal intersection of its three inci- 1 < i < _7 < 3, the curve 7,-j must contain a maxi-
dent surfaces, say o-1, a2, cr3). The corresponding vertex mal open x-monotone connected portion ßij having v
v is incident to (at least) three edges of C, which we de- as an endpoint, such that the 1-border (ßij,R'{j), where
note by ei2, ei3, and e23, where each e;j is a portion R'tj is the side of ßij consistent with Rij, is disjoint from
of the corresponding intersection curve jij = 0{ fl o~j, C. Let Zij denote the other endpoint of ßij.
for 1 < i < j < 3; moreover, each edge e,-j has a side We define the index of v, denoted j(v), to be the
Rij which is consistent with R, so that (e,j,i?,-j) is a number of points of intersections of CTI, a2, 0-3 which
1-border of C. If one of these curves, say 712, contains lie to the right of v (i.e., with x > x(v)). Clearly, 0 <
two edges, e\2, e'12, with respective sides R\2, R\2, such j(v) < s - 1.
that e12 and e'12 have v as a common endpoint, R\2 and We define K(,)(E), for j = 0,..., s - 1 to be the max-
R'12 are consistent with each other, and both (ei2, -R12) imum number of 0-borders (v,R) of any fixed cell of
and (e'12, R'12) are 1-borders of C, then, as is easily seen, •4(E), whose vertices v are inner vertices of index at
there is a face / on 03 which is incident to v and which most j. We also define K^(n) to be the maximum pos-
forms with both its sides 2-borders of C. We call such sible value for K^(E), over all collections E of n surface
a face a popular face of C, borrowing a notation from patches satisfying conditions (i)-(iv) (with the same b
[3, 5]; see Figure 1. Let us denote by 7r(E) the maxi- and s). Similarly, we define 7r^(E), for j = 0,..., s — 1,
mum number of inner vertices of popular faces bounding to be the maximum number of vertices with index at
a single cell of .4(E), and let w(n) denote the maximum most j of all popular faces bounding any fixed cell of
of 7r(E), over all collections E of n surfaces as above .4(E), where each such vertex is counted with multiplic-
(with the same s and b). (Strictly speaking, a vertex v ity, once for every incident popular face. We also define
can be incident to more than one popular face, in which 7r^'(n) to be the maximum possible value for 7r^^(E),
case we count it in 7r(E) with multiplicity, once for every over all collections E of n surface patches satisfying con-
incident popular face.) ditions (i)-(iv) (with the same b and s).
A major novel ingredient of the proof is the derivation Our method is to derive a recurrence relationship for
of a sharp upper bound on the number of vertices of pop- «(n), by bounding each of the functions K^ in terms

15
of K^'-1) (with a special handling of K^); the solution
of the resulting system of recurrences will yield the as-
serted bounds.
So let us fix an index j, and assume that the vertex
v under consideration has index at most j. In this case,
we incur an overhead of only 7r^(n), when we also add
to our counts vertices incident to popular faces. Several
cases can still arise:
(a) All three arcs ßij emerge from v in the direction of
increasing x (or all emerge in the direction of decreasing
x). In this case v is an ^-extreme vertex of C, as is
easily checked (using the general position assumption),
and Theorem 2.1 implies that the total number of such
vertices (and corresponding 0-borders) is 0(n2). We
will thus assume in the sequel that at least one of these
arcs emerges from v in the direction of increasing x, and
at least one arc emerges in the direction of decreasing
x. Figure 2: The dotted faces on the surface <j\ appear on
(b) At least one of the arcs ßij ends at a point Zij the boundary of C, and near both of them C lies, say,
which is either an endpoint of the original intersection above u\
curve jij, or a point of local z-extremum on that curve.
We then charge (v,R) to the point Zij, and note that
the number of such points is 0(n2), and that each such designated points, in their order along ß\i from v. All
point is charged only a constant number of times in this those points are inner vertices of .4(E), and it is clear
manner (e.g., along ßij it can be charged at most once that none of these vertices can be charged in this manner
for every side of ßij), thus implying that the number more than a constant number of times (along ß\2 each
of 0-borders (v,R) of this kind is only 0(n2). Again, such vertex can be charged at most twice for each side of
in what follows we assume that this situation does not ß\i)- By construction, each of the charged vertices lies
arise, which means, in particular, that each of the three at restricted level at most £, as is easily verified. Our
endpoints z,-j is a vertex of C\ more precisely, each Zij goal is thus to obtain an upper bound for the number
has a side R*- which lies across the third surface defining M of inner vertices of .4(E) that lie at restricted level
Zij from a side consistent with i?J-, such that {z-ij.R*-) < £; the number of 0-borders in the present subcase is
is a 0-border of C. See Figure 2. O(M/0-
(c) At least one of the arcs ßij, say for definiteness ß12, For this we apply the probabilistic analysis technique
is not intersected by the third surface a$. of [9, 25], in the same manner as in [17]. That is, we
Define the level of a point w in 3-space to be the choose a random sample 71 of r = n/£ surfaces of E, and
smallest number of surfaces of E whose removal makes construct the arrangement A(7Z). Let w be an inner
w belong to the closure of the cell containing Z in the vertex of *4(E) at restricted level A < £, and let Q be
resulting subarrangement. If tu is a vertex of .4(E) and a specific collection of A surfaces, none incident to w,
R is a side of w, we say that w (resp. (w,R)) lies at whose removal makes w a vertex of the cell containing
restricted level X(w) = k (resp. \((w, R)) = k) if by Z. The probability that w shows up as a vertex of
removing k surfaces from E, none of which is incident Cz(7l) is at least ("7^3)/("): out of the total number
to w, we make w a vertex (resp. make (w, R) a 0-border) (") of possible samples 1Z, consider those samples that
of the cell containing Z in the resulting subarrangement, contain the three surfaces forming w and do not contain
and if k is the smallest number with that property. any of the A surfaces of Q; for each of these samples
Let t denote the number of distinct surfaces of S that (and possibly for other samples as well), w is a vertex
intersect ßn- We fix some threshold parameter £ = £j, of Cz(R-)- Hence, we have
to be defined later (we will use a different parameter for
? /n-A-3\
each j), and consider the following two subcases: El r-3 ) FA < E\K(JI)\ < K(r) ,
(c.i) t > £: In this case we charge (v,R) to a block of A=0 VW
£ points of intersection between ß\i and the surfaces of
E, defined as follows. For each surface a intersecting where E[] denotes expectation (with respect to 71), and
/3i2, choose its point of intersection that lies nearest where FA is the number of vertices w of .4(E) at re-
to v along ßi2- We obtain at least £ such designated stricted level A. (Note that K(7Z) counts the number of
points, and we charge (v, R) to the block of the first £ 0-borders bounding C'z(7l), which is clearly an upper

16
bound on the number of vertices of that cell.) As in than j by assumption), we take w to be the point lying
[9, 25], one easily verifies that, for r = n/£, we have furthest from v along ßi2. Let t denote the number of
distinct surfaces of E, excluding cr3, that intersect ß\2.
We consider the following two subcases:
£FA = O(£3K(n/0); (d.i) t > £: In this case we charge (v,R) to a block of
A=0 £ vertices of the full arrangement .4(E) which lie along
in other words, the number of inner vertices of .4(E) /3i2, in complete analogy to the construction in case (c.i)
at restricted level < f is 0(£3/c(n/£)), which in turn above, except that the surface a3 is excluded from the
implies that the number of inner 0-borders (v, R) of C construction. Since each such vertex can be charged
in this subcase is 0(£2«;(n/f)). in this manner only a constant number of times, and
(c.ii) t < £: In this case, if we remove these t surfaces all these vertices lie at restricted level < £ + 1, as is
from the arrangement, v becomes a vertex of a popular easily checked, it follows, exactly as above, that the total
face of C. Indeed, zi2 has an appropriately consistent number of 0-borders v in this subcase is 0(£2«(n/£)).
(d.ii) t < £: In this case, if we remove these t surfaces
side i?*2 so that (z12, R*2) is a 0-border of C. When we
remove the t surfaces crossing ßi2, the cell C expands (without removing a3), the point w, together with a side
from R*2 towards v and 'reaches' the other side of v Rw consistent with R12, must form a 0-border (w,Rw)
of the cell containing Z in the reduced arrangement.
consistent with the side R'12 of ßu, making v a vertex
of a popular face (on 0-3) of the cell containing Z in Indeed, recall that we are assuming that the other end-
the reduced arrangement. To exploit this observation, point Z12 of /3i2 forms a 0-border (zi2,-R*2) of C, for a
%ve apply the following variant of the preceding random side R*2 lying across from a side consistent with R'12-
sampling argument. Fix a parameter r = n/£, and draw By assumption, the portion of /312 between w and 212 is
a random sample 72 of r surfaces of E. Let £'[72] be the not crossed by CT3, so, when the other t surfaces crossing
expected number of vertices in .4(72) of index < j which /3i2 are removed, the cell C expands from the side i?j2
are incident to popular faces of Cz(72) (counted with and 'reaches' w from 212 along the side {ßi2,R\2). We
the appropriate multiplicity). By definition, E'[R] < charge (v, R) to (w, Rw). Clearly, each such (w, Rw) is
Tr^\r). (Note that the index of a vertex does not change charged in this manner only a constant number of times.
when we pass to a subset 72, as long as the 3 surfaces We next estimate the number of 0-borders (w,Rw)
of this kind. We apply a random-sampling argument
defining the vertex belong to 72..) Now, using a similar
argument to the one given above, the probability that similar to those used above. That is, we fix a parameter
our vertex v will show up as a vertex of such a popular r = n/£, and draw a random sample 72 of r surfaces
of E. Let £"'[72] be the expected number of 0-borders
face of Cz(72) is > (VWC): of the (?) possible
ways of choosing 72., we consider those samples for which (w,Rw) of Cz(R), such that w has index < j — 1. By
0i, 02, 03 € 72., and none of the other t surfaces crossing definition, £"[72] = E[^-l\n)} < ««-^(r).
/?i2 is chosen in 72; as already noted, each such choice The probability that the charged 0-border (w,Rw)
(and possibly others as well) will make v appear as a will show up as such a 0-border of Cz(72) is >
vertex of a popular face of the cell under consideration. (nr"-f)/(r): 0f the (r) P0Ssible W8 °f choosing %,
Hence, we have we consider those samples for which 01,02,03 £ 72, and
none of the other t surfaces crossing ß\2 is chosen in
f fn-t-Z\ 72.; each such choice (and possibly other choices too)
will make (w,Rw) appear as a 0-border of Cz(72.), as
(=0 (") argued above. Hence, we have
where Gt is the number of 0-borders (v, R) in the full
arrangement that fall into the present subcase, with J2 ^-4P-Ht = 0(E"[R]) = Oi^-^r)) ,
j(v) < J an(i with exactly t surfaces crossing the corre-
sponding arc /3i2- Arguing exactly as above, we obtain, where Ht is the number of 0-borders (v, R) in the full ar-
for r = n/£, rangement that fall in the present subcase, with j(v) < j
and with exactly t surfaces crossing the corresponding

i> O(e^3)(n/0) arc /3i2 (excluding the corresponding surface 0-3). Ar-
guing as above, we obtain, for r = n/£,

in other words, the number of 0-borders in this subcase


YlHt = O(eKU-1\n/0);
is O(£M'')(n/0)- t=o
(d) In the remaining case (which can occur only if
j(v) > 0), the third surface a3 intersects ßi2 in at least in other words, the number of 0-borders (v, R) in this
one point w\ if there are several such points (no more subcase is O(£3K(j'_1)(n/0)-

17
four sides2 (assuming general position), and, by Theo-
rem 2.1, the number of such vertices, and hence also the
number of popular edges, is 0(n2). Moreover, if both
e\ and e2 emanate from v in the positive x-direction,
or if both emanate in the negative ^-direction, then, as
is easily checked, v must be a locally x-extreme ver-
tex of one of the two sides of /, so the number of such
vertices is also 0(n2). Hence, in what follows we may
assume that neither of the edges e\, e2 is adjacent along
a to another popular face of C, and that one of these
edges emanates from v in the positive x-direction and
one emanates in the negative x-direction.
As above, our method is to derive a recurrence re-
lationship for 7r(n), by bounding each of the functions
7r(;) in terms of 7r^-1^ (with a special handling of 7r(°));
the solution of the resulting system of recurrences will
Figure 3: Two adjacent popular faces /,/', giving rise yield the asserted bounds.
to a popular edge e2 So let us fix an index j, and assume that the vertex v
under consideration has index < j. By our assumptions,
for i = 1,2, the curve 7,- must contain a maximal open x-
monotone connected portion /?,- having v as an endpoint
Hence, summing over all cases, we obtain the fol- and satisfying the following property: let i?'+, R'f be
lowing recurrence for K^ (where, for j = 0, we put the two sides of ßi which are consistent with the two
K*--1) = 0 in the right-hand side): respective sides Rf, R~ of e,-; then /3; does not contain
any point at which both sides R'f~, R'~ lie locally in C.
cO'Vr^ = O(£2K(«/0
(n) = + e*l»(n/0 + Let Zi denote the other endpoint of ß{. By assumption,
^«"""(n/O + n +TlJ,("))' GO one of these arcs, say ß1, emanates from v in the positive
x-direction and the other emanates in the negative x-
In order to solve the recurrence (1) we first have to direction.
bound the functions TT^\n), which is done in the next Several cases can arise:
subsection. (a) At least one of the arcs ßi ends at a point z,- which
is either an endpoint of the original intersection curve
7i, or a point of local x-extremum on that curve. We
3.1 The Number of Vertices on Popular then charge v to the point Z{, and note that the num-
Faces ber of such points is 0(n2), and that each such point is
To bound the number of such vertices, we adapt the charged only a constant number of times in this manner,
analysis given above to bound the functions TT^(TI), thus implying that the number of vertices v of this kind
rather than the functions K^(n). is only 0(n2). In what follows we assume that this sit-
uation does not arise, which means, in particular, that
Let v be an inner vertex of a popular face / of the
z\ is a vertex of another popular face of C, whose two
cell C; assume that / lies on a surface a G S, and
sides are consistent with (appropriate extensions along
that the two other surfaces incident to v are <J\,Oi 6
71 of) R!i , R'{~, respectively.
S. As above, we may assume that v is non-singular
on any of these surfaces, and that these surfaces meet In the full version of the paper we distinguish and
transversally at v. Denote the two sides of / by R+ and analyze two additional cases: (b) ßi is not intersected
R~. Let 7,- = a Pi (7, for i — 1,2. Each 7; contains an by the third surface 02, and (c) the surface a2 intersects
edge e,- having v as an endpoint and bounding /. Let ßi in at least one point (which can occur only when
Rf, R~ denote the two sides of e,- that are consistent j(v) > 0). Due to lack of space, we omit further details
with R+, R~~, respectively. for these cases here, and we just summarize with the
resulting recurrence for TT^ (where, for j = 0, we put
If, say 71 has another edge e\ incident to v such that -1
7T' ) = 0 in the right-hand side):
(a) e[ bounds another popular face /' on a, and (b) /
and /' share the edge e^) then e2 is a popular edge of
C, meaning that all its four sides lie in C locally near
TU) (n) = 0{e^{.nlO + in2 + ^'-^(n/O) • (2)
e2 (see Figure 3). We claim that the number of popular 2
Strictly speaking, v is locally x-extreme in one of the four
edges of C is 0(n2). This follows from the observation portions of C into which these sides 'point'; we allow ourselves
that v must be a locally x-extreme vertex of one of these here and below this slight abuse of notation.

18
3.2 Solving the Recurrences Theorem 3.2 The combinatorial complexity of a sin-
gle cell in an arrangement of n algebraic surface
We next proceed to solve the recurrences (1) and (2). patches in 3-space, satisfying the conditions (i)-(iv), is
We start with the latter equation, fix some e > 0, and 0(n2+e), for any e > 0, where the constant of propor-
claim that its solution is 7r(j)(n) < BjU2+£, for j = tionality depends on e, s and b.
0,..., s - 1, where the constants Bj depend on e, j, and
on the maximum degree b. By definition, this implies
that 7r(n) < Bs^n2+e. 4 Zone Complexity
We prove this claim by induction on n. We first
rewrite (2), using a different parameter £,■ for each j, An interesting application of Theorem 3.2 is to bound
as the combinatorial complexity of the zone of a surface
in an arrangement of other surfaces in 3-space. Specifi-
7r(0)(n) < c^7r(n/£o) + c£0n2 and (3) cally, let E be a collection of n algebraic surface patches
M)( 2
< tfwin/tj) + ci3n + c^V^Hn/O) , in 3-space, and let a be another such surface, so that
the surfaces in E U {a} satisfy conditions (i)-(iv). The
j = l,...,s-l,
zone of a in .4(E) is the collection of all cells of -4(E)
that are crossed by a. The complexity of the zone is the
for appropriate positive constants c, £o, ■ • • , fs-ii with-
sum of the complexities of all its cells.
out loss of generality, we assume c > 1. We take £0 to be
sufficiently large, and put £,• = fjf, for j = 0,..., s - 1; Theorem 4.1 The combinatorial complexity of the
note that £,■ = ^_1, for j = 1,..., s - 1. We note that, zone of a in .4(E) is 0(n2+e), for any e > 0, where
by choosing the JB/S to be sufficiently large, we can as- the constant of proportionality depends on e, s andb.
sume that the claimed bounds hold for all n < £0- (E.g.,
choose the S/s to be larger than some appropriate mul- Proof. We extend the idea used in [12] for the anal-
tiple of £o, and use the fact that all the quantities we ysis of zones in 2-dimensional arrangements. That is,
want to estimate are bounded by 0(n3), where the con- assume first that o is a connected surface. We cut each
stant of proportionality depends only on the maximum <7j G E into a constant number of sub-patches along its
degree b of the surfaces and of their boundaries.) curve of intersection with a. If we shrink these pieces
For n > £o - we apply the induction hypothesis in the by a small amount, all the cells of the zone become
right-hand side of (3), and conclude that the asserted connected to each other, and form a single cell in the
bounds continue to hold for n too, provided that the arrangement of the new patches. Since these patches
following inequalities are satisfied: are easily seen to also satisfy conditions similar to (i)-
(iv), the asserted bound follows. If a is not connected, it
cBs
-i+ce0-e<B0, and consists of a constant number of connected components,
a and we apply the above argument to each component
'-B i-i < separately. □
ce ^ ce ^ c
^3 ^ B; 1,...,S-1.
Sj So

To achieve this, we choose -Bo > 2c£0 and J->Bi2 =


-1-E
, ^^ 5 Conclusion
^+})^^g-Bo , and require that the f;'s be sufficiently In this paper we have obtained a near-quadratic bound
large so that £g~" > 2scs . We leave it to the reader to for the combinatorial complexity of a single cell in an
verify that this choice of coefficients satisfies the above arrangement of n algebraic surface patches of constant
inequalities. This inductive step completes the solution maximum degree, each bounded by a constant number
of the recurrence for the functions TT^\n). of algebraic arcs of constant maximum degree as well.
In a similar manner we solve the recurrences (1). We This almost settles a long-standing conjecture, and pro-
show that the solution of these equations is n^\n) < vides a fairly satisfactory extension of the 2-dimensional
Ajn2+e, for j = 0,..., s — 1, where the constants Aj Davenport-Schinzel theory developed in [14]. Our proof
depend on e, j, and the maximum degree b. By def- extends recent techniques developed in [16, 17, 26], all
inition, this implies that n(n) < As-in2+e. For lack based on the probabilistic technique of [9, 25] for deriv-
of space, we omit the fairly routine inductive proof of ing bounds on the number of generalized '(< fc)-sets' in
these bounds. arrangements.
Using rather standard arguments (given in the full As noted in the introduction, our result has immedi-
version of this paper), one can show that the overall ate applications to the general motion planning problem
combinatorial complexity of C is dominated asymptot- with three degrees of freedom. That is, for rather gen-
ically by the above bound for the number of its inner eral systems with three degrees of freedom, the combi-
vertices. We thus obtain the main result of the paper: natorial complexity of the connected component of the

19
free configuration space, consisting of all robot place- [9] K. Clarkson and P. Shor, Applications of random sam-
ments which are reachable from some given initial free pling in computational geometry, II, Discrete Comput.
placement, is 0(n2+e), for any e > 0, where n is the Geom. 4 (1989), 387-421.
number of contact surfaces, as defined in the introduc- [10] M. de Berg, L.J. Guibas and D. Halperin, Vertical de-
tion. This still falls short of efficient construction of such compositions for triangles in 3-space, this volume.
a component (in near-quadratic running time, which is [11] H. Edelsbrunner, Algorithms in Combinatorial Geom-
one of the major open problems that we pose in this etry, Springer-Verlag, Heidelberg, 1987.
paper). However, at least we know that the complexity [12] H. Edelsbrunner, L. Guibas, J. Pach, R. Pollack, R.
of such a component is nearly an order of magnitude Seidel and M. Sharir, Arrangements of curves in the
smaller than the worst-case complexity of the entire ar- plane - Topology, combinatorics, and algorithms, The-
rangement, and, in most cases, also of the entire free oretical Computer Science^ (1992), 319-336.
configuration space. [13] H. Edelsbrunner, R. Seidel and M. Sharir, On the zone
Another open problem that the paper raises is to theorem in hyperplane arrangements, SIAM J. Com-
further improve the bound that we have obtained, to puting 22 (1993), 418-429.
the conjectured bound of 0(nXs(n)), or at least to [14] L.J. Guibas, M. Sharir and S. Sifrony, On the general
0(n2polylog(n)). Another open problem is to extend motion planning problem with two degrees of freedom,
our results to arrangements in d dimensions. We be- Discrete and Comput. Geom. 4 (1989), 491-521.
lieve that this is doable, and are currently exploring [15] D. Halperin, Algorithmic Motion Planning via Ar-
this problem. One main subproblem here is to extend rangements of Curves and of Surfaces, Ph.D. Disser-
Theorem 2.1 to higher dimensions. tation, Computer Science Department, Tel Aviv Uni-
Other open problems are to extend our analysis to versity, July 1992.
obtain sharp bounds on the complexity of many cells [16] D. Halperin and M. Sharir, New bounds for lower en-
in 3-D arrangements, and to derive bounds on the sum velopes in three dimensions, with applications to visi-
of squares of cell complexities in an entire arrangement; bility in terrains, Proc. 9th ACM Symp. on Computa-
see [2, 5] for related work. tional Geometry (1993), pp. 11-18. Also to appear in
Discrete Comput. Geom.
[17] D. Halperin and M. Sharir, Near-quadratic bounds for
References the motion planning problem for a polygon in a polyg-
[1] P.K. Agarwal, M. Sharir and P. Shor, Sharp upper onal environment, Proc. 34th IEEE Symp. on Founda-
and lower bounds for the length of general Daven- tions of Computer Science (1993), pp. 382-391.
port Schinzel sequences, J. Combin. Theory, Ser. A. [18] S. Hart and M. Sharir, Nonlinearity of Davenport-
52 (1989), 228-274. Schinzel sequences and of generalized path compression
[2] B. Aronov, J. Matousek and M. Sharir, On the sum schemes, Combinatorica 6 (1986), 151-177.
of squares of cell complexities in hyperplane arrange- [19] R. Hartshorne, Algebraic Geometry, Springer-Verlag,
ments, Proc. 7th Symp. on Computational Geometry New York 1977.
(1991), pp. 307-313. (To appear in /. Comb. Theory [20] M.W. Hirsch, Differential Topology, Springer-Verlag,
Ser. A.) New York 1976.
[3] B. Aronov, M. Pellegrini and M. Sharir, On the zone of [21] P. McMullen, The maximum number of faces of a con-
a surface in a hyperplane arrangement, Discrete Corn- vex polytope, Mathematika 17 (1970), 179-184.
put. Geom. 9 (1993), 177-186.
[22] J. Pach and M. Sharir, The upper envelope of piece-
[4] B. Aronov and M. Sharir, Triangles in space, or build- wise linear functions and the boundary of a region en-
ing (and analyzing) castles in the air, Combinatorica closed by convex plates: Combinatorial analysis, Dis-
10 (1990), 137-173. crete Comput. Geom. 4 (1989), 291-309.
[5] B. Aronov and M. Sharir, Castles in the air revis- [23] R. Pollack and M.F. Roy, On the number of cells de-
ited, Proc. 8th ACM Symp. on Computational Geom- fined by a set of polynomials, C.R. Acad. Sei. Paris, t.
etry (1992), 146-156. (To appear in Discrete Comput. 316, Serie I (1993), 573-577.
Geom.)
[24] J.T. Schwartz and M. Sharir, On the two-dimensional
[6] B. Aronov and M. Sharir, Translational motion plan- Davenport Schinzel problem, J. Symbolic Computation
ning of a convex polyhedron in 3 dimensions, this vol- 10 (1990), 371-393.
ume.
[25] M. Sharir, On fc-sets in arrangements of curves and
[7] J. Bochnak, M. Coste and M-F. Roy, Geometrie surfaces, Discrete Comput. Geom. 6 (1991), 593-613.
Algebrique Reelle, Springer-Verlag, Berlin 1987.
[26] M. Sharir, Almost tight upper bounds for lower en-
[8] B. Chazelle, H. Edelsbrunner, L. Guibas, M. Sharir and velopes in higher dimensions, Proc. 34th IEEE Symp.
J. Snoeyink, Computing a single face in an arrange- on Foundations of Computer Science (1993), pp. 498-
ment of line segments and related problems, SIAM J. 507. Also to appear in Discrete Comput. Geom.
Computing 22 (1993) (in press).

20
On Translational Motion Planning in 3-SpaceH

Boris Aronov' Micha Sharir t

Abstract faces, and put q — Y^i=i It- Let


Let B be a convex polyhedron translating in 3-space Pi = Ai® (-B) = {a-b\aeAi,beB}
amidst k convex polyhedral obstacles A\,...,Ak with
be the Minkowski sum of Ai and —B, for i — I,.. .,k,
pairwise disjoint interiors. The free, configuration space
let V = {Pi}f=i be the resulting collection of these so-
(space of all collision-free placements) of B can be repre-
sented as the complement of the union of the Minkowski called expanded obstacles, and let U = (J-=1 Pi be their
sums Pi = Ai 6 (-B), for i = 1,..., k. We show that union. As is well known, the complement C of U (also
the combinatorial complexity of the free configuration called the common exterior of T) represents the free
space of B is 0(nk log k), where n is the total complex- configuration space FP of B, in the sense that, for each
ity of the individual Minkowski sums Pi,..., P^. The point z £ C, the placement of B, for which the reference
bound is almost tight in the worst case. We also derive point O lies at z, does not intersect any of the obstacles
an efficient randomized algorithm that constructs this Ai, and all such free placements are represented in this
configuration space in expected time 0(nk log3 k). manner.
As is well known, the combinatorial complexity (i.e.,
the number of vertices, edges, and faces on the bound-
1 Introduction ary) of each Pi is at most <d{pqi), so the sum of the
complexities of the expanded obstacles is n = O(pq). In
Let Ai,..., Ah be k closed convex polyhedra in three practice, n is usually much smaller than pq. The bounds
dimensions with pairwise disjoint interiors, and let B derived in this paper depend only on n and k, and not
be another closed convex polyhedron, which, with no on p and q.
loss of generality, is assumed to contain the origin O. Our main result is that the combinatorial complexity
In the context of motion planning, B is a 'robot' free of the union U, and thus also of FP = C, is 0(nk log2 k)
to only translate in 3-space, and the Ai's are obstacles and Q,{nka(k)) in the worst case. This should be com-
which B must avoid. Suppose Ai has qi faces, B has p pared to the recent bound obtained by the authors [4]
on the combinatorial complexity of the union of any k
*Work on this paper by the first author has been supported
by NSF Grant CCR-92-11541. Work by the second author has convex polyhedra in 3-space with a total of n faces; it
been supported by NSF grant CCR-91-22103, by a Max Planck is shown there that the maximum complexity of such a
Research Award, and by grants from the U.S.-Israeli Binational union is 0(k3 + riklog2 k) and fi(£3 + nka(k)). Thus
Science Foundation, the G.I.F. — the German-Israeli Foundation
the convex polyhedra Pi arising in the context of trans-
for Scientific Research and Development, and the Fund for Basic
Research administered by the Israeli Academy of Sciences. lational motion planning have special properties that
'Department of Computer Science, Polytechnic University, yield the above improved bound.
Brooklyn, NY 11201 USA. The problem of obtaining sharp bounds for the com-
'School of Mathematical Sciences, Tel Aviv University,
binatorial complexity of the union of Minkowski sums,
Tel Aviv 69978, Israel, and Courant Institute of Mathematical
Sciences, New York University, New York, NY 10012 USA. as above, has been open for the past eight years, and
has been studied during this period in several papers.
Permission to copy without fee all or part of this material is It was raised by Kedem et al. [16] (see also [20]), where
granted provided that the copies are not made or distributed for the 2-dimensional version of the problem was success-
direct commercial advantage, the ACM copyright notice and the fully tackled. Related work on the 3-dimensional case
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing is described in [2, 3, 4, 10, 14, 19]. Except for the
Machinery. To copy otherwise, or to republish, requires a fee papers [4, 14] (and parts of [2]), these papers studied
and/or specific permission.
different (though related) problems, involving the com-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA plexity of the lower envelope or of a single cell in an
© 1994 ACM 0-89791-648-4/94/0006..$3.50

21
arrangement of triangles in 3-space. A recent paper of Let an intersection edge be an edge of the intersection
Halperin and Yap [14] analyzes the complexity of the of the boundaries of two distinct expanded obstacles.
union of Minkowski expansions, as above, for the case Each such edge e meets the boundary of the union U
where B is a box, and obtains a bound of 0(n2a(n)). in at most k — 1 intervals, as it intersects each of the
Our result is general, and thus almost settles this open remaining k — 2 polyhedra in at most one interval, and
problem, except for the polylogarithmic factor in our the complement (within e) of the union of these k — 2
upper bound; we conjecture that the correct bound is intervals consists of at most k — 1 intervals.
0(nka(k)). We introduce a real parameter t £ [0, 1] (we refer to
We also consider the algorithmic problem of efficient
it as 'time'), define Pi(t) = Ai®(-tB), for i = 1,.. .,k,
construction of FP. We present an efficient and rather
and U(t) = \Ji-i Pi(t), and let C(t) denote the comple-
simple randomized algorithm that computes FP in ex-
ment of U(t). Note that the general position assumption
pected time 0(nk log k). The algorithm and its anal-
does not imply that polyhedra {Pi(t)} are in general po-
ysis are adapted from a very similar algorithm given in
sition, for all values of t. It does imply, though, that, at
[4] for constructing the union of arbitrary convex poly-
any given t, we can have at most one degenerate contact
hedra in 3-space.
between the Pi(t)'s. Such a contact can be expressed as
The paper is organized as follows. In Section 2 we
a polynomial equality in t and in the coordinates of the
bound the number of components and local minima of
vertices of the J4;'S and of B. Moreover, there is only a
C. The analysis of the topology of U, and of several
finite number of values of t at which such a degeneracy
related structures constructed from a family of convex
can occur. For example, if to > 0 is the first instant
polyhedra, continues in Section 3. Section 4 establishes
at which P{(t) and Pj(t) meet, then Pi(t) n Pj(t) must
the main result of the paper, namely the bounds on the
consist of a single point, for otherwise we would have at
combinatorial complexity off/. Section 5 describes the
least two algebraically-independent polynomial equali-
randomized algorithm for computing the boundary of
ties holding simultaneously, which is forbidden by the
U and Section 6 concludes with some remarks and open
general position assumptions. Moreover, such an initial
problems.
single-point contact of Pi(t) and Pj(t) must occur ei-
ther between a vertex of one of these polyhedra and a
2 The Number of Holes of U face of the other, or between two edges, one from each
and Local Extrema of C polyhedron. Similarly, it is easy to verify that the first
contact between three growing obstacles must occur at
We first simplify the analysis by assuming that the given
a single point.
polyhedra A{ and B are in general position, meaning
that the coordinates of the vertices of the Ai's and of B Before continuing, we recall a well-known fact: Let
are all transcendentals that are algebraically indepen- P and Q be two convex polyhedra. Denote by Afp the
dent over the rationals. As argued in [4], the general normal diagram (also known as the Gaussian diagram)
position assumption involves no real loss of generality. of P; this is the decomposition of the Gaussian sphere
Without loss of generality, in what follows we will also <5>2 of orientations into regions, each consisting of the
assume that U is bounded and that C has thus a single outward-directed normal directions of all planes sup-
unbounded component. porting P at some vertex (each edge of Afp is a great
To establish our upper bound on the complexity of circular arc consisting of the outward-directed normal
the union [/, it clearly suffices to bound the number of directions of all planes supporting P at some edge, and
vertices of U. Moreover, it suffices to bound the number each vertex of Afp is the outward-directed normal di-
of vertices of U which are formed by the intersection rection of some face of P). The normal diagram MQ of
of the relative interiors of three faces of three distinct Q is defined analogously. Then the overlay of Afp and
polyhedra Pi, because the number of all other vertices, A/Q is the normal diagram of the Minkowski sum PfyQ.
namely, vertices of the original Pi's and intersections of This implies that the combinatorial structure (i.e., the
edges of the original Pi's with faces of other expanded number of, and incidence relations between, faces of all
obstacles, is only O(nk). This is a consequence of the dimensions) of P 0 Q is completely determined by the
following easy proposition (cf. [4]): orientations of the faces of P and of Q and by their
incidence structures. Hence, in particular, the combi-
Proposition 2.1 The number of vertices of Pi H Pj,
natorial structure of Pi(t) — A, (B (—tB) is the same
summed over all Pi, Pj £ V, is 0(nk).
for all t > 0. This implies the following property. For
We first bound the number of connected components t £ [0, 1], let s(t) denote the Minkowski sum either of a
of the complement C of U (the common exterior ofV). fixed edge of A{ and (—t) times a fixed vertex of B, or
Under the assumptions made above, C has a unique un- of a fixed vertex of A, and (—t) times a fixed edge of B.
bounded component, so it suffices to estimate the num- If s(to) is an edge of P{(to), for some to £ (0, 1], then
ber of bounded components of C, i.e., "holes" in (/. s(t) is an edge of Pi(t) for all t £ (0, 1].

22
We want to keep track of the number of holes of U(t) the aiy-plane, so p will be the only point in its neighbor-
as t increases from 0 to 1. At t = 0, the number of holes hood with this z-coordinate.) A local maximum is de-
of U(t) is 0. As t increases, the holes shrink, so the fined similarly. The following theorem is a consequence
number of holes can increase only when a component of of Theorem 2.4:
C(t) is split into two components.
Theorem 2.5 The number of local maxima and min-
Lemma 2.2 A component of C(t) can split into two ima of the closure C of C is 0(nk).
components only at times t when an edge s(t) of some
P({i) meets an intersection edge. e(t) of two other poly- Proof: We prove the claim only for the number of lo-
hedra, Pi(t), Pj(t), at some point v, so that the inter- cal minima of C, since the treatment of local maxima
section ofC(t) with a small neighborhood of v is discon- is fully symmetric. Any bounded convex component
nected. K of C has exactly one local minimum (which is also
the global minimum of A'), because K does not have
Proof: Easily follows from an observation of de Berg et a lowest horizontal edge, as implied by our general po-
al. [5] that a split can occur only when some Pi(t), Pj(t), sition assumption. Hence the number of such minima
P{(t) come to intersect for the first time, and from gen- is 0(nk), by Theorem 2.4. This also applies to com-
eral position assumption. We omit the details. □ ponents of C all of whose horizontal cross sections are
Suppose that such a configuration does indeed arise connected, because such a component has at most one
at some time t, and suppose that e(t) is formed by the local (and global) minimum as well. So we will proceed
intersection of a pair of faces of Pi(t) and of Pj(t). The to bound the number of local minima of those com-
edge s(t) intersects both Pi(t) and Pj(t) at two respec- ponents that have at least one disconnected horizontal
tive intervals having a common endpoint. Lemma 2.2 cross section. We will in fact prove that the number of
then implies that the two intervals s(t) D P{(t) and such minima is only 0(k2).
s(t) n Pj(t) must have disjoint relative interiors. Sweep C with a plane IT parallel to the zy-plane and
moving upwards, in the positive z-direction, and keep
Lemma 2.3 // at time t the intervals s(t) f) Pi(t) and
track of the number / of connected components of 61ri7r.
s(t)r\Pj(t) intersect, then s(t')nPi(t') and s{t')C\Pj{t')
This number is initially l (when IT is below all vertices
also intersect, for all t' > t.
of C). I increases by l when ir sweeps through a local
Proof: Omitted in this version. minimum of C, or when a connected component of CC\ir
splits into two subcomponents; / decreases by 1 when
Lemmas 2.2 and 2.3 imply that, for each t at which a
IT sweeps through a local maximum of C, or when two
connected component of C is split into two components,
components of C f~l 7r merge into a single component.
there exist two polyhedra, Pi(t), Pj(t), and an edge s(t)
The events at which components may split or merge
of another polyhedron Pt(t), such that the two intervals
occur only when TT sweeps through the topmost or bot-
s(f)nPj(l) and s(t)C\Pj(t) meet at a common endpoint,
tommost vertex of the intersection of some pair P,, Pj
and continue to overlap for all t' > t. Thus the number
of expanded obstacles, for some i ^ j. The number of
of such 'hole-splitting' events, involving the same edge
such events is clearly bounded by 2(*) = 0(k2).
s(t) of any of the expanded polyhedra, is at most k — 3,
Consider the following dynamic scheme for assigning
so the total number of holes that the union can have is
weights to each component of C fl TT. When TT sweeps
at most 0(nk). That is, we have shown:
through a local minimum point of C, a new component
Theorem 2.4 The. number of connected components of of CDTT is created, and is assigned weight — 1. When two
the common exterior of Minkowski sums of k polyhedra, components of C fl TT merge, the weight assigned to the
as above, is 0(nk). new component is 2 plus the sum of the weights of the
merged components. When a component shrinks and
Remark: We do not know if this bound is tight, as the disappears, its final weight is added to a global count.
best lower bound we can construct is Cl(k2). When a component is split into two subcomponents,
Let S be any closed polyhedral set in 3-space in gen- each of them is assigned weight 1 + ^, where w is the
eral position. (In this paper we only consider polyhedral weight of the split component.
sets bounded by a finite number of edges, vertices, and We claim that, at any given time during the sweep,
faces.) For a point p, let a neighborhood of p in S be the weight of any component of CD IT is always at least
the intersection of 5 with a ball centered at p, whose — 1, and the weight of a component that was formed by
radius is smaller than the distance from p to any edge, a splitting or merging operation is non-negative. (We
face, or vertex of S not incident to p. A point p of ,$' is refer to components of C that have a cross-sectional
a local minimum if it is a point of smallest z-coordinate component of the latter type as interesting components.)
in some neighborhood of p in S. (Under the general Both claims are easy to prove by induction on the sweep
position assumptions, no face or edge can be parallel to events. Now suppose that, at some point during the

23
sweep, there are s local minima of C below w, so that
the cross-sectional components that they have created
have already been split or merged, and that the num-
ber of such splittings and mergings below ix is N (which
is at most 0(k2)). Then the total weight of the com-
ponents of C n 7T that have been formed by splittings
and mergings, plus the total weight of all the interest-
ing components of C that have terminated below w, is
easily seen, by induction on the sweep events, to be
2N — s. As claimed above, this weight is non-negative,
thus s < 2N = 0(k2). When the sweep plane passes
the topmost vertex of C, this inequality shows that the
number of local minima of C contained in interesting
components is 0{k2). Adding the number of local min-
ima in non-interesting components of C, we obtain the
bound asserted in the theorem. □

3 On the Structure of Levels in A(V) Figure 1: A family of convex polygons; lßl\ U^2\ and
(/(3) are shaded successively darker.
Define the arrangement A(V) of the collection V of the
expanded obstacles to be the decomposition of space
into vertices, edges, faces, and 3-dimensional cells, in- is easy to see that v must be a local maximum of C^1'.
duced by the faces of the polyhedra of V; for more The lemma follows. We omit the rather easy details. O
details on arrangements, see [2, 9]. For each s — Applying Theorem 2.5, we thus obtain:
0,..., Ar — 3, let Corollary 3.2 If V is a collection of polyhedra with a
total of n faces, arising as Minkowski expansions of a
(/(•') = {J{pu n... n Pjs 11 < h < j2 < ... < j, < k}. collection of k convex polyhedra, with pairwise-disjoint
interiors, by another convex polyhedron, then the num-
Furthermore, put C& = IR3 \ U^ and Z/5"1) = ber of local minima and the number of connected com-
dCW = of/*». We call Z,(s) the s-lh level of the ar- ponents of [/(3) is 0{nk).
rangement A{V). We also denote by C>$> the closure of
C^s\ Note that U^ = (/ is just the union of the poly- We next study the topological structure of (A2). We
hedra ofV, C^> = C is their common exterior, and l/°) begin by deriving a topological property of general poly-
is the common boundary of U and C. These definitions hedral sets. Let S be a closed polyhedral set in general
are illustrated in the planar case in Figure 1. position; in particular, no two vertices of S have the
In this section we prove some geometric and topologi- same z-coordinate. Note that a neighborhood of a point
cal properties of U^2' and LA3), which will be used in the p in S, as defined in the previous section, is star-shaped
proof of our main theorem (Theorem 4.2 in Section 4). with respect to p, so its intersection with a horizontal
plane through p is also star-shaped and thus connected.
Lemma 3.1 The number of local minima and the num- A merge point of S is a point p £ S such that, for any
ber of connected components of U^3\ for any collection neighborhood of p, any horizontal plane lying below p
of k polyhedra with a total of n faces in general position, and sufficiently close to it intersects the neighborhood in
are bounded by the number of local maxima of C^' plus a disconnected set. We define the merge number m(p) of
0(k2). p to be the number of connected components in this in-
tersection, less 1. By star-shapedness of neighborhoods,
Proof: f/(3) is the union of triple intersections of poly- m(p) is well defined. (We can naturally extend this defi-
hedra in V. Thus a local minimum of [/(3) is necessar- nition to any non-merge point p' by putting m(p') = 0.)
ily a local minimum of one of these triple intersections. We will apply our analysis to S = U^2\ so in this case
(This immediately bounds the number of local minima m{p) < 2 for any point in the set, as is easily implied
by (3).) Since the number of all pairwise intersections by the general position assumption on V.
of polyhedra in V is only (2), it suffices to consider The first Betti number of ,S', ß\ (■$'), is the rank of the
only those minima that are formed as intersections of first singular homology group of S [11]. Informally, it is
three distinct polyhedron boundaries. By the general the number of 'linearly-independent' homotopy classes
position assumption, such an intersection must be the of closed cycles in ,5', where each class consists of all
unique common point v of the relative interiors of three cycles homotopic within S to some given cycle and not
faces of three distinct polyhedra in V. In this case, it contractible in S.

24
Proposition 3.3 The first Betti number ßi(S) of any to the number of components of the intersection of a
compact polyhedral set S in general position does not neighborhood of v in S with the plane z — t1, lying
exceed the sum of the merge numbers of its vertices. just below v, namely, it is equal to m(v) + 1. Hence
ß\(S<[t]) - ß\(S<[t']) < m(v), as claimed. This con-
Proof: Let z : S —> IR be the z-coordinate function. cludes the proof of Proposition 3.3. □
For a,b G IR, let S[a] = ^({a}), S[a,b]
_1
--I
(Ml),
and S<[a] = z ((—oo,a]). Lemma 3.5 For a collection of k arbitrary convex
We begin the proof by stating a polyhedral analogue polyhedra in general position, with a total of n faces,
of a basic fact of Morse theory (cf. [18, Theorem 3.1]). /?i([/(2)) is at most proportional to k2 plus the num-
The proof is an easy and standard exercise in topology, ber of local minima of U^. Hence, for collections of
we omit it in this version. Minkowski expansions, as above, this number is 0{nk).

Fact 3.4 Let S be a triangulated polyhedral set in gen- Proof: Applying Proposition 3.3 to S = U^2\ we con-
eral position. If S[a,b] contains either no vertex of S, clude that it suffices to bound the number of merge
or exactly one vertex v and the z-coordinale of v is a, points of (/(2). This is because the merge number of
then S[a] is a deformation retract1 ofS[a,b]. any point of U^ is at most 2, as follows from the gen-
eral position assumption (and already noted above). Let
We now triangulate S. This may add new vertices v € dll^ be a merge point; then «must be a vertex of
to S, but their presence does not affect the statement A(V). We may assume that v is a vertex formed by the
of the proposition, since they all have merge number 0. transversal intersection of some three faces, F{, Fj, F{,
Let z = c be a plane below all the vertices of S. Since belonging to three respective distinct expanded polyhe-
S is assumed to be bounded, we have S<[c] = 0. It dra Pi, Pj, P{. (Indeed, any other vertex is either a
suffices to prove that, as t increases from c to +oo, the vertex of some P,- or of some P,- l~l Pj, for i, j = 1,..., k.
Betti number ßi(S<[t]) increases at (the z-coordinate No vertex of the former type can be a merge point of
of) each vertex of S by at most the merge number of any U^'\ as is easily seen. A vertex of the latter type,
the vertex, and never changes otherwise. on the other hand, can be a merge point only if it is the
Fact 3.4 implies that ßi(S< [t]) changes only when the bottommost point of P,- D Pj, as is readily verified using
plane z = t sweeps through a vertex of ,S'; indeed, if the general position assumption. Thus the number of
t' > t is such that no vertex of S has z coordinate these merge points is at most (2).) An easy case analy-
in (M']> then S<[t] is a deformation retract of S<[t'], sis shows that any vertex v of this form can be a merge
and thus S< [t] and ,$'< [t1] have the same homologies point of f/(2) only if it is a local minimum of U^3\ We
[21, Corollary 1.12]. Let v be a vertex of ,S'. We want omit the details. □
to bound the difference ßi(S<[t]) - ßi(S<[t']), where
t = z(v) and t' < t is appropriately close to t.
4 The Complexity of the Union
One can easily verify that the transformation from
S<[t'] to ■$'<[<] is equivalent, topologically, to gluing a Having all this machinery available, we now turn to the
ball D centered at v to S<[t'], choosing the size of D to analysis of the complexity of U. The initial portion
be such that it intersects all triangles of Tf at least one of the analysis is identical to that of [4], and here we
of whose vertices approaches v as t' —>■ t, and no other only go quickly through its main steps; we refer the
triangles. An easy topological calculation2 yields reader to that paper for full details. Specifically, let
i>{k, n) denote the total number of edges of U contained
ßl(S<[t]) = ßl(S<[t']UD)< m
Ui<i<j<<: dPiOdPj, maximized over all collections V
of k Minkowski sums, as above, with a total of ?; fares,
ßi(S<[t']) + ß!(D) + ßo(S<[t'] n D) - 1. in general position. We apply the inductive analysis
Here ßa(X) is the number of connected components of scheme of [4], which yields the following recurrence for
X. Now ßy{D) = 0 and ß0(S<[t'] l~l D) is exactly equal i>(k,n):

'For a topological space X, a subspace Y C X is called a k


deformation retract of X if there exists a continuous map p : (k-2)yb(k,n)<^2^(k-l,n-ni) + 7J>(-l\k,n) , (1)
X X [0,1] -> X such that p(x,0) = x, for all x 6 X, p(X,l) = Y, l
i=\
and p(y, 1) = y for all y £ Y; see, for example, [21, pp. 15,19].
2
It is easy to show that, for two path-connected topological where ii{ is the number of faces of P,-, for i = 1,..., k,
spaces X andr, ßi{X uY) < ßi(X) + ßi (Y) + ß0(X n Y) - 1.
An elementary proof of this fact can be found in [15]. If X is not and where rp^^k^n) is the maximum, taken over all
path-connected, but Y is, the statement follows by repeated ap- collections V as above, of the quantity ]T\ w(f), with
plications of the path-comiected version. Note that in our case D
the sum ranging over all faces / of ZA1); here w(f) —
is path-connected but 5<[i'] need not be. The statement also eas-
ily follows from arguments based on the Mayer-Vietoris sequence; max(4e/—6, 0) and ej is the number of edges on df that
see, for example, Vick [21, p. 22]. lie on the boundary of the only polyhedron containing /

25
Tb w

lllllllll
\d

F
assssh&M II

Figure 2: A special quadrilateral Q.

in its interior. (This definition of ilM\k,n) is not used Lemma 4.1 For collections V of arbitrary convex poly-
here, and is given only for the sake of completeness.) hedra in general position, the number of special quadri-
We next estimate tj>(l\k, n), exactly as in [4], by using laterals is at most proportional to nk plus the number of
the same inductive scheme. This leads to the recurrence local minima ofU^\ Hence, for Minkowski expansions,
as above, this number is 0(nk).
k

(Jb-2)^(1)(Jb,n) = ^2^1\k-l,n-ni)+0(nk+^2\k,n)) Proof: Let Q be a special quadrilateral defined by


i= \ {F{Q),P'{Q),P"{Q)), as above. The boundary OQ
(2) of Q is necessarily a bounding cycle of a connected
where i}^2\k,n) is the number of "special quadrilater- component of d(P' H P") n L(1). Following an argu-
als" of the following form, maximized over all collec- ment similar to that of [4], we observe that the over-
tions V as above. Such a quadrilateral Q is schemat- all number of special quadrilaterals Q whose bound-
ically depicted in Figure 2; it is defined by a triple aries are contractible to a point in the corresponding
(F(Q), P'(Q), P"(Q)), where P' = P'(Q), P" = P"{Q) sets d(P'(Q) fl P"{Q)) n Z/1) is just 0{nk), since in the
are distinct polyhedra of V, and F — F(Q) is a face process of contracting dQ one has to encounter a ver-
of another polyhedron, P(Q), of V\ the intersection tex of P'(Q) n P"{Q), and it is easily checked that no
P' fl P" Pi F is the quadrilateral Q, which is assumed to vertex of this form is charged by more than one con-
be disjoint from all other polyhedra, the four vertices of tractible quadrilateral, for fixed P' and P". The claim
Q are vertices of the union U, two opposite edges of Q now follows from Proposition 2.1. We thus need to
are contained in dP'P\F and in the interior of only P", consider only non-trivial quadrilaterals, namely those
and the two other opposite edges of Q are contained in whose boundary is not contractible in the above fash-
dP" fl F and in the interior of only P'. In other words, ion.
if we remove P' and P" from V and replace them by Let Q be such a non-trivial special quadrilateral. By
P'nP", then dQ appears on the boundary of the union definition, Q does not meet the interior of lf(3\ but is
of the modified collection, and the union of all poly-
hedra in V, except for P' and P", contains Q on its
boundary. In the notation of Section 3, Q is a special P' n p"
type of face of L^2\ The structure of U^ locally near
Q is schematically depicted in Figure 3.
In the case of general convex polyhedra, the authors
give a bound of 0(k3 + nk) for ^2\k,n), and show
that it is tight in the worst case [4]. However, we show
here that the special properties of A(V) in the case P' c\P
of Minkowski sums, as established in Section 3, lead
to an improved bound of only 0(nk). Plugging this
bound into the recurrences (1) and (2), we obtain, fol-
lowing the analysis of [4], i}M\k,n) = 0(nk\ogk) and
il>(k,n) = 0(nk \og2 k), which thus completes the proof P" n p
of the upper bound of our main result.
We actually prove the following stronger result:
Figure 3: U^ near a special quadrilateral Q.

26
fully contained in IJ(2\ Moreover, dQ C dll^ (see Fig- occurs because previous cuts, along other special quadri-
ure 3). "Cut" U^ along Q (or, rather, shift Q slightly laterals incident to K, have separated K from all other
away from P{Q) and then cut U^ along the shifted adjacent components of U^3'. In this case, we charge the
quadrilateral). We apply this cutting procedure to ev- current cut to one of these preceding cuts. It is easily
ery non-trivial special quadrilateral, in some arbitrary checked that no cut is charged in this manner more than
order. Since, by definition, the relative interiors of any once. This implies that the number of special quadrilat-
pair of distinct special quadrilaterals are disjoint, it fol- erals in this subcase is at most equal to the number of
lows that the cuts do not interfere with each other. non-trivial special quadrilaterals of the preceding types
Each cut of IJ(2\ performed along some non-trivial (those decreasing ß\{U^2') and those appearing in case
special quadrilateral Q, has one of two possible effects: (i) above).
Either the first Betti number of U^2' decreases by 1, or This completes the proof for collections of general
the number of connected components of U^2' increases convex polyhedra. In the case of Minkowski expansions,
by 1, according to, respectively, whether points of U^2' as above, Corollary 3.2 implies that the number of spe-
lying on the two sides of Q sufficiently near Q can or can- cial quadrilaterals is 0{nk). O
not be connected by a path that avoids Q in the current We have thus shown that, in the case of Minkowski ex-
version of {/(2). The number of cuts is thus proportional pansions, ij)(2\k,n) = 0(nk), which in turn completes
to the increase in the number of connected components the analysis of ij>(k,n) and yields the upper bound in
of f/(2) plus the decrease in the first Betti number of the main result of the paper:
[j(2\ as effected by the cuts. Since none of the cuts
can increase the first Betti number of IJ(2\ it follows, Theorem 4.2 Let A\,.. .,A\- be k convex polyhedra in
by Lemma 3.5, that the latter quantity (the decrease in 3-space with pairwise disjoint interiors, and let B be
ßi(U^)) is bounded by 0(k2) plus the number of local another convex polyhedron. The combinatorial complex-
minima of lf( K ity of the union of the Minkowski sums A{ 9d (-P), for
To estimate the former quantity, consider a cut per- i = 1, . . ., k, is 0(nk log k), where n is the overall com-
formed along a special quadrilateral Q, defined by the plexity of the individual Minkowski sums. In the worst
triple (F(Q),P'(Q),P"(Q)), which increases the num- case, this complexity can be Q,(nka(k)).
ber of components of the current version of U^2>. Since
Q is non-trivial, "dragging" Q along d{P'(Q) D P"(Q)) Remark: The preceding argument assumes general
in either direction encounters a third polyhedron, and position of the polyhedra Ai and B. Nevertheless, the
thus also a distinct component of U^3>. To be more pre- theorem also holds for collections of polyhedra not in
general position, as can be argued using a perturbation
cise, one of the new components of lA2\ denoted £/} ,
scheme [4]. We omit the details in this version.
contains, near Q, points belonging to P(Q) fl P'{Q) H
Proof of the lower bound: We make use of a planar
P"(Q), so U\ contains a component of IJ(3\ The other
construction, given in [1], of k convex polygons with
component of U^2\ denoted U\ , is bounded, near Q, a total of 7i edges, so that their union has il(na(k))
by the connected portion K of d{P'{Q) f\P"{Q)) n^1' edges and vertices. Additionally, the polygons can be
incident to Q. It is clear that K must also be incident arranged so that their union is star-shaped, say with
(before any cut was made) to some third polyhedron, respect to the origin, and at least some fixed fraction
for otherwise K would have been homeomorphic to a of its vertices are visible from the point (0, +oo), in the
disk whose boundary corresponds to dQ, and Q would strong sense that there exists some fixed angle ß > 0
then have been a trivial quadrilateral, contractible to a (independent of k and n), so that, for any such visible
point in K C d(P'(Q) (~l P"(Q)) n L^\ There are now vertex v, the wedge whose apex is v, whose bisecting
two subcases to consider: ray is parallel to the positive y-axis, and whose angle is
(i) The component [/£ also contains a component of /?, does not meet any of the polygon interiors.
lj(3>. (Note that no component of U^3' is ever split by Without loss of generality, assume that k is even and
the cuts, because all special quadrilaterals are disjoint n > 4.5k. We start our three-dimensional construc-
from the interior of U^3\ and the cuts, performed along tion with a set of k/2 convex polygons in sy-plane with
slightly shifted copies of the quadrilaterals, are thus dis- n — 3fc edges altogether, so that their union U' has
joint from lf(3\) The total increase in the number of Q,(na(k)) vertices visible from (0,+oo,0) in the above
components of [A2) formed by cuts of this kind cannot strong sense. By scaling, we may assume that the entire
exceed the number of components of IJ(3\ and can thus construction is contained in the unit disk about the ori-
be bounded by the number of local minima of U^3'. gin in the xy-plane. Now slightly shift and expand the
(2)
(ii) The component (/^ does not contain a component polygons in the 2-direction, each by a different amount,
of f/(3). Since the corresponding boundary K, as de- to produce pairwise-disjoint flat and thin convex prisms,
fined above, was incident, before any cut was made, to all contained in the slab \z\ < 0.1, say; see Figure 4. The
another component of U^3\ it follows that this subcase second set of k/2 polyhedra consists of points (0,M, i),

27
M'

(b)

Figure 4: The lower bound construction, not to scale: (a) a view from above; (b) a side view.

for i — 1,.. .,k/2 (or, rather, tiny tetrahedra centered Corollary 4.3 The combinatorial complexity of the
around these points), where Af > Hs an appropri- free configuration space of a convex polyhedron B, trans-
ate parameter. This gives us a collection {^ijf-j of lating in 3-space amidst a collection of k convex obsta-
k pairwise-disjoint convex polyhedra with a total of n cles, A\,..., At, having pairwise disjoint interiors, is
faces. The polyhedron B is a tetrahedron with vertices 0(?ik\og k) and can be £l(nka(k)) in the worst case,
(0,0, ±M') and (±M',M,0), where M' < M/4 is an- where n is the overall complexity of the Mmkowski sums
other parameter, chosen so that the dihedral angles of Ai e(-ß), fori = l,...,k.
B at its horizontal and vertical edges are both equal to
some /?' < ß; note that, by the choice of M', we have Remarks: (1) Going back to the parameters p and q
tan Y < 1/4, an inequality that will be needed below. that count the number of faces of B and of all the J4;'S
See Figure 4 for an illustration. together, we can state the upper bound of Theorem 4.2
Let v be a vertex of U' visible from (0, +oo, 0) in the and Corollary 4.3 as 0(pqk log k), and the lower bound
above sense. By construction, we can place B so that as Q(qka(k)) for constant p. A sharper dependence of
its vertical edge ev touches the two prisms correspond- the bound on p (when q and k are fixed) remains an
ing to the two polygons whose boundaries intersect at v; open problem.
moreover, we can slide B vertically upwards and down- (2) Our proof of Theorem 4.2 makes use of the fact
wards, by a total distance of close to 2M', so that e„ that the Pi's are Minkowski sums only in the proof of
maintains these two contacts, while the interior of B re- Theorem 2.4. Hence our analysis also applies to any
mains disjoint from any of the shifted prisms. It is easily collection of k general convex polyhedra with a total
seen that, for an appropriate choice of M, independently of n faces, with the property that, for any subset of r
of the choice of v, the boundary of B will meet each of of these polyhedra, the number of components of the
the tiny tetrahedra Ai around the points (0, M, i) during complement of their union is 0(rm), where m is the
the vertical motion. Moreover, our choice of parameters total number of faces of those r polyhedra. We pose it
also implies that the intersection of B with the vertical as an open problem to find other natural examples of
line x = 0,y = M has length less than 2tan|- < 1/2, collections of convex polyhedra with this property.
so, when B touches one of these Ai's, its interior re-
mains disjoint from all the other polyhedra Ai] see Fig-
5 Efficient Construction of the Union
ure 4(b) for an illustration. In other words, each of the
appropriate fi(n«(fc)) vertices of U' gives rise to £l(k) We next describe an efficient randomized algorithm for
placements of B where it makes three contacts with the constructing the union U of a collection V of expanded
Ai's, while its interior remains disjoint from all these polyhedra, as above. The input to the algorithm con-
polyhedra. Since each of the resulting Q(nka(k)) place- sists of the original polyhedra Ai and ß, so we first com-
ments of B corresponds to a vertex of the union of the pute the individual Minkowski sums P{ = Ai (\) (—B),
expanded polyhedra Ui-i -^» ® (—B), the lower bound for i = 1,..., k. This computation can be done in sev-
of the theorem follows. D eral ways, the most efficient of which is by using the
technique of Guibas and Seidel [13]. Each P,- can be

28
constructed in time 0(p + qt +7ij), where n8- is the com- ward modifications, for trapezoids defined by 1, 2, 3,
plexity of P{. Thus the cost of this stage is 0(pk + q + n). or 4 polyhedra. Adapting the analysis of [4], and using
The main algorithm is essentially identical to the one the Clarkson-Shor probabilistic technique [8], one easily
given in [4] for the case of general polyhedra; for the sake shows:
of completeness, we briefly review the algorithm here, Claim 1: The probability that a canonical trapezoid r,
and revise its analysis to exploit the improved combina- lying in the plane containing F and having weight w, is
torial bounds derived above. created during the incremental construction is 1/(4 )•
Claim 2: The overall number Tw of canonical trape-
The algorithm proceeds as follows. We first compute zoids with weight less than w, over all faces F of the
all the pairwise intersections P,- fl Pj, for 1 < i < j < k. given polyhedra, is 0(w3nk\og2 —).
This can be done in time 0(nk), as shown in [4]. In
The expected running time of the algorithm, over all
additional 0(nk) time, we can also extract, for each
faces F, is thus
face F of a polyhedron P; £ V, the collection QF of
the convex polygons Qj = F C\ Pj, for j ^ i. The set
s
UF — F \ Uj3£i Qj i the portion of F that appears on
dU, so the algorithm computes the sets UF, over all
faces F. Reconstructing the boundary of U from this
where tw is the total number of canonical trapezoids
information is relatively straightforward, by gluing the
whose weight is exactly w. Since tw = Tw+\ — Tw (with
sets UF to each other in an appropriate manner. The
To = 0), we can rewrite the above sum as
construction of the sets UF is done exactly as in [4]:
For each face F of some Pi £ V, we choose a random i-5
order of the polyhedra in V \ {P,} and insert the poly- Olnk+Y^
gons Qj G QF, one by one, in the corresponding order, w=0
(w + 4)(w + S)(w + 2)
maintaining the complement of their union (within the
jfc-5
plane containing F) as we go. For this we use the same w37ik log 2 k
technique as in [7, 12, 17], which maintains a vertical oink+^2
^ (w + 4)(iu + 3)(u> + 2){w + 1) J
decomposition (relative to some direction within F) of
the complement into trapezoids; see [4] for more details.
At the end of the incremental procedure, it is relatively O (nk +Y— log2 - ) = 0{nk log3 jfc) .
\ ^-^ w w
straightforward to truncate the resulting complement to \ w=\ /
within F. The cost of this truncation is easily seen to Hence we have:
be proportional to the complexity of F plus the number
of final trapezoids forming the complement of \JQF- Theorem 5.1 The union of a collection of k expanded
Thus this step does not increase the asymptotic com- convex polyhedra in 3-space, as above, with a total of
plexity of the algorithm. In the motion planning ap- n faces, can be computed in randomized expected time
plication, mentioned below, we also need support for 0(nk log3 k).
efficient point location queries in UF- NO additional pro-
cessing is needed, as the data structure used to compute We omit here the rather easy details of the following
UF, as adapted from the algorithms of [7, 17], already
application to motion planning:
supports logarithmic-time point location queries. Corollary 5.2 Given a convex polyhedron B, free to
The cost of the algorithm is proportional to the num- translate among k convex polyhedral obstacles with
ber of trapezoids that are created during the execution pairwise-disjoint interiors, the entire free configuration
of the algorithm, plus the sum of their weights, plus the space of B can be computed and preprocessed in ran-
initial cost 0(7ik) of computing all the collections QF- domized expected time Oinklog k), where n is the total
Here the weight of a trapezoid r C F is the number of number of vertices of the Minkowski sums of the obsta-
polygons Qj £ QF that intersect the relative interior cles and of —B. Then, given two placements, (j, £2,
of r; each of them either fully contains r or its bound- of B, we can decide, in 0(k\ogn) time, whether B can
ary crosses r. Define a canonical trapezoid r C F to translate in a collision-free manner from £1 to (,2-
be a trapezoid that occurs in the trapezoidal decompo-
sition of the complement (within the plane containing 6 Conclusions
F) of the union of some subset of QF- Such a trape-
zoid is defined by between 1 and 5 polyhedra—P,- plus In this paper we have shown that the combinatorial
the at most 4 polyhedra that define its sides and cor- complexity of the union of the Minkowski sums of k
ners in the plane containing F. The following argument convex polyhedra in three dimensions, having pairwise-
applies only to canonical trapezoids defined by exactly disjoint interiors, with another convex polyhedron, is
5 polyhedra. It has to be repeated, with straightfor- O(nklog k) (and Q,(nka[k)) in the worst case), where

29
7i is the overall complexity of the individual Minkowski [6] B. Chazelle, An optimal algorithm for intersecting
sums. We have also presented an efficient and rather three-dimensional convex polyhedra, SIAM J. Computing
simple randomized algorithm for computing the union 21(4)(1992), 671-696.
in expected time 0(nk log3 k). Both the combinatorial [7] B. Chazelle, H. Edelsbrunner, L. Guibas, M. Sharir, and
bound and the algorithm have applications to transla- J. Snoeyink, Computing a single face in an arrangement of
tional motion planning of a convex polyhedral object in line segments and related problems, SI AM J. Computing
a 3-dimensional environment amidst polyhedral obsta- 22 (1993), 1286-1302.
cles, and we have also discussed these applications. [8] K. Clarkson and P. Shor, Applications of random sam-
These results almost settle a long-standing open prob- pling in computational geometry II, Discrete Comput.
lem, but raise a whole collection of new open problems Geom. 4 (1989), 387-421.
(some of these problems have already been mentioned [9] H. Edelsbrunner, Algorithms in Combinatorial Geome-
in earlier sections). One open problem is to tighten try, Springer-Verlag, Heidelberg, 1987.
the remaining gap between the lower and upper bounds
[10] H. Edelsbrunner, L. Guibas, and M. Sharir, The up-
on the complexity of the union. We conjecture that per envelope of piecewise linear functions: Algorithms and
the correct worst-case bound is Q(nka(k)). There are applications, Discrete Comput. Geom. 4 (1989), 311-336.
also the problems of designing an efficient determinis-
[11] M. Greenberg and J. Harper, Algebraic Topology: A
tic algorithm for computing the union, and of improving
First Course, Benjamin-Cummings, Reading, MA, 1981.
the query performance of the motion planning algorithm
mentioned above. [12] L. Guibas, D. Knuth, and M. Sharir, Randomized in-
cremental construction of Voronoi and Delaunay diagrams,
The more challenging and interesting open problems,
Algorithmic^ 7 (1992), 381-413.
however, involve generalizations and extensions of our
results and techniques. First, what is the combinatorial [13] L. Guibas and R. Seidel, Computing convolutions by
complexity of the union of Minkowski sums Ai $ B, reciprocal search, Discrete Comput. Geom. 2 (1987), 175-
193.
where the Ai's are k convex polyhedra with pairwise
disjoint interiors, and B is a ball? Even the special [14] D. Halperin and C.K. Yap, Combinatorial complexity
case where the Ai's are lines seems to be open; in this of translating a box in polyhedral 3-space, Proc. 9th ACM
case we want to bound the combinatorial complexity Symp. on Computational Geometry, 1993, 29-37.
of the union of k congruent infinite cylinders, where [15] G. Hotz and J. Seilen, On algebraic computation trees
the conjecture is that this complexity is near-quadratic and Betti numbers, Manuscript, 1993.
in k. This problem arises in motion planning, when [16] K. Kedem, R. Livne, J. Pach and M. Sharir, On the
applying a standard heuristic of enclosing the moving union of Jordan regions and collision-free translational mo-
(rigid) object by a ball, and planning the motion of the tion amidst polygonal obstacles, Discrete Comput. Geom.
enclosing ball. 1 (1986), 59-71.
[17] N. Miller and M. Sharir, Efficient randomized algo-
Acknowledgements rithms for constructing the union of fat triangles and of
pseudo-disks, manuscript, 1991.
We wish to thank Dan Halperin for useful discussions [18] J. Milnor, Morse Theory, Princeton University Press,
on the problem, and Jifi Matousek and Igor Rivin for Princeton, NJ, 1963.
helpful suggestions on matters of topology.
[19] J. Pach and M. Sharir, The upper envelope of piecewise
linear functions and the boundary of a region enclosed by
References convex plates: Combinatorial analysis, Discrete Comput.
Geom. 4 (1989), 291-309.
[1] B. Aronov and M. Sharir, The common exterior of con-
vex polygons in the plane, manuscript, 1994. [20] M. Sharir, Efficient algorithms for planning purely
translational collision-free motion in two and three di-
[2] B. Aronov and M. Sharir, Triangles in space, or build-
mensions, Proc. IEEE Symp. on Robotics and Automation,
ing (and analyzing) castles in the air, Combinatorica 10(2)
1987, pp. 1326-1331.
(1990), 137-173.
[21] J.W. Vick, Homology Theory: An Introduction to Alge-
[3] B. Aronov and M. Sharir, Castles in the air revisited,
braic Topology, Academic Press, New York, 1973.
Proc. 8th ACM Symp. on Computational Geometry, 1992,
pp. 146-156. Also to appear in Discrete Comput. Geom.
[4] B. Aronov and M. Sharir, The union of convex polyhedra
in three dimensions, Proc. 34th IEEE Symp. on Foundation
of Computer Science, 1993, pp. 518-529.
[5] M. de Berg, J. Matousek, and O. Schwarzkopf, Piece-
wise linear paths among convex obstacles, Proc. 25th ACM
Symp. on Theory of Computing, 1993, pp. 505-514.

30
Motion Planning amidst Fat Obstacles *
(extended abstract)
t t
A. Frank van der Stappen Mark H. Overmars

Abstract Robot motion planning considers the problem of finding a


collision-free path for a robot B in a workspace W with ob-
We present an efficient and simple paradigm for motion plan- stacles £ from an initial to a final placement, i.e., a path that
ning amidst fat obstacles. The paradigm fits in the cell decom- avoids collision of B with the obstacles. The motion planning
position approach to motion planning and exploits workspace problem is often studied as a problem in the configuration
properties that follow from the fatness of the obstacles. These space C, which is the space of parametric representations of
properties allow us to decompose the workspace, subject robot placements. The free space FP is the subspace of C of
to some constraints, rather than to decompose the higher- points that represent placements of the robot in which it does
dimensional free space directly. A sequence of uniform steps not intersect any obstacle in £. The problem of finding a
transforms the workspace decomposition into a free space de- collision-free path for B corresponds to finding a continuous
composition of asymptotically the same (expectedly small) curve in FP (or its closure) connecting the points represent-
size. The approach applies to robots with any fixed number ing the initial and final robot placement. The combinatorial
of degrees of freedom and turns out to be successful in many complexity of FP largely influences the complexity of finding
cases: it leads to nearly optimal O(nlogn) algorithms for such a curve.
motion planning in 2D, and for motion planning in 3D amidst In [11], we examine the role of fatness in motion planning.
obstacles of comparable size. In addition, we obtain algo- We show that the combinatorial complexity of the free space
rithms for planning 3D motions among polyhedral obstacles, FP is linear in the number of obstacles if these (stationary)
running in 0(n2 log n) time, and among arbitrary obstacles, obstacles are fat and satisfy certain weak additional assump-
running in time 0(n3). tions, whereas it would be much higher if the obstacles are not
fat. The additional assumptions mainly require the obstacles
and the robot to be of constant complexity, and the robot to be
1 Introduction not too large compared to the obstacles. The obstacle fatness
and the additional assumptions provide a realistic framework
Fatness turns out to be an interesting phenomenon in com- for efficient motion planning.
putational geometry. Several papers discuss the surprising A question that immediately comes to mind when consider-
impact of fatness of the objects under consideration on com- ing the combinatorial result of [11] is whether this reduced
binatorial complexities and algorithm efficiencies. Fat ob- complexity opens the way to efficient motion planning algo-
jects are compact to some extent, rather than long and thin. rithms for such realistic environments. To answer this impor-
Examples of the influence of fatness are described in papers tant question, we have considered various existing (planar)
by Alt et al. [1] and Matousek et al. [5] which show that the motion planning algorithms and examined the influence of
combinatorial complexity of the union of geometric figures obstacle fatness on their efficiency. The boundary-vertices
is low if the figures are fat. Overmars [6] presents an efficient retraction algorithm by Sifrony and Sharir [10] for a ladder
algorithm for point location in fat subdivisions. moving in a planar workspace with polygonal obstacles runs
* Research is supported by the Dutch Organization for Scientific Research in time 0(K logn), where K is the number of pairs of ob-
(N.W.O.) and by the ESPRIT III BRA Project 6546 (PROMotion). stacle corners that lie less than the length of the ladder apart.
'Department of Computer Science, Utrecht University, P.O. Box 80.089, Fatness of the obstacles causes K to be only 0(n), whereas
3508 TB Utrecht, The Netherlands. it would be 0(n2) for arbitrary obstacles. The boundary cell
Permission to copy without fee all or part of this material is decomposition algorithm by Avnaim, Boissonnat, and Faver-
granted provided that the copies are not made or distributed for jon [2], running in time 0(n3 log n) for a constant complexity
direct commercial advantage, the ACM copyright notice and the polygonal robot amidst arbitrary polygonal obstacles, can be
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing shown to run in O(nlogn) time in the realistic setting of
Machinery. To copy otherwise, or to republish, requires a fee fat obstacles, due to the bounded local complexity (see e.g.
and/or specific permission. [9, 10]) of the workspace caused by the fatness. The 0(n5)
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
31
algorithm by Schwartz and Sharir [7] for planning the motion property for a collection of fat objects placed in R . More-
of a ladder or a polygonal robot amidst polygonal obstacles over, we prove a low complexity bound for arrangements of
can be shown to run, unmodified, in time 0(n2) if the ob- sufficiently tight wrappings of fat objects. Such arrangements
stacles are fat, whereas a minor modification enhances the play an important role throughout this paper.
efficiency to a running time of 0(n log n) [12, 13].
Algorithms for efficient motion planning in 3D workspaces 2.1 Fatness
are scarce: approaches in contact space, like the algorithms
mentioned above by Sifrony and Sharir, and by Avnaim, Contrary to many other definitions of fatness in literature, the
Boissonnat, and Faverjon, were never shown to generalize to definition given below applies to general shapes in arbitrary
higher dimensions. General approaches to motion planning dimension. It involves a parameter k which supplies a quali-
(e.g. by Schwartz and Sharir [8]) are computationally ex- tative measure of fatness: the smaller the value of k, the fatter
pensive. Three-dimensional workspaces imply at least three- the object must be.
dimensional configuration spaces with arrangements defining
the free portions. Naturally, the structure of such higher- Definition 2.1 [fc-fatness]
dimensional arrangements is considerably more complex to Let E C Rd be an object and let k be a positive constant.
understand, let alone to subdivide the free arrangement cells The object E is k-fat if for all hyperspheres S centered inside
into simple subcells or catch their structure in some one- E and not fully containing E:
dimensional roadmap. At this point, however, fatness comes
k ■ volume(E fl S) > volume(S).
to our help to provide us with a very beneficial property of
the workspace, which in fact also led to the enhanced perfor-
The definition forbids fat obstacles to be long and thin or to
mance of the planar motion planning algorithms: the bounded
have long or thin parts.
local complexity of the workspace implied by the fatness of
the objects makes it possible to partition the workspace W The following "proximity lemma" will be crucial in the rest
(rather than the configuration space) into regions R such that ofthispaper. For a sketch of the proof we refer to [11], where
the free part of the configuration space cylinder obtained by a similar lemma is proven.
lifting R into configuration space has constant complexity.
Lemma 2.2 Let £ be a set of non-intersecting k-fat objects
Moreover, the bounded local complexity also establishes ex-
in R and letc > 0 be a constant. Then the number of objects
istence of small partitions into such regions.
E G £ with diameter at least 5 intersecting any hypercubic
We formalize and exploit the workspace properties outlined box with side length c ■ 5 is bounded by a constant depending
above to obtain a paradigm for planning the motion of a con- on k and c.
stant complexity robot moving amidst constant complexity
fat obstacles. The paradigm follows the cell decomposi- In other words, when all objects have diameter at least S,
tion approach to motion planning. The size of the resulting any hypercube with side length c ■ 5 contains only a constant
decomposition of the free space into simple subcells is deter- number of objects. This workspace property resembles a
mined by the size of some constrained workspace partition. property that is referred to as bounded local complexity [9].
The running time of algorithms based on the paradigm de- The motion planning paradigm outlined in the section will
pends on the time to find such a partition. In Section 2 we actually work for any set of obstacles satisfying Lemma 2.2,
discuss some geometric preliminaries. Section 3 explains the not only for fat obstacles.
paradigm and its context and shows how its performance de-
pends on the size of a constrained partition of the workspace.
Section 4 discusses the construction of small partitions for 2D
2.2 Wrappings of fat objects
workspaces with arbitrary fat obstacles and 3D workspaces
Sufficiently tight wrappings of objects play a crucial role
with polyhedral fat obstacles, leading to O(nlogn) and
throughout this paper. Apart from providing the justification
0(n2 log«) motion planning algorithms respectively, inde-
that the paradigm for motion planning amidst fat obstacles
pendent of the number of degrees of freedom of the robot.
presented here indeed works, the wrappings also help in find-
We end the section by mentioning a nice additional result,
ing efficient instances of the paradigm.
and, finally, draw some conclusions in Section 5.
An e-wrapping of an object E is an enclosing shape of E,
with the property that the distance from the wrapping to E
2 Preliminaries: fatness and wrappings never exceeds e.
Definition 2.3 [e-wrapping]
In this section we recall the definition of fatness introduced Let E C Rd and let e G R+. Any A satisfying E C A C
in [11] and formulate a lemma stating a useful object density { p G R | d(p, E) < e } is an e-wrapping of E.

32
The complexity of a scene of n disjoint k-fat objects is clearly
0(n). If we expand the objects in some way then they will
start intersecting, and eventually the combinatorial complex-
ity of the scene will increase. We may expect, however,
that the complexity will remain 0(n) if we expand the fc-fat
objects by some bounded amount. Theorem 2.4 states the
circumstances that lead to this result. An obvious way to
express a bound on the expansion of an object E is to state
that the expanded object is an ^-wrapping of the object E
itself, for some bounded positive e.
Theorem 2.4 Let £ be a set ofn non-intersecting k-fat ob-
jects in Rd of constant complexity each. Let 8 be a lower
bound on the diameters of the objects E G £ and let c > 0
be some constant. Assume that a constant complexity (c • 8)-
wrapping A(E) is given for every object E G £. Then:

(a) the complexity of the arrangement .4(A) ofall wrapping


boundaries dA(E) is 0(n), c-S Et "Ei °E,

(b) every point p G Rd lies inside at most 0(1) wrappings Figure 1: The object E{ can be fully enclosed in a box
ME)- with side length 8E, ■ The (c • <5)-wrapping of Ei (with bold
boundary) lies completely inside a concentric box with side
Proof: We assume, to prove the (a)-part, that the objects
length (2c + 1) • 8Et, because 8 < SEt. A wrapping of some
in £ are ordered by increasing size: E\,..., En. We intend
other obstacle Ej can only intersect the wrapping of E, if it
to count for each object E{ the subspaces of dimensions 0 to
intersects the concentric box as well. By repeating the same
d-1 that are defined by the intersection of dA(Ei) and wrap-
reasoning, the object Ej itself must then intersect the outer
ping boundaries dA(Ej) with j > i. Two (c • <5)-wrapping
concentric box with side length (4c + 1) • 8Et.
boundaries dA(Ei) and dA(Ej) (i < j) can only intersect
if the objects Ei and Ej are less than 2c • 8 apart. By the fact
that 8 is a lower bound on all object diameters, Ei and Ej
must also be less than 2c • 8E, apart, which in turn implies 3 Motion planning amidst fat obstacles
that Ej must have non-empty intersection with the hypercube
with side length (4c + 1) • 8E, having a smaller Et-enclosing
A number of cell decomposition-based motion planning al-
hypercube with side length 8El at its center (see Figure 1
gorithms (see e.g. [7, 8]) use a projection-like approach to
for a 2D example). Application of Lemma 2.2 yields that
partition the free space, i.e., they (recursively) decompose
there can only be a constant number of such Ej's, so there is
a lower-dimensional subspace of the configuration space C
at most a constant number of wrapping boundaries dA(Ej)
and lift the decomposition regions into C. The free part of the
(j > i) that intersect dA(Ei). By the additional assumption
resulting cylinders is subsequently partitioned into a number
that all wrappings have constant complexity, there is only a
of simple subcells. The objective is to keep the number of
constant number of subspaces of dimension between 0 and
d - 1 defined by the intersection of dA(Ei) and wrapping subcells as low as possible.
boundaries dA(Ej) (j > i). Adding the contributions of all Our paradigm for motion planning amidst fat obstacles fits
wrappings amounts to a total of 0(n) subspaces of dimen- in the approach outlined above. The circumstances that we
sions 0 to d - 1 in the arrangement .4(A). The linear bounds consider allow for a base decomposition in the workspace
on the number of these subspaces imply the same bound of whose regions correspond to cylinders in configuration space
0{n) on the number of d-faces in .4(A), making the total in which the free part is easily decomposable into (a small
combinatorial complexity of the arrangement 0(n). number of) simple subcells. Below we first summarize the
The (b)-part follows immediately from the proof of the (a)- realistic assumptions that guarantee the feasibility of the ap-
part. Let Ei be the smallest object for which the point p G R proach.
lies inside the wrapping A(Ei). Since there is only a con- We consider a not too large robot B with a constant number /
stant number of wrappings of larger objects intersecting Ei's of degrees of freedom moving in a d-dimensional Euclidean
wrapping, the point p can be in no more than a constant num- workspace amidst n k -fat obstacles E G £■ Furthermore, we
a
ber of additional wrappings. assume that no part of the robot B can collide with any other
part of B. Some point O G B is appointed to be the refer-

33
ence point of the robot. Our paradigm applies to situations B to be in contact with E. Because pB < b ■ Smin, it follows
where the robot's configuration space C can be defined as from Theorem 2.4 that the arrangement A(G) of grown ob-
the Cartesian product of its d-dimensional workspace W and stacle boundaries dG(E, pB) (E G £) has complexity O(n)
some other space D (of dimension at least / - d), and each of the arrangement's d-faces is the intersection of
only 0(1) grown obstacles.
C = W x D,
If we take some arbitrary subset R of the workspace W,
such that the position of the robot's reference point in the then the subset will intersect a number of grown obstacle
robot's workspace is part of the specification of its placement. regions. The set of obstacles for which the grown obstacle
A placement Z of the robot can thus be written as Z = region intersects the set R will be referred to as R's coverage
(2w ,ZD), where Zw G W = Rd and ZD G D. In cases of Cov(R).
a free-flying robot this assumption will be satisfied.
The reach pB of a robot B is defined to be the maximum Definition 3.3 [coverage Cov(R)]
Let R C W = Rd.
distance from the reference point O G B to any point in B in
any placement Z of B. More formally:
Cov(R) = {Ee£\RnG(E,pB) ^ 0}.
Definition 3.1 [reach pB of a robot B]
Let Z\\J be some arbitrary position of the reference point 0 A direct consequence of the conclusion that each d-face of
of the robot B. Then the reach ps of the robot B is defined as »4(G) is the intersection of only 0(1) grown obstacles is
that the workspace W of the robot can be partitioned into
Pß = sup max d(p,Z\j), regions R with \Cov(R)\ = 0(1). In a general setting such
ZD£D PeB[(zw,zD)]
a partitioning could be impossible as their may be points that
where B[Z] stands for the set of points in W covered by B lie in w(l) grown obstacles simultaneously. Partitionings
when placed at Z. of the robot's workspace into constant complexity regions
with constant size coverage provide a first step towards a
In other words, the reach pB of a robot B is the maximum decomposition of the free space into constant complexity
distance that any point in the robot B can ever have to the subcells. We refer to workspace partitions of this kind as
reference point, which is also equal to how far the robot cc-partitions (constant-size coverage, constant complexity).
can reach, measured from its reference point. Naturally, the
reach is independent of the actual position of the reference Definition 3.4 [cc-partition]
point. Using the notion of the reach of a robot, we state A cc-partition V of a workspace W with obstacles £ is a par-
the additional assumption that the robot is not too large: the tition of W into regions R satisfying the following additional
reach pB of the robot B should not exceed b ■ Smin for some constraints:
reference point O G B and some constant b, where 5min is a
lower bound on the diameter of the obstacles in £. • \Cov(R)\ = 0(l),
If either the obstacles are non-fat or the robot is arbitrarily
• R has constant complexity.
large, the robot B with its reference point O fixed at some
point p G W may be able to touch all obstacles E G £. The
circumstances summarized above, however, make this im- The cc-partition Vw of the workspace W can be lifted into
possible: the robot is able to touch only a constant number of a cylindrical decomposition of the configuration space C by
obstacles. (This follows quite easily from Theorem 2.4.) As taking the Cartesian product of the partition Vw and the
a result, the workspace can be partitioned into regions where space D. The specific properties of a region R G Vw. i-e-. its
the robot can only touch a constant number of obstacles. Note constant complexity and constant-size coverage, are shown
that B will definitely be unable to touch the obstacle E if it is below to imply a constant descriptional complexity of the free
further away from E than its reach pß. We define the notion part FP n (R x D) of the configuration space cylinder RxD.
of grown obstacles to formalize this observation. The maximal connected components of FP n (R x D) are
adequate subcells in a cell decomposition of the free space as
Definition 3.2 [grown obstacle G(E, p)] they allow for easy path finding within their interior, due to
Let E be an obstacle in Rd and let p G R+. The p-grown their constant complexity and connectedness. Free subcells
obstacle E is defined as: in a single configuration space cylinder RxD can only be
adjacent to free subcells in a cylinder implied by a region
G(E,p) = {pe-Rd\d(p,E)<P}. R! that is adjacent to R in the cc-partition of the workspace
W. As both subcells have constant complexity, their shared
Clearly, G(E, pB) is a pß-wrapping of E. Now the robot's boundary must also have constant complexity and, as a result,
reference point must lie inside G(E, pB) in order for the robot allow for simple crossing from one subcell into another one.

34
Algorithm FatMot outlined below exploits the ideas summa-
rized in the previous paragraph. The algorithm consists of
two parts. The first part is a computation in the workspace
that aims at finding a, hopefully small, cc-partition VW of the W
workspace W with obstacles £. More precisely, it computes
a graph (Vw, -EW) consisting of a set VW of closed regions
and a set Ew = { (R, R') G VW x VW I OR n dB! ^ 0 }
of adjacencies of VW's regions1. Finally, the graph must be
accompanied by the computed function Cov : VW -> V{£),
linking the coverage Cov(R) to each region R G VW- The
actual "shape" of the first part of Algorithm FatMot depends
on the specific workspace W and type of obstacles in £ un-
der consideration, as does the computation time T(n) that is
spent in this phase. The computation time T(n) turns out to
highly affect the efficiency of the entire Algorithm FatMot,
hence, a thorough investigation of instances of W and £ is
justified. This is the subject of the next section. Desc(R')
The remaining steps of Algorithm FatMot take place in con-
figuration space, where the cc-partition graph (VW, EW) and Figure 2: The relation between the cc-partition graph
the function Cov are used to deduce a connectivity graph (VW, -EW) in the workspace W at the top, and the connectiv-
CG = (Vc,Ec) consisting of a set of constant complexity ity graph (Vc, Ec) in the configuration space at the bottom.
regions Vc that partition the set of free placements FP, and Each node R G VW defines at most 0(1) nodes A G Vc,
the set Ec = { (A, A') G Vc x Vc | 6A (~l dA' £ 0 }. The collected in a set Desc(R). Two nodes A and A' in Vc can
sizes of the sets Vc and Ec are of the same order of magni- only be connected if the corresponding nodes R and R! in
tude as the sets VW and Ew respectively: \Vc\ = 0(|VW|). VW are connected, so A\ may be connected to all nodes in
\Ec\ = 0(\Ey/\). The outline of the second part is, con- Desc(R'), but A\ and A4 cannot be connected.
trary to the first part, independent of the workspace W and
obstacles £ under consideration.
Crucial to the validity of the approach sketched by Algorithm
FatMot is a rather simple observation regarding constraint
ALGORITHM FATMOT
surfaces in configuration space. Let us consider the surface
Find a cc-partition graph (Vw, EW) and compute Cov; f<t>,$ of placements in which a robot feature <f> touches a
Vc := 0; feature <J> of some obstacle E. A substantial part of the
Ec := 0; representation of a robot placement is the position, in the
for all R G VW do workspace W, of the robot's reference point. This position
1. Desc(R) := 0; must be less than ps away from E, otherwise B would be
2. for all E G Cov(R) do unable to touch E. As a result, a point p = (pw,Pc) G
for all features <f> of B and $ of E do W x D lying on the constraint surface /^$ satisfies pw G
compute constraint surface /^,$; G(E,PB).
3. compute the arrangement A of surfaces /<£,$;
4. use A to compute FP D (R x D); Lemma 3.5 Let <j> a robotfeature and let $ be a feature of an
5. for all maximal connected components A obstacle E, such that the placements in which <f> is in contact
ofFPn(i?x D)do with $ define a hypersurface /^:$ in C, then:
5.1. Vc :=VCU{A}; U,*CG(E,pB)xD.
5.2. Desc(R) := Desc(R) U {A};
forall(fli,Ä2) G £wdo An implication of Lemma 3.5 is that a configuration space
for all Ax G Desc{Rx) A A2 G Desc(R2) do cylinder R x D can only be intersected by constraint sur-
if dAi DdA2^® then Ec := Ec U {(Al, A2)}. faces /«£,$, for which $ is a feature of some E G Cov(R).
By the constant-size coverage of a region R G VW and the
Figure 2 gives a pictorial explanation of Algorithm FatMot. constant complexity of both B and each obstacle E G £, the
1
number of constraint surfaces /«/,_$ intersecting a cylinder
We do not distinguish between a node in the graph and the region that is
represented by that node, hence if we speak of a node R (or A) we actually
Rx D with Re VW, is bounded by a constant. Since each
mean the node representing the region R (or the free subcell A). constraint surface is assumed to have constant complexity,

35
the entire arrangement of constraint surfaces inside R x D Z\ — (Ziw, Z\D) to another placement Z2 = (Z2w, Z2D)"
has constant complexity. Together with the constant com- basically reduces to a point location query with Ziw and
plexity of the cylinder R x D itself - following from R's Z2w in VW to find Ri 3 Z\SN and R2 9 Z2w- Hence,
constant complexity - this implies the constant complexity of only point location in the (2D or 3D) workspace is required,
FP n (R x D). Steps 1-5 in the first for-loop compute the which can be done efficiently. After that it takes 0(1) to find
0(1) (constant complexity) maximal connected components Ai B Zi using Desc{Rx) and A2 3 Z2 using Desc(R2),
ofFPD(RxD). A possible way to compute this free part (in followed by a search in the connectivity graph (Vc, Ec) for
constant time) could be to apply the techniques from [8] to a sequence of subcells connecting Ax to A2. The constant
the constant number of constraint hypersurfaces intersecting complexities of the subcells and of the common boundaries
the cylinder R x D. Each step is easily verified to run in of pairs of adjacent subcells facilitate the transformation of
0(1) time. The set Desc(R) stores the nodes in (Vc, Ec) the subcell sequence into an actual free path for B.
that correspond to free subcells in R x D. Note that the set
Desc(R) has constant cardinality.
Two free subcells A\ and A2 can only be adjacent if their con- 4 Small and efficiently computable
taining cylinders Ri x D and R2 x D are adjacent in C and,
hence, Ri and R2 are adjacent in W. An adjacency (Rx, R2) workspace partitions
gives rise to only a constant number of adjacencies of nodes
A\ and A2 in Desc(Ri) and Desc(R2) respectively due to In this section we consider the problem of finding small cc-
the constant cardinality of Desc(Ri) and Desc(R2). Two partitions of workspaces W with obstacles £. Different types
free subcells A\ and A2 in adjacent cylinders are adjacent of workspaces and obstacles lead to different choices for a cc-
if they share a common boundary. Such a common bound- partition. Below we first discuss a general partition scheme
ary has constant complexity since both involved free subcells for a 2D Euclidean workspace with constant complexity ob-
have constant complexity. The nested for-loop in the second stacles. The cc-partition has optimal size and is computable
for-loop takes constant time by the above considerations. by a simple plane sweep. Next, we move on to 3D, where
The output of Algorithm FatMot is a decomposition of the we consider the case of polyhedral obstacles. In addition,
free space into constant complexity subcells that are collected we mention some results obtained for general obstacles and
in a set Vc- The connectivity of the subcells is captured in obstacles from a bounded size range.
a set Ec of pairs of adjacent subcells. The running time of
FatMot is easily seen to be 0(T(n) + |VW| + |-Ew|)- So,
the efficiency of Algorithm FatMot is fully determined by 4.1 Two-dimensional Euclidean workspace
the size of the cc-partition graph (VW, -£\v) and the time to
compute the graph and the function Cov. Since the time The proposed partition scheme for 2D workspaces, a ver-
T(n) to explicitly compute a cc-partition graph (VW, -£W) tical decomposition of the arrangement of grown obstacle
and the function Cov dominates the time 0{\ VW | + \EW |) to boundaries, works for any kind of obstacles, as long as their
simply report the graph we may conclude that the T(n)-factor boundaries consist of a constant number of constant degree al-
is dominant. gebraic curves. The approach differs from the one presented
in [13] which is a modified version of Schwartz and Sharir's
Theorem 3.6 Algorithm FatMot computes a cell decompo- ladder algorithm [7] and as such dedicated to a polygonal
sition of the free space of size 0(|VW| + \E\y\) in time robot and polygonal obstacles.
0(T(n)), where T(n) is the time to compute a cc-partition
graph (VW, i?w) and the function Cov : Vw —> V{8). The first step towards a cc-partition computes the grown ob-
stacle boundaries dG(E, pB) for all obstacles E G E. Each
The size and computing time of a cc-partition graph influence boundary is obtained in 0(1) time leading to 0(n) time for
both the size of the cell decomposition that is obtained and computing all boundaries. As a preparation for the next step,
the time necessary to compute it. A small and efficiently each grown obstacle boundary dG(E, pB) is cut up into O(1)
computable partition is therefore crucial to the success of our arcs which are maximal connected, «-monotonous boundary
method. At this stage, one may expect the method to be rather parts having no vertices in their interiors. Note that arc
efficient since the paradigm reduces the problem of finding a endpoints are generally incident to two arcs. For future pur-
cell decomposition of the free part of the configuration space poses we label each arc from dG(E,pB) with the obstacle
to the problem of finding some constrained partition of the name '£". By Theorem 2.4, the resulting 0{n) arcs define
lower-dimensional workspace. Finding small and efficiently only 0(n) (yet unknown) arc intersections and partition the
computable cc-partitions is the subject of the next section. workspace into regions with constant-size coverage.
Finally, we mention that the problem of solving a mo- In a second step we compute the vertical decomposition of the
tion planning query "find a free path from a placement arrangement A(G) of grown obstacle boundaries, by sweep-

36
ing the plane [3] with the arcs with a vertical line, meanwhile 4.2 Three-dimensional Euclidean workspace
extending walls in upward and downward vertical direction
from every arc endpoint (known in advance) and all arc in- The problem of finding cc-partitions for three-dimensional
tersections (to be determined during the sweep). The arcs Euclidean workspaces is much harder than its two-
and walls and their endpoints form a planar graph consisting dimensional equivalent, which is illustrated by the relatively
of 0(n) edges and vertices, subdividing the plane into 0(n) small number of results on partitioning 3D arrangements.
constant complexity regions: the regions of Vw ■ The set Ew Below we first consider the case of polyhedral obstacles in
of pairs of adjacent regions has size 0(n) as well, as each some detail, and then mention some results for two other
adjacency is represented by one of the 0(n) edges in the classes of obstacles.
graph. Like in the two-dimensional case, we first partition the
workspace into regions with constant-size coverage, and sub-
Lemma4.1 |VW| = 0(n) and \Ew\ = 0(n). sequently subdivide these regions into constant complexity
regions. Instead of using the grown obstacle boundaries to
The sweep must not only compute the regions of Vw, but achieve the first decomposition we now use the boundary
also the coverages Cov(R) of the regions R G Vw, and of a polyhedral outer approximation of these grown obsta-
the region adjacencies of Ew- Throughout the sweep we cles, which still achieves a decomposition of W into regions
maintain as invariant that all regions, coverages, and adja- of constant-size coverage, but additionally allows for subse-
cencies left of the sweep-line are computed. The sweep-line quent application of a vertical trapezoidation algorithm (to
status and event point schedule, both stored in appropriate the triangulated polyhedral arrangement) to obtain 0(n2)
data structures, facilitate the maintenance of the invariant. constant complexity regions. A tight outer approximation
The sweep-line status is a top-to-bottom cross-section of the of the grown obstacle G(E, pB) is the Minkowski difference
vertical decomposition of .4(G) and the vertical sweep-line. H(E,PB) of E and a cube with side length 2/>g:
This alternating sequence of arcs and regions accompanied
by their coverages is stored in a binary tree. The event point H(E,pB) =
schedule is the ordered sequence (by ^-coordinate) of all arc Ee(e-{(x1,x2,x3)e'R3\ PB < x1,x2,x3 < Pß}),
endpoints and the potential intersections of consecutive arcs
in the sweep-line status. A priority queue stores the schedule. where 0 represents the Minkowski difference operator and
The processing of the next event, i .e., the extension of vertical 6 G 50(3) is some arbitrary rotation matrix to establish that
walls from an intersection point or endpoint, marks the end none of the cube's faces is vertical, thus preventing future
of at most three consecutive regions in the sweep-line status. vertical triangles. Computation of a (constant complexity)
These regions and their coverages are reported to maintain Minkowski difference H(E, ps) takes 0(1) time.
the invariant. Moreover, the regions are deleted from the The polyhedral arrangement A(H) of all Minkowski differ-
sweep-line status and replaced by the (at most three) newly ence boundaries dH(E, pB), E G S, satisfies properties that
started regions. Appropriate adjustments w.r.t. the separat- are similar to the properties of the arrangement 4(G) in the
ing arcs are made as well. In addition, we must report the 2D case.
adjacencies of the new regions and compute their coverages.
These coverages are easily computed from the coverages of Lemma 4.4 (a) The complexity of A(H) is 0{n),
the ended regions and the arc labels (see [14] for details on
(b) \Cov(A)\ = 0(1) for each 3-face A in A{H).
the update). Potential intersections of the 0(1) newly created
pairs of consecutive arcs must be inserted in the event queue.
Proof: Each Minkowski difference H{E, ps) is a y/% ■ ps-
In summary, the processing of an event requires a constant
wrappingof-E1, and, becausepe < &-<5mj„,alsoa6V3<5m;n-
number of searches, deletions, and insertions on a binary tree,
wrapping of E. Since <$m!n is a lower bound on the diameter
and a constant number of insertions in the event queue. All of all obstacles E G £, the (a)-part follows immediately
listed operations take 0(log n) time, so the processing of all from Theorem 2.4. Moreover, the same theorem implies
events, and, hence, the entire sweep, takes 0(n log n) time.
that each point p G W lies in 0(1) Minkowski differences
H(E, ps) simultaneously, which implies that a 3-face A lies
Lemma 4.2 T(n) = O(nlogn).
in the intersection of 0(1) Minkowski differences. Because
H{E, PB) 2 G(E, PB), COV(A) is a subset of the set of
Substitution of the vertical decomposition in the first step of
obstacles E for which H(E,pß) encloses A and, hence,
Algorithm FatMot leads to a cell decomposition of size 0(n),
\Cov(A)\ = 0(1). a
computed in 0(n logn) time.
A naive, but sufficiently efficient, computation of the 0(n)
Theorem 4.3 The motion planning problem amidst fat ob- complexity arrangement 4 (H) takesO(n2) time and a subse-
stacles in R2 can be solved in time 0(n log n). quent constrained triangulation of all 0(n) planar Minkowski

37
faces and the segments defined by intersections with other the vertical trapezoidation. The representation of a region
faces can be performed in near-linear time. The constrained follows immediately from its floor and ceiling. Adjacent re-
triangulation of the faces of A{H) does not introduce new gions in the trapezoidation share a common boundary that
vertices. The result is that we end up with a collection T^JJ-) is either embedded in a vertical wall, either extended from
of non-intersecting triangles. Although the triangles are non- a triangle edge or added during the trapezoidation phase, or
intersecting, they do touch each other, i.e., they share edges embedded in a triangle. If the triangles are in general position
and vertices. then it can be shown that regions that share a vertical boundary
face must have either adjacent floors or adjacent ceilings in
De Berg, Guibas, and Halperin [4] present an algorithm for
computing the vertical trapezoidation of an arrangement of some vertically decomposed triangle arrangement. Regions
that share a common boundary that is embedded in a triangle,
triangles in 3-space. In the restricted case of non-intersecting
triangles, their algorithm leads to a decomposition of 3-space have floor and ceiling with non-empty intersection on either
side of a triangle. Hence, the representation of the regions as
into 0(n2) constant complexity regions. The computation
well as the adjacency information is completely contained in
takes 0(n2 log n) time. Below we first briefly discuss the
the vertically decomposed triangle arrangements.
algorithm and the structure of the trapezoidation. After that,
we show that application of the algorithm to the set of tri- Adjacent regions in the decomposition share a face that is
angles T^(H) leads to a cc-partition graph (Vw, Ew), with either a part of a vertical wall or a part of some triangle. It
| V\v[ = 0(n2) but, unfortunately, a larger set Eyj. To rem- turns out that the number of adjacencies of the latter type
edy this we will replace each triangle by a flat tetrahedron is more than 0(n2). Walls extended from other triangles'
and then show that the resulting set F(T^(H)) of tetrahe- edges end on both sides of a triangle i G T^(H) and define
dra solves the problem as its vertical trapezoidation leads to arrangements of line segments on these sides. The complex-
\VW\ = \EW\ = 0{n2) andT(n) = 0(n2\ogn). ity of a single arrangement and its vertical decomposition can
be as high as 0(n2), and, hence, the number of 2-faces de-
The computation of the vertical trapezoidation proceeds in
fined by the vertically decomposed arrangement is bounded
two steps. The first step results in the vertical decom-
by 0(n2). These 2-faces are the floors (or ceilings) of the
position of the arrangement of non-intersecting triangles.
vertical trapezoidation regions. Each non-empty intersection
The vertical decomposition partitions the arrangement into
regions of points with equal vertical visibility w.r.t. T, of 2-faces on either side of a single triangle corresponds to
an adjacency of two vertical trapezoidation regions. There
both in upward and downward direction, by extending walls
are 0(nA) pairs of 2-faces on opposite sides of a triangle
in vertical direction from all triangle edges. A region
and it seems impossible to bound the number of non-empty
in the vertical decomposition is a maximal connected set
intersections, and, hence, the number of region adjacencies,
{x G 1R \up(x) = ti A down(x) = ^} where t\,t2 G T
and up(x)ldoivn(x) denotes the first triangle in T that is hit by anything close to 0(n2).
by the vertical ray emanating from x in upward/downward An elegant way to avoid the problem outlined above is by
direction. The floors and ceilings, i.e., the bounding faces replacing the set of triangles TA(H) by a set of tetrahedra
in vertical direction, of the resulting regions are parts of tri- F{TA(H)) that are sufficiently flat to prevent them from in-
angles. More precisely, they are 2-faces in an arrangement tersecting. The tetrahedra have the initial triangles of TA(H)
of ending walls on a triangle side. Note that the floor and as one of their faces. The triangular faces of the tetrahedra
ceiling of a vertical decomposition region have equivalent in F{T^H)) form again a set of non-intersecting, though
projections onto the (x, y)-plane. The second step refines the touching, triangles. This set is four times larger than TA(H)
vertical decomposition into a vertical trapezoidation, consist- (and therefore still of size 0(n)) but, more importantly, it
ing of regions bounded by six planar faces, by adding walls has the simple though very beneficial property that one of the
parallel to the (x, z)-plane. The refining is obtained through sides of each triangle faces the interior of a tetrahedron. As a
a planar vertical decomposition of the floor and ceiling of result, the number of walls ending on the interior-facing side
the region, in which segments are extended within the floor of a triangular face t of r G F(T^(H)) is constant as such
or ceiling parallel to the j/-axis from every vertex on the walls can only be extended from edges of the tetrahedron r.
boundary of the floor or ceiling. These segments delimit the
We first discuss how to replace each triangle t G TA(H) by
additional walls parallel to the (x, z)-plane. The resulting
a tetrahedron r having t as one of its faces, such that the
trapezoidal faces are the floors and ceilings of the vertical
resulting tetrahedra are non-intersecting. Recall that T^H)
trapezoidation regions.
is a set of triangles that may share a vertex or an edge but
The vertical trapezoidation algorithm results in 0(n2) con- do not intersect each others' interiors. Let e be the minimum
stant complexity regions in time 0(n2logn). The output distance between any pair of disjoint triangles. Furthermore,
consists of the input triangles accompanied by the vertically let 7i be the minimum over all dihedral angles between pairs
decomposed arrangements of ending walls. These arrange- of (touching) triangles that share an edge and 72 be the min-
ments implicitly contain all relevant information regarding imum over all angles between the supporting plane of a tri-

38
angle t G TA(H) and an edge of another triangle t' incident vertically decomposed triangle arrangements. The number
to a vertex of t. We define 7 = min(7i, 72)- We construct a of non-empty intersections on opposite sides of a triangle t is
set F(TA(H)) by applying the following procedure to every 0(mt ■ nt) = 0{nt) due to mt = 0(1). Hence, the number
t G T. Let vi, v2, v3 be the vertices oft. of adjacencies ofthe second type equals X^ 0(rct) = 0(n2).
In summary, the total number of adjacencies in Ew is 0(n2).
1. The planes 7Ti, 7r2, 7r3 through v1,v2,v3 that make a
positive angle 7/2 with the top side (facing z = 00) of Lemma4.6 |VW| = 0(n2) and \EW\ = 0(n2).
t intersect in a point v. If the distance from v to t is
strictly less than e, then the tetrahedron is defined by the After applying the 0(n2 log n) trapezoidation algorithm, we
vertices v, vi,v2,v3. traverse the resulting 0(n2) constant complexity regions us-
ing the decomposed triangle arrangements to extract explicit
2. If the distance from v to t is at least e, then we take the
descriptions ofthe regions, regions adjacencies, and the cov-
half-line /i through v and perpendicular to and ending
erages of the regions. The latter computation requires ad-
on t. The tetrahedron is defined by vi,v2,v3 and the
ditional explanation. Instead of attempting to compute the
unique point v' on the half-line h with distance e/2 to f.
constant-size coverages directly, we first compute the set
The following lemma now holds for the resulting set of intersecting Minkowski differences H(E, PB), using the
F{TA(H)) of tetrahedra. (For a proof, we refer to [14].) fact (throughout the traversal) that adjacent regions are inter-
We denote the (open) interior of a closed set r by int(r). sected by the same set of Minkowski difference unless they
are separated by a triangle t that is part of some Minkowski
Lemma4.5 Vr.r'e F(TA(H)) : int(r) n mt(r') = 0. difference boundary dH(E,pB), in which case the sets of in-
tersecting Minkowski differences differ by exactly {E}. The
Application of the trapezoidation algorithm to the triangu- set of Minkowski differences H(E, pß) intersecting a region
lar faces of F(TA(H)) yields a vertical trapezoidation of R G Vw is a superset ofthe set of grown obstacles G(E, PB)
complexity 0(n2) and therefore consisting of 0(n2) regions intersecting R, since G(E, pB) C H(E, pB). The latter set,
with constant complexity. The trapezoidation regions are ap- which is the coverage Cov(R) of R can be computed from
pointed to be the regions of Vw ■ The coverage of each region the set of intersecting Minkowski differences, as this set has
R G Vw clearly has constant size as R is a subset of a 3-face constant size as well by Lemma 4.4. The traversal of the
A in the arrangement A{H). 0(n2) regions takes time proportional to the number of re-
Let us now consider the number of adjacencies of regions in gions, leading to the conclusion that the computation time
Vw- The complexities of the vertically decomposed triangle T(n) is dominated by the running time of the trapezoidation
arrangements is crucial in determining the number of adja- algorithm.
cencies, so we first study these complexities. The complexity
Lemma4.7 T(n) = 0(n2logn).
of the entire vertical trapezoidation is 0(n2). As a result the
cumulative complexity of all vertically decomposed triangle Substitution of the described vertical trapezoidation in the
arrangements is 0(n2) as well. Each triangle t G F(TA(H)) first step of Algorithm FatMot leads to a cell decomposition
has a side facing the interior of the tetrahedron r it belongs to of size 0(n2) computed in 0(n2 logn) time.
and a side facing outward. The complexity mt of the verti-
cally decomposed arrangement on the inward-facing side of Theorem 4.8 The motion planning algorithm amidst fat
t is constant, since only a constant number of walls, extended polyhedral obstacles in R3 can be solved in time 0(n2 log n).
from one of the edges of r, ends on this side: mt = 0(1),
for all t. The complexity nt of the vertically decomposed If the assumption of polyhedral obstacles is dropped we are no
arrangement on the outward-facing side of a single triangle longer able to tightly wrap the obstacles. As a consequence,
t, however, can be as high as 0(n2). The number of ad- we are also no longer able to obtain an arrangement of wrap-
jacencies of 2-faces in a decomposed triangle arrangement ping boundaries of size 0{n) that partitions the workspace
is of the same order of magnitude as the complexity of the into regions of constant-size coverage. Hence, a different
decomposed arrangement, hence, the numbers of adjacen- strategy for finding a cc-partition is necessary. It can be
cies on the inward and outward-facing sides of a triangle t shown [14] that a possible cc-partition of the workspace is
are 0(mt) and 0(nt) respectively, adding up to a total of given by the supporting planes of the faces of the bound-
0(mt + nt) adjacencies of 2-faces on t. We have stressed ing boxes of the grown obstacles G(E, pB). This partition
earlier that each pair of adjacent trapezoidation regions has yields 0(n3) regions and adjacencies, and leads to an 0(n3)
either adjacent floors or ceilings in some vertically decom- motion planning algorithm, which seems definitely open for
posed triangle arrangement, or intersecting floor and ceiling
improvement.
on opposite triangle sides. The number of adjacencies of the
Another nice result is obtained for general obstacles from
first type equals YLt °(m« + "*) = °("2)' as h is of the
same order of magnitude as the cumulative complexity of the a bounded size range. If we assume all obstacle diameters

39
to be in the range Smin .. . Smax = u ■ 8min for some con- References
stant u > 1, then a cc-partition of optimal 0{n) size can
be constructed. The idea is to put an imaginary orthogo- [1] H. ALT, R. FLEISCHER, M. KAUFMANN, K. MEHLHORN, S.
NäHER, S. SCHIRRA, AND C. UHRIG, Approximate motion
nal grid {(piSmin,p2Smin,P30min)\Pl,P2,P3 G Z} in the
workspace W and partition W into axis-parallel boxes with planning and the complexity of the boundary of the union of
simple geometric figures, Algorithmica 8 (1992), pp. 391-406.
the grid points as their corners. A key observation is that the
bounding box of each grown obstacle can be covered with a [2] F. AVNAIM, J.-D. BOISSONNAT, AND B. FAVERJON, A practical
constant number of grid cubes with side length 8mi„, leading exact motion planning algorithm for polygonal objects amidst
to 0(n) such cubes with constant size coverage by Lemma polygonal obstacles, Proc. Geometry and Robotics Workshop
(J.-D. Boissonnat and J.-P. Laumond Eds.), Lecture Notes in
2.2. The complement of the cubes is decomposable by O(n)
Computer Science 391 (1988), pp. 67-86.
axis-parallel boxes of measure 5mjn x 5min x h ■ Smin, with
h E N, and 0{n) axis-parallel boxes that are unbounded in [3] J.L. BENTLEY AND T.A. OTTMAN, Algorithms for reporting
the ^-direction. The resulting regions provide a cc-partition and counting geometric intersections, IEEE Transactions on
Computers 28 (1979), pp. 643-647.
graph (Vw, Ew) of size 0(n), that can be computed together
with the region coverage Cov in time 0(n log n) (see again [4] M. DE BERG, L. J. GUIBAS, AND D. HALPERIN, Vertical decom-
[14] for the details). positions for triangles in 3-space, Proc. 10th ACM Symp. on
Computational Geometry (1994).
Theorem 4.9 The motion planning problem amidst fat ob- [5] J. MATOUSEK, N. MILLER, J. PACH, M. SHARIR, S. SIFRONY,
stacles in R with diameters in the range 5min ... u ■ Smin, AND E. WELZL, Fat triangles determine linearly many holes,

for some constant u > 1, can be solved in time 0(n log n). Proc. 32nd IEEE Symp. on Foundations of Computer Science
(1991), pp. 49-58.
[6] M.H. OVERMARS, Point location in fat subdivisions, Inform.
Proc. Lett. 44 (1992), pp. 261-265.
5 Conclusion [7] J.T. SCHWARTZ AND M. SHARIR, On the piano movers' prob-
lem I. The case of a two-dimensional rigid polygonal body
In this paper, we have presented a paradigm for planning the moving amidst polygonal boundaries, Comm. Pure Appl.
motion of a constant complexity robot amidst fat constant Mart. 36 (1983), pp. 345-398.
complexity obstacles. The efficiency of the method relies [8] J.T. SCHWARTZ AND M. SHARIR, On the piano movers' prob-
on the ability to find small and efficiently computable so- lem II. General techniques for computing topological proper-
called cc-partitions of the workspace. We have furthermore ties of real algebraic manifolds, Adv. in Applied Mathematics
shown that small cc-partitions of the workspace do indeed ex- 4 (1983), pp. 298-351.
ist for various instances of workspaces with obstacles. A cc- [9] J.T.SCHWARTZ AND M. SHARIR, Efficient motion planning al-
partition of optimal size, i.e., 0(n), has been found for planar gorithms in environments of bounded local complexity, Report
Euclidean workspaces with arbitrarily shaped obstacles and 164, Department of Computer Science, Courant Inst. Math.
for 3D Euclidean workspaces with arbitrary obstacles of com- Sei., New York NY (1985).
parable sizes. The partitions, both computable in 0(n log n), [10] S. SIFRONY AND M. SHARIR, A new efficient motion plan-
lead to nearly-optimal algorithms for motion planning in the ning algorithm for a rod in two-dimensional polygonal space,
corresponding settings. Additional cc-partitions have been Algorithmica 2 (1987), pp. 367-402.
found for Euclidean workspaces with polyhedral and arbi- [11] A.F VAN DER STAPPEN, D. HALPERIN, AND M.H. OVERMARS,
trary obstacles. They lead to motion planning algorithms in The complexity of the free space for a robot moving amidst
the respective settings with running times 0(n2 log n) and fat obstacles, Computational Geometry: Theory and Applica-
0(n3), based on quadratic and cubic size partitions. An tions,!, (1993), pp. 353-373.
obvious open question is whether it is possible to enhance [12] A.F. VAN DER STAPPEN, The complexity of the free space for
the latter results by finding smaller, efficiently computable, motion planning amidst fat obstacles, Journal of Intelligent &
cc-partitions for these environment instances. Robotic Systems, in press.
The presented paradigm has a large applicability. The listed [13] A.F. VAN DER STAPPEN, D. HALPERIN, AND M.H. OVERMARS,
bounds and algorithms are independent of the actual number Efficient algorithms for exact motion planning amidst fat ob-
of degrees of freedom of the robot, as long as this number stacles, Proc. of the IEEE Int. Conf. on Robotics and Automa-
is constant. The paradigm therefore not only caters for rigid tion, Atlanta GA (1993), Vol. 1, pp. 297-304.
robots but is instead also capable of handling robots that [14] A.F. VAN DER STAPPEN AND M.H. OVERMARS, Motion plan-
both move and have articulated arms and legs. Moreover, ning amidst fat obstacles, in preparation.
preliminary results on using (a slightly generalized version
of) the paradigm for planning coordinated motions of two or
more robots amidst fat obstacles are promising.

40
Approximate Euclidean Shortest Path in 3-Space
(Extended Abstract)

Joonsoo Choi Jürgen Seilen* Chee-Keng Yapf


Courant Institute of Mathematical Sciences
New York University

Abstract described a polynomial-time approximate algorithm.


The approximate Euclidean shortest path problem has,
Papadimitriou's approximation approach to the Eu- in addition to the above inputs, an input parameter
clidean shortest path (ESP) problem in 3-space is re- e > 0 and we are required to construct an obstacle-
visited. As this problem is NP-hard, his approach avoiding path whose length is at most (1 + e) times the
represents an important step towards practical algo- length of the shortest path. As Papadimitriou sug-
rithms. Unfortunately, there are non-trivial gaps in gested, his algorithm offers hope for practical imple-
the original description. Besides giving a complete mentation. The approach is basically simple and may
treatment, we also give an alternative to his subdivi- be very similar to ones that practitioners intuitively
sion method which has some nice properties. Among use, although without a corresponding analysis. Un-
the tools needed are root-separation bounds and non- fortunately, there are several non-trivial gaps in this
trivial applications of Brent's complexity bounds on important paper. There is an alternative approach
evaluation of elementary functions using floating point to the approximate ESP problem due to Clarkson [3];
but it is not directly comparable to Papadimitriou's
numbers.
result because the complexity of Clarkson's algorithm
depends on an additional parameter p.
Most geometric algorithms are developed within
1 Introduction the context of one of two distinct computational
frameworks, the algebraic framework or: the bit frame-
The Euclidean shortest path (ESP) problem can be work. In the algebraic framework, we count the num-
formulated as follows: given a collection of polyhe- ber of algebraic operations, assuming that each al-
dral obstacles in physical space S, and source and tar- gebraic operation returns an exact value. Computa-
get points s0, t0 £ S, find a shortest obstacle-avoiding tional models appropriate for the algebraic framework
path between s0 and t0. Here S is typically E2 or E3. include arithmetic circuits and real RAMS. In the bit
It is evident that this is a basic problem in applica- framework, we are interested in the representation of
tions such as robotics. The case S — E2 has recently algebraic values as binary strings. Algebraic opera-
seen a breakthrough, with the O(nlogn) algorithm of tions must be reduced to Boolean operations. Com-
Suri and Hershberger [7]. However, our interest is the putational models that cater to the bit framework in-
case 5 = E3. Here, Canny and Reif [2] proved that the clude Boolean circuits and Turing machines.
problem is ATP-hard. In contrast, Papadimitriou [6] Most basic problems in the algebraic framework
•This author is supported by a postdoctoral fellowship from have only one input size parameter n, which is usu-
the DAAD, Germany. ally proportional to the number of algebraic values in
tThis author is supported by NSF grant #CCR-9002819. the input. For instance, the problem of multiplying
two polynomials of degree n is said to have input size
Permission to copy without fee all or part of this material is n, and can be solved in 0(n log n) algebraic opera-
granted provided that the copies are not made or distributed for tions. The result of Suri and Hershberger mentioned
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given above also falls under the algebraic framework. Ba-
that copying is by permission of the Association of Computing sic problems in the bit framework usually have two
Machinery. To copy otherwise, or to republish, requires a fee parameters, n and L, where n is as before and L is
and/or specific permission.
the maximum bit-size of any algebraic value. For in-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA stance, isolating the roots of a polynomial of degree n
© 1994 ACM 0-89791 -648-4/94/0006..$3.50

41
where each coefficient has at most L bits. Sometimes three parts and indicate where the difficulties come
n is bounded and may be omitted; an example is the into each part. In section 3, the new subdivision
GCD of two integers. Most approximation problems method for edges is described. In section 4, we give
(such as the approximate ESP above) naturally be- some general lemmas on application of Brent's com-
long to the bit framework. In this case, we have an plexity bounds for floating-point number computa-
additional input parameter, e. Usually, e is specified tions. In sections 5 to 8, we sketch the fixes to the
by an integer s where e = 2~s. original algorithm. We conclude in section 9.
The main source of trouble in Papadimitriou's pa-
per (and, for that matter, Clarkson's paper) lies in
the fact that it is a result in the bit model and yet it 2 Outline of an Approximate Algo-
lapses into the algebraic framework at several critical rithm
moments. This is inadmissible because we know of no
sensible combination of the bit framework with the al- Assume we are given a collection of polyhedral ob-
gebraic framework. After all, the TVP-hardness of ESP stacles, source and target points s0,t0, and an 0 <
result falls under the bit framework, and the approxi- e < 1/2. We assume that the obstacles are bounded
mation result of Papadimitriou is generally viewed as by triangular facets. There are a total of n edges in
an approach to circumvent this hardness barrier. As the collection of obstacles. Each vertex of obstacles
an example of the lapses, note that lengths of polygo- and s0,*o are specified by L-bit integers. Throughout
nal paths are sums of square-roots of rational numbers. this paper, we use a parameter
These values are no problem to compute in the alge-
braic framework, but in the bit framework, one must fi
work out the precision to which one need to compute C0n'
these values. We will see that the precision needed where Co is a suitably large constant. For the present
depends on how the numbers are to be used. One discussion, C0 > 8 suffices. The algorithm of Pa-
cannot take this precision issue lightly as it is pre- padimitriou can be divided into three parts:
cisely (no pun intended) the large precision needed for
the sums of square-roots computation that prevents us (I) We divide each edge e into a set of segments by
from placing the ESP problem (even the planar case) introducing points p0, p±1, p±2,.... We call the
into the class NP. Pi's the break points and p0 the origin of e. Each
Once one realizes these lapses, it is still not a rou- segment is of the form <7; = \pi,Pi+i] for ieZ.
tine matter to decide the precision to which we must (II) The visibility graph G = (N, A) is constructed.
compute these algebraic numbers. We will employ ba- The nodes N of the graph comprise the segments
sic techniques of root bounds and algebraic computa- from (I) and also s0,t0. We can view s0 and t0
tion (see [9]). One complication is that we will be using as degenerate segments. The visibility edges A
approximations of approximations (and so on). The comprise pairs (<T,<T') of nodes that can see each
second difficulty is that we need to invoke Brent's re- other, meaning that there exists x G a, x' E cr'
sults [1] concerning the evaluation of elementary func- such that the line segment [x, x'} avoids the (in-
tions to carry out the various approximations. But ap- terior of) obstacles. We call such a line segment
plication of Brent's results requires some arguments, [x,x'\ a visibility segment.
as we will see.
The heart of Papadimitriou's algorithm is a subdi- (III) We compute for each visibility edge (a, a1) a
vision scheme to break up edges into smaller segments. "nominal cost" C(a,a'), defined to be the Eu-
In our reworking of Papadimitriou's approach, we in- clidean distance between the midpoints of a and
troduce a new subdivision scheme that has two nice cr'. We now apply Dijkstra's shortest path algo-
features. If e is halved, we can reuse all the points in rithm to the weighted graph G' = (N, A; s0,C).
the previous subdivision. This can save recomputa- The shortest path ir in G' from sQ to t0 is output.
tion in practice (although we do not know if this is an
The correctness of the algorithm amounts to the
asymptotic improvement). Further, it turns out that
claim that the cost C(ir) is at most (l + e)C(7r*) where
our subdivision uses fewer points (this is an asymp-
C(ir*) denotes the Euclidean length of an actual short-
totic improvement when e is small enough).
est path 7T*. According to the original paper, every-
The rest of this abstract is organized as follows: thing hinges on a clever subdivision scheme for the
In section 2, we sketch Papadimitriou's algorithm in points p±i (i = 0, 1,...) in part (I).

42
We now give some counter indications: arises: suppose the algorithm outputs a sequence of
(I)' The origin po of an edge e is a specially chosen segments
rational point. For \i\ > 0, ||p0 - Pi\U is the rational 0-1,0-2, • • -,0-jfc

number ei||s0 -po||2(l + fi)'*'-1- But tnis means that that purports to be an approximation to the shortest
the coordinates of p; would in general be irrational. path. This means that there exists a zig-zag path
The original paper assumes that p; can be exactly de-
termined. But in fact, we must determine the preci- T = {s,qi,ri,...,qk,rk,t)
sion to which to compute the points. This precision (where qi,n € o^) that avoids all obstacles. (Note that
depends on the subsequent use of these points - see qi,ri can be quite far apart in absolute terms.) We
(III)' below. must compute an approximation to this zig-zag path,
(II)' For any edge e, let span(e) denote the line since obtaining this explicit path is the raison d'etre of
through e. In general, for any set X of points, most applications. The approximation must be guar-
span(X) is the affine span of X. Following Papadim- anteed to be obstacle-avoiding (and still achieves an
itriou, let us fix two edges e, / and let x and y be real e-approximation).
parameters for points in span(e) and span(f), respec-
tively. Let e(x) and f(y) denote the corresponding
points. Now consider a triangular facet T bounding 3 A New Subdivision Scheme
an obstacle. We view T as the intersection of three
half-planes contained in span(T). Let H be one such In this section, we present a new subdivision scheme
half-plane. So its boundary dH contains an edge of for edges. The original scheme would work as well, but
T. The set of potential visibility segments [e(x), f(y)] our new scheme is motivated by the desire that the
such that span(e(x),f(y)) intersects dH is a hyper- subdivision for e/2 is a refinement of the subdivision
bola for e. As in the original, the origin po of an edge e is
(x - a)(y - b) = c chosen to be the closest point on e to the source so-
We now describe the subdivision of the half-edge e!
for some a,b,c, as noted by Papadimitriou and Guibas
to one side of the origin (the other half-edge is sim-
[6]. However, the set H* of points (x,y) correspond-
ilarly treated). Let d — ||so — P0II2 be this closest
ing to potential visibility segments that intersect H is
distance. Choose p\ on half-edge e' at distance d from
neuer of the form (x-a)(y—b) < c or (x — a)(y-b) > c,
po- The segment [po,Pi] is uniformly subdivided into
contrary to [6]. This is intuitively obvious since the hy-
segments of length dei/2 by introducing the points
perbola is solely determined by dH, and does not take
qi,q2, ■ ■ ■■ The rest of the half-edge e' is subdivided
into account the actual plane span(H). Assuming that
using the points P2,P3, ■ ■ ■ defined as follows. Let m
we correctly figure out the configuration obstacle H*
be the smallest integer satisfying
corresponding to any half-plane H, the corresponding
configuration obstacle T* of T is now given by 2m > log(l(e)/cQ
log(l + ei):
T* = H\ n H; n HI
where £(e) denotes the length of an edge e. Then we
where 51nff2niJ3 = T. Finally, the free-space FP define p,- such that
in the (x,y) parameter space is the complement of (i-l)/2™
1(e)
the union of all the T* 's. The boundary of FP will ||P0-Pi||2 = d
consist of axes-parallel line segments and hyperbolic
segments. In the plane sweep algorithm proposed to Let D(a, a') denote the shortest distance between the
determine FP, the priority of events are now the x- two segments a and a'.
coordinates of intersections of these straight lines and
hyperbolas. The original paper improperly assumes Lemma 1
that we can compute these priorities exactly. (i) The subdivision satisfies the basic inequality
(Ill)' The original paper assumes that we can com-
£(a) <eiL>(so,0-)
pute the nominal cost function C(o~, a') exactly. There
are two sources of inaccuracies: we can only compute (ii) There are at most N = 0(n(L/e{)) segments in
the midpoints of a approximately, and then we only all the edges.
compute an approximation to the distance between (Hi) The subdivision for e/2 is a refinement of the sub-
two approximate midpoints. A more serious matter division for e.

43
Property (i) is similar to the original scheme. Prop- one can compute exp(a;) and ln(a?) to precision s in
erty (ii) improves on the original by an additive factor time O(ß(s)\ogs) where
of 0(nlog(l/€i)/€i). This improvement can be sig-
nificant because e might be exponentially small in L, fi(s)
especially if we want to guarantee that we approach denotes the bit-complexity of multiplying s-bit inte-
an actual shortest path. Property (iii) is advantageous gers. Towards a satisfactory solution of (PI), consider
to have when we want to use successive refinements of a subproblem:
e. Note that Papadimitriou's scheme does not enjoy
such a feature. We note two possible disadvantages (P2) Let s, L be given natural numbers and
for our scheme: We use two distinct methods to sub- x a number satisfying 2~L < \x\ < 2L.
divide e - for the region near the origin, the scheme is Compute exp(a;) to precision s in time
uniform and the rest uses an exponential scheme. It polynomial in s, |a;|.
seems that both parts are essential to get our proper-
ties (ii) and (iii). Also, our segment endpoints (unlike Floating point numbers. Let us briefly describe
Papadimitriou's) are at irrational distances from the the floating point number system we will be assum-
origin. ing. A floating point (f.p.) number a is a pair (e, /) of
binary integers where e is the exponent and / the frac-
tion. Let (/) denote the number obtained by placing
4 Floating Point Number Computa- a binary decimal point just in front of the most signifi-
tions cant one (T') in / (if / = 0 then define (/) = 0). Thus
1/2 < (/) < 1 for / ^ 0. The number represented by
Approximate computations introduce a host of de- a is 2e ■ (/). We also write a ~ 2e(/), to emphasize
tailed calculations which we highlight in this section. that a is the representation itself, not just the value it
Our subdivision scheme requires us to compute values represents. The precision of a is1 equal to 1 + [lg /J
of the form EF where E, F are numerical expressions. Lemma 2 Assuming a floating-point representation
The following captures what is needed: of numbers, we can solve (P2) in time 0(fi(s +
|x|)log(s+|ar|) j/1 < \x\ < 2L, and 0(p(* + log L)(L +
(PI) Let s,Li,L2 be given natural num-
log(s-flogL))) if2~L < \x\< 1.
bers and E, F be numerical expressions
satisfying 2~Ll < F < 1 and -L2 < Let us sketch a proof of lemma 2. Let s' = s + L
InE < —2~L2. The problem is to com- and (e,/) ~ x. Then
pute EF to precision s, in time polynomial
in s,L1,L2. {l,f)~y:=x-2-V**}
which lies in the range [1, 2). Applying Brent's result,
In application, we have s + Lx+L2 = 0(log(l/ei) + we can compute a value z which approximates exp(y)
L). Note that x approximates x to precision (resp., to precision s' in time 0(ju(s')lgs'). Now we apply
relative precision) s means \x — a;| < 2~s (resp., repeated squaring to z for a total of [lg x\ times, each
\(x - x)/x\ < 2~s). We resort to Brent's results [1] time taking care to truncate the result to precision s'.
on computation of elementary functions, and compute For |ar| < 1, we do repeated square roots instead of
EF using the following obvious straightline program: squarings. We then argue that the final result approx-
(i) Compute Vi, V2 which approximate E, F to preci- imates exp(x) to precision s.
sion si and s2, respectively; (ii) Compute V3 which The upshot of a series of arguments similar to the
approximates ln(Vi) to precision s3; (iii) Compute V4 above eventually leads us to:
which approximates V2 ■ V3 to precision s4; finally,
(iv) Compute V5 which approximates exp(V^) to pre- Lemma 3 Assume that we can compute E, F to any
cision s5. We conclude that (with suitable choices of precision r in time TE(r),TF{r), respectively. Then
s,-'s) V5 approximates EF to precision s. We would we can solve problem (PI) in time
hope that the cost of these steps is polynomial in
O(TF(s + L0)+TB(s + L2)+
s, Li, L2. The sequence of approximations is compli-
cated by the fact that application of Brent's result is max{/i(s + L2) log(s + L2),
not straightforward: his bounds for elementary func- ll{8 + lg(I0))(io + log(s + lg(Lo)))}),
tions assume that each function is defined over an arbi-
'We write 'log' when the actual base is irrelevant. But lg :
trary but fixed domain [a,b]. Under this assumption, g2 and In = loge.

44
where we write Lo for L\ + L2. If LQ = 0(s), this Suppose e\,e2 is not in degenerate position with
simplifies to 0(TE(s) + TF(s) + fi(s)s). respect to H. It can be shown that the sign of AD —
BC depends on the direction of vector p, — qi with
respect to H and on whether span(ei) intersects H,
5 Configuration Obstacles for i= 1,2.

Fix any two edges ei,e2 of obstacles. Write ti —


\pi,qi\ and let us parameterize the points on span(ei)
such that xpi + (l — x)qi is denoted by ej(x), for x G JL Configuration Obstacles. We are ready to de-
The set of pairs (x, y) corresponding to a potential vis- scribe H* C Q'. Let us define two points
ibility segment [ei(x), e2(y)] is thus parameterized by (aroi J/o),(*ii J/i) £ Q' as follows: span(H) intersects
the unit square Q = [0,1] x [0,1]. Let Q be embed- span(e\) at ei(aio) and intersects span(ei) at e2(yo).
ded in Q' = M2, which denotes the parameter space Let Pi be the plane containing dH and parallel to e^.
for [span(ei) x span(ei)]. For any obstacle X C M3, Then P\ intersects span(ei) at ei(yi) and Pi intersects
let X* denote the set of points (x, y) € Q' such that span(e\) at ei(x\). We may assume that these inter-
[ei(x), e2(y)] intersects the relative interior of X. We section points are well-defined. Furthermore, imag-
call X* the configuration obstacle corresponding to X. ine span(H) to be the horizontal plane {Z — 0} in
As in section 2, it is enough to understand the con- physical (X, Y, Z)-space, and that pi — &■ have a pos-
figuration obstacle H* where H is a half-plane. As- itive Z-component. The vertical and horizontal lines
sume that dH contains the edge [u, v] of a triangular through (zo,2/o) divide Q' into four quadrants. By
face. Let £(x, y) be the line passing through the points symmetry, we may assume that e\,e2 are parameter-
e\(x),e2(y). The requirement that l(x,y) intersects ized to increase in the positive Z direction. Then the
dH reduces to the equation Axy + By + Cx + D = 0 first and third quadrants are necessarily disjoint from
where A — det(v — u \ pi—qi | £2 — 32), B = det(v — u | H*. Let us consider one possibility (the other is simi-
qi-u \ p2- 92), C = det(w - u | pi - qx | q2 - u) larly treated), where the line dH separates ei(xo) and
and D = det(u — u \ q\ — u \ q2 — u). If A ^ 0, 62(2/0) on the plane span(H). We may assume (x\, t/i)
we may rewrite the equation in a standard form for lies in the first quadrant. See figure 1. The asymptotes
hyperbolas: (Ax + B)(Ay + C) = -AD + BC. of the hyperbola in this case are the vertical and hor-
izontal lines through (xi,yi), and (xo,yo) lies on the
hyperbola. Suppose the hyperbola lies to the north-
Degenerate position. We say the two edges ei, e2
are in degenerate position with respect to H if A = 0 west and southeast of (a?i, j/i). Then H* is shown as
or (A ^ 0) A(AD — BC = 0). Let us analyze two edges shaded in figure 1.
in degenerate position. If A = 0 then it can be shown
that either (i) the points u, v, u+pi — qi, u+p2 — q2 are
on the same plane, or (ii) the two edges ei,e2 are in
two parallel planes that do not intersect with the line
dH. Now consider the case A^0. Using the relation
(see [5])
det(a I 6 | d) det(a | c | e) =
det(a I 6 | c) det(a | d \ e)
— det(a I b \ e) det(a | d | c).
we may deduce
Lemma 4
u v u+pi-qi q\
(i)AD-BC = det (
11 1 1
f
u v u + pi - q2 q2
■det
111 1 1
(ii) If AD — BC = 0 then one of the lines
span(ei), span(e2) either is parallel with dH, or in- Figure 1. Configuration obstacle for a half-space.
tersects dH.

45
6 Construction of the visibility graph they will generate an event of type (iii). Whenever we
come to an event of type (ii), we have just completely
In this section, we shall (like Papadimitrou) count swept a column of at most M grid rectangles and will
the number of algebraic operations, to give some idea begin to sweep a new column of at most M grid rect-
of the global complexity. To avoid confusion with the angles. We use O(M) steps to do the processing of
bit-complexity accounting in the next section, we call these grid rectangles. There are 0(n2) events of type
each algebraic operation a "step". (i) and 0(nM) events of type (iii). They can each be
Again focus on a pair of fixed edges ei,e2. The processed in 0(log(n + M)) steps. The events of type
break points (these are the p;'s and g,-'s in section 3) (ii) take O(M) steps each, and 0(M2) altogether.
on ei and e2 define a grid on Q. For segments <r, C e;
(i = 1,2), there is a corresponding grid rectangle R =
R(<?\, 02) Q Q- We say that R is covered iff 7 Bit Complexity
R{ar1,a2)\K* = (1) We must now determine the bit complexity of the
Clearly (<7i, <r2) is an edge in the visibility graph G iff algorithm in the preceding section. In particular, this
ß(°"i,(T2) is not covered. calls for determining the precision to carry out the
Our goal is to decide for every grid rectangle R various tasks. We need this, for example, to make sure
whether or not it is covered; if it is uncovered, we will that we can do line sweep correctly and to be able to
further determine a rational sample point p such that determine sample points in each grid rectangle R that
a ball of some small radius 6 centered at p is contained is not covered. Towards this end, we shall employ a
in R \ A*. Note that this determination will allow us variety of classical techniques in algebraic computing
to compute a guaranteed obstacle-avoiding path. [9]. The upshot of the calculations (sketched below)
Let is that
M = 0(L/d) W = 0(\og(l/e1) + L)
be a bound on the maximum number of break points bits of precision suffices in the computation of points.
on any edge. Then there are at most M2 grid rect- So comparisons between numbers in the algorithm (as
angles in Q. We proceed slightly differently than Pa- in priority queue operations) take 0(W) time.
padimitriou. For a given pair of edges, the following bit complex-
First we compute the arrangement of the collection ity is readily determined: The break points p±i,q±j
of boundary arcs corresponding to all the configura- will be approximated to 0(W) bits, and by lemma 3,
tion obstacles T*. This can be computed in 0(nA4(n)) these can be computed altogether in 0(M'p(W)W)
where A4(n) = 0(n ■ 2a(-n^>) and a(n) is the inverse of time. We can compute the arrangement in time
an Ackermann-like function. This follows from the 0(n\4(n)ß(W)). To compute the boundary of A*
fact that any two boundary arcs can intersect at most takes 0(n2\ogn ■ W). The sweepline operations take
twice, and from the incremental algorithm in [4]. We 0{W) per queue operation and 0(p(W)) to compute
next convert this arrangement into an explicit repre- events of type (iii). Thus all the operations of type
sentation of the boundary of the configuration obstacle (1) cost 0(n2 log(n + M)W); type (ii) cost 0{M2W)
K*, say, in 0(n2 log n) steps. Finally we perform an and type (iii) cost 0(nMlog(n + M)p,(W)). Sum-
interesting kind of line sweep over this representation marizing, the bit complexity of the algorithm in the
of A'* in Q. Our goal is to decide for each grid rectan- previous section, applied to all pairs of edges, is
gle whether it is covered by K*. There are three kinds
of events for the sweepline: 0(n3\4(n)n(W) + n3M log Mn{W)
(i) Vertices on the boundary of A'*. +{nM )2W + nMfi(W)W).
(ii) The break points po,P±i,P±2, • • • on ex.
(iii) Intersections between a horizontal grid line and a We now go into some details. For simplicity, we
boundary arc of A*. Unlike the first two types, this will ignore additive constants in the size of integer
is dynamically inserted into the priority queue. numbers.
The state of the sweepline is represented by a bal- There are 3 types of event points in the line-sweep
anced binary tree T that contains a leaf for each of algorithm: the ^-coordinates of intersection points be-
the horizontal grid lines and for each of the boundary tween boundary curves, of asymptotes of hyperbolic
arcs that intersect the sweepline. Whenever a grid line curves, and of parameters for break points. In the fol-
and a boundary arc become adjacent in T, we check if lowing, we talk about "separating a set of points" -

46
this means we compute the x- and y-coordinates of Next we determine the precision to separate the in-
these points to sufficient precision so that the relative tersection points and the approximate break points in
z-order and y-order of any two points in the set are the parameter space Q'. Let P(x) = Ax2 + Bx + C
correctly determined. This is needed for the line-sweep be the polynomial in (2). The roots of P(x) contain
algorithm to work correctly. the z-coordinates of intersection points between two
The precision to separate two break points depends hyperbolic curves. The coefficients of P are integers of
on the minimum distance between two consecutive length 6L. The approximate position of break points is
break points, i.e., the shortest length of line segments. represented by a rational number D/E where E = 2W
We have: and D is an integer such that \D\ < E. Therefore
it is the root of Q(x) = Ex - D. The generalized
Lemma 5 A precision o/0(log(l/ei) + £) suffices to Hadamard's bound again shows that 2W + YIL bits
separate two break points. suffice to separate the roots of P(x) and Q(x). Sum-
ming up the precisions that suffice for integral and
Now consider the intersection points of two hy-
fractional parts of points, we conclude:
perbolic curves. From the preceding development, if
Axy + By + Cx + D = 0 is the equation of a hyper- Lemma 7 A precision of2W + 18L = 0(log(l/ei) +
bola that partially bounds a half-space configuration L) suffices to separate intersection points of hyperbolic
obstacle H*, then A,B,C,D are integers of size 3L. curves from break points.
Let a be the ^-coordinate of an intersection point.
The maximum bit size for a is the sum of (i) bit In the same way, we can show that other types of
size of the integral part of the maximum a and (ii) pairs of events are separated with this precision.
the precision needed to separate any two intersection
points or precision needed to separate any intersec- Theorem 8 It suffices to compute the event points to
tion point from 0. Let P\(x,y) = Aixy + B\y + precision 0(log(l/ei) + L).
dx + Du P2(x, y) = A2xy + B2y + C2x + D2 be hy-
perbolic functions with integer coefficients. Then the
^-coordinates of intersection points between P\(x,y) 8 Coda
and P2(x,y) are roots of the resultant iesy(Pi,P2),
where Now that we have a visibility graph G = (N,A),
we wish to compute the nominal cost of each visibility
iesy(Pi(x,y),P2(x,y)) = edge in A. Unlike the original algorithm, we do not
Aiz + Bi Cxx + £>i pick the distance between midpoints of segments for
det (2) computing nominal costs. Instead, we pick any ratio-
A2x + B2 C2x + D2
nal point in each segment instead of the midpoint. If
The resultant is an integer polynomial with coeffi- we run Djikstra's algorithm on G, assuming that we
cients of length QL. By Cauchy's bound on roots of know the exact nominal cost of each visibility edge,
polynomials [9], QL bits suffice to represent the inte- then the original calculations shows that the distance
gral part of any root, and 6£ bits suffice to separate of the "approximate shortest path" ir is at most 1 + e
the roots from 0. times the length of the actual shortest path ■K* .
Next let us calculate a lower bound on the gap But, of course, our calculation only uses approx-
between two intersection points, assuming they are imations to the nominal cost. The approximations
different. Let a be the root of the resultant arise because we must take square roots. Because we
Tesy(Pi(x,y),P2(x,y)) and ß be the root of the re- choose rational points, it turns out that we only need
sultant resy(P3(3;, y), PA(X, y)) where Pi,P2, Pz, PA are to compute square-roots of rational numbers x where
hyperbolic functions that are integer polynomials. Ap- 2-4L-6 < a; < 22L+4 to some precision s. It turns out
plying the generalized Hadamard's bound [9] to the that
two resultants, we show that 24L bits are needed to s = log(4n/e)
separate a and /?. Thus we need 6L,24L bits for
the integral, fractional part of the intersection points suffices, and it takes 0(fi(W)) time to compute the
between two hyperbolic functions, respectively. This square-root to this precision.
yields: After this, we may invoke Dijkstra's algorithm and
compute the approximate shortest path 7r. Note that
Lemma 6 A precision of SOL bits suffices to separate all intermediate numbers in Dijkstra's are sums of at
any two intersection points of hyperbolic curves. most n approximate distances, and hence they have

47
sizes at most 0(ln(n/e) + L). Each operation in Di- 4. We may generally call this the method of gen-
jkstra's algorithm involving these numbers takes time eralized grids. Of course, grids are a familiar practi-
0(ln(n/e) + L) since they are either addition of two cal technique in all of computational sciences. From
numbers or comparisons. Thus the bit complexity of a complexity theoretic viewpoint, such methods have
Dijkstra's algorithm is been shunned in the past as trivial or uninteresting.
This need not be so, as Papadimitriou's work has
0(N2n(W)) demonstrated. In fact, grid methods may be the most
practical recourse for solving some intractable prob-
where N := nM is an upper bound on the number of lems. It would be interesting to derive some general
segments in all the edges. theorems about these approaches.
One final point: suppose Dijkstra's algorithm yields
a sequence of segments (SQ, <T1; O~2, ..., <Xjt,2o)- For
each consecutive pair (<7j,<r,+i) of segments, we can References
compute a sample point (x;,?/;) G c; x cr;+i such that
the segment \xi,yi\ is a visibility segment (section [1] Richard P. Brent. Fast multiple-precision evalua-
2(111)). In fact, in the parameter space, we can en-
tion of elementary functions. Journal of the ACM,
sure that there is a ball Bi of positive radius centered
23:242-251, 1976.
around (x,-, j/j) such that every (a;', y') £ Bi represents
a visibility segment. Using the sample points, we fi- [2] J. Canny and J. H. Reif. New lower bound tech-
nally obtain an explicit zig-zag path (section 2(111)') niques for robot motion planning problems. IEEE
that is obstacle avoiding. In conclusion: Foundations of Computer Science, 28:49-60, 1987.
[3] K. L. Clarkson. Approximation algorithms for
Theorem 9 There is an approximate algorithm for
ESP in 3-space that computes an explicit obstacle- shortest path motion planning. In Proc. 19th
avoiding path with relative error e > 0 with bit- Annu. ACM Sympos. Theory Comput., pages 56-
complexity 65, 1987.
[4] H. Edelsbrunner, L. Guibas, J. Pach, R. Pollack,
0((n3A4(n) + n3M logM + (nM)2) ■ ß(W))
R. Seidel, and M. Sharir. Arrangements of curves
where W = 0(ln(n/e) + L) and M = 0{nL/e). in the plane: topology, combinatorics, and algo-
rithms. Theoret. Comput. Set., 92:319-336, 1992.
[5] H. Lass. Vector and Tensor Analysis. McGraw-
9 Conclusion Hill, 1950.

1. Papadimitriou's paper on approximate Eu- [6] C. H. Papadimitriou. An algorithm for shortest-


clidean shortest paths has become recognized as a key path motion in three dimensions. Inform. Process.
result in this area. In this paper, we rectified several Lett, 20:259-263, 1985.
gaps in his paper, and presented for the first time, [7] Subhash Suri and John Hershberger. Efficient
a true bit-complexity bound for an e-approximation
computation of euclidean shortest paths in the
algorithm for ESP.
plane. IEEE Foundations of Computer Science,
2. It should be clear from our development that
there are many tedious and non-obvious details when pages 508-517, 1993. An improved 0(n\ogn)
we do such approximations. The result is an inter- bound was recently announced.
esting mix of combinatorial, numerical and algebraic [8] Chee Yap. Towards exact geometric computation.
complexity. Many of these tools are, in fact, those that In Fifth Canadian Conference on Computational
are necessary in order to make "exact computation" a
Geometry, pages 405-419, Waterloo, Canada, Au-
practical reality [8].
gust 5-9 1993. Invited Lecture.
3. In our solution, we tried to extract some gen-
eral lemmas about approximate computing with float- [9] Chee Yap. Fundamental Problems in Algorithmic
ing point numbers, to facilitate future applications of Algebra. Princeton University Press, to appear.
such an approach. Note that one could avoid Brent's Available on request from author (and via anony-
result by approximating Taylor's expansions directly,
mous ftp).
but this is expected to yield an inferior bit complexity.

48
The Realization Problem for Euclidean Minimum Spanning Trees is
NP-hard

Peter Eades* Sue Whitesidest


Department of Computer Science School of Computer Science
University of Newcastle McGill University
Newcastle Australia Montreal Canada

Abstract The study of graph drawing and layout also prompts in-
terest in Euclidean minimum spanning tree realizability.
Several graph drawing algorithms try to make a layout
We show that deciding whether a tree can be drawn in which is as "small" as possible in some sense. Some aim
the plane so that it is the Euclidean minimum spanning for minimum area, some for minimum width, some for
tree of the locations of its vertices is NP-hard. minimum total edge length [12, 10]. We have observed
that in a number of experimental results (see [5]), algo-
Keywords: tree, algorithm, graph drawing, graph layout, rithms for drawing trees often (but not always) produce
NP-hard, spanning tree. tree layouts that are minimum spanning trees, or nearly
minimum spanning trees, of the vertex locations.

In a paper that studies graph theoretic changes in min-


1 Introduction imum spanning trees of moving point sets, Monma and
Suri [9] note that every tree with maximum degree at
This paper investigates a fundamental geometric real- most five can be drawn as a minimum spanning tree,
ization problem, the realization problem for Euclidean and that no tree with a vertex of degree larger than 6
minimum spanning trees: Given a tree T = (V, E), find can be drawn as a minimum spanning tree.
a location D(u) for each vertex u € V so that T is a
Bose, Lenhart and Liotta [1] show that for several
minimum spanning tree of {D(u) : u € V"}, or deter-
classes of proximity graphs (for example, relative neigh-
mine that no such locations exist.
borhood graphs and Gabriel graphs), the problem of
This problem belongs to the growing body of knowledge determining whether a tree can be realized as a proxim-
and research on the geometric realizability of combina- ity graph can be solved in polynomial time.
torial objects and the related problem of finding com-
This paper presents the first negative result in this area:
binatorial characterizations of geometric objects. The
the realization problem for Euclidean minimum span-
Delaunay triangulation realizability problem [4], [3] pro-
ning trees is NP-hard.
vides another such example. It asks whether, for a given
triangulation specified combinatorially in terms of ver-
tices, edges, faces and incidence relations, there is a way
to place the vertices in the plane so that their Delaunay
triangulation is combinatorially equivalent to the given
2 Preliminaries
triangulation.
•eades@cs.newcastle.edu.au Dept. of C.S., University Dr.,
Given a set S of points in the plane, a spanning tree of
CaUaghan NSW 2308 AUSTRALIA S is a tree whose vertex set is S. Edges of the tree can
W@cs.mcgill.ca School of C.S., 3480 University St. #318, be regarded either as pairs of points in S or as open
Montreal, Quebec H3A 2A7 CANADA line segments between points in S. A spanning tree
T = (S, E) of S is a Euclidean minimum spanning tree
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for
of S if
direct commercial advantage, the ACM copyright notice and the
title of the publication. and its date appear, and notice is given E
uv£E
dist(u,v)
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. is minimized over all spanning trees of S.

10th Computational Geometry 94-6/94 Stony Brook, NY, USA


© 1994 ACM 0-89791-648-4/94/0006..$3.50

49
A drawing D of a tree T = (V, E) is a pair of 1-1 func-
tions
Dv : V -*■ Ä2, DB ■ E -> L,
where L is the set of open line segments in R?, such
that the endpoints of DE(U, V) are D{u) and D{y). The
images of the vertices and edges of T under D form a
tree which is isomorphic to T.

When discussing a tree T — (V, E) and some drawing D


of T, we often use the same notation for a vertex and its
position as given by Dy, and the same notation for an
edge and the corresponding line segment. For instance,
if u,v,a,b G V and uv,ab £ E then expressions such
as "the length of the edge uv" and "edge ab intersects
edge uv" refer to the drawing D of T. Also, a "vertex"
or "edge" of D refers to the image under Dv or DE of
a vertex or an edge of T.

Definition 1 Suppose that D is a drawing of T —


(V,E), and let S = {Dv(v) : v e V). If T is iso-
morphic to a minimum spanning tree of S, then we say Figure 1: A (3,4)-logipede
that D realizes T.

Thus "T is realizable" means that there is a 1-1 function The realization shown in the Figure places the tree on a
Dv that maps each tree vertex v to a point Dy(v) in triangular grid. We prove that this phenomenon holds
the plane, such that T is isomorphic to at least one in general. Any realization of a logipede as a Euclidean
of the Euclidean minimum spanning trees of the point minimum spanning tree draws the logipede on a trian-
set Dv(V). Hence our main result can be described as gular grid. Here we emphasize strongly that the combi-
follows. natorial structure of the tree forces the grid to appear
implicitly in the realization. No initial requirement is
Minimum Spanning Tree Realizability (MSTR) made that the tree must be embedded on a grid, or
Instance: A tree T. that its edge lengths must be uniform.
Question: Is T realizable?
To transform an instance of Not-AU-Equal-3SAT with
Theorem 1 MSTR is NP-hard. m clauses and n variables to an instance of MSTR,
we construct an (m, n)-logipede and use it to provide
a framework for a pair of (clause, boolean variable) and
Specifically, we show that the problem of determining (clause, complement variable) incidence matrices. We
whether trees with maximum degree 6 are realizable is regard the realization of an (m, n)-logipede as consist-
NP-hard. ing of a "spine" whose length is proportional to n, to
which pairs of "legs" are attached whose lengths depend
We say a tree T has a unique realization D, or that on m and the place of attachment along the spine. Each
D uniquely realizes T, if D realizes T and for every pair of legs represents a boolean variable and its com-
other realization D' of T, there is a congruence mapping plement, and the legs in the pair act like columns in the
DV(V) to D'V(V) and DE(E) to D'E{E) after a suitable two incidence matrices. For technical reasons, the legs
change of scale. grow in length, and so the rows of the incidence ma-
trices cannot be visualized as parallel to the spine, but
We now give a brief overview of the proof of the main
rather as forming an angle with it. Details are given in
result. We prove Theorem 1 by a reduction from Not-
Section 5.
All-Equal-3SAT (see Section 5). This is done by de-
signing a family of trees we call {in, n)-logipedes. These The occurence or not of a literal in a clause is indicated
trees are defined purely combinatorially in terms of in- by modifying the leg corresponding to the literal at the
cidences of vertices and edges. We show that logipedes position in the leg that corresponds to the clause.
are uniquely realizable. Figure 1 shows the unique real-
ization of a (3,4)-logipede. To define logipedes and to prove that they are uniquely

50
realizable, we construct a sequence of uniquely realiz-
able "gadgets". The next section describes the gadgets.
Section 4 indicates how to prove they are uniquely real-
izable. Section 5 proves Theorem 1.

3 The Gadgets
Figure 3: Two realizations of a star chain
Since our proof that a particular gadget is uniquely re-
alizable generally depends on knowing that its prede-
cessors are uniquely realizable, the sequence of gadgets
given here can be regarded as a route through the proof
of logipede unique realizability.

It cannot be over-emphasized that the gadgets are


purely combinatorial objects, sometimes called free or
abstract trees. To save space, however, we convey the
definition of most gadgets by giving a realization rather
than by writing out a combinatorial definition.

Definition 2 A tree consisting of a degree 6 vertex to-


gether with its six neighbors is a star. The degree 6 ver-
tex is called the center of the star, and the other vertices
are called the points of the star.

A star is illustrated in two ways in Figure 2: combina-


torially, and realized as a minimum spanning tree.

Figure 4: A base and its realization

Definition 4 The tree in Figure 5 is a spine base. The


new star is called the 1st or leading spine star, denoted
Si.

Figure 2: A star and its realization


Definition 5 The tree in Figure 6 is a short spine in
Chains of stars have limited but multiple possibilities realized form. The two new stars adjoined to the 1st
for realizations (Figure 3). Chains of stars are subtrees leg stars are called 2nd leg stars. The third new star is
of many of our gadgets, but they must be modified to
called the cap star.
achieve unique realizability.

Definition 3 The tree in Figure 4 is a base. The star Definition 6 Figure 7 illustrates a spine of length k
with center s in the Figure is called the center star of for k — 7. (A spine of length 1 is just a short spine.)
the base, and vertex s is called the center of the base.
The two remaining stars are called leg stars of the base.
Definition 7 Figure 8 gives a realization of an (m, k)-
legged spine for m = 6 and k = 7. We say the spine has

51
Leg Stars —»

Spine Star S±
////fk /fk
Figure 7: Realization of a spine of length 7

Spine Scar S

Figure 5: A spine base and its realization

length k and the legs have length m because the number


of spine stars is k, and the number of leg stars in each Figure 8: A (6,7)-legged spine
leg is m. (A (2, k)-legged spine is just a spine of length
k.)
NOTATION. Note that, given an (mi,m2,fc)-skeleton,
the (mi, k — l)-legged spine and the {m-z, l)-legged spine
used to create it are uniquely identifiable. The spine
Definition 8 Figure 9 gives a realization of an stars in the (mi, k — l)-legged spine retain their names
(m\, m2,&j-skeleton for mi = 6, m2 = 11 and k = in the skeleton, and are called the 1st, 2nd, ..., k — 1st
8. It is created by joining an (m,2,l)-legged spine to spine stars (denoted Si, S2, ■■-, Sk-i) of the skeleton.
an (m\,k — \)-legged spine as shown. We say it has The cap star of the (m2, l)-legged spine becomes the
k spine stars, or length k for short, and front legs of kth spine star Sk of the skeleton.
length mj and rear legs of length m^.
Definition 9 Figure 1 of the previous section illus-
trates an (m,n)-logipede for m — 3 and n — 4- An
(m,n)-logipede is created from a (2m,(2m-\-n+l),2nJ-
2nd Leg scar skeleton as shown in the figure. Here the m and n re-
fer to the number m of clauses and n of variables in
Cap Star 1st Leg Star
a Not-all-equal-3SAT instance that the logipede will en-
code, and the numbers of stars in the legs and the spine
are functions of these parameters.
1st Leg Scar

Spine Star S
2nQ Leg scar Definition 10 A pre-(m,n)-logipede is the tree ob-
tained by following the construction for an (m,nj-
logipede, but adjoining star chains of length 1 instead
of star chains whose lengths depend on m and the index
Figure 6: A realization of a short spine of the spine star.

52
3. In D, both the path between b and c and the path
between a and b contain an edge of length I.

Then the edge sb has length I and forms an angle of 120°


with each of the segments ba and be.

Figure 9: A (6,ll,8)-skeleton

4 Uniqueness Results
Figure 10: Diagram for 120-degree Lemma
This section outlines the proof that (m, n)-logipedes are
uniquely realizable. Most proofs of lemmas are straight-
forward and have been omitted. Some are left for flavor.

Lemma 1 Suppose that S is a finite set of points in the


plane, T is a minimum spanning tree of S, and S' C S.
If the subgraph T' ofT induced by S' is connected, then
T' is a minimum spanning tree of S'.

The above Lemma is used as follows. Suppose that D'


is a unique realization of a tree T', and that a tree T
contains T". Then in every realization D of T, T' must
be drawn congruent (after scaling) to D'.
Figure 11: Realization of a double star

Lemma 2 // segments ab and be are edges in a Eu-


clidean minimum spanning tree, then labe is the largest Corollary 1 Suppose that T is a star chain of length
angle in Aabc. 2. Then T is uniquely realizable as in Figure 11.

Lemma 3 In every realization of a star, all edges have sides of length 1


At least one
the same length, and consecutive edges in the cyclic or- edge of length 1
neighbor w

dering of edges around the center form 60° angles.

Lemma 4 Let D be a realization of tree T. Suppose


that

1. D contains three vertices a, b, c such that segments


ab and be are of length I and form an angle of 120°. Figure 12: Diagram for 5-hex Lemma
(These segments are not necessarily edges of D).
2. Vertex b is a point of a star with center s, where Lemma 5 Suppose, that in some realization D of tree
the star is disjoint from a and c. T, a vertex c of T is located at the center of a regular

53
hexagon of side length I, at least five of whose vertices
are occupied by vertices ofT, which need not be adjacent
to c or to each other in T. Suppose further that for each
vertex v of T located at a vertex of the hexagon, there is
a path in D connecting v to c that contains at least one
edge of length I (Figure 12). Then each neighbor w of c
Path has at 1
must be located at one of the 6 vertices of the hexagon. one edge of length 1

r* Figure 14: Diagram for 3-hex Lemma.

Proof: In D, let e and / denote the neighbors of s that


precede and follow c in the cyclic ordering of vertices
adjacent to s, as in Figure 14. The fact that D is a
minimum spanning tree places constraints on the loca-
tions of e and /. By Lemma 3, the segments ce and cf
must form an angle of 120°.
Figure 13: Diagram for 3-claw Lemma
The only solution to these constraints is to place e and
/ at vertices /14 and /i6 of the hexagon, which by Lemma
3 determines the placement of s and the set of locations
Lemma 6 Let T be a tree formed be adjoining three
occupied by its neighbors. D
new leaves to one of the points b of a star. Then in any
realization D ofT, b is located at the center of a regular
hexagon whose vertices are occupied by the center of the With the machinery of the preceding technical lemmas,
star, two points of the star, and the three new leaves it is possible to prove in order the unique realizability of
adjoined to point b. (See Figure 13.) the following sequence of gadgets (we omit the proofs;
see the figures of the previous sections for the realiza-
tions): spine bases, short spines, (m, fc)-legged spines,
A vertex of a realization D of a tree T is called a hexagon (mi,m2, fc)-skeletons, pre-(m, n)-logipedes, and (m, n)-
centerii it is the center of a regular hexagon of side equal logipedes.
to the minimum edge length in D, such that at least 5
of the vertices of the hexagon are occupied by vertices
of D.
5 The Transformation
Lemma 7 Suppose that
1. D is a realization of a tree T in which a vertex c This section uses the uniqueness of the logipede real-
is located at the center of a regular hexagon with side ization to transform the NP-complete problem Not-All-
length I; denote the vertices of the hexagon by hi,...hs Equal-3SAT [6] to MSTR.
in cyclic order.
Not-All-Equal-3-Sat (NAE3S)
2. Vertices /ii,/i2 o-nd /13 of the hexagon are occupied by
Instance: A set C of m clauses Ci,C2, ...,cm, each con-
vertices v\, t>2 and i>3 of D, where for each Vi, 1 < i < 3,
taining 3 literals from a set X of n boolean variables
there is a path in D connecting u,- to c and containing
Xi,X2,...,Xn and their complements.
an edge of length I.
Question: Can consistent truth values be assigned to
3. Vertex c is adjacent in T to a vertex s of degree 6,
the literals so that each clause contains at least one true
s # vi, v2 or v3.
literal and at least one false literal?
Then:
- Vertex s is located at vertex /15 of the hexagon, and the Without loss of generality, we assume that no clause in
edges between s and its neighbors have length I, and C contains both a variable Xj and its complement X'.
- The two neighbors of s that precede and follow c in the
cyclic ordering of the neighbors of s occupy vertices /14 Our transformation follows the paradigm used by Bhatt
and he of the hexagon. and Cosmodakis [11], Idicula [7], Gregori [8] and Bran-

54
denburg [2]. We modify an (m, n)-logipede so that the of the logipede with strikers corresponding to the yes
modified logipede can be realized (although not neces- instance a = X[ OR X'2 OR X'3, c2 = X[ OR X'2 OR
sarily uniquely) if and only if the NAE3S instance being X'A, and c3 = X2 OR X'z OR X4.
transformed is a yes instance.
Suppose that the NAE3S instance is a yes instance. The
Consider two mxn incidence matrices defined as follows. underlying unlabelled (m, n)-logipede has a unique re-
Row i of each matrix represents clause cs-; in one ma- alization. However, the labelled leg lj could be drawn
trix, column j represents variable Xj, and in the other on either side of the spine, with leg /< drawn on the
matrix, column j represents the complement X', of vari- opposite side. Consider a consistent truth assignment
able Xj. In the (clause, variable) matrix, entry (i,j) is to variables such that each clause contains at least one
1 if clause i contains variable Xj; otherwise, the entry is false literal and at least one true literal. A realization of
0. The entries of the (clause, complementary-variable) the modified logipede, with strikers added, can be ob-
matrix are defined similarly. tained from such a truth assignment by placing all legs
whose corresponding literals are true on the same side of
An (m, n)-logipede represents these two matrices as fol- the spine, and placing all remaining legs on the opposite
lows. Let lj and /'• denote the leg chains associated side of the spine. The details are straightforward.
with the jth odd-indexed spine star Sy-i, 1 < J' < n-
These legs represent variable Xj and its complement To show that only yes instances of NAE3S are trans-
XL respectively. For geometric reasons, it is conve- formed to yes instances of MSTR, arbitrarily choose a
nient to make the first j — 1 stars closest to the spine true side and a false side of the spine in the minimum
in legs lj and /'• serve as padding that does not repre- spanning tree realization. Set the literals correspond-
sent any positions of the incidence matrices. Beyond the ing to legs appearing on the true side to true and the
padding, every other star in a leg chain represents an remaining literals to false. In the example shown in
incidence matrix position. In particular, position (i, j) Figure 15, the assignment of truth values read off from
in the (clause, variable) matrix is represented by a star the realization would be X\ — X3 = X4 = true and
in leg lj, namely by star (j — 1) + (2z - 1), where the leg X-2 = false, or the complements of these values. It is
star closest to the spine is regarded as the first star in not hard to show that this strategy works in general.
the leg.
D

Lemma 8 There is a polynomial time transformation


from NAE3S to MSTR.

Proof: Given an NAE3S instance with m clauses and n


variables, construct an (m, n)-logipede T, and then add
to it as follows.

1. If variable Xj appears in clause C{ (so by assump-


tion Xj does not appear in c,), select two degree 1
pointsof star (j —l) + (2i— 1) in leg lj for modifica-
tion. Adjoin two new leaves to one of the selected
points, and one new leaf to the other selected point.
Do not modify leg lj.

2. Similarly, if Xj, but not Xj, appears in c,-, then


adjoin new leaves as above to two points of star
(j - 1) + (2i - 1) in leg /j but do nothing to leg lj.

3. If neither Xj nor Xj appears in c,-, then adjoin new


leaves as above both in lj and in lj.

Clearly this transformation can be done in polynomial


Figure 15: One realization of a transformed yes instance
time in the length of the NAE3S instance. The set of
three new leaves adjoined to a star that is modified is
called a striker. Figure 15 gives one possible realization Now Theorem 1 follows immediately.

55
In conclusion, we note that the proof of Theorem 1 con- [11] K. Sugiyama. A readability requirement on draw-
structs a tree whose only realization is on a triangular ing digraphs: Level assignment and edge removal
grid. Furthermore, any tree drawn on a triangular grid for reducing the total length of lines. Technical
such that tree edges all have unit length is a minimum Report 45, Int. Inst. for Advanced Study of Social
spanning tree. Thus our transformation can be used to Information Science, March 1984.
show that the problem, considered in [7], of drawing a
tree on a triangular grid so that every edge has unit [12] L. Valiant. Universality considerations in vlsi
length is NP-complete. circuits. IEEE Transactions on Computers, C-
30(2):135-140, 1981.

References
[1] P. Bose, W. Lenhart, and G. Liotta. Characterizing
proximity trees. In Graph Drawing 93, 1993.

[2] F.J. Bradenburg. Nice drawings of graphs and trees


are computationally hard. Technical Report MIP-
8820, Fakultät fur Mathematik und Informatik,
Univ. Passau, 1988.

[3] M. B. Dillencourt and W. D. Smith. A linear-time


algorithm for testing the inscribability of triva-
lent polyhedra. In Proceedings of the Eighth An-
nual ACM Symposium on Computational Geome-
try, pages 177-185, Berlin, Germany, June 1992.

[4] M. B. Dillencourt and W. D. Smith. A simple


method for resolving degeneracies in delaunay tri-
angulations. In Automata, Languages, and Pro-
gramming: Proceedings of the 20th International
Colloquium, pages 177-188, Lund, Sweden, July
1993. Springer-Verlag Lecture Notes in Computer
Science 700.

[5] P.D. Eades. Drawing free trees. Bulletin of the


Institute for Combinatorics and its Applications,
5:10-36, 1992.

[6] M.R. Garey and D.S. Johnson. Computers and


Intractability: A Guide to the Theory of NP-
Completeness. Freeman, San Francisco, Ca., 1979.

[7] P. J. Idicula. Drawing trees in grids. Master's the-


sis, Department of Computer Science, University
of Auckland, 1990.

[8] E.B. Messinger, L.A. Rowe, and R.H. Henry. A


divide-and-conquer algorithm for the automatic
layout of large directed graphs. IEEE Transactions
on Systems, Man and Cybernetics, SMC-21(1):1-
12, 1991.

[9] C. Monma and S. Suri. Transitions in minimum


spanning trees. In Proc. ACMSymp. on Computa-
tional Geometry, pages 239 - 249, 1991.

[10] E. Reingold and J. Tilford. Tidier drawing of trees.


IEEE Transactions on Software Engineering, SE-
7(2):223-228, 1981.

56
Optimal Parallel Randomized Algorithms for the Voronoi Diagram of
Line Segments in the Plane and Related Problems
Sanguthevar Rajasekaran Suneeta Ramaswami*

Department of Computer and Information Science,


University of Pennsylvania, Philadelphia, PA 19104

Abstract Machine) for the construction of the Voronoi diagram of a


set of non-intersecting (except possibly at endpoints) line
In this paper, we present an optimal parallel random- segments in the plane. The first sequential algorithm for
ized algorithm for the Voronoi diagram of a set of n this problem was given by Lee and Drysdale [17], which
non-intersecting (except possibly at endpoints) line seg- runs in 0(nlog2n) time. This run-time was later improved
ments in the plane. Our algorithm runs in O(logn) time to 0(nlogn) in numerous papers (Kirkpatrick [15], Yap
with very high probability and uses 0{n) processors on a [23] and Fortune [10]), which is optimal since sorting can
CRCW PRAM. This algorithm is optimal in terms of P.T be reduced to this problem. The best known parallel de-
bounds since the sequential time bound for this problem terministic algorithm was given by Goodrich, O'Diinlaing
is Q,(n log n). Our algorithm improves by an 0(log n) fac- and Yap [13] and runs in 0(log n) time using 0(n) pro-
tor the previously best known deterministic parallel algo- cessors. It seems unlikely that existing deterministic tech-
rithm which runs in 0(log n) time using 0(n) processors niques can be used to improve this run-time.
[13]. We obtain this result by using random sampling Recent years have seen significant advances in paral-
at "two stages" of our algorithm and using efficient ran- lel algorithm design for computational geometry prob-
domized search techniques. This technique gives a direct lems. Some of the earliest work in this area was done
optimal algorithm for the Voronoi diagram of points as by Chow [5] and Aggarwal et. al. [1], who gave paral-
well (all other optimal parallel algorithms for this prob- lel algorithms for various fundamental problems such as
lem use reduction from the 3-d convex hull construction). two-dimensional convex hulls, trapezoidal decomposition
1 Introduction etc. A number of these algorithms have since been im-
proved. Atallah, Cole and Goodrich [3] demonstrated op-
Voronoi diagrams are elegant and versatile geometric
timal deterministic algorithms for many of these problems
structures which have applications for a wide range of
by applying the versatile technique of cascading divide-
problems in computational geometry and other areas. For
and-conquer and building on data structures developed in
example, computing the minimum weight spanning tree,
[1]. Reif and Sen [22] also obtained optimal randomized
or the all-nearest neighbor problem for a set of line seg-
parallel algorithms for a number of these problems; these
ments can be solved immediately and efficiently from the
algorithms use n processors and run in O(log n) time with
Voronoi diagram of line segments. As we learnt from [17],
very high probability.
these diagrams can also be used to compute a country's
The important problems of constructing Voronoi dia-
territorial waters! Certain two-dimensional motion plan-
ning problems can be solved quickly when the Voronoi grams of points in two dimensions and convex hulls of
points in three dimensions, however, eluded optimal par-
diagram is available [19]. Thus, exploiting parallelism to
obtain faster solutions is a desirable goal. In this paper, allel solutions for a long time. Both these problems have
we are interested in developing an optimal parallel ran- sequential run-times of 0(n logn). Aggarwal el al. [1]
domized algorithm on a PRAM (Parallel Random Access gave 0(log2n) and 0(log3n) time algorithms (using n pro-
cessors) for the Voronoi diagram and convex hull prob-
*This research is partially supported by ARO' Grant lems, respectively, and the technique of cascaded-merging
DAAL03-89-C-0031. could not be extended to these problems to improve their
Permission to copy without fee all or part of this material is run-times [8]. Very recently, Goodrich [12] has given an
granted provided that the copies are not made or distributed for algorithm for 3-d convex hulls that does optimal work,
direct commercial advantage, the ACM copyright notice and the but has 0(log n) run-time, and Amato and Preparata
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing [2] have described an algorithm that runs in O(logn)
Machinery. To copy otherwise, or to republish, requires a fee time but uses n1+e processors. Randomization, however,
and/or specific permission. proves to be very useful in obtaining optimal run-time as
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

57
well as optimal P.T bounds1. In [21], Reif and Sen gave thought of as a process tree, where a node corresponds to
an optimal randomized algorithm for the construction of a procedure at a particular stage of the recursion, and the
the convex hull of points in three dimensions. Since the children of that node correspond to the subproblems cre-
problem of finding the Voronoi diagram of points in two ated at that stage. The basic idea of the technique given
dimensions can be reduced to the three-dimensional con- in [21] is to find, at every level of the process tree, a good
vex hull problem, they also obtained an optimal parallel sample with high probability. By doing this, they can
method for the former. Their algorithm runs in O(logn) show that the run-time of the processes at level i of the
time, using n processors, with very high probability, and tree is 0(log n/28) with very high probability, and hence
there are no known deterministic algorithms that match the run-time of the entire algorithm is O(logn) with very
these bounds. high probability. By choosing a number of random sam-
ples (say g(n) of them; typically g(n) = O(logn)), we are
2 The Use of Randomization guaranteed that one of them will be good with high likeli-
Recent work by Clarkson and Shor [6], Mulmuley [18], hood. The procedure to determine if a sample is good or
and Haussler and Welzl [14] has shown that random- not will have to be repeated for each of the g(n) samples.
ization can be used to obtain better upper bounds for However, we would have to ensure that this would not
various geometric problems such as higher-dimensional cause the processor bound of 0(n) to be exceeded and
convex hulls, halfspace range reporting, segment inter- this is done by polling i.e. using only a fraction of the
sections, linear programming etc. Clarkson and Shor [6] input (l/g(n), typically) to determine the "goodness" of
used random sampling techniques to obtain tight bounds a sample. The idea is that the assessment of a sample
on the expected use of resources by algorithms for various (good or bad) made from this smaller set is a very good
geometric problems. The main idea behind their general reflection of the assessment that would be made from the
technique is to use random sampling to divide the prob- entire set. This method finds a good sample efficiently at
lem into smaller ones. The manner in which the random every level of the process tree, and is useful for converting
sample is used to divide the original input into subprob- expected value results into high probability results.
lems depends on the particular geometric problem under
consideration. They showed that for a variety of such Note that the total size of the subproblems can be
problems, given a randomly chosen subset R of the input bound to only within a constant multiple of the origi-
set S, the expected size of each subproblem is 0(|5|/|i?|) nal problem size. Thus in a process tree of O(loglogn)
and the expected total size is 0(|5|). A sample that sat- levels, this could lead to a polylogarithmic factor increase
isfies these conditions is said to be good, and bad other- in processor bound. In [6], Clarkson and Shor get around
wise. They showed that any randomly chosen sample is this problem by using only a constant number of levels
good with constant probability, and hence bad with con- of recursion in their algorithm and combining this with
stant probability as well. This allows us to obtain bounds incremental techniques (which are inherently sequential;
on the expected use of resources, but does not give high see [6] for further details). As mentioned earlier, Reif and
probability results (i.e. bounds that hold with probability Sen's [21] strategy to handle this problem is to eliminate
> (1 — l/na), where n is the input size, and a > 0). As redundancy at every level of the process tree. This step
pointed out by Reif and Sen [21], this fact proves to be is non-trivial and quite problem-specific. Our approach
an impediment in the parallel environment due to the fol- in this paper gets rid of this need altogether. In other
lowing reason: Parallel algorithms for such problems are, words, we do not need to devise a method to control to-
typically, recursive. For sequential algorithms, since the tal problem size at every level of the process tree. The
expectation of the sum is the sum of expectations, it is basic idea is to use random sampling at two stages of
enough to bound the expected run-time of each step. For the algorithm. We show that the polylog factor increase
recursive parallel algorithms, the run-time at any stage of in processor bound actually gives us a method to choose
the recursion will be the maximum of the run-times of the much larger samples, and this allows us to ignore the
subproblems spawned at that stage. There is no way of problem of increase in processor bound. By developing
determining the maximum of expected run-times without efficient search strategies to determine subproblems, we
using higher moments. Moreover, even if we can bound are able to obtain an optimal algorithm for the Voronoi
the expected run-time at the lowest level of the recursion, diagram of line segments in the plane. We think that our
this bound turns out to be too weak to bound the total approach is general enough to apply to other problems as
run-time of the algorithm. well.
We would like to point out that our strategy applies
In [21], Reif and Sen give a novel technique to over-
to the Voronoi diagram of points in the plane as well,
come this problem. A parallel recursive algorithm can be
thus giving a direct algorithm for this problem (instead
1 of using the reduction to 3-d convex hulls). During the
Sorting can be reduced to these problems, and hence the
best possible run-time will be 0(log n) on EREW and CREW course of the paper, we will point out the analogous steps
PRAMs. for the case of points in the plane.

58
B((a, b), (c, d)) , an angular
composed of three distinct objects: the two endpoints of
B(c, (a, b)), a parabolic arc^., bisector (a straight line) /\ s and the open line segment bounded by those endpoints.
b ■■-. y^ /: B(b, d), a straight line The Euclidean distance between two points p and q is
denoted by d(p, q). The projection of a point q on to
a closed line segment s with endpoints a and b, denoted
/ B(b, (c, d)), a parabolic arc proj(q, s), is defined as follows: Let p be the intersection
point of the straight line containing s (call this line s),
Spokes
and the line going through q that is perpendicular to s.
If p belongs to s, then proj(q, s) = p. If not, then
-B(a, c), a straight line proj(q, s) = a\ld(q, a) < d(q, b) and proj(q, s) = b,
otherwise. The distance of a point q from a closed line
segment s is nothing but d(q, proj(q, s)). By an abuse
Figure 1: The bisector of line segments s-y and S2- of notation, we denote this distance as d(q, s). Let S\
and S2 be two objects in S. The bisector of s\ and S2,
3 Preliminaries and Definitions
B(si, S2), is the locus of all points q that are equidistant
The parallel model of computation that will be used from s\ and S2 i.e. d(q, s\) = d(q, S2). Since the objects
in this paper is the Concurrent iJead Concurrent Write in S are either points or open line segments, the bisectors
(CRCW) PRAM. This is the sychronous shared memory will either be parts of lines or parabolas. The bisector of
model of parallel computation in which processors may two line segments is shown in Figure 1. Note that if S
read from or write into a memory cell simultaneously. is a set of points, all the bisectors are parts of straight
Write conflicts are resolved arbitrarily; in other words, lines. The formal definition is stated below, followed by
the protocol used for resolving such conflicts does not
an important theorem.
affect our algorithm. Each processor performs standard
Definition 3.2 The Voronoi region, V(s), associated with an
real-arithmetic operations in constant time. In addition,
object s in S is the locus of all points that are closer to s than
each processor has access to a random number generator to any other object in S i.e. V(s) = {p \ d(j>, s) < d(p, s )
that returns a random number of O(logn) bits in con- for all s1 £ S}. The Voronoi diagram of S, Vor(£), is the
stant time. A randomized parallel algorithm A is said to union of the Voronoi regions V(s), s £ S. The boundary
require resource bound f[n) with very high probability if, edges of the Voronoi regioons are called Voronoi edges, and
for any input of size n, the amount of resource used by the vertices of the diagram, Voronoi vertices.
A is at most c.a.f(n) with probability > 1 — l/na for
positive constants c, a (a > 1). O is used to represent Theorem 3.3 (Lee et al. [17]) Given a set S of n objects
in the plane (in this paper, these objects will either be noninter-
the complexity bounds of randomized algorithms i.e. A
secting closed line segments or points), the number of Voronoi
is said to have resource bound 0(f(n)). The following is
regions, Voronoi edges, and Voronoi vertices o/Vor(5) are all
an important theorem. 0(n). To be precise, for n > 3, Vor(S) has at most n vertices
Theorem 3.1 (Reif and Sen, [22]) Given a process tree and at most 3ra — 5 edges.
that has the property that a procedure at depth i from the root It is convenient to divide Voronoi regions into smaller
takes timeT, such that Pr[T% > k(e'Y a log n] < 2-(E'>'alo6", regions by augmenting the diagram in the following way
then all the leaf-level procedures are completed in 0(log n) (such an augmentation was originally proposed by Kirk-
time, where k and a are constants greater than zero, and patrick [15]): If v is a Voronoi vertex of V(s), and if
0<e' < 1.
v' = proj{y, s), then the line segment obtained by join-
Note that the number of levels in the process tree will ing v and v' is a spoke of V{s). The spokes define new sub-
be O(loglogn). Intuitively, the above theorem says that regions within V(s). These sub-regions bounded by two
if the time taken at a node which is at a distance i from spokes, part of s and a Voronoi edge are called primitive
the root is 0((logn)/2*) with high probability, then the regions (prims) [13]. Some spokes and prims are shown in
run-time of the entire algorithm is O(logn). Figure 1. Hereafter, all references to the Voronoi diagram
will assume that it is augmented as above.
3.1 Voronoi Diagrams
In the case of the Voronoi diagram of points, all bisec-
We now give definitions and establish some notation for tors are straight lines and hence two bisectors can inter-
the geometric objects of interest in this paper i.e. Voronoi sect at most once. However for line segments, the bisec-
diagrams (these definitions are standard; see e.g. [13, tors are composed of straight line segments and parabolic
17]). Let S be a set of nonintersecting closed line segments arcs. Consequently, we give the following lemma, which
in the plane. For simplicity of description, we will assume will be of use to us later on in the paper.
that the elements of S are in general position i.e. no Lemma 3.4 Given line segments s, s\ and S2 in the
three of them are cocircular. Following the convention plane, the two bisectors B(s, s\) and B(s, S2) can inter-
in [17, 23], we will consider each segment s £ S to be sect at most twice.

59
We give below some results that will be useful for the subproblems so that each of these can be solved in par-
brute force construction of the Voronoi diagram of a sam- allel. The technique of using a random sample to divide
ple of the appropriate size, and will be used in the course the original problem into subproblems will be useful only
of our algorithm. if we can show that the subproblems are of roughly equal
Lemma 3.5 The Voronoi diagram of a set of n line seg- size (0(n1_e)) and that the total size of all the subprob-
ments in the plane can be constructed on a CREW PRAM lems is almost equal to the size of the original problem
in O(logn) time using n3 processors. (Proof Omited) (0(n)). The expected value resource bounds for com-
putational geometry problems obtained by Clarkson and
Lemma 3.6 The Voronoi diagram of a set of n points
Shor [6] will be applied here. As mentioned in Section 2,
in the plane can be constructed on a CREW PRAM in
due to the nature of randomized parallel algorithms it is
O(logn) using n? processors.
necessary to efficiently find, at each level of the process
The above lemma follows easily from the fact that in- tree, such a sample with high probability. The technique
tersections of n half-planes can be found in O(logn) time of polling developed by Reif and Sen [21] will be utilised
using n processors [1, 4]. (Amato and Preparata's [2] towards this end. So a crude outline of the algorithm
method, though a more complicated approach, would give could be as follows.
us the same result.) The following are well-known non- (1). Construct the Voronoi diagram of R using the brute
optimal parallel algorithms that will be used when the force technique (Lemma 3.5/Lemma 3.6). Call this dia-
input to a subproblem is of an appropriately small size. gram Vor{R). We use Vor(R) to divide the original prob-
Lemma 3.7 (Goodrich et. al, [13]) The Voronoi di- lem into smaller problems which will be solved in parallel.
agram of a set of n line segments in the plane can be (2). Process Vor(R) appropriately in order to efficiently
constructed on a CREW PRAM in 0(log2n) time using find the input set of line segments to each of these sub-
n processors. problems.
Lemma 3.8 (Aggarwal et. al., [1]) The Voronoi dia- (3). Recursively compute (in parallel) the Voronoi dia-
gram of a set of n points in the plane can be constructed gram of each subproblem.
on a CREW PRAM in 0(log n) time using n processors. (4). Obtain the final Voronoi diagram from the recur-
sively computed Voronoi diagrams.
4 Randomized Algorithms for By choosing an appropriate e, we can ensure that the
first step can be done in O(logn) time using n processors.
Voronoi Diagrams In Section 4.4, we describe the use of a randomized search
In this section, we develop an optimal parallel randomized technique in order to efficiently find the subproblems de-
algorithm for the construction of the Voronoi diagram of fined by a chosen sample. We show that step 2 can be
a set of line segments in the plane. As we mentioned in carried out in O(logn) time with high probability using
Section 2, Reif and Sen [21] use the novel technique of n processors. In Section 4.5, we describe the merge tech-
polling to give an optimal randomized algorithm for the nique to compute the Voronoi diagram from recursively
three-dimensional convex hull problem. This immediately computed Voronoi diagrams (this step is non-trivial) and
gives an optimal randomized method for the Voronoi dia- show that the final merge step can be done in O(logn)
gram construction of a set of points in the plane because time using n processors. Thus, the recurrence relation
this problem is O(logn) (parallel) time reducible to the 3- for the run-time is T{n) = T{nl~e) + O(logrc), which
d convex hull problem. However, no analogous reduction solves to O(logn) (this follows from Theorem 3.1). How-
is at hand for the case of line segments. Our optimal par- ever, the description of the algorithm that we have given
allel randomized algorithm tackles the Voronoi diagram here is incomplete.
problem directly which, to our knowledge, has not been
As mentioned earlier, there is a side-effect in such re-
done before. The technique that we present in the forth-
cursive algorithms that is important to consider. When
coming sections is general enough that it can be applied
we use a random sample to divide the original problem
to the case of line segments as well as points in the plane.
into smaller ones, we can succeed in bounding the total
As a result, we also obtain a new and simpler randomized
size of the subproblems to only within a constant multiple
parallel method for the Voronoi diagram of points. Note:
of n. In a recursive algorithm, this results in an increase
Even though we restrict our attention to line segments in
in the total problem size as the number of recursive levels
the plane, this technique would work even when the input
increases. For a sample size of 0(n£), the depth of the
contains circular arcs (see [23] for relevant details).
process tree for a parallel randomized algorithm would
4.1 Outline of the Method be O(loglogn), and even this could result in a polyloga-
Let S = {si, S2, . •., s„} be the input set of line seg- rithmic factor increase in the total problem size. In [21],
ments in the plane and let R be a random sample from Reif and Sen get around this problem by eliminating re-
S. Let \R\ = nc for some 0 < e < 1. The sample dundancy in the input to the subproblems at every level
R will be used to divide the original input S into smaller of the recursion. In other words, since it is known that

60
the final output size is 0(n), it is possible to eliminate
those input elements from a subproblem whicch do not
contribute to the final output. By doing this, they bound
the total problem size at every level of the process tree
to be within c.n for some constant c. This step is non-
trivial and, in general, avoiding a growth in problem size
in this manner can be quite complicated. Moreover, the
strategy that can be used to eliminate redundancy seems
to be very problem-specific. We describe a method to use
sampling at two stages of the algorithm, which will help Figure 2: Region C#(e) (shaded) associated with
us to overcome the problem of the increase in total in- edge e.
put size as our algorithm proceeds down the process tree.
Moreover, it appears that our strategy is general enough smaller than (or equal to) VR(si). An element s,- will
to be applicable to other kinds of problems as well. This belong to the subproblem associated with edge e if and
technique is described in further detail in Section 4.3. It is only if VR(si) has a non-empty intersection with VR(e)
also crucial to device efficient search strategies in order to and VR(e). Observe that determining input for each sub-
determine all the subproblems that an element lies in. In problem in this manner satisfies the desired condition that
our algorithm, this need is particularly important because we stated in the remark above. VR(si) intersects VR{e)
of the fact that one of the stages of sampling entails larger and VR{e) if and only if the element s; has a non-empty
sample sizes (this will become clearer in Section 4.3). We intersection with Cn(e).
give such an efficient search strategy in Section 4.4. Let X(Cf{(e)) denote the set of all elements s,- G S
4.2 Defining the Subproblems such that Si has a non-empty intersection with Cß(e).
We now give a precise description of how the Voronoi dia- Thus, the input set for the subproblem associated with e
gram of a random sample R is used to divide the original will be nothing but X(CR(e)). Each of the Vor[X{CR{e)))
input S into smaller problems. Let \R\ = r. Consider an will be computed recursively. The number of edges
edge e of Vor(R). e has two primitive regions (prims were in Vor(R) will be at most 3r — 5 (Theorem 3.3),
defined in Section 3) on either side of it; call these VR(e) and, hence, so will the number of regions Cß(e). Let
and VR(e). Every vertex v of Vor(R) is equidistant from CR = {C/j(e) | e is a Voronoi edge from Vor(R)}. We
exactly three elements of R, and v is closer to these three can now use Clarkson and Shor's result (Corollary 3.8,
elements than to any other element of R. Thus every ver- [6]) to obtain the following. Note that it takes four ele-
tex defines a circle such that exactly three elements of R ments of R to define each region CR(C): the two elements
are incident on it and the interior of the circle is empty. that e bisects, and two other elements that determine the
Let VR(V) denote the circle (and its interior) defined by two vertices of e (referring now to the notation used in [6],
Voronoi vertex v of Vor[R). Let v\ and V2 be the two clearly 6 = 4 and the "ranges" identified by the function
vertices of e. 6 are precisely the regions CR(C) defined here).
Consider now the region obtained by the union of Lemma 4.1 Given a random sample R of size r from a set
VR(e), VR(e), and the two circles VR(V\) and VR(V2) of objects S of size n and using the notation established above,
(see Figure 2); in the case of unbounded edges, we have both of the following conditions hold with probability at least
two prims and one circle. Call this region Cfi(e). Ob- 1/2;
serve that for the Voronoi diagram of points, it is enough
(a) max { \X(CR(e))\ } < kmax (n/r) log r
to consider CR{C) to be the union of just the two circles Cn{e) g CR
defined by the two vertices of e because the prims VR(e)
and VR{e) always lie entirely within this union. This is (b) Y, l*(C*(e))l ^ ktot (»A) E( \CR\ )
not always the case for line segments, as can be seen in CR(e) g CR
Figure 2. where kmax and fc{0j are constants (obtained from Corollary
Remark: We would like the subproblem associated with 3.8 in [6]).
every edge of Vor{R) to satisfy the following condition: if
the final Voronoi region V(si) of element s; G S inter- Since E{ \CR\ ) is O(r), the above conditions guarantee
sects VR(e) or VR(e), then we would like at least all such that with probability at least 1/2, the total size of the
Si to be part of the input associated with the edge e. subproblems is almost equal to the size of the original
For every element s,- of S, consider the set of points that problem and the subproblems are of roughly equal size.
are closer to s; than to any other element of R. In other As in [6, 21], if a sample R satisfies these conditions then
words, consider the Voronoi region of s* in the Voronoi it is called a good sample and bad otherwise. In order to
diagram of the set R U {si}. Denote this by VR(si). solve the subproblems in parallel and obtain an optimal
Clearly, the final Voronoi region of s, will be a region run-time, we want a good sample with high probability.

61
4.3 Two Stages of Sampling is a good sample. As before, if we choose O(logn) such
samples, we know that at least one of them will be good
As mentioned in Section 2, Reif and Sen [21] describe
with very high probability.
the novel technique of polling in order to obtain a good
Let Ar = n/logqn. Let Si, 62, •••, Sdiogn be the
sample with high probability from samples that are only
O(logn) samples of size N each. Since the size of Si is
expected to be good. If O(logn) samples are chosen, in-
large, we obviously cannot afford to construct Vor(Si)
stead of just one, then it follows from Lemma 4.1 that
using a brute force technique (as we can do with sam-
with high probability one of these samples will be good.
ples of size 0(nej). We will have to run the randomized
Let i?i, ßo, ■••, -Raiogn be these samples (where the parallel algorithm using each of these Si as input. Let
value of a is fixed according to the desired success prob-
R\, R\, ■■■, Rla\ogN be tne O(logTV) random samples,
ability of the algorithm) of size 0(ne) each. Let us as-
each of size Nc, chosen from Si. Thus the skeleton of our
sume for now that we have an efficient (n processors and
algorithm will now be as follows. Note that the testing of
O(logn) time) procedure to compute the total subprob-
the samples Si is done with respect to a restricted input
lem size J2cR (e) g CR I X(CR,(e)) I for eacn Vor(Ri)- set (polling).
However, in order to determine which of these Ri is good,
Algorithm VORONOI_DlAGRAM;
this procedure will have to be repeated for each of the
• TV := n/\ogqn.
O(logn) samples. This will mean an increase in the pro-
• Pick dlogn random samples Si, S2,.. . , Sdlog n of size N
cessor bound of 0(n) which we want to avoid. Reif and each.
Sen [21] introduce the idea of polling in order to overcome • Let 7 be a random subset of the input set S such that
this problem. They determine the goodness of sample Ri \I\ = n/logqn, q being a constant < q.
by using only 0(n/\og n) randomly chosen elements from • S' := PICK_THE_RIGHT_SAMPLE(5I,52, ...,Sd\0Sn,I).
the input set, where b > 2 is some constant. The pro- • Partition the entire input S according to the good sample
cedure to determine the goodness of the alogn samples S'; such a method is given in Section 4.4.
can be run in parallel for all the Ri. • Solve each subproblem using a non-optimal technique
The randomized parallel algorithm is then run on the (Lemma 3.7 or Lemma 3.8).
• Merge the results (see Section 4.5).
good sample found in the above manner. However the
technique outlined so far still does not guarantee that we
Function PICK_THE_RIGHT_SAMPLE(5I , S2,. .. ,SdioSn,I)-
stay within the desired processor bound of O(n). The • Do the following in parallel for each 5, (1 < i < dlogn).
best bound that Lemma 4.1 can give us is that the total
1. (a) Choose a log n random samples R\, R'2, ..., R'a\os n
size of the subproblems at level (i + 1) of the process tree
each of size N€ from the set St.
is kf0f times the total size of the subproblems at level i.
This implies that after O(loglogn) levels, the total size (b) Construct the Voronoi diagram of each R'j
could increase by a polylogarithmic factor. Suppose the (1 < j < a log N) using the brute force technique
described in Lemma 3.5 of Section 3 (Lemma 3.6
total size at the leaf level of the process tree is at most
for the Voronoi diagram of points in the plane).
n.\ogcn, for some constant c. If the input to the divide-
and-conquer algorithm were to be of size n/logcn, then (c) Determine which of these Rj is a good sample for
S{.Hence the inputs to the method in Section 4.4
the total problem size at the leaf level of the process tree
will be R'j and St. Suppose R'}, is one such good
would be 0(n). This observation (along with the results
sample; with high probability, there will be such a
developed in the following sections) yields the following. ■/

J ■

Theorem 4.2 The Voronoi diagram of a set of n line (d) Use R' 1 to divide S, into smaller subproblems.
segments can be constructed in O(logn) time with high
(e) Recursively compute (in parallel) the Voronoi dia-
probability using n\ogcn processors.
gram of each subproblem.
The above theorem actually enables us to choose samples (f) Obtain the final Voronoi diagram Vor(Si) from
of size much larger than 0(ne). In particular, such a these recursively computed Voronoi diagrams.
sample S' could be of size O(n/loggn), q being a constant
2. Compute the total subproblems size when restricted to
> c. If S' is a good sample, then it would again divide the
I (this is polling). Hence the inputs to the method in
original input into smaller problems of roughly equal size Section 4.4 will be St and /.
(i.e. X(Cs'(e)) would be of size roughly 0(log?n) for all
• Return the best 5,; with high probability there will be such
Voronoi edges e in Vor(S')) and Y^ l^(^-s'(e))l would be
an S,.
0{n). In order to compute the Voronoi diagram of these
subproblems, we can then use any non-optimal algorithm Observe that in the above function, it will not be neces-
like the one stated in Lemma 3.7 (Lemma 3.8 for points sary to use polling in step 1(c) because of the smaller size
in the plane). We would, however, like to be able to find of the Si. The whole point of polling is to ensure that the
such a good sample S1 with high probability. As we know processor bound of 0(n) is not exceeded. However, we
from Lemma 4.1, there is a constant probability that £" can afford to use, for all 1 < a: < dlogn, the whole set

62
Si to determine the goodness of R'j (1 < j < alogn) stant T. The idea of using fractional independent sets2
because (cüogn).(alogn).TV is o(n) as long as q > 3. to build a subdivision hierarchy was first proposed by
We know that each of the Vor(Si) can be constructed Kirkpatrick [16]. Subdivision hierarchies can be used to
in O(logn) time with very high probability (more ac- construct efficient search data structures. Randomized
curately, we will know this for sure after the next two parallel algorithms to solve this problem efficiently were
sections). But we want to be sure that every one of given independently by Dadoun and Kirkpatrick [9] and
the Vor[Si) will be constructed in O(logn) time with by Reif and Sen [22]. We can clearly use the same idea of
high probability. This follows immediately from the fact fractional independent sets to build a hierarchy of Voronoi
that for events A\, A2, ... (not necessarily disjoint), diagrams that will be very useful for our purposes.
Pr[UiAi] < YliPr[Ai] Suppose the probability that the The dual VV(R) of the Voronoi diagram Vor(R) of
construction of Vor(Si) takes more than ß \ogn steps is a set of elements R is the graph which has a node for
< n~a for some constants a and ß. Then it follows every element in R and an edge between two nodes if
from the stated inequality that the probability that the their corresponding Voronoi regions share a Voronoi edge
construction of one or more of the Vor[Si) takes more (for the case when R is a set of points, the dual is the
than ß logn time is < (n~a).(d\ogn). Consequently, well-known Delaunay triangulation of the set of points).
the probability that all the Voronoi diagrams Vor(Si), W(R) is planar, and can be used to build a hierarchy of
Vor[S2), ..., Vor{Sd\ogn) are constructed in O(logn) Voronoi diagrams. By a slight abuse of notation, for each
time is > (1 — (n~a).(dlogn)), which is very high. segment s £ R, we will use s to refer to its corresponding
It will be necessary to process the Voronoi diagram of node in the graph W(R) as well (hence R will refer to
the random sample appropriately so that we have a fast the set of nodes when we talk about W(R)). Observe
method to find the subproblems defined by it. Note that that when R is a set of line segments in the plane, VV(R)
in our scheme it is imperative that we have an efficient could be a multigraph (i.e. there could be more than one
algorithm to perform this processing. In other words, we edge between two nodes): this is because a bisector can be
cannot afford to have a parallel algorithm that uses a split into two or more pieces in Vor(R). It can be shown
polynomial number of processors. Whereas in [21], since that every interior face of VV(R) must be triangular. In
the sample size is always 0(ne), they can choose an appro- a triangulated subdivision, the exterior face is assumed to
priate e such that the processor bound of 0(n) is main- be a triangle as well. If VV(R) does not have a triangular
tained, we do not have this flexibility. This is because of exterior face, we can assume that R has been augmented
the large sample size during the first stage of sampling. appropriately so that we have this property (this can be
In the following section, we give an efficient method that done in O(logr) time using r processors).
satisfies our requirement. In the remainder of this paper, we use VR(S) to denote
the Voronoi region of s £ R in the Voronoi diagram
4.4 Finding X{CR(e)) for each CR(e) Vor(R). Also, as in [16], we will assume that every node
Let R be a random sample chosen from a set S, and let of a fractional independent set is an internal node VV{R),
\R\ = r. (Hence R could either be one of the Si cho- and the degree of each such node is less than or equal
sen from the original input S (r = N and S = S) or to T, where r is a fixed constant (for our purposes, it
one of the Äj chosen from Si (r = Ne and S = Si).) suffices to assume that r = 6). Let i?i = R. Consider a
Let us assume Vor(R) is available to us; Vor(R) would fractional independent set W of R\ in the graph W{R\),
have been constructed either through a brute-force tech- and let R2 = Ri - W. Let s be a node in W. Let TRl(s)
nique or the divide-and-conquer method outlined in the represent the set of neighbors of s in VV(Ri) (obviously
previous section. We now describe a method to process |r-Rl(s)[ < T). Since W is an independent set, we know
Vor[R) appropriately so that we can find X(CR(C)) (C S) that TRl(s) C Ri- Then we have the following.
for all Voronoi edges e of Vor(R) in O(logn) time with Lemma 4.3 For an element s1 £ R2, VR2(S') contains
high probability using 0(n) processors. Note that we ob- a part of the region VR^S) (i.e. VR2(S') fl VR1(S) ^ 0J
viously cannot sequentially determine all the subproblems if and only if s' £ TRl(s).
that an element of <S lies in because this could be as large
as 0(r). It is now easy to construct Vor(R2) from Vor[R\).
First, we know from [9, 22] that with very high proba-
4.4.1 Processing Vor[R) to Form the Search bility, we can find such an independent set W in constant
Data Structure VorDS(Ä) time using r processors (the idea is to use randomized
Let U be a triangulated subdivision with u vertices. A 2
If G = (V, E) is a planar graph, then a set X C V is a
subdivision hierarchy is a sequence Ui, U2,---, Uh(u) of fractional independent set of G if (1) the degree of each vertex
triangulated subdivisions satisfying the following condi- v S X is less than or equal to some constant d (2) no two
tions: (1) Ui = U, (2) |C/j(u)| = 3, and (3) each region vertices of X are connected by an edge (i.e. the set X is an
of Ui+i intersects at most r regions of Ui for some con- independent set) and (3) \X\ > c \V\ for some fraction c.

63
symmetry breaking; see [9, 22] for details). It follows from level i. Let these be called V\, V2, ■ ■ ■ ,VP (note that p
Lemma 4.3 that X>V(i?2) can be obtained from VV(Ri) will be less than or equal to r). Without loss of gener-
in constant time using r processors: For all s G W, (a) ality, let s\, si, ■ ■ •, sp be the elements of Ri such that
delete the node s and the edges between s and members of for 1 < j < p, Vj belongs to VR^SJ), respectively. If
rfll(s) and (b) add edges between pairs of elements from B(s, intersects prim Vj, then IT generates a request
rfil(s) if they share a Voronoi edge in Vor{R2) (there will for a new processor in the following manner: it randomly
be at most 3 such new edges for each s). Note that for generates a processor label and writes into that proces-
each new prim of Vor^R^), we can determine in constant sor to indicate that it is being requested. There could be
time the prims of Vor[Ri) that it intersects. write conflicts during this step and an arbitrary processor
We can repeat on R? the steps described above and will succeed (in the case of a success, the new processor
obtain a new set A3 and the graph VV{Rz), and we can will need to know Vj and s so as to continue the search
continue the process until we have a set of size 3. In other from the node corresponding to Vj). Obviously II can
words, we can build a hierarchy (analogous to the subdi- carry out this step in constant time (p steps). In order to
vision hierarchy of Kirkpatrick [16]) of Voronoi diagrams be sure that this scheme works, we need to know that for
Vor{Ri), Vor(R2), ..., Vor(Rh) where h = O(logr). This each s £ S, every prim that should be reached at level
will take O(logr) time and r processors with high prob- i is reachable from level (i + 1) in the above described
ability. We build the search data structure as we con- manner. This follows from the lemma given below (we
struct this hierarchy of Voronoi diagrams. The data struc- omit the proof, which is quite straightforward).
ture is a directed acyclic graph VorDS(i?) that contains Lemma 4.5 // VR'(s) intersects a prim V at level i,
a node for each primitive region in the diagrams Vor(Ri) then V ,+1 (s) must intersect at least one of the prims
(1 < i < h). Each prim of Vor[Ri+\) is a node in that V intersects at level (i + I) of VorDS(Ä).
the [i + l)-th level of VorDS(Ä) and has a directed edge We described one phase of the algorithm above. During
to those nodes at level i with which it has a non-empty
the next phase, another set of requests are generated in a
intersection. Obviously the degree of each node in the
similar manner (including the ones that weren't satisfied
data structure is less than or equal to r. Thus we have
in the previous phase), and so on. It follows from the
the following.
above lemma that by searching through VorDS(Ä) in the
Lemma 4.4 The search data structure VorDS(Ä) can be described manner, we can find VR(s) and hence all the
built in O(logr) time with very high probability using r subproblems that s lies in.
processors, where r = \R\. There is an important fact that we have ignored so far.
4.4.2 Searching VorDS(£) to find X(CR(e)) for In order to carry out this search step efficiently, we have
all CR(e) to be sure that the total number of requests generated is
0{M\ogJ\f) over all levels of VorDS(ß). Observe that it is
Once VorDS(R) has been constructed, we want to search
possible for the total problem size to increase from level
it efficiently in order to find the input set to each subprob-
i = 1 to level i = h of VorDS(i?) because an element s G S
lem determined by R i.e. X(C#(e)) for CR(C) G CR. Es-
might lie in a greater number of subproblems at level i+1
sentially, each element s £ S searches through VorDS(i?)
than at level i. However, we can prove that this increase
to determine all the subproblems that it lies in, and this
is such that the total subproblems size is still 0(N) at
is done in parallel for all such s. Note that this is also every level of VorDS(i?). We will not go into the proof,
the step that allows us to determine if R is a good sample for lack of space and appeal to intuition instead. Consider
or not. (Hence in our algorithm, S may sometimes be a
an element s' G Ri such that s' belongs to the indepen-
polling set that is a subset of the original input S.) Let
dent set W ofVV(Ri). For every element that belongs to
I ,S I = N. We first state the basic idea behind how the
TRl (s') (the neighbors of s' in VV{R\)), the total problem
search proceeds. size associated with that element at level 2 of VorDS(iJ)
For each element s £ S, we start off the search by
could increase. This is because elements that belong to
determining the prims at level h that VRh{s) intersects3.
the subproblems associated with s' (there can be at most
Obviously VRh (s) is of constant size and hence this step
a constant number of such subproblems) could, upon the
can be carried out in constant time using 0{M) proces-
removal of s', now belong to the neighbors as well; by an
sors. Our algorithm works in phases. We describe the
abuse of notation, call this set of elements X(CR1(S1)).
steps during one phase: Suppose that for s £ S, a pro-
Hence the maximum possible increase in size at level 2 of
cessor II has reached the node corresponding to prim V
VorDS(Ä) will be given by E,^w\^Rl(s')\.\X(CRl(S'))\.
at level (i + 1) of VorDS(-R). As we know from the pre-
In a similar manner, we can compute the total increase at
vious section, V intersects a constant number of prims at
level 3 of the data structure, while taking into account the
Recall that we use V (s) to denote the region that is possible increase in the problem size associated with an
closer to s than to any other element in R i.e. the Voronoi independent set element at level 2. We are able to prove
region of s in the Voronoi diagram of R U {s}. that this increase at each level of VorDS(Ä) is given by a

64
geometric series of ratio less than 1, as long as the frac- ement s G S. V(s) can be determined by finding the
tion of independent set elements at each level of the data intersection of all the Voronoi regions of s that have been
structure is less than /z, where \i < 1 is fixed. We can computed recursively in the subproblems. As before, let
show that this must be the case with very high probabil- \R\ = r and let \S\ = Af. Since R is a good sample of
ity. The intuition behind this result is as follows: Those S, we know that the total size of the subproblems is less
independent set elements that cause a large increase in than or equal to kf0f Af. It follows therefore that the total
problem size must have high degree in VV(R), and those number of Voronoi edges in all the recursively computed
that cause a smaller increase will have a smaller degree. Voronoi diagrams must be less than 3.fc^ Af (since the
Hence there will be fewer elements that cause a large in- number of Voronoi edges in Vor{X(CR(e))) is less than
crease than those that cause a smaller increase (since in Z.\X(CR(e))\).
a planar graph there will be fewer vertices of large degree Consider the set of subproblems in which s G S lies.
than vertices of smaller degree). Let TR(S) be the set of recursively computed Voronoi
The search through this data structure is carried out regions of s in these subprobles. That is4, Tjj(s) =
by the dynamic allocation of processors to each segment {Vx(CR(e))(s) | X(CR(e) G CR}. The Voronoi re-
s e S. The idea is to use a number of processors pro- gions will be represented as the collection of their Voronoi
portional to \YRl(s)\ for s. We can use randomized tech- edges. Note that the total size of all the TR(S) for all
niques for dynamic processor allocation (such methods s G S will also be 0(Af) since every Voronoi edge is
are standard, as given, for example, in [20]). For good counted exactly two times over the regions TR(S) for all
samples, all the requests will be satisfied in 0(logAf) s G S (once for each of the two Voronoi regions that it
phases with very high likelihood using 0(M) processors. borders). Every Voronoi edge in TR(s) is part of some
If the search through VorDS(Ä) is incomplete after these bisector B(s, s') (s' G <S). In the case of line segments,
0(logM) phases (i.e. there are requests that haven't been computing the intersection of these bisectors to find V(s)
satisified), then we can reject R with high confidence. is not an efficient strategy because of the fact that two
Note that since the data structure that we are search- such bisectors can intersect twice (see Lemma 3.4). The
ing through is a directed acyclic graph, it is possible that following lemma provides us with a solution. (We omit
an« £ 5 may arrive at the same node through two differ- the proof for lack of space.)
ent paths. In such instances, we want to avoid repeating Lemma 4.7 Every Voronoi vertex of the final Voronoi
searches that have already commenced. We would like region V(s) appears as a vertex in at least one of the
to use 0{Af\ogAf) space in order to solve this problem;
Voronoi regions in the set TR(s).
we can use randomized hashing techniques to achieve this
goal. This will use 0{M) space for each level of VorDS(fl). Thus we just have to search the set of vertices that ap-
From Gil, Matias and Vishkin [11], we know that we can pear in the Voronoi regions in YR(S) and eliminate those
certainly do this in 0(log*W) time (nearly constant) with vertices that are not part of V(s). We do this as fol-
high probability by doing an optimal amount of work at lows. The vertices of any Voronoi region of an element s
each phase. But we show that over all the levels of the have well-defined sorted order defined by the projection
data structure, the total processing time is 0(logAf) with of the vertices on s (this is given as the function proj in
high probability (omitted for lack of space). Thus we have Section 3). Assume that the vertices appear in clockwise
the following. order (with respect to some axis that is fixed on s). We
Lemma 4.6 We can find X(CR(e)) for all CR(e) G CR merge in parallel the Voronoi vertices of the regions in
TR(S) according to this ordering by using the cascading
in Ö(log Af) time using 0(Af) processors and O(AflogAf)
space, where R is a random sample of S and \S\ = Af'■ divide-and-conquer technique that sorts optimally [Cole
[7],Atallah, Cole and Goodrich [3]], until finally we are
4.5 Merging Recursively Computed left with the vertices of V(s). Each leaf of the merge tree
Voronoi Diagrams will contain a Voronoi vertex from the regions in TR(S)
along with the Voronoi edge to its right. Let ys be the
In the previous section, we described the method to find total number of Voronoi edges in TR(s).
the subproblems determined by a random sample from We say that a Voronoi vertex v is hidden by a Voronoi
the input set S. So assume now that for a good sample edge e if the segment from v to proj(v, s) intersects e and
R, X(CR(e)) has been found for all CR(e) G CR. The v does not lie on e. The idea is to maintain, at each node
diagrams Vor[X(CR(e))) will be computed recursively, in K of the merge tree and each phase i of the cascade, a list
parallel for each CR(e). We want to merge these Voronoi that consists of vertices that are not hidden by any of the
diagrams to form Vor{S). In the remainder of the sec- Voronoi edges encountered at K until phase i. After the
tion, we describe the method to perform this merge step final phase, the root of the merge tree will have the list
efficiently.
4
The final Voronoi diagram of S can be constructed Recall that we use VA(a) to denote the Voronoi region of
by computing the final Voronoi region V(s) for each el- a G A in the diagram Vor(A).

65
of Voronoi vertices that belong to V(s). This step runs [6] K. L. Clarkson and P. W. Shor. Applications of Ran-
in 0(log ys) time with 0(ys) processors. We execute this dom Sampling in Computational Geometry, II. Discrete
step in parallel for all s 6 S and since Y^s c S ^s *s Comput. Geom., 4:387-421, 1989.
0(A/"), we have the following. [7] R. Cole. Parallel Merge Sort. SIAM J. Comput.,
Lemma 4.8 The Voronoi diagram Vor(«S) can be con- 17(4):770-785, 1988.
structed from the recursively computed Voronoi diagrams [8] R. Cole and M. T. Goodrich. Optimal Parallel Algo-
Voi(X(CR(e))) (CR(e) G CR) in 0(\ogAf) time using rithms for Polygon and Point-set Problems. Algorithmica,
0(Ar) processors. 7:3-23, 1992.
[9] N. Dadoun and D. Kirkpatrick. Parallel Processing for
5 Conclusions and Applications Efficient Subdivision Search. In Proc. Third ACM Symp.
It follows from the previous section that we have an op- on Computational Geometry, pages 205-214, 1987.
timal algorithm for the Voronoi diagram of a set of line [10] S. Fortune. A Sweepline Algorithm for Voronoi Diagrams.
segments in the plane. We state this below. In Proc. 2nd ACM Symp. on Computational Geometry,
pages 313-322, 1986.
Theorem 5.1 The Voronoi diagram of a set of n non- [11] J. Gil, Y. Matias, and U. Vishkin. Towards a Theory of
intersecting line segments in the plane can be computed in Nearly Constant Time Parallel Algorithms. In Proc. of
O(logn) time using 0(n) processors and O(nlogn) space. Symp. on FOCS, 1992.

The above theorem immediately gives us optimal paral- [12] M. T. Goodrich. Geometric Partitioning Made Easier,
lel randomized algorithms for computing the minimum Even in Parallel. In Proc. 9th ACM Symp. on Computa-
tional Geometry, 1993.
weight spanning tree, the all-nearest neighbor for the set
of segments and also an optimal parallel algorithm to plan [13] M. T. Goodrich, C. O'Dünlaing, and C. K. Yap. Con-
the motion of an object from one point to another while structing the Voronoi Diagram of a Set of Line Segments
in Parallel. In Lecture Notes in Computer Science: 382,
avoiding polygonal obstacles (see [19] for details).
Algorithms and Data Structures, WADS, pages 12-23.
Clarkson and Shor's [6] results established the effec-
Springer-Verlag, 1989.
tiveness of random sampling in deriving better expected
bounds for computational geometry problems and Reif [14] D. Haussier and E. Welzl. e-nets and Simplex Range
Queries. Discrete and Computational Geometry, 2:127-
and Sen [21] demonstrate how to obtain high probability
152, 1987.
results from expected bounds, which is crucial for par-
allel algorithms. Our result offers more evidence of the [15] D. G. Kirkpatrick. Efficient Computation of Continuous
usefulness of randomization in obtaining more efficient Skeletons. In Proc. 20th IEEE Symp. on Foundations of
Computer Science, pages 18-27, 1979.
algorithms. It will be interesting to see if our technique
can be applied to other problems to obtain more efficient [16] D. G. Kirkpatrick. Optimal Search in Planar Subdivi-
results and perhaps less complicated algorithms since we sions. SIAM J. Comput., 12(l):28-35, 1983.
believe that our approach is simpler and more general. [17] D. T. Lee and R. L. Drysdale. Generalization of Voronoi
For instance, we think that the 3-d convex hull algorithm Diagrams in the Plane. SIAM J. Comput., 10(l):73-87,
given by Reif and Sen [21] could be simplified, especially February 1981.
since the surface of a convex polyhedron is topologically [18] K. Mulmuley. A Fast Planar Partition Algorithm. In
equivalent to a bounded planar subdivision. Proc. 20th IEEE Symp. on the Foundations of Computer
Science, pages 580-589, 1988.
References [19] C. O'Dünlaing and C. K. Yap. A 'Retraction' Method for
Planning the Motion of a Disc. J. Algorithms, 6:104-111,
[1] A. Aggarwal, B. Chazelle, L. Guibas, C. O'Dünlaing, and 1985.
C. K. Yap. Parallel Computational Geometry. Algorith-
[20] J. H. Reif and S. Sen. Polling: A New Random-
mica, 3:293-327, 1988.
ized Sampling Technique for Computational Geometry.
[2] N. M. Amato and F. P. Preparata. An NC1 Parallel 3D Manuscript.
Convex Hull Algorithm. In Proc. 9th ACM Symp. on
[21] J. H. Reif and S. Sen. Optimal Parallel Randomized Algo-
Computational Geometry, 1993.
rithms for Three Dimensional Convex Hulls and Related
[3] M. J. Atallah, R. Cole, and M. T. Goodrich. Cascading Problems. SIAM J. Comput., 21(3):466-485, 1992.
Divide-and-Conquer: A Technique for Designing Parallel
[22] J. H. Reif and S. Sen. Optimal Randomized Parallel Algo-
Algorithms. SIAM J. Comput., 18(3):499-532, 1989.
rithms for Computational Geometry. Algorithmica, 7:91-
[4] M. J. Atallah and M. T. Goodrich. Efficient Parallel 117, 1992.
Solutions to Geometric Problems. In Proc. 1985 IEEE
Con}, on Parallel Processing, pages 411-417, 1985. [23] C. K. Yap. An O(nlogn) Algorithm for the Voronoi Di-
agram of a Set of Simple Curve Segments. Discrete and
[5] A. Chow. Parallel Algorithms for Geometric Problems. Computational Geometry, 2:365-393, 1987.
PhD thesis, Univ. of Illinois at Urbana-Champaign, 1980.

66
Constructing Levels in Arrangements and
Higher Order Voronoi Diagrams*

Pankaj K. Agarwal1 Mark de Berg2 Jiff Matousek3


Otfried Schwarzkopf2

Abstract ometry and yet they have kept some of their secrets.
Some of the intriguing open questions are related to
We give a simple lazy randomized incremental algo- the concept of levels. We say that a point p is at
rithm to compute <fc-levels in arrangements of x- level k with respect to a set H of non-vertical hyper-
monotone Jordan curves in the plane, and in arrange- planes in Rd if there are exactly k hyperplanes in H
ments of planes in three-dimensional space. If each
that lie strictly above p. The fc-level of an arrange-
pair of curves intersects in at most s points, the ex-
ment A(H) of hyperplanes is the closure of all facets
pected running time of the algorithm is 0(fc2As(n/fc) +
min(As(n)log2n, fc2As(n/fc) logn)). For the three-
of A(H) whose interior points have level k with re-
dimensional case the expected running time is 0(nk + spect to H—see Figure 1. The <fc-level of -4(if) is
min(nlog3n,nfc2logn)). The algorithm also works for
computing the <fc-level in a set of discs, with an expected
running time of O {nk + min(n log2 n, nk log n)). Further-
more, we give a simple algorithm for computing the order-
k Voronoi diagram of a set of n points in the plane that
runs in expected time 0(k{n — k) logn + n log3 n).

1 Introduction
Arrangements of hyperplanes have been studied for Figure 1: The 2-level in an arrangement of lines.
a long time in combinatorial and computational ge-
the union of all i-levels of A{H), for 0 < i < k. The
*Work on this paper by P.A. has been supported by Na-
tional Science Foundation Grant CCR-93-01259 and an NYI fc-level and the < fc-level of arrangements of monotone
award. M.d.B. and O.S. acknowledge support by the Nether- surfaces are defined analogously. In fact, one can give
lands' Organization for Scientific Research (NWO) and partial a more general definition of levels. Given a family T
support by ESPRIT Basic Research Action No. 7141 (project
of subsets, also called ranges, of Md, define the level of
ALCOM I: Algorithms and Complexity). Work by J.M. was
supported by Charles University Grant No. 351 and by Czech a point p with respect to T to be the number of ranges
Republic Grant GACR 201/93/2167. Part of this research was that contain p in their interior; the fc-level and ^fc-
done when P.A. and O.S. visited Charles University, and when level in the arrangement of T are defined as before.
P.A. visited Utrecht University. These visits were supported
by Charles University and NWO.
For a set H of hyperplanes, if we choose ranges to
department of Computer Science, Box 90129, Duke Uni- be the half-spaces lying above the hyperplanes of H,
versity, Durham, NC 27708-0129, USA. then the level of p is same under the two definitions.
2
Vakgroep Informatica, Universiteit Utrecht, Postbus Although many researchers have studied combina-
80.089, 3508 TB Utrecht, the Netherlands.
3
Katedra aplikovane matematiky, Universita Karlova, Mal- torial aspects of levels in arrangements, the maximum
ostranske näm. 25, 118 00 Praha 1, Czech Republic. complexity of the fc-level is still unknown. Even in
the plane there is a large gap between the known
Permission to copy without fee all or part of this material is upper and lower bound on the maximum complex-
granted provided that the copies are not made or distributed for ity of the fc-level: the best known lower bound is
direct commercial advantage, the ACM copyright notice and the fi(nlog(fc + 1)) [Ede87], whereas the best known up-
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing per bound is 0(nVk/log*(fc+ 1)) [PSS92]. However,
Machinery. To copy otherwise, or to republish, requires a fee exact bounds are known for the maximum complex-
and/or specific permission. ity of the <fc-level in an arrangement of hyperplanes
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

67
in Rd. Using a probabilistic counting method, Clark- information. After adding the first n/2 hyperplanes
son and Shor [CS89] proved that the maximum com- we expect the fc-level of A(H) to be located near the
plexity of the <fc-level is G(nLd/2Jfcrd/2l). Following fc/2-level of A(R), where R is the set of the first n/2
a similar technique, Sharir [Sha91] proved that the hyperplanes; most of the <fc-level of A(R) lying be-
maximum complexity of the <fc-level in a set of x- low this /c/2-level will be peeled off in later stages.
monotone Jordan curves, with at most s pairwise Hence, we only maintain the <re(r)-level of the first
intersections, is 0(fc2As(n/fc)). Here \s(m) is the r hyperplanes, where n(r) is approximately k{r/n).
maximum length of an (m, s)-Davenport-Schinzel se- However, now we have to be a bit more careful about
quence; for any constant s, Xs(m) is roughly linear in discarding layers of cells. It turns out that the easi-
m [ASS89]. For discs he proved a bound of 0(nfc) on est way to do this is to remove the peeling step alto-
the complexity of the < fc-level. gether, and to replace it by regular clean-up phases.
On the algorithmic side, Mulmuley [Mul91b] gave a This idea was inspired by the lazy randomized incre-
randomized incremental algorithm for computing the mental algorithms of de Berg et al. [dBDS94]. At the
<fc-level in hyperplane arrangements in any dimen- same time, this makes it possible to use the algorithm
sion. For d > 4, the expected running time of his in situations where it is not obvious how to access the
algorithm is 0(n Ld/2Jfcrd/2l); which is optimal. For parts of the current cell complex that must be peeled
d = 2,3 the expected running time of his algorithm off. One such situation is for the <fc-level for discs.
is 0(n/Jd/2T log(n/fc)), which is suboptimal by a log-
arithmic factor. Recently, Everett et al. [ERvK93]
gave an optimal 0(n log n + nk) expected time ran-
domized algorithm for computing the < k-level in an As stated earlier, not much is known about the
arrangement of lines in the plane. Mulmuley's al- complexity of the exact fc-level. There is one special
gorithm can be applied to compute the <fc-level of case where the maximum complexity of the fc-level
arrangements of x-monotone Jordan curves in the of a three-dimensional arrangement is known to be
plane, but there does not seem to be an easy way Q(k(n — k)), namely when all the hyperplanes are
to generalize it for computing the < k-level in more tangent to the unit paraboloid. This situation arises
general ranges like discs. Sharir [Sha91] presented a when the planes are the images of a set of points in
divide-and-conquer algorithm for computing the <fc- the plane under the transformation that maps the
level of rather general ranges in the plane; its worst- order-fc Voronoi diagram of these points to the fc-
case running time is roughly log2 n times the maxi- level of the planes. Most known algorithms for com-
mum size of the <fc-level. puting the fc-levels in three-dimensional space actu-
In this paper we show that by modifying Mul- ally compute the <fc-level [Mul91b, CE87, BDT93].
muley's algorithm slightly, we can obtain a sim- Since the complexity of the < fc-level is 0(nfc2) in
pler and faster randomized algorithm for com- the situation sketched above, the running time of
puting the <fc-level in a hyperplane arrange- these algorithms is Q(nk2 + nlogn). The random-
ment whose expected running time is 0(nfcTd/2l + ized incremental algorithm by Aurenhammer and
Schwarzkopf [AS92] maintains only the fc-level, but
nlognmin(A;^/2l,log^'/2'n)), which is optimal for
it can be shown that any randomized incremental al-
k > log2 n if d = 2, for k > log3/2 n if d = 3, and
gorithm that maintains the fc-level of the interme-
for all values of k if d > 4. Moreover, the modified
diate arrangements must take time ft(nk2) as well,
algorithm works for more general ranges like discs or
since the expected number of structural changes in
pseudo-discs as well.
the fc-level is ü(nk2) [AS92]. The only algorithm that
Let us have a brief look at Mulmuley's algo- approaches the desired 0(k(n — fc)) time bound was
rithm [Mul91b] (see also his book [Mul93]). The n
presented by Clarkson [Cla87]. His algorithm runs in
hyperplanes are added one by one in random order
time 0(n1+£fc), where £ > 0 is an arbitrarily small
and during this process the <fc-level of the current
constant. (The algorithm can probably be improved
arrangement is maintained. For all faces of the cur-
somewhat by using more recent results on geometric
rent structure a conflict list (containing the not yet cuttings).
inserted hyperplanes that intersect the face) is main-
tained. When adding a new hyperplane h, the algo- We present a simple randomized incremental algo-
rithm first updates the arrangement locally at faces rithm that runs in 0(k(n - fc) logn + n log3 n) time.
that are intersected by h. Then it removes cells that We obtain this result by maintaining neither the en-
have "fallen off" because they are now on level k + 1; tire < fc-level nor the exact fc-level of the current ar-
Mulmuley calls this the peeling step. rangement, but some suitably chosen region that is
We observe that this algorithm maintains too much guaranteed to contain the fc-level of the full set.

68
2 Computing the <fc-level are connected in this graph if they share a facet. We
also mark an arc of this graph if the shared facet of
Let H be a set of n hyperplanes in d-dimensional the two simplices connected by this arc is contained
space. We denote the arrangement formed by H as in a hyperplane. The level of points changes if and
A(H) and the level of a point p with respect to H only if we pass from one simplex to an adjacent one
as £H{P)- We define the level of a face of A(H) as connected by a marked arc.
the level of any of its interior points. For a subset
Now consider the addition of hyperplane hr+i. In
R C H, we denote the bottom-vertex triangulation of
a generic step of the algorithm (that is, when r +1 is
the <k-level of A(R) by Ck(R)- This triangulation is
not a power of 2) we must perform two tasks: update
defined as follows. Let C be a cell of the <fc-level and
our collection of simplices (that means, re-triangulate
let v be the bottom vertex of C (that is, the lexico-
the cells that are split by hr) and their adjacency
graphically smallest vertex of the cell). If d = 1 then
relations, and compute the conflict lists for the new
C is a segment and it is already a (1-dimensional)
simplices.
simplex. If d > 1, then we recursively triangulate the
Let us start with the first task. Using the conflict
(d— l)-dimensional facets of C and extend each (d—1)-
lists we identify all the simplices in Sr that are in-
simplex into a d-simplex using vertex v. The bottom-
tersected by hr+i; those are the only ones influenced
vertex triangulation Ck{R) of the <k-level of A(R) is
by the insertion of hr+\. Because we know the adja-
obtained by triangulating every cell of the <fc-level
cency relations among the simplices, we can get the
in this manner. (Unbounded cells of A(R) require
intersected simplices in a number of groups, one for
some care in this definition [Cla88].) Observe that the
each cell that is intersected. Consider such a group,
bottom-vertex triangulation is a cell-complex: any
and let C be the corresponding cell. All the simplices
facet of a simplex is shared with exactly one other
in the group have to be deleted and replaced by a
simplex. In this section we give an algorithm to com-
number of new simplices. Let us first take a look
pute Ck{H) for a given parameter k < n.
at the situation when d = 2—see Figure 2. To deal
with the part of C that lies on the same side of hr+\
The algorithm. To compute Ck(H) we first gen- as the bottom vertex v of C, we draw new diagonals
erate a random permutation h\,h,2, ■ ■ ■ ,hn oi H. Let from v to the two intersection points of hr+\ with the
Hr := {hi,...,hr}, and let «(r) be an appropriate boundary of C; this creates three new simplices. The
non-decreasing function with n{n) > A; to be de- part of C lying on the opposite side of hr+\ is sim-
fined below. The idea of the algorithm is to main- ply triangulated from scratch. This way the bottom-
tain CK(r)(Hr) while adding the hyperplanes one by vertex triangulations of the two cells that result from
one. However, it turns out to be easier not to dis- the splitting of C are constructed in time that is lin-
card cells whose level (with respect to Hr) has grown ear in the number of new simplices that are created.
too large after every step. Instead we get rid of these The adjacency relations among the simplices can eas-
cells at regular clean-up-phases, namely after insert- ily be determined during the process. In dimensions
ing the 2*-th hyperplane, for 1 < i < [lognj, and greater than two things are not very different. Con-
after inserting the last hyperplane. This type of lazy sider a 3-dimensional cell C. We first re-triangulate
randomized incremental algorithm was introduced re- the 2-dimensional facets that are intersected, in the
cently by de Berg et al. [dBDS94]. Below we give a way we just described. We also triangulate C D /ir+i-
detailed description of the algorithm. Next we construct the 3-dimensional simplices. Given
We maintain a collection of d-simplices that forms the triangulation of the facets of the cell, the proce-
a d-dimensional cell complex, defined as follows. Sup- dure for this is analogous to the planar procedure.
pose we have added the first r hyperplanes. Then the In general, in dimension d we first treat the parts of
collection Sr forms the bottom-vertex triangulation of the (d— l)-facets incident to intersected simplices re-
the cells of A{Hr) whose level is at most n{p) with cursively, and then we extend the (d — l)-simplices
respect to Hp, where p is the time when the latest that we get to d-simplices by connecting them to the
clean-up was performed. Our schedule for perform- correct bottom vertex.
ing clean-ups implies that p is the largest power of Our second task is to compute the conflict lists of
two that is less than r. With every simplex A £ Sr the new simplices. Let C be a cell that has been split
we keep a conflict list H(A) that contains the hyper- by hr+\, and let C be one of the two new cells con-
planes in H intersecting the interior of A, and with tained in C. Some of the simplices of C may already
each hyperplane h £ H\Hrwe keep a list of simplices have existed in C; these simplices already have the
of Sr that h intersects. We also keep an adjacency correct conflict lists. To find the conflict lists for the
graph Q on the simplices. Two simplices Ai and A2 new simplices we collect all the hyperplanes from old

69
c>
r+1

Figure 2: Re-triangulation of a cell that is split.

simplices that intersect C. We remove the duplicates The analysis. Consider the situation after step r
from our collection, and for each hyperplane we de- of the algorithm. Let p be the largest power of two
termine one new simplex that it intersects (its initial that is less than r, and define k* := n(p). From now
simplex). This can be done in time proportional to on we assume that r and, hence, p and k* are fixed.
the total size of the conflict lists involved. Next, we We use the abstract framework of de Berg et
perform for each hyperplane a traversal of the adja- al. [dBDS94] to analyze our algorithm. Let T be the
cency graph on the new simplices, starting from its set of all possible simplices A, that is, all A that arise
initial simplex. This way we determine all the new in the bottom-vertex triangulation of A(R) for some
simplices intersected by the hyperplane. After having subset R C H. We denote the defining set of a sim-
done this for each hyperplane, we have constructed all plex A G T by T>(A); this is the inclusion-minimal
the new conflict lists. The time we have spent is lin- subset R for which A appears in the bottom-vertex
ear in the size of these lists plus the size of the old triangulation of A(R). (In degenerate situations, dif-
lists that disappear. ferent defining sets can correspond to simplices with
the same set of vertices; these simplices are consid-
ered to be distinct.) We define the killing set of A,
denoted /C(A), as the set of hyperplanes in H that
In a generic step of the algorithm this is all we do. intersect the interior of A. Furthermore, for a subset
(It would be difficult to discard simplices at every R C H we define T(R) as the set of simplices in the
step. The reason for this is the following. Since our bottom-vertex triangulation of the full arrangement
"threshold" n(r) depends on r, it is not necessarily A(R), and we define M(R) as the set of all simplices
the case that all simplices lying below the new hy- in T that have level at most k* with respect to R.
perplane hr+\ can be removed. Therefore we would Notice that the simplices in A4(R) do not have to be
have to maintain the levels of the simplices, so that present in T{R). Finally, for R' C R c H we define
we can decide in later stages whether or not to dis- C(R, R') := T{R) n M(R'). The idea is that the set
card them. But maintaining the level of the simplices C(R, R') corresponds to the structure maintained by
explicitly is too costly, because it involves simplices the lazy algorithm: in our analysis R will be the cur-
not intersected by hr+x.) For r = 2,4,..., 2LlognJ,n, rent subset and R' will be the subset for which the
however, we perform a clean-up step. We traverse the latest clean-up was performed. Observe that C(R, R)
entire current cell complex using the adjacency graph is the same as Ck-(R), the set of simplices of the
Q. While visiting each simplex we compute its level bottom-vertex triangulation of the </c*-level of A(R).
and discard it if its level is larger than «(r), where r
Let &(A) := |Z?(A)| and w(A) := |/C(A)|. It is
is the current step. There will be a slight chance that straightforward to verify that the following three con-
by doing so we discard a cell that later turns out to ditions hold:
contain a part of the </c-level of A(H). but we will
argue that the probability that this happens is small. (i) there is a constant b > 0 depending on d such
If it happens, we will notice so in the final clean-up that 6(A) < b for all Aef,
phase and we will restart the algorithm with a new
random permutation. Since the probability of pick- (ii) a region A G T is in T(R) if and only if X>(A) C
ing such an unfortunate permutation is small, this R and £(A) n R = 0,
procedure changes the expected running time of the
algorithm by a constant factor only. (in) for R' C R C H we have M(R) C M(R').

70
Let hi,..., hn be a random permutation of H, and To bound the expression above we now use the fact
let Hr:={hi,..., hr}. Define Cr := £{Hr, Hp). (Re- that Hq is a random sample of Ht of size q with q >
call that p is the largest power of two that is less i/4. Because conditions (i')-(iv') hold we can use
than r.) Furthermore, for 1 < q < r < n, we define a theorem by de Berg et al. [dBDS94] for bounding
the function higher moments. This theorem tells us that

T(r,q):=mnxE[\£(Ht,Hq)\}. (1) E[ Y, W A
( >#*)1 = 0{{t/q)d\Ck.{Hq)\).
q<t<r
Aeck.(Hq)
De Berg et al. [dBDS94] proved that under conditions
(i)-(iii) the following theorem holds. The complexity of £k*{Hq), the <fc*-level of A(Hq),
is 0(gLd/2J(fc*)^/2l). We can conclude that r(r,q) =
Theorem 1 Let 3 < r < n and let p be the largest
0(rLd/2J (fc*)Td/2l) for r/4 < q < r. Combining this
power of two that is less than r. The expected size
result with Theorem 1 gives us the following result.
of £r is at most r{r,p). The expected number of
(To simplify the expression we have replaced occur-
simplices in CT \ Cr-\ is bounded by 0(^r(r,p/2)).
rences of p and p/2 by r; this does not influence our
The expected total conflict size of these simplices is
bounds asymptotically because r/2 < p < r.)
bounded as
Lemma 2 The expected running time of the lazy
*E &€Cr\Cr
Ul (A)]<0(-äT(r,p/2)).
randomized algorithm is
To apply this theorem we must bound the func-
tion r(r,q) for r/4 < q < r. In other words, we 0{nJ2AdW-2(K(r) + iydM).
must bound the expected number of simplices in the r=l
bottom-vertex triangulation T(Ht) that have level at
most k* with respect to Hq, for r/4 < q < t < r. It For dimensions larger than three, we simply choose
is sufficient to bound the expected number of vertices K (r) := k. In this case, a cell that we discard can-
of A{Ht) at level at most k* with respect to Hq; the not contain any part of the </c-level later on, so our
number of simplices is linear in this number. Observe algorithm always succeeds. We obtain an algorithm
that Hq is a random sample of Ht. We shall refor- for the computation of <k-levels with expected run-
mulate our problem in an abstract setting so that we ning time 0(nLd/2Jfc^/2T). The algorithm is nearly
can use results on random sampling. identical to Mulmuley's algorithm and has the same
Recall that C{Hq,Hq) equals £k-(Hq), the set of optimal running time; the only difference is that we
simplices of the bottom-vertex triangulation of the replaced his peeling steps by our clean-up steps.
<fc*-level of A(Hq). As before, let T denote the set of For dimensions two and three, however, this
all possible simplices, and let X>(A) denote the defin- choice of n(r) gives us an expected running time of
ing set of a simplex A. Again, the following condition 0{nk^d/2l{ log(n//c)), which is suboptimal by a factor
holds: of log(n/fc). We now show that a slight twist in the
algorithm, namely a different choice of/c(r), improves
(i') there is a constant b > 0 such that 6(A) < b for
its expected running time for sufficiently large values
all A e T,
of Jfe.
Let /C(A, Ht) be the subset of hyperplanes in Ht that In the following, the dimension d is 2 or 3. To
intersect the interior of A. It is not difficult to check minimize the running time we would like to choose
that the following conditions hold for every subset n(r) as small as possible. As remarked earlier, how-
RCHt: ever, there is a slight possibility that the algorithm
does not give us the entire <k-level, that is, that we
(ii') if A € £{R, R), then P(A) C R, have discarded cells that contain a vertex of the <k-
(in') if A e C(R, R), then AC(A, Ht)nR = 0, level. We must choose «(r) large enough so that the
probability of this happening is small. To bound this
(iv') if A e C(R,R) and R' is a subset of R with probability we need the following lemma, which can
2?(A) CR' CR, then A G C(R', R'). be proven using tail estimates for the binomial distri-
Define uj{A,Ht) := \K(A,Ht)\. The number of ver- bution [AS93].
tices we have to consider is
Lemma 3 Let v be a vertex in an arrangement A(H)
of n hyperplanes at level £H {V) < k, and let r < n
A€Ck.(Hq) and ß > 1 be parameters. The probability that for

71
a random sample R C H of r hyperplanes the level such arrangements into constant complexity pieces,
£R(V) of v is more than 2ßk^ is bounded by or boxes. We use the vertical decomposition: we ex-
tend a vertical segment upward from every intersec-
2[eß~lß-ß]2k{r/n\ tion point of two curves until it hits another curve
and extend a vertical segment downward until it hits
For ß > e2, this is bounded by another curve; if a vertical segment does not intersect
any curve, it is extended to infinity. The same tech-
2exp(-2/3/c(r/n)).
nique can be applied to the cells in the </c(r)-level
of the arrangement A(Hr). The number of resulting
In the remainder we shall need that the probability
boxes is 0(K(r)2Xs(r/K.(r))). We can now use the lazy
that a vertex v at level at most k in A(H) has a level
randomized incremental algorithm described above to
greater than «(r) in A(Hr) is bounded by 2/n4. From
compute the < k-level in an arrangement of Jordan
the lemma above it readily follows that this is true if
we choose curves. We only need to change the way the decom-
position is updated after an insertion, since we are
n(r) := max(2e /c-,41nn). now using vertical decompositions instead of bottom-
n vertex triangulations. We omit the details of how the
Now let us consider the probability that the algo- vertical decomposition is updated; they are the same
rithm fails. Our choice of n(r) implies that the prob- as in randomized incremental algorithms for comput-
ability that a vertex v is mistakenly discarded in any ing full planar arrangements [Mul91a].
given clean-up step is at most 2/n4. There are [lognj The analysis of the algorithm follows the analysis
clean-up phases, and there are at most nd vertices to given earlier, with the maximum complexity of the
consider (with d = 2 or d = 3), so the probability < k-level in a set of hyperplanes replaced by the max-
that we ever discard a vertex unjustified is at most imum complexity of the <&-level in a set of Jordan
2 log n/n. In other words, we expect to succeed af- curves. Thus, if p is the largest power of two less than
ter we have run the algorithm a constant number of r then the expected running time is
times.
According to Lemma 2 the expected running time 0(E^2r(r,p/2)),
of the algorithm with the given choice of n(r) will be r=l

(K{r) + 1)^/21 where r(r,p/2) = 0{n{r)2Xs(r/K,(r))). The same


OWE choice of «(r) as before gives us a running time
of 0(k2Xs(n/k) + min(As(n) log2 n, k2Xs(n/k) logn)).
k[d/2-\r\d/2-]-l (\nn)\d/2-\ This bound subsumes the case of line arrangements,
< 0(n)E Jd/2] since two lines intersect at most once and Ai(n) — n.
r=l
The same algorithm also works for a set of discs.
= 0(nk^+n(lognydW+1). Using the fact that the complexity of the < k-level of a
set of n discs is 0(nk), it can shown that the expected
For k < 4 In n, this is no improvement over the trivial running time of the algorithm, as in the case of lines,
choice of n(r). Hence, our final choice for n(r) is
' is 0(nk + min(nlog2 n,nklogn)). We omit the easy
details from here.
k, if k < 4Inn,
n(r)
max(2e2A;^,41nn), otherwise.
Theorem 4
d 2
This gives us an expected running time of 0(nfcl" / l + (i) The <k-level of an arrangement of n x-monotone
Jordan curves in the plane such that any pair
nlognmin(fcl"d/2l,logrd/2"1 n)), which is optimal for
intersects in at most s points can be computed
k > logn in the planar case, and for k > log3/2 n
in 0{k2Xs{n/k) + min(As(n) log2n, k2Xs(n/k) logn))
in the three-dimensional case.
time by a lazy randomized incremental algorithm,
Before we state our theorem on computing the <k- (ii) The <k-level of an arrangement of n planes in
level we discuss a generalization of the planar algo- three-dimensional space can be computed in expected
rithm. time 0(nk2 + min(n log3 n, nk2 logn)) by a lazy ran-
Let H be a set of n x-monotone Jordan curves in domized incremental algorithm.
the plane with each pair of curves intersecting at most (Hi) The <k-level of an arrangement of n discs in
s times. To apply our algorithm to arrangements of the plane can be computed in expected time 0(nk +
Jordan curves we need a technique for decomposing min(n log2 n, nk log n)).

72
3 Computing order-/c Voronoi dia- sect the interior of A. Let £ (A) be the level of any
point in the interior of A with respect to H \ H(A)
grams
and let w(A) := \H(A)\. We call A interesting if
Let P be a set of n points in the plane. The order- ^(A) < fc < £(A) + w(A), and we call a cell of A{Hr)
k Voronoi diagram of P is the subdivision of the active if its bottom-vertex triangulation has at least
plane into cells such that the fc closest points in P one interesting simplex.
are uniquely determined inside each cell. In other Our algorithm maintains the simplices of the
words, two points p, q are in the same cell if the k bottom-vertex triangulation of all active cells of
points of P that are closest to p are also the k points A(Hr). Since the fc-level of A(H) can intersect only
of P that are closest to q. P can be mapped to a set interesting simplices, we are sure that the fc-level is
H = H(P) of planes in three-dimensional space as contained in the region that we maintain. With every
follows. Lift each point of P to the unit paraboloid simplex A we maintain the conflict list H(A) and the
U : z = x2 + y2, and take the plane that is tangent level £(A). We also store with every vertex of each
to U at that point. The order-A; Voronoi diagram of active cell its real level, that is, its level with respect
P corresponds to the fc-level of H—see for example to H. This will help us to compute the level 1(A)
Edelsbrunner's book [Ede87]. The maximum com- when we create a new simplex A. Finally, we main-
plexity of the order-fc Voronoi diagram and, hence, tain the adjacency graph on the simplices; there is an
the maximum complexity of the fc-level in the situa- arc between two simplices if they share a facet.
tion above, is 9(fc(n - k)). To add a new plane hr+i we proceed as follows.
First we identify all active cells intersected by hr+v,
We give a simple algorithm that computes the fc- using the conflict lists this can be done in time linear
level for this case in 0{k{n - k) log n + n log3 n) time. in the number of simplices intersected by hr+i- Then
The algorithm is randomized incremental, like the one we re-triangulate these cells and we compute the con-
in the previous section. This time, however, we do flict lists for the new simplices, as described in the
not use the lazy paradigm: we clean up the structure previous section. Every new simplex A contains at
after every step. Another difference with the previous least one old vertex; using the level of this vertex we
algorithm is the following. can compute the levels of the new vertices of A by ex-
In the algorithm for computing the < fc-level we ob- amining the planes in H(A). Hence, we can compute
served that at time r the <fc-level of the full set is the real levels of all new vertices in time that is linear
expected to be contained in the <fcr/n-level of the in the size of the new conflict lists. Next we compute
sample. Stated differently, we made an estimation of the level £(A) of each new simplex A; using the level
the real level of a vertex in the arrangement of sam- of any of the vertices of A this can again be done by
ple planes based on its level in the sample. We then examining the planes in H{A). (Note that ^(A) does
decided whether or not to discard the vertex based on not change for the old simplices.) Finally, we check
this estimation. By making our estimations conser- which of the new simplices is interesting, and we dis-
vatively we ensured that the probability of discarding card the cells that have no interesting simplex. These
a "good" vertex was small. two steps can be done in time linear in the total size
This line of attack turns out not to work for com- of the conflict lists of all deleted simplices.
puting the exact fc-level. So we maintain a portion of When the last hyperplane hn has been added,
the arrangement which is guaranteed to contain the we have H(A) = 0 for every A. In other words,
fc-level. In particular, we do not make an estimate ui(A) = 0 and we are left with the simplices of the
of the real level of a vertex based on its level in the bottom-vertex triangulation of A(H) that have level
sample. Instead we maintain for each vertex in the fc. The facets of these simplices that bound their sim-
current arrangement a range of values that is guaran- plex from below and are contained in one of the planes
teed to contain its real level. We only discard a vertex in H form the fc-level of A{H).
when k is not in this range. Thus we are sure that
the algorithm produces the right answer. To bound It remains to analyze the algorithm.
the expected running time of our algorithm, however,
we have to use a probabilistic argument. Lemma 5 The expected number of simplices present
at time r is 0(rk^ logr + r log r).
As before, we denote by H the set of planes and
by Hr the first r elements in a random permutation Proof: We use an argument based on the e-net the-
of H. Let A be a simplex in the bottom-vertex tri- ory. Haussler and Welzl [HW87] proved that a ran-
angulation of the arrangement A{Hr). The conflict dom sample R of r planes from a set H of n planes
list H(A) of A is the set of planes in H that inter- has the following property with probability at least

73
1 - 1/n3: Any line segment s, which do not intersect Theorem 6 The k-level in an arrangement of n
a plane in R, intersects at most C^ logr planes in H, planes in three-dimensional space that are all tangent
where C is a constant. to the unit paraboloid can be computed in expected
The set Hr is a random sample of H of size r. time 0(k(n-k) log n+n log3 n) with a randomized in-
Let us therefore assume for a moment that the above cremental algorithm, using 0(k(n-k) log n+n log2 n)
mentioned property holds for Hr, that is, every seg- storage.
ment s that lies within a cell of A(Hr) intersects at
most Cf logr planes of H. As a consequence, for Remark. We only used the fact that all planes in
all simplices A present in stage r we have u>(A) < the set H are tangent to the unit paraboloid in the
3C^ logr. We now bound the total complexity of all analysis of the algorithm; the algorithm itself works
active cells (still assuming that the property above for arbitrary sets of planes. Hence, if the complexity
holds for Hr). By definition, every active cell C con- of the A;-level for arbitrary sets of planes is about the
tains at least one interesting simplex A. Let p be an same as in the restricted case of planes tangent to
arbitrary point inside A. The level of p with respect the unit paraboloid, then the running time of our
to H lies between £(A) and 1(A) + Lü(A). Because A algorithm is also close to optimal in this general case.
is interesting and w(A) < 3C^ logr we know that the Corollary 7 The order-k Voronoi diagram of n
level of p lies between k-3C^ logr and k + ZC^ logr. points in the plane can be computed in expected time
We now observe that every vertex v of C can be con- 0(k(n - k) logn + n log3 n) with a randomized incre-
nected to p with a segment s = pv lying inside C. mental algorithm that uses 0(k(n~k) log n+n log2 n)
Therefore s crosses no more than C^ logr planes in storage.
H, and we can conclude that the level of v lies be-
tween k - 4CS logr and k + 4C^ logr. The number
of vertices in A(H) with this level is bounded by 4 Concluding Remarks
k+4C^ logr We have presented algorithms concerning levels in ar-
Tl Ti
E
£=k~4C^ logr
0(nt) = 0(nk- logr + n(- logr)2).
r r
rangements. The first algorithm computes the <k-
level in an arrangement of curves in the plane or
planes in three-dimensional space. The second algo-
The probability that a given vertex of A(H) appears
rithm computes the exact fc-level of a set of planes in
in A(Hr) is 6((£)3). Hence, the total complexity of
three-dimensional space that are tangent to the unit
all active cells (and thus also the number of simplices
paraboloid; the /c-level in this situation corresponds
present) at time r is 0(rk^ log r + r log2 r).
to the order-fc Voronoi diagram of a set of points in
This derivation was under the assumption that the
the plane. The algorithms improve and/or simplify
e-net property mentioned above holds for Hr. This is
the best known algorithms for these problems.
true with probability at least 1-1/n3. If the property
Both algorithms are randomized and incremental.
is not true for Hr, we use the trivial bound of 0(r3)
We improve upon previous randomized incremental
on the number of simplices in A(Hr). The expected
algorithms for these problems by being more care-
number of simplices is therefore bounded by
ful in what to maintain. In particular, previous ran-
(1 - 1/n3) -0(rkr- logr + r log2r) + (1/n3) ■ 0(r3) domized incremental algorithms for these problems
maintained a part of the current arrangement based
= 0(rk^ logr + r log2 r). g on the level of that part in the current arrangement.
As in the previous section, the expected running The part that we maintain, on the other hand, is
time of the algorithm is bounded by the sum of the based on the level of that part in the full arrangement.
sizes of the conflict lists of all simplices ever created This level is, of course, not known exactly during the
during the algorithm. Using Theorem 1 again (with algorithm. For the computation of the <yfc-level we
the appropriate definitions of C and r), we can prove therefore made an approximation of the level in the
that this quantity is bounded by full arrangement based on the level in the current ar-
n rangement. For the computation of the exact fc-level
we maintained a range of values that is guaranteed to
^2 —0{rk- logr+rlog2r) = O(nklogn+nlog3n).
r=i r n contain the level in the full arrangement.
Our algorithms are suboptimal when k is very
For k < n/2 this is equal to 0(k(n - k)\ogn + small. We leave it as an open problem to develop
nlog3n). For k > n/2, we consider the fc-level as an algorithm that is optimal for all values of k. An-
the (n - fc)-level in the arrangement turned upside other open problem, even in the plane, is to compute
down, leading to the following theorem. the exact fc-level in optimal time.

74
References (<fc)-levels, with applications to separa-
tion and transversal problems. In Proc.
[AS92] F. Aurenhammer and 0. Schwarzkopf. 9th Annu. ACM Sympos. Comput. Geom.,
A simple on-line randomized incremen- pages 38-46, 1993.
tal algorithm for computing higher order
Voronoi diagrams. Internat. J. Comput. [HW87] D. Haussler and E. Welzl. Epsilon-nets
Geom. Appl, 2:363-381, 1992. and simplex range queries. Discrete Com-
put. Geom., 2:127-151, 1987.
[AS93] N. Alon and J. Spencer. The Probabilistic
Method. J. Wiley & Sons, 1993. [Mul91a] K. Mulmuley. A fast planar partition al-
gorithm, II. J. ACM, 38:74-103, 1991.
[ASS89] P. K. Agarwal, M. Sharir, and P. Shor.
Sharp upper and lower bounds on the [Mul91b] K. Mulmuley. On levels in arrangements
length of general Davenport-Schinzel se- and Voronoi diagrams. Discrete Comput.
quences. J. Combin. Theory Ser. A, Geom., 6:307-338, 1991.
52:228-274, 1989. [Mul93] K. Mulmuley. Computational Geometry:
[BDT93] J.-D. Boissonnat, 0. Devillers, and An Introduction Through Randomized Al-
M. Teillaud. An semidynamic construc- gorithms. Prentice Hall, New York, 1993.
tion of higher-order Voronoi diagrams and [PSS92] J. Pach, W. Steiger, and E. Szemeredi. An
its randomized analysis. Algorithmica, upper bound on the number of planar k-
9:329-356, 1993. sets. Discrete Comput. Geom., 7:109-123,
[CE87] B. Chazelle and H. Edelsbrunner. An 1992.
improved algorithm for constructing kth- [Sha91] M. Sharir. On k-sets in arrangements of
order Voronoi diagrams. IEEE Trans. curves and surfaces. Discrete Comput.
Comput, C-36:1349-1354, 1987. Geom., 6:593-613, 1991.
[Cla87] K. L. Clarkson. New applications of ran-
dom sampling in computational geometry.
Discrete Comput. Geom., 2:195-222, 1987.

[Cla88] K. L. Clarkson. A randomized algorithm


for closest-point queries. SI AM J. Corn-
put, 17:830-847, 1988.
[CS89] K. L. Clarkson and P. W. Shor. Ap-
plications of random sampling in compu-
tational geometry, II. Discrete Comput.
Geom., 4:387-421, 1989.

[CSY87] R. Cole, M. Sharir, and C. K. Yap. On k-


hulls and related problems. SI AM J. Corn-
put, 16:61-77, 1987.

[dBDS94] M. de Berg, K. Dobrindt, and O.


Schwarzkopf. On lazy randomized incre-
mental construction. In Proc. 25th Annu.
ACM Sympos. Theory Comput, 1994.

[Ede87] H. Edelsbrunner. Algorithms in Combi-


natorial Geometry, volume 10 of EATCS
Monographs on Theoretical Computer Sci-
ence. Springer-Verlag, Heidelberg, West
Germany, 1987.

[ERvK93] H. Everett, J.-M. Robert, and M. van


Kreveld. An optimal algorithm for the
Computing Many Faces in Arrangements of Lines and Segments

Pankaj K. Agarwal* Jiff Matousek* Otfried Schwarzkopf5

Abstract of segments we define the arrangement, A(S), in an


analogous manner. Notice that while the cells in a
We present randomized algorithms for computing line arrangement are convex, in an arrangement of
many faces in an arrangement of lines or of seg- segments they need not even be simply connected.
ments in the plane, which are considerably simpler Line and segment arrangements have been exten-
and slightly faster than the previously known ones. sively studied in computational geometry (as well
The main new idea is a simple randomized 0(n log n) as in some other areas), as a wide variety of com-
expected time algorithm for computing y/n cells in an putational geometry problems can be formulated
arrangement of n lines.
in terms of computing such arrangements or their
parts [11, 14].
1 Introduction Given a set L of n lines and a set P of m points
in the plane, we define A(L, P) to be the collection
Given a finite set of lines, L, in the plane, the ar- of all cells of A(L) containing at least one point of
rangement of L, denoted as A{L), is the cell complex P. The combinatorial complexity of a cell C, denoted
induced by L. The 0-faces (or vertices) of A{L) are by \C\, in A(L) is the number of edges of C. Let
K
the intersection points of L, the 1-face (or edges) are (-^> P) = 52ceA(L,p) |C| denote the total combina-
maximal portions of lines of L that do not contain torial complexity of all cells in A(L, P), and let
any vertex, and the 2-faces (called cells) are the con-
K(TI, m) = max K(L, P),
nected components of IR2 - \JL. For a finite set S
where the maximum is taken over all sets of n lines
*A part of this work was done while the first and third
authors were visiting Charles University and while the first and over all sets of m points in the plane. It is known
author was visiting Utrecht University. The first author has that
been supported by National Science Foundation Grant CCR- /c(n, m) = 6(n2/3m2/3 + n + m).
93-01259 and an NYI av/ard. The second author has been
supported by Charles University grant No. 351 and Czech Re- The upper bound was proven by Clarkson et al. [9];
public Grant GACR 201/93/2167. The third author has been previous results and related work can be found in
supported by the Netherlands' Organization for Scientific Re- Canham [4], Edelsbrunner and Welzl [13], Szemeredi
search (NWO) and partially supported by ESPRIT Basic Re-
search Action No. 7141 (project ALCOM I: Algorithms and and Trotter [20]
Complexity) In this paper we study the problem of computing
tDepartment of Computer Science, Box 90129, Duke Uni- A(L, P), that is, for each cell C € A{L, P), we want
versity, Durham, NC 27708-0129, USA.
return the vertices of C in, say, clockwise order. We
* Department of Applied Mathematics, Charles University,
Malostranske näm. 25, 118 00 Praha 1, Czech Republic. will refer to the cells of A(L, P) as the marked cells of
§ Department of Computer Science, Utrecht University, A(L). Edelsbrunner et al. [12] presented a random-
P.O. Box 80.089, 3508 TB Utrecht, the Netherlands. ized algorithm, based on the random sampling tech-
nique [16], for computing A{L,P), whose expected
Permission to copy without fee all or part of this material is running time was
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the 0(m2/3-£n2/3+2£ log n + n log n log m),
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing for any fixed e > 0. A deterministic algorithm with
Machinery. To copy otherwise, or to republish, requires a fee running time
and/or specific permission.
0(m 2/3„2/3 ,log O(l)
(
> n + n log n + m log n)
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
was given by Agarwal [1]. These algorithms thus For the analysis of the expected running time of our
are nearly worst-case optimal, but both of them are algorithms we will use a generalization of a lemma
rather involved. due to Chazelle and Friedman [7]. (An alternative
Recently randomized incremental algorithms have analysis could probably be obtained using a method
been developed for a wide variety of geometric prob- similar to that of Chazelle et al. [6], but we hope that
lems, which add the input objects one by one in a our approach is somewhat more intuitive).
random order and maintain the desired structure; see
e.g. [6, 10, 18, 19]. In our case, we can add the lines
of L one by one in a random order and maintain the 2 A generalization of Chazelle
marked cells in the arrangement of lines added so far.
However, this approach seems to yield expected run-
and Friedman's lemma
ning time of fl(n^/m+m log n) in the worst case. We, Let 5 be a set of lines or segments, and P a set
therefore, do not quite follow the randomized incre- of points in the plane. For a cell C of the collec-
mental paradigm.
tion A(S,P), let C" denote the collection of trape-
We begin by presenting an expected 0(m2+n log n)
zoids in the vertical decomposition of C,1 and let
time randomized algorithm for computing A(L, P).
Notice that for m < y/n\ogn, this algorithm is op- An(S,P) = \JceA(s,P)^ denote tne set of trape-
timal. We then apply the random sampling tech- zoids in the vertical decomposition of .4(5, P). Abus-
nique in a standard way, obtaining an expected ing the notation slightly, we will use A (5, P) to de-
0(m2/3n2/3 log2/3 -4=-f-(m+n) logn) time algorithm. note the corresponding planar subdivision as well.
We also study a similar but more complicated prob- Let R be a subset of 5. For a trapezoid A €
lem of computing the marked cells in an arrangement An(R,P), let w(A) denote the number of elements
of n segments. Let 5 be a set of n segments in the of 5 intersecting the interior of A.
plane. We use an analogous notation ,4(5, P) to de- Let n = |5|, and suppose R is a random subset of
note the set of the cells in ,4(5) containing at least 5 of size r. For the analysis of our algorithms, we
one point of P, and 77(71, m) to denote the maximum are interested in estimating the expectation, over all
combinatorial complexity of .4(5, P) over all sets 5 random choices of R,
of n segments and sets P of m points in the plane.
w
Aronov et al. [2] proved that E[ Y.
U
^c (2.1)
A€A (R,P)
77(71, m) = 0 (m2/3n2/3 + n log m + n a(n)J .
where c is a small constant like c = 2. Well-known
A randomized algorithm with expected running time results concerning the so-called e-nets ( Haussler and
0(m2/3_£n2/,3+2£logn + na(n) log2nlogm) is de- Welzl [16]) imply that, for every Ae/(ß), w(A) <
scribed by Edelsbrunner et al. [12], and a slightly C{n/r) logr with high probability, where C is a suit-
faster deterministic algorithm is presented by Agar- able constant. From this one can derive a bound for
wal [1]. (2.1). We are, however, interested in the following,
Following a similar strategy as for the case of slightly stronger bound (better by a factor of logc r):
lines, we first develop a randomized algorithm with
0((m2 + nlogm + na(n))logn) expected running
Proposition 2.1 (i) Let L be a set ofn lines and P
time. Let's remark that the above upper bound
a set of m points in the plane. If R C L is random
for 77(71,7«) is not known to be tight, and a bound
subset of size r, where each subset of size r is chosen
like r](n,y/n) = 0(na(n)) (which is conjectured to
with equal probability, then for any constant c > 1.
be the complexity of y/n cells) will immediately im-
prove the expected running time of our algorithm
E[ £ w(AY = K(r,m)-0((n/r)c).
to O (n log n a (n)). Plugging this algorithm to the
standard random sampling technique, as in the case AeAu(R,P)
of lines, we obtain a randomized algorithm for com-
puting A(S, P) in 0(m2/3n2/3 log4/3 ^ a1/3(^) + (ii) Let S be a set of n segments and P a set of
m points in the plane. If R C 5 is random subset
(m + nlogm + na(n))logn) expected time. If
the segments of 5 have only fc = o(n2) intersec- 1
The vertical decomposition C of a cell C in an arrange-
tion points, the expected running time of the algo- ments of segments (or of lines) is obtained by drawing a vertical
rithm is 0(m2/3A;1/3log4/3 £a1/3(£)+(m+nlogm+ line from each vertex of C in both directions (within C) until
na(n))logn). it hits another edge of C.
of size r, where each subset of size r is chosen with It is easily checked that these axioms hold in the sit-
equal probability, then for any constant c > 1. uations of Proposition 2.1.
For any natural number t, let us denote
E[ Y, ( ) ] = V(r, m) ■ 0((n/r)c).
W A C

ll
A€A (R,P) CTt{R) = {A G CT(R) | w(A) > tn/r} .
These bounds essentially say that the cth moment We establish the following:
of the quantities w(A) behaves as if they were 0(n/r).
If we sum w(A) over all cells in A(R)—the case Lemma 2.2 Given a set S of objects, let R be a ran-
where every cell of A{R) contains a point of P—then dom sample of size r < n — \S\ drawn from S, and let
Proposition 2.1 follows from a result of Clarkson and t be a parameter, 1 < t < r/d, where d = max \D(A) \.
Shor [10]. In our situation, where the sum is taken Assuming that CT(R), D(A) and K(A) satisfy Ax-
over only some of the cells, the Clarkson-Shor frame- ioms (i) and (ii) above, we have
work does not apply directly anymore (the main dis-
tinction between these two situations will be outlined E\CTt(R)\ = 0(2"*) -E\CT{R')\ (2.2)
below). We give a proof based on a generalization
of an approach due to Chazelle and Friedman [7], where R' C S denotes a random sample of size r' =
which is somewhat different from the Clarkson-Shor [r/t\.
method. Recently, de Berg et al. [3] gave an alterna-
tive proof of Proposition 2.1. Roughly speaking, Lemma 2.2 says that the expected
We derive a key lemma in a somewhat abstract number of "large" trapezoids in CT(R), that is trape-
framework; see also [6, 7, 10] for various approaches zoids which the value of w(A) exceeds the "right"
to axiomatize similar situations. value n/r more than t times, decreases exponentially
with t.
Let S be a set of objects. For a subset R C S, we
define a collection of 'regions' called CT(R); in the Chazelle and Friedman [7] proved a result analo-
situation of Proposition 2.1 the objects are segments, gous to Lemma 2.2 under the following stronger ax-
iom replacing (ii):
the regions are trapezoids and CT(R) = AU (R, P).
Let T = T(S) = Uflcs CT(R) denote the set of re- (ii') If D{A) C R and K{A) n R = 0. then A e
gions defined by all possible subsets of S. We asso- CT{R).
ciate two subsets D(A),K(A) C S with each region
AeT. This assumption implies that the presence of A in
.D(A), called the defining set, is a subset of S defin- CT(R) depends only on D(A) and K(A), thus it is
ing the region A in a suitable geometric sense.2 We determined purely "locally." Notice that (ii') may
assume that for every AeT, |D(A)| < d for a fail in the situation of Proposition 2.1. However, (ii')
(small) constant d. In Proposition 2.1, each trape- holds in the special case, when CT(R) is the vertical
zoid A is defined by at most 4 segments (or lines) decomposition of all cells in A(R).
of S, which constitute the set D(A); details can be Proof of Lemma 2.2: Let Tt = \JRCS CTt(R).
found in Chazelle et al. [6]. We have
K(A), called the killing set, is a set of objects of
5, such that including any object of K(A) into R E|CTt(£)| = 5] Pr[A G CT(fi)], (2.3)
prevents A from appearing in CT(R). In many ap- A6T(
plications K(A) is the set of objects intersecting the Pr
cell A; this is also the case in Proposition 2.1. Set
E\CT(R')\ = J2 [A G CT(R')}
AeT
w(A) = \K(A)\.
Let S,CT(R),D(A),K(A) be such that for any > J2 Pl A e CT
't iR')\ ■ (2-4)
subset RC S, CT(R) satisfies the following axioms: AGTt

(i) For any A e CT(R), D(A) C R and RnK{A) = We will prove that, for each A G Tt,
0, and
Pr[A e CT(R)} = 0(2"') • Pr[A G CT(R')}, (2.5)
(ii) If A G CT{R) and R' is a subset of R with
D{A) C R', then A G CT(R'). which in conjunction with (2.3) and (2.4) implies
2
(2.2).
We need not make this precise here, as this is only an
intuitive meaning of D(A). The analysis depends only on the Let AA denote the event that D(A) C R and
axioms involving O(A) given below, and these will be satisfied K(A) C\R = %, and let A'A denote the event £>(A) C
in our specific examples. R' and K{A) n R' = 0.

78
We rewrite Pr[A G CT(R)] using the definition of as desired. D
conditional probability: We now prove Proposition 2.1.

Pr[A G CT{R)\ = PrL4A] • Pr[A G CT{R) | AA] Proof of Proposition 2.1: We will only prove the
first part, the second part is identical. For any subset
and analogously R C L of size r, let CT(R) denote the set of trape-
Pr[A G CT{R')} = Pi[A'A] ■ Pr[A G CT(R') \ A'A]. zoids in the vertical decomposition of the marked
cells of A(R), i.e., CT(R) = An(R,P). Obviously,
We observe that by Axiom (ii), we have \CT(R)\ <K(r,m). Now
Pr[A G CT(R) | AA] < Pr[A G CT{R') \ A'A]. (2.6)
E[ £ w(Ay]
Indeed, Pr[A G CT(R') \ A'A] is the probability that A.eA,l(R,P)
A appears in CT(R'), where R' is created as follows:
Include all elements of D(A), and then choose the
remaining r' - |-D(A)| elements randomly among the r
t>l
elements of S\(-D(A)UK(A)). We may continue this
experiment by choosing R to be R' plus a random ^ (-)CY,(t + l)c-V\CTt(R)\
subset of r - r' elements of S \ (R' U K(A)). Clearly r
t>0
for such subsets R' and R, Pr[A G CT{R)] < Pr[A G
CT(R')]. Moreover, the subset R selected by this
= (-) ^tcO(2-t)-/c(r/f,m)
C
r
t>o
experiment contains D(A) plus r - \D(A)\ random
elements of S \ (D(A) U K{A)), so Pr[A G CT(R)} is < K(r,m)(-)C£0(ic-2-*)
the same as the left hand side of (2.6).
Therefore
Pr[A G CT{R)] Pr[AA]
Pr[A G CT(R')} ~ Pr[A'A] '
(Note that r' = [r/t\ > d, and hence both denomi- 3 Computing cells in line ar-
nators are nonzero.) rangements
It remains to estimate the latter ratio, which can be
done in the same way as by Chazelle and Friedman. In this section we describe a randomized algorithm for
Let d ■= |D(A)|, w = w(A), and for two non-negative computing A(L, P), where L is a set of n lines and
integers a < x, let x- = x(x — 1) • • ■ (x — a + 1). Then P a set of m points in the plane. In fact, our algo-
rithm computes the vertical decomposition A (L, P).
Pr[AA] _ (-TZ) Q)
(n\ fn — w — d\ Each face of A (L, P) is a trapezoid, bounded by at
?M'A} \r) I r'-d I most two vertical segments and portions of at most
r- (n — w — r')- two edges of a cell of A (L,P). We first present a
(n - r1)^ randomized algorithm for computing A (L, P) with
By our assumption r' > d, so we obtain 0{m2 + nlogn) expected time, which is optimal for
m < \Jn log n. We assume that the points of P are
T — %
— : < dt iovi = 0,1,... ,d- 1. sorted in nondecreasing order of their x-coordinates,
and that the lines of L are sorted by their slopes. We
first describe the outline of the overall algorithm, and
Thus, the first factor in the above expression is 0(td).
then discuss each of the steps in detail.
To bound the second factor, we observe that, for i =
r',r' + l,...,r-l,
1. Let t be some sufficiently large constant. Choose
w a random subset RC. L of r = [n/t\ lines.
1 < 1 < exp(— w/n).
2. Partition P into q = \\/i~\ subsets Pi, ... ,Pq,
Since w > tn/r, we have w/n > t/r, and therefore
each of size at most k = [m/\/i\, where

Pr[A'A] - ■ " - V r Pi = {P(i-i)fc+i> • • • ,Pik) fori < q,


d
= 0(t )exp(-(t-l)) = 0(2- ).. t P
q = {P(q-l)k+l, ■■■ ,Pm}-

79
3. For each i < q, compute A (R,Pi) recursively. or in other words, the polygons of C intersecting £.
If a cell C of A(R) is computed more than once, Indeed, after having located all points of the form £*,
retain only one copy of C. (Note that multiple we traverse the adjacency graph of the trapezoids in
copies of a cell C are computed if C contains the A (C*). At each trapezoid T £ A (C*) we compute
points of more than one P^'s.) Since P is sorted C*(T), the set of regions that contain the trapezoid
in the x-direction, it is easy to detect multiple T £ A (C*), and output the pairs (£, C) for £* £ r
copies of a cell. In this way, obtain A (R, P). and C* £ C*(T). Suppose we arrive at r from r', then
C*(T) and C*(T') differ by at most one region (the re-
4. For each line £ £ L \ R, compute the cells of
A(R, P) that £ intersects. gion whose boundary separates r from r'), and thus
C*(T) can be obtained from C*(T') in 0(1) time.
5. For each trapezoid A of A (R, P), compute the The total time spent in this step is 0(m2 +n log n)
set LA Q L \ R of lines that intersect the interior plus the number of polygon/line incidences. The
of A. expected number of these incidences is bounded by
0(K(T, m) ■ (n/r)) = 0(n + m ), using Proposition 2.1
2
6. For each trapezoid A £ A (R,P), compute the with r = n/t and c = 1.
arrangement of lines of LA within A, and the
vertical decompositions of its cells. For each cell
C £ A(R, P), perform a graph search on trape-
zoids of these vertical decomposition to merge
appropriate trapezoids and to discard superflu-
ous ones, thus forming the portion of A (S, P)
within the cell C.

Steps 1-3 are trivial, so we now describe Steps 4-6


in more detail.
Step 4. We want to compute the cells of A(R, P)
intersected by each line in L\R. The situation can be
viewed as follows: we have a collection C of disjoint v2 ■■
convex polygons (the cells of A(R, P)), and a set L\R
of lines. The collection C has at most m polygons
with a total of 0(n- ■mr edges3. For each cell C £ C,
consider C*, the set of points that are dual to the lines Figure 1: Finding a.
intersecting C. C* is a polygonal region, bounded
by an infinite convex chain from above and by an
infinite concave chain from below. Each vertex of C* Step 5. Let C be a cell in A(R, P), and let
is dual to the line supporting an edge of C. For a Lc Q L \ R be the set of lines intersecting the in-
pair of polygons Ci,C2 £ C, an intersection point of terior of C. For each line £ £ Lc, we compute the
the edges of C{, CJ is dual to a common tangent of trapezoids of C intersected by £, as follows. Since
C\ and C<}. Since C\,C2 are disjoint, the boundaries the lines in L are sorted by their slopes, by being care-
of C*,C% intersect in at most 4 points. ful in Step 4, we can ensure that the lines of Lc are
Let us consider the arrangement A(C*) of the also sorted by their slopes. For each line £ £ LQ we
polygonal chains bounding the regions C*, for all compute the two vertices vi, v2 of C that support the
C £ C. It has 0(n + m2) complexity, and can be com- lines parallel to £ (see Figure 1). This can be done,
puted in time 0(m2+n\ogn), for instance by Mulmu- over all lines of Lc, in 0(\LC\) time by merging the
ley's randomized incremental algorithm [18, 6]. This slopes of Lc with the slopes of the edges of C; we
algorithm actually computes the vertical decomposi- leave out the easy details for the reader. Next, we
tion A (C*) of the arrangement, together with a point traverse dC in clockwise as well as counter-clockwise
location data structure with O(logn) expected query order in a lock-step fashion, starting from both V\
time. We use this data structure to locate the points and V2 simultaneously (so we preform 4 traversals in
£* dual to all lines £ £ L\ R. From this we can de- a lock-step fashion, as depicted in Figure 1), until
termine, for every £, the regions of C* containing £*, we reach an intersection point a of £ and C. Since
3
£ intersects C, we will eventually find such an in-
The latter estimate follows from the bound for K.(n, m)
mentioned in Section 1, in fact it is the weaker bound proved tersection point. Finally, by tracing £ through c",
by Canham [4]. starting from c, we compute all k trapezoids of c"

80
that £ intersects. The time spent in finding a and where rrii < m/y/i for i < q = \\fi ], Y^1=\ TO« — TO>
tracing £ is easily seen to be 0(k). Summing over all and C is an appropriate constant. The solution of
cells C G A(R, P) and over all lines of LQ, the total this recurrence is
time spent is 0(%2A A\\ ,R p) w(A)), whose expected
value, by Proposition 2.1 (i), is 0[rn2 + nlogn). T(n, m) = 0(m2 + n log n).

Step 6. Let A be a trapezoid of AU{R,P). Af- If m > y/nlogn, we can divide the points of P into
ter having computed LA, we compute the arrange- groups of size \/n\ogn, and solve the subproblems
ment A(L&) using, say, a randomized incremental separately. This standard batching technique yields
algorithm. We clip A{L&) within A, and compute a more convenient bound for the expected running
the vertical decomposition of the clipped arrange- time, namely 0(m\/n\ogn + nlogn). Hence, we can
ment. For each point p G P PI A, we also compute conclude
the trapezoid of this vertical decomposition contain-
ing p. The time spent in this step is easily seen Lemma 3.1 Given a set L of n lines and a set P of
to be 0{w{A)2 + \P n A|logu;(A)) per trapezoid m < n2 points in the plane, the cells of A(L) contain-
1
AGA \R,P). ing the points of P can be computed by a randomized
For a cell C € A{R,P), let Ac be the set of the algorithm in expected time 0(m\/n\ogn + nlogn).
resulting trapezoids that lie in C. We now define a
graph Qc on the trapezoids of Ac. The vertices of We now present another randomized algorithm
Qc are the trapezoids of Ac, and two trapezoids are whose running time is significantly better for larger
connected by an edge if they share a vertical edge. values of m. Although the basic idea is the same as in
By performing a depth first search on Qc, we can [1], the algorithm presented here is simpler because
extract all connected components of Qc whose trape- we allow randomization.
zoids contain any point of P. That is, we pick a point We choose a random subset R C L of size r, where
p G P n C. Let TP G Ac be the trapezoid containing
p. We perform a depth first search in Qc starting from m 2/3
Tp until we find the entire connected component of Qc nWlogWin/y/m)
containing rp. Let Ac(p) be the set of trapezoids in
this component; then the union of these trapezoids is Using a randomized incremental algorithm, we con-
exactly the cell of A(L, {p}). The vertices of the cell, struct A (R) plus a point-location data structure for
sorted in the clockwise order, can be easily obtained A (.R) in expected time 0(r2) [6]. For each trape-
by merging the trapezoids of Ac(p) in an obvious
zoid A G A (R), let LA C L \ R be the set of lines
manner.
that intersect the interior of A and FA C P the set of
If there is a point of P n C that does not lie in
points that are contained in A. LA can be computed
Ac(p), we repeat the same procedure. We continue
this step until we have extracted all component of Qc in time 0(nr) by tracing each line through A (R) and
PA can be computed in expected time 0(m logn) by
that contain any point of Pfl C. This gives A(L, P(~)
C). locating each point of P in A (R). Set n^ = |LA|
Repeating this step for all cells of A{R, P), we ob- and 771A = |-PA |- Let Z/\ be the set of trapezoids in
tain all cells of A(L, P). Finally, we compute the ver- the vertical decomposition of cells of .4(LA U {dA})
tical decomposition of all the cells. The total running that intersect the boundary of A and lie inside A.
time for Step 6 is 0(m\ogn)+J2AeA(R P) 0(w(A)2), Clarkson et al. [9] proved that |ZA| = 0(n&).
and its expected value is For each trapezoid A G A (R), it is sufficient
to compute A (LA, PA) and Z&. We compute
0(m log n + K{r,m){n/r)2) = 0(r n). n
.4(LA,PA) in expected time 0(mA\/ A logriA +
«A log «A) using Lemma 3.1. ZA can be computed by
Putting all the pieces together, the total expected a randomized incremental algorithm. Roughly speak-
running time of Steps 4-6 is 0(m2 + nlogn). Let ing, we clip the lines of LA \ R within A, add the
T(n, m) denote the maximum expected time of the clipped segments one by one in a random order, and
entire algorithm, then we obtain the following recur- maintain the vertical decomposition of the cells of
rence. the segments added so far which intersect dA. Fol-
lowing the same analysis as in [6], it can be shown
T{n,m) < ^T([n/iJ,mi) + C(m2+nlogn), that the expected running time of the algorithm is
O(riAlognA)- Hence, the expected running time of

81
the algorithm is family of inner components such that C lies in the
interior of the outer component and in the exterior of
E y^ O (nriA y^A log TIA + n& log TIA J + each inner component. Each component of dC can
A6^M(R)
be regarded as a simple polygonal chain. Let O be
the set of outer boundary components of the cells in
O(nr) + 0(7nlogn).
A(R, P), and let 1 be the set of the inner boundary
By a result of Clarkson and Shor [10] (or also by components of these cells. We have \ö\ < m and
Proposition 2.1), we have \X\ < m + n. Let \i be the total number of edges of
all polygons in ÖUI; obviously, fi < n(n/t, m).
E E
Ae.4"(fl)
n& = 0(nr) and We first decompose each segment g 6 S \ R into
maximal subsegments, so that each subsegment lies
in the interior of some outer component O, i.e. we
E cut each segment at the intersection points of Ö and
[AeAE(R) "M V«A log «A = °lm\/7l0g7
n S and discard the subsegments that lie in the exte-
rior of Ö. Let £ be the set of resulting subsegments.
Thus, the expected running time of the algorithm Next, for each subsegment a e S, we compute the
is bounded by 0(m^j log(n/r)+nrlog ^+mlogn). trapezoids of A (R, P) intersected by a.
Substituting the value r in the above expression, we Suppose that we have already computed £ in
obtain Step 4. Then in Step 5 we compute 5A, for all
Theorem 3.2 Given a set L ofn lines and a set P A e A (R, P), as follows. We preprocess each polyg-
of m points, the faces of A(L) containing the points onal chain I £ I, in linear time, for ray shooting
of P can be computed by a randomized algorithm in queries, so that the first intersection point of a query
expected 0(m2/3n2/3 log2'3 -4= + (m + n) log n) time. ray and / can be computed in logarithmic time, see
[5, 15]. The total time spent in preprocessing I is
0{ß) = 0{r,{n,m)).
4 Computing cells in segment Let a be a segment of E that lies in the interior of
arrangements the outer component O G O of dC. Let a, b be the
endpoints of a, and let A(a) be the trapezoid of C
Next, we present an algorithm for computing marked containing a. If a is not an endpoint of a segment of
cells in arrangements of segments. Let S be a set S\R, then a lies on the boundary of A(a). We check
of n segments and P a set of m points in the plane. whether b e A(a). If the answer is 'yes\ then A(a)
The goal is to compute A(S, P) and its vertical de- is the only trapezoid of C intersected by a, and we
composition A (S, P). Again, we begin by a simpler stop. If b £ A(a), we compute the other intersection
algorithm which is effective for few cells, and then point, ai, of a and A (a). If a\ lies on a vertical edge
plug the random sampling technique to handle larger of A(a), we also compute, in constant time, the next
values of m. trapezoid A(ai) of C intersected by a. We then re-
The outline of the first algorithm is the same as peat the same step with a\ and A(ai). if oi, on the
in the previous section, except that we must now in- other hand, lies on an edge of the cell C, then a\ lies
terpret the operations in terms of segments. Since on the boundary of some inner component I £ I oi
the cells of A (R, P) are not necessarily simply con- C, and the portion of the segment a immediately fol-
nected, we may have to deal with m + n polygons lowing ai lies outside C. Using the ray shooting data
even though there are only m cells. Consequently, structure, we compute the next intersection point 02
the computation of the sets of cells intersected by of the polygonal chain / and the segment a\b. Once
each segment of S \ R in Step 4 and the computation we know 02, we can also compute the trapezoid of
of SA for each trapezoid A G A (R, P) in Step 5 now C containing 02, and we continue tracing a through
become considerably more complicated. Another dif- C\
ficulty in computing S/\ is that we now have to detect
For each trapezoid intersected by a, we spend
intersections between simple polygons and segments
O(logn) time, so the total time spent in comput-
rather than between convex polygons and lines. In
ing the ka trapezoids intersected by a is 0(ka logn).
the remainder of this section we will describe how to
Summing over all segments of S, the total time spent
compute the sets 5A-
is
The boundary of each cell C, dC, of A(R, P) is Eff6s°(^logn) = °(£Ae.A"(Ä,p)nAloSn) ,
composed of (at most) one outer component and a where nA = |5A|-

82
Next, we describe how to compute the set S. No- tree T with g starting from the root. Let v be a node
tice that it is sufficient to compute all intersection visited by the query procedure. If the endpoints of g
points between the segments of S \ R and the outer do not lie in the vertical strip Wv, i.e., g completely
polygonal chains in Ö. crosses Wv, then g intersects O G Zv if and only if
Let Jo be an interval corresponding to the projec- the line supporting g intersects the convex hull of O.
tion of the polygoal chain O G Ö onto the z-axis, and Thus, we first compute all polygonal chains of Zv
let J = {Jo \OeO}. intersected by g, using the line intersection searching
We construct an interval tree T on J\ see Mehlhorn structure, and then, for each O G Zv intersected by g,
[17] for details on interval trees. T is a minimum we compute the intersection points of g and O using
height binary tree with at most 2m leaves. Each node the ray shooting data structure. If kg is the number
v of T is associated with an interval Uv, and a point of intersection points between g and the polygonal
xv. Let Wv = Uv x [—00, +00] be a vertical strip, and chains of Zv, then the total time in reporting these
let hv be the vertical line passing through xv. For the intersections is O((kg + 1) log^)-
root u, Wu is the entire plane and hu is the vertical If one of the endpoints of g lies in Wv, we can com-
line passing the middle endpoint of the intervals of pute all a" intersection points between Ov and g in
J. Each interval J G J is stored at the highest node time 0((avg + 1) log/j„), using the ray shooting data
v of T such that xv G J. structure for Ov. Let v\, V2 be the children of the
Let Jv be the set of intervals stored at v. We as- node v. If g intersects WVl (resp. WV2), we visit vx
sociate two subsets Ov,Zv of O with v. Let Ov = (resp. V2). It is easily shown that the query proce-
{O I Jo € Jv} and Zv = \JW Ow, where the union dure visits O(logm) nodes, and the query time is
is taken over all descendants of v, including v; set 0((logm + fcfl)logn), where kg is the total number
mv = \Ov\ and zv = \ZV\. Finally, let fj,v (resp. C„) de- of intersection points reported.
note the total number of edges in Ov (resp. Zv). Since We repeat this procedure for all segments g G S\R.
each polygonal chain of Ö appears in exactly one Since fj, < r)(n,m) = 0(m2 + n(logm + a(n)))
and
Ov, we have YlveT ^ = V and YlveT^ ^ 2/^logm. H9es\Rk9 ^ EAS^ü^P)71^' the total cost

Moreover, it can be shown that if v\, V2 are the chil- of computing the intersection points is 0((m2 +
dren of v then zVl,zV2 < zv/2, which implies that nlogm + na(n))logn + SAe_4ii(fi?P) n& log«). As
£„er*„2 = 0(m2). in the previous section, the time spent in Step 6
Since the polygonal chains in Ov are pairwise dis- (refining the cells of A"(R,P)) is 0(£AnA). Us-
joint and all of them intersect a vertical line, we can ing Proposition 2.1 (ii), we obtain that the to-
regard Ov along with appropriate portions of the ver- tal expected time spent in the merge step is
tical line hv as a simple polygon ILj, and prepro- O ((m2 +nlogm + na(n)) logn).
cess II„ in 0(^v) time for answering ray shooting Following the same analysis as earlier, we
queries. Using this data structure, one can report can conclude that the total running time of
all k intersection points of a segment g and Ov in the first algorithm for computing A(S, P) is
time 0((k + 1) log fj,v). O ((rn2 +71 log m + noj(n))logn). We can again use
Next, we take the convex hull of each polygonal the batching technique if TO is large. Omitting the
chain in Zv, and preprocess the resulting convex poly- details, we obtain
gons into a data structure, as described in the previ-
ous section, so that all convex polygons intersected Lemma 4.1 Given a set S of n segments and a set
by a query line can be reported quickly. Since any Pofm points, the faces of A(S) that contain a point
two polygonal chains of O are disjoint, the bound- of P can be computed by a randomized algorithm in
aries of their convex hulls intersect in at most two expected time 0((my/nlogm+n(logm+a(n))) logn).
points, and so they have at most 4 common tan- For larger values of m, we again use the ran-
gents. Consequently, the line intersection searching dom sampling technique as in the previous section.
structure has size 0(z2 + £„). Moreover, it can be That is, we choose a random subset R C S of size
computed in time 0(z2 + zvlog(v + (v), using the 2 3
"TO / log1/3(n/v^)] , + .„,_,
algorithm of [19]. We also preprocess each O G Ö -T7T • 2/v / r~\ ' and com ute A
P (R)-
in linear time for ray shooting queries as in [15]. It
can be shown that the total preprocessing time is For each A G A"(R), we compute PA = P l~l A
0(m2 + Y,V {zv logCu + Cv)) = 0(m2+mlogmlogn+ and 5A, the set of segments that intersect A. We
/ilogm). We omit the details. clip the segments within A. The total time spent
Let g G S \ R be a segment. All intersection points in this step is 0(r2 + (m + nr) log r). Let zbea
of g and Ö can be computed as follows. We search the point lying in the unbounded face of ^4(5). For each

83
A £ A (R), we compute A (SA,PA U {2}), in time [6] B. Chazelle, H. Edelsbrunner, L. Guibas, M. Sharir
0((mA^/nA\ogmA + nA(\ogmA + a(nA))) lognA), and J. Snoeyink, Computing a face in an arrange-
using Lemma 4.1, and then glue them together. We ment of line segments, SIAM J. Computing 22
omit the rather routine details from here. The overall (1993), 1286-1302.
expected running time of the algorithm is [7] B. Chazelle and J. Friedman, A deterministic view
of random sampling and its use in geometry, Com-
E[ Y, 0({nA{a(nA) + hgmA)+ binatorica 10 (1990), 229-249.
ll
AeA {R)
[8] K. Clarkson, Computing a single face in an arrange-
mA^nAlogmA + 0((m + nr) log r). ment of segments, 1990, manuscript.

Again, using the results by Clarkson-Shor [10] and [9] K. Clarkson, H. Edelsbrunner, L. Guibas, M. Sharir
substituting the value of r, we obtain and E. Welzl, Combinatorial complexity bounds for
arrangements of curves and spheres, Discrete and
Theorem 4.2 Given a set Sofn segments and a set Computational Geometry 5 (1990), 99-160.
Pofm points, the faces of A(S) that contain a point
[10] K. Clarkson and P. Shor, Applications of random
of P can be computed by a randomized algorithm in
sampling in computational geometry II, Discrete
expected time 0{m2l'in2/z log4'3 -^ a 1/3/ ) + (m- and Computational Geometry 4 (1989), 387-421.
nlogm + na(n)) logn).
[11] H. Edelsbrunner, Algorithms in Combinatorial Ge-
Finally, let us remark that if A{S) is sparse, that ometry, Springer-Verlag, Berlin, 1987.
is, if it has only k = o(n2) vertices, then using
[12] H. Edelsbrunner, L. Guibas and M. Sharir, The
the fact that the expected number of trapezoids in
complexity of many faces in arrangements of lines
A (R) is 0(kr2/n2 + r), we can do a more care- and of segments, Discrete and Computational Ge-
*2/3 logV^fc/m)"
ometry 5 (1990), 161-196.
ful analysis, choose r n (fY j2/3(fc/m)
and
can show that the expected running time of the algo- [13] H. Edelsbrunner and E. Welzl, On the maximal
rithm is 0(m2/3fc1/3 log4/3 ^Q 1/3(i) + (m+nlogm+ number of edges of many faces in an arrange-
na(n)) log n). ment, Journal of Combinatorial Theory, Series A
41 (1986), 159-166.
Acknowledgments. The authors thank Mark de
[14] L. Guibas and M. Sharir, Combinatorial and
Berg, Mark Overmars, and Micha Sharir for several algorithms of arrangements, in New Trends in
useful discussions. Discrete and Computational Geometry (J. Pach,
ed.), Springer-Verlag, New York-Berlin-Heidelberg,
1993, 9-36.
References
[15] J. Hershberger and S. Suri, A pedestrian approach
[1] P. Agarwal, Partitioning arrangements of lines: II. to ray shooting: Shoot a ray, take a walk, Proc. 4th
Applications, Discrete and Computational Geome- ACM-SIAM Symp. Discrete Algorithms, 1993, pp.
try 5 (1990), 533-573. 54-63.
[2] B. Aronov, H. Edelsbrunner, L. Guibas and M. [16] D. Haussler and E. Welzl, Epsilon-nets and simplex
Sharir, Improved bounds on the complexity of range queries, Discrete Comput. Geom. 2 (1987),
many faces in arrangements of segments, Combi- 127-151.
natorica, 12 (1992), 261-274.
[17] K. Mehlhorn, Data Structures and Algorithms 3:
[3] M. de Berg, K. Dobrindt and O. Schwarzkopf, On Multi-dimensional Searching and Computational
lazy randomized incremental construction, to ap- Geometry, Springer-Verlag, Berlin, 1984.
pear in Proceedings 26th Annual ACM Symposium
on Theory of Computing, 1994. [18] K. Mulmuley, A fast planar partition algorithm, I,
J. Symbolic Computation 10 (1990), 253-280.
[4] R. Canham, A theorem on arrangements of lines in
the plane, Israel J. Math. 7 (1969), 393-397. [19] K. Mulmuley, A fast planar partition algorithm, II,
J. ACM 38 (1991), 74-103.
[5] B. Chazelle, H. Edelsbrunner, M. Grigni, L.
Guibas, J. Hershberger, M. Sharir and J. Snoeyink, [20] E. Szemeredi and W. Trotter Jr., Extremal prob-
Ray shooting in polygons using geodesic triangula- lems in discrete geometry, Combinatorica 3 (1983),
tions, Proc. 17th Int. Colloq. Automata, Languages 381-392.
and Programming, 1991, pp. 661-673.

84
Matching Shapes with a Reference Point

Helmut Alt* Oswin Aichholzert


Freie Universität Berlin Institut für Grundlagen der Informationsverarbeitung
Fachbereich Mathematik und Informatik Technische Universität Graz
Takustraße 9, D-14195 Berlin, Germany Schießstattgasse 4, A-8010 Graz, Austria
e-mail: altfflinf.fu-berlin.de e-mail: oaichQigi.tu-graz.ac.at

Günter Rote
Institut für Mathematik, Technische Universität Graz
Steyrergasse 30, A-8010 Graz, Austria
e-mail: roteQftug.dnet. tu-graz.ac. at

Abstract A, B, to determine how much they "resemble each


other".
For two given point sets, we present a very simple Here, a "figure" will be a union of finitely many
(almost trivial) algorithm to translate one set so points and line segments in R2 or triangles in E3.
that the Hausdorff distance between the two sets Note that sets of curves in E2 and E3 or surfaces
is not larger than a constant factor times the min- in E3 can be approximated arbitrarily closely by
imum Hausdorff distance which can be achieved in these objects. As a measure for "resemblance" we
this way. The algorithm just matches the so-called will use the Hausdorff-metric 6H, which is a some-
Steiner points of the two sets. how natural distance measure and gives reasonable
The focus of our paper is the general study of results in practice (see [HKR]). It is defined as fol-
reference points (like the Steiner point) and their lows:
properties with respect to shape matching.
For more general transformations than transla- Definition 1 Let A, B be compact subsets of E2
tions, our method eliminates several degrees of free- orE3. Then
dom from the problem and thus yields good match- 8ff(A, B) := max min Met — fell,
V
ings with improved time bounds. ' a€A b£B " "

where ||-|| is the Euclidean norm and the Hausdorff-


distance is defined as
1 Introduction
SH(A,B):=m3,x{S~H(A,B),S~H(B,A)}.
This work is motivated by a problem that is typ-
ical in application areas such as computer vision If A and B consist of n and m line segments in
or pattern recognition, namely, given two figures the plane, their Hausdorff-distance SH(A,B) can
be computed in time 0((n + m)log(n + m)) (cf.
'This research was supported by the ESPRIT Basic Re-
search Action Program No. 7141, Project ALCOM II. It [ABB]). However, it is more natural to assume
was initiated during a stay of the author at the TU Graz that A and B are not fixed but can be moved by a
sponsored by funds for the promotion of foreign relations of translation, by a rigid motion (translation and ro-
that university. tation) or even transformed by a similarity (scal-
*That research was supported by the Jubiläumsfond der
ing and rigid motion) in order to match them as
Oesterreichischen Nationalbank.
Permission to copy without fee all or part of this material is well as possible and then determine the minimal
granted provided that the copies are not made or distributed for Hausdorff-distance. So, in general, we have a set T
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given of allowed transformations and want to determine
that copying is by permission of the Association of Computing for given figures A and B:
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission.
mm SH(A,T(B)).
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

So
Note that, for similarities, it makes a difference if 2 Reference Point Methods
we exchange the sets A and B in this problem.
This problem of finding an optimal matching has Like in [ABB] pseudooptimal algorithms use suit-
been considered for the two-dimensional case in able reference points, which we define for arbitrary
several previous articles: In [ABB], an algorithm dimension d as follows:
of running time O ((nm) log(nm) log* (nm)) for the Definition 2 Let Cd denote the set of compact
case that T is the set of translations along one subsets of ELd, and let T be a set of transforma-
fixed direction is described. An 0((nm)2 log (nm)) tions on Kd. A mapping s: Cd —>■ Rd is called a
algorithm for arbitrary translations is presented reference point with respect to T if the following
in the paper [AST], which can be improved to two conditions are satisfied:
0 (nm(n + m) log(nm)) if A and B are finite sets of
(a) s is equivariant with respect to T, i.e., for all
points [HKS]. The paper [CGHKKK] gives an al-
A,B e Cdand T £ T we have
gorithm of time complexity 0((nm)3 log (nm)) for
arbitrary rigid motions. The latter two algorithms s(T(A))=T(s(A)).
use sophisticated and powerful tools like paramet-
(b) There exists some constant c > 0 such that for
ric search and therefore do not seem to be applica-
allA,BeCd,
ble in practice.
Here, we follow a different approach which was \\s(A)~s(B)\\<c-8H(A,B).
already used in [ABB]. We do not try to find an
In other words, s is a Lipschitz-continuous
optimal solution but an approximation to the op-
mapping between the metric spaces (Cd, SH)
timal one by simpler algorithms. More precisely, if
and (Ed, || • ||) with Lipschitz constant c. We
the optimal matching yields Hausdorff-distance 6
call c the quality of the reference point s.
our algorithms will find a matching T such that
Based on the existence of a reference point for T
SH(A,T(B))<aS we obtain the following algorithms for pseudoopti-
mal matchings where T is the set of translations,
for some constant a > 1. We call such a solution a rigid motions, and similarity transformations, re-
pseudooptimal matching with loss factor a. spectively:
A somehow similar approach has been taken in Algorithm T
several articles by Heffernan and Schirra ( [H,HS]) 1. Compute s(A) and s(B) and translate B by
considering matching of finite sets A, B of points s(A) — s(B) (so that s(B) is mapped onto s(A)).
under rigid motions. They consider both, the deci- Let B' be the image of B.
sion problem, whether for a given £ A (or a subset 2. Output B' as the pseudooptimal solution (to-
of a given size k) can be mapped in a 1-1-fashion gether with the Hausdorff-distance SH(A,B')).
into the ^neighborhoods of points of B, and the Algorithm R
optimization problem, namely to find the smallest
1. as in Algorithm T.
£ of this kind. Both problems are solved very effi-
2. Find an optimal matching of A and B' under
ciently by allowing that the optimal e is not found
rotations of B' around s(A).
exactly, but within a small tolerance interval (ap-
3. Output the solution B" and the Hausdorff-
proximate algorithms).
distance SH(A,B").
The aim of this paper is to work out the general
idea of using "reference points" for pseudooptimal Algorithm S
algorithms. Reference points were first introduced 1. as in Algorithm T.
in [ABB] and used in [CKS] to obtain an 0(mn 2. determine the diameters d(A) and d(B) and
log(mn)) approximate algorithm for the decision scale B' by a := d(A)/d(B) around the cen-
problem for sets of line segments. Here we will also ter s(A).
present a reference point that gives better bounds 3. as Step 2 in algorithm R with the scaled image
than the one in [ABB] and can be applied to simi- of B'.
larities and problems in three dimensions as well. 4. as Step 3 in algorithm R.

86
As the algorithms R and S are formulated, they Lemma 3 If A, B C ^d are compact sets with di-
look only for proper rigid motions and positive sim- ameters d(A) and d(B), respectively, then
ilarities, respectively. Reflections can be included \d(A)-d(B)\<2SH{A,B).
by simply running the algorithm a second time with
a reflected copy of A. Proof: This holds because B is contained in the
These algorithms are simpler than the ones for ^-neighborhood of A and vice versa. EQ
finding the optimal solutions, since after Step 1 the Proof of Theorem 1: We prove only (c) which
matchings are restricted to ones leaving the refer- implicitly contains the proofs for (a) and (b). Con-
ence point invariant. In d dimensions this elimi- sider an optimal similarity transformation 5opt- It
nates d degrees of freedom. The qualities and run- can be written as 5opt = ropt o Topt, where Topt
ning times of these algorithms are as follows: a rigid motion and ropt is a homothety with ra-
tio a'. Let 6 be the optimal Hausdorff-distance
Theorem 1 Suppose that we can determine a ref-
8 = SH(A,Sopt(B)). Then
erence point of quality c for the sets of transfor-
mations T in the Algorithms T, R, and S in linear \\s(A) - s{Sopt(B))\\ < cS.
time. In the case of similarity transformations also
Let t be the translation by s(A) - s(Sopt(B)); then
assume that s(A) always lies within the convex hull
S = to Sopt is a similarity transformation mapping
conv(A).
s(B) onto s(A) and
(a) Algorithm T finds a pseudooptimal matching
(1) SH{A,S(B))<(c+l)S.
for translations with loss factor a = c + 1.
Write S as S = f of, where f a rigid motion
(b) Algorithm R finds a pseudooptimal matching
mapping s(B) onto s(A) and r is a homothety with
for rigid motions with loss factor a = c + 1.
center s(A) and ratio a'. Let a = d(A)/d(B) as in
(c) Algorithm S finds a pseudooptimal matching Algorithm S, r the homothety with center s(A) and
for similarity transformations with loss factor ratio a, and S = r o T. Then
a = c + 3. (2) SH(A,S(B)) < SH(A,S(B))+SH(S(B),S(B))
In the plane, the running times for two sets of Now,
n and m points and line segments are 0((n +
m) log(n+m)) for Algorithm T and 0 (nm log(nm) (3) 6H(S(B),S(B)) = SH (f(f(5)), r(f(B)))
log* (nm)) for Algorithms R and S. In three dimen-
sions, where A and B are sets of triangles, the < (a' - a)d(f(B)) , by Lemma 2
running times become 0(mn) for Algorithm T and
= \(a' - a)d(B)\ = \a'd(B) - d(A)\
0((nm)3H(n,m)) for Algorithms R and S. Here
H(n,m) is the time to compute the Hausdorff dis- = \d(Sopt(B))-d(A)\,
tance. (since a' was the ratio of 5opt)
2 2
Note that an upper bound of 0({n m + nm ) <2-SH(Sopt(B),A) = 26,
log2(nm)) for H(n,m) is known [AG].
by Lemma 3. From (1), (2), and (3) we have
For the proof of the theorem we need the fol-
lowing lemmas, which can be shown by elementary (4) 6H(A,S(B))<(c+3)6
geometrical considerations.
for a similarity transformation S composed of a
d rigid motion that maps s(B) onto s(A) and a ho-
Lemma 2 Let B C K be a compact set with di-
ameter d(B), and let p be a point in its convex hull mothety with center s(A) and ratio a. Since Algo-
conv(B). Let TX,T2 be homotheties (scalings) with rithm S finds the optimum among these similarity
center p and ratios (scaling factors) ax and a2, re- transformations the bound (4) holds for it, as well.
spectively. Then For the time bound we observe that Step 1 can
be done in linear time, and Step 2 in 0{n\o%n +
SH{Ti(B),T2(B))<\(ai-a2)d(B)\. mlogm). (In three dimensions, the diameters can

87
B5

Figure 1: s(As) = (1/3,0), s(B6) = (1/2,0), where s is either the center of the smallest enclosing ellipse
or the centroid of the figure. This can be seen by applying an affine transformation which maps As to an
equilateral triangle or Bs to a square.

be computed trivially in 0(n2 + m2) time.) Step 3, Figure 1, for example, shows As, Bs for cases b)
finding the optimal matching under rotations, can and d). In [ABB] also a positive example of a refer-
be done in time 0 (nm log(nm) log* (nm)) in the ence point for rigid motions in two dimensions was
plane by the algorithm of [ABB], whose analysis given: the centroid of the boundary of the convex
relies on Davenport-Schinzel sequences. This algo- hull. It was shown that this reference point is of
rithm expbcitly computes the Hausdorff-distance, quality at most 4ir + 3 « 15.57. Here, we will give
so Step 4 is for free. In 3-space, we have rotations a reference point which works even for similarity
in E3 around a fixed center, which is an optimal transformations, is easy to compute, can be gener-
matching problem with 2 degrees of freedom. It alized to higher dimensions, and whose quality is
can be solved in time 0((nm)3H(n,m)) by meth- 4/TT « 1.27.
ods of [ABB], a First we observe that we can without loss of gen-
erality restrict our attention to convex figures. In
fact, in [ABB] it was shown that for any two com-
3 The Steiner Point pact sets A, B:

The previous section would be useless if it were not 8H(conv(A), conv(B)) < 8H(A,B).
possible to find suitable reference points. In [ABB] From that it follows easily that a reference point for
it was observed that in the two-dimensional case the convex hull of a compact set A is a reference
the point s(A) = (xmax, ymax), where xmax and ymax point for A, as well.
are the maximal x- and y-coordinates of points in Our candidate for a reference point is the so-
A. is a reference point of quality A/2 for transla- called Steiner point, which has been investigated
tions. intensively in the field of convex geometry [G,S,
For rigid motions the situation is not as easy. Seh].
We will first list a few points that come to mind
Definition 3 We denote by Bd the d-dimensional
but turn out not to be reference points. In fact,
unit ball and by Sd~l its boundary, the (d — 1)-
for arbitrary small 8 > 0, we can construct figures
dimensional unit sphere in Kd.
As, Bs for which 8H(AS, B6) < 8, but \\s(As) -
Let A be a convex body (convex and compact
s(Bs)\\ is not in 0(8) or does not even converge to
subset) in Rd. The support function hA: Rd —> K
0 for 8 —> 0. Some of these counterexamples are
of A is given by
from [B], some are new:
hA(u) = max (a, u)
s(A) is the centroid of the \\s(As) - s(Bs)\\
a) vertices of the convex hull 12(1) (see Figure 2).
b) convex hull ' "(1) The Steiner point s(A) of A is defined as
c) smallest enclosing circle si(Vs)
d
d) smallest enclosing ebipse (2(1) 8(A) hA(u)u düj(u),
e) smallest enclosing rectangle (2(1) Vol(5 d-r
Sd-i

88
Figure 2: The support functions hA (u), hB (u) of two convex bodies A,B.

where doj(u) is the surface element of Sd~l. d


< j(+6)(u,e)du(u)
For a non-convex compact set A G Kd, we define Vol(Sd-1)
■ Sd-i

the support function and hence the Steiner point ud>0


by the same definitions. They coincide with the
support function and the Steiner point of the convex
J(-6)(u,e)du(u)
hull conv(A).
ud<0

For the Steiner point we obtain


= Sd- j (u,e)du>(u)
Vo\(Sd~1)/2
Theorem 4 The Steiner point is a reference point
ud>0
for similarity transformations in arbitrary dimen-
sion d. For d = 2, its quality is A/it, for d = 3 it is The expression in brackets in the last line is noth-
3/2, for arbitrary d it is less than T/2/K ■ y/d+1. ing but the d-th coordinate of the center of gravity
of the upper unit half-sphere. If we compute the
Proof: The equivariance of the Steiner point under integral by projecting away the <i-th coordinate and
similarity transformations is well known [G,Sch]. integrate over (xi,x2,... , «d-i) € Bd~l C Rd_1, a
For the bound on the quality, we observe that for straightforward calculation gives that the surface
two convex bodies A and B, \\hA(u) — hB(u)\\ < element is transformed by
6H(A, B) =: 6 for any u 6 S*'1 (see Figure 2).
Now let p = s(A) - s(B), and consider the du(\i(xux2,... ,xd_ij) ■dxidx2 ■•-dxi_\.
(u,e
inner product of p with an arbitrary unit vec-
tor e. Without loss of generality we assume that Thus the integral turns out to be just the volume
e = (0,... , 0,1) is the unit vector in the d-th co- of Bd~1, and we get the following bound on (p, e):
ordinate direction.
(p, e) < Sd- ..,/„,d 1., ,_ = 62a ■
2 /

(p,e) = (s(A)-s(B),e) Vol(5 - )/2 rf7rd/2/r (<J±2)

(hA(u)-hB(u))(u,e)duj(u) _2_ T(*?)


Vol(5 d-v 6-
Sd-i
V5F'r(^)'

89
using the formulas for the volume and surface area normal to the hyperplanes meeting at v (the nor-
of higher-dimensional balls and spheres. This last malized exterior angle at v). (See Figure 4 for a
expression is a bound on the length of p since e two-dimensional example.)
was in fact an arbitrary unit vector and therefore
can be substituted by p/||p||. The values F(3/2) = For smooth convex bodies, the Steiner point can al-
V5F/2, r(2) = 1, and T(5/2) = 30F/4 give the so be defined as the centroid of a non-uniform mass
claimed quality bounds for d = 2 and d = 3. The distribution on the boundary, where the density is
quotient of the two F-functions is between \fd/2 the (Gaussian) curvature.
and \/(d+ l)/2, and this gives the general bound.
s
From this proof one can see how to construct p"
an example showing that the bound cannot be
improved: S"'1 must be divided into two half-
spheres, and hA(u) — hB(u) will ideally always be
equal to +6 or —S, depending on the half-sphere in
which u lies. Figure 3 shows two two-dimensional

""••C?

Figure 4: The weight of vertex v is ^.

Combining Theorems 1, 4, and 5 we get:

Theorem 6 Let A and B be sets of n and m line


segments in d = 2 dimensions or n and m triangles
Figure 3: ||s(A«) - s(Bs)\\ is close to 4/ir ■ 8. in d = 3 dimensions. Then pseudooptimal match-
ings can be found for A and B applying the cor-
point sets A6 and Be. As is just a circle of radius r, responding algorithms of Section 2 as indicated in
and B6 consists of a "distorted" circle and an ad- the following table.
ditional point. If we allow to apply any similarity
to Bs in order to minimize the Hausdorff distance T running time loss factor
from As, the optimal position is as shown in Fig-
translations
ure 3, and the Hausdorff distance is S. The distance
d= 2 0 ((n + m) log(n + m)) 4/TT + I
of the Steiner point s(Bs) from the center s(Ae) of
the circle can be calculated as 2/7T • vV^arccos
Y ^TT,
d= 3 0(H(n,m)) 2.5
' r+6'
which approaches 4/TT ■ 6 as r goes to oo. If one rigid motions
lets the two Steiner points coincide, the Hausdorff d = 2 0 (nm log(nm) log* (nm)) 4/TT + I
distance rises by this amount, showing that 1 + 4/7T d= 3 0((nmfH(n,m)) 2.5
is indeed the loss factor of Algorithm T. Since similarities
As is rotation-symmetric, this holds also for Algo- d = 2 0 (nm log(ram) log* (nm)) 4/TT+ 3
rithm R. The above construction generalizes easily
d= 3 0((nm)3H(n,m)) 4.5
to higher dimensions.
The following theorem is well-known [G,S].
Proof: For the proof note that the Steiner point
Theorem 5 The Steiner point of a convex poly- for a convex polygon or polytope can be comput-
tope is the weighted sum of its vertices, where the ed in linear time because of Theorem 5, after the
weight of vertex v is that fraction of the surface of convex hulls have been constructed in O(?ilogn +
the unit sphere that lies between the unit vectors mlogm) time. The bound of 0(H(n,m)) (as in

90
6H(K,C) = 3 6H(A,K) = 2

Figure 5: A lower bound for the quality of a reference point.

Theorem 1) for translations in three dimensions arcs of radii 2 and 8 and opening angles of 57r/3 and
comes from the final computation of the Hausdorff 7r/3, respectively, and with an additional point in-
distance. Just finding the pseudooptimal transla- side; and finally an equilateral triangle A = q\q2qz
tion takes only O(nlogn + ralogm) time. EQ with side length 10. The optimal matching between
C and K and between K and A is shown in the
lower part of Figure 5. It is obtained by super-
4 Lower Bounds imposing the points o and p (marked by crosses)
or the points p and qi, respectively. The dimen-
For translations in two dimensions the following sions given in the lower middle part of Figure 5
lower bound on the quality of reference points can also exhibit the position of the extra point in the
be shown: keyhole K.
Theorem 7 The quality c of any reference point Let us first assume that the reference point s(C)
for translations (Algorithm T) in two (or higher) of the circle is its center o. Since SH(C,K) = 3,
dimensions cannot be better (i.e., smaller) than the reference point s(K) of K must lie in a circle
y/Äß- of radius 3c around p. Similarly, s(A) must he in
a circle of radius 2c around s(K), i.e., in a circle
Proof: We consider three point sets (see the upper of radius 5c around q1. If we turn K by 120° in
part of Figure 5): A circle C with center o and ra- both ways, we can conclude in a similar way that
dius 5; a keyhole-shaped figure K with two circular s(A) must he in circles of radius 5c around q2 and

91
around q3. By equivariance with respect to trans- [CGHKKK] P. P. CHEW, M. T. GOODRICH,
lations, the triangle A has only a single reference D. P. HUTTENLOCHER, K. KEDEM, J.
point, and therefore the three circles must inter- M. KLEINBERG, D. KRAVETS, Geometrie
sect, as shown in the lower right part of Figure 5. pattern matching under Euclidean motion,
This means that c must be at least A/4/3 « 1.155. Proc. 5th Canadian Conference on Compu-
If the reference point s(C) is not the center o, the tational Geometry, 1993, pp. 151-156.
only difference is that the centers of the final three
circles will be translated by the respective amount. [CKS] P. P. CHEW, K. KEDEM, S. SCHIRRA, On
a chracteristic points and approximate deci-
sion algorithms for Hausdorff distance, Re-
The above construction can be generalized to d port, Max-Planck-Institut für Informatik,
dimensions to give a lower bound of y/2d/(d+ 1) Saarbrücken, 1993.
on the quality c.
Comparing A/4/3 « 1.155 with the upper bound [G] B. GRüNBAUM, Convex Polytopes, Wiley
of 4/7T « 1.27 for the Steiner point, we note that & Sons, 1967.
the gap is quite small. We are quite sure that the
[H] P. J. HEFFERNAN, Generalized approxi-
lower bound can be improved, and we believe that
mate algorithms for point set congruence,
the Steiner point is the optimal reference point with
Proc. 3rd Workshop on Algorithms and Da-
the best quality guarantee.
ta Structures, Springer Lecture Notes in
Computer Science, Vol. 709, 1993, pp. 373-
5 Acknowledgements 384.

[HS] P. J. HEFFERNAN, S. SCHIRRA, Approxi-


We would like to thank the following colleagues
mate decision algorithms for point set con-
who in many discussions contributed ideas to this
gruence, Proc. 8th Annu. Symp. on Com-
research: Franz Aurenhammer, Stefan Felsner, Mi-
putational Geometry, 1992, pp. 93-101.
chael Godau, Emo Welzl, Lorenz Wernisch, and
Gerhard Wöginger. [HK] D. P. HUTTENLOCHER, K. KEDEM, Com-
puting the Minimum Hausdorff distance for
References point sets under translation, Proc. 6th An-
nual Symp. on Computational Geometry,
[ABB] H. ALT, B. BEHRENDS, J. BLöMER, Ap- 1990, pp. 340-349.
proximate matching of polygonal shapes,
[HKS] D. P. HUTTENLOCHER, K. KEDEM, M.
Proceedings 7th Annual Symposium on
SHARIR, The upper envelope of Voronoi
Computational Geometry, 1991, pp. 186-
surfaces and its applications, Discrete and
193.
Computational Geometry, 9 (1993), 267-
[AG] H. ALT, M. GODAU, Computing the Haus- 291.
dorff-distance in Higher Dimensions, in [HKR] D. P. HUTTENLOCHER, G. A. KLANDER-
preparation. MAN, W. J. RUCKLIDGE, Comparing im-
ages using the Hausdorff-distance, IEEE
[AST] P. J. AGARWAL, M. SHARIR, S. TOLE-
Transactions on Pattern Analysis and Ma-
DO, Applications of parametric searching
chine Intelligence 15 (1993), 850-863.
in geometric optimization, Proc. 3rd ACM-
SIAM Sympos. Discrete Algorithms, 1992, [S] G. C. SHEPHARD, The Steiner point of a
pp. 72-82. convex polytope, Canadian J. Math., 18
(1966), 1294-1300.
[B] B. BEHRENDS, "Algorithmen zur Erken-
nung der e-Kongruenz von Punktmengen [Sch] R. SCHNEIDER, Krümmungsschwerpunkte
und Polygonen", Diplomarbeit, FB Math- konvexer Körper, Abh. Math. Sem. Ham-
ematik, Freie Universität Berlin, 1990. burg 37 (1972), 112-132.

92
Piecewise-Linear Interpolation between Polygonal Slices'

Gill Barequet* Micha Sharir t

rata. These cross-sections, hereafter called slices, are


Abstract the basis for interpolating the boundary surface of the
organ. The interpolated object can then be displayed
In this paper we present a new technique for piecewise-
linear surface reconstruction from a series of parallel in graphics applications, or (more recently) even manu-
polygonal cross-sections. This is an important prob- factured by an NC (Numerically Controlled) or an RP
lem in medical imaging, surface reconstruction from (Rapid Prototyping) machine. Another motivation for
topographic data, and other applications. We reduce this problem is the non-destructive digitization of ob-
the problem, as in most previous works, to a series ot jects: after an object is scanned by an echo-graphic or
problems of piecewise-linear interpolation between each an X-ray apparatus, the obtained slices are used for the
pair of successive slices. Our algorithm uses a partial reconstruction of the original object. Yet another mo-
curve matching technique for matching parts of the con- tivation is the reconstruction of a 3-dimensional model
tours, an optimal triangulation of 3-D polygons for re- of a terrain from topographic elevation contours.
solving the unmatched parts, and a minimum spanning Many solutions were suggested for the pure raster in-
tree heuristic for interpolating between non simply con- terpolation. These usually handle two raster images
nected regions. Unlike previous attempts at solving this where each pixel is either white or black, or assigned
problem, our algorithm seems to handle successfully any a grey-level taken from a fixed range. The interpola-
kind of data. It allows multiple contours m each slice, tion produces one or more intermediate raster images,
with any hierarchy of contour nesting, and avoids the which smoothly and locally turn the first image into the
introduction of counter-intuitive bridges between con- second one. Then, the bounding surface is detected us-
tours, proposed in some earlier papers to handle inter- ing other methods, such as edge detection techniques,
polation between multiply connected regions. Experi- for identifying places of transition from the inside to
mental results on various complex examples, involving the outside of the object. In the grey level case, these
actual medical imaging data, are presented, and show methods include some thresholding mechanism which
the good and robust performance of our algorithm. decides which levels are 'inside' the object and which
are not. Cline et al. [6] attempted to convert directly
Keywords: surface reconstruction, tiling, surface fit-
ting, branching surfaces, slice interpolation, triangula- the voxel data into a polyhedral surface, suggesting the
marching cubes technique, which produced very small
tion, dynamic programming, geometric hashing, curve triangles whose size was roughly the same as that of the
matching, polyhedra. input voxels.
Many other solutions, including the approach taken
in this paper, assume that the interpolation is preceded
1 Introduction by an edge-detection process, which is invoked for each
of the slices. Thus, each slice is then assumed to be rep-
The problem of reconstructing the boundary of a solid resented by a hierarchy of non-crossing contours, each
object from a series of parallelplanar cross-sections has being a closed simple Jordan curve, which represent the
attracted much attention in the literature during the boundaries between "material" and "non-material ar-
past two decades. The mam motivation for this prob- eas; in general, the depth and breadth of this hierarchy
lem comes from medical imaging applications, where is not restricted, and a contour may enclose any num-
cross-sections of human organs, such as bones, tumors ber of other contours, which themselves may enclose
and tissues, are obtained by CT (Computerized Tomog- other contours, and so on. In practice, each contour is
raphy) or MRI (Magnetic Resonance Imaging) appa- given as a discrete circular sequence of points along it.
and we can thus regard it as a simple closed polygonal
* Work on this paper by both authors has been supported by curve, whose vertices are the given points. Finally, we
a grant from the G.I.F., the German-Israeli Foundation for Sci- may also assume that the exterior, unbounded region in
entific Research and Development. Work on this paper by the each planar slice represents "non-material" (the model
second author has also been supported by National Science foun-
dation Grant CCR-91-22103, and by grants from the U.S .-Israeli is assumed to be bounded).
Binational Science Foundation, and the Israel Science fund ad- Thus the problem that we face is: Given a series of
ministered by the Israeli Academy of Sciences.
'School of Mathematical Sciences, Tel-Aviv University, Tel- parallel planar slices (which we will assume to be par-
Aviv 69978, Israel, and Algotec Systems Ltd., Raanana, Israel. allel to the zy-plane), each consisting of a collection
t School of Mathematical Sciences, Tel-Aviv University, Tel- of non-crossing, but possibly nested, closed and simple
Aviv 69978, Israel, and Courant Institute of Mathematical Sci- polygonal curves, with the above properties, we want
ences, New Vork University, New York, NY 10012, USA
to reconstruct a polyhedral solid model whose cross
sections along the given planes coincide with the in-
Permission to copy without fee ail or part of this material is put slices. A natural simplification of the problem, also
granted provided that the copies are not made or distributed for taken in most earlier works, is to consider only a single
direct commercial advantage, the ACM copyright notice and the pair of successive parallel slices, and to construct a solid
title of the publication and its date appear, and notice is given model within the layer delimited by the planes of the
that copying is by permission of the Association of Computing slices, which interpolates between the given slices. The
Machinery. To copy otherwise, or to republish, requires a fee
union (or, rather, concatenation) of these models will
and/or specific permission.
give us a solution model for the full problem.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA Before continuing, we should remark that the solution
© 1994 ACM 0-89791-648-4/94/0006..$3.50 is not uniquely defined, and the measure of 'goodness'

93
contours. Boissonnat mentioned three typical examples
where his standard method failed to produce good re-
sults, thus requiring special treatment. The first exam-
ple contained two overlapping contours but with con-
siderable differences in their geometry. The second ex-
ample consisted of two similar contours, where one of
them also contained a hole polygon. And the last ex-
ample showed a branching problem but without contour
overlaps. Our algorithm handles successfully (and eas-
ily) all these 'bad' examples. Boissonnat suggested a
correction scheme, which either changed the geometry
(a) Wrap-around (b) Forced contour (c) Sapaxata treatment of one of the slices, or constructed one or two interme-
tiling association of non-overlapping
contours diate slices between the original ones. These idea were
further developed by Boissonnat and Geiger ([4], [11]).
Figure 1: Contour association and tiling There have been a few other recent works that also
attempted to handle the more general cases; these are
by Kehtarnavaz and De Figueiredo [17], Kehtarnavaz.
Simar and De Figueiredo [18], Ekoule, Peyrin and Odet
of a proposed solution is rather subjective and intu-
itive. Of course, if each of the two slices consists of a [8], Meyers, Skinner and Sloan [22], and by Welzl and
single contour, and these contours roughly 'sit above Wolfers [30]. However, all these treatments suffered
each other', then we expect the solution to be a single from a variety of problems, treated only certain re-
'drum-like' polytope whose boundary consists of a cir- stricted cases, and worked only in favorable situations
cular sequence of triangles 'wrapping around' the two where the two slices closely resemble each other.
contours; see Figure 1(a). However, even in the simple Finally, Gitlin, O'Rourke and Subramanian [12] prove
case of one contour in each slice, if the zy-projections of that it is not always possible to find an interpolating
the two contours are far away from each other, it is not polyhedron between two polygons, that lie in two par-
clear which is a better solution: to construct a highly allel planes. That is, any attempted interpolation pro-
slanted 'pipe' that connects between these contours (as duces a self-intersecting surface. This result holds onlv
in Figure 1(b)), or to regard the lower contour as the when the interpolating triangles are all assumed to con-
top cover of some pillar-like solid, and the upper con- nect between the two polygons vertices, i.e. to have two
vertices taken from one polygon and the third from the
tour as the bottom cover of another pillar-like solid (as other polygon. We do not assume this in our approach,
in Figure 1(c)). The choice of a solution can become and we indeed get a non-intersecting interpolation when
much more arbitrary in more involved cases. we apply our algorithm on their example.
We first briefly review the fairly extensive literature Two comprehensive reviews of many of the works on
on this problem. Most of the earlier works only stud- reconstructing 3D objects from cross-sections are given
ied the variant where each slice contains only one con- by Schumaker [23] and by Hagen, Müller and Nielson
tour. In the sequel we denote it as the one-to-one case, [14]. The first review is not restricted to piecewise-linear
as opposed to the one-to-many and the many-to-many
cases. These studies either sought a global optimization constructions based on polygonal slices, but also refers
of some objective function or settled with a local tiling- to parametric and tensor representations of contours,
advancing rule, after the tiling starting points at the two and describes volumetric and surface approaches.
contours were somehow determined, e.g. the closest pair We propose a new approach to the interpolation prob-
of vertices between the contours. lem. Our algorithm handles well slices with multiple
In the full version we review these works in more de- contours, ancTdoes not rely on any resemblance between
tail, but since they are all inferior to our solution, in the slices. We accept slices which contain anv num-
that they cannot handle arbitrary data, we omit this ber of contours, arbitrarily different in their geometries.
review here. These works are by Keppel [19], Fuchs et The zy-projections of contours of different slices mav
arbitrarily overlap; we do not make any distinction in
al. [9], Sloan and Painter [28], Cook et al. [7], Chris- the treatment of contours which fully overlap, partiallv
tiansen and Sederberg [5], Shantz [25], Batnitzky et al. overlap or do not overlap at all. Many of the previous
[2]. Sloan and Hrechanyk [26], Ganapathy and Dennehy works, such as [19], [9], [26] and [10], either prohibit
[10], and by Wang and Aggarwal [29]. A good survey on the creation of triangles in the same slice, or specifi-
all the works cited so far is given by Sloan and Painter cally define steps where this action is allowed. We do
[27]. They decompose each method into its building not make a distinction between triangles which connect
the two slices and those which totally lie within a sin-
blocks, and compared the various methods accordingly. gle slice. Generally speaking, our algorithm is based on
They also describe a testbed for evaluating and com- an analysis of the resemblance between the two slices.
paring these techniques.
Thus, we separately treat similar contour portions that
Zyda, Jones and Hogan [32] made an attempt to han- are matched between the two slices, and then treat the
dle the many-to-many case, but their method could not remaining portions that do not match. We refrain from
handle any branching cases, and produced unsatisfac- creating artificial bridges between contours that might
tory results for partially overlapping contours, as in Fig- conflict with the geometry of the other slice, as already
ure 4. Other limitations involved specific geometries. noted in [25] and others. In the only case where we con-
However, they suggested solutions for these limitations, struct such bridges, they are guaranteed not to conflict
which might help in certain cases, but which required with the geometry of the other slice, i.e. not to intersect
some interaction with the user.
the projection of any other contour. We do not have
Boissonnat [3] presented a totally different approach. to introduce intermediate slices. To recap, our algo-
He constructed the Delaunay triangulation for each rithm appears to overcome all the technical difficulties
slice, projected one triangulation onto the other, and that hampered the performance of previous solutions,
obtained a collection of tetrahedra, aiming to maximize it treats data in full generality, and the extensive ex-
the sum of their volumes. This was a considerable step perimentation that we have conducted indicates that it
towards handling the case where each slice has multiple performs very well on complicated large-size data. We

94
one given above). The later sections describe in detail
certain phases of the algorithm. Section 3 describes the
matching of contour portions, and Section 4 describes
the actual surface reconstruction. In Section 5 we briefly
analyze the complexity of the algorithm, and present
experimental results. We end in Section 6 with some
concluding remarks.

Figure 2: Matching contour portions


2 Overview of the Algorithm
The input to the algorithm, as described in the Intro-
duction, is a pair of parallel planar slices parallel to the
regard our algorithm as a significant step in the solution xy-plane, each slice consisting of a list of closed and
of this problem. For an illustration of the performance simple polygonal contours, which do not intersect each
of our algorithm on real-life examples, see Figures 17 other. The containment hierarchy of the contours may
and 18. be omitted; in this case we compute it ourselves, using
Here is a brief overview of our algorithm. We first a simple line-sweep technique. Contours of even nest-
match similar contour portions between the two slices ing level (starting at 0, which labels external contours)
(e.g. the upper arcs pq and p'q' in Figure 2). Then we are such that their interior, in a sufficiently small neigh-
'stitch' (or 'tile') each pair of matched contour portions borhood of the contour, is the "material", and contours
bv a sequence of adjacent triangles forming a 'band' be- of odd level are those whose interior, sufficiently near
tween the portions. With some care, if we take the union them, is the "non-material". We orient each contour so
of the original contours and new bands, and cancel out that, when viewing the contour from above, the mate-
duplicate edges, we obtain a collection of closed spatial rial lies to the right of the contour (thus all even-level
polygonal curves, each of which may be composed of contours are oriented in the clockwise direction, when
pieces of contours on both slices and of some edges of viewed from above, and all odd-level contours are ori-
the connecting triangles. Moreover our matching pro- ented in the counterclockwise direction). If necessary,
cedure essentially guarantees that the ay-projections of
these curves are pairwise disjoint, although they may we re-orient the contours in these consistent directions.
be nested within each other. If no nesting occurs, we We remark that we need to compute the contour hierar-
simply triangulate each of these spatial polygons, us- chy only to obtain the consistent orientation of contours:
ing a simple dynamic programming approach, which the hierarchy itself is not used in the algorithm.
roughly aims to minimize the total area of the triangula- Our proposed algorithm consists of the following
tion. If nesting occurs, we take one polygon P with all steps:
polygons Pi, . . .,Pk whose xy-proiections are directly 1. Data acquisition:
nested within that of P, and apply a minimum span- (a) Orient all the contours in each slice in consistent
ning tree procedure that introduces edges connecting directions, as explained above. If the input does not
between these polygons and yielding an zy-projection include this information, compute the contour nesting
which is simply connected, so we can then proceed to hierarchy in each slice, and use it to obtain the desired
triangulate the"resulting polygonal curvet as above. See orientations.
Figure 3 for an illustration. More details of all these 2. Matching contour portions:
steps will be given later in the paper. (a) Discretize each contour polygon into a cyclic se-
For the purpose of identifying matching portions of
the contours we use a partial curve matching technique, quence of vertices, so that the arc length between each
pair of consecutive vertices is equal to some (small)
which was first suggested by Kalvin et al. [16] and
given parameter.
by Schwartz and Sharir [24]. This technique, which
(b) Vote for contour matches. Each pair of distinct ver-
uses the so-called Geometric Hashing method, originally
solved the following curve matching problem: Given two tices of the discretized contours, one on each slice, whose
mutual horizontal distance is below some threshold pa-
curves in the plane, such that one is a (slight deforma- rameter, contributes one vote. The vote is for the match
tion of a) proper subcurve of the other, find the trans- between these two contours with the appropriate shift,
lation and rotation of the subcurve that yields the best which maps one of these vertices to the other.
least-squares fit to the appropriate portion of the longer (c) Transform the resulting votes into a collection of
curve. candidates of partial contour matches.
This technique was extended and used in computer 3. Reconstructing the surface:
vision for automatic identification of partially obscured
objects in two or three dimensions, an important prob- (a) Stitch together each pair of contour portions that
lem in robotics applications of computer vision, which have been matched in the above step, by adding trian-
has attracted much attention; see Hong and Wolfson gles which connect between these portions. The new
[15], Wolfson [31], and Kishon, Hastie and Wolfson [20]. triangles are oriented consistently with the contours.
A simplified variant of this technique has recently (b) Combine the remaining contour edges into spatial
been used by Barequet and Sharir [1] for the totally cycles (denoted as clefts), obtained by taking the union
different problem of detecting and repairing gaps in the of the contour edges in both slices and of the edges of
boundary of a polyhedron, a problem which often arises the stitching triangles, and by canceling out duplicate,
in the creation of polyhedral approximations of CAD oppositely-oriented edges. When projected onto the xy-
plane, these cycles do not intersect each other. Find
models. In the variant used in [1], as well as the one their nesting hierarchy, and, for each cleft C. construct,
used in this paper, no motion of one curve relative to if necessary, a system of straight 'bridges' that connect
the other is allowed, so the technique becomes consid- between C and its holes (immediate children in the hi-
erably simpler.
The paper is organized as follows. In Section 2 we give erarchy), so as to turn them into a single cycle, which
a more precise definition of the problem and present now replaces the cleft C.
an overview of the algorithm (more detailed than the (c) Triangulate the resulting 3-D clefts, using a 3-D min-

95
slice. These matches aim to detect regions of simi-
larity between the boundaries of the interpolating ob-
ject along the two slices. Naturally, contour portions
which are similar in the two slices must have similar se-
quences of footprints. Thus, our next goal is to search
for pairs of sufficiently long subsequences that closely
match each other. In our approach, two subsequences
(a) Original slices (b) Tiled matches (pi,... ,pi+i-i) and (qj,. .., qj+t-i) are said to closely
match each other, if, for some chosen parameter t > 0.
the number of indices k for which ||pi+fc — 9j+fc|| < -
is sufficiently close to £. (Here the norm || • || is the
Euclidean distance between the ^-projections of the
points.) We perform the following voting process, where
votes are given to good point-to-point matches.
(c) Remaining clefts (d) Simplified clefts The contours are given as cyclic ordered sequences
of vertices, and we break each of them arbitrarily to
make it into a linear sequence. All the vertices of
the lower slice are preprocessed for range-searching, so
that, for each vertex v of the upper slice, we can ef-
ficiently locate all the vertices of the lower slice that
lie in some e-neighborhood of (the zy-projections of) v.
We have used a simple heuristic projection method for
the range searching, that reduces the search to a pair
(e) Triangulated clefts (f) The final of 1-dimensional searches; this may be inefficient in the
reconstruction
worst case, but works very well in practice.
The positions along a contour sequence c, whose
Figure 3: The different steps of our algorithm length is £c, are numbered from 0 to £c — 1. Assume
that the querying vertex v is in position i of contour
sequence c\. Then, each vertex retrieved by the query,
which is in position j in contour sequence C2, contributes
imum area triangulation technique. a vote for the match between contours c\ and C2 with a
The various steps of the algorithm are illustrated in shift equal to (j — i) (mod £C2).
Figure 3. Figure 3(a) shows a pair of slices in a branch- Obviously, matches between long portions of contours
ing situation. The lower slice contains one contour (de- are reflected by a large number of votes for the appro-
noted by S\), and the upper slice contains three con- priate shift between the matching contours. We thus
tours (denoted by S2). Figure 3(b) shows the tiling of collect the shifts with a large number of votes, identify
the three matches found between these two slices. Fig- (roughly) the starting and ending points of the corre-
ure 3(c) shows the remaining clefts, which form a shal- sponding match, and possibly also remove (small) por-
low hierarchy of nested polygons. Figure 3(d) shows tions of the matches, near their endpoints. which are
the clefts after the hole elimination step, and their also shared by other matches.
Note that this procedure will only match contour por-
minimum-area triangulations are shown in Figure 3(e). tions that are consistently oriented. This is important,
The final surface reconstruction is shown in Figure 3(f). since it guarantees that the material region lies on the
same side of the two contours, thus implying that if
we stitch the gap between these two contours, we get
3 Matching Contour Portions a proper portion of the boundary of a possible inter-
polating solid. Also note that the e parameter for the
range-searching queries is not a function of the input.
For lack of space, we omit here a detailed description It is rather our a priori estimation of the physical size
of the data acquisition step, which was already briefly of the difference between similar contour portions of the
described above, and is anyway fairly straightforward. two slices.
In some cases small portions of the contours are in-
cluded in more than one candidate match. This usu-
3.1 Contour Discretization ally happens at the connection between two different
matches, involving the same contour on one slice and
Each contour polygon is refined and discretized into a different contours on the other. We simply eliminate
cyclic sequence of points. This is done by choosing some those portions common to more than one significant
sufficiently small arc length parameter s, and by gen- candidate match.
erating equally-spaced points, at distance s apart from
each other (along the polygon boundary). We need to
choose s so that it is much smaller than (a) the length of 3.3 Accepting Match Candidates
any original edge of any contour, and (b) the minimum
straight distance between any pair of contour points Each match is given a score. The score may also reflect,
which lie on different contours (on the same slice) or in addition to the number of votes for the appropriate
lie on the same contour and their distance along the shift, other quality measures (such as the closeness of
contour is sufficiently large. the vertices on the two matching contour portions). Our
setting of the scoring function is described in Section 5.
A crucial property of the matches, which we have to
3.2 Voting for Contour Matches achieve when tuning the parameters which control the
detection of matches, is that every intersection between
We first try to match pairs of portions of contours, the zy-projections of any pair of contours, one from each
where each portion in a pair belongs to a different slice, will lead to a match between the corresponding

96
Figure 4: Intersecting contours with no long matching
portions Figure 5: Tiling a match

contours, although it might be very short. This will en-


sure that there will be at least one match between each
pair of overlapping contours (namely, contours with in-
tersecting zy-projections), even if the relative amount contour 2
of overlap is very small. The reason for this is given contour 1
shortly below. (a) original contours (b) Alter matching and tiling
We achieve this by accepting very short match can-
didates (even of length 2 or 3), as long as their quality
fits our bounds. We have to make sure that the dis- Figure 6: A short match and the clefts near an inter-
cretization parameter is sufficiently small with respect section of contours
to the voting threshold and with respect to the smallest
contour feature size, as described above, in order not
to miss contour intersections. An extreme example is
shown in Figure 4, where four short matches are indeed of two sorted lists, and turns out to produce reason-
ably looking triangulated boundary patches between the
found between the two contours. matched contour portions. Figure 5 shows such a tri-
angulation. Alternative advancing rules were described
by Christiansen and Sederberg [5], and by Ganapathy
4 Reconstructing the Surface and Dennehy [10].
4.1 Stitching the Matches
4.2 Filling the Clefts
Each match consists of two directed polygonal chains,
whose xy-projections are very close to each other. We After tiling the matching contour portions, we remain
arbitrarily choose one end of the match, and 'merge' with the unmatched portions. These, combined with
the two chains as if they were sorted lists of numbers. the extreme edges of the tiling sequences, form a collec-
In each step of the merge we have pointers to the cur- tion of closed 3-D polygons, which we refer to as clefts.
rent vertices, u and v, in the two chains, and make a Finding these clefts is straightforward. First, recall that
decision as to which chain should be advanced, say v ad- we have already inverted the orientation of all contour
vances to a new vertex w. Then we add the new triangle polygons of the lower slice. Consider the contour poly-
Auvw to the boundary of the constructed polyhedron, gons of the two slices (the inverted lower slice and the
and advance the current vertex (from v to w) along the upper slice), as well as the tiling triangles, as the for-
appropriate chain. When we reach the last vertex of mal sum of their directed edges, and add up all these
one chain, we may further advance only the other one.
This process terminates when we reach the last vertices polygons, with the convention that e + (—e) = 0. After
of both chains. these cancellations, the resulting sum consists of all the
The triangles that we create are oriented consistently desired clefts. Since each polygon that participates in
with the contours. To achieve this, we invert the orien- the formal sum is a directed cycle, the resulting sum
tation of all contour polygons of one slice, say the lower is easily seen to represent a collection of pairwise edge-
one, and orient each triangle so that the edge it shares disjoint directed cycles.
with a contour is oriented oppositely to the contour; This collection of 3-D polygonal cleft cycles has the
see Figure 5 for an illustration of the directions of the property that, when projected onto the xy-plane, no
tiling triangles. This orientation guarantees that the two cycles intersect. This is because we have already
reconstructed solid boundary is oriented in a consistent detected all the projected contour intersections in the
manner. matching phase, and because the extreme tiling edges
Several advancing rules were examined, and the fol- in the tnangulation of a match are likely to degenerate
lowing simplest one proved itself the best. Assume or almost degenerate in the projection. This situation
is illustrated in Figure 6. The only way this property
that the current vertices of the two chains are v} and can be violated is when an extreme tiling edge crosses
u? which are followed by v] and respectively. another edge of a contour. For this to happen, either
wl < i"i the extreme edge must be highly slanted, or the con-
Then, if \v}v}^\ + \vht+il ^
i+i\-r\"j \v}v] + n ' i-j^j + il. we ad-
"j +l tour must have very sharp turns. This can be avoided
vance the first chain; otherwise we advance the second by an appropriate fine tuning of the discretization and
chain1. This bears close resemblance to the merging matching threshold parameters, and in any case we did
not face such a situation in all of our comprehensive
'That is, we advance so that the newly added triangle has experiments (which involved fairly complex and rather
smaller perimeter; actually, for program efficiency, we eventually
used the squares of the distances, with equally good results. 'adversary' data). To recap, while in rare, worst-case

97
(a) Original contour (b) Cloft cycle
orientations orientations (a) An acceptable (b) A conflicting
bridge bridge
Figure 7: Cleft orientations
Figure 8: Bridges in simple branching cases

scenarios, projected cleft cycles might intersect, we will


assume in what follows that this does not occur. collection of triangles spanned by the vertices of P. so
The zy-proiections of these cleft polygons might that each edge of P is incident to exactly one triangle,
again form a hierarchy of polygon nesting. We check and all other triangle edges are incident to two trian-
this possibility by invoking again the same line-sweeping gles each), which minimizes the total sum of T over its
procedure used in the data acquisition step. This time,
all the polygons are guaranteed to be correctly oriented. triangles.
For this purpose, we closely follow the dynamic pro-
Figure 7 illustrates this situation. Figure 7(a) shows a
gramming technique of Klincsek [21] for finding a poly-
branching case, where the lower slice contains one con-
tour, and the upper slice contains two contours. Af- gon triangulation in the plane, which minimizes the to-
ter tiling the detected match, inverting the lower slice, tal sum of edge lengths. Let P = (VQ,V1: .... u„_i, v„ =
and canceling out opposite edge occurrences, two nested, v0) be the given polygon. Let Wij (0 < i < j < n - 1)
cleft cycles remain, already oriented consistently, as denote the weight of the best triangulation of the polyg-
shown as Figure 7(b). onal curve (vi,...,Vj,vj+1 = v,). We then apply a
Let C be a cleft whose immediate children in the hier- straightforward dynamic programming approach, which
archy are C\, .. ., Ck ■ We define an undirected weighted initializes each Witi+2 to T(vi, vi+l, vi+2). and then
complete graph G, so that each vertex of G is one of
these k +1 cycles, and the weight of an edge connect- computes each W(i, k), for k - i = 3, 4, .... n - 1. as
ing two cycles is the minimum distance between the mmi<m<k[Wiim + Wmik +T{vi,vm,vk)}. We omit here
^-projections of these cycles. (We assume that our the easy further details. The actual value of T{u, v. w)
contour discretization is dense enough, so that the min- that we have used is a weighted average of several terms,
imum vertex-to-vertex distance, which is what we actu- the most significant one being the area of the triangle;
ally computed, serves as a sufficiently good approxima- see Section 5 for more details.
tion of the actual minimum distance.) We now compute Finally, if the interpolation involves the uppermost or
a minimum spanning tree T of G, and form a bridge be- lowermost slice in the given sequence, we also have to
tween each pair of cycles connected by an edge of T; the add to the reconstructed object boundary the regions
bridge is a straight segment connecting the two nearest of material on that slice, so as to 'close' the volume of
vertices on these cycles. It is easily verified that the that object.
^-projections of the bridges do not cross each other,
and also do not cross the £y-projection of any cycle.
We create two oppositely-oriented copies of each bridge 5 Experimental Results
and add them to the given cycles. This eliminates the
'windows' C\, . . ., Ck and replaces the whole configura- We have implemented the whole algorithm on a Dig-
tion by a single composite, self-touching but otherwise ital DECstation 5000/240 and on a Sun SparcStation
simple polygonal cycle.
II in C. We have experimented with the algorithm
We emphasize that bridge assembly was the most sig- on several data files obtained by CT or MRJ scan-
nificant obstacle in previous works, which used this tool
for reducing a branching situation to the simple one- ners, and obtained very good results in practically all
cases. The input usually consisted of about fifty to
to-one case. That wasTecause a bridge in one slice one hundred cross-sections, from 0.5 mm to 2.0 mm
could conflict with the geometry of the other slice, by
having its projection intersect a contour, as shown in apart. The tuning of the parameters (discretization
Figure 8(b). As noted, we do not face this problem. length and size of neighborhood in the geometric hash-
We note that this procedure is required only in com- ing) was very robust, and large variation of these pa-
plicated cases (few of them are presented in Section 5); rameters produced nearly identical results. We usu-
ally used 1.0 mm as the discretization parameter, and
in most practical instances clefts do not tend to be
nested. In any case, after this hole elimination step, 3.0 mm for the voting threshold (for human organs
we are left with a collection of closed polygonal cleft cy- whose global size was between 5 to 20 cm in all di-
cles, with the property that their ^-projections enclose mensions). We allowed up to two successive point mis-
pairwise-disjomt regions. matches along a match. A point-to-point match con-
Our next goal is to triangulate each cleft cycle. Since tributed the amount of l/(d+ 0.1) to the match score,
many such triangulations are possible, we seek a trian- where d was the xy distance between the two points.
gulation which minimizes the total area of the triangles. We considered only match candidates which received
More precisely, we want to solve the following problem: 4 votes or more and whose scores were above 15.0.
Given a 3-dimensional closed polygonal curve P, and (Our discretization was sufficiently dense so that this
an objective function T defined on all triangles (called choice still captured all contour overlaps.) The objec-
weight in the sequel), find the triangulation of P (i.e., a tive function T for the cleft-triangulation was taken to

98
Figure 9: A synthetic example

Figure 10: A synthetic branching example

(b) Before reconstruction


be 0.85A + 0.05P + 0.10Ä, where A is the area of the
triangle, P is its perimeter, and R is the ratio between
the largest and the smallest of its three edges. All these
parameters were user denned, but modifying them did
not achieve any better results.
We can measure the complexity of the algorithm in
terms of four variables: k, the total number of input
points along the contour edges of two consecutive slices,
n, the total number of points after the arc length dis- (c) After reconstruction
cretization step, £, the number of clefts, and ft, the
size of the biggest cleft (after the hole-elimination step). Figure 11: A synthetic complicated example
Usually, ifc is considerably smaller than n. The number
£ of clefts could be in the worst case as large as 0(fc ),
but in practice £ is smaller than, or at least comparable
with the number of contours c (which is typically much
smaller than k).
Due to lack of space, we do not give here a for-
mal analysis of the complexity of the algorithm. Such
an analysis produces terms that may be very large;
for example, the cleft triangulation step (based on dy-
namic programming) takes 0(£h3) time, which is, the-
oretically, and in complex situations also pragmatically,
the most expensive portion of our algorithm. The en- (a) Before reconstruction
tire algorithm runs on practical instances in average
0((k + 0 \og(k + 0 + n + £h3) time.
Here are some specific examples of the performance
of the algorithm:
Figure 9 shows a simple case, similar to the first prob-
lematic example of Boissonnat [3]. Each slice in this
example contains exactly one contour. The tiled match
appears in white, whereas the triangulated cleft appears
in black. (b) After reconstruction
Figure 10 shows a synthetic branching example,
where the lower slice contains two contours whereas
the upper slice contains only one contour. Two long Figure 12: A simple case
matches were found and tiled by the white trian-
gles. The remaining cleft appears in between the two
matches, and its triangulation appears in black. triangulation appears in black.
Figure 11 shows a more complicated synthetic exam- The next several figures show the typical performance
ple, where the lower slice contains one contour, and the of our algorithm, as observed from its execution on a se-
upper slice contains three contours. Figure 11(a) shows ries of cross-sections of a human jaw bone. Figure 12
a top view of this situation, whereas Figure 11(b) shows shows the reconstructed surface between two slices. The
an isometric view of it. Figure 11(c) shows the surface tiles of the matches appear in white, and the triangula-
reconstruction. The tiling of the single match appears tions of the two remaining clefts appear in black. Fig-
in white. The remaining cleft consists of one cycle which ure 13 shows two slices with a branching region. The
encloses two other cycles. Two bridge constructions match tiles appear in white, whereas the cleft triangu-
compose the three polygons into a single one, and its lations appear in black. Figure 14 presents a consider-

99
(b) After reconstruction

Figure 15: A multiple branching case

(b) After reconstruction

Figure 13: A simple branching case

(a) Before reconstruction


(b) After reconstruction

Figure 16: A composite case

ably more complicated situation, where the reconstruc-


tion turns out to be 'intuitively correct'. Figure 14(a)
shows that the lower slice contains a contour with two
hole contours and the upper slice contains only one
contour, which mostly lies above the "material" region
of the lower slice. The surface reconstruction is shown
in Figure 14(b). The three match tiles appear in white,
and the cleft triangulations appear in black. The reader
(b) After reconstruction may verify that the two "non-material pillars" repre-
sented by the two hole contours in the lower slice were
Figure 14: A complicated branching case connected to the unbounded "non-material" region in
the upper slice. Similar complex examples are given in
Figures 15 and 16.
The reconstruction of the whole jaw bone, whose in-

100
Model Synthetic Jaw Bone
Slices 2 96
Layers 1 95
Contours:
Total 3.0 417.0
Per Slice 1.5 4.3
Vertices:
Total 143.0 17,646.0
Per Contour 47.7 42.3
Matches:
Total 2.0 330.0
Per Layer 2.0 3.5
Clefts:
Total 1.0 275.0
Per Layer 1.0 2.9
Time (Seconds):
All:
Stitching 0.07 12.50
Triangulation 0.13 37.12
Total 0.20 49.62
Per Layer 0.20 0.52

Table 1: Performance of the algorithm

Figure 17: A fully reconstructed human jaw bone


111 contours made of 5,329 edges. Figures 18(c,d) show
the full reconstruction of the terrain (again, a top view
and an isometric view).
Finally, we measured the performance of our imple-
mentation on two of the examples described above. All
the time measurements were taken on a Digital DEC-
station 5000/240. Table 1 summarizes the performance
of the algorithm on the simple branching case shown in
Figure 10, and on the whole jaw bone shown in Fig-
ure 17. Note that the data of the jaw bone was accu-
mulated from 95 layer reconstructions. Therefore, some
of the data is averaged per layer. We note that in medi-
cal data, at least the data with which we experimented,
successive slices tend to differ a lot in their geometries.
Therefore, many clefts are created and their (relatively
time-consuming) triangulations affect the total running
time of the algorithm.

6 Conclusion
We have proposed in this paper an algorithm for solving
Figure 18: A topographic terrain the practical problem of polyhedral interpolation be-
tween parallel polygonal slices. This problem has many
medical and geographic applications, and also appears
to be a fairly basic and interesting problem in computer
put consisted of 96 slices, is shown in Figure 17. The graphics and solid modeling.
result was a valid polyhedral description, which con- Our method produces a relatively smooth boundary,
tained about 60,000 triangles. The reconstructed jaw due to the contour discretization. In situations where
contained 209 3-D cavities (fully enclosed in the outer the addition of new vertices is not desired, e.g. due to
3-D reconstructed boundary). data explosion, our system uses the discretization only
for the matching step, but the tiling itself and the fol-
Our experimentations were mostly performed on lowing minimum-area triangulation are performed on
medical imaging data. However, as we mentioned in the contours containing only the original points.
the introduction, the reconstruction problem has other We feel that our technique reconstructed the bound-
applications as well. One such application is the re- ary of various organs in an intuitively appealing manner;
construction of a terrain from elevation contour data in one might say that our algorithm demonstrated some
topographic maps. This application is much simpler, 'understanding' of the underlying problem. The results
because of the xy-monotomcity of terrains. For exam- were more than adequate even in extreme cases of tiling
ple, contours cannot overlap in this case (although they between two seemingly totally different slices.
can be nested). Figure 18 shows the reconstruction of We plan to continue the experimentation with our al-
a terrain in the Zikhron-Ya'akov area in Israel. Fig- gorithm, to test its performance limits and see if there
ures 18(a,b) show the elevation contours (a top view and are data instances on which the algorithm might not
an isometric view). The data contained seventeen levels perform well, thus requiring further calibrations and en-
which are 10 meters apart, starting from 20 and ending hancements (in view of our experimentation so far, we
at 180 meters above see level. These levels consisted of doubt that anything really problematic will arise).

101
Acknowledgment [17] N. KEHTARNAVAZ AND R.J.P. DE FIGUEIREDO, A framework
for surface reconstruction from 3D contours, Computer Vision
We wish to thank Haim Wolfson for helpful discussions Graphics and Image Processing, 42 (1988), 32-47.
concerning the geometric hashing technique, Emo Welzl
and Barbara Wolfers for helpful discussions concerning [18] N. KEHTARNAVAZ, L.R. SIMAR AND R.J.P. DE FIGUEIREDO,
the solid reconstruction problem, and for providing us A syntactic/semantic technique for surface reconstruction from
with data files and with a comprehensive bibliography cross-sectional contours, Computer Vision, Graphics and Im-
on that problem, and Jean-Daniel Boissonnat and Bern- age Processing, 42 (1988), 399-409.
hard Geiger for supplying us with data files.
[19] E. KEPPEL, Approximating complex surfaces by triangula-
tion of contour lines, IBM Journal of Research and Develop-
ment, 19 (1975), 2-11.
References
[20] E. KISHON, T. HASTIE AND H. WOLFSON, 3-D curve match-
[1] G. BAREQUET AND M. SHARIR, Filling gaps in the bound- ing using splines, J. of Robotic systems, 8 (1991), 723-743,
ary of a polyhedron, Technical Report 277/93, Department of
Computer Science, Tel Aviv University, 1993. [21] G.T. KLINCSEK, Minimal triangulations of polygonal do-
mains, Annals of Discrete Mathematics, 9 (1980), 121-123.
[2] S. BATNITZKY,H.I. PRICE, P.N. COOK, L.T. COOK AND S.J.
DWYER III, Three-dimensional computer reconstruction from [22] D. MEYERS, S. SKINNER AND K. SLOAN, Surfaces from con-
surface contours for head CT examinations, J. of Computer
tours: the correspondence and branching problems, Proc
Assisted Tomography, 5 (1981), 60-67. Graphics Interface '91, 1991, 246-254.

[3] J.D. BOISSONNAT, Shape reconstruction from planar cross sec- [23] L.L. SCHUMAKER, Reconstructing 3D objects from cross-
tions, Computer Vision, Graphics and Image Processing, 44 sections, in: W. Dahmen, M. Gasca and C.A. Micchelli (eds.),
(1988), 1-29. Computation of Curves and Surfaces, Kluwer Academic Pub-
lishers, 1989, 275-309.
[4] J.D. BOISSONNAT AND B. GEIGER, Three dimensional recon-
struction of complex shapes based on the Delaunay triangula- [24] J.T. SCHWARTZ AND M. SHARIR, Identification of partially
tion, Technical Report 1697, Inria-Sophia Antipolis, 1992. obscured objects in two and three dimensions by matching
noisy characteristic curves, Int. J. of Robotics Research 6
[5] H.N. CHRISTIANSEN AND T.W. SEDERBERG, Conversion of (1987), 29-44.
complex contour line definitions into polygonal element mo-
saics, Computer Graphics, 13 (1978), 187-192. [25] M. SHANTZ, Surface definition for branching contour-defined
objects, Computer Graphics, 15 (1981), 242-270.
[6] H.E. CLINE, W.E. LORENSEN, S. LUDKE, C.R. CRAWFORD
AND B.C. TEETER, Two algorithms for the three-dimensional [26] K.R. SLOAN AND L.M. HRECHANYK, Surface reconstruction
reconstruction of tomograms, Medical Physics, IS (1988) 320- from sparse data, Proc. IEEE Conf. on Pattern Recognition
327. and Image Processing, 1981, 45-48.

[7] L.T.
COOK, P.N. COOK, K.R. LEE, S. BATNITZKY, B.Y.S. [27] K.R. SLOAN AND J. PAINTER, From contours to surfaces:
WONG, S.L. FRITZ, J. OPHIR, S.J. DWYER III, L.R testbed and initial results, Proc. CHI + GI '87, 1987, 115-
BIGONGIARI AND A.W. TEMPELTON, An algorithm for volume
estimation based on polyhedral approximation, IEEE Trans-
actions on Biomedical Engineering, 27 (1980), 493-500. [28] K.R. SLOAN AND J. PAINTER, Pessimal guesses may be opti-
mal: A counterintuitive search result, IEEE Transactions on
[8] A.B. EKOULE, F.C PEYRIN AND C.L. ODET, A triangula- Pattern Analysis and Machine Intelligence, 10 (1988) 949-
tion algorithm from arbitrary shaped multiple planar contours, 955.
ACM Transactions on Graphics, 10 (1991), 182-199.
[29] Y.F. WANG AND J.K. AGGARWAL, Surface reconstruction and
[9] H. FUCHS, Z.M. KEDEM AND S.P. USELTON, Optimal surface representation of 3D scenes, Pattern Recognition, 19 (1986)
v
197-207. '
reconstruction from planar contours, Communications of the
ACM, 20 (1977), 693-702.
[30] E. WELZL AND B. WOLFERS, Surface reconstruction between
simple polygons via angle criteria, Proc. 1st European Sump,
[10] S. GANAPATHY AND T.G. DENNEHY, A new general trian- on Algorithms, 1993, 397-408.
gulation method for planar contours, A CM Transactions on
Computer Graphics, 16 (1982), 69-75. [31] H.J. WOLFSON, On curve matching, IEEE Transactions on
Pattern Analysis and Machine Intelligence, 12 (1990) 483-
[11] B. GEIGER, Construction et utilisation des modeles d'organes 489. ^ '
en vue de l'assistance au diagnostic et aux interventions chirur-
gicals, Ph.D. Dissertation, L'Ecole des Mines de Paris, 1993. [32] M.J. ZYDA, A.R. JONES AND P.G. HOGAN, Surface construc-
tion from planar contours, Computers and Graphics, 11 (1987)
[12] C. GlTLIN, J. O'ROURKE AND V. SUBRAMANIAN, On recon- 393-408. "
structing polyhedra from parallel slices, Technical Report 025,
Department of Computer Science, Smith College, Northamp- y
ton, MA, 1993.

[13] L. GuiBAS AND J. STOLFI, Primitives for the manipulation of


general subdivisions and the computation of Voronoi diagrams,
ACM Transactions on Graphics, 4 (1985), 74-123.

[14] H. HAG EN, H. MüLLER AND G.M. NIELSON, FOCUS on Scien-


tific Visualization, Springer Verlag, 1993.

[15] J. HONG AND H.J. WOLFSON, An improved model-based


matching method using footprints, Proc. 9th Int. Conf. on
Pattern Recognition, 1988, 72-78.

[16] A. KALVIN, E. SCHONBERG, J.T. SCHWARTZ AND M. SHARIR,


Two-dimensional, model-based, boundary matching using
footprints, Int. J. of Robotics Research, 5 (1986), 38-55.

102
Practical Methods for Approximate Geometric Pattern
Matching under Rigid Motions
(Preliminary Version)

MICHAEL T. GOODRICH* JOSEPH S. B. MITCHELL1, MARK W. ORLETSKY


Department of Computer Science Department of Applied Math. Statistics Department of Computer Science
The Johns Hopkins University SUNY, Stony Brook, University The Johns Hopkins University
Baltimore, MD 21218, USA Stony Brook, NY 11794, USA Baltimore, MD 21218, USA
E-mail: goodrichScs . jhu. edu E-mail: jsbmSams .snnysb.edu E-mail: orletsky@cs.jhu.edu

Abstract motions T, such that the directed1 Hausdorff distance


between T(P) and B is minimized. Recall that the di-
We present practical methods for approximate geomet- rected Hausdorff distance, h(C, D), from a point set C
ric pattern matching in d-dimensions along with exper- to another point set D is defined as
imental data regarding the quality of matches and run-
ning times of these methods verses those of a branch- h(C,D) — max min p(c,d),
and-bound search. Our methods are faster than previ-
ous methods but still produce good matches. where p is the usual Euclidean distance between c
and d.

1 Introduction 1.1 Previous Work


d This line of research has a rich history, which really be-
Suppose we are given a set B of n points in $t , which we
shall call the background, and a set P of m points in 3£d, gins in earnest in the computational geometry literature
which we shall call the pattern. The geometric pattern with work by Alt, Mehlhorn, Wagener, and Welzl [3] on
matching problem is to determine a rigid motion, taken methods for finding congruences between two sets of
from some class of motions, such that each point in P points A and B under rigid motions. Besides giving a
is moved to a point in B. This problem is motivated number of exact methods, they introduce an important
by a number of problems in computer vision, including approximate version of the problem, where one is given
character recognition. Of course, it is easy to solve this a tolerance e > 0 and asked to find a motion T, if it ex-
problem in 0(nm log n) time just by keeping the points ists, that allows a matching between each point in T(A)
of B in some dictionary. and a point in B at most distance e away. Moreover,
Unfortunately, this approach is very sensitive to noise they also consider the optimization version of this prob-
in the background. Thus, it is actually more natural to lem, in which one wishes the smallest e admitting such
ask for a rigid motion of P such that each point of P a motion. This version of the problem is very close to
is moved near to a point in B. We call this the approx- the problem we address in this paper. Unfortunately,
imate geometric pattern matching problem. Formally, the running times for this version of the problem are
we desire a rigid motion T, taken from some class of quite high.
Imai, Sumino, and Imai [21] show that these bounds
'This research was partially supported by the NSF and
DARPA under Grant CCR-8908092, by the NSF under Grants
can be reduced somewhat if one is already given an as-
CCR-9003299, CDA-9015667, and IRI-9116843. signment of points in A to points in B. Likewise, Arkin,
tThis research was partially supported by grants from Hughes Kedem, Mitchell, Sprinzak, and Werman [4] show that
Research Laboratories, Boeing Computer Services, Air Force Of- one can improve the running times in the approximate
fice of Scientific Research contract AFOSR-91-0328, and by NSF
Grants ECSE-8857642 and CCR-9204585.
case if the "noise regions" are disjoint. Even so, the
methods derived in these papers are still relatively non-
Permission to copy without fee all or part of this material is trivial and the running times for all but the most simple
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the motions are still quite high.
title of the publication and its date appear, and notice is given In work more directly related to this paper, sev-
that copying is by permission of the Association of Computing eral researchers [6, 7, 18, 19, 20, 25] have studied
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. 'The undirected Hausdorff distance is defined as H(C, D)
ma.x{h(C,D),h{D,C)}.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

103
methods for finding rigid motions that minimize ei-
ther the directed or undirected Hausdorff distance be- Motion Best Match Our Method Factor
tween the two point sets. All of these methods are T mW nnizlogn [19] nmlogn 2
based upon intersecting higher-degree curves and/or T71 in sß2 n2mi\ogn [6] n2mlogn 4
surfaces, which are then searched (sometimes paramet- Tin 3^ n3m2 log2 n [19] nm log n 2+e
rically [1, 8, 9, 10, 22]) to find a global minimum. This K in 3^ - nAm\ogn 4+e
reliance upon intersection computations makes for al- IK in sRd - n6m log n 8+e
gorithms that are potentially numerically unstable, are
conceptually complex, and have running times that are Table 1: Our Results. We give the previous best-
high for all but the most trivial motions. Indeed, Ruck- match asymptotic running times, our asymptotic run-
lidge [26] gives evidence that such methods must have ning times, and our worst-case approximation fac-
high running times.
tor guarantee. The transformations considered are
The high running times of these methods motivated T translation and H =rotation, and their combina-
Heffernan [16] and Heffernan and Schirra [17] to con- tion. The parameter e can be any positive constant less
sider an approximate decision problem for approximate than 1. Also, the previous methods for the 3-d transla-
point set congruence (they did not study point set pat- tion case is actually for undirected Hausdorff distance,
tern matching). The general framework is that one is and the translation method in [19] is for d < 3.
given a parameter e > 0 and asked to solve the ap-
proximate set congruence problem [3], except that one
is allowed to "give up" if one discovers that e is "too
close" to the optimal value e* (i.e., the Hausdorff dis- running time and match quality performance of our
tance between T(A) and B). By allowing algorithms to methods when run on various input instances, and com-
be "lazy" in this way, they show that the running times pare this performance with that of a more conventional
can be significantly reduced from the previous bounds. procedure based upon a branch-and-bound search of a
However, this may not be the best way to approach discretized configuration space. Our experimentation
the problem with an approximation algorithm, since gives evidence that our methods are indeed quite fast
in some instances the program will consume a possibly in practice, yet nevertheless are still able to find rigid
large amount of computing time and terminate without motions with good matches. In addition to this analy-
an approximation. Unfortunately, the running times of sis, we also give some heuristics that speed up the run-
the methods in [16, 17] increase substantially if one tries ning time in practice, even though they do not actually
to get a yes-or-no answer for an e close to e*. Thus, it improve the worst-case running time.
is difficult to use their methods to approximate e*. In the next section we describe our methods under
various rigid motions, in 2-, 3-, and, in some cases,
1.2 Our Results higher dimensions. Our results are summarized in Ta-
ble 1. We give some of the results of our experimental
In this paper we present a simple (almost trivial) ap- work in Section 3, and we conclude in Section 4.
proach for approximate point set pattern matching un-
der rigid motions, where one is given a pattern set P
of m points in $d and a background B of n points in 2 Our Algorithms
3?d and asked to find a rigid motion T that minimizes
h(T(P),B). Our methods are based upon a simple In this section we give each of our methods for approx-
"pinning" strategy. They are fast, easy to implement, imate geometric pattern matching including bounds on
and do not suffer from any numeric instability difficul- the quality of match that will be produced relative to
ties. Moreover, since they are defined for the (more the absolute best possible match.
general) directed Hausdorff measure, they are tolerant
of noise in the background. Our methods are not exact,
however. 2.1 Translation Only in $d
Instead, in the spirit of approximation methods for Suppose we are given a set B of n points in 3Jd and
other hard problems (e.g., NP-hard problems [11, 14]), a set P of m points in 3Jd, where d is considered con-
we derive algorithms that are guaranteed to come close stant. In this subsection we give an efficient method
to the optimal value, 6*, which is also the approach for finding a translation T such that h(T'(P),B) is
taken by Alt et al. [2] for approximate polygon match- at most 2h(Topt(P),B), where Topt(P) is the optimal
ing. In particular, each of our methods gives a rigid translation, i.e., the one that minimizes h(T(P),B),
motion T such that h(T(P),B) < ab*, for some small taken over all translations T.
constant a > 1. Pick some point p G P as a "representative" for
We justify the implementability of our methods P. For each b e B, define Tb to be the transla-
through empirical tests. In particular, we study the tion that takes p to 6. Our method, then, is to

104
find mmbe B{h(Tb(P),B)} as our best approximate translation that takes r to b. Also for a b' G B, b' ^ 6,
match, and let T be the translation Tb that achieves define Rb> to be the rotation that makes r, b', and
this bound. This can clearly be done in 0(nm * k collinear. Let Eby be the Euclidean motion that
Nearest d(nj), where Nearestd(n) is the time needed to is the combination of Tb and Rv. Our method is
perform a nearest-neighbor query in an n-point set (in to find mmbtb<eB{h(Eby(P),B)} as our best approx-
this case B) in 5ftd. imate match, and let E' be the Euclidean motion Eb]bi
Of course, if d = 2, then we can achieve that achieves this bound. This can clearly be done in
Nearest2(n) = O(logn) by answering nearest-neighbor 0(n2m*Nearest3(n)) time, which we can implement to
queries using point location in a Voronoi diagram for be 0(n2mlogn).
B (e.g., [12, 23, 24]), which requires O(nlogn) prepro-
cessing. For higher dimensions, this approach is not Lemma 2.2 h{E'{P),B) < 4h(Eopt(P), B), for any
as efficient, however. So, our method for implementing constant 0 < e < 1.
nearest neighbors will instead be based on the (practi-
cal) method of Arya et al. [5], which finds approximate Proof: For simplicity of expression, define hopt —
nearest neighbors in O(logn) time in 5ftd, for any con- h(Eopt(P),B). Observe that for each p G Eopt(P),
stant dimension d > 2, after O(rclogn) preprocessing. there exists an associated b G B that is within a dis-
Their method can be tuned to return a point whose dis- tance /lopt off». Consider the process of translating the
tance is at most a (l + e)-factor larger than the nearest- entire pattern Eopt(P) so that the particular point r
neighbor distance, for any constant 0 < e < 1. now coincides with its associated background point b.
This translation will cover a distance of at most hopt
Lemma 2.1 h{T'(P),B) < 2h(Topt{P), B) in 5ft2 and and will therefore increase the distance from any other
h(T'(P),B) < (2 + e)h(Topt(P),B) in 5ftd, for d > 3, point in the pattern to its associated background point
with e > 0 being any constant less than 1. by at most hopt. Now consider the process of rotating
the entire pattern about point r so that line between r
Proof: (For 5ft2) For simplicity of expression, de-
and k now passes through the background point asso-
fine /i0pt = h(Topt(P),B). Observe that for each
ciated with k in Eopt(P)- This rotation will have the
P G T0pt(-P), there exists an associated b £ B that
effect of moving point k by at most 2/iopt. Since k is
is within a distance hopt of p. Consider the process of
the fartherest point in the pattern from the center of
translating the entire pattern Topt(P) so that a par-
rotation, all other pattern points will be moved by a
ticular point p now coincides with its associated back-
distance of at most 2hopt. Thus, any given point in
ground point b. This translation will cover a distance
the pattern can be moved by at most hopt during the
of at most hopt and will therefore increase the distance
translation and at most 2/iopt during the rotation, and
from any other point in the pattern to its associated
could have been initially at most hopt away from its
background point by at most hopt. Therefore, it will
associated background point. Therefore, each point in
have a directed Hausdorff distance of at most twice
the pattern will be at most a distance of 4/iopt from a
that of Topt(P)- This translation will be one of those
background point. The pattern in its current position
generated and checked by our algorithm. Thus, our al-
coincides with one of the Euclidean transformation gen-
gorithm will produce a translation that has a directed
erated and checked by our algorithm. ■
Hausdorff distance that is at most a factor of two times
the minimal. (For 5ftd, with d > 3, this factor is multi-
plied by (1 + e')i where e' is defined so that the approx- 2.3 Rotation in 3£3
imation factor for our method becomes 2 + e.) ■
Suppose we are given a set B of n points in 5ft3 and
a set P of m points in 5ft3. In this subsection we
2.2 Translation and Rotation in !K2 give an efficient method for finding a (pure) rotation
Suppose we are given a set B of n points in 5ft2 and a R', about the origin, such that h(R'(P),B) is at most
set P of m points in 5ft2. In this subsection we give an 4h(Ropt{P),B), where Ropt(P) is an optimal rotation,
efficient method for finding a Euclidean motion (trans- i.e., one that minimizes h(R(P),B), taken over all ro-
lation and rotation) E' such that h(E'(P), B) is at most tations R.
4h(Eopt(P),B), where Eopt(P) is an optimal Euclidean Find a point p\ G P that is furthest from the ori-
motion, i.e., one that minimizes h(E(P), B), taken over gin. Find a point pi G P that maximizes its per-
all valid motions E. pendicular distance to the line defined by the origin
Select from the pattern diametrically opposing points and point pi. For each 6' 6 B, define Rlbi to be
and call them r and k. Point r is treated as both the the rotation that makes the origin, p\ and b' collinear.
distinct representative of the pattern for the transla- For each b" G 5,6" ^ 6', define Ä26» to be the ro-
tion part of the transformation and it is treated as the tation about the origin-pi axis that makes the ori-
center of rotation for the rotation part of the transfor- gin, pi, P2, and b" coplanar. Our method, then, is
mation. Specifically, for each b £ B, define Tb to be the to find mmb-ibfeB{h(R2b"(Rh'(P)),B)} as our best

105
approximate match, and let R' be the resultant rota- This can be done in 0(n3m * Nearest3{n)) time. As
tion R2hn(Rlb,(P)) that achieves this bound. This can above, we achieve Nearest3(n) = O(logn) using ap-
clearly be done in 0(n2m * Nearest3(n)) time, which proximate nearest-neighbor searching [5], and end up
is 0(n2mlog2n) if one uses the best current point with the following result:
location method for a 3-dimensional convex subdivi-
sion [15] to query nearest neighbors in a 3-dimensional Lemma 2.4 h(E'(P),B) < (8 + e)h(Eopt{P), B), for
Voronoi diagram (e.g., see [12, 23, 24]). Our preference, any constant 0 < e < 1.
however, is to achieve a faster (and more practical)
0(n2m log n) time bound using the approximate near- Proof: For simplicity of expression, define hopt =
est neighbors method of Arya et al. [5]. This slightly h(Eopt(P),B). In addition, as in previous proofs, let
weakens our approximation factor, as we show in the us show that the expansion factor is 8 if one were to use
following lemma, but we feel this is justified by the time actual nearest neighbors instead of approximate near-
efficiency. est neighbors. Observe that for each p G Eopt(P), there
exists an associated b G B that is within a distance
Lemma 2.3 h(R'(P),B) < (4 + e)h(Ropt(P), B), for /«opt of p. Consider the process of translating the entire
any constant 0 < e < 1. pattern Eopt(P) so that r becomes coincident with its
associated background point. This process can move
Proof: Since the e term is a direct consequence
any point in the pattern by a distance of at most hopt.
of our using approximate nearest neighbor searching
Now consider the process of rotating the entire pat-
to achieve Nearest3(n) = O(logn), it is sufficient to
tern so that line rk passes through the background
show that actual nearest neighbors would give an ap-
point that was associated with k. This rotation can
proximation factor of 4. For simplicity of expression,
move any point in the pattern by at most 2hopt. Now
define hopt = h(Ropt(P), B). Observe that for each
consider a second rotation that brings the background
P € -ffopt(-P), there exists an associated b G B that
point associated with / into the rlk plane. This rota-
is within a distance hopt of p. Consider the process
tion may move pattern point p2 a distance of at most
of rotating the entire pattern Ropt(P) so that px, the
4/iopt, and therefore it may move any point in the pat-
furthest pattern point from the origin, now becomes
tern by at most 4hopt. This rotation will be one of
collinear with its associated background point b and the
those generated and checked by our algorithm. The
origin. This process can move any point in the pattern
translation may have moved any point a distance of
by at most hopt. Now consider the second rotation that
at most hopt, the first rotation may have moved any
aligns p2 with its matching background point. This ro-
point a distance of at most 2hopt farther, and the sec-
tation may move p2 a distance of at most 2hopt, and
ond rotation may have moved any point a distance of
therefore it may move any point in the pattern by at
at most 4hopt still farther. Considering that any given
most 2Aopt. This rotation will be one of those generated
and checked by our algorithm. ■ pattern point may have been a distance of hopt away
from its associated background point to start with, no
pattern point can be farther than 8hopt from its asso-
2.4 Translation and Rotation in 3£3 ciated background point. Our algorithm will therefore
Suppose we are given a set B of n points in 3£3 and a set produce a Euclidean transformation that has a directed
P of m points in 3?3. In this subsection we give an effi- Hausdorff distance that is at most a factor of eight times
the minimal. B
cient method for finding a Euclidean transformation E'
such that h(E'(P), B) is at most (8 + e)h(Eopt(P), B), Thus, we have shown how one can easily achieve all
where Eopt(P) is the optimal Euclidean transformation, the results claimed in Table 1.
i.e., the one that minimizes h(E(P),B), taken over all
such transformations E.
Select from the pattern diametrically opposing points
3 The Experimental Setup
and call them r and k. Choose a point / G P such that We have claimed more than this, however, in that we
the perpendicular distance from / to the line rk is max- assert that our methods are practical. Therefore, so as
imum. For each b 6 B, define Th to be the translation to justify this stronger claim, we have produced an im-
that takes pattern point r to 6.
plementation of our methods, and we have compared
For each b' e B, b' £ b, define Rlb, to be the rotation this implementation with a method that produces best
that causes r, k and b' to become collinear. For each matches to an arbitrary precision using a conventional
b" G B, b" £ b', b" £ b, define R2b„ to be the rotation
branch-and-bound search of a discretized configuration
about the rk axis that brings b" into the r, k, I plane. space. This conventional method seems to be the most
Our method, then, is to compute the value of practical previous best match procedure (we did not
™m,b',b"€B{h(R2b,,(Rlb,(Tb(P))),B)} as our best ap- feel it was practically feasible to implement the previ-
proximate match, and let E' be the Euclidean trans- ous intersection-based methods). As we show through
formation R2hn(R\b,(Tb{P)) that achieves this bound. our experimental results, however, this conventional

106
method is still quite slow compared to our method, and There are several heuristics one can apply to this
the matches it finds are not that much better than the method, which do not improve the worst-case running
ones that our method finds. time, but which do improve the running time in prac-
tice. First, since the relative qualities of the various
translations are identical using p to be either the dis-
3.1 Example Generation tance between the points or the distance squared be-
We generated problem instance examples in dimension tween the points, we use distance squared to avoid the
d by randomly choosing a set of n background points in costly square root function in this inner-most loop. At
the unit d-cube with lower left corner at the origin. The the end of the program, when we have found the trans-
points are generated by selecting each of the d coordi- lation that we want, we then take the square root to
nates from the range [0,1) with uniform distribution. get the actual Hausdorff distance.
Once we generate this background, we randomly select We also use a condition that terminates the while-
m points from this background to be an unperturbed loop early once it is known that a particular placement
pattern. Each pattern point is then perturbed by a need not be further considered. Observe that in the cal-
small amount so that the pattern no longer identically culation of the Hausdorff distance, we are finding the
resembles a subset of the background points. The per- maximum amount by which a pattern point deviates
turbation is done as follows. A parameter 6 defines the from its nearest background point. As we determine
maximum distance that a pattern point can be moved. this quantity for each of the pattern points we have a
The original position of a pattern point and the dis- partial-maximum at any given point in the loop. If this
tance 5 define a hypersphere centered at the point's partial-maximum ever exceeds the best Hausdorff dis-
original position. The pattern point will be moved from tance found so far, the placement that we are checking
its original position to a point inside of this d-sphere is known to be suboptimal and does not warrant fruther
such that the probability that it will be placed in any consideration. We therefore terminate the while loop as
subvolume of the sphere is equal to the ratio of that soon the partial computation of the Hausdorff distance
subvolume to the volume of the entire d-sphere. In exceeds the global best found so far.
other words, perturbation causes each pattern point,
p to be randomly placed with uniform distribution in 3.2.2 Translation in 3?3
the hypersphere with center p and radius 8. After this
perturbation process, the pattern is referred to as a per- The algorithm for translation in 3£3, and for that mat-
turbed pattern. We use this perturbed pattern and the ter 5ftd, is identical to the algorithm for translation in
background from which it was generated as the sets P 3?2, except that the distances are computed in a higher
and B, respectively. dimension.

3.2 Implementation of the Approxi- 3.2.3 Translation and Rotation in 3?2


mate Match Algorithms The implementation of the algorithm described in Sec-
This section gives the details of the implementation tion 2.2, is also quite straightforward. Diametrically
of our approximate-match algorithm for four different opposing pattern points are chosen, one of which will
matching problems involving translation and rotation serve as both the distinct representative of the pattern
in 2 and 3 dimensions. and as also the center of rotation. The algorithm then
translates the pattern so that the distinct representa-
tive coincides with each of the n background points in
3.2.1 Translation in 9?2 succession. After each translation, the pattern is ro-
As described in Section 2.1, our approximate pattern tated about the current position of the distinct repre-
matching algorithm translates the pattern so that the sentative a total of 7i — 1 times so that after each rota-
distinct representative of the pattern coincides with tion, the other antipodal point is aligned with another
each of the n background points in succession. For one of the background points. We now have the pattern
each such translation, the Hausdorff distance is calcu- in one of the n * (n - 1) positions at which we check
lated and compared with the best found so far. If the the Hausdorff distance. As with the translation-only
new Hausdorff distance is smaller that the best found so case, we maintain the best Hausdorff distance found so
far, the position of the pattern (i.e., the position of the far and the position of the pattern that produced it.
distinct representative) and this new best distance re- If at any time one of the n * (n — 1) placements has
place those recorded so far. After the pattern has been a directed Hausdorff distance that is better than the
translated to all of the background points, we output best found so far, our records are updated to reflect
the best found. This position of the pattern is known this new best position and Hausdorff distance. Again,
to produce a Hausdorff distance that is within a factor we use the distance-squared and early loop-termination
of two of optimal. heuristics in order to further speed up the algorithm.

107
3.2.4 Translation and Rotation in 3?3 in this position, the Hausdorff distance is calculated. If
this distance is the best found so far, it is recorded along
The algorithm for producing an approximate match for
with the probe point (center of square). The algorithm
translation and rotation in 3ft3 is as follows. We again
then recurses on each of its four quadrants.
select the distinct representative and the antipode of
Notice that squares that are passed to the recursive
the pattern as we have done in Section 3.2.3. In this
algorithm will in general exclude both pattern points
case, we also select a third pattern point, called the ra-
and background points. The pattern and background
dial point, which has the property that it is the great-
are not cropped to fit these squares, these squares sim-
est distance away from the line passing through the
ply describe areas in which we would consider placing
distinct representative and the antipode. Our approxi-
the distinct representative of the pattern in an effort to
mate match algorithm is comprised of three nested for-
find good matches. The recursion is terminated when
loops. The outer-most loop translates the pattern such
it reaches a predefined maximum depth or if it is cer-
that the distinct representative of the pattern coincides
tain that placement of the distinct representative at
with each of the n background points in succession.
any point in the square will not produce a Hausdorff
The next loop chooses one of the remaining n — 1 back-
distance that is better than the best found so far. One
ground points and rotates the pattern about the current
observation that we can use to terminate the depth of
position of the distinct representative so that the an-
recursion early is that the Hausdorff distance can be de-
tipode becomes aligned with this selected background
creased by an amount of at most x when the pattern is
point. The inner-most for-loop selects a third back-
translated by a distance of a?. If the value of the Haus-
ground point from the remaining n — 2 and performs a
dorff distance produced by probing the center of the
second rotation of the pattern, this time about the line
square is so great relative to the best found so far that
passing through the current position of the distinct rep-
placing the distinct representative at any point in the
resentative and the current position of the antipode, to
bring the plane defined by the distinct representative, square is known to produce a Hausdorff distance that
does not beat the best found so far, we no longer need
the antipode, and the radial point into a position that
to recursively search this square and we can terminate
includes the background point chosen by this third for-
this branch of the recursion.
loop. Note that there are two rotations summing to
2TT that that will do this, one bringing the radial point
In the approximate match algorithm, we allow the
nearer to the third chosen background point and the condition an early exit to the while loop if the Haus-
other taking it farther away. We are of course interested dorff distance of a particular placement is known to
in the one that brings it closer, which is the rotation be suboptimal. In the conventional algorithm, we do
that has the smaller absolute value. not. The Hausdorff distances are used as probe values
and large probe values have a tendency to terminate
For each of the n(n - l)(n - 2) placements produced
recursion early. We do not use this break out of the
by the above described for loops, the Hausdorff distance
of the placement is generated and the current best is while loop since it would return to the recursive algo-
kept. At the termination of our algorithm, we output rithm probe values which were, in most cases, smaller
the best placement found. than those that are accurate. Such smaller probe val-
ues inhibit pruning and we find that is better to allow
Implementation of the rotations described in this sec-
the probing algorithm to run to completion and return
tion are explained in detail in Foley and vanDam [13].
accurate probe values.

3.3 Implementation of the Branch and 3.3.2 The Conventional Algorithm for Trans-
Bound Algorithms lation and Rotation in $t2
This section gives the implementation details of the cor- The conventional method for Translation and Rotation
responding branch-and-bound algorithm for matching in 5ft2 involves searching the three-dimensional configu-
problems involving translation and rotation in 2 and 3 ration space in which the x and y position of the distinct
dimensions. representative of the pattern comprise two of the di-
mensions and the angular position of the pattern about
3.3.1 The Conventional Method for Transla- the distinct representative, 9, comprises the third.
tion in $R2 We search the configuration space defined by x, y, G
[0,1] and the angle 9 e [-TT, TT]. We probe the center of
The conventional method against which we compared this volume by translating the pattern so that the dis-
our method is a recursive algorithm. It receives a tinct representative resides at point (0.5, 0.5) and rotate
square defined by a center point and a side length. It the pattern about the distinct representative so that the
then "probes" the center of the square by translating antipode of the pattern is at 0 radians in relation to the
the pattern so that the distinct representative of the distinct representative. We then calculate the directed
pattern is in the center of the square. For the pattern Hausdorff distance of the pattern in this position and

108
if it is better than the best found so far, we record it Ratio of Hausdorff
along with the probe point, x, y, and 6 that produced distances
it. We then recurse on each of the 8 octants until the (Approximate-to-Actual)
maximum depth of recursion is reached or it is certain 2
that no placements in the configuration space that we
\
are currently searching will have a directed Hausdorff 1.b
distance that is better than the global best found so far,
1
in which case this branch of the recursion is terminated.
O.b
3.3.3 Translation and Rotation in 5ft3
0 i i i i iii. i i i i i i i i

The conventional method for Translation and Rotation 100 200 300 400 500
in 3?3 is again the search of a configuration space, this Number of Background Points
time a 6-dimensional space. One has three degrees of
freedom in placing the distinct representative of the
pattern relative to the background, specifically the x, Figure 1: Ratios of approximation method to con-
y, and z position, and one has three degrees of freedom ventional method.
in orienting the pattern in three-space once the distinct
representative has been pinned. Two of these degrees
of freedom involve the location of the antipode of the
pattern relative to the distinct representative, which point in a way that it gets moved the maximum amount
can be thought of as the <j> and 6 components of the possible when we move p to its match point.
spherical coordinate of the antipode in relation to the We conducted an experiment to test this. Thirty sets
distinct representative. The final degree of freedom is of background points were generated, each having be-
the angular orientation of the pattern about the axis tween 50 and 500 points. From each background, a pat-
from the distinct representative and the antipode. tern of size 10 was selected and perturbed. The pattern
This conventional algorithm is similar in nature to was then matched to its associated background using
the two previously presented. The center of the 6-space both the approximate match algorithm and a conven-
is probed, by placing and orienting the pattern accord- tional match algorithm. The ratio of the directed Haus-
ing to the value for each of the 6 variables defining a dorff distance of the approximate match algorithm to
placement that are contained in the probe point. The the conventional match algorithm is plotted in Figure 1.
directed Hausdorff distance of the pattern in this po- The average of the ratios plotted is 1.69, which is close
sition is calculated and the algorithm recurses on each to the predicted value of 1.71.
of the 26 = 64 subregions of the configuration space
until either the maximum depth of recursion has been 3.5 Experiment 2: Ratio of approxi-
reached or until pruning occurs. mate to actual for Translation in 3£3
In a manner similar to Experiment 1, it could be conjec-
3.4 Experiment 1: Ratio of approxi- tured that the matches produced by the approximate
mate to actual for Translation in 3£2 match algorithm in three dimensions will be close to
For the case of translation, we have provided an upper l/\/2, since this is the average distance by which a
bound on the directed Hausdorff distance of the approx- point is perturbed with our perturbation strategy rela-
imate match algorithm of twice that of the directed tive the maximum distance with which a point will be
Hausdorff distance of the optimal match. It is likely, perturbed with our perturbation strategy.
in practice, however, that the approximate match algo- Experiment 3 was conducted to test this. Forty-five
rithms will produce matches with better directed Haus- sets of background points were generated, each having
dorff distances than this worst case. It is our conjecture between 5 and 100 points. From each background, a
that for large sparse B's and large sparse P's, the ap- pattern of size 5 was selected and perturbed. The pat-
proximate match algorithms will produce matches that tern was then matched to its associated background us-
are (1 + A) * hopt, where A is the ratio of the expected ing both the approximate match algorithm and a con-
distance by which a point will be perturbed divided by ventional match algorithm. The ratio of the directed
the maximum distance by which a point will be per- Hausdorff distance of the approximate match algorithm
turbed. In particular, for our perturbation strategy in to the conventional match algorithm is plotted in Fig-
two dimensions, A should be close to l/-\/2, since this ure 2. The average of the ratios plotted is 1.679, which
is the expected distance the representative point p is is close to the predicted value of 1.79. The fact that the
from its "match point" in B, and it is likely that there experimental average is less than the predicted value
is another point in P that is close to hopt from its match can be attributed to the relatively small pattern size of

109
Quality of the Approximate-match algorithm for Translation in 3-D Number of floating-point
operations required
(in millions)
Approximate Match
' Aig-
With Pruning

Approximate Match
100
Alg.
No Pruning
Number of points in Background

Conventional
Match Alg. With
pruning

Figure 2: Ratios of approximation method to con-


Conventional
ventional method Translation only in 3D. Match Alg.

Number of Points in the


Background

5 points, which decreases the probability that one of the


pattern points will be translated by a nearly maximal Figure 3: Running times of the four methods.
amount when the distinct representative of the pattern
is translated to its associated background point.

3.6 Experiment 3: Running Times Running Time vs. Background Size

The approximate match algorithms have worst-case


time complexities that are much lower than those of
the actual match algorithms. We conjectured, however,
that they should run faster in practice. This experi- Approximate-mat
ch
ment examines the extent to which they do, comparing
them to what should be a good practical algorithm—
branch-and-bound. This experiment involves two cases,
the translation-only case in 3?2 and the translation-and-
rotation case in 3?3. So as to eliminate any system ef- | Number of Points in the Background

fects on the running time data, we keep a counter of


floating point operations used by each algorithm as op-
posed to using the Unix time command. The numbers Figure 4: Running times of the two 3-D methods.
presented in the graphs are numbers obtained from this Line 1 graphs the running times for the conven-
counter.
tional method and line 2 graphs the running times
In the translation-only case in 5ft2, thirty sets of back- for our method
ground points were generated, each having between
50 and 500 points. From each background, a pattern
of size 10 was selected and perturbed. The pattern
was then matched to its associated background using
both the approximate match algorithm and a conven- Translation and Rotation in 3D Quality Comparison
tional match algorithm both with and without heuris-
tic speedups. The results of this experiment are shown
1.00
in Figure 3. In every case the approximate match al- 0.80
sr
0.60
gorithm, even without the heuristic speedup, had a 0.40
0.20 =
smaller running time than the conventional algorithms. 0.00 III i i i i i i \ i < i i i i i i i

In the translation-and-rotation case in 3?3, 24 sets 0.00 5.00 10.00 15.00 20.00 25.00
of background points were generated, each having be-
Number of Points in the Background
tween 5 and 25 points. From each background, a pat-
tern of size 5 was selected and perturbed. The pat-
tern was then matched to its associated background
using the approximate match algorithm with heuris- Figure 5: Running times of the four methods.
tic speedups, a depth-first branch-and-bound algo-
rithm and a breadth-first branch-and-bound algorithm.

110
The running times of the depth-first and breadth-first Number of floating-point operations Required
(in millions)
branch-and-bound algorithms were, in all instances
within a factor of 0.01 of each other and are therefore
500 .
plotted as a single line in Figure 4 which depicts the 1
results of this experiment.
Conventional
The branch-and-bound algorithms search a six di- 300 .
Method
Without Pruning
mensional space comprised of three degrees of freedom
in the translation of the pattern and three degrees of
freedom in the rotation of the pattern. This produces
200 .
1 Conventional
Method
With Pruning

a rather large branching factor 26 = 64 in the recursive ,


/ ..„„,-
1^ ,
0
algorithms, and necessitated the depth of these algo-
rithms to be limited to 3. With this (necessary) depth Depth of Recursion
limitation, the approximate-match algorithm actually
found better matches than the branch-and-bound algo-
rithm did in all of the 24 cases, in spite of the fact that Figure 6: Running times with and without prun-
the branch-and-bound algorithms required on average ing.
4479 times as many floating-point operations. The av-
erage directed Hausdorff distance of the match pro-
ducted by the approximate-match algorithm and the
algorithms, they are easy to implement, and they run
average directed Hausdorff distance of the match pro-
fast in practice, as predicted.
duced by the branch-and-bound algorithms are given
in Figure 5 for comparison.
Acknowledgements
We thank Esther Arkin, Sändor Fekete, and David Mount
3.7 Experiment 3: Running Times vs. for useful discussions on this research. Some of the results
Depth of Recursion grew out of discussions during a Workshop on Geometric
Probing in Computer Vision, sponsored by the Center for
The depth of search of the conventional match algo- Night Vision and Electro-Optics, Fort Belvoir, Virginia, and
rithms that we have implemented must be limited. This monitored by the U.S. Army Research Office. The views,
experiment depicts the extent to which the running opinions, and/or findings contained in this report are those
time of the algorithm increases as the depth of recursion of the authors and should not be construed as an official
is increased. Further, it shows the substantial speedup Department of the Army position, policy, or decision, unless
obtained by pruning the search. The results of this so designated by other documentation.
experiment are depicted in Figure 6.
Four backgrounds were generated, each having 50
points. From each background, a pattern of size 10
References
was selected and perturbed. The conventional method [1] P. K. Agarwal, B. Aronov, M. Sharir, and S. Suri,
without pruning was run ten times on the first back- "Selecting distances in the plane," in Proc. 6th Annu.
ground, with the depth of recursion being varied from 1 ACM Sympos. Comput. Geom., 321-331, 1990.
to 10. The conventional method with pruning was run [2] H. Alt, B. Behrends, and J. Blömer, "Approximate
ten times on the next three backgrounds, and again matching of polygonal shapes," in Proc. 7th Annu.
ten times on each, with the recursion depth being var- ACM Sympos. Comput. Geom., 186-193, 1991.
ied from 1 to 10. An average of the running times for [3] H. Alt, K. Mehlhorn, H. Wagener, and E. Welzl, "Con-
the three cases with pruning were taken and the results gruence, similarity and symmetries of geometric ob-
were plotted. jects," Discrete Comput. Geom., 3, 237-256, 1988.
[4] E. M. Arkin, K. Kedem, J. S. B. MitcheU, J. Sprin-
zak, and M. Werman, "Matching points into pairwise-
4 Conclusion disjoint noise regions: combinatorial bounds and algo-
rithms," ORSA J. Comput., 4(4), 375-386, 1992.
We have given approximate pattern matching algo- [5] S. Arya, D. M. Mount, N. S. Netanyahu, R. Silverman,
rithms for translation, rotation, and Euclidean trans- and A. Wu, "An optimal algorithm for approximate
formations for two, three, and sometimes even higher nearest neighbor searching," in Proc. 5th ACM-SIAM
dimensions. These matching algorithms are guaran- Symp. on Discrete Algorithms, 1994.
teed to give a match with a directed Hausdorff dis- [6] L. P. Chew, M. Goodrich, D. Huttenlocher, K. Ke-
tance that is no greater than a small constant times dem, J. Kleinberg, and D. Kravets, "Geometric pat-
the best achievable directed Hausdorff distance. In ad- tern matching under Euclidean motion," in Proc. 5th
dition, they have a time complexity that is substan- Canad. Conf. Comput. Geom., Waterloo, Canada,
tially smaller that those of existing pattern matching 151-156, 1993.

Ill
[7] L. P. Chew and K. Kedem, "Improvements on geomet- [24] F. P. Preparata and M. I. Shamos, Computational Ge-
ric pattern matching problems," in Proc. 3rd Scand. ometry: an Introduction, Springer-Verlag, New York,
Workshop Algorithm Theory, Lecture Notes in Com- NY, 1985.
puter Science, vol. 621, Springer-Verlag, 318-325, 1992.
[25] G. Rote, "Computing the minimum Hausdorff distance
[8] R. Cole, "Slowing down sorting networks to obtain between two point sets on a line under translation,"
faster sorting algorithms," in Proc. 25th Annu. IEEE Inform. Process. Lett., 38, 123-127, 1991.
Sympos. Found. Comput. Sei., 255-260, 1984.
[26] W. Rucklidge, "Lower bounds for the complexity of the
[9] R. Cole, "Parallel merge sort," SIAM J. Comput., Hausdorff distance," in Proc. 5th Canad. Conf. Com-
17(4), 770-785, 1988. put. Geom., Waterloo, Canada, 145-150, 1993.
[10] R. Cole, J. Salowe, W. Steiger, and E. Szemeredi, "An
optimal-time algorithm for slope selection," SIAM J.
Comput., 18, 792-810, 1989.
[11] T. H. Cormen, C. E. Leiserson, and R. L. Rivest, In-
troduction to Algorithms, The MIT Press, Cambridge,
Mass., 1990.
[12] H. Edelsbrunner, Algorithms in Combinatorial Geome-
try, EATCS Monographs on Theoretical Computer Sci-
ence, vol. 10, Springer-Verlag, Heidelberg, West Ger-
many, 1987.
[13] J. D. Foley and A. Van Dam, Fundamentals of Inter-
active Computer Graphics, Addison-Wesley, Reading,
MA, 1982.
[14] M. R. Garey and D. S. Johnson, Computers and
Intractability: A Guide to the Theory of NP-
Completeness, W. H. Freeman, New York, NY, 1979.
[15] M. Goodrich and R. Tamassia, "Dynamic trees and
dynamic point location," in Proc. 23rd Annu. ACM
Sympos. Theory Comput., 523-533, 1991.
[16] P. J. Heffernan, "Generalized approximate algorithms
for point set congruence," in Proc. 3rd Workshop Al-
gorithms Data Struct., Lecture Notes in Computer Sci-
ence, vol. 709, 373-384, 1993.
[17] P. J. Heffernan and S. Schirra, "Approximate deci-
sion algorithms for point set congruence," in Proc. 8th
Annu. ACM Sympos. Comput. Geom., 93-101, 1992.
[18] D. P. Huttenlocher and K. Kedem, "Computing the
minimum Hausdorff distance for point sets under trans-
lation," in Proc. 6th Annu. ACM Sympos. Comput.
Geom., 340-349, 1990.
[19] D. P. Huttenlocher, K. Kedem, and J. M. Kleinberg,
"On dynamic Voronoi diagrams and the minimum
Hausdorff distance for point sets under Euclidean mo-
tion in the plane," in Proc. 8th Annu. ACM Sympos.
Comput. Geom., 110-120, 1992.
[20] D. P. Huttenlocher, K. Kedem, and M. Sharir, "The
upper envelope of Voronoi surfaces and its applica-
tions," in Proc. 7th Annu. ACM Sympos. Comput.
Geom., 194-203, 1991.
[21] K. Imai, S. Sumino, and H. Imai, "Minimax geometric
fitting of two corresponding sets of points," in Proc. 5th
Annu. ACM Sympos. Comput. Geom., 266-275, 1989.
[22] N. Megiddo, "Applying parallel computation algo-
rithms in the design of serial algorithms," I. ACM,
30, 852-865, 1983.
[23] K. Mehlhorn, Multi-dimensional Searching and Com-
putational Geometry, Data Structures and Algorithms,
vol. 3, Springer-Verlag, Heidelberg, West Germany,
1984.

112
Spheres, Molecules, and Hidden Surface RemovaF

Dan Halperint Mark H. Overmars*

Abstract easy to obtain. Our study is motivated by the rep-


resentation and manipulation of molecular configura-
We devise techniques to manipulate a collection of tions, modeled by a collection of spheres.
loosely interpenetrating spheres in three-dimensional
A common approach to representing the three-
space. Our study is motivated by the representation
dimensional geometric structure of a molecule, is to
and manipulation of molecular configurations, mod-
represent each of its atoms by a "hard" sphere. It
eled by a collection of spheres. We analyze the sphere
is also common to assume that the nuclear arrange-
model and point to its favorable properties that make
ment, i.e., the relative displacement of the spheres,
it more easy to manipulate than an arbitrary collec-
is fixed (it is often the so-called equilibrium nuclear
tion of spheres. For this special sphere model we
configuration). There are recommended values for
present efficient algorithms for computing its union
the radius of each atom sphere and for the distance
boundary and for hidden surface removal. The effi-
between the centers of every pair of spheres. In this
ciency and practicality of our approach are demon-
model, the spheres are allowed to interpenetrate one
strated by experiments on actual protein data.
another, therefore it is sometimes referred to as the
"fused spheres" model (see, e.g., Figure 1). The enve-
1 Introduction lope surface of the fused spheres may be regarded as
a formal molecular surface. It is evident, that various
In this paper we devise techniques to represent and properties of molecules are disregarded in this simple
manipulate a collection of overlapping spheres in model. However, in spite of its approximate nature, it
three-dimensional space. Often, manipulating three- has proven useful in many practical applications. For
dimensional geometric objects that intersect is time more background material and references, see, e.g.,
consuming. However, by imposing several constraints the survey paper by Mezey [16].
on the spheres and their interaction, we obtain a set-
ting where efficient and practical techniques are quite
"The first author acknowledges support by a Roth-
schild Postdoctoral Fellowship, by a grant from the Stan-
ford Integrated Manufacturing Association (SIMA), and by
NSF/ARPA Research Grant IRI-9306544. The second author
f±*
was partially supported by the ESPRIT III Basic Research
Action No. 7141 (project ALCOM II) and by the Netherlands
Organization for Scientific Research (N.W.O.).
t Robotics Laboratory, Department of Computer Science,
Stanford University, Stanford, CA 94305, USA. Email:
halperinfics.stanford.edu.
^Department of Computer Science, Utrecht University,
P.O.Box 80.089, 3508 TB, Utrecht, the Netherlands. Email:
markovQcs.ruu.nl.

Permission to copy without fee all or part of this material is


granted provided that the copies are not made or distributed or
direct commercial advantage, the ACM copynght notice and the
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing
Machinery To copy otherwise, or to republish, requires a fee Figure 1: Molecule 1: A small molecule surrounded
and/or specific permission. by water with a total of 42 atoms.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

113
We study the hard sphere model from a compu-
tational geometry point of view, that is, we study
the combinatorial and algorithmic behavior of a col-
lection of n (possible intersecting) spheres in 3-space,
having some special properties. We make several sim-
ple observation, showing that, because of these spe-
cial properties, the spheres in this model can be effi-
ciently manipulated. For example, we show that the
maximum combinatorial complexity of the boundary
of the union of the fused spheres is 0(n), whereas for
an arbitrary collection of spheres (even unit spheres)
this may be 0(n2) (see, e.g., [13]). These results are
described in Section 2.
Figure 3: Molecule 3: A piece of DNA with 757
atoms.
Wmm
J
on the objects to allow for efficient algorithms. It
if \ >*tlÄ M /— exemplifies, yet another time, that in practical situa-
tions a collection of geometric objects having certain
additional properties (obtained from observing real-
life situations), behaves favorably.
_ ■

V Jl )

Figure 2: Molecule 2: A small protein with 100


atoms.

In Section 3 we take advantage of the favorable be-


havior of the model, to devise a data structure for
answering intersection queries of the form: Given a
hard sphere model M of a molecule and a query atom
sphere Q (both given in a fixed placement in 3-space),
report which spheres of M are intersected by Q. In
Section 4 we use this data structure to efficiently com-
pute the boundary of the union of the spheres. We
also show that this algorithm can be used to compute
a related type of molecular surfaces, so-called solvent
accessible surfaces. Finally, in Section 5, we present
efficient algorithms for hidden surface removal, either
by computing a depth order or by computing the vis- Figure 4: Molecule 4: A larger protein with 971
ibility map of a molecule. atoms.
Our work is closely related to the study of fatness.
It has been shown that certain problems in computa- We support our claim for efficiency and practical-
tional geometry can be solved much more efficiently ity of the data structure and the algorithms that we
when the objects involved have no long and thin parts present by reporting results of experiments that were
(see, e.g., [15, 17, 20]). Clearly, spheres are fat. In carried out on actual protein data retrieved from the
3-space though fatness is not enough to guarantee ef- "Protein Data Bank" at Brookhaven National Lab-
ficient algorithms when the objects are allowed to in- oratory [1, 2]. In Figures 1 till 4 you find pictures
tersect. Fortunately, the extra properties in the hard of some of the molecules that we used. All of these
sphere model provide enough additional constraints pictures were created using the algorithms described

114
in Section 5. Proof. Part (i): Consider a ball Bi. Let B be the
ball of radius rz + 2rmax, centered at a. Clearly, any
ball in M that intersects Bi must lie completely in-
2 The Hard Sphere Model side B. For each Bj that lies completely inside B, let
ßj denote the ball of radius | • rm;n centered at c3.
Overlapping spheres in three-dimensional space may We claim that the ßj's are pairwise interior-disjoint.
in general be rather unwieldy objects. The arrange- Suppose the opposite, namely, that there are two such
ment (i.e., the subdivision of space) defined by n balls ßj1 and ßj2 whose interiors intersect. This im-
spheres in 3-space may have complexity 6(n3) in the plies that Cj1 and Cj2 are less than p ■ rm-m apart.
worst case and their union boundary may have com- This, in turn, means that the ball with radius p ■ rn
plexity 0(n2). Moreover, efficient algorithms for ma- and center at Cj1 contains the center of the ball Bn,
nipulating a collection of overlapping spheres are of- contradicting the assumptions of the theorem.
ten complex and rather time consuming. However, Hence, by volume consideration, the total number
the atom spheres in the model of a molecule have of balls that are completely contained in B cannot
properties that we can exploit to obtain efficient and exceed
simple algorithms for manipulating them. One such
3
property is that, although two spheres may interpen- (n + 2rmax)3 (3r:maxj\ k
< <216-(-)3.
etrate, their centers cannot get too close to one an- (E .
\ 9 r min ) \2 1 mm) P
other. The other useful property is that their radii
range in a fairly restricted range; see, e.g., [11, p. J-3] Part (ii) follows from Part (i) because Part (i) im-
for a list of van der Waals radii, which are one type plies that the number of features involving Bx on the
of acceptable radii. Actually, each molecular mod- union boundary is bounded by a constant. Indeed,
elling package seems to use its own slightly different if the balls are in general position then a feature in-
set of radii. The following table shows the list the volving a ball Bi is either a face on the boundary of
radii (in Angstr0m) of the spheres we use to repre- Bi, or an intersection arc of Bi with another ball, or
sent the main types of atoms. (Taken from an actual an intersection point of Bi with two other balls. All
molecular modelling package.) these features belong to the two-dimensional subdivi-
sion (or arrangement) formed on the boundary of Bx
c Cal Hj N 0 P S by a constant number of circles, each being the inter-
1.70 2.07 0.90 1.55 1.52 1.80 1.80 section of Bi with another ball. The complexity of
this arrangement is evidently bounded by a constant.
In Theorem 2.1 below, we state the conditions Thus, the overall complexity of the union boundary
that make the sphere model of a molecule favor- is 0(n). ü
able. (Similar observations were recently, indepen-
dently made by Varshney and Brooks [21].) From The following table gives the values ofk,p and the
this point on, we will distinguish between a ball maximal and average number of balls intersecting a
and a sphere. Each atom with radius r; and cen- single ball for our four example molecules (Figures 1
ter at Ci induces a ball Bi = {p\d(p,Ci) < r*} and a to 4).
sphere Si = {p\d(p,Ci) = n}, where d(pi,p2) is the
Euclidean distance between the points p\ and p2 in mol. k max aver.
P
3-space. 1 2.30 0.64 14 5.0
2 1.18 0.71 12 6.4
Theorem 2.1 Let M = {B1,..., Bn) be a collec-
3 2.00 0.63 15 7.4
tion of n balls in 3-space with radii 7*1,..., rn and
4 1.18 0.71 12 6.3
centers at ci,...,c„. Let rmin = min;ri and let
rmax = maxi r,. Also let S = {Si,..., Sn} be the col- As can be seen k is small and p is large as required,
lection of spheres such that Si is the boundary surface resulting in a small number of intersections per ball
of Bi. If there are positive constants k,p such that (being much smaller than the worst-case bound of
^^ < k and for each Bi the ball with radius p ■ r;
216(fc/p)3).
ana concentric with Bi does not contain the center of
We now turn to discuss the subdivision of three-
any other ball in M (besides a), then: dimensional space induced by a collection of spheres;
(i) For each Bi € M, the maximum number of balls the arrangement of the spheres. The study of ar-
in M that intersect it is bounded by a constant. rangements plays a fundamental role in geomet-
ric computing. We denote the arrangement of the
(ii) The maximum combinatorial complexity of the spheres in M by A(M), that is, A(M) is the subdivi-
boundary of the union of the balls in M is 0(n). sion of 3-space into cells of dimensions 0,1,2 and 3,

115
induced by the spheres in M (see, e.g., [4, pp. 144- Proof. We distinguish between two portions of 3-
150]). The combinatorial complexity of the arrange- space: inside the union of the balls (i.e., the balls
ment A(M) is defined to be the number of cells of corresponding to the spheres in M), and outside the
various dimensions in this subdivision. For arbitrary union of the balls. The complexity of the vertical
sets of spheres the complexity can be 0(n3). The fol- decomposition of A{M) inside the union of the balls
lowing is an immediate corollary of Theorem 2.1 (i): is evidently 6(n), by Theorem 2.1 (i). Hence, from
this point on we bound the complexity of the verti-
Corollary 2.2 The complexity of the arrangement cal walls that lie completely outside the union of the
A(M) of the spheres in M as defined in Theorem 2.1 balls. These walls are erected from curves that lie on
is Q(n). the union boundary. Recall that the equators of the
spheres are also considered curves in the arrangement
For most algorithmic uses, however, a raw arrange- A(M).
ment is an unwieldy structure. The difficulty is that
Fix an edge 7 of A(M) that lies on the union
many cells in an arrangement can have very complex
boundary, and let H1 be the vertical surface which
topologies, and thus navigating around them is diffi-
is the union of vertical lines through points on 7. Let
cult. What we often want is a further refinement of
F be the collection of faces of A(M) that lie on the
the cells of an arrangement into pieces that are each
union boundary, where a face is a maximal portion of
homeomorphic to a ball and have constant descrip-
a sphere in M that does not meet any other sphere
tion complexity.
or the equator of that sphere, and is not contained in
A prevailing and general technique for decompos-
any other sphere. By Theorem 2.1 (parts (i) and (ii))
ing arrangements is the vertical decomposition (see,
F consists of 0(n) faces (or surface patches), each
e.g., [3]), defined as follows. For every sphere Si,
bounded by a small number (bounded by a constant)
we call the curve of intersection of Si and the hor-
of low-degree algebraic curves.
izontal plane through the center of Si the equator
of the sphere. Let E be the collection of curves on For every face / in F, let /' be / n iJ7. /' is a
the spheres in M consisting of intersection curves be- collection of a small number of low degree algebraic
tween any pair of spheres and the equators of the curves on H1. By standard arguments, the complex-
spheres. Let 7 be a curve in E. We extend a vertical ity of the vertical wall extended from 7 and that lies
segment upward and downwards from every point of outside the union, is determined by the complexity
7 until it hits a sphere in M or extends to infinity. We of the lower envelope (or upper envelope, or both)
repeat this process for every curve in E. As a result defined by the collection F' = {f'\f 6 F} with re-
we get a collection of vertical walls that together with gard to the curve 7. Since the curves F' are either
the spheres in M subdivide 3-space into zy-monotone pairwise disjoint, or a pair of curves in F' meet at an
3D cells. We then project each cell onto the zy-plane, endpoint of at least one of the curves, and they do not
and extend vertical segments (with respect to the y- intersect otherwise, the complexity of the envelope is
direction) from every vertex of the projection and 0(n). We repeat this argument for every edge 7 on
from every x-extreme point in the projection of a cell, the union boundary. There are 0{n) such edges, and
such that the segments are maximal and contained in- the upper bound follows. D
side the projection of the cell. We then extend each
of these segments into a vertical wall contained inside The bound is sharp. One can easily construct a set
the original 3D cell. For details and illustrations of of (even non-intersecting) unit spheres that achieve
vertical decompositions for arrangements of spheres 6(n2) complexity. It is though possible to construct
in 3-space, see [4]. an 0(n) decomposition of the arrangement. Consider
Clarkson et al. [4] show that the complexity of the a three-dimensional grid whose unit size (along each
vertical decomposition of an arrangement of spheres of the coordinate axes) is 2 x rmax. The grid induces
is dominated by the complexity of the vertical walls a partitioning of 3-space into axis parallel unit cubes
erected from curves in E. They show a slightly super- (those cubes whose vertices are grid points and that
cubic upper bound on the complexity of the vertical do not contain any grid point in their interior). By
decomposition of an arbitrary collection of n spheres applying the same type of arguments as in the proof
in 3-space. In the next theorem we show another of Theorem 2.1, one can show that every cube in this
favorable property of the collection of spheres that partitioning intersects at most some fixed number of
we study: spheres. Moreover, each sphere intersects at most 8
cubes. Now take the collection of 0(n) non-empty
Theorem 2.3 The complexity of the vertical decom- cubes. It is easy to see that the vertical decomposi-
position of the arrangement A(M) for a collection of tion of this set has linear complexity. For each of the
spheres M as defined in Theorem 2.1 is 0(n2). cubes consider the arrangement of spheres that inter-

116
sect it, restricted to the cube and construct its verti- C with the box Q'. Using the same technique as in
cal decomposition (again restricted to the cube). This the proof of Theorem 2.1(i), it can be shown that the
will give a decomposition of the cube in a bounded number of answers is bounded by a constant. For each
number of simple pieces. As there are 0{n) cubes to of these answers we check whether the corresponding
decompose the total complexity will be linear. It is ball actually intersects Q. This takes 0(1) time. Us-
easy to see that the number of adjacencies between ing a standard range tree (see, e.g., [18, Section 2.3.4])
pieces is linear as well, which is an important prop- we obtain a solution that requires 0(n log2 n) prepro-
erty in certain applications (like motion planning). cessing time and space and answers queries in time
0(log2n).
Theorem 2.4 For a collection of spheres M as de- However, due to the special properties of the col-
fined in Theorem 2.1 there exists a decomposition of lection of spheres that we study, they admit a simpler
the arrangement A(M) into simple pieces of total and more efficient data structure. Like in the previous
complexity 0{n). section, we subdivide space into cubes of size 2 x rmax.
For each ball in M we compute the grid cubes that it
intersects. Let C be the set of non-empty grid cubes.
3 Intersection Queries The size of C is bounded by 0(n). We arrange the
cubes of C in a balanced binary search tree, ordered
Given a molecule it is required that we are able to by the lexicographic order of the (x,y,z) coordinates
answer certain queries efficiently. In particular inter- of the say, bottom-left-front vertex of the cube. With
section queries play an important role. For example, each non-empty cube we store the list of (at most a
in computer aided drug design, one wishes to manip- constant number of) balls of M that intersect it.
ulate a molecule in the presence of another molecule Given a query ball Q, we compute all the (at most
to see whether they fit together. During such ma- 8) grid cubes it intersects, and search for each of these
nipulation the molecules should not intersect. Hence, cubes in the binary tree, to see whether it is non-
with every change in the manipulated molecule an empty. If it exists we check the balls stored for inter-
intersection query with the other molecule must be section with Q. We might find some balls more than
performed. Also, it is often required to know whether once but duplicates can easily be removed. The total
particular positions in 3-space lie inside or outside the number of balls tested will be 0(1). This leads to the
molecule, i.e., whether a point intersects the molecule following result:
or not.
In this section we will devise a data structure that Theorem 3.1 Given a collection of n balls M as in
can be used to answer intersection queries with ei- Theorem 2.1, one can construct a data structure us-
ther a point or with a ball whose radius is bounded ing 0{n) space and O(nlogn) preprocessing time, to
by rmax. The query should report all atom balls that answer intersection queries for balls whose radii are
contain the point or intersect the query ball. We will not greater than r-max> in time O(logn).
use this structure in the next section to compute the
molecule boundary. Clearly a point is a degenerated The binary search tree in the above approach is
ball. Hence, a data structure that can answer queries only used to locate the different cubes. Hence, we
for balls can also answer point queries. Below we only can easily replace it by a hashing structure. Using
describe a structure for query balls. When imple- the perfect hashing results in [7] this leads to:
menting the structure though a distinction is made
because point queries can be answered faster (i.e., Theorem 3.2 Given a collection Mofn balls as de-
with smaller constants in the time bounds). fined in Theorem 2.1, one can construct a data struc-
Our first approach to solving this problem trans- ture using 0(n) space, to answer intersection queries
forms it into an orthogonal range query problem. Let for balls whose radii are not greater than rmaX; in
M be the set of n balls (as defined in Theorem 2.1) to 0(1) time. The randomized preprocessing time of the
store and let C be the set of centers of the balls. We structure is 0(n).
store the set C in a three-dimensional range tree that
can answer the following type of query: Given a query Recently, Fjällström and Petersson [8] have car-
axis-parallel box, report the points of C contained in ried out a comparative study of the behavior in prac-
the box. To report all the balls of M intersecting a tice of various three-dimensional range search struc-
query ball Q with radius TQ we construct a ball Q' tures, motivated by simulation of deformation pro-
with radius TQ +rmax and concentric with Q. Clearly, cesses. An interesting result of their study is that
the center of a ball of M intersecting Q must lie inside range trees do not perform well in practice (for the
Q'. Next, let Q' denote the axis-parallel bounding special test data that they experiment with), as com-
box of Q'. We query the range search structure on pared to other methods that they examined. In par-

117
ticular the best performing method in their study is a the solvent "sphere" is assumed to be fairly small.
grid-like method, similar to the one mentioned above. We denote the solvent molecule sphere by R.
We implemented this data structure although we We can rephrase the above problem in terms of
used double hashing rather than perfect hashing. motion planning in robotics: Let R be a spherical
The following table shows, for each of the four test robot moving in 3-space among spherical obstacles
molecules: their size, the building time, the time to (the balls in M). Describe the obstacles in a config-
answer 1000 point intersection tests and the time to uration space where every point represents a possi-
answer 1000 intersection tests for a ball with radius ble placement of R by the position of the center of
?*max- All running times are in seconds, on an Indigo R. In this formulation, the solvent accessible surface
R3000 workstation (25.4 specmarks). becomes the boundary of the outer cell of the free
portion of the configuration space. Unlike prevailing
mol. n build point query ball query formulations of motion-planning problems, the "ob-
1 42 0.01 0.14 0.20 stacles" in our case may intersect. However, as ex-
2 100 0.01 0.13 0.22 pressed in Theorem 2.1, these obstacles have other,
3 757 0.08 0.13 0.19 favorable, properties.
4 971 0.12 0.14 0.22 To compute the boundary of the outer cell of the
free configuration space, we follow a common practice
As can be seen the query time seems independent in motion planning, and compute the Minkowski (vec-
of the size of the molecule. Also, the query time tor) difference1 of each obstacle and the robot, to ob-
bounds are very low allowing, e.g., for testing whether tain the configuration obstacles. Now, the Minkowski
a molecule with 100 atoms intersects a molecule with difference of two spheres is again a (larger) sphere.
1000 atoms in 0.02 seconds, i.e., fast enough for in- Hence, our goal is actually to compute the outer com-
teractive use while manipulating the molecule. ponent of the union boundary for a collection of balls
in 3-space.
The solute molecule is modeled by balls as in The-
4 Computing the Boundary orem 2.1. The radius of each ball in M is increased
by r'—the radius of the solvent sphere. We assume
We now use the data structure of the previous section
r' to be of the same order of magnitude as rmax.
to efficiently compute the outer cell of the boundary
Note that, the expanded balls obey the conditions
of the union of the spheres. We assume that the union
of Theorem 2.1 for different constants r' • , r' , k'
consists of one connected component, which is often
and p'. Therefore, an algorithm for computing the
the case in our application setting. If the union is
union boundary for a collection M of balls as in The-
composed of several pairwise-disjoint connected com-
orem 2.1, is also applicable to computing solvent ac-
ponents, then additional measures must be taken; see
cessible surfaces. Thus, we present an algorithm for
below for more details.
computing the union boundary of a collection of balls
The boundary of the outer cell can be viewed as
M as defined in Theorem 2.1.
a formal molecular surface, which is of interest in
The scheme of the algorithm is to compute, for each
various applications in molecular biology. Moreover,
Bi e M, the contribution of its boundary to the union
we will show that the same algorithm, operating on
boundary and then to combine all this information to
a closely related set of balls, solves another prob-
give the final output of the algorithm. The algorithm
lem in computational biology, sometimes referred to
consists of four steps:
as computing the approximate solvent accessible sur-
face (see, e.g., [14, 5, 16]). This involves the inter- 1. For each ball identify the other balls intersecting
action of solute and solvent molecules in a solution. it.
In a simplified model, the question may be formu-
lated as follows: Which parts of a molecular sur- 2. For each ball compute its (potentially null) con-
face of a solute molecule are accessible to the solvent tribution to the union boundary.
molecules, where the latter are modeled by spheres (a
3. Transform the local information into global
single sphere each). We will assume that the solute
structures describing the connected components
molecules are modeled by the hard sphere model.
of the union boundary.
An approach to solving this problem is proposed in
[14]: Roll a sphere representing the solvent molecule 4. Filter out portions of the union boundary that do
on a reference surface, to obtain a new surface de- not belong to the desired connected component
scribed by the center of the rolling sphere. The refer- of the "outer cell".
ence surface, in our case, is the boundary of the union 1
The Minkowski difference of two spatial sets A and B,
of the balls in the hard sphere model. In most cases, A - B, is the set {p - q\p £ A,q £ B}.

118
If all we need is a list of the faces of the union edge along /, as required for the quad-edge structure.
boundary (as is the case in the preparatory stage of Also for each edge e bounding / we determine the ar-
the hidden surface removal algorithm of Section 5) rangement Aj containing the face /' on the opposite
then we only need Steps 1 and 2. side of / (j can be i because of the extra arcs we
For Step 1, we use the data structure described in added). /' can be found in time 0(1) because only
Theorem 3.2. The cost of the query for each ball is a constant number of spheres intersect 5,. We locate
0(1), hence the total cost of this step is 0{n) ran- e in Aj, add pointers between the copies of e and re-
domized time (or O(nlogn) deterministic). cursively treat /' in Aj if it was not visited before. In
this way we continue until we have located the whole
As for Step 2, consider a ball Bi and the family
connected component of the boundary containing /.
of (a constant number of) balls intersecting it. Let
If not all free faces have been visited we take one of
Bj be a ball intersecting Bi. If B3 fully contains Bi,
the non-visited faces and continue from there. It is
then we stop the process for Bi, as it cannot con-
easy to see that this requires time 0(n) in total.
tribute in any way to the union boundary. If Bj is
fully contained in Bi, then we ignore Bj, for obvi- As a result of Steps 2 and 3 we get a quad-edge
ous reasons. Otherwise, we compute the intersection representation of each connected component of the
between the spheres Sz and Sj, which is a circle Cij union boundary of the balls in M. Recall that we
on Si. The circle CV,- partitions Si into two parts: are only interested in the boundary of the outer cell,
One part may appear on the union boundary, and we which we assumed to be connected. At this stage we
will refer to it as the free part of Sz with respect to need to identify the outer cell (Step 4). We search
Sj, and the other is completely contained in Sj and for the ball Bt e M having the point with largest
therefore cannot appear on the union boundary. We ^-coordinate on its boundary. We then determine an
repeat the process for each ball intersecting Bi, to get edge on the boundary of the face /; of Bt contain-
a collection of circles on S*. These circles form a 2D ing the highest point. This face clearly belongs to
arrangement Ai on Si. A face of A belongs to the the outer cell. From this face we scan the entire con-
union boundary if and only if it belongs to the free nected component containing fi, using the quad-edge
portion defined by each circle Cij. Since the number structure. We mark every edge found throughout the
of circles on Si defined in that way is constant, the ar- scan, as belonging to the outer cell. Finally we delete
rangement can be computed by a brute force method any edge that has not been marked in the previous
in constant time, together with the attribute whether step. The remaining structure describes the outer
a face is free or not (a free face is guaranteed to ap- cell. This takes time proportional to the size of the
pear on the union boundary). The complexity of the union boundary which is 0(n).
arrangement Ax is evidently constant. For each ball As for space requirements, the data structure of
in M, the above procedure will take constant time. Theorem 3.2 requires 0(n) space. The additional
In Step 3 we will represent each connected compo- structures described above are easily verified to re-
nent of the union boundary by a quad-edge structure quire linear space.
[10]. To this end we have to augment the arrange-
ments Ai slightly. If Ai is the whole sphere Si we
split it into two parts with some circle. Next, if a
Theorem 4.1 The outer portion of the boundary of
boundary component of A is a simple circle C we
the union of a connected collection of balls as defined
split C into two arcs adding two vertices. (If C lies
in Theorem 2.1 can be computed in 0(n) randomized
in both Ai and Aj the same vertices should be added
time (or 0(n log n) deterministic), using 0(n) space.
in both arrangements.) Finally, if a free face of Ai
contains holes we split it by adding extra arcs. (To
make these additions canonical, we can fix a direction
d, and add all the extra arcs along great circles that If the union of the balls is not connected, additional
are intersection of the sphere with planes parallel to machinery is required to identify and discard compo-
the direction d.) After this step, which can easily nents lying in internal cells. This can be done in time
be performed in time 0(n), the union boundary will 0{n log n) by computing the decomposition of A{M)
consist of simple faces where each face is bounded by as described in Theorem 2.4 and traversing the outer
at least two edges and each edge bounds exactly two cell of this arrangement. Details will be given in the
faces (assuming general position). full paper.
Now we proceed as follows: We take some free face We only implemented Steps 1 and 2 of the above
/ of some Ai, that was not treated before, and de- algorithm because that is all that is required for hid-
termine its boundary. In this way we obtain for each den surface removal. The following table shows the
edge e bounding / pointers to the previous and next running time for our four molecules.

119
mol. Step 1 Step 2 spheres. It is good enough to draw the pieces of the
1 0.02 0.2 spheres that constitute the boundary of the union,
2 0.05 0.7 as computed in the previous section. Clearly, pieces
3 0.42 6.5 of the spheres that do not contribute to the bound-
4 0.54 7.5 ary cannot be visible. Also the parts of the sphere
that point away from the viewing direction cannot be
As can be seen Step 2 dominates the amount of seen. We will show that for the remaining part of the
time required, while theoretically both steps take boundary a depth order does exist.
time O(n). It is though easy to verify that the oper-
ations involved in Step 2 are much more complicated Theorem 5.1 Let S = Si,...,Sn be a collection of
and, hence, the constants in the bound are much spheres sorted by decreasing z-coordinate of their cen-
higher. ter (i.e., from back to front). For each Si let Hl
be the hemi-sphere facing the viewing direction. Let
Hj,...,H-1 be the collection of maximal pieces of Hi
5 Hidden Surface Removal that are part of the boundary of the union of the
One of the tasks of molecular modelling packages is spheres. Then
to display molecules. This should preferably be done Tjl TlJl I/I ZJJ2 TTI UJr,
so fast that the user can interact with the model,
e.g., by turning it around to look at it from different is a valid depth order for the pieces on the boundary.
directions or by moving different molecules with re-
spect to each other, for example to see whether they Proof. We will prove this by contradiction. So as-
fit together in some nice way. Hence, one needs fast sume there are two pieces HJ* and Hl- that are in the
algorithms for hidden surface removal among sets of wrong order. Clearly i ^ j so let us assume i < j.
intersecting spheres. H.\ and Hl- are in the wrong order so there must be
In practice one normally uses the Z-buffer algo- a ray in the viewing direction that first hits H\ and
rithm for this. Almost all 3-D graphics workstation than Hlj (so H\ partially hides #j). Because H\ and
available nowadays have such an algorithm imple-
Hlj belong to the union boundary, the ray must first
mented in their graphics hardware. Unfortunately,
such hardware can only handle polyhedral objects. hit Hf, next the back of Ht, next Hj, and finally the
Hence, as a first step, one has to approximate the back of Hj. But this implies that the back of Hj lies
spheres by triangular meshes. Different methods ex- behind the back of Ht and, hence, j < i, which con-
ist but all lead to a large number of faces. To get tradicts our assumption. □
a reasonable sphere one needs at least 100 triangles.
So a molecule of 1000 atoms requires the drawing of This leads to the following algorithm. We first com-
100,000 triangles in 3-space. Even special graphics pute the boundary of the union. In this way, for each
hardware (except maybe the most expensive types) sphere Si we collect a (constant) number of pieces
cannot display such molecules fast. It would typically that it contributes to the boundary. For each of these
take between one and a few seconds. pieces we cut off the part that does not lie in Hi. Next
we sort the spheres by depth and draw the pieces in
A second approach used in computer graphics is this order. As shown in the previous section comput-
the painter algorithm. Here one tries to define a ing the boundary takes deterministic time 0(n log n)
depth order on the objects, sorting them from back and results in 0(n) pieces. The sorting of the spheres
to front. Next one draws the objects in this order on by depth takes time 0(n log n). Hence, we obtain the
top of each other (like a painter) where each new ob- following result:
ject hides the parts of other objects that lie below it.
Such an approach does not require special graphics Theorem 5.2 Given a set of n spheres as defined in
hardware and, hence, can also be used on, e.g., laser Theorem 2.1, a valid depth order consisting of 0(n)
printers. The problem though is that one needs a pieces can be computed in time 0(n log n).
valid depth order on the objects. Such an order does
not always exist (there can be cyclic overlap among We implemented this algorithm. Actually, we split
objects). Also, for intersecting object such an order it into two phases: In the preprocessing phase we
obviously does not exist. compute the boundary of the union and for each
For sets of non-intersecting spheres an easy depth sphere we collect the pieces that are part of the
order exists: simply sort the spheres by z-coordinate boundary. (See the previous section for time bounds.)
of their center. But for intersecting spheres this does In the query phase we are given a particular viewing
not apply. There is though no need to draw the entire direction. Now we compute the hemi-spheres (which

120
are dependent on the viewing direction) and cut off quality Postscript pictures which is impossible with
the parts that lie outside it. Next we compute the the Z-buffer algorithm.
depth order for the spheres and draw the pieces. All
In some applications a depth order is not enough
pictures in this paper were generated using this ap-
but one wants a combinatorial representation of the
proach. The implementation (even though not yet
visible pieces, the visibility map. A lot of work has
fully optimized) is rather fast. We did run it on two
been done in computational geometry in producing
different machines: An Indigo R3000 machine with
visibility maps. See, e.g., the book of de Berg [6].
entry level graphics and an Indigo R3000 XS24 with
For collections of arbitrary intersecting spheres the
hardware Z-buffer. The first machine performs the
best known hidden surface removal algorithm runs
Z-buffer algorithm in software while the second one
in randomized expected time 0(n2+e) for any e > 0
has special purpose hardware for this. The following
(using the general algorithm for computing the lower
table shows the amount of time (in seconds) required
envelope of low-degree algebraic surfaces in 3-space
per frame for both the Z-buffer algorithm and our
by Sharir[19]). No output-sensitive method, where
method.
the time bound depends on the complexity of the re-
entry graphics XS-24 sulting visibility map, is known. In the case of a set
mol. Z-buf new Z-buf new of non-intersecting spheres the best known method
1 0.5 0.2 0.1 0.1 is presented in [12]. It runs in time 0((n + k) log n)
2 1.1 0.5 0.25 0.3 where k is the complexity of the visibility map (which
3 5.5 3.6 1.85 2.0 can be 0(n2), even for non-intersecting unit spheres).
4 7.4 4.6 2.35 2.9 We will now briefly indicate how the method of [12]
can be adapted to work for intersecting spheres as
From these figures one might conclude that the well. For more details see the full paper. We assume
new method runs about twice as fast on the entry some familiarity with the method of [12].
level system while it is slightly slower on the XS-24. For the method of [12] to work one needs to sub-
This should though be treated with care. First of all, divide the objects in a (small) collection of pieces
the pictures produced by the two methods are quite that first of all has a depth order and, secondly, has
different. The way we implemented it, the Z-buffer the property that the union of the projection on the
algorithm produces a Gouraud shaded image while viewing plane of the pieces lying in any depth range
our new method produces a flat shaded image (be- has small complexity. One could use the collection of
cause the method draws in 2-d one cannot produce pieces as defined in Theorem 5.1. It is though unclear
anything else). Our method though draws boundary whether this collection satisfies the second condition.
lines around the spheres and along the intersections Hence, we define a different set of pieces.
(like in Figures 1 till 4) while the Z-buffer method For each sphere Si we again consider the hemi-
does not (it cannot because it does not know where sphere Hi. We take the pieces of Hi that are con-
the intersections are). Also the picture quality differs tained in the boundary of the union of {Hi,...,Hi},
largely. On 8-bit systems the Gouraud shaded image i.e., we ignore the spheres that lie nearer. In a way
looks rather displeasing while the images produced by similar to the proof of Theorem 5.1 one can prove
the new method look much nicer. Also there is the that these pieces constitute a valid depth order. In
issue of precision. For the Z-buffer we used an ap- the full paper we will also prove that for any z-range
proximation of the spheres with about 100 triangles. the union of the projection of the pieces whose sphere
In the new method we used an approximation of the center lies in the range, is linear. Applying the results
circles and ellipses (projected sphere boundaries and in [12] we obtain:
intersections) with 24 edges, which is better. Finally,
the difference in time for our new method on the two Theorem 5.3 Given a set of n spheres as defined in
different platforms is caused because, on the entry Theorem 2.1, the visibility map can be computed in
level systems, more than half of the time is spent in time 0((n + fc)log2n), where k is the complexity of
the actual drawing, not in the computation of the the resulting map.
depth order. On the XS-24 this is much less. For
more details on the implementation see [9].
So we can conclude that our new approach pro- 6 Conclusion
duces nice images and can be used on simple graphics
workstations without 3-D capabilities. Even on ma- We have considered the hard sphere model of a
chines with 3-D graphics hardware the method be- molecule in a fixed nuclear configuration from a com-
haves comparably. Finally, and probably most im- putational geometry point of view. We have shown
portant, the new method can be used to produce high that the collection of spheres representing the atoms

121
of a molecule in that model behaves favorably in com- bounds for arrangements of curves and spheres, Dis-
parison with an arbitrary collection of spheres in 3- crete and Computational Geometry 5 (1990), pp. 99-
space. Using this observation we were able to de- 160.
vise a data structure that efficiently detects which [5] M.L. Connolly, Solvent-accessible surfaces of proteins
atom spheres of a molecule are intersected by a query and nucleic acids, Science 221 (1983), pp. 709-713.
sphere (of bounded radius). Then, we presented an [6] M. de Berg, Ray shooting, depth orders and hid-
efficient algorithm for computing the boundary (or den surface removal, Springer LNCS 703, Springer-
envelope) of the union of atom spheres. Furthermore, Verlag, 1993.
we presented efficient algorithms for hidden surface [7] M. Dietzfelbinger, A. Karlin, K. Mehlhorn, F. Meyer
removal of a molecule. Our results have been sup- auf der Heide, H. Rohnert and R.E. Tarjan, Dynamic
ported by experiments carried out on actual protein perfect hashing: upper and lower bounds, Proc. 29th
IEEE Symposium on Foundations of Computer Sci-
data, displaying the efficiency and practicality of our
ence, 1988, pp. 524-531.
approach.
We believe that other (algorithmic) problems in [8] P.-O. Fjällström and J. Petersson, Evaluation of al-
gorithms for geometrical contact-searching problems,
molecular modelling can be solved efficiently using
manuscript, 1993.
the data structures and properties presented in this
[9] G-J. Giezeman and M.H. Overmars, Fast display of
paper. The area also provides many other chal-
molecular models, in preparation.
lenging problems, like: Is it possible to preprocess
[10] L.J. Guibas and J. Stolfi, Primitives for the manipu-
two molecules such that one can efficiently determine
lation of general subdivisions and the computation of
whether, in a particular pose, the molecules intersect Voronoi diagrams, ACM Transactions on Graphics,
or not? Also other models of molecules give rise to 4 (1985), pp. 74-123.
interesting question. For example, there is the prob- [11] Handbook of Biochemistry, H.A. Sober, Editor, The
lem of hidden surface removal for the ball-and-stick Chemical Rubber Co., 2nd Edition, 1970.
model where atoms are represented by small balls and [12] M.J. Katz, M H. Overmars and M. Sharir, Efficient
the links by thin sticks. We plan to work further on hidden surface removal for objects with small union
these problems. size, Corap. Geom.: Theory and Appl., 2 (1992), pp.
223-234.
[13] K. Kedem, R. Livne, J. Pach and M. Sharir, On the
Acknowledgements union of Jordan regions and collision-free transla-
The authors wish to thank Ed Moret, Raquel Norel and tional motion amidst polygonal obstacles, Discrete
Haim Wolfson for helpful discussions and for supplying and Computational Geometry 1 (1986), pp. 59-71.
various data and references on molecular structures. We [14] B. Lee and F.M. Richards, The interpretation of pro-
would like to thank Geert-Jan Giezeman who did most of tein structure: Estimation of static accessibility, J.
the implementation work. of Molecular Biology 55 (1971) pp. 379-400.
[15] J. Matousek, N. Miller, J. Pach, M. Sharir, S. Sifrony
and E. Welzl, Fat triangles determine linearly many
References holes, Proc. 32nd IEEE Symposium on Foundations
of Computer Science, 1991, pp. 49-58.
[1] E.E. Abola, F.C. Bernstein, S.H. Bryant, T.F. Koet-
zle and J. Weng, Protein data bank, in Crys- [16] P.G. Mezey, Molecular surfaces, in Reviews in Com-
tallographic Databases: Information Content, Soft- putational Chemistry, Vol. I, K.B. Lipkowitz and
ware Systems, Scientific Applications, F.H. Allen, D.B. Boyd, Eds., VCH Publishers, 1990.
G. Bergerhoff and R. Seivers, Eds., Data Comis- [17] M. H. Overmars, Point location in fat subdivisions,
sion of the International Union of Crystallography, Inform. Proc. Lett., 44 (1992), pp. 261 - 265.
Bonn/Cambridge/Chester, 1987, pp. 107-132. [18] F.P. Preparata and M.L Shamos, Computational
[2] F.C. Bernstein, T.F. Koetzle, G.J.B. Williams, E.F. Geometry—An Introduction, Springer Verlag, New
Meyer Jr., M.D. Brice, J.R. Rodgers, O. Kennard, T. York, 1985.
Shimanouchi and M. Tasumi, The protein data bank: [19] M. Sharir, Almost tight upper bounds for lower en-
A computer-based archival file for macromolecular velopes in higher dimensions, Proc. 34th Annu. IEEE
structure, Journal of Molecular Biology 112 (1977), Sympos. Found. Comput. Sei., 1993, pp. 498-507.
pp. 535-542. [20] A.F. van der Stappen, D. Halperin and M. H. Over-
[3] B. Chazelle, H. Edelsbrunner, L. Guibas and M. mars, The complexity of the free space for a robot
Sharir, A singly-exponential stratification scheme moving amidst fat obstacles, Comput. Geom.: The-
for real semi-algebraic varieties and its applications, ory and Appl., 3 (1993), pp. 353-373.
Theoretical Computer Science 84 (1991), pp. 77-105. [21] A. Varshney and F.P. Brooks Jr., Fast analytical
computation of Richards's smooth molecular surface,
[4] K.L. Clarkson, H. Edelsbrunner, L.J. Guibas, M.
Proc. Visualization '93, 1993, pp. 300-307.
Sharir and E. Welzl, Combinatorial complexity

122
Determining the Castability of Simple Polyhedra*
Prosenjit Bose David Bremner Marc van Kreveld
McGill University McGill University Utrecht University

Abstract (see e.g. [12, 23]), only two cast parts are used. To con-
struct the cast parts, a prototype of the object is first
A polyhedron P is castable if its boundary can be par- obtained (see Figure 1). The prototype is then divided
titioned by a plane into two polyhedral terrains. Such into two parts along a plane. The face along which the
polyhedra can be manufactured easily using two cast part is cut is referred to as the base. The first cast
parts. Assuming that the cast parts are removed by part is made by placing the base of the part on a flat
a single translation each, it is shown that for a simple surface, and then adding sand around it. The part is
polyhedron with n vertices, castability can be decided then rotated such that the base is facing up. The other
in 0(n2logn) time and linear space using a simple al- part is placed such that the bases coincide and the sec-
gorithm. Furthermore, a more complicated algorithm ond cast part is built by adding sand around this part.
solves the problem in 0(n3/2+e) time and space, for any An opening into the cavity is maintained during the
fixed e > 0. In the case where the cast parts are to construction of the second cast part. This completes
be removed in opposite directions, a simple 0(n2) time the construction of the cast of the prototype object. To
algorithm is presented. Finally, if the object is a con- built a metal rendition of the prototype object with this
vex polyhedron and the cast parts are to be removed cast, liquid metal is poured into the opening until it fills
in opposite directions, a simple 0(n log2 n) algorithm is the cavity. After the metal solidifies, the cast parts are
presented. removed from the object. To be able to construct the
cast with this process, it is necessary that the proto-
type can be removed without breaking the cast. Also,
1 Introduction for manufacturing methods related to sand casting such
A new application area of computational geometry is in as other metal casting methods [12, 23] and injection
molding and blow molding methods for plastics [20, 24],
the area of automated manufacturing, where an engi-
neer can design an object with the aid of a computer, it must be possible to remove the constructed object
and determine by which manufacturing process the ob- from the cast without breaking it in order to re-use the
ject can be constructed. There are several types of man- cast. Thus for several different manufacturing methods
ufacturing processes studied in computational geometry, involving casting, the geometry of the object determines
such as injection molding [5, 6, 13], NC machining [14], its feasibility of construction.
automated welding [17] and layer deposition methods We note that more complicated objects can be made
(such as stereolithography) [3]. by using cores and inserts [12, 20, 23, 24]. However, their
In this paper, we study the geometric and computa- use slows down the manufacturing process and makes it
tional aspects of casting. Casting consists of filling the more costly. Thus to be cost efficient, cores and inserts
open region bounded by two or more cast parts with should be avoided. We do not study the extra possibil-
a material such as a liquid metal, after which the cast ities of cores and inserts in this paper.
parts are removed. The removal of the cast parts with- An object is castable if it can be manufactured by
out breaking them imposes certain restrictions on the casting. Geometric and algorithmic issues of casting
shape of the object to be constructed. For sand casting of planar objects has been studied by Rosenbloom and
*This research is supported by the NSERC and the ESPRIT Rappaport [21]. This paper addresses casting of poly-
Basic Research Action 7141 (project ALCOM II: Algorithms and hedral objects. In geometric terms, castability can be
Complexity). defined as follows (for a polyhedron P, dP denotes the
boundary of P, and for a plane h, h+ and h~ refer to
Permission to copy without fee all or part ^tWs materiallis
aranted provided that the copies are not made or distributed TOT the open half-spaces above and below h):
drect commercial advantage, the ACM copynght npt.ce and the
tx e of the pubHcation and its date appear, and not.ce is given Definition 1 A simple polyhedron P is castable if there
haUopffis by permission of the Association of Computing
BfcSSflFro copy otherwise, or to republ.sh, requires a fee
exists a plane h such that h+ D dP is a weak terrain in
and/or specific permission. some orientation, and h~C\dP is a weak terrain in some
10th Computational Geometry 94-6/94 Stony'Brook, NY, USA
© 1994 ACM 0-89791 -648-4/94/0006..$3.50

123
add sand liquid metal
add sand sand cast of upper half

forming the
metal object
sand cast of lower half remove prototype halves
from the cast parts

Figure 1: Construction of an object by sand casting, using two halves of the object as prototypes.

orientation. The plane h is called the casting plane. (A one translation each, and in opposite directions
weak terrain may contain edges and facets parallel to the (opposite cast removal).
orientation in which it is a terrain.)

To manufacture a polyhedron P that is castable, first 3. The two cast parts must be removed from P by
determine a casting plane h for P. Then the cast parts one translation each, in arbitrary directions (arbi-
C\ and C2 are made from the prototype halves h+ n dP trary cast removal).
and h~ n dP. Since P is castable, the prototype halves
can be removed from the cast parts, and later the man- In manufacturing, developing machines that perform
ufactured object can be removed from the cast parts. orthogonal and opposite cast removal is much simpler
Although our algorithms deal with the sand casting pro- than machines that perform arbitrary cast removal. In
cess, they can be applied in related processes as well. fact, opposite cast removal seems to be the most popu-
We consider three versions of the castability problem. lar technique used [8, 20]. Furthermore, if orthogonal or
They differ in the way the cast may be removed from opposite cast removal is possible, it can be determined
the polyhedron P. Figure 2 shows the three versions for more efficiently. We summarize the complexity of the
planar polygons. different algorithms we developed for the casting prob-
lem. In the top half of the table, the time bounds of
simple, linear space algorithms are shown. The bottom
half of the table shows improvements made (in theory)
by using 0(n3/2+e) storage (for any positive constant
«0-

lin. space orthogonal opposite arbitrary


convex 0(n log2 n) 0(nlog n) <9(n2 log n)
simple 0(n2) 0(n2) 0(n2logn)
best res. orthogonal opposite arbitrary
convex 0(n3/2+e)
Figure 2: Three versions of the castability problem. simple 0(n3/2+e) 0(n3/2+e) 0(n3/2+e)

1. The two cast parts must be removed from P by Our algorithms depend on geometric properties of
one translation each, in opposite directions, and casting, discussed in Section 2. The maximum number
normal to the casting plane (orthogonal cast re- of distinct cast planes is analysed in Section 3, and al-
moval). gorithms are given in Sections 4 and 5. For detailed
proofs and descriptions of the algorithms, we refer the
2. The two cast parts must be removed from P by reader to the technical report [4].

124
2 Preliminaries that the bounding plane contains the origin. Let

For a polyhedron P, denote by V, E and F the set S+(h) = f| *0(/)andrW= PI W)'


of vertices, edges and facets. Edges that bound two f€F+UF£ /€F-UF*
parallel facets are not allowed; they can be removed
without changing the shape of the polyhedron. Edges The intersection of a set of half-spaces is non-trivial if it
and facets are open, the closure of an edge e or facet / contains more than a single point. Denote by refl(b) the
is denoted by cl(e) or cl(f). Although technically the reflection of an object b through the origin. We make
object to be constructed is the interior of P, and the the following observations.
boundary of P is part of the cast, with a slight abuse
of notation, we nevertheless state that P is castable or Lemma 1 h is a casting plane for polyhedron P for
not castable. arbitrary cast removal if and only if £+(h) and £~(h)
are both non-trivial.
For a non-vertical plane h, we denote by h+ and
h~ the open half-spaces above and below h. If h is Lemma 2 h is a casting plane for polyhedron P for
vertical but does not contain a line parallel to the y-axis, opposite cast removal if and only if t;+(h) n refl{(,~{h))
then h+ and h~ denote the open half-spaces bounded is non-trivial.
by h that contain the points (0,oo,0) and (0, —oo,0),
respectively. If h is vertical and contains a line parallel Lemma 3 Let h be a plane and let £ be a line perpen-
to the 2/-axis then h+ and h~ denote the open half- dicular to h and through the origin, h is a casting plane
spaces bounded by h that contain the points (oo,0,0) for polyhedron P for orthogonal cast removal if and only
and (—oo,0,0), respectively. if £n£+(h) n refl(£~(h)) is non-trivial.
Let P be a polyhedron and let h be a plane that
intersects P. If h is a casting plane and the upper cast With the above lemmas, we can test for a given plane
part can be removed in direction u, then the outward h efficiently whether it is a casting plane for P. Since
normal of any facet / of P that lies in h+ makes an angle the casting problem for a plane h and a polyhedron P
at most 7r/2 with u. This also holds when / lies partially can be transformed in linear time to a linear program-
in h+. Also, if all facets of P that lie completely or ming problem in 3 dimensions, the test requires only
partially in h+ make an angle at most 7r/2 with ü, then linear time [18]. In fact, since all planes bounding the
h+ n dP is a weak terrain. Therefore, castability with half-spaces contain the origin, the linear programming
respect to a plane h is only determined by the facets of problem is basically 2-dimensional.
P that intersect h+ and the ones that intersect h~. lih
is a casting plane for P, then h can be perturbed if this Lemma 4 Given a polyhedron P and a plane h, one
does not involve new facets intersecting h. In case of can test in linear time whether h is a casting plane for
orthogonal cast removal, the only perturbation allowed P in any of the three versions for removing the cast.
is translation.
2.2 Geometric properties of casting
Observation 1 For castability with orthogonal cast re- In this section, we uncover some important geometric
moval, we may assume that the casting plane contains properties of casting planes that will allow us to bound
at least one vertex of P. For opposite and arbitrary cast the number of distinct casting planes and hence develop
removal, we may assume that the casting plane contains efficient algorithms.
at least three vertices of P.
Lemma 5 If a simple polyhedron P is castable in non-
opposite directions with casting plane h, then h contains
2.1 Relation to linear programming an edge of P.
Let P be a polyhedron and let h be a plane. The plane Lemma 6 If a simple polyhedron P is castable with
h partitions the set V of vertices of P into three subsets casting plane h and in non-opposite directions, then h
Vh, V^~ and V^ of vertices in, above and below h, re- contains an edge of the convex hull of P.
spectively. Similarly, h partitions the set E of edges of P
in four subsets Efr, E£, E^ and E^ of edges contained Notice that the above two lemmas imply that if a
in h, intersecting h, above h and below h, respectively. polyhedron is castable, but not with opposite cast re-
The set F of facets is partitioned in the same way. For moval, then the casting plane contains both an edge of
any facet / e F, denote by *(/) the closed half-space P and an edge of the convex hull of P (this might be
supporting / but not containing the interior of P. De- the same edge). This will aid considerably to determine
note by *o(/) the same half-space, but translated such castability with arbitrary cast removal.

125
The following lemma forms the crucial link between removal, we have the following properties of intersec-
simple polyhedra and convex polyhedra in terms of tions of a casting plane h and a polyhedron P: (i) The
castability with removal directions restricted to orthog- facets of Fx that intersect h properly have their out-
onal and opposite. ward normals such that when translated to the origin,
they span a plane or part of it (since f]{*o(/) I / £ ^x}
Lemma 7 If a simple polyhedron P is castable, then the contains a line through 6). (ii) All edges that intersect h
convex hull of P is also castable using the same casting properly are parallel (otherwise the incident facets span
plane and cast removal directions. more than a plane), (iii) Any two vertices in the closure
of a facet / and in h are antipodal in cl{f). Any ver-
Lemma 8 // the casting plane h properly intersects a tex and edge in the closure of / and intersecting h are
facet f of convex polyheron P, and also two vertices antipodal in cl(f) (see Lemma 8).
u.v in the closure of f, then for opposite cast removal,
vertices u,v must be antipodal in cl(f). Lemma 9 Given a convex polyhedron P, the number
of distinct casting planes that intersect some edge of P
Corollary 1 Let h be a casting plane for a convex poly- properly is at most linear in the number of vertices of
hedron P which intersects a facet f properly, and as- P, assuming opposite cast removal.
sume opposite cast removal. If h intersects a vertex v
and properly intersects an edge e in the closure of f, Let h be a candidate casting plane of P, and let
then v is antipodal to both endpoints of e. If h properly Q = h n P. If Q contains three consecutive vertices
intersects two edges in the closure of f, then they are u,v,w that are also vertices of P, then each of u and
parallel. w is either an endpoint of an edge incident to v, or a
vertex antipodal to v on the closure of a facet / incident
Lemma 8 and Corollary 1 are the two geometric facts to v. We say that the plane through u,v,w is generated
that allow us to solve opposite cast removal more effi- by v. It follows that the set of candidate casting planes
ciently than arbitrary cast removal. generated by v has size (d^a), where d is the degree of v
In [4], we also show that for a convex polyhedron P, and a is the number of vertices antipodal to v in the clo-
the linear programming problems defined by P and a sures of the facets incident to v. Every casting plane h
candidate casting plane h need not consider all facets of that does not intersect any edge properly contains three
F, but only those intersecting h and those adjacent to vertices that are consecutive in hnP, and therefore, ev-
h, leading to the algorithm described in Section 4. ery such casting plane is generated by some vertex of P.
It is straightforward to prove that every convex polyhe-
dron has a vertex of constant degree which participates
3 The number of distinct casting in a constant number of antipodal pairs (on the incident
planes facets). Using this fact inductively, we obtain:

Given a polyhedron P, two planes h\ and h2 are (combi- Theorem 1 Given a convex polyhedron P with n ver-
natorial^) distinct if the partitioning of the facets into tices, the maximum number of distinct casting planes
F+, F~, Fc and Fx they define is different. By Ob- for P is 0(n), assuming opposite removal of the cast
servation 1, a trivial upper bound on the number of parts.
distinct casting planes for a polyhedron with n vertices
is 0{n3). There is another interesting combinatorial bound on
This section gives a linear upper bound on the maxi- the complexity of the intersection of all distinct casting
mum number of distinct casting planes for convex poly- planes with a convex polyhedron. Two distinct casting
hedra in case of orthogonal and opposite cast removal planes hi and h2 that properly intersect the same edge
as well as a quadratic upper bound for arbitrary cast are similar, because they define the same cast removal
removal. directions, and they intersect the same closure of edges
and facets. In other words, if hi and hi each properly
3.1 Orthogonal and opposite cast re- intersect edges that are parallel, there cannot be two
vertices u, v strictly to the one side of hi and strictly
moval to different sides of h2 ■ We use the term weakly equiv-
We restrict our attention to opposite cast removal, since alent for two such planes. Two planes are weakly dis-
orthogonal cast removal is (close to) a special case of op- tinct if they are not weakly equivalent. There are 0{n)
posite cast removal, and there are only minor differences weakly distinct casting planes for any convex polyhe-
between the two cases. For an explicit rendition of the dron P with n vertices. We analyse the combinatorial
differences, we refer the reader to [4]. For opposite cast complexity of h n P, summed over all weakly distinct

126
casting planes h. This quantity is well-defined for op- Corollary 2 Given a convex polyhedron P with n ver-
posite cast removal, since two weakly equivalent casting tices, the maximum number of planes that intersect the
planes have an equal-size intersection with P (although interior of P but do not intersect any facets of P is
they may intersect different facets, edges and vertices). 0(n), and the maximum number of edges of P contained
We prove a bound of 0(n log n) on the summed com- in these planes, summed over all planes, is 0(n log n).
plexity. Note that when the sum is over all distinct cast-
ing planes (not weakly distinct), the summed complex- 3.2 Arbitrary cast removal
ity can be 0(n2) if P has a set of ft(n) parallel edges.
The bound makes use of a hierarchical decomposition We have shown that the number of casting planes that
of P that closely resembles the hierarchy of Dobkin and also allow opposite cast removal is linear. For the other
Kirkpatrick [10]. It is the basis of the 0{n log2 n) time casting planes, we know from Lemma 5 that they con-
algorithm for casting of convex polyhedra with opposite tain an edge of P. Since we may also assume that they
cast removal. contain a third vertex, we conclude:
Theorem 3 Given a convex polyhedron P with n ver-
Lemma 10 Given a convex polyhedron P with n ver- tices, the maximum number of distinct casting planes
tices, there exists a subset V of the vertices V of size for P is 0(n2), assuming arbitrary removal of the cast
ft(n), such that each v € V has degree < 8 and is an- parts.
tipodal to < 12 vertices in facets incident to v.

The following hierarchical decomposition of P gen- 4 Algorithms for orthogonal and


erates a set of planes that contains all the candidate
casting planes that do not intersect an edge properly:
opposite cast removal
In this section and the next, algorithms are presented for
1. Mark all edges of P as "original". Compute all the computation of casting planes, and hence, determine
antipodal pairs of all facets of P and mark them whether a given polyhedron is castable. This section
as "original". Set i = 1. focuses on orthogonal and opposite cast removal.
2. Select a subset Vx of V as in Lemma 10. For every
vertex v £ Vi: generate all planes through u,v,w 4.1 A simple algorithm for simple poly-
for which uv and vw are original edges, or (u,v) hedra
and (v, w) are original antipodal pairs, or one is an
We compute 0(n) candidate casting planes as follows.
original edge and the other an original antipodal
pair. For every vertex v £ V», the number of gen- By Lemma 7, we need only consider the casting planes
erated planes is at most (122+8) = 190, thus 0(n) of the convex hull of P. We first compute the candidate
casting planes that intersect some edge properly, and
for the whole subset.
then the ones that are generated. We only consider op-
3. Recompute the convex hull of the vertices of P posite cast removal; the case of orthogonal cast removal
minus the vertices of Vx. only requires some straightforward changes.
4. Recompute the antipodal pairs of the facets. Let Ei,...,Ekbe& partitioning of E into subsets of
(Note: Edges or antipodal pairs of CH(P \ Vi) parallel edges. Let Vf be the set of vertices that must
are not original unless they were deemed original be contained in the casting plane for the cast removal
in step 1.) direction parallel to the edges of E{. For each Ei, we
compute the convex hull G+ of the lower endpoints of
5. Repeat at step 2 with i = i + 1 unless P has no Ei and the convex hull G~ of the upper endpoints of Ei.
vertices left. The convex hull of \Ei\ points in 3-dimensional space can
be computed in 0(|Ei|log|Ei|) time, see e.g. [11, 19].
As in [10], the number of subsets Vi is O(logn). It Then we compute all planes that contain the vertices
follows—as we show in [4]—that every ft (log n) consecu- of Vf and separate the interiors of Gf and G~, and
tive vertices of P contained in a casting plane h contains contain at least three vertices of Vf, Gf and G~. This
a vertex that generates h. This leads to: gives 0(\Ei\) candidate casting planes. Summed over all
subsets Ei,...,Ek, we obtain 0(n) candidate casting
Theorem 2 Given a convex polyhedron P with n ver- planes in 0(n log n) time.
tices, the maximum total complexity of hC\P, summed Second, we compute the other candidate casting
over all weakly distinct casting planes h for P, is planes, which are the generated planes of the hierar-
0(n\ogn), assuming opposite cast removal. chical decomposition of Subsection 3.1. Antipodal pairs

127
computations take 0(n) time and convex hull compu- time bound. It turns out that the data structure is ex-
tations take O(nlogn) time, see e.g. [11, 19]. The total actly the same for the three versions of removing the
time taken by the process is given by the recurrence cast; only the query algorithms are different.
T(n) < T((l - a)n) + O(nlogn), where a is the con-
Let P be a polyhedron. For any vertex v £ V, de-
stant in the fl(n) of Lemma 10. This recurrence solves
fine F(v) as the set of facets incident to v, and for any
to T(n) = O(nlogn). We conclude:
subset V C V, define F(V) as the set of facets inci-
Lemma 11 Given a polyhedron P with n vertices, one dent to at least one vertex of V. We make the following
can compute in O(n\ogn) time a set Q of 0(n) planes observation:
such that any casting plane h that contains at least three Observation 2 For any plane h, we have F£ U F£ =
vertices of P is contained in Q, assuming opposite cast
removal.
We store P in a 2-level data structure T. The pri-
Theorem 4 Given a polyhedron P with n vertices, one mary tree is a 3-dimensional partition tree that stores
can decide in 0(n2) time and linear space whether P is the set V of vertices of P, see Matousek [15, 16] and
castable when the cast parts must be removed in orthog- Agarwal and Sharir [2] for example. They show that
onal or opposite directions. for any constant e > 0, a structure of size and prepro-
cessing time 0(n3/2+e) exists, such that for any query
plane h, the subset V£ C V of vertices above h can
4.2 Walking around convex polyhedra
be retrieved in 0(nll2+e) canonical nodes in 0{nll2+e)
For convex polyhedra, the result can be improved. Re- time. For any node 5 of T, corresponding to a canoni-
call that determining whether a plane ft is a casting cal subset Vs, the secondary structure at 5 stores Vg as
plane for P can be done by only considering the facets follows. Recall from Subsection 2.1 that for a facet /,
intersected by h and the facets incident to the edges *(/) is one of the closed half-spaces of which the bound-
that are contained in h (this only holds for convex poly- ing plane supports /, and *o(/) is *(/) translated such
hedra), see Section 2.2. A linear program on this set that the bounding plane contains the origin. Let F(Vg)
of facets tells us whether h is a casting plane. We also be the set of facets incident to at least one vertex of Vs.
know, by Theorem 2, that the total number of facets Let Bs be the cone f|{*o(/) I / e F(vs)} with apex at
that we check, for all 0(n) candidate casting planes, is the origin. The secondary structure is simply an array
only 0(nlogn). To test each candidate casting plane, or balanced binary tree that stores the facets of Bs in
either generated or a member of an equivalence class of cyclic order around the apex. The secondary structure
weakly equivalent planes, our algorithm walks around allows for queries with a half-line starting at the origin,
the intersection of the plane with the polyhedron at a to determine whether the half-line is contained in Bs-
cost of O(logn) per step. This leads to an 0(n log2 n) This query is in fact a 2-dimensional query to determine
time algorithm for a convex polyhedron P with n ver- whether a point lies in a convex polygon.
tices.
Suppose that we wish to determine whether h is a
Theorem 5 Given a convex polyhedron P with n ver- valid casting plane for orthogonal cast removal. Then
tices, one can decide in 0(nlog2 n) time and linear we search with h in T and determine the canonical
space whether P is castable when the cast parts must nodes of T with respect to h, in particular, the set
be removed in orthogonal or opposite directions. A+ = {S\,...,St} of nodes of which the associated sets
Vs1,..., Vst are a partition of V^. Let l\ be the upward
half-line normal to h starting at the origin. For each of
4.3 A data structuring approach the nodes Si, we query with £~£ in the secondary struc-
The second, 0(n log2 n) time solution described above ture to determine by binary search whether l\ e Bst ■
only applies to convex polyhedra. By using data struc- If the answer is positive for all nodes S1,... ,St, then
tures, we will improve upon the quadratic time results P n h+ is a terrain with respect to the direction normal
of Theorem 4 for simple polyhedra as well. Unfortu- to h (and parallel to £%). The query is repeated for h~,
nately, the storage requirements increase with the data to determine whether P(~\h~ is a terrain with respect to
structuring method. The idea is to test every candidate the direction normal to h. If this is also the case, then
casting plane by querying with it in a data structure h is a casting plane of P for orthogonal cast removal.
(instead of applying linear programming). The query Since t = 0(nll2+€), the query time is 0(nll2+e logn).
determines whether h really is a valid casting plane for
the polyhedron P. The preprocessing of the data struc- Next we consider cast removal in opposite direc-
ture should be less than quadratic and the query time tions. The query is a variation to the previous solu-
should be less than linear in order to beat the quadratic tion. We determine both sets A+ and A~ of canonical

128
nodes for the queries with h+ and h , respectively. Let Corollary 3 For any constant e > 0 and any sim-
A+ = {Si,...,St} and A" = {S[,... ,S'S}. We wish ple polyhedron P with n vertices, one can determine in
to determine whether the common intersection of the 0(n3/2+e) time and space whether P is castable when
t cones B5l,...,BSi, intersected with the reflection in the cast parts must be removed orthogonal to the casting
the origin of the common intersection of the s cones plane, or in opposite directions.
BSf,..., Bg^, is non-trivial. One can decide whether the
common intersection is non-trivial using the algorithm
of Reichling [22]. He shows how to find an extremal 5 Algorithms for arbitrary cast
point in the common intersection of k convex n-gons in removal
0(k\og2n) time. In our case, we 'reflect' all operations
on the second set of cones. (Alternatively, we could In this section we study the most general casting prob-
store the reflected cones explicitly at every node and lem of this paper: determine whether a simple polyhe-
work with these, but this is not necessary.) The query dron P is castable when the cast parts may be removed
time is 0((s + t) log2 n) = 0{n^2+e log2 n) time. in arbitrary directions. Using results of the previous sec-
Thirdly, we consider the query in the same structure tions, we can obtain an 0(n9/4+e) time algorithm: we
to solve arbitrary cast removal. We remark that for ar- devise a data structure as in the previous section to test
bitrary cast removal, we can determine using 0(n log n) all candidate 0(n2) casting planes. We will do better
queries whether a casting plane exists, even though we in this section. Using Lemmas 5 and 6 and one more
do not have a subquadratic bound on the number of observation on arbitrary cast removal, we first obtain
casting planes in this case. This will be shown in the a simple 0(n2 log n) time and linear space algorithm,
and then a more complicated 0{n3/2+e) time and space
next section.
Let h be the casting plane. We determine the set algorithm.
A+ as before; let BSl,-..,BSt be the cones that are Let P be a polyhedron. We first test whether P ad-
stored at the set A+ canonical nodes. Now we have mits opposite cast removal using the simple 0(n2) time
to determine whether the common intersection of these algorithm of Theorem 4. If so, we are done. Otherwise,
cones is non-trivial. Any half-line starting at the origin if P is convex, then by Lemma 5 we only have to con-
and in the common intersection of the cones represents sider casting planes that contain some edge of P. If P
a direction with respect to which P(~\h+ is a terrain. A is non-convex, then, by Lemma 6, we only have to con-
half-line in the common intersection of the t cones can be sider casting planes that contain an edge of the convex
determined in 0(£log2 n) = 0{nll2+e log2 n) time using hull of P.
Reichling's algorithm. If no such half-line exists, then
P Dh+ is not a terrain with respect to any direction. Observation 3 Let P be a polyhedron and h a plane
If P n h+ is a terrain for some direction, we repeat the that contains an edge e of the convex hull of P. Assume
query to test whether P n h~ is a terrain. w.l.o.g. that e is horizontal and that a vertical plane
exists which supports e and has P - cl(e) completely to
Theorem 6 For any constant e > 0 and any simple the one side.
polyhedron P with n vertices, a data structure of size
• If Pnh+ is a terrain and PC\h~ is not a terrain,
and preprocessing time 0(n3/2+e) exists, such that for
then no plane p containing e for which P (~l h~ C
any query plane h, one can determine in 0{nll2+e) time
whether h is a casting plane for P in any of the versions \i~ is a casting plane.
for removing the cast. • If PC\h+ is not a terrain and PC\h" is a terrain,
then no plane p containing e for which P (~l h+ C
Remark: In fact, we have also shown that for any H+ is a casting plane.
query half-space h+, we can determine within the same
bounds whether P n h+ is a terrain in some direc- • If P(~\h+ and PC\h~ are both not a terrain, then
tion. Furthermore, by choosing a different partition no plane containing e is a casting plane.
tree for the primary tree, we can trade query time for
storage space, see e.g. Chazelle, Sharir and Welzl [7], The above observation sets up a binary search for a
Matousek [16] and Agarwal and Sharir [2]. For any casting plane that contains some edge e of the convex
n < N < n3, a data structure of size and preprocess- hull of P. A plane h rotating about e encounters the
ing time 0{Nl+e) exists with query time 0(n1+e/N1?3). n - 2 other vertices of P in some order. One binary
The theorem above states the version we need for the search step on this order tests whether PC\h+ and PC\h~
casting problem. are terrains using linear programming. Therefore, we
have the following.

129
Theorem 7 Given a simple polyhedron P with n ver- 6 Conclusions and open prob-
tices, one can determine in 0(n2 log n) time and linear
space whether a casting plane for P exists, when the cast lems
parts can be removed in arbitrary directions.
This paper studied the geometric version of the prob-
As shown in Subsection 4.3, we can preprocess P lem of determining whether a simple polyhedron can be
into a data structure such that any plane can be tested manufactured using casting. It was assumed that there
in 0(n1/2+e) time. Since 0(n\ogn) planes are tested are two cast parts, and each has be removed with a
by the above procedure, the test part can be improved single translation. We presented simple algorithms that
to 0(n3//2+e) time. However, how can we obtain the or- use 0(n2) or 0(n2 logra) time and linear space which are
der of vi,..., i>„_2 without sorting? Again, the solution based on linear programming. Furthermore, we showed
lies in data structuring. Notice first that the order of that theoretically, better results can be obtained us-
vi,... ,vn-2 is not needed explicitly. In the first step, ing partition trees and their variants. This leads to an
the vertex that is the median vn/2-i must be deter- 0(n3/2+€) time and space algorithm. The ne-factors can
mined, and in the following steps a median in one of be replaced by polylogarithmic factors if we use the par-
the two halves. tition trees of Matousek [16]. Finally, as a by-product,
The data structure that is needed solves the follow- we obtained a combinatorial bound on the number of
ing query problem: Given a query edge e such that there planes intersecting a polyhedron in edges only, and on
exists a plane h containing e that has the interior of P the summed number of edges in these planes.
completely to the one side, and an integer k, find the Manufacturing applications have not been studied
k-th. vertex of P that is encountered by h when it ro- much in computational geometry. There are quite a
tates about e. Dualization yields a more familiar query large number of open problems to be solved in this area.
problem: preprocess a set of n planes (dual to the ver- We first list some open problems related to this paper,
tices of P), such that for any given query ray, the jfc-th and then list a few others in cast design that deserve
intersection point with the planes can be determined. attention.
The query ray is contained in the line dual to the line
supporting e, and the starting point of the ray is any 1. What is the maximum number of distinct casting
point dual to a plane containing e that has the interior planes in case of arbitrary cast removal? This pa-
of P completely to the one side. per shows 0(n2), whereas the only lower bound
Let V{V) = {V(vi)\vi e P} be the set of planes we have is linear.
dual to the vertices of P, preprocess them into a data
structure for line segment intersection counting, as given 2. For a convex polyhedron P, what is the maxi-
by Agarwal and Matousek [1]. They show that for mum summed complexity of the intersection of all
any e > 0, a structure of size and preprocessing time weakly distinct casting planes with PI This paper
0(n3/2+e) exists, such that segment intersection count- shows 0{n log n) in case of opposite cast removal,
ing queries can be answered in 0(n1^2+€) time. Further- but the trivial lower bound is linear.
more, they show how the same structure can be used to
find the k-th intersection point of a query ray with V(V) 3. Give simple algorithms for casting that improve
in 0(n1/2+e) time. Let the query ray be parameterized our simple 0{nlog2 n), 0(n2) and 0(n2 logn)
by q + A • u, A > 0, where q is a point and u is a vector in time algorithms. Find algorithms that improve
3-dimensional space. In our application, if the fc-th in- upon our 0(n3/2+e) time algorithms. (De Berg [9]
tersection point does not exist, and the last intersection observed that orthogonal cast removal for simple
point is the j-th, then the query should be continued in polyhedra can be done in 0(n4/3+e) time by using
'wrap-around' mode: find the (k - j)-th plane for the a different data structure to test candidate casting
query ray along the same line and in the same direction, planes.)
but with q translated in direction —ü to infinity. When
this happens, the plane rotating about e in primal space 4. Suppose that we wish to determine castability of
rotates past a vertical orientation. These adaptations to an object with non-linear boundaries. Give (sim-
the query algorithm can easily be made within the same ple) algorithms that deal with this problem.
asymptotic time bounds. Hence, we conclude:
5. For some casting processes, is not necessary that
Theorem 8 For any simple polyhedron P with n ver- the cast parts must be separated by a plane. In
tices and any constant e > 0, one can determine in these cases, every convex polyhedron is castable.
0(n3/2+e) time and space whether P is castable, when However, no algorithms are known for cast re-
the cast parts can be removed in arbitrary directions. moval of simple polyhedra.

130
Acknowledgements. This research was initiated dur- [11] Edelsbrunner, H., Algorithms in Combinatorial
ing the workshop on 'Injection molding' at the Bel- Geometry. Springer-Verlag, Berlin, 1987.
lairs Research Institute, McGill University. The authors
[12] Elliott, R., Cast iron technology. Butterworths,
thank the organiser Godfried Toussaint and the other
participants for creating a good research environment. London,1988.
Furthermore, we thank Pankaj Agarwal for answering [13] Fekete, S.P., and J.S.B. Mitchell, Geometric aspects
several of our questions. of injection molding, manuscript, 1993.

[14] Held, M., On the Computational Geometry of


References Pocket Machining. Lect. Notes in Comp. Science
500, Springer-Verlag, 1991.
[1] Agarwal, P. K., and J. Matousek, Ray shooting and
parametric search. Proc. 24th ACM Symp. Theory [15] Matousek, J., Efficient partition trees. Proc. 1th
of Computing (1992), pp. 517-526. ACM Symp. on Comp. Geometry (1990), pp. 1-9.

[2] Agarwal, P. K., and M. Shark, Applications of a [16] Matousek, J., Range searching with efficient hier-
new space partitioning technique. Proc. 2nd WADS archical cuttings. Proc. 8th ACM Symp. on Comp.
(1991), Lect. Notes in Comp. Science 519, Springer- Geometry (1991), pp. 276-285.
Verlag, pp. 379-391.
[17] McAllister, M., and J. Snoeyink, Two dimensional
[3] Asberg, B., G. Blanco, P. Bose, J. Garcia, M. Over- Computation of the Three dimensional Reachable
mars, G. Toussaint, G. Wilfong, and B. Zhu, Fea- Region for a Welding Head. Proc. 5th Canadian
sibility of design in stereolithography. Proc. 13th Conf. on Comp. Geom (1993), pp. 437-442.
Symp. on FST & TCS (1993), Lect. Notes in Comp.
[18] Megiddo, N., Linear-time algorithms for linear pro-
Science 761, pp. 228-237.
gramming in R3 and related problems. SIAM J.
[4] Bose, P., D. Bremner, and M. van Kreveld, Deter- Comp. 12 (1983), pp. 759-776.
mining the Castability of Simple Polyhedra. Tech.
[19] Preparata, F.P., and M.I. Shamos, Computational
Rep. SOCS 93.12, School of Comp. Science, McGill
geometry - an introduction. Springer-Verlag, 1985.
University, 1993.
[20] Pribble, W.I., Molds for reaction injection, struc-
[5] Bose, P., M. van Kreveld, and G. Toussaint, Fill-
tural foam and expandable styrene molding. In:
ing polyhedral molds. Proc. 3rd WADS (1993),
Plastics mold engineering handbook, J.H. DuBois
Lect. Notes in Comp. Science 709, Springer-Verlag,
and W.I. Pribble (Eds.), Van Nostrand Reinhold
pp. 210-221. Company Inc., New York, 1987.
[6] Bose, P., and G. Toussaint, Geometric and compu- [21] Rappaport, D., and A. Rosenbloom, Moldable and
tational aspects of injection molding. Proc. 3rd Int. Castable Polygons. Proc. 4th Canadian Conf. on
Conf. on CAD and Computer Graphics (1993), Bei- Comp. Geom. (1992), pp. 322-327.
jing, China, pp. 237-242. Also: Tech. Rep. SOCS
92.16, School of Comp. Science, McGill University, [22] Reichling, M., On the detection of a common inter-
1992. section of k convex objects in the plane. Inf. Proc.
Lett. 29 (1988), pp. 25-29.
[7] Chazelle, B., M. Sharir, and E. Welzl, Quasi-
optimal upper bounds for simplex range searching [23] Walton, C.F., and T.J. Opar (Eds.), Iron castings
and new zone theorems. Proc. 6th ACM Symp. on handbook. Iron casting society, Inc., 1981.
Comp. Geometry (1990), pp. 23-33.
[24] Whelan, A., Injection moulding machines. Elsevier,
[8] Personal Communication with R. Connolly, Man- London,1984.
ager Injection Molding, Industrial Materials In-
stitute, National Research Council of Canada,
Boucherville, Quebec, November 1993.
[9] De Berg, M., personal communication, 1994.

[10] Dobkin, D. P., and D. G. Kirkpatrick, A linear time


algorithm for determining the separation of convex
polyhedra. J. of Algorithms 6 (1985), pp. 381-392.

131
A Fast Algorithm For Constructing Sparse Euclidean Spanners
(Extended Abstract)

Gautam Das *t Giri Narasimhanf

Abstract Euclidean distances. The complete Euclidean graph


contains all n(n — l)/2 edges.
Let G = (V, E) be a n-vertex connected graph with
Although complete graphs represent ideal com-
positive edge weights. A subgraph G' is a i-spanner
munication networks, they are expensive to build
if for all u, v £ V, the distance between u and v
in practice, and sparse spanners represent low cost
in the subgraph is at most i times the correspond-
alternatives. Sparseness of spanners is usually mea-
ing distance in G. We design an 0(n log2 n) time
sured by various criteria such as few edges, small
algorithm which, given a set V of n points in k-
weight, and small degree. Spanners for complete
dimensional space, and any constant t > 1, pro-
Euclidean graphs as well as for arbitrary weighted
duces a i-spanner of the complete Euclidean graph
graphs find applications in robotics, network topol-
of V. This algorithm retains the spirit of a recent
ogy design, distributed systems, design of parallel
0(n3 log n)-time greedy algorithm which produces i-
machines, and have also been investigated by graph
spanners with a small number of edges and a small
theorists. Most of the recent literature on spanners
total edge weight; we use graph clustering tech- are referenced in [4, 9].
niques to achieve a more efficient implementation.
Our spanners have similar size and weight sparse- Let MST refer to a minimum spanning tree of
ness as those constructed by the greedy algorithm. the complete graph. For complete Euclidean graphs
in 2-dimensions, an 0(n log n)-time algorithm is de-
scribed in [7] which produces i-spanners with 0(n)
edges and weight 0(wt{MST)), which is optimal.
1 Introduction The problem gets more difficult in higher dimen-
Let G = (V, E) be a n-vertex connected graph with sions. In ^-dimensional space, there are several al-
positive edge weights. A subgraph G' is a i-spanner gorithms that run in 0(n logn) time [8, 10]. How-
if for all it, v € V, the distance between u and v ever they only guarantee that the number of span-
ner edges is 0(n); the total weight could be arbi-
in the subgraph is at most i times the correspond-
ing distance in G. The value of i is known as the trarily large. In [4] an 0(n log n) time algorithm is
stretch factor of G'. Let Vbea set of n points in described which generates spanners in Jfe-dimensions
^-dimensional space. An Euclidean graph has V as with weight 0(log n) • wt(MST). The nature of this
its vertices, and its edges are straight line segments algorithm is such that the O(logn) factor cannot
joining pairs of points, with edge weights being their be eliminated, so the algorithm always produces a
suboptimally weighted spanner.
•Supportedin part by NSF gTant CCR-930-6822 In contrast, in [1, 4, 5] a simple greedy algorithmis
'Math Sciences Dept., Memphis State University, Mem- presented which generates spanners with 0{n) edges
phis, TN 38152. e-mail: dasg/giriOnextl.msci.memst.edu
and a weight which is likely to be asymptotically op-
Permission to copy without fee all or part of this material is timal for all dimensions. In [4] it is shown that for
granted provided that the copies are not made or distributed for any dimension k the weight is O(logn) • wt(MST),
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is qiven and in [5] it is shown that for k < 3 the weight
that copying is by permission of the Association of Computing is 0{wt{MST)). In [5] it is conjectured that the
Machinery. To copy otherwise, or to republish, requires a fee weight is actually asymptotically optimal in any di-
and/or specific permission.
mension and that the O(logn) factor can be elim-
10th Computational Geometry 94-6/94 Stony Brook NY USA
© 1994 ACM 0-89791 -648-4/94/0006..$350

132
inated by a more careful analysis. The constants
implicit in the O-notation depend only on t and k. Algorithm GREEDY(G = (V, E), t)
The greedy algorithm has also been used to gener- begin
ate spanners of arbitrary weighted graphs, and there order E by non-decreasing weights
again, it is superior to other algorithms in the sense E' +-<b, G'^(V,E')
that it produces spanners with very small weight. for each edge e = (u, v) € E' do
However, the greedy algorithm is handicapped by if spG'(u, v) > t ■ wt(e) then
a slow running time, mainly because it has to make E'*-E'U {e}, G' *- (V, E')
a large number of shortest path queries. In the Eu- output G'
clidean case, the best-known implementation has a end.
running time of 0(n3 log n). In this paper, we de-
sign an 0(nlog2n)-time algorithm to construct t-
spanners, which retains the spirit of the greedy algo- Figure 1: The greedy algorithm
rithm. This new algorithm is faster because we use
graph clustering techniques to answer shortest path
queries only approximately. The spanners produced that is an edge of G', the weight of the second
by this algorithm have the same asymptotic size shortest path between u and v in G' is greater than
and weight bounds as the spanners produced by the t • d(u, v). The second property is crucial in showing
greedy algorithm. Furthermore, any improvements that the total weight of the spanner is small. In [4]
in these bounds for the greedy algorithm spanners is it is shown that G' has 0(n) edges and has a total
likely to lead to similar improvements in the bounds edge weight of O(logn) • wt(MST), where MST is
for the spanners produced by this algorithm. Graph a minimum spanning tree of V. In [5] it is shown
clustering is not new, and in fact there are several that for ife < 3, the greedy algorithm outputs a t-
algorithms which use a variety of clustering tech- spanner of weight 0(wt(MST)). In that paper it is
niques to generate spanners of Euclidean as well as conjectured that this result is true for fc-dimensions.
arbitrary weighted graphs [2, 3, 6, 8, 10]. What is In this paper, our algorithm mimics the greedy al-
interesting is the way in which we exploit a simple gorithm and constructs a t-spanner G' with asymp-
clustering technique in our implementation. totically same size and weight sparseness. Apart
In the next section we introduce notation, summa- from the very short edges of the spanner, all other
rize previous relevant research, and give an overview edges (u, v) satisfy the property that the weight of
of our algorithm. Section 3 describes the clustering the second shortest path between u and v in G' is
technique used. Section 4 describes the algorithm. greater than c • d(u, v), where c is a constant depen-
We conclude with some open problems. dent on t. Thus, techniques similar to those used
in [4, 5] can be used to prove the same sparseness
bounds. Details appear later.
2 Preliminaries The following concept will be useful in later sec-
tions. We define a certain kind of "partial" spanners
Let G = (V, E) be a n-vertex connected graph with of complete Euclidean graphs. Let V be a set of n
positive edge weights. The weight of a single edge e points in Jb-dimensional space, t > 1 and W > 0.
is wt(e), the weight of a set of edges E' is wt(E'), A graph G' is a (i, W)-spanner if for all u, v £ V
and the weight of the entire graph is wt{G). Let such that d(u,v) < W, spG.(u,v) < t • d(u,v). In
spa{u,v) be the weight of the shortest path in G other words, G' provides short paths between pairs
between u and v. Let d(u, v) refer to the Euclidean of points whose inter-distance is at most W. For
distance between points u and v in Euclidean space. instance, at any stage of the greedy algorithm, if
In [1, 4], a greedy algorithm is developed for con- the edge most recently examined has weight L, the
structing i-spanners of arbitrary weighted graphs, partially constructed spanner is a (t, i)-spanner.
for any t > 1. We reproduce the algorithm in Fig-
ure 1. Let us apply this algorithm to a complete 2.1 Overview of the algorithm
Euclidean graph in ib-dimensional space and let the
output graph be G' = (V, E'). We first run the 0(n log n) time algorithm in [8] to
It is easy to see that the output is a t-spanner, get a graph G = (V, E), which is a v^-spanner of the
since for any (u, v) that is not an edge of G', complete Euclidean graph. Although it may have a
spG'{u,v) < t • d(u,v). In addition, for any (u, v) large weight, it has 0(n) edges. We shall then find a

133
■\/i-spanner G' of G. Clearly, G' will be a i-spanner a cluster-cover. First consider a procedure called
of the complete graph. SINGLE-SOURCE(G>,W), which takes as in-
If we were to run the original greedy algorithm put any weighted graph G', a start vertex v, and
on G to get G', it will have to answer 0(n) short- W > 0. It outputs all vertices u such that
est path queries on G'. Our algorithm does better spa'(v,u) < W. It can be implemented as Dijk-
by speeding up the queries. We group the edges in stra's single-source shortest path algorithm by us-
E into O(logn) groups, such that each group has ing a heap and ensuring that the algorithm never
edges that are more or less of equal weight. Then visits vertices further than W from v. We now de-
we examine the edges, going from one group to the sign a procedure CLUSTER-COVER(G', W) as fol-
next in order of increasing weight, and at the same lows. Select any vertex v± of G', and run SINGLE-
time building a partially constructed spanner, G'. SOURCE(G',ui,W). The output is a cluster Cx
Immediately before processing a group of edges with center v±. Then select any vertex v2 not yet
(of weight approximately W), the algorithm cre- visited, and run SINGLE-SOURCE(G', v2, W). The
ates a cluster-graph H as follows. Roughly speak- output is G2 with center v3. Continue this process
ing, the vertices of G' are covered by a set of clus- until all vertices are visited. For each vertex, the
ters such that each cluster consists of vertices that procedure also computes the clusters to which it be-
are within 0(W) distance from each other in G'. longs as well as its distance from their respective
Each cluster is collapsed into a representative ver- centers.
tex, namely its center, to form a single macro vertex Let G' = (V, E') be any weighted graph, W > 0
of H. These macro vertices are connected by edges and 0 < 6 < 1/2. Assume a cluster-cover has
of weight 0(W) only if the distance between their been constructed with cluster radius 6W. A cluster-
centers in G' is 0(W). Notice that all edge weights graph H is defined as follows. The vertex set is
of H are more or less the same. Thus distances in G' V. The are two kinds of edges, intra-cluster edges
are approximated by distances in H. A crucial ob- and inter-cluster edges. For all Ci, and for all
servation, as proved later, is that in the Euclidean u£Cj, [u, Vi] is an intra-cluster edge (we use square
case the maximum degree of H turns out to be a brackets to distinguish cluster-graph edges from the
constant. Thus the shortest path query can be an- edges of G'). Inter-cluster edges are between clus-
swered in constant time as follows. Start with a ter centers. [t>i,u;'] is an inter-cluster edge if, either
macro vertex whose corresponding cluster contains 8PG'{vi,Vj) < W, or there exists e = (u, v) £ E'
u, and see whether v belongs to any of the clusters such that u £ Ci,v £ Cj. Cluster-graph edges have
that are within O(Vf) links from the start cluster. weights, and wt([u, v]) is defined as spa'(u, v).
Since the degree is constant, and t is a constant, We now describe a procedure called CLUSTER-
we need only explore a constant-sized portion of H. GRAPH(G', 6, W). It first calls CLUSTER-
Once we have examined all the edges in a group, we COVER^', 6W). In fact, during this process all
create a cluster-graph again (but with a larger W), intra-cluster edges (and their weights) will also be
and process the next group of edges. computed. Recall that inter-cluster edges have to
The running time of of our algorithm is dominated satisfy one of two conditions. Inter-cluster edges
by the periodic clustering necessary. satisfying the first condition may be computed by
running SINGLE-SOURCE on G' from each clus-
ter center t;,- and checking which other cluster cen-
3 Clustering a graph ters are no further than W from V{. The remain-
ing inter-cluster edges may be computed as fol-
In this section we first consider arbitrary weighted lows. For all e = (u,v) £ E' do the following.
graphs. Let G' = (V, E') be an any positive For all cluster centers V{,Vj such that u belongs
weighted graph, and W > 0. A cluster C is a set to t;,-'s cluster and v belongs to Vj's cluster, add
of vertices, with one vertex v its center, such that the inter-cluster edge [vi,Vj] with weight denned to
for all u £ V, spGi{u,v) < W implies that u £ C. be wt([vi, u]) + wt(e) + wt([v, Vj]) (unless the inter-
W is the radius of the cluster. A cluster-cover is a cluster edge already existed with a smaller weight).
set of clusters C\, Cj,..., Cm, (with corresponding The motivation for the cluster-graph is that it is
centers t>i,«3,.. .,um) such that their union is V. a simpler structure than G'. Shortest path queries
Clusters in a cluster-cover may overlap, however a in G' can be translated into shortest path queries in
cluster center does not belong to any other cluster. H, and the latter can be performed more efficiently.
We describe an obvious algorithm to compute The following two lemmas are obvious.

134
Lemma 3.1 Intro-cluster edges are no larger that
SW. Inter-cluster edges are larger than SW, but cluster with radius SW
no larger than max{W, D + 26W}, where D is the
weight of the largest edge in G'.

Lemma 3.2 Let a path between u and v in H have


weight L. Then there is a path between u and v in
path P
G' with weight at most L.
The next lemma is the converse, which is harder.
We first introduce some definitions. A vertex u is
defined to be sufficiently far from vertex v if, (1)
no single cluster contains both, and (2) spc (v., v) >
W - 2SW. Define a cluster-path in JET to be a path
where the first and last edges are intra-cluster edges,
but all intermediate edges are inter-cluster edges.

Lemma 3.3 Let u be sufficiently far from v. Let


Li be the weight of a path between u and v in G'.
Then there exists a cluster-path between u and v in
H with weight L2 such that
(1 + 6S\ inter-cluster edge
L2 <
\l-26j
Proof : This lemma says that H approximates
paths in G' only for pairs of vertices which are suf- path Q intra-cluster edge
ficiently far apart. Secondly, notice that the quality
of the approximation depends on 6; smaller values
of S make paths in H closer in weight to paths in
G', although H becomes denser.
Let the path from u to v having weight L\ in G' be
P. We shall use the notation P(w, x) to denote the
vertices of P between vertices w and x, not including Figure 2: Paths in G' and H
w. We shall construct a cluster-path Q from u to
v in H with weight L2 as follows, follows. Let Co
be any cluster (with center v0) containing u. The Now L2 = wt([u,v0]) + tut([v0.i>i]) + iut([vi,v]).
first edge of Q is the intra-cluster edge [u, v0]. Next, But wt([u, vo]) and wt([vi, v]) are each at most SW,
among all clusters with centers adjacent to vo in H, while wt([v0,vi]) = spG>(«o,i>i) < spG>{vo,v>) +
let Ci (with center «i) intersect the furthest vertex spGi(u, v) + spG'(v, vi) < 26W + Li. Thus
along P(u,v), say w\. Add the inter-cluster edge
[■u0,i>i] to Q. Next, among all clusters with centers L2 < Ii + 4SW
adjacent to vi in H, let C2 (with center v2) intersect
the furthest vertex along P(IUI,I;), say w2. Add the We now have two inequalities relating L\, L2 and
inter-cluster edge [vuv2] to Q. This process may W. After eliminating W, we get
be continued until we reach a cluster center, vm,
(l + 26\
whose cluster contains v. At this stage, complete L2 < ■L,
Q by adding the intra-cluster edge [vm,v]. Figure 2 \l-26j
illustrates some of this notions.
Case 2: m > 2 and is even. In this case, sup-
Case 1: m = 1. In this case there is only one inter-
pose [vi,vi+i] and [^+1,^+2] are any two consecu-
cluster edge along Q. Since u is sufficiently far from
tive inter-cluster edges on Q. We observe that the
v, we know that sum of their weights is greater than W. If this were
Li > W - 2SW not so, then the edge [vi,vi+2] (which exists by the

135
definition of the cluster-graph) would have instead it as qm_1 < (f^ff) -Pm-i + 26W. We then sum
been added to Q by the above process.
up the p's and q 's as in Case 2, and get
We divide Q into portions Q0, Q2, ■ ■ ■, where <?2i
is the portion between v?i and V2i+2- Similarly, we (l + 26\
divide P into portions P0, P2,..., where P2t- is the L2 < Lx + 46W
\l-26)
portion between the last vertex intersecting C2; and
the first vertex intersecting C2t+2 (see Figure 2). We Since Lx > W - 26W, we get Lx ■ 46/(1 - 26) >
shall first prove that for any even i, the weight of Q2t 46W. Substituting for 46W in the above inequality
is no more than a constant (which depends upon 6) and simplifying, we get
times the weight of P2*.
Let the weight of P2i be p2i and that of Q2i be g2i. 1 + 6A
L2 < £1
Since there cannot be an inter-cluster edge between 1-26/
V2i and v2i+2, we have
The constant in Case 3 dominates, which proves
Pu>W- 26W
the lemma. D
Select r to be any vertex of P2l- within the in-
termediate cluster C2i+i. The vertex r splits P2i
into two portions. Let p'2i (p2i) be the weight of 3.1 Clustering of partial Euclidean
the initial (final) portions; thus p2i = p'2i + p2i. spanners
So wt{[v2i, i>2t+i]) < P2i + 2SW, and similarly
Although described for arbitrary weighted graphs,
fi([«3t+i,T2t+2]) < P2l- + 26W. Adding the two,
in our algorithm we will always be computing
we get
cluster-graphs for partial spanners of complete Eu-
92< < P2i + 46W clidean graphs under the following conditions. Let
We now have two inequalities relating p2i, g2t- and t > 1, a>0, 0<6< 1/2, 6 > 0, and W > 0. For a
W. After eliminating W, we get set V of n points in ^-dimensional space, let G' be
a (t, aW)-spanner such that all its edges are smaller
1 + 26 than 9W. Run CLUSTER-GRAPH(G',6, W), and
92i < •P2i
1-26 let H be the computed cluster-graph. H has several
additional properties, which are used in analyzing
Summing over all even values of i, and taking into
the running time of our algorithm.
account the two intra-cluster edges at either ends of
Q, we get Lemma 3.4 Let ß > 0 be any constant. Inside any
(l + 26\ sphere of radius ßW there can be at most a constant
L2 < £1 + 2SW (which depends upon a, ß, 6, t, and k) number of
\l-2Sj
cluster centers.
Since u is sufficiently far from v, we know that
Lx > W - 26W. That is, Lx ■ 26/(1 - 26) > 26W. Proof : We first provide a lower bound on the spa-
Substituting for 26W in the above inequality and tial separation between any pair of cluster centers.
simplifying, we get Let Vi,Vj be two cluster centers, and let d(vi,Vj) =
L. There are two cases, either L > aW or L < aW.
+ 46 If it is the latter case, then spGi(vi,Vj) < tL. But
L2 < ■£1 spG>{vi,Vj) > 6W (Lemma 3.1), hence L > 6W/t.
(1 26
So in either case, L > min{aW, 6W/i}.
Given a sphere of radius ßW, we can pack at most
Case 3: m > 3 and is odd. In this case, the analysis
a constant (which depends upon a, ß, 6, t, and k)
will be exactly the same as in Case 2, except that we
number of points inside it, such that the spatial sep-
have to account for the last inter-cluster edge along
aration between any pair of points is greater than
Q and correspondingly the portion of P between
min{aW, 6W/t}. D
the last two clusters. Let gm_i be the weight of
[um_i, vm], and let pm_i be the weight of the portion
of P between the last vertex intersecting Cm_i and Lemma 3.5 A vertex belongs to at most a constant
first vertex intersecting Cm. Clearly qm-i < Pm-i + (which depends upon a, 6, t, and k) number of clus-
26W. The inequality does not change if we rewrite ters.

136
Proof : Consider any vertex u. Let C be a clus-
ter containing u, with cluster center v. d(u, v) < Algorithm FAST-GREEDY(V,t)
spG'(u,v) < 6W. Consider a sphere of radius 6W begin
centered at u. The cluster centers of all clusters
containing u have to lie within the sphere. Invoking
6
a(IM)
use algorithm in [8], create a \/t-spanner G = (V, E)
Lemma 3.4 completes the proof. L-l
order E by non-decreasing weight
let the largest edge in E have weight D
Lemma 3.6 The subgraph of H induced by the create the intervals
inter-cluster edges has at most a constant degree Io = (0,D/n],
(which depends a, 6, 6, t, and k). Ii = {2^-^D/n, 2{D/n] for t = 1,2,..., logn
let Ei be the (sorted) edges of E with weights in U
Proof : Let [vi,Vj] be an inter-cluster edge. By E'+-Eo,G'^{V,E')
Lemma3.1, d{vuvj) < spa^Vj) < max{W,0W+ for i <— 1 to log n do
28W}. Consider a sphere of radius max{W, 9W + Wi «- 2^-^D/n
26W} centered at Vi. The cluster centers adjacent to H «- CLUSTER-GRAPH(G',£, Wi)
V{ have to lie within the sphere. Invoking Lemma 3.4 for each edge e € Ei do
completes the proof. '-' EXAMINE-EDGE(e)
output G'
We introduce one more procedure to be used end.
by the algorithm. Let G' be a (t, aW)-spanner
satisfying the conditions laid out earlier, and let
H be its cluster-graph. The procedure CHECK- Figure 3: An 0(nlog2 n)-time algorithm
PATH(.ff, u, v, L) returns "true" if there is a cluster-
path from u to v in H with weight at most L, and
clidean graphs in ifc-dimensional space. The algo-
"false" otherwise.
This procedure is always called by our spanner rithm is shown in Figure 3, and one of its subrou-
algorithm under fortunate circumstances. There is tines is shown in Figure 4. As one can see, it retains
a constant 7 > 0 such that, the input values of L the spirit of the greedy algorithm, except for the
are always at most jW. Because of this restriction, graph clusterings.
the procedure can be made to run in constant time.
To see this, consider initiating from u a brute-force 4.1 Analysis of the algorithm
search for such a cluster-path. There are at most a
We analyze three aspects of the FAST-GREEDY al-
constant number of intra-cluster edges leading from
gorithm. First, we prove that G' is indeed t-spanner.
u to different cluster centers. The inter-cluster edges
We then show that the spanner has a small weight.
have each weight at least SW, thus if such a cluster-
Finally we show that a proper implementation runs
path exists, it can have at most j/6 inter-cluster
in 0(nlog2n) time.
edges. We also know that the subgraph of H in-
duced by inter-cluster edges has a constant degree Lemma 4.1 The graph G' produced by the FAST-
(Lemma 3.6). We can conclude that the brute-force GREEDY algorithm is a t-spanner of the complete
search initiated from u will only have to examine a Euclidean graph.
constant sized subgraph of H, and verify whether v
belongs to this subgraph, and if so, whether there Proof : To see that G' is a t-spanner, consider
exists a cluster-path from u to v of weight at most any edge e = (u, v) of E which is not added to
E' in procedure EXAMINE-EDGE. A cluster-path
L.
This procedure is used in lieu of the time con- (in fact, any path) from u to v in the cluster-graph
suming shortest path queries of the original greedy corresponds to an equivalent path in G' with the
same weight (Lemma 3.2). Thus e is discarded if
algorithm.
spG'(u,v) < Vi ■ d(u, v), which implies that G' is
a V*-spanner of G, and is thus a t-spanner of the
4 The spanner algorithm complete graph. ^

In this section we illustrate an 0(n log n) time al- Let us now estimate the weight of the spanner.
gorithm for constructing i-spanners of complete Eu- The EQ edges do not contribute much because their

137
greedy algorithm. We omit details from this version
Algorithm EXAMINE-EDGE(e = (u, v)) of the paper.
begin We now analyze the running time of the algo-
if not CHECK-PATH(if, u,v,y/i- d(u, v)) then rithm.
E' «- E' U {e}, G' «- (V, E')
for all cluster centers w, x such that Lemma 4.3 At any stage, if the most recently ex-
u is in w 's cluster and amined edge has weight L, at that stage G' is a
v is in x's cluster (t, L/t)-spanner.
do
Proof : Consider in general any t-spanner G' and
add inter-cluster edge [w, x] to H
let u and v be any pair of vertices. Then spQi(u, v) <
wt([w, x]) «— wt([w, u]) + d(u, v)+
t • d(u, v), which implies that any edge on this path
wt([v, x])
has weight at most t ■ d(u, v). Thus in our case, the
end.
edges to be examined in the future (weights larger
than L) cannot contribute to short spanner paths
between points whose spatial separation is at most
Figure 4: Deciding whether an edge should be added
L/t. D

total weight is at most D, and D < wt(MST). We The above lemma implies that each cluster-graph
shall estimate wt(E' \ E0). H generated by the CLUSTER-GRAPH procedure
(prior to the examination of edges in Ei) satisfies all
Lemma 4.2 Let e = (u,v) € E'\E0. Then the the properties and lemmas discussed in Section 3.1.
weight of the second shortest path between u and v During the processing of Ei, new inter-cluster edges
in G' is greater than y/i • d(u, v). may be added by the EXAMINE-EDGE procedure,
but H still satisfies those properties.
Proof : Let C be the shortest simple cycle in G'
containing e. We have to estimate wt{C) — d(u,v). Lemma 4.4 FAST-GREEDY runs in 0(n log2 n)
time.
Let ei = (ui,i;i) be the largest edge on the cycle.
Then ei € E\Eo, and among the cycle edges it is
Proof : The initial stages of the algorithm involve
examined last by the algorithm. Let us consider the
a call to the spanner algorithm in [8], and sorting,
scenario while the algorithm is examining e\.
which together take 0(n log n) time.
There is an alternate path in G' from ui to v\ of
Consider EXAMINE-EDGE. As seen earlier, a
weight wt(C) — d(ui,vi). But since the algorithm
call to CHECK-PATH takes constant time. Adding
eventually decides to add ei to the spanner, at that
the new inter-cluster edges takes constant time, be-
moment the weight of each cluster-path from uj to cause there are only a constant number of clusters
Vi is larger than y/i-d(ui, vi). Notice that wt(u\, vi)
containing either of the end points of the processed
is larger than Wj, where 6Wi is the current cluster
edge. Thus each call to EXAMINE-EDGE takes
radius. This implies that v,\ and vi are not con-
constant time. EXAMINE-EDGE is itself called
tained in any one cluster. Thus ui is sufficiently 0(n) times.
far from vi. By Lemma 3.3 this implies that the
Consider CLUSTER-GRAPH. This procedure
weight of each path in G' from Ui to vi, in partic-
first calls CLUSTER-COVER. On partial spanners,
ular wt(C) — d(ui,vi), is larger than y/i • (jxff) • the latter can be made to run in 0(n log n) time be-
d(ui,«i). Substituting the value of 6 selected by cause there are 0(n) edges and each vertex is visited
the algorithm, this simplifies to y/i- d[u\, v{). Since by the SINGLE-SOURCE procedure at most a con-
wt(C) — d(u,v) > wt(C) — d{u\,v\), the lemma is stant number of times (Lemma 3.5), thus there are
proved. Ö overall 0(n) heap operations, each taking O(logn)
time. The CLUSTER-COVER procedure can simul-
taneously build the intra-cluster edges of the cluster-
Lemmas 4.1 and 4.2 are crucial in proving that graph. Inter-cluster edges are built in two stages. In
E' \ Eo has a small weight. Using techniques almost the first stage, the SINGLE-SOURCE procedure is
identical to those in [4, 5], we can derive a bound on run from every cluster center, and in a manner sim-
the weight of E' \ E0, which is asymptotically the ilar to the proof of Lemma 3.5, we can show that
same as the weight of the spanner produced by the each vertex is visited at most a constant number of

138
times. This stage therefore takes 0(n log n) time. In References
the second stage, each edge (it, v) of G' is checked;
there are only a constant number of clusters con- [1] I. Althöfer, G. Das, D.P. Dobkin, D. Joseph,
taining u or v, thus this stage can be processed in J. Soares: On Sparse Spanners of Weighted
linear time. Thus each call to CLUSTER-GRAPH Graphs: Discrete and Computational Geome-
takes 0{n log n) time. CLUSTER-GRAPH is itself try, 9, 1993, pp. 81-100.
called log n times. [2] B. Awerbuch, D. Peleg: Sparse Partitions:
Hence the time complexity of FAST-GREEDY is IEEE Foundations of Computer Science, 1993.
0(nlog2n). E
[3] E. Cohen: Fast Algorithms for Constructing t-
Spanners and Paths with Stretch t: IEEE Foun-
dations of Computer Science, 1993.
5 Conclusions [4] B. Chandra, G. Das, G. Narasimhan, J. Soares:
In this paper we show how a simple and natural New Sparseness Results on Graph Spanners: to
graph clustering technique can be effectively used in appear in International Journal of Computa-
speeding up an existing greedy algorithm for con- tional Geometry and Applications.
structing Euclidean graph spanners. We conclude [5] G. Das, P. Heffernan, G. Narasimhan: Opti-
by listing some open problems. mally Sparse Spanners in 3-Dimensional Eu-
clidean Space: ACM Symposium on Compu-
1. Is it possible to reduce the running time to tational Geometry, 1993, pp. 53-62.
O(nlogn)? This may require doing some sort
of clustering which exploits earlier clusterings. [6] G. Das, P. Heffernan: Constructing Degree-
One problem with such an approach is that 3 Spanners with Other Sparseness Properties:
the error introduced in path length estimations International Symposium on Algorithms and
(Lemma 3.3) may multiply beyond a constant Computations, 1993.
factor.
[7] C. Levcopoulos, A. Lingas: There are Pla-
2. The original greedy algorithm has been success- nar Graphs Almost as Good as the Com-
plete Graphs and as Short as the Minimum
ful in producing small weight spanners for ar-
bitrary weighted graphs [4]. There exist other Spanning Trees. Symposium on Optimal Algo-
spanner algorithms for general graphs which are rithms, LNCS, Springer-Verlag, 1989, pp. 9-13.
faster, but none produce spanners with smaller [8] J.S. Salowe: Construction of Multidimensional
weight. It would be interesting if we can effi- Spanner Graphs with Applications to Minimum
ciently implement the greedy algorithm for ar- Spanning Trees: ACM Symposium on Compu-
bitrary weighted graphs. Of course, we would tational Geometry, 1991, pp. 256-261.
not be able to exploit several nice properties
which arise in the geometric case, such as con- [9] J. Soares: Graph Spanners: Ph.D Thesis, Univ.
stant degree cluster-graphs. of Chicago Technical Report CS 92-14, 1992.

3. The conjecture in [5] that for any dimensions [10] P.M. Vaidya: A Sparse Graph Almost as Good
the weight of the spanner produced by the as the Complete Graph on Points in K Dimen-
greedy algorithm is 0(wt(MST)) needs to be sions: Discrete and Computational Geometry,
resolved. If proven true, it is likely to imply that 6, 1991, pp. 369-381
asymptotically optimally weighted spanners in
any dimensions can be computed in 0(n log n)
time.

4. The clustering technique used in this paper is


simple and natural; it would interesting to see
whether it has other applications in problems
involving geometric graphs, especially in speed-
ing up existing algorithms.

139
Dynamic Maintenance of Maximas of 2-d point sets

Sanjiv Kapoor
Department of Computer Science
Indian Institute of Technology
Hauz Khas, New Delhi 110016.
e-mail: skapoor@cse.iitd.ernet.in

Abstract In this case Overmars and Van Leeuwen [OL] have


designed a data structure which requires splitting and
This paper describes an efficient scheme to dynamically merging balanced trees when points are inserted and
maintain the set of maximas of a 2-d set of points. Using deleted. In their scheme 0(log2n) operations are re-
the fact that the maximas can be stored in a Staircase quired for each insertion and deletion. A scheme by
structure, we use a technique which maintains approx- Willard and Luekar [WL] gives a bound of 0(logn)
imations to the Staircase structure. We first show how for updates but the set of maximas is not maintained.
to maintain the maximas in 0(logn) time per insertion Fredrickson and Rodger [FR] and Janardan [J] have de-
and deletion when there are n insertions and deletions. signed a scheme which maintains the staircase struc-
0{logn) is charged per change for reporting changes to ture of the set of maximas and allows for insertions
the structure. We also show another scheme which re- and deletions in O(logn) and 0{log2n) operations, re-
quires 0(logn) amortized time per insertion and deletion spectively. These are the most asymptotically efficient
with an output complexity of 0(r) steps when r maxi- schemes known. Their data structure requires 0{n)
mal points are to be listed. The data structures require space. Also [HS] gives a scheme for offline maintenance.
0(n) space. We first present an improved data structure that main-
tains the staircase structure in 0(logn) time per inser-
tion and deletion. A point can be tested to be a maxima
1 Introduction in 0(logn) time in our representation. And the staircase
structure representing the set of Maximas can be listed
Given a set S of points in the x — y plane, pi — (ZJ, JA) 6 out in time linear in the size of the set of Maximas but
S is a maximal point iff it is not dominated by another with 0(logn) operations to be spent on changes in the
point pj where a point pj dominates pi iff a;,- < Xj and report of the maximal elements. The data structure is
yi < yj. The set of maximal points of S form a structure simple and requires 0{n) space.
which monotonically decreases in the y direction as the Furthermore it is shown that the data structure can
x coordinate of the points increases. Such a structure is be modified to give a bound of 0(nlogn + mlogn + r)
called a Staircase structure. The maxima problem occurs operations when there are n insertions, m deletions and
in a large number of applications in statistics, economics, r maximal points are reported.
operations research etc. The reader is referred to the We hope that the methodology that we have described
book by Preparata and Shamos for further details [PS]
may also be applicable to dynamic maintenance of other
In this paper is described the design of a data struc- geometric structures, i.e. convex hulls, intersection of
ture for the dynamic maintenance of the maximas of a half planes and kernel of simple polygons. Since the
point set. We maintain approximations to the set in a optimal dynamic maintenance of these geometric struc-
structure which is an approximate staircase structure. tures has been unsolved for some time, the solution in
For the static case it has been shown that the staircase this paper may be of interest in terms of technique.
structure can be computed in 0(nlogn) time eliminat-
ing dominated points[KLP]. In the dynamic case however
one needs to keep track of the dominated points. 2 Outline of the Paper.
Permission to copy without fee all or part of this material is This paper first describes the structural changes required
granted provided that the copies are not made or distributed for for maintaining the maximas under insertions and dele-
direct commercial advantage, the ACM copyright notice and the tions. We then show how to implement the scheme in a
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing data structure requiring 0{n) space.
Machinery. To copy otherwise, or to republish, requires a fee The underlying data structure that we use for storing
and/or specific permission. the points is the red-black tree [T]. It is called the Max-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
140
ima Balanced Tree. The set of points, 5 are stored at the by M(w) by M(w) itself. However when a single point,
leaves of a red-black tree, which we denote by MT(S), in p, is inserted Af(io) changes only locally. The merger
order of increasing jc-coordinate values. At each node is operation can now be accomplished by changes to the
stored the set of maximas of a set of points stored in the current staircase structure instead of complete recompu-
subtree rooted at that point. This set is not stored ex- tation. There are a number of cases depending on the
plicitly as we will see. The initial tree can be constructed topmost node of M'(w), Top(M'{w)) where M'(w) is
in 0(nlogn) time easily. Let M(q) be the set of maxi- the updated staircase structure at w. We assume that
mas at node q in the tree. Furthermore assume that at Top(M'(w)) has changed. If it does not, then no change
each node the maximas are specified in a staircase sorted in the merged staircase structure is required.
order with points having decreasing y-coordinate and in-
creasing x-coordinate. We let Top(M(q)) represent the Case 1: Top(M'(w)) is above Top(M(v)). In this case
point with the maximum y-coordinate in the staircase the merger requires constant time since M'(v) is actually
structure representing the maximas at node q. We let M'{w). (Fig. Ml)
j/(p) refer to the y-coordinate of point p. Case 2: Top(M'(w)) is not above Top(M(v)). In this
The first scheme that is proposed uses the fact that case the merger is done by a binary search on M(v) and
during insertions binary search is performed only once requires 0(logn) time. Note that from this node up-
after which the inserted point is dominated. This fact words to the root the top node of any staircase structure
has also been used in [FR], [J] in their data structure. does not change and new merger points need not be re-
We thus obtain a solution with 0(logn) insertion time computed. (Fig. M2)
and 0(log2n) deletion time. Also isolated is the reason
for the 0{log2n) behaviour of the scheme. This scheme Next consider the case when P uses u. Again, suppose
is briefly described in section 3. M(u) has been modified and let the modified structure
In section 4, the algorithm is refined so that both be M'(u). There are two cases:
insertions and deletions can be done in 0{logn) time.
We do so by maintaining approximations to the stair- Case 1: Top(M(u)) has changed. There are two cases.
case structure. This allows the use of only a constant If Top(M(w)) < Top(M'(u)) then change the top node
number of binary searches to update the balanced tree of M(v) to Top(M'(u)) if necessary. Otherwise, change
structure storing the maximas. The improvements are Top(M(v)) to Top(M(w)) if necessary.
described without a description of the secondary struc- Case 2: Top node of M(u) has not changed. In this
tures required to store the maximas at the nodes of the case we have to determine the changes that are to be
balanced binary tree. Finally, in section 5, the space re- made to M(v) since the top of M(w) has to be posi-
quirements are shown to 0(n). In section 6 the scheme tioned with respect to the changes in M(u). We note
is modified to list the maximal points in linear amortized that this can be done in constant time since only a com-
time. parison of Top(M(w)) with the point inserted into M{u)
and points adjacent to it has to be made, provided that
node is in the set of maximas. This information is easily
An 0{logn) insertion and maintained as we proceed up the path P.(Fig. M3)
2 We thus see that an O(logn) insertion is possible since
0(log n) deletion scheme. binary search is performed once only in Case 2 when P
Let us first consider insertions. Let p be the point to be uses w.
inserted into the tree MT(S) storing the set of maximas Next consider the affect of deletions. Again consider
of the point set S. Since the leaves are arranged in as- a path P from leaf to root and a triple of nodes (u, v, w)
sorted order a binary search gives us the leaf at which on the path. The path may use either u or w. First
the point p is to be inserted. Let P be the path from the consider the case when the path P uses w. Suppose the
root to the leaf. Suppose, on the path P, we encounter a maximal set has been recomputed at w and is M'(w).
triple of nodes (v., v, w) where v is the common parent of There are two cases depending on Top(M(w)): Case 1,
u and w. u is the left child and is referred to by left(v) where Top(M(w)) changes. This case has two subcases.
and w the right child and referred to by right(v). P uses And Case 2 when Top(M(w)) does not change. We con-
v and one of u and w. sider the subcases.
Firstly suppose the path P uses w. Suppose the max- Case 1.1: Top(M'{w)) < Top(M(u)). Then M(v) can
imas of the points in the subtree at w has been recom- be computed in 0(logn) time by locating Top(M'(w))
puted because of the insertion of the new point p. M(v) in Top(M(u) by a binary search.
has to be recomputed from M(u) and M(w) by a merger. Case 1.2: Top(M'{w)) > Top(M{u)). Update
The merger, in general, involves locating Top(M(w)) in Top(M(v)) in O(l) time since M(v) is M'(w).
M (u) and then replacing the portion of M (u) dominated Case 2: Top(M(w)) does not change. M(v) changes ex-

141
actly as M(w) is changed in the portion of the staircase 4.2 Detailed Algorithm.
common to both M(v) and M(w). In this case the list at
v need not be searched but only changed at Top(M(w)) We first formally define the semi-staircase structure at
to incorporate M'{w). the nodes.
Next consider the case when the path P uses u. M{y) The Semi-staircase structure is a sequence of nodes,
is obtained from M'(u) and M(w) by a merge operation simultaneously sorted in increasing x order, and in de-
and requires 0(logn) operations. creasing y-order such that two adjacent vertices are ei-
ther connected by a horizontal and vertical Manhattan
It is the first sub-case of the first case when the
path uses w and u that creates the first problem, i.e. path or by a straight line (called kink line). (Fig. M4)
it gives a time bound of 0(log2n) since the merge of A Stairstep is the horizontal and vertical Manhattan
M'{u) and M(w) requires O(logn) time due to search path that connects two adjacent vertices.
for Top(M(w)) in M'(u) and there may be Q(logn) The kink line (u, v) is an approximation to a staircase
such merges to be performed. Also Top(M'(w)) may structure which connects the two vertices u and v.
be changed at 0(logn) nodes along path P. Finally we We need the following property of kinks which will be
consider the rebalancing operations. They can be per- proved later.
formed in 0{logn) time since the balancing requires at Property Cover: Every kink line connecting a point u,
most O(l) locations of top nodes of staircase structures. which is not maximal, to another point v is dominated
Next we show how to improve the performance to by a horizontal edge or a kink edge, i.e. there exists a
0(logn) per deletions also. point, c with greater y co-ordinate than u and greater x
co- ordinates than it and v.

4 An Improved Solution. When the point c is connected by a horizontal line to


a point 5 with y-coordinate equal to or just above that of
4.1 Outline. v, s is called the kink-cover of the kink line. Note that
such a point need not always exist, e.g. it does not exist
In order to improve the performance we attempt to re- when v is the top node of a staircase structure. Note also
move the bottleneck introduced by the repeated mergers that we may obtain a sequence of kink lines. The Cover
that are required on path P when M'(u) and M(w) are property is also satisfied for each edge of this sequence
merged after a deletion. This is done by performing a and hence by the entire sequence.
constant number of mergers as follows: We next show how to dynamically maintain this semi-
Let Mset(P, u) be the set of nodes on the path P with staircase structure under insertions and deletions.
the following property: Top(M(wi)), uij G Mset(P, u)
intersects the section of the staircase in M(u) that is
changed due to the deletion. Note that io; is an ances-
4.3 Insertions
tor of u and \Mset(P, u)\ — 0(logn). Only one merger We first consider Insertions. For inserting point p let P
is required and that is the merger with the maximal set be the path from leaf to root. As we proceed up the path
M(wk) where wk is the node in the binary tree such that consider the triple of nodes (u, v, w) such that v is the
Top(M(wk)) exceeds the top, Top(M(wi)), of all other parent of u and w.
nodes in the set Mset(P, u). All the other mergers re- Suppose the path P uses w. The cases are similar to
quired are deferred by actually constructing the chains the previous section and involve a binary search with
so that M(wi), Wi £ Mset(P, u) is merged with M(ui), Top(M(w) onto a semi-staircase structure. The first
where Ui is the sibling of Wi , by joining Top(M(vii)) change in the algorithm occurs when y = y(Top(M(w)))
to either the node in M(u) at which M((wk)) is merged intersects a kink line joined to v. In this case a new kink
or to Top(M(ui)). This construction is required for a line is introduced from Top(M(w)) to v. The second
constant number of sets, Mset(P,u) corresponding to change is when at a node w, Top(M(v)) is connected by
nodes u on the path P. This destroys the staircase na- a kink edge to a node in M(u) and the node to which the
ture of the maximal set, creating non-horizontal and ver- kink edge is connected is removed by the insertion of a
tical lines called "kinks" but the deletion now requires point. Top(M(v)) is then located within the new stair-
0(logn) steps. case in constant time by computing the intersection with
The insertion also requires 0(logn) steps. It may so the stairstep newly introduced. Thus as in the previous
happen that during insertion or deletion the node at section one location of Top(M(w)) in a semi-staircase
which the "kinks" occur changes. The kinks thus shift. structure is required.
However we show that the shift only occurs once on the Before detailing the location of Top(M(w)) we de-
path and there are only 0(logn) edges to be transferred scribe in general the procedure for the location of a point
at the kinks. p in a semi-staircase. The procedure is recursive. At any
node v in the tree we check if the point is located in the

142
part of the semi-staircase at the left son or at the right The relocation is done onto a staircase structure Af(u).
son and we recur in the appropriate sub-tree. This check When kink edges are present at the node q, relocation of
is done as follows: Suppose w and u are the right and the topmost node may destroy the semi-staircase struc-
left sons at v and M(tu) is merged with M(u) by a hori- ture and changes have to be made to preserve the semi-
zontal edge, h. Then the procedure branches to the left staircase structure and the cover property. We describe
if j/(p) is greater than the y co-ordinate of point on h these changes next.
otherwise the procedure branches to the right. Alter- When other kink edges are present relocating
natively, if at v there is a kink edge merging the right Top(M'(w)) involves two sub-cases. Either the top node
semi-staircase with the left then the procedure recurs at of M'(w) is relocated below the kink edge (s, q), where
the left. The procedure stops at a leaf having discovered s is the point at the first descendant node of u attached
on the staircase a point with y co-ordinate just greater to q by a kink edge. Or onto the kink edge. Let d be the
than y(p). This is the node to which p is located. The node at which s is attached to q by a kink edge. Note
procedure requires 0(logn) steps. Also those 0(logn) that s € M(right(d)) where right(d) is the right son of
kink edges on the search path which intersect y = y(p) d. s is located in the staircase structure at left(d). Sup-
are obtained. pose the node to which the relocation is done is q'. Next,
To update the staircase structures after the location of all the kink edges intersected by y = y(s) have their top
a point is done, suppose the node to which the location point changed to the node in the staircase just below q'
is done is q'. Firstly the edge joining Top(M(to) to q' if such a node exists. Also Top(M'(w)) is relocated in
is added to the semi-staircase structure at v. Next the the changed structure M'(u). All the operations require
kink edges intersected by y = y(s) have their top point 0(logn) time since atmost two locations are done and at-
changed to the node in the staircase just below q' if such most O(logn) kink edges have their top point changed.
a node exists. Else the kink edges become horizontal In the second sub-case, i.e. when Top(M'(w)) is lo-
edges. cated onto the kink edge, Top(M'(w)) is located in M(u)
When path P uses u, the update after an insertion by a procedure similar to the one which locates s in the
is again in constant time as described in the previous above case. And all the kink edges intersected by the
section. horizontal edge are changed. In this case too 0(logn)
Thus insertions can be done in 0(logn) steps. steps are required.
Next consider the situation when Top(M(w)) was con-
4.4 Deletions nected by a kink edge to a node q in M(u). Again, let
Next consider deletions: Again consider the triple s be the point first attached to 9 by a kink edge at a
(u, v, w). Suppose P, the path from the leaf deleted (cor- descendant node of u (if such a node exists). Either
responding to point q) to the root, uses w. We consider the y-coordinate of Top(M'(w)) is less than that of 5 or
the case depending on whether M'(w) has it's topnode not. Firstly consider the case when Top(M'(w)) < y(s).
different from M(w) or not. Then Top(M'(w) is relocated in the staircase structure
at M(u). Furthermore s may be located also, modify-
Case 1.1: Top(M'(w)) is changed, i.e. the topmost ing kink edges intersected by y = y(s) as in the above
node of the previous maximal set has been deleted. In case. Next, consider the case when Top(M'(w)) > y(s).
this case Top(M'(w)) is to be located again in M(u) Then a kink edge from Top(M'(w)) to q may be retained
to construct M(v). There are two subcases; Either the in the merge step or Top(M'(w) may be located in the
new topmost node is the topmost node of M(v). In this staircase structure modifying the kink edges from s and
case the check is done in O(l) time. On the other hand other nodes as described in the previous paragraph.
the topmost node has to be relocated within M(u) in We next characterize when the relocation of points in
0(logn) time. However we need to do this only when the semi-staircases is necessary: Let Uset be the set of
the set of maximas is affected. Before we consider the nodes, whose Top has changed due to the deletion of the
number and type of such relocations required we describe particular node. Note that the Top value of these nodes
in detail one such relocation: There are two possible situ- is in increasing order of y-coordinate. A relocation is
ations depending on whether the previous topmost node done at the node, say t, with the highest Top value.
is connected by a kink edge or not. Furthermore, consider a node u,u ^ t and u 6 Uset.
We first consider the situation when the topmost node u is not relocated but Top(M(right(u))) is joined to
in M(w) is not connected by a kink edge to a node in Top(M(left(u))) by a kink edge.
M(u) but by a horizontal edge. Let q' be the node
in M(u) to which the topmost node in M(w) was con- Case 1.2: Top(M'(w)) has not changed. In this case
nected. The relocation depends on whether or not other no changes are required in the merger step and the com-
nodes were connected by kink edges to the node q. If no position of M'(w) and M(v) is carried upwords in O(l)
other nodes were connected then the relocation is simple. time.

143
Next suppose the path P uses u. We assume by in-
When a deletion is performed, the operations firstly
duction that M'(u) has a semi-staircase structure.
introduces kink edges by finding the node closest to the
Case 2.1: M(w) intersects M(u) at the stairstep asso-
root which intersects the modified staircase and locating
ciated with the removed node. Let R{q) be the semi- it in the staircase structure. All other edges added at
staircase that replaces the node q deleted. R(q) is ob-
descendant nodes are kink edges and valid, i.e. joining a
tained as we traverse up the path P. We let S be
point in the right subtree to a point in the left subtree
the set of nodes on the path P such that if v e S unless the point is at the top.
then Top(M(v) intersects the stairstep associated with
These also include kinks introduced by adding edges
q and thus R(q). Let w be the node in S such that
from the Top of staircases at the left son to the Top of
Top(M(w)) > Top(M(u)), u £ S. Then Top(M(w) is
staircases at the right sons. The cover property is main-
located in R(q) to give a node z which forms the node
tained since each kink edge (u, v) is covered if it has been
above Top(M(w)) in the semi-staircase structure at the
determined if u is not in the maximal set. Also when
parent of w. Otherwise a direct line (kink line) is drawn
kink and cover edges are modified by locations the semi-
from Top(M{u)),u 6 5 to a node t in R(q) where t is
staircase structure and cover property are maintained as
the node in R(q) with y-coordinate just less than z and
detailed by the construction procedure. This is also true
greater than Top(M(w)). If such a t does not exist then after balancing of the tree. ■
either a normal staircase is constructed with z being the
Since the cover property is maintained at the nodes
node next in the semi-staircase structure at the parent
of the tree kinks in the output are important in that
of u. Also if t is not present in M(w), where w is the sib-
these kinks have to be removed to obtain the actual out-
ling of u, then Top(M(u)) is connected via a kink line to
put. These kinks can be removed at the time of report-
Top(M{w)). Note that this procedure involves delaying
ing along with other kinks that are discovered when the
the construction of the straight lines until z is obtained.
kmks are removed resulting in an output complexity of
All the merges required can be done in O(logn) time
(Fig. M5) 0(m + (chng)logn) when there are chng changes in the
set of maximas to be reported. Details of the report-
ing will be discussed in the next section. Once removed
Case 2.2: M(w) does not intersect M(u) at the
these kinks do not occur again in the output.
stairstep associated with the changed node. Then no
To summarize
change in the merger need be done.
The above cases complete the description of the
changes required after a deletion. It is easily seen that Lemma 2 The structural changes required to maintain
O(logn) steps are required. Furthermore, balancing re- the semi-staircase structures at each node of the Max-
quires O(logn) steps as each rotation or double rotation ima Balanced Tree under insertions and deletions can
requires at most O(l) relocations of topmost nodes giv- be carried out in O(logn) operations. Moreover 0(logn)
ing a bound of O(logn) steps. operations are required for every change to be reported in
the maximal set.
Note however that at the end of the deletion some
kinks may be left on the final staircase structure at the
root.
4.5 An 0(n) Space Solution
We next show that the insertion and deletion proce-
dures are correct. It suffices to show that a semi-staircase In this section we show how to implement the scheme
is maintained at each of the nodes and also that the cover for insertion and deletion in 0(n) space. This is accom-
property is maintained. plished by maintaining O(l) information at the nodes of
Lemma 1 The insertion and deletion procedure main- the balanced binary search tree.
tains semi- staircases at each node of the Maxima Bal- Firstly at each node, v, is maintained left and right
anced Tree. Moreover the semi-staircase structures sat- pointers, left(v) and right(v), to the sons of the node,
isfy the cover property. say u and w. We also maintain two variables TOP
and INTER which contain points. TOP is the top-
Proof: The proof is by induction. It is trivially true
most point in the semi-staircase structure at v (This
when there is only one point. Thus assume that there
point is also referred to by Top{M{w)) before). And
are n points and the data structure contains lists which
INTER is the node at which Top(M(w)) is located in
are staircase structures.
the semi-staircase structure at u, i.e. INTER is the
If an insertion is made the operation only introduces a
point in the staircase structure at v just above the point
kink edge when the inserted node is located onto a kink
TOP at node w in the staircase structure at v. Note
edge in the staircase structure. The new kink edge added
that Top(M(w)) may be attached to INTER by a kink
maintains the semi-staircase structure and also the cover
edge. In the description below the value of INTER for
property since either the kink edge is the dominating
nodes where a kink line is drawn is assumed to be the
edge or the dominating edge is unchanged.
y-coordinate of the upper point of the kink line. To

144
list the points more efficiently we need another variable son to the left son then locate y(p) in the left subtree
CHANGE which we detail below. again. Otherwise we return with INTER as the node
We next describe the listing and search procedures on required.
the data structure without using CHANGE. Note that this procedure requires 0(logn) time. A list
of kink edges along the path s.t. y = y(p) intersects the
4.6 Listing the maximas kink edge is also obtained. These edges are modified so
that their top end is y(p) thus modifying the staircase
To list all the maximas we proceed as follows: We start structure as described before.
at the root. At the root node TOP gives the first node in The procedure, LIST, above is invoked at the root
the staircase structure. To obtain nodes contributed by with stop being the least y- coordinate. We omit the
the left subtree we test if the topmost node of the right proof of correctness. The procedure requires time pro-
subtree, w, is located strictly below the topmost node of portional to 0(mlogn) where m is the number of maxi-
the left subtree, u. If so then we list, recursively, those mal points.
maximal elements in the subtree at u not yet reported To list the maximal points in 0(m) time we make
and with y co-ordinates greater than the y-coordinate of the following modification to the data structure: At
TOP(right(w)). We then list the maximal elements in each node, say v, we store a pointer called CHANGE.
the subtree rooted at w recursively. When we apply this CHANGE points to the first preorder descendant node
procedure recursively we note that at a node the left son where a change to the staircase structure at v is made.
may be merged with the right son using a kink edge. IUNTER(v) < TOP(y) then CHANGE points to the
We thus first remove this kink edge before recurring. first node , say u, in a preorder scan of the left sub-
This procedure is formalized as follows: tree rooted at v where TOP(right(u)) > INTER(v).
If TOP(v) = TOP(right(v)) then CHANGE{v) is the
same as CHANGE(right{v)).
LIST(v, stop, last);
(This procedure lists the maxima in the It is easy to see that using these pointers we can re-
subtree at v with y-cordinate greater cursively list the maximas in linear time. This includes
than stop, last is the y-coordinate the time required to remove kinks along the staircase
of the last maximal point output.) structure. The following scheme does so:
Begin
LIST[y, stop, last);
If last > y{TOP) > stop then
(This procedure lists the maxima in the subtree
begin output TOP; last := TOP end;
at v with y-cordinate greater than stop)
else
Begin
begin
If last > y(TOP) > stop then
if (right son is connected to left
begin output(TOP); last:= TOP end;
son by a kink edge) then
else
LOCATEY( Top(right{v)));
begin
if y(TOP) > y{INTER) then
if (right son is connected to left
begin
son by a kink edge) then
LIST(left, y{INTER), last);
LOCATEY( Top(right(v))) and update
LIST(right, stop, last)
CHANGE using LOCATE CHANGE.
end
if y(TOP) > y(INTER) then
else LIST(right, stop, last)
begin
end
LIST(CHANGE, y(INTER), last);
end.
LIST(right, stop, last)
end
We now describe the implementation of the locate pro- else LIST(CHANGE, stop, last)
cedure, LOCATEY. The locate algorithm has been de- end
scribed before. end.
Suppose we are at a node v and wish to search for the
horizontal location of p in the semi-staircase structure
at v. There are two cases: Suppose y(INTER) is less Note that the procedure LOCATE CHANGE is in-
than y(TOP). If y(p) > y(INTER) then we recursively voked to find the value of CHANGE at every node.
search in the left subtree. And if y(p) < y(TOP(w)) This is required since this value is not updated at ev-
where w is the right son of the current tree node then ery node during the deletion operation when kink edges
we recur to the right. Otherwise we get two subcases. If are constructed. The procedure LOCATE CHANGE
INTER is TOP because of a kink edge from the right will be described later in the section. Before LOCATE

145
CHANGE is invoked the kink is removed by locat- v. If yp > y(INTER(Can)) a new value of Can is ob-
ing TOP{right(v)). This requires 0(logn) steps for tained from the CHANGE value at the node currently
every kink removal. Since the corresponding point is assigned to Can and the process repeated until we find
not in the previously reported output (else the kink a node at which INTER has greater y-coordinate than
would not be present) the complexity of the procedure is yp. Such a node exists when this procedure is called
0(m + chng(logn)) where m is the number of maximas and CHANGE is assigned this node. At each step the
and chng is bounded by the number of changes in the height of Can decreases. Thus this procedure requires
set of maximas since the last report where every change 0(logn) steps.
involves removal of a kink.
We next show that the pointers CHANGE can be
4.7 Searching for Dominance
assigned at each node initially in O(l) amortized time.
This requires the use of a stack to maintain a list of In this section we show how to determine if a given point,
nodes at which relevant changes to the current staircase p, is dominated by the set of maximas or not. We do so
structure have taken place. The top of the stack gives by a search for the y-coordinate of the given point in the
a candidate to be assigned to CHANGE at the cur- set of points with greater x-coordinates. Let P be the
rent node, say v, as we traverse up the tree to the root. path from the root to the leaf where the x-coordinate of
It is the first descendant node in preorder at which a the point p is located. Let R be the set of roots of the
change in the staircase structure takes place. Note that subtrees to the right of path P. It suffices to check if
at this node, say u, Top(right(u)) was located within y{p) > y(TOP(v)) for all v G R. If it is, then the point
M(left(u)). The next item in the stack has the same is not dominated otherwise it is.
property, i.e. it is the first descendant node v of the cur-
rent node with the property that INTER{y) is greater
than the value of INTER at the current node. The stack 4.8 Insertions and deletion
contains nodes, v, such that INTER(y), is in increasing
To bound the time for insertions and deletions in the
order for the nodes as we go from top to bottom in the
data structure we note that the crucial step while per-
stack.
forming insertions and deletions is that of locating the
To obtain a stack and to assign a value to CHANGE topmost node of a semi-staircase structure in another
at the current node, v, we adopt the following proce- semi-staircase structure. This is problem LOCATEY.
dure. At node v, TOP(right(v)) is located within the An 0{logn) solution to this problem has been presented
staircase structure at left(v). If the location is such that above in the 0(n) space data structure.
TOP(right(v)) exceeds TOP(left(v)) then the value of Moreover the O(l) rotations required can also be
CHANGE is the same as the one at right(v) and the done in 0(logn) steps since they require O(l) mergers,
stack at the current node is the same as the stack on the each requiring 0{logn) steps. The variables TOP and
right son. If TOP(right(v)) is below TOP(left(v)) then INTER stored at the nodes at which relocations are
CHANGE is obtained from the stack of CHANGE val- performed can also be modified in 0(logn) steps. Note
ues at left(v) as follows: Let Can be the node on top that the value of INTER can be obtained by using
of the stack. If the y-coordinate of INTER(v) is > in- LOCATEY. The value of TOP is immediately avail-
coordinate of INTER at Can then Can is removed from able.
the stack and a new candidate is obtained from the top We would also like to update the value of CHANGE
of the stack. This removal is repeated until we find a at the nodes. We consider the insertion path P(p) for a
node on the stack at which the y-coordinate of INTER point p. Let cp be the node at which p is located within a
is above the y-coordinate of INTER{v). CHANGE at staircase structure. Below that node, p is at the TOP of
v is then assigned to be this node. Moreover the modi- the staircase structures. Also let cu be the node at which
fied stack obtained from the left son is updated with i; p is removed from the staircase structures. Above this
and the stack at right(v) is removed from further consid- node p is no longer on the staircase and will not affect
eration. The initialization of CHANGE can be done in the value of CHANGE at these nodes. The procedure
constant amortized time at the nodes since once a node which modifies CHANGE values is similar to the ini-
is deleted from a stack it is not considered again. tialization procedure. For nodes below cp the value of
We finally describe the procedure LOCATE CHANGE'.is not modified. The value of CHANGE at
CHANGE. This procedure is used when the merge of cp is computed from the left son of cp by the procedure
the right son with the left son at v is done by a non- LOCATE CHANGE which has been described before.
kink edge using LOCATEY. In this procedure let yp For nodes above cp upto cu the value of CHANGE is cp
be the y-coordinate of the located point. A candidate, unless a change in the current staircase structure takes
say Can for CHANGE is obtained from the value of place. Again if the change is below the y-coordinate of
CHANGE at the staircase structure at the left son of p the change is stacked. And if the change is above the

146
^-coordinate of p then Cp is removed from further consid- semi-staircase, i.e. not at the top of the semi-staircase
eration and the value of CHANGE need not be changed at v. At this node the point has to be located within a
at this node and above since the value of INTER is un- staircase structure. This location, LOC(p), is important
changed. since it may need to be redetermined during deletions.
Furthermore the entire insertion procedure requires So we keep this location with the point. However this lo-
0(logn) steps since at most 0(logn) values are stacked cation is not updated at every insertion or deletion since
or popped while recomputing CHANGE on P(p). And only the top points in a staircase are manipulated. Thus
LOCATE CHANGE is called only once. when this point is to be output the value of LOC(p)
A similar procedure to update CHANGE is used may need to be updated. If the location requires a bi-
when a point is deleted. Firstly, note that only 0(1) lo- nary search the time for this search is charged to a point
cations which require a binary search are performed dur- that is inserted or deleted and changes this value. We
ing a deletion. Thus O(l) LOCATE CHANGE calls prove this below:
which requires 0(logn) operations are required. When
kink edges are added only O(l) work is required to up- Lemma 3 Every update of LOC(p) for p G M(S), the
date CHANGE. Modification of CHANGE along the set of maximas of a point set S, can be charged uniquely
deletion path is done using stack manipulations as in the to an insertion or a deletion.
insertion case and requres 0(logn) time.
We next show how to rebalance. We consider single Proof: To prove the lemma, suppose LOC(p) for point p
rotations only. The procedure is similar for double rota- is modified. Let u be the node at which LOC(p) is mod-
tions. Let v be the node at which a rebalancing opera- ified and let v be the son of u on P(p) where P(p) is the
tion is performed. At the nodes affected by the rebalanc- path from the leaf to the root. The relocation is required
ing CHANGE is obtained by the procedure LOCATE when p is added to the set of maximas. The modification
CHANGE described above. Also the rebalancing may must be due to an insertion or a deletion since the last
affect the value of CHANGE above v. Note that rebal- time p was added to the set of maximas. Since the Top of
ancing changes the value of INTER at two nodes. The every node is updated during the insertion procedure, p
procedure for updating CHANGE above v is similar to cannot be at the top of the staircases at v when insertions
that for updating CHANGE at nodes above cp in the affect v. Thus p must have become the topmost node of
insertion case when point p is inserted. Note that the a staircase structure due to a deletion and moreover the
initial nodes to be stacked to compute CHANGES are top node of the staircase structure at v just prior to this
chosen from the nodes affected by the balancing. Thus event must be above the topmost node of the sibling
updates to CHANGE after rebalancings can be done in else p would have been located, (we are referring here
0(logn) operations. to the deletion procedure described in section 4). Thus
We state our final result: if p is to be relocated by a search requiring more than
O(l) time the corresponding section of the staircase at
Theorem 1 The maxima* of a set of point can be main- w, the sibling of v must have been modified. The loca-
tained in a data structure which uses 0(n) space and tion is charged to the deletion or insertion that modified
which requires 0(logn) operations per update when 0(n) the section. Note that other points which have the same
points are deleted or inserted. The output complexity is LOC value as p are also affected by the same deletion
0(m+(chng)logn) when m points are reported and when or insertion. Let this set be called OTHER. The points
there have been chng changes since the last report. in OTHER are dominated by p since p is maximal and
the location of p introduces kink edges from these points
to the located point. Moreover the points in OTHER
5 An improved amortized can be ordered by domination since they lie along the
Bound path to the leaf where LOC{p) is present in the Maxima
Tree. The topmost kink edge becomes important and is
In this section we show how the maximas can be reported removed either when p is deleted or when the maximas
in linear amortized time. are to be reported. Either the first point in OTHER is
To improve the reporting bound we note that the in the set of maximas or some other point dominating it
0(logn) factor in the reporting time bound essentially is. The location at this step is charged to p and points in
arises because a point repeatedly occurs in the changes OTHER associated with the point located at this step.
in the maximal set, i.e. it occurs, is removed from the To summarize the details: With each point, p we asso-
maximal set by an insertion, and then re-occurs in the ciate a set OTHER(p). This is the set of points whose
set of maximas. Thus its location in the staircase is to LOC will be affected due to the deletion of p. The relo-
be determined at each step. To remedy this we keep cation of a point occurs when the point becomes a maxi-
this location as follows. Let p be a point and let v be a mal element and there is a kink line from the point in the
node in the tree where the point p first occurs within a staircase structure. This happens in two ways. Firstly

147
when the point, p becomes the Top point at a node dur- like to thank MPI-Informatik, Germany for providing
ing a deletion of a node which was the old Top point of support during the final part of the work.
the staircase structure containing p at the node and when
LOC(p) has changed. The other event happens when the
point, p, is to be located onto a staircase structure on References
which the deleted point was located. In the first case
[FP] F.P. Preparata and M. I. Shamos, Computa-
the location is charged to the deleted point which intro-
tional Geometry- An Introduction, Springer
duced the modified semi-staircase at that node. Note
Verlag, (1985).
that only one location is done. Other points connected
by kink lines and which are encountered during the loca- [GR] G.N. Fredrickson and S. Rodger, A new ap-
tion are assigned to the located point, p, by adding them proach to the dynamic maintenance of maxi-
to the set OTHER(p) since these points will be affected mal points in a plane, Discrete and Computa-
due to the deletion of p. In the second case the location tional Geometry, 5, 365-374, 1990.
of p is charged to the deleted point that forced the loca-
tion, say q, and the elements oiOTHER{q) are assigned [HS] Hershberger and Suri, Offline Maintenance of
to OTHER(p). Thus a deleted point is charged twice, Planar Configurations, SODA, 1991, pp. 32-
once in the first case and once in the second. The second 41.
type of charging is part of the deletion process whereas
[J] R. Janardan, On the dynamic maintenance of
in the first case a kink is removed from the output and
maximal points in the plane, 40(2)(1991) 59-
a previous deletion is charged.
64.
Finally, note that the LOC values do not change due
to rotations and double rotations. The lemma follows. [KLP] H.T. Kung, F. Luccio, and F.P. Preparata,
■ On finding the maximas of a set of vectors, J.
Note, while maintaining LOC(p), CHANGE values Assoc. Comput. Mach. 22, 4 (1975), 469-476.
at tree nodes also need to be maintained. This in-
volves computing CHANGE by a call to LOCATE [OL] M.H. Overmars and J.L. Van Leeuwen, Main-
CHANGE and updating CHANGE on the path from tenance of configurations in the plane, J.
the leaf to the root. This is done by a procedure simi- Comp. System Sc. 23 (1981), 166- 204.
lar to that which updates CHANGE during insertions
[T] R.E. Tarjan, Updating a balanced search tree
and requires 0(logn) steps. We thus have the following
in O(l) rotations, IPL 16 (1983), 253-257.
result:
[WL] D.E. Willard and G.S. Luekar, Adding range
Theorem 2 The set of Maximas of a set of points in
restriction capability to dynamic data struc-
the plane can be maintained in 0(nlogn + mlogn) oper-
tures, J. Assoc. Comput. Mach. 32, 3 (1985),
ations when there are n insertions and m deletions. The
597-617.
data structure requires linear space. Moreover, r maxi-
mal points can be listed out in 0(r) operations.

6 Conclusions and
Acknowledgements.
We have shown efficient schemes for dynamically main-
taining the set of maximas of a set of points in 2-
dimensions. We do so by maintaining approximate in-
formation. This technique can also be applied to main-
taining maximas in higher dimensions with less effective
results. Maintaining the maximas efficiently under both
deletions and insertions in higher dimensions is a chal-
lenging problem. This technique has also been applied
to convex hulls by the author but the results do not give
optimal insertion and deletion time as yet. The results
will be reported elsewhere. Other applications of this
technique would be interesting. I would like thank A.
Dutta and S. Sen for helpful discussions. I would also

148
M(u) ' M w
( > M(u)
H M(w)
Fig. Ml Mergel Fig. M2 Merge2

M'(u)
, ! .
M(uT~l I ~l , M(w)

Fig. M3 Delete

Covering line w

Fig. M4 Semi-Staircase Structure.

Semi-Staircase structures

Fig. M5. Deletion of node v.

149
Biased Finger Trees and Three-Dimensional Layers of
Maxima
(Preliminary Version)
1
MIKHAIL J. ATALLAH* MICHAEL T. GOODRICH " KUMAR RAMAIYER*
Department of Computer Sciences Department of Computer Science Department of Computer Science
Purdue University The Johns Hopkins University The Johns Hopkins University
W. Lafayette, IN 47907-1398, USA Baltimore, MD 21218, USA Baltimore, MD 21218, USA
E-mail: mjaScs.purdue.edu E-mail: goodrichScs.jhu.edu E-mail: kumarScs.jhu.edu

Abstract 1.1 Background and Motivation

We present a method for maintaining biased search


trees so as to support fast finger updates (i.e., updates When a binary search tree T is maintained dynamically
in which one is given a pointer to the part of the tree as a primary structure it is appropriate to count, as a
being changed). We illustrate the power of such biased part of the update time, the time to perform a top-down
finger trees by showing how they can be used to derive search for the node(s) in T being changed. This may
an optimal 0(n logn) algorithm for the 3-dimensional not be appropriate when T is used in tandem with other
layers-of-maxima problem and also obtain an improved structures, however, for one may be given, as part of the
method for dynamic point location. input to an update operation, pointers, or "fingers" [20,
25, 22], directly into the part of T being changed. Such
a pointer could come, for example, from a query in
some auxiliary data structure. This may, in fact, have
been a prime motivating factor behind the method of
1 Introduction Huddleston and Mehlhorn [22] for designing a dynamic
search tree that has an 0(1) update time performance
Binary search trees are one of the most useful data for insertions and deletions when the search time is not
structures, and are ubiquitous throughout the design counted, where we use "Ö(-) time" to refer to a worst-
and analysis of efficient algorithms [14]. In some cases case time bound that is amortized over a sequence of
they serve as a stand-alone structure (e.g., implement- updates.
ing a dictionary or a heap), while in many cases they
are used in tandem with other structures, either as pri- Another important variant concerns the case when
mary or secondary structures (or both, as in the range each item i in the search tree is given a weight, Wi.
tree [36]). In many dynamic computational geometry This weight is a positive integer that may be propor-
algorithms they may even be found as tertiary struc- tional to an access probability, as in an optimal binary
tures, e.g., Goodrich and Tamassia [19]. search tree structure [3, 24]. Or it may represent the
size of some auxiliary structure associated with item i,
as in a link-cut structure [40] (which itself has many
*This research supported by the NSF under Grant CCR- applications [12, 17, 18]) or in a point location struc-
9202807. ture built using the trapezoid method [8, 35, 38]. In
'This research supported by the NSF and DARPA under cases with weighted items such as these one desires a
Grant CCR-8908092, by the NSF under Grants CCR-9003299,
CDA-9015667, and IRI-9116843. search tree satisfying a bias property that the depth of
^This research supported by the NSF and DARPA under each item i in the tree be inversely proportional to wl.
Grant CCR-8908092 and by the NSF under Grant IRI-9116843. Bent, Sleator and Tarjan [5] give a method for main-
taining such a structure subject to update operations,
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for such as insertions, deletions, joins, and splits, as well as
direct commercial advantage, the ACM copyright notice and the predecessor query operations. Most of their update and
title of the publication and its date appear, and notice is given query operations take 0(log W/wi) time (in some cases
that copying is by permission of the Association of Computing as an amortized bound), with the rest taking slightly
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. more time, where W is the sum of all weights in the
tree.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

150
1.2 Our Results Insert(i,Wi, Pi-, T) : Insert item i with weight Wi into
T, where p%- is a pointer to the predecessor, i~,
In this paper we examine a framework for achieving of i in T (if i has no predecessor in T, then we let
fast finger-tree updates in a biased search tree, and we this point to z's successor).
refer to the resulting structure as a biased finger tree.
We know of no previous work for a structure such as Delete(i,pi,T) : Remove item i from the tree T, given
this. We show that insertions and deletions in a biased a pointer pi to the node storing i.
finger tree can be implemented in Ö(logiOi) time, not Split(i,T) : Partition T into three trees: 7/, which con-
counting search time, while still maintaining the prop- tains all items in T less than i, the item i itself,
erty that each item i is at depth O(log W/wl) in the and Tr, which contains all items in T greater than
tree. Moreover, we show that, while split operations i.
will take Ö(log W/wi) time (whichjs unavoidable), we
3oin(Tx,Ty) : Construct a single tree from Tx and Ty,
can implement join operations in 0(1) time.
where all the items in Tx are smaller than the items
Our structure is topologically equivalent to that
inTy.
given by Bent, Sleator, and Tarjan [5]. In fact, if each
item i has weight wl = 1, then our structure is topologi- Change-weight (i,u4,T,pi) : Change the weight of the
cally equivalent to a red-black tree [14, 21, 41]. It is our item i in T from wz to uv, given the pointer p% to
update methods and amortized analysis that are differ- the node storing the item i.
ent, and this is what allows us to achieve running times Slice(i,T,x,ii,i2) : Break the item i in T into two
that are significant improvements over those obtained items i\ and %2 such that i~ <i\ <%2 < i+, and
by Bent, Sleator, and Tarjan, even if one ignores the the weight of item i\ is x * Wi and the weight of
search times in their update procedures. Moreover, we item %2 is (1 — x) * Wi, where 0 < x < 1, and i~
provide an alternative proof that red-black trees sup- and i+ are predecessor and successor items of i in
port constant-time amortized finger updates (which is T respectively.
a fact known to folklore).
F\ise(ii,i2,i,T) : Combine the items i\ and %2 in T
We show the utility of the biased finger tree structure
into a single item i of weight w^ + wl2 such that
by giving an optimal 0(nlogn)-time space-sweeping
ii < i < %2 in T. The items i\ and 12 need not be
algorithm for the well-known 3-dimensional layers-of-
siblings, but should be adjacent in the total order.
maxima problem [2, 7, 15, 27]. We also give improved
methods for dynamic point location in a convex subdi- As mentioned above, our structure is topologically
vision [35, 8], and present a method for dynamic point similar to the biased search tree1 of Bent, Sleator and
location in staircase subdivision with logarithmic query Tarjan [5]. Our methods for updating and analyzing
and update times. We note that although the stair- these structures are significantly different, however, and
case subdivision we consider is a very restricted form achieve run times better than those of Bent et al. in
of subdivision, it is the only subdivision we know of for most cases (see Table 1).
which there is a method achieving logarithmic query We assume that items are stored in the leaves, and
and update times. In addition, the optimal algorithm each internal node stores two items, left and right,
for three-dimensional layers of maxima problem uses which are pointers to the largest item in the left subtree
our dynamic data structure for staircase subdivision. and the smallest item in the right subtree, respectively.
In addition, the root maintains pointers to the mini-
mum and maximum leaf items. Every node x of the
2 Biased Finger Trees tree stores a non-negative integer rank r(x) that satis-
Suppose we are given a totally ordered universe U of fies the natural extensions of red-black tree rank [41] to
weighted items, and we wish to represent a collection weighted sets [5]:
of disjoint subsets of U in binary search trees subject 1. If a; is a leaf, then r(x) = [log u>i\, where i is the
to the "standard" tree search queries, as well as item item x stores.
insertion and deletion in a tree, and join and split oper-
ations on trees (consistent with the total order). Aho, 2. If node x has parent y, then r(x) < r(y)\ if x is
Hopcroft, and Ullman [3] refer to these as the concaten- a leaf, then r(x) < r(y) - 1. Node x is major if
able queue operations. r(x) = r(y) — 1 and minor if r(x) < r(y) — 1.
In this section we describe a new data structure that 3. If node x has grandparent y, then r(x) < r(y) — 1.
efficiently supports all of the these operations. So as
to concentrate on the changes required by an update In addition to the above rank conditions, we also require
operation, we will assume that each update operation that a node be minor if and only if its sibling or a child
comes with a pointer to the node(s) in the tree(s) where 1
Bent, Sleator and Tarjan actually introduce two kinds of bi-
this update is to begin. Formally, we define our update ased search trees; our biased finger trees are structurally equiva-
operations as follows: lent to the ones they call locally biased.

151
Update Operation Previous Biased Trees [5] Biased Finger Trees
Search(i,T) O (log WM) 0(logW/wi)
Insert (i, w1,pl- ,T) ö(\o. w Ö(|log^i-| + l)
Delete(z,T, pi) Ö{\ogW/wi) Ö(\ogwl)
Split (i,T) Ö(\ogW/wr) Ö(logW/Wi)
Join (TX,TV) Ö{\\ogWx/Wy\) 0(1)
max wtv
Change-Weight (i, w2> ,T,pl) Ö(log(
v ox , ,wti'h)
min{Wi j '' Ö(\\OgWi/Wi:\)
Slice(i,T,x,ii,i2) Ö(l0g —r^ r)
Fuse(ii,i2,i,T) Ö(min(logwn,logu;l2))

Table 1: Summary of Time Bounds for Biased Tree Operations. W and W are the sum of the weights of
all the items before and after the update operation respectively, Wx (Wy) denotes the sum of weights in Tx (Ty),
and i~ (i+) denotes the predecessor (successor) of i. All the complexities for update operations only count the
time to perform the update, and do not include search times.

of its sibling is a major leaf [5]. We refer to this as the due to a single promote/demote operation is 0(1) (ac-
bias property. tually at most 8 credits). Also, each operation adds at
In the remainder of this section we provide algo- most two pairs of equal rank siblings to the tree.
rithms for various update operations on biased finger
trees, and also analyze their amortized complexities.
2.2 Update Operations

2.1 Rebalancing a Biased Finger Tree We now discuss the methods for various update opera-
tions. We begin with the join operation. We describe a
We begin our discussion by analyzing the time needed "bottom-up" strategy, which, contrasts with the "top-
to rebalance a biased tree after an update has occurred. down" approach of Bent, Sleator and Tarjan [5].
We use the banker's view of amortization [42] to ana- Join: Consider the join of two biased trees Tx and Ty.
lyze the rebalancing and update operations. With each Let u and v be the rightmost leaf and the leftmost leaf
node a; of a biased finger tree we associate2 a value, of Tx and Ty respectively. Let w and I be the parent of
C(x), of "credits", with 0 < C(x). Moreover, we par- u and v respectively (see Fig. 1). The nodes u and v
tition these credits into three types—one type that is can be accessed using the pointers in the root nodes x
similar to those used in the analysis of Bent, Sleator, and y respectively. We have the following cases:
and Tarjan [5], one type that assigns 1 credit to the
nodes on the spine of the tree, and one type suggested Case 1. r(x) = r(y). In this case we create a new
by Kosaraju [26]. We omit details here. node z with Tx as the left subtree and Ty as the
After an update operation, we perform promote or right subtree, and we assign a rank of r{x) + 1 to
demote operations on the ranks of some of the nodes z. We then proceed up the tree as in the promote
of the biased finger tree, which increase or decrease operation.
the rank of the nodes, respectively. These operations
locally preserve the rank properties, but may cause vi- Case 2. r(x) <r(y). In this case we traverse the right-
olation of the rank property on other nodes, which may most path of Tx and the leftmost path of Ty, both
require further promotions or demotions or may even bottom up, in the increasing order of ranks of the
require rebalancing to globally preserve the rank prop- spine nodes. As we proceed we store the pointers
erties. We show that the total complexity of promotion, to the nodes encountered and also tags indicating
demotion and rebalancing operations due to a single whether they are from Tx or Ty in an array A or-
promote or demote operation is 0(1). The structure of dered by node ranks. We also keep track of the
our case analysis follows closely that Tarjan [41] used nodes of equal ranks last encountered in the two
for red-black trees. We again omit the details here, and paths and we terminate the traversal when reach-
in the full version prove the following: ing the root x. Suppose t is the smallest rank node
along the leftmost path of Ty having rank greater
Lemma 2.1 The total complexity of promotion, demo- than x. Suppose a and b are the last encountered
tion and rebalancing operations on a biased finger tree equal rank nodes during the traversal, and note
2
This credit notion is only used for analysis purposes. No that the node x was stored as the last node in ar-
actual credits are stored anywhere. ray A. We attach x along with its left subtree to

152
Figure 1: Join of trees Tx and Ty.

t as the left child of t. For the other nodes in A, the trees whose roots become siblings in this process
we proceed as follows (see Fig. 1): Consider the (so as to maintain our minor-node bias property). We
next node, c, in the array A. Suppose c is part of show that this can be done in Ö{\ log Wi/wi- |) time.
Tx. If the successor of c in A is a node d from Tx, Deletion: Consider the deletion of an item i with
we attach c and its left subtree as a right child of weight Wi from the biased finger tree T for which a
d. If the successor of c in A is a node d from Ty, pointer to the item i is provided. This operation is simi-
we attach c and its left subtree as a left child of d. lar to that of insertion and we have different cases based
Suppose c is part of Ty. If the successor of c in A is on whether the node deleted is minor/major. We use
a node d from T^, we attach c and its right subtree different operations to preserve bias property in each
as a right child of d. If the successor of c in .4 is a case. We give details in the full version where we show
node d from Ty, we attach c and its right subtree the complexity of deletion to be Ö(logu;;).
as a left child of d. We continue this process until We summarize:
the nodes a and b are encountered. Then, we cre-
ate a new node z with Ta and Tb as left and right Theorem 2.2 One can maintain a collection of biased
subtrees respectively. We assign a rank of r(a) + 1 search trees subject to tree searches, element insertion
to z and rebalance if required through a promote and deletion, change of weight of element, slicing and
operation. This terminates the join. If there are fusing of elements, as well as tree joining and splitting,
no equal rank spine nodes a and b, then we join all in the bounds quoted in Table 1 for biased finger trees,
the nodes in the array A in the above manner. not counting the search times.

Case 3. r(y) < r{x). Symmetrical to above case. Bent et al. [5] show that repeated single-node joins
on the right hand side can construct a biased finger tree
Analysis: We show in the full version that the to- in 0(n) worst-case time. In our case, however, we can
tal number of credits needed to perform this update is show the following:
0(1). This, and Lemma 2.1, establishes that the run-
Theorem 2.3 Any sequence of joins that constructs a
ning time for a join is 0(1).
biased finger tree ofn items can be implemented in 0(n)
worst-case time.
Split: We perform the split operation as in [5]. We
show that with the same complexity we can preserve Proof: The proof follows immediately from the fact
all three types of credits in the nodes of the resulting that our join algorithm on biased finger trees takes 0(1)
trees. time. I
Insertion: Consider the insertion of an item i with Let us now turn our attention to some non-trivial
weight Wi to a biased finger tree T. Recall that i~ applications.
denotes the immediate predecessor of item i in T if it
exists, and immediate successor of i in T otherwise. We
provide a pointer to i~. In the full version we describe
3 The Layers-of-Maxima Prob-
how to perform a bottom-up insertion from i~. The lem
most interesting case occurs when the new item has
weight much larger than i~, for we must then splay i In this section, we use the biased finger tree data struc-
up the tree to its proper position while joining together ture to solve an open (static) computational geometry

153
regions of the points in that layer. We denote this by
V(l), for a layer /. We show that to correctly compute
the layers, it is sufficient to maintain for each layer /, the
boundary of the intersection of the sweep plane, say n,
with T>(1). The intersection region is two dimensional,
and we call its boundary a staircase.
The shape of the staircase representing a layer
changes, as we continue the sweep. During the sweep,
we maintain only a subset of points that belong to each
layer. This is because, if points, say p and q, belong to
a layer I, and if the projection of dominance region of
p onto 7T dominates that of q, then point q will not be
part of the boundary of intersection. This simplifies the
identification of layer for a new point. Let S' C S be the
current set of points maintained by the algorithm. We
Figure 2: Computation of Layer for a New Point p. show that S' has the property that the the staircases
corresponding to the layers of points in S', subdivide
the xy-plane into disjoint regions (as defined earlier).
We call this a staircase subdivision. We show that this
problem: the 3-dimensional layers-of-maxima problem. property is preserved at each step of the sweep, when
Before we describe our method, however, we introduce we compute the layer for a new point. Hence, at any in-
some definitions. A point p £ 5ft3 dominates a point stant the current set of maxima layers form a staircase
q £ 5ft3, if x{q) < x{p), y{q) < y{p): and z(q) < z(p). subdivision, and we reduce the computation of layer
Given a set S of points in 5ft3, a point p is a maximum for a new point to operations on the staircase subdivi-
point in S, if it is not dominated by any other point in sion. We call the region in the subdivision between two
S. We define the dominance region of a point p in 5ft3 as staircases, a face. Hence, if there are m layers, they
a set D C 5ft3 such that p dominates every point q € D. subdivide the xy-plane into m 4- 1 faces. The projec-
The maxima set problem is to find all the maximum tion of each new point onto the xy-p\a,ue belongs to a
points in S. Kung, Luccio, and Preparata [27] showed unique face among these m + 1 faces. We work with
that this problem can be solved in 0(n log n) time. In the staircase subdivision, and the projection of a new
the related layers-of-maxima problem, one imagines an point, to identify the point's layer.
iterative process, where one finds a maxima set M,in The algorithm for computing the layer number of a
5, removes all the points of M from S, and repeats this new point p is, then, as follows:
process until S is empty. The iteration number in which
a point p is removed from S is called p's layer, and we 1. Identify the two staircases in the staircase subdi-
denote it by l(p), and the layers-of-maxima problem vision between which the new point p lies. Assign
is to determine the layer of each point p in S. This p to higher-numbered layer of these two. For ex-
is related to the well-known convex layers problem [7], ample, in Figure 2, p lies between the layers 1 and
and it appears that it can be solved for a 3-dimensional 2, and gets assigned to layer 2. If p lies below the
point set S in 0(n log n log log n) time [1] using the dy- highest-numbered layer, say m, then assign p to a
new layer m + 1.
namic fractional cascading technique of Mehlhorn and
Näher [32]. We show how to solve the 3-dimensional 2. Compute the horizontal segment h, and the verti-
layers-of-maxima problem in 0{nlogn) time, which is cal segment v from p, which hit the boundary or
optimal 3. some layer (of course the layer hit by h is the same
We solve this problem using a three-dimensional layer that is hit by v, and has same number as p's
sweep, and a dynamic method for point location in a just computed layer).
staircase subdivision. Given a set S of n points in 5ft3,
we first sort the points along the z axis, and then sweep 3. Insert the segment h and the segment v into the
the points in the decreasing order of their z coordinates subdivision.
to construct the maxima layers. When we sweep across
4. Delete the segments in the layer l(p), which are
a point, we compute its layer using the information
dominated by p in the xy-pla,ne. For example, in
about the layers computed so far. The information we
Figure 2, we delete segments in portion A of layer
maintain for each layer is the union of the dominance
2.
3
A simple linear time reduction can be shown from sorting
problem to three-dimensional layers-of-maxima problem, thereby Correctness and Analysis: We now show that each
showing a lower bound of fi(r ; n) for three-dimensional layers new point p is identified with its correct layer. We use
of maxima problem. Figure 2 to illustrate the idea. Consider layer 2. The

154
staircase of layer 2 is the boundary of the intersection of answering such queries in O(logn) time [13, 16, 23, 39].
the union of the dominance regions of the points in the These optimal data structures are static, however,
layer 2 with the sweep plane n. Since the points are pro- in that they do not allow for any changes to <S to oc-
cessed in decreasing order of their z coordinates, when cur after the data structure is constructed. There has,
we insert p, the dominance region of point p does not therefore, been an increasing interest more recently into
dominate any of the points in layer 2. Also the points methods for performing point location in a dynamic
in layer 2 do not dominate p along x and y coordinates. setting, where one is allowed to make changes to S,
So, point p belongs to layer 2 (i.e., l(p) = 2), as identi- such as adding or deleting edges and vertices. It is
fied by the algorithm. Now to update the boundary of easy to see that, by a simple reduction from the sort-
intersection with IT, we delete the portion A from layer ing problem, a sequence of n queries and updates to
2, and include the segments h and v into the subdivi- S requires fi(nlogn) time in the comparison model,
sion. To see why only the boundary is maintained, we yet there is no existing fully dynamic framework that
observe that if point q is introduced later, the algorithm achieves O(logn) time for both queries and updates
will identify q with layer l(p). But q does not belong to (even in an amortized sense). The currently best meth-
layer l(p) , since q is dominated by p. So, it should ei- ods are summarized in Table 2. The results in that ta-
ther initiate a new layer, or belong to an existing layer ble are distinguished by the assumptions they make on
(see Figure 2). In any case, l(q) = l(p) + 1. Also, we the structure of «S. For example, a convex subdivision is
observe that after deleting points in portion A, the new one in which each face is convex (except for the external
boundary for layer 2 is in the form of a staircase, thus face), a staircase subdivision is one in which each face
preserving the property. is a region bounded between two infinite staircases, a
Suppose location, insertion and deletion of a rectilinear subdivision is one in which each edge is par-
vertex/edge in a staircase subdivision take time allel to the x- or y-axis, a monotone subdivision is one
Q(n),I(n), and D(n) time respectively. We implement in which each face is monotone with respect to (say)
step 1 as a point location in staircase subdivision, and the x-axis, a connected subdivision is one which forms
it takes 0(Q{n)) time. We represent the staircase cor- a connected graph, and a general subdivision is one that
responding to each layer by a dictionary, for ordering may contain "holes." The interested reader is referred
along x and y axes (since both are same ordering). Us- to the excellent survey by Chiang and Tamassia [9] for
ing these data structures, we compute in O(logn) time a discussion of these and other results in dynamic com-
the horizontal segment h, and the vertical segment v putational geometry.
for a new point p. Hence, step 2 takes O(logn) time.
Therefore, the total time for computing the layer of
each point is 0(logn + Q(n) + I(n) + k* D(n)), where
4.1 Our Data Structure
k is the number of points deleted in step 4. Since each Suppose we are given a convex subdivision S that we
point is deleted at most once, and is not inserted back, would like to maintain dynamically subject to point lo-
we amortize the cost of k deletions on each of the k cation queries and edge and vertex insertions and dele-
points. Hence, the complexity of computing layer of tions. As mentioned above, our method for maintain-
each new point is Ö(logn + Q(n) + I(n) + D(n)). In ing S is based upon a dynamic implementation of the
the next section, we show a method which achieves "trapezoid method" of Preparata [35] for static point
Q(n) = I(n) = D(n) = Ö(logn), resulting in a location. Incidentally, this is also the approach used by
Ö(logn) algorithm for computing the layer of a single Chiang and Tamassia [8], albeit in a different way. Let
point. This gives us an O(nlogn) algorithm for com- us assume, for the time being, that the ^-coordinates
puting the three dimensional layers-of-maxima, and is of the segment endpoints are integers in the range [1, n]
optimal. (we will show later how to get around this restriction us-
ing the the BB[a] tree). We define our structure recur-
sively, following the general approach of Preparata [35].
4 Dynamic Point Location Our structure is a rooted tree, T, each of whose nodes
is associated with a trapezoid r whose parallel bound-
In this section, we address the general problem of dy- ary edges are vertical. We imagine the trapezoid r as
namic point location in a convex subdivision. So, being a "window" on S, with the remaining task being
suppose we are given a connected subdivision S of that of locating a query point in S restricted to this
the plane such that S partitions the plane into two- trapezoidal window. With the root of T we associate a
dimensional cells bounded by straight line segments. bounding rectangle for S.
The point location problem is to construct a data
4
structure that allows one to determine for any query Cheng and Janardan's update method is actually a de-
amortization of an amortized scheme via the "rebuild-while-you-
point p the name of the cell in S that contains p (see work" technique of Overmars [34].
[13, 15, 16, 23, 28, 29, 35, 36, 39]). It is well-known 5
Our method can actually used for any dynamic point location
that one can construct a linear-space data structure for environment satisfying a certain pseudo-edge property.

155
Type Queries Insert Delete Reference

general O(lognloglogn) Ö (log n log log n) Ö(log2n) Baumgarten et al. [4]


connected 0(log2n) O(logn) O(logra) Cheng-Janardan [ll]4
connected O(logn) 0(log3n) Ö(log3n) Chiang et al. [10]
monotone O(logn) 0(log2n) Ö(log2n) Chiang-Tamassia [8]
monotone 0(log2 n) O(logn) O(logn) Goodrich-Tamassia [18]
rectilinear 0 (log n log log n) O(lognloglogn) 0 (log n log log n) Mehlhorn-Näher [32]
convex 0(\ogn + \ogN) O(lognlogiV) O(lognlogTV) Preparata-Tamassia [38]
convex5 O(logn) Ö(logn) Ö(log2n) this paper
staircase O(logn) O(logn) O(logn) this paper

Table 2: Previous and New results in dynamic point location. N denotes the number of possible y-coordinates for
edge endpoints in the subdivision.

Let v therefore be a node in T with trapezoid r asso- this issue we define the weight of a node v e T to be the
ciated with it. If no vertex or edge of S intersects the number of leaf descendents oiv in T, and we use w(v) to
interior of r, then we say that r is empty, in which case denote this quantity. Given this weight function, then,
v is a leaf of T. Note that in this case any point deter- we store the children of each node v in T as leaves in a
mined to be inside r is immediately located in the cell biased finger tree Tv and doubly link all the leaves of Tv.
of S containing r. Let us therefore inductively assume Of course, such a biased finger tree is a trivial tree for
that r contains at least one endpoint of a segment in each node v corresponding to a vertical cut, but this is
S. There are two cases: not a problem, for it gives us a way to efficiently search
1. There is no face of S that intersects r's left and the children of a node whose corresponding action is a
collection of horizontal cuts.
right boundaries while not intersecting r's top or
bottom boundary. In this case we divide r in two
The structure of T satisfies an invariant that if a face
by a vertical line down the "middle" (we choose a / spans a trapezoid, then either it has a spanning edge
vertical line which balances the height of the tree e of the subdivision on its top or bottom boundary or
on both sides) of r, an action we refer to as a ver- it is split into two by a pseudo-cut. In either case, the
tical cut. This creates two new trapezoids TI and face / has a bounding spanning edge if it spans r. We
TT, which are ordered by the "right of" relation.
say that a face / or an edge e of the subdivision covers
We create two new nodes vi and vT, which are a trapezoid r if it spans r horizontally and it does not
respectively the left and right child of v, with vi span any ancestor of r in T. The structure of T has the
associated with n and vT associated with rr.
property that any face or edge covers at most O(logn)
2. There is at least one face of S that intersects both trapezoids and also each face or edge covers at most
the left and right boundaries of r and does not two nodes at any level of T. These properties follow
have a spanning edge of r as its top or bottom easily from segment tree like arguments [31].
boundary. In this case we "cut" T through each
of the faces of S that intersect r's left and right We now describe the point-location query algo-
boundaries. This creates a collection of trapezoids rithm for our data structure. Consider the operation
Ti,r2,...,Tfc ordered by the "above" relation. We query(T,x,y), where x and y represent the coordinates
refer to this action as a collection of horizontal of the query point and r is a current trapezoid in the
pseudo-cuts (even though it would be more accu- subdivision (which represents a node in our primary
rate to call them "non-vertical pseudo-cuts"). We data structure). We alternately make comparisons with
associate a node vl in T with each r; and make nodes in the primary and secondary data structures.
this set of nodes be the children of v in T, ordered In the primary data structure (triangular nodes rep-
from left-to-right by the "above" relation on their resenting trapezoids), we compare the x value of the
respective associated trapezoids. point against the x value of the vertical cut at r. This
identifies the left or right secondary data structure of r
Repeating the above trapezoidal cutting operations containing the query point. We then use the secondary
recursively at each child of v creates our tree T (see data structure to identify a trapezoid containing the
Figure 3). The tree T, of course, cannot yet be used to query point among the several trapezoids separated by
perform an efficient point location query, since a node horizontal cuts. In the secondary data structure i.e.,
v in T may have many children if its associated action in the biased finger tree stored in the trapezoid r, we
forms a collection of horizontal cuts. To help deal with compare the (x,y) value of the point against the sup-

156
ffij 1 1 /I 1 1
a
1
h
11 ._
^>^£^

Figure 3: Trapezoidal Decomposition of a Convex Subdivision with Pseudo-Edge Cuts. The triangular nodes
denote vertical cuts and the circular nodes denote horizontal cuts.

porting line of the spanning edge or pseudo-cut 6. This a deletion is essentially the reverse of the above opera-
identifies a leaf node, say q, in the biased finger tree tions. This operation runs in Ö(log2 n) time, however,
that represents a trapezoid, say r9, in the primary data since we now may have to perform O(logn) split op-
structure. We now recursively locate the point by call- erations (and their complexity, unfortunately, does not
ing query(rq, x, y). form a telescoping sum).
The arguments in the previous section on the struc-
ture of our data structure imply that, starting from the 4.2 Rebalancing the Primary Structure
root of T, we can perform the point location query in
0(logu;(r) + depth(r)) time in the worst case, where In this section we show how to relax the constraint that
r denotes the root of T. This is because the times to the endpoints have x coordinates in the range [1, n]. We
perform the biased merge tree queries down a path in use a BB[a]-tree as a primary tree for vertical cuts with
T form a telescoping sum that is O(logw(r)). Noting biased finger tree as a secondary structure in each node.
that w(r) is 0(n log n) [35] and depth(r) is O(logn) We briefly review the properties of BB[a]-tree. Let f(l)
(since our primary data structure is kept balanced) denote the time to update the secondary structures af-
gives us the desired result that a point location query ter a rotation at a node whose subtree has I leaves.
takes O(logn) time. Also, assume that we perform a sequence of n update
Our method for updating this structure is rather in- operations, each an insertion or a deletion, into an ini-
volved; hence, for space reasons, we can only sketch tially empty 1? 23 [a]-tree. Now, we have the following
the main ideas in this extended abstract. In the case times for rebalancing [30]:
of an insertion of an edge e into a face / our method
traverses down the tree for the endpoints of e. At each • If f(l) = 0(1 logc I), with c > 0, then the rebalanc-
node that / covers and such that e cuts so that the new ing time for an update operation is 0(logc+1 n).
faces no longer cover we must perform 0(1) join oper- • If f(l) = 0(la), with a < 1, then the rebalancing
ations. Since there are O(logn) such nodes, the total time for an update operation is 0(1).
time for these updates, then, is Ö(logn). In addition,
there are also O(logn) places in the tree where we must In our case, we show f(n) = 0(n) and so the rebal-
insert this new edge, each of which can be implemented ancing cost is O(logn). We give the details in the full
in 0(1) time, given a pointer to the location for this in- version.
sertion (which we obtain from the_A list for /). Thus, Thus we show,
the total time for an insertion is O(logn). The case of
Theorem 4.1 Given a convex subdivision S of n ver-
6
When we use the query algorithm to locate edges, if the edge tices, there exists a data structure which allows point
spans the trapezoid T then we compare the y-value of the point
location queries in O(logn) time, vertex/edge insertion
of intersection of the edge with the left boundary of T against the
y-values of the points of intersections of the horizontal cuts with in O(logn) time, and vertex/edge deletion in Ö(log n)
the left boundary of r. time.

157
r
r

a. A Spanning Face Without any Pseudo-cut b. A Spanning Face With a Pseudo-cut

Figure 4: Pseudo-Cut for a staircase spanning face.

4.3 Dynamic Point Location in Stair- Theorem 4.2 Given a staircase subdivision S of n
case Subdivisions vertices, there exists a data structure which allows point
location queries in O(logn) time, edge (vertex) inser-
In this section, we construct an O(logn) depth trape- tion in Ö(logn) time, and edge (vertex) deletion in
zoidal structure for staircase subsubdivisions similar to Ö(logn) time (the deletions are always coupled with in-
the one for convex subdivision, which allows us to per- sertions, however).
form query in O(logn) time, and updates in Ö(logn)
time. We always require that deletion of an edges (ver- The edge insertion and deletions performed on stair-
tices) should always be accompanied by an insertion of case subdivision in our three-dimensional layers of max-
an edge (vertices). ima algorithm satisfy the constraints specified in The-
The trapezoidal structure for staircase subdivision orem 4.2. Therefore we have,
satisfies a slightly different invariant from that of con-
vex subdivision. Here we use an invariant that if a face Theorem 4.3 Given a set S of n points in 5R3, one
/ spans a trapezoid T and / can be split into two faces can construct the layers of maxima for S in 0(n logn)
by a (truly) horizontal spanning segment, say e, of r, time, which is optimal.
then we split r into two trapezoids using e. So, unlike
convex subdivision, not every spanning face of r will
have a pseudo-cut (see Figures 4.a and 4.b) here. Us-
Acknowledgement
ing this invariant, we can easily do an analysis similar We would like to thank Rao Kosaraju for several helpful
to that of convex subdivision to show that the insert op- conversations concerning the topics of this paper.
eration in a staircase subdivision takes takes Ö(logn)
time. The details are omitted.
Using this invariant, we can easily do an analysis References
similar to that of convex subdivision to show that the
insert operation in a staircase subdivision takes takes [1] P. Agarwal, private communication, 1992.
Ö(logn) time. The details are omitted. We observe [2] A. Aggarwal and J. Park, "Notes on searching in
that, each edge deleted is always bounded on the top multidimensional monotone arrays," in Proc. 29th
and on the right by "long" edges. This implies that we IEEE Symposium on Foundations of Computer Sci-
already have a horizontal spanning pseudo edge for the ence, 1988, 497-512.
face resulting after deletion, and hence deletion of an [3] A.V. Aho, J.E. Hopcroft, and J.D. Ullman, Data
edge does not require an introduction of a new pseudo- Structures and Algorithms, Addison-Wesley (Read-
cut into the subdivision. This eliminates the costlier ing, Mass.: 1983).
case of deletion which takes Ö(log n), and all the other [4] H. Baumgarten, H. Jung, and K. Mehlhorn, "Dy-
cases take Ö(logn) time. We give details in full ver- namic Point Location in General Subdivisions," Proc.
sion. Thus, this observation results in a Ö(logn) time 3rd ACM-SIAM Symp. on Discrete Algorithms, 1992,
method for deletion of an edge in the staircase subdi- 250-258.
vision. [5] S.W. Bent, D.D. Sleator, and R.E. Tarjan, "Bi-
Thus we show, ased search trees," SI AM Journal of Computing,
14(3):545-568, August 1985.

158
[6] N. Blum and K. Mehlhorn, "On the Average Num- [23] D. Kirkpatrick, "Optimal Search in Planar Subdivi-
ber of Rebalancing Operations in Weight-Balanced sion," SIAM Journal on Computing, Vol. 12, No. 1,
Trees," Theoretical Computer Science, 11, 1980, 303- February 1983, pp. 28-35.
320. [24] D.E. Knuth, Sorting and Searching, Addison-Wesley,
[7] B. Chazelle, "On the convex layers of a planar set," Reading, Mass., 1973.
IEEE Trans. Inform. Theory, IT-31 1985, 509-517. [25] S.R. Kosaraju, "Localized Search in Sorted Lists," in
[8] Y.-J. Chiang and R. Tamassia, "Dynamization of the Proc. 13th Annual ACM Symp. on Theory of Com-
Trapezoid Method for Planar Point Location," Proc. puting, 1981, pp. 62-69.
ACM Symp. on Computational Geometry, 1991, 61- [26] S.R. Kosaraju, "An Optimal RAM Implementation
70. of Catenable Min Double-ended Queues," Proc. 5th
ACM-SIAM Symp. on Discrete Algorithms, 1994,
[9] Y.-J. Chiang and R. Tamassia, "Dynamic Algorithms
in Computational Geometry," Proc. of the IEEE, 195-203.
80(9), 1992. [27] H.T. Kung, F. Luccio, F.P. Preparata, "On Finding
the Maxima of a Set of Vectors," J. ACM, Vol. 22,
[10] Y.-J. Chiang, F.P. Preparata, and R. Tamassia "A
No. 4, 1975, pp. 469-476.
Unified Approach to Dynamic Point Location, Ray
Shooting, and Shortest Paths in Planar Maps," Proc. [28] D.T. Lee and F.P. Preparata, "Location of a Point
4th ACM-SIAM Symp. on Discrete Algorithms, 1993, in a Planar Subdivision and its Applications," SIAM
44-53. J. Computing, Vol. 6, No. 3, 594-606, 1977.
[11] S.W. Cheng and R. Janardan, "New Results on Dy- [29] D.T. Lee and F.P. Preparata, "Computational
namic Planar Point Location," 31st IEEE Symp. on Geometry—A Survey," IEEE Trans, on Computers,
Foundations of Computer Science, 96-105, 1990. C-33(12), 1984, 872-1101.
[12] R.F. Cohen and R. Tamassia, "Dynamic Expression [30] K. Mehlhorn, Data Structures and Algorithms 1:
Trees and their Applications," Proc. 2nd ACM-SIAM Sorting and Searching, Springer-Verlag, 1984.
Symp. on Discrete Algorithms, 1991, 52-61. [31] K. Mehlhorn, Data Structures and Algorithms 3:
[13] R. Cole, "Searching and Storing Similar Lists," J. of Multi-dimensional Searching and Computational Ge-
Algorithms, Vol. 7, 202-220 (1986). ometry, Springer-Verlag, 1984.

[14] T.H. Cormen, C.E. Leiserson, and R.L. Rivest, Intro- [32] K. Mehlhorn and S. Näher, "Dynamic Fractional Cas-
duction to Algorithms, MIT Press (Cambridge, Mass.: cading," Algorithmica, 5, 1990, 215-241.
1990). [33] I. Nievergelt and E.M. Reingold, "Binary Search
[15] H. Edelsbrunner, Algorithms in Combinatorial Geom- Trees of Bounded Balance," SIAM J. Comput., 2,
etry, Springer-Verlag, NY, 1987. 1973, 33-43.
[34] M. Overmars, The Design of Dynamic Data Struc-
[16] H. Edelsbrunner, L.J. Guibas, and J. Stolfi, "Optimal
tures, Lecture Notes in Computer Science, Springer-
Point Location in a Monotone Subdivision," SIAM J.
Computing, Vol. 15, No. 2, 317-340, 1986. Verlag, 1983.
[35] F.P. Preparata, "A New Approach to Planar Point
[17] D. Eppstein, G.F. Italiano, R. Tamassia, R.E. Tarjan,
Location," SIAM J. Computing, Vol. 10, No. 3, 1981,
J. Westbrook, and M. Yung, "Maintenance of a Min-
imum Spanning Forest in a Dynamic Planar Graph," 73-83.
J. Algorithms, 13, 1992, 33-54. [36] F.P. Preparata and M.I. Shamos, Computational Ge-
ometry: An Introduction, Springer-Verlag, NY, 1985.
[18] M.T. Goodrich and R. Tamassia, "Dynamic Trees and
Dynamic Point Location," Proc. 23rd ACM Symp. on [37] F.P. Preparata and R. Tamassia, "Fully Dynamic
Theory of Computing, 1991, 523-533. Point Location in a Monotone Subdivision," SIAM
J. Computing, Vol. 18, No. 4, 811-830, 1989.
[19] M.T. Goodrich and R. Tamassia, "Dynamic Ray
Shooting and Shortest Paths via Balanced Geodesic [38] Preparata, F.P. and R. Tamassia, "Dynamic Planar
Triangulations," Proc. 9th ACM Symp. on Computa- Point Location with Optimal Query Time," Theoret-
tional Geometry, 1993, 318-327. ical Computer Science, Vol. 74, No. 1, 95-114, 1990.
[20] L.J. Guibas, E.M. McCreight, M.F. Plass, and [39] N. Sarnak and R.E. Tarjan, "Planar Point Loca-
J.R. Roberts, "A New Representation for Linear tion Using Persistent Search Trees," Communications
Lists," Proc. 9th ACM Symp. on Theory of Comput- ACM, Vol. 29, No. 7, 669-679, 1986.
ing, 1977, 49-60. [40] D.D. Sleator and R.E. Tarjan, "A Data Structure for
[21] L.J. Guibas and R. Sedgewick, "A Dichromatic Dynamic Trees," J. Comput. and Sys. Sei., 26, 362-
Framework for Balanced Trees," Proc. 19th IEEE 391, 1983.
Symp. on Foundations of Computer Science, 1978, 8- [41] R.E. Tarjan, Data Structures and Network Algo-
21. rithms, SIAM, Philadelphia, PA, 1983.
[22] S. Huddleston and K. Mehlhorn, "A New Data Struc- [42] R.E. Tarjan, "Amortized computational complexity,"
ture for Representing Sorted Lists," Ada Informatica, SIAM J. Alg. Disc. Meth., 6(2):306-318, April 1985.
17, 1982, 157-184.

159
An Algorithm for Approximate Closest-point Queries

Kenneth L. Clarkson
AT&T Bell Laboratories
Murray Hill, New Jersey 07974
e-mail: clarksonQresearch.att.com

Abstract of the most interesting potential applications have d


at least 10, and often much greater. Thus the promise
This paper gives an algorithm for approximately solv- of a query time of 0(log n) is crushed by the "curse
ing the post office problem: given n points (called of dimensionality."
sites) in d dimensions, build a data structure so that, This paper gives a modest but significant improve-
given a query point q, a closest site to q can be found ment in the dimension dependence of one recent algo-
quickly. The algorithm is also given a relative error rithm, that of Arya and Mount.[AM93] They attack
bound e, and depends on a ratio p, which is no more the problem of approximate solution to the post-office
than the ratio of the distance between the farthest problem; their procedure returns an c-closest site, one
pair of sites to the distance between the closest pair whose distance to the query point q is within 1 + e of
of sites. The algorithm builds a data structure of closest. Here e > 0 is input when their data structure
size 0(n7?)0(l/e)(<i-1)/2 in time 0(n2J7)0(l/f)(d_1). is built. The algorithm given here takes their ap-
Here 77 = log(p/e). With this data structure, a site is proach to what is arguably its logical conclusion, re-
returned whose distance to a query point q is within duces the query time from Ö(log3 n) to <9(log n),1 and
1 + e of the distance of the closest site. A query needs reduces the "constant" factors for the dimension from
0(logn)0(l/e)(rf-1)/2 time, with high probability. 0{\/e)d to about 0(l/e)(d-1)/2. (The latter reduc-
tion applies to the storage and query-time bounds.)
The new algorithm has an additional factor in storage
1 Introduction and preprocessing time of log p, where p is bounded
above by the ratio of the distance between the sites
The post-office problem is the following: given a set
farthest apart to the distance of the sites closest to-
5 of n points (called sites) in d dimensions, build
gether. (In fact p is roughly the maximum, over all
a data structure so that given a query point q, the
sites s, of the ratio of the distance to s to its farthest
closest site to q can be found quickly. Many data
Delaunay neighbor, to the distance of s to its closest
structures have been proposed for this problem; their
Delaunay neighbor. Hence \ogp is negligible relative
query times generally are faster than the trivial O(n),
to other factors.)
and often are O(logn), as n —► 00. The dependence
Arya et al. have more recently described a dif-
of the query time on the dimension d is generally
ferent approximation algorithm, based on quadtree
very steep for the nontrivial algorithms, at least 2n(-d\
techniques, that has better storage and preprocess-
Even heuristic algorithms that are fast in practice,
ing bounds than those given here, but with a query
such as bucketing and kd-trees, also have this expo-
time that has a Cl(l/e)d dependence.[AMN+ 94]
nential dependence. This is unfortunate, since many
The new algorithm uses a technique previously
used for polytope approximation [Cla93] in order to
Permission to copy without fee all or part of this material is approximate a certain Voronoi region for each site by
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the a simpler Voronoi region for the site. The approxi-
title of the publication and its date appear, and notice is given mation problem is solved using randomization. The
that copying is by permission of the Association of Computing algorithm also builds a data structure similar to a
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. skip list, and uses randomization for that.[Pug90]

10th Computational Geometry 94-6/94 Stony Brook,,NT,UÖM


NY USA 'Here 0(g(n)) means 0(g(n)) with probability at least 1
© 1994 ACM 0-89791 -648^/94/0006..$350 * 1/n2.

160
The following section first describes the general ap- so that
proach, and then develops that approach in the fol-
lowing subsections. tft,(Lt) = {q | d(q,s) < (1 + e')d(q,b) for all beL,}.

The condition on Ls is equivalent to N(.>{LS) C


2 The algorithm Nt{S). The set Afe(S) is the Voronoi region of s in
a certain multiplicatively weighted Voronoi diagram.
Following Arya and Mount, the general idea is to find, The L, we want is a small one that such that Afe>(L,)
for each site s, a list of sites Ns with the following is inside Afe(S); the problem of finding such an Ls can
property: if s is not the closest site to the query point be solved by techniques previously applied to poly-
q, then there is a site in N, closer to q than s. With tope approximation. [Cla93]
this property, a simple search procedure will lead to The following subsection discusses the problem of
the closest site: pick any site s; if a site t G N, is finding Ls; §2.2 bounds the size of such a list; §2.3
closer to q, assign t to s and repeat; otherwise return shows how to use the lists to obtain fast query times.
s as closest. Finally, §3 makes some concluding remarks.
This approach is not so interesting just yet. The
list N, must be the set of Delaunay neighbors of s, as
the interested reader can easily show. This makes for 2.1 Finding Ls
a space requirement of fi(n2) in the worst case, for To find Ls, we'll translate the problem to d + 1 di-
d > 2. Also, the query time is fi(n) in the worst case: mensions using standard "lifting map" techniques.
there is no speedup over the obvious algorithm. (For If we put s at the origin, the region J*fe(S) is the
uniformly distributed points, the query time is more intersection of all regions of the form
like 0(nlld), so this approach is not entirely useless,
however.) {*|z2<(l + e)2(z-6)2},
For more interesting results, make the problem eas-
ier: instead of the closest site, find an e-closest site. where 6 G S. The condition here is z2/(l + e)2 < (z-
(Again, such a site has a distance to the query point 6)2, or az2 > 2b-z-b2, where a = l-l/(l + e)2 « 2c.
that is within 1 + e of the distance of the closest site's, Now let (z,y) denote a point in Rd+1, with z G Rd
for £ > 0.) This is the approximate query problem and y G R- We have
solved by Arya and Mount. They used a collection
of narrow cones to obtain their lists, in a way similar Afc(S) - {z | ay > 26 • z - b2 and y = z2}.
to Yao's use of them for finding minimum spanning
trees[Yao82]. Here the approach is to go from the de- So for b G S, let W£]j denote the halfspace
sired conditions on the lists to a problem similar to
nCtb = {(z,y) \ay>2b-z-b2},
polytope approximation.
The modified construction begins as follows. For
and Ve(S) denote the polytope which is the intersec-
each site s, consider a list Ls with the following prop-
tion of such halfspaces,
erty: for any q, if there is 6 G S with

d(q,s)>(l + c)d(q,b), vt(s)=n «<,»■


665
then there is 6' G Ls with
Then
d(q,s)>(l+e')d(q,b'),
K(S) = {z I (z, y) G Vt(S) and y = z2}.
where e' = e/2. (Note that if e = 0, then La = Na.)
Using such lists, the search procedure starts at any Let* = {(*,!/) \y>z2}. Then for M-(LS)C7V£(5),
site s. If there is t G Ls with d(q, s) > (1 + e')d(q, t), it is enough that
then assign f to s and repeat. Otherwise, return s.
With Ls as defined, the returned s is e-closest. Note ?V(L5)n*cPe(S)n*. (1)
that the procedure makes progress at each step: the
distance of the current site decreases by 1/(1 + e'). The problem of finding L, satisfying this con-
Consider the condition satisfied by L, in a contra- dition can be solved using techniques as for poly-
positive way. Fixing s G S, let Afe(S) be defined by tope approximation[Cla93], which are very simi-
lar to techniques described long ago for linear
Aft(S) = {q | d(q, a) < (1 + e)d(q, b) for all 6 G S], programming[Cla88]. The general idea is this: give

161
each site an integral weight, initially one. Take a ran- Lemma 2.2 Let P C Rd be compact and convex, and
dom subset R of S, choosing each site with probabil- contained in a ball of radius 1. For e with 0 < e < 1,
ity proportional to its weight, and making R about there is a convex polytope P' D P with 0(l/6)(d-1^2
the right size. Test if R satisfies (1); if so, return facets, and with P' within Haussdorf distance e of P.
it. Otherwise, we can derive from the testing of R
a subset of S that we can expect to be small, and We'll apply this lemma to bound the size of L,. To
that must contain a site of an appropriate Ls. Dou- do so, split \P into slabs
ble the weights of the sites in that subset. Repeat
this process until done. *,• = {(*,!/) \di<y<di+1},
Here are a few more details of the algorithm: fix
some optimal L satisfying (1), where the size c of C for i = 0... m, where V^ö = (1/2) minjes ||6||, and
is as small as possible. Assume for the moment that di = 3c/;_i/2, and m is large enough that i/^m >
c is known. (By using exponentially increasing esti- (2/a)maxi,es||6||. We have m = logO(p/a). The
mates of c, we lose only a small factor in the size of following lemma implies that only the points of these
the returned set, and in running time.) Give each slabs need be considered.
p G S a weight, initially equal to one. Choose a ran-
dom subset R C S of size cC\d\ogc, where C\ is a Lemma 2.3 Every halfspace WC]j contains all points
small constant, choosing a site with probability pro- ofty not in some ty,-.
portional to its weight. For each b G S, check that
Proof. We need to show that y > z2 and either
y > dm or y < d0 imply 'Ht}h for any 6 6 S. Since b ■ z
^(U)n*cH(|, (2)
is maximized for given ||z|| when z — 6||z||/||6||, when
This is a convex programming problem, and as shown showing that (z,y) G We,b we can assume z = jb
by Adler and Shamir, it is solvable in 0(n) ex- for some 7. If z2 > dm, the minimum value of y
pected time using a randomized procedure similar to to consider is z2, so it's enough to show that az2 >
one for linear programming.[AS90] (The base case, 26 • z - b2, or ay2b2 > 2yb2 - b2. This is implied
with 0(d2) constraints, can be solved in polynomial by 7 > (2/a). If z2 < dm, then similarly we need
time.[Vai89]) If all 6 G S satisfy (2), then return R as ay > Ab2la > 2yb2 - 62, which holds for 7 < 2/a.
When y < do, we have z2 < y < 62/4, and so we need
Ls. Suppose the condition fails for some 6 G S. Then
az2 > 27t2 - 62, where 7 < 1/2. Since az2 > 0, the
there will be some vertex v of VC>(R) D \f not in Tie j;
result follows. G
such a vertex can be returned as part of the output
of the convex programming algorithm. Find all the Consider a given slab \P;. We have
halfspaces H(>,b that do not contain v, for 6 G S. This 5
set V of halfspaces will have relatively few members, adi > -a'dj+i, (3)
with high probability, and will contain a member of
the optimal set C. If the size of set V is less than for sufficiently small e. Consider the sets
C2<in/r, then double the weights of the correspond-
ing sites. (Here C2 is another small constant.) Repeat Va = f]{(z,y)\a'di+1>2b-z-b2},
this procedure until a list L, is returned. i€S
An analysis of this procedure appears in [Cla93],
and
and will appear in the full paper.
Pb= f]{(z,y)\adi>2b-z-b2}.
b£S
2.2 The size of Ls Then (considering only points in ^j)
This algorithm returns a set Ls of size within
0(d\ogc) of the best possible size c, as can be shown vt>{S) crc?1 cv((s).
as in [Cla93]. How large can c be? We have the fol-
Moreover, condition (3) implies that there is a gap
lowing bound, which this subsection will prove.
between V and Vb that we'll use shortly. Now let
ball
Theorem 2.1 The optimal size c of Ls is
B' = {z\z2< di+1},
0(l/e)(d-Wd\og(p/e).
so that all points in $,■ have z projections in B', and
We'll need the following lemma, due to let
Dudley.[Dud74] B = {z\z2<(l + 2e)2di+1}.

162
Let V* = {z | (z,y) G Va}, and similarly define V\. procedure will in two steps find a site t' in Rj+i such
Then V$ C\ B1 CV*CiB, and by (3), every point of that d(q,t') < d(q,t)/(l + e')2. (Here we assume that
the former is at least the search in Rj+\ takes at least two steps.) Since
(1 + e')2 > (1 + e) f°r £ > 0, we know that t' is closer
a'dj+i/4 to q than t. The number of sites visited at stage
j + 1 for the exact procedure is proportional to the
number of sites of Rj+i closer to q than t; hence the
from any point not in the latter. If a plane 7it\b does number of sites visited for the approximate procedure
not contain Wi, and so is relevant here, then as in the in Rj+i is no more than 2 plus the number for the
proof of Lemma 2.3, we have di+i > b2/4. This says exact procedure.
that gap between V£nB' and V\C\B is proportional to
e^/di+i, and so by appropriate scaling we can apply To analyze the exact search procedure, we can
follow Sen's analysis of skip lists.[Sen] Look at the
Lemma 2.2 to find a polytope Vp such that
search procedure "backwards": starting at the clos-
est site to q in Rj, visit sites in Rj in order of in-
vav n B' C Vcp CVbpHB
creasing distance, until a site also in Rj+i is encoun-
and Vc has 0(l/e)(d_1)/2 facets. This implies that tered. Call this a level jump. Once the level jump
there is a polytope Vc in Rd+1 of the same complexity, occurs, only sites in Rj + i are visited. The proba-
bility of a level jump at a given visited node is 1/2.
such that relative to ^i,
Thus the probability that at least k level jumps occur
VC<(S)CVC CVC(S). in v node visits is the probability that a binomially
distributed random variable has at least k successes
It not hard to show that there is a "coarsening" poly- in v trials. The query time can be greater than V
tope ■P£'(Lj), with at most d times as many facets as only if either the number of level jumps exceeds K
Vc, such that Vtl{L\) n *i C Vt(S). or if fewer than K level jumps occur in V attempts;
By putting the lists L\ together into L,, we obtain the former probability is no more than nj1K, which
the size bound of the theorem of this subsection. we'll need less than some probability P\. This im-
plies K > lg(n/Pi). The probability of fewer than K
level jumps in V trials can be bounded using Cher-
2.3 Solving closest-point problems
noff bounds for the binomial; letting 7 = 2K/V,
How can a fast query time be obtained using the lists it is exp(-V(l - 7)2/2)- The probability that the
La? Just as with Arya and Mount's work, a skip- query time exceeds 2lg(n/Pi)/j for a given point q
list approach is helpful.[Pug90] Choose a family of is therefore at most Px + exp(-lg(n/Pi)(l - T)2/T)-
subsets of 5 as follows: let Ro = S; to obtain Rj+i Hence, setting Pi = l/nQ, an 0(<2)logn query time
from Rj, pick each element of Rj to be in Rj + i with is achievable with failure probability 0(l/nQ).
probability 1/2. Repeat this process until an empty
This analysis applies only to a single given point
Rk is obtained. If s G Rj but not Rj + i, say that s q; what about arbitrary points? As with similar situ-
has level j. Construct the lists L,j for each Rj, and
ations in randomized geometric algorithms, a good
so s G S has lists for each subset up to its level. To
query time holds for all points because there are
answer a query, start with some s G Rk-i, and find
nd°(1) combinatorially distinct classes of points. That
the e-closest site tk-i in Äjt-i using the lists L,tk-i-
is, in an exact search algorithm, two points 91 and
Now find an e-closest site tk-2 in Rk-2, starting with
q2 will have the same sequence of visited sites, and
tk-i- Repeat until t0 is found, and return t0 as an
so the same query time, if the distance order on the
f-closest site in S.
sites induced by the two points is the same. In other
The correctness of this procedure should be
words, whether we sort the sites in order of distance
clear. How much time does it take? Since each
from qi, or sort them in order of distance from 92,
list is bounded in size by 0(dc log c), where c is
we get the same sorted order. How many classes of
0(l/e)(d~lV2d\og(p/e), the query time is equal to
points are distinct in this way? Let B be the set
0(dc log c) times the number of sites visited in the
of Q) perpendicular bisector hyperplanes of pairs of
procedure.
sites, and let A{B) be the subdivision of Rd induced
It is worthwhile to compare this procedure with
by those bisectors. Then all points in one cell (block)
one that finds the closest site in Rj at stage j, not
of A(B) induce the same distance orders, and so have
just the e-closest. Suppose we have tj as the e-closest
the same query time. The number of cells of A(B)
at some stage, but indeed a site t is closest in Rj.
When finding the e-closest in Rj+i, the approximate is ((jp) < n2d. Thus a query time for any point of

163
O(logn) occurs with probability 1 - l/nn(-1\ [Dud74] R. M. Dudley. Metric entropy of some
Queries can be made a bit faster by splitting up classes of sets with differentiable bound-
the each list Lsj into lists Lsj, where the superscript aries. J. Approximation Theory, 10:227-
corresponds to the slabs \P; in §2.2. When searching 236, 1974.
for a given site s at a given stage j, the list L\ ■ with
i = 2\gd(s,q) can be used. This gives a query time [Pug90] W. Pugh. Skip lists: a probabilistic alter-
independent of p. native to balanced trees. Commun. ACM,
35:668-676, 1990.
[Sen] S. Sen. Some oberservations on skip lists.
3 Concluding Remarks
[Vai89] P. M. Vaidya. A new algorithm for
It should be possible to have an algorithm that is minimizing convex functions over convex
polynomial in d, by making e a sufficiently large con-
sets. In Proc. 30th Annu. IEEE Sym-
stant, as in Bern's note.[Ber93]
pos. Found. Comput. Sei., pages 338-343,
1989.
References [Yao82] A. C. Yao. On constructing minimum
spanning trees in fc-dimensional spaces
[AM93] S. Arya and D. M. Mount. Approximate and related problems. SI AM J. Comput.,
nearest neighbor queries in fixed dimen- 11:721-736, 1982.
sions. In Proc. 4th ACM-SIAM Sym-
pos. Discrete Algorithms, pages 271-280,
1993.

[AMN+94] S. Arya, D. M. Mount, N. S. Ne-


tanyahu, R. Silverman, and Angela Wu.
An optimal algorithm for approximate
nearest neighbor searching. In Proc.
5th ACM-SIAM Sympos. Discrete Algo-
rithms, 1994.

[AS90] I. Adler and R. Shamir. A randomiza-


tion scheme for speeding up algorithms
for linear and convex quadratic program-
ming problems with a high constraints-
to-variables ratio. Technical Report 21-
90, Rutgers Univ., May 1990. To appear
in Math. Programming.

[Ber93] M. Bern. Approximate closest-point


queries in high dimensions. Inform. Pro-
cess. Lett., 45:95-99, 1993.

[Cla88] K. L. Clarkson. A Las Vegas algorithm for


linear programming when the dimension
is small. In Proc. 29th IEEE Symp. on
Foundations of Computer Science, pages
452-456, 1988. Revised version: Las Ve-
gas algorithms for linear and integer pro-
gramming when the dimension is small
(preprint).

[Cla93] K. L. Clarkson. Algorithms for polytope


covering and approximation. In Proc. 3rd
Workshop Algorithms Data Struct., Lec-
ture Notes in Computer Science, 1993.

164
New techniques for exact and approximate dynamic closest-point
problems

Sanjiv Kapoor* Michiel Smid*

Abstract O(lognloglogn) (resp. O((logn)2/(k)glogn)fc)).


Previously, no deterministic linear size data struc-
Let S be a set of n points in MD. It is shown ture having polylogarithmic update time was
that a range tree can be used to find an Loo- known for this problem.
nearest neighbor in S of any query point, in
(^((logn)-0-1 loglogn) time. This data structure
has size 0(n(logn)r>_1) and an amortized update 1 Introduction
time of 0((logn)£)_1 loglogn). This result is used
to solve the (1 + e)-approximate £2-nearest neigh- Closest-point problems are among the basic prob-
bor problem within the same bounds. In this prob- lems in computational geometry. In such problems,
lem, for any query point p, a point q G S is com- a set 5 of n points in JRD is given and we have to
puted such that the euclidean distance between p store it in a data structure such that a point in
and q is at most (1 + e) times the euch dean distance 5 nearest to a query point can be computed effi-
between p and its true nearest neighbor. This is the ciently, or we have to compute a closest pair in S, or
first dynamic data structure for this problem hav- for each point in S another point in S that is closest
ing close to linear size and poly logarithmic query to it. Distances are measured in the Lt-metric, for
and update times. a fixed t, 1 < t < oo. These problems are known as
New dynamic data structures are given that the nearest-neighbor problem, the closest pair prob-
maintain a closest pair of S. For D > 3, a lem, and the all-nearest-neighbors-problem. In the
structure of size 0(n) is presented with amortized dynamic version, the set S is changed by insertions
update time 0{(logn)D-1 loglogn). For D = 2 and deletions of points.
and any non-negative integer constant k, struc- The planar version of the nearest-neighbor prob-
tures of size 0(nlogn/(loglogn)k) (resp. 0(n)) lem can be solved optimally, i.e., with O(logn)
are presented having an amortized update time of query time using 0(n) space, by means of Voronoi
diagrams. In higher dimensions, however, the sit-
'Department of Computer Science, Indian Institute of uation is much worse. The best results known are
Technology, Hauz Khas, New Delhi 110016, India. E-mail: due to Clarkson [3] and Arya et al.[l]. In [3], a
skapoorflcse.iitd.ernet. in
f
Max-Planck-Institut für Informatik, Im Stadtwald, D-
randomized data structure is given that finds a
66123 Saarbrücken, nearest-neighbor of a query point in O(logn) ex-
Germany. E-mail: michiel8mpi-sb.mpg.de. This author pected time. This structure has size 0(n^D/2^+s),
was supported by the ESPRIT Basic Research Actions Pro- where 6 is an arbitrarily small positive constant.
gram, under contract No. 7141 (project ALCOM II).
In [1], the problem is solved with an expected
query time of 0(n1-1/r(-D+1)/2l(logn)°(1)) using
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for 0(nloglogn) space. It seems that in higher di-
direct commercial advantage, the ACM copyright notice and the mensions it is impossible to obtain polylogarithmic
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing query time using 0(n(logn)°^) space. Moreover,
Machinery. To copy otherwise, or to republish, requires a fee even in the planar case there is no dynamic data
and/or specific permission.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

165
structure known that has poly logarithmic query In this paper, we give new deterministic data
and update times and that uses 0(n(logn)°(a)) structures for the dynamic closest pair problem.
space. These structures are based on our solution to the
Therefore, it is natural to ask whether the ap- ioo-neighbor problem, on data structures for main-
proximate nearest-neighbor problem, allows more ef- taining boxes of constant overlap, and on a new
ficient solutions. Let e > 0. A point q £ S is called transformation. Given any dynamic closest pair
a (1 + e)-approximate neighbor of a point p £ TRD, data structure having more than linear size, this
if dt(p,q) < (1 + e)dt(p,p*), where p* £ S is the transformation produces another dynamic closest
true nearest-neighbor of p. pair structure that uses less space. The complexity
This approximate neighbor problem was consid- bounds of the new structures are shown in the last
ered in Arya et al.[l, 2]. In the latter paper, the three lines of Table 1. The results of the last two
problem is solved optimally: They give a deter- lines are obtained by applying the transformation
ministic data structure of size 0{n) that can find repeatedly. Note that we obtain the first linear size
a (1 + e)-approximate neighbor in O(logn) time, deterministic data structure that maintains a clos-
for any positive constant e. At this moment, how- est pair in polylogarithmic time. As a by-product,
ever, no dynamic data structures are known for we prove:
this problem. In this paper, we prove the following
results. Theorem 3 Let S be a set of n points in IR/0.
There exists a dynamic data structure of size
Theorem 1 Let S be a set of n points in
0(n(logn) ~a) that maintains an Loo-neighbor of
IR . There exists a dynamic data struc-
each point in S. This data structure has an amor-
ture of size 0(n(logn)D~1) that, given a query
tized update time o/O((logn)-D_1 loglogn).
point p £ JR , finds an L ^-neighbor of p
in S in 0((logn)'D~'1 loglogn) time. This
All our algorithms use classical and well-
data structure has an amortized update time of
understood data structuring techniques, such as
0((logn)D"1 loglogn).
range trees, segment trees and dynamic fractional
Theorem 2 Let S be a set of n points in TR,D and cascading.
let e be a positive constant. There exists a dynamic The rest of this paper is organized as follows. In
data structure of size 0(n(logn)I,_1) that, given a Section 2, we show how range trees can be used
query point p £ MD, finds a (1 + e)-approximate L2- to solve the Zoo-neighbor problem. We also give
neighbor of p in S in (^((logn)-0-1 loglogn) time. the data structure for solving the approximate L2-
This data structure has an amortized update time nearest neighbor problem.
of 0((\ogn)D-1 loglogn). Our first data structure for maintaining the clos-
est pair stores a dynamically changing set of boxes
We also consider the dynamic closest pair prob- that are of constant overlap, i.e., there is a constant
lem, in which we have to maintain a closest pair c such that each box contains the centers of at most
under insertions and deletions. This problem has c boxes in its interior. We have to maintain such
been investigated only recently. In Table 1, we give boxes under insertions and deletions such that for
an overview of the currently best known data struc- any query point p £ MD, we can find all boxes that
tures for maintaining a closest pair under insertions contain p. In Section 3, we give two data structures
and/or deletions of points. For an up-to-date sur- for this problem. The first one is based on segment
vey, we refer the reader to Schwarz's Ph.D. The- trees. Therefore, its size is superlinear. We also
sis [9]. give a linear size solution having a slightly worse
Note that all data structures of Table 1 are deter- update time in the planar case. This solution is
ministic and can be implemented in the algebraic based on skewer trees. (See [4, 11].)
computation tree model. If we add randomization In Section 4, we use the results obtained to
to this model, then there is a data structure of size give a new data structure that maintains the clos-
0(n) that maintains a closest pair in 0((logn)2) est pair in a point set. This structure has size
expected time per update. (See Golin et al.[5].) 0(n(logn)-D_1) and an amortized update time of

166
mode dimension update time w/a space reference
insertions D > 2 logn w n [9, 10]
deletions D>2 (logn)" a n(logn)"-1 [13]
fully dynamic D>2 ■y/nlogn w n [8]
fully dynamic D>2 (log n)D log logn a n(logn)v [12]
fully dynamic D>3 (log n)L>-1 log logn a n this paper
fully dynamic 2 log n log log n a nlogn/(loglogn)fc this paper
fully dynamic 2 (logn)2/(log logn)* a n this paper

Table 1: Deterministic data structures for the dynamic closest pair problem. Distances are measured in
the Zrmetric, for a fixed 1 < t < oo. In the last two lines, k is an arbitrary non-negative integer constant.
The update times are either worst-case (w) or amortized (a).

O((logn)-D_1loglogn). It immediately gives the whose first coordinate is at least equal to p\. Dur-
dynamic data structure for the all-Zoo-nearest- ing this search, each time we move from a node v
neighbors problem. In Section 5, we give the trans- to its left son, add the right son of v to the set
formation that reduces the size of a dynamic clos- M. Let v be the leaf in which this search ends.
est pair structure. Applying this transformation If the point stored in this leaf has a first coordi-
repeatedly to the structure of Section 4 gives the nate that is at least equal to pi, then add v to
new results mentioned in Table 1. the set M. It is well known that the final set M
satisfies {r G S : rt > pi} = UveAf1^«- Here>
Sv denotes the set of points that are stored in the
2 The Loo-neighbor problem subtree of v. Range trees can be maintained under
insertions and deletions of points. The update algo-
Let 5 be a set of n points in JKD. We want to rithms use dynamic fractional cascading. (See [6].)
store this set into a data structure such that for A D-dimensional range tree for a set of n points
any query point p G JR,D, we can find a point in S has 0(n(logn)z5_1) size and can be maintained in
having minimal Zoo-distance to p. Such a point is 0((logn)r,_1loglogn) amortized time per inser-
called an L^-neighbor of p in 5. tion and deletion.
Let q be an Zoo-neighbor of p in the set {s G We use the following notations. For any point
S ■ si > Pi}- We call q a right-£<»-neighbor of
P = (PI,P2,---,PD) G MD, we denote by p' the
p in S. Similarly, a point r is called a left-Loo-
point (P2,---IPD) inffi,-0-1. If Sis a set of points in
neighbor of p in S, if it is an Zoo-neighbor of p in m.D, then 5' = {p' : p G S}. In Figure 1, our recur-
the set {s G 5 : si < pi}. In order to guarantee sive algorithm is given that finds an Zoo-neighbor
that both neighbors always exist, we add the 2D
of any query point p G IR .
artificial points (aly. .., ajj), where all a; are zero,
except for one which is either oo or — oo, to the set
S. Lemma 1 1. If the variable stop has value false
The data structure that solves the Zoo-neighbor after the while-loop of Stage 2 has been com-
problem is just a D-dimensional range tree storing pleted, then the set C contains a right-Loo-
the points of 5 and the artificial points. (See [7].) neighbor of p in S.
We recall an important property of range trees:
Let p be any point in JRD. Consider the set 2. If the variable stop has value true after the
{r £ S : ri > pi}, i.e., the set of all points in while-loop of Stage 2 has been completed, then
5 having a first coordinate that is at least equal to the set C U Sv contains a right-L^-neighbor of
p's first coordinate. Using the range tree, we can p in S.
decompose this set into O(logn) canonical subsets:
Initialize M := 0. Starting in the root of the main 3. During the while-loop of Stage 3, the set CuSv
tree, search for the leftmost leaf storing a point contains a right-L^-neighbor of p in S.

167
Algorithm Neighbor(p, S, D) (* returns an Zoo-neighbor of p in 5 *)
begin
1. Assume D — 1.
<7 := maximal element in the 1-dimensional range tree that is less than p;
qR := minimal element in the 1-dimensional range tree that is at least equal to p;
if \p - qR\ < \p - qL\ then return qR else return qL fi;
2. Assume D > 2.
2a. Compute a right-Zoo-neighbor:
Stage 1. Compute the set M of nodes of the main tree, see above.
Number these nodes vi,v2, ■. -,vm, m = \M\, where t;,- is closer to
the root than i^-i, 2 < i < m.
Stage 2. (* one of the sets SVi contains a right-i^-neighbor of p *)
C := 0; i := 1; stop := false;
while i < m and stop = false
do x' := Neighbor(p', S'V.,D - 1);
r := the point stored in the rightmost leaf of the subtree of vf,
if dooip^x') > |p! -^1
then C := C U {x}; i := i + 1
else v := Vi\ stop := true
fi
od;
if stop = false
then qR := a point of C having minimal Zoo-distance to p;
goto 2b
fi;
Stage 3. (* the set CuS„ contains a right-i^-neighbor of p *)
while v is not a leaf
do w := left son of v;
z':=Neighbor(p',S;,D-l);
r :— the point stored in the rightmost leaf of the subtree of w;
if dcoip^x') > \Pl -n\
then C := C U {a;}; v := right son of v
else v := w
fi
od;
q := a point of C U Sv having minimal Zoo-distance to p;
2b. Compute a left-Zco-neighbor:
In a completely symmetric way, compute a left-Zoo-neighbor qL of p;
2c. if d00(p,qR) < doo(p,?L) then return qR else return qL fi
end

Figure 1: Finding an Zoo-neighbor.

168
This lemma implies that point qR which is com- 3 The containment problem for
puted in part 2a is a right-Xoo-neighbor of p in 5. boxes of constant overlap
Similarly, point qL computed in part 2b is a left-
ioo-neighbor of p. This proves that the point that A 60a; is a D-dimensional axes-parallel cube, i.e.,
is returned in part 2c is an Zoo-neighbor of p. it is of the form [ai : a\ + 6] X [a2 : a2 + 6} X
Algorithm Neighbor(p, S, D) can be implemented ... X [ap : ary + 6], for real numbers ai, a2,..., an
using fractional cascading, such that its running and 8 > 0. The center of this box is the point
time is bounded by 0((logn)£,_1). Hence, we have (ai + ti/2,a2 + 6/2,...,aD + 6/2).
a data structure for the Z«,-neighbor problem that Let S be a set of n boxes in TR,D that are of
has a query time of O^logn)15-1) and that uses constant overlap, i.e., there is an integer constant
0(n(logn)r)_1) space. Range trees can be main- CD such that each box B of S contains the centers
tained under insertions and deletions of points. Be- of at most CD boxes in its interior. (Here, we also
cause of dynamic fractional cascading, the query count the center of B itself. Note that many boxes
time increases by a factor of O(loglog n). This may have their center on the boundary of B.)
proves Theorem 1. We want to store these boxes in a data structure
Let 5 be a set of n points in IRß and let e > 0 such that for any query point p£lR , we can find
be a fixed constant. For any point p G MD, we all boxes that contain p.
denote by p* its L2-neighbor in 5. A point 56 5 Remark: Note that we distinguish between "be-
is called a (1 + e)-approximate Li-neighbor of p if ing contained in a box" and "being contained in the
^(p, ?) < (1 + e)^2(P)P*)- We want to store the interior of a box".
set 5 in a data structure such that for any query In the full paper it is shown that any point p G
point p G Ht15 we can find a (1 + e)-approximate IR-0 is contained in at most 21+D CD boxes of S.
Li-neighbor of it. (The proof is technical.)
Let p G JR.13 and let q be an Zoo-neighbor of p in
S. It is easy to show that 3 is a \AD-approximate
3.1 A solution based on segment trees
^-neighbor of p. We extend this as follows. Let
(Ti) be a family of orthonormal coordinate systems We start with the one-dimensional case. Let S be
all sharing the same origin. Assume that for any a set of n intervals [a,- : bj], 1 < j < n, that are
point x in TR.D there is an index i such that in Ti of constant overlap with constant c We store the
all coordinates of x are almost equal, i.e., within intervals in the leaves of a balanced binary search
1 + e from each other. In Yao [15], it is shown how tree T, sorted by their right endpoints. The leaves
such a family consisting of 0((c/e)D~1) coordinate of this tree are threaded in a doubly-linked list.
systems can be constructed. In the planar case, Let p G IR be a query element. Search in T for
this family is obtained by rotating the X- and Y- the leftmost leaf containing a right endpoint that
axes over an angle of i ■ <f>, 0 < i < 2w/<j>, where is at least equal to p. Starting in this leaf, walk
0 < <fr < 7r/4 is such that tan<j> = e/(2 + e). along the leaves to the right and report all inter-
The data structure for approximate Z2- vals encountered that contain p. Stop walking as
neighbor queries: For each index i, let Si denote soon as 4c intervals have been reported, or c inter-
the set of points in S with coordinates in the sys- vals have been encountered that do not contain p.
tem T{. The data structure consists of a collection It is clear that this data structure solves the one-
of range trees; the z-th range tree stores the set S;. dimensional problem in 0(n) space with a query
Finding an approximate Z2-neighbor: Let p G time of O(logra). Moreover, intervals can be in-
IR.-0 be a query point. For each index i, use the i- serted and deleted in O(logrc) time.
th range tree to find an I«,-neighbor gM of p in We next consider the Z>-dimensional case, where
Si. Report an L^,-neighbor that has minimal L2- D > 2. Let 5 be a set of n boxes in ffi/° that are
distance to p. of constant overlap with constant CD- If B = B\ X
It can be shown that this query algorithm reports B2 X ... X BD is a box in IBP', then B' denotes the
a (l + e)-approximate ^-neighbor of p. This proves box 52 x ... x BD in IR73-1. Similarly, 5' denotes
Theorem 2. the set {B' : B G S}. Recall that we use a similar

169
notation for points. level of the recursion, the query algorithm can stop
The D-dimensional structure for D > 2: Let as soon as it has reported this many boxes. It re-
0.1 < a2 < ... < am, where m < 2n, be the sorted mains to prove that, at the last level, the query
sequence of all distinct endpoints of the intervals algorithm can stop if it has encountered cjr, boxes
of the first coordinates of the boxes in S. We store that do not contain p.
the elementary intervals ( — 00 : ai),[ai : aj],(ai : Consider such a last level. That is, let
^2), [ö2 : a2],...,(am_! : am),[am : am],(am : 00) Vi,v2,.. .jVp-i be nodes such that (1) i>x = v, (2)
in this order in the leaves of a balanced binary Vi is a node of the main tree of one of the three
search tree, called the main tree. Each node v of structures that are stored with u,_i, and (3) i>; lies
this tree has associated with it an interval Iv being on the search path to p{.
the union of the elementary intervals of the leaves The algorithm makes one-dimensional queries
in the subtree of v. Let Sv be the set of all boxes with pry in the three structures—binary search
B = Bx x B2 X ... X BD in 5 such that Iv C Bx trees—that are stored with VD-\. Consider one
and If(v) %. Bt. (f(v) is the father oft;.) such query. The algorithm searches for pD. Let r
Each node v of the main tree contains (a pointer be the leaf in which this search ends. Starting in r,
to) an associated structure for the set Sv: Partition the algorithm walks along the leaves to the right.
this set into Svi, Svc and Svr, consisting of those During this walk, it encounters boxes that do or do
boxes of Sv whose centers lie to the left of the "ver- not contain p. Assume that in leafs, the cry-th. box
tical" slab Iv xIRß_1, in or on the boundary of this is encountered that does not contain p. We have
slab, and to the right of this slab, respectively. to show that the algorithm can stop in s. That is,
The associated structure of v consists of three we must show that all leaves to the right of s store
recursively defined (D - 1)-dimensional structures boxes that do not contain p.
for the sets S'vl, S'vc and S'„. Assume this is not the case. Then, there is a box
The query algorithm: Let p = (pi,p2,.. .,pD) G A = [a-i : at + a] X [a2 : a2 + a] x ... X [aD : aD + a]
M be a query point. Search in the main tree for that is stored in a leaf to the right of s and that
the elementary interval that contains pi. For each contains p. Let B^ = [bjt : b^ + ßj] x [bj2 :
node v on the search path, recursively perform a bj2 + ßj] x ... x [bjD : bjD + ßj], 1 < j < cD,
(-D - 1)-dimensional query with the point p' in the be the encountered boxes between r and 5 that do
three structures that are stored with v. not contain p. In the full paper, we prove that A
At the last level of the recursion, a one- contains the centers of all these boxes in its interior.
dimensional query is performed in a binary search This is a contradiction. ■
tree. In this tree, the algorithm stops if it has re-
Theorem 4 Let S be a set of n boxes in TRD of
ported 21+D2cD boxes of S that contain p, or if it
constant overlap. There exists a dynamic data
has encountered CD boxes of S that do not contain
structure of size 0(n(logn)-D"~1) such that for any
P-
point p 6 MD, we can find all boxes of S that
contain p in 0((logn)D_1 loglogn) time. This
Lemma 2 The query algorithm is correct.
data structure has an amortized update time of
OKlognJ^loglogn).
Proof: It is well known that the set of all boxes
B = Bi x ... X Brj such that p1 6 B1 is exactly
the union of all sets Sv, where v is a node on the 3.2 A solution based on skewer trees
search path to pt. Hence, we only have to consider In this section, we give a Unear space solution to
the nodes on this search path. the box containment problem. This solution is
Let v be a node on the path to px. We have based on skewer trees, introduced by Edelsbrunner
to find all boxes in Sv whose last D - 1 inter- et al. [4].
vals contain (p2, ...,PD)- We claim that the re- Let S be a set of n boxes in MD that are of
cursive queries in the three structures stored with constant overlap with constant cu- For D = 1,
v find these boxes. We know that there are at most the data structure is the same as in the previous
21+D CD boxes that contain p. Hence, at the last subsection.

170
The D-dimensional structure for D > 2: If a closest pair of S if d(P, Q) = min{d(p, q):p,q£
S is empty, then the data structure is also empty. S,p^q}.
Assume that S is non-empty. Let 7 be the median We introduce the following notations. For any
oftheset{(a1+6i)/2: [ax :&i]x[a2 : b2]x.. .x[aD : point p G TR.D, box(p) denotes the smallest box
bo] G 5}, and let e be the largest element that is centered at p that contains at least (2D+2)D points
less than 7 in the set of all elements ai, (a1 + bi)/2 of S\ {p}. In other words, the side length of box(p)
and 61, where [ax : 6X] X ... X [aD : bD] ranges over is twice the Zoo-distance between p and its (1 +
S. Let 71 := 7 - e/2 and let a be the hyperplane (21? + 2)D)-th resp. (2D + 2)ß-th £TO-neighbor, if
in JR.D with equation zi =71. p G S resp. p g" S.
Let S<, S0 and 5> be the set of boxes [ax : Let N(p) be the set of points of 5 \ {p} that are
bi] x ... x [aD : bD] in S such that bx < 71, contained in the interior of box(p). Note that N(p)
«i < 7i < h and 71 < ai, respectively. The D- has size less than [2D + 2)D. In fact, N(p) may
dimensional data structure for the set S is an aug- even be empty.
mented binary search tree—called the main tree—
having the following form: Lemma 3 The set {(p, q):peS,q£ N(p)} con-
1. The root contains the hyperplane a. tains a closest pair of S.
2. The root contains pointers to its left and right
sons, which are Z?-dimensional structures for the Proof: Let (P, Q) be a closest pair of 5. We have
sets S< and S>, respectively. to show that Q G N(P). Assume this is not the
3. The root contains (a pointer to) an associated case. Let 6 be the side length of box(P). Since Q
structure for the set S0: Partition this set into S0i lies outside or on the boundary of this box, we have
and S0r, consisting of those boxes in 50 whose cen- d(P,Q)>8/2.
ters lie to the left of the hyperplane er, and to the Partition box(P) into (2D + 2)D subboxes with
right of cr, respectively. The associated structure of sides of length 6/(2D + 2). Since box(P) contains
the root consists of two (D - 1)-dimensional struc- at least 1 + (2D + 2)D points of 5, one of these
tures for the sets 50i and 50r. subboxes contains at least two points. These two
The query algorithm and its analysis is similar points have distance at most D ■ 6/(2D + 2) < 6/2,
to that of the previous subsection. The details can which is a contradiction, because (P, Q) is a closest
be found in the full paper. (See also Smid [11].) pair of 5. ■
The set {box(p) : p G 5} is of constant overlap:
Theorem 5 Let S be a set of n boxes in MD of each box contains the centers of at most (2D + 2)
constant overlap. There exists a data structure of boxes in its interior. These centers are precisely
size 0(n) such that for any point p G MD, we can the points of N(p) U {p}. This fact and the above
find all boxes of S that contain p in (^((logn)13-1) lemma suggest the following data structure.
time. This static data structure can be built in The closest pair data structure:
0(nlogn) time. 1. The points of 5 are stored in a range tree.
For the dynamic version of the problem, the 2. The distances of the multiset {d(p, q) : p G
query time is 0((logn)Z)_1 loglogn) and the size S,q G N(p)} are stored in a heap. With each dis-
of the structure is 0(n). Boxes can be inserted and tance, we store the corresponding pair of points.
deleted in amortized time 0((logn)2 log logn). (Note that both d(p,q) and d(q,p) may occur in
the heap.)
3. The points of S are stored in a dictionary. With
4 Maintaining the closest pair
each point p, we store a list containing the ele-
In this section, we apply the results obtained so ments of N(p). For convenience, we also call this
far to maintain a closest pair of a point set under list N(p). With each point q in N(p), we store a
insertions and deletions. Let 5 be a set of n points pointer to the occurrence of d(p, q) in the heap.
in IR^ and let 1 < t < 00 be a real number. We 4. The set {box(p) : p G 5} is stored in the dy-
denote the It-distance between any two points p namic data structure of Theorem 4. This structure
and q in MD by d(p, q). The pair P, Q G S is called is called the 60a; tree.

171
It follows from Lemma 3 that the pair of points 5 A transformation for reducing
that is stored with the minimal element of the heap
the space complexity
is a closest pair of S. The update algorithms are
rather straightforward. We only give the insertion The closest pair data structure of the previous sec-
algorithm. tion uses more than linear space. This raises the
The insertion algorithm: Let p £ MD be the question if the same update time can be obtained
point to be inserted. Assume p £ S. using only linear space. Note that we have a lin-
1. Using the range tree, find the (2D + 2)D L^- ear space solution for maintaining the set {box(p) :
neighbors of p in 5. The point among these neigh- p £ S}. (See Theorem 5.) For the Zoo-neighbor
bors having maximal .Loo-distance to p determines problem, however, no linear space solution having
box(p). The neighbors that are contained in the polylogarithmic query and update times is known.
interior of box(p) form the list N(p). Hence, in order to reduce the space complexity, we
2. Insert p into the range tree and insert the dis- should avoid using the range tree.
tances d(p,q), q £ N(p) into the heap. Then, in- We will give a transformation that, given any
sert p—together with the list N(p)—into the dic- dynamic closest pair data structure having more
tionary. With each point q in N(p), store a pointer than linear size, produces another dynamic closest
to d(p, q) in the heap. Finally, insert box(p) into pair structure that uses less space.
the box tree. Let DS be a data structure that maintains a clos-
3. Using the box tree, find all boxes that contain est pair in a set of n points in MD under inser-
p. For each reported element box(q), q ^ p, that tions and deletions. Let S(n) and U(n) denote the
contains p in its interior, do the following: size and update time of DS, respectively. We as-
3.a. Search in the dictionary for q. Insert p into sume that S(n) and U(n) are non-decreasing. Let
N(q), insert d(q,p) into the heap and store with p f(n) be a non-decreasing integer function such that
a pointer to d(q,p). 1 < f(n) < n/2.
3.b. If N(q) has size less than (2D + 2)D, then Let S C IR be the current set of points. The
the insertion algorithm is completed. Otherwise, if cardinality of S is denoted by n. Our transformed
N(q) has size (2D + 2)D, let ru .. .,n be all points data structure will be completely rebuilt after a
in N(q) that have maximal Loo-distance to q. For sufficiently long sequence of updates. Let S0 be
each 1 < i < I, delete V{ from N(q) and delete the set of points at the moment of the most recent
d(q, ?i) from the heap. Finally, delete box(q) from rebuilding and let no be its size at that moment.
the box tree and insert the box centered at q having As in the previous section, for each p £ JR,D,
rx on its boundary as the new box(q). box(p) denotes the smallest box centered at p that
During the update algorithms, we perform a con- contains at least (2D + 2)D points of S \ {p}. The
stant number of query and update operations in the set of all points of 5 \ {p} that are in the interior
range tree, the box tree, the heap and the dictio- of this box is denoted by N(p). If p £ S0, then
nary. Therefore, Theorems 1 and 4 imply: boxo(p) denotes the smallest box centered at p that
contains at least (2D + 2)D points of S0 \ {p}.
Theorem 6 Let S be a set of n points in WiD and The transformed closest pair data structure:
let 1 < t < oo. There exists a data structure of 1. The set S is partitioned into sets A and B such
size 0(n(logn) _1) that maintains an Lt-closest that A C {p £ S : p £ S0 A box(p) C box0(p)}.
pair of S in 0((logn)D~1 log log n) amortized time 2. The distances of the multiset {d(p, q) : p £
per insertion and deletion. A,q £ N(p)} are stored in a heap. With each dis-
tance, we store the corresponding pair of points.
Consider again our data structure. The box 3. The boxes of the set {box0(p) : p £ S0} are
box(p) that is associated with point p contains an stored in a list, called the box list. With each el-
Zoo-neighbor of p in S \ {p}. Therefore, the data ement box0(p) in this list, we store a bit having
structure can easily be adapted such that it main- value true if and only if p £ A. Moreover, if p £ A,
tains for each point in S its L^-neighbor. This we store with boxo(p) the box box(p).
proves Theorem 3. 4. The boxes of the set {box0(p) : p £ So} are

172
stored in the static data structure of Theorem 5. box0(q) has value true, then check if p is contained
This structure is called the box tree. With each in the interior of box(q). If so, do the following:
box in this structure, we store a pointer to its oc- 2.a. Search in the dictionary for q. Insert p into
currence in the box list. N(q), insert d(q,p) into the heap and store with p
5. The points of S are stored in a dictionary. With a pointer to d(q,p).
each point p, we store a bit indicating whether p 2.b. If N(q) has size less than (2D + 2)D, then
belongs to A or B. If p G A, then we store with p the insertion algorithm is completed. Otherwise,
5.a. a pointer to the occurrence of boxo(p) in the let ri,..., ri be all points of N(q) that are at maxi-
box list, and mal Loo-distance from q. For each 1 < i < I, delete
5.b. a list containing the elements of N(p). For n from N(q) and delete d(q, n) from the heap. Fi-
convenience, we also call this list N(p). With each nally, replace box(q)—which is stored with box0(q)
point q in N(p), we store a pointer to the occur- in the box list—by the box centered at q having rx
rence of d(p, q) in the heap. on its boundary, being the new box(q).
6. The set B is stored in the dynamic data struc- Note that since A C {p G S : p G So A box(p) C
ture DS, called the B-structure. box0(p)}, all boxes box(q), q G A, that contain p
are found in Step 2.
Lemma 4 Let 8 be the minimal distance stored in The deletion algorithm: Let p G S be the point
the heap and let 8' be the distance of a closest pair to be deleted.
in B. Then, min(£, 8') is the distance of a closest 1. Search for p in the dictionary. If p G B,
pair in the set S. then delete p from this dictionary and from the B-
structure. Otherwise, if p G A, follow the pointer
Proof: Let {P,Q) be a closest pair in S. We dis- to box0(p) in the box list and set its bit to false.
tinguish two cases. Moreover, for each point q in N(p), delete the dis-
Case 1: At least one of P and Q is contained in tance d(p,q) from the heap. Then, delete p from
A. Assume that P G A. Since box(P) contains at the dictionary.
least 1 + (2D + 2)D points of S, Q is contained in 2. Using the box tree, find all boxes that contain
the interior of this box. Hence, Q G N(P) and the p. For each reported element box0(q), follow the
distance d(P,Q) is stored in the heap. Therefore, pointer to its occurrence in the box list. If the bit
8 = d(P,Q). Clearly, d(P,Q) < 8'. This proves of boxo(q) has value true, then check if p is con-
that d(P,Q) = min(8,8'). tained in box(q). If so, do the following: Set the
Case 2: Both P and Q are contained in B. Then bit of box0(q) to false. Search in the dictionary for
8' = d(P,Q) and d(P,Q)< 6. ■ q. For each point r in N(q), delete d(q, r) from the
Initialization: At the moment of initialization, heap. Then, delete the pointer from q to 6oa;o(?))
S = So = A and B = 0. Using Vaidya's al- delete the list N(q), and store with q a bit say-
gorithm [14], compute for each point p in S its ing that it belongs to B. Finally, insert q into the
1 + (2D + 2)D ioo-neighbors. The point among 5-structure.
these neighbors having maximal Loo-distance to p Rebuild: Recall that n0 is the size of 5 at the
determines box(p) = box0(p). The neighbors (ex- moment we initialize the structure. After /(no)
cept p itself) that are contained in the interior of updates have been performed, we discard the entire
this box form the list N(p). It is clear how the rest structure and initialize a new data structure for the
of the data structure can be built. current S.
The insertion algorithm: Let p G TR.D be the
point to be inserted. Theorem 7 Let DS be any data structure for the
1. Insert p into the dictionary and store with p a dynamic closest pair problem. Let S(n) and U(n)
bit saying that p belongs to B. Then, insert p into denote the size and update time of DS, respectively.
the 5-structure. Let 1 < f(n) < n/2 be a non-decreasing integer
2. Using the box tree, find all boxes that contain function. We can transform DS into another data
p. For each reported element boxo(q), follow the structure for the dynamic closest pair problem hav-
pointer to its occurrence in the box list. If the bit of ing size 0(n + S(f(n))), and an amortized update

173
time o/0((logn)ß-1 + U(f(n)) + (nlogn)//(n)). problem. Proc. ACM Symp. on Computational
Geometry, 1992, 330-336.
If we apply this theorem twice (for the case D > 3),
respectively k times (for the case D = 2), with ap- [11] M. Smid. Rectangular point location and the
propriate choices for the function f(n), then we get dynamic closest pair problem. Proc. 2nd An-
the results given in the last three lines of Table 1. nual International Symp. on Algorithms, Lec-
ture Notes in Computer Science, Vol. 557,
Springer-Verlag, Berlin, 1991, 364-374.
References
[12] M. Smid. Maintaining the minimal distance of
[1] S. Arya and D.M. Mount. Approximate near- a point set in polylogarithmic time. Discrete
est neighbor queries in fixed dimensions. Proc. Comput. Geom. 7 (1992), 415-431.
SODA 1993, 271-280.
[13] K.J. Supowit. New techniques for some dy-
[2] S. Arya, D.M. Mount, N.S. Netanyahu, R. namic closest-point and farthest-point prob-
Silverman, A. Wu. An optimal algorithm for lems. Proc. SODA 1990, 84-90.
approximate nearest neighbor searching. Proc.
SODA 1994, pp. 573-582. [14] P.M. Vaidya. An O(nlogn) algorithm for the
all-nearest-neighbors problem. Discrete Com-
[3] K.L. Clarkson. A randomized algorithm for put. Geom. 4 (1989), 101-115.
closest-point queries. SIAM J. Comput. 17
(1988), 830-847. [15] A.C. Yao. On constructing minimum spanning
trees in k-dimensional spaces and related prob-
[4] H. Edelsbrunner, G. Haring and D. Hubert. lems. SIAM J. Comput. 11 (1982), 721-736.
Rectangular point location in d dimensions
with applications. The Computer Journal 29
(1986), 76-82.

[5] M. Golin, R. Raman, C. Schwarz and M. Smid.


Randomized data structures for the dynamic
closest-pair problem. Proc. SODA 1993, 301-
310.

[6] K. Mehlhorn and S. Näher. Dynamic frac-


tional cascading. Algorithmica 5 (1990), 215-
241.

[7] F.P. Preparata and M.I. Shamos. Computa-


tional Geometry, an Introduction. Springer-
Verlag, New York, 1985.

[8] J.S. Salowe. Shallow interdistance selection


and interdistance enumeration. International
Journal of Computational Geometry & Appli-
cations 2 (1992), 49-59.

[9] C. Schwarz. Data structures and algo-


rithms for the dynamic closest pair prob-
lem. Ph.D. Thesis. Universität des Saarlandes,
Saarbrücken, 1993.

[10] C. Schwarz, M. Smid and J. Snoeyink. An


optimal algorithm for the on-line closest pair

174
Competitive Searching in a Generalized Street
Amitava Datta* Christian Icking**

Abstract Lumelsky and Stepanov [8] study this problem when


only tactile sensors are used. Papadimitriou and Yan-
We consider the problem of a robot which has to find nakakis [9] consider several variants of the problem as a
a path in an unknown simple polygon from one point two-person game and gave bounds on the length of the
s to another point t, based only on what it has seen so generated path in terms of the length of the shortest
far. A Street is a polygon for which the two boundary path. Blum et al [2] present deterministic and ran-
chains from s to t are mutually weakly visible, and the domized on-line algorithms for several versions of this
set of streets was the only class of polygons for which a problem when the obstacles are rectangles or convex
competitive search algorithm was known. polygons.
We define a new, strictly larger class of polygons, Following the concept of competitive algorithms intro-
called generalized streets or (/-streets which are charac- duced by Sleator and Tarjan [10] for general problems
terized by the property that every point on the bound- in computer science, a strategy for searching on-line is
ary of a ^-street is visible from a point on a horizon- called k-competitive for a constant k, if it can be guaran-
tal line segment connecting the two boundary chains teed that the generated path is no longer than k times
from s tot. We present an on-line strategy for a robot the shortest path. The constant k is then called the
placed at s to find t in an unknown rectilinear {/-street; competitive factor.
the length of the path created is at most 9 times the Klein [6] describes the problem of designing an on-
length of the shortest path in the L\ metric. This is line strategy for a robot when the robot is constrained
optimal since we show that no strategy can achieve a to move inside a simple polygon from a vertex s to a
smaller competitive factor for all rectilinear (/-streets. vertex t. He gives an on-line strategy for a class of
Compared to the L2-shortest path, the strategy is 9.06- polygons called streets. A street is a polygon such that
competitive which leaves only a very small gap to the the clockwise polygonal chain L from s to t and the
lower bound of 9. anticlockwise polygonal chain R from s to t are mutually
weakly visible. An alternative criterion for recognizing
a street was also given in [5]. Das et al [3] give an
1 Introduction algorithm to compute, for a given polygon, all pairs of
Path planning is one of the fundamental problems in points s and t such that the polygon is a street with
robotics. In contrast to path planning with complete respect to these points.
information, i. e. if the whole scene is known in ad- Klein proves a lower bound of \/2 (> 1.41) on the
vance, it is interesting for many real life situations to competitive factor for searching in a street, and his
consider the problem of finding a path on-line. Here, strategy achieves a competitive factor of 1+|TT (< 5.72).
the geometry of the scene is unknown and the robot Recently, Kleinberg [7] has improved this ratio to 2\/2
has to make decisions depending on the information it (< 2.83). He also mentions that his strategy is \/2-
gathers through (e. g. visual or tactile) sensors. competitive for rectilinear streets which is optimal. In-
terestingly, this means in fact that one can find on-line
'This work was done when the author was visiting FernUni-
an L\-shortest path for rectilinear streets.
versität Hagen, and the author will like to thank Rolf Klein for
his support. It has been posed as a challenging open problem
"Praktische Informatik VI, FernUniversität Hagen, whether more general classes of polygons admit com-
Elberfelder Straße 95, D-58084 Hagen, Germany,
petitive searching. In this paper, we introduce one such
email: ehr ist ian. icking«f emuni-hagen. de
class.
Permission to copy without fee all or part of this material is The rest of the paper is organized as follows. In Sec-
granted provided that the copies are not made or distributed for tion 2, we introduce some definitions and properties re-
direct commercial advantage, the ACM copyright notice and the lated to (/-streets. We give the strategy for rectilinear
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing (/-streets and analyze its complexity in Section 3. Some
Machinery. To copy otherwise, or to republish, requires a fee open questions are mentioned in Section 4.
and/or specific permission.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 j_75
Figure 1: A (/-street.

2 Definitions and properties point p G L U R, there exists an Z,Ä-chord c such that


p is visible from a point on c.
We consider a simple polygon P in the plane with a start
vertex, s, and a target vertex, t. We use the Cartesian Figure 1 shows an example of a (/-street. Some LR-
coordinate system. The notion of horizontal (resp. ver- chords, drawn as dashed lines, indicate visibilities along
tical) indicates a direction parallel to the z-axis (resp. the dotted rays.
y-axis).
We assume for simplicity that no three vertices are Lemma 4 The class of Q-streets contains all streets
aligned. Our results can be easily adapted to handle the and this containment is proper.
general case when three vertices are aligned or s and t
are not vertices. The clockwise (resp. anticlockwise) Proof. Consider a street and a point p in its left chain
chain from s to t is called the left chain or L (resp. L, see Figure 2. We want to show that p is visible from
right chain or R). These two chains induce a natural a point on an LR-chord. Within the street, p must be
ordering of vertices of the polygon from s to t. visible from some point q G R. We shoot a horizontal
ray from p into the interior of the street. If it hits R
Definition 1 [6] A polygon is called a street if the two then p lies on an LR-choid and we are done.
chains L and R are mutually weakly visible. Otherwise we move a point r from p to q on the line
segment pq from which we continue to shoot horizontal
Definition 2 A horizontal line segment inside the
rays in both directions, see Figure 2. We stop at the
polygon P with both endpoints on the boundary of P
first position where a ray touches the right chain R,
is called a chord. The extension of a horizontal edge
which must eventually happen since q £ R. This ray
e across the interior of P such that the two end points
determines an ii?-chord from which p is visible.
hit the polygon boundary is called the chord of e, analo-
gously we define the chord of a vertex. If a chord touches This proves that every street is a (/-street. In Fig-
both the L and R chains it is called an LR-chord. ure 1, we have seen an example of a (/-street which is
not a street. D
Definition 3 A simple polygon in the plane is called The following lemma states a simple property of LR-
a generalized street or Q-street if for every boundary chords.

176
Figure 2: A street is always a (/-street (Lemma 4).

Lemma 5 Every path in P from s to t intersects all iff the two points s and t are in two different regions of
LR-chords of the polygon. a chord then it is an LR-choid.

Proof. Consider an LR-choid c and suppose c touches Definition 7 A reflex vertex / is called a landmark
the chains L and R at the points p and q respectively. with respect to an LR-chord c if
The line segment pq divides the polygon into two parts.
The point t cannot be in the part which also contains • / is visible from some point of c, and
s, otherwise p and q would be on the same chain L or
R. This implies that s and t are in different parts and • both, the vertical edge incident on /, and c, are part
any path from s to t must intersect pq. D of the same region of the chord of /.

See Figure 4 for an example of a landmark. A land-


3 A strategy for rectilinear (/-streets mark is always an endpoint of a cut chord or a step
chord. For the robot, to see a landmark will be an evi-
From now on, we concentrate on rectilinear (/-streets; dence that the target is hidden behind the chord of that
all edges are either horizontal or vertical, see Figure 3 landmark.
for an example. It is clear that the class of rectilinear
(/-streets includes all rectilinear streets and is strictly Lemma 8 Let I be a landmark with respect to an LR-
larger. chord and let c be the chord of the horizontal (cut or
step) edge of I. Then the following is true.
Definition 6
1. The points s ar-dt arc in different regions of c, i. e.
• A horizontal edge of the polygon is called a cut edge
c is an LR-chord.
if both of its vertices are reflex. The chord of a cut
edge is called a cut chord. 2. All landmarks (if any) with respect to c are in the
• A horizontal edge is called a step edge if one of its regions of s and t.
vertices is convex and the other is reflex. The chord 3. Either the point t or some landmark in the region
of a step edge is called a step chord. oft is visible from some point on c.
• A cut chord divides the polygon into three parts, a
step chord divides it into two parts. We call these Proof. We prove the lemma for the case of c being a
parts the regions of the chord. cut chord. The proof for a step chord is similar.
Suppose, c is a cut chord which passes through the
We refer to a cut chord or step chord as a critical cut edge e. Suppose, the vertex v is adjacent to e and
chord, see Figure 4 for examples. It is easy to see that v is a landmark with respect to an LR-choid c\. First,

177
1

V.
i *
4 *

L R

T-r N i

-
»■■

'»■
ip i i

Figure 3: A rectilinear (/-street.

assume that s and i are in the same region of c. If s • The point t or some landmark in the region oft is
and t are in the region which does not contain c\, then visible from some point on c.
ci is not an LiZ-chord. If they are in the same region
which contains c\, then there is at least one point on • The only visible landmarks are in the region ofT.
the edge e which is not visible from any Li?-chord and
the polygon is not a (/-street, a contradiction. Hence, Proof. Similar to that of Lemma 8. □
c is an LiZ-chord and the two points s and t are in two
different regions of the chord c. Now, we turn to a description of our algorithm. We
For proving the second statement, assume that there assume that at every position in its path, the robot
is a landmark I2 on a horizontal edge ti in a region Ri can get the visibility map of the polygon through its
other than the ones which contain s and t. Note that sensors. The idea for our strategy is inspired by the
no horizontal line segment (except the chord c) whose strategy, called doubling, for searching a point on a line
end points touch the polygon in the region Rt can be by Baeza-Yates et al [1]. There, the robot goes back and
an Liu-chord. This is because the complete polygonal forth on the line, at each step doubling the distance to
chain which constitutes this region belongs either to the the start point, until the target is reached.
L or to the R chain. So, there is at least one point on
e2 which is not visible from any LiJ-chord. This means Lemma 10 [1] The doubling strategy for searching a
the polygon is not a (/-street, a contradiction. point on a line has a competitive factor of 9, and this
For the third statement, consider the two regions is optimal.
which do not contain the point s. We have already
proved that t must be in one of these two regions. So, For the problem of finding a path in a (/-street, we
t can be hidden from all the points of the chord c only apply a slight variant of the doubling strategy. Stand-
through the presence of a landmark. D ing on a critical LÄ-chord, our robot performs doubling
on this chord until the target becomes visible or a land-
mark is in sight. If at any time during this doubling a
Lemma 9 If c is the chord of the starting point s then vertical wall is hit, the robot walks straight in the other
the following holds. direction. Also, it may happen that after reaching a cut

178
e. 1
k

ec

r
Figure 4: A step edge e,, a cut edge ee, and the respective chords.
Vertex / is a landmark with respect to the chord of ee.

or step chord, the robot immediately sees the next land- Proof. We assume w.l.o.g. that the landmark / is on
mark and it does not execute doubling on this chord. the right chain R and to the right and above the present
We do not differentiate between all these variants of the position p of the robot, see Figure 5. The other cases
doubling algorithm in our strategy and call all of them are similar.
doubling. The robot goes vertically upwards from its present
The doubling strategy in [1] is formulated to search position until it reaches the chord of the landmark /
for the target only on an integer grid. It is not com- (then we are done), or / becomes invisible. The visibility
petitive if the distance to the target may be any real ray to / can only be obstructed by a reflex vertex of L.
number, because the first step may be to the wrong At this point, the robot starts going to the right until it
direction. Nevertheless, we can use doubling in our en- is vertically below a point of the chord of/, or / becomes
vironment of real coordinates if we chose as length of invisible again (whatever comes first).
the first step for each doubling the distance of the ac- This process is repeated until the chord of/ is reached,
tual position of the robot to the nearest projection of see the thick line in Figure 5. Clearly, the resulting path
all visible vertices on the actual chord. is xj/-monotone.
Our algorithm, called doubleX, is presented (in The reached point on the chord of / either is vertically
pseudo-code) in Table 1. The robot walks on a rec- above p, or has an x-coordinate equal to the maximum
tilinear path and tries to keep close to an Li-shortest x-coordinate of the subchain of L between the chord
path. Initially, when the robot is at the point s, it either of p and the chord of /. This shows that we reach the
sees a landmark or the goal by executing the doubling chord of / at the ii-nearest point from p. O
algorithm on the chord of s. This is possible due to
Lemma 9. So, initially the robot can choose a region It is easy to see that if t is visible from the present
depending on this landmark. At every successive step, position of the robot, it can reach t in a similar way, so
the robot moves from one L-R-chord defined by a land- that step 15 of the algorithm is feasible.
mark to another LÄ-chord defined by the next land-
mark. These landmarks can be correctly chosen due to Lemma 12 Starting from the point s, the robot cor-
Lemma 8. If there is more than one visible landmark rectly reaches the point t by executing procedure dou-
then the robot is free to chose one of them. In this bleX.
process, ultimately the goal is reached.
We need the following lemma before proving the fea- Proof. Initially, there are two possibilities at the point
sibility of step 10 of the algorithm. s. If the robot sees the point t, it can go to t by a
method similar to that in Lemma 11. Otherwise, it finds
Lemma 11 If a landmark I is visible from the present a landmark according to Lemma 9. From Lemma 5,
position, the robot can reach the Li-nearest point on the the path should cross the chord which passes through
chord of I by an xy-monotone, i.e. Li-shortest, path. this landmark. So, initially, the robot chooses a correct

179
1 Procedure doubleX
2 s : the starting point.
3 t : the target point.
4 m : a chord.
5 begin
6 Let m be the chord of s.
7 Execute doubling on m until a landmark / or the target t is visible.
8 while (t is not visible) do
9 Let m be the chord of /.
10 Go to the Lj-nearest point of m on an xy-monotone path.
11 Determine the region R of m where we come from.
12 Execute doubling on m
13 until a landmark / or the target t is visible in a region other than R.
14 end while
15 Go to t on an xy-monotone path.
16 end

Table 1: The strategy for rectilinear (/-streets.

vertical direction. In every subsequent step, the robot we have to prove that the path up to c,+i is shortest.
reaches a critical chord. While executing the doubling If i = 0 or if the reduced path from Cj_i to c,+i is xy-
algorithm at each such chord, it is always ensured from monotone, this follows from the induction hypothesis.
Lemma 8 that either the next landmark or the point t Otherwise, we have two possible cases. If the reduced
is found. As soon as the point t is visible, the robot can path changes its vertical direction at c< ("up" from c;_i
go to t by a xy-monotone path as mentioned before. O to c,- and "down" from c,- to c;+i or vice versa) then c,-
We now estimate the length of the path generated by is a cut chord, and every shortest path from s to t goes
the robot. along the edge of C{.
If, on the other hand, the horizontal direction
Definition 13 The reduced path is a rectilinear path changes, then the path from c,_i to c,- must touch a
from s to t which only includes from the robot's path vertical edge at an extreme position such that every
shortest path also touches that edge, since otherwise
• the xy-monotone motion from one critical chord to the robot's path, from c,_i, would not reach the L\-
the next, and nearest point on c*.
• the horizontal step from the point where a critical From this we conclude that the reduced path is short-
a
chord is first reached to the point where it is left. est up to t.

In other words, for the reduced path, we do not con-


Theorem 15 Procedure doubleX achieves a competi-
sider the extra movements generated due to the execu-
tive factor of 9 in the L\ metric, and this is optimal.
tion of the doubling algorithm.

Lemma 14 The reduced path is an Li-shortest path Proof. From Lemma 14, the reduced path of the robot
from s tot. is a shortest path. Compared to a reduced path, the
only extra path segments the robot traverses are the
Proof. Along its way from s to t, the robot stops at a segments generated due to doubling on a step or cut
sequence of critical chords Co,..., c<,..., c*, where CQ is chord. Suppose, for such a chord c,-, the robot reaches
the chord of s, and ct is the last chord the robot crosses and leaves c,- at the points pi and ■pi respectively. From
before reaching t. Lemma 10, the robot traverses at most 9 times the
By induction, assume that the path is a shortest path length of the segment plpj due to doubling. Hence,
upto the chord cj. Clearly, this is true for i = 0. Now, the claim follows.

180
Figure 5: An xy-monctone step from one £i?-chord to another.

On the other hand, no better competitive factor can The competitive factor must be less than the maximum
be achieved. Figure 6 shows how we can produce a Q- value of
street with many caves at integer positions where t can 9xi + yi 9w + 1
be in any of the caves, such that searching for t in such
a ^-street is essentially equivalent to searching a point
on a line, for which [1] proves a lower bound of 9. O
for all possible values of w. A simple analysis shows
The lower bound of 9 also applies if we compare the that the maximum is reached at w = 9 at which
robot's path to the I^-shortest path. But what is the
competitive factor of our strategy in this case? Any
\/82 < 9.06
Li-shortest path is at most \/2 times longer than the
corresponding /^-shortest path. From this one can con-
clude that our strategy doubhX achieves a competitive is the maximum value. The claim of the theorem follows
factor of 9^2 (< 12.73) in the L2 metric. But with a by extending the analysis to every pair of such chords
closer look to the details of our strategy, one can prove and from the fact that the L2-shortest path must also
a
a much better bound. visit the points p\ and p2-

Theorem 16 Procedure doubleX achieves a competi-


tive ratio o/9.06 in the L2 metric.
4 Conclusion
Proof. We consider two reflex vertices p; and P2 of
the robots path such that the reduced path from pi to For the rectilinear case, we have extended the class of
P2 is xy-monotone but the reduced path from pi to the polygons for which competitive strategies are known for
critical chord after p2 (if it exists) is not xy-monotone, a robot, starting at a vertex s, to find a path to a vertex
as well as the reduced path from the preceding chord of t with the help of the visibility map. Our strategy dou-
Pi top2. bleX achieves an optimal competitive factor of 9 in the
Let xi be the x-distance between pi and p2 and yi L\ metric, and a factor of 9.06 in the L2-metric, which
the {/-distance (such that the reduced path from pi to is very close to optimal.
P2 has length x -f y). It is an interesting open question whether there is, in
The length of the L2-shortest path from p\ to P2 is at the rectilinear case, a still larger class of polygons which
least \Jx\ + y\. From the proof of Theorem 15 we know can be searched competitively, and in the general case, if
that the length of the robot's path is at most 9xi + y\. the class of (/-streets or another class of polygons which
We may assume that yi ^ 0 and substitute w = xi/yi. strictly includes streets permits a competitive search.

181
t can be in any of the caves.

> * v •* \ \
.Ji_n_JLJi_n_n_n_n_n..
u
Figure 6: Searching in a ^-street is at least as difficult as searching a point on a line.

References [9] C. Papadimitriou and M. Yannakakis. Shortest


paths without a map. Theoretical Computer Sci-
[1] R. Baeza-Yates, J. Culberson, and G. Rawlins. ence 84, 1991, pp.127-150.
Searching in the plane. Information and Com-
putation 106, 1993, pp. 234-252. [10] D. D. Sleator and R. E. Tarjan. Amortized Ef-
ficiency of List Update and Paging Rules. Com-
[2] A. Blum, P. Raghavan and B. Schieber. Navigat- munications of the ACM, 28, 1985, pp. 202-208.
ing in unfamiliar geometric terrain. In Proceed-
ings of the 23rd ACM Symposium on Theory of
Computing, 1991, pp. 494-504.

[3] G. Das, P. J. Heffernan, and G. Narasimhan.


LR- Visibility in Polygons. In Proceedings of the
5th Canadian Conference on Computational Ge-
ometry, 1993, pp.303-307.

[4] X. Deng, T. Kameda, and C. Papadimitriou.


How to learn an unknown environment I: The
rectilinear case. Technical Report CS-93-04, De-
partment of Computer Science, York University,
1993.

[5] Ch. Icking and R. Klein. The Two Guards Prob-


lem. International Journal of Computational
Geometry and Applications 2, 1992, pp. 257-
285.

[6] R. Klein. Walking an unknown street with


bounded detour. Computational Geometry:
Theory and Applications 1, 1992, pp. 325-351.

[7] J. Kleinberg. On-line search in a simple polygon.


In Proceedings of the 5th ACM-SIAM Sympo-
sium on Discrete Algorithms, 1994, pp. 8-15.

[8] V. J. Lumelsky and A. A. Stepanov. Path-


planning strategies of a point mobile autmaton
moving amidst unknown obstacles of arbitrary
shape. Algorithmica 2, 1987, pp. 403-430.

182
The Tight Lower Bound for the Steiner Ratio in Minkowski Planes

Biao Gao* Ding-Zhu Du* Ronald L. Graham*

Abstract all the points of X, and such that the sum of all the
lengths H^lSllo is a minimum. We denote this mini-
A minimum Steiner tree for a given set X of points mum sum by LM(X). Further, we define
is a network interconnecting the points of X having
minimum possible total length. The Steiner ratio for Ls(X)=MxLM(Y)
a metric space is the largest lower bound for the ra- where Y ranges over all finite subsets of E2 containing
tio of lengths between a minimum Steiner tree and a X. It is not hard to show that there always exists X1 3
minimum spanning tree on the same set of points in X with \X'\ < 2\X\ - 2 having LS{X) = LM(Xr).
the metric space. In this note, we show that for any When equality holds we say that the Steiner tree T(X)
Minkowski plane, the Steiner ratio is at least 2/3. This (= S(X')) is a full Steiner tree for X. The minimum
settles a conjecture of D. Cieslik, and also Du et al.. spanning tree S(Y) will be called a minimum Steiner
tree T(X) for X. The points of Y\X are usually called
1 Introduction Steiner points of T(X); the points of X are known as
regular points of T(X).
Given a compact, convex, centrally symmetric domain Minimum Steiner trees have been the subject of
D in the Euclidean plane E2, one can define a norm extensive investigations during the past 25 years or
|| ■ \\D '■ E2 —* R by setting ||X||.D = A where x = Xü so (see[4, 11, 16, 9]). Most of this research has dealt
and ü G dD, the boundary of D. We can then define with the Euclidean metric, with much of the remain-
a metric dp on E2 by taking ing work dealt with the L\ metric, or more generally,
do(x,y) = \\x -y\\D. the usual Lp metric or norm (see [6, 3]). It has been
shown, for example, that the determination of Ls{X)
Thus, dD = {x | ||X||D = 1}. The resulting met- in general is an NP-complete problem, both for the
ric space M = M(D) = (E2,do) is often called a Euclidean as well as the L\ case (cf. [10], [9]).
Minkowski or normed plane with unit disc D. We In this note, we study the Steiner ratio p(D) for
will usually suppress the explicit dependence of vari-
M(D), defined by
ous quantities on D. For a finite subset X C E2, a
minimum spanning tree S = S(X) consists of a col-
lection of segments AB with A, B £ X, which spans
Thus, p(D) is a measure of how much the total length
'Computer Science Department, University of Minnesota,
Minneapolis, MN 55455, and Institute of Applied Mathematics,
of a minimum spanning tree can be decreased by allow-
Chinese Academy of Sciences, Beijing. Support in part by the ing additional (Steiner) points. It is known that for L\
NSF under grant CCR-9208913. metric (so that D is the square with vertices (±1,0),
'AT&T Bell Laboratories, Murray Hill, NJ 07974
(0,±1)), p(D) = 2/3 [13] and for the Euclidean (or
Permission to copy without fee all or part of this material is L2) metric, p{D) = \/Z/2 [7]. More recently, Cieslik
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the [3] and Du, Gao, Graham, Liu and Wan [6] indepen-
title of the publication and its date appear, and notice is given dently conjectured that for any normed plane,
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to repubiish, requires a fee
and/or specific permission. 2/3 < p{D) < VZ/2.

10th Computational Geometry 94-6/94 Stony Brook, NY, USA


© 1994 ACM 0-89791-648-4/94/0006..$3.50 joo
Cieslik [3] showed that for any normed plane,

0.612 < p(D) < 0.9036

while Du et al. [6] proved that for any normed plane,


(a) (b)

0.623 < p(D) < 0.8686


Figure 1: Local structures in full minimum Steiner

We will prove here that for any normed plane, trees

p{D) > 2/3. regular points are called adjacent if one can be reached
from the other by always moving in a clockwise direc-
Since the L\ metric has p = .2/3 then this inequality
tion or always moving in a counterclockwise direction.
is therefore best possible.
Clearly, each regular point has two other adjacent reg-
ular points.
For prior results on minimum Steiner trees in
We can form a polygon G, called the characteristic
normed planes, the reader should consult [2], [8], [1],
polygon of T, by joining each pair of adjacent regular
[17] and [19]. This note is organized in the following
points with a straight line segment. Any spanning
way. In Section 2, fundamental properties of mini-
tree lying inside G is called an inner spanning tree. A
mum Steiner trees are presented. In Section 3, the
minimum inner spanning tree is one having the least.
main result is proved.
possible total length. A point set P is called critical
if there is a minimum Steiner tree T for P such that
2 Preliminaries the union of the minimum inner spanning trees (with
respect to T) for P divides the characteristic polygon
A minimum Steiner tree is full if every regular point G = G(T) into equilateral triangles. The vertices of
is a leaf (i.e., has degree one). The following lemma these equilateral triangles (which we will call lattice
states an important property of full minimum Steiner points) lie on a triangular lattice in the normed plane.
trees, which can be found in [6] Since similar sets have the same ratios of minimum
Steiner tree and minimum spanning tree lengths, we
Lemma 1 Suppose that dD is difjerentiable and
need only consider critical sets having equilateral tri-
strictly convex. Then every full Steiner minimum tree
angles with unit edge length. Clearly, for any critical
consists of three sets of parallel segments.
set, a minimum inner spanning tree is in fact a min-

A tree is called a 3-regular tree if every vertex imum spanning tree; its length is just n — 1 where n

which is not a leaf has degree three. A consequence of is the number of its (regular) vertices. Note that any

Lemma 1 is that for strictly convex and differentiable two adjacent regular points have mutual distance 1.

norms, every minimum Steiner tree is a 3-regular tree. Define

Another consequence of Lemma 1 is the following pn{D) := mm -———.


\P\=n LM(P)
result. A proof can be found in [5]. If pn-i > Pn, then n is called a. jump value. In [7], Du
and Hwang prove the following.
Lemma 2 For strictly convex and difjerentiable
norms, every full minimum Steiner tree on more than Lemma 3 In a plane with a strictly convex and dif-
three points must have at least one of the local struc- ferentiable norm, if n is a jump value then pn is
tures shown in Figure 1. achieved by some critical set.

Consider a full minimum Steiner tree T in a plane Remark: The proof of Du and Hwang for Gilbert-
with a strictly convex and differentiable norm. Two Pollak conjecture used a contradition argument. In

1S4
their argument, n is assumed to be the smallest nat- contradicting (1).
ural numder such that a counterexample of n points If T has some edge e of length at least 2/3, then
exists for the Gilbert-Pollak conjecture. For this n, by removing e, we are left with two vertex-disjoint
they proved that p is achieved by some critical set subtrees T\ and T?. Clearly, T\ and T2 are Steiner
and then showed that the Gilbert-Pollak conjecture trees on disjoint subsets P\ and P2, respectively, where
holds for every critical set. Actually, if assume that n Pi U P2 = P. It follows that
is a jump value, then the argument of Du and Hwang
Ls(P) > Ls(P1) + Ls(P2) + e(e)
still holds. Thus, we have the above lemma.
> l(LM(Px) + LM(P2) + l)

3 The Main Result > \LM{P),

Theorem 1 For any convex and centrally symmetric again contradicting (1), where in general we will let
D, £(T) denote the total length (under D) of any graph
P(D)>\. T (such as an edge, path or tree). D

Moreover, if Pk(D) — 2/3 for some k, then k — 4 and Lemma 5 Suppose T\ is a 3-regular subtree of T
3D is a 'parallelogram. which has f leaves. Then

Proof. To begin with, we first assume that the bound-


*(Ti)<|(/-l).
ary 3D of unit disc D is strictly convex and differen-
tiable. Thus, we can apply the results of the preceding Proof. Assume that
section.
Assume that the theorem is false. Let n denote the
*m)>f(/-i)
least value so that pn{D) < 2/3. Thus, n is a jump for some subtree T\ and suppose that Tj has r leaves
value. By Lemma 3 there exists a critical set P of size which are regular points. Then the removal of T\ re-
n such that sults in f — r subtrees. Suppose that they interconnect
Ls(P) < 2
sets of rii, n2, • • •, n/-r regular points, respectively.
LM(P) 3'
Then ni + n2 + ■ ■ ■ + nj-r = n — r and
that is,
LS{P)
Ls{P)<2-LM{P) = -z{n-l). (1)
> §(m - 1) + |(n2 -!) + ••■+ !(ny_r - 1) + £(T\ ]
Let T be a minimum Steiner tree on P which witnesses > i(n-f) + Uf-i)
the criticality of P. We first establish some properties = !("-!).
of T.
which contradicts (1). Ü
Lemma 4 T is a full Steiner tree and every edge of
T has length less than 2/3. Let us call a path ASiS2 ■ ■ ■ SiB joining two adja-
cent regular points A and B in T monotone if it is
Proof. If T is not a full Steiner tree, then we can
either a clockwise or counterclockwise path from A to
decompose it into two edge-disjoint subtrees T\ and
B. We will say that S\ can be legally moved to A if
T2 which are Steiner trees on point sets P\ and P2,
i > 3 and the subpath SiS2Ss can be removed from T
respectively, where Pi U P2 = P and each Pi has size
(disconnecting it into three subtrees) and replaced by
less than n. Thus, by the minilality of n,
a parallel translate S[S2S'3 with S[ located at point
Ls{P) = LS(P1) + LS(P2)>^LM(P1) + ^LM(P2) A so that S^S^Ss intersects S3 • ■ -SiB. Thus, the two
subtrees containing A and B, respectively, are recon-
> \LM{P), nected by S[S'2S'3.

185
Lemma 6 Let AS1S2 ■ ■ SiB be a monotone path in Suppose that Si can be legally moved to both A and
T connecting two regular points A and B. Suppose B. Then from these two movements, we can obtain a
that Si cannot be legally moved to A. Draw a line tree of total length at most £(T) +£(S\S2), which can
through B, parallel to AS\, and intersecting the sub- be decomposed at A and B (see Figure 3). Thus,
path S1S2S3 at B'. Then

£(AS1S2S3) + £(S2S3) - £{BB'S2) > 1. (2) AQ

Proof. Since Si cannot be legally moved to A, we have


l(BB') < £(ASi). If B' is on the segment S1S2 (see BÖ
Figure 2(a)), then

(£(ASi) - £(BB')) +£(S1B') > £(AB) = 1,


Figure 3:
that is,
£(ASlS2)-£(BB'S2) > 1.
£{T) + *(SiS2) > -(n - 2) + i(ASiB).
Thus, (2) holds.
By Lemma 5,

£(AS,B)-re(SxS2)<

Therefore,

*(T) > -(n-2)+e(AS1B)-e(S1S2)


(a) (b)

> ^(n-4) + 2£(AS1B)


Figure 2:
> f(n-l),
On the other hand, if B' is on the segment S2S3
(see Figure 2(b)), then contradicting (1).
Suppose now that Si cannot be legally moved to
(£(ASi) - £(BB')) + £(S1S2B') > £{AB) = 1, either A or B. Let C be the regular point adjacent to
that is, A, other than B, and D the regular point adjacent to
B, other than A. By Lemma 6,
HAS&B') + £{S2B') - £{BB'S2) > 1.
^SiS2S3) + £(S2S3) - £(CC'S2) > 1, (3)
Thus, (2) also holds in this case, and the lemma is ^BS^S-tS^ + £(S2S4) - £(DD'S2) > 1, (4)
proved. D
where C and D' are two points defined in the lemma.
It is easy to see that (2) still holds if £{AS\) = Let T" be the 3-regular subtree interconnecting A, B,
£{BB'). S3 and S4. Adding (3) and (4), we obtain

Lemma 7 Suppose S\ is a Steiner point in T adja- 2£(T') - l(ASiB) - £{CC'S2D'D) > 2,


cent to two regular points A and B. Then S\ can be
that is,
legally moved to exactly one of A or B.
CH > 1 + \{£{ASlB) + £{CC'S2DlD)) > 2,
Proof. Let 52 be the Steiner point adjacent to Si and
let S3 and S4 be the two vertices adjacent to S2- contradicting Lemma 5. Ü

186
We now complete the proof of the first part in the Let T" be the 3-regular subtree interconnecting A, B,
theorem. By Lemma 2, there are two possible local S4 and S2. By (5) and (6),
structures we need to consider. We first consider the
1{T') = l(ASiB) + ^(SiS3S2) + £(S3S4) > 2,
local structure shown in Figure 1(b). Then there exists
a Steiner point S3 adjacent to two Steiner points Si contradicting Lemma 5.
and S2 each of which is adjacent to two regular points, Next, we consider the local structure shown in Fig-
say A and B are adjacent to Si, and C and D are ad- ure 1(a), i.e., there exists a Steiner point S2 adjacent
jacent to S2- Let S4 be a vertex adjacent to S3. (See to a Steiner point Si and a regular point C such that
Figure 4.) We first observe that if £(BSr) = £{CS2) Si is adjacent to two regular points A and B. Let S3

B O EJO--

Figure 4: Figure 5:

then, whether or not Si can be legally moved to A, we be the vertex adjacent to S2, other than C and Si.
obtain a contradiction by using the argument given in We claim that
the proof of Lemma 7. Thus, without loss of general-
ity, we can assume that £(BSi) > £(CS2), i.e., Si can- £(S2S3) < tiBSi). (7)
not be legally moved to B. Then by Lemma 6, Si can
In fact, if £(S2S3) > £(BSi), then considering the 3-
be legally moved to A (see Figure 4). This movement
regular subtree T", interconnecting A, B, C and S3,
results in a tree of length at most £(T)+£(S3S4), which
we would have
can be decomposed at A into the subtree AS\B and
a subtree interconnecting n — 1 regular points other £{T') > £{BS1S2C) + £{ASXB) > 2,
than B. Thus,
contradicting Lemma 5. Now, let E be the adjacent
l(T) + £(S3Si) > l(n-2) + £(ASxB) > H(„_i) + I. regular point of A other than B and let AS\ ■ ■ ■ Sk E
be the monotone path connecting A and E. From
Since £{T) < |(n — 1), we have the definition of a critical set, it is easy to see that
£(AE) = 1. Let B, Eu E2, ■■■, E5 be all the lattice
1
£(S3S4) > (5) points with distance exactly one to A (see Figure 5).
Then E G {EU---,E5}. Since £{AC) < £{AB) +
Moreover, by Lemma 4, £(BSi) < § and £{DS2) < §. £(BC) = 2, C is identical to either E\ or a lattice
It follows that point which forms an equilateral triangle with B and
Ei (see Figure 5).
£{CS2) = £{CS2D) - £{DS2) > \.
Suppose that E' is a point on the path S1S2S3 such
Note that by Lemma 6, that EE' is parallel to AS\. If E is at E\, then E1
must be on S2S3 and £(S2E') = £(BSi). It follows
£(BS1S3S2)-£(CS2)> 1. that
£{S2S3)>£(S2E')^£(BSl),
Thus,
contradicting (7). The similar argument can be ap-
£(SlS3S2)>l + £(CS2)-£(BS1)>-. (6) plied to the case that E is at E2.

187
If E is at E3, then it is easy to see k > 4. Let
E" be a point on 52 5354 such that EE" is parallel to
5i52. Extend BSi to F so that EF is parallel to ASi.
Since £{BE) = 2£(BA), we have £{EF) = 2£{ASi)
and £(SiF) = t(BSi). Let F' be a.point on the path
S2S3S4 so that FF' is parallel to 5i52. If F' is on the
segment 52 53, then

£(S2S3)>£(S1F) = £(BS1),
Moreover,
contradicting (7). If F' is on the segment 5s54, then
£(T') - £{AGF)
£(S3S4) > £(EF) = 2£(ASX)
> £(T') - (£(S2S3) + £(S3S4) - t{AS!))
> 2(£(AB) -£(AS1))> 2(1 -\) = \,
> £(AS1B) + £(ASlS2C)-£(S3S4)
contradicting Lemma 4. 2-H = l.
>
3 3
Therefore,

£(T) > |(n - 3) + £(T') - £(AGF) > |(n - 1),

contradicting (1). This completes the proof of the first


part of the theorem for strictly convex and differen-
B O Oc tiable 3D.
When 3D is not strictly convex or not differen-
Figure 6: tiable, we can use a sequence of strictly convex and
differentiable ones to approach it from its interior. For
If E is at £4 or E5, then the extension of S\ A must each norm in the sequence and for any point set P, we
intersect the monotone path AS\ ■ ■ -SkE. This im- know that
plies that any line between ASi and 5s54 and parallel (8)
LS{P)>-LM(P).
to them must intersect the path AS\ ■ ■ -SkE. Draw
Since Ls(P) and LM{P) are continuous functions with
the parallelograms S1S2S3H and AS\HG and extend
respect to the norm for fixed P, then letting the se-
EG until it intersects the path AS\ ■ ■ -SkE, say at F.
quence go to its limit, we see that (8) holds for the
(AG cannot intersect the path ASi ■ ■ -SkE since oth-
(arbitrary) limiting norm. This completes the proof
erwise, removing S2S3 and adding AG would result in
of the first part of the theorem.
a tree of length at most £(T) which does not satisfy
Next, we show the second part of the theorem. Be-
the condition in Lemma 1 at the intersection of AG
fore doing so, we establish three lemmas.
and the path AS\ ■ ■ -SkE). Then FHS3S4 is also a
parallelogram. It is easy to see that Lemma 8 Let A\A2 ■ ■ ■ An be a path and let OBij
be the unit vector starting from the origin O along
£(GF)<£(S3S*)-e(ASi).
directions AiAj. If £(AiA2 ■ ■ ■ An) = £(AiAn), then
Let T' be the 3-regular subtree interconnect- the straight-line segment Bi2Bn-itn is part of 3D.
ing A, B, C and 53. Consider the tree
(T\T')UAGF which interconnects n—2 regular points. Proof. We prove that all Bij, i < j, are on the same
Then, straight line. The lemma is a consequence of this fact.
First, consider n = 3. Draw the parallelo-
£{T) - £{T') + £(AGF) > \{n - 3). gram Ai^^S. Without loss of generality, assume
o

188
e(AiA2) > £(AXB) = e{A2A3)- Let C be a point
on AXA2 such that ^A^C) = £(AxB). Let E be the
intersection point of BC and A\A3- Draw line ^.ff
parallel to BC and intersecting A\A3 at # (see Figure
8). Then
i(A1E)=£(HA3) Figure 9:

£{AXA2)
£(AlH) = £(A1E) i, j and k, Bij, Bjk, and 5^ are either all distinct or
1{MC) ' all identical. It follows that all Bij for 1 < i < j < 4
Thus, are collinear.
Now consider n > 4. Note that £(A\A2 ■ ■ ■ An) =
t{A^A3) = £(A1H) + £(HA3)
£(A1A2) £(A1An) implies that for 4 < j < n, £{AxA2A3Aj) =
= £(A1E)(1 + £(AiAj) and for 3 < j < k < n, £{AiA2AjAk) =
£{AXC)
£{AxAk). Therefore, for 4 < j < n,
- «**>(i+££}>• Bi2,B23,Bi3,Bij,B2j and B3j are collinear
Since
and for 3 < j < k < n,
£{AXA3) = £(AXA2A3) = ^2^3)(1 + |^j).
Bi2,Bij,B2j,Bik,B2k and Bjk are collinear.
we have
It follows that all Bij for 1 < i < j < n are collinear.
£(AXE) = £(A2A3) = £(AXB) = /(^C). D

This means that quadrilateral A\CEB is similar to Lemma 9 p4{D) = 2/3 iff dD is a parallelogram..
quadrilateral OB\2B\3B23. Therefore, Bx2, B23 and
£?i3 are collinear. In addition, B\3 lies between B\2 Proof. Note that for any D,
and ß23-
P3(D) > 3/4.

Suppose PA{D) = 2/3. Thus, 4 is a jump value. Con-


sider F = {(A,B,C,E) I LM(A,B,C,E)= 1}. Since
LM(A, B,C, E) is continuous with respect to A, B,
C and E, then F is a compact set in 8-dimensional
Figure 8: space. Clearly,

Next, consider the case n = 4. Note that Pi(D)= inf LS(A,B,C,E).


(A,B,C,E)eF
£(AiA2A3A<i) = £(AXA4) implies that £{AXA2AA) =
£(AiAi) because Since Ls(A, 5, C, E) is also continuous with respect to
A, B, C, and E, there exists a point set {,4, B, C, E}
£{AXA2A3AA) > t(AiA3) + £(A2A4) > £{AXAA). such that

From the case n — 3, 5i4 is in the segment [Bi2, B24\. 2/3 = P4(D) = LS(A, B, C, E)/LM(A, B, C, E). (9)
Similarly, B14 is in the segment [Bi3,B3i], Bx3 is in
the segment [.612,523]i anc^ -^24 is in the segment Note that the minimum Steiner tree T for this point
[^23,534] (see Figure 9). Note that all 5,-j's are on set must be full because 4 is a jump value. Suppose
dD, a boundary of a convex region. Moreover, for any that A, B, C and E are arranged in the order as shown

189
Now, suppose to the contrary that dD is not a par-
allelogram and Pk{D) = 2/3 for some fixed value of
k. By Lemma 9, PA{D) > 2/3. Thus, there ex-
ists k', 4 < k' < k, such that pk>-\(D) > 2/3 and
Pk'(D) = 2/3. Let P be a set of k' points such that
Ls(P)/'LM(P) = 2/3. Then every minimum Steiner
Figure 10:
tree for P is full. By Lemma 10, we can choose a
sequence of norms D' with strictly convex and dif-
in Figure 10. Let pxy denote the path from X to Y ferentiate boundary such that pk'-i(D') < pk<{D').
in T. We claim that the So, the minimum Steiner tree T(D') for P under each
norm D' is still full. By Lemma 1, every T(D') is
t(pAB) = t(AB), (10)
3-regular and satisfies the condition that all edges of
£(PCB) = £(CB), (11) T(D') lie in three directions. Since the number of
KJPCE) = 1{CE), (12) 3-regular trees with k' leaves is finite, there is a subse-
£{PAE) = t(AE). (13) quence of {T(D')} which converges to a 3-regular tree
and satisfies the same condition. It is easy to see that
In fact, if one of them does not hold, then this tree must be a minimum Steiner tree for P under
the norm || • ||D. By the argument used in the proof
£{AB) + £(CB) + £(CE) + £{AE)
of Du and Hwang [7], it follows that P is a critical
< £(PAB) + KPCB) + £{PCE) + £{PAE) = 2£{T). set. Now, by using the argument in the proof of the

So, first part of the theorem, taking special care of the


cases in which equality holds in various inequalities,
4LM(A,B,C,E) we eventually obtain a contradiction. This completes
< 3(£(AB) + £(CB)+£(CE)+£(AE)) the proof of the second part of the claim and the proof
is complete. O
< 6£(T) = 6LS(A,B,C,E),

contradicting (9). By Lemma 8 and (10)-(13), dD


must be a parallelogram. D 4 Discussion
Lemma 10 Let d(dD, dD') denote the maximum Eu- We conjecture that for any norm || • \\D, there exists k
clidean distance between the two intersections of a ray such that Pk(D) = p(D). A consequence of this con-
from the origin with dD and dD'. Then for any 8 > 0 jecture is that p(D) = 2/3 iff dD is a parallelogram.
and k, there exists e > 0 such that d(dD,dD') < e The proof techniques used in this paper are different
implies \pk{D) - Pk(D')\ < 6. from those in Hwang [13] for proving 2/3 as the Steiner
ratio of the rectilinear plane. Graham and Hwang [12]
Proof. Consider any set of k points as a point in conjectured that m-dimensional rectilinear space has
2£-dimensional space. Let Q be the point set in 2k- the Steiner ratio m/(2m — 1). Although the methods
dimensional space consisting of "points" each of which in [13] do not seem to be applicable to proving this
is a set of k points in the plane with a Euclidean mini- conjecture, perhaps the ideas we use here will be of
mum spanning tree of length one. Then Q is a compact some help. We hope to consider this in the near future.
set. In addition, it is easy to see that for any D,

Ls(P)
pk(D) = inf
Pen LM{P)'
References
Thus, Pk(D) is continuous with respect to D. O [1] M. Alfaro, M. Conger, K. Hodges, A. Le

190
R. Kochar, L. Kuklinski, Z. Mahmood and K. [13] F.K. Hwang, On Steiner minimal trees with rec-
von Haam, The structure of singularities of $- tilinear distance, SIAM J. Appl. Math., 30 (1976)
minimizing networks in R2, Pac. J. Math., 149 104-114.
(1991) 201-210.
[14] G. Lawlor and F. Morgan, Paired calibrations ap-
[2] G.D. Chakerian and M.A. Ghandehari, The Fer- plied to soapfilms, immiscible fluids, and surfaces
mat problem in Minkowski space, Geometriae or networks minimizing other norms, preprint
Dtdicata 17 (1985) 227-238. (1991).

[15] Z.C. Liu and D.Z. Du, On Steiner minimal trees


[3] D. Cieslik, The Steiner ratio of
with Lp distance, Algorithmica, 7 (1992) 179-191.
Banach-Minkowski planes, Contemporary Meth-
ods in Graph Theory (ed. R. Bodendiek), (BI- [16] Z.A. Melzak, Companion to Concrete Mathemat-
Wissenschatteverlag, Mannheim, 1990) 231-248. ics, Vol II, Wiley, New York, 1976.

[4] E.J. Cockayne, On the Steiner problem, Canad. [17] D. Sankoff and P. Rousseau, Locating the ver-
Math. Bull. 10 (1967) 431-450. tices of a Steiner tree in an arbitrary metric space,
Math. Program., 9 (1975) 240-246.
[5] D.Z. Du, On Steiner ratio conjectures, Annals of
Operations Research, 33 (1991) 437-449. [18] M. Sarrafzadeh and C.K. Wong, Hierarchical
Steiner tree construction in uniform orientations,
[6] D.Z. Du, B. Gao, R.L. Graham, Z.-C. Liu, and P.- unpublished manuscripts.
J. Wan, Minimum Steiner trees in normed planes,
[19] J.M. Smith and M. Gross, Steiner minimal trees
to appear in Discrete and Computational Geom-
and urban service networks, J. Socio. Econ.
etry.
Ping., 16 (1982) 21-38.
[7] D.Z. Du and F.K. Hwang, A proof of Gilbert-
Pollak's conjecture on the Steiner ratio, Algorith-
mica 7 (1992) 121-135.

[8] D.Z. Du and F.K. Hwang, Reducing the Steiner


problem in a normed space, SIAM J. Computing,
21 (1992) 1001-1007.

[9] M.R. Garey, R.L. Graham and D.S. Johnson, The


complexity of computing Steiner minimal trees,
SIAM J. Appl. Math., 32 (1977) 835-859.

[10] M.R. Garey and D.S. Johnson, The rectilinear


Steiner tree problem is NP-complete, SIAM J.
Appl. Math., 32 (1977) 826-834.

[11] E.N. Gilbert and H.O. Pollak, Steiner minimal


trees, SIAM J. Appl. Math. 178 (1968) 1-29.

[12] R.L. Graham and F.K. Hwang, Remarks on


Steiner minimum trees, Bull. Inst. Math. Acad.
Smica, 4 (1976) 177-182.

191
Bounding the Number of Geometric Permutations
Induced by /c-Transversals

Jacob E. Goodman*
Richard Pollackj
Rephael Wenger*

Abstract sects them. An undirected line transversal in-


duces a pair of orderings on A corresponding to
We prove that a (fc-l)-separated family of n com- the two orientations of the line. Such a pair of
pact convex sets in Rd can be met by &-trans- orderings induced by a line transversal is called
versals in at most 0{df (f^-2)^))^"^ a geometric permutation of the set A.
or, for fixed k and d, 0{nk(k+lXd-V) different A generalization of the concept of line trans-
order types. This is the first non-trivial bound versal is a k-transversal, a flat, or affine subspace,
for 1 < k < d- 1. of dimension k that intersects every member of
A. The family A is k-separated [6] if no subset of
A of size greater than k + 1 has a Ä:-transversal.
Introduction Equivalently, A is ^-separated if every family of
j sets of A can be strictly separated from ev-
Let A be a family of n compact convex sets in ery disjoint family of k + 2 - j sets of A by a
R . A line transversal of the family A is a line hyperplane.
that intersects every member of A. If the sets If A is (&-l)-separated, then each oriented k-
in A are pairwise disjoint, then a directed line transversal / induces an "ordering" on A as fol-
transversal induces a linear ordering on the sets, lows. For each convex set a £ A, choose a point
determined by the order in which the line inter- Pa G / H a. The order type of the set of points
"PA = {Pa | a € A} is the family of orientations of
*City College, City University of New York, New York,
NY 10031, U.S.A. (jegcc@cunyvm.cuny.edu). Supported all the ordered (& + l)-tuples from VA- Because
in part by NSF grant DMS91-22065 and by NSA grant A is (Ä-l)-separated, the order type of VA is
MDA904-92-H-3069. independent of the choice of pa. This order type
'Courant Institute of Mathematical Sciences, New represents the order in which / meets the mem-
York University, New York, NY 10012, U.S.A. (pol-
lack@geometry.nyu.edu). Supported in part by NSF grant
bers of A. An unoriented fc-transversal induces a
CCR91-22103 and by NSA grant MDA904-92-H-3075. pair of order types on A corresponding to the two
J
Ohio State University, Columbus, OH 43210, U.S.A. orientations of the ^-transversal. Such a pair of
(wenger@cis.ohio-state.edu). Supported in part by NSA orderings is also known as a geometric permuta-
grant MDA904-93-H-3026 and by the NSF Regional
tion of the set A. A more complete discussion of
Geometry Institute (Smith College, July 1993) grant
DMS90-13220. ^-transversals and geometric permutations can
Permission to copy without fee all or part of this material is be found in the survey paper [6].
Granted provided that the copies are not made or distnbuted for What is the maximum number of geomet-
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given ric permutations induced by ^-transversals for
that copying is by permission of the Association of Computing a (&-l)-separated family of n compact convex
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. sets in Ud1 For line transversals in the plane,
10th Computational Geometry 94-6/94 Stony Brook, NY, USA the answer, due to Edelsbrunner and Sharir (see
© 1994 ACM 0-89791-648-4/94/0006..$3.50 [4]), is 2n - 2. In higher dimensions, much less

192
is known. Clearly the number of geometric per- coordinates of X{. For every partition of P into
mutations is at most the number of order types an ordered pair (P',P") of non-empty subsets,
of n points in Rk, which is choose some oriented hyperplane separating P'
from P" with normal vector vpi pointing toward
(")fcMl+0(l/log(n/fc))) _ ^
for n/k
P'. Let H be the set of these 2d+1 - 2 separat-
K
ing hyperplanes and let N be the corresponding
by results of [5]. Katchalski, Lewis, and Liu give set of unit normal vectors. The orientation of an
a lower bound of fi(nd_1) for line transversals ordered d-tuple of vectors in N is the sign of the
in Rd [7], while Wenger gives an upper bound determinant of the d vectors taken in order as
of 0(nM~2) for the same problem [9]. For k- the rows of a d x d matrix. The order type of
transversals in Rd only the trivial lower bound N is the correspondence between these d-tuples
of fl(nd~k), which follows immediately from the and their orientation. There are many choices
results of [7] by "lifting", is known. Cappell et for H, giving rise to sets N with many different
al. give a bound of 0{nd~1) for the number of order types. Neverthess, we shall show that the
geometric permutations induced by hyperplane order type of N determines the orientation of P.
transversals of families of compact convex sets First, notice that dropping just two normal
[3]. This paper gives the first polynomial (in vectors from N may make it impossible to deter-
n) bound, 0{nk(k+1Hd-k)), for arbitrary k and mine the orientation of P from the order type on
d (Theorem 2). N. Choose any partition of {1,..., d} into non-
The main new idea that we use to obtain this empty subsets I' and I", and let / be a (d— 1)-
polynomial bound is the following result, which flat in R . It is possible to place d + 1 points
may be of independent interest. R = xi,..., Xd+i in / so that any partition other
The orientation of a labeled set S, of d + 1 than the one corresponding to R' = {xi | i £ I'}
points in Rd is determined by any set of 2d+1 - 2 and R" = {xi \ i 6 I"} can be realized by split-
vectors vp such that for each non-empty proper ting the point set with a (d-2)-flat in /. Con-
subset P C S, vp is the unit vector normal to struct all such splitting (d-2)-flats and extend
some hyperplane separating P from its comple- them to oriented hyperplanes in Rd to generate
ment S \P and pointing toward P. This fact is a set H consisting of 2d+1 - 4 separating hyper-
not as transparent as it appears and constitutes planes. Moving one of the d + 1 points above or
Theorem 1. below / gives us two (d-f-l)-tuples of points, P
We would like to express our gratitude to and Q, in general position. The set H separates
Marie-Fran$oise Roy for bringing to our atten- each of P and Q in the same 2d+1 - 4 distinct
tion the embedding of the real Grassmannian ways, yet P and Q have opposite order types.
Gfc?(f in R^ which we use in the proof of The- The two missing hyperplanes separating points
orem 2 in place of the more familiar embedding corresponding to R' and R" provide crucial in-
in F$U) using Plücker coordinates. This embed- formation about the orientations of P and Q.
ding has the effect of simplifying the presentation Assume now that H is a set of 2d+1 - 2 ori-
of the argument and of making the bound singly ented hyperplanes separating a (d+l)-tuple P as
rather than doubly exponential in k. described above, and let N be the set of unit nor-
mal vectors of H. Associate the zth member of
P with the ith vertex of the standard d-simplex
Determining Orientation from Ad in Rd, whose vertices in canonical order
Separation are (0,0,...,0), (1,0,...,0), (0,1, 0,.. .,0),...,
(0,...,0,1). Notice that the orientation of the
Let P = {«i,..., Xd+i} be a labeled set of d + 1 vertices in this order is positive. Using N we con-
points in general position in Rd. The orientation struct a map </>N from dAd, the boundary of the
of P is the sign of the (d + 1) x (d + 1) determi- standard simplex, to the unit sphere Sd_1 C Rd.
nant whose ith row consists of 1 followed by the Let K be the boundary complex of Ad, and L

193
the baxycentric subdivision of K. Each (closed) this hyperplane to pass through q* and orient it
face K in K is associated with a vertex wK in L. with normal pointing toward Q'. Let H*(Q) and
K contains a set D' of vertices of K and misses N*(Q) be this canonical set of hyperplanes and
another set D". Let P' and P" be the subsets their normal vectors, respectively.
of P associated with D' and D", respectively. We first show that the degree of <J>N equals the
Define 4>N(WK) to be the unit normal vector of degree of <f>N*tPy The set H of separating hyper-
the oriented hyperplane separating P' and P" planes can be continuously transformed to the
with normal pointing toward P'. Extend this canonical separating set H*{P). Let Ht denote
map in each face of the barycentric subdivision the intermediate sets of separating hyperplanes
by mapping each point x = ^aKwK, ]£ aK = 1, where 0 < t < 1, H0 = H, and Hx = H*(P). Let
aK > 0, to the vector ^ O,K<J>N{WK)- Nt be the set of normals of Ht.
Every (d-l)-simplex A of L contains a unique Since the normals in Nt vary continuously with
vertex v' of Ad and lies on a facet of Ad op- the separating hyperplanes, for each vertex wK of
posite another vertex v" e Ad. Let h be some the barycentric subdivision the image <j)Nt{wK)
hyperplane perpendicular to the line through the must vary continuously as a function of t. Hence
points p',p" e P corresponding to v',v" (resp.) for any point x = ^aA, the convex combi-
and separating p' from p". For each vertex w of nation Y,aK4>Nt{wK,) also varies continously as a
A, the vector </>AT(W) points away from the half- function of t, and the same holds for its nor-
space bounded by h containing p" and toward malization <f>Nt(x). Hence the degree of <]>Nt is
the half-space containing p'. Thus all the vec- a constant that does not change with t, and, in
tors (J>N(W) must he in an open half-space and so particular, the degree of 4>N = ^iV0 equals the
J2aK<j>N(wK) is never 0. Normalize J2aK<t>N{wK) degree of <f>N*(P) = <t>Ni-
to map a; to a point 4>N(X) on Sd_1. Let Vd be the set of vertices of Ad in canonical
The resulting mapping, ^N '■ dAd -► Sd_1, has order. It is easy to check that the map 4>N*{yd)
a well-defined degree, which is (intuitively) the is a homeomorphism of dAd to the unit sphere
algebraic number of times 4>N wraps dAd around and has degree +1. We show that the degree of
Sd_1. For basic facts about this degree, see for 4>N*IP) equals the degree oi<f>N*(yiy
example [8]. Since P and Vd have the same positive ori-
entation, we can continuously move the points
Lemma 1 Let P be a (d+l)-tuple of points in
in P to the corresponding points in Vd, keeping
general position in Ud> let H be some set of sep-
them in general position; this can be shown, for
arating hyperplanes for P, and let N be the set
example, by an easy inductive argument. Let
of normals of H. The map (f>N has degree +1 if
Pt denote the intermediate sets of points where
the orientation of P is positive and degree -1 if
0 < * < 1, -Po = P, and Pi = Vd. The sets
the orientation of P is negative.
H*(Pt) and N*(Pt) are also continuous func-
Proof: If P has negative orientation then we tions of t. As argued above, this implies that
(>
may reflect it and the hyperplanes in H, say by t N*(Pt) 1S a continuous function of t. Thus the
reversing the sign of the first coordinate. Reflec- degree of ^»(p) = <?W*(F0) equals the degree of
<>
tion reverses both the orientation of P and the l N*(vd) ~ <f)N*(Pi)j which is +1. Since the degree
sign of the degree of the mapping <f>N- Thus we of 4>N equals the degree of<f)N*(p), the orientation
D
may assume that P has positive orientation. of P matches the degree of 4>N-
For any (d + l)-tuple Q of points in general
Lemma 1 establishes that the orientation of P
position in Rd we define the following canoni-
depends upon the degree of <f>N- We now show
cal separating set. Let q* be the barycenter of
that the degree of <j>N depends only upon the
the simplex whose set of vertices is Q. For ev-
order type of N.
ery partition of Q into sets Q' and Q" there is a
unique hyperplane containing Q' which is paral- Lemma 2 The order type of N determines the
lel to some hyperplane containing Q". Translate degree of </>JV •

194
Proof: As before, let K be the boundary com- of vi,.. .,Vd-i- But then, by the choice of e,
plex of the standard d-simplex, Ad, and L the it would follow that det(<j>N(wi),... ,Vd-i) = 0
barycentric subdivision of K. Let 0 be the set for each i, which would imply that <J)N(WO), ■ • ■,
of all unit vectors that are linear combinations <J>N{W<1-\) are linearly dependent, contrary to the
of d - 1 or fewer vectors of JV. Choose any point choice of the simplex A.
y' on the unit sphere that is not contained in 0. Partition the (d-l)-simplices of L whose image
Since the degree of <J>N is +1 or — 1, the point contains y into those whose orientation is pre-
y' = </>N(x') for some point x' on dAd. Point x' served and those whose orientation is reversed
lies in the interior of some [d— l)-face A of L. Let by <^>JV. The degree of (f>N is then the number of
WQ,WI,..., Wd-i be the vertices of A. the former minus the number of the latter (see
For any d vectors vi,..., Vd, let det(x>i,..., vj) [8], for example). The simplices whose image
represent the determinant of the matrix with the contains y are determined by the order type of
vectors V{ (in that order) as rows. Choose an JV U {y}, as is their orientation. Thus the degree
e > 0 such that of fa is determined by the order type of JV. D
1 \det(vi,V2,...,Vd)\
We have therefore proved:
d\det(v[,v'2,...,v'd)\
for all Vi,Vi € JV where det(vi,.. .,Vd) ^ 0 and Theorem 1 The orientation of a (d+l)-tuple P
det(v'1,...,v,d)?0. Let^ = l/(l+e+--- + ed-1), of points in general position in R is determined
x - n{wQ + ewx-{ \-ed~1wd-\),arLdy = <I>N(X)- by the order type of the normal vectors to any
We claim that the order type of JV U {y} is de- set of oriented hyperplanes separating each non-
termined by the order type of JV. Let V\,..., Vd-i empty subset of P from its complement.
be a set of d — 1 vectors in JV. The orienta-
tion of the (f-tuple (y, vx,..., Vd-i) is the sign of
det(y, vi,..., Vd-\). If the vectors Vi are linearly Bounding the Number of Geo-
dependent, then the orientation of the d-tuple metric Permutations
(y, v\,..., Vd-i) is zero. Assume the t>; are lin-
early independent. By definition, Let A be a (k—l)-separated family of n compact
convex sets in Rd. For every subset A' of size
<t>N(x) k + 1, choose a family EJJ of 2fc+1 - 2 oriented
= v(<f>N(w0) + e<fov(wi) + • • • + ed_Vjv(wd_i)), separating hyperplanes for A', and let JV4/ be
the set of unit normals to the members of HA .
where v is chosen so that ||^(«)|| = 1. Thus
Let HA and JV4 be the sets of all the chosen
det(j/,ui,...,u<i_i) hyperplanes and normal vectors, respectively.
d-l For each oriented ^-transversal /, let fC\A and
= v£Vdet(<for(«>i),t;i,...,Vd-i). /nHj. represent the sets obtained by intersecting
»=o / with the sets in A and with the hyperplanes in
By our choice of a suitably small e, the sign HA, respectively. Notice that / meets each sep-
of this sum is determined by the sign of the arating hyperplane transversally. Let Mf be the
first non-zero term, el det(^(wi),ui,... ,Vd-i), d X d matrix which in the standard basis repre-
in this sum. The vectors <f>^(wi), v\,..., Vd-i are sents orthogonal projection onto /o, the oriented
all in JV and so the order type of JV determines k-dimensional subspace of Rd parallel to /. No-
the sign of det((f>N(wi),vi,.. .,Vd-i)- Thus the tice that Mf is symmetric, idempotent and has
orientation of every d-tuple in JV U {y} is com- trace fc. In fact, such matrices are in one-to-
pletely determined by the orientation of the d- one correspondence with the k-dimensional sub-
tuples in JV. spaces of Rd, which make up the real Grassman-
Notice that y £ 0. For otherwise, we would nian Gk,d- This Grassmannian is an algebraic
have det(y,vi,...,Vd-i) = 0 for some choice variety in R^ of dimension k(d — k), defined by

195
polynomials of degree at most 2 (see [2] for more geometric permutations.
details). Let f(V) be the orthogonal projection
of any set V of vectors in Rd onto /0. Represent-
ing V as the columns of a d X |V| matrix, we see Conclusion
that f(V) is then represented by the columns of
In this paper we have generalized arguments
MfV. Notice, too, that f(Nj) is a set of normals
given in [9] for bounding the number of geo-
to / n HA.
metric permutations of line transversals in Rd.
By Theorem 1, two oriented fc-transversals, /
If we pay attention only to the dependence on
and /', generate the same order type on A if for
n, the 0(nfc(fc+1)(d~fc)) bound given here matches
every (fc-fl)-subset A' the orientation of every
the one in [9] when k — 1. Better bounds are
fe-tuple in f(N^i) and of the corresponding k-
known for the special cases of line transversals
tuple in f'(N^i) is the same. Let F be a it-
in the plane (0(n)) and of hyperplane transver-
tuple of N^i. The orientation of f(V) is zero
sals in Rd (O^-1)) [3, 4, 9]. We suspect that
if and only if Mf(V) has rank < k, and this
the number of geometric permutations for fe-fiats
will be true if and only if the maximal minors
is at most 0(nki-d-^).
of Mf(V) are all zero. Let gy be the sum of
the squares of these maximal minors, gy is a
polynomial of degree 2d in the d2 indeterminates References
■"li, • • -Udd, the coordinates of a generic point of
Rd . By continuity, two fc-transversals / and /' [1] BASU, S., POLLACK, R., AND ROY, M.-F.
meet A' in the same order type if the subspaces On the number of cells defined by a fam-
corresponding to Mf and My can be connected ily of polynomials on a variety. In Algorith-
in Gk,d without meeting the zero set of gy for mic Foundations of Robotics, K. Y. Goldberg,
any ^-element subset V of NAi. D. Halperin, J.-C. Latombe, and R. H. Wil-
Each fc-subset V of NA> determines such a son, Eds. A. K. Birkhauser, Boston, to ap-
polynomial gy of degree 2d in R[un,... ,udd\- pear.
There are ( fc J such polynomials for each of [2] BOCHNAK, J., COSTE, M., AND ROY, M.-
the (^"J subsets A' of A of size k + 1, giving a F. Geometrie algebrique reelle. Springer-
total of
Verlag, Heidelberg, 1987.
(2k+i _ 2
s = [3] CAPPELL, S. E., GOODMAN, J. E., PACH,
J., POLLACK, R., SHARIR, M., AND WENG-
polynomials. In [1] it is shown that the number ER, R. The combinatorial complexity
of connected components of all non-empty sign of hyperplane transversals. In Proc. 6th
conditions (and hence in our case of the number Ann. ACM Sympos. Comput. Geom. (1990),
of connected components on Gj.^ of the comple- pp. 83-91.
ment of the zero set of these s polynomials) of
[4] EDELSBRUNNER, H., AND SHARIR, M. The
5 polynomials in R[Xi,..., Xm], each of degree
maximum number of ways to stab n convex
at most dona variety of dimension m! defined
non-intersecting sets in the plane is 2n — 2.
by polynomials of degree at most d, is at most
Discrete Comput. Geom. 5 (1990), 35-42.
sm 0(d)m. Applying this bound to our polyno-
mials on the variety Gk,d, we have proved: [5] GOODMAN, J. E., AND POLLACK, R. Upper
bounds for configurations and polytopes in
Theorem 2 A (k—l)-separated family ofn com-
Rd. Discrete Comput. Geom. 1 (1986), 219-
pact convex sets in Rd has at most
227.
(2k+l _ N k(d-k)
2 71
dp [6] GOODMAN, J. E., POLLACK, R., AND
0(d)
vk + 1, WENGER, R. Geometric transversal the-

196
ory. In New Trends in Discrete and Com-
putational Geometry, J. Pach, Ed. Springer-
Verlag, Heidelberg, 1993, pp. 163-198.

[7] KATCHALSKI, M., LEWIS, T., AND LIU, A.


The different ways of stabbing disjoint convex
sets. Discrete Comput. Geom. 7 (1992), 197-
206.

[8] LEFSCHETZ, S. Introduction to Topology.


Princeton University Press, Princeton, 1949.

[9] WENGER, R. Upper bounds on geometric


permutations for convex sets. Discrete Com-
put. Geom. 5 (1990), 27-33.

197
Applications of the Crossing Number
Jänos Pach*
Dept. of Computer Science, City College-CUNY
and Courant Institute, NYU
Farhad Shahrokhi Mario Szegedy
Dept. of Computer Science, University of North Texas AT&T Bell Laboratories

Abstract & the answer is linear in n. (The cases when k < 3 had
been settled earlier by Hopf and Pannwitz [HF], Erdös
We show that any graph of n vertices that can be [E], Alon and Erdös [AE], O'Donnel and Perles [OP],
drawn in the plane with no k + 1 pairwise crossing and Goddard, Katchalski and Kleitman [GKK].)
edges has at most ckn\og2k~2n edges. This gives a In this paper we shall discuss the dual counterpart
partial answer to a dual version of a well-known prob- of the above problem. We say that two edges of G
lem of Avital-Hanani, Erdös, Kupitz, Perles, and oth- cross each other if they have an interior point in com-
ers. We also construct two point sets {pi,. ■ ■ ,pn}, mon. Let ek(n) denote the maximum number of edges
{?i> ■ • • i 9n} in the plane such that any piecewise lin- that a geometric graph of n vertices can have without
ear one-to-one mapping / : R2 —► R2 with /(p;) = qt containing k + 1 pairwise crossing edges. If G has no
(1 < i < n) is composed of at least fi(n2) linear pieces. crossing edges, then it is a planar graph. Thus, it
It follows from a recent result of Souvaine and Wenger follows from Euler's polyhedral formula that
that this bound is asymptotically tight. Both proofs
are based on a relation between the crossing number ex(n) = 3n - 6 for all n > 3.
and the bisection width of a graph.
It was shown in [P] that e2(n) < 13n3/2 and that, for
any fixed k,
1 Introduction ek(n) = 0{n2-lWk+1?).
A geometric graph is a graph drawn in the plane However, we suspect that ek(n) = 0(n) holds for ev-
by (possibly crossing) straight-line segments i.e., it is ery fixed k as n tends to infinity. We know that this
defined as a pair of (V(G), E(G)), where V(G) is a set is true for convex geometric graphs [CP] (a geomet-
of points in the plane in general position and E(G) is ric graph is convex if the nodes of the graph are on
a set of closed segments whose endpoints belong to the convex hall of the drawing). Our next theorem
V{G). brings us fairly close to this bound for arbitrary geo-
The following question was raised by Avital and metric graphs. (We remark that our proof works just
Hanani [AH], Erdös, Kupitz [K] and Perles: What is as well for drawings where the edges are arbitrary Jor-
the maximum number of edges that a geometric graph dan curves.)
of n vertices can have without containing Ar+1 pairwise
Theorem 1.1 Let G be a geometric graph of n ver-
disjoint edges? It was proved in [PT] that for any fixed
tices, containing no k + 1 pairwise crossing edges.
•Supported by NSF grant CCR-91-22103, PSC-CUNY Re- Then the number of edges of G satisfies
search Award 663472 and OTKA-4269.
\E(G)\<cknlog2k-2n,
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the with a suitable constant ck depending only on k.
title of the publication and its date appear, and notice is given The proof is based on a general result relating the
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee crossing number of a graph to its bisection width (see
and/or specific permission. Theorem 2.1). A nice feature of our approach is that
we do not use the assumption that the edges of G are
10th Computational Geometry 94-6/94 Stony Brook, NY USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

198
line segments. Theorem 1.1 remains valid for graphs minimum number of crossings can always be realized
whose edges are represented by arbitrary Jordan arcs by a drawing satisfying the following conditions:
with the property that no arc passes through any ver- (1) no two arcs meet in more than one point (in-
tex other than its endpoints. cluding their endpoints);
The same ideas can be used to settle the follow- (2) no three arcs share a common interior point.
ing problem. Let Ti and T2 be triangles in the plane,
We need the following result which is an easy con-
and let {pi,...,pn} and {31,..., qn} be two n-element
point sets lying in the interior of T\ and T2, respec- sequence of a weighted version of the Lipton-Tarjan
tively. A homeomorphism f from Xi onto T2 is a con- separator theorem for planar graphs [LT].
tinuous one-to-one mapping with continuous inverse. Theorem 2.1 Let G be a graph with n vertices of de-
/ is called piecewise linear if there exists a triangula- gree di,...,dn. Then
tion of T\ such that / is linear on each of its triangles.
The size of / is denned as the minimum number of 62(G)<(1.58)2(l6c(G) + £<f2j,
triangles in such a triangulation. Recently, Souvaine
and Wenger [SW] have shown that one can always find where b(G) and c(G) denote the bisection width and
a piecewise linear homeomorphism / : T\ —► T2 with the crossing number of G, respectively.
f(pi) = qi (1 < i < n) such that the size of / is Proof: Let if be a plane graph on the vertex set
0(n2). Our next result shows that this bound cannot V(H) = {vi,...,Vff} such that each vertex has a non-
be improved. negative weight w(vi) and 5Zi=1 «;(«,•) = 1. Let d(u,-)
Theorem 1.2 There exist a triangle T and two point denote the degree of v< in H. It was shown by Gazit
sets {pi,...,pn}, and Miller [GM] that, by the removal of at most
{<Zi> • • •. 9n} C int T such that the size of any piece- IN X1/2
wise linear homeomorphism f : T —* T which maps p,- 1.58 J^M
to qi (1 < i < n) is at least en2 (for a suitable constant k«=i
c>0). edges, H can be separated into two disjoint subgraphs
For some closely related problems consult [S] and Hi and #2 such that
[ASS].
2 «0("O>3 2 «>(»<)> 3-

2 Crossing number and bisection (See also [M] and [DDS].)


width Consider now a drawing of G with c(G) crossing
pairs of arcs satisfying conditions (1) and (2). Intro-
ducing a new vertex at each crossing, we obtain a plane
Let G be a graph of n vertices with no loops and
graph H with N = n + c(G) vertices. Assign weight 0
no multiple edges. For any partition of the vertex set
to each new vertex and weights of 1/n to all other ver-
V(G) into two disjoint parts Vi and V2, let E(Vx, V2)
tices. The above result implies that, by the deletion
denote the set of edges with one endpoint in V\ and
of at most
the other endpoint in V2. Define the bisection width
/ „ Xi/»
of G as
b(G) = min \E(VUV2)\,
1.58 16c(G) + yV2
i=l
edges, H can be separated into two parts Hi and H2
where the minimum is taken over all partitions
such that both of the sets Vi = V(HX) ("1 V(G) and
V(G) = Vi U V2 with |Vi|, \V2\ > n/3.
V{H2) PI V(G) have at least n/3 elements. Hence,
Consider now a drawing of G in the plane such that 2
the vertices of G are represented by distinct points and / „ y/
the edges are represented by Jordan arcs connecting 6(G) < \E{Vi,V2)\ < 1.58 I \Gc{G) + Y,d2\ ,
them with the property that no arc passes through a
vertex different from its endpoints. The crossing num- and the result follows. □
ber c(G) of G is defined as the minimum number of In the special case when every vertex of G is of
crossing pairs of arcs in such a drawing of G, where degree at most 4, Theorem 2.1 was established by
two arcs are said to be crossing if they have an in- Leighton [L] and it proved to be an important tool
terior point in common. It is easy to show that the in VLSI design (see [U]).

199
3 Geometrie graphs than n vertices, we can apply the induction hypothesis
to obtain
The aim of this section is to prove the following
generalization of Theorem 1.1 for curvilinear graphs. \E(G)\ = \E(Gl)\ + \E(G2)\ + b(G)
Theorem 3.1 Let G be a graph with n > 2 vertices, < 3m(101og2 m)2* + 3n2(101og2 n2fk + 6(G),
and let k > 1. If G has a drawing with Jordan arcs
such that no arc passes through any vertex other than where n,- = \Vi\ (i = 1,2). Combining the last two
its edpoints and there are no k + 1 pairwise crossing inequalities we get
arcs, then
\E(G)\ - 9^(10 log2 n)k-ls/\E{G)\
|£(G)|<3n(101og2n) 2fc-2 < 3^(101og2^)2^+3|(101og2|^
Proof: By double induction on k and n. The as-
< 3n(101og2n)2i(l--^).
sertion is true for k = 1 and for all n. It is also true Iog2n
for any k > 1 and n < 6 ■ 102*-2, because for these
values the above upper bound exceeds (2). If the left hand side of this inequality is negative, then
Assume now that we have already proved the theo- 1-^(^)1 < 3n(101og2 n)2k and we are done. Otherwise,
rem for some k and all n, and we want to prove it for
k + 1. Let n > 6 • 102*, and suppose that the theorem f{x) = x- 9>/n(10 log2 n)k-lJx~
holds for k + 1 and for all graphs having fewer than n
is a monotone increasing function of x when x >
vertices.
\E(G)\. An easy calculation shows that
Let G be a graph of n vertices, which has a drawing
with no k + 2 pairwise crossing edges. Let us fix such a
drawing with c(G) crossings and, for the sake of sim- /(3n(10 log2 n)2k) > 3n(10 log2 n)2k(l - -1—).
log2n
plicity, denote it also by G = (V(G),E(G)). For any
arc e G E(G), let Ge denote the graph consisting of Hence,
all arcs that cross e. Clearly, Ge has no k + 1 pairwise
crossing arcs. Thus, by the induction hypothesis, /(|£(G)|)</(3n(101og2n)2*),

which in turn implies that


c(G) = I £ \E(Ge)\ |£(G)|<3n(101og2n)2*,
eeß(G)
as required, ü
< \ Y, 3n(101og2n)2*-2
e£E(G)

< ^|£(G)Hl01og2n)2*-2. 4 Avoiding snakes

Since £,"=1 d2 < 2\E{G)\n holds for every graph G In [ASS], Aronov, Seidel and Souvaine con-
with degrees di,...,d„, Theorem 2.1 implies that structed two polygonal regions P and Q with vertices
{Pii • • • ,Pn} and {qi,..., qn} in clockwise order such
that the size of any piecewise linear homeomorphism
1/2
/ : P —► Q with f(pi) = qt (1 < i < n) is at least
b{G) < 1.58(16c(G) + £d? en2 (for an absolute constant c > 0). Their ingenious
t=i construction heavily relies on some special geometric
< 9^n|£(G)|(101og2n) i-l features of "snakelike" polygons.
Our theorem 1.2 (stated in the introduction) pro-
Consider a partition of V(G) into two parts V\ and vides the same lower bound for a modified version of
V2, each containing at least n/3 vertices, such that the this problem due to J.E. Goodman. The proof given
number of edges connecting them is b(G). Let Gi and below is purely combinatorial, and avoids the use of
Gi denote the subgraphs of G induced by V\ and Vi, "snakes."
respectively. Since neither of Gi or G2 contains k + 2 Proof of Theorem 1.2: Let Tx and T2 be two
pairwise crossing edges and each of them has fewer triangles containing two convex n-gons P and Q in

200
their interiors, respectively. Let PT(I), • • ->P*(n) de- Let b(Gv) < k. Let (Vi, V2) be a partition of V(GT)
note the vertices of P in clockwise order, where ir is with |Vi|, |V2| > n/3 and E(VUV2) < k. Define
a permutation of {1,..., n} to be specified later. Fur-
thermore, let qi,...,qn denote the vertices of Q in Ei(Vi,V2) = {qtqt+i I 1 <»'<"} n E(VU V2),
l
clockwise order. Let / : T\ —► T2 be a piecewise linear E2{Vx, V2) = {«,(,-)9»(.-+i) I 1 < < n) n E V
( i - ^)-
homeomorphism with /(p.) = g,- (1 < % < n), and fix
a triangulation Ti of Ti with |7"i| = size(/) triangles Since \Ei(Vi,V2)\ < k, the partition (Vi,V2) should
such that / is linear on each of them. By subdividing be of a special form. If we delete all elements of
some members of 7i if necessary, we obtain a new tri- Ei(Vi, V2) from the path qi... qn, it splits into at most
angulation T{ of Ti such that each p> is a vertex of T{ k + 1 paths (or points) lying alternately in Vi and in
and \7{\< |Ti| + 3n. V2. This yields a 2(fc + 1)(£) upper bound on the
Obviously, / will map T{ into an isomorphic tri- number of partitions in question.
angulation T2' of T2. The image of each segment The order in which the elements of Vi (i - 1,2) oc-
P*iP*(i+i) is a polygonal path connecting </»(<) and cur in the sequence q^X). ..qT(n) can be represented
?ir(i+i), (! < * < ")• Tne collection of these paths by a function <T,- : {1,..., |Vi\} -+ V,- (» = 1,2). For a
together with the segments qtqt+i is a drawing of the fixed partition (Vi, V2), there are at most |Vi|! choices
graph G = GT defined by: for (Ti and |V2|! choices for cr2. If <T\ and <r2 are also
fixed, then the number of possible permutations is
V(G) = {qi,...,qn}, bounded again by 2(Jk +1)(£). Thus the total number
(*) of permutations ir for which b{Gr) < k cannot exceed
E(G) = {qtqi+i | 1 < i < n} U {«,(i)?»(<+i) I
1 < i < n}.
Suppose that this drawing has c crossing pairs of
arcs. Notice that each crossing must occur between a
path 5T(i)9x(i+i) and a segment g>?,-+i. By the con-
vexity of Q, any line can intersect at most two seg-
ments qjqj+i. Hence the total number of subsegments
<- E "<;/3)"'2(t+i)0
(V,,K3)

of the concatenation of the polygons f(p*(i)P*(i+i)), < 4(fc+l): n n


1 < i < n, is at least c/2. On the other hand, by { k)\nß)
the convexity of P, each triangle belonging to T{ in-
which is less than n! if fc < n/20, and n is sufficiently
tersects at most two sides of the form fV(j)Px(,-+i).
large. Ü
Thus, \T{\ > c/4, which yields that
c(G)
size(/) = |7i|>|T/|-3n> 3n,
- 4 References
where c(G) stands for the crossing number of G. Ap-
[AE] N. ALON AND P. ERDöS, Disjoint edges in
plying Theorem 2.1, we obtain that
geometric graphs, Discrete Comput. Geom. 4
b\G) (1989), 287-290
<G)> 1.
40
[AS] N. ALON AND J. SPENCER The Probabilistic
Therefore, Method, J. Wiley, New York, 1992.
b7(G) 1 [ASS] B. ARONOV, R. SEIDEL AND D. SOUVAINE,
On compatible triangulations of simple poly-
gons, Computational Geometry: Theory and
To complete the proof of Theorem 1.2, it is suffi- Applications 3 (1993), 27-36
cient to show that for a suitable permutation w the
bisection width of the graph G = GT defined by (*) [AH] S. AVITAL AND H. HANANI, Graphs, Gilyonot
is at least constant times n. We use a counting argu- Lematematika 3 (1966), 2-8. (Hebrew)
ment (cf. [AS]. The family of graphs GT has size n\.
We bound from above the number of those members [CP] V. CAPOYLEAS AND J. PACH, A Turän-type
of this family whose bisection width is at most k. We theorem on chords of a convex polygon, J.
will see that for ifc < n/20 this number is less than n\. Combinat. Theory B, 56 (1992), 9-15.

201
[DDS] K. DIKS, H. N. DJIDJEV, O. SYKORA AND [S] A. SAALFELD, Joint triangulations and trian-
I. VRTO, Edge separators for planar graphs gulation maps, Proc. 3rd Annual ACM Sympo-
and their applications, Proc. 13th Symp. Math. sium on Computational Geometry, 1987, 195-
Found. Comp. Science (Borlin, ed), Lecture 204
Notes in Comp. Science 324, Springer Verlag,
280-290. [SW] D. SOUVAINE AND R. WENGER, Constructing
piecewise linear homeomorphisms, Submitted
[AH] P. ERDöS On sets of distances of n points, to 10th Annual ACM Symposium on Computa-
Amer. Math. Monthly 53 (1946), 248-250. tional Geometry.

[GM] H. GAZIT AND G.L. MILLER, Planar separa- [U] J.P. ULLMAN, Computational Aspects of
tors and the Euclidean norm, Algorithms (Proc. VLSI, Comp. Sei. Press, Rockville, Maryland,
Internat. Symp. SIGAL'90, T. Asano at. al. 1984.
eds.), Lecture Notes in Computer Science 450,
1990, 338-347.

[GKK] W. GODDARD, M. KATCHALSKI AND D.J.


KLEITMAN, Forcing disjoint segments in the
plane, manuscript.

[AH] H HOPF AND E. PANNWITZ, Aufgabe No. 167,


Jber. Deutsch. Math, Verein. 43 (1934), 114-

[K] Y.S. KUPITZ, Extremal Problems in Combina-


torial Geometry, Aarhaus University Lecture
Note Series, no. 53, Aarhaus University, Den-
mark, 1979.

[L] F. T. LEIGHTON, Complexity Issues in VLSI,


Foundations of Computing Series, MIT Press,
Cambridge, Mass., 1983.

[LT] R.J. LIPTON AND R.E. TARJAN, A separator


theorem for planar graphs, SIAM Journal of
Applied Math. 36 (1979), 177-189.

[M] G.L.MILLER, Finding small simple cycle sep-


arators for 2-connected planar graphs, /. Com-
puter and System Sciences 32 (1986), 265-279.

[OP] P. O'DONNEL AND M. PERLES, Every ge-


ometric graph with n vertices and 3.6n-
3.4 edges contains three pairwise disjoint
edges, manuscript, Rutgers University, New
Brunswick, 1991.

[P] J. PACH, Notes on geometric graph theory,


DIM ACS Series in Discrete Mathematics and
Theoretical Computer Science 6 (1991), 273-
285.

[PT] J PACH AND J. TöRöCSIK, Some geometric


applications of Dilworth's theorem, Proc. 9th
Annual ACM Symposium on Computational
Geometry, 1993.

202
Cutting Dense Point Sets in Half

Herbert Edelsbrunner*, Pavel Valtr* and Emo Welzl§

Abstract 1 Introduction
Dense point sets are sets with bounded ratio of largest
A halving hyperplane of a set S of n points in Rd con- over smallest distance between points. We present ex-
tains d affinely independent points of S so that equally tremal properties of dense point sets for the number
many of the points off the hyperplane lie in each of the of halving hyperplanes and for the stabbing number of
two half-spaces. We prove bounds on the number of geometric d-uniform hypergraphs. In this section, we
halving hyperplanes under the condition that the ratio introduce and discuss notions and results.
of largest over smallest distance between any two points
is at most 6nl/d, 5 some constant. Such a set S is called
Dense Sets. Let 6 > 0. A set S of n points in Md is
dense.
6-dense if the ratio of the maximum over the minimum
In d — 2 dimensions, the number of halving lines for distance between two points in S is at most 6n1'd. We
a dense set can be as much as Q(nlogn), and it cannot use dense short for <5-dense if 6 is a constant. Note
exceed 0(n5/4/log* n). The upper bound improves over that values of 6 that admit arbitrarily large <5-dense
the current best bound of 0(n3/2/log* n) which holds sets cannot be arbitrarily small. For example in M2,
more generally without any density assumption. In d =
5 > S0 = \/2\/3/ir « 1.05 is necessary and sufficient.
3 dimensions we show that 0(n7/'3) is an upper bound
on the number of halving planes for a dense set. The Arbitrarily large <50-dense sets can be constructed as the
proof is based on a metric argument that can be extended intersection of a triangle grid with a disk. For our pur-
to d>A dimensions, where it leads to 0(nd_?) as an poses, it is possible to suppose the minimum distance is
upper bound for the number of halving hyperplanes. 1, so S is <§-dense if the diameter of S is at most 6n1/d.
Various combinatorial extremal problems previously
considered for arbitrary point sets have recently been
•The research by H. Edelsbrunner is partially supported by studied for dense sets. These include convex and empty
the National Science Foundation, under grant ASC-9200301 and
the Alan T. Waterman award, grant CCR-9118874. The research convex subsets [2, 20, 21], separation discrepancy [1],
by P. Valtr is supported by the Deutsche Forschungsgemeinschaft, mutual avoidance and crossing families [21]. The com-
under grant We 1265/2-1. Part of the research by P. Valtr and plexity of the convex hull problem for <5-dense sets was
E. Welzl has been carried out during a visit to the Tel Aviv Uni-
determined in [21].
versity supported by the German-Israeli Foundation for Scientific
Research and Development. The investigation of dense point sets is motivated
*Dept. Comput. Sei., Univ. Illinois at Urbana-Champaign, Ur- by the common discrepancy between the complexity
bana, Illinois 61801, U. S. A. of algorithms in the worst case and in practical cases.
tGraduiertenkolleg "Algorithmische Diskrete Mathematik", The complexity of a geometric algorithm typically de-
Freie Univ. Berlin, 14195 Berlin, Germany and Dept. Applied
Math., Malostranske näm. 25, Charles Univ., 118 00 Praha 1, pends on certain combinatorial parameters associated
Czech Republic. with the geometric data, and it is often the case that
§
Inst. Informatik, Freie Univ. Berlin, 14195 Berlin, Germany. these parameters obtain their extrema only for bizarre
and rare data sets. In particular, extremal point sets
Permission to copy without fee all or part of this material is constructed in the literature often exhibit large distance
granted provided that the copies are not made or distributed for ratios, sometimes exponential in the number of points.
direct commercial advantage, the ACM copyright notice and the This is related to the fact that there are combinatorial
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing types of point configurations that require the distance
Machinery. To copy otherwise, or to republish, requires a fee ratio be at least double-exponential in the number of
and/or specific permission.
points, see [14, 15]. Such sets are unlikely to occur in
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50

203
practical applications. As a consequence, researchers dimensions.
spend a substantial amount of time and effort battling
difficulties that are too rare to be relevant in practical Outline. Section 2 shows the Q(nlogn) lower bound
applications. The notion of density can be seen as an
on the number of halving lines is asymptotically un-
attempt to make the theoretical analysis of algorithms
affected by the density assumption. Section 3 gives a
more relevant to practice.
proof of the 0(n?/log* n) upper bound on the number
There are two related concepts. Random sets of of halving lines for a dense set of n points in M2. The
points uniformly distributed in the unit square, and sets crux of the argument is a reduction to k-sets for about
of points with small integer coordinates (grid points). y/n subsets of size at most about \/n each. Section 4
Dense point sets behave differently from such sets, at considers point sets in M3. The approach to proving
least in some respect. For example, a random set of an upper bound rests on an area argument combined
n points in the unit square is likely to have a pair at
with an observation about centroids of subsets of the
distance 0(£), and is therefore not dense. Similarly, set. This is extended to d > 4 dimensions in section
a dense set of n points in the plane can include the 5. Alternatively, the metric argument can be combined
vertices of a convex m-gon, m = ü(^/n), which is im- with an upper bound on the stabbing number of geo-
possible for any set of points with integer coordinates metric d-uniform hypergraphs known as Lovasz' lemma
between 0 and some constant times ^/n.
[16]. This is discussed in section 6.
It is perhaps worthwhile to mention that dense
point sets have been considered in computer graphics
[6], and that they commonly appear in nature (eye- 2 Lower bound in the plane
photoreceptor distributions, minimum distance con-
straints for molecules, atoms of proteins, etc.). The constructions in [11, 13] establishing the fi(nlogn)
lower bound on the number of halving lines are not
Halving hyperplanes. A notion that is closely re- dense: with minimum distance 1 they require the max-
lated to and somewhat more general than a halving hy- imum distance be at least some constant times n. This
perplane is that of a fc-set. A subset T C S of a finite set section shows that asymptotically the same lower bound
S C Rd is a k-set if card T = k and there is a half-space can also be obtained for dense sets. We begin by modi-
so that T is the intersection of S with this half-space. fying the construction in [11] so that the ajj-coordinates
The number of &-sets, for some fixed k, arises in the of the points are contiguous integers.
analysis of geometric algorithms, see e.g. [7, 8, 12]. The
LEMMA. For any positive even integer m there are
number of k-sets obtains its maximum when the points
points p\,P2,-..,pm in K2 so that
are in general position, which we henceforth assume.
The problem of bounding the maximum number of k- (i) for all i the ^-coordinate of pi is i, and
sets possible for a set of n points turns out to be notori-
(ii) there are at least y log3 y halving lines.
ously difficult, even in d — 2 dimensions. The largest k
for which matching upper and lower bounds are known PROOF. Assume first that m = 2-3*, k > 0, and denote
is 3, see [18]. The most difficult case seems to be when k the number of halving lines of a set S by h{S). We
is roughly j, which is the reason why this case receives construct sets Sk, card (Sk) = 2-3fc, with slightly higher
special attention as the problem of bounding the num- number of halving lines than claimed, namely h(Sk) —
ber of halving lines. The best upper bounds for general (k + l)-3k = f\og3?f.
point sets in M2 is 0(n3/2/log* n), see [17], and there For k = 0 we have m = 2, So = {(1, 0), (2, 0)}, and
are constructions of sets with fi(nlogn) halving lines, h(So) = 1. We continue by induction. Sk+i is the union
[11, 13]. Our results for dense sets in M2 consist of an of three sets, T0,Ti,T2, each an affinely transformed
adaptation of the lower bound in [11] and of the upper copy of Sk as described below. By horizontal transla-
bound 0(n5/4/log*n). tion, along the «i-axis, make sure the points in 7} have
In three and higher dimensions, the problem seems ^-coordinates from im + 1 through (i + l)m. Next,
even harder. The first non-trivial upper bound for d = shrink the ^-coordinates of all points in T,- by a suffi-
3 dimensions has been given in [5]. This bound has ciently large factor. Then, move the points vertically,
been improved in [4, 10], and the current best bound is along the x2-axis, so that the shrunk ^-coordinates be-
0(rc8/3), as derived in [9]. In d > 4 dimensions there come vertical displacements with respect to a line, one
are minute improvements over the trivial 0(nd) bound for each Tt. The three lines meet in point (?J2yti,0)
based on algebraic topology arguments about the non- and have slopes 0, 1, and -1. The line for T0 is x2 = 0,
embeddability of certain complexes, see [22]. We have the one for 7\ is x2 = xx - 2m^1, and the one for T2
0(nd~i) as an upper bound for dense sets in all d > 3 is x2 = -xi + 2n^=1. So in fact, the only difference

204
between Sk and T0 is in the z2-coordinates which are the origin, and translate along Ä,- until all points lie in
scaled down for T0; the points in Ti and T2 also expe- Y. Define S — (Jt=1 Qi. For sufficiently small e > 0,
rience horizontal translation and vertical displacement every halving line of Qi is also a halving line of S.
other than scaling. The shrinking factor for each set 7} Finally, we adjust the number of points from card S =
is chosen sufficiently large so that any line through two M-m = (2|V£1 + 9)(2[^J) to n. Notice that
points of Ti separates Ti+1 and 7i+2, where indices are
taken modulo 3. HVn
n < n+ 18 < card S <n + < n+ 12m.
Any halving line of 7} is also a halving line of Sk+i ■ In ~2~
addition, Sk+i has — halving lines connecting a point
of T( with a point of T;+i each, for i = 0,1, 2. It follows We can delete points from 12 sets Qi until a set S' C
that S with card S' = n remains. By choosing half these
points from Qj, 1 < j < 6, and the other half from Qj,
A(5*+i) = h(T0) + h(Ti) + h(T2) ■ 3m/2 M±i < j < M±li) the halving lines of the remaining
= Sh(Sk) + 3 k+1 sets Qi are still halving lines of S'. Therefore,
= (k + 2)3k+1. h(S') > (M - 12) • h(Pm)
To extend this construction to arbitrary positive even
> (2^n - 3) • log3
m observe that all halving lines of Sk+i have bounded 12
slope. We can thus add equally many points above > log3 n-n.
and below all these lines and retain them as halving 12
lines. To satisfy the integer coordinate requirement, we The diameter of S' is less than Am and the number
add the points with contiguous integer xi-coordinates,
of points is n > 4m2. The density of S' is therefore
starting at 2 • 3* + 1 • After adding j points above and
j points below all halving lines of Sk, we get a set of v4m!
m = 2 • 3fc + 2j points, which we denote by Pm for later
REMARK. It is possible to improve the density factor
reference. We may assume j < 2 • 3*, so Pm has fewer
than three times as many points than Sk, which implies by setting m « \J^/?>/(Air) ■ y/n « 0.37^ and M ss
the claimed lower bound for h(Pm). ED
^ • 27rm « \JA^I\ß-y/n « 2.69^/n and by placing the
The integer zi-coordinates can be used to control the m points of Qi alternately at distances roughly m-\- \,
density of transformed copies of Pm. This is done in the m+ 1 + 2m —1 + 1 and at distances roughly
lower bound construction below. m+ f, m+ 1 + 2m — 1 + | from the origin.
The diameter is smaller than Am, so the density is at
THM. 1 For any even n > 2 there is a 2-dense set of
n points in K2 with at least ^ log3 n - n halving
most 2 V^A- 1.49. The number of halving lines is
lines. at least j^ log3 n — n.
For any fixed 6 > J2\/3/ir « 1.05, we can construct
PROOF. We may assume that n > 312, for otherwise the
a <5-dense set of even size n with at least en log n — n
claim is void. Define m = 2-[^J and M = 2-\y/n]+9;
halving lines, where c = c(6) > 0 is independent of n,
so m is even and M is odd. Let Y be the annulus of
as follows. Put mx = \8y/n and m2 = {\6 — e)y/n,
points on and between the two circles with radii m and
where e = e(6) > 0 is sufficiently small. Let Y be
2m, both centered at the origin. For 1 < i < M, let Rj
the annulus of points on and between the two circles
be the half-line with angle ^ • 2n starting at the origin.
with radii mi and m2, both centered at the origin. We
The intersection Ri n Y is a line segment of length m.
find a set S of 4m2(mi — m2) points in the annulus Y
For e > 0 and 1 < i < M find an affine transformation
similarly as in the proof of Theorem 1 so that 5 has at
Qi of Pm so that
least en log n — n halving lines. Let T be a set of points
(i) Qi C Y, of a triangle grid with minimum distance 1 which is
symmetric around the origin and does not contain the
(ii) the distance of any p £ Qi from Ri is at most e, origin. Let T" be the intersection of T with the disk of
and radius m2 — 1 centered at the origin. We may certainly
(iii) the distance between any two points in Qi is at assume that each of the en log n — n halving lines of S
least 1. cuts T' into two equal-sized parts. Then, S U T" has
at least en log n — n halving lines. If e > 0 was chosen
For example, shrink the ^-coordinates of the points in sufficiently small, S U X" has at least n points. Finally,
Pm to within [—e,e], rotate the set by ^ ■ 27T about we delete (card (S U V) - n)/2 pairs of points of V,

205
each pair symmetric around the origin, so that exactly as claimed. a
n points remain in S Uf. This gives us a <5-dense set
of size n with at least en log n - n halving lines. REMARK. Let fk(n,6) be the maximum number of k-
sets in a <5-dense set of n points in the plane, and let
f(n, 8) = max{/fc(n, 8) : 0 < k < n}. Thus, Theorem 2
3 Upper bound in the plane yields
Let fk(n) be the maximum number of fc-sets in a set
of n points in the plane, and let f(n) = max{/fc(n) : where k = ^ - 1. An analogous argument gives also
0 < k < n}. As mentioned in the introduction, f(n) -
0(nt/log* n) is the best known upper bound on f(n). f(n,S)=0(6^-f{36y/K)).
We show that <5-dense sets admit smaller bounds. In
particular, the result implies that O(n?/log*n) is an REMARK. Let us redefine R - R(y) in the proof of
upper bound for dense sets. Theorem 2 to be the smallest rectangle that contains
the e-neighborhood of ^PlconvS, where £ > 0 is a small
THM. 2 The number of halving lines of a <5-dense set
positive constant. In this case, the points of S H R are
of n points in M2 is at most 0{8y/n ■ /(36,/n)).
almost collinear. We call SCR2 of size n 8-line-dense if
PROOF. Let S be a <5-dense set of n points in M2. Con- there is a line q such that the orthogonal projection of S
sider a general direction 7 G [0,7r) and a line £ = £(j) to q is a 5-dense set in the 1-dimensional interpretation.
with direction 7 so that equally many points of S lie on Let h(n,8) be the maximum number of fc-sets in a 8-
both side of £. The length of £ l~l conv S is at most the line-dense set of n points in the plane, and let l(n, 8) =
diameter of S, which is at most 8y/n. Let R = #(7) be max{/fc(n,<5) : 0 < k < n). Analogous arguments as
the smallest rectangle that contains the ^-neighborhood in sections 2 and 3 yield that for any fixed 8 > 80 =
of £ n conv 5; its length is at most 8^/n + 1, its width /2V3/7T and 8' > 1,
is 1, so its area is at most 8*Jn +1. For each point ^
p e S n R consider the disk Dp - {x \ \xp\ <\), where
f(n, 8) = 0(Vn~ ■ /(ci-A, 6')) = 0(/(c2n, 8)),
\xp\ is the Euclidean distance between x and p. The
area of R covered by Dp is at least |. Since all such where cx and c2 are two constants depending only on 8
disks are disjoint, this implies that and 8'.
In particular, if the function f(n,6) is smooth as a
card(5nfi)<^|±i<--5v^+3. function of n (i.e., f(cn, 8) = 0(f(n,8)) for any con-
stant c) then
We say a line h meets R shortside if h meets the two
short sides, which have length 1 each. A halving line f(n,6) = e(y/ü-l(y/^,6%
of S necessarily meets £ within conv S and thus within
R. It follows that if h is a halving line then it meets and determining the asymptotic behavior of the max-
R shortside if its direction differs from 7 by at most imum number of halving lines is equally difficult for
x, where (8y/n + |)tanx = \, or equivalently, x = dense sets as for line-dense sets. We believe that the
arctan Since 6^/n certainly exceeds 1, we have function f(n,8) (and also the function f(n)) is smooth
2-is/n + l
but have no proof at this moment.
1
arctan > 2|5 l
> 3
> REMARK. Note that Thm. 2 can be bootstrapped. So
28^/h~ + 1 ~ \/" + ~~ • 6Vn 10-Sy/n'
if dense sets asymptotically maximize the number of
Choose m = [5 • 6y/n\ and assume that all directions halving lines, then this maximum is 0(n polylog n).
-Y = 0 ijr -2-7T s^TT are general in the sense that
no two points of S lie on a line with such a direction.
Two contiguous directions differ by less than 2x, so each 4 Upper bound in space
halving line meets at least one of the rectangles R(j)
shortside. Let S be a dense set of n points in M3. As mentioned
To finish the argument observe that each rectangle, in the introduction, we derive an upper bound on the
R, is met shortside by at most f(%8y/n + 3) halving number of halving planes using an area argument for
lines, because they are all split 5 n R the same way. It triangles spanned by points in S. In particular, we need
follows that the total number of halving lines is at most a lower bound on the total area of a collection of m such
triangles. We begin with two lemmas. The collection
m ■ f{-8Vn~ + 3) = 0(6^ • /(35^)), of subsets of S with size k is denoted by (k).
7T

206
LEMMA A. Let 5 be a set of n points with minimum If A\ < A2 < ■ ■ ■ < AM is the ordered sequence of the
distance 1 in M3. Then M — (3) triangle areas, we can rewrite this as

1 3D
E \Pl\
<3 i < lteAfn* + YlAin2 +

For i > 6Dn2 this implies that at least one of 144A2n*


PROOF. Consider the ordered sequence of the N = Q) and YlAiTi2 exceeds \{i - ™n2) > f. The first in-
distances: £i < £2 < • • • < xjv- The pigeon-hole princi- equality implies
ple implies that for each index i there is a point with at 13
least — points at distance x,- or less. So we have at least Ai>
14716
— + 1 points inside a ball of radius x,-. Because of the
which is weaker than the second inequality provided
minimum distance assumptions we get at least -± + 1
i > |n3. This is indeed the case if i > 6Dn2, because
pairwise disjoint open balls of radius \ each inside a
D > |n 3, which can be proved by a straightforward
ball of radius x,- + i. By dividing volumes we get
packing argument. Finally, the total area of m = 2i >
12Dn2 triangles is at least
2i 3 3 3
+ 1< ^^ = 8(xt + ±) <3 .x .
i ■ Ai > >
2 14-n* 40
It follows that Xi > §(^)3, and therefore

TV N
a
3 < 3-rT".
t=i i=l The lower bound on the total area of m triangles is
{p,«}e(f)
sufficient to prove an upper bound on the number of
a halving planes of a 5-dense set S. Assume n is odd
and define k — tLf^- For every subset T C S of size
k, let JT be the centroid, that is, JT — £ HPeT P- Let
Based on the bound for distances we can now prove
Sk be the set of fc-fold centroids, that is, Sjt = {JT I
a bound for areas of triangles.
T C S, cardT = k}. The convex hull of Sk is a three-
LEMMA B. Let 5 be a set of n points with minimum dimensional convex polytope, Pk- Note that P* is con-
distance 1 and maximum distance D in IR3. Then tained in the convex hull of 5, and by density assump-
the total area of m > YIDn2 different triangles is tion, its projections to the three coordinate planes have
at least ^mi/ii«. area at most 62n^ each. It follows that the surface area
of Pk is less than 662n3.
PROOF. For two points p,q £ S consider all third points We claim that if the plane, h, through points p,q,r e
r £ S so that the area of the triangle pqr is at most A S is a halving plane then a homothetic copy of the tri-
and pq is its longest edge. The distance from r to the angle pqr is a face of Pk- Let U C S be the subset of
2A_
line through p and q is therefore at most \pq\' id r points on one side of h, so card U = k — 1. For each
lies between the two planes through p and q normal to x G {p, q,r}, there is a plane that separates U U {x}
pq. The number of points r that can possibly lie inside from S — U — {x}, and therefore juu{x] is a vertex
this cylinder can be bounded by a packing argument. of Pk- Furthermore, the centroids defined by U U {p},
After growing by \ in every direction, the volume of the U U {q}, and U U {r} span a triangular face of Pk- This
cylinder is face is a homothetic copy of pqr, with scaling factor
p In summary, if the plane through points p, q, r is a

<M+I*is+^w+4'^
halving plane then a homothetic copy of pqr is a face
V
of Pk, and the area of pqr is k2 times the area of the
corresponding facet. Since the surface area of Pjt is less
because \pq\ + 1 < 2\pq\. It contains at most ^V pair- than 662n2/3, the total area of all triangles correspond-
wise disjoint open balls of radius | each. Using lemma ing to halving planes is less than 6&2<52n2/3 < §<52n8/3.
A we get an upper bound on the number of triangles Lemma B thus implies the following upper bound on
with area A or less: the number of halving planes.

E -V < UAA2ni + l2An2 + ^-n2. THM. 3 The number of halving planes of an «5-dense
set of n points in M3 is less than 20 • 64/3n7/3.
{p,«}e(f)

207
5 Four and higher dimensions all sequences z\ though Zk so that z, > 1, for all i, and
rjti=1 = k\A. Simplices are counted only if all their x,'s
The area argument of section 4 can be extended to Md, exceed 1; the others are covered by the second term
d > 4. To simplify the argument, only dense sets of n on the right side of the second inequality in lemma C.
points in Kd are considered, so the diameter is D < Sn* To consider all sequences we use induction and the fact
for some constant 6. Suitable positive constants are
that IllTi1 *•• = *!£■- So
used throughout this section and denoted as c, with or
without sub- and superscript. A set T of cardT = k + d k+1
1 < d+ 1 points in Md spans a fc-simplex, a? = conv T. sk(A)< f sk^(-)-z
z
- -Dk-ldz.
Jz = l
Its ^-dimensional Euclidean measure is denoted by |<7T|.
We let sk (A) denote the number of £-simplices spanned For k = 2 we get
by the points whose measure is A or less. All logarithms rA 1
are to the base 2. s2(A) < c-nAd D -dz
Jz = l z
LEMMA C. Let S be a dense set of n points in M.d. Then < 4 ■ nAd log A-D,
sk(A) is bounded from above by
and for k > 3 we get
c-nAd for k = 1,
fA 1
sk(A) < c-nAd log A ■£>(») / -— dz
c-n1+äAd log A + c'nk+l for 2 < k < d. k 1
Ji=\ z ~ \ogz
< c'2"-nAd log A •£»(*).
PROOF. Let F be an (i - l)-flat, 1 < i < d. The (i -
l)-dimensional measure of its intersection with conv S a
is less than D*~l. It follows that the d-dimensional
measure of the cylinder of points at distance z + | of The upper bound on sk{A) can be used to prove a
less from F is less than ci(z + |)d"i+1D,_1. With a lower bound on the total measure of a collection of k-
different constant, c[, this is also an upper bound on simplices, all spanned by 5.
the number of points in S at distance z or less from F. LEMMA D. Let S be a dense set of n points in Md. The
Consider an arbitrary ordering, po,Pi, ■ • • ,Pk, of the total ^-dimensional measure of m > c" ■ nk+~s~
vertices of a ^-simplex <TT, T C S. For 1 < i < k, let Ä;-simplices is at least
X{ be the distance of p; from the (i — l)-flat spanned by
Po! • ■ •, Pi-1 • If z\, Z2, • • •, Zk is a sequence of distances m1+ d J(c ■ n*) for k = 1
2d + k(k-l)
so that Xi < Zi for all i, then 1+ 2
m ^/(c-n 2<i log'' m) for 2 < k < d.

\^\ = hUx^hli^ (i)


PROOF. Let Ax < A2 < ... < AM be the ordered se-
quence of the M = (k'll) ^-simplex measures. Assume
c" > Ac' so the majority of any set of m ^-simplices have
The number of fc-simplices for which (1) holds is all Xi exceeding 1, see the proof of lemma C. For k = 1,
bounded from above by we can rewrite the result in lemma C as i < c ■ nAf, so
m m i _i_X
m1T *
1
* 1 El v-^ .1
C2nl[[(zi + -)d-i+'Di-
,•=1 (cn)d i=l nd

The number of &-simplices with at least one x; at most For k > 2 and i > f > 2c'nk+h^L, we get i < 2c •
1 is less than c' ■nk-Dk~1. For the others we can assume n* A? log Ait where 1= 1 + (\)/d. Thus
all Zi exceed 1, so the upper bound can be simplified to
Ai > c4 ■ ^——'- .
.d-i + l log"* (i ■ n~i)
c'2nD&)Y[. (2)
J'=I For the total measure we get
For a given A, we can now derive an upper bound on
Sk(A), the number of A:-simplices <TT with \ax\ < A. Y^Ai > C4-— x
nd
For k = 1 set z\ = A, get |<x<r| = x\ < A from (1) and i=i i=i log" z
s1(A) < c'2nAd from (2). This completes the proof of ,i + i
> c'A
the first inequality in lemma C. For k > 2 we consider rid \ogd rn

208
because /" 2 ^dx < c'i ■ ^ a [2] N. Alon, M. Katchalski and W. R. Pulleyblank. The
maximum size of a convex polygon in a restricted set of
REMARK. For d = 3, k = 2, and D proportional to points in the plane. Discrete Comput. Geom. 4 (1989),
ns, the bounds in lemmas B and D agree up to the 245-251.
logarithmic factor. The larger D gets the further the
[3] N. Alon and M. A. Perles. On the intersection of edges
bound in lemma D lags behind the one in lemma B. of a geometric graph by straight lines. Discrete Math.
For k = d — 1, lemma D says that m > c" ,d-i 60 (1986), 75-90.
{d— l)-simplices have total (d— l)-dimensional measure [4] B. Aronov, B. Chazelle, H. Edelsbrunner, L. J. Guibas,
at least M. Shark and R. Wenger. Points and triangles in the
,i+i ,f+i._ -a a.
plane and halving planes in space. Discrete Comput.
C5
> d
Geom. 6 (1991), 435-442.
c■n M'2 1
log * m log n
[5] I. Bäräny, Z. Füredi and L. Lovasz. On the number of
The exponent of n exceeds d— ^ for d > 4. This is worth halving planes. In "Proc. 5th Ann. Sympos. Comput.
noticing because the same argument on centroids which Geom., 1989", 140-144.
leads to theorem 3 in section 4 implies that
[6] R. L. Cook. Stochastic sampling in computer graphics.
d l d 1 d ACM Trans. Graphics 5 (1986), 51-72.
c6D - n - <45n -i
[7] B. Chazelle and F. P. Preparata. Halfspace range
is an upper bound on the total measure of all (d — 1)-
search: an algorithmic application of fc-sets. Discrete
simplices spanning halving hyperplanes. It follows that
Comput. Geom. 1 (1986), 83-93.
there cannot be m > c" ■ nd~d such (d — l)-simplices,
because this would contradict lemma D. [8] R. Cole, M. Sharir and C. K. Yap. On fc-hulls and re-
lated problems. SIAM J. Comput. 16 (1987), 61-77.
THM. 4 The number of halving hyperplanes of a dense
set of n points in Rd, d > 4, is less than c • nd~t. [9] T. K. Dey and H. Edelsbrunner. Counting triangle
crossings and halving planes. In "Proc. 9th Ann. Sym-
pos. Comput. Geom., 1993", 270-273.
6 Stabbing number [10] D. Eppstein. Improved bounds for intersecting trian-
As described by Santalo [19], there is a motion-invariant gles and halving planes. Rept. 91-60, Dept. Comput.
measure on lines in IR3 with the property that the mea- Sei., Univ. California at Irvine, 1991.
sure of lines intersecting a triangle is twice its area. [11] H. Edelsbrunner and E. Welzl. On the number of line
This measure can be used to extend theorem 3 to the separations of a finite set in the plane. J. Combin. The-
stabbing problem for triangles defined by a <5-dense set ory, Ser. A 38 (1985), 15-29.
5 C K3. The measure of lines intersecting the convex
[12] H. Edelsbrunner and E. Welzl. Constructing belts
hull of 5 is bounded by 0(62n2lz). If we take every line
in two-dimensional arrangements with applications.
with the multiplicity of its stabbing number in a set of
SIAM J. Comput. 15 (1986), 271-284.
m triangles defined by 5, then this measure is twice the
total area of these triangles. Lemma B shows that this [13] P. Erdös, L. Loväsz, A. Simmons and E. G. Straus.
area is fi(m3'/2/n5/'6), provided m > c6n7/3. So if the Dissection graphs of planar point sets. In A Survey of
set of triangles has the property that every line stabs Combinatorial Theory, ed. J. N. Srivastava et al., 139-
at most 0(n2) of them, then m = 0(64/3n7/3), which is 149, North-Holland, Amsterdam, 1973.
the same bound as in theorem 3. Lovasz' lemma guar- [14] J. E. Goodman, R. Pollack and B. Sturmfels. Coordi-
antees that this is indeed the case for triangles that span nate representation of order types requires exponential
halving planes. Thus, the motion-invariant measure for storage. In "Proc. 21st Ann. ACM Sympos. Theory
lines together with Loväsz' lemma gives another proof Comput., 1989, 405-410.
of theorem 3 based on the area bound in lemma B. The
[15] J. E. Goodman, R. Pollack and B. Sturmfels. The in-
same can be said about d > 4 dimensions, theorem 4,
trinsic spread of a configuration in IR . J. Amer. Math.
and lemma D.
Soc. 3 (1990), 639-651.

[16] L. Lovasz. On the number of halving lines. Ann. Univ.


References Sei. Budapest Eötvös Sect. Math. 14 (1971), 107-108.

[1] R. Alexander. Geometric methods in the study of ir- [17] J. Pach, W. Steiger and E. Szemeredi. An upper bound
regularities of distribution. Combinatorica 10 (1990), on the number of planar fc-sets. Discrete Comput.
115-136. Geom. 7 (1992), 109-123.

209
[18] E. Ramos. The number of 3-sets of a finite point set
in the plane. Rept. UIUCDCS-R-93-1843, Dept. Corn-
put. Sei., Univ. Illinois at Urbana-Champaign, Illinois,
1993.

[19] L. A. Santalö. Integral Geometry and Geometric Prob-


ability. Addison-Wesley, Reading, Mass., 1976.

[20] P. Valtr. Convex independent sets and 7-holes in re-


stricted planar point sets. Discrete Comput. Geom. 7
(1992), 135-152.

[21] P. Valtr. Planar point sets with bounded ratios of dis-


tances. Ph.D. thesis, Fachbereich Math., Freie Univ.
Berlin, 1994.

[22] R. T. Zivaljevic and S. T. Vrecica. The colored Tver-


berg's problem and complexes of injective functions. J.
Combin. Theory, Ser. A 61 (1992), 309-318.

210
Fast Greedy Triangulation Algorithms*
(Extended Abstract)

Matthew T. Dicker-son*
Department of Mathematics and Computer Science
Middlebury College, Middlebury VT 05753

Robert L. Scot Drysdale*


Scott A. McElfresh
Department of Mathematics and Computer Science
Dartmouth College, Hanover NH 03755

Emo Welzl
Institut für Informatik
Freie Universität Berlin

1 Introduction testing the compatibility of a candidate edge with edges


in a partially constructed greedy triangulation. Our
1.1 Overview of the Results method requires ©(1) time for both the edge test and
the update of our data structure, @(n) time for initial-
The greedy triangulation (GT) of a set S of n points
ization, and ©(n) space.
in the plane is the triangulation obtained by starting
with the empty set and at each step adding the short- We next prove that an edge cannot be greedy if a
est compatible edge between two of the points, where small disk centered at its midpoint contains a point from
a compatible edge is defined to be an edge that crosses S in both half-disks. Based on this, we are able to prove
none of the previously added edges. In this paper we that all edges in a greedy triangulation of uniformly
present a simple, practical algorithm that computes the distributed points over a convex compact region C are
greedy triangulation in expected time O(nlogn) and expected either to be short or to have both endpoints
space 0(n) for points uniformly distributed over any near the boundary of C.
convex shape. A variant of this algorithm should also These results allow us to develop an algorithm that
be fast for many other distributions. computes the greedy triangulation for uniformly dis-
We first describe a surprisingly simple method for tributed points in 0(n log n) expected time. We also
"This paper benefitted from discussions with David Eppstein present another two-phase algorithm that is less tuned
and others during the MSI Workshop on Computational Geom- to uniform distributions. It runs in expected time
etry, Stony Brook NY, October 23-24, 1992, with Cliff Stein
and others in the Dartmouth Algorithms Seminar, with Lorenz
0(nlog n) time on uniformly distributed points, and
Wernisch, and with Andrzej Lingas. 0(n2 log n) in the worst case. These algorithms should
' This study was supported in part by the funds of the National be compared to an algorithm by Levcopolous and Lin-
Science Foundation, CCR-9301714. gas [20]. For the more restricted case of points uni-
' This study was supported in part by the funds of the National
formly distributed in the unit square, their algorithm
Science Foundation, DDM-9015851, and by a Fulbright Founda-
tion grant that helps support this author's sabbatical visit to the runs in expected time 0(n). Extending it to rectangles
Freie Universität. is straightforward, but extending it to non-rectangular
Permission to copy without fee all or part of this material is
convex shapes would require non-trivial modications of
granted provided that the copies are not made or distributed for the algorithm and analysis. Although their algorithm
direct commercial advantage, the ACM copyright notice and the is beautiful theoretically, it has not been implemented
title of the publication and its date appear, and notice is given and would be difficult to implement practically. Our
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee algorithms not only work efficiently for more general
and/or specific permission. compact convex regions, but the simplicity of our algo-
rithms and smaller constant factors would make them
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 preferable for most practical-sized problems.

211
1.2 Background thus improving the space complexity of Gilbert's algo-
rithm without affecting the worst case time. Lingas [24]
Efficiently computing the greedy triangulation is a prob-
shows that his method runs in 0(n log ' n) for points
lem of long standing, going back at least to 1970 [9]. A
chosen uniformly from the unit square.
number of the properties of the GT have been discov-
Recently Levcopoulos and Lingas, and independently
ered [18, 22, 26, 27] and the greedy algorithm has been
used in applications [5, 27]. Wang, have shown how to do the update step in 0(n)
A straightforward approach to computing the GT is time, using a modification of the linear-time algorithm
to compute all (2) distances, sort them, and then build for computing the Voronoi diagram of a convex polygon
the GT an edge at a time by examining each pair in [1], leading to an 0(n2) time and 0(n) space algorithm
order of length and adding or discarding it based on its in the worst case [19, 31]. More recently Levcopoulos
compatibility with the edges already added. It is easy and Lingas give a modification of this algorithm that
to see that this method requires 0(n2) space and time is expected to take 0(n) time for points uniformly dis-
tributed in a square [20]. These methods are elegant,
T(n) = 0(n2 log n + n2f(n) + ng(n)) (1) but are significantly more complicated than our meth-
ods and should be slower for practical-sized problems.
2
where 0(n log n) is the time required for an optimal
One use of the greedy triangulation is as an approx-
comparison-based sort on (j) distances, f(n) is the time
imation to the minimum weight triangulation (MWT).
required to test new edges for compatibility, and g(ri)
Given a set S of n points in the plane, a Minimum
is the time required to update the data structure when
Weight Triangulation (MWT) of 5 is a triangulation
a new greedy edge is added [29]. A naive test would
that minimizes the total length of all edges in the tri-
compare each new potential edge to each of the existing
angulation. The MWT arises in numerical analysis
edges (of which there are at most 0(n)) for an 0(n3)
[22, 25, 29]. In a method suggested by Yoeli [34] for nu-
time algorithm. Gilbert [10] presented a data struc-
merical approximation of bivariate data, the MWT pro-
ture allowing an O(logn) time compatibility test and
vides a good approximation of the sought-after function
an 0(n log n) time update, thus improving the algo-
surface. Wang and Aggarwal use a minimum-weight
rithm's overall time complexity to 0{n2 logn), without
triangulation in their algorithm to reconstruct surfaces
adversely affecting space complexity. He does this by
from contours [32]. Though it has been shown how to
building a segment tree for each point in the set, where
compute the MWT in time 0(n3) for the special case
the endpoints of the "segments" are the polar angles be-
of n-vertex polygons [14], there are no known efficiently
tween the given point and every other point in the set.
computable algorithms for the MWT in the general case
Manacher and Zobrist [27] have since given an 0{n2)
[29]. We therefore seek efficiently computable approxi-
expected time and 0(n) space greedy triangulation al-
mations to the MWT.
gorithm that makes use of a probabilistic method for
pretesting compatibility of new edges. Note that our Although neither the GT nor the Delaunay triangu-
approach also uses this "generate and test" paradigm, lation (DT) yields the MWT [26, 25], the GT appears
and that we gain improvements over previous results to be the better of the two at approximating it. In fact,
by generating fewer edges and supplying more efficient for convex polygons the GT approximates the MWT to
tests. with a constant factor while the DT can be a factor of
An alternate approach to "generate and test" is to fi(rz) larger [18]. For general point sets, the DT can be a
generate only compatible edges. One way to do this factor of ft(n) larger than the MWT, but the best lower
was discovered independently by Goldman [11] and by bound for the GT is Q(^/n) [13, 17]. For points lying
Lingas [24]. The method uses the generalized or con- on a convex polygon or uniformly distributed points in
strained Delaunay triangulation [3, 15, 33]. The con- a square, both the GT and the DT are expected to be
strained Delaunay triangulation is required to include a within a constant factor of the MWT [20, 4]. For these
set of edges E. The rest of the edges in the triangulation reasons a large amount of effort has gone into finding ef-
have the property that the circumcircle of the vertices ficient methods for computing the greedy triangulation.
of any triangle contains no point visible from all three Other heuristics for approximating the MWT have
vertices. also been developed. Plaisted and Hong have developed
This alternate approach computes the constrained a complicated polynomial-time heuristic that is guaran-
Deluanay triangulation of the points with the current teed to be within a factor of O(logn) of the MWT [28].
set of GT edges as the set E. The next edge to be The best heuristics known so far are those of Lingas
added to the GT can be found in linear time from the [23] and Heath and Pemmaraju [12]. These approaches
constrained Delaunay triangulation. The triangulation make use of the convex hull and a spanning tree to create
must then be updated to include the new edge in E, a single cell, and then use an optimal cell triangulation
which takes 0(n log n) time in the worst case. This algorithm generalized from Gilbert's dynamic program-
gives an 0(n2 log n) time and O(n) space algorithm, ming approach for computing the MWT of points on

212
a convex polygon [10]. However, though both methods k < (j), let T be a partial greedy triangulation of S
appear empirically to produce triangulations much bet- constructed using the standard greedy approach of exam-
ter than the GT, both of these algorithms require 0(n3) ining the first k interpoint pairs in nondecreasing order
time which is impractical for large point sets. In [12], of distance and adding to T exactly those edges compat-
the authors only report on data for sets of size 50 and ible with previously added edges. Now let (p,q) be the
smaller. We also note that with the method of Heath (k + 1)*' pair to be tested with 8 = d(p, q). If edge pq is
and Pemmaraju, the greedy triangulation still remains not compatible with T, then T contains a CW or CCW
of interest as it is a substep in their algorithm. chain p,v\,. ..,Vk,x (or, respectively, q, vi,..., Vk, x)
with respect to pq that has the following five properties:
1) edge VkX intersects segment pq,
1.3 Notation 2) points vi,...,Vk He within the 6 x 26 rectangle
Throughout the paper, we let d(p,q) be the distance R that is divided into two squares by segment pq and
from point p to q using the standard Euclidean distance d(p, Vi) < 6 (respectively d(q, Vi) < 8) for 1 < i < k,
metric. 3) ifd(q,vi) > 8 (respectively d(p,v\) > 8) then k =
1,
4) the vertices p, v\,..., Vk (all edges of the chain be-
2 A New Edge Test for the GT fore Vkx) form a convex chain, and
5) VkX is the closest edge to p (respectively q) of all
We now present our new method for testing the com- edges in T intersecting pq.
patibility of edges in a greedy triangulation. We will
first present some definitions, and then a new theorem
stating a property of any pair of points that does not 2.1 Method and Proof of Correctness
form an edge in the GT. Following the theorem, we will We now give a fast greedy triangulation edge test based
present the edge test method with a proof of its correct- on Theorem 1. To determine whether edge pq is compat-
ness and a complexity analysis of the run time required ible, the algorithm examines the CW and CCW chains
by each of the operations. from p and q with respect to pq. The method actually
requires that we examine at most only two edges on each
Definition 1 In a straight line planar graph T, a clock- of these chains. It returns TRUE if the edge is compat-
wise chain from p\ (hereafter written "CW chain from ible and FALSE otherwise. For reasons of brevity, we
pi ") is a sequence of points pi, ■ ■ -,Pk such that for 1 < give only the first part of this test: checking the CCW
i < k,piPi+i are edges in T, and for 1 < i < k,piPi+i from p. Steps 2, 3, and 4 are symmetric except that in
is the next edge around point pi in a clockwise direction Step 4 instead of a goto Step 5 the algorithm would re-
frompi-ipi. turn TRUE. In part le., Cq is the circle of radius d(p, q)
centered at q.
Definition 2 Let pi,...,Pk be a CW chain in straight
line planar graph T. If {p\,p-i) is the first edge in a
clockwise direction from a segment piq (with p\q not 2.1.1 Edge Test for (p, q) in T
necessarily an edge in T), then we say that Pi, ■ ■ -,Pk JS Step 1: CCW Chain from p
a CW chain with respect to p\q. la. Let v\, V2 be the next two points on
the CCW chain from p (with respect to pq).
We define a counter-clockwise chain, or CCW chain, in lb. IF {Lqpvi > TT/2) OR (no CCW chain exists)
a similar fashion. THEN goto Step 2.
The new compatibility test method is based on the lc. IF viv2 intersects pq THEN return FALSE.
following lemma and theorem. Id. IF v2 = q THEN return TRUE
le. IF v\ is strictly inside Cq AND v2 ^ q
Lemma 1 Given a set S of n points, let x, y, and z be
THEN return FALSE.
oriented so that they form a CW triangle. Let T be the
ELSE goto Step 2.
partial triangulation in the standard greedy algorithm at
the time when xz is tested for compatibility or at some
later time. Let x, y, z be a CCW chain in T. Then
triangle xyz contains no points in S in its interior and Proof of Correctness We now show that the above
xz is either compatible with T or already in T. (The algorithm correctly determines whether edge pq is com-
lemma is also true if CW and CCW are interchanged.) patible with the edges already added to T (assuming
the edges are added in greedy fashion.) We give a proof
for Step 1; the other three steps are exactly analagous.
Theorem 1 (CW/CCW Chain Theorem) The first two cases are obvious. First assume that
Given a set S of n points and a non-negative integer v\ is outside R (or equivalently that no CCW chain

213
exists). It follows directly from Theorem 1 that if pq intervals will be maximal sections of the wheel with the
is not compatible we will find a CW or CCW chain on entire "rim" present.) A closed point is a point incident
one of the subsequent steps and we can immediately to at least one edge but to no open edges.
go to Step 2. Now assume that V1V2 intersects pq. By To the each edge structure in the data structure for
definition, pq is not compatible with T and we can halt. storing the edges as a circular linked list we add pointers
Now assume that v2 = 0. That is, the second edge on to the next CW and CCW open edge and a flag to show
the CCW chain is v\q. In this case Lemma 1 says that whether the wedge lying between that edge and the next
pq is compatible, so we can halt and answer TRUE. open edge CCW from it is an open ordered pair or a
If vi is strictly inside Cq and v2 ^ q, then we claim closed interval. These new fields will only be maintained
that pq can not be compatible with T. Though we have for open edges, and will provide a doubly-linked circular
not yet found an existing edge VkX intersecting pq, we list of open edges around each point.
know that one exists, because assuming otherwise would
Maintaining this structure when a new edge pq is
lead to a contradiction. Suppose that pq were compati-
added to T is fairly straightforward. We will discuss
ble and were added to the triangulation. Then q, p, vi
updates at p; q is symmetric. If pq is the first edge in-
would be a CCW chain, so by Lemma 1 triangle qpvi
cident to p, the new edge will point to itself as an open
would contain no points in its interior and v\q would
ordered pair spanning 27r. If pq is added to the middle
be compatible. Because it is shorter than pq it would
of an open pair (x, y) (note that new edges can only be
already be in the triangulation. But then v\q would be
added between edges of an open ordered pair), we must
the next edge CCW around vl from pvi, contradicting
do two types of updates. First, (x,y) must be split into
the assumption that v2 i=- 9- Therefore pq cannot be
two pairs (x, q) and (q, y), which may be open or closed.
compatible.
To find out which, we must see if edges xq and yq are in
There is one remaining case, which is when V\ is inside
T, which can be done in constant time. Second, we must
rectangle R but not strictly inside circle C, v2 ^ q, and
see if the new edge closes off a previously open pair. To
v\v2 does not intersect pq. That this CCW chain will
do that, we see if the CCW edge from pq has the same
not lead to any edge intersecting pq follows directly from
endpoint w as the CW edge from qp (and the symmetric
Condition (3) of Theorem 1.
case on the other side). In either case, we must be able
We have now completed the proof of the correctness
to update the data structure so that a previously open
of our greedy edge test method. D
interval (x, y) is now closed. To do this the new closed
interval (x,y) must be merged with possible closed in-
2.2 Implementation and Analysis tervals lying to either side of it to form a single closed
interval. All of these tests and updates can be done in
We now discuss the implementation of our edge test and
constant time.
analyze its efficiency. We store our greedy triangulation
T as a graph using adjacency lists. Each adjacency list With this data structure, the edge test is done as
is represented as a circular linked list of edges ordered follows. The new edge pq is located in the circular list of
in polar (or rotational) order around the point. To find open edges at p and q. If pq falls in a closed interval for
CW and CCW chains from a new edge we must deter- either point, then the edge is not compatible. Otherwise
mine where in rotational order the new edge would fit. perform the test described in the previous subsection,
That would normally take 0(n) time, or O(logn) if we using the open edges as the first edges in the CW and
stored the circular list in a binary tree. Fortunately, CCW chains. This test will take time proportional to
we can use properties of the greedy triangulation to do the number of open edges.
better. Fortunately, the maximum number of open edges ad-
Let p be a vertex in T. We consider the neighbors of jacent to any point p is 10. This is because any pair
p (in T) in CCW order. Let x and y be two consecutive (x,y) with a < 7r/3 must be closed. Because a is not
neighbors, and let a be the CCW angle swept from px the largest angle in triangle pxy, we know that xy is
to py. We call the ordered pair (x, y) closed if a < TT and not the longest edge in the triangle. By Lemma 1, xy
xy is in T, and we call (x, y) open otherwise. (Note that is in T, which means that (x, y) is closed. Therefore ev-
if (x, y) is closed, by Lemma 1 the triangle pxy must be ery open pair has a > 7r/3, so so there cannot be more
empty, so no new greedy edges can connect to p between than six of them around p. If there are six, each edge
px and py.) We call an edge an open edge if it connects is shared by two open intervals, so there are only six
p to a point in an open ordered pair. A closed interval is edges. If there are five or fewer open pairs, then there
a wedge around p that is bounded by two adjacent open cannot be more than 10 open edges.
edges whose endpoints in CCW order do not form an To initialize the data structure we simply create n
open pair. (If the edges around p are viewed as spokes empty circular lists in 0(n) time. Because there are
of a wheel, then the open pairs will correspond to pairs 0{n) edges in the entire triangulation the total space
of spokes with no "rim" between them and the closed required by all lists is 0(n).

214
Thus we have a data structure that requires O(l) time
for an edge test or an update, 0(n) time to initialize,
and 0(n) space. For comparison, we end this subsec-
tion by noting that the method of Gilbert [10] requires
0(rz2logn) time for initialization, O(nlogn) time for
update, and 0(n2) space.

3 A Necessary Condition for an


Edge to be in the Greedy Tri-
angulation
We begin by stating a simple and obvious lemma.

Lemma 2 (Convex Quadrilateral Rule) Let


pqr and pqs be two empty triangles in a greedy trian-
gulation. If segment rs intersects segment pq (that is,
prqs is a convex quadrilateral), then d(p,q) < d(r,s).
Figure 1: Edges intersecting ab
Heath and Pemmaraju [12] describe this as the prop-
erty of "local optimality."
We now give an important (though less obvious) Since there are points on both sides of edge pq, it
lemma1 that states a necessary (but not sufficient) con- is not a CH edge, and therefore it must be an edge
dition for an edge to be a greedy triangulation edge. in two triangles - an upper and a lower. Let pw\q be
This is a variant of Lemma 3.1 in [21]. the upper triangle and let pz\q be the lower triangle.
If w\ and z\ are both in C, then d(wi,zi) < d(p,q)
Lemma 3 Let p,q be a pair of points in a set S. Con- and thus by Lemma 2 pq could not be a GT edge and
sider the disc D of radius 6 — d(p, q)/(2y/5) centered we have a contradiction. Without loss of generality, we
at the midpoint of pq. Let pq divide the disc into two therefore assume that wi is outside of C and is closer to
half-disks. If both half-disks contain at least one point q than to p. Since edge pw\ cuts off ab, it follows that
in S then pq cannot be in the GT of S. d(p, wi) > a.
For notational convenience, we also label all the GT
Proof Sketch For notational convenience, orient the edges intersecting segment ab. The GT edges above pq
plane so that segment pq is horizontal, with p on the left that intersect ab we will label ei,..., em and the edges
side. (For the remainder of the proof, refer to Figure 1.) below ab that intersect ab we label /i,..., /„. We now
Let a be the point closest to pq in the upper half-disk of give a case analysis on these edges. First, all of these
D, and let 6 be the point closest to pq in the lower half- edges cannot have both endpoints outside of or on C,
disk of D. Let C be the circle with pq as a diameter, because they comprise all of the edges crossing ab, and
and let a be the length of the shortest segment with all of them would be longer than a. But our choice of 8
endpoints on or outside of C that passes through D. causes a to be greater than 26, and by Observation 1,
Then a - sjd{p,q)2 - 4<52. one intersecting GT edge must be shorter than d(a,b).
We will give a proof by contradiction making use of The final two observations lead to our contradiction.
the following observation.

Observation 1 Let p\ and p2 be any pair of points Observation 2 At least one e,- and at least one fj
that are not connected by an edge in the GT. Then some must have an endpoint in C.
GT edge intersecting segment pip2 must have length
< d(pltp2).
Observation 3 If t^ is the first e,- to have an endpoint
Assume pq is a GT edge. Then ab cannot be a GT in C, then e\,..., e^-i are all of the form pwi for 1 <
edge, and by Observation 1 there must be some GT edge i < k — 1, and ejt is of the form xwk-i- Furthermore,
of length less than d(a, b) < 26 "cutting off" ab. We will x lies to the left of D. Finally, for some 1 < / < k — 1
show that no such edge exists either above or below pq. there is an point u>; that lies within d{p, q) of p. (See
'an earlier false version of this lemma with S = d(p, q)/2 was Figure 1 again.)
given in [6]. We give the corrected version here.

215
The Contradiction This structure is very constrain- Let us employ a constant 0 < 7 < 1, fixed for the
ing. We have constrained x to lie to the left of D and whole section. Given a set S of n points in the plane, we
inside of C. Furthermore, if x were closer to q than a, call a pair {p, q] of points in S plausible, if D'(p, q, rj) (~l
then by Observation 1 one of the e,- with 1 < i < k — 1 S = 0 or D"(p, q, n) n S = 0, with n = j\p - q\/2. The
would have to be shorter than a, which cannot be the previous section showed that if 7 = 1/V5, only plausible
case. (None of them have endpoints in C'.) Therefore x edges can be in a greedy triangulation. When 7 = 1
is at least a from q. Finally, x must lie below the ray only plausible edges can be Delaunay, so the lemmas we
from q that is tangent to D from above. prove about distributions of edge lengths apply to both
We have also constrained point wi to lie outside of C greedy and Delaunay triangulations.
near q, but inside the circle of radius d(p,q) centered at Our first goal is to estimate the expected number of
p. It must also lie below the ray from from p tangent to plausible pairs in a set S of n points, uniformily dis-
D from above. tributed in a convex compact region C. We normalize C
Observation 2 says that some edge fj will be the first to be of area 1 to simplify the notation.
edge below pq along ab with an endpoint y inside of Suppose p and q are points in C, so that D{p,q,ri)
C. But where can y lie? It must lie above either the is contained in C (ri as above). If we choose another
ray from p tangent to D from below or the ray from q n — 2 points at random from C, then the probability of
tangent to D from below. If it is in the left half of C, its {p, q} being plausible is the same as the probability that
distance to x will be less than a. If it is in the right half D'{p, q, n) is empty or D"(p, q, r{) is empty. This gives
of C, its distance to wi will be less than a. In either case us the following:
we have a contradiction, because all intervening edges
Prob({p, q}is plausible)
will be at least a long. (All of them have both endpoints
on or outside of C.) O < Prob{D' is empty) + Prob(D" is empty)
n-2

= 2 1
3.1 Comments on the Constant
The proof above requires a to be larger than a number of
different values. The strongest requirement arises in the We have to cope with pairs of points {p, q) where
last case, when we let y lie at the intersection of the ray D(p,q,ri) extends beyond the boundaries of C: For
from p tangent to D from below and C and we let wi lie p G C, let ß(p) denote the distance of p from the bound-
at the intersection of the ray from p tangent to D from ary of C, or, in other words, the largest radius of a disk
above and the circle of radius d(p, q) centered at p. The centered at p which is still contained in C. Then we
actual bound of d(p, g)/(2\/5) is derived from a slightly observe that for any pair if points p and q in C, the
worse configuration, which cannot be actually achieved. disk D(p, q, r2), r2 = (ß{p) + ß(q))/2, is contained in C.
We require that the intersection points between the two It follows that for any pair {p, q} C C the probability
rays from p tangent to D and the circle of radius d{p, q) of being plausible (after adding (n-2) random points) is
centered at p be at most a apart. This case is less than bounded by
2
5 percent worse than the actual worst case, and is less 2e-r 7r(n-2)/2
complicated to calculate and express.
We do not believe that our bound is tight. The for r = rPig := min{ri, r2}, with ri and r2 dependent on
worst example that we have been able to find is a di- p and q as previously specified. Now let p and q be two
amond with pq as its diameter, with two additional random points in a random set of n points in C. Then
points just outside of the midpoints of two opposite the probability of being plausible is bounded by
edges of the diamond. This case approaches the bound l f 2c-r^(„-2)/2 dqdp
5 = d(p, 5)/(2Vz) as closely as is desired.

< I I 2e-r^n-2)/2 dqdp


4 An Analysis of the Edges in the Jpec Jqec

Greedy Triangulation + [ i 2e-r^("-2)/2 dqdp . (2)


Jp£C JqCC

For two points p and q in the plane, and for a real num- In order to estimate the terms in (2) we use density
ber r > 0, let D(p, q, r) denote the closed disk of radius functions fp(x), p G C, and g(x). f^ fp(x)dx is the
r centered at (p+q)/2. The line through p and q defines probability for a random point in C to have distance at
two closed semidisks of D(p, q,r), denoted by D'(p, q, r) most z from p; clearly, fp(x) < 2xn for all p G C and
and D"(p, q, r) (without specifying which half is D' and x > 0. f_oo g(x)dx is the probability of a random point
D", respectively). in C to have distance at most z from the boundary of C;

216
here we have a bound of g(x) <U,U is the perimeter
of C, for all x> 0.
5 Greedy Triangulation Algo-
Now the left term in (2) equals rithms
/ jX 2/p(z)e-*V*(»-2)/8 dxdp These results lead to the following greedy triangulation
Jpec Jx=o algorithm:

< / 4xne-x3^<n-2ys dx
Jx=0 5.1 Algorithm 1
16
Step 1: Generate all plausible pairs with rx <
72(n-2)
B. To do this, we generate all pairs of points separated
by a distance of at most 2B/j. This is the fixed-radius-
The right term in (2) equals near-neighbors problem [2, 7]. In this case a bucketing
algorithm by Bentley, Stanat, and Williams can solve
/ 9(x) / 9{y)2e-(*+y?^--»l*dydx the problem in time 0(n + m), where m is the number
Jx=0 Jy=0 of pairs that lie within 2B/y of one another. As each
pair is generated, test to see if it is plausible using the
< 2U2 / / e-^M"-2)/*^*
Jx=0 ./y=0 method described below.
8£/5
Tt(n - 2) Step 2: Generate all plausible pairs with r2 <
B. The easy way to do this is to find all points within
Lemma 4 Let X be the random variable for the number 25 of the boundary of C and to generate all pairs. How-
of plausible pairs in a random set S of n > 4 points ever, this can generate pairs with r2 as long as 25. By
uniformly distributed in a convex region of area 1 and sorting the points within 25 of the boundary of C in
perimeter U. Then order of their distance from the boundary one can gen-
erate only the pairs needed by matching each point with
U2 2
E(X) < 4(n + 2)(— + 4) = 0(U2n points further from the boundary than itself only until
IT ~fz
r2 > 5, then going on to the next point. Also, note
and that pairs that also have rx < B can be ignored, be-
cause they were generated in Step 1. Test each pair to
E{X\ogX) < 2E{X)\ogn = 0(U2n\ogn) . see if it is plausible.

Step 3: Generate the greedy triangulation of


the plausible pairs generated in Steps 1 and 2.
Let us call a pair {p, q} c C a candidate (for being plau- To do this, first sort the pairs in increasing order of
sible), if r = rp,? < 5, where 5 := ^(c In n)/(n - 2) distance between the points. Start with an empty tri-
for a constant c. Our next goal is now to show, that angulation, and attempt to create an edge between each
a random set does not contain too many candidates, pair in turn, failing to create the edge if it fails the com-
and-with high probability-all plausible pairs are indeed patibility test described above.
candidates. We use a similar method of splitting the
problem into inequalities, and arrive at the following
lemma: 5.2 Testing to See if a Pair is Plausible
Lemma 5 Let Y be the random variable for the num- We need a fast test to see if an edge is plausible. One
ber of candidates in a random set S of n > 4 points way to do this uses a grid of squares. As a preprocessing
uniformly distributed in a convex region of area 1 and step, cover C by a grid of 0(n) squares, each with side
perimeter U. Then 1/Vn- For each bucket, create a list of the points in
S that fall in that bucket. Then to test a pair (p,q),
E Y
compute D(p,q,r), with r = mm(ri,r2) as described
( )<\^ + U2)c(n + 2)lnn = 0{U2cnlogn) . above. Go through the squares that overlap D'(p, q, r)
until you find a point lying in D'(p,q,r) or find'that
The probability that there exists a plausible pair that is no such point exists. Similarly go through the squares
not a candidate is bounded by that overlap D"(p, q, r) until you find a point lying in
this half-disk or find that no such point exists. If either
„2-CT/2
half-disk is empty, the point is plausible. In searching
through the grid squares, start with the squares with
maximum overlap with the half-disk.

217
For uniformly distributed points this test will run in 5.4 Algorithm 2
O(l) expected time. The probability that a grid square
We turn Algorithm 1 into a two-phase algorithm. We
that lies completely in C contains no point from S is
run Steps 1 and 3 of Algorithm 1, but skip Step 2. What
(1 - 1/n)". This is always less than e_1. Therefore the
we will be left with at the end of this process is a par-
probability that a given grid square contains a point
tial greedy triangulation. All of the short edges will be
is greater than 1 - e~l > 0.63. This implies that a
present, but no edge longer than 2B/j will be present.
search through grid squares looking for a non-empty
But Lemma 5 implies that with very high probability,
one is expected to look at fewer than 2 squares. When
all edges that have either endpoint at least 2B/j from
r is small enough that no full grid squares overlap a
the boundary of C will be present. We will call points
half-disk, then only a constant number of grid squares
at least 25/T from the boundary interior points. We
overlap the half-disk. When r is larger, the number
call a greedy triangulation edge with an interior point
of grid squares examined before an point is found is
as (at least) one of its endpoints an interior edge. The
expected be a constant.
expected number of interior edges that are missing is
Unfortunately, a bad distribution of points could
bounded by the expected number of plausible edges
cause this test to look at 0(n) squares for a very long
which are not candidates, so is at most n2_C7r'2 . As
edge. To prevent this, we stop testing after looking at
long as c is chosen to be at least 4/TT this is 0(1) edges.
clnn squares for some c that we choose. Thus the test
This implies that at most 0(1) interior points will not
could occasionally decide that a half-disk is empty when
be closed (as defined in the edge test section). This is
it in fact is not. Thus a candidate could occasionally be
because a missing edge can cause at most four points
considered plausible when it is not. But this will happen
to be not closed (the four vertices of the quadrilateral
with probability less than (1-e"1)'1™ = n«8"1)"1).
with the missing edge as diagonal).
This is about n"-46c. We can therefore choose c so that
the expected number of edges on which the test fails is This observation leads to a new Step 2'.
o(l), and this limitation will avoid bad worst-case times
without hurting expected times.
Step 2': Generate plausible long pairs Gener-
ate all possible pairs of non-closed points, and reject all
5.3 Analysis of Algorithm 1 implausible pairs. Sort these pairs, and continue run-
ning Step 3 of Algorithm 1 with these pairs as well.
Given this test for plausible pairs, it is easy to show that
Algorithm 1 runs in 0(n log n) expected time. By using
the floor function we can do the preprocessing for the Because all short pairs are tried and then all longer
edge test in 0(n) time. By Lemma 5 the number of pairs pairs that could possibly create an edge are tried, the al-
considered in Steps 1 and 2 is O(nlogn). Each test for gorithm will correctly generate the greedy triangulation
plausibility takes constant expected time, so these steps of any set of points.
require 0(n log n) time. By Lemma 4 the number of The edge test data structure keeps track of the list
pairs that are generated in Steps 1 and 2 that are plau- of incident open edges for each point. A point which is
sible is 0(n). Sorting these takes 0{n logn) time, and closed will have incident edges, but no open edges in its
the compatibility test for each takes 0(1) time. There- list.
fore Step 3 and the entire algorithm require 0{n log n) Will this step generate too many candidate pairs?
time and 0(n) space. In the worst case the algorithm The number of interior points that are not closed is
could take 0(n log2 n) time and 0(n log n) space. 0(1). Non-interior points lie within 2B/j of the bound-
Unfortunately, this algorithm is not guaranteed to ary of C. The total number of non-interior points is ex-
generate the greedy triangulation. It will generate it pected to be at most 2BUn/j, because 2BU/j is an
with probability l-n2'™!2 , and because we can choose upper bound on the area close enough to the boundary
c as large as we like we can make this probability ar- of C Therefore the total number of candidate edges
bitrarily close to 1. But the algorithm could fail to generated in Step 2' is ("Unh+o^ = 0(n\ogn).
produce a triangulation, either because neither diago-
Lemma 4 says that the total expected number of plau-
nal of a quadrilateral was a candidate or because the
sible pairs is 0(n), so Step 2' is expected to gener-
edge compatibility test (which depends on the correct-
ate 0(n) plausible pairs. Therefore sorting and testing
ness of the partial triangulation) could fail if edges were
these for compatability will take O(nlogn) time.
missing. Alternately, it could produce a triangulation
that was not the greedy one, and there is no known fast This shows that Algorithm 2 will always compute the
way to verify the correctness of a greedy triangulation. greedy triangulation and is expected to run in 0(n log n)
Fortunately, a minor modification of the algorithm time, using O(n) space. In the worst case it could take
0(n2 log n) time and 0(n2) space.
will eliminate this problem.

218
5.5 Algorithm 3 - An Algorithm that improvement over previous methods.
Depends Less on the Uniform Dis- We then proved a necessary condition involving half-
tribution disks for an edge to be in the greedy triangulation. This
lead to theorems on the number of pairs of points that
Algorithm 2 depends heavily on the uniform distribu- were plausible and that were candidates to be plausible
tion, both to get a fast expected-time test for plausibil- edges.
ity and to tell when to end the first phase and begin the Finally, we used these characterizations and the com-
second. The following algorithm is a variant that is less patibility test to prove the correctness and runtime of
sensitive to the exact distribution. It will dynamically several new algorithms for computing the greedy tri-
decide when to switch from one phase to the next in angulation. On uniformly distributed points we can
an attempt to balance the amount of work done in each compute the greedy triangulation in expected time
phase. O(nlogn) and space 0(n).
In the first phase it generates possible edges in in- Some obvious questions arise from this work.
creasing order using an algorithm of Dickerson, Drys-
Problem 1 OPEN We can construct a point set for
dale, and Sack [8]. (Algorithms to enumerate the k
which Algorithm 3 would require 0(n2 log n) time. How-
closest interpoint pairs have been invented by by Sa-
ever this set is highly structured and non-random. What
lowe and by Lenhof and Smid, but because they need to
is the expected run time for Algorithm 3 for random dis-
know k in advance they are less appropriate in this con-
tributions other than the uniform distribution?
text [30, 16].) When the number of pairs of not closed
points is proportional to the number of pairs already ex- Problem 2 OPEN Is there a greedy triangulation al-
amined, it starts over, enumerating pairs of not closed gorithm requiring o(n2) time in the worst case? Note
points in increasing order (similar to Step 2' above). that with our edge test, a way to enumerate all pairs
How do we know when to switch over? We keep track of points in increasing order by distance in 0(n2) time
of the number of points which are not closed. When would lead to an 0{n2) algorithm for the GT, but would
during an edge insertion a point becomes closed, we sub- not lead to an o(n2) algorithm.
tract 1 from the number of non-closed points c. When
c2/2 is greater than the number of edges tested so far, Problem 3 OPEN What is the true worst-case ra-
tio for 6 in Lemma 3? We have bounded it between
the number of edges generated in the second phase will
equal the number in the first, so we change to the second d(p, <z)/(2\/5) and d(p, q)/(2y/2).
phase.
References
5.6 Analysis of Algorithm 3
[1] A. Aggarwal and L. J. Guibas and J. Saxe and P.
Generating the next pair in increasing order requires Shor, "A linear time algorithm for computing the
O(logra) time, and a compatibility test takes 0(1) time. Voronoi diagram of a convex polygon ." Discrete
Therefore the algorithm runs in time O(logn) times the Comput. Geom. 4 (1989) 591-604.
number of pairs generated. It requires space propor-
tional to the number of pairs generated. [2] J. Bentley, D. Stanat and E. Williams Jr., "The
complexity of finding fixed-radius near neighbors."
For the uniform distribution, we have already seen
Information Processing Letters 6 (1977) 209-213.
that all interior points are expected to be closed af-
ter examining 0(n log n) edges, and that at that point [3] P. L. Chew, "Constrained Delaunay triangulations."
the number of points which are not closed is O(Bn) = Proceedings of the Third Annual ACM Symposium
0{y/n\ogn). Therefore the number of pairs in the on Computational Geometry (1987) 215-222.
second phase will be 0(n log n). This implies that
the algorithm is expected to take 0(n log2 n) time and [4] R. C. Chang and R. C. T. Lee, "On the average
0(n log n) space for a uniform distribution. length of Delaunay triangulations." BIT 24 (1984)
269-273.
[5] F. Dehne, Flach, J.-R. Sack, and R.Valiveti, "Ana-
6 Summary and Open Problems log Parallel Computational Geometry." Proceedings
of the 5th Canadian Conference on Computational
We have given a new method for testing edge compati-
Geometry (1993) 143-153.
bility in a greedy triangulation. The method is based on
Theorem 1, the CW/CCW chain theorem, which states [6] M. Dickerson, "Expected rank of the longest edge
an interesting property of greedy triangulations. Our in the greedy triangulation." Proc. of the 4th Cana-
method requires only O(l) time for both the compati- dian Conference on Computational Geometry (1992)
bility test and updates operations. This is a significant 182-187.

219
[7] M. Dickerson and R. S. Drysdale, "Fixed-radius [21] A. Lingas, "The greedy and Delaunay triangula-
near neighbors search algorithms for points and seg- tions are not bad in the average case." Information
ments." Information Processing Letters 35 (1990) Processing Letters 22 (1986) 25-31.
269-273.
[22] A. Lingas, "On Approximating Behavior and Im-
[8] M. Dickerson, R.L. Drysdale, and J-R Sack, "Simple plementation of the Greedy Triangulation for Con-
Algorithms for enumerating interpoint distances and vex Planar Point Sets." Proceedings of the Second
finding k nearest neighbors." International Jour- Annual ACM Symposium on Computational Geom-
nal of Computational Geometry and Applications 3 etry (1986) 72-79.
(1992) 221-239.
[23] A. Lingas, "A new heuristic for the minimum
[9] R. D. Düppe and H. J. Gottschalk, "Automatische weight triangulation." SIAM Journal of Algebraic
Interpolation von Isolinien bei willküerlich verteil- and Discrete Methods 8 (1987) 646-658.
ten Stützpunkten." Allgemeine
Vermessungsnachrichten 77 (1970) 423-426. [24] A. Lingas, "Greedy triangulation can be effi-
ciently implemented in the average case." Proceed-
[10] P. Gilbert, "New results in planar triangulations." ings of Graph-Theoretic Concepts in Computer Sci-
MS Thesis, University of Illinois, Urbana, IL, 1979. ence (1988) 253-261.

[11] S. Goldman, "A Space Efficient Greedy Triangula- [25] E. Lloyd, "On triangulations of a set of points in
tion Algorithm." Information Processing Letters 31 the plane." Proceedings of the 18th FOCS (1977)
(1989)191-196. 228-240.

[12] L. Heath and S. Pemmaraju, "New results for the [26] G. Manacher and A. Zobrist, "Neither the greedy
minimum weight triangulation problem." Virginia nor the Delaunay triangulation of the planar set ap-
Polytechnic Institute and State University, Depart- proximates the optimal triangulation." IPL 9 (1979)
ment of Computer Science, TR 92-30 (1992). To 31-34.
appear in Algorithmica.
[27] G. Manacher and A. Zobrist, "Probabilistic meth-
[13] D. Kirkpatrick, "A note on Delaunay and optimal ods with heaps for fast-average-case greedy algo-
triangulations." Information Processing Letters 10 rithms." Advances in Computing Research vol. 1
(1980) 127-128. (1983) 261-278.

[14] G. Klincsek, "Minimal triangulations of polygonal [28] D. A. Plaisted and J. Hong, "A heuristic triangu-
domains." Ann. Discrete Math. 9 121-123. lation algorithm." J. Algorithms 8 (1987) 405-437.

[15] D. T. Lee and A. K. Lin, "Generalized Delaunay [29] F. Preparata and M. Shamos, "Computational Ge-
triangulations for planar graphs." Discrete Comput. ometry: an introduction." Springer-Verlag, 1985.
Geom. 1 (1986) 201-217.
[30] J.S. Salowe, "Enumerating distances in space." In-
[16] H. P. Lenhof, M. Smid, "Enumerating the ^-closest ternat. J. Comput. Geometry Appl. 2 (1992) 49-59
pairs optimally." Proceedings of the 33rd FOCS,
[31] C. A. Wang, "Efficiently updating the constrained
(1992) 380-386.
Delaunay triangulations." BIT 33 (1993) 238-252.
[17] C. Levcopoulos, "An U(y/n) Lower Bound for the
[32] Y.F. Wang and J.K. Aggarwal, "Surface recon-
Nonoptimality of the Greedy Triangulation." Infor-
struction and representation of 3-D scenes." Pattern
mation Processing Letters 25 (1987) 247-251.
Recognition 19 (1986) 197-207.
[18] C. Levcopoulos and A. Lingas, "On Approximating
[33] C. A. Wang and L. Schubert, "An optimal algo-
Behavior of the Greedy Triangulation for Convex
rithm for constructing the Delaunay triangulation
Polygons." Algorithmica 2 (1987) 175-193.
of a set of line segment." Proceedings of the Third
[19] C. Levcopoulos and A. Lingas, "Fast Algorithms Annual ACM Symposium on Computational Geom-
for Greedy Triangulation." BIT 32 (1992) 280-296. etry (1987) 223-232.

[20] C. Levcopoulos and A. Lingas, "Greedy Triangu- [34] P. Yoeli, "Compilation of data for computer-
lation Approximates the Minimum Weight Trian- assisted relief cartography." In Display and Analysis
gulation and Can be Computed in Linear Time in of Spatial Data J.C.Davis and M.J. McCullagh, ed-
the Average Case." Tech. Report LU-CS-TR:92-105, itors, John Wiley & Sons, NY (1975).
Dept. of Computer Science, Lund University, 1992.

220
Linear-size Nonobtuse Triangulation of Polygons
Marshall Bern * Scott Mitchellf Jim Ruppert *

Abstract tied this aversion for one important application area by


proving convergence of the finite element method [25]
We give an algorithm for triangulating n-vertex polyg- as triangle sizes diminish, so long as the maximum an-
onal regions (with holes) so that no angle in the final gle is bounded away from n. They also gave an example
triangulation measures more than 7r/2. The number of in which convergence fails when angles grow arbitrar-
triangles in the triangulation is only 0(n), improving ily flat. (An elementary example in which large angles
a previous bound of 0(n2), and the worst-case running spoil convergence is Schwarz's paradox [22].)
time is 0(nlog n). The basic technique used in the Any bound smaller than 7r implies convergence in
algorithm, recursive subdivision by disks, is new and Babuska and Aziz's model, but a bound of TT/2 on the
may have wider application in mesh generation. We largest angle has special importance. First of all, any
also report on an implementation of our algorithm. stricter non-varying requirement would also bound the
smallest angle away from zero; for some inputs (such
as a long, skinny rectangle) this forces the triangula-
1. Introduction tion to contain a number of triangles dependent on the
geometry—not just on the combinatorial complexity—
The triangulation of a two-dimensional polygonal re- of the input. Second, a nonobtuse triangulation is
gion is a fundamental problem arising in computer necessarily a (constrained) Delaunay triangulation [8].
graphics, physical simulation, and geographical infor- Third, a nonobtuse triangulation admits a perpendicu-
mation systems. Most applications demand not just lar planar dual, that is, an embedding in which dual
any triangulation, but rather one with triangles satis- edges cross at right angles. Such an embedding is con-
fying certain shape and size criteria [9]. In order to venient for the "finite volume" method [25]. Finally,
satisfy these criteria, one typically allows triangles to a nonobtuse triangulation has better numerical proper-
use new vertices, called Steiner points, that are not ties [3, 27]. In particular, Vavasis [27] recently proved
vertices of the input polygon. The number of Steiner that for finite element problems with physical char-
points should not be excessive, however, as this would acteristics that vary enormously over the domain, a
increase the running time of computations. nonobtuse mesh implies faster convergence of a certain
Throughout the application areas named above, it is numerical method.
generally true that large angles (that is, angles close These properties have established nonobtuse triangu-
to 7r) are undesirable. Babuska and Aziz [2] justi- lation as a desirable goal in finite element mesh gener-
* Xerox Palo Alto Research Center, 3333 Coyote Hill Rd., Palo
ation. Several heuristic methods have been developed
Alto, CA 94304 to compute nonobtuse triangulations [4, 20]. Baker,
t Applied and Numerical Mathematics Dept., Sandia National Grosse, and Rafferty [3] gave the first provably-correct
Laboratories, Albuquerque, NM 87185. This work was supported algorithm. Their algorithm also bounds the smallest
by the Applied Mathematical Sciences program, U.S. Department
of Energy Research and by the U.S. Department of Energy under
angle away from zero, and hence necessarily uses a num-
contract DE-AC04-76DP00789. ber of triangles dependent upon input geometry. Melis-
»NASA Ames Research Center, M/S T27A-1, Moffett Field, saratos and Souvaine [16] gave another algorithm of this
CA 94035. The author is an employee of Computer Sciences type.
Corporation, supported under NASA contract NAS 2-12961.
From the point of view of theoretical computer sci-
Permission to copy without fee all or part of this material is ence, however, it is important to determine the inher-
granted provided that the copies are not made or distributed for ent complexity of nonobtuse triangulation, apart from
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given no-small-angle triangulation. Bern and Eppstein [8] de-
that copying is by permission of the Association of Computing vised a nonobtuse triangulation algorithm using 0(n2)
Machinery. To copy otherwise, or to repubiish, requires a fee triangles, where n is the number of vertices of the input
and/or specific permission.
domain. This result demonstrates a fundamental com-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791 -648-4/94/0006..$3.50
221
Figure 1. (a) Disk packing. (b) Induced small polygons. (c) Final triangulation.

plexity separation between bounding large angles and gles share entire sides. Figure 1(c) shows the resulting
bounding small angles. Bern, Dobkin, and Eppstein [7] nonobtuse triangulation.
later improved this bound to 0(n1S5) for convex poly- This algorithm is circle-based, rather than grid-based
gons. like the previous polynomial-size nonobtuse triangula-
In this paper, we improve these bounds to linear, us- tion algorithm [8]. Analogously, the problem of no-
ing an entirely different—and more widely applicable— small-angle triangulation has grid-based [10] and circle-
technique. Aside from sharpening the theory, our based [23] solutions. In retrospect, circle-based algo-
new algorithm boasts other advantages: it parallelizes, rithms offer a more natural way to bound angles, as
thereby placing nonobtuse triangulation in the class well as meshes more intrinsic to the input domain.
MC; and it does not use axis-parallel grids, so the out- This conclusion is supported by two more examples.
put has no preferred directions. Our algorithm also In the second stage of this paper's algorithm, certain
improves results of Bern et al. [7] on no-large-angle tri- misshapen small polygons cause technical difficulties;
angulation. The superseded results include an algo- these are neatly solved by packing in more disks. (One
rithm guaranteeing a maximum angle of at most 5fl"/6 of these additional disks is the second from the left along
that uses 0(n log n) triangles for simple polygons and the bottom side of Figure 1(b).) In other recent work,
0(n3'2) triangles for polygons with holes. Mitchell uses the "angle buffering" property of circles
to give a triangulation, restricted to use only interior
Steiner points, with linear size and largest angle nearly
2. Overview of the Algorithm as small as possible [18].

Our algorithm consists of two stages. The first stage


(Section 3) packs the domain with non-overlapping 3. Disk Packing
disks, tangent to each other and to sides of the domain.
The disk packing is such that each region not covered In this section, we describe the first stage of the algo-
has at most four sides (either straight sides or arcs), as rithm. Let P denote the input: a region of the plane
shown in Figure 1(a). The algorithm then adds edges bounded by a set of disjoint simple polygons with a to-
(radii) between centers of disks and points of tangency tal of n vertices. An arc-gon is a simple polygon with
on their boundaries, thereby dividing the domain into sides that are arcs of circles. The circles may have var-
small polygons as shown in Figure 1(b). ious radii, including infinity (which implies a straight
The second stage (Section 4) triangulates the small side).
polygons using Steiner points located only interior to Throughout the disk-packing stage, we make use of
the polygons or on the domain boundary. Restricting the generalized Voronoi diagram (GVD), which is de-
the location of Steiner points ensures that triangulated fined by proximity to both edges and vertices. The in-
small polygons fit together so that neighboring trian- terior points of polygonal region P are divided into cells

222
a hole boundary are considered to be part of the hole.
At the end, the large remainder region is bounded by a
simply-connected arc-gon with 0(n) sides. Every cor-
ner of this arc-gon has angle 0, since each results from
a tangency.
The second step can be implemented in time
Figure 2. Adding disks at (a) convex and (b) concave cor- 0(n log n). We use a data structure that answers
ners of polygonal region P. queries of the following form: given a query point p,
which data object (vertex, edge, or disk) will be hit
first by an expanding circle tangent to a vertical line
according to the nearest vertex of P, or the nearest edge through p (tangent at p and to the left of the line)? Such
(viewing each edge as an open segment). The resulting a query can be answered using Fortune's *-map [13], a
partition consists of a set of bisectors, either line seg- sort of warped Voronoi diagram.
ments or parabolic arcs; it is essentially the same as the The initial set of data objects includes the edges, ver-
medial axis [21]. The GVD can be similarly defined for tices, and disks attached to the outer boundary of the
arc-gons, or more generally for arbitrary collections of input polygon. The first query point is the leftmost
points, segments, and circular arcs. The GVD of a col- point on a hole. The answer determines a disk D en-
lection of n points, segments, and arcs can be computed tirely contained within the polygon, touching both the
in time O(nlogn) [13]. hole and the outer boundary. Disk D is inserted into
The disk-packing stage consists of three smaller steps. the query data structure, along with the vertices, edges
First, one or two disks are placed at each vertex of the and disks of the hole. Each subsequent query is per-
polygon. Second, holes in the polygon are connected formed using the leftmost point of all remaining holes.
to the boundary by adding disks tangent to two holes, Altogether, the queries yield a set of disks connecting
or to a hole and the outer boundary. Third, disks are all holes and the exterior of the polygon.
added to the as-yet-uncovered regions (called remainder For a static set of data objects, the *-map can be
regions), recursively reducing their complexity until all built in time 0(n log n) [13], and standard planar sub-
have at most four sides. division search techniques [21] yield an O(logn) query
time. In our case, the set of data objects is not fixed,
Disks at Corners. The first step preprocesses P so since edges and a disk are added following each query. A
that we need only consider arc-gons with angle 0 at each trick due to Bentley and Saxe [5] allows dynamic inser-
vertex. At every convex vertex of P, we add a small tions to the query structure, with query time 0(log n)
disk tangent to both edges, as shown in Figure 2(a). At and amortized insert time 0(log2 n). The trick is to di-
every concave vertex of P, we add two disks of equal vide the n data objects among 0(log n) data structures,
radii, tangent to the edges, and tangent to the angle one for each bit in the binary representation, of n. A
bisector at the corner, as shown in Figure 2(b). We can query searches all data structures in 0(log n) time. An
handle point holes by centering small disks at them. insertion rebuilds all the data structures corresponding
We choose radii small enough that disks lie within P, to bits that change. The total time required for n in-
and none overlap (that is, intersect at interior points). sertions is 0(nlog2 n).
This step isolates a small 3- or 4-sided remainder region
at each corner of P. The large remainder region is an Reducing to 3- and 4-Sided Remainder Regions.
arc-gon of 2n + r = 0(n) sides, where n is the number After the first two steps, there is one simply-connected
of vertices of P and r is the number of concave corners. remainder region A with 0(n) sides, and 0(n) remain-
The first step can be implemented in time 0(n log n) der regions in corners with three or four sides. The final
using the GVD of P. By checking the adjacencies of step of the disk-packing stage recursively subdivides A
GVD cells, we can determine the nearest non-incident by adding disks. The result will be a linear number of
edge for each vertex v of P; one-eighth this distance remainder regions of three and four sides.
gives a safe radius for the disks next to v. (Our imple- To subdivide arc-gon A, we add a disk tangent to
mentation actually uses some other choices of radii to three of its sides. Such a disk divides the region enclosed
reduce output size.) by the arc-gon into four pieces: the disk itself and three
smaller regions bounded by arc-gons. We choose a disk
Connecting Holes. The second step connects polyg- tangent to three sides of A, not all of them consecutive,
onal holes to the outer boundary by repeatedly adding thereby ensuring that each of the three smaller arc-gons
a disk tangent to two or more connected components has at most n — 1 sides. As shown in Figure 3, a disk
of the boundary. In this step, previous disks touching tangent to three sides of an arc-gon must be centered

223
Figure 4. Remainder regions with vertices of P.

choosing a disk centered at a centroid of the GVD of A,


Figure 3. A disk tangent to three edges of an arc-gon is we split A into arc-gons A\, A2, and A3. We imagine
centered at a vertex of the GVD. splitting Ai, A2, and A3 in parallel, so that altogether
there will be O(logn) splitting stages, each involving a
set of arc-gons of total complexity 0(n). If we recom-
at a vertex of the GVD. Since A is simply connected,
pute GVD's from scratch after each splitting stage, we
the edges of its GVD form a tree, a fact that will be
obtain total time 0(nlog2 n). This can be improved to
useful in bounding the running time. 0(n log n) by rebuilding GVD's in linear time, using an
adaptation of the algorithm due to Aggarwal et al. [1].
Lemma 1. It is possible to reduce all remainder
regions to at most 4 sides, by packing 0(n) non-
overlapping disks into arc-gon A. 4. Triangulating the Pieces
Proof: Each vertex of the GVD corresponds to a disk We now describe the second stage of our algorithm. At
tangent to three sides of A. If A has at least five sides, this point, polygonal region P has been partitioned into
then there is a vertex v of the GVD that is adjacent to disks and remainder regions with three or four sides,
two non-leaf vertices of the GVD; a disk centered at v is either straight or circular arcs. Each circular arc of a
tangent to three sides of A that are not all consecutive. remainder region R is naturally associated with a pie-
Now let d(n) be the maximum number of disks shaped sector, namely the convex hull of the arc and
needed to reduce an n-sided arc-gon to 3- and 4-sided the center of the circle containing the arc. We denote
remainder regions. We prove d(n) < n — 4 by induction the union of R and its associated sectors by R+. These
on n. The base cases are <i(3) = 0 and rf(4) = 0. augmented remainder regions define a decomposition
For the inductive step, notice that adding one disk of P into simple polygons with disjoint interiors. In
produces three new arc-gons. (We can simply ignore an augmented remainder region, we retain vertices at
extra tangencies in the degenerate case of four or more circle tangencies; vertices such as these, at which the
tangencies.) Suppose the new arc-gons have k,l,m angles measure ir, are called subdivision points.
sides, respectively, with 3 < k < I < m. Since we In this section, we show how to triangulate each R+
are choosing non-consecutive sides, m < n. Counting region. All Steiner points will lie either on straight
1 for the added disk, we have that d(n) < 1 + d(k) + sides of R (that is, along P's boundary) or interior to
d(l) + d(m). Since the disk divides three sides, and is R+. Thus we never place Steiner points on the radii
itself divided in three places, we have k + l + m = n + 6. bounding sectors, and triangulated R+ regions will fit
First suppose k = 3. Since we are choosing non- together at the end. Our triangulation method is given
consecutive sides, / > 4, so in three cases: remainder regions with vertices of P,
three-sided remainder regions, and four-sided remain-
d(n) < 1 + rf(3) + d(l) + d(m) der regions. The first two cases are easy, but the last is
< 1 + 0 + (/ - 4) + (m - 4) quite intricate. In all cases, triangulating a single R+
= (/ + m)-7 = (n + 3)-7 = n-4. region takes 0(1) time, so altogether the running time
of the second stage is 0(n).
When k > 4, we have d(n) < 1 + d{k) + d{l) + d(m). By
Remainder Regions with Vertices of P. Every
induction, d(n) < 1 + (k - 4) + (/ - 4) + (m - 4), which
vertex of P was isolated by one or two disks in the first
is equal to (k + 1 + m) — 11 = (n + 6) - 11 = n — 5. I
step of the algorithm. The resulting regions R+ can be
Finally we comment on running time. Any tree con- triangulated with at most four right triangles, as shown
tains a vertex, called a centroid, whose removal leaves in Figure 4, by adding edges from the disk centers to
subtrees of size at most two-thirds the original size. By the points of tangency and the vertex of P.

224
Figure 5. Three-sided remainder regions: (a) with a straight
side, (b) with only finite-radius arcs. Figure 6. The good case for four-sided remainder regions.

Three-Sided Remainder Regions. A three-sided Proof: If all arcs have finite radius, then the sum of
remainder region R without a vertex of P is bounded the measures of the arcs of R is identical to the sum of
by three circular arcs, so that arcs meet tangentially at the measures of the angles at the corners of R+. For
the vertices of R. Here we are considering a straight straight sides, we imagine further augmenting R+ with
side to be an arc of an infinitely large circle. We call "infinite sectors" of angle 0.
a Steiner point in an augmented remainder region R+
Next we show that the vertices are cocircular. Let
safe if it lies either interior to R+ or on the boundary
C\ and C*3 be finite-radius circles containing opposite
of P.
arcs of R. (Here notice that if R has two straight sides,
Lemma 2. If R is a three-sided remainder region, they must be opposite.) Assume the two lines that
then R+ can be triangulated with at most six right are externally tangent to both C\ and C3 meet at a
triangles, adding only safe Steiner points. point a;. There exists an inversive transformation ([11],
pp. 77-95) of the protective plane that maps x to infin-
Proof: First assume that R has a straight side (nec- ity and hence the two external tangent lines to parallel
essarily at most one), and view R so that this straight lines. The transformed circles C[ and C3, correspond-
side forms a horizontal base. The augmented region R+ ing to C\ and C3, have equal size, so the vertices of
is a trapezoid with two vertical sides, and a subdivision the transformed remainder region R' form an isosceles
point p along its slanted top side. We cut perpendic- trapezoid. It is easy to see that any isosceles trapezoid
ularly from p (that is, tangent to both arcs) across R has cocircular vertices. The inverse of the original in-
until we hit the base, and there add a safe Steiner point versive transformation maps the circle containing the
s. We add edges from s to the centers of the arcs' cir- vertices of R' to a circle containing the vertices of R. I
cles to divide R+ into four right triangles, as shown in
Figure 5(a). Now if we are lucky, the region R+ can be triangu-
lated with 16 right triangles, as in the following lemma.
Now assume all the sides of R are arcs of finite ra-
dius. Notice that R+ is a triangle with subdivided sides.
Moreover, the subdivision points along the sides of R+ Lemma 4. If R is a four-sided remainder region, in
are exactly the tangency points of the inscribed circle which each arc measures at most w and the center of
of R+. (This follows from the fact that the inscribed the circle through R's vertices lies in the convex hull of
circle makes each corner of R+ incident to two edges of R, then R+ can be triangulated with 16 right triangles,
equal length.) So we add the circle's center c and edges adding only safe Steiner points.
from c to all the vertices around R+, dividing R+ into
six right triangles, as shown in Figure 5(b). I Proof: We may assume that all arcs of R have finite
radius. If R has a straight edge, we can apply the trian-
Four-Sided Remainder Regions. A four-sided re- gulation to a region with an infinite sector attached to
mainder region R is bounded by four circular arcs (pos- the straight edge and then simply remove the resulting
sibly of infinite radius) that meet tangentially at the infinite strips.
vertices of R. Lemma 3 states two interesting proper- The construction is shown in Figure 6. Here we have
ties of these regions. added the center c of the circle through i?'s vertices in
order to form four kites (quadrilaterals with two adja-
Lemma 3. The arcs ofR have total measure 2ir. The cent pairs of equal-length sides). ■
vertices of R are cocircular.

225
Figure 8. (a) Mutual tangents and mutual chord meet at a point. (b) Triangulation.

Proof: Again we may assume that all arcs of R have


finite radius, as a solution to this case implies a trian-
gulation for the case of straight sides.
Consider one of the arcs S next to C*. We claim that
the lines tangent to S at its endpoints and the mutual
chord of C* and its opposite arc all meet at a single
point p interior to R, as shown in Figure 8(a). This
Figure 7. New circle C breaks up a reflex remainder region. claim allows the triangulation shown in Figure 8(b).
Why is the claim true? For each of the three disks—
C*, the opposite disk, and the one with arc S—we
The triangulation of Figure 6 can fail in two different
define a power function. The power function of a
ways: (1) if one of the arcs of R measures more than rr (a
circle with center (xc,yc) and radius r is P(x,y) =
reflex arc), then R+ has a reflex vertex at which angles
(x — xc)2 + (y-yc)2—r2. The power functions of two tan-
will measure more than 7r/2; and (2) if center c lies
gent circles are equal along their mutual tangent line;
outside the convex hull of R, then it lies on the wrong
the power functions of two overlapping circles are equal
side of one of the chords and will introduce unwanted
along a line containing their mutual chord. The point
intersections. Each of these difficulties will be handled
p of the claim is the point at which all three power
by adding yet another disk.
functions are equal. ■
First assume R has a reflex arc on circle C3. Add
another disk C*, tangent to C3 and C\ (the circle con- We now consider the second difficulty. Call a four-
taining the arc opposite C3), such that the center of sided remainder region R centered if the convex hull
C* lies on the line joining the centers of C\ and C3. of R contains the center c of the circle through R's
The new disk C*—unlike any of the disks used up un- vertices, and uncentered otherwise. Let the arc of R
til this point—may overlap an old disk and produce with the longest chord lie along circle C\, and denote
a self-intersecting remainder region, as shown in Fig- the other circles by C2, C3, and C4, clockwise around
ure 7. Lemma 3 holds without modification for self- R. (Circles through infinity handle the case of straight
intersecting remainder regions. Region R+, formed as sides.) Assume that the line through the centers of C\
before by adding the associated sectors to R, remains and C3 is vertical as in Figure 9. If R is uncentered,
a simple polygon with subdivision points on its sides, then c must lie below the chord on C\.
specifically a triangle with three subdivisions on one
Let f 12 be the vertex of R at which C\ and C2 meet,
side and one on each of the others. The next lemma
and similarly define t23, *34, and i4i. For a disk C* tan-
shows how to triangulate R+ with a generalization of
gent to both Ci and C3, let SL (= SL(C*)) be the circu-
the method of Lemma 2.
lar arc with endpoints <i2 and i23 that passes through
the points at which C* meets C\ and C3. Lemma 3
Lemma 5. Let R be a self-intersecting four-sided re-
guarantees that such an arc exists. Similarly define Sr.
mainder region resulting from breaking up a reßex four-
Let CL and cr be the centers of the circles containing
sided remainder region by the addition of C*. Then
SL and Sr, respectively.
R+ can be triangulated with at most 12 right triangles,
adding only safe Steiner points.

226
Lemma 6. There exists a disk C* tangent to C\ and
C3, such that CL lies in the convex hull of the four points
of tangency around SL and cr lies in the convex hull of Trajectory
the four points of tangency around Sr.

Proof: First let C* be the disk that is tangent to


Ci and C3 such that the center of C* lies on the line
through the centers of CL and C3.
Centers CL and cr lie on a horizontal line through
the center of C*, hence outside C\ and C3. But the
requirements of the lemma may be violated, because cr
may lie outside the chord ^34^41 of Sr (if Sr has measure
less than 7r) or CL may lie outside the chord 2^23 of SL Figure 9. The trajectories of centers CL and cT as C* sweeps.
(if SL has measure less than 7r). We assert that both
of these bad conditions cannot occur at the same time. Lemma 7. Let R be a non-reßex, uncentered, four-
Why? It suffices to show that the sum of the measures sided remainder region. Then R+ can be triangulated
of SL and Sr is at least 2n. Angle Zi23<*3^34, where into at most 28 right triangles, adding only safe Steiner
2*3 is the point of tangency of C* and C3, measures at points.
least 7r/2, because the arc of R on C3 measures at most
IT. And Zii2i*3i4i measures more than w/2, because
Proof: Again we may assume that all arcs of R have
the center of the circle through the vertices of R lies
finite radius. We start by adding the "centering" disk
below ti2^4i- Hence the remaining angles at 2*3 (the
C*, guaranteed by Lemma 6. As above, we denote the
two subtended by the endpoints of SL and Sr) sum to
tangent point of C* and CL by 2*i and the tangent
less than ir.
point of C* and C3 by 2*3. In addition to 2*i and 2,3,
If neither bad condition occurs, then C* satisfies the we add the following Steiner points: the centers Q and
conditions of the lemma, and we are done. But if one of cr associated with arcs Si and Sr, and the midpoint m
the bad conditions does occur, then we sweep C* in the of segment 2*1**3. See Figure 10.
direction that could cure the condition, while keeping
We triangulate by adding: all chords around Si and
C* tangent to both C\ and C3. If cr lies outside 234241,
Sr; edges from Q to m and to the centers of C\, C2, and
then we sweep C* to the left in Figure 9; the other case
C3; and edges from cr to m and to the centers of C3,
is symmetrical.
C4, and C\. Finally we add an edge between the center
During the leftward sweep, cr moves towards C\ of Ci and 2*i and between the center of C3 and 2*3.
along the perpendicular bisector of £34^41 and CL moves
Resulting triangles come in sets of four, each set form-
towards C2 along the perpendicular bisector of t12t23, as
ing a kite and its diagonals. Hence all triangles are
shown in Figure 9. These bisectors never intersect C3,
right. (Notice that C* is treated somewhat differently
so CL and cr can never lie outside their chords (2232*3
than the other circles, since we do not use its center.
and 2*3*34) on C3. The chords of SL and Sr between Nevertheless the four triangles around m form a kite,
tangency points on C* are never the longest chords on
because 2*i2»3 is the mutual chord of C*, S2, and 54.)
these arcs, so CL and cr also lie safely inside these chords
throughout the sweep.
As cr moves, it must pass through 234*41 and become
good, before it reaches C\ and becomes bad. By the
arc-measure argument above, cr must cross inside 234*41
before CL crosses outside *i2*23- Hence at some point
in the sweep, both cr and CL satisfy the conditions of
the lemma, and the C* at this point is C*. ■

Lemma 6 breaks up uncentered, non-reflex remainder


regions, but unless C* coincides with the initial C* in
the sweep, adding C* creates a new reflex remainder
region. The following lemma finesses this final difficulty
(shall we say circularity?) by triangulating both new
augmented regions at once.
Figure 10. Triangulating R+ when R is uncentered.

227
We have now completed the proof of our main theo- Proof: Using 0(n2) processors—one for each vertex-
rem, linear-size nonobtuse triangulation. edge pair—and time 0(log n), we can compute the near-
est non-incident edge for each vertex and hence choose
Theorem 1. An n-vertex polygonal region can be tri- appropriate radii for disks to pack into corners. The
angulated with O(n) right triangles, in time O(nlogn) second step, connecting holes, is trickier. We first com-
for simple polygons and 0(n log n) for polygons with pute a minimum spanning tree (MST) of P's holes; by
holes. I this we mean the shortest set of line segments S, each
segment with both endpoints on the boundary of P,
such that the union of S and the exterior of P is a
connected subset of the plane. Using 0(n2) proces-
5. Implementation sors and time 0(log n), we compute for each vertex the
nearest edge lying on a different connected component
We implemented our algorithm within the Matlab en- of P's boundary. We use this information to compute
vironment [15]. The implementation differs somewhat distances between connected components, and add to
from the algorithm described in the text. We use several S the shortest component-joining line segment incident
heuristics for disk placement so as to reduce the number to each component. This reduces the number of com-
of triangles. Also we do not bother to compute general- ponents by at least a factor of two, so O(logn) such
ized Voronoi diagrams. Rather we use a simple O(hn) merging steps suffices to complete the computation of
method to connect h holes to the boundary, and we set S.
choose arbitrary disks touching three non-consecutive Now it is not hard to show that no point of the
sides, rather than disks centered at GVD centroids. To plane is covered by more than 0(1) diameter disks of
keep the user entertained during the worst-case 0(n2) segments in S. Hence there is a pairwise-disjoint set
running time, we display color-coded disks and triangles of diameter disks of cardinality a constant fraction of
as they are added. Finally, although Section 4 describes |5| [26]. It is not hard to find these disks in parallel
a construction using only right triangles, the implemen- time 0(\ogn) using separators. We repeat the process
tation produces some acute triangles, an example being of computing the MST (of the new connected compo-
the large downward-pointing triangles in Figure 1(c). nents, holes plus disks) and finding a large indepen-
Experiments with a variety of polygonal regions show dent set of diameter disks. After O(logn) cycles—for
that an n-vertex input typically produces about 22n total time of 0(log3 n)—we have reduced to a simply-
triangles. A simple polygon with n — 3 reflex corners connected arc-gon.
can produce as many as 25n triangles; the maximum The third step of the disk-packing stage uses the
for polygons with holes appears to be about 33n. Since generalized Voronoi diagram in order to find centroid
a floating point representation entails roundoff, some of disks. Using 0(n2) processors and time O(log n), we
the right angles present in the nonobtuse triangulation can compute the GVD of a set of n circular arcs as fol-
become slightly obtuse. The worst test case had an lows. We compute the equal-distance curve (bisector)
angle of about |- + 10~n radians (Matlab retains 16 for each pair of arcs. Then for each arc a, we com-
digits), so the implementation is fairly robust, which pute the piecewise-polynomial boundary of a's cell re-
is somewhat surprising given that our implementation cursively by dividing the set of bisectors into two equal
often places very small disks next to very large ones. halves and then merging the boundaries for each half.
Two piecewise-polynomial boundaries of 0(n) pieces
can be merged in time O(logn) on n processors. Once,
6. Parallelizing the Algorithm the GVD has been computed, a centroid can be found in
time O(logn) by alternately removing leaves and merg-
We now sketch the first MC algorithm for nonobtuse ing degree-2 paths.
triangulation. We give a straightforward though rather Recall that the algorithm requires a "decomposition
inefficient algorithm, with parallel time 0(log n) and tree" of centroid disks of height O(logn), so by simply
processor requirement 0(n2). Both time and processors recomputing the GVD after each centroid, we obtain an
should be improvable. One bottleneck subproblem is overall time for the third disk-packing step of 0(log3 n).
the computation of the GVD of circular arcs; see [14] Finally, the triangulation stage consists entirely of local
for the GVD of line segments. operations, so it is trivially parallelized. I

Theorem 2. An n-vertex polygonal region P (with


holes) can be triangulated with 0(n) right triangles in
0(log3 n) time on 0(n2) EREW PRAM processors.

228
7. Conclusion [2] I. Babuska and A. Aziz. On the angle condition
in the finite element method. SIAM J. Numer.
We have presented a new algorithm for nonobtuse trian- Analysis 13 (1976), 214-227.
gulation of polygons with holes. The number of trian- [3] B.S. Baker, E. Grosse, and C.S. Rafferty. Nonob-
gles produced is linear in the number of vertices of the tuse triangulation of polygons. Discrete and
input, a significant improvement over previous meth- Comp. Geom. 3 (1988), 147-168.
ods. This is of course asymptotically optimal, resolving
the question of the theoretical complexity of nonobtuse [4] R.E. Bank. PLTMG User's Guide. SIAM, 1990.
triangulation of polygons.
[5] J.L. Bentley and J.B. Saxe. Decomposable
One direction for further work is extending the al-
searching problems: 1. Static-to-dynamic trans-
gorithm to inputs more general than polygons with
formation. J. Algorithms 1 (1980), 301-358.
holes; these inputs occur in modeling domains made
of more than one material. Currently, there is an algo- [6] M. Bern, L.P. Chew, D. Eppstein, and J. Rup-
rithm for refining a triangulated simple polygon into a pert. Dihedral Bounds for Mesh Generation in
nonobtuse triangulation with 0(n4) triangles, and also High Dimensions. Manuscript, 1993.
an fi(n2) lower bound [8]. There is still no algorithm
for polynomial-size nonobtuse triangulation of planar [7] M. Bern, D. Dobkin, and D. Eppstein. Triangu-
straight-line graphs; a solution to this problem would lating polygons without large angles. Proc. 8th
give another solution to "conforming Delaunay trian- Annual ACM Symp. Computational Geometry,
gulation" [12]. Mitchell [17] recently showed how to 1992. To appear in IJCGA.
triangulate planar straight-line graphs with maximum
[8] M. Bern and D. Eppstein. Polynomial-size nonob-
angle at most 7ir/8, using at most 0(n2 logn) triangles.
tuse triangulation of polygons. Int. J. Comp. Ge-
Another important direction is exploring whether our ometry and Applications 2 (1992), 241-255.
ideas can be used for related mesh-generation prob-
lems. For instance, disk-packing may yield a simpler [9] M. Bern and D. Eppstein. Mesh generation and
algorithm for the problem of no-small-angle, nonobtuse optimal triangulation. Xerox PARC Tech. Report
triangulation [3, 16]. Perhaps we can use our meth- CSL-92-1. Also in Computing in Euclidean Geom-
ods to produce nonobtuse meshes with skinny trian- etry, World Scientific, Singapore, 1992.
gles aligned with the boundary. (See [19] for aligned
no-large-angle meshes.) Or perhaps our methods can [10] M. Bern, D. Eppstein, and J.R. Gilbert. Provably
be allied with a heuristic method called "bubble sys- good mesh generation. Proc. 31st IEEE Symp.
on Foundations of Computer Science, 1990, 231-
tems" [24].
241. To appear in J. Comp. System Science.
Finally, higher dimensions are still a mystery. Do
three-dimensional polyhedra admit polynomial-size tri- [11] H.S.M. Coxeter. Introduction to Geometry. John
angulations without obtuse dihedral angles? Algo- Wiley k Sons, 1961.
rithms for point sets are known [6, 10].
[12] H. Edelsbrunner and T.S. Tan. An upper bound
for conforming Delaunay triangulations. Discrete
and Comp. Geom. 10 (1993), 197-213.
Acknowledgments
[13] S. Fortune. A sweepline algorithm for Voronoi di-
We would like to thank Paul Chew, Jonathan agrams. Algorithmica 2 (1987), 153-174.
Shewchuk, and Shang-Hua Teng for some valuable dis- [14] M.T. Goodrich, C. ÖDünlaing, and C. Yap. Com-
cussions and Dan Asimov and Micha Sharir for proofs puting the Voronoi diagram of a set of line seg-
of Lemma 3. ments in parallel. Algorithmica 9 (1993), 128-141.

[15] MATLAB Reference Guide, The MathWorks,


Inc., Natick, Massachusetts, 1992.
References
[16] E. Melissaratos and D. Souvaine. Coping with in-
[1] A. Aggarwal, L.J. Guibas, J. Saxe, and P.W. consistencies: a new approach to produce quality
Shor. A linear time algorithm for computing the triangulations of polygonal domains with holes.
Voronoi diagram of a convex polygon. Disc, and Proc. 8th Annual ACM Symp. Computational
Comp. Geometry 4 (1989), 591-604. Geometry, 1992, 202-211.

229
[17] S.A. Mitchell. Refining a triangulation of a pla-
nar straight-line graph to eliminate large angles.
Proc. 34th Symp. on Foundations of Computer
Science, 1993, 583-591.

[18] S.A. Mitchell. Finding a covering triangulation


whose maximum angle is provably small. Proc.
17th Annual Computer Science Conference, Aus-
tralian Comp. Science Comm. 16 (1994), 55-64.

[19] J.-D. Müller. Proven angular bounds and


stretched triangulations with the frontal Delau-
nay method. Proc. 11th AIAA Comp. Fluid Dy-
namics, Orlando, 1993.

[20] S. Müller, K. Kells, and W. Fichtner. Automatic


rectangle-based adaptive mesh generation with-
out obtuse angles. IEEE Trans. Computer-Aided
Design 10 (1992), 855-863.

[21] F. Preparata and M. Shamos. Computational Ge-


ometry - an Introduction. Springer-Verlag, 1985.

[22] J.F. Randolph. Calculus and Analytic Geometry.


Wadsworth, 1961, 373-374.

[23] J. Ruppert. A new and simple algorithm for


quality 2-dimensional mesh generation. Proc. j,th
ACM-SIAM Symp. on Discrete Algorithms, 1993,
83-92.

[24] K. Shimada and D.C. Gossard, Computational


methods for physically-based FE mesh genera-
tion. Proc. IFIP TC5/WG5.3 8th Int. Conference
on PROLAMAT, Tokyo, 1992.

[25] G. Strang and G.J. Fix. An Analysts of the Finite


Element Method. Prentice Hall, 1973.

[26] S.-H. Teng. Points, Spheres, and Separators: a


unified geometric approach to graph partitioning.
Ph.D. Thesis, Carnegie Mellon University, CMU-
CS-91-184, 1991.

[27] S.A. Vavasis. Stable finite elements for problems


with wild coefficients. Tech. Report TR93-1364,
Dept. of Computer Science, Cornell University,
1993.

230
Bounds on the Size of Tetrahedralizations
BERNARD CHAZELLE* NADIA SHOURABOURAt
Department of Computer Science Program in Applied and Comput. Math.
Princeton University Princeton University
Princeton, NJ 08544, USA Princeton, NJ 08544, USA

1 Introduction algorithm of Chazelle and Palios [8] works just the


same for polyhedra of arbitrary genus: specifically,
We extend the work of Bern [5] on triangulating the any polyhedron with n vertices and r reflex angles
region between three-dimensional polyhedra. Here is a can be triangulated with 0(n + r2) tetrahedra, re-
summary of our results: gardless of its genus. The bound is tight in the
worst case.
• We give a linear algorithm for triangulating the
region between two convex polyhedra. No assump- Tetrahedralization refers to the triangulation of
tions are made on the polyhedra: they can be dis-
three-dimensional polyhedra or the region between
joint, nested, or overlapping. The algorithm pro-
them. The subject has been heavily researched because
duces 0(n) tetrahedra, where n is the input size.
of its relevance to the finite-element method, mesh gen-
This optimal bound improves on an 0(nlogn)-size eration, topology of 3-manifolds, interpolation theory,
construction of Bern [5]. tool design, etc. [1, 2, 3, 4, 5, 8, 9, 14, 15]. An odd as-
• We give a method for triangulating the region be- sortment of results has emerged. For example, all poly-
tween a convex polyhedron and a disjoint polyhe- hedra can be tetrahedralized, but nonconvex ones might
dral terrain (or a star-shaped polyhedron). The require additional vertices, so-called Steiner points: the
number of tetrahedra produced is 0(nlog n). We canonical example is the Schönhardt octahedron [17],
prove the rather surprising result that the bound which is made by connecting together two parallel,
is tight. More generally, we show that any convex slightly twisted triangles. Checking whether Steiner
decomposition of the space between a convex poly- points are needed or not has been shown to be NP-hard
hedron and a terrain requires Q(rclogn) pieces in by Ruppert and Seidel [16]. Steiner points are some-
the worst case. what of a nuisance in practice, because they make repre-
sentations more complicated and cause round-off error
• We prove that any polyhedron of genus g must have problems. Unfortunately they can rarely be avoided.
at least g-\ reflex dihedral angles. To our surprise, The number and the shape of the tetrahedra are pa-
this result appears to be new. Actually, we were rameters that are both more critical and malleable. The
not even able to find any proof in the literature that former is where we focus our attention in this paper.
the number of reflex edges is £l(g). Although our
It was shown in [8] that any n-vertex polyhedron can
proof is quite simple it relies on the Gauss-Bonnet
be triangulated using only fi(n2) tetrahedra. This is
curvature formula and thus it is not completely self-
known to be optimal in the worst case [6]. Of course, in
contained. This result shows that the triangulation
many cases, it is possible to do much better. For exam-
•Supported in part by NSF Grant CCR-90-02352 and The ple, a convex polyhedron requires only 0(n) tetrahedra.
Geometry Center, University of Minnesota, an STC funded by Bern [5] provided motivation for looking at the region
NSF, DOE, and Minnesota Technology, Inc.
tSupported in part by NSF Grant PHY-90-21984
between two convex polyhedra. If the polyhedra are dis-
joint (side-by-side) it is quite easy to achieve an 0(n)-
Permission to copy without fee all or part of this material is size triangulation. The nested case is more difficult, and
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the Bern proposed a construction consisting of O(nlogn)
title of the publication and its date appear, and notice is given tetrahedra. Our first result improves this to 0(n),
that copying is by permission of the Association of Computing which is optimal. Furthermore, the method allows the
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. polyhedra to be intersecting. It is based on a dovetailed
construction of the Dobkin-Kirkpatrick polyhedral hi-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA erarchy [10], somewhat in the style of [7] though much
© 1994 ACM 0-89791-648-4/94/0006..$3.50
simpler. Unlike Bern's construction, our method uses
Steiner points. Whether this can be avoided remains
an open problem.

231
The polyhedron used in the quadratic lower bound cell decomposition, so any standard data structure for
proof of [6] is built by placing two polyhedral terrains,1 three-dimensional cell complexes3 will provide an ade-
one on top of the other. It is natural to ask whether quate representation [11]. Specifically, we need lists of
the lower bound collapses if one terrain is convex. Our vertices, edges, facets, and cells, along with their inci-
second result shows that O(nlogn) is the exact answer. dence relations.
The upper bound is obtained by carefully pruning the
outer polyhedral hierarchy at critical places and tracing Thickening the Boundaries. A layer can grow in-
its interaction with the terrain by way of a fairly delicate wards or outwards. We begin with the inward growth.
accounting scheme. Pick a maximal independent set of low-degree vertices
The lower bound is achieved by creating an art- on the inner boundary. For each such vertex v, form
gallery that requires on the order of nlogn guards: the the convex hull of its adjacent vertices and keep only
roof of the gallery is a hangar-like concave structure; the those faces non adjacent to v. glue the resulting patch
floor plan is a terrain parameterized by a permutation. to the layer. The space between the patch and the
We prove that the number of guards needed is precisely layer is called a pocket (Fig. 1). It is a polyhedron
equal to the number of swaps required in mergesorting of constant description size. Growing a convex poly-
that permutation. Expectedly, we use the bit-reversal tope inwards in this fashion produces the well-known
permutation to achieve the best possible lower bound. Dobkin-Kirkpatrick hierarchy [10].
The essence of our proof technique is to be able to in-
terpret a triangulation scheme as a permutation routing
network, whereby each node corresponds to one or sev-
eral distinct tetrahedra. This connection allows us to
classify the floor plans that lead to easy triangulations
by just looking at the complexity of their corresponding
permutations.

2 Triangulating between Two Convex Figure 1.


Polytopes

Let P and Q be two convex polytopes,2 with a total The outward growth [12, 13] is equivalent to the in-
of n vertices. We wish to subdivide the region between ward growth in dual space. We select a maximal in-
the boundaries of P and Q into 0(n) tetrahedra. Naive dependent set of nonadjacent, low-complexity facets on
methods such as merging the Dobkin-Kirkpatrick hier- the outer boundary of the layer. For each such facet
archies of the two polytopes are doomed to fail. Instead, /, we intersect the halfspaces bounded by / and its
we define a process for "thickening" the boundaries of adjacent facets (on the relevant sides). This creates a
the polytopes in coordinated fashion, until they become pocket with at most a constant number of other facets,
so wide as to cover all of H : during the growth process one of which is / (Fig. 2). There is one delicate point
we maintain a triangulation of the union of the thick-
ened boundaries. For this to work, the two boundaries
have to grow at comparable speeds.
To flesh out this idea, we introduce the key notion
of a polyhedral layer, which is simply the region be-
tween two nested convex polytopes. The outer and in-
ner boundaries might share faces, so a layer is topologi-
cally equivalent to S2 x [0,1] pinched at various places.
We define the magnitude of a layer to be the total num- Figure 2.
ber of faces (of all dimensions) among its inner and
outer boundaries. Layers will always come along with a
*A polyhedral terrain is the graph of a bivariate piecewise- to address: the facets of the pocket are coplanar with
linear continuous function: any vertical line intersects it in exactly the facets adjacent to /. On the one hand, we must
one point.
2
A polytope is a bounded polyhedron: our restriction to the
merge those facets together, otherwise the complexity
bounded case is meant only to simplify the explanation. It is of the new outer boundary does not decrease (actually
routine to extend our results to unbounded polyhedra. Simi- it strictly increases). On the other hand, if we merge
larly, we assume that the polytopes are nondegenerate and well-
3
behaved. In particular, it is assumed that no vertex is completely Recall that a cell complex is a subdivision of a region into
surrounded by coplanar facets: if this were the case, we would relatively open faces (i.e., vertices, edges, facets, cells) such that
remove the vertex and merge the incident facets together. the closures of two adjacent faces intersect in the closure of a face.

232
the facets, we no longer have a cell complex. To re- equivalent to disks.)
solve this dilemma, we enclose the new outer boundary The reason we need this correspondence will now be-
into a slightly enlarged copy of itself, and connect it in come clear. Suppose that we wish to grow, say, the
the obvious way (Fig. 3). This creates a layer of very layer L inwards. Our first task is to determine the
thin buffer pockets that completely surrounds the outer intersection of the new pockets of L with the current
boundary; such a pocket is a symbolic device and need union complex. If a pocket has a facet in (old) dL that
not have actual volume. intersects V then routine navigation through the cell
complex starting at that intersection does the job. If
not, then things are a little more dicey, as the pocket
might penetrate V at some random location. We use
the optimal algorithm of [7] to intersect the boundaries
of L and V pairwise. With the correspondence men-
tioned above, this gives us access to all the union com-
plex boundary facets that intersect the pockets, in time
linear in the complexity of the boundaries. (There are
technical details which we omit.)
What do we do with the new pockets? A pocket that
does not intersect either boundary of L' falls in one of
Figure 3. two categories (Fig. 4): if it lies entirely inside L', it is
ignored, i.e., it has no effect on the union complex. Oth-
erwise, it is simply added to the union complex. The

A simple but important observation is that thick-


ening both the inner and outer boundaries of the layer
decreases its magnitude by a constant factor. Note that
the magnitude of a layer may have nothing to do with
its complexity as a cell complex: as a matter of fact,
growing a layer increases the complexity of its cell com-
plex but decreases its magnitude. Figure 4.

Coordinated Growth of Two Layers. Let us


now look at the thickening of two layers, L and L', ema- more interesting case arises if a pocket partly intersects
nating from P and Q, respectively. We do not make any V (Fig. 5). Then, we triangulate the complement of
assumptions about the relative positioning of the lay- L' within the pocket and add these faces to the current
ers. We assume that the union of the two layers is fully union complex. In Fig. 5 this complement consists of
available as a cell complex (not necessarily simplicial); two full-dimensional components; in general, it can have
we call it the union complex. Note that it also provides up to a constant number of them (because the pocket
a cell decomposition of the boundary of L U V. We do has 0(1) complexity). We should also observe that the
not assume, however, that it gives a cell decomposition union complex is only modified by growing: once it con-
of the four boundaries. For example, portions of the tains a face it keeps it forever. Also, as we mentioned
boundaries strictly inside L U L' might have been re- before, we should not expect the boundary of the new
moved and have no representative features in the union layer L to be represented in the union complex in its
complex. totality.
We assume that all four boundaries of the layers are Triangulating the complement of V in the pocket is
available separately, i.e., with no regard to the fact that quite easy because the boundary of L' is convex and the
some might intersect: this is the same as having a rep- pocket has constant size. Outward growth is handled
resentation of four distinct convex polytopes. However, similarly. The only difference is that a pocket might
we also provide pointers from the facets of the four now have a large size (remember those thin buffer pock-
boundaries to their corresponding facets of the union ets). It is an easy exercise, however, to carry out the
complex: for this to make sense, we require that any triangulation in linear time.
boundary facet that does not lie completely inside LUL'
should have its "outside" part appear as the union of at
most a constant number of facets of the union complex. The Triangulation Algorithm. Returning now
(Just one is not enough, because such a facet might to our original problem, we grow the layer of P first
be homeomorphic to an annulus, so it needs to be cut inwards and then outwards. Then, we switch and do
up in two in order to keep all the facets topologically the same with respect to Q. We iterate this process

233
size of the input polyhedra. The size of the triangulation
is asymptotically optimal in the worst case.

3.1 The Upper Bound


A natural idea would be to compute the outer Dobkin-
Kirkpatrick hierarchy of P and merge the terrain Q
within it. Such a naive approach runs into problems,
however, because terrain facets may intersect too many
features of the hierarchy. We get around this problem
by pruning the resulting cell complex appropriately. Re-
call from the previous section that the outer hierarchy
of P subdivides K3 into constant-complexity pockets
and arbitrarily thin buffer pockets. Suppose that two
Figure 5. facets /, g of the terrain intersect the same pocket and:

1. Both facets intersect the same set of pocket edges.

back and forth until the boundaries become of constant 2. No edge of either facet intersects the pocket.
size. At that point, a simple finishing touch adds a 3. The portion D of the pocket between the two facets
few unbounded tetrahedra to create a full-fledged union
does not intersect the terrain (except at /, g).
complex that subdivides all of IR . Buffer pockets that
have not yet been triangulated can be handled now,
A polytope D that satisfies all these conditions is
which produces the desired simplicial complex. The
called a drum (Fig. 6): it consists of two facets (which
total space and time complexity is easily seen to follow
are pieces of the terrain facets /, g that cut all across
a geometric series summing up to 0(n).
the pocket) and at most a constant number of lateral
facets (pieces of pocket facets): the pair (f,g) consti-
Theorem 2.1 It is possible to triangulate the region
tutes the type of the drum. We say that two drums
between the boundaries of two convex polytopes in linear
time, using a linear number of faces.

Remark: The dovetailing mechanism can be replaced


by variants such as always thickening the bigger layer.
However, it would be a big mistake to grow one layer
all the way, and then work on the other. Similarly,
simply merging the two hierarchies fails miserably. In
both cases, on the order of n logn tetrahedra might end Figure 6.
up being produced. As one should note, a key idea to
avoid this blowup has been to avoid refining the interior
of the layers as they grow.
are adjacent if they share a common lateral facet. Our
pruning strategy involves removing all the lateral facets
Triangulating between a Polytope between adjacent drums (along with the incident edges
and a Terrain and vertices, unless they are needed by neighboring non-
drum cells). Note that because two adjacent drums are
always of the same type, pruning never brings in con-
Let P and Q be respectively a convex polytope and a
tact drums of different type. The merged drums are
polyhedral terrain. We could also choose an arbitrary
called superdrums. Two obvious questions are: How do
star-shaped polyhedron as Q, since it can be made into
we turn the resulting subdivision into a triangulation?
a terrain by a suitable projective transformation. We
Why is the triangulation of size O(nlogn)?
assume that P and Q do not intersect, or if they do,
that the input size n accounts for all the intersection
features as well. Completing the Triangulation. Let us examine
each pocket separately. If the pocket is free of any ter-
Theorem 3.1 It is possible to triangulate the region rain features, then triangulating it is routine (as usual,
between two disjoint polytopes (one convex, the other one must be careful that the triangulations of a facet
star-shaped), using O(nlogn) tetrahedra, where n is the should agree on both sides, but this is easy to enforce;

234
see [5] for a thorough treatment of a more general and
difficult version of that issue.) If the pocket does not
give rise to any drum, then no pruning takes place
within and we must triangulate a portion of the ter-
rain inside a single pocket. If the pocket is not of the
buffer type, then it is of constant size. So, we can simply
erect vertical walls from the edges and triangulate the
resulting cylinders (which is a two-dimensional prob-
lem), while also adding enough internal Steiner points
to make the facet triangulations compatible (see [1, 8]
for a similar idea). If the pocket is a buffer, then we
can further assume that it contains no terrain vertex,
so there is not even any need to erect walls.
The only difficult case is when a pocket contains one Figure 8.
or several drums. The portion of the pocket outside
its drums can be handled as before. The question is
how to triangulate a superdrum R. Such a polyhedron
resembles a thick polygon (Fig. 7). It consists of two An easy way to visualize D{ is to think of the blocking
facets F, G (arbitrarily complex simple polygons within points of Bj as nails in a board and d as a tight rubber
/ and g) connected together by lateral facets. As in a band which is to be snapped: the new position of C, is
drum, the edges of the lateral facets provide a bijection precisely A'.
between the vertices of the polygons F and G. Note Recall that we have an identical structure on the
that a given pair (/, g) can give rise to more than one facet G, so we can similarly define a polygon D\ from
polyhedron R. C-. Note, however, that although C; and C[ are in bi-
jection, the same need not be true of A and D\. We
now match each £),• and D\ by taking the convex hull
Hi of their union. Since the sequences DQ,D\,. .. and
D'0,Di,... are nested, the same is true of the sequence
of convex hulls H0, Hu etc. Let Kt = (H{ D R) U #,_i,
so that R=U?=1(Ki\Hi-i). Note that Kt \ /f*_i is
the region between two nested convex polytopes: it is
free of any blocking material, so we can apply Theorem
Figure 7. 2.1 to triangulate it.

The Complexity of the Triangulation. An edge


Naive methods for triangulating R seem to run into of the terrain can appear in only O(logrc) pockets.
all sorts of snags, as one must be careful to keep the size It follows immediately that the number of tetrahedra
small. Recall that the pockets contributing the drums produced outside of the drums is O(nlogn). For the
of R are arranged in a hierarchical fashion. The cross- same reason the combined complexity of all the merged
section of the outer hierarchy of P with the plane sup- drums is at most 0(n log n). The only question remain-
porting F is a nonempty collection of O(logn) nested ing is how many tetrahedra are produced during the tri-
convex polygons, Co,Ci, etc. The 2d-pockets between angulation of the superdrum R. The final triangulation
them are convex polygons consisting of a base made of step adds only a constant factor to the size, so it suffices
some number of collinear segments and a constant-size to estimate the total complexity of the H0,Hi, etc. The
polygonal arc (Fig. 8). The non-dotted 2d-pockets in size of Hi is proportional to the total number of edges
the figure indicate the drums. The non-dotted region, in Di and D\. But notice that the edges in all the Di's
which is precisely the facet F of R, is surrounded by a form a planar graph, therefore it suffices to count the
set of blocking 2d-pockets (the dotted polygons). Note number of vertices, which is |J3o| + |Si| + ■ ■ ■• Unfor-
that these blocking pockets might not necessarily be all tunately, this estimate is too crude. We must take into
adjacent to R. consideration the fact that not all blocking points con-
We describe a method for subdividing F and explain tribute to the complexity. In particular, it is clear that
how it can be carried over to R. Let Bi be the set only points on blocking 2<f-pockets that are adjacent to
of vertices of d incident to blocking 2d-pockets. Note R can become vertices of the An Hi's. Furthermore,
that the Bi are not necessarily disjoint. By analogy, if more than two vertices lie on the base of a blocking
the points of B, are called blocking. We define A to 2d-pocket, only the two endpoints can play any role. It
be the convex hull of all the points in BQ U ■ • • U Bi. thus appears that the contribution of superdrums to the

235
overall size of the triangulation is at most proportional The naive algorithm for constructing the triangula-
to the the total number of blocking 2d-pockets adjacent tion involves intersecting each facet of the terrain with
to superdrums. Such a 2d-pocket is blocking for one of the entire outer hierarchy, which certainly takes no more
two reasons: than 0(n2) time. Within that running time, it is rou-
tine to carry out the entire pruning. It is possible to
1. It is intersected by an edge of / or g (Fig. 9). improve the running time slightly, by using fairly com-
plicated batching techniques based on multidimensional
searching. It is not worthwhile pursuing that line of at-
tack. Whether a simple, quasi-linear algorithm exists
remains an open question.

3.2 The Lower Bound


We construct a convex polytope and a terrain disjoint
from it, such that any convex decomposition of the
space between them requires on the order of n log n
pieces, where n is the combined size of the input.

Building the Polyhedra. The polytope is a cylin-


der with half of a regular 2m-gon as a base, where
Figure 9.
m = 2P. It consists of (i) a horizontal square of unit
area facing up, (ii) m slabs facing down, (iii) two con-
gruent vertical facets whose normals are parallel to the
y-axis (Fig. 11).
2. It is not intersected by any edge of / or g but it
is adjacent to what would be a drum D, if it were
not for a terrain edge that intersects D (Fig. 10).

Figure 11.

Figure 10. To define the terrain it is helpful to (conceptually)


enclose the cylinder inside a tall box, with the square of
the cylinder coinciding with the top of the box. The ter-
rain consists of the plane supporting the bottom of the
box, plus m blade-like protrusions abutting the slabs of
Obviously, there are at most 0(n log n) 2c?-pockets of the cylinder (Fig. 11 shows only one of them). Each
the first kind. The same is true of the second kind of protrusion is associated with a slab of the cylinder: it
pockets, but to see why is a little more subtle. The crux is essentially a trapezoid (with small but positive thick-
is that no single terrain edge can create more than two ness) parallel to the z-axis; its top side is parallel to
2d-pockets of type 2 within the same three-dimensional a slab of the cylinder and comes extremely close to it
pocket G. The reason for this is that D cuts all across without touching it. The trapezoids are in one-to-one
G and therefore no terrain edge can intersect both D correspondence with the m slabs of the cylinder. We
and G\D. We conclude that the triangulation is of size assume that each trapezoid extends all across the ver-
0(n logn). tical box. This is why it is necessary to make the box

236
tall enough: a simple calculation shows that the height
of the box should be on the order of m. Clearly, the
total description size of the input scene is n = 0(m).
Our construction is complete once we specify (i) the
permutation that defines the correspondence between
slabs and trapezoids, and (ii) the placement of the
trapezoids along the «/-direction. Because the box is tall
enough, any permutation on m elements is feasible. We
choose the bit-reversal permutation 7r = (z'o,. • •, «m-i)i
where ik is 1 plus the number obtained by writing k in
binary over p bits and reversing the bits. For example,
if p = 3, we obtain

TT = (1,5,3,7,2,6,4,8).

Figure 12.
Placing Guards. The slabs can be thought of as
the leaves of a complete binary tree of depth p. An
internal node v thus is naturally associated with a se-
quence of consecutive slabs s,-,..., Sj. Let W(v) be to specify the placement of the nodes on the leftmost
the wedge formed by two planes tangent to the cylin- path of the tree, vQ,..., vp.
der along the segments s,-_i D s,- and Sj H Sj+\. We
choose the planes so that their normals bisect the an-
gles between their respective slab pairs. If s; or SJ is an V,
extreme slab then we take the vertical plane support-
ing the relevant wall of the box. Fig. 12 shows such
a wedge (with some liberty in the drawing to make it
clearer). Given a node v (not a leaf, not a parent of a
leaf, not the root), consider the bounding line Lv of the
i
wedge W(v). A simple geometric observation is that
since the trapezoids are extremely close to the slabs,
the line Lv intersects (strictly) the trapezoids in cor-
respondence with the slabs Si,...,Sj, and only those.
Furthermore, because of the bit-reversal permutation,
as we move along the line we encounter trapezoids from Figure 13.
the left and right children of v in alternation. The inter-
section with the trapezoids are such tiny segments that
we might as well as think of them as points q0,...,qj-i
(given in ascending «/-order). The midpoint of a seg- Let ek = (c/m)k, for some small enough constant
ment of the form qiqi+i, for 0 < / < j - i, is called a c > 0. For any 1 < k < p, we place the block for the
guard (the crosses in Fig. 12). Obviously, there is a total right child of vk ahead of the block for the left child of vk
of about mlogm guards overall. The lower bound will by precisely ek (Fig. 13). Observe that it is always easy
follow directly from the fact that by a judicious place- (for c small enough) to fit the entire block of trapezoids
ment of the trapezoids in the «/-direction we can ensure within the box. The lower bound follows from the next
that no two guards can see each other. lemma.
Instead of assigning each trapezoid an explicit y-
coordinate, which would complicate the proof, we de- Lemma 3.2 No iwo guards can see each other.
fine their placement in a recursive manner. We process
the tree of trapezoids bottom-up. For a node to be Proof: If the two guards p, q correspond to nodes v, w
processed means that the entire block of trapezoids as- that are not in any ancestral relationship, then the con-
sociated with it has been placed, up to translation (i.e., vex cylinder itself obstructs their mutual visibility. If
its degrees of freedom have been reduced to one). Since v = w, then the trapezoids passing through the points
we proceed bottom-up, to process v simply means de- qo,qi, etc., hide the guards from one another. So, the
ciding the relative positioning of the blocks associated only case remaining is if, say, v is an ancestor of w. Let
with the two children of v. To simplify matters further, j and k (j < k) be the heights of w and v, respectively.
we make the placements of all the blocks at a given level If we project trapezoids and guards onto the zz-plane,
in the tree identical up to translation. Thus, it suffices we find that not only the projection of p lies in that

237
of every trapezoid associated with v, but actually the
projected point is at least at a distance proportional to
D/m away from any edge of the trapezoid's projection
(Fig. 14), where D is the distance from the bounding
line Lv to either of the two lines of contact between the
wedge W(v) and the cylinder.
> p
I
L, L,
Figure 16.

4 Genus and Reflex Angles

Intuitively, it seems clear that a polyhedron with large


Figure 14. genus should have many reflex dihedral angles (we call
the corresponding edges reflex). Recall that a poly-
hedron of genus g is a 3-manifold with piecewise-linear
boundary that is homeomorphic to a torus with g holes.
Thus, there exist two disks of radius Cl(D/m) which If r is the number of reflex edges, we will show that
any infinite ray of visibility from p must necessarily
avoid: these disks are centered on and normal to the g<r+l. (1)
line Lv, and they lie on each side of p at a distance
ek/2 from it (Fig. 15). The curvature kv at the vertex v is defined to be

^ = ^(2--I>)
where 0j is the angle between two consecutive edges
\. y incident to v. The Gauss-Bonnet formula relates the
total curvature to the genus:

J2kv = 2 — 2flr,
V

Inequality (1) follows easily from the next lemma.

Lemma 4.1 The number of reflex edges incident to a


vertex v is at least —kv.
Figure 15.
Proof: Project the facets incident to v onto a unit
sphere centered at v. This produces a simple, closed
curve made of geodesic pieces. In other words, it is a
Let p' be the point of Lw nearest to p (Fig. 16). Be- "polygon" on the sphere made of arcs of great circles.
cause of the two obstructing disks, p cannot see any A reflex edge gives rise to a reflex angle on the polygon
point of Lw away from p' by more than 0(\pp'\ekm/D), and vice-versa. It is easy to see that
which is 0(c\pp'\£j/D). But \pp'\ is at most D, so by
setting c small enough, we find that no point on Lw L <2ir{R+l), (2)
away from p' by more than e;/3 can see p. But q lies
where L is the length of the curve and R is its number
at least (ej — £,t)/2 away from p', which gives a contra-
of reflex angles. Indeed, if R is zero then the inequality
diction. O
simply states the classical fact that the curvature at a
locally convex point is nonnegative. If R is nonzero,

238
then we can draw arcs of great circles from each reflex [10] Dobkin, D.P., Kirkpatrick, D.G. Fast detection of
point along the bisector of its reflex angle, and thus polyhedral intersection, Theoret. Comput. Sei. 27
decompose the unit sphere into at most R + 1 convex (1983), 241-253.
regions (i.e., regions where any two points are visible
along an arc of great circle connecting them). The case [11] Dobkin, D.P., Laszlo, M.J. Primitives for the ma-
R = 0 can now be used R + 1 times to establish (2). nipulation of three-dimensional subdivisions, Algo-
The lemma follows immediately from the fact that rithmica, 4 (1989), 3-32.

[12] Martin, A. A simple primal algorithm for intersect-


L = ^0i=2v{\-kv). ing Z-polyhedra in linear time, Tech. Report 91-16,
July 1991.
D
[13] Mehlhorn, K. Data Structures and Algorithms
3: Multidimensional Searching and Computational
Chazelle and Palios [8] have given an algorithm for
Geometry, Springer-Verlag, Heidelberg, Germany,
triangulating a genus-0 polyhedron with n vertices and
1984.
r reflex angles, using 0(n + r2) tetrahedra. The al-
gorithm works for arbitrary genus g, but the bound [14] Mulmuley, K. Computational Geometry: An
becomes 0(n + (r + g)2) tetrahedra. The inequality Introduction Through Randomized Algorithms,
g < r + 1 implies that the true bound is still 0(n + r2). Prentice-Hall, 1994.
In other words, the complexity bound for genus 0 ap-
plies to polyhedra of arbitrary genus as well. [15] Pellegrini, M. Building convex space partitions in-
duced by pairwise interior-disjoint simplices, ICSI
TR-93-039, Aug. 1993.
References
[16] Ruppert, J., Seidel, R. On the difficulty of trian-
[1] Aronov, B., Sharir, M. Triangles in space or build- gulating three-dimensional non-convex polyhedra,
ing (and analyzing) castles in the air, Combinator- Discrete and Computational Geometry, 7 (1992),
ica, 10 (1990), 137-173. 227-253.

[2] Aronov, B., Sharir, M. The Union of convex poly- [17] Schönhardt, E. Über die Zerlegung von Dreieck-
hedra in three dimensions, Proc. 34th Annu. IEEE spolyedern in Tetraeder, Math. Annalen, 98 (1928),
309-312.
Sympos. Found. Comput. Sei. (1993), 518-527.

[3] Aronov, B., Sharir, M. Castles in the air revisited,


Proc. 8th Annu. ACM Sympos. Comput. Geom.
(1992), 146-156.

[4] Bajaj, C.L., Dey, T.K. Convex Decompositions of


Polyhedra and Robustness, SIAM Journal on Com-
puting 21 (1992), 339-364.

[5] Bern, M. Compatible tetrahedralizations, Proc. 9th


Annu. ACM Sympos. Comput. Geom. (1993), 281-
288.

[6] Chazelle, B. Convex partitions of polyhedra: a


lower bound and worst-case optimal algorithm,
SIAM Journal on Computing, 13 (1984), 488-507.

[7] Chazelle, B. An optimal algorithm for intersecting


three-dimensional convex polyhedra, SIAM Journal
on Computing, 21 (1992), 671-696.

[8] Chazelle, B., Palios, L. Triangulating a nonconvex


polytope, Discrete and Computational Geometry, 5
(1990), 505-526.

[9] Dey, T.K. Triangulation and CSG representation


of polyhedra with arbitrary genus, Proc. 7th Annu.
ACM Sympos. Comput. Geom. (1991), 364-372.

239
An Optimal Bound for
Conforming Quality Triangulations
(extended abstract)
Tiow-Seng Tan

Department of Information Systems & Computer Science


National University of Singapore
Lower Kent Ridge, Singapore 0511

Abstract teria of shape and size are somewhat conflicting—good


triangles may be the result of adding new vertices. Au-
This paper shows that for any plane geometric graph Q tomatic generation of triangulations has been a subject
with n vertices, there exists a triangulation T conforms for research since the 1960s. Nevertheless, many in-
to G, i-e. each edge of Q is the union of some edges of T, teresting results, both practical and theoretical ones,
where T has 0(n2) vertices with angles of its triangles have been discovered in the recent years too; see, for
measuring no more than j|?r. Additionally, T can be example, [BDE92, BEG90, BeEp91, BMR94, Dey91,
computed in 0(n2 logn) time. The quadratic bound on MeSo92, Mitc93a, Mitc93b, Mitc94, Rupp93, Tan93]
the size of its vertex set is within a constant factor of and the survey [BeEp92].
worst case optimal. This paper considers triangulating a plane geomet-
ric graph (i.e. plane graph with straight edges) using
triangles with no large angles. Such resulting triangu-
1 Introduction lations have potential applications in the area of finite
element and surface approximation; see, for example,
In many engineering applications such as finite ele- [BaAz76, BaLi84, Greg75]. It shows that triangulating
ment analysis [Cave74], surface interpolation [Laws77], a plane geometric graph of n vertices using angles no
and shape reconstruction [Bois88], two and higher- larger than ^ir requires at most 0(n2) new vertices.
dimensional domains are frequently decomposed into A previous result of Mitchell [Mitc93b] achieves angle
small and simple elements before numerical computa- bound of |7T with O(n2logn) new vertices. This pa-
tion. One particularly important class of decomposi- per thus provides significantly better bounds on triangle
tions is the so-called simplicial cell complex, usually shape and vertex size. We also note that the quadratic
referred to as triangulation, where the domain is de- bound on the vertex size is within a constant factor of
composed into simplices—triangles in two and tetrahe- worst case optimal. Our construction is conceptually
dra in three dimensions—so that the intersection of two simple though its proof is quite involved. It has some
simplices is either empty or a face of both. flavor of Edelsbrunner and Tan [EdTa93] and Mitchell
For a given domain such as a polygonal region or, [Mitc93b]. The complete proof indeed uses some results
more generally, a plane graph with straight edges, there derived from the latter.
are clearly many ways to decompose or triangulate it The paper is organized as follows. Section 2 formal-
into a triangulation, with or without the addition of izes the problem. Section 3 provides the outline of the
new vertices to the domain. But accuracy and efficiency method that proves the quadratic bound, and Sections
of an engineering computation impose optimal criteria 4 to 9 discuss its details for angle bound a = \ir. Then,
such as the triangle shape (with bounds on triangle an- Section 10 provides details on implementing the proof
gles away from 0 and it) and vertex size (with bounds and extending it to a = ±±ir, and Section 11 concludes
on the number of new vertices), respectively. These cri- the paper. This extended abstract omits most proofs;
the fufl details can be found in [Tan94].
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the 2 Some Terminology
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing We first introduce some notions, then define the prob-
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. lem.

10th Computational Geometry 94-6/94 Stony Brook, NY, USA


© 1994 ACM 0-89791-648-4/94/0006..$3.50

240
Plane Geometrie Graphs. Let 5 be a set of n points 3 The Outline of Construction
or vertices in 3ft2. An edge is a closed line segment
connecting two points. Let £ be a collection of edges Given a plane geometric graph Q — (S, E) where \S\ =
determined by vertices of 5. Then Q = (S, E) is a plane n, the algorithm of Edelsbrunner, Tan and Waupotitsch
geometric graph if [ETW92] can augment it by edges to a triangulation
that minimizes its maximum angle over all possible aug-
(i) no edge contains a vertex other than its endpoints, mentations. This triangulation is the so-called min-max
that is, ab f~l S = {a, 6} for every edge ab £ E, and angle triangulation T of Q. So, for a given Q, we are
done if T has angles measuring at most a, the targeted
(ii) no two edges cross, that is, abCtcd £ {a, 6} for every
angle bound; otherwise, we proceed to refine this trian-
two edges ab ^ cd in E. gulation by adding Steiner vertices until it has no bad
One example of a plane geometric graph is a poly- angle. We say an angle is bad if it has measure larger
gon where S and E form a single cycle. The cycle is than a; otherwise it is good. A good triangle is a triangle
the boundary of the polygon. It subdivides 3?2 into a with only good angles whereas a bad triangle has some
bounded face, its interior, and an unbounded face, its bad angle. A polygon (or polygonal region) that can
exterior. A polygon with four edges or sides is a quadri- be triangulated with no bad triangles is said to have a
lateral. good triangulation. For our discussion till Section 10, a
is set to |?r.
Triangulations. A triangulation is a plane geometric Let us assume now that T has some bad angles. Sup-
graph T = (S,E) so that E is maximal. By maxi- pose Apqr is one with a bad angle at q. Then, in refining
mally, edges in E bound the convex hull ch(S) of S T, we need to find a vertex t so that qt subdivides the
(i.e. the smallest convex set in D?2 that contains S) and angle at q into two smaller ones. Notice that such a t
subdivide its interior into disjoint faces bounded by tri- may not be any of the existing vertices of T■ So, t may
angles. These triangles of T are referred simply as tri- possibly be a Steiner vertex. Also, using only one ver-
angles, and their angles as angles. With reference to a tex t inside Apqr does not improve the situation since
polygon, we talk about its triangulation as restricted to Lptr > Lpqr. In general, t on pr is chosen to subdivide
only its interior. the angle at q as well as Apqr into two new triangles.
Such a refinement results in the other triangle sharing
Conforming Triangulations. A plane geometric pr, say Aprs, to have a vertex on pr. So a subdivision
graph T = (S',E') conforms to another such graph on Aprs is now necessary to get rid of the "large angle"
Q = (5, E) if S C S' C ch{S) and each edge in E is a of 7T at t. This situation may continue to propagate to
union of edges in £". Each vertex in S' — S, also termed other triangles. The main idea of our construction is to
a Steiner vertex, may or may not subdivide an edge of bound such propagations of vertices.
E. A triangulation T conforms to a plane geometric The proposed construction has six major phases. The
graph Q is called a conforming triangulation of Q. The first phase (Section 4) subdivides each triangle of T into
problem studied here is as follows: three quadrilaterals by adding edges, termed spokes,
perpendicular to its three sides from the center of its in-
Given a plane geometric graph Q — (S, E), find
scribing circle. Some of these quadrilaterals are marked
a conforming triangulation T of Q with small
as fences; they together with traps set up in the sec-
vertex set and with angles measuring at most a
ond phase (Section 5) help in controlling propagations
where a < TT. of vertices. The third phase (Section 6) propagates ver-
Previous Results. Two results are directly related to tices of spokes and traps. From one vertex, we may get
the problem studied here. Bern, Mitchell and Ruppert a sequence of vertices where one propagates to the next.
[BMR94] have recently shown how to augment a poly- This sequence can be viewed as a kind of path, called
gon (with or without holes) by linear number of Steiner propagation path, whose vertices are possibly Steiner
vertices so that it can be triangulated with no obtuse vertices. The fourth phase (Section 7) removes redun-
angles. For a general plane geometric graph with n ver- dant subpaths and the fifth phase (Section 8) untan-
tices, the recent result of Mitchell [Mitc93b] constructs gles crossings of paths. The remaining vertices of paths
0(n2 logn) Steiner vertices to achieve the angle bound form the set of required Steiner vertices, and the final
of |7T. This bound on the cardinality of Steiner ver- phase (Section 9) triangulates each quadrilateral having
tices is within a logarithmic factor from the lower bound Steiner vertices on its boundary using edges of paths as
of Q{n2); see [BeEp91, Mitc93b] for discussions on the guides.
lower bound construction (for any angle bounded away We note that the construction above as it is may add
from 7r) due to M. S. Paterson. unnecessarily many Steiner vertices. This can neverthe-

241
less be avoided by modifying some steps as described in • tracing linear number of paths, and
Section 10. Let us next define a few more notions before
discussing the details of the construction. • ensuring each path has length at most linear.

Pebbles. Propagation paths leave traces of its vertices


Fences and Traps. A fence is a polygon that has a on boundaries of quadrilaterals. A quadrilateral with all
good triangulation even if its edges contain Steiner ver- traces on its boundary taken as Steiner vertices may not
tices. A trap is a polygon with a base edge ab and dead have a good triangulation for traces that are too near to
ends a', b' where a and 6 are connected to the respective each other (unless the quadrilateral is a fence). Thus,
dead ends via paths Paa' and Pw- Other than a' and b' portions of some propagation paths need to be removed
may be the same point, Paa' and Pbb', also termed the and the remaining portions reconnected to nearby ones
boundary paths of the trap, do not intersect. Addition- in the same direction. The set of propagation paths re-
ally, Paa' with vertices a = Po,Pi,P2, ■ ■ -,Pk = a! and mained plus the set of centers of inscribing circles form
Pbb' with vertices 6 = geh <7i, 92, ■ ■ •, <7fc = b' are such that the required set of Steiner vertices (or pebbles) for 7".
Pi-iPi and qi-iqi, for 1 < i < k, lie in the closure of Two major concerns of Sections 7 to 9 are:
some quadrilateral. This condition implies that a trap
encloses neither vertices of S nor endpoints of spokes. • ensuring paths terminate on convex hull edges,
Vertices of a trap are not necessarily Steiner vertices in fence edges, endpoints of spokes or dead ends, and
the final construction.
• triangulating quadrilaterals whose boundaries con-
The construction of fences and traps in Sections 4
tain Steiner vertices using no bad triangles.
and 5 considers the following issues:
Analyzing Cost. Once all the above issues are re-
• building linear number of fences and traps, and solved, the number of Steiner vertices used is clearly
quadratic in the number of vertices of T-
• ensuring each trap has at most linear number of
vertices.
4 Erecting Fences
Paths. A path with origin po is a sequence of vertices
Po,Px, ■ ■ -,P<,Pi+i, ■ ■ ■ where p,- and p,+i are points on The purpose of a fence is to block or terminate propa-
two different edges of some quadrilateral. Two consec- gations of vertices. We can consider convex hull edges
utive vertices p,-,p,+i of the path define an edge p,p,+i of T — (S, E) as degenerate fences since no propagation
or, more specifically, a directed edge p'i'pi+l with tail p,- of vertices out of the convex hull is necessary. They are,
and head p,+i. Each directed edge defines four angles however, insufficient to block all propagations; we need
at its two endpoints with edges of the quadrilateral con- the following type of fences plus traps discussed in the
taining it. For our purposes, we use a path to refer to next section. Throughout the discussion, we refer to
one where the two angles at the tail of each directed some specific measures of angle. As mentioned, a• = | JT
edge are good, and analogously an inverse path to one is the targeted angle bound. Let <j> = -| and ß —\- No-
where the two angles at the head of each directed edge tice that a — -K — ß and <j> + 2ß — ■K. We use the term
are good. And, vertices of paths and inverse paths are isosceles triangle to mean a triangle with apex angle <f>
always some points on edges of T■ and two base angles ß.
The length of a path or an inverse path is its number Consider a triangle pqr £ T■ Let c be the center of its
of vertices minus one, and the direction is the direction inscribing circle, i.e. c is the point common to the three
of its directed edges. Two paths are coherent if they tra- angle bisectors. Let p',q',r' be the three perpendicular
verse through the same set of quadrilateral edges, and projections of c onto respectively qr,rp,pq; see Figure
are parallel if they are coherent and their two edges in 4.1. Edges cp',cq' and cr' are spokes of Apqr.
the same quadrilateral are parallel. We also use coher-
ent and parallel to describe two inverse paths, or one Step 1. Erecting Fences.
path with an inverse path. For each Apqr S T with the largest angle at say q,
Two directed edges ab and cd (of some paths) in add the center c of its inscribing circle as a Steiner
quadrilateral pq'cr' are vertex disjoint if {a, b}n{c, d} — vertex. Also, add spokes cr', cp' and cq' to sub-
0, and cross if they are vertex disjoint and abDcd ^ 0. divide Apqr into three quadrilaterals pq'cr', rq'cp',
They are said to be of the same orientation if a and c and qr'cp'. Then, mark qr'cp' as a fence. And,
are on the same edge of pq'cr' (so are b and d), otherwise mark pq'cr' if Lp > ß, and rq'cp' if Lr > ß.
opposite orientation.
Major issues regarding propagation paths in Section The above step marks quadrilaterals that indeed sat-
6 are: isfy the definition of a fence as long as no Steiner vertices

242
on pq and pr, respectively of the two quadrilaterals
adjacent to pq'cr' and incident to p. If 92 lies on
pr", trace out two i-paths at 92 such that the first
edges of the i-paths meet pr' at two points that
form an isosceles triangle with apex at 92- Simi-
larly, trace out two i-paths at rj if ri lies on pq".
In all the above, we terminate an i-path when it hits
either a convex hull edge, a fence edge, a spoke, or
when its length has reached K.

Figure 4.1: Trianglepgr is subdivided into three quadrilaterals


pq'cr'', rq'cp' and qr'cp'. It is simple to check that \pr'\ =
\pq'\, |rp'| = |rg'|, \qr'\ = |«p'|, and \cr'\ = \cp'\ = \cq'\ = p
where p is the radius of the inscribing circle of L\pqr.

will be added to spokes of triangles. This follows imme-


diately from the next lemma. Those quadrilaterals that
are not marked as fences are referred as non-fences.

Lemma 4.1 Suppose quadrilateral pq'cr' is such that


Lq' = Lr' = -| and Lp > ß. Then it has a good triangu-
lation even if pr' and pq' contain some Steiner vertices.
a
Figure 5.1: For pq'cr', one i-path each is traced at r' and q',
and two at 92 but none at n.
5 Setting Traps
To supplement fences that block some propagations, we The above step traces out a maximum of four i-paths at
step up traps whose dead ends can serve to terminate each endpoint of a spoke—one each into the quadrilat-
the other propagations. To do this, we first identify erals (non-fences) where the endpoint is a vertex, and
portions of quadrilateral edges, other than spokes, that two into the other quadrilateral with the endpoint on
must be bases of traps. Clearly, we need only consider one of its edges. Notice that the latter two i-paths at
those that are not parts of the boundaries of fences. an endpoint may not be coherent, though they started
We thus talk about quadrilateral pq'cr' in the following off by moving to the same edge. With all the i-vertices
as one with right angles at r' and q' and Lp < ß, un- in place, we can identify (next two paragraphs) some
less stated otherwise. Also, we assume pq'cr' lies inside portions of quadrilateral edges as bases of traps to be
Apqr of T. constructed.
To plan for traps, we introduce a special type of in- Consider a directed edge pipI+1 of an i-path inside
verse path, termed i-path, where all its directed edges a quadrilateral pq'cr' with p,- €E pr' and p,+i € pq' ■
define good angles of ß at their heads and all such good The head p,+i subdivides pq' into two segments: one
angles are on the same side of the inverse path. We refer that form an angle of ß with PiPi+i and the other of
to vertices of i-paths as i-vertices. These vertices may ■K — ß. The former is a positive segment and the latter
not be Steiner vertices in the final construction. In the (excluding point pt+i) a negative segment. The collec-
next step, each i-path constructed has length bounded tion of heads of directed edges of i-paths (inside pq'cr')
by K where K is one more than four times the number on pq' subdivide points on pq' into two types: a pos-
of edges of T. itive point is one in at least a positive segment, and
a negative point otherwise. Points p and q' are (arbi-
Step 2. Planning Traps. trarily) said to be positive. By the formulation, pq' is
Consider each quadrilateral (non-fence) pq'cr'; see subdivided into three (possibly degenerate) portions by
Figure 5.1. Trace an i-path at r' with its second markers say mi and m.2 where mi 6 pm2. And, the
vertex r" on pq' so that Lr'r"q' — ß. Similarly, two portions pmi and m^q' are I-types containing only
trace an i-path at q' with its second vertex q" on pr' positive points, and mim2 (excluding points mx and
so that Lq'q"r' = ß. Suppose r\ and qi are vertices »«2) is O-type containing only negative points.

243
Notice that the above description of an edge is with Lemma 5.1 In the construction of a trap with base
reference to a quadrilateral incident to it. So, an edge is xy, the two t-paths from x and y are coherent. E3
subdivided into O-types and I-types on its two sides due
to at most three incident quadrilaterals. So there are Lemma 5.2 The number of traps constructed is at
at most three portions of O-types. These are possible most 6n. til
bases of traps to be constructed. Let us assume without
loss of generality that T contains no horizontal edges.
Lemma 5.3 Each trap has at most K edges. a
Step 3. Setting Traps. 6 Propagating Paths
For each vertex p €E S, consider the at most two
quadrilaterals that overlap an arbitrarily small hor- The necessity to propagate vertices to compute quality
izontal line segment having p as an interior point. triangulation is a consequence of the following simple
Pick from each one edge say pq' as a candidate edge lemma, which was introduced in Edelsbrunner, Tan and
to construct traps: for each quadrilateral incident Waupotitsch [ETW92].
to pq', construct a trap with base xy C pq' into the
Lemma 6.1 If xy is an edge in a triangulation T of
quadrilateral where xy is O-type.
a point set S, then n(T) > max,6s Ixsy where fi(T)
denotes the largest angle in 7*. EO
The above construction of a trap with base xy on pq'
in the direction into piq[cir[ is as follows. We need the In effect, propagation is to subdivide each long edge
notion of a t-path (the reverse of an i-path). A t-path into small ones so to remove large angles extended by
is a path where all its directed edges define good angles the edge.
of ß at their tails and all such good angles are on the To trace a path, we adapt a few terminology intro-
same side of the path. duced in [Mitc93b]. Consider a quadrilateral pq'cr' with
Lp < ß and right angles at q' and r'. Let s be a point
Trace two (coherent) t-paths at x and y into on pq'. The cone at s consists of all points t of pq'cr'
Pi<l'iCiri so that those good angles of/? at tails such that both Lisp and Ltsq' are good (i.e. at most
of directed edges are on the same side with re- a). Next, the maw of s is the portion of the cone at
spect to each t-path. Both t-paths continue until s on the boundary of pq'cr', except for s. Notice that
they have just reached say xj (possibly x) and each point on the maw of s is a candidate for extending
yi (possibly y), on piq[ of quadrilateral piq\cir[ a path from s. Next, the iterative construction of union
where one of the following is true: of cones at points in maws, starting with s, results in
the so-called horn of s. Initially at stage 0, the horn is
1. the t-paths intersect at a point, say z/, in
the cone at s. The horn at stage i + 1 is the union of
the interior of piq'iCir\ when continue to be cones at points in the union of maws, or simply maw,
extended; at stage i. It is clear that the two paths bounding the
2. piq[cir\ is a fence or piq\ is a convex hull horn of s are actually t-paths starting at s. They are
edge; or referred as the boundary paths of the horn. The center
path of the horn is the sequence of line segments where
3. piri is the very first edge visited for the fifth
each connects the midpoints of the maws (which are
times by the t-paths where Apiriqi G T
center path points) for two consecutive stages, starting
contains piq[cir't.
at s. (We can assume because of Lemma 6.2 below that
For cases 2 and 3, xi and yi are the dead ends each maw contains only points on one edge of a quadri-
and both t-paths are the boundary paths of the lateral, so the midpoint of the maw at a stage is well
trap. For case 1, consider z £ p\r\ where zzi is defined.)
perpendicular to xiyi. We take z as the dead end Given some point t in the maw of s at stage j, it is
if zz{ does not intersect cjr,'; otherwise, take r\ trivial to work from t back to s to obtain a path of length
as the dead end. And, we complete the boundary j + 1 with origin s and last vertex t. This is how the
paths of the trap by extending both t-paths till propagation phase constructs a propagation path for a
the dead end. vertex s by generating the horn of s iteratively until it
intersects (or covers) some point t that is an endpoint
Though case 1 modifies t-paths slightly in constructing of a spoke, a dead end, or a point on a fence or a convex
traps, it is easy to check that each trap does have its hull edge. Besides these, t may possibly be some point
base connected to its dead end(s) by two paths; see also common to cones of the horn from different stages—
the next lemma. which happens when the horn is self-intersecting inside

244
some quadrilateral. In this case, the chosen t has to agation paths.
appear as the last vertex as well as some intermediate
vertex of the constructed propagation path. One such Step 4a. Propagating Paths—Beginning Case.
possible t is a point in the current maw of stage j that For each endpoint s of a spoke that lies on some
is also a center path point of stage i for i < j and the edge of 7", we consider the two t-paths with origin
horn defined from t contains t. A propagation path s in the direction of a propagation path to be con-
constructed using this condition has length ji + 1 and structed for s (in Step 4). These t-paths sandwich
consists of a subpath from s to t followed by a loop an angle of IT — 2ß at s and each terminates once (1)
containing t as derived from the horn oft. it visits an edge of T twice or (2) it crosses some
Due to a technical reason (Section 7), we need to dis- spoke or arrives at a fence or a convex hull edge.
tinguish two types of self-intersecting horns—one inter- Only for (1), the last vertex of the t-path becomes
sects while passing through a quadrilateral for the sec- an origin as if it is a dead end which Step 4 uses to
ond time in the same orientation to one intersects while generate two propagation paths.
passing through in opposite orientation. It is the latter
that we do not use for constructing propagation path. Step 4b. Propagating Paths—Exceptional Case.
This is to avoid terminating a propagation path with di- Suppose in Step 4, a propagation path remains un-
rected edge qir-j such that the last vertex rj (other than determined for s after its horn has since entered the
an origin of some propagation path) being also a tail of base xy of a trap, say T, and traversed the same
other directed edge inside the quadrilateral containing number of edges as T to reach the edge containing
qfrj. (On the other hand, it is possible that a vertex, the two dead ends, Xd and yd, of T. Let w be any
other than dead ends and endpoints of spokes, is passed point in the intersection of the horn of s with xy,
through by two different propagation paths in opposite and let a w and b w be the two points of the bound-
directions. This does not create technical difficulties for ary paths of the horn of w (in T) on xjyj. Treat
Section 7. But, for convenience, we will interpret such a w and b w as two additional dead ends just like the
a vertex as two nearby vertices in Section 7.) other dead ends identified earlier on. So each is an
We say a propagation path P terminates properly if origin of two propagation paths to be generated by
its last vertex rj is an endpoint of a spoke, a dead end, Step 4, one into T through x^yd and one out of
a point on a fence or a convex hull edge, or a head T. And, we complete the construction for s by a
common to another directed edge of P or other propa- propagation path that terminates at aw or bw.
gation path inside the quadrilateral containing the last
directed edge of P.
A few remarks are in order. First, the two t-paths
of s in Step 4a actually bounds the horn at s initially,
Step 4. Propagating Paths.
i.e. they are coherent. But they are not necessarily
Take endpoints of spokes and dead ends of traps
coherent in extending new directed edges and one may
as the current Steiner vertices of T■ These Steiner
actually be longer than the other eventually. Note that
vertices, except for centers of inscribing circles, are
we talk of these t-paths without requiring their vertices
origins of propagation paths to be generated. For
be Steiner vertices in the construction so far. Second,
an endpoint of a spoke on an edge of T, we generate
when both t-paths end in case (1), we can actually cre-
a propagation path in the direction out of the tri-
ate just one new dead end instead of two as stated. For
angle containing the spoke. For a dead end (which
this, we then fix one t-path as the initial part of the
is not also an endpoint of a spoke), we generate
propagation path to be constructed for s, and apply
two distinct propagation paths—one each into the
Step 4 to the last vertex of the t-path to complete the
two quadrilaterals containing the dead end on their
remaining part of the propagation path of s. This way
boundaries. All propagation paths are to terminate
avoids creating two other propagation paths. Third, we
properly.
will see that the above special arrangement of Step 4b is
needed at most once for each trap (with two dead ends).
The following two addenda to Step 4 are to ensure So we generate only O(n) propagation paths in total.
that the lengths of all propagation paths are bounded Fourth, the horn of w in T is properly contained in T,
by O(n). Firstly, Step 4a is performed to generate some as the horn of s does not meet the boundary paths of
new origins of propagation paths before the normal pro- T; otherwise, we would have a propagation path with
cessing of Step 4. This extra effort is to avoid using origin s that terminates properly at one dead end of T.
horns self-intersect in opposite orientations to create So, aw and bw are well defined. Again, we talk of the
propagation paths. Secondly, Step 4b handles an ex- horn of w without requiring vertices on its boundary
ceptional case due to Step 4 so to cut short some prop- paths be Steiner vertices.

245
The next result implies that once a horn intersects propagation paths. We remove edges and vertices
some spokes, we can construct from the horn a prop- of Ps except possibly for the last vertex of P, that is
agation path that terminates properly. So, we avoid shared by other propagation paths, and terminate
propagation paths that cross spokes. P by new edge g/r,-<.

Lemma 6.2 Let s be a point on pq' of quadrilateral


pq'cr'. If the maw of s contains points on cq' or cr^ Vertices of spokes and of propagation paths remained
then the maw of s contains r'. a after Step 5 form the final set of Steiner vertices for T-

Lemma 6.3 For a propagation path P to return to an Lemma 7.1 All propagation paths still terminate
edge of T, P has to visit some candidate edge (identified properly with each merging of paths. PJ
in Step 3). PJ Lemma 7.2 Once Step 5 has completed, any two di-
rected edges of the same orientation inside a quadrilat-
Lemma 6.4 If the horn of s self-intersects in opposite
eral do not cross. PJ
orientation at stage £, then there exists a propagation
path with origin s that terminates properly and has less
Lemma 7.3 Once Step 5 has completed, any two di-
than £ + 3n vertices. PI
rected edges that are vertex disjoint and of the same
orientation inside a quadrilateral define a region that
Lemma 6.5 Each propagation path constructed b
Step 4 has less than 15n vertices. ä has a good triangulation. PJ

Lemma 6.6 Step 4 computes less than 66n propaga-


tion paths. PJ
8 Untangling Crossings
For this and the next section, we view each directed
7 Removing Complications edge as an individual with two good angles at its tail,
without associating it to a particular propagation path.
The result of the propagation phase (Step 4) is another Though Step 5 (Section 7) also removes some crossings,
plane geometric graph conforms to 7'. Each vertex s on directed edges of opposite orientations may still cross
an edge, say pq', of a quadrilateral (non-fence) pq'cr' inside a quadrilateral. With reference to a quadrilat-
is such that there is another vertex t on pr' where st eral (non-fence) pq'cr', the next step is to get rid of
is an edge of some propagation path passing through all crossings by modifying edges while maintaining the
pq'cr'. So, either the two angles at s or that at t in- following invariants:
side pq'cr' are good. Because of this, quadrilaterals
with vertices on their boundaries can be triangulated 1-1. each edge is assigned an orientation with its tail defin-
ing two good angles;
with no bad triangles except when there are vertices
due to nearby directed edges of the same orientation. 1-2. each Steiner vertex is an endpoint of some directed
As such, we use the following merging step to remove edge;
this "complication". Vertices of pq'cr' along pq' are
labeled as p = <7o, gi, 92, • • •, 9( = ?' and along pr' as 1-3. no Steiner vertex is a tail of more than one directed
P = ro, ri, T2,. . ., rm — r'. A neighboring pair of di- edge;
rected edges are two directed edges of the same ori-
1-4. directed edges of the same orientation do not cross;
entation such that the segment defined by their tails
contains no other tail. 1-5. for two (non-crossing) vertex disjoint directed edges
g,r,/ and qyvy with i < j, the region defined by these
Step 5. Merging Paths. four vertices can be subdivided into two good trian-
For each quadrilateral pq'cr', repeat the following gles using rt'qj. Analogous assertion applies to two
so long there exists a neighboring pair qir-{i and vertex disjoint directed edges r,-^,- and rfqj.
qjrji, with i < j and good Lr^qjp and Lr^q^q'
or, analogously, a neighboring pair r,'<7,'< and r^qy These invariants are true initially. In particular, 1-1, 1-2
with i < j and good Iq^rjp and Iqiirjr'. We just and 1-3 are trivially true, and 1-4 and 1-5 are true due to
describe the former case. Let Ps be the shortest Lemma 7.2 and Lemma 7.3 respectively. In Step 6, the
subpath of some propagation path P starting with next available index from i refers to the smallest index,
qjVy until a vertex of P that is a head common starting at i and in increasing order, whose correspond-
to two (or more) directed edges, or a vertex on ing vertex can be used as the head of a new directed
a fence or convex hull edge, or an origin of other edge while maintaining 1-4. We say an ordered pair

246
(a, 6) is lexicographically smaller than another ordered Lemma 8.1 When applied to a quadrilateral pq'cr'',
pair (a', 6') if a < a', or a = a' and b < b'. Step 6 terminates by removing all crossings. ED

Step 6. Removing Crossings Lemma 8.2 Invariants 1-1 to 1-5 are maintained after
Consider each quadrilateral pq'cr' in turn to re- each iteration of Case A. LLI
move crossings. The following two cases are re-
peated until all crossings are removed. Each iter- Lemma 8.3 Invariants 1-1 to 1-5 are maintained after
ation involves edges g^r,^ crosses r^j, such that each iteration of Case B. LU
{i + j, h + ji) is lexicographically the smallest or-
dered pair. See Figure 8.1.
Case A. qi7il crosses rjqj1.
9 Triangulating Quadrilaterals
We first add qirj with the appropriate orientation
We now have for each quadrilateral pq'cr1 some Steiner
and remove qtrtl and rjqj1. Next, there are two
vertices on its boundary and directed edges in its in-
symmetrical cases depending on whether <?j,»•,•, de-
terior. Each Steiner vertex lies on some directed edge,
fines two good angles at qjl or at rtl. Let us discuss
and each directed edge defines two good angles at its
only the former. If qjl is no longer a vertex of any tail. Since directed edges do not cross, they subdivide
directed edge, we add qj~ri2 where i2 is the next
pq'cr' into regions of three, four, or five sides. We la-
available index from z'i. Next, if r,-, is no longer a bel these regions in their natural sequence starting with
vertex of any directed edge, we add r,-,"^-, where j2 that containing casßi then its adjacent one as R2 and
is the next available index from j\. so on until that containing p as Rm'- All except pos-
Case B. r,-~g,- crosses qj~rj. sibly for R\ have straightforward good triangulations.
We add qirj if qi is not a tail of any directed edge, We must however first handle R\ by merging nearby
else add r/g,- if ry is not a tail of any directed edge. regions to R\ until we have obtained a region with a
Next, if ru (qjl, respectively) is a vertex of other di- good triangulation. As such, some directed edges may
rected edges, we are done by removing r,~g,- (gj,~Vj, not be in the final triangulation—they serve as guides
respectively). Otherwise, move all directed edges in our construction.
(inclusive of r;fg,) crossing gjfr,- with heads at g,-
to qji where j' = i + 1. Step 7. Triangulating Quadrilaterals.
Quadrilaterals with no Steiner vertices or are fences
r=rm can easily be triangulated with no bad triangles; re-
fer to Lemma 4.1. We next consider each non-fence
pq'cr'. Label its regions subdivided by directed
n, edges from that containing c to that containing p as
rr^r
r Ri,R2,..., Rm' ■ Starting with V, = 0 and k = 0,
^C L^s / we then repeat incrementing k and including Rk
^^ "^ /
^^ >^ into V, until we can produce a good triangulation
^^
^^ // "^ ^ for K — uf=1i?i. Then for the remaining regions
^^
^ ...-J./ n i»_—0 0 RjJ = k + 1, k + 2 ..., m' of three or four sides,
we triangulate each in a straightforward way.

Figure 8.1: Since directed edges of the same orientation do


not cross (invariant 1-4), the underlying directed edges based
Lemma 9.1 Each region Rk for k = 2, 3,..., m' has a
on the two chosen line segments tj.r.j and rJqJl must have
good triangulation. bü
opposite orientations. Any directed edge e with endpoint on r^
for j < i' < »i must cross g;r,, by the choice of (i +j,«'i +ji)-
As such and because of 1-4, the other endpoint of e must be Lemma 9.2 There exists a k < m' such that
q}2 for J2 > j\ with strict inequality for Case B, and e must 11 = uf=1Ä,- has a good triangulation. ED
have the same orientation as the directed edge based on rjqn.
A similar statement applies to directed edges with endpoints Till here, we have the following theorem:
on qy for t < j' < j\.
Theorem 9.3 Triangulating a plane geometric graph
It is clear that each iteration of either Case A or Case g - (5, E) of \S\ = n vertices and \E\ - O(n) edges
B may introduce new crossings. Still, the process can using angles no larger than |;r requires 0(n2) Steiner
be shown to terminate. vertices. ED

241
10 Implementing Construction otherwise, it is ignored in Step 4 and is not considered
a Steiner vertex in later steps.
In this section, we describe an efficient algorithm to Step 5 and Step 6 are the same as before. The for-
implement the above constructive proof. Also, we dis- mer actually further removes away some unnecessary
cuss ways to avoid some redundant Steiner vertices, Steiner vertices. Note that a dead end can be treated
and extend the construction to a better angle bound as an ordinary vertex subject to removal by Step 5 if
of a = Y^7T. Let us assume that each point coordinate the dead end originates one instead of two propagation
can be stored in a constant amount of storage and that paths (in opposite directions) at the completion of Step
basic geometric operations, such as projecting a point 4. A similar consideration applies to an endpoint of
onto a line can be carried out in a constant amount of a spoke. Finally, Step 7 works quite the same as be-
time. fore: for a non-fence, we just use the straightforward
method in Lemma 9.1; otherwise, we have a fence with
Theorem 10.1 Triangulating a plane geometric graph ß < lp <1ß that can be solved with Lemma 4.1. How-
Q = (S,E) of \S\ = n vertices and \E\ = 0(n) edges ever, there is one problem—let us pick Case c for the
using angles no larger than |7r requires 0(n2) storage discussion, and note that a similar situation occurs for
and 0(n2 log n) time. ED Case b. Vertices p',q',r' used in Step 1 to subdivide
Apqr into three triangles are not necessarily Steiner
Reducing Steiner Vertices. The above construction vertices as mentioned. So the resulting triangulation
generates substantially many Steiner vertices, though obtained from Lemma 9.1 or Lemma 4.1 may have tri-
it achieves the worst case optimal bound. As implied angles with vertices that are not actually created. These
by Lemmas 6.5 and 6.6, the constant factor in the triangles have to be discarded. As a result, we obtain
quadratic bound is relatively large. Fortunately, we an untriangulated region R supported by edges of Apqr
see in the following a modified construction that avoids and directed edges inside Apqr. It can be proved that
many redundant propagation paths and Steiner ver- R resulted from Case b or Case c always has a good tri-
tices. Let us start with Step 1. Instead of subdivid- angulation and one can thus be constructed in constant
ing each triangle pqr of T with largest angle at q into time since R has at most six edges. In summary, the im-
three quadrilaterals, we subdivide it into two or three provement still runs with 0(n2) storage and 0(n2 logn)
triangles as follows depending on lq. time.

Case a. Lq > a. Reducing Angle Bound. The angle bound of |?r can
Subdivide Apqr into Apqq' and Arqq' where q' G pr slightly be improved to a = j±n (i.e. 132°), but with a
and Lpqq' — Lrqq1. We treat qq' as a spoke. larger constant in the quadratic bound on vertex size.
Case b. Iß < lq < a. In this case, isosceles triangles has base angles ß — J=-K
Same as Case a. Additionally, mark Apqq' as a fence if (i.e. 48°) and apex angle <j> = -^n (i.e. 84°). All re-
Lp > /?, and similarly mark Arqq1 if Ir > ß. sults developed starting from Section 4 are valid except
for Lemma 4.1 and Lemma 9.2. We need not worry
Case c. lq < Iß.
about Lemma 9.2 since it is no longer relevant to the
Subdivide Apqr into Apr'q', Aqp'r', Arq'p1 and
above improved construction. As for Lemma 4.1, prob-
Ap'q'r' where p' G qr, q' G pr, r' G pq are so that lem arises when <f> < lp < 2ß. One way to resolve this is
pq' = pr',qp' = qr',rq' = rp'. Also, treat edges of
to perform the following before Step 1: subdivide each
Ap'q'r' as spokes, and mark each of the other three tri-
triangle pqr of T with largest angle less than 2ß by a
angles as a fence if its angle opposite its edge incident
new vertex s inside pqr into triangles with angles at s
to Ap'q'r' is no less than ß.
equal to g7r. The existence of such a subdivision can
With this subdivision, we then plan and set up traps easily be verified.
in Step 2 and Step 3, and create other dead ends in Step
4a. As before, we next generate propagation paths in
Step 4 (and Step 4b) but only for selected vertices. Each 11 Concluding Remarks
q' obtained in Case a is an origin of a propagation path
out of the triangle containing the spoke with q' as an Given a plane geometric graph, this paper shows that
endpoint. We next consider whether more propagation a conforming triangulation with a quadratic bound on
paths are to be created for s where s is either q' in its vertex set and the |7r bound on its angles can be
Case b, p' or q' or r' in Case c, or a dead end. When s computed in slightly more than quadratic time. Addi-
terminates some propagation path P' generated so far, tionally, the result applies to the better angle bound of
we generate a propagation path P" for it following P' Y|7T, but with a larger constant factor in the quadratic
(so we can imagine P' to include also the part of P")\ bound on the vertex set. This paper improves the re-

248
suit of Mitchell [Mitc93b] by reducing the asymptotic [Cave74] J. Cavendish. Automatic triangulation of ar-
bound on the vertex set by a logarithmic factor and the bitrary planar domains for the finite element
angle measure by at least j. Further reducing the angle method. Intl. J. Numer. Methods Engrg. 8 (1974),
bound closer to ^ is still very interesting. 679-696.
The main idea of the paper is on the control of the [Dey91] T. K. Dey. Decompositions of Polyhedra in Three
lengths of propagation paths using fences and traps. Dimensions. Techn. Rep. CSD-TR-91-056, Ph.D.
This is a similar strategy used in Edelsbrunner and Tan Thesis, Comput. Sei. Dept., Purdue Univ., IN,
[EdTa93], where the corresponding concept is termed 1991.
walls. The current paper is, however, much more com-
[EdTa93] H. Edelsbrunner and T. S. Tan. An upper bound
plex; major difficulties include the construction of the for conforming Delaunay triangulations. Discrete
linear number of traps and the modification of prop- Comput. Geom. 10 (1993), 197-213.
agation paths, whereas these issues do not appear in
[EdTa93] due to the nice feature of constructing walls [ETW92] H. Edelsbrunner, T. S. Tan, and R. Waupotitsch.
inside disks that are mutually disjoint and using only An 0(n2 log n) time algorithm for the minmax
angle triangulation. SIAM J. Sei. Statist. Com-
non-crossing propagation paths.
put. 13 (1992), 994-1008.

[Greg75] J. A. Gregory. Error bounds for linear interpola-


tion on triangles. The Mathematics of Finite El-
Acknowledgement ement and Applications II, J. R. Whiteman, ed.,
Academic Press, NY, 1975, 163-170.
I would like to thank Scott Mitchell for providing details
of his paper [Mitc93b]. [Laws77] C. L. Lawson. Software for Cl surface interpola-
tion. In Math. Software III, J. R. Rice, ed., Aca-
demic Press, 1977, 161-194.
References [MeSo92] E. A. Melissaratos and D. L. Souvaine. Coping
[BaAz76] I. Babuska and A. K. Aziz. On the angle condition with inconsistencies: a new approach to pro-
in the finite element method. SIAM J. Numer. duce quality triangulations of polygonal domains
Anal. 13 (1976), 214-226. with holes. In "Proc. 8th Ann. Sympos. Comput.
Geom., 1992", 202-211.
[BaLi84] R. E. Barnhill and F. F. Little. Three and four-
[Mitc93a] S. A. Mitchell. Mesh Generation with Provable
dimensional surfaces. Rocky Mountain J. Math.
Quality Bounds. Techn. Rep. CS-TR-92-1327,
14 (1984), 77-102.
Ph.D. Thesis, Comput. Sei. Dept., Cornell Univ.,
[BDE92] M. Bern, D. Dobkin and D. Eppstein. Triangulat- NY, 1993.
ing polygons without large angles. In "Proc. 8th [Mitc93b] S. A. Mitchell. Refining a triangulation of a pla-
Ann. Sympos. Comput. Geom., 1992", 222-231. nar straight-line graph to eliminate large angles.
[BEG90] M. Bern, D. Eppstein and J. Gilbert. Provably In "Proc. 34th Ann. IEEE Sympos. Found. Com-
good mesh generation. In "Proc. 31st Ann. IEEE put. Sei., 1993", 583-591.
Sympos. Found. Comput. Sei., 1990", 231-241. [Mitc94] S. A. Mitchell. Finding a covering triangula-
To appear in J. Comp. System Science. tion whose maximum angle is provably small. In
"Proc. 17th Ann. Computer Science Conference,
[BeEp91] M. Bern and D. Eppstein. Polynomial-size nonob-
ACSC-17, 1994".
tuse triangulation of polygons. Intl. J. Comput.
Geom. Appl. 2(3) (1992), 241-255. [Rupp93] J. Ruppert. A new and simple algorithm for qual-
ity 2-dimensional mesh generation. In "Proc. 4th
[BeEp92] M. Bern and D. Eppstein. Mesh Generation ACM-SI AM Sympos. Discrete Algorithms, 1993",
and Optimal Triangulation. In Computing in Eu- 83-92.
clidean Geometry, D. Z. Du and F. K. Hwang,
eds., World Scientific, Singapore, 1992, 23-90. [Tan93] T. S. Tan. Optimal Two-Dimensional Triangula-
tions. Techn. Rep. UIUCDCS-R-92-1783, Ph.D.
[BMR94] M. Bern, S. A. Mitchell and J. Ruppert. Linear- Thesis, Comput. Sei. Dept., Univ. Illinois, Ur-
size non-obtuse triangulation of polygons. In bana, IL, 1993.
"Proc. 10th Ann. Sympos. Comput. Geom.,
1994". [Tan94] T. S. Tan. An optimal bound for conforming
quality triangulations. Techn. Rep., Dept. Inform.
[Bois88] J. D. Boissonnat. Shape reconstruction from pla- Sys. & Comput. Sei., National Univ. Singapore,
nar cross sections. Computer Vision, Graphics, Singapore, 1994.
and Image Process. 44 (1988), 1-29.

249
On the Maximum Degree of Minimum Spanning Trees
Gabriel Robins and Jeffrey S. Salowe*
Department of Computer Science, University of Virginia, Charlottesville, VA 22903-2442

Abstract The Bounded Degree Minimum Spanning Tree


(BDMST) problem: Given a complete weighted
Motivated by practical VLSI routing applications,
graph and an integer D > 2, find a minimum-cost
we study the maximum vertex degree of a minimum
spanning tree (MST). We prove that under the Lp spanning tree with maximum vertex degree < D.
norm, the maximum, vertex degree over all MSTs is
equal to the Hadwiger number of the corresponding Finding a BDMST of maximum degree D = 2 is
unit ball; we show an even tighter bound for MSTs equivalent to solving the traveling salesman problem,
where the maximum degree is minimized. We give the which is known to be NP-hard [6]. Papadimitriou and
best-known bounds for the maximum MST degree for
Vazirani have shown that that given a planar pointset,
arbitrary Lp metrics in all dimensions, with a focus
the problem of finding a Euclidean BDMST with D =
on the rectilinear metric in two and three dimensions.
We show that for any finite set of points in the Man- 3 is also NP-hard [15]. On the other hand, they also
hattan plane there exists an MST with maximum de- note that a BDMST with D = 5 in the Euclidean
gree of at most A, and for three-dimensional Manhat- plane is actually a Euclidean MST and can therefore
tan space the maximum possible degree of a minimum- be found in polynomial time. The complexity of the
degree MST is either 13 or 14. BDMST problem when D = 4 remains open. Ho,
Vijayan, and Wong [11], proved that an MST in the
1 Introduction rectilinear plane must have maximum degree of D < 8,
and state (without proof) that the maximum degree
Minimum spanning tree (MST) construction is a bound may be improved to D < 6. The results of
classic optimization problem for which several efficient Guibas and Stolfi [9] also imply the D < 8 bound.
algorithms are known [8] [14] [17]. Solutions of many
In this paper we settle the bounded-degree MST
other problems hinge on the construction of an MST
problem in the rectilinear plane: we show that given a
as an intermediary step [3], with the time complex-
planar pointset, the rectilinear BDMST problem with
ity sometimes depending exponentially on the MST's
D < 3 is NP-hard, but that the rectilinear D > 4 case
maximum vertex degree, as in the algorithm of Geor-
is solvable in polynomial time. In particular, we prove
gakopoulos and Papadimitriou [7]. Applications that
that in the rectilinear plane there always exists an
would benefit from MSTs with low maximum vertex
MST with maximum degree of D < 4, which is tight.
degree include Steiner tree approximation [13] as well
We also analyze the maximum MST degree in three
as VLSI global routing [1] [16]. With this in mind, we
dimensions under the rectilinear metric, which arises
seek efficient methods to construct an MST with low
in three-dimensional VLSI applications [10], where we
maximum vertex degree:
show a lower bound of 13 and an upper bound of 14
*This work was partially supported by NSF grants MIP-
on the maximum MST degree (using the previously
9107717 and CCR-9224789. The authors' Email addresses are known techniques, the best obtainable lower and up-
robins@cs.virginia.edu and salowe@cs.virginia.edu. per bounds for three dimensions under the rectilinear
Permission to copy without fee all or part of this material is metric were 6 and 26, respectively).
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the More generally, for arbitrary dimension and Lp
title of the publication and its date appear, and notice is given metrics we investigate : (i) the maximum possible ver-
that copying is by permission of the Association of Computing tex degree of an MST, and (ii) the maximum degree
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. of MSTs in which the maximum degree is minimized.

10th Computational Geometry 94-6/94 Stony Brook, NY, USA


© 1994 ACM 0-89791-648-4/94/0006..$3.50
250
We relate the maximum MST degree under the Lp It is known that the regular ^-simplex realizes the
metric to the so-called Hadwiger number of the cor- lower bound and the fc-hypercube realizes the up-
responding Lp unit ball. The relation between MST per bound [19]. Tighter bounds are known for k-
degree and the packing of convex sets has not been hyperspheres; Wyner [20] showed that the Hadwiger
elucidated before, though Day and Edelsbrunner [5] number for spheres is at least 20-20™(1+o(1)), and Ka-
studied the related "attractive power" of a point. For batjansky and Levenstein [12] showed that it is at
general dimension we give exponential lower bounds most 20A01k(-1+°(1V. Only four Hadwiger numbers for
on the Hadwiger number and on the maximum MST spheres are known exactly; these are the numbers in
degree. dimensions 2, 3, 8, and 24, and they are 6, 12, 240, and
196560, respectively. The three-dimensional Hadwiger
Our results have several practical applications. For
number has a history dating back to Newton and was
example, our efficient algorithm to compute an MST
only determined much later.
with low maximum degree enables an efficient im-
plementation of the Iterated 1-Steiner algorithm of For two points x = (xi, x2, ■ ■ ■, Xk) and y =
Kahng and Robins for VLSI routing [13], which af- (2/1,2/2, •• -,2/Jfe) in fc-dimensional space 3?fc, the Lp dis-
fords a particularly effective approximation to a rec- tance between x and y is \\xy\\p = yY^i=i \xi ~~ ^'lP-
tilinear Steiner minimal tree (within 0.5% of optimal For convenience, if the subscript p is omitted, the rec-
for typical input pointsets [18]), and where the central tilinear metric is assumed (i.e., p = 1). Let B(k,p,x)
time-consuming loop depends on the maximum MST denote an open Lp unit ball centered at a point x in
degree [1] [2]. Our results also have implications to 3?fc (we use 3£p to denote fc-dimensional space where
newly emerging three-dimensional VLSI technologies distances are computed under the Lp metric). When
[10], as well as for any other algorithms that use an x is the origin, B(k,p, x) is denoted as B(k,p), and we
MST as the basis for some other construction. use H(k,p) to denote the Hadwiger number of B(k,p).
The remainder of the paper is as follows. Section 2 Let I(k,p) be the maximum number of points that
establishes the terminology and relates the maximum can be placed on the boundary of an Lp fc-dimensional
MST degree to the Hadwiger numbers (the central unit ball so that each pair of points is at least a unit
result is Theorem 4). Section 3 studies the Lx Had- apart. With respect to a finite set of points PC$J
wiger numbers and the maximum MST degree for the and an MST T for P, let v{k,p,P,T) be the maxi-
Li metric. Section 4 considers the Hadwiger numbers mum vertex degree of T (also referred to as simply
and the maximum MST degree for arbitrary Lp met- the degree of T). Let v(k,p,P) = maxi/(k,p,P,T),
rics. We conclude in Section 5 with open problems. where r is the set of all MSTs for P, and let
i/(k,p)= mzxv(k,p,P). In other words, v(k,p,P)
2 Hadwiger and MST Numbers
denotes the maximum degree of any MST over P, and
A collection of open convex sets forms a packing if i/(k,p) denotes the highest possible degree in any MST
no two sets intersect; two sets that share a boundary over any finite pointset in ^-dimensional space under
point in the packing are said to be neighbors. The the Lp metric.
Hadwiger number H(B) of an open convex set B is We will need the following result, which is easily
the maximum number of neighbors of B considered
established.
over all packings of translates of B (a translate of B
is a congruent copy of B moved to another location in Lemma 1 \\xy\\p > 2 if and only if B(k,p,x) n
space while keeping B's original orientation). B(k,p,y) = 0. Further, \\xy\\p = 2 if and only if
There is a vast literature on Hadwiger numbers B(k,p,x) and B(k,p,y) are tangent.
(e.g., Croft et al. [4], Fejes T6th [19]). Most re-
sults address the plane, but there are several results Lemma 2 The Hadwiger number H(k,p) is equal to
for higher dimensions. In particular, if S is a convex I(k,p), the maximum number of points that can be
set in $tk (i.e., fe-dimensional space), the Hadwiger placed on the boundary of the unit ball B(k,p) so that
number H(S) satisfies: all interpoint distances are at least one unit long.

k2 + k < H(S) < 3* - 1 Proof: We first show that I(k,p) < H(k,p). Suppose

251
that I(k,p) points are on the boundary of B(k,p) and imum of the degrees of all minimum-degree MSTs over
are each at least a unit distance apart. Consider plac- all finite pointsets in 5ft* (recall that we use the phrase
ing an Lp ball of radius | around each point, includ- "the degree of T" to refer to the maximum vertex de-
ing one at the origin. By Lemma 1, these balls form gree of the tree T).
a packing, and all the balls touch the ball containing
Although it is clear that v(k,p) < v(k,p), it is
the origin. Therefore, I(k,p) < H(k,p).
not clear when this inequality is strict. In order to
Next we show that H(k,p) < I(k,p). Consider a count v(k,p), we define the MST number M(k,p) sim-
packing of Lp unit balls, and choose one to be centered ilarly to the Hadwiger number H(k,p), except that the
at the origin. Consider the edges connecting the origin translates of the Lp unit ball B(k,p) are slightly mag-
to each center of the neighboring balls. The intersec- nified. The underlying packing consists of B(k,p) as
tions of these edges with the boundary of B(k,p) yield well as multiple translated copies of (1 + e) ■ B(k,p),
a pointset where each pair of points is separated by at and M(k,p) is the supremum over all e > 0 of the
least a unit distance, otherwise we would not have a maximum number of neighbors of B(k,p) over all such
packing of Lp unit balls. r-i packings. Clearly M(k,p) < H(k,p). We also define
I(k,p) as the number of points that can be placed on
Lemma 3 The Hadwiger number H{k,p) is equal to the boundary of B(k,p) so that each pair is strictly
v(k,p), the maximum MST degree over any finite greater than one unit apart.
pointset in 5ft* Consider a set S = {xx,. . ., xn] of n points in 5ft*.
For convenience, let N = 2\^>, and let Si,. .., Sjv be
Proof: We show that v(k,p) < I(k,p), the maximum the set of sums of the interdistances, one sum for each
number of points that can be placed on the bound- distinct subset. Let
ary of an Lp ^-dimensional unit ball so that each
pair of points is at least a unit apart. Let x be a 0 < 8 = min {\Si - Sj\ : \S{ - S, I > 0}
point, and let j/i,.. ., yv be points adjacent to x in an
MST, indexed in order of increasing distance from x. A perturbation of a pointset S is a bijection from S
Note that (j/;, yj) must be a longest edge in the trian- to a second set S' = {x[,.. . ,x'n} (for convenience,
gle (x,yi,yj), and that the MST restricted to x and assume that the indices indicate the bijection); we say
yi,...,yv is a star centered at x. Draw a small Lp that a perturbation of S is small if
ball around x, without loss of generality a unit ball,
and consider the intersection of the segments (x,yi),
1 < « < i^, with B(k,p,x). Let these intersection
Ei lP<2

points be called &, 1 < i < v, and suppose there is


a pair & and y~j, i < j, with ||y;?/j||p < 1. Note that In discussing spanning trees of S and the perturbed
(yi,y~j) is the shortest edge on the triangle (x,yi:yj), set 5", we assume that the vertex set [n] consists of the
and (x, yj) is a longest edge. Now consider similar tri- integers 1 ton, where vertex i corresponds to point Xi
angle (x, yi, z), where z is a point on the edge (x, yj). or point x\. The topology of a tree over vertex set [n]
The path from yj to z to y, is shorter than the length is the set of edges in the tree.
of (x,yj), so (yi,yj) is not a longest edge in triangle
(x, yi} yj), a, contradiction. We note this bound is tight Theorem 4 Let S be a set of points in 5ft*, and let S'
for pointsets that realize I(k,p). rj be a set of points corresponding to a small perturbation
of S. Then the topology of an MST for S' is also a
We next consider a slightly different number
topology for an MST for S.
i>(k,p), which is closely related to v(k,p). Recall
that v(k,p,P,T) denotes the maximum vertex de-
Proof: Let T be an MST for S, and let T be an
gree of the tree T. Let i>(k,p, P) = mini/(k, p, P, T),
MST for S'. Let l(T) and l(T) be the lengths of T
where r is the set of all MSTs for P, and let and T', respectively. Then /(T)-f < /(!") < /(T)+f.
0(k,p)= max v(k,p, P). In other words, u(k,p,P)
PC3^fc Consider the tree T with the same topology as T" but
denotes the degree of an MST over P that has the with respect to pointset 5. Now, l(T') - f < 1(f) <
smallest possible degree, and v(k,p) denotes the max- l(T) + f, so l(T) - S < 1(f) < l(T) + 6. Since 6 is

252
the minimum positive difference between the sums of partition has the uniqueness property, which in turn
any two distinct subsets of interdistances, l(T) — l(T), implies an upper bound of 8 on the maximum MST
and f is also an MST for S. □ degree in the Manhattan plane.

Lemma 5 The maximum of the degrees of all Lemma 6 Given a point p in the Manhattan plane,
minimum-degree MSTs over all finite pomtsets in 3^, each region of the diagonal partition with respect to p
is equal to the maximum number of slightly magnified has the uniqueness property.
unit balls that can be packed around a given unit ball;
that is, P{k,p) = M(k,p). Proof: We need to show that for any two distinct
points u and w that lie in the same region, \\wu\ <
Proof: Let 5 be a set of points, and let 6 be defined max(||iup||,up||). This is obvious for the one dimen-
as above. Place a small Lp ball about each point x G sional regions. Consider u, w in one of the two dimen-
5 (without loss of generality a unit ball, though the sional regions. Assume without loss of generality that
intent is that x is the only point inside B(k,p,x)), ||up|| < ||iup|| (otherwise swap the roles of u and v in
and connect each distinct pair (x,y), x,y G S, with this proof). Consider the diamond D with left corner
a line segment. Consider the intersections of these at p and center at c, such that u is on the bound-
edges with B(k,p,x). Perform a small perturbation ary of D (see Figure 1(c)). Let a ray starting at p and
on S so that no two intersection points have length 1. passing through w intersect D at b. By the triangle in-
Repeat the argument used in the proof of Lemmas 2 equality, \\wu\\ < \\wb\\ + \\bu\\ < ||iu6|| + ||6c|| + ||cu|| =
and 3, this time with balls of the form (1 + c) -B(k,p), ||iu6|| + ||6c|| + ||cp|| = \\wp\\. Thus every one of the
for small e > 0. The first part shows that I(k,p) = 8 regions of the diagonal partition has the uniqueness
M{k,p), and the second that i>(k,p) < I(k,p). This property. □
bound is tight for pointsets that realize I(k,p). rj

3 The Maximum Lx MST Degree


Hadwiger numbers are notoriously difficult to com-
pute. In this section, we determine the 2 and 3 dimen-
sional Hadwiger numbers for the diamond and octa-
hedron, respectively. The first of these numbers is
well-known, but we could not find any reference for
the octahedron. We also study the MST numbers,
obtaining a value of 4 in two dimensions, and bounds
in higher dimensions. For notational convenience, we
define:
The Uniqueness Property: Given a point p, a
region R has the uniqueness property with respect
to p if for every pair of points u,w G R, \\wu\ <
max(||u;p||,up||).
A partition of space into a finite set of disjoint regions
is said to have the uniqueness property if each of its
regions has the uniqueness property.
Define the diagonal partition of the plane as the
partition induced by the two lines oriented at 45 and Figure 1: A partition of SR — {p} into 8 regions such
-45 degrees through a point p (i.e., partitioning 5ft2 - that for any two points u and w that lie in the same
{p} into 8 disjoint regions, four "wedges" of dimension region, either ||um|| < ||«>p|| or else \\uw\\ < \\up\\.
two (labeled Rl through RA in Figure 1(a)), and four
"half-lines" of dimension one (labeled R5 through RS
in Figure 1(a)). It is easy to show that the diagonal

253
Corollary 7 The maximum possible degree of an
MST over any finite pointset in the rectilinear plane
is equal to 8; that is, v{2,1) = 8.

Proof: By Lemma 6 the diagonal partition has the


uniqueness property, which implies that 1(2,1) <.8.
The pointset {(0, 0), (±1,0), (0, ±1), {±\,±\)} shows
that this bound is tight. Lemmas 2 and 3 imply that
the maximum MST degree in the Manhattan plane is
equal to 8. □
We now show an analogous result for three-
dimensional Manhattan space. Consider a cuboctahe-
dralpartition of 3?f into 14 disjoint regions correspond-
ing to the faces of a truncated cube (Figure 2(a-b)),
i.e., 6 congruent pyramids with square cross-section
(Figure 2(c)) and 8 congruent pyramids with trian-
gular cross-section (Figure 2(d)). Most of the region
boundaries are included into the triangular pyramid
regions as shown in Figure 3(c), with the remaining
boundaries forming 4 new regions (Figure 3(d)), to a
(d)
total of 18 regions. Following the same strategy as
in the two-dimensional case, we first show that the
uniqueness property holds.

Lemma 8 Given a point p in three-dimensional Man-


hattan space, each region of the cuboctahedral partition
with respect to p has the uniqueness property.

Proof: We need to show that for any two points u and


w that lie in the same region of the cuboctahedral
partition, \\wu\ < max(||wp||, up\\). This is obvious
(f)
for the 2 dimensional regions that are the boundaries (e)
between the pyramids (by an argument analogous to
that of Lemma 6). Figure 2: A truncated cube (a-b) induces a 3-
Consider one of the square pyramids R with respect dimensional cuboctahedral partition of space into 14
regions: 6 square pyramids (c), and 8 triangular pyra-
to p (Figure 2(c)), and let u,w 6 R. Assume without
mids (d). Using the triangle inequality, each region
loss of generality that ||up[| < \\wp\\ (otherwise swap may be shown to contain at most one candidate point
the roles of u and w). Consider the locus of points for connection with the origin in an MST (e-f).
D C R that are distance ||up|| from p. (Figure 2(e));
D is the upper half of the boundary of an octahedron.
Let c be the center of the octahedron determined by
D, so that c is equidistant from all points of D. Let
6 be the intersection of the surface of D with a ray To show the uniqueness property for the triangular
starting fromp and passing through w. By the triangle pyramids, consider one of the triangular pyramids R
inequality, ||w;w|| < ||w;6[| + ||6w|| < \\wb\\ + \\bc\\ + with respect to p (Figure 2(d)), and let u,w £ R.
\\cu\\ = \\wb\\ + \\bc\\ + \\cp\\ = \\wp\\ (recall that the Assume without loss of generality that ||up|| < \\wp\\
square pyramid regions do not contain their boundary (otherwise swap the roles of u and w). Consider the
points). Thus, w is closer to u than it is to p, which locus of points D in R that are at distance ||up|| fromp
implies that the region R has the uniqueness property. (Figure 2(f)). Let b be the intersection of D with a ray

254
shows that this bound is tight. Lemmas 2 and 3 imply
that the maximum MST degree in three-dimensional
Manhattan space is 18. r-.

.* •• R. We can further refine the maximum MST degree


bound of Corollary 7 by applying the perturbative ar-
gument of Theorem 4.
R
i ^Hx? Theorem 10 The maximum degree of a minimum-
:::::^<5
degree MST over any finite pointset in the rectilinear
(a) (b)
plane is A; that is, 0(2,1) = 4.

Proof: The pointset {(0,0), (±1,0), (0, ±1)} estab-


lishes a lower bound of 4. To get the upper bound of
4, consider 1(2,1), the number of points that can be
placed on boundary of a unit ball (i.e., a diamond) in
5Ri such that each pair of points is strictly greater than
one unit apart. Consider the diagonal partition, as in
the proof of Lemma 6; at most one point can be in
the closure of each of the four 2-dimensional regions,
proving the result. r-.

Theorem 10 has an interesting consequence on the


Figure 3: Assigning the boundary points to the var- complexity of the BDMST problem restricted to the
ious region: a hollow (solid) dot indicates an open
rectilinear plane:
(closed) interval. A topological mapping of the cuboc-
tahedron (a) is shown in (b). The various boundaries Instance: A planar pointset P = {xlt..., xn), and
are included into the triangular pyramid regions (c), integers D and C.
while the square pyramids do not contain any bound-
ary points. The remaining boundaries form 4 new re- Question: Is there a rectilinear spanning tree with
gions (d), bringing the total to 18. maximum degree < D and cost < C?
If D = 4, the question can be decided in polyno-
mial time. In fact, our methods establish that such
a bounded-diameter MST can be computed as effi-
starting from p and passing through w. By the triangle ciently as an ordinary MST. On the other hand, if
inequality, \\wu\\ < ||u;6|| + ||6u|| < ||w&|| + ||&p|| = ||iop|| D = 2, the problem is essentially a rectilinear travel-
(recall that each triangular region is missing one of its ing salesman problem (a wandering salesman problem,
boundary faces, as shown in Figure 3(a-b)). Thus, w since the tour is a path rather than a circuit), and it
is closer to u than it is to p, which implies that the is therefore NP-complete. It turns out that the D = 3
region R has the uniquenes property. question is also NP-complete, using a proof identical
Thus every one of the 18 regions of the cuboctahedral to the one appearing in Papadimitriou and Vazirani
partition has the uniqueness property. r-i [15] (their result is for the corresponding Euclidean
problem, but since they restrict their construction to
a special type of grid graph, their proof holds in the
Corollary 9 The maximum possible degree of an
rectilinear metric as well). We can summarize the rec-
MST over any finite pointset in three-dimensional
tilinear and Euclidean results in the following table:
Manhattan space is equal to 18/ that is, i/(3,1) = 18.
Complexity of the B DMST Problem
Proof: By Lemma 8 the cuboctahedral partition has D Euclidean rectilinear
the uniqueness property, which implies that 7(3,1) < 2 NP-complete JNP-complete
3 JNP-complete NP-complete
18. The pointset {(0,0,0), (±1,0,0), (0,±1,0), 4 open polynomial
(0,0, ±1), (±|,±i,0), (0,±|,±±), (±i,0,±i)} >b polynomial polynomial

255
Next, we refine the maximum MST degree bound Proof: Consider the family F(j) of points
(±i,.. .,±i,0,.. .,0), where j is an integer between
of Corollary 9.
1 and k. (Here, the j nonzero terms can be arbitrarily
Theorem 11 The maximum degree of a minimum- interspersed in the vector.)
degree MST over any finite pomtset in 2,-dimensional Each member of F(j) is distance 1 from the origin;
rectilinear space is either 13 or 14; that is, 13 < the distance between x G F(j) and y G F(j) depends
I>(3,1) < 14. on the positions and signs of the nonzero terms. Given
x = (x1>x2,...,xk) G F(j), let x be the binary vector
Proof: For the lower bound, the following pointset
containing a 1 in bit i if x, ^ 0 and a 0 in bit i if
shows that the maximum degree of an MT is I(k,p) >
X( = 0. If the Hamming distance between x and y is
13: {(0,0,0), (±100,0,0), (0,±100,0), (0,0,±100),
at least j, then ||xy|| > 1. (The Hamming distance
(47j _4,49), (-6, -49,45), (-49, 8,43), (-4,47, -49), between two bit vectors is the number of bit positions
(_49!_6,-45), (8,-49,-43), (49,49,2)}, since for
in which they differ.) We want to find a large set of
this pointset, all non-origin points are strictly closer
x that are mutually Hamming distance greater than j
to the origin than they are to each other, forcing the
apart.
MST to be unique with a star topology.
Consider the set V(j) of bit vectors containing ex-
To obtain the upper bound of 14 on the maximum
actly j l's; \V(j)\ = ({). Form a graph G{t) =
MST degree, consider the cubeoctahedral partition.
(V(t), E(t)) for which (x, y) G E(t) if and only if the
Any two points lying in the closure of one of the 14
Hamming distance between x and y is at most j. Note
main regions of the cuboctahedral partition must be Li/2J
within distance 1 of each other. □ that G(t) is regular with degree d(j) - ^ (])( 7;).
8=1
We note that there is an elementary means to set-
To see this, we determine the number of edges adja-
tle the 13 vs. 14 question raised in Theorem 11.
cent to x = (1,...,1,0,...,0), where there are j l's.
Suppose we are trying to decide whether 14 points
The set of vectors in V(j) adjacent to x can be par-
can be placed on the surface of a unit octahedron
titioned into vectors that contain i 0's in the first j
so that each pair is greater than a unit distance
positions, 1 < i < |jj + 1. For a given i, there are (])
apart. The relationship between point (xi,yi,Zi) and
ways to choose the 0 positions and (fcTJ) positions to
point (xj,yj,Zj) can be phrased by the inequality
place the displaced l's in the last k - j positions.
\xi -Xj\ + \yi-Vj\ + \zi - ZJ I > 1 subJect to the con-
straints \xi\ + \yi\ + \zi\ = 1 and \XJ\ + \yj\ + \ZJ\ = 1. Here is our strategy to find a subset of V(j) of large
The absolute values can be removed if the relative or- cardinality that are mutually far apart: choose a ver-
der between xx and x2, etc., is known. We can there- tex, delete its neighbors, and continue. The number
fore consider all permutations of the coordinates of of vertices chosen must exceed \V(j)\/d(j). Suppose
the 14 points and produce the corresponding inequal- that cj = 16Vej = k. Then
ities. If the inequalities corresponding to a particular
permutation are simultaneously satisfied, i>(3,1) = 14, |VQ-)I > 0) > (?)
otherwise z>(3,1) = 13. Feasibility can be settled by d(j) (*■
i)(i)C?) (f-+ D^T(T)
determining whether a particular polytope contains a
nonempty relative interior (this approach is easily ex- ri/2
tended to any dimension k). We have not settled the >c'
4iyy " VieV
\16/ v^
13 vs. 14 question, and the above procedure seems
Here, c' and c" are constants; the approximation to
impractical due to the large number of resulting in-
({) is from Graham et al. [8]. Substituting for c gives
equalities. 2
the result. □
We now address the Hadwiger and MST Numbers
for the fc-crosspolytope. 4 The Maximum Lp MST Degree
Theorem 12 The maximum degree of a minimum- In this section, we provide bounds on M(k,p) for
degree MST over any finite pointset in $t\ is ai ^easi general Lp metrics.
ß(2°-°312*); that is, v(k, 1) = Q(2° 0312k).

256
Theorem 13 The maximum degree of a minimum- that the MST number is not maximized in the L^
degree MST over any finite pointset in $lk is at least metric in any dimension.
v{k,p) = Sl{Vk2n(l-E^), where a = £ and E(x) =
Theorem 14 The maximum degree of a minimum-
*ig;? + (i-z)igrb- degree MST over any finite pointset in 3^ is 2k; that
is, 0(k,oo) - 2k.
Proof: Consider the vertices of the fc-hypercube
(±1,..., ±1). Each of these points is k1/p from the Proof: We first show the result for p — oo; note that
origin. On the other hand, if points x and y differ the Lp unit ball is a fc-hypercube. The upper bound
from each other in j positions, they are distance 2j1'p is established by considering I(k,p), the number of
from each other. If 2j1/p > fc1/p, then x and y are points that can be placed on boundary of a unit ball
further from each other than they are from the origin. in 3?£ such that each pair of points is strictly greater
We need to find the largest cardinality set of points than one unit apart. Note that at most one point can
on the ib-hypercube that differ in at least J = ^ po- be placed in each fc-ant (the fc-dimensional analogue
sitions. To do this, construct a graph G whose vertex of "quadrant"). The lower bound is established by
set is the set of binary strings of length k, and for considering the set of 2fe vertices of a &-hypercube. rj
which there is an edge between string a and string b
Theorem 15 For each k, there is a p such that the
if and only if the Hamming distance between a and 6
maximum degree of a minimum-degree MST over any
is at most J. Proceed in the same manner as in the
finite pointset in 5R* space exceeds 2k; that is, for all
Tne
proof of Theorem 12, except that d(J) = 2_,G)- k there exists a p such that v{k,p) > 2

number of vertices chosen must exceed 2k/d(J). Now, Proof: Consider the pointset (—1, ±1,..., ±1),
(e,±8,...,±6), and (k1^, 0,..., 0), where {e? + (k -
l)tJP) = k. It is possible to choose e, 6, and p so that
i<ak ^ ' each pair of points is on the surface of a Lp ball of ra-
dius kllp, and all interdistances are greater than kllp.
for 0 < a < \ (see Graham et al. [8], Chapter 9,
Problem 42). Note that a = ^, so □
5 Conclusion
: Vk2k^-E^^ Motivated by practical VLSI applications, we
d(J)
showed that the maximum possible vertex degree in
n an Lp MST equals the Hadwiger number of the corre-
Theorem 13 shows that for any fixed p > 1, 0(k,p) sponding unit ball, and we determined the maximum
grows exponentially in the dimension. Note that this vertex degree in a minimum-degree Lp MST. We gave
bound is less than the bound obtained by Wyner [20] an exponential lower bound on the MST number of
(for H(k,2), it is fi(20-189*) since E{\) = fig 3- 1 « a jk-crosspolytope, and showed that the MST number
0.189), but it is sufficient for our purposes. for an Lp unit ball, p > 1, is exponential in the dimen-
It is well known that H(k,p) < 3^-1 (e.g., [19]). In sion. We concentrated on the L\ metric in two and
2-dimensional space, the Hadwiger number is largest three dimensions due to its significance for VLSI: for
for L\ and L«,, the only planar Lp metrics with Had- example, we showed that for any finite pointset in the
wiger number 8. For all other Lp metrics, the Had- Manhattan plane there exists an MST with maximum
wiger number is 6. On the other hand, the planar MST degree of at most 4, and that for three-dimensional
number is smallest for L\ and Leo, having a value of Manhattan space the maximum possible degree of a
4, and it is easily seen to be 5 for all other Lp metrics. minimum-degree MST is either 13 or 14.
These observations raise an interesting question: We solved an open problem regarding the complex-
how does the MST number behave as a function of p? ity of computing bounded-degree MSTs by providing
Note that the maximum Hadwiger number is achieved the first known polynomial-time algorithm for con-
by parallelotopes. Next we derive the MST number structing a MST with maximum degree 4 for an ar-
for the Loo unit ball (i.e., the fc-hypercube), and show bitrary pointset in the rectilinear plane. Moreover,

257
our techniques can be used to compute a bounded- [9] L. J. GUIBAS AND J. STOLFI, On Computing
diameter MST as efficiently as an ordinary MST. Fi- all North-East Nearest Neighbors in the LI Met-
nally, our results also enable a significant execution ric, Information Processing Letters, 17 (1983),
speedup of a number of common VLSI routing algo- pp. 219-223.
rithms. Remaining open problems include:
[10] A. C. HARTER, Three-Dimensional Integrated
Circuit Layout, Cambridge University Press, New
1. Whether the MST number for L\ in three dimen-
York, 1991.
sions is 13 or 14;
[11] J.-M. Ho, G. VIJAYAN, AND C. K. WONG,
2. The complexity of computing a planar Euclidean
New Algorithms for the Rectilinear Steiner Tree
MST with maximum degree 4;
Problem, IEEE Trans. Computer-Aided Design,
3. Tighter bounds on the Hadwiger and MST num- 9 (1990), pp. 185-193.
bers for arbitrary k and p.
[12] G. A. KABATJANSKY AND V. LEVENSTEIN,
Bounds for Packings of the Sphere and in Space,
References Prob. Information Trans., 14 (1978), pp. 1-17.

[1] T. BARRERA, J. GRIFFITH, S. A. MCKEE, [13] A. B. KAHNG AND G. ROBINS, A New Class of
G. ROBINS, AND T. ZHANG, Toward a Sterner Iterative Steiner Tree Heuristics With Good Per-
Engine: Enhanced Serial and Parallel Implemen- formance, IEEE Trans. Computer-Aided Design,
tations of the Iterated 1-Steiner Algorithm, in 11 (1992), pp. 893-902.
Proc. Great Lakes Symp. VLSI, Kalamazoo, MI,
March 1993, pp. 90-94. [14] M. KRUSKAL, On the Shortest Spanning Subtree
of a Graph, and the Traveling Salesman Problem,
[2] T. BARRERA, J. GRIFFITH, G. ROBINS, AND Proc. Amer. Math Soc, 7 (1956), pp. 48-50.
T. ZHANG, Narrowing the Gap: Near-Optimal
Steiner Trees in Polynomial Time, in Proc. IEEE [15] C. H. PAPADIMITRIOU AND U. V. VAZIRANI, On
Intl. ASIC Conf., Rochester, NY, September Two Geometric Problems Relating to the Travel-
1993, pp. 87-90. ing Salesman Problem, J. Algorithms, 5 (1984),
pp. 231-246.
[3] T. H. CORMEN, C. E. LEISERSON, AND
R. RlVEST, Introduction to Algorithms, MIT [16] B. T. PREAS AND M. J. LORENZETTI, Phys-
Press, 1990. ical Design Automation of VLSI Systems, Ben-
jamin/Cummings, Menlo Park, CA, 1988.
[4] J. T. CROFT, K. J. FALCONER, AND R. K.
GUY, Unsolved Problems in Geometry, Springer- [17] A. PRIM, Shortest Connecting Networks and
Verlag, New York, 1991. Some Generalizations, Bell Syst. Tech J., 36
(1957), pp. 1389-1401.
[5] W. H. E. DAY AND H. EDELSBRUNNER, Effi-
cient Algorithms for Agglomerative Hierarchical [18] J. S. SALOWE AND D. M. WARME, An Exact
Clustering Methods, J. Classification, 1 (1984), Rectilinear Steiner Tree Algorithm, in Proc. IEEE
pp. 1-24. Intl. Conf. Computer Design, Cambridge, MA,
October 1993, pp. 472-475.
[6] M. R. GAREY AND D. S. JOHNSON, Computers
and Intractability: a Guide to the Theory of NP [19] G. F. TÖTH, New Results in the Theory of Pack-
Completeness, W. H. Freeman, San Francisco, ing and Covering, Convexity and its Applica-
1979. tions, 1983.
[7] G. GEORGAKOPOULOS AND C. H. PAPADIM- [20] A. D. WYNER, Capabilities of Bounded Dis-
ITRIOU, The 1-Steiner Tree Problem, J. Algo-
crepancy Decoding, AT&T Tech. J., 44 (1965),
rithms, 8 (1987), pp. 122-130. pp. 1061-1122.
[8] R. L. GRAHAM AND P. HELL, On the History of
the Minimum Spanning Tree Problem, Annals of
the History of Computing, 7 (1985), pp. 43-57.

258
Optimal Linear-Time Algorithm for the Shortest Illuminating Line
Segment in a Polygon
(Extended Abstract)

Gautam Das ** Giri Narasimhanf

An interesting related result due to Bha.ttacharya


Abstract and Mukhopadhyay [BM] is a linear-time algo-
Given a simple polygon, we present an optimal rithm to compute a single weakly-visible line seg-
linear-time algorithm that computes the shortest il- ment in a polygon. Although a linear-time algo-
luminating line segment, if one exists; else it reports rithm was presented for this problem in [DHN2], the
that none exists. This solves an intriguing open strength of their result lies in the fact that their
problem by improving the 0(n log n)-time algorithm algorithm does not use the linear-time triangula-
[Ke87] for computing such a segment. tion algorithm [Cha], or the linear-time algorithm
to compute shortest paths in a triangulated polygon
[LP, GHLST]. The present algorithm, in contrast,
1 Introduction uses both the triangulation as well as the shortest
path algorithms, but manages to compute more; it
In this paper we present an optimal linear-time al- computes the shortest weakly-visible segment in a
gorithm to do the following: given a simple polygon polygon. Another related result is an optimal linear-
with n vertices, it computes in 0(n) time the short- time algorithm due to Bhattacharya et al. [BMT]
est illuminating line segment inside the polygon, if for computing the shortest line segment from which
one exists; otherwise it reports that no such seg- the exterior of a simple polygon is weakly visible. It
ment exists. In other words, it computes the short- may be noted that we are concerned with internal
est line segment within a polygon that needs to be
weak visibility.
illuminated in order for the interior of the polygon
Besides resolving a long-standing open problem,
to be lit. The algorithm solves an outstanding open
our paper is also interesting because of the tech-
problem by improving the 0(n log n)-time algorithm
niques used. The results in this paper build on
presented by Ke [Ke87] for this problem.
some of our previous work on optimal linear-time
The concept of weak visibility in polygons was in-
algorithms for weak-visibility problems in polygons.
troduced by Avis and Toussaint [AT]. Since then it
The linear-time algorithms for computing all LR-
has received much attention from researchers [AT,
visible pairs of points [DHN1] and for computing all
BMT, SS, TL, DHN1, DHN2, Che, DC, IK, Ke87];
weakly-visible chords [DHN2] output a mass of infor-
also see the survey article by J. O'Rourke [O'R].
mation related to visibility within a polygon. Our
Two sets of points are weakly visible from each other
present algorithm shows how to exploit this wealth
if every point in either set is visible from some point
of information to answer more interesting questions
in the other set. Thus, our algorithm computes the
related to weak visibility in polygons. We achieve
shortest line segment that is weakly visible from a
our results by studying the structure of minimal
given simple polygon. weakly-visible segments and identifying the bound-
'Supported in part by NSF Grant CCR-930-6822 ing chords for such segments. As described later,
'Math Sciences Dept., Memphis State University, Mem- one of the by-products of our algorithm in this pa-
phis, TN 38152. e-mail: dasg/giri@nextl.msci.memst.edu
per is a linear-time algorithm to generate all minimal
Permission to copy without fee all or part of this material is weakly-visible segments. These techniques were also
granted provided that the copies are not made or distnbuted for
direct commercial advantage, the ACM copynght notice and the used in [DHN2] to obtain a linear-time recognition
title of the publication and its date appear, and notice is given of L^-convexity of simple polygons.
that copying is by permission of the Association of Computing
Machinery To copy otherwise, or to republish, requires a fee The shortest illuminating line segment in a poly-
and/or specific permission.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 259
gon can also be thought of as the shortest straight
Pcw(v.v')
line path that a watchman could patrol along in or-
der to watch over a polygonal art gallery. There have
been a number of papers on the shortest watchman
tour problem [CN, PV]. Our algorithm finds the
shortest straight-line watchman tour, if one exists.

2 Notation
Figure 1: A clockwise component and its C-polygon
We define notation for this paper. A polygonal chain
is a concatenation of line segments. The endpoints
of the segments are called vertices, and the segments Each reflex vertex v defines two special ray shots
themselves are edges. If the segments intersect only as follows. If a is the direction from v~ to v, we let
at the endpoints of adjacent segments, then the rcw{v) — r(v,ct) represent the clockwise ray shot
chain is simple, and if a polygonal chain is closed from v. If v' is the hit point of the clockwise ray
we call it a polygon. In this paper, we deal with shot, then the subchain Pcw(v,v') is the clockwise
a simple polygon P of n vertices, and its interior, component of v (see Fig. 1). Counterclockwise ray
int(P). The segment between two points x and y is shots and components are defined in the same way.
denoted xy, and int(xy) = xy\ {x, y}. Two points A component is redundant if it is a superset of an-
x, y £ P are visible (or co-visible) if xy C PUint(P). other component.
Two sets of points A and B are said to be weakly The clockwise component of v also defines a. sub-
visible from each other if every point in A is visible polygon called the clockwise C-polygon of v, which
from some point of B, and vice versa. A polygon is is the subpolygon of P bounded by the polygonal
said to be Z2~convex if for every pair of points in the chain Pcw{u,v') and the chord vv'. The clock-
polygon, there exists another point from which the wise C-polygon of v is shown as a shaded region
first two are visible. The (Euclidean) distance be- in Fig. 1. The counterclockwise C-polygons are de-
tween two points x and y is denoted dist(x,y). We fined in a similar fashion. We define the envelope of
assume that the input is in general position, which a C-polygon to be the boundary (in the interior of
means that no three vertices are collinear, and no P) of the C-polygon of v. Note that the envelope
three lines defined by edges intersect in a common of a C-polygon is simply the straight-line segment
point. (chord) consisting of the ray shot from v. Later, we
If x and y are points of P, then Pcw{x,y) will refer to the envelope of an intersection of a set
{Pccw{z,y)) is the subchain obtained by travers- of C-polygons, which is the boundary (inside of P)
ing P clockwise (counterclockwise) from x to y. The of the intersection of the set of C-polygons.
subchains Pcw(z,y) and Pccw(z,y) includes their
endpoints x and y. A polygon P is said to be LR-
visible with respect to a pair of points x and y, if 3 Preliminaries
Pcw(x,y) is weakly visible from Pccw(x,y).
We let f[x, a) represent the ray rooted at x in In this section we describe some of the geometric
direction a. For a vertex x of P, let x+ be the ver- properties of a weakly-visible line segment.
tex adjacent to x in the clockwise direction, and x~ It was noted in [IK] that the family of non-
the vertex adjacent in the counterclockwise direc- redundant components completely determines LR-
tion. Informally, the ray shot from a point x £ P in visibility of P, since a pair of points s and t ad-
direction a consists of "shooting" a "bullet" from x mits LR-visibility if and only if each non-redundant
in direction a which travels until it hits a point of P. component of P contains either s or (. A similar
The first point where this shot hits P is called the result from [DHN2] states that the family of non-
hit point of the ray shot. The line segment from a redundant components also determines all weakly-
shooting point x to its hit point x' is called a chord visible chords, since a chord st is a weakly-visible
of the polygon. A weakly-visible chord is a chord chord if and only if each non-redundant component
that is weakly visible from the rest of the polygon. of P contains either s or t. Lemma 1 below shows
A weakly-visible segment is simply any line segment that the family of non-redundant components also
in PU int(P) that is weakly visible from the rest of determines the family of weakly-visible segments,
the polygon. while lemma 2 describes another property satisfied

260
by all weakly-visible segments in P.

Lemma 3.1 A line segment üv - I is weakly visible


from P iff the segment I intersects the C-polygon
corresponding to every non-redundant component of
P.

Lemma 3.2 If a line segment üv — I is weakly vis-


ible from P, then the chord V, which is obtained by
extending I in loth directions until it hits P, is a
weakly-visible chord, and the endpoints of I' form a
LR-visible pair of points with respect to P.

The obvious implication of Lemma 3.2 is that a


polygon has at least one weakly-visible chord iff it
has at least one weakly-visible segment and conse-
quently a shortest weakly-visible segment. Figure 2:
Before giving an overview of the algorithm, we
describe the peculiar output of the 0(n)-time algo-
rithm for computing all weakly-visible chords of a It is clear that any line segment inside P that
polygon [DHN2] (the chords algorithm, in short), touches both a,- and ßi must intersect every C-
since this algorithm is used by our scheme. The polygon and by lemma 3.1 must be a weakly-visible
chords algorithm generates * = 0{n) pairs of the segment. However, the converse is not so obvi-
form (Ai, Bt). Note that for the rest of the paper k ous. Lemma 4.1 below, which implies the con-
will be used to denote the number of pairs output by verse, proves that the shortest weakly-visible seg-
the chords algorithm. Here Ai is a line segment on ment must join a point on at and a point on ßi, for
P that is described in terms of a parameter x (for some i. This vital property is necessary to make our
example, x = 0 (1) refers to the left (resp. right) algorithm work in linear time. Note that SAi cor-
endpoint of Ai). Bi is a polygonal chain on P such responds to a subsequence of the sorted sequence of
that every line segment joining a point on Ai and components. What lemma 4.1 proves is that only
a point on Bi forms a weakly-visible chord. How- such subsequences (and not an arbitrary subset) of
ever, Bi has endpoints that are linear functions of non-redundant components need to be considered
the parameter x. It may also be noted that each of for computing the shortest weakly-visible segment.
the AiS are disjoint line segments, while the £;s are
possibly overlapping polygonal chains. Lemma 4.1 If li — I is the shortest weakly-visible
segment, then s must lie on on and t must lie on ßi,
for some i = I,. . . ,k.
4 Overview of algorithm
Proof:
The first step of our algorithm is to run the chords Extend the line segment / = st until it hits P at
algorithm. If the polygon has no weakly-visible points p and q as shown in Fig. 2. By Lemma 3.1,
chords, then the algorithm stops and declares that segment I must intersect every C-polygon. This im-
there are no weakly-visible segments either. plies that for every C-polygon C, one of the two line
Note that for the rest of the paper all refer- segments ps and qi must lie completely in C. Also,
ences to the term components are references to non- if the envelope of C intersects /', it musl include
redundant components. For every Ai output by the precisely one of the two segments ps and qi.
chords algorithm, let SAi be the set of components By the minimality of I, it is clear that the point
that contain Ai, and let CAi be the intersection of s (t) lies on the envelope of one or two C-polygons.
the C-polygons corresponding to the components in If 5 (resp. t) lies on the envelope of some C-polygon
SAi. Let the envelope of CAi be denoted by on. Let Cs (resp. Ct), then since the envelope of Cs (resp.
SBi be the set of all components not in SAi, and Ct) intersects /', Cs (resp. Ct) includes the point p
let CBi be the intersection of the C-polygons of all (resp. q), and does not include q (resp. p).
the components in SBi. Let ßi denote the envelope Let I' = pq. By Lemma 3.2, /' is a weakly-visible
chord. Consider the output of the chords algorithm.
of CBi.

261
Let p S A{. By the correctness of the chords al- it touches a vertex of P in its interior. If the first
gorithm, q £ B{. Note that C, must include all of case occurs, the algorithm briefly described earlier
A{ because of the way the chords algorithm works. will output the shortest illuminating segment. The
Thus, C, must be a C-polygon that determines ai, details of this case are described in the next section.
and Ct must be a C-polygon that determines ßi. The second case is handled separately in section 6.
Hence s must lie on a; and t must lie on ßi thus The algorithm for the second case is a modification
concluding the proof. □ of our earlier algorithm for computing all weakly-
visible chords of a polygon [DHN2]. If a weakly-
The above lemma suggests the following skeleton visible segment touches a vertex of P it is referred
to as a non-tangential weakly-visible segment; oth-
for our algorithm. For every i = l,...,k, con-
struct the envelopes a,- and ßi, and then compute erwise it is referred to as a tangential weakly-visible
the shortest line segment joining a point on ai and segment.
a point on ßi. The shortest of these is the shortest By putting all the pieces together, we show a
weakly-visible segment. linear-time algorithm to obtain the shortest non-
tangential weakly-visible segment, and a linear-
Note that since both Qj and ßi are convex polygo-
time algorithm to compute the shortest tangential
nal chains, computing the shortest line segment con-
weakly-visible segment. The shortest of the two
necting them can be computed in time 0(|a,-| + |/3;|),
segments is the shortest weakly-visible segment in
where |a,-| and \ßi\ are the lengths of the two chains.
a polygon, thus giving us the desired algorithm.
However, in general there may be considerable over-
lap between a,- and ct;+i, as well as between ßi and
A'+i- For the i-th iteration, instead of simply find-
ing the shortest line segment that joins ai and ßi,
5 Case 1: Non-tangential
the algorithm only scans the portion of a; that is not weakly-visible segment
part of o/j+i (and the portion of ßi that is not part of
A'+i)i an°l finds the shortest segment between those As mentioned earlier, this ca.se corresponds to the
parts. The assumption is that the rest of the por- situation when the shortest weakly-visible segment
tions of the two polygonal chains will be scanned as does not touch any vertex of the polygon except pos-
part of a later iteration. Repetitious scanning of the sibly at its endpoints. For each i = l,...,k, let
polygonal chains is thus prevented by delaying the SNi be the shortest non-tangential weakly-visible
scanning of overlapping portions as much as possi- segment that joins Q, and ß1 with at least one end-
ble. point on Qj — Qi + i or ßi — ßi + i- It can be shown
In section 5.1, we precisely characterize how ex- that the shortest of the segments SNi, i = I, . . ■ ,k
changes to become orj+i, and correspondingly how must be the shortest non-tangential weakly-visible
ßi changes to become ßi+i- In section 5.2, we de- segment that joins a; and ßl, i = 1,. . ., k.
scribe a data structure that stores ai, i = 1, ..., k,
and another identical structure that stores ßi,i =
5.1 Structure of az and ßi
l,...,k. The planarity of these data structures is
sufficient proof that the size of the union of ai and As mentioned earlier both ai and ßi are the bound-
the size of the union of ßi for i = 1,..., k is 0(n). aries (internal to P) of the intersection of a set of
The problem with the skeleton algorithm de- C-polygons. Hence it is clear that both of them are
scribed above is that the shortest line segment join- convex polygonal chains. It may be possible that
ing ai and ßi for some i may not lie entirely within ai = Qij = a;., = ■ • ■ = ai . This simply means
P. This happens because even though the line seg- that no component starts or ends on the portion of
ment when extended may hit Ai, it might not hit B,- P covered by Ailt Ai2, . . ., Alp.
because of obstruction from the rest of P, i.e., the We now describe the structural differences be-
extended line is not a weakly-visible chord. In this tween a, and a; + i (in ca.se they do differ), and the
case, if there is a weakly-visible chord connecting corresponding differences between ßi and ßi + \. The
Ai and I?,-, then the shortest weakly-visible segment main purpose of studying this structure is to iden-
joining cv{ and ßi would touch a vertex of the P. tify the polygonal chains at — at + 1 and /?,- - /3l + i
This suggests that our algorithm needs to deal with so that they can be processed in the i-th iteration.
two main cases. The first case is when the short- Clearly, if a; = a; + i, then no processing is required
est illuminating segment does not touch a vertex of in iteration i.
P except at its endpoints; the second case is when Assume that a; ^ at-+i. From [DHN2J we know

262
that Ai and A'+i are disjoint line segments. There (a)
are various events that trigger the chords algorithm 1/ p\
to go from iteration i to iteration i + 1, thus out-
putting pairs (Ai,Bi) and pairs (Ai+1,Bi+i). An
event occurs if a component starts or ends between
Ai or Ai+i. The other possible events have to
do with changes in the points of tangency for the
boundaries of the weakly-visible chords. The chain
ai is different from a;+i only when a component
starts or ends between Ai and Ai+i. For the next
three paragraphs we will assume that the counter-
clockwise end for any polygonal chain is the front
end, while the clockwise end is the tail end.
If a component c starts between Ai and A'+i» the
changes from a; to a,-+1 are as shown in Fig. 3(b).
Note that the C-polygon corresponding to compo-
nent c lies to the left of the line and that the compo-
nent c consists of the polygonal chain Pcw(P2,92)-
Ai lies to the right of p2, while Ai+X lies to the left
11 "i
of p2. cti consists of the chain from at to s2 to oy,
while c*t+i consists of the chain from p2 to s2 to aj,
(b)
i.e., a portion of the tail of a. gets replaced by a por-
tion of the ray shot corresponding to the component af P2
c. At the same time, as shown in Fig. 3(b) ßi has
a portion of its front replaced by a new polygonal
chain, ßi consists of the chain from bt to t2 to <j2,
while /3;+i consists of the chain from bt to t2 to bj.
In other words, CAi shrinks at its tail end, and CBi
grows at its front end, while both their boundaries
remain convex. Note that a{ - ai+i comprises of
the polygonal chain from at to s2, while ßi - ßi+\
comprises of the segment from q2 to t2.
Note that in the Figs. 3(a) and (b), the region
CAi n CAi+1 (as well as the region CBi l~l CBi+i)
have been shown as a filled region. The area oc-
cupied by CAi+i (but not by CAi) is indicated as
a dot-filled region, while the area occupied by CAi
and CBi ls left blank.
By a similar argument, if a component c ends
between Ai and Ai+i, the portion of the ray shot 17 «1
corresponding to c at the front (right end or the
counterclockwise end) of Q; gets replaced by a new
polygonal chain, causing CAi to grow in the front. CAi - CAi+l
As shown in figure 2(a), ßi has a portion of its tail
(right end or counterclockwise end) replaced by a
portion of the ray shot corresponding to c, thus caus- CAi+i - CAi

ing CBi to shrink at its tail end. In this case note


that ai - Qj+i comprises of the segment from pi to
CAi n CAi
Si, while ßi -ßi+i comprises of the chain from bt to

The above description describes the changes that


take place to the a and ß chains while moving from Figure 3: Changes in the structure of at and /?,
the i-th iteration to the (i + l)-st iteration.

263
5.2 Data structure for storing the a then SNi is als° the shortest segment between a,
and ß chains and ßj as well as between a; and ß\ for all values of
/ between i and j. On the other hand, if the chord
The union of all the chains ai (ßi) form a tree. We is not weakly visible, then the segment s;£t is ig-
claim here without elaborating that both the sets nored, and will be handled by the second phase of
of chains a; and /% can be stored in simple linear- the algorithm (corresponding to Case 2).
sized data structures that are similar to the persis-
Another subtle complication is introduced by the
tent search trees of Sarnak and Tarjan [ST]. The
possibility that SNi may have one endpoint on
data structure will be detailed in a full version of
ßi—ßi+i and another endpoint on a,-na;+i (instead
this paper.
of ai — Q{+i). This could happen if the sweep algo-
rithm (described at the start of this subsection) for
5.3 Computing SNi finding the shortest line segment joining two convex
polygonal chains reaches the end of one of the chains
As described in the previous section, the algorithm
without hitting a local minimum. For example, as-
goes through k iterations. In the i-th iteration, the
sume that the end of a,- — Qf+i is reached before
chains at — cci+x and /?,- — /3,-+i are identified, and
reaching the end of ßi — ßi+i and before a minimum
the shortest segment that joins a,- and ßi with one
was encountered. In this case, our algorithm con-
endpoint on c^ —Qi+i or ßi —/?,'+i is computed. Let
tinues sweeping on ßi —/%+1, while continuing the
this segment be SNi = s,-£j.
sweep on a^naj+i. Our algorithm needs to be mod-
Given any two convex polygonal chains a and ß,
ified to ensure that this portion of ai n a; + i is not
there is a simple sweep algorithm to find the shortest
swept again in iteration i+l (or later). In this case,
line segment that joins the two chains. In this case,
it can be shown that SNj cannot have an endpoint
a and ß are two convex chains that form part of the
on this portion of Q, n a1 + 1 and hence need not be
boundary of two disjoint convex polygons. The al-
considered in any later iteration. The relevant por-
gorithm involves sweeping the two chains, one from
tion of ai n Qi+i is marked visited so that, a sweep
its clockwise end and in counterclockwise order, the
in a later iteration can skip over this portion of the
other from its counterclockwise end in clockwise or-
chain. The entire arguments in this paragraph could
der. Informally speaking, the sweep algorithm works
have been carried out with a replaced by ß and vice
because of three simple facts: (1) for a fixed point versa.
a £ a, its distance to visible points b £ ß is uni-
Once a local minimum is found for the i-th itera-
modal, (2) as point a moves monotonically on a, its
tion, the algorithm also verifies if it is a global min-
closest point on ß moves monotonically on ß, (3)
imum for the shortest segment between a^ and /3,-.
for points a £ Q, its shortest distance to ß (i.e.,
If the point on a; - ai+1 or ßi - ßi+1 is not the end-
the distance to its closest point on ß) is unimodal.
point ofthat subchain, then the global minimum for
Intuitively speaking, fact (3) states that the local
the shortest segment between a,- and ßi must have
minimum is also the global minimum.
been reached. Otherwise, a simple test can check
In the i-th iteration, it is possible that the seg-
whether the global minimum has been reached or
ment SiU may not lie entirely within P. To identify
not. If it is not a global minimum, then SNi can be
this situation, we exploit the fact that given a point
ignored since the shortest segment between a,- and
x on P, the chords algorithm has already identified
ßi connects points that are not on ai — a^+1 as well
which directions from x give rise to weakly-visible
as ßi — ßi+\. Since such a segment would connect
chords. Hence to check whether SNi lies in P, the
cti+i and ßi+i it will be encountered in a later iter-
algorithm computes the endpoint of the chord gen-
ation. The algorithm with the minor modifications
erated when the line segment is extended. Call this
mentioned above is guaranteed to sweep every por-
point pi. Using the output of the chords algorithm
tion of the a and ß chains exactly once and hence
our algorithm checks whether the chord in the di-
achieves the claimed linear-time complexity.
rection piSi is a weakly-visible chord. It should be
pointed out that it is possible that pi may not lie on
Ai, but on some other segment Aj. To identify Aj,
the algorithm traverses from Ai to Aj along P. It
6 Case 2: Shortest tangential
is non-trivial to show that this portion of P is not weakly-visible segment
traversed again for this purpose (and hence does not
contradict the claimed 0(n) time complexity). The This case occurs when the interior of the shortest
intuition behind the claim is that if pi lies on A, weakly-visible segment in the polygon touches a ver-

264
tex of the' polygon. However, in this case, the corre-
sponding weakly-visible chord obtained by extend-
ing the segment is also a tangential chord, i.e., it
touches a vertex of the polygon in its interior. The
crucial point to observe is that these are exactly the
weakly-visible chords that are output by the linear-
time chords algorithm [DHN2]. A suitable modifica-
tion of the chords algorithm can output all tangen-
tial weakly-visible segments, of which the shortest
can be computed.

The chords algorithm uses the following strategy.


It traverses along the polygon in a counterclockwise
direction with a point x. When x is on Ait the points
y(x) and z{x) corresponding to the other endpoints
of the two tangential chords from x are computed.
The points y(x) and z(x) move monotonically on
P; so do the points of tangency for the tangential Figure 4: Case 2: Determining tangential shortest
chords, namely s(x) and t(x). As x moves on A{, weakly-visible segments
there are several possible events that can take place,
which would change the description of the tangents:
the point y(x) (or z{x)) could move to a vertex of
P; the point s(x) (or t(x)) could move to a vertex
of P. These events cause a recomputation of the All minimal weakly-visible
equations of the tangential chords as a function of x. segments algorithm
In [DHN2] we show that the number of these events
are O(n), thus giving us a linear-time algorithm.

One of the by-products of our algorithm is a linear-


time algorithm to generate all minimal weakly-
The modification for computing the tangential
visible segments of a polygon. This algorithm is
weakly-visible segments is as follows. During iter-
a modification of the algorithm described in sec-
ation i, the chains a{ and ßi are computed. When
tion 6 for computing the shortest tangential weakly-
the point x is on A{, the points of intersection of the
visible segment. It outputs a set of pairs (Uit Vi),i —
tangential chords with a; and ßi are also maintained
1, . . ., m. Here Ui and Vi are subchains of the polyg-
(call them a1{x),a2(x),b1(x),b2{x)). The segment
onal chains a and ß, m = 0{n), and any segment
from ai(z) to bx(x) and the segment from a2{x)
to b2(x) are the two tangential weakly-visible seg- joining points u G U{ and v G V- is a minimal
weakly-visible segment. One note of caution is that
ments with respect to x. The situation is described
Ui and Vi have left and right endpoints that are
in Fig. 4. There are, however, an additional number
linear functions of a parameter x in a spirit simi-
of events that could cause a change in the descrip-
lar to that of the endpoints of the chain B; that
tion of the tangential weakly-visible segments: the
is output by the chords algorithm. For a point
points 0l(x) or a2{x) (&i(x) or b2{x)) could move to
x on Ai, the polygonal chains a; and ßi can be
a vertex of at- (ßi). This would cause additional re-
computed along with the points ai(x),a2(x) G a;
computations of the equations as well as the lengths
of the tangential segments. The crucial point is that and &i(z),&2(z) G ßi- The output of the algorithm
consists of(Ui,Vi) = ((ai(jj)Ia2(i))l {b2(x), 6j(x))).
in between events, the length of the tangential seg-
The discussion at the end of section 6 can also be
ments can be computed in terms of x, from which
used to show that the number of these pairs pro-
the minimum can be computed for that interval in
duced is m = O(n). Lemma 1 can be used to show
constant time. It can also be shown that the total
that these segments are minimal in the sense that
number of events that will be encountered is 0(n)
any subsegment of these segments is not weakly vis-
and that o^s), &i(z), a2(x), b2{x) move monotoni-
cally on the a and ß chains. ible.

265
8 Conclusion and open prob- [CN] W.P. Chin, and S. Ntafos, "Shortest Watch-
man Routes in Simple Polygons," Discrete and
lems Computational Geometry, 6 (1991), pp. 9-31.
We show optimal linear-time algorithms to compute
[DHN1] G. Das, P. Heffernan and G. Narasimhan,
the shortest weakly-visible segment and all minimal
"LR-visibility in polygons,", Proc. 5th Canadian
weakly-visible segments in a given simple polygon.
Conference on Computational Geometry, (1993),
Some interesting open questions are:
pp. 303-308.
• Can the exhaustive sweeping techniques from
[DHN2] G. Das, P. Heffernan and G. Narasimhan,
this paper be used to solve other weak visi-
"Finding all weakly-visible chords of a polygon in
bility problems efficiently? For example, are
linear time," manuscript, 1993.
there linear-time algorithms for the all-pairs
version of any of the 2-guard walk problems (see [DC] J. Doh and K. Chwa, "An algorithm for de-
[DHN1])? termining internal line visibility of a simple poly-
gon," J. of Algorithms, 14 (1993), pp. 139-168.
• Can the algorithm from this paper be designed
without using the triangulation or the shortest [H] P. J. Heffernan, "An optimal algorithm for
path algorithm as a subroutine? the two-guard problem," Proc. Ninth Annual
ACM Symp. on Computational Geometry, 1993,
• Ntafos [Nt] introduced the notion old-visibility,
pp. 348-358; to appear in Inter. I. on Computa-
where an observer's visibility is limited to dis-
tional Geometry and Applications.
tance d. Can the shortest illuminating segment
be computed efficiently under ^-visibility? [IK] C. Icking and R. Klein, "The two guards prob-
lem," Inter. J. on Computational Geometry and
Applications, 2 (1992), pp. 257-285.
References
[Ke87] Y. Ke, "Detecting the weak visibility of a
[AT] D. Avis and G.T. Toussaint, "An optimal al-
simple polygon and related problems," Tech. Re-
gorithm for determining the visibility of a polygon
port, The Johns Hopkins University, (1987).
from an edge," IEEE Transactions on Computers,
30 (1981), pp. 910-914. [LP] D. T. Lee and F. P. Preparata. "An optimal
algorithm for finding the kernel of a polygon,"
[BMT] B. K. Bhattacharya, A. Mukhopadhyay, and
JACM, 26(3), (1979), pp. 415-421.
G.T. Toussaint, "A linear-time algorithm for com-
puting the shortest line segment from which a [Nt] S. Ntafos, "Watchman Routes Under Limited
polygon is weakly externally visible," in Proc. of Visibility," Computational Geometry: Theory and
2nd WADS, 1991, pp. 412-424. Applications, 1(3) (1991), pp. 149-170.
[BM] B. K. Bhattacharya, and A. Mukhopadhyay, [O'R] J. O'Rourke, "Computational geometry col-
"Computing in linear time an internal line seg- umn 18," SIGACT News, 24 (1993), pp. 20-25.
ment from which a simple polygon is weakly in-
ternally visible," Personal Communication, 1993. [PV] P. Pradeep Kumar, and C.E.Veni Madhavan,
"Shortest watchman tours in weak visibility poly-
[Cha] B. Chazelle, "Triangulating a simple polygon gons,", Proc. 5th Canadian Conference on Com.-
in linear time," Discrete and Computational Ge- putational Geometry, (1993), pp. 91-96.
ometry, 6 (1991), pp. 485-524.
[SS] J.-R. Sack and S. Suri, "An optimal algorithm
[GHLST] L. Guibas, J. Hershberger, D. Leven, M. for detecting weak visibility," IEEE Transactions
Sharir and R. Tarjan, "Linear time algorithms for on Computers, 39 (1990), pp. 1213-1219.
visibility and shortest path problems inside trian-
gulated simple polygons," Algorithmica, 2 (1987), [ST] Sarnak and R. Tarjan, "Planar Point Loca-
pp. 209-233. tion Using Persistent Search Trees", CACM, 29,
(1986).
[Che] D.Z. Chen, "Optimally computing the short-
est weakly visible subedge of a simple polygon," [TL] L.H. Tseng and D.T. Lee, "Two-guard walka-
Tech. Report No. 92-028, Dept. of Computer Sci- bility of simple polygons," manuscript, 1993.
ences, Purdue University, May 1992.

266
Morphing Simple Polygons
Leonidas Guibas John Hershberger*
Stanford University Mentor Graphics
Stanford, CA 94305 San Jose, CA 95131

Abstract by John F. Hughes of Brown University in the Pixels-


and-Predicates Workshop organized by David Salesin
In this paper we investigate the problem of morphing and Jack Snoeyink at the University of British Columbia
(i.e. continuously deforming) one simple polygon into last spring. The problem is set in two dimensions; we
another. We assume that our two initial polygons have are given two simple polygons P and Q. Assume that
the same number of sides n, and that corresponding both P and Q are counterclockwise oriented. The poly-
sides are parallel. We show that a morph is always gons P and Q are parallel, where this is taken to mean
possible by a varying simple interpolating polygon also that P and Q have the same number of sides and their
of n sides parallel to those of the two original ones. If sides can be put in one to one correspondence so that
we consider a uniform scaling or translation of part of corresponding sides are parallel and oriented the same
the polygon as an atomic morphing step, then we show way. This is equivalent to saying that that the two poly-
that 0(n4/3+e) such steps are sufficient for the morph. gons have the same sequence of angles. The morphing
problem is to interpolate between P and Q via a con-
tinuously changing polygon R(t), where t denotes time.
1 Introduction We set R(0) = P and R(l) = Q. We require that R{t)
remain parallel to P and Q at all times, and that it also
In computer graphics a recent area of interest has been remain simple. See Figure 1 below.
morphing, i.e. continuously transforming one shape into
another. Morphing algorithms have numerous uses in k
shape interpolation, animation, video compression, as
well as obvious entertainment value. Some of the rel-
evant graphics papers are [KR, SG, SGWM]. In gen-
eral there are numerous ways to interpolate between
two shapes and little has been said about criteria for Q
comparing the quality of different morphs and notions
of optimality. A common problem with many morph- Figure 1: Two parallel polygons
ing algorithms is that although locally the geometry of
the interpolated shape remains faithful to the original We provide a discrete solution to Hughes's problem.
shapes, global properties such as symmetry, simplicity We take as our basic operation the uniform scaling
(in the topological sense), etc., can be easily violated. and/or translation of a contiguous part of a polygon
In fact, the very existence of morphs that can maintain parallel to itself. We call such a step a parallel move of
high-level global properties of the interpolated shapes is the corresponding polygonal chain. The affected edges
often far from obvious. in a parallel move expand or contract so as to keep the
In this paper we address a morphing problem raised two endpoints of the chain on the lines supporting the
*Most of this research was performed while the second author two adjacent edges to the chain. Also, no parallel move
was visiting at Stanford University. is allowed that would cause any moving edge or vertex
to pass over another vertex or edge of the polygon. It is
Permission to copy without fee all or part of this material is
granted provided that the copies are not made or distributed for clear that any number of parallel moves keep a simple
direct commercial advantage, the ACM copyright notice and the polygon parallel to itself and simple. Our main result is
title of the publication and its date appear, and notice is given that, if n denotes the number of sides of P and Q, then
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee 0(n4/3+£) parallel moves always suffice to morph P to
and/or specific permission. Q. We have an algorithm of the same complexity that
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 267
computes such a sequence of moves. morphing algorithm becomes then a theorem about ro-
The problem of constructing a simple polygon given tating one weighted binary tree into another while sat-
a sequence of angles has a substantial history in com- isfying the weight conditions. This in itself is quite an
putational geometry. Culberson and Rawlins [CR] first interesting combinatorial problem.
raised this question and gave an algorithm that con- We note that for rectilinear polygons the problem is
structs such a polygon in time 0{nD), where the as- easier, and a solution is already known [T]. We also
sumption is that all angles are rational multiples of IT remark that our transformation to a reduced form is
by a fraction whose denominator is bounded by D. Vi- unattractive from a practical point of view, as it may
jayan and Wigderson improved this result by construct- change wildly the scale of different features of the orig-
ing such a polygon in linear time with no restriction inal polygons. We discuss at the end of the paper some
on the angles being rational (reported in Vijayan [V]). concrete and interesting algorithmic issues that arise in
The result of the present paper paper shows that all sim- keeping small the overall distortion of the original poly-
ple polygons realizing the same sequence of angles are gons during the morph process.
homotopic to each other within this class of polygons.
This in itself is an interesting result which, according
to Hughes, had been in the folklore but never formally 2 The reduced form of a polygon
proven. Some of the trickiness involved can be seen in
the two polygons of Figure 2. These are oppositely spi- Our morphing algorithm works by transforming each of
raling polygons, but they are still parallel and therefore the two polygons P and Q into a reduced form. We
morphable. first transform P to its reduced form, then morph the
reduced form of P to that of Q, and then undo the
! .__..: ':"""""""""" transformations that reduced Q. We will be able to
map the morphing of the reduced forms to the purely
combinatorial tree rotating problem mentioned above.
! i The reduced form of polygon P is a polygon parallel to
P with a particular hierarchical structure. The reduced
form of P can be obtained from P by 0(n) elementary
parallel moves. The reduced form is not unique, but
Q
instead depends on the order in which the parallel moves
are performed.
Figure 2: These oppositely spiraling polygons are still
morphable

The main idea of this paper is to use parallel moves


to transform each polygon to a reduced form in which
the side lengths are of widely different scales. Once
both polygons are in reduced form, we can use a se-
quence of elementary local transformations to morph
one reduced form to the other. In the reduced form,
small-scale structures do not interfere with larger-scale
parallel moves—when a large-scale edge translates, any
smaller-scale structures adjacent to its endpoints trans- jS&
late along as if they were part of the endpoints. We
establish a correspondence between these transforma- Figure 3: The two kinds of parallel moves
tions in reduced polygons and (classical) rotations in
binary trees. The catch, however, is that our trees have We allow two types of parallel moves, defined as fol-
weights on the leaves and induced weights on the in- lows: (1) Suppose there exists a circle that intersects
ternal nodes. These weights correspond roughly to the exactly two edges of the polygon. Then we may shrink
polygon angles. Our mapping from polygons to trees is or expand the structure inside the circle uniformly, so
such that all weights of leaves or internal nodes must be long as the intersections of the polygon with the cir-
in the range (-1,+1). Although the problem of using cle do not change. (2) Suppose there exist two disjoint
single rotations to transform one binary tree to another circles, each intersecting an edge e of the polygon and
is well-studied and is known to be doable in a linear one other edge. Then we may translate e and move the
number of rotations, these methods are not applicable two circles and their contents uniformly along with e,
to our situation, as not all rotations maintain the weight such that each circle's intersections with the polygon
condition on the trees. The combinatorial essence of our are stationary in the reference frame of the circle. In

268
both cases we enforce the condition that the polygon and does not participate directly in the remainder of the
always intersects each circle in exactly two fixed places. elimination process. See Figure 5.
See Figure 3.
The reduced form of P is based on a process of elim-
inating P's edges one by one. Consider an edge e of
polygon P whose endpoints u and v are shared with
adjacent edges eu and ev. If we translate e parallel to
itself while keeping the rest of the polygon fixed, u and
v move along the lines supporting eu and e„, length-
ening or shortening those edges as well as e itself. We
can translate e so that at least one of e, eu, and ev gets
shorter. One of the edges will eventually be reduced to
zero length, if e does not hit another part of P first. See
Figure 4. Figure 5: A reduced form

When the edge elimination process terminates, the


reduced form of the polygon consists of a triangle with
some microstructure at its vertices. Each vertex is con-
tained in a disk, and the three disks are disjoint. If we
look inside a disk, we see two infinite edges—the ones
that cross the disk boundary—and a single finite edge
joining them. The vertices where the finite edge joins
the infinite edges have microstructure themselves: they
Figure 4: Translating an edge are contained inside smaller disks that are disjoint from
each other and completely inside the surrounding disk;
We show in Lemma 1 below that every polygon can each smaller disk contains recursively similar structures.
be morphed with 0(1) edge translations (amortized) so If we ignore the disks of the reduced form and look
that at least one edge is reduced to zero length, while only at the edges, we see that the reduced form of a
keeping the polygon simple. In this case we can it- polygon P is a special hierarchical morph of P: the
eratively reduce the polygon to a triangle: at each of reduced form is parallel to P, and it is obtained from P
n - 3 steps, we eliminate one edge of P by translation. by parallel moves that preserve simplicity.
For certain degenerate polygons, it is possible that the The following lemma, due to Emo Welzl, shows that
elimination process will terminate with a parallelogram the edge elimination process applies to any polygon.
instead of a triangle. This case does not pose any addi- Combining this with the discussion above, we can com-
tional difficulties for our algorithm, and so we will ignore pute a reduced form for any polygon.
this possibility from here on.
The reduced form of a polygon models the edge elim- Lemma 1 ([W]). Given a simple polygon P with n
ination process in its structure. To compute it, we run vertices, we can reduce it to a triangle by a sequence
the edge elimination process as above, except that in- ofO(n) edge translations, each of which preserves sim-
stead of reducing edges to zero length, we reduce them plicity and n - 3 of which shorten some edge to zero
to infinitesimal length. Suppose that the edge elimina- length.
tion process eliminates an edge e, coalescing its vertices
u and v to become the common endpoint of adjacent Proof: The algorithm repeatedly translates edges to-
edges eu and ev. In the reduced form of the polygon, ward the interior of the polygon. It maintains a set of
vertices u and v are kept separate, joined by an infinites- frozen edges that have already been translated and may
imal edge e. We imagine drawing an infinitesimal disk not be translated again. It works in a subpolygon of P,
that contains u and D, centered on the intersection of and maintains the invariant that at most two (adjacent)
the lines supporting eu and ev. (If the supporting lines edges of the current subpolygon are frozen.
are parallel, we drop the centering requirement.) In the The generic step of the algorithm picks an arbitrary
remainder of the elimination process, the disk translates unfrozen edge e of the current polygon (initially P) and
along with the intersection of the supporting lines, act- translates it toward the interior of P. As the edge trans-
ing like a finite-size vertex. Because the disk and its lates parallel to itself, its endpoints move along the lines
contents are infinitesimal, we are sure that no trans- supporting the two edges adjacent to e, and those two
lating edge touches the disk unless it also touches the edges shorten or lengthen. The translation stops when
corresponding vertex in the original edge elimination one of two things happens: (1) e or one of its two neigh-
process. The infinitesimal edge is hidden inside the disk boring edges is shortened to zero length, or (2) e collides

269
with some vertex v of P, or a translating endpoint v of triangle. We conjecture that there is always some edge
e collides with some other edge of P. See Figure 6a. that can be translated to eliminate itself or one of its
neighbors without violating simplicity. This would give
the ideal algorithm we want, but we have so far been
unable to prove the conjecture.
The key feature of the reduced form is the hierarchy
of edge eliminations, as the following lemma shows.

Lemma 2. If two reduced forms are parallel polygons


and have the same hierarchical structure, then one can
Figure 6: Eliminating edges to find a reduced form be morphed to the other using a linear number of edge
translations.
In case (1) we have eliminated an edge. In case (2),
the collision between an edge and the vertex v has parti- Proof: Let P and Q be the two reduced forms. The
tioned the polygon in two, and we recursively apply the algorithm follows the hierarchy of the reduced form. We
same procedure on one of the two pieces. Specifically, repeatedly translate edges of P to be collinear with the
we translate e away from the polygon interior slightly, corresponding edges of Q. When we are done, the two
so the polygon is not completely partitioned by the colli- polygons are identical. The first step translates the top-
sion at v (the amount to back away is upper-bounded by level triangle edges of P to be collinear with those of Q,
a constant that can be computed from the geometry of moving the microstructure disks along with the inter-
the polygon), and freeze all three edges participating in sections of the edges. Within each microstructure disk,
the collision: the two edges incident to v, and the edge v we translate the finite edge of P to be collinear with
hit. Because at most two adjacent edges of the current the corresponding edge of Q. (The subdisks translate
polygon were frozen, the same is true of at least one of along with the intersection points of the finite and infi-
the two subpolygons created by the near-partition at v. nite edges.) We then recursively make the two polygons
We recurse on the subpolygon with fewer frozen edges. identical inside each subdisk. D
Each of the subpolygons is at least a triangle, so each
also has fewer edges than the current polygon.
The recursion bottoms out, in the worst case, when 3 The tree representation of a
the current polygon is a triangle with two frozen edges
(Figure 6b). Translating the third edge inward elimi- reduced form
nates one of the frozen edges. When a frozen edge is
eliminated, it contracts into the vertex v that caused The hierarchical nature of the reduced form can be nat-
its freezing. We unfreeze the other two edges that were urally represented by a tree structure. The infinitesimal
frozen because of v. This restores the invariant: the disks of the reduced form correspond to nodes in a bi-
collision at v originally created two subpolygons Px and nary tree; a disk and the two subdisks it contains corre-
P2, each with at least three edges, with one edge belong- spond to a node and its children. Each of the three top-
ing to both Px and P2. The edge elimination reduces level disks of the reduced form corresponds to a tree.
the total number of edges in Px and P2 by one, to a Logically these three trees should be joined in a ring;
minimum of four. The new subpolygon is the union of however, to maintain the convenience of a consistent
Pi and P2; it has at least four edges, at most two of binary tree representation, we omit the ring edges and
which are frozen. work with the trees separately. Each tree represents the
reduced form of a simple bi-infinite chain (one whose
The size of the current subpolygon decreases at each
initial and final edges are rays).
recursive call, and the algorithm eliminates an edge
when the current subpolygon is a triangle. Thus the In this section and Section 4 we work only with chains
algorithm successfully eliminates all the edges of P (or and their corresponding trees; we show how to morph
reduces P to a triangle, if we stop just before the last two parallel chains to each other. In Section 5 we ad-
elimination). Edges are unfrozen only when we move up dress the original problem of morphing polygons.
one recursive level. Each unfreezing can be charged to Each node of a tree has an angular weight associated
the edge elimination that occurred just before it. The with it, namely the turn angle at the corresponding disk,
total number of edge translations is bounded by n plus i.e., the difference between the direction angles of the
the number of unfreezings (at most 2n) and hence is incoming and outgoing edges of the disk (we assume the
0{n). D
polygon is oriented counterclockwise). For convenience
we normalize the weight of each vertex of P by dividing
The preceding algorithm is less than ideal, because it it by 7T, so the weight is in the range (-1, +1); the sum
uses more than n - 3 edge translations to reduce P to a of the weights over all the vertices is therefore 2. The

270
weight at each disk of the reduced form is the sum of transform Ti to T2 using only valid rotations. We now
the weights of all the polygon vertices inside it. show how to interpret a tree rotation as a morphing op-
Because the edges incident to each vertex of P and eration that transforms one reduced form into another.
each disk of the reduced form make an angle strictly Let A, B, and C be the tree nodes involved in the ro-
between -ir and n, the weight of each node in the bi- tation, grouped ((A B) C) before and {A (B C)) after
nary tree is in the open range (-1,-1-1). We say that the rotation. The tree structure {{A B) C) corresponds
a node whose weight is in this range is valid. If all the to a disk of the reduced form in which the edges before
weights in a tree are valid, we say the whole tree is valid. A and after C are infinite, the edge BC is finite, and
The binary tree associated with the reduced form of a the edge A~B is infinitesimal, contained in a subdisk.
bi-infinite chain is always valid. The following lemma Of course, A, B, and C are vertices only at this level
shows that the converse is also true. of the reduced form; they may have microstructure of
their own. See Figure 7. We want to morph AB, BC,
Lemma 3. Any valid tree corresponds to the reduced and the two infinite edges such that AB becomes finite
form of some bi-infinite chain. and BC infinitesimal.
Proof: The proof is by recursive expansion. Let r be Lemma 4. Let A, B, and C be the turn angles of a
the root of the tree. The weight of r corresponds to the four-edge bi-infinite chain, and suppose the angles A +
total turn of the chain. We draw the infinite chain edges B, B + C, and A + B + C are all valid. Then either of
and draw a circle C centered on the intersection of their the edges AB and B~C can be reduced to zero length by
supporting lines. Let a and ß be the weights of the chil- translating the infinite edge adjacent to it.
dren of r. Within the circle we draw an edge that makes
angles of a and ß with the two infinite edges, and two
smaller circles inside C centered on the endpoints of the
new edge. Applying this process recursively with each
subtree and its corresponding circle produces a reduced
form for the tree. (At each step the drawing inside the
innermost circle is provisional, to be replaced when the
D
angle inside the circle is expanded.)
In the remainder of this section we reduce the problem
of morphing between two parallel bi-infinite chains to a Figure 8: Each finite edge may be eliminated by trans-
problem of transforming one valid tree into another by lating an infinite edge
rotations. Because we want the tree transformation to
Proof: Let e% be the infinite edge incident to A, and
correspond to polygon morphing, we insist that the tree
define e% to be the ray parallel to e% whose origin is
be valid at all times. In particular, the transformation
B. Let e^ be the infinite edge incident to C. Edge AB
may use only valid rotations, ones whose initial and final
can be shortened to zero length by translating e% if and
states are both valid. For example, in Figure 7, if A, B,
only if TiC and e~c do not enter the infinite trapezoid
and C represent node weights, it must be the case that
bounded by e%, AB, and e%. If edge BC enters the
each of A, B, C, A + B, B + C, and A + B + C lies in
trapezoid, then angle A + B is invalid; if the infinite
the range (—1,1).
edge e~c enters the trapezoid, then angle A + B + C is
invalid. By assumption, both angles are valid, so AB
can be shortened. A similar argument for BC finishes
a
the proof.
The following lemma shows that a reduced form al-
lows us enough flexibility to apply Lemma 4.

Lemma 5. In a reduced form, the disk sizes can be


chosen so that the infinite edges incident to any disk
are free to translate a distance at least equal to the
diameter of the disk.
Proof: The proof is top-down. The base case is easily
established: the top-level infinite edges of a chain are
Figure 7: A tree rotation and the corresponding morph unconstrained. (In the top-level triangle of a polygo-
of a reduced form nal reduced form, keeping the disk radius at most one-
Let Ti and T2 be two valid trees with the same se- fourth of the minimum edge length of the triangle estab-
quence of weights at the leaves. Section 4 shows how to lishes the base case.) Within each disk V of a reduced

271
form, there are two infinite edges / and g, joined by a As mentioned earlier, a weighted tree is called valid
finite edge e. The endpoints of e are contained in two if the weights of all its nodes (leaves, as well as internal
subdisks concealing microstructure. In the inductive nodes) are reals in the range (-1,+1) (open interval).
step, we assume that / and g are able to translate at A rotation is called valid if it transforms a valid tree into
least the diameter of V, so they can certainly translate another valid tree. It is clear that rotations preserve the
at least 6 = the maximum diameter of a subdisk. Edge sequence of leaf weights, but change the grouping struc-
e appears infinite from the vantage point of each of its ture on these weights imposed by the tree. If Xi and
disks. When we translate e relative to the disk defined T2 are two valid binary trees on n leaves with the same
by (e, /), the other disk translates uniformly along with sequence of leaf weights w1, w2, ■. ., wn, then the result
the intersection of the lines supporting e and g. There- mentioned in the previous paragraph asserts that one
fore, we choose 5 small enough that translating e by ö can always go from one tree to the other via a sequence
relative to one subdisk does not move the other subdisk of rotations. Arbitrary rotations, however, can destroy
out of V. a validity by generating internal nodes whose weights are
To morph ({A B) C) to (A (B C)), we erase the outside the range (-1,-1-1). So the natural question that
disk around AB, then translate the infinite edges to arises is whether it is always possible to go from Ti to
lengthen AB and shorten BC, leaving vertex B (and its T2 via a sequence of valid rotations and, if so, what is
microstructure) fixed. Once AB is of finite length and the maximum required length of such a sequence.
BC is infinitesimally short, we draw a new disk around We show that the answer to this question is affirma-
BC, leaving A at the top level. During these transla- tive, but we do not know if our upper bound is best
tions and regroupings, we may scale the microstructure possible (in fact, we strongly suspect that a nearly lin-
at A, B, and C uniformly if necessary. (Unless the infi- ear upper bound holds).
nite edges are parallel, we can actually do the rotation
without translating the infinite edges at all. If they Theorem 7. If Xi and T2 are any two valid binary trees
are parallel and we do have to move them, we make on the same sequence of leaf weights W\, w2, ■ ■ ■ ,wn,
sure the movement is small enough that the condition then it is always possible to go from Xi to T2 by a se-
of Lemma 5 is maintained at the other ends of those quence ofO(ni/'i+e) valid rotations.
edges.)
Because a valid rotation on trees can be mapped di- The rest of this section proves the theorem. Our basic
rectly to a constant-complexity morph of one reduced strategy is go from Ti to T2 as follows: take any pair
form to another, any algorithm for transforming trees of leaves in T2 that are siblings and perform valid rota-
via valid rotations corresponds directly to an algorithm tions on Tx (if necessary) to make them siblings in Ti
for morphing the reduced forms of two parallel bi- as well (we have to argue that this is always possible).
infinite chains. Theorem 7 thus implies the following: In each tree contract that pair of leaves into their par-
ent, making the parent a new leaf and giving it a weight
Theorem 6. Given two parallel bi-inßnite chains P that is the sum of the two previous leaf weights. We are
and Q of n sides, we can continuously deform P to Q now left with two valid trees on n - 1 weighted leaves,
by parallel moves while maintaining simplicity. The de- and we repeat the whole process until both trees have
formation uses 0(n4/3+e) parallel moves. been reduced to a single node. It is clear that in this
process we generate a sequence of valid rotations that
transforms Xi into T2. This simplistic scheme has to be
4 Tree reconciliation via rota- refined by adding a certain "tree renormalization" step
tions at key points, in order to speed up the process.
Let us then focus first on the problem of taking a
In this section we address the purely combinatorial pair of adjacent but non-sibling leaves w and y in Ti
problem of transforming one binary tree into another via and performing valid rotations to make them siblings.
a sequence of (single) rotations. This is a well-studied See Figure 9. Let x be the least common ancestor of w
problem [CW, STT]; it is known that 0(n) rotations and y, and let v and z be the left and right children of x
are necessary and sufficient to rotate one tree into an- respectively. A key concept for our analysis is that of a
other in the worst case (the best-known upper bound is spine in a binary tree. A spine is a maximal sequence of
2n - 6). But in our setting there is additional structure nodes that form a path in the tree all of whose links go
to cope with. Our trees have weights at their leaves. in the same direction (all left or all right). For example,
The internal nodes also have induced weights, namely in Figure 9, the paths [v..w] and [z..y] are spines. We
the sum of the leaf weights in all leaves belonging to base our procedure for making w and y siblings on a
the subtree rooted at that internal node. These weights sequence of spine-contraction steps, as in the lemma
restrict the possible trees we can have, as well as the and corollary below.
allowed rotations between them.
272
children of the spine will have been regrouped into trees
attached to the contracted spine, each of height at most
O(logfc).

If we use a spine contraction on the spines [v..w] and


[z..y], we can make the least common ancestor x of
A A
w y
leaves w and y be at most 5 levels above the two leaves.
We can then finish as follows.

Lemma 10. If the weights of two adjacent leavesw and


Figure 9: Two adjacent non-sibling leaves
y have a valid sum, then w and y can be made siblings
by at most eight valid single rotations once the spines
Lemma 8. Among any four consecutive internal nodes [v..w] and [z..y] have been contracted.
along a spine in a valid tree, at least one can be rotated
out of the spine by a valid single rotation. Proof: After the spine-contraction process, we can
assume that no rotation involving only spine [v..w] or
Proof: Without loss of generality assume that the spine [z..y] is valid. Let l\,...,lk denote the weights
spine is a left spine, like [z..y] in Figure 9. Let A, B, C, of the left children of spine [u..«;], in left-to-right order,
and D be the right children of four consecutive nodes and similarly let r\,..., r_,- denote the weights of the
on the spine, and let X be A's sibling, as in Figure 10a. right children of [z..y\. Observe that the Vs all have
By abuse of notation let A, B, C, D, and X also denote the same sign; the same is true for the r's. By abuse
the weights of the nodes. If any consecutive pair of right of notation, let w and y also denote the weights of the
children, say (A,B), has a valid sum (—1 < A + B < corresponding nodes. Denote the weight at x by x =
1), then a valid rotation can be applied at the edge h + ■ ■ ■ + h + w + y + r± + • ■ • + Tj. We know \x\ < 1.
joining the parents of A and B. This makes A and B If l\ has the same sign as x, say positive, then x > x —
into siblings whose grandparent lies on the spine, and li > x— 1 > —1, so x —1\ is valid. Similarly, if sign(rj) =
removes one edge from the spine. See Figure 10b. sign(x), then x — Tj is valid. If sign^) = sign(ry) ^
sign(a;), then sign(:r) = sign(w + y), say positive. Then
x < x —1\ < w +y < 1 and x — l\ is valid (so is x — rj).
Without loss of generality assume x — li is valid. Per-
form a rotation at edge (v,x), moving the right child of
v to be the left sibling of z. The new parent of z and
the moved node has weight x — l\, which is valid. All
the other modified nodes have weights that were present
before the rotation, so the rotation is valid. It shortens
Figure 10: A rotation may be performed on any spine by one the length of the path between w and y. After
with more than four nodes the rotation, we can still apply the argument above to
show that at least one of the edges incident to the lowest
If no consecutive pair has a valid sum, then |A + ß| >
common ancestor of w and y can be rotated. Perform-
1 and \C+D\ > 1. All four of A, B, C, and D must have
ing at most eight rotations, we shorten the path length
the same sign, so \A+B+C+D\ = \A+B\ + \C+D\ > 2.
to two, making w and y siblings. □
The weight at the parent of D is w = X + A + B + C + D.
Because |X| < 1, we have |io| > 1, so the initial tree was The overall rotation cost of making leaves w and y
invalid, a contradiction. □ siblings is proportional to the sum of the original lengths
of the two spines [v..w] and [z..y]. This is 2 less than the
If we partition a spine into consecutive groups of four
tree distance of w and y. Let us call the latter quantity
nodes each and apply the valid rotation guaranteed by
simply the distance in T± between w and y.
the previous lemma to each group independently, we can
Our discussion so far, coupled with our overall tree
reduce the length of our spine by 1/4. By iterating this
morphing strategy mentioned earlier, provides a proof
process until the previous lemma is no longer applicable,
that 7\ can be rotated into T2. In fact, we also get an
we obtain the following spine-contraction corollary. We
0(n2) upper bound on the number of rotations needed,
note that when no rotation can be applied along a spine,
as the distance between any two adjacent leaves is 0(n),
all the weights of the spine nodes must be of the same
and the number of sibling-formation operations is at
sign.
most n — 1.
Corollary 9. Given a spine of length k, we can reduce In order to improve this bound, we must analyze more
it to length at most 4 by k - 4 valid rotations. Fur- carefully the distances between adjacent leaves that are
thermore, when this procedure terminates, the original being made siblings. In particular, the difficulty is that

273
rotations that reduce one spine length can increase other that make siblings of a pair of leaves that were originally
spine lengths—actually it is very easy to check that any at distance k can increase the distance of any other ad-
single rotation will decrease the distance between two jacent pair of leaves by at most 0(log k). Let us consider
pairs of leaves by 1, and it will increase the distance the following game: we have n bins, each containing at
between two other pairs by 1. We can, however, argue most n tokens. The bins model the gaps between suc-
that there is a sequence of spine contractions over a cessive leaves, and the tokens account for the distances
whole tree that reduces the maximum spine length. between successive pairs. We play as follows:
Lemma 11. Any valid tree on n leaves with maxi- • At each turn, we remove all k tokens from one bin
mum spine length k can be rotated using 0(n) rotations and distribute them to k other bins. At most one
into another valid tree whose maximum spine length is new token gets added to each bin at each turn.
O(logfc).
• We play for n turns; the goal is to maximize the
Proof: Apply Corollary 9 on the left and right spines number of tokens moved.
of the original tree, reducing them to constant length.
Each subtree that was originally a child of the left or In the real tree situation, contracting a pair of leaves
right spine is now at depth O(logfc). Let T be such at distance k may increase the distance of some other
a subtree. Without loss of generality, assume that the pair not by 1 but by O(logfc). But let us focus on the
parent of T is to its left. Apply Corollary 9 on the right simpler game situation for now.
spine of T, reducing it to length at most four. (This
process does not modify any ancestors of T.) Now the Lemma 13. If originally each bin contains 0(1) to-
length of the right spine that includes T's right spine kens, then after n2/3 turns, the maximum number of
tokens moved is Q(n).
(including ancestors) is 0(logk). Recursively apply this
procedure to the original child trees of T's right spine,
Proof: We first show that during any run of n1/3 turns
until every node in the tree has participated in one
in the first n2/3 turns, at most n2/3 tokens are moved.
spine-reduction operation.
The run moves tokens from a set B of n1/3 bins into
Spine-reduction does not affect the internal structure
other bins. There are at most n2/3 tokens in B at the
of the children of the spine; the cost of spine-reduction
start of the run (because we are in the first n2/3 turns)
is proportional to the length of the spine. Each spine-
and at most n2/3 tokens get added into B during the
reduction operation is applied to a spine that has not
run (because each bin in B receives at most n1/3 tokens
previously been operated upon. Thus the total work is
in n1/3 turns). Partitioning the first n2/3 turns into n1/3
0{n). By construction, each spine in the final tree con-
runs of n1/3 turns apiece completes the upper bound.
sists of at most four nodes that result from the reduction
To prove the lower bound, let A and B be two disjoint
of that spine, plus 0(log k) ancestors that were rotation
sets of n1/3 bins. In the first \n2^ turns, put at least
nodes in a spine reduction higher up in the tree. D
|n1/3 tokens in each bin of A. Divide the second |n2/3
Corollary 12. Any valid tree on n leaves can be ro- turns into ^n1/3 phases of n1/3 turns apiece. In each
tated using 0(n log* n) rotations into another valid tree phase, move all the tokens from A to B or vice versa,
whose maximum spine length is 0(1). putting \nll3 in each bin. □
In the slightly more elaborate tree setting in which a
Proof: Recall that log* n = min(fc | \og(k) n < 1), single contraction of length k may increase a particular
where log(fc) n is the fe-fold composition log(log • • • (n)). distance by O(logfc), the bound on the total work done
By applying Lemma 11 0(log*n) times, we reduce the after n2/3 contractions becomes 0(n1+e).
maximum spine length to 0(1). D We can now complete the proof of the main theorem
We call the process of transforming a tree into one of this section. After every n2/3 contraction steps, we
whose maximum spine length is constant a normaliza- renormalize the tree. Thus the cost of the rotations for
tion. We intersperse normalizations with the leaf pair- the leaf contractions balances the cost of the rotations
ing and contraction process so as to keep leaf distances for renormalization and both are bounded by n4/3+e.
Thus the theorem is proved.
small. But we need to develop one more idea first, the
intuition being that during the pairing and contraction
process some leaf pairs may have a large distance, but 5 Morphing polygons
not many may do so. After all, in a single tree, the av-
erage distance between adjacent leaves is constant—but In this section we use the tools of the preceding sections
of course our rotations change the tree all the time. to show how to morph one polygon to another parallel
We saw earlier that rotations redistribute spine polygon. This is more difficult than morphing bi-infmite
length. In fact, Corollary 9 states that the rotations chains (Sections 3 and 4), because we cannot guarantee

274
that the reduced forms of two parallel polygons will have
the same top-level triangle. We show below that each a
morphing operation that involves two of the top-level
trees can be transformed with 0(1) parallel moves to
involve a single tree.
Let 7\ = {Ti,T{,T") be the set of three trees associ-
ated with the top-level triangle of the reduced form of
polygon P, and let T2 = (T2,T£, Tg) be the correspond-
ing set of trees for Q. In the tree model, our algorithm
for morphing P to Q is the same as that of Section 4:
we pick a pair of leaves that are siblings in one of the
trees of T2, rotate them to be siblings in one of the trees
-f\
of 71, and then collapse the pair into their parent in
both 7i and T2, thereby reducing the size of the prob- Figure 11: Splitting a chain into two separated chains
lem. This works fine if the two leaves belong to the
same tree in 71: we simply apply the algorithm of Sec-
Consider the case in which the sequence of weights
tion 4 to that tree. If the two leaves belong to different
li,...,lk,x,y,ri,...,rj can be split into two subse-
trees, however, we must morph the polygon to bring the
quences, each with a valid sum, without separating x
two leaves into the same tree before we can apply the
and y. Without loss of generality assume the split is to
algorithm of Section 4.
the right of some /,. The sum h + ■ ■ ■ + h is positive,
Let x and y be two sibling leaves in T2, and with-
and the sum W = li+1 H h x must be valid. Thus by
out loss of generality suppose that x and y are the last
Lemma 14 the chain corresponding to 7\ can be split in
and first leaves in 7\ and T{, respectively. We begin
two by stretching the edge e corresponding to the split
the morph by shortening the spines containing x and
point of the sequence. We perform a parallel move,
y as much as possible (Corollary 9). Then the right
stretching e and bringing the subchain corresponding
spine of 7\ has at most four left children whose weights
to W closer to the chain (that is, microstructure) for
li,...,lk all have the same sign. The left spine of T[
T[. Let / be the edge of the top-level triangle joining
has at most four right children with same-sign weights
Ti to T{. If W is positive, we translate / away from the
n,..., r0■. The weight of 7i is h + ■ ■ ■ + h + x, and
triangle interior, so that it gets shorter (Figure 12a). If
the weight of T[ is y + n H h r,. Because 7\ and
W is negative, we hold / stationary and translate e out-
T[ are both top-level trees, their weights are both pos-
ward, again shortening / (Figure 12b). In both cases
itive, and their sum is between 1 and 2. Leaves x and
the parallel move does not encroach upon the triangle's
y are siblings in 7^, so their combined weight is valid:
third vertex. The move shortens / enough that we can
|x + y\ < 1. The following lemma is our basic tool for
draw a microstructure disk around it: the triangle has
separating a top-level tree into two:
been changed so x and y belong to the same tree, and
Lemma 14. Let T be a valid tree, and suppose the left the algorithm of Sections 3 and 4 applies.
(right) spine ofT has 0(1) children, all otwhose weights
are positive. Let e be a spine edge such that the total
leaf weight to the left ofe is valid, as is the total weight
to the right. Then the polygonal chain corresponding
to T can be morphed with O(l) parallel moves to sep-
arate it into two linearly separated sub chains joined by
a single edge, corresponding to splitting T at e. (a)

Proof: The children of the spine above e are all pos-


itive. Let Te be the subtree of T rooted at the bottom *£ f
of e. Te corresponds to a microstructure disk T>e in the
reduced form. If we erase all the microstructure disks
that contain Ve, we obtain a mostly-convex chain with (b)
disks at its vertices (the only possible nonconvexity is at
Ve). See Figure 11. We coalesce all the disks except Ve
together by parallel moves (because T is valid, none of Figure 12: Modifying the top-level triangle in one step
the requisite edge-shortenings causes a collision between
chain edges.) This essentially leaves a two-vertex valid Lemma 15. The sequence h, ■ ■ ■ ,h,x,y,ri,... ,rj can
chain, whose finite edge can be stretched arbitrarily. □ be split into at most three subsequences, each with a

275
valid, positive sum, with x and y in the same subse- Theorem 16. Given two parallel simple polygons P
quence. and Q of n sides, we can continuously deform P to Q
by parallel moves while maintaining simplicity. The de-
Proof: Consider the modified sequence l\,..., Ik, (x + formation uses 0(n4/3+£) parallel moves.
y), r\,..., rj. Without loss of generality assume the Z's
are positive. Let V be the longest prefix of the modified
sequence whose sum is valid. The sum of V is positive 6 Open questions
(the sum up to y is > — 1, and if that sum is negative,
the 6's must be positive). The problem discussed in this paper and our solution to
If the suffix after V is valid, and hence positive, we are it raise many fascinating questions.
done. If not, we split the suffix after its first element. The two specific questions left open by our approach
This element is positive and valid. The sum of the last are (1) to show that in any polygon an edge can always
part of the suffix is also positive (else the whole suffix be eliminated by an edge translation, and (2) to get a
would be valid) and valid (else the total sequence sum tight bound on the number of parallel moves needed for
would be > 2). D the morph. As mentioned earlier, we strongly suspect
If the weight sequence cannot be split into two valid that this number is nearly linear.
pieces without separating x and y, we split it in three More generally, it would be interesting to introduce
pieces, as in Lemma 15. We stretch the edge corre- some measure of polygon distortion and look at edge
sponding to one of the two splits, turning the triangle translation algorithms that minimize this measure. Our
into a convex quadrilateral with edge f = xy separated algorithm is very bad this way, for even if P and Q
from the other two top-level vertices. See Figure 13. are very similar-looking polygons, their intermediate
(The quadrilateral must be convex, else the weight se- morphs can visually look quite different.
quence could be split into two valid pieces.) By trans-
Acknowledgements: The authors wish to acknowledge
lating the quadrilateral edge opposite / outward, we
valuable discussions with John Hughes, Tom Shermer,
shrink it enough to draw a microstructure disk around
David Kirkpatrick, G.D. Ramkumar, and Emo Welzl.
it. (Translating outward shrinks the edge because the
top-level turn at the endpoints of / sums to more than
> 1.) Now we stretch the edge corresponding to the References
other split. As in Figure 12a, we translate / outward,
shortening it until it can be contained in a microstruc- [CR] J. Culberson and G. Rawlins. Turtlegons: gen-
ture disk. Now x and y belong to the same tree, and erating simple polygons from sequences of angles.
In Proceedings of 1985 Comp. Geom. Symp., pages
the previous algorithm applies.
305-310, 1985.
[CW] K. Culik and D. Wood. A note on some tree sim-
ilarity measures. In IPL, 15, pages 39-42, 1982.
[KR] A. Kaul and J. Rossignac. Solid-interpolating de-
formations. In Proceedings of Eurographics 1991,
pages 494-505, 1991.
[SGWM] T. Sederberg, P. Gao, G. Wang, and H. Mu. 2-d
shape blending: an intrinsic solution to the vertex
path problem. In Computer Graphics, 27, pages
15-18, 1993 (SIGGRAPH '93)
[SG] T. Sederberg and E. Greenwood. A physically
based approach to 2-d shape blending. In Com-
puter Graphics, 26, pages 25-34, 1992 (SIG-
GRAPH '92)
[STT] D. Sleator, R. Tarjan, and W. Thurston. Rota-
Figure 13: Modifying the top-level triangle in two steps tion distance, triangulations, and hyperbolic ge-
ometry. In Proceedings of the 1986 STOC Sympo-
Except for the preliminary spine-shortening, we use sium, pages 122-135, 1986.
only 0(1) parallel moves to make x and y into siblings
[T] C. Thomassen. Deformations of planar graphs. In
in the same tree. The game model of Lemma 13 still J. Comb. Theory Ser. B, 34, pages 244-257, 1983.
applies to morphing polygons: bins still correspond to
[V] G. Vijayan. Geometry of planar graphs with an-
gaps between leaves, but now adjacent leaves may be gles. In Proceedings of 1986 Comp. Geom. Symp.,
in different trees. Thus the number of parallel moves pages 116-124, 1986.
needed to morph polygons is asymptotically the same
[W] E. Welzl. Personal communication, 1993.
as the number needed for bi-infinite chains:

276
A New Technique to Compute Polygonal Schema for 2-manifolds with
Application to Null-homotopy Detection
Tamal K. Dey
Dept. of Computer Science
Indiana University-Purdue University at Indianapolis

Abstract A 2-manifold M can be represented by a polygon


P (polygonal schema) with even number of edges such
We provide a new technique for deriving optimal sized that when edges are appropriately identified, we get
polygonal schema for triangulated compact 2-manifolds back M. Given a triangulation T of M, Vegter and
without boundary in 0(n) time, where n is the size of Yap [10] designed an algorithm that derives a polygo-
the given iriangulation T. We first derive a polygonal nal schema (canonical) of optimal size whose edges be-
schema P embedded in T using Seifert-Van Kampen's long to the edges of a refined triangulation of T. This
theorem. A reduced polygonal schema Q of optimal size method subdivides the edges of T into O(g) subedges
is computed from P, where a surjective mapping from and increases the size of the triangulation to O(gn).
the vertices of P is retained to the vertices of Q. This A lower bound of Cl(gn) is known for deriving such a
helps detecting null-homotopic (contractable to a point) canonical polygonal schema for 2-manifolds. In that re-
cycles. Given a cycle of length k we determine if it is spect the algorithm of Vegter and Yap is optimal. How-
null-homotopic in 0(n + gk) time where g is the genus ever, in applications we may not need such polygonal
of the given 2-manifold. The actual contraction for a schema. As shown in this paper, we can derive a polyg-
null-homotopic cycle can be computed in O(gkn) time onal schema of optimal size in 0(n) time from T with-
and space. This is an improvement of a factor of g over out refining it. This polygonal schema is not embedded
the previous best-known algorithms for these problems. in a refinement of T but retain a surjective mapping
from the vertices of another polygonal schema embed-
ded in T to its vertices. This fact is used to detect
1 Introduction null-homotopic cycles on M. Our method of comput-
ing the polygonal schema is also simpler than Vegter
In recent years a new focus has developed in studying and Yap's method. We believe that this method will
the algorithmic aspects of topology [2, 4, 6, 7, 9, 10], find more applications in other algorithms.
a well-developed branch of mathematics. This emer- Given a cycle C on a 2-manifold, we say that C is
gent field has been called "Computational Topology" null-homotopic if it can be contracted to a single point.
[6, 10]. It is generally recognized that there exists a vast Detecting the null-homotopy of a given cycle in a topo-
repository of topological problems which have not been logical space is a century-old problem, known as the
studied extensively from an algorithmic point of view. contractability problem in topology [8]. A related prob-
This paper deals with the problem of computing polyg- lem involves determining if two given cycles can be con-
onal schema, an efficient representation of 2-manifolds, tinuously deformed to one another. It turns out that a
from their triangulations. An elegant solution to this solution to the contractability problem also provides a
problem provides an improved algorithm for detecting solution to this problem.
null-homotopic cycles on compact 2-manifolds. The contractability problem for 2-manifolds was first
solved from a mathematical point of view during the
Permission to copy without fee all or part of this material is 1880s. It was established that a cycle is null-homotopic
granted provided that the copies are not made or distributed for if and only if its corresponding curve on the univer-
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given sal covering space is closed. Universal covering space
that copying is by permission of the Association of Computing is a collection of polygons (polygonal schema) appro-
Machinery. To copy otherwise, or to republish, requires a fee priately attached to give a tessellation of the plane. In
and/or specific permission.
[6], Schipper used this result to give an 0(g2k + gn)
10th Computational Geometry 94-6/94 Stony Brook, NY, USA time and space algorithm to detect the null-homotopy
© 1994 ACM 0-89791 -648-4/94/0006..$3.50

277
of a given cycle. Here k is the length of the given cycle. is an invariant property of the underlying space.
In his algorithm Schipper derives the canonical polygo-
nal schema using the algorithm of Vegter and Yap [10]. Fact 2.1 A cycle C is contractable or null-homotopic
Using our polygonal schema computation we design an if and only if[C] = 1 in ni [8J.
algorithm that runs in 0(n + gk) time and space. If the
We use the following concepts of group theory in the
given cycle is null-homotopic, the actual contraction can
next sections. Let G be a group with the product opera-
be computed in O(gnk) time. This is an improvement
tion "•". A set of elements X — {gi,g2, ■••} of G is called
of a factor of g over Schipper's algorithm. We should
a generator set if any non-identity g 6 G can be written
mention that Schipper's algorithm does not remain lin-
ear in k and takes 0(n + k2) time when g = 1 for torus as g = si • g2---9k for some k > 1 and g'{ e {91,92, •••}•
In other words all elements of G are generated by X.
(orientable) and g = 2 for klein bottle (non-orientable).
A word is a concatenation of elements of G under the
We treat these cases separately and give 0(n -f k) op-
timal algorithms for them. product operation. For example w = <7i.<?2-S3 = <7i<72<?3
is a word. A relation r is a word which is set to 1. For
We describe necessary concepts in homotopy and fun-
example r = Siff2ff3 is a relation if 51^2^3 = 1- Rela-
damental groups of topological spaces in Section 2. In
tions of the form gg~l,g~1g are called trivial relations.
the third section we explain the polygonal representa-
The structure T =< gi,g2--- : r!,r2l... > is called
tion (polygonal schema) of 2-manifolds. In Section 4
a group presentation of G if {<7i, <72) ■■•} is a gener-
we describe a technique to derive a reduced polygonal
ator set that generates G with respect to the rela-
schema from the given triangulation of a 2-manifold us-
tions {r!,r2,...}. We also write G =< gi,g2,--- ■
ing Seifert-Van Kampen's theorem. In the fifth section r r
we detail the algorithm for null-homotopy detection, i, 2--- >• Two relations are equivalent if one can be
derived from the other. A group is freely generated
and we conclude in Section 6.
by X = {gi,g2,---} if there are no nontrivial relations.
In that case the group has a presentation of the form
2 Homotopy and Fundamental < 9u92,... : >•

Group
3 Polygonal Schema
Let f : T\ —* T2 and g : T\ —► TJj be two maps be-
tween the topological spaces Ti and Tj. These two A 2-manifold is a topological space where each point has
maps are called homotopic if there is a continuous func- a neighborhood homeomorphic to an open disk. By this
tion h : [0,1] x Ti -+ T2 such that h(0, x) = f(x) and definition, we are considering only 2-manifolds without
h(l,x) = g(x). We can interpret h as a deformation boundary. A 2-manifold can be infinite or finite. More-
process that transforms / to g in a continuous manner. over, it can be closed or open depending on whether
We are interested in the case when T\ = S1, the unit or not its closure coincides with itself. A closed and
circle. Then, / and g are closed curves, also called cy- finite 2-manifold is also called a compact 2-manifold. A
cles. Let C\, C2 be two cycles that begin at a common sphere and a klein bottle are two examples of compact
point, say p. The product operation, " ■ ", is defined 2-manifolds. A 2-manifold is called orientable if it has
on them as C3 = C\ ■ C2, where C3 is the cycle begin- two distinct sides. Otherwise, it is non-orientable. For
ning at p, then going around Ci followed by a traversal details see [8].
around C2 which finishes at p. The inverse C_1 of a cy- A 2-manifold is triangulable in the sense that it can
cle C is the cycle lying on top of C, but with opposite be represented as the union of a set of triangles, edges,
orientation. and vertices satisfying the following properties. Each
Given a fixed origin p for the cycles on T2, we call pair of triangles either share a single vertex or a single
C, C equivalent if there is a homotopy between them edge, or are completely disjoint. Also, the triangles
which keeps p fixed. The equivalence class of C is de- incident on a vertex can be ordered circularly so that
noted by [C]. The product operation " • " extends nat- two triangles share a common edge if and only if they
urally to equivalence classes as [Ci] • [C2] = [C\ ■ C2]. are adjacent in this ordering. In this paper we consider
These equivalence classes form a group under the only compact 2-manifolds without boundary.
product operation. The identity element 1 is repre- Any orientable or non-orientable 2-manifold M can
sented by the equivalence class of the point cycle p, be represented by a simple polygon P with an even
number of edges on bd(P)1 which is also called a polyg-
and [C] ■ [C-1] = [C ■ C-1} = 1 giving [C]-1 = [C"1].
This group, denoted ^(T^), is called the fundamental onal schema of M. Each edge of P has a signed label
group of the topological space T2. It turns out that this such that each unsigned label occurs twice. See [3, 8]
group is independent of the choice of the origin p and 1
bd(P) represents the boundary of the polygon P.

278
-r ■'•*,

X
Figure 3.1: A polygonal schema for double torus

for details. Two edges with the same unsigned labels closed.
are called partnered edges. Partnered edges can have The following lemma provides a method that flattens
labels with the same or opposite signs. Two partnered out T to a triangulation T" of a planar polygon.
edges with the labels +x and -x represent the same
edge on M but are oppositely directed on P. Figure
3.1 shows a polygonal schema for double torus (</ = 2).
We use x-1 to denote the complement of the label x. Lemma 3.1 A polygonal schema P with triangulation
To reconstruct a surface homeomorphic to M from its V can be constructed from T where there is a one-to-
polygonal representation, the oriented edges with the one correspondence between triangles ofT' and T.
same labels are identified together in such a way that
their orientations match. For simplicity, we say that
M is obtained from P by identifying partnered edges PROOF. We construct a sequence of closed disks
appropriately. Di,D2i .,£)„ in a plane incrementally such that P
An orientable 2-manifold M with genus g > 0 can Dn at the end. Initially, Di = a[, a triangle in the
be represented canonically using a Ag-gon where all Ag plane that corresponds to an arbitrarily chosen triangle
vertices represent the same vertex on M. The size of o-\ on T. Let Di rjUff'j. .Ua'i after the ith step. At
this polygon is optimal since no &-gon with k < Ag can the i + 1 th step we choose a triangle cr1+1 on T which
represent M. The labels on the edges around the poly- has the following properties: (i) no triangle correspond-
gon are of the form: ing to c-i+i has been included in Di, and (ii) a triangle
o~j adjacent to <ri+1 by an edge has a corresponding tri-
x\yix11y1lxiy2x2ly21. •XlVgB^Vg1- angle in Di. These two conditions imply that there is
an edge e = o~j D cri+i such that its corresponding edge
Similarly, a non-orientable 2-manifold with genus e' on Di appears on bd(Di). We attach a triangle a'i+1
g > 1 can be represented canonically using an opti- to bd(D{) such that a'i+1 Dbd(Di) = e'. This gives the
mal sized 2<7-gon where the labels on the edges around new disk A+i = A U <r,'+1. It is clear that if A is a
the polygon are of the form: closed disk, so is A+i- Finally, when we exhaust all
XiXiX2X2---X gXg. triangles on A4, we have Dn with the triangulation V
that has the following properties, (i) Each triangle in T"
For g = 0, the orientable 2-manifold is the sphere corresponds to a single triangle in T and vice versa, (ii)
which can be represented canonically by two directed Each edge e' on bd(Dn) has a partnered edge e" such
edges II"1. Similarly for g = 1, the non-orientable that they both correspond to a single edge e on T. This
2-manifold is the projective plane which can be rep- is because each edge e on T has two incident triangles
resented by two directed edges xx. If we identify the and the edges on bd(Dn) have a single triangle incident
partnered edges of the canonical polygon appropriately, on them, (iii) When partnered edges of bd(Dn) are
they form a set of curves glued at a single point on the identified, we get back T. This is because, by our con-
2-manifold. These curves are called canonical genera- struction, the two triangles in V incident on partnered
tors. edges e', e" correspond to the two triangles incident on
Let T be a triangulation of a 2-manifold M with n e in T. Incidence relations of all other edges inside T"
edges. A path on T is a sequence of alternating vertices are isomorphic to their corresponding edges on T. So,
and edges, Vien^—et-ivjfe, where the edge e< has ver- Dn - P, a polygonal schema for M with a one-to-one
tices Vi,Vi+i as endpoints. A cycle is a path, which is correspondence between triangles in T and T".

279
Figure 4.1: The spaces D, G and G'

4 Computing an optimal polyg- Let a set of generators of Tfi(G) be 7 with the set of
relations p\. The fundamental group of D is the trivial
onal schema group {1} since D is an open disk. Let the set of rela-
tions obtained for the generators of 7Ti(DnG') in terms
The size (number of edges on the boundary) of the
of the generators of 7^ (D) and it\ (G") be p2 ■ The spaces
polygonal schema as deduced in the last section can be
M, G1 and D satisfy all conditions of Seifert-Van Kam-
fi(n), which is too large for our purpose. Here, we show
pen's theorem. Then according to this theorem TTI(M)
a technique to derive a polygonal schema Q of optimal
has a presentation < 7 : pi,p2 >■
size from P that retains enough information to preserve
A presentation of TTI(G) can be obtained as follows.
a surjective mapping from vertices of P to Q. Due to
Let Y be a spanning tree of G, and p be a vertex of
this mapping, we would be able to trace a path on Q
Y. Each edge e of G defines a cycle c(e) = view' orig-
that corresponds to a path on P and hence a path on
inating at p where w,w' are the paths from p to the
T. We already observed that the triangulation T" of P
end points of e along the edges of Y. To simplify nota-
becomes isomorphic to the triangulation T of M when
tions we write e for the cycle c(e). Any cycle e where
partnered edges are identified. From now on we will not
e is an edge of Y is contractable to p and hence be-
distinguish between the triangles, edges of T and X"; we
longs to the identity of 7Tj(G). Let B = {bi,b2l..., bi}
refer to them with the same name. With this set up,
be the set of edges of G that do not belong to Y. A
two partnered edges on bd{P) have the same name.
presentation of K\{G) is < bi,b2, ...,bi : > imply-
Let the 1-complex (graph) formed by the identified
ing pi = {}. Consider the sequence of edges around
edges of bd(P) be G. The space D = M - G is an open
(clockwise) bd(P). Some of these edges belong to Y
disk since P — bd(P) is an open disk. Let us attach a
which are set to 1 in 7Ti(G). In terms of the generators
thin layer of an open set on two sides of the edges of
of TTI(G), let the sequence of edges around bd(P) form
G to make it open, and denote this space G'; see figure
the word 6'111...6211...63ll...6'2^ll...l, where 6Js repre-
4.1. We can express TTI{M — G'öD) in terms of TTI(G')
sent the edges in B or their inverses. This word is
and fti(D) using the following theorem:
equivalent to r = b\b'2...b'2t. The generator for the space
Seifert-Van Kampen's theorem: Suppose S is a space
D D G' is b'^'i-.-byi in terms of the generators of 7Ti(G')
which can be expressed as the union of path-connected
and is 1 in terms of the generator of D. So we have
open sets A, B such that A fl B is path connected and
p2 = 6'162...6j^ = 1. Hence a presentation of it\{M) is
such that fti(A) and TTI(B) have respective representa-
< bi,b2, ...,bi : p2 >.
tions
Lemma 4.1 £ = 2g if A4 is orientable and £ = g if M
irl(A)=< ai,o2l... :ri,...,rn >
is non-orientable.
7Ti(B) =< &i,62,...: si,...,sq >
PROOF. Consider the polygon P with all edges in Y
while Xi(A D B) is finitely generated. contracted to a single point. This results in a polygon
Then i'i(S') =< ax> a2,..., 6i, b2.... : Q with the edges b\b'2...b'u labeled clockwise around it
r\,—,rn,si,...,sq,uiv^l,...,umv^ > where Ui,Vi are (figure 4.2). The polygon Q is a 2f-gon with partnered
the expressions for the same generator of TTI(A f) B) edges. Further we can assume that all vertices of Q have
in terms of the generators of K\{A) and -K\{B), respec- the same label, i.e., when partnered edges are identified,
tively. all vertices are identified to a single point. Then Q rep-
Since any cycle (curve) on G' can be continuously resents a polygonal schema for a manifold M' home-
deformed to the edges of G, we have 7Ti(G) = 7Ti(G'). omorphic to M. This is because (i) When partnered

280
edges are identified Q form a 2-manifold M' whose constructed from T in 0(n) time.
fundamental group is same as ni(M) (apply Seifert-
Van Kampen's theorem) and (ii) any two compact 2- Theorem 4.2 Let M be any compact 2-manifold of
manifolds are homeomorphic if and only if their funda- genus g with triangulation T of size n. A polygonal
mental groups are isomorphic. Euler's characteristic of schema Q of optimal size can be constructed in 0(n)
M' is 2 - I since we get one vertex, I edges and one time, where a surjective mapping is retained from the
face when the edges of Q are identified. It is known vertices of a polygonal schema embedded in T to the
that the Euler's characteristic of a surface M of genus vertices ofQ.
g is 2 - 2g if M is orientable and is 2 - g if M is non-
orientable. Since M and M' are homeomorphic, their
Euler's characteristics must be equal, proving I - 2g if
5 Detecting Null-Homotopy
M is orientable and I — g if M is non-orientable. Traversing a cycle C on T is equivalent to traversing
an ordered set of paths U = {ui, u2,..., Ur} that have
end points on bd(P) if C intersects G. Each of these
4.1 The Algorithm paths Ui is homotopic to a path u[ that has edges only
We construct the polygonal schema P as described in on bd(P) and have the same endpoints as w;. Note that
lemma 3.1. If we assume that the triangulation T is no such path exists when C does not intersect G. In
represented with a data structure that allows us to ac- that case C is trivially null-homotopic. We consider
cess the triangles incident on an edge and the edges of the nontrivial case when C intersects the edges of G.
a triangle in constant time, then the construction of P When edges on bd(P) are identified, the sequence
takes 0(1) time per triangle and 0(n) in total. In case u[u'2,...,u'r form a cycle C" on T, which is homotopic
T is represented with only a set of triangles such that to C. Each path u\ can be expressed as a word W{ in
the edges of a triangle are accessed in constant time but terms of the generators 61,62,--A by listing the se-
not the triangles incident on an edge, we spend 0(n) ex- quence of edges on it that are not marked 1 on bd(P).
tra time to preprocess this data structure. If the edges This is actually done on bd(Q) to avoid unnecessary vis-
are given with integer names, we index the set of edges its of edges that are marked 1 on bd(P). We also write
of the given triangles in an array and match them to tu,- ~ Ui if the word u>; corresponds to the path u,-. The
detect the incident triangles for each edge. If the edges word w = w\w2...wr represents the cycle C in ni(M).
are given as pair of vertices, we sort them through radix We determine if w = 1 to detect if C is null-homotopic
sort in linear time and then match them. (Fact 2.1).
While constructing P we maintain pointers from the The sequence of paths {uiu2...ur} with endpoints on
edges and triangles of T to the edges and triangles of bd(P) are detected through pointers as we traverse C
P. Also, the edges of the 1-complex G are detected on T. The homotopic path u\ of it< is identified by the
during this step. A spanning tree Y of G is computed endpoints vi,v2 of U{. We do not traverse the path u\
in 0(n) time. The edges not in Y are detected and the on bd(P) which can have fi(n) length. To form the word
corresponding edges on bd(P) are marked with the label Wi ~ Ui we detect the corresponding vertices of v\, V2 on
other than 1. All other edges on bd(P) are marked 1. bd(Q) through pointers from P to Q. We can consider
All these take 0(n) time. the labeled edges between these vertices on bd(Q) in
The reduced polygon Q of size 11 is constructed from any direction (clockwise or counter-clockwise) to form
P as follows. Let the sequence of edges around bd(P) the word u>,-. This takes 0(|iu,-|) time. Thus the word
(clockwise) be 6i6'2...6'2£ ignoring the edges marked 1. w for C is constructed in 0{\w\) time. The length of w
We form the polygon Q to have 2i edges labeled can be at most 0(gk) since each word u>i can have at
W2—V21 around it- We maintain pointers from the ver- most 21 - 0{g) length and there can be r = 0(k) such
tices of P to the vertices of Q as follows. Let 6-6-+1 be words in the worst case.
any two consecutive edges in the sequence (circular) To determine if C is null-homotopic, we check if w =
b[b'2...b'2l and viv2...vs be the vertices of bd(P) between 1. The polygon Q can be thought of as a polygonal
b'{ and b'i+1 where vi is an endpoint of 6(- and vs is an schema for M, where 2£ vertices represent the same
endpoint of b'i+l. All these vertices point to the same point on M. So, u> can be thought of as a word formed
vertex v between 6- and 6(+1 in Q. See figure 4.2. The by the concatenation of edges taken from a canonical
polygon Q can be thought of as the polygon P with set of generators of M ■ Detecting w - 1 for such a
all edges in the spanning tree Y shrunk to a single ver- word w is known as the word problem. Schipper gave an
tex. By lemma 4.1 Q has optimal size. The point- algorithm for this problem which runs in 0(g\w\) time.
ers from P to Q realizes a surjective mapping between Using this algorithm we can detect if w - 1 in 0(g2k)
their vertices. Combining all costs together Q can be time; however, we can do better. If w = u>iw2...wr

281
Ab"

Figure 4.2: Reduced polygonal schema

where tu,- ~ u,-, we can detect if w = 1 in O(gr) = O(gk) together. Each middle edge is traversed in 0(1) time
time. taking 0(gk) time altogether since there are 0(gk) such
Our method is similar to the method of Schipper [6]. edges. Thus the total time spent on detecting the
Let U(M) denote the universal covering space for M. closedness of the lifted path for w is 0(gk). Unfor-
We can construct a universal covering space U(M) of tunately, when g < 1 (g < 2 if M is non-orientable)
M as follows: Let PM be a 4^-gon (if A4 is orientable) the above amortized analysis fails. Indeed, for g = 1
or a 2<7-gon (if M. is non-orientable) such that when its (<7 = 2 if .M is non-orientable), the above procedure
edges are identified we get a set of generators for M. takes Q(k2) time in total. We use different procedures
meeting at a single point. By taking infinitely many for these cases as detailed below.
copies of PM and gluing them together along the iden-
tified edges, one gets a tessellation of the plane with
either 4^-gons or 2^-gons, depending on whether M. is 5.1 Special Cases
orientable or not. Since the polygon Q can be thought Any cycle on a sphere (g = 0) is contractable to a sin-
of as a polygonal schema for A4 where all 11 vertices gle point. So, the contractability problem is trivial for
represent the same point on X, we can take PM — Q spheres. The fundamental group of any torus (g = 1)
to construct U(M). The following fact is well-known has the presentation < a,b : aba~lb~l > which means
[8]. ab — ba. Thus any word w on the canonical generators
Fact 5.1: Any curve C on M can be mapped to a can be expressed as w = ambn. This implies w = 1 if
unique path u (lifted path) in U(M) such that C is and only if m = 0 and n = 0. Let an edge e on Q (a
null-homotopic if and only if u is closed. rectangle) be traversed C\ times in the clockwise direc-
We construct a part of U(M) in an incremental fash- tion and Ci times in the counter-clockwise direction on
ion which is sufficient to detect if the lifted path u of w the paths/words w\,W2, ...,wr. Let ce = C\ — C2- We
is closed. If u is closed, this method provides a closed have m = 0 and n = 0 if and only if ce +ce =0 for each
disk whose boundary is u. For each iu,-, the edge with pair of partnered edges e,e'. Detecting this fact takes
which it starts is called its first edge, and the edge with 0(Eri=i Kl) = 0(gk) = 0(k) time. With the 0(n)
which it terminates is called its last edge. All other preprocessing time we have an 0(n + k) time algorithm
edges are called middle edges. The first edge and the for torus.
last edge of a word iu:- are same if |u>,-| = 1. We update Similar to the orientable 2-manifolds, the cases when
the constructed structure when we traverse any of the g = 1 (projective planes) and g = 2 (klein bottle) for
first and last edges. Since all middle edges in between a non-orientable 2-manifolds are treated separately. Al-
first edge and a last edge are visited on a single polygon though the case for g = 1 can be solved trivially, the
(current polygon), we do not need to update the struc- case for g — 2 (polygon Q is rectangle) cannot be solved
ture during their visits. Because of its similarity to [6] by the method used for torus. Instead we use a different
and shortage of space, we omit the details of updation method for klein bottles.
here. An improved version of this procedure is reported For klein bottles, the polygon Q is a rectangle and the
in [1]. sequence of edges around bd(Q) reads either abab^1 or
An amortized analysis shows that each first and last aabb; see Figure 5.1. The universal covering space with
edge take 0(g) amortized processing time. Since there these two patterns are shown in Figure 5.1. We observe
are 0(k) such edges, 0(gk) time is spent on them al- that vertices in the universal covering space have two

282
,,, ä,k b>/ o-/» t

Ouk a./v >'k_/vft ,,b

.?- CL u A <*

Ot/v 1 > '*■ o.+ 'JYI

tt TT .- /^

Figure 5.1: Universal covering spaces for klein bottles

different configurations in both cases. We can deter- structure. First, the cycle C is deformed to the cycle
mine in an 0(1) step the edges that take us left, right, C = u'1u2...u'T on G. This is achieved by deforming
up and down for each configuration. For example, from u\,U2,...,ur to u\tU2,...,u'r respectively over the trian-
configuration F% (Figure 5.1) we go left, right, up and gles of T in 0(kn) time. Next we contract all the edges
down by the edges 6-1, b, a-1 and a respectively. We of G that are present in the spanning tree Y in 0{n)
can also decide in 0(1) time which configuration we end time. This may leave some of the triangles of T (equiv-
up with when we move from a particular configuration alent^ T' of P) to be contracted to a single edge loop
through a particular edge. For example, we go to F'2 or a double edge loop. These two steps deform the cy-
from F[ through the edge 6_1 (Figure 5.1). Once we cle C to u, which is contracted over the polygons in the
have this information available through a preprocessing constructed structure. The deformed triangulation T'
step, we can visit the edges of w on bd(Q) and for each is superimposed on each such polygon Q. A contraction
such edge we know the direction of our movement in of u over the deformed triangulations of the polygons
the universal covering space without constructing it ex- completes the contraction of C. The constructed par-
plicitly. The path on the universal covering space will tial structure can have at most 0(gk) polygons since it
be closed if and only if we move an equal number of is constructed in 0(gk) time. This implies that u can
times left as right and an equal number of times up as be contracted over 0(gk) triangulations of size 0(n)
down. This procedure takes 0(|Iü|) = 0{gk) = 0(k) each. This produces an O(gkn) time and space actual
time. With preprocessing times added, we have an op- contraction for C.
timal 0(n + k) time and space algorithm. Remark: Recently using our polygonal schema compu-
Combining the costs of all steps for all cases we have tation and a clever modification of Schipper's universal
the following theorem. covering space construction with the help of sophisti-
Theorem 5.1 Let M. be any compact 2-manifold with- cated data structures, we have designed an improved
out boundary of genus g > 0 with a triangulation T of algorithm for the null homotopy problem [1]. This algo-
size n. We can detect if a given cycle C of length k is rithm runs in 0(n+k^/Iögg~) time and in Q(n+k) space.
null-homotopic in 0(n + gk) time and space. The actual contraction can be computed in Q(nk) time
and space.
5.2 Related Problems
Detecting homotopic cycles: Two cycles C\,C2 of 6 Conclusions
lengths ki, &2 respectively are homotopic if and only if
[Ci • CJ1] = 1. Let w\,W2 be the words constructed We have presented a new technique to derive a reduced
corresponding to C\ and C2l respectively. We have polygonal schema from a triangulation of a given 2-
[C\ • C^"1] = 1 if and only if twi.tyj1 = 1. This can be manifold. This has produced an improved algorithm for
detected in 0(g(ki + jfc2)) time giving an 0(n + g(k^ + detecting null-homotopic cycles on compact 2-manifolds
k2)) time algorithm for this problem. without boundary. We believe that this technique
Computing actual contractions: The path u cor- will find further applications in other algorithms on
responding to w on the partially constructed universal 2-manifolds. The method can possibly be adapted
space is closed if and only if the original cycle C is to solve the contractability problem on compact 2-
null-homotopic. In case u is closed we can compute the manifolds with boundary. An open question is: can the
actual contraction as follows. Recall that the closed recent time bound 0(n + k^/logg) achieved for null-
disk whose boundary is u is present in the constructed homotopy problem be further improved to 0(n + &)?

283
An extension of the null-homotopy problem is to con-
sider it on arbitrary complexes. Fundamental group
of any cf-dimensional (d > 1) complex is determined
only by its 2 dimensional subcomplex. So, to solve the
contractability problem we can concentrate on only 2-
complexes. However, it is known that the contractabil-
ity problem is unsolvable for arbitrary 4-manifolds [8].
Hence the contractability problem is unsolvable for ar-
bitrary 2-complexes. It is an interesting and probably
a difficult question to characterize the 2-complexes for
which the contractability problem is solvable. Perhaps
a more practical problem would be to consider the 2-
complexes that are embeddable in three dimensions.
Acknowledgement. The author wishes to thank Her-
bert Edelsbrunner for sharing an idea on the special
case of klein bottles.

References
[1] T. K. Dey and H. Schipper. A new technique to com-
pute polygonal schema for 2-manifolds with applica-
tion to null-homotopy detection, manuscript (1994).

[2] H. Edelsbrunner and C. Delfinado. An incremental al-


gorithm for betti numbers of simplicial complexes. 9th.
Ann. Sympos. Comput. Geom. (1993), 232-239.

[3] P. J. Giblin. Graphs, Surfaces and Homology. Halsted


Press. New York (1977).

[4] J. Hersberger and J. Snoeyink. Around and around:


computing the shortest loop. Proc. 3rd Canad. Con}.
on Comput. Geom. (1991), 157-161.

[5] K. Melhorn and C. K. Yap. Constructive Hopfs the-


orem: or how to untangle closed planar curves. Proc.
ICALP, Springer Lecture Notes in Computer Science.
(1988), 410-423.

[6] H. Schipper. Determining contractibility of curves.


Proc. 8th ACM Sympos. on Comput. Geom. (1992),
358-367.

[7] J. S. Snoeyink. Topological approaches in compu-


tational geometry. Tech. Report STAN-CS-90-1331
(1990).

[8] J. Stillwell. Classical topology and combinatorial group


theory. Springer-Verlag. New York (1980).

[9] G. Vegter. Kink-free deformations of polygons. Proc.


5th ACM Sympos. on Comput. Geom. (1989), 61-68.

[10] G. Vegter and C. K. Yap. Computational complexity


of combinatorial surfaces. Proc. 6th ACM Sympos. on
Comput. Geom. (1990), 102-111.

284
Triangulating Topological Spaces"
Herbert Edelsbrunner and Nimish R. Shah
Department of Computer Science
University of Illinois, Urbana, IL 61801, USA.

Abstract In this paper we concentrate on the second question.


In particular, given a subspace and a finite point set in
Given a subspace X C Rd and a finite set S C Ud, we in- Rd, we give an unambiguous rule for constructing a sim-
troduce the Delaunay simplicial complex, V\, restricted plicial complex representing the subspace. Topological
by X. Its simplices are spanned by subsets T C S for properties of this simplicial complex, such as whether
which the common intersection of Voronoi cells meets X its domain is homotopy equivalent or homeomorphic to
in a non-empty set. By the nerve theorem, U^x o-nd X the subspace, can be studied based on local interactions
are homotopy equivalent if all such sets are contractible. between the subspace and the Voronoi neighborhoods
This paper shows that \JV% and X are homeomorphic of the points. This leads us back to the first question:
if the sets can be further subdivided in a certain way so additional points can be chosen so they improve the
they form a regular CW complex. local interaction patterns. How this can be done in a
concrete, possibly three-dimensional setting ought to be
the subject of future investigations.
1 Introduction Simplicial complexes and triangulations. An
affinely independent point set T C Rd defines the sim-
This paper studies the problem of constructing simpli- plex (TT = convT. Its dimension is k = dimerx =
cial complexes that represent or approximate a geomet- card T— 1, and it is also referred to as a k-simplex. The
ric object in some finite-dimensional Euclidean space, points of T are the vertices of <TT- A simplicial com-
Rd. We refer to the geometric object as a topological plex, K, is a finite collection of simplices that satisfies
space or subspace of Rd. This problem arises in geo- the following two properties: if CT G K. and U C T
metric modeling and finite element analysis, and it is then au G K,, and if O~T, cy G K then <TT n cry = arnV ■
a special case of the grid generation problem [21]. It The first property implies 0 G /C, and the first and
is special because we only consider grids or complexes second properties combined imply O~T H °V G K. The
made up of simplices. The problem can be divided into vertex set of K is vert/C = [J<,Te)cT> tne dimension
two questions: is dim/C = max«,^ dimcr, and the underlying space is
{JK, = UCTPK °~- A subcomplex of K is a simplicial com-
How do we choose the points or vertices of the plex C C K.
grid?
A particular simplicial complex defined by a non-
How do we connect the vertices using edges, degenerate finite set 5 C Rd is the Delaunay simplicial
triangles, and higher-dimensional simplices? complex, V = Vs [6]. It consists of all simplices CTT,
T C S, for which there exists an open ball, B, with
'Research of both authors was supported by the National Sci- S n dB = T and 5 n B = 0. Given S, V is unique,
ence Foundation under grant ASC-9200301 and under the Alan T.
Waterman award, grant CCR-9118874. Any opinions, findings,
dimX> = min{d, cardS — 1}, and \JV = convS. In
conclusions, or recommendations expressed in this publication are computational geometry, V is usually referred to as the
those of the authors and do not necessarily reflect the view of the Delaunay 'triangulation' of S [7, 18]. To avoid confu-
National Science Foundation. sion with the topology notion of a triangulation, which
is adopted in this paper, we choose to call T> a simpli-
Permission to copy without fee all or part of this material is cial complex. Following the tradition in combinatorial
granted provided that the copies are not made or distributed for topology, a triangulation of a topological space X is a
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given simplicial complex K, together with a homeomorphism
that copying is by permission of the Association of Computing between X and (J/C [17, 19]. If there exists a simplicial
Machinery. To copy otherwise, or to republish, requires a fee complex K, such that (J/C is homeomorphic to X, then
and/or specific permission.
X is triangulable.
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
285
Outline. Our approach to constructing a simplicial vertex set of fC, so that D G nerve C iff the simplex
complex that represents a topological space X C Rd is spanned by ß(D) is in fC.
based on a finite set S C Rd and the Delaunay simplicial Observe that the collection of Voronoi cells restricted
complex of this set, V = Vs- Section 2 introduces the to X, Vx, is a finite closed covering of X. The Delaunay
concept of a Delaunay simplicial complex T>\ restricted simplicial complex restricted by X, T>\ = T>st\, is the
by X, which is a sub complex of V. This concept is a geometric realization of nerve Vx defined by ß(Vp) = p,
common generalization of ideas developed by Martinetz for all p£ S. That is, Vx = {aT \ T C S, HVT)x #
and Schulten [15], Chew [4], and Edelsbrunner [8]. Vx 0}. Note that Vx is a subcomplex of the Delaunay
is defined for every X C Rd and every non-degenerate simplicial complex V = VKd of S. See figure 2.1 for an
finite S C Rd. If 5 satisfies the assumptions of the example. The nerve theorem of combinatorial topology
nerve theorem, see section 2, then (J£>x and X are ho-
motopy equivalent. Section 3 presents some topological
concepts and discusses the meaning of non-degeneracy
in detail. Sections 4 and 5 study conditions on S that
guarantee \JV\ be homeomorphic to X. An explicit
construction of a homeomorphism is also given. Sec-
tion 6 mentions directions for further research.

2 Restricted Delaunay Simpli-


cial Complexes
d
Coverings and nerves. Let XCf be a topological Figure 2.1: (a) The Voronoi cells often points decompose
space and SCR^a finite point set We assume non- three spaces, Xi, X2, and X3. (b) The three correspond-
degenerate position of the points in S, which generically ing Delaunay simplicial complexes consist of an edge, a
means that anything vanishing under a slight perturba- cycle of three edges, and two triangles sharing an edge,
tion of the points is precluded. For example, we require respectively.
that T C S be affmely independent if cardT < d + 1,
and that no d + 2 points of S be cospherical. Further [2, 13, 23] sheds some light on the relationship between
particulars of this assumption will be discussed in sec- X, Vx, and Vx. See section 3 for a formal definition of
tion 3. The Voronoi cell of p G S is homotopy equivalence and contractibility.
Vp = {x G Rd | \px\ < \qx\, q G S}, THEOREM (nerve). Let C be a finite closed covering
of a triangulable space X C Rd so that for every
where \yz\ denotes the Euclidean distance between D C C, p| D is either empty or contractible. Let K,
points y,z G Rd- The collection of Voronoi cells is be a geometric realization of nerve C. Then X and
V = Vs = {Vp | p G 5} [22]. The Voronoi cell restricted IJ/C are homotopy equivalent.
to X of p G S is VPtx = XC\Vp, and the collection of
restricted Voronoi cells is Vx = Vs,x = {VP,x \ P G S}. In particular, if f] D is empty or contractible for every
For a subset T C S we have corresponding subsets Vy = D C Vx then X and IJ^x are homotopy equivalent.
{VP \peT}CV and VT,X = {Vp,x I P € T} C Vx. Related earlier work. Martinetz and Schulten [15]
We will consider their common intersections, f] Vy and study neural nets modeling a topological space X. In ge-
nvT,x = xnnvT. ometric language, a neural net consists of finitely many
A covering of X is a collection C of subsets of X so points and edges between them. The algorithm in [15]
that X = (JC. It is a closed (open) covering if each constructs the net by choosing a finite set S C X and se-
set in C is closed (open), and it is a finite covering if lecting edges based on points sampled from X found in
C is finite. For a subset D C C consider the common Voronoi cells associated with point pairs. A cell is asso-
intersection, f] D. The nerve of a finite covering C is ciated with every pair {p, q} C S for which Vp l~l Vq ^ 0,
see [7, 18]. This cell can be interpreted as a "thick-
nerve C = {DC C | p|D # 0}. ened" version of the face common to Vp and Vq, and
a point of X sampled in this cell is taken as evidence
We remark that the nerve can be defined for a finite that X n Vp n Vq # 0. Martinetz and Schulten call the
covering of any abstract set, not just for subsets of Rd. resulting net the induced Delaunay triangulation of S
A geometric realization of nerve C is a simplicial com- and X; in the limit it is the same as:the edge-skeleton
plex, K, together with a bijection ß between C and the oiVx.

286
Chew [4] introduces a method for constructing a sim- For convenience, we define R* = Hk - Bk - S* = 0 if
plicial complex approximating a (two-dimensional) sur- k < 0. An open k-ball is a homeomorph of Rk, a half-
face in R3. Let X be such a surface and S C X a finite open k-ball is a homeomorph of Hfc, a closed k-ball is
point set. Three points p,q,r G S span a triangle in a homeomorph of Bk, and a (fc - l)-sphere is a homeo-
the approximating complex if they lie on the bound- morph of Sfc_1. For k > 1 these are disjoint classes of
ary of an open ball B C R3 with center in X so that spaces, that is, open balls, half-open balls, closed balls,
S n B - 0. Assuming non-degeneracy, such a ball B and spheres are pairwise non-homeomorphic. This is
exists iff X n Vp n Vq 0 Vr # 0. Chew's method can thus not true for ifc = 0: open, half-open, and closed 0-balls
be seen as a special case of our definition of restricted are points, and a 0-sphere is a pair of points.
Delaunay simplicial complexes. Our first theorem is about topological spaces that are
Finally, Edelsbrunner [8] defines the dual complex of manifolds, with or without boundary. X C Rd is a k-
a union of balls in Rd. Consider the case where all balls manifold without boundary if each x G X has an open
are equally large. Let S C Rd be a finite point set, and jk-ball as a neighborhood in X. X C Rd is a k-manifold
define X = {x G Rd | minpeS M < p}, for some fixed with boundary if each x G X has an open or half-open
positive p G R. The Voronoi cells of S decompose X into jfe-ball as a neighborhood in X, and there is at least one
closed convex regions, and the dual complex is defined x £X that has no open fc-ball as a neighborhood. The
as the nerve of these regions, geometrically realized by set of points without open fc-ball neighborhood forms
the map ß(Vp,x) = p, for all p G S. We see that it the boundary, bdX, of X. Note that the boundary of a
is the same as the Delaunay simplicial complex, V\, half-open fc-ball is an open (k - l)-ball, which is there-
restricted by X. The common intersection of any subset fore without boundary. From this it follows that the
of these regions is convex and therefore contractible, so boundary of a ^-manifold with boundary is a (fc - 1)-
the nerve theorem implies that the underlying space of manifold without boundary. The interior of a manifold
the dual complex is homotopy equivalent to X. X is intX = X - bdX; it is the set of points with open
jfc-ball neighborhoods. Note that our definition distin-
guishes between manifolds with and without boundary,
3 Some Topological Concepts which is somewhat non-standard as the set of manifolds
without boundary is usually considered a subset of the
Neighborhoods, homotopies, homeomorphisms, set of manifolds with boundary. A manifold X is com-
and manifolds. An open ball in Rd is a set B = pact if every open covering of X has a finite subcovering,
B(x,p) = {y G Rd | \yx\ < p} for some point x G Rd or equivalently, if it is closed and bounded. A manifold
and some positive p G R; x is the center and p the ra- Y C X is a submanifold of X.
dius of B. For Y C X, a neighborhood of Y in X is an Non-degeneracy. In section 4, we are interested in
open subset of X that contains Y. the intersection between manifolds and affine fiats. An
Let X and Y be two topological spaces. Two maps ^-manifold F C Rd is an t-flat if it is the affine hull of
ft g : X —► Y are homotopic if there is a continuous map £+1 points, or equivalently, it is the intersection of d—l
h: Xx [0,1] -► Y with h(x, 0) = f(x) and h(x, 1) = g(x) hyperplanes, or linear functionals. Let X C Rd be an
for all ieX. The two spaces, X and Y, are homotopy m-manifold. Intuitively, a point x G Rd has d degrees of
equivalent if there are continuous maps / : X —► Y and freedom, and it looses d — m of them if it is constrained
„ . Y —► X so that g o / is homotopic to the identity to lie in X. Similarly, x looses d - I degrees if it is
map in X and / o g is homotopic to the identity map constrained to lie in F. So if x G X n F then x should
in Y. X is contractible if it is homotopy equivalent to a have lost 2d-m-£ degrees of freedom. Hence, Xf\F
point. should be empty if d- (2d- m-t) =m + £-d<0. In
Topological spaces X and Y are homeomorphic, writ- general, we expect x to have m+l-d degrees of freedom
ten X « Y, if there is a bijective map <p : X —*■ Y so that and XC\F to be an (m+£-rf)-manifold. Algorithmically,
ip and f'1 are continuous, ip is a homeomorphism be- such a non-degeneracy assumption can be simulated by
tween X and Y, and X and Y are homeomorphs of each conceptual perturbation techniques, see e.g. [9, 24].
other. Homeomorphs of open, half-open, and closed This intuitive argument can be formalized for smooth
balls of various dimensions play an important role in or piecewise smooth manifolds. We need some def-
the forthcoming discussions. For k > 0, let o be the initions from differential topology. For an open set
origin of R* and define X C Rm, a map / : X ->• Rn is smooth if it has contin-
uous partial derivatives of all orders and at all points
H* = {* = (&,...,&) eR* I & >0}, of X. For arbitrary X C Rm, f is smooth if for all
B* = {x G R* | M < 1}, and x G X there exists an open ball B = B(x,e) C Rm and
•k-i
= {x G Rk | M = 1}. a smooth map g : B -»• Rn so that g equals / on X n B.

287
Topological spaces X C Rm and YCR" are diffeomor- closed ball property for X if for every £ < m and every
pkic if there exists a homeomorphism <p : X —► Y so subset T C S with card T = m + 1 — £, the following
that if and <p~l are smooth. An m-manifold X with two conditions hold:
or without boundary is smooth if each x £ X has a
neighborhood diffeomorphic to R* or H*. (Bl) f] VT,X is either empty or a closed ^-ball, and
Now, let X be a smooth m-manifold, and let / : X —► (B2) Pl^T.bdx is either empty or a closed (I— l)-ball.
R be a smooth map. Then y £ R is a regular value of /
if for every z £ /~ * (y) some partial derivative of / at x In section 3, we argued that it is reasonable to ex-
is non-zero; otherwise, y is a critical value of/. By the pect X n p| VT be an ^-manifold, if X is a smooth m-
preimage theorem in differential topology, the preimage manifold. This is reflected in condition (Bl). A similar
of any regular value is a smooth submanifold of X with non-degenerate position assumption is implied by (B2)
dimension m — 1, and by Sard's theorem, the set of crit- for the boundary of X. We will see that the closed ball
ical values has measure 0 in R, see e.g. [10, 11]. This im- property guarantees that dimension is preserved. As an
plies that with probability 1, the intersection between a example consider Xi and V\1 in figure 2.1. Condition
smooth m-manifold X and a hyperplane with prescribed (B2) is violated by the common edge of the two Voronoi
normal direction is a smooth (m — l)-manifold. Hence, cells intersecting Xi. Indeed, (J^Xi ¥> *i because the
with probability 1, the intersection between X and an dimension of X\ is two and that of U^Xj is one.
£-flat F with prescribed normal (d — £)-flat is a smooth Two technical lemmas. Before proving the firts the-
(m + £ - cQ-manifold. By non-degenerate position of F orem we establish two facts about the closed ball prop-
we mean that this is indeed the case, and it is reason- erty. The first says that the closed ball property pre-
able to assume non-degenerate position because F just serves dimension locally, and the second is a statement
needs to avoid a measure zero set in Rd~l. about the way Voronoi cells intersect a compact mani-
One of the conditions necessary for our results is fold and its boundary. We work with arbitrary, that is,
the non-degeneracy of the intersection between Voronoi possibly non-smooth m-manifolds since we do not need
cells and the manifold. We thus extend the above no- any smoothness properties for our proofs. A simplex
tions to Voronoi cells and their intersections. An in- o~T £ Vx is a principal simplex if there is no proper su-
tersection of Voronoi cells is the common intersection perset U DT with cry £ Vx ■ The first fact is formalized
of finitely many closed half-spaces, and thus a convex in the following lemma.
polyhedron. Let P be a convex polyhedron and let X be LEMMA 4.1 (preservation of dimension). Let m > 1, let
a manifold without boundary. We say that P intersects X C Ud be a compact m-manifold with or without
X generically ifXnP = 0orXnP has the right dimen- boundary, and let S C Rd be a non-degenerate fi-
sion and X n int P = int (X D P). If X is a manifold with nite set of points that has the generic intersection
boundary, then P intersects X generically if P intersects property for X. If S has the closed ball property
intX and bdX generically. By non-degenerate position for X then every principal simplex of V\ is an m-
of P we mean that P intersects X generically. Again, simplex.
this is a reasonable assumption to make.
PROOF. Let a? £ V\ be a principal simplex, and define
F' = PJVT and F = f]VT,x- By condition (Bl), F =
4 Triangulating Compact Mani- X n F' is a closed (-ball, with £ = m + 1 - card T. Since
<TT £ T>x, we have F ^ 0, which implies £ > 0 and
folds therefore card T < m+1. If card T = m+1 then <rT is an
m-simplex and we are done. So suppose cardT < m+1.
We are now ready to state conditions under which the Since <rT is a principal simplex, it follows that F C
restricted Delaunay simplicial complex is a triangula- intF', for otherwise there is a proper face G' = f)Vu
tion of X. These conditions will be applied only when of F', so T C U, with X n G' # 0. If follows that
X is a compact manifold. To avoid any confusion, we o~u £ Dx, which contradicts the principality of ax-
note that our results do not settle the open question Finally, we show that F C int F' also leads to a con-
whether or not all compact manifolds are triangulable. tradiction. As mentioned above, F is a closed £-ball
The closed ball property. Throughout this section and hence bd F is an (£- l)-sphere. This {£.- l)-sphere
we assume non-degenerate position of fiats and discrete is contained in intF', so it must lie in bdX. Indeed,
point sets. Let m > 0 and let X C Rd be a compact h&F - bdXnF'. This contradicts condition (B2),
m-manifold with or without boundary. Let S C Rd
which requires bdX D F' be a closed (£ - l)-ball. EQ
be a finite point set. We say that S has the generic
intersection property for X if for every subset T C 5, For the next lemma we need a classic result on sub-
P|VT intersects X generically. We say that S has the divisions of a certain type of complex. A closed ball is

288
called a cell, or a k-cell if its dimension is k. A finite Figure 4.1 (c) shows the barycentric subdivision of the
collection of non-empty cells, U, is a regular CW com- simplicial complex in 4.1 (b). Note that sd/C can be
plex if the cells have pairwise disjoint interiors, and the
boundary of each cell is the union of other cells in H.
A subset of 11 is a chain if its elements can be ordered
so that each contains its predecessors and is contained
in its successors. Let C^ be the set of chains in H and
note that nerve C-^ is well defined. The result men-
Vx *sdPx
tioned is that any geometric realization of nerve Crc is
homeomorphic to \}H. It can be found in [5, chapter
V] and [14, chapter III] and also in [3] where it is ap- (a) (b) (c) 00
plied to manifolds subdivided by the cells of a regular
CW complex. Another classic result needed is the weak Figure 4.1: (a) The space X is a closed 2-ball in the form
Schönflies theorem, see e.g. [20, chapter 3], which im- of a boomerang. It is covered by the restricted Voronoi
plies that if A is a piecewise linear fc-sphere and B C A cells of six points, which define a regular CW complex U
is a piecewise linear closed fc-ball then A - int B is also with \J1l = X. (b) The Delaunay simplicial complex, T>x,
a closed fc-ball. consists of four triangles connecting six points, (c) The
barycentric subdivision, sdX>x, has the same underlying
LEMMA 4.2 (complimentary closed ball property). Let space as Vx- (d) A geometric realization of nerveC-R
m, X, and S be as in lemma 4.1. Let T C S be so consists of a simplicially homeomorphic copy of sdX>x (not
that G = DvT,bdX # 0, and define F = f|vT,x shaded), surrounded by a collar of triangles (shaded).
and I = m - cardT. If 5 has the closed ball prop-
erty for X then bd F - intG is a closed £-ball. constructed inductively by connecting by to all sim-
PROOF. By condition (B2), F is a closed (£+ l)-ball, plices subdividing the proper faces of O~T- The star of
and thus an (£+l)-manifold with boundary. Let U con- a vertex v G K is st v = {a € K- \ v £ <r}.
sist of all sets fl Vt/,x and f| Vj/,bd x over all U C S with We will use these tools to show our first result stated
T C U. Assuming S has the closed ball property for X, in theorem 4.3 below. The proof constructs a home-
these sets are cells, so H is a regular CW complex and omorphism between X and (JX>X one steP at a time-
F = [jH. Let K be a geometric realization of nerve C-R. In this process, the pasting lemma of point set topol-
and let <p : F —>■ \J K be a homeomorphism; it exists be- ogy [16, 19] is employed. It can be stated as follows.
cause of the homeomorphism result mentioned above. If f ; ^ _► Y and g : B —► Y are continuous maps
Note that <p{b& F) = bd |J K is the underlying space of that agree onAnß and A, B are closed in AUB, then
a subcomplex of K, and similarly, <p(G) = \J£ for a h : AllB ^ Y, which agrees with f on A and with g
subcomplex C C K. By construction, bd[J/C is a piece- on B is continuous.
wise linear ^-sphere and (J£ C hd{JK is a piecewise
linear closed £-ball. The weak Schönflies theorem im- THEOREM 4.3 Let X C Rd be a compact manifold,
plies that bd U K -int \J C is a closed £ball. Since tp is a with or without boundary, and let S C Rd be a
homeomorphism, tp'1 (bd\JfC-'mt\JC) = bdjF-intG non-degenerate finite point set that has the generic
intersection property for X. If 5 has the closed ball
is also a closed £-ball, as claimed. tu
property for X then (JX>X « X.
Theorem for manifolds. We need a few additional
definitions. The barycentric coordinates of a point PROOF. For each i, define V» = {f)VV,x | cardT =
x with respect to a simplex CTT, T = {VQ,. ..,Vk}, m + 1 - i} and note that because of the closed ball
property all elements in V; are closed i-balls. We in-
are real numbers £o,---,6; so that ^;=o& = * and
ductively construct simplicial complexes £, and home-
Yy=otiv' = x> ^y are unique and non-negative if omorphisms y>,- : [JV,- —► (J£s-, so that /C,_i C /Cj and
x € <rT. Let fC and C be two simplicial complexes, and tpi agrees with <p,-i on [j Vi_i. When we arrive at
let / : vert K, —► vert £ take the vertices of any simplex K = Km and <p = ipm we show there is a simplicial
in K. to the vertices of a simplex in C. The simplicial homeomorphism between K, and sd T>x ■ The result fol-
map implied by / is g : \J K -»• U A which maps a point
lows because X = |JVm « IJ^ w Usdx>x = IJ^x-
x eaT, T= {v0,...,vk},to g(x) = E*=o^/(üO- We To start the induction, let each T C S correspond
will use the fact that if / is a bijection then g is a home- to a point vT in Re. Let e be large enough and
omorphism. The barycenter of aT is bT = X^=o i+i> choose the points in Re so that any collection of sim-
and the barycentric subdivision of K is plices of dimension up to m spanned by these points
sd£ = {conv{br \TeC}\CeCK}. satisfy the properties of a simplicial complex. Define

289
/Co = {vT | T C S, cardT = m+ 1, f| vT,x ^ 0}- At see why (B2') is sufficient, let 1 < m < 3 and suppose
this stage the homeomorphism ipo : Vo —► /Co defined by X and S satisfy the assumptions in lemma 4.1. Assume
Vo(nW,x) = ^T is just a bijection between two finite also that S satisfies condition (Bl), that is, for every
point sets. K m and every T C S with card T = m + 1 - t,
Suppose 0 < j < m — 1 and Kj and fj : \J Vj —* F = p| VV,X is either empty or a closed f-ball. Note
[J/Cy are constructed. Let i = j + 1 and initialize that
fC{ — K-j. Let T C S with card T = m + 1 — i so
that i*1 = n^T.x 7^ 0 and VT is not yet in /C,. Define G = flVTibdx = b<i^- (J intf|Vt;,x
G = n^T.bdX- We add simplices to /C« that will allow TCUCS
us to extend the homeomorphism so it includes F G V,-.
Specifically, consider all sets U C S, with T C U and is either empty or an (I — l)-manifold contained in an
f)Vu,x 7^ 0- The corresponding simplices au belong to (£— l)-sphere, namely bd F. For £ < 3, the contractibil-
K-j and are contained in <pj (bd F — int G). Add all sim- ity of G ^ 0 implies that G is a closed (£ - l)-ball; so
plices <TUU{VT} to fa- To extend the homeomorphism (B2') implies (B2). For. m = 4, (B2') implies (B2) if the
we distinguish two cases. Assume first that G = 0, and Poincare conjecture for 3-spheres is true, see e.g. [1].
therefore F C int X. Since ^j is a homeomorphism and
F is a closed i-ball, bdF and rjj(bd F) are both (i— 1)-
spheres. It follows that (Jst^T is a closed i-ball, and a
5 General Topological Spaces
homeomorphism <pr : F -» [j st VT that agrees with ipj In this section, we generalize the result for compact
on bdF can be constructed. Now assume G ^ I. By manifolds to more general topological spaces. The re-
lemma 4.2, bd F — int G and therefore ipj (bd F — int G) quirements will automatically exclude spaces that can-
are closed [i — l)-balls. Furthermore, bd G is an (i - 2)- not be expressed as the underlying space of a finite reg-
sphere. Let £ C /C; consist of the simplices <7[/u{„T}, ular CW complex. In order to generalize theorem 4.3,
with cru C 9?j(bdG). U^2 is a closed (i - l)-ball, and we need extensions of the generic intersection and: the
a homeomorphism ip'T : G —► [J £ that agrees with ^;- closed ball properties. Let X C Rd be a topological
on bdG can be established. Now we are in the same space and let S C Rd be a non-degenerate finite point
situation as in the first case, and a homeomorphism set. S has the extended closed ball property for X if
ifT ■ F —>• \J st VT that agrees with ip'T on G and with there is a regular CW complex TZ, with X = (J72., that
<fj on bd F — int G can be constructed. After adding all satisfies the following properties for every T C S with
F = f] VT,X with card T = m + 1 - i in this fashion, we f|VT,x^0:
get <£>,- by combining all <PT using the pasting lemma.
Observe that /C and sdX>x contain a vertex for each (El) there is a regular CW complex TZT C 11 so that
TCS with f]\fT,x # 0, so vertsdPx = {br | vT G ()VT,X = {jnT,
vert/C}. It follows that / : vert/C —> vertsdX>x de-
fined by /(vj) = by is a bijection. By construction (E2) the set TlT = {j £ 11 \ int 7 C intf)VT} contains
of /C, if a collection of vertices belong to a common a unique cell, r]T, so that T)T C 7 for every 7 € 1ZT,
simplex in /C, then their images belong to a common (E3) if T)T is a j-cell then r]T D bdf|VT is a (j - 1)-
simplex in sd£>x- It follows that the simplicial map sphere, and
g : [J/C —» (Jsdl?x implied by / is a homeomorphism.
Therefore, LJ/C « Usd^x = U^x, and the assertion (E4) for each integer k and each fc-cell 7 6 HT - {T]T},
of the theorem follows. PI 7 n bd H VT is a closed (k - l)-ball.

REMARK. AS illustrated in figure 4.1, the Delaunay We call rjT the hub oiKT. Furthermore, S- has:the
simplicial complex restricted by X is related to the com- extended generic intersection property for X if for every
plex obtained from the chains of the regular CW com- T C S and every 7 G HT - HT there is a 6 G HT so
plex defined by the Voronoi cells. Besides being smaller, that 7 C 6.
an advantage of the Delaunay simplicial complex is that It is not difficult to see that if X is a compact manifold
it naturally imbeds in the same space that contains X and S has the generic intersection and the closed ball
and 5. properties for X, then the extended generic intersection
REMARK. For manifolds of dimension 3 or less, condi- and the extended closed ball properties follow. Indeed,
tion (B2) is implied by (Bl) and the weaker requirement the regular CW complex, 11, required by condition (El)
consists of all non-empty sets f)VT;X and f}VTbdX,
(B2') pl^T.bdX is either empty or contractible.
T C S. Fix a subset T C S and define F = {\MT,x
Of course, this is interesting only for manifolds with and G = f] V^bdx- If non-empty, F and G are closed
boundary, for otherwise (B2) and (B2') are void. To balls, and if G ^ 0 then F^i and the dimension of

290
F exceeds the dimension of G by one. There are three The introduction of a general concept typically gives
possible cases. If F = G = 0 then f] VT>x = F = 0 and rise to many specific questions and directions for fur-
conditions (E2) through (E4) are void. If F ^ 0 and ther research. We see three directions of progressively
G = 0 then ftj, = {F}, and T]T — F satisfies conditions more basic work necessary to bring restricted Delaunay
(E2) and (E3); condition (E4) is void. If F ^ 0 and simplicial complexes closer to the targeted application
G^0 then fty = {F,G}, ryr = G satisfies conditions areas. The first is the design of efficient algorithms
(E2) and (E3), and j = F satisfies condition (E4). In that constructs the Delaunay simplicial complex of a
any case, the establishment of the homeomorphism in finite point set, S, restricted by a domain or space,
the proof of theorem 4.3 can be viewed as introducing X. Special cases under different assumptions on how
a vertex VT for T\T and connecting it to the simplices X is specified are considered in [15, 4, 8]. The second
inductively constructed for the cells in TZT — TVy ■ This direction is the design of methods that choose finitely
idea also works in the general case. many points resulting in good quality discretizations of
Let X C Rd be a topological space, and let S C Rd be X. Such methods have a long history in the somewhat
a non-degenerate finite point set that has the extended different context of finite element analysis, see e.g. [21].
generic intersection and the extended closed ball prop- The third direction is the study of maps from a prob-
erties for X. To construct a homeomorphism between lem specific domain to a space, possibly imbedded in
X = (J li. and (J V%, we consider one subset T C S at a higher dimensions, that depends on functional studied
time, in order of non-increasing cardinality. Inductively, over the domain or on approximate solutions thereof.
we assume the cells in TZT - HT are already mapped
homeomorphically to appropriate simplices. We extend
the homeomorphism to the cells of ltT, again induc- References
tively in order of non-decreasing dimension. We intro-
[1] R. H. BING. Some aspects of the topology of 3-
duce a vertex, VT, for the hub, TJT- If f]T is a fc-ball,
manifolds related to the Poincare conjecture. Lectures
its boundary is a (k — l)-sphere, and by (E3) and the
in Modern Mathematics 2 (1964), 93-128.
induction hypothesis, the cells in this (k — l)-sphere are
already part of the homeomorphism. After connecting [2] R. BOTT AND L. W. Tu. Differentiable Forms in Al-
VT to the simplices that correspond to the cells in bd rjT, gebraic Topology. Springer-Verlag, New York, 1982.
we can extend the homeomorphism to ryr ■ Every other
cell in TlT is treated the same way, only that the reason [3] E. BRISSON. Representing geometric structures in d
the homeomorphism can be extended is now a combi- dimensions: topology and order. Discrete Comput.
Geom. 9 (1993), 387-426.
nation of the two induction hypotheses. This implies
the generalization of theorem 4.3 to topological spaces [4] L. P. CHEW. Guaranteed-quality mesh generation for
other than manifolds. curved surfaces. In "Proc. 9th Ann. Sympos. Comput.
Geom., 1993, 274-280.
THEOREM 5.1 Let X C Rd be a topological space, and
let 5 be a non-degenerate finite point set that has [5] G. E. CooKE AND R. L. FiNNEY. Homology of cell
the extended generic intersection property for X. If complexes. Princeton Univ. Press, 1967.
S has the extended closed ball property for X then
U^x^X. [6] B. DELAUNAY. Sur la sphere vide. Izv. Akad. Nauk
SSSR, Otdelenie Matematicheskii i Estestvennyka
Nauk 7 (1934), 793-800.
6 Remarks and Further Work [7] H. EDELSBRUNNER. Algorithms in Combinatorial Ge-
ometry. Springer-Verlag, Heidelberg, Germany, 1987.
This paper is targeted at problems requiring the dis-
cretization of possibly complicated geometric objects in [8] H. EDELSBRUNNER. The union of balls and its dual
finite-dimensional Euclidean spaces. Such problems are shape. In "Proc. 9th Ann. Sympos. Comput. Geom.,
abundant in the computational science literature, see 1993", 218-231.
e.g. Kaufmann and Smarr [12], where the discretization
[9] H. EDELSBRUNNER AND E. P. MüCKE. Simulation of
of continuous domains is common practice. The dimen-
Simplicity: a technique to cope with degenerate cases
sions of the domain and the imbedding space can be
in geometric algorithms. ACM Trans. Comput. Graph-
the same, as e.g. common in fluid dynamics problems, ics 9 (1990), 66-104.
or they can be widely different, as in the study of many
dynamical systems. The restricted Delaunay simplicial [10] V. GUILLEMIN AND A. POLLACK. Differential Topol-
complex introduced in this paper is a general method ogy. Prentice-Hall, Inc., Englewood Cliffs, New Jersey,
that produces simplicial discretizations in all cases. 1974.

291
[11] M. W. HIRSCH. Differential Topology. Springer-Verlag,
New York, 1976.

[12] W. J. KAUFMANN III AND L. L. SMARR. Supercom-


puting and the Transformation of Science. Scientific
American Library, New York, 1993.

[13] J. LERAY. Sur la forme des espaces topologiques et sur


les points fixes des representations. J. Math. Pure Appl.
24 (1945), 95-167.

[14] A. T. LUNDELL AND S. WEINGRAM. The Topology of


CW Complexes. Van Nostrand, New York, 1969.

[15] T. MARTINETZ AND K. SCHULTEN. Competitive Heb-


bian rule forms manifold representing networks. Neural
Networks, to appear.

[16] J. R. MUNKRES. Topology: A First Course. Prentice


Hall,.Englewood Cliffs, New Jersey, 1975.

[17] J. R. MUNKRES. Elements of Algebraic Topology.


Addison-Wesley, Redwood City, California, 1984.

[18] F. P. PREPARATA AND M. I. SHAMOS. Computa-


tional Geometry — an Introduction. Springer-Verlag,
New York, 1985.

[19] J. J. ROTMAN. An Introduction to Algebraic Topology.


Springer-Verlag, New York, 1988.

[20] C. P. RoURKE AND B. J. SANDERSON. Introduction


to Piecewise-Linear Topology. Springer-Verlag, Berlin,
1982.

[21] G. STRANG AND G. J. Fix. An Analysis of the Finite


Element Method. Prentice: Hall, Englewood Cliffs, New
Jersey, 1973.

[22] G. F. VoRONOI. Nouvelles applications des parametres


continus ä la theorie des formes quadratiques. J. Reine
Angew. Math. 133 (1907), 97-178.

[23] W.-T. Wu. On a. theorem of Leray. Chinese Math. 2


(1962), 398-410.

[24] C. K. YAP. Symbolic treatment of geometric degenera-


cies. J. Symbolic Comput. 10 (1990), 349-370.

292
Almost Optimal Set Covers in Finite VC-Dimension
(Preliminary Version)

HERVE BRöNNIMANN* MICHAEL T. GOODRIC^


Department of Computer Science Department of Computer Science
Princeton University Johns Hopkins University
Princeton, NJ 08544, USA Baltimore, MD 21218, USA
E-mail: hbrQcs.princeton.edu E-mail: goodrich@cs.jhu.edu

Abstract geometry literature (e.g., see [5, 9, 10, 11, 12, 13,
14, 15, 18, 23, 24, 33, 35, 34, 40, 36, 38, 39]), and
We give a deterministic polynomial time method they can be used to model a number of interesting
for finding a set cover in a set system (X, 1Z) of computational geometry problems.
VC-dimension d such that the size of our cover is There are a host of iVP-hard problems defined
at most a factor of 0{dlog(dc)) from the optimal on set systems, with one of the chief such problems
size, c. For constant VC-dimension set systems, being that of finding a set cover of minimum size
which are common in computational geometry, our (e.g., see [20, 22]), where a set cover is a subcol-
method gives an O(logc) approximation factor. lection C C 1Z whose union is X and the size of
This improves the previous 6(log|X|) bound of C is simply the number of sets in C. A related
the greedy method and beats recent complexity- (in fact, equivalent) problem is that of finding a
theoretic lower bounds for set covers (which don't hitting set of smallest size, where a hitting set is a
make any assumptions about VC-dimension). We subset HCX such that H has a non-empty inter-
give several applications of our method to compu- section with every set R in TZ. There are a num-
tational geometry, and we show that in some cases, ber of problems that can be reduced to these two
such as those that arise in 3-d polytope approxi- problems, and many of these problems are formu-
mation and 2-d disc covering, we can quickly find lated as computational geometry problems. Thus,
0(c)-sized covers. our interest is in finding minimum set covers and
smallest hitting sets as quickly as possible.
Unfortunately, the corresponding decision
1 Introduction problems, SET COVER and HITTING SET, as we
will call them, are both iVP-complete [22, 28].
A set system (X, U) is a set X along with a collec- Moreover, even if each element of X is contained in
tion PL of subsets of X, which are sometimes called just two sets, the HITTING SET problem is still NP-
ranges [24]. Such entities have also been called hy- complete [28] (and is known as VERTEX-COVER).
pergraphs and range spaces in the computational Thus, unless P = NP, if we desire a polynomial-
time algorithm, we must content ourselves with an
'Supported in part by NSF Grant CCR-90-02352 and approximation algorithm, which, if we let c denote
Ecole Normale Superieure.
f
This research supported by the NSF and DARPA under the size of a minimum set cover, produces a set
Grant CCR-8908092, and by the NSF under Grants IRI- cover of size ac for some (hopefully) small approx-
9116843 and CCR-9300079. imation factor a. The only known polynomial-
time approximations algorithms for SET COVER
Permission to copy without fee all or part of this material is with guaranteed performance ratios are the greedy
arartri providedthat the copies are not made or distributed or
^rect commercial advantage, the ACM copyright not|ce and the algorithm [16, 27, 31], which achieves an approxi-
ttle of the publication and its date appear, and noticeis given mation factor of a = (1 + In A), where A denotes
that copying is by permission of the Association of Computing
KrffirJ! To copy otherwise, or to republish, requires a fee the size of the largest set in R, and an algorithm of
and/or specific permission. Hochbaum [25], which achieves an approximation
10th Computational Geometry 94-6/94 Stony'Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 29ß
factor of a = max;cex{|'^-x|}) where 1ZX denotes We show the utility of our approximation algo-
the set of all R £ 1Z containing x. Note that in the rithm by giving several applications of our method
former case a can be as large as (1 + ln \X\) and in to problems in computational geometry and learn-
the latter a can be as large as \1Z\. Thus, as worst ing theory, including polytope approximation, geo-
case bounds, the greedy algorithm achieves the metric point-probe decision tree construction, and
best approximation factor, and Johnson [27] shows disk cover. Our methods improve the running
there are set systems where the greedy algorithm time and/or the approximation factors of previ-
does indeed produce a set cover with approxima- ous methods. In fact, for 3-d polytope approxima-
tion factor a = Q(\n\X\ + 1). Interestingly, Lund tion and 2-d disc covering we show how to adapt
and Yannakakis [32] have recently shown that, un- our method to achieve a constant approximation
less NP C DTIME[nP°ly lo§ n], no polynomial time factor. We also describe an implementation of our
algorithm can approximate SET COVER within a approach, and show that it indeed beats the greedy
factor better than a = |ln|X| in the worst case, method in practice in some cases.
and, unless NP C DTIME[nlos Io§ n], Bellare et Before we describe our methods, however, let
al. [4] showed that no polynomial time algorithm us first review the relevant properties and defini-
can approximate SET COVER within a factor bet- tions regarding the VC-dimension notion.
ter than a = Sln\X\ in the worst case, for any
constant S < 1/8.
2 Set Systems of Finite VC-
Dimension
Our results. In this paper we give a (determin-
istic) polynomial-time algorithm that finds a set In this section we recall the basic facts about set
cover of size within a factor of a = 0(d\og(dc)) systems of finite VC-dimension. Let (X, 1Z) be a
of the size c of the minimum set cover, where d given set system. Given Y C X, all the subsets of
stands for the VC-exponent of the set system (see Y obtained as the intersection of Y and R ranging
Section 2 for definitions). Thus, for set systems over TZ, form a set system called the system in-
with bounded VC-exponent, we actually beat the duced by KonF, and denoted by TZ\y- Y is shat-
complexity-theoretic lower bounds [4, 32] (which tered by U if 1Z\Y = 2Y. (X, 1Z) is said to have VC-
make no assumptions about the VC-exponent). In dimension d, if d is the smallest integer such that
section 4, we indicate some examples on which no d+1 point subset Y C X can be shattered. If Y
Hochbaum's method [25] or the greedy meth- is finite, it is well known [42, 43] that the number
ods [16, 27, 31] perform poorly, and show that our h
method outperforms them in some cases. of sets of ^|F is less than ('O')H ('d') ^ \Y\d>
Our algorithm, which is actually for the dual where d is the VC-dimension of (V, 1Z). We call the
HITTING SET problem, is based upon a deter- VC-exponent1 the infimum of all numbers s such
ministic analogue of a randomized natural selec- that \1Z\y\ = 0{\Y\S) for any finite subset Y of X.
tion technique used by Clarkson [17, 19], Little- The aforementioned result shows that s < d, but
stone [30], and Welzl [44]. This technique can be equality does not always occur, as there are sys-
viewed as "algorithmic Darwinism," for we itera- tems in which the VC-exponent is non integral [2].
tively select, in polynomial-time, a small-sized sub- However, the VC-dimension is finite if and only
set of X (known in the literature as an e-net [24]) if the VC-exponent is finite as well; s never takes
that intersects all highly-weighted sets in 1Z, and, values in the interval [0,1], and it is 0 if an only if
if this set is not a hitting set, then we increase 1Z is finite [2] (whereas d is 0 if and only if 1Z con-
the weight of the elements in an R G TZ missed sists of one set). In particular, the VC-exponent
by this set. By continuing this process over sev- concept only makes sense for an infinite set sys-
eral "generations" we guarantee that the "fittest" tem, whereas the VC-dimension is more general.
elements, which belong to the optimal hitting set, Consider, for the sake of an example, a common
eventually are included. Fortunately, the number set system arising often in computational geome-
of generational iterations we must perform is at try applications—the halfspace set system. In this
most 0(clog(|V|/c)); hence, this approach yields This value has also gone by the names real density [2]
a (relatively simple) polynomial-time algorithm. and scaffold dimension [23].

294
system X is taken as a set of halfspaces in ~Rd 3 The Main Algorithm
and 1Z is taken to be all combinatorially distinct
The goal of this section is to prove our main the-
ways if intersecting halfspaces in X by a simplex.
orem. Let s be a non decreasing function, let
It is well known (e.g., [2]) that this system has a
n = \X\, and let m = \1Z\.
VC-dimension and a VC-exponent of d.
The dual set system (11, X*) is defined by Definition 3.1 An s-net finder for (X,1Z) is an
X* = {Rx : x G X}, where 1ZX consists of all algorithm A that, given r and a weight distribu-
the sets R G H that contain x. One way to look at tion w on X, returns a (l/r)-net of size s(r) for
dual systems is to consider (X, 11) as a (possibly (X,1Z) with weights w. Also, a verifier is an algo-
infinite) boolean matrix M that has a column for rithm B that, given a subset H C X, either states
each x G X and each row corresponds to an inci- (correctly) that H is a hitting set, or returns a
dence relation for a set R G 11, and view the dual nonempty Re H such that R D H = 0.
as a transpose of this matrix. It is also well known
(e.g., see Assouad [2]) that the VC-dimension d* Using size(x) to denote the length of the en-
of the dual (11, X*) is less than 2d+l, where d is coding of an object x, let us say that A runs in
the VC-dimension of the primal (X,1l). TA(size(X,1Z),size(w),r) time3 and that B runs
Let (X, 11) be a set system. If a subset N CX in Ts(size(A,^),size(H)) time. We will suppose
intersects each set R G U of size bigger than e\X\, that both TA and TB are (non constant) polynomi-
then we call N an e-net [24]. As has been observed als, so that T(0(x)) = 0(T(x)) and £fc<xT(2fc) =
by Haussler and Welzl [24], set systems of VC- 0(T(2X)).
dimension d admit (l/r)-nets of size 0(dr log(dr)).
Theorem 3.2 Let (X,1Z) be a set system that
This bound has been improved by Blumer et al. [7]
to 0(dr log r) and this has been proved tight by admits both an s-net finder A and a veri-
Komlös et al. [29]. We can generalize this defini- fier B. Then there is an algorithm A(A,B)
tion by putting an additive2 weight function w on that computes a hitting set of size at most
2X. In this formulation, an e-net is required to s(4c), where c stands for the size of an op-
intersect every set of weight at least ew(X). To timal hitting set. The time taken by A is
0(clog(n/c) (TA(nm,nlog(n/c),c) +TB(nm,c)).
allow for efficient computation, we need that the
set system be described somewhat more efficiently If X has finite VC-dimension, then we may im-
than by the list of its subsets. plement the net finder using the greedy method
[13], and the verifier by inspecting all of (X,1Z),
Definition 2.1 We say that a set system (X,1Z) both in polynomial time (in either the real RAM
has a subsystem oracle of degree D if there is an or bit models). But under standard computational
algorithm which, given a subset Y C X, returns assumptions, there are better implementations of
(Y,H\Y) (as a boolean matrix) in time 0(\Y\D+1). the net finder and verifier.
It is a witnessed oracle if, for any set R of1Z\Y, it Corollary 3.3 Let (X,1l) be a set system given
can provide a set R' of 11 such that R = R'nY in by a witnessed subsystem oracle of degree D,
0(\X\) time. which admits a hitting set of size c. Let d
stand for the VC-exponent of (X,1l), and as-
If (X,1Z) has a subsystem oracle of degree D, sume 0 £ 11. Then one can find a hitting
and VC-exponent d, it is clear that d < D. Un- throughout the literature in computational geometry,
der this assumption, it has also been shown [9] the unit-cost (or real RAM) model is usually assumed. In
that one can find a (l/r)-net for (X,1Z) of size this case, size(ui) is simply n. However, due to to the partic-
0(dr\og(dr)) in time 0(dfDrD \ogD(rd)\X\, for ular relevance of our algorithm in the realm of ATP-hardness,
and since the weights can (and will) become exponential in
both the uniform and weighted cases. the forthcoming algorithm, we have to be careful that the
algorithm still runs in polynomial time in the bit model.
2
The term additive refers to the fact that w(Y) - As it turns out, our running time is the same in both mod-
V) w(y), with the usual abuse of notation w(y) = els, but the choice of the encoding and the value of TA are
different.
w({y})-

295
set for (X,n) of size 0(dc\og(dc)) in T(\X\) = Our strategy can be thought of in terms of evo-
o(c2D+l\ogD{dc)\og{\X\lc)\X\) time m the real lutionary biology, in that it is based upon a notion
RAM model, or O (cT(\X\) log(|X|/c)) time in the of "survival of the fittest." Intuitively, we want to
bit model. simulate the growth of a population where some el-
ements are advantaged because they hit more sets
Proof: It suffices to show how to implement the than others. The idea is to put weights on the el-
net finder and the verifier and show their complex- ements (initially uniformly) and use the net finder
ity bound. But one can find a (l/r)-net for (X, 1Z) A to select a (l/2c)-net of size s(2c). If it doesn't
of size O(drlog{dr)) in 0(d)3Dr2D logD(rd)\X\ hit a particular set R GTZ, as returned by the ver-
time, for both the uniform and weighted cases, us- ifier B on the net, we double the weights of the
ing the algorithm of Brönnimann, Chazelle, and points in R. Because of the definition of a hit-
Matousek [9], in the real RAM model. In the bit ting set, at least one point in an optimal hitting
set falls in R, and has its weight doubled. How-
model, the complexity of the weights would have
to be taken into account, which may add at most ever, the property of a (l/2c)-net implies that the
an 0(clog(|X|/c)) factor to the running time, as weight of R is at most a fraction l/2c of the total
proven in the next section. As for the verifier, one weight, and the total weight does not increase too
simply runs the witnessed subsystem oracle for H. much. Therefore, we soon expect an optimal hit-
If the oracle fails to list 0 as being in 1Z\H, we may ting set to be included in the chosen set. The next
conclude that H is a hitting set. Otherwise, we lemma shows that this is indeed the case.
ask for a witness R of the fact that 0 G TI\H- Thus
RCiH = 0, and R is nonempty as 0 0 1Z. The time Lemma 3.4 // there is a hitting set of size c,
spent by the verifier is 0(\H\D+1 + \X\). Plugging the doubling process cannot iterate more than
these bounds into Theorem 3.2 yields the corollary. 4clog(n/c) times, and the total weight will not ex-
D ceed n4/c3.

Proof: Our proof follows arguments of Clark-


son [17, 19], Littlestone [30], and Welzl [44]. Let
Remarks. (1) If we change the definition of the H be a hitting set of size c. Because the set R
VC-exponent to fit better the VC-dimension con- returned by B at each iteration satisfies w(R) <
cept, by requiring that for all finite Y C X we w(X)/2c, the weight of X is not multiplied by
have |% | = °(('ol) +"■ + ('?)) which is also more than a factor 1 + l/2c in any iteration. How-
0(\Y\/d + l)d, then we can reduce the size of the ever, Hf]R is not empty, by definition oiH. There-
hitting set to O (dc log c) [14]. fore, after k iterations, if each h G H has been
(2) For a particular c, the algorithm will either doubled Zh times, we have
say that there is no hitting set of size c, or it will
1 i, k
output a hitting set of size O (dc log {dc)), which, w(X) < n(l + — )fc < ne^, and
2c
of course, is different than saying that there is a
hitting set of size c. w [H) = Y,rh> where
J2zh>k-
(3) The corollary can be stated with d as the hen hen
dual VC-exponent, with an oracle for the dual Using the convexity of the exponential function, we
set system, and as yielding a set cover of size conclude that w{H) > c2klc. Since w(H) < w(X),
0{dclog(dc)). we finally have
k k_ 3fc
We now turn to the proof of Theorem 3.2. c2<= < n e2c < n2-sc;

3.1 The algorithm from which k < 4clog(^) follows. The bound of
n4/c3 on w(X) is an immediate consequence. D
Let us assume, for the time being, that we know
the size c of a smallest hitting set (we will show If the process exceeds this guaranteed number
later why this is a reasonable assumption). of iterations, that only means that there is no cover

296
of size c. Thus, we can use this procedure to ac- 4 Lower bounds for other meth-
tually determine an approximate bound for c. To ods
start with, we conjecture a value d of c, which ini-
tially can be set to 1. In general, if our routine In this section we give some specific cases where
fails to find a hitting set, there is no hitting set of our method improves the previous methods. We
size c', so we increase d by a factor of two. At the begin with the greedy method.
stage when we find a hitting set, d < 2c, so that
the hitting set returned is of size at most s(4c). 4.1 The greedy method
The following example has been communicated to
us by Jif l Matousek (private communication). Let
3.2 e-nets with or without weights? 5 = {pitj : i = l,2,j = l... 2P+1 - 1} be a set
of n = 2P+2 - 2 distinct points, and let its valid
Typically, e-net algorithms are designed for the subsets be Sj = {pi,k ■ i = 1,2, k = 2'... V+l -
uniform case not for the weighted case. Here 1}, for i G {1,2}, j G {0...p}, as well as the two
we mention a simple method for reducing the particular sets T; = faj : j = l... 2P+1 - 1} (see
weighted case to an unweighted one, as outlined by Figure 1). The greedy method will pick the cover
Matousek [35]. First scale the weights such that (Sj)j=i...p, which is of size p = log(n + 2) - 2. The
w(X) = n. Then take [w(x) + lj copies of each optimal cover is (Ti)i=i)2 and is of size 2. The dual
element x € X. Note that the multiset X' thus VC-dimension of our example is 2, as every point
obtained contains all the elements of X and has a is covered by exactly 2 subsets, and our algorithm
cardinal of at most 2n. Take then an e-net for the (in a dual setting to obtain a set cover) will pick
set X': it is also an e-net for the original set X the optimal cover for a value of c = 2.
with weights w.
So Si S2 S3
T2f[7^
3.3 Time analysis TiU \^

Figure 1: A greedy method's worst case that has


For a given c', it is clear that there can be at most
finite VC-dimension.
4c'log(n/c') iterations, each of which takes time
O (TA{size{X,1l),size(w),d) + TB(size{X,n),d)).
But the total weight can never exceed n4/c3, which
4.2 Hochbaum's method
proves that size(w) = 0(nlog(n/c'))- When d in-
creases geometrically, by our choice of polynomial In Hochbaum's method, one denotes the set sys-
functions for TA and TB, the sum of all running tem of m sets over n elements as a 0-1 (n,m)-
times is dominated by their last term, for which matrix A each column Aj of which is the inci-
c < d < 2c. Finally, a standard encoding of dence vector of one of the sets. The algorithm
(X,1l) gives that s\ze{X,1l) = 0(nm), conclud- then solves the linear program maxe^.y subject
ing the proof of Theorem 3.2. to yT.A < em,y > (0, ...,0), where ek is a A;-
Note that in real RAM model, the size of the vector whose components are all 1. Let J denote
weights is irrelevant, and one simply accounts for the sets of tight constraints at the optimum y*
the number of arithmetic operations and not their (in mathematical notation, j G J if and only if
complexity. As argued in Section 6, the weights (y*)T.Aj = 1). Then J is a set cover within /
almost never go past a few digits in practice, so times the optimum, where / is the maximum row
such an assumption is not unrealistic. In any sum of A.
case, since our weights are always multiples of Take k to be any constant. Let us put n = (™)
2, we can encode each weight using a register of and take for A the (n, m)-matrix whose rows are
0(log n) bits and we can use such registers to per- made up of all possible vectors with m — kVs and k
form any weight arithmetic in 0(c log(n/c)) time 0's (in no particular order). The corresponding set
(by Lemma 3.4). system has n elements and m sets. By symmetry,

297
the method will pick all the sets in the cover, which for small-dimensional linear programming to give
gives a cover of size m, guaranteed within m-k off a polynomial-time randomized method that pro-
the optimum. Any k + l elements will constitute duces an approximation within 0(d2 log (de)) of
an optimal cover. the optimal c. In fact, the algorithm of this paper
This example has both dual VC-exponent and is a deterministic analogue of Clarkson's method in
dual VC-dimension k, so our algorithm will return our more general framework4. Interestingly, how-
a cover of size 0(k2 log k). ever, for the important case of d = 3, we are able
to improve on Clarkson's result to achieve an ap-
Remark. Interestingly enough, the bad example proximation factor that is 0(1).
for the greedy (resp. Hochbaum's) method can be But let us first describe our method for gen-
solved efficiently with our as well as Hochbaum's eral d > 4. We need to exhibit an appropriate net
(resp. the greedy) method. We don't know of an finder and a verifier. Note that since P contains
example for which our method would outperform Q, 0 is not in the cover set system. The basic
both of them. observation is that the cover set system is a sub-
system of the halfspace set system, and therefore
has VC-dimension and VC-exponent d (since d + l
5 Applications hyperplanes define at most 2d+l - 1 regions of the
space, and the complexity of an arrangement of m
In this section, we cover mainly computational ge-
halfspaces is 0{md)). Therefore our hope is to find
ometry applications, therefore it is customary to
an s-net finder, where s(x) = 0(dxlog(dx)).
assume the real RAM model where all the integers
To find a (l/r)-net for the weighted cover
and their elementary arithmetic operations have
set system, we simply use the algorithm of
unit complexity.
Brönnimann et al. [9], which computes a weighted
(l/r)-net in 0(nrd\ogd(dr)) time, using the reduc-
5.1 Separating polyhedra tion of Section 3.2 to take care of the weighted
case. This provides a (l/r)-net for the more gen-
Let QCPbe two convex polytopes in Md. The
problem of finding a separator polytope between eral set system consisting of all halfspaces, but this
P and Q with as few facets as possible is believed is a fortiori a (l/r)-net for the cover set system,
and the bound on its size is still O(dr log(dr)).
to be TVP-hard, even in the three-dimensional
case [21], but one can find good approximations As for the verifier, let Yn denote the canonical
for it. In [41] Mitchell and Suri cast the problem polytope with k faces associated with the hyper-
as a hitting set problem. Let H = U{Q) denote planes of some Y C % of size k. In particular,
the set of supporting hyperplanes of Q. Let the %(Q)n = Q- All we are asking for is whether Yn
cover set system be (Ti, {Uv : p <E dP}), where, for is entirely contained in P, or else to give a point
any point p, %p consists of those hyperplanes in of dP which is in Yn. We can simply compute
H for which p and Q lie on opposite sides. (For the intersection of all the halfspaces defined by the
definiteness, we agree that if p is on h, then h planes YWH(P) and test whether there is a facet
is not in Hp.) They show that a hitting set for that belongs to P. If so, we can return T-Lp where
the cover set system gives a subset of facets of Q p is, e.g., the centroid of this face. Otherwise, Yn
is certainly contained in P.
whose bounding halfspaces define a polytope be-
tween Q and P. A polytope Q' between Q and We can find a (l/r)-net in O (rd\ogd{dr)\Q\\
P such that each facet of Q' contains a facet of time and verify k halfspaces in 0(k + \P\)^^
Q is called canonical. The smallest (with respect time (d > 4) or in 0((k + \P\) log(k + |P|j) time
to the number of facets) canonical polytope con- (d = 2,3). Plugging those bounds into our main
tained in P can be obtained from a minimal hit- theorem, we get that
ting set of this set system and is within d times
the optimal separating polyhedron (in number of Theorem 5.1 Let Q C P be two convex nested
faces). Therefore the greedy strategy returns a polytopes in Hd (d > 4) with a total of n facets.
polyhedron within 0(d2 log |Q|) of the optimal. In Clarkson's exposition is restricted to polytopal
a recent twist, Clarkson [19] applies ideas he used problems.

298
It is possible to find a separator of size within the next result shows that we can get better per-
0(d2logc) of the optimum c, in a deterministic formance ratio in the height of a decision tree for
non-degenerate (i.e., general position) inputs. We
time of o(n& + cdnlogd(dc)) clog(n/c), which
define the point set system of a family S of plane
is always O (nd+2 \ogd n). objects by all subsets Sp of S for all points p, where
Sp consists of all objects in S containing p.
Note that the case where c = fi(n£) is of lit-
tle interest, because, in this instance, our algo- Lemma 5.3 Let P be a polygon in the plane, S be
rithm offers no better a performance ratio than a family of congruent copies of P, and let (S,1Z)
the greedy method (at least asymptotically). Thus be the point set system of S. Then (S,1Z) has VC-
we could make the algorithm faster (for the same exponent at most 2 (the constant 2 cannot be im-
guaranteed ratio) by switching to the greedy proved in general), and admits a witnessed subsys-
method when c becomes too large. tem oracle of degree 2. The exponent is still 2 if P
But in three dimensions, we can actually do convex.
much better. In particular, we recall from [38, 37]
Proof: Clearly, the number of sets of (5,U) is
that the three dimensional halfspace set system
at most the number of cells is the arrangement
admits e-nets of size 0(l/e), and as indicated in
of 5. If all m polygons in S have k vertices each,
Section 3.2, their algorithm can be extended to
their arrangement has complexity 0(k2m2), which
the weighted case as well. The cost of the com-
corresponds to the complexity of the arrangement
putation of a (l/c)-net of size 0(c) is 0{nc), if
of their supporting lines. The complexity drops
c<na [37], and the cost of verifying is 0(n log n)
to 0(km2) if the polygons are convex, which pro-
as argued above. Therefore we obtain the follow-
vides somewhat better constants for the shatter
ing strengthening of our previous theorem:
function. However, it is easy to come up with ex-
amples for which those bounds are tight and also
Theorem 5.2 Let Q C P be two nested polyhedra
reflect the number of different subsets in the point
in M3 with a total of n facets, one of them being
set cover. This also provides the construction of
convex. It is possible to deterministically find a
the witnessed oracle: The oracle constructs the
separator of size within O(l) from the size c of
an optimum separator in 0(nc(c + log n) log(n/c)) arrangement and simply picks a point in each of
the cells. If asked to provide a witness, the point is
time, if c < na for some a > 0.
tested against all the polygons, in 0(m log k) time.
In particular, it should be noted that the run- (Here, we treat k as a constant, and we are only
ning time is always 0{n1+2a logn), which improves interested the number of elements of 5.) □
on the 0(n4) time bound of Mitchell and Suri's
method [41] for the general case. However, for
Remark. Clearly, the VC-dimension depends on
large c > na, we have to switch to a 0(n3) method
to find the net [38], yielding 0(cn3log(n/c)) time. the number of sides of P. If 5 consists of congruent
Note that this is still 0(n4), whereas the time copies of a single convex set, even a convex poly-
consumed by the greedy method is strictly 0(nA) gon with infinitely many sides, then its point set
system (S,1l) need not have finite VC-exponent
(though Mitchell and Suri reduce it to 0(n3) when
both polyhedra are convex.) (resp. VC-dimension).

Our algorithm, combined with the above ob-


5.2 Decision Trees servation, and the result of Arkin et al. [1] gives
In [1], Arkin et al. describe how to construct us a decision tree of smaller asymptotic depth than
a point-probe decision tree for a set of non- the greedy method for the non-degenerate arrange-
degenerate polygons in the plane whose height is ment of Arkin et al.5 Moreover, our method can
also be used to derive point-probe decision trees
s _ i + [log(Jfc/(s - 1))1, when given a hitting
set of size s. For some applications, the result 5
For degenerate arrangements they design a new greedy
serves to decide the position of a polygon in a strategy, which seems not to be describable as a set cover
scene [1]. While their approach is more general, strategy.

299
of improved depth for any set of general-position It has been proved by Blum and Rivest [6] that
/c-gons in the plane, for constant k, since this point this problem admits no proper learning algorithm
set system also has bounded VC-dimension (as the (for which the hypothesis also consists of 5 halfs-
proof above shows as well). paces) whose running time is polynomial in d, s,
e~\ 6~l, even if s = 2 (unless P = NP). How-
5.3 Disc cover ever, Baum [3] argues that this only shows that we
should look for hypotheses with more halfspaces.
Let 5 be a set of n points in the plane and let V Indeed, Blumer et al. [7] and Baum [3] have pro-
be a family of discs. The disc cover problem is to posed algorithms that output a hypothesis of size
find a minimum number of discs in V that cover 0(slogm). These algorithms are polynomial in
the points in S [26]. This problem is motivated fixed dimension (however, the dependence in the
by VLSI design criteria as well as viewing prob- dimension is exponential). Unfortunately, with the
lems in astronomy. Matousek et al. [38] show that purpose of training a neural net in mind, we see
this set system admits 0(r) sized (l/r)-net and, that each halfspace of the hypothesis corresponds
as indicated in Section 3.2, one can extend their to a gate of the neural net, and therefore the size
algorithm to weighted point sets. The resulting al- of the neural net increases with precision.
gorithm runs in 0(rn log n) time, and implies the The algorithm of Blumer et al. proceeds by
following:
first labeling the examples, then forming a set sys-
tem of the halfspaces containing only positive ex-
Theorem 5.4 Let S be a set of points in the amples, and finally returning a small set of halfs-
plane, and V be a set of discs whose union con- paces covering all the positive examples. For this
tains S. It is possible to find a disc cover of S
last step we can use our method: The hypothesis is
from V (a subset of V whose union still contains guaranteed to have size 0(ds log(ds)), independent
P) whose size is no more than O(l) times the opti- of the number of examples. Moreover, we can im-
mal size c of such a cover in 0(c2n log nlog(n/c))
prove on the results in two and three dimensions.
time. This proves
Note that our method never takes more than
Theorem 5.5 For any fixed d > 1, given s halfs-
0(n3 log n) time. This bound contrasts the bound
paces H in Wld, and any distribution on points in
of Hochbaum and Maas [26] for finding a constant-
Hd, there exists a neural net of size 0(dslog(ds))
factor approximation to a disc cover, as their
which can be trained, in time polynomial in s, e, 5
method requires all the discs in V to have the same
and with confidence 1-5, to recognize whether a
radius and, even when all the parameters in their
point belongs to the union of H with a probability
method are optimized for the running time, their
of error less than e. The size of the neural net can
method takes 0(n5) time.
be brought down to O(s) if d = 2,3.

5.4 Learning a Union of Halfspaces in The result, of course, is also valid for learning
Fixed Dimension the union of concepts taken from a concept class
that has finite VC-dimension.
Let if be a set of s halfspaces in FLd, and write
H+ for their union, and H~ for its complement.
Let D be an (unknown) probabilistic distribution 6 Experimental Results
on H . A learning algorithm A for H+, given m
examples drawn from D, outputs a hypothesis G Our algorithm has been implemented and the re-
such that, with confidence 1 - 6 (on the examples sults will be described in [8]. There are many pos-
fed to the algorithm), G verifies D(H+ A G+) < e. sible choices for implementation, as we have many
(A denotes the symmetric difference.) An example ways to compute an e-net in practice, and they
is labeled positive if it falls in H+, negative other- result in different performances.
wise. This ensures that, for subsequent examples, The first consists in choosing a random sample
the label as computed with G will be correct (ac- of size 0(dclog c). It turns out that this performs
cording to H) with probability at least 1 — e. badly against the greedy method, as the values of n

300
we consider are never big enough to justify the use hitting sets, and for which the set systems have
of our method with the random sampling against bounded VC-dimension.
the greedy method. Our algorithm has been implemented, and the
The second possible choice is to use a com- practical results are encouraging.
puted e-net, with the algorithm of Chazelle and The main open question pertaining to this re-
Matousek [14], and this seems to yield results com- search is whether our algorithm can be made to
parable to the greedy method. run in parallel in polylogarithmic time and polyno-
The third method of choice is to compute the mial number of processors. It seems that the main
net using the greedy method [13]. Even though problem lies in the iteration process: if we are to
this does not guarantee the same performance as double the weights of many sets at once, we are
the second choice, it performs well in practice, and unable to enforce that the weights of many points
never returns anything bigger than that returned in an optimal hitting set double at each stage.
by the greedy set cover method. Moreover, the An e-net is a hitting set for the heavy subsets.
lower bound as returned by our method is sub- The algorithm can be thus adapted to find an al-
stantially higher than that returned by the greedy most minimum sized e-net. A related problem that
method. Therefore, if it doesn't produce better would be of great practical interest is to find a sim-
hitting sets, at least it is able to give better lower ilar algorithm for e-approximations. It is not even
bounds in practice. known if finding a minimum sized approximation
For our three choices, the fear that weights is iVP-complete, much less if there is any algorithm
might increase exponentially and therefore require that returns an almost optimal e-approximation.
a multi-precision treatment is completely dispelled The greedy method is shown to attain an
by empirical observation. In the largest example 0(log n) approximation ratio in the polytope sepa-
we tried (of size about 10002), after some 700 iter- ration, but it might be possible to use the geometry
ations, the maximum weight was a bare 16384—as to show that it in fact yields a constant ratio. Such
opposed to a possible 2700. This strongly suggests a claim has neither been proved nor disproved.
that the normal precision (of 32 bits) will suffice Finally, in the decision tree problem, we were
in all reasonable instances of the problem. This is unable to find a strategy that would work for de-
due, of course, to the fact that only small weights generate arrangements. Is such an adaptation pos-
tend to be doubled through the algorithm. sible?
One last issue concerns the generation of "ran-
dom" set systems of finite VC-dimension. As this Acknowledgements
is a hard problem, we simply generated random set We would like to thank Dan Boneh, Bernard Chazelle,
systems in such a way that the generation process S. Rao Kosaraju, Jiff Matousek, Joseph Mitchell, and Neal
Young for helpful discussions concerning the topics of this
itself guaranteed the finite (parameterizable) VC- paper.
dimension. We also tested the method on more
natural set systems such as the cover set systems
of two polyhedra.
References
[1] E. M. Arkin, H. Meijer, J. S. B. Mitchell, D. Rappa-
port, and S. S. Skiena. Decision trees for geometric
7 Conclusions models. In Proc. 9th Annu. ACM Sympos. Comput.
Geom., pages 369-378, 1993.
We have shown an approximation algorithm for [2] P. Assouad. Densite et dimension. Ann. Institut
Fourier, Grenoble, 3:232-282, 1983.
the hitting set and set cover problems, and proved
[3] E. Baum. On learning the union of halfspaces. J.
that it performs well if the VC-dimension of the Compl., 6:67-101, 1990.
set system is bounded. Furthermore, our algo- [4] M. Bellare, S. Goldwasser, C. Lund, and A. Rüssel.
rithm "defeats" known complexity-theoretic lower Efficient probabilistically checkable proofs and appli-
bounds [4, 32] (which make no assumptions about cations to approximation. In Proc. 25th Annu. Symp.
Theory Comput, pages 294-304, 1993.
the VC-exponent), by being adaptive: the com-
[5] B. Berger, J. Rompel, and P. W. Shor. Efficient NC al-
petitive ratio depends on the size of the optimal gorithms for set cover with applications to learning and
solution. We have exhibited a variety of compu- geometry. In Proc. 30th Annu. IEEE Sympos. Found.
tational geometry problems that reduce to or use Comput. Sei., pages 54-59, 1989.

301
[6] A. Blum and R. Rivest. Training a 3-node neural net- [25] D. Hochbaum. Approximation algorithms for the set
work is np-complete. In Proc. 1st Workshop Comput. covering and vertex cover problems. SIAMJ. Comput.,
Learning Th., pages 9-18, 1988. ll(3):555-556, 1982.
[7] A. Blumer, A. Ehrenfeucht, D. Haussler, and M. War- [26] D. S. Hochbaum and W. Maas. Approximation
muth. Classifying learnable geometric concepts with schemes for covering and packing problems in image
the Vapnik-Chervonenkis dimension. J. ACM, 36:929- processing and vlsi. J. ACM, 32:130-136, 1985.
965, 1989.
[27] D. S. Johnson. Approximation algorithms for combi-
[8] H. Brönnimann. An implementation of MIN HITTING natorial problems. J. Comput. Syst. Sa., 9:256-278,
SET heuristics. Manuscript, 1994. 1974.
[9] Herve Brönnimann, Bernard Chazelle, and Jiff Ma- [28] R. M. Karp. Reducibility among combinatorial prob-
tousek. Product range spaces, sensitive sampling, and lems. In R. E. Miller and J. W. Thatcher, editors,
derandomization. In Proc. 34th Annu. IEEE Sympos. Complexity of Computer Computations, pages 85-103.
Found. Comput. Sei. (FOCS 93), pages 400-409, 1993. Plenum Press, New York, 1972.
[10] B. Chazelle. An optimal convex hull algorithm and [29] J. Komlös, J. Pach, and G. Woeginger. Almost tight
new results on cuttings. In Proc. 32nd Annu. IEEE bounds for e-nets. Discrete Comput. Geom., 7:163-173
Sympos. Found. Comput. Sei., pages 29-38, 1991. 1992.
[11] B. Chazelle. Cutting hyperplanes for divide-and- [30] N. Littlestone. Learning quickly when irrelevant at-
conquer. Discrete Comput. Geom., 9(2):145-158, 1993. tributes abound: A new linear-threshold algorithms.
In Proc. 28th IEEE Sympos. Found, of Comput. Sei.,
[12] B. Chazelle, H. Edelsbrunner, M. Grigni, L. Guibas, pages 68-77, 1987.
and M. Sharir. Improved bounds on weak e-nets for
convex sets. In Proc. 25th Annu. ACM Sympos. Theory [31] L. Loväsz. On the ratio of optimal integral and frac-
Comput. (STOC 93), pages 495-504, 1993. tional covers. Discrete Math., 13:383-390, 1975.
[32] C. Lund and M. Yannakakis. On the hardness of
[13] B. Chazelle and J. Friedman. A deterministic view of
approximating minimization problems. In Proc. 25th
random sampling and its use in geometry. Combma-
torica, 10(3):229-249, 1990. Annu. Symp. Theory Comput., pages 286-293, 1993.
[33] J. Matousek. Construction of e-nets. Discrete Comput.
[14] B. Chazelle and J. Matousek. On linear-time deter- Geom., 5:427-448, 1990.
ministic algorithms for optimization problems in fixed
dimension. In Proc. 4th ACM-SIAM Sympos. Discrete [34] J. Matousek. Approximations and optimal geometric
Algorithms, pages 281-290, 1993. divide-and-conquer. In Proc. 23rd Annu. ACM Sym-
pos. Theory Comput., pages 505-511, 1991. Also to
[15] B. Chazelle and E. Welzl. Quasi-optimal range search- appear in I. Comput. Syst. Sei.
ing in spaces of finite VC-dimension. Discrete Comput.
Geom., 4:467-489, 1989. [35] J. Matousek. Cutting hyperplane arrangements. Dis-
crete Comput. Geom., 6:385-406, 1991.
[16] V. Chvatal. A greedy heuristic for the set-covering
[36] J. Matousek. Range searching with efficient hierarchi-
problem. Math. Oper. Res., 4:233-235, 1979.
cal cuttings. In Proc. 8th Annu. ACM Sympos. Com-
[17] K. L. Clarkson. A Las Vegas algorithm for linear pro- put. Geom., pages 276-285, 1992.
gramming when the dimension is small. In Proc. 29th [37] J. Matousek. Reporting points in halfspaces. Comput.
Annu. IEEE Sympos. Found. Comput. Sei., pages 452- Geom. Theory Appi, 2(3):169-186, 1992.
456, 1988.
[38] J. Matousek, R. Seidel, and E. Welzl. How to net a
[18] K. L. Clarkson and P. W. Shor. Applications of ran- lot with little: small e-nets for disks and halfspaces. In
dom sampling in computational geometry, II. Discrete Proc. 6th Annu. ACM Sympos. Comput. Geom., pages
Comput. Geom., 4:387-421, 1989. 16-22, 1990.
[19] Kenneth L. Clarkson. Algorithms for polytope covering [39] J. Matousek, E. Welzl, and L. Wernisch. Discrepancy
and approximation. In Proc. 3rd Workshop Algorithms and e-approximations for bounded VC-dimension. In
Data Struct., volume 709 of Lecture Notes in Computer Proc. 32nd Annu. IEEE Sympos. Found. Comput. Sei.,
Science, pages 246-252, 1993. pages 424-430, 1991.
[20] T. H. Cormen, C. E. Leiserson, and R. L. Rivest. In- [40] J. Matousek. Efficient partition trees. Discrete Com-
troduction to Algorithms. The MIT Press, Cambridge, put. Geom., 8:315-334, 1992.
Mass., 1990. [41] J. S. B. Mitchell and S. Suri. Separation and approx-
[21] G. Das. Approximation schemes in computational ge- imation of polyhedral surfaces. In Proc. 3rd ACM-
ometry. Ph.D. thesis, University of Wisconsin, 1990. SIAM Sympos. Discrete Algorithms, pages 296-306,
1992.
[22] M. R. Garey and D. S. Johnson. Computers
and Intractability: A Guide to the Theory of NP- [42] N. Sauer. On the densities of families of sets. Journal
Completeness. W. H. Freeman, New York, NY, 1979. of Combinatorial Theory, 13:145-147, 1972.
[23] M. T. Goodrich. Geometric partitioning made easier, [43] V. N. Vapnik and A. Y. Chervonenkis. On the uniform
even in parallel. In Proc. 9th Annu. ACM Sympos. convergence of relative frequencies of events to their
Comput. Geom., pages 73-82, 1993. probabilities. Theory Probab. Appi, 16:264-280, 1971.
[24] D. Haussler and E. Welzl. Epsilon-nets and simplex [44] E. Welzl. Partition trees for triangle counting and other
range queries. Discrete Comput. Geom., 2:127-151, range searching problems. In Proc. 4th Annu. ACM
1987. Sympos. Comput. Geom., pages 23-33, 1988.

302
An Efficient Algorithm for the Euclidean Two-Center Problem

Jerzy W. Jaromczyk* Miroslaw Kowalukf

Abstract 1 Introduction
We study the following geometric optimization
problem (the "two-center problem"): "Given a
We present a new algorithm for the two-center
set S of n points in the real plane, find two closed
problem: "Given a set S of n points in the real
discs whose union contains all of the points and
plane, find two closed discs whose union contains
the radius of the larger disc is minimized." The
all of the points and the radius of the larger disc
distance is measured with the Euclidean metric.
is minimized." An almost quadratic 0(n2 logn)
This is an instance of a well-known fc-center
solution is given. The previously best known al-
gorithms for the two-center problem have time problem, where the objective is to find k clo-
complexity 0(n2log3n). The solution is based sed discs minimizing the maximum radius. The
on a new geometric characterization of the op- problem stems from practice. For example, we
timal discs and on a searching scheme with so- want to place k emergency units so the worst-
called lazy evaluation. The algorithm is sim- case response time to each of n given sites will be
ple and does not assume general position of the minimized. The problem, specifically for k = 1,
input points. The importance of the problem is known under various names: minimum span-
is known in various practical applications inclu- ning circle, minimax location problem, minimax
ding transportation, station placement, and fa- detection station problem, Euclidean messenger
boy problem (see [Fl, F2, HM]). These names
cility location.
tell more about potential applications.
In addition to having a practical flavor the
problem is known for its stimulating impact on
inventing new algorithmic techniques. Since the
* Department of Computer Science, University of Kentucky, Le-
problem was posed by Sylvester in 1857 [S] se-
xington, KY 40506
tInstitute of Informatics, Warsaw University, Warsaw, Poland veral algorithms for k = 1 have been presen-
ted. Recent computationally-efficient solutions
Permission to copy without fee all or part of this material is include an O(nlogn) time algorithm based on
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the the farthest Voronoi diagram (see Shamos and
title of the publication and its date appear, and notice is given Hoey [SH]). An optimal 0{n) algorithm based
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee on a powerful, and beautiful, prune-and-search
and/or specific permission.
strategy was given by Megiddo [M]. The pro-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA blem becomes NP-complete when the parame-
© 1994 ACM 0-89791-648-4/94/0006..$3.50
303
ter A; is a part of the input. Therefore it is in- the plane is endowed with a standard ortho-
teresting, and again important in view of prac- gonal coordinate system. Consider a set of 12
tical applications, to look at fixed values of k. unit length vectors that form with the axis OX
Specifically, for k = 2 the problem was studied an angle 0 ... 11. Specifically, u8- =
by Drezner [D] in the context of efficient trans- [cos((z7r)/6),sin((?'7r)/6)]. With each point p in
portation. He gave an 0(n3) time complexity S we associate the set of 12 cones determined
algorithm. Agarwal and Shamir [AS] provided by the pairs of orthogonal vectors from this set
the first algorithm with the cost close to qua- of vectors. Each cone has its apex at p. Intui-
dratic. Specifically, their methods based on in- tively, we can think about this cone as the first
teresting modifications and additions to the Me- quadrant (with the bounding half- lines) of the
giddo's parametric search technique resulted in coordinate system centered at p and determined
a 0(n2 log3 n) algorithm. An essential part of by vectors [0,1], [1,0]. All the other cones asso-
the algorithm is a decision procedure by Hersh- ciated with p can be obtained by consecutive
berger and Suri [HS]. This procedure, given a rotations of this quadrant by ir/6 (30°) about p.
real number r > 0, determines in O(nlogn) Clearly, the number of cones is 0(n).
time if there are two closed discs of radius r Consider now the set S of n points. We say
whose union contains the given set of points. that a pair (d*,d*) of two closed discs is optimal
Moreover, it tells if the radius of two minimal en- for S if all the points in S are contained in the
closing discs is larger or smaller than r. Another union d* U d*, the larger of these two discs, say
algorithm with the same 0(n2 log3 n) time com- d*, has radius r* minimal over all pairs of discs
plexity was presented by Katz and Sharir [KS] at whose union contains S, and d* has the smallest
last year's Symposium on Computational Geo- possible radius for r*. Disc d* will be called an
metry. Their paper brought out new ideas, ba- optimal, disc. If Si = {p G S : p G d*} and 5*2 =
sed on expander graphs, for this and other geo- S\S\ then d* is the minimal disc containing S2-
metric optimization problems. The complexity d* will be called a complementary disc. Clearly,
of the resulting algorithm for the two-center pro- an optimal pair of discs is a solution to the two-
blem was the same 0{n2 log3 n), however. center problem.
In this paper we will present a new algorithm There are several simple and well-known pro-
for the two-center problem. The algorithm has perties of the two optimal circles. They will be
0(n2 log n) time complexity and is based on new useful through the rest of the paper and we will
observations regarding the geometry of the pro- list them below.
blem. They allow for an efficient search in the Each disc in the optimal pair is determined eit-
set of discs that are candidates for the opti- her by a pair of points in S or by some three of
mal solution. The algorithm provides more in- them. That is, the radius of a disc is determined
sight into the geometry of the problem than by half the distance between some two points, or
the previous ones. (In fact, a lack of a di- is equal to the radius of the circumscribing circle
rect geometric flavor is a known disadvantage for some three points in S. Note that, since we
of parametric-search based algorithms for geo- do not assume general position, the points deter-
metric problems.) Due to this insight the resul- mining the optimal discs are not unique. Howe-
ting algorithm is simple, uniform, and works for ver, among the points determining the optimal
arbitrary sets of points. discs there are points with special properties.
We will formulate these for the case when both
discs are defined by three points. The same will
2 Geometric preliminaries hold true for discs defined by two points.
There exist determining points Ai,Bi,Ci for
Our algorithm is based on a new characteriza- d* that do not belong to the interior of d*, and
tion of the optimal discs. To proceed furt- there are A2, B2, C2 that are not in the interior
her we need some definitions. Assume that of d*.
304
There exist points Ai,Bi,Ci (and A2,B2,C2, also consider the set of discs that pass through p,
respectively) such that all angles in the triangle that contain CH(Sc), and whose circles contain
AAiBiCi are acute. In other words, there are at least one point in Sc beyond p. The locus of
such Ai,Bi,Ci that the center of their circum- their centers is the boundary 7 of the intersec-
scribing circle is in the interior of AAiBiCi. tion of those halfplanes determined by the bisec-
The above facts are elementary and follow tors of the segments joining p with the vertices
from the observation that otherwise at least one of CH(Sc) that do not contain p. This inters-
of the discs, contrary to their optimality, could ection, and the boundary, can be found with a
be made smaller. Hereafter, by the determining standard 0(nlog n) algorithm (see [E]). Another
points for d* and d* we will mean points with way to see this is to view 7 as the envelope of the
the above properties. Note that one (or two) of set of the above described bisector with the view
the points determining d* (the optimal disc) can point at (+oo,0). If the order of the segments
lie on the boundary of the complementary disc joining p with the vertices of CH(Sc) is known
d* (but that this point does not determine d* in (that is, the order of the slopes of bisectors is
the above sense). known) then this envelope can be found in 0(n)
From the above facts it is easy to derive that time with a modification of Keil's algorithm for
the radius of d* is not bigger than the radius the envelope of lines [K] (see also [V]).
of the optimal spanning circle (the solution to 7 is monotone with respect to the y-axis. This
the 1-center problem) for a given set. To this follows from the fact that all bisectors of the seg-
end, consider the optimal disc containing S and ments for points in the first quadrant are mono-
split S into two sets using a line containing the tonic and that the intersection of halfplanes is a
center of this disc and not containing any points convex set.
in S. Each of these subsets can be enclosed in a Now consider the points <?i,... ,qm of S that
smaller disc. are in the second and fourth quadrants of the
As opposed to the 1-center problem, which al- coordinate system (the quadrants are numbe-
ways has a unique solution, the 2-center problem red in the counterclockwise orientation, with the
can admit more than one optimal pair of discs. cone corresponding to the first quadrant). Each
For example, the set of vertices of a square have point q in these quadrants determines the mi-
two symmetric, optimal solutions. nimal disc, with respect to the radius, whose
Additionally to the above facts we will use a circle passes through p and q and which con-
non-trivial result due to Megiddo [M] that pro- tains CH(Sc). It defines a sequence of di-
vides a linear time algorithm to construct the scs d(qn),...,d(qirn) and the corresponding se-
minimal enclosing disc containing a given set of quence of radii r^,..., r,- We will show how
points. This algorithm will be useful for our the order of these radii can be found efficiently.
purposes. We wish to do so without explicitly finding the
discs; this would kill our hopes for an efficient
algorithm. Before showing the method, let us
3 Ordered sequences of discs for explain at this point what our goal is. This or-
cones dered sequence of radii will allow us to perform
a binary search provided that some kind of order
We will associate with each cone a fixed num- can simultaneously be obtained for the comple-
ber of sequences of discs. Consider a cone C for mentary discs (the disc for the complement of S
a point p from S. Without loss of generality, with respect to the points contained in the first
we may assume that p is at the origin of the disc.) Consider a point q and the segment pq.
coordinate system and the cone coincides with The center of the disc with the circle passing
the first quadrant of this system. Otherwise we through p and q is located on the perpendicular
can apply an affine transformation. Consider bisector lpq of pq. In order to find the center of
Sc = S D C and its convex hull CH(Sc), and the smallest such circle that in addition contains

305
CH(Sc) we need to consider two cases that de- Qi = S f] quadranti (the first quadrant contains
pend on how the middle point M of the segment the positive axis, i.e. is closed, the negative x-
pq is located with respect to 7. Its location de- axis belongs to quadrant?, and the negative y-
pends on whether the disc that we consider is axis belongs to quadrant^.
determined by three or by two points. If M is
on that side of 7 that contains p then the cen- As we know, Cp together with Q2 determines
ter is on the intersection of the bisector with 7. a sequence of discs ordered with respect to non-
This intersection can be located, with the help decreasing radii. (Similarly, another sequence is
of binary search, in O(logn) time. The radius defined by Cp with Q4.) Instead of constructing
of the disc is equal to the distance of this inters- the sequence for all points in Q2 (Q4) we will
ection to p. Otherwise, if M is on the opposite construct it only for those points in Q2 (Q4, re-
side of 7 from p then M is the required center. spectively) that are not in disc d0 which is the
Again, the radius is equal to the distance from minimum enclosing disc for Q1. Ignoring those
M to p. Clearly, M can be located with respect points will not affect the correctness of the over-
to 7 in 0(log n) time. We put the centers of di- all algorithm for the 2-center problem. As we
scs based on triples of points or based on pairs will show later, points in the second and fourth
of points in different sequences. Sorting the di- quadrants will be examined as potential candi-
stances yields the increasing order of the discs. dates for the point that determines, together
Concluding, we have: with the apex of the cone and another point
LEMMA 3.1 The increasing order of the discs in CH(S'c) an optimal circle. It follows from
associated with the cone and determined by the the definition of the sequences and from simple
points in the second quadrant can be found in geometric facts that points that are inside do are
O(nlogn) time. not feasible candidates since they could not form
an acute triangle with the cone center and ano-
Similarly, we can find the order of discs determi-
ther point in CH(Sc) and simultaneously pass
ned by the points in the fourth quadrant. Note
through the cone center and contain all points
that these centers of discs that are on 7 do not
in CH(Sc). Denote the obtained sequence by
need to be sorted since the distance of points on
(dt)0c — (d0,d1,..., <4C), the corresponding radii
7 to p is a monotonic (unimodal, to be precise)
by ridt), and the set of points of S in d{ by di(S).
function. The smallest radius corresponds to the
The sequence starts with disc d0, the minimum
minimal enclosing disc d0 for CH(Sc) and it
enclosing set for Qx that can be found in 0(n)
splits 7 into two monotonic subsequences corre-
time with Megiddo's algorithm [M]. Others of
sponding to the second and the fourth quadrants
these sets are not explicitly known; they can be
respectively. We will consider each such part of
found with an additional 0(n) time per set, but
the sequence separately. Note that the above
this is too costly an operation for us so we do not
construction works also if, instead of considering
intend to compute all of them. Each d{ determi-
the set of all the points in the second and fourth
nes its complementary disc d{ which is the mini-
quadrants, we consider only their subsets.
mal enclosing disc for the complement J;(5) of
di(S), i.e. for S\di(S). Denote by f,- the radius
4 Monotone sequences of radii of d{. It gives us a sequence of pairs of numbers
{(rt,fi)}. Let us emphasize that the first ele-
A cone Cp associated with p determines an or- ments of the pairs are known from the algorithm
thogonal coordinate system centered at p with constructing the sequence (see the previous sec-
the axes corresponding to the vectors defining tion). However, it requires an extra effort (e.g.
Cp. The first quadrant quadranti coincides running Megiddo's algorithm), which we want
with the cone. Let quadrant2, quadrant3, and to avoid whenever possible, to find r\. Direct
quadrant^ be the remaining quadrants (in coun- search of the sequence for the optimal pair of di-
terclockwise order). We will look at the points scs (passing through p) is not effective since (f,-)
306
is not monotonic in general. This stems from d*. Let the projection of A on the line joining
the fact that, in general, the sequence of sets the centers of d* and d* be the closest to the
di(S) is not monotone with respect to inclusion. center of d*, and let the projection of C be the
Before proceeding further, in order to see where farthest (with ties broken arbitrarily). We will
the difficulty lies, let us analyze what happens to carry out the proof under the assumption that
the sets di(S) of points in the sequence (growing A is "below" the line joining the centers of the
with respect to the radius) of discs associated discs, and that we rotate cones in the clockwise
with the cone and Q2. To focus our attention, direction. Other cases are symmetric. We have
let us consider those sequences with discs whose the following three possibilities.
circles pass through at least one other point of 1. There exists a cone with p = A that contains
S in the cone beyond p. The growing discs con- both B and C such that no point in S \d*(S)
tain more and more points (in the sense of set belongs to this cone. Then the minimal disk
inclusion) from Q2 and Q3. This follows from enclosing the points in this cone (and passing
the observation that their circles must intersect through A), that is d0, is an optimal disk.
in Qi in order to contain S\. Therefore, there is
no intersection in the third quadrant; this also
translates into the fact that all points in Q2 (and
Q3) that are in the smaller disc must be also in
the larger disc. By the same argument, the discs
can loose points from Q4 (the fourth quadrant)
as they grow. Because of these points in Q4,
the monotonicity (w.r.t. inclusion) ofdi(S), and
therefore the monotonicity of S \ di(S), can be
lost. We will soon see that there are yet some
cones that give us control over the events occur-
ring in the fourth quadrant. We now have the 2. The above case does not hold true and one
following theorem, formulated here for the case of the angles BAG or ABC is smaller than 7r/6
of the optimal disc defined by some three points. (30°). We will consider both cases,
The case of discs defined by some two points is a) BAC < TT/6.
similar and will be discussed later.
THEOREM 4.1 Let d* be an optimal disc (the
larger of the two discs in an optimal pair) whose
circle passes through p. There exists a cone Cp
for p such that (SnCp) C d*(S) and one of the
following holds true:
1. All three points determining d* are in Cp
(p being one of them)
2. Cp contains two points determining d* (p
being one of them), and no points of S that are
in the optimal disc are in Q4 (or, symmetrically,
in Q2). That is, d*C\Q4 = l).
3. Cp contains two points determining d* (p
being one of them), and the first disc d\ (not do)
contains all the points in Q4 (or in Q2, respec-
tively) that are in d*. That is, {d*(S) l~l Q4) C
Take the cone for A that contains B and such
d^S) (or, {d*{S) n Q2) C di(5)), respectively.
that the next cone does not contain B. This
PROOF: Let A,B,C be points that determine cone contains some points in S \ d*(S). Now

307
take the similarly oriented cone CB for B and line of the tangent line to d* at A is in the first
consider the cone second next to it (i.e. rotate quadrant. Also, no point in S \ d*(S) is in the
the cone about B by 7r/3.) We will show that first quadrant (the cone) since it lies completely
this cone has the desired properties. This cone in the halfplane determined by the perpendicu-
determines four quadrants, as described earlier. lar to the segment joining the centers of d*, and
First, note that C belongs to this cone (the first d* through point A (which follows from the fact
quadrant) since the angle ABC is at least 7r/3, that angle ABC is less than 7r/6). Hence, the
and the angle between AB and one of the arms cone has the required properties.
of CB is not smaller than TT/2 and not bigger
3. The first case does not hold and both the
than 27r/3. Note that no point of S in the op-
angles ABC and BAC are at least 7r/6. Note
timal disc belongs to the fourth quadrant. This
that at least one of the right angles centered at
follows from the fact that angle ABO, 0 being
A or B, with one arm passing through C and
the center of d*, is smaller than 7r/6 and there-
the other not intersecting d*, does not contain
fore a half line of the tangent line to d* at B is
points in S \ d*(S). Assume that it is the right
in the first quadrant. Also, no point in S\d*(S)
angle centered at A; denote it by RA. Take the
is in the first quadrant (the cone) since it lies
cone determined by A that contains C and the
completely in the halfplane determined by the
next one that does not have this property. We
perpendicular to the segment joining the cen-
will show that this cone has the desired pro-
ters of d*, and d* through point B. Hence, the
perties. First note that the first quadrant does
cone has the required properties,
not contain points in S \ d*(S).
b) ABC < TT/6.

**% tangent

Take the cone for A that contains B and such


that the next cone does not contain B. Now,
consider the cone second next to it (i.e. rotate
the cone about A by ir/3.) We will show that
this cone has the desired properties. This cone Those points that belong to d*(S) and are in
determines four quadrants, as described earlier. the fourth quadrant are contained in the disc
C belongs to this cone (the first quadrant) since dAC with the diameter AC. Furthermore, the in-
the angle BAC is smaller than TT/2 and bigger tersection of the first disc dx in the sequence ge-
than 7r/3. Note that no point of S in the optimal nerated by the second quadrant with the fourth
disc belongs to second quadrant. This follows quadrant does not contain any point in S\d*(S)
from the fact that angle BAO, O being the cen- as it is completely included in right angle RA.
ter of d*, is smaller than TT/6 and therefore a half This follows from the fact that the circle of dx

308
intersects the circle of (IAC at A and in the arc We will end this section with results for an
AC. This intersection also contains the inters- optimal disc that is determined by a pair rather
ection of d* and the fourth quadrant Q4. The- than a triple of points. In this case the segment
refore, d\ contains all the points of S that are joining this pair of points is a diameter of the
in d*(S) Pi Q4. Hence, the cone has the required disc.
properties. D
THEOREM 4.2 Let d* be an optimal disc whose
The immediate consequences of the above circle contains point p G 5. There exists a cone
theorem are: Cp for p such that S H Cp C d*(S) and one of
the following holds true:
COROLLARY 4.1 1. The optimal disc is defined 1. Both point determining d* (p being one of
by the minimum spanning disc of the points in them) belong to Cp; or
some cone; or 2. The other than p point determining d* is not
2. the optimal disc is in a trailing seg- in Cp. Then d*(S) 0 Q4 = $ or d*(S) D Q2 = 0-
ment ds,..., dkc of the sequence of discs
do, d\,..., dkc for some cone. This segment con- PROOF: Let A and B be the points determining
sists of those di 's that do not contain any points d*. Let A be this point whose projection on the
ofQi. Hence, we have ds(S) C ... C dkc(S); or line joining the centers of d* and d* is closer to
3. the optimal disc is in an initial segment the center of d* than the projection of C. We
di,..., dk> of the sequence di,..., dkc for some will carry out the proof under the assumption
cone Cp. (Note that we start this sequence at d\ that A is "below" the line joining the centers
rather than at d0). This initial segment consists of the discs, and that we rotate cones in the
of those di 's that contain the same points of' Q4 clockwise direction. Other cases are symmetric.
(orQ2) as disc d\ does. Hence, we have di(S) C Consider this cone CA that does not contain any
...crffc^s). points in S\d*(S) and the previous one does not
Note that the segments of the sequences from have this property. Such a cone always exists as
items 2 and 3 of the above corollary can be fo- there is a halfplane determined by a line passing
und from the sequence of the discs in 0(n log n) through A that do not contain any points in S \
time using a simple binary search. In later sec- d*(S). CA determines four quadrants as usual,
tions we will always assume that the sequences the cone itself being the first one. We have two
of discs are shortened to appropriate segments, cases:
as described above. 1. B belongs to CA- Then the cone has the
Recall that the monotonicity (w.r.t. set inclu- required properties.
sion) of d((S) implies the monotonicity (in the 2. B is not in CA- Assume that B is in Q2 (the
opposite direction) of the complements d{(S) = second quadrant). Then the tangent line to d* at
S \ di(S). This, in turn, implies the monoto- A passes through the first and third quadrants
nicity of the corresponding radii f,-. This holds and therefore no point in d*(S) belongs to Q4.
only for some cones, as described in the theo- D
rem. Nevertheless, we will soon see that it is
sufficient to find the optimal discs efficiently. Note that the above proof is significantly
We need to comment why the third quadrant simpler than its counterpart for discs determi-
is ignored in building sequences of candidate di- ned by triples of points. One of the reasons
scs. Clearly points in the third quadrant can be- is that we do not need to find a cone that ne-
long to d*. However, no point in the third qua- cessarily contains the second determining point
drant can determine an optimal disc together (beyond p) in its interior as it is required in the
with p (the center of the cone) and a point in case of triples.
the first quadrant as they form an obtuse tri- To gain a benefit from the above theorem we
angle. need another straightforward observation.
309
If d* is an optimal circle determined by a pair The following simple binary-like search can ef-
of points p and q (with p's projection on the ficiently locate (a*, 6*). For each sequence per-
segment joining the centers of d* and d* being form a binary search with respect to the a's in
closer to the center of d*) then at least one of the order to find the smallest a with b < a (a local
right angles centered at p with one arm including minimum). If the a's form a nondecreasing and
pq does not contain points in S \ d*(S). This the 6's a nonincreasing sequence, a binary search
follows from the fact that p does not belong to will correctly locate the required pair. However,
the interior of d* so d* can not overlap these not all sequences are monotonic with respect to
both right angles at the same time. the a's and 6's, and therefore the search can lead
Now, the above theorem leads to to one of two possible outcomes. Here the search
is guided by the result of comparing the current
COROLLARY 4.2 d* is either identical with
a with the corresponding 6 (that must be eva-
d0 or it belongs to the sequence of discs
luated). For example, if 6 > a, the search will
dx,d2,. ■. ,dc as defined in Section 2.
continue in the right half. Either we will not
find any pair with b < a and no pair will be
4.1 Searching with lazy evaluations returned or the search will continue and a pair
will be returned. In this case the returned pair
The searching in the algorithm will be based on
is not guaranteed to be the smallest in a given
the following general scheme. Assume that we
sequence. Now, from all the returned pairs we
are given a family ft of sequences of pairs of
choose the lexicographically smallest. This must
numbers {(a), 6j)}, j = 1 ... mt-, i = 1 ... k, and
be our (a*, 6*) since it is an element of at least
set m = £f m,-. Denote by ft* the set of all one monotonic sequence; the binary search cor-
pairs (a, b) e ft such that b < a. The searching rectly locates it. The total cost of the search is
problem is: "Find a lexicographically smallest bounded by 0(n2 log n). Concluding, we have:
pair (a*, 6*) e ft*." That is, we want to find a
pair with the smallest a, 6 not greater than a, THEOREM 4.3 The lexicographically smallest
and with b as small as possible for a given a. pair (a*, 6*), with b < a, of a quasi-monotonic
Assume that, in addition, the sequences in ft collection ofO(n) sequences, with O(n) pairs in
have the following properties. There exists iQ the sequence and 0(n) penalty to evaluate pairs,
such that {af,bl°} contains (a*, 6*); {a}0} is a can be found in 0(n2 logn) time.
nondecreasing sequence; and {bf} is a nonin-
creasing sequence. In other words, the optimal
(a*, 6*) is contained in some sequence of pairs 5 Algorithm
whose first elements form a monotonic sequence,
We will use the schema of searching with lazy
and whose second elements also form a monoto-
evaluations for locating the optimal solution
nic sequence (in the opposite direction). The
(d*,d*). We have the following lemma
collection ft with the above properties will be
called quasi-monotonic. LEMMA 5.1 The family ft of all the sequences
We are interested in the case when the a's associated with the cones is quasi — monotone.
are known and the 6's can be computed with
a certain cost penalty. To make the discussion PROOF: Follows directly from the construc-
more specific assume that the number of sequen- tion of the sequences and from Corollary 4.1 and
ces k = 0(n), the lengths of the sequences are 4.2. D

0(n), and the cost to find each b is also 0{n).


In this case a standard search for the maximum The algorithm works as follows. For all the
would result in 0(n3) time. Due to the special points in S construct the corresponding cones,
properties of quasi-monotonic families we can and the sets Qu Q2l Q3, and Q4. Find the mi-
perform that search more efficiently. nimal enclosing disc d0 for Q1 and the minimal

310
disc Jo for S\d(S) and add it to the pool of can- hope that the geometric properties of the opti-
didates. Then construct ordered sequences of di- mal discs presented in this paper will find more
scs for each cone as described in Section 2. This applications in geometric optimization.
takes O(nlogn) time per cone and 0(n2logn)
for all cones. From these sequences we can con- Acknowledgement: We thank Richard King for
struct those sequences described in items 2 and his help in the proofreading of this paper and
3 of Corollary 4.1 in an additional O(nlogn) Dan Boylin for his help with preparing the figu-
time per cone. For example, with the help of a res.
binary search we can locate the last disc in the
sequence that contains the same points of Q4 as Bibliography
[AS1] P. K. Agarwal and M. Sharir. Planar geometric
the first disc dx of this sequence does. Based on
location problems, Tech. Rep. 90-58, DIMACS, Rutgers
Theorem 4.1 and 4.2 the set of sequences con- Uni., August 1990. (also to appear in the Algorithmica)
tains an optimal disc. By virtue of Lemma 5.1 [D] Z. Drezner. The planar two-center and two-median
this set of sequences is quasi-monotone. Per- problems, Transportation Science, 18, 1984, pp.351-361.
form the lazy evaluations search on this set and [E] H. Edelsbrunner. Algorithms in Computational
return pairs of discs into the pool of candidates. Geometry, Springer Verlag, 1987.
[Fl] R. R. Francis. A note on the optimum location of
This can be done by Theorem 4.3 in 0(n2 logn)
new machines in existing plant layouts. J. Industr. Eng.
time. The penalty for each lazy evaluation is 12, 1961, pp.41-47.
0(n) if Megiddo's algorithm is used to find the [F2] R. R. L. Francis. Some aspects of minimax loca-
complementary discs. Finally, find the global tion problem, Oper. Res, 15 (1967), pp.1163-1168.
minimum (d*,d*) (or all pairs of discs that are [HM] G. Y. Handler and P. B. Mirchandani. Loca-
optimal) in 0(n) time. This leads to the follo- tion on Networks: Theory and Algorithms, MIT Press,
Cambridge, MA, 1979.
wing main result:
[HS] J. Hershberger and S. Suri. Finding Tailored Par-
THEOREM 5.1 The pair of discs (d*,d*) that titions, J. of Algorithms 12 (1991), pp. 431-463.
solves the two-center problem for a set of n [K] M. Keil. A simple algorithm for determining the
envelope of a set of lines, Information Processing Letters,
points in the Euclidean plane can be found in
39 (1991), pp.121-124.
0(n2 logn) time. [KS] M. J. Katz and M. Sharir. An Expander-Based
Approach to Geometric Optimization. Proc. of the
ninth Symposium on Computational Geometry, ACM,
pp. 198-207, 1993.
6 Conclusions [M] N. Megiddo. Linear-time algorithms for linear pro-
gramming in R3 and related problems, SIAM J. Comp.,
We have presented a new algorithm for the two- 12 (1983), pp.759-776.
center problem. Its cost of 0(n2 log n) is the [RT] H. Rademacher and 0. Toeplitz. The Enjoyment
of Mathematics, Princeton Univ. Press, Princeton, NJ,
best known to date. The algorithm is based
1957.
on an interesting insight into the geometry of [S] J. J. Sylvester. A question in geometry of situati-
the problem that leads to a simple searching ons, Quart. J. Math. 1(1857), p.79.
scheme called searching with lazy evaluations. [SH] M. I. Shamos and D. Hoey. Closest-Point Pro-
The algorithm is robust with respect to dege- blems, Proc. FOCS, IEEE (1975), pp.151-162.
nerate configurations of points. It also handles [V] G. Vegter, Computing the bounded region deter-
mined by finitely many lines in the plane, Tech. Report
uniformly optimal discs that are defined either
87-03, Dept. Math, and Comp. Sei, Rijkuniversiteit,
by three or by two points. The searching scheme Groningen, 1987.
is simple and therefore it will be interesting to
see whether or not there is some room for im-
provement in the time complexity. Interesting
directions of further research include studies on
more general k- center problems for a fixed va-
lue of k, and for non-Euclidean metrics. We

311
On geometric optimization with few violated constraints"
JIRI MATOUSEK
Department of Applied Mathematics
Charles University
Malostranske näm. 25, 118 00 Praha 1, Czech Republic

Abstract works, algorithms were obtained with roughly 0(nq)


running time1. There seems to be little hope at present
We investigate the problem of finding the best solu- at improving these bounds substantially in the full
tion satisfying all but k of the given constraints, for range of values of q. In particular, as observed by D.
an abstract class of optimization problems introduced Eppstein (private communication), for q close to n/2,
by Sharir and Welzl — the so-called LP-type problems. a sub quadratic solution would imply a subquadratic
We give a general algorithm and discuss its efficient im- solution for several other basic problems, for which
plementations for specific geometric problems. For in- one seems unlikely with present methods (information
stance, for the problem of computing the smallest circle about this class of problems, collected and publicized
enclosing all but k of the given n points in the plane, under the name 'n2-hard problems' by M. Overmars
we obtain an 0(n log n + k3n€) algorithm; this improves and his coworkers, can be found in [G093]; see also
previous results for k small compared to n but moder- Erickson and Seidel [ES93] for lower bounds in a weak
ately growing. model of computation for some problems of this type).
We also establish some results concerning general In this paper we investigate improvements over the
properties of LP-type problems. roughly 0{nq) bound in the situation when k = n — q
is small compared to n (all but few points should be
enclosed by the circle); this question was raised e.g., by
1 Introduction Efrat et al. [ESZ93]. One of the first methods com-
ing to mind for solving the problem is to construct the
Smallest enclosing circles. We begin by dis- gth order Voronoi diagram for the point set P, and find
cussing the following geometric problem: the required circle by inspecting all its cells (this ap-
proach was pointed out by Aggarwal et al. [AIKS91]).
Given a set P of n points in the plane and an It is known that the combinatorial complexity of the
integer q, find the smallest circle enclosing at qth order Voronoi diagram is 0((n — q)q), and it has
least q points of P. been shown recently that it can be constructed in ex-
pected time 0(n log3 n + (n-q)q log n) [AdBMS94], (see
This problem has recently been investigated in several also [Cla87], [AM91] for previous results). In our set-
papers [AIKS91], [EE93], [DLSS93], [ESZ93], [Mat93b] ting, this says that the smallest circle enclosing all but
and it motivated also this paper. In these previous k points can be found in 0(n log3 n + nk log n) time.

'Supported in part by Charles University grant No. 351 and In this paper we show that one can do still better for
Czech Republic Grant GACR 201/93/2167. Part of this research small k, namely that the problem can be solved in close
was performed while the author was visiting at Computer Sci- to linear time with k as large as n1/3:
ence Institute, Free University Berlin, and it was supported by
the German-Israeli Foundation of Scientific Research and Devel-
opment (G.I.F.), and part while visiting Max-Planck Institute for Theorem 1.1 The smallest circle containing all but at
Coinputer Science in Saarbrücken. most k of the given n points in the plane can be com-
Permission to copy without fee all or part of this material is puted in 0(n\ogn + k3ne) time2.
granted provided that the copies are not made or distributed for 1
direct commercial advantage, the ACM copyright notice and the Here are the specific running times: Eppstein and Erick-
title of the publication and its date appear, and notice is given son [EE93] solve the problem in 0(nq log q + nlogn) time with
that copying is by permission of the Association of Computing Ofnlogn + nq + q2 logg) space, and Datta et al. [DLSS93] give
Machinery. To copy otherwise, or to republish, requires a fee an algorithm with the same running time and space improved to
and/or specific permission. 0(n + g2logg). Efrat et al. [ESZ93] achieve O(»iglog2 n) time
with O(nq) space or alternatively O(nqlog* nlog(n/g)) time with
10th Computational Geometry 94-6/94 Stony Brook, NY, USA 0(nlog ?i) space, and the author [Mat93b] has 0(nlog7i + nq)
© 1994 ACM 0-89791-648-4/94/0006..$3.50 time with 0(nq) space or time 0(nlogn + rig logg) with 0(n)
space.
Throughout the paper, e in exponents stands for a positive
constant which can be made arbitrarily small by adjusting the

312
A predecessor of our technique is a result of Megiddo the minimum basis violated by at most k of the con-
[Meg83], who demonstrated that the k = 0 case, the straints can be computed in 0(nkd) time, by finding op-
smallest enclosing circle for n points, can be solved in tima for 0(kd) LP-type problems of the form (G, w)
0(n) time. with GCH.

LP-type problems. The problem of finding the Paper overview and further results. In sec-
smallest enclosing circle belongs to a class of optimiza- tion 2, we first review the definitions and some proper-
tion problems known as LP-type problems (or 'gener- ties for LP-type problems (sec. 2.1). Then we define and
alized linear programming' problems). This class was discuss nondegenerate LP-type problems (section 2.2).
introduced by Sharir and Welzl [SW92]. It captures In section 2.3 we consider bounds on the number of
the properties of linear programming relevant for the bases violated by at most k constraints and by exactly
description and analysis of their linear programming k constraints, phrasing results and proofs known for lin-
algorithm. The definition and more information on LP- ear programming in the LP-type problems setting. In
type problems will be given later; here we only mention section 2.4 we give a simple algorithm for finding the
few important facts. minimum basis violated by at most k constraints in a
nondegenerate LP-type problem, and we also show that
Each LP-type problem has an associated parameter,
our notion of "removing degeneracies" is meaningful in
the so-called combinatorial dimension (or dimension for
this context.
short). For instance, for a feasible linear programming
problem (one with a solution satisfying all the con- The general algorithm can sometimes be imple-
straints), this combinatorial dimension equals to the mented more efficiently in specific geometric situations
geometric dimension of the underlying space. Random- using dynamic data structures. Theorem 1.1 is one such
ized algorithms are known for solving an LP-type prob- case. In section 3, we discuss this and some other geo-
lem with n constraints and of dimension bounded by metric problems, mainly the following one (derived from
a constant in 0(n) expected time, see [Cla88], [SW92]. linear programming):
For a linear-time deterministic algorithm under some-
Problem 1.3 Given a collection H of n closed halfs-
what more restrictive assumptions see [CM93]. The al-
paces in IRd and an integer k, 1 < k < n, find the
gorithms have originally been developed for linear pro-
lexicographically smallest point ofMd contained in all
gramming, but under suitable computational assump-
tions they work for all LP-type problems. At the same but at most k of the halfspaces of H.
time, the class of LP-type problems turned out to con-
Other geometric problems amenable to a similar
tain also many other optimization problems of geomet-
treatment will be only mentioned without going into
ric flavor besides linear programming, such as the small
details.
enclosing circle computation or finding the distance of
two convex polyhedra. See also [Kal92], [MSW92] for After we deal with technical obstructions concern-
algorithms with expected running time subexponential ing degeneracies, Problem 1.3 can be solved using the
in the dimension, [Gär92] for another but related ab- general algorithm from Theorem 1.2. There are two
stract class of optimization problems and [Ame93] for substantially different cases: if the linear programming
further properties and applications of the LP-type class. problem defined by H is feasible (that is, the intersec-
tion of all halfspaces of H is nonempty), the dimension
The problem of finding the best solution satisfying all
of the corresponding LP-type problem is d, while for
but at most k of the given constraints can be posed and
an infeasible problem the dimension is d + 1 (note that
solved within the framework of LP-type problems. We
"feasible" , "infeasible" refers to the existence of a point
need that the considered LP-type problem is nondegen-
in all halfspaces of H, not to the existence of a point
erate. In geometric situations, this roughly means that
lying in all but at most k halfspaces of H).
the constraints are in general position, which can usu-
ally be achieved by perturbation techniques similar to By using dynamic data structures, the complexity of
the ones for removing degeneracies in geometric prob- the general algorithm can be improved. The results are
lems. However, one has to proceed carefully so that the summarized in the following theorem (we do not write
combinatorial structure of the problem is not changed out the improved complexities for larger dimensions, as
in an undesirable way. Exact definitions for the notions the improvements become less significant):
in the following theorem are given in the next section.
Theorem 1.4 (i) In defeasible case, Problem 1.3 can
Theorem 1.2 Let d be a constant, let (H,w) be a non- be solved
degenerate LP-type problem of dimension d with n con-
• in time 0(nkd) by the general algorithm, for any
straints and let k be a given integer, 1 < k < n. Then
fixed d,
parameters of the algorithms. Multiplicative constants implicit
in the 0() notation may depend on e. • in time 0(nlogn + kzne) in dimension 3, and

313
• in time 0(n\ogn + fc8/3?i2/3+£ + kAnll3+e) in di- in all but k of the given halfplanes. [ERvK93] provide
mension Jf. an 0(nk\ogk + 7i\ogn) solution, based on a (< fc)-level
construction algorithm. Efrat et al. [ELS93] consider
(ii) In the infeasible case, we get the problem in the latter form and obtain similar re-
sults. Moreover, they mention some more applications
• 0(nkd+1) time for the general algorithm, and investigate the analogous problem in dimension 3,
• 0(7i log n + k3 log n) time in dimension 2 and where they give an 0(?ifc2(logn + log £)) solution. An-
other closely related problem is the finding of a line in-
• 0(7i log n + k4ne) time in dimension 3. tersecting all but at most k of given n vertical segments
in the plane, investigated by Everett et al. [ERvK93];
Let us summarize previous work on Problem 1.3. In it can also be reduced to linear programming with at
the feasible case, the problem can be rephrased as find- most k violated constraints.
ing the lexicographically smallest point of the fc-level in Our results for both the 2 and 3-dimensional problem
an arrangement of n hyperplanes. thus present an improvement over the previous roughly
In the plane, there is an 0(n log n) algorithm (this is 0(nk) bounds if k is in the range (roughly) from logri
why we do not mention the planar case in Theorem 1.4). to y/n. Let us remark that the smallest k (in the weak
It is based on the observation that for a given horizontal separation problem or its dual) can be found in the same
line, one can determine in 0(?i log ?i) time whether it time as are the bounds in Theorem 1.4 (where the k is
intersects the fc-level. Then parametric search is used given), since our method searches all bases of level at
to determine the lowest line which still intersects the most k, and we may arrange it so that bases of smaller
&-level. This algorithm (implicitly) appears in Cole et level are searched first.
al. [CSY87]. It is not clear at present how efficiently
can this approach be generalized to higher dimensions.
2 LP-type problems
A natural approach in higher dimension is to con-
struct the fc-level or the (< fc)-level in the arrangement3.
In dimension 3, an output-sensitive algorithm is known 2.1 Basic definitions and properties
which constructs the £-level in 0(ns(b + n)) time,
We begin by recalling the abstract framework of [SW92]
where b denotes the complexity of the constructed level
(with minor formal modifications). An minimization
[AM91]. The worst-case complexity of the fc-level is
problem is a pair (H,w), where H is a finite set, and
0(n8/3) [DE93] (see also [ACE+91]). In higher dimen-
w : 2H —► W is a function with values in a linearly
sions, only weak worst-case bounds on the fe-level com-
ordered set (W, <). The elements of H are called the
plexity are known, and also output-sensitive construc-
constraints, and for a subset G C H, w(G) is called the
tion algorithms become less effective, so that one may
value of G.
consider constructing the whole (< fc)-level. This can
be done in expected 0(nk2 log j) time in dimension Intuitively, the value w(G) for a subset G of con-
straints stands for the smallest value attainable for
3 and in worst-case optimal 0(n^-d'2^ k'd^2^) expected
certain objective function while satisfying all the con-
time in dimension d > 4 [MuI91]. For k much smaller
straints of G. The goal is to find w(H). For the compu-
than n, the level construction approach thus becomes
tation, the problem is not specified by giving the value
quite inefficient in higher dimensions. Let us remark
of 7i> for each subset (which would make the computa-
that the picture is very different for "random" problem
tion trivial), but rather by oracles implementing certain
instances, as Mulmuley [Mul91] proves that for hyper-
primitive operations, to be described below.
planes randomly chosen from several natural distribu-
tions, the (< fc)-level expected complexity as well as The set W is assumed to posses a smallest element
expected construction time are 0(nkd~l). denoted by —oo (intuitively, it stands for 'optimum un-
defined') and usually also a largest element oo (with
Problem 1.3 in the infeasible case was investigated
intuitive meaning 'no feasible solution exists').
in several papers. For instance, Cole et al. [CSY87]
and Everett et al. [ERvK93] considered the follow- The minimization problem (H, w) is called an LP-
ing weak separation problem in the plane: Given two type problem if the following two axioms are satisfied:
point sets R and B with n points in total, find the
Axiom 1. (Monotonicity) For any F, G with
smallest k for which there is a line £ and a fc-point set
F CGCH, w(F)< w{G).
E C R U B such that all points of R \ E lie on one
Axiom 2. (Locality) For any F C G C H
side of £ and all point of B \ E lie on the other side.
with w(F) = w(G) > —oo and any h £ H,
In a dual setting, this amounts to finding the smallest
w(G U {h}) > w(G) implies that also w(F U
k for which there exists a point in the plane contained
{/,}) > w(F).
3
Even in the plane, the above mentioned 0(n log2 n) algorithm
can be improved a little for k very small, see [ERvK93]. Before we specify the computational primitives, let

314
us introduce some more terminology. A basis B is a set value w(G) of a set of constraints is defined as the lexi-
of constraints with w(B') < w(B) for all proper subsets cographically smallest point (vertex) of the intersection
B' of B. A basts for a subset G of H is a basis B CG of all halfspaces of G. There are two exceptional cases:
with UJ(B) = w(G). So a basis for G is a minimal the value is oo if the intersection of the halfspaces of G
subset of G with the same value as G. The maximum is empty and it is -oo if this intersection is unbounded
cardinality of any basis is called the dimension of(H, w) in the —x\ direction or, more generally, if it does not
and denoted by dim(H,w). have a lexicographically minimal point (e.g., if it is the
We say that a constraint h 6 H violates a set G if halfspace {x\ > 0}).
w(G U {/i}) > u>(G). This notion is most often used The verification of the axioms is easy. If the lin-
with G being a basis. For G C H we denote by V{G) ear programming problem defined by H has a well de-
the set of constraints of H violating G. fined optimum, then the combinatorial dimension of the
problem is d; if the linear program is infeasible, the com-
As was mentioned in the introduction, there are sev-
binatorial dimension is usually d+l (as d+1 halfspaces
eral algorithms for solving an LP-type problem of con-
in general position are needed to witness the infeasibil-
stant bounded dimension in time 0{\H\). These algo-
rithms differ slightly in the assumptions on the prim- ity).
itive operations available for the considered problem. Violation tests and basis changes for linear program-
We describe the primitives needed for the random- ming are implemented easily using Gauss elimination.
ized algorithm of Sharir and Welzl [SW92] (see also The "Initial basis" assumption is more tricky, as it
[MSW92]). asks for finding a dually feasible solution if one exists.
This can be circumvented by including the constraints
u
Violation test. Given a basis B and a Xi > -K" for i - 1,2,...,d, with K standing for
constraint h £ H decide whether h violates a very large number. These constraints can either be
B. added to H explicitly and then they form an initial ba-
sis, or they can be included implicitly and then each
Basis change. Given a basis B and a con-
set of constraints, including the empty one, defines a
straint h, return (some) basis for B U {h}.
unique lexicographically minimal vertex, so there are
Initial basis. On the beginning, we have no -oo values in this modification. In our discussion of
some basis Bo with W(BQ) > -co. linear programming in section 3, we assume that this
latter variant has been chosen.
For the 0(nkd) time bound in Theorem 1.2, we as-
sume that both violation test and basis change are im-
plemented in constant time, and that for any G C H 2.2 Nondegenerate LP-type problems
with w(G) > -co an initial basis B0 C G with w(B0) >
A nice feature of both the linear programming algo-
—oo can be found in 0(n) time.
rithms of Clarkson [Cla88] and of Sharir and Welzl
To illustrate the definitions, let us look how two par- [SW92] is that they do not require any special treat-
ticular problems fit into this framework. For the prob- ment of degenerate input configurations (such as many
lem of finding the smallest enclosing circle foi a set H of
halfspace boundaries passing thru a single point). Prob-
points in the plane, the constraints are the points, the ably for this reason, no notion of "general position" in
value w(G) of a nonempty set G C H is the radius of the the context of LP-type problems has been developed.
smallest circle enclosing G, and we set u>(0) = -co; thus For our algorithm below, some "nondegeneracy" is im-
the set W consists of the element -oo plus the nonneg- portant, so we suggest a definition and make few obser-
ative real numbers. Bases have cardinality 0,1,2 or 3 vations concerning nondegenerate LP-type problems.
(the 'interesting' cases are subsets with nonzero circum-
It is natural to define that an LP-type problem
radius, where the basis cardinality is 2 or 3). A nontriv-
(H, w) is nondegenerate if w{B) ^ w(B') for any two
ial step in verifying the axioms is to show that for any
distinct bases B,B'. For a nondegenerate problem, we
set, the minimum enclosing circle is unique, see [Wei91],
[SW92]. Implementing the computational primitives is write B(G) for the (unique) basis for a set G.
straightforward. We must also define what does "removing degenera-
cies" mean. Let us say that an LP-type problem (H, w)
As our second example, we consider the linear pro-
is a refinement of an LP-type problem (H,w), if for
gramming problem in Hd in the following form: We are
any G,G' C H, w(G) < w{G') implies w(G) < w(G').
given a set H of closed halfspaces in JRd, and the goal
is to find the point x in the intersection of the halfs- Clearly, if B is a basis in (H,w), it is also a basis in
(H,w), but not conversely. Removing degeneracies for
paces of H with the lexicographically smallest coordi-
a degenerate problem (H, w) means finding some its
nate vector. Here the set W is formed by a smallest
element -oo, the set Md ordered lexicographically by nondegenerate refinement.
the coordinate vectors, and a largest element oo. The When considering an LP-type problem (H,w) and

315
its refinement (H,w), we let the notation V{G), resp. enough for an infeasible linear programming problem.
B(G) refer to the set of violating constraints for G, resp. There may be many bases witnessing the infeasibility,
the basis for G in (H,w), and we use V(G), B(G) for and by the treatment of linear programming indicated
violating constraints and basis in (H, w). above, all these bases receive the same value 00. An-
There are two different types of degeneracies. To other (related) serious problem is that if the feasible
elucidate the difference, call two bases B,B' equiva- region of a degenerate linear programming problem con-
lent if they have identical sets of violating constraints, sists of a single point (say), then some perturbations of
V(B) = V(B'). It is fairly easy to find a refinement of the constraints may make the problem infeasible. Ob-
any LP-type problem where no two nonequivalent bases taining nondegenerate refinements in such cases may
have the same value, as follows. be a somewhat subtle matter; we discuss some possible
approaches in section 3.
Define a linearly ordered set VV = {—00} U ((W \
{ — 00}) x 2H), where —00 remains the smallest element,
the pairs in the Cartesian product are ordered lexico-
graphically and the ordering in the second coordinate
is some arbitrary linear ordering of the set of all sub-
2.3 Bases of level k
sets of H. We define a new value function w by set-
Let (H, w) be an LP-type problem and B C H be a ba-
ting w(G) = (w(G), V(G)); it is easy to check that this
sis. We define the level of B as |V(B)|, i.e. the number
yields a refinement where no two nonequivalent bases
have the of constraints violating B.
vali
We denote by Bk the set of all bases of level k, and
Two equivalent bases must always have the same
value. Any two equivalent but distinct bases thus vio- by Bk the bases of level k and cardinality i. We use
late the nondegeneracy condition, and this is an 'intrin- the notation B<k for the set of all bases of level at most
sic' degeneracy. For instance, for linear programming, k.
such degeneracies correspond to several bases defining In this section, we discuss bounds for the maximum
the same vertex. possible size of B<k and Bk. In the context of linear
At present we are not aware of any universal and programming (more exactly, for a feasible linear pro-
efficient method for removing this type of degeneracies. gram), a basis of level k translates to a local minimum
The following simple example shows that sometimes any of the fc-level in the arrangement of hyperplanes bound-
nondegenerate refinement must have a larger dimension ing the constraints. Mulmuley [Mul91] showed that the
than the original (degenerate) problem. total number of such local minima of levels 1,2,. .. ,k in
dimension d is 0(kd). His proof is a straightforward
Example 2.1 Let a,b,c,d be the vertices of a square adaptation of the method of Clarkson and Shor [CS89].
in the plane in clockwise order, and for G C H = Clarkson [Cla92] and independently Mulmuley [Mul93]
{a,b,c,d} define the value w(G) as the circumradius proved that the number of local minima for level k alone
of G. This is an LP-type problem of dimension 2, as is 0{kd~l). Both bounds are easily seen to be tight.
any nontrivial circumscribed circle is defined by a di- In the following theorem, we generalize these results
ametral pair. The sets {a,c} and {b, d] are two equiv- for nondegenerate LP-type problems (the nondegener-
alent bases. Suppose there existed a nondegenerate re- acy is crucial; without it the bounds in the theorem be-
finement (H, w) of this problem with no basis having low need not hold). The proof for level at most k goes
more than 2 points. Then w.l.o.g. we may assume that through unchanged. For the exactly k level bound, we
w({a, c}) < w({b, d}). Set G = {a, b, c}, F = {a, c} and need an extra assumption, namely that no value —00
h = d; then w(F) = w(F U {h}) = w(G) < w(GU{h}), appears in the considered problem. Then we can imi-
which violates the locality axiom. Thus, any nondegen- tate Clarkson's proof quite closely; the proof is omitted
erate refinement has dimension at least 3. in this extended abstract. We do not know whether the
statement remains true without this assumption.
For specific geometric problems, one can often as-
sume that the corresponding geometric configurations
are nondegenerate in a suitable sense (e.g., for linear Theorem 2.2 (i) For any nondegenerate LP-type
programming, the boundary hyperplanes of the con- problem of dimension d, the number of bases of
straints are in general position and not parallel to any level at most k and of cardinality at most i does not
coordinate axis), using the techniques of simulation of exceed e(k + iy. In particular, \B<k\ = 0((k + l)d).
simplicity for geometric problems, see e.g. [EM90],
[Yap90], [EC92], [Sei94]. But, for instance, this is not
4 (ii) For any nondegenerate LP-type problem (H,w) of
This modification of the weight function is not reflected in the
computation of the algorithms which use only the primitive oper- dimension d with w{G) > -co for any G C H, we
ations mentioned above, as none of these primitives are changed. have \Bk\ = 0((k + i)d-1).

316
2.4 Finding the minimum &-level basis G U {h0} either, so w(G U {/i0}) = w(G U {h, h0}), but
In our algorithm, we need to assume that we deal with we have w(G U {h}) > w(G U {h0}) by the choice of /i0,
a contradiction with monotonicity. G
a nondegenerate LP-type problem. The following easy
proposition (whose proof is omitted) shows that in or- We are ready to finish the proof of Theorem 1.2.
der to find a minimal (< fc)-level basis in a possibly We start in the basis B(H), and we search the above
degenerate LP-type problem (H,w), it suffices to find defined directed acyclic graph by some graph traversal
the minimum (< A)-level basis in any nondegenerate algorithm, say by depth-first traversal. For any current
refinement of (H, w). node, we can find all of its at most d successors in 0{n)
time, and by 2.2(i), we know that only 0(kd) bases need
Proposition 2.3 Let (H, w) be an LP-type problem, to be searched. By the above lemma, we know that all
let (H,w) beits nondegenerate refinement. Let B be bases of B<k are reached. D
the basts in B<k (the set of all bases of level at most k We conclude this section by a general scheme for an
in (H, w)) with the minimum w-value, let B be a basis application of suitable dynamic data structures for im-
for B in (H, w). Then B £ B<k and w(B) is minimum plementing this algorithm (which more or less offers it-
over B<k. self).
When traversing the graph defined above, we main-
For the rest of this section, let (H, w) be a nondegen- tain two dynamic data structures, O and V. For a cur-
erate LP-type problem of dimension d, and let k < n rent basis B, the data structure O stores the constraints
be a given integer. Our goal is to find the basis with of H \ V(B), and it can quickly determine the basis for
the smallest value among all bases of level at most k in the currently stored set of constraints. The data struc-
(H, w). The algorithm consists of searching all bases of ture V stores the constraints of V(B), and it can quickly
level at most k and selecting the one with minimum test whether all constraints of the currently stored set
value. It it is easy to see that for a nondegenerate violate a basis given as a query.
problem, the optimal basis has level exactly k, but our
For testing if a successor basis B' of B with V(B') =
method requires searching also bases of smaller levels.
V(B) U {6} for some 6 £ B exists, we first delete 6 from
First we define a directed acyclic graph on the vertex O and then we query O for the basis B' for the current
set B<k. An edge goes from a basis B £ Bj to a basis constraint set. Then we query the data structure V to
B' £ Bj+1 (0 < j < k) if V(B') = V(B) U {b} for some check whether V{B) C V(B'). If yes, we insert b into V,
be B. We note that B' is the basis for H \ V(B) \ {&}. and we are ready to continue the search with B' as the
Therefore, given B £ Bj, we can find all its neighbors current basis. When traversing the previously visited
in Bj+i by computing, for every b £ B, the basis B' edge (B, B') backwards, we insert b to O and delete it
for H \ V(B) \ {b} and checking the condition V(B') = from V.
V(B) U {6}. This requires solving |5| < d LP-type
problems of the form (G, w) with G C H plus simple
auxiliary operations.
3 Geometric applications
We need the following

In this section, we mainly consider Problem 1.3 (mini-


Lemma 2.4 Every basis of Bk can be reached from
mum vertex contained in all but at most k of given n
B(H) by a directed path.
halfspaces in IRd). For a halfspace h, we let dh stand for
its bounding hyperplane, and for a set G of halfspaces
Proof: It suffices to show that any basis B' £ Bj+1 has we write dG for {dh; heG}.
a predecessor in Bj.
As outlined in section 2.1, the linear programming
Write G = H \ V(B'), then B' = B{G). For every
problem can be interpreted as an LP-type problem. One
h 6 V(B') £ 0, consider the value w(GU{h}), and let
technical problem is that the input problem may be de-
ho € V(B') be an element giving the smallest of these
generate, while our algorithm requires a nondegener-
values. In fact, such h0 is unique, as w(G U {h0}) =
ate one. For a feasible linear program, degeneracy is
w(G U {h}) for h jt h0 implies that B(G U {h0}) =
caused by degeneracy in the arrangement of dH, while
B(G U {h}) C G by nondegeneracy, and this in turn
for an infeasible problem, any two distinct infeasible
means w(G U {h0}) = w(G), a contradiction with the
bases present a degeneracy, even if the hyperplanes of
assumption h0 £ V(B').
dH are in general position. For our algorithm, we need
Let B be the basis for G U {h0}. We claim that a nondegenerate refinement.
B is the desired predecessor of B'. We have V(B) U
As we will see below, for a problem with a nonempty
{h0} C V(B'); we need to show equality. Suppose the
and full-dimensional feasible region, a nondegenerate
inclusion is proper, then some h £ V(B'),h ^ h0 does
refinement can be produced relatively easily using in-
not violate B. Then, by locality, h does not violate
finitesimal perturbations, while the situation gets more

317
Finally we have to distinguish the values of the mfea-
complicated in other cases. One potential problem is
sible bases (this step is unnecessary for feasible prob-
the following: if the feasible region is nonempty but
lems). We consider an infeasible set G of halfspaces
has empty interior, an arbitrarily small perturbation of
(after the final perturbation), and we divide them into
the input halfspaces may cause the problem to become
upper and lower halfspaces. The value of G will be
mfeasible, and in general we need not get a refinement.
the smallest amount t = t(G) by which we must shift
At this moment, a general remark concerning simu- the intersection of all lower halfspaces upwards so that
lation of simplicity is perhaps appropriate. When ap- it touches the intersection of all upper halfspaces. It
plying simulation of simplicity on a geometric problem, turns out that this gives the desired nondegenerate re-
we replace it in effect by a different problem (although finement of dimension d+l; we omit the details. In
an "infmitesimally close" one), and an algorithm run on the algorithm, we do not choose specific numbers for
this different problem may sometimes yield a different
ei,e2,£3, rather we treat them as indeterminates. □
answer than the correct one for the original problem
By proving Proposition 3.1, we have shown that the
(e.g., the original linear program is feasible while the
general algorithm from Theorem 1.2 is applicable to
perturbed one is not) . We can take two points of view:
Problem 1.3. Further we consider efficient implementa-
First, we may say that the input numbers for a "real
tion of the dynamic data structures O and V mentioned
world" problem are inaccurate anyway, and so the an-
in the end of section 2.4 for the linear programming
swer for the perturbed problem is equally appropriate
problem (actually for its nondegenerate refinement con-
as the one for the original problem. For example, we
structed in the proof of Proposition 3.1).
cannot really tell whether the feasible region is very thin
or empty. From the second point of view, the input is We begin with the feasible case. Here the data struc-
given exactly and its degeneracies really exist, so if we ture V stores a set of halfspaces which all contain a
use perturbation, we must be sure to recover the answer known point (a fixed point in F(H)), and the query
to the original problem correctly. By requiring that our boils down to checking whether a given point lies out-
algorithm is run on a nondegenerate refinement of the side of the union of the current set of halfspaces. For
input problem, we are taking the second of the outlined this task, algorithms are known with the following per-
positions (which may not always be appropriate, de- formance [AM91] (we only quote the results relevant
pending on the application). The first attitude would to our application): In dimension 3, 0{ne) query time
allow us to take an arbitrary infinitesimal perturbation, can be achieved with 0(n log n) preprocessing time and
and would save us many complications. 0(log2 n) amortized update time. In dimension d > 4,
one gets the following tradeoff: for a parameter m in
The following proposition shows that a nondegener-
ate refinement can be constructed for a linear program- range [n,n^% query time 0(n1+7™1/[d/2j) is ob-
tained with 0{m1+c) space and preprocessing time and
ming problem. Let T(H) denote the feasible region of
with 0(m1+£/n) amortized update time (in fact, for
the linear program defined by H.
m = 71 an 0{nlogn) preprocessing suffices). We must
apply the appropriate perturbations on the input half-
Proposition 3.1 Given a set H of halfspaces in IR , spaces, but this is a simulation of simplicity technique
one can define a nondegenerate LP-type problem (H, w), of a particular type and it only slows down the compu-
which is a refinement of the LP-type problem (H, w)
tation by a constant factor.
defined above, has dimension d (resp d+l) if?{H) ± 0
The data structure O should return a basis for the
(resp. T(H) = 0j, and for which the computational
current set of halfspaces (and we are guaranteed that
primitives can be implemented in constant time.
the halfspaces have a nonempty intersection). Results
of [Mat93a] show that the same performance can be
Proof sketch: The refinement proceeds in several achieved as the one above for V (the query time grows
steps. First, we replace the problem of finding the lex- by a polylogarithmic factor, which formally disappears
icographically smallest feasible vertex by finding a ver-
in the if term).
tex minimizing an objective function of the form c-x,
In dimension 3, we perform 0(k3) queries and up-
with c=(l,ei, £?,..., et1). Ifei > 0 is chosen small
dates in both data structures, which leads to the
enough, we get an isomorphic LP-type problem. Then
claimed 0(n\ogn + Pn€) complexity. For dimension
we shift each of the constraint halfspaces by £2 out-
4, we choose a suitable tradeoff between the total up-
wards (keeping the bounding hyperplane parallel to the
date and query time and the preprocessing time of the
original one), with O < e2 < £i- This guarantees that
data structures, as follows: For k < n1/8, we let m = n,
whenever the feasible region is nonempty, it also has
for k4 < n < k8 we let m = fc8/3n2/3 and for larger
a nonempty interior. Then we perturb each bounding
k we choose m = n4/3. This yields the formula stated
hyperplane by at most e3 < £2 (where distance of hy-
in the theorem. Tradeoffs can be computed also for
perplanes is defined as the distance of their dual points,
higher dimensions, although with less significant gains
say). This perturbation makes the values of all feasible
in efficiency. This establishes part (i) of Theorem 1.4.
bases distinct.

318
In the infeasible case, the data structure V stores get the 0(nlogn+fc3log2n) running time. This finishes
the upper halfspaces and lower halfspaces separately. the proof of Theorem 1.4. O
Testing for a feasible basis is as before. For an infeasi- Proof of Theorem 1.1: For the smallest enclos-
ble basis B, we first compute the value t(B) as in the ing circles problem discussed in the introduction, the
proof of Proposition 2.3 and the point r = T(B) of the situation with a nondegenerate refinement is consider-
intersection of all upper halfspaces of B where the in- ably easier than the one for linear programming (this is
tersection of all lower halfspaces of B first touches when because the value function depends continuously on the
shifted upwards, and then we test if r lies outside all up- point set). It suffices to take any sufficiently small per-
per halfspaces and r - (t, 0,..., 0) lies outside all lower turbation of the input points such that no 4 points are
halfspaces. cocircular and no circle determined by 2 points passes
The data structure O also stores upper and lower through another point.
halfspaces separately. If the currently stored set is fea- To build the required dynamic data structures, we
sible, the algorithm of [Mat93a] returns the basis. If use the well-known lifting transformation. Namely, we
infeasibility is reported, we use parametric search to map each point p = (u, v) in our point set to the plane
3 2 2
find the value of t. As a generic algorithm, we use the TT(P) = {(x, y, z) 6R ; z = u + v - lux - 2vy}, and
algorithm of [Mat93a] for testing feasibility of the set of we map a circle C with center (a, b) and radius r to the
the upper halfspaces plus the lower halfspaces shifted by point x(C) = (a,b,r2-a2 + b2) 6 K3. Then p lies inside
a generic value of t. A more detailed exposition would C iff x(C) lies above n(p).
require explaining the feasibility testing algorithm and This allows us to implement the data structure V
we omit it, as the details are easy to fill in, assuming using the dynamic data structure of [AM91] mentioned
a familiarity with [Mat93a]. The application of para- in the previous section. For the data structure Ö, we
metric search on top of the feasibility testing algorithm must work somewhat more.
only increases the query time by polylogarithmic fac-
For a point set P in the plane, let A(P) denote the
tors. The overall performance of the resulting dynamic
cell above all the planes ir{p) with p G P. Finding the
data structures V and Ö is thus the same as in the fea-
smallest circle enclosing P translates to minimizing the
sible case above; this gives the result for dimension 3 in
function tp(x, y, z) := x2 + y2 - z over the region A(P);
Theorem 1.4(ii).
the minimum value is the square of the radius of the
For the 2-dimensional case, the parametric search smallest enclosing circle, and the x and y coordinates
machinery is unnecessary, and we may directly use a of the point realizing the minimum determine the center
relatively simple dynamic data structure for maintain- of the circle.
ing convex hulls in the plane due to Overmars an van
The procedure is quite analogous to the one from
Leeuwen [OvL81]. To build Ö, we use this data struc-
[Mat93a] for minimizing a linear function over a convex
ture in a dual form. One part represents the intersection
polyhedron (which is given implicitly by a certain al-
U of the upper halfplanes, another part the intersection
gorithm for answering membership queries), only that
L of the lower halfplanes. After 0(n log n) preprocess-
here we minimize a convex function. In our case, the
ing, halfplanes can be inserted and deleted in 0(log n)
membership algorithm is the query answering algorithm
time, and the data structure provides a representation
for the dynamic data structure of [AM91]. A reader fa-
of the convex chains forming the boundaries of L and
miliar with the procedure of [Mat93a] may check that
U (the chains are stored in balanced binary trees).
the only point where the difference between a linear
If the current problem is feasible, the optimal vertex function and a convex one appears is in the following
is either the extreme vertex of U, or the extreme vertex situation: We have a j-flat / and a (j — l)-flat /' C /•
of L, or one of the two intersections of the boundaries We know that the minimum of <p over /' n A(P) is at-
of U and of L. All these vertices can be found and tained at some point z € /' • From the local geometry
examined in 0(log2 n) time. For an infeasible problem, near this point we want to determine on which side of
the first contact of U and L when translating L upwards /' lies the minimum of <p within / n A(P). In case of
occurs either at a vertex of L or at a vertex of U. For a minimizing a linear function, the minimum point z is
given vertex v of L, we can determine the point where determined by j - 1 of the planes bounding A(P), and
it hits the boundary of U in 0(log n) time. From the one can easily determine on which side of /' the mini-
local situation at that point, we can detect whether the mized function may grow. In our case of a (quadratic)
first contact of L and U occurs to the left of v or to the convex minimized function, the minimum may be the
right of v. Hence we can determine the first contact, the global minimum, or it may be determined by any num-
corresponding t value and the basis in 0(log n) time ber of planes up to j — 1, but still one may determine
by binary search in the lower convex chain. The data locally on which side of /' does the minimum within
structure V is also implemented using the Overmars / lie. With this subroutine available, we may use the
and van Leeuwen data structure, with 0(log n) time procedure of [Mat93a], and we obtain a minimization
per update and O(logrz) time per query. Altogether we

319
algorithm with 0(ne) query time. Generalization to the original problem), and we know that there are only
an arbitrary dimension is also possible (the efficiency 0(k2) of these. Still, the current method may search
depends on the efficiency of the algorithm for the mem- k3 bases, most of them infeasible ones; could this be
bership queries). avoided?
In this way, also the data structure Ö can be im-
plemented with 0(ne) query time, and this gives the
Acknowledgment. I would like to thank Emo Welzl
bound in Theorem 1.1. D
for bringing the problem to my attention, and Pankaj
There are various other optimization problems of ge- K. Agarwal and David Eppstein for useful discussions.
ometric flavor fitting into the LP-type framework, see
[MSW92], [Ame93]. Here are few examples: Finding
the smallest ball, resp. the smallest volume ellipsoid References
enclosing a given point set in IRd; finding the largest
volume ellipsoid inscribed into the intersection of given [ACE+91] B. Aronov, B. Chazelle, H. Edelsbrunner, L. J.
halfspaces in IRd; finding the distance of two convex Guibas, M. Sharir, and R. Wenger. Points
polyhedra given by vertices, resp. by facet hyperplanes and triangles in the plane and halving planes
in IR ; finding a line transversal for given convex poly- in space. Discrete Comput. Geom., 6:435-442,
1991.
gons in the plane.
If the dimension is fixed, one can apply our general [AdBMS94] P. K. Agarwal, M. de Berg, J. Matousek, and
O. Schwarzkopf. Constructing levels in arrange-
algorithm to the respective derived problems with k vi-
ments and higher order Voronoi diagrams. In
olated constraints, provided that the nondegeneracy is-
Proc. 10th Annual ACM Symposium on Comput.
sue can be handled. In many of the problems, simula- Geom., 1994. To appear.
tion of simplicity alone should suffice; it seems that lin-
ear programming is complicated in this respect because [AIKS91] A. Aggarwal, H. Imai, N. Katoh, and S. Suri.
Finding k points with minimum diameter and
feasible solutions need not exist. The applicability of
related problems. J. Algorithms, 12:38-56, 1991.
dynamic data structures to speed up the computations
must be checked individually. In general, the improve- [AM91] P. K. Agarwal and J. Matousek. Dynamic half-
ments will probably be significant only if the dimension space range reporting and its applications. Tech.
is really small. Report CS-1991-43, Duke University, 1991. Ex-
tended abstract, including also results of D. Epp-
stein: Proc. S3. IEEE Symposium on Founda-
4 Discussion tions of Computer Science (1992), pages 51-60.
[Ame93] N. Amenta. Helly theorems and generalized lin-
It would be interesting to find more about nondegener- ear programming. In Proc. 9th Annu. ACM Sym-
ate refinements of LP-type problems. We have shown pos. Comput. Geom., pages 63-72, 1993. Also to
that the dimension must sometimes grow at least by appear in Discrete & Computational Geometry.
1; a natural question is how large growth is necessary [Cla87] K. L. Clarkson. New applications of random
and sufficient in the worst case; is there any bound only sampling in computational geometry. Discrete
depending on the dimension? Comput. Geom., 2:195-222, 1987.
From a practical point of view, it would be very de- [Cla88] K. L. Clarkson. A Las Vegas algorithm for linear
sirable to have some more direct scheme for making programming when the dimension is small. In
the geometric LP-type problems, linear programming in Proc. 29th Annu. IEEE Sympos. Found. Comput.
particular, nondegenerate that the rather cumbersome Sei., pages 452-456, 1988.
approach via geometric perturbations we used. Alter- [Cla92] K. L. Clarkson. A bound on local minima of
natively one might find an algorithm which can handle arrangements that implies the upper bound the-
nondegeneracy directly. orem. Manuscript, 1992.
In Theorem 2.2(a), we saw that the number of bases [CM93] B. Chazelle and J. Matousek. On linear-time
of level exactly k is 0(kd~1) in a rf-dimensional LP- deterministic algorithms for optimization prob-
type problem with no —oo values. Two questions arise lems in fixed dimension. In Proc. 4th ACM-
naturally: First, is the claim still true if we allow -oo SIAM Sympos. Discrete Algorithms, pages 281—
values? And second, can one use this result algorith- 290, 1993.
mically for finding the smallest basis of level k, that [CS89] K. L. Clarkson and P. W. Shor. Applications of
is, can one efficiently avoid searching all bases of level random sampling in computational geometry, II.
at most k, whose number may be of the order kdl In Discrete Comput. Geom., 4:387-421, 1989.
particular, for the 2-dimensional infeasible linear pro- [CSY87] R. Cole, M. Sharir, and C. K. Yap. On ib-hulls
gramming, we are actually interested only in 2-element and related problems. SIAM J. Comput., 16:61—
bases (as all infeasible bases have the same value oo in 77, 1987.

320
T. Dey and H. Edelsbrunner. Counting triangle [MSW92] J. Matousek, M. Sharir, and E. Welzl. A subex-
[DE93]
crossings and halving planes. In Proc. 9th Annu. ponential bound for linear programming. In
ACM Sympos. Comput. Geom., pages 270-273, Proc. 8th Annu. ACM Sympos. Comput. Geom.,
pages 1-8, 1992. Also to appear in Algorithmica.
1993.
[Mul91] K. Mulmuley. On levels in arrangements and
[DLSS93] A. Datta, H.-P. Lenhof, C. Schwarz, and
M. Smid. Static and dynamic algorithms for k- Voronoi diagrams. Discrete Comput. Geom.,
point clustering problems. In Proc. 3rd Work- 6:307-338, 1991.
shop Algorithms Data Struct., Lecture Notes in [Mul93] K. Mulmuley. A generalization of Dehn-
Computer Science, 1993. Sommerville relations to levels in arrangements.
In Proc. 9th Annu. ACM Sympos. Comput.
[EC92] I. Emiris and J. Canny. An efficient approach to
removing geometric degeneracies. In Proc. 8th Geom., 1993.
Annu. ACM Sympos. Comput. Geom., pages 74- [OvL81] M. H. Overmars and J. van Leeuwen. Mainte-
82, 1992. nance of configurations in the plane. J. Comput.
Syst. Sei., 23:166-204, 1981.
[EE93] D. Eppstein and J. Erickson. Iterated nearest
neighbors and finding minimal polytopes. In [Sei94] R. Seidel. The nature and meaning of perturba-
Proc. 4th ACM-S1AM Sympos. Discrete Algo- tions in geometric computing. Manuscript, 1994.
rithms, pages 64-73, 1993. [SW92] M. Sharir and E. Welzl. A combinatorial bound
A. Efrat, M. Lindenbaum, and M. Sharir. Find- for linear programming and related problems. In
[ELS93]
ing maximally consistent sets of halfspaces. In Proc. 1992 Symposium on Theoretical Aspects of
Proc. 5th Canadian Conference on Computa- Computer Science (Lecture Notes in Computer
tional Geometry, 1993. Science), volume 577, pages 569-579. Springer-
Verlag, 1992.
[EM90] H. Edelsbrunner and E. P. Mücke. Simulation
of simplicity: A technique to cope with degener- [Wel9l] E. Welzl. Smallest enclosing disks (balls and el-
ate cases in geometric algorithms. ACM Trans. lipsoids). In H. Maurer, editor, LNCS 555 (New
Graph., 9:66-104, 1990. Results and New Trends in Computer Science),
pages 359-370. Springer-Verlag, 1991.
[ERvK93] H. Everett, J.-M. Robert, and M. van Kreveld.
[Yap90] C. K. Yap. A geometric consistency theorem for a
An optimal algorithm for the (< fc)-levels with
symbolic perturbation scheme. J. Comput. Syst.
applications to separation and transversal. In
Proc. 9th Annu. ACM Sympos. Comput. Geom., Sei., 40:2-18, 1990.
pages 38-46, 1993.
[ES93] J. Erickson and R. Seidel. Better lower bounds
for detecting affine and spherical degeneracies. In
Proc. 34th Annu. IEEE Sympos. Found. Comput.
Sei. (FOCS 93), 1993.
[ESZ93] A. Efrat, M. Sharir, and A. Ziv. Computing the
smallest fc-enclosing circle and related problems.
In Workshop on Algorithms and Data Structures
(WADS), 1993.
[Gär92] B. Gärtner. A subexponential algorithm for
abstract optimization problems. In Proc. 33rd
IEEE Sympos. Found. Comput. Sei., 1992.
[G093] A. Gajentaan and M. Overmars. n2-hard prob-
lems in computational geometry. Tech. Report
RUU-CS-93-15, Utrecht University, 1993.
[Kal92] G. Kalai. A subexponential randomized simplex
algorithm. In Proc. 24th Annu. ACM Sympos.
Theory Comput., pages 475-482, 1992.
[Mat93a] J. Matousek. Linear optimization queries. Jour-
nal of Algorithms, 14:432-448, 1993. The results
combined with results of O. Schwarzkopf also ap-
pear in Proc. 8th ACM Symposium on Compu-
tational Geometry, 1992, pages 16-25.
[Mat93b] J. Matousek. On enclosing k points by a circle.
Manuscript, 1993.
[Meg83] N. Megiddo. The weighted Euclidean 1-center
problem. Math. Oper. Res., 8(4):498-504, 1983.

321
Efficient Piecewise-Linear Function Approximation
Using the Uniform Metric
(Preliminary Version)

Michael T. Goodrich*
Dept. of Computer Science
Johns Hopkins Univ.
Balitmore, MD 21218
Email: goodrichQcs.jhu.edu

Abstract and find an F G T achieving this error bound.


The version of this problem we address in this pa-
We give an 0(n log n)-time method for finding a best k- per is to find a function F G T that minimizes the
link piecewise-linear function approximating an n-point uniform error term with respect to S where T is the
planar data set using the well-known uniform metric to class of /c-link piecewise-linear functions, for some given
measure the error, e > 0, of the approximation. Our k e {l,2,...,n- 1}. Using terminology from the ap-
method is based upon new characterizations of such proximation theory literature (e.g., see [9, 16, 18, 19]),
functions, which we exploit to design an efficient al- this is equivalent to the problem of finding a best (fc+1)-
gorithm using a plane sweep in "e space" followed by knot degree-1 spline approximating S under the l^
several applications of the parametric searching tech- norm. Of course, the case k = n - 1 is trivial, and
nique. The previous best running time for this problem there is a simple reduction of the case k = 1 to 3-
was 0(n2).
dimensional linear programming, which can be solved
in 0{n) time [12, 20, 40, 42, 43, 53]. Thus, the inter-
1 Introduction esting cases are for 1 < k < n - 1. We show how to
solve this problem for any such k in 0{n logn) time.
Given a set S = {(zi.j/i), {x2,y2), •••, (xn, yn)}, the The motivation for this problem is that one may
problem of approximating 5 by a function is classic have limited resources with which to describe the set S,
in applied mathematics, and it finds applications in a but one wishes the best approximation possible within
number of computational problems. The general goals the given resource bounds. This can also be viewed as
in this area of research are to find a function F belong- a data compression problem.
ing to a class of functions T such that each F G T is
simple to describe, represent, and compute and such 1.1 Previous work
that the chosen F approximates S well. For example,
one may desire that T be the class of linear or piecewise- The problem we address is a special case of a whole class
linear functions, and, for any particular F G T, that the of problems in approximation theory where one wishes
measure of the error be the well-known uniform metric: to fit a set of data using a spline function under some
metric. Thus, the interested reader is referred to texts
l|5-F||00= max \Vi - F(xr)\, discussing approximation theory, such as those by Bell-
i€{l,2,...,n}
man and Roth [9], Conte and de Boor [16], Davis [18],
which is also known as the l^ or Chebychev measure of and Dierckx [19], for a general treatment of such prob-
error [16, 18, 30], The goal, then, is to determine the lems. Research in this literature is primarily interested
value of in minimizing the number of knots in a spline under the
e* = min||S-F|U the least squares metric, e.g., Jupp [36] gives a numer-
ical approach to this problem. For the specific prob-
'Partially supported by the NSF and DARPA under Grant
CCR-8908092, and by the NSF under Grants IRI-9116843 and
lem we address here, Bellman and Roth [8] describe
CCR-9300079. a dynamic-programming approach based upon using a
Permission to copy without fee all or part of this material is uniform grid to determine possible placements of link
granted provided that the copies are not made or distributed for endpoints (which they call knots). Their method is not
direct commercial advantage, the ACM copyright notice and the guaranteed to find a best fc-link approximation, how-
title of the publication and its date appear, and notice is given ever.
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee Hakimi and Schmeichel [30] show that such a best
and/or specific permission. approximation can be found in 0(n2logn) time, and
10th Computational Geometry 94-6/94 Stony Brook NY USA this is the first method we know of that is guaranteed
© 1994 ACM 0-89791-648W/0006..$3 50
322
to find a best approximation. Their algorithm is based nal curve, subject to some error tolerance. The prob-
upon a clever lemma that shows that one can limit the lem of fitting a minimum-link convex polygon nested
number of "critical" e values that are candidates for between two given polygons was studied by Aggarwal
e* to be 0(n2). They also show that one can test if et al. [5], who give an O(nlogn) time solution to this
any such e value is equal to e* in 0(n) time, which problem. In addition, Imai and Iri [34, 35] give an 0{n)
implies that, once enumerated and sorted, one can per- time method for finding the minimum-link function ap-
form a "binary search" among these critical values to proximating a given monotone chain. Their method
find e*. Of course, enumerating these critical e's re- is very similar to an 0(n) time method independently
quires tt(n2) time. Indeed, a straightforward applica- discovered by Suri [54, 55] for solving the more-general
tion of the lemma by Hakimi and Schmeichel would problem of finding a minimum link path joining two
require 0(n3) time to enumerate them. They reduce points inside a simple polygon. There has also been
the time to 0(n2 logn) using the powerful plane sweep- some work on approximations that are required to use
ing technique (e.g., see [51]), which involves "sweeping" a subset of the endpoints of the given polygonal chain.
the plane with a line L while maintaining appropriate For example, using an approach of Imai and Iri [33, 35],
data structures for the points L encounters along the Toussaint [57] and Melkman and O'Rourke [44] give
way. More recently, Wang et al. [58] show how to use several 0(n2logn) time methods under various met-
an even more clever plane sweep procedure to find a rics.
best fc-link approximation under the uniform metric in There hasn't been much work on three-dimensional
version of these approximation problems with guaran-
0{n2) time.
teed performance bounds, however, although the recent
work by Mitchell and Suri [49] on a special case of the
1.2 Related work 3-dimensional function approximation problem is a no-
With the exception of the papers by Hakimi and Schme- table exception.
ichel [30] and Wang et al. [58], related work in the There is also a rich literature that studies minimum-
computational geometry literature has been directed link distance as a metric in its own right (e.g., see [6,
at what can be viewed as the "inverse problem," which 23, 24, 37, 39, 47, 48, 54, 55]).
is also addressed in the paper by Hakimi and Schme-
ichel [30]. In this problem one is given an error mea- 1.3 Our results
sure e > 0 and asked to find a minimum-link polygo-
nal path (which may or may not be required to be a As mentioned above, we give an O(nlogn) time algo-
function) that has distance at most e from all the ob- rithm for finding a best fc-link piecewise-linear function
jects in S (which need not just be points), under some approximating a set S of n points in the plane under
reasonable distance metric. As mentioned earlier, for the uniform metric. Our method is based upon new
the case when 5 is a set of points and the error mea- geometric insights that allow us to apply a novel plane
sure is the uniform metric, then Hakimi and Schme- sweep in "e space" to enumerate a set of 0{n) criti-
ichel show that this problem can be solved in 0(n) cal e values, which we then search in a binary search
time. Their method can be viewed as an extension fashion. This allows us to restrict the range of e values
of the linear-time method of Suri [54], which computes containing e* to be an interval [ei,e2], but it does not
a minimum-link path inside a simple polygon, to the necessarily give us ex = e2 = e*. To achieve this latter
problem of finding a minimum-link monotone polygonal result we give additional geometric characterizations of
chain that "stabs" a given set of line segments. Hersh- a best fc-link approximation that allow us to follow this
berger and Snoeyink [32] show how to further generalize preprocessing step by several applications of pipelined
this method to find in 0{n) time a minimum-link path versions of the well-known parametric searching tech-
of a particular homotopy type in a non-simple polygon, nique (e.g., see [2, 3, 4, 11, 13, 14, 15, 41]).
and Guibas, Hershberger, Mitchell, and Snoeyink [29] Admittedly, the use of this technique typically
show how to generalize this method even further to makes an algorithm rather impractical to implement.
find in 0(n) time a minimum-link stabber for any given But we show that this is not true in our case, for we
set of disjoint convex objects that must be stabbed in can design a relatively simple version of our algorithm
some given order (not necessarily just by increasing that uses only the most simple versions of parametric
^-coordinates). Robert and Toussaint [52] study the searching (which can be made even more practically
problem of finding a line L that minimizes a weighted efficient via randomization).
minmax error measure to a set of convex polygons in In the section that follows we give some properties
of a best fc-link approximation and in Section 3 we show
0(n2 log n) time.
There has also been a considerable amount of work how to exploit these properties to restrict the range of
on finding a minimum-link approximation to a polygo- candidate e values. We show how to then complete the

323
T
_L
Figure 1: An example set 5 such that 5(e*) has
a 1-link ordered stabber, but any ordered stabber
of 5(e) requires 10 links if e < e*.

construction in Section 4 by relying on additional geo-


metric properties of a best fc-link approximation, which
/>[<>,
we show can be exploited in a series of applications of
parametric searching. Finally, we show how to simplify
our implementation in Section 5.

Figure 2: An instance where a minimum-link


2 Some Properties of a Best k- stabber of 5(e) is not confined to lie between U(e)
Link Approximation and G(e).

Let 5 = (pi, p2,..., pn) be a left-to-right ordered listing


of the points in 5 and let e > 0 be given. So as to for-
constrained to lie between U(e*) and G(e*), but this
mally define our approximation problem and articulate
is not the case1 (as shown in Figure 2). This is ac-
some of its important properties, let us introduce a bit
tually a good thing, for otherwise we would run into
of additional notation. For each point pt = (xl.yi) in
some robustness difficulties, for we would have to use
5 define ut = (xz,yt + e) and gt = [xl,yl - e), and
a method for finding a minimum-link path in a simple
let 5(e) denote the ordered set of vertical segments
polygon as a subroutine, and, as Snoeyink observers2,
(uigi,u2g2, ■ ■ ■ ,ungn). Thus, if we view points as de-
the bit complexity for finding such a path can be sign-
generate segments, then 5 = 5(0). For any ordered set
ficantly larger than the bit complexity for representing
of disjoint geometric objects A a polygonal chain C is
the vertices of the input polygon. This is no problem
an ordered stabber if a traversal of C intersects the ob-
for our method, however, for we will be using methods
jects of A in the given order [29], Finally, define F(e)
for finding minimum-link stabbers as subroutines in our
to be a minimum-link ordered stabber of 5(e).
algorithm, and these methods do not suffer from this
The formal problem we address in this paper, then,
bit complexity blow-up difficulty.
is to find e*, the smallest e > 0 such that F(e) has
To describe why we can use minimum-link stabber
at most k links. Formulating the problem in this way
methods as subroutines, we must show how to restrict
allows us to deal with "degenerate" inputs, such as the
F to a certain canonical form. For a given e, let nu(e)
one illustrated in Figure 1, where 5(e*) may allow an
be the shortest path from u\ to un that does not go
ordered stabber with k' < k links, but a minimum-link
above U(e) and does not cross G(e). Similarly, let 7r5(e)
stabber of 5(e) may require k > k links for any e < e*.
be the shortest path from g± to gn that does not go
Thus, a best fc-link approximation F = F{e*) may, in
below G(e) and does not cross U(e). Such paths were
fact, have fewer than k links because of degeneracies.
introduced by Lee and Preparata [38] and are often
Of course, one can always introduce "dummy" vertices
referred to as geodesic paths [1, 7, 10, 25, 28, 45, 46,
along F to force its link-count to be exactly k in such
56], and the union of two such paths is often called an
a case.
hourglass [22, 26]. Let us therefore use H(e) to denote
this hourglass 7ru(e)U7rs(e). We say that an edge oiH(e)
2.1 A Canonical Form for Best /c-Link is an inflection edge if one of its endpoints lies on U(e)
Approximations while its other endpoint lies on G(e). Let 1(e) denote
the set of all such inflection edges. (See Figure 3.)
Let us connect consecutive <?2's and u^s so as to form
We say that two consecutive links pq and qf in F
two "parallel" monotone chains U(e) and G(e), with
have a zig turn type if r is above the ray pq" (i.e., pq
U(e) being the upper chain, i.e., let us create edges
and qf form a "left turn"). Similarly, two consecutive
9i9i+i defining G(e) and Ui,ui+i defining U{e) for
i G {1, 2,..., n - 1}. One might be tempted to think 'We are indebted to Jack Snoeyink (personal communication)
that a best /c-link function F approximating 5 can be for pointing this example out to us.
2
Again, by a personal communication.

324
Figure 3: An example hourglass. The inflection
edges are shown shadded.

links pq and qr in F a zag turn type if r is below the ray


p%. This allows us to characterize each link in F, other
than the first and last links, by the turn types they
form with their predecessor and successor links. For
example, a zig-zag link forms a left turn with its pre-
decessor and a right turn with its successor. The next
lemma establishes an important relationship between
such links and inflection edges in /(e).

Lemma 2.1: There is a best k-link function F approx-


imating S such that
1. each e G I(e*) is contained by the first or last link
ofF or by a zig-zag or zag-zig link ofF, and
2. the first and last link ofF, as well as each zig-zag
and zag-zig link ofF, contains an e € I{e*)-

Proof: (1:) Suppose e £ I{e*), i.e., e is an inflection


edge of H(e*). Also suppose, for the sake of contra-
diction, that e is contained in no link of the appropri-
ate type in any best fc-link approximation F. We will
follow a proof technique of Ghosh [23], which involves
performing local perturbations of a candidate stabber, Figure 4: Example zig-zag edges. In (a) we il-
to derive a contradiction. Since e is an inflection edge, lustrate why an inflection edge is contained in a
it connects a m to a g0; hence, F must intersect e along zig-zag link, and in (b) we illustrate why a zig-zag
some link A, for F cannot go above any m nor below link contains an inflection edge.
any g3. Let us assume for the time being that A is nei-
ther the first nor last link of F, and let A~ denote A's
predecessor and let A+ denote A's successor. Also, let
L(e) denote the line containing e and let B denote the
set of all points on some segment from a point p on A~,
A, or A+ to p's nearest neighbor on L(e), i.e., the points
"between" L(e) and A", A, and A+. B can contain no
points of U(e*) nor G(e*), for if this were not the case,
then e would not be an inflection edge (e.g., see Fig-
ure 4a). Thus, we can "move" the common endpoint
of A" and A to be on L(e), and the common endpoint
of A and A+ to be on L{e), keeping the rest of F fixed,
and we will keep F as a fc-link approximation to 5. To

325
establish that A must be a zig-zag or zag-zig link, note 3.1 Enumerating all geodesic-critical e
that the first place where the ray mg] crosses G(e*) values
cannot be before the first place it crosses t/(e*), and,
likewise, the first place where the ray gjm* crosses U(e*) Our method for enumerating all geodesic-critical e val-
cannot be before the first place it crosses G(e*) (e.g., ues is based upon a sweep through "e space." We main-
see Figure 4a). If this were not so, mg] would not be tain the hourglass H(e) = 7ru(e) U 7rs(e) while taking e
an inflection edge of H(e*). Thus, either A is the first from 0 to +00, stopping at each geodesic-critical e value
along the way. To simplify the discussion, however, let
or last link of F (which occurs if one of the rays ulg] or
us concentrate on the problem of maintaining iru(e),
gjm crosses neither U(e*) nor G(e*)) or A is a zig-zag or so that we restrict our notion of geodesic-critical e's to
zag-zig link (since F is a minimum-link approximation those that change TTu(e); the method for maintaining
to S(e*)). Similar (actually simpler) arguments hold TTg(e) is similar. Initially, for e = 0, nu(e) is the chain
for the cases when A- or A+ do not exist, and are left U(e) = G(e); hence, it consists of n — 1 edges. If we
to the reader. Therefore, there is a best fc-link approx- then increase e by an "infinitesimal" amount we find
imation to 5 that contains each edge in S, and each that some of the vertices of iru(e) lie on U(e) while oth-
such edge is contained in the first or last link of F or ers lie on G(e). For any vertex p on nu(e), if one of
in a zig-zag or zag-zig link. p's adjacent vertices on 7ru(e) lies on the chain oppo-
(2:) For the second part of the lemma, let m be site from the chain that p lies on, then we say that p
the minimum number of zig-zag, zag-zig, first, and last is a pinch vertex. For each pinch vertex p on 7ru(e),
links that do not contain any edge in I(e*), taken over let q and r denote p's adjacent vertices on iru(e), and
all best A;-link approximations to S satisfying part one compute the e > t value at which p would cease to be a
of the lemma (which we have just shown to be true). pinch vertex if we were to restrict U(e) and G(i) to that
In addition, let A = pq be one of these m links. Let portion of the plane bounded by the lines x = x(q) and
us assume for the time being that A is zig-zag link in x = x(r) inclusive, where x(t) denotes the ^-coordinate
F. Let A~ = fp denote the predecessor of A in F and of a point t. Call this e value locally-critical for p, and
let A+ = qs denote the successor of A in F. Since let E be the set of all e's that are locally-critical for
F is a minimum-link path, the line rs must intersect pinch vertices on 7r„(e).
both U{e*) and G(e*)(e.g., see Figure 4b). But this
implies that F crosses an inflection edge, which is a Lemma 3.1: The smallest e in E is the smallest
contradiction; hence, we establish the second part of geodesically-critical value bigger than e.
the lemma for this case. The proofs for the other cases
are similar; hence, this establishes the lemma. G Proof: Let e' be the smallest geodesically-critical value
bigger than e. If we were to increase e' "infinitesimally,"
Having established an important property of some then, by definition, 7r„(e') would have at least one fewer
of the links in a best fc-link function approximation to edge. For this to occur, two consecutive edges of iru(e')
S, let us now turn to the problem of enumerating these would have to be replaced by a single edge. Thus, the
edges, and in the process we will also restrict the range vertex incident upon the two removed edges is a pinch
of e's that allow a /c-link approximation. vertex; hence e' is in E. Now, let e" be the smallest
value in E. Since there is no value in E smaller than e"
in E, iru{e) does not change for e G (e,e"]. Thus, there
3 Finding the Inflection Edges is a global change to iru(e) for e > e", which implies that
e" is geodesically-critical. Therefore, e' = e", which
We say that an e is geodesic-critical if H(e) has I edges,
completes the proof. □
but H(e) has fewer than / edges for e > e. Our method
for finding all the inflection edges is to determine an
Our method for maintaining 7rn(e), then, is as fol-
interval [£1,62] that contains e* and is such that H(e{)
lows. We store the values belonging to £ in a priority
is combinatorially equivalent to i?(e2). This will allow
queue that supports the operations of insert, delete,
us to determine all inflection edges that F must con-
and extract-min in O(logn) time (e.g., see [17]). While
tain. Our procedure is conceptually quite simple. First
E is not empty, we extract the smallest e in E, perform
we enumerate all 0(n) geodesic-critical e values, and
the modification of nu(e) implied by this geodesically-
then we perform a binary search among these values to
critical value, and then update E to reflect the new
determine the interval [ei,£2] containing e*.
geodesic path. This update involves examining the two
vertices of iru(e) that now become adjacent and up-
dating E accordingly. If either of them were previ-
ously pinch vertices, then we remove its corresponding
locally-critical value from E. Likewise, if either of them

326
becomes a pinch vertex after performing the update technique, as optimized by Cole [13, 14]. One such op-
for e, then we insert its new locally-critical value into timization applies to any situation that involves a set
E. Since we reduce by one the number of edges of the Z = {zi,Z2,...,zm}ofm independent binary searches
geodesic path with each event in E, the total number among an ordered set A = (ai, a2,. • •, an) of n items,
of events must be 0{n); hence, the total time to enu- where each comparison c{az,z3) is parameterized by e.
merate all the geodesically-critical values is 0(n log n). The outcome of c(a,i,Zj) depends upon which of a con-
Given these geodesically-critical values it is then a stant number of intervals, determined by a» and Zj,
simple manner to determine the consecutive pair that contain e*. If it takes T steps to determine if e* < e,
contains e* by using the method of Hershberger and for a particular e, then this parametric searching tech-
Snoeyink [32], Guibas et al. [29], or Hakimi and Schme- nique allows us to perform all m binary searches in
ichel [30] to drive a binary search among the set of 0{{T + m)(logn + logm)) time (see Cole [13] for de-
geodesically-critical values. Using one of these simple tails). It also gives us an interval [e1,e2] containing e*,
algorithms, all of which are based upon the "greedy which is the intersection of all the intervals determined
method," to test if a given e is smaller than e* takes to contain e* during the m searches.
0{n) time. This implies that we can determine, in The second optimization applies when one wishes
0(nlogn) time, the combinatorial structure of 7ru(e*), to sort a set A = {ai,a2,. •. ,an}, where, as in the
and, as mentioned above, a similar procedure gives us previous case, each comparison c{az,aj) is parameter-
the combinatorial structure of 7r5(e*). Therefore, we ized by e so that the outcome of c{ai,aj) depends upon
can identify all the inflection edges in H(e*), each of which of a constant number of intervals, determined
which F must contain, by Lemma 2.1. by a, and a0, contain e*. If it takes T steps to deter-
All that is left, then, is for us to determine all the mine if e* < e, for a particular e, then this parametric
links of F that do not contain inflection edges. searching technique allows us to sort the elements of A
in 0({T + n) logn) time (see Cole [13, 14] for details).
Also, this method gives an interval [ei, e2] containing e*,
4 Completing the Construction which is the intersection of all the intervals determined
to contain e* during the sort.
Whereas we used geodesic paths to find the zig-zag and The challenge, of course, in applying these tech-
zag-zig links, to complete the construction we use a re- niques is to design the parameterized sorts and searches
lated structure—the visibility graph. In particular, re- so that the result is meaningful. Let us therefore turn
call that the visibility graph of a set of line segments R to our application of these techniques.
has a vertex for each endpoint of a segment in R and an
edge for each pair (p, q) such that the line segment pq
4.1 Finding e*
does cross any segment in R, although we allow pq to
intersect segment endpoints and even contain the seg- Our method for completing the construction is to
ment pq if it is in R. It is well-known, for example, that perform a parametric search for a {/-anchored or G-
geodesic paths always follow visibility graph edges3. In anchored link satisfying Lemma 4.1. Observe that find-
our case we are interested in the visibility graph defined ing such a link effectively "clamps" U{t) and G(e) at
on the segments in U(e)uG{e). We say that an line seg- e = e*. Also note that we can use the linear-time
ment s is U-anchored (resp., G-anchored) if s contains method of Hershberger and Snoeyink [32], Guibas et
an edge e in the visibility graph of U{e*) U G(e*) such al. [29], or Hakimi and Schmeichel [30] to resolve com-
that both of e's vertices lie on U(e*) (resp., G(e*)). The parisons and to give us the final approximation F once
following lemma establishes an important relationship we have narrowed the interval of candidate e values to
between a best fc-link function approximation to S and
these anchored links. To simplify the discussion let us concentrate on the
problem of determining a [/-anchored link that contains
Lemma 4.1: Any canonical best k-link approximation a vertex of G(e*); the method is similar for visibility
to S has a U-anchored link containing a vertex ofG(e*) edges anchored on G(e). Our algorithm will actually
or a G-anchored link containing a vertex ofU(e*). "dovetail" the search for a {/-anchored link containing
a vertex of G(e*) with the search for a G-anchored link
Proof: The proof follows immediately from the char- containing a vertex of U(e*).
acterization lemma of Hakimi and Schmeichel [30]. □ Call a vertex p of U{t) a left inflection (resp., right
inflection) vertex if p is the left (resp., right) endpoint
Our method for enumerating all such edges is based of an inflection edge of H{e*). Following an approach
upon several applications of the parametric searching similar to that used by Ghosh [23], consider a portion of
3
For more information about visibility graphs and their prop- U(e) between a left inflection vertex p and the leftmost
erties see the excellent book by O'Rourke [50].

327
comparisons, to sort all l(w) and r(w) lists in O(nlogn)
time. This may still not restrict the range of e values
to [e*, e*], however, for the vertices in an l(w) and r(w)
may have the same ordering with respect to w over a
range of e values.
Therefore, to complete the process we must perform
one more application of parametric searching where we
perform a binary search in l(w) for each z G r(w) to
locate the vertex in l(w) hit by the ray zt{z), if it exists.
Given that each l(w) is now sorted, we can perform all
of these binary-search parametric searches in 0(n log n)
time. Since one of these searches (or a corresponding
search for G-anchored edges) must succeed, we finally
are guaranteed to have restricted the range of candi-
Figure 5: A [/-anchored edge determining e* date e values to the interval [e*,e*]. Moreover, seeing
how the last comparison in this parametric search was
resolved using a minimum-link ordered stabber algo-
right inflection vertex q to the right of p. Denote this rithm, this completes the construction, giving us the
portion of U(e) as C/[P]?](e). Note that the portion of following theorem.
iru(e*) between p and q is a convex chain of edges such
Theorem 4.2: Given a set S ofn points in the plane,
that each consecutive pair forms a "right turn." De-
and an integer parameter 1 < k < n - 1, one can con-
note this portion of iru(e*) as n\p, q] (but note that we
struct a best k-link approximation to S under the uni-
have yet to determine e*—at this point we only know
form metric in O(nlogn) time.
the combinatorial structure of nu(e*)). Finally, observe
that if U[Pjq] (e) contains the endpoints v and z of the
c^-anchored link that we seek, then vz must be equal 5 Simplifying the Implementa-
to the the common tangent of v and n[p, q] as well as
z and ir[p, q]. (See Figure 5.) Moreover, if the link sat- tion
isfying Lemma 4.1 is a [/-anchored link, then it must
contain such a tangent edge for some [/[Pj9](e). Although our method for finding a best fc-link approx-
imation to S is conceptually simple at a high level, im-
Our first parametric search therefore is to determine
plementing it in practice would probably not be so easy.
for each vertex v on U[p^(e) its vertex of tangency, t(v),
with the convex chain n[p, q] at e = e* (see Figure 5). The chief difficulty arises from the (up to) three calls
to parametric searching that are made at the end of
In this case we can use binary-search-based parametric
the algorithm; all the other steps would be relatively
searching [13] applied to a well-known "binary search"
straightforward to implement. But those calls to para-
tangent-finding method (e.g., see [21, 51]) to find all
metric searching, especially the version based upon a
such tangents in 0(n log n) time. This may still not
parametric sorting, would be a challenge to implement,
restrict our interval of e values to [e*,e*], however, for
and the constant factors they would imply in the run-
a vertex v will have the same vertex of tangency, t(v),
over a range of e values. ning time would not be very small. Fortunately, as
we show in this section, we can considerably simplify
For each vertex w on n[p, q], collect each vertex v
these calls to parametric searching. In particular, we
on [/[Pl9](e) such that w = t(v) into two sets—l(w),
show how to eliminate the (second) call based upon
containing the vertices to the left of w, and r(w), con-
sorting all together, and we observe how one can sim-
taining the vertices to the right ofw. If w is the vertex
plify all our calls to parametric searching through a
of tangency for the [/-anchored edge we seek, then that
simple randomization technique. The resulting algo-
edge is determined by a« £ l(w) and a z 6 r(w).
rithm will still be guaranteed to find a best fc-link ap-
In order for these two vertices to be able "search for
proximation to S, however, for the randomization will
each other," however, we must first order the vertices
only impact the running time of our method, not its
in l(w) and r(w) radially around w. To accomplish this
correctness. Nevertheless, it will result in a method
we make a second application of parametric searching,
that runs in O(nlogn) time with very high probabil-
this time using the second version, based upon a paral-
ity. Moreover, the (expected) constant factors will be
lel sorting algorithm [13, 14], together with the linear-
reasonably small.
time method of Hershberger and Snoeyink [32], Guibas
Let us begin by describing how we can eliminate
et al. [29], or Hakimi and Schmeichel [30] for resolving
the call to sorting-based parametric searching, which

328
So, let us turn to the problem of determining the
members of lvia(w) for some given w on ir\p,q]. Let
w' denote the vertex on t/[p,g](e) directly above w (i.e.,
if w = gu then w' = Ui). A simple consequence of
the proof of Lemma 5.1 is that a vertex v in l(w) is
in lvis(w) if and only if the geodesic path from v to
w' is above the line segment vw. Indeed, it is suffi-
cient that the first edge e(v) in this path be above the
segment vw. Since each such geodesic path remains
unchanged for e € [ei,e2] (because it is a sequence of
left turns that occur at vertices of */[p,,](e))> we can
determine e(v) for each such v without knowing the
value of e*. Specifically, we can use the data structure
of Guibas and Hershberger [27], as simplified by Her-
shberger [31], to determine each e(v) in O(logra) time.
Figure 6: An illustration of why lvis(w) is already This data structure is relatively simple to construct and
sorted. query, especially since each U[Ptq]{e) is a single mono-
tone chain.
Note that each e(v) determines a critical iv value
comprises the second call to parametric searching in our such that v is visible if e > e, and v is not visible oth-
algorithm. Recall that after we have made our first call erwise. Thus, once we have determined all the e(u)'s,
to (binary-search based) parametric searching, we have we can then determine which v's are visible from their
determined for every vertex v on U[Piq](e) its tangent, respective w = t(v) vertices simply by resolving all of
t(y) on n\p,q]. Previously, we then collected, for each the e's against e* using the method of Hershberger and
w on 7r[p,g], all the vertices on U[pA](e) whose tangent Snoeyink [32], Guibas et al. [29], or Hakimi and Schme-
is w to the "left set" l(w) and the "right set" r(w), and ichel [30] to drive a binary search. Since there are 0(n)
we sorted the vertices of l(w) radially around w (using such parameterized comparisons, and each resolution
sorting-based parametric searching) so that we can then requires 0(n) time, the total time needed to resolve all
do a binary search in l(w) for each vertex in r(w) (using of these comparisons is 0{n log n). This implies that
binary-search based parametric searching). Observe, we can substitute the most simple form of paramet-
however, that we do not need all the vertices of l(w) to ric searching for the more-complicated sorting-based
perform this search; we need only those vertices that method [13, 14]. The resulting algorithm would still
are visible from w on U[p^{t*). Thus, let us use lvis(w) run in 0(n log n) time. The only slightly impractical
to denote the set of vertices in l(w) that are visible steps in this algorithm are repeated computations of
from w on U[pA]{e*). If we can determine these visible medians (e.g., of the remaining unresolved e's in each
vertices, then,' as the following lemma shows, we can iteration of the above binary search), for which the best
sort them without resorting to parametric searching. deterministic algorithm has a relatively large constant
(e.g., see [17]).
Lemma 5.1: Sorting the vertices of lvis{w) radially But the computation of a median or weighted me-
around w as they appear on U[p,q](e*) gives the same dian (which is the least-efficient step in the binary-
order as a listing of the vertices oflvis{w) by increasing search based parametric searching method of Cole [13])
x-coordinates. can be significantly improved in practice through the
use of randomization (e.g., see [17]). The effect in our
Proof: Suppose, for the sake of a contradiction, that case is that the resulting algorithm will still be guaran-
there are two vertices u and z in lvis{w) such that u is teed to find a best fe-link approximation, but it will not
before z in a radial listing around w as they appear on be guaranteed to run in 0{n log n) time. Nevertheless,
t/[p,,](£*), but x(z) < x(u). (See Figure 6.) Since w it will run in 0{n log n) time with very high probabil-
is below the curve U[Ptq]{e*), this implies that U[Piq]{e*) ity, and the (expected) constants factors in the running
intersects the segment zw. But this contradicts the time will be very reasonable. Thus, we suggest such
fact that z is visible from tu; hence, this establishes the a use of randomization in any implementation of our
lemma. □ method.
Thus, it is sufficient for us to determine the mem-
bers of lvis(w), for each w on ir\p,q], since they are
already given by increasing x-coordinates (for that is
how the vertices are ordered in S).

329
6 Conclusion and Directions for [8] R. E. Bellman and R. S. Roth, "Curve fitting by seg-
Future Work mented straight lines," American Statistical Associa-
tion Journal, 64, 1079-1084, 1969.
We have given an 0(n log n)-tirae method for finding [9] R. E. Bellman and R. S. Roth, Methods in Approxima-
a best fc-link approximation to set of n points in the tion: Techniques for Mathematical Modelling, D. Rei-
del Publishing Co., Boston, 1986.
plane under the uniform metric, and we have even
given a method for efficiently implementing it in prac- [10] B. Chazelle, H. Edelsbrunner, M. Grigni, L. Guibas,
tice. This suggests a number of interesting directions J. Hershberger, M. Sharir, and J. Snoeyink, "Ray
shooting in polygons using geodesic triangulations," in
for future work. Some possibilities include examining
Proc. 18th Internat. Colloq. Automata Lang. Program.,
metrics other than the uniform metric, approximating Lecture Notes in Computer Science, vol. 510, Springer-
with higher-degree spline functions, and approximat- Verlag, 661-673, 1991.
ing more-general types of geometric objects (such as
[11] B. Chazelle, H. Edelsbrunner, L. Guibas, and
segments joined in a polygonal path). As with our re- M. Sharir, "Diameter, width, closest line pair, and
sults, the general goal should be to find a best fc-piece parametric searching," in Proc. 8th Annu. ACM Sym-
approximation, since this is the version of the prob- pos. Comput. Geom., 120-129, 1992.
lem driven by bounds placed upon the computational
[12] K. L. Clarkson, "Linear programming in 0(n3rf2)
resources needed to represent the approximation. time," Inform. Process. Lett., 22, 21-24, 1986.
[13] R. Cole, "Slowing down sorting networks to obtain
Acknowledgements faster sorting algorithms," J. ACM, 34, 200-208, 1987.
I would like to thank Jack Snoeyink for some stimulat- [14] R. Cole, "Parallel merge sort," SIAM J. Comput.,
ing discussions regarding minimum-link function approxi- 17(4), 770-785, 1988.
mations, for several helpful comments regarding earlier ver- [15] R. Cole, J. Salowe, W. Steiger, and E. Szemeredi, "An
sions of this paper, and, in particular, for pointing out the optimal-time algorithm for slope selection," SIAM J.
counter-example illustrated in Figure 2. Finally, I would Comput., 18, 792-810, 1989.
like to thank Esther Arkin, Mikhail Atallah, Paul Chew, Si-
mon Kasif, S. Rao Kosaraju, Joe Mitchell, and David Mount [16] S. D. Conte and C. de Boor, Elementary Numeri-
for several helpful discussions concerning this and related cal Analysis: An Algorithmic Approach, McGraw-Hill,
problems. New York, 3rd edition, 1980.
[17] T. H. Cormen, C. E. Leiserson, and R. L. Rivest, In-
troduction to Algorithms, The MIT Press, Cambridge,
References Mass., 1990.
[18] P. J. Davis, Interpolation and Approximation, Blaisdell
[1] P. K. Agarwal, A. Aggarwal, B. Aronov, S. R.
Publishing Co., New York, 1963.
Kosaraju, B. Schieber, and S. Suri, "Computing exter-
nal farthest neighbors for a simple polygon," Discrete [19] P. Dierckx, Curve and Surface Fitting with Splines,
Appl. Math., 31(2), 97-111, 1991. Clarendon Press, New York, 1993.
[2] P. K. Agarwal, B. Aronov, M. Sharir, and S. Suri, [20] M. E. Dyer, "Linear time algorithms for two- and three-
"Selecting distances in the plane," in Proc. 6th Annu. variable linear programs," SIAM J. Comput., 13 31-
ACM Sympos. Comput. Geom., 321-331, 1990. 45, 1984.

[3] P. K. Agarwal and J. Matousek, "Ray shooting and [21] H. Edelsbrunner, Algorithms in Combinatorial Geome-
parametric search," in Proc. 24th Annu. ACM Sympos. try, EATCS Monographs on Theoretical Computer Sci-
Theory Comput., 517-526, 1992. ence, vol. 10, Springer-Verlag, Heidelberg, West Ger-
many, 1987.
[4] P. K. Agarwal, M. Sharir, and S. Toledo, "Applica-
tions of parametric searching in geometric optimiza- [22] H. ElGindy and M. T. Goodrich, "Parallel algorithms
tion," in Proc. 3rd ACM-SIAM Sympos. Discrete Al- for shortest path problems in polygons," Visual Corn-
gorithms, 72-82, 1992. put., 3, 371-378, 1988.

[5] A. Aggarwal, H. Booth, J. O'Rourke, S. Suri, and C. K. [23] S. Ghosh, "Computing visibility polygon from a convex
Yap, "Finding minimal convex nested polygons," in set and related problems," J. Algorithms, 12, 75-95
Proc. 1st Annu. ACM Sympos. Comput. Geom., 296- 1991.
304, 1985. [24] S. K. Ghosh and A. Maheshwari, "Parallel algorithms
[6] E. M. Arkin, J. S. B. Mitchell, and S. Suri, "Opti- for all minimum link paths and link center problems,"
mal link path queries in a simple polygon," in Proc. in Proc. 3rd Scand. Workshop Algorithm Theory, Lec-
3rd ACM-SIAM Sympos. Discrete Algorithms, 269- ture Notes in Computer Science, vol. 621, Springer-
279, 1992. Verlag, 106-117, 1992.

[7] B. Aronov, "On the geodesic Voronoi diagram of point [25] M. T. Goodrich and R. Tamassia, "Dynamic ray shoot-
sites in a simple polygon," Algorithmica, 4, 109-140 ing and shortest paths via balanced geodesic triangu-
1989. lations," in Proc. 9th Annu. ACM Sympos. Comput.
Geom., 318-327, 1993.

330
[26] L. J. Guibas and J. Hershberger, "Optimal shortest [42] N. Megiddo, "Linear-time algorithms for linear pro-
path queries in a simple polygon," in Proc. 3rd Annu. gramming in R3 and related problems," SIAM J. Corn-
ACM Sympos. Corn-put. Geom., 50-63, 1987. put, 12, 759-776, 1983.
[27] L. J. Guibas and J. Hershberger, "Optimal shortest [43] N. Megiddo, "Linear programming in linear time when
path queries in a simple polygon," J. Comput. Syst. the dimension is fixed," J. ACM, 31,.114-127, 1984.
Sei., 39, 126-152, 1989. [44] A. Melkman and J. O'Rourke, "On polygonal chain
[28] L. J. Guibas, J. Hershberger, D. Leven, M. Sharir, and approximation," in Computational Morphology, G. T.
R. E. Tarjan, "Linear-time algorithms for visibility and Toussaint, editor, North-Holland, Amsterdam, Nether-
shortest path problems inside triangulated simple poly- lands, 87-95, 1988.
gons," Algorithmica, 2, 209-233, 1987. [45] J. S. B. Mitchell, "An algorithmic approach to some
problems in terrain navigation," Artif. Intell., 37, 171-
[29] L. J. Guibas, J. E. Hershberger, J. S. B. Mitchell, and
J. S. Snoeyink, "Approximating polygons and subdivi- 201, 1988.
sions with minimum link paths," in Proc. 2nd Annu. [46] J. S. B. Mitchell, D. M. Mount, and C. H. Papadim-
SIGAL Internat. Sympos. Algorithms, Lecture Notes in itriou, "The discrete geodesic problem," SIAM J. Corn-
Computer Science, vol. 557, Springer-Verlag, 151-162, put., 16, 647-668, 1987.
1991. [47] J. S. B. Mitchell, C. Piatko, and E. M. Arkin, "Com-
[30] S. L. Hakimi and E. F. Schmeichel, "Fitting polygo- puting a shortest fc-link path in a polygon," in Proc.
nal functions to a set of points in the plane," CVGIP: 33rd Annu. IEEE Sympos. Found. Comput. Sei., 573-
Graph. Mod. Image Proc, 53(2), 132-136, 1991. 582, 1992.
[31] J. Hershberger, "A new data structure for shortest path [48] J. S. B. Mitchell, G. Rote, and G. Woeginger,
queries in a simple polygon," Inform. Process. Lett., "Minimum-link paths among obstacles in the plane,"
38, 231-235, 1991. in Proc. 6th Annu. ACM Sympos. Comput. Geom., 63-
72, 1990.
[32] J. Hershberger and J. Snoeyink, "Computing minimum
length paths of a given homotopy class," in Proc. 2nd [49] J. S. B. Mitchell and S. Suri, "Separation and approx-
Workshop Algorithms Data Struct., Lecture Notes in imation of polyhedral surfaces," in Proc. 3rd ACM-
Computer Science, vol. 519, Springer-Verlag, 331-342, SIAM Sympos. Discrete Algorithms, 296-306, 1992.
1991. [50] J. O'Rourke, Art Gallery Theorems and Algorithms,
[33] H. Imai and M. Iri, "Computational-geometric meth- Oxford University Press, New York, NY, 1987.
ods for polygonal approximations of a curve," Comput. [51] F. P. Preparata and M. I. Shamos, Computational Ge-
Vision Graph. Image Process., 36, 31-41, 1986. ometry: an Introduction, Springer-Verlag, New York,
[34] H. Imai and M. Iri, "An optimal algorithm for approx- NY, 1985.
imating a piecewise linear function," Journal of Infor- [52] J.-M. Robert and G. Toussaint, "Linear approxima-
mation Processing, 9(3), 159-162, 1986. tion of simple objects," in Proc. 9th Sympos. Theoret.
[35] H. Imai and M. Iri, "Polygonal approximations of a Aspects Comput. Sei., Lecture Notes in Computer Sci-
curve-formulations and algorithms," in Computational ence, vol. 577, Springer-Verlag, 233-244, 1992.
Morphology, G. T. Toussaint, editor, North-Holland, [53] R. Seidel, "Small-dimensional linear programming and
Amsterdam, Netherlands, 71-86, 1988. convex hulls made easy," Discrete Comput. Geom., 6,
[36] D. L. B. Jupp, "Approximation to data by splines 423-434, 1991.
with free knots," SIAM Journal on Numerical Anal- [54] S. Suri, "A linear time algorithm for minimum link
ysis, 15(2), 328-343, 1978. paths inside a simple polygon," Comput. Vision Graph.
Image Process., 35, 99-110, 1986.
[37] Y. Ke, "An efficient algorithm for link-distance prob-
lems," in Proc. 5th Annu. ACM Sympos. Comput. [55] S. Suri, Minimum link paths in polygons and related
Geom., 69-78, 1989. problems, Ph.D. thesis, Dept. Comput. Sei., Johns
Hopkins Univ., Baltimore, MD, 1987.
[38] D. T. Lee and F. P. Preparata, "Euclidean shortest
paths in the presence of rectilinear barriers," Networks, [56] S. Suri, "Computing geodesic furthest neighbors in
14, 393-410, 1984. simple polygons," J. Comput. Syst. Sei., 39, 220-235,
1989.
[39] W. Lenhart, R. Pollack, J.-R. Sack, R. Seidel,
M. Sharir, S. Suri, G. T. Toussaint, S. Whitesides, and [57] G. T. Toussaint, "On the complexity of approximating
C. K. Yap, "Computing the link center of a simple polygonal curves in the plane," in Proc. IASTED, In-
polygon," Discrete Comput. Geom., 3, 281-293, 1988. ternational Symposium on Robotics and Automation,
Lugano, Switzerland, 1985.
[40] J. Matousek, M. Sharir, and E. Welzl, "A subexponen-
tial bound for linear programming," in Proc. 8th Annu. [58] D. P. Wang, N. F. Huang, H. S. Chao, and R. C. T. Lee,
ACM Sympos. Comput. Geom., 1-8, 1992. "Plane sweep algorithms for polygonal approximation
problems with applications," in Proc. 4th Annu. Inter-
[41] N. Megiddo, "Applying parallel computation algo- nat. Sympos. Algorithms Comput. (ISAAC 93), Lecture
rithms in the design of serial algorithms," J. ACM, Notes in Computer Science, vol. 762, Springer-Verlag,
30, 852-865, 1983. 515-522, 1993.

331
Applications of Weighted Voronoi Diagrams and Randomization
to Variance-Based ^-Clustering
(Extended Abstract)

Mary Inaba*, Naoki Katoht and Hiroshi Imai*

Abstract in 0(n(l/e)d) time, which is quite practical and may


be used to real large-scale problems such as the color
In this paper we consider the fc-clustering problem for
quantization problem.
a set S of n points p{ = (a;,) in the (^-dimensional space
with variance-based errors as clustering criteria, moti-
vated from the color quantization problem of comput- 1 Introduction
ing a color lookup table for frame buffer display. As
the inter-cluster criterion to minimize, the sum of intra- Clustering is the grouping of similar objects and a clus-
cluster errors over every cluster is used, and as the intra- tering of a set is a partition of its elements that is cho-
cluster criterion of a cluster Sji sen to minimize some measure of dissimilarity. It is very
fundamental and used in various fields in computer sci-
i^r1 E n*.--*os;)ii2 ence such as pattern recognition, learning theory, im-
age processing and computer graphics. There are vari-
is considered, where || • || is the L2 norm and x(Sj) is ous kinds of measure of dissimilarity, called criteria, in
thecentroidofpointsinS,-,i.e., (l/|5j|) SPi6s xi- Tne compliance with the problem.
cases of a = 1,2 correspond to the sum of squared errors
Definition of the fc-clustering problem: The gen-
and the all-pairs sum of squared errors, respectively.
eral ^-clustering problem can be defined as follows. A
The ^-clustering problem under the criterion with
fc-clustering is a partition of the given set S of n points
a = 1,2 are treated in a unified manner by charac-
Pi = (*i) (i = 1, • • •, n) in the d-dimensional space into
terizing the optimum solution to the /^-clustering prob-
k disjoint nonempty subsets Si,..., Sk, called clusters.
lem by the ordinary Euclidean Voronoi diagram and the
A ^-clustering is measured by the following two criteria.
weighted Voronoi diagram with both multiplicative and
(Intra-cluster criterion) For each cluster Sj, the
additive weights. With this framework, the problem
measure (or error) Intra(S,-) of Sj, representing how
is related to the generalized primary shutter function
good the cluster Sj is, is defined appropriately by
for the Voronoi diagrams. The primary shutter func-
applications. Typical intra-cluster criteria are the di-
tion is shown to be 0{n0(kd)), which implies that, for
ameter, radius, variance, variance multiplied by \Sj\
fixed k, this clustering problem can be solved in a poly-
(sum of squared errors) and variance multiplied by
nomial time. For the problem with the most typical
|5j|2 (all-pairs sum of squared errors) of point set Sj.
intra-cluster criterion of the sum of squared errors, we
(Inter-cluster criterion) The inter-cluster criterion
also present an efficient randomized algorithm which,
defines the total cost of the fc-clustering, which is a
roughly speaking, finds an e-approximate 2-clustering
function of Intra(Sj) (j = l,...,k) and is denoted
* Department of Information Science, University of Tokyo, by lnter(yi,y2,...,yk) where yj = Intra(Sj). Typi-
Tokyo 113, Japan cal function forms are max{ yj \ j = 1,..., k } and
f
Department of Management Science, Kobe University of
i=l Vk-
Commerce, Kobe 651-21, Japan
Then, the ^-clustering problem is to find a ^-clustering
Permission to copy without fee all or part of this material is which minimizes the inter-cluster criterion:
granted provided that the copies are not made or distributed for min{ Inter(Intra(5i),. • • ,Intra(5fc)) |
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given ^-clustering (S\,...,Sk) of S }
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee Previous results concerning diameter and ra-
and/or specific permission.
dius: In computational geometry, many results have
10th Computational Geometry 94-6/94 Stony Brook NY USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
332
been obtained for the clustering problem. The di- clustering algorithm and to determine the complexity
ameter and radius problems are rather well studied. of the fc-clustering problem for the variance-based case.
They include an 0(n log ra)-time algorithm for finding Before describing the existing computational-geometric
a 2-clustering of n points in the plane which mini- results concerning variance-based case, let us define the
mizes the maximum diameter (Asano, Bhattacharya, variance-based intra-cluster criterion in a rigorous way.
Keil and Yao [1]), an 0(n2 log2 n)-time algorithm for The variance Var(S) of points pt = (x.) in S is defined
finding a 3-clustering of planar point set which mini- by
mizes the maximum diameter (Hagauer and Rote [5]), Var(S) = Tir£||x1--x(S)||2
and an 0(n log2 n/ log log n)-time algorithm for finding
a 2-clustering which minimizes the sum of the two di- where x(S) is the centroid of S:
ameters (Hershberger [10]). When k is regarded as a
variable, most fc-clustering problems become NP-hard
(e.g., see Megiddo and Supowit [14], Feder and Greene
^ = 4\s\ E Pi€S
Xi

[4]). For fixed fc, the fc-clustering problem using the For a parameter a, define VarQ'(5) by
diameter and radius as the intra-cluster criterion and Vara(S) = |5|aVar(5).
a monotone function, including taking the maximum
and the summation, as the inter-cluster criterion can Var° is exactly the variance itself. Var1 is represented
be solved in a polynomial time (Capoyleas, Rote and as
Var1(5)=^||xi-x(5)||2
Woeginger [3]).
Pies
There are also proposed approximate algorithms for
the diameter and radius whose approximation ratio is and hence is the sum of squared errors with respect to
theoretically guaranteed. Feder and Greene [4] gave op- the centroid of S. Var2 is represented as
timal approximate algorithms whose running time is Vai*(S)=|S|£ll**-*(<S)ll2
0(n\ogk) for n points in the d-dimensional space for Pi€S
fixed d, and whose worst-case ratio is 2. = J2 IN-*'II2
Pi.PiGS, i<l
Motivation for the variance-based clustering: In and hence is the all-pairs sum of squared errors in 5.
this paper, we consider the fc-clustering problem with Adopting Var" as the intra-cluster metric, as a becomes
variance-based measures as an intra-cluster criterion. larger, the sizes of clusters in an optimum fc-clustering
This is motivated from the color quantization prob- becomes more balanced.
lem of computing a color lookup table for frame buffer
display. Typical color quantization problems cluster Previous results on the variance-based cluster-
hundreds of thousands of points in the RGB three- ing: For the variance-based criteria, unlike the di-
dimensional space into k = 256 clusters. Since k is ameter and radius, the fc-clustering problem adopting
large, a top-down approach to recursively divide the the maximum function as the inter-cluster criterion be-
point set into 2 clusters is mostly employed. In this comes hard to solve. For this inter-cluster criterion
problem, the diameter and radius are not suited as an with the all-pairs sum of squared errors, only a pseudo-
intra-cluster criterion, and the variance-based (Wan, polynomial approximation scheme is known (Hasegawa,
Wong and Prusinkiewicz [15]) and L\ -based (median Imai, Inaba, Katoh and Nakano [7]). Also, in applica-
cut; Heckbert [9]) criteria are often used. In [15], [9], tions such as the color quantization problem, the sum-
the top-down approach is used and in solving the 2- mation function is adopted as an inter-cluster crite-
clustering problem both only treat separating planes rion [15]. In this paper, we consider only the summa-
orthogonal to some coordinate axis. These algorithms tion case, that is, the fc-clustering problem to minimize
are implemented in rlequant of Utah Raster Toolkit, the summation of variance-based intra-cluster costs over
and ppmquant of X11R5 or tiff median of Tiff Soft. Al- clusters.
though these implementations run rather fast in prac- For the variance-based clustering problem with the
tice, roughly speaking in O(nlogn) time, there is no summation function as an inter-cluster metric, the fol-
theoretical guarantee about how good their solution fc- lowing are known. Concerning Var1, the sum of squared
clusterings are. errors, it is well known that an optimum 2-clustering is
linearly separable and that an optimum fc-clustering is
Rigorous definition of the variance-based clus- induced by the Voronoi diagram generated by fc points
tering: Therefore, it is required to develop a fast 2- (e.g., see [2, 7,15]). Using this characterization together

333
with standard computational-geometric techniques, the problem.
2-clustering problem with Var1 as the intra-cluster met-
ric can be solved in 0(n2) time and 0(n) space, and the
fc-clustering problem is solvable in a polynomial time 2 A unified approach to the
when k is fixed [7]. Concerning Var2, the all-pairs sum variance-based ^-clustering by
of squared errors, an optimum 2-clustering is circularly
separable (Boros and Hammer [2]), and a finer charac- weighted Voronoi diagrams
terization by using the higher-order Voronoi diagram is
The variance-based fc-clustering problem is described as
given in [7]. Using this characterization, the 2-clustering
follows:
problem with Var2 as the intra-cluster metric can be
lb
solved in 0(nd+1) time, and also it is seen that the
min{ ^2 Var<*(5j) I ^-clustering (S1,... ,Sk) of S}
^-clustering problem for this case can be solved in a
polynomial time 0(ra(<*+i)*(*-i)/2) wnen k is fixed [6].
There is also proposed an approximate algorithm for In [7], a parametric characterization was given for the
the ^-clustering problem with Var1 as an intra-cluster case of a = 2 (all-pairs case) by using a general paramet-
metric. Hasegawa, Imai, Inaba, Katoh and Nakano [7] ric technique for minizing quasiconcave functions de-
gave an 0(nk+1 )-time algorithm for fixed d whose worst- veloped by Katoh and Ibaraki [12], which enabled us
case ratio is 2. This algorithm solve the ^-clustering to characterize an optimal 2-clustering for a — 2 by
problem with constraining the representative point of means of higher-order Voronoi diagram, and to obtain
each cluster to be one of points in the cluster. a pseudo polynomial approximation scheme for the 2-
clustering problem for Var2 and the maximum function
Our results: In this paper, the ^-clustering problem as the inter-cluster metric.
under the intra-cluster criterion Var" with a = 1, 2 is In this paper, we concentrate on the case where the
treated in a unified way by characterizing the optimum summation function is adopted for the inter-cluster cri-
solution to the ^-clustering problem by the ordinary terion, and give a more direct characterization for the
Voronoi diagram and the weighted Voronoi diagrams problem with a = 1, 2.
with both multiplicative and additive weights. We may make use of partitions of n points induced
With this framework, the problem is related to the by weighted Voronoi diagrams. Consider k points
generalized primary shutter function for the Voronoi qj = {nj) in the d-dimensional space with multiplicative
diagrams, which is roughly the number of parti- weight Uj and additive weight aj (j = 1,..., k). Define
tions of n points in the d-dimensional space induced the Voronoi region Vor(<?j) of qj by
by the Voronoi diagram generated by k generator *
points. The primary shutter function of the Eu- Vor(qj) = f){p = (x)\
clidean Voronoi diagram is shown to be 0(ndk), and
that for the Voronoi diagram with additive and multi- "j\\x ~ fJ-jl? + °j < vi\\x - M;||2 + oi }
plicative weights 0(n(d+2)*). Based on these, the k- For any point in Vor(gj), qj is the closest point among
clustering problem for n points in the d-dimensional qi (/ = l,...,k) with respect to the weighted distance.
space with a variance-based criterion can be solved in Vor(gj) (j = l,...,k) partitions the space, which is
0(n(d+2)fc+1) time. This greatly improves the previous called the weighted Voronoi diagram generated by these
bound 0(n°(dk )). We have thus given a polynomial- k points qj. When aj = 0 and Vj — 1 (j = l,...,Jfc),
time algorithm for the case of fixed k, but its degree is this weighted Voronoi diagram reduces to the ordinary
large even for moderate values of d and k. Euclidean Voronoi diagram.
To develop a practically useful 2-clustering algorithm, By the Voronoi diagram generated by these k
for the problem with the most typical intra-cluster crite- weighted points, n points in the given set S are nat-
rion of the sum of squared errors, we present an efficient urally partitioned into k clusters (we here ignore the
randomized algorithm which, roughly speaking, finds an case in this definition where a point in S is equidistant
e-approximate 2-clustering in 0(n(l/e)d) time, which is from two points among these k weighted points). We
quite practical and may be used to real large-scale prob- call this partition a Voronoi partition of n points in S by
lems such as the color quantization problem. In the k weighted generators. Apparently, not all fc-clusterings
analysis, a fact that this intra-cluster cost has its statis- are Voronoi partitions. In fact, we can characterize op-
tical meanings by definition is used. This randomized timal fc-clusterings by the Voronoi partition. The case
algorithm can be easily generalized to the fc-clustering of a = 1 is well known, and we here state only the

334
+1
theorem. the Voronoi partitions can be enumerated in 0(n )
time.
Theorem 1 ([2, 7, 15]) Suppose that (Sj*,.. .,S£) is
an optimum k-clustering for the k-clustering problem Proof: In the ordinary Voronoi diagram, all multiplica-
with Var1 (a = 1) as the intra-cluster metric. Then, tive weights are one and all additive weights are zero,
an optimum k-clustering is a Voronoi partition by the i.e., VJ = 1, aj — 0 (j = l,...,k). Parameters are \ij
ordinary Euclidean Voronoi diagram for k points qj = (j = 1,..., k). Consider the (dfc)-dimensional vector
(n*)(tx*=x(S*)). □ space consisting of fj. with \i = {fix,ii2,..., fJ.k). In this
(dfc)-dimensional space, we can define an equivalence
Now, we prove the following theorem for the case of relation among points such that two points are in the
Var2, i.e., all-pairs sum of squared errors. equivalence relation if their corresponding Voronoi par-
titions are identical. The equivalence relation produces
Theorem 2 Suppose that (SJ",..., S£) is an optimum
a subdivision of this space into equivalence classes.
k-clustering for the k-clustering problem with Var (a =
For each pair of distinct ßji and fiJ2 among fij
2) as the intra-cluster metric. Then, an optimum k-
(j = 1,..., k) and each point p; = (XJ) among p,
clustering is a Voronoi partition by the weighted Voronoi
(i = l,...,n), consider an algebraic surface in this dk-
diagram for k points qj = (fij) (/*] = *(-$,*)) with multi-
dimensional space defined by
plicative weight vj = |5|| and additive weight aj defined
6y^- = Epi6s;ll»'.--*(5;)ll2- Hsi-MjJ-lF.--/*;, =0

Proof: First, observe the following relation. where x; is regarded as a constant vector. The num-
ber of such surfaces is nk(k - l)/2. The arrangement
E \Xi -x\ of these nk(k - l)/2 algebraic surfaces coincides with
the subdivision defined by the equivalence relation from
= x^ii(^-*(5i)) + (*(5J')-a;)ii2 Voronoi partitions. The number of Voronoi partitions
is bounded by the combinatorial complexity of the ar-
= \Sj\-\\x-x(Sj)f+ X>< - *(S;)H2 rangement of nk{k -1)/2 constant-degree algebraic sur-
faces, and the theorem follows. O
where it should be noted that YlPieSj(Xi ~ x(Sj)) = 0-
Now, suppose that, in the weighted Voronoi diagram A further detailed analysis about the primary shut-
above, a point pi G Sj is not contained in Vor(gj) ter function of the k-Voronoi space is done by Ishiguro
for qj = (x(Sj)), and is in Vor(g^). Then, moving [11]. In that paper, the linearization technique is ap-
Pi from 5- to St, the total cost is strictly reduced plied in the analysis, and an algorithm using hyperplane
from the above formula (note that Var is the all-pairs arrangements is given based on it. Also, an application
sum of squared errors), which contradicts the optimal- of the primary shutter function to learning an unknown
ity of (5j*,..., SI). Hence, each pj € S] is contained in k-Voronoi space from examples is shown.
Vor(gj) for j - 1,..., k, and the theorem follows. □
Theorem 4 The number of Voronoi partitions of n
By Theorem 1 and Theorem 2, the variance-based points by the weighted Voronoi diagram generated by k
fc-clustering problem with a = 1,2 can be solved by weighted points with a multiplicative weight and an ad-
enumerating all the Voronoi partitions of n points gen- ditive weight in the d-dimensional space is 0(n^d+2> ),
erated by k weighted points, and finding a partition with and all the Voronoi partitions can be enumerated in
0(n(d+2)fc+l) üme D
minimum one.
The number of distinct Voronoi partitions has strong
connection with the generalized primary shutter func- The proof is similar, and is omitted in this version.
tion for fc-label space introduced by Hasegawa [6, 8] Combining these results, we have the following.
which has applications in computational learning the-
ory. We here analyze this number by showing that Theorem 5 (1) The k-clustering problem for Var can
Voronoi partitions are duals of arrangements of alge- be solved in 0(ndk+1) time.
braic surfaces in the 0(dfc)-dimensional space. (2) The k-clustering problem for Var2 can be solved
in 0(n(d+Vk+1) time.
Theorem 3 The number of Voronoi partitions of n
points by the Euclidean Voronoi diagram generated by It should be noted that, from the linear separability
k points in the d-dimensional space is 0(ndk), and all or circular separability, of an optimum 2-clustering for

335
Var1 and Var2, respectively, as shown by [2, 7], the k- Var1 (S).
clustering problem for Var1 and Var2 is readily seen to On the other hand, the centroid x(T) of T is close to
be solvable in 0(ndfc(fc-1)/2) and 0(n^d+1'>k(-k-11/2) time, the centroid x(S) of S with high probability by the law
respectively, using similar arguments in [3] for the diam- of large numbers, and we obtain the following lemma.
eter and radius. Only with the linear/circular separa-
bility for the 2-clustering, an algorithm of order n°(dfc2) Lemma 1 With probability 1-8,
may be best possible for the ^-clustering problem. Our
algorithms run in 0(n°^dk^>) time, and improve the p(T)-x(5)||2< J-Var°(5).
bra
0(no(-dk )) bound greatly. This becomes possible by
the fine characterization of optimum fc-clusterings by Proof: First, observe that
the weighted Voronoi diagram, and by evaluating the
primary shatter function of the weighted Voronoi parti- E(x(r)) = x(S), E(\\x(T) - x(S)f) = ^Var°(5)
tions in a tighter manner.
and then apply the Markov inequality to obtain the fol-
lowing.

3 Randomized algorithms for Pr(p(T) - x(S)\\2 > ^Var°(5)) < 6. D


the case of the sum of squared
errors
Lemma 2 With probability 1-6,
The results in the previous section are interesting from
the theoretical viewpoint, and the time complexity is ^||x1-s(r)||2<(i + —^^(5).
Pi€S
polynomial when k is considered as a constant. How-
ever, even for k = 3,4,5, its polynomial degree is
Proof: Immediate from Lemma 1 and the following.
quite high, which makes it less interesting to implement
the algorithms for practical problems such as the color ^||a;i-*(T)||2 = Var1(5) + |5|-||x(r)-x(5)||2. D
quantization problem. The fc-clustering problem is NP- Pies
complete in general when k is regarded as a variable,
and in this respect the results are best possible we may
Thus, we can estimate Var1 (5) by random sam-
expect to have.
pling. For the 2-clustering problem, we have to estimate
To develop a practically useful algorithm, utilizing
Var1 (50 and Yai1(S2) for a 2-clustering (SUS2) by es-
randomization may be a good candidate, since the intra-
timating the centroids of 5i and 52. Now, consider the
cluster metric we are using has its intrinsic statistical following algorithm.
meanings. In this section, we develop randomized algo-
rithms for the ^-clustering problem with Var1, the sum
of squared error, as the intra-cluster metric. A randomized algorithm for the 2-clustering:
In this extended abstract, we mainly consider the 2- 1. Sample a subset T of m points from S by m inde-
clustering problem with Var1, but most of the follow- pendent draws at random;
ing discussions carry over to the fc-clustering problem.
First, let us consider how to estimate Var1 (5) for the 2. For every linearly separable 2-clustering (Ti,T2) of
set S of n points p{ = (a:,-) (i - l,...,n) by random T, execute the following:
sampling. Let T be a set of m points obtained by m
Compute the centroids t\ and t2 of Ti and T2,
independent draws at random from 5. If the original
respectively;
point set S are uniformly located, (n/(m - l))Varx(T)
may be a good estimate for Var1 (S). However, this is Find a 2-clustering (Si, 52) of S by dividing S
not necessarily the case. For example, suppose that a by the perpendicular bisector of line segment
point pi in S is far from the other n - 1 points in S, connecting ti and t2;
and the other n - 1 points are very close to one another.
Compute the value of Var1 (Si)-(-Var1 (S2) and
Then, Var (S) is nearly equal to the squared distance
maintain the minimum among these values;
between p{ and a point in S - {pj, while with high
probability Varx(T) is almost zero. This indicates that 3. Output the 2-clustering of S with minimum value
Var (T) cannot necessarily provide a good estimate for above.

336
The idea of this randomized algorithm is to use all Proof: From Lemmas 2 and 3, with probability 1 - 8 ■
pairs of centroids of linearly separable 2-clusterings for
the sampled point set T. Let (S^S}) be an optimum
2-clustering of S for Var1, and let sj and S2 be tne £ E11*-sew
centroids of SJ and S2, respectively. By considering
all linearly separable 2-clusterings for T, the algorithm ^(l+JTT^T^^Var1^)
handles the 2-clustering (T{,T±) obtained by dividing T
i=i
by the perpendicular bisector of line segment connecting holds. Furthermore, the left hand side is bounded from
si and s2. Then, from the centroids of T[ and T2, we below by ]£2=1 Var1 (S'j), whose value is computed in
obtain a 2-clustering {S[,S'2) in the algorithm. the algorithm. Hence, the minimum value found in the
Since T is obtained from m independent draws, algorithm is within the factor.
Concerning the time complexity, all linearly separable
E(ir;i) = ^;i ü = i, 2).
2-clusterings for T can be enumerated in 0(md) time.
From Lemma 2, Var1^*) can be estimated by using For each 2-clustering (Ti,T2) of T, finding a pair of
\T'j\. The sizes |Tj| (j - 1,2) are determined by inde- centroids and a 2-clustering of 5 generated by the pair
pendent Bernoulli trials, and is dependent on the ratio together with its objective function value can be done
of |Sj| and \S2\. For the sampling number m, we say in 0(n) time. Thus the theorem follows. Ü
that 5 is f(m)-balanced if there exists an optimum 2-
We have developed a randomized algorithm only for
clustering (S^S^) with
the 2-clustering problem so far, but this can be directly
-min{|S*|, \S;\}>f(m), generalized to the fc-clustering problem. If there ex-
n ists a balanced optimum fc-clustering, similar bounds
and the optimum 2-clustering is called an /(re- can be obtained. It may be noted that the technique
balanced optimum 2-clustering. We then have the fol- employed here has some connection with the technique
lowing. used to obtain a deterministic approximate algorithm
with worst-case ratio bounded by 2 for the fc-clustering
Lemma 3 Suppose there exists a (loge m)-balanced op- problem in [7].
timum 2-clustering (S^S^)- Then, with probability The above theorem assumes some balancing condi-
2 tion. In some applications, a very small cluster is use-
1 __ for a constant ß (0 < ß < 1), the follow-
ing i2 less even if its intra-cluster is small. For example, when
ing holds.
we apply a 2-clustering algorithm recursively in a top-
min{ |r;|, |T2*| }> (1 - /?)£min{ \S;\, |S2*| } down fashion to solve the fc-clustering problem, a bal-
> (1- /3)logm. ancing condition on 2-clusterings may be imposed to 2-
clustering subproblems so that the sizes of subproblems
771
Proof: Set \i' = — min{|S*|, \S2\}. For TO indepen- may become small quickly and the total clustering may
n have nicer properties. In such a case, the randomized al-
dent Bernoulli trials Xi,X2,..., Xm with Pr(X; = 1) =
gorithm naturally ignores such small-size cluster. Also,
fi'/m < Pr(Xi = 0) = 1 - fi'/m, the Chernoff bound
for the case of finding a good and balanced 2-clustering,
implies, for X = X\ + h Xm,
we have only to apply a slightly modified version of the
Pr(X < (1 - /?)/*') < exp(-/x'/?2/2). randomized algorithm directly. This is typical for the
clustering problem in VLSI layout design. See, for ex-
From the assumption,
ample, Kernighan and Lin [13]. Generalizing Theorem
1
exp(-/x'/32/2) < exp(-(logm)/?2/2) = ^^■ D 6 for such cases, we have the following.
Theorem 7 For the problem of finding an optimum 2-
clustering among (7m)-balanced 2-clusterings for a con-
Theorem 6 Suppose that the point set S is f(m)- stant 7, the randomized algorithm finds a 2-clustering
balanced with /(TO) > logm. Then, the randomized al- which is almost at least (7m)-balanced and whose value
gorithm finds a 2-clustering whose total value is within is within a factor ofl+0(l/(6m)) to the optimum value
of this problem with probability 1 — 6 for small 6. □
a factor ofl + —. -r-77—r to the optimum value with
6(l-ß)f(m) In the proof of this theorem, we use results concern-
2
probability 1-6 -p-^ in 0(nmd) time. ing the e-net and e-approximations. The details will be

337
given in the full version. We here restate the theorem 4 Concluding remarks
in a rough way so that its essence can be understood
direclty. We have demonstrated that optimum solutions to the
variance-based fc-clustering can be characterized by the
Corollary 1 When there is an optimum 2-clustering (weighted) Voronoi diagram generated by k points, and
(Si,S%) of S such that have evaluated the primary shutter function of the k-
Voronoi space. This primary shutter function can be
l^ri, |S2*|>7|5| = n
used in computational learning theory in learning k-
for some constant 7 (0 < 7 < 1/2), the randomized Voronoi spaces.
algorithm, which samples m points from S, finds a 2- We have then presented a simple randomized algo-
clustering whose expected value is l + 0(l/ra) with high rithm for the ^-clustering problem with Var1 as an
probability. D intra-cluster metric. This algorithm is practically useful
when k is small and balanced ^-clusterings are prefer-
Corollary 2 For the problem of finding an optimum
able. For example, for the problem of finding an op-
2-clustering among 2-clusterings (Si, S2) of S such that
timum 2-clustering for n planar points among almost
\Si\, |52|>7|5|=n completely balanced 2-clusterings, an approximate 2-
for some constant 7 (0 < 7 < 1/2), the randomized clustering which is approximately balanced and whose
algorithm, which samples m points from S, can be easily cost is within a factor of 1 +1/3 = 4/3 on the average to
modified to find an approximate balanced 2-clustering the optimum cost can be found by sampling 10 points
whose expected value is l+0(l/m) with high probability. from n points and spending O(102n) = 0(n) time with
a probability Ej=s (1°)/210 « 0.89, or by sampling 20
points and spending O(202n) = 0(n) time with proba-
On the other hand, if very small clusters with small bility £!13 (2°)/220 « 0.9996.
intra-cluster metric should be found, we may enumer- The randomized algorithm, however, is not so suit-
ate such small clusters deterministically or in a random- able to find a good unbalanced 2-clustering. Also,
ized manner, since the number of such small clusters is although the randomized algorithm itself is valid for
relatively small. For the 2-clustering problem in the large k, the running time becomes inherently large since
two-dimensional case, the number of linearly separable the primary shutter function for m sampled points is
2-clustering such that one cluster consists of at most k' 0(mo(dA;)). -phis impiies tjjat the variance-based k-
points is O(k'n) and can be enumerated efficiently. By clustering problem is harder in such a situation com-
enumerating fc'-sets for an appropriate value of k', we pared with the diameter- or radius-based ^-clustering
obtain the following theorem. to which a good and fast approximate algorithm with
worst-case ratio 2 is known [4].
Theorem 8 The 2-clustering problem for n points in
Therefore, to solve the variance-based ^-clustering for
the plane with Var as the intra-cluster metric can be large k practically, say for A; = 256 of the typical color
solved in 0(n5'3(logn)3) time with the approximation
quantization problem, we may apply the randomized 2-
ratio within a factor of 1 + 0(1/ log n) with probability clustering algorithm proposed in this paper recursively
1-0(1/log«).
in a top-down manner with sampling only a small num-
Proof: Set m = n^logn. For this m, by the ran- ber of points at each stage as mentioned above. We plan
domized algorithm, we find a good (log m)2-balanced to implement this approach and experimentally evalu-
ate its efficiency.
2-clustering. Also, by the deterministic algorithm enu-
merating (< n2/3 log n)-sets, we find a best unbalanced
2-clustering. Setting 5 = 1/logm and ß to a con- Acknowledgment
stant, the time complexity of the randomized algorithm
The work of the authors was supported in part by the
is 0(n(n1/3 logra)2) = 0(n5/3(logra)2) and the approxi-
Grant-in-Aid of Ministry of Education, Science and Cul-
mation ratio is bounded by 1 + 0(1/ log m) with proba-
ture of Japan.
bility 1 -0(1/ log m). The deterministic algorithm runs
in 0(n(n2/3 log n)(logn)2) = 0(n5/3 (log n)3) time. D
References
It should be noted that the time complexity in this
theorem is subquadratic, compared with the determin- [1] T. Asano, B. Bhattacharya, M. Keil and F. Yao:
istic quadratic exact algorithm. Clustering algorithms based on minimum and max-

338
imum spanning trees. Proceedings of the 4th Annual [14] N. Megiddo and K. J. Supowit: On the com-
Symposium on Computational Geometry, Urbana, plexity of some common geometric location prob-
1988, pp.252-257. lems. SIAM Journal on Computing, Vol.13 (1984),
[2] E. Boros and P. L. Hammer: On clustering prob- pp. 182-196.
lems with connected optima in Euclidean spaces. [15] S. J. Wan, S. K. M. Wong and P. Prusinkiewicz:
Discrete Mathematics, Vol.75 (1989), pp.81-88. An algorithm for multidimensional data cluster-
[3] V. Capoyleas, G. Rote and G. Woeginger: Geomet- ing. ACM Transactions on Mathematical Software,
ric clustering. Journal of Algorithms, Vol.12 (1991), Vol.14, No.2 (1988), pp.153-162.
pp.341-356.
[4] T. Feder and D. H. Greene: Optimal Algorithms
for Approximate Clustering. Proceedings of the
20th Annual ACM Symposium on Theory of Com-
puting, 1988, pp.434-444.
[5] J. Hagauer and G. Rote: Three-clustering of points
in the plane. Proceedings of the 1st Annual Euro-
pean Symposium on Algorithms (ESA '93), Lecture
Notes in Computer Science, Vol.726, 1993, pp.192-
199.
[6] S. Hasegawa: A study on e-net and e-approxima-
tion. Master's Thesis, Department of Information
Science, University of Tokyo, 1993.
[7] S. Hasegawa, H. Imai, M. Inaba, N. Katoh and
J. Nakano: Efficient algorithms for variance-based
/c-clustering. Proceedings of the First Pacific Con-
ference on Computer Graphics and Applications,
World Scientific, 1993, pp. 75-89.
[8] S. Hasegawa, H. Imai and M. Ishiguro: e-
approximations of fc-label spaces. Proceedings of
the 4th International Workshop on Algorithmic
Learning Theory (ALT'93), Lecture Notes in Ar-
tificial Intelligence, Vol. 744, 1993, pp.288-299.
[9] P. Heckbert: Color image quantization frame buffer
display. ACM Transactions on Computer Graphics,
Vol.16, No.3 (1982), pp.297-304.
[10] J. Hershberger: Minimizing the sum of diameters
efficiently. Computational Geometry: Theory and
Applications, Vol.2 (1992), pp. 111-118.
[11] M. Ishiguro: Evaluation of combinatorial complex-
ity for hypothesis spaces in learning theory with ap-
plications. Master's Thesis, Department of Infor-
mation Science, University of Tokyo, 1994.
[12] N. Katoh and T. Ibaraki: A parametric charac-
terization and an e-approximation scheme for the
minimization of a quasiconcave program. Discrete
Applied Mathematics, Vol.17 (1987), pp.39-66.
[13] B. W. Kernighan and S. Lin: An efficient heuristic
procedure for partitioning graphs. The Bell System
Technical Journal, Vol.49, No.2 (1970), pp.291-
307.

339
Bounded boxes, Hausdorff distance, and a new proof of an interesting
Helly-type theorem.

Nina Amenta *
The Geometry Center
1300 South Second Street
Minneapolis, MN. 55454

Abstract The elements of the family H are called the con-


straints. Like a linear program, a convex program
In the first part of this paper, we reduce two geometric
has a single global minimum which is determined
optimization problems to convex programming: find-
by a subfamily of constraints. And under reason-
ing the largest axis-aligned box in the intersection of a
able computational assumptions on the constraints
family of convex sets, and finding the translation and
and the convex function, fixed-dimensional convex
scaling that minimizes the Hausdorff distance between
programming can be solved in expected linear (in
two polytopes. These reductions imply that important
|-fi"|) time by any of the randomized combinato-
cases of these problems can be solved in expected linear
rial linear programming algorithms of [C90], [S90],
time. In the second part of the paper, we use convex
[MSW92]. These algorithms are combinatorial in
programming to give a new, short proof of an interest-
the sense that they operate by searching the sub-
ing Helly-type theorem, first conjectured by Grünbaum
families of constraints for one that defines the min-
and Motzkin.
imum; a more classic example of a combinatorial
LP algorithm the simplex algorithm.
1 Introduction We give two new reductions from geometric op-
timization problems of practical interest to con-
Linear programming is a popular tool in computa- vex programming. The first problem is finding the
tional geometry. A related problem is largest volume axis-aligned box in the intersection
Convex Programming of a family K of convex sets. Like the ubiqui-
Input: A finite family H of closed convex sets in tous bounding box, this bounded box can be used in
Ed and a convex function f. heuristics to approximate a more complicated vol-
Output: The minimum of f over f] H, the inter- ume. When the dimension is fixed and the elements
section of H. of K are linear halfspaces (or otherwise easy to
compute with), this reduction implies an expected
Remember that a function / : Ed —> TZ is convex
0{n) time algorithm, n = \K\. The planar case of
when f(Xa + (1 - \)b) < A/(o) + (1 - \)f(b), for
this problem was raised in the context of a heuris-
all a, b e Ed and 0 < A < 1.
tic for packing clothing pattern pieces [DMR93].
'email: nina@geom.umn.edu. Most of this work was They give an 0(na(n) log n) algorithm to find the
done at the University of California, Berkeley, where the au- maximum area axis-aligned rectangle in any sim-
thor was supported by a U.C. Presidents Dissertation Year ple polygon in E2. Our reduction may be useful
Fellowship and an AT&T Graduate Research Program for
Women Grant. for higher dimensional packing heuristics as well,
Permission to copy without fee all or part of this material is
and also when objects are to be decomposed into
granted provided that the copies are not made or distributed for collections of axis-aligned boxes (eg. in ray tracing,
direct commercial advantage, the ACM copyright notice and the [AK89],pp 219-23).
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing Our second reduction concerns some particu-
Machinery. To copy otherwise, or to republish, requires a fee
and/or specific permission. lar cases of the much-studied problem of mini-
mizing the Hausdorff distance between two ob-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 340
jects under a group of transformations. The one- if and only if the intersection of J is nonempty, for
directional Hausdorff distance from a set A to a all J CIkd with \J\ < k(d+l).
set B, H(A,B), is the maximum distance from
any point in A to the nearest point in B. The This is called a Helly-type theorem because of its
Hausdorff distance between A and B, H(A,B), is combinatorial structure: the whole family of sets
m&x{H(A,B),H(B,A)}. The Hausdorff distance has nonempty intersection if and only if all of
is used in pattern recognition and computer vision its constant-size subfamilies do. There are many
as a a measure of the difference in shape between Helly-type theorems; it is appealing to think that
the two sets; typically a family P of critical points there is some fundamental topological property un-
is extracted from an image and compared with a derlying them all. This theorem is interesting be-
stored template A. The problem is to choose a cause it suggests this fundamental property might
transformation from some family which, when ap- be that the intersection of every subfamily is some-
plied to A, minimizes H(P,A) or H(P,A). how homologically of constant complexity.
For convex polytopes A, B we reduce the prob- Grünbaum and Motzkin conjectured Theorem
lem of finding the translation and scaling which 0.1 [GM61J, and proved the case k = 2, using a
minimizes H(A,B) to a convex program. In the more general axiomatic structure in place of con-
plane, this convex program can be solved in ex- vexity. The case k = 3 was proved by Larman
pected 0(n) time, where n is the total number [L68]. Morris settled the conjecture in his thesis.
of vertices. A similar convex program, motivated His proof, however, is quite long (69 pages) and
by the scenario above, finds the translation which involved, and a better proof has been called for
minimizes the H(P,A), where P is a point set [E93].
and A is a convex polytope. Again in the pla- Using convex programming, we give a short and
nar case, this convex program requires expected insightful proof. Our approach is to introduce a
min{0{mn),0(n\gn + m)}) time, where n = |P| function /, and then show that the problem of min-
and A has m vertices. imizing / over a family l\ belongs to the class GLP
There are many results on minimizing the Haus- (for Generalized Linear Programming). Informally,
dorff distance between various objects under differ- GLP is the class of problems which can be solved
ent groups of motions. Most of them solve more dif- by combinatorial LP algorithms. This is already
ficult problems and require more time. For planar interesting, as an example of a problem which is
point sets P, Q, an algorithm of [HKS91] finds the combinatorially similar to LP although geometri-
translation that minimizes H(P,Q) in 0(mn(m + cally the intersection of the constraints fails not
n)lg(mn)) time, where n = \P\,m = \Q\. Allow- only to be convex, but even to be connected. The-
ing rotation as well, an algorithm of [CGHKKK94] orem 0.1 follows by applying an easy theorem from
minimizes H(P, Q) in 0{m2n2(m+n) lg2 ran) time. [A93], that there is a Helly-type theorem about the
Algorithms for measuring the Hausdorff distance constraint set of every GLP problem.
for fixed polygons, allowing no transformations
at all, require O(nlgn) time for simple polygons
[ABB91], and 0{n) for convex polygons [A83]. The 2 Setup
algorithms implied by our reductions are also com-
paratively simple and implementable. In this section we give some background on con-
We turn from these practical issues to a theoreti- vex programming, GLP, and the combinatorial LP
cal question from combinatorial geometry. We give algorithms.
a new proof of the theorem of [Mo73]: First we give the formal definition of GLP, us-
ing an abstract framework due to Sharir and Welzl
Theorem 1.1 Let Chd he the family of all sets in [SW92]. A GLP problem is a pair (H,w), where
Rd consisting of the disjoint union of at most k if is a family of constraints, generally sets, and
closed convex sets. Let 1% C C\ be a subfamily w : 2H —► A is a function which takes a subfamily
with the special property that it is closed under in- of constraints to an element of a totally ordered
tersection. Then the intersection of 1% is nonempty set A. A has a special maximum element fi. When

341
w(G) < Q, G is feasible, and otherwise G is infea- Lexicographic convex programming
sible. Input: A family H of compact convex subsets of
In convex programming, for example, w(G), for E , and the lexicographic function f.
G C H, is the minimum of / over fl^, and if Output: The minimum of f overf]H.
C\G = 0, then u>(G) = £2. In order to ensure
The minimum is certainly achieved at a single
that w is defined on every subfamily of constraints,
point, since each point has a unique value. But
we may have to enclose the problem in a compact
this is not, strictly speaking, a convex program-
"bounding box". We say that w is the objective
ming problem, since / is not a function into 72..
function inducedby f.
We observe, however, that / is related to the lin-
(H, w) is a GLP problem if
ear function
1. For all F C G C H: w(F) < w{G)
ge(x) = X-L + ex2 + e2x3 + ... + € d-\ Xd
2. For all F C G C # such that w(F) = w(G) and
for each h £ H: for infinitessimally small e. To make this relation-
w(F + h)> w(F) if and only if w(G + h) > w(G) ship precise, we adopt the terminology of [M94],
(by F + h, we mean F U {/i}) and say that an objective function v is a refinement
of a function w when, for F, G C H, w(G) > w(F)
A basis is a subfamily G C H such that w(G-h) <
implies v(G) > v(F).
w(G), for all h £ G. The combinatorial dimension
Let w and ve be the objective functions induced
of a GLP is the maximum cardinality of any feasi-
by / and g€, respectively. For any finite family H
ble basis.
of constraints, there is some e small enough so that
Every convex program meets Condition 1, since
vc is a refinement of w. Note that there may be
adding more constraints to a problem can only in-
no e small enough that v€(F) = v€(G) whenever
crease the minimum. It is also well-known that
w(F) = w(G), as illustrated in figure ??. Finally,
a ^-dimensional convex program has combinatorial
dimension d; there is a formal proof in [A93'].
But notice that it is not the case that every con-
vex program is a GLP problem, since it may fail
to satisfy Condition 2. Condition 2 is always sat-
isfied, however, when the minimum of / over the
intersection of every subfamily G C H is achieved
by exactly one point. This observation implies that
the following cases of convex programming are al-
ways GLP problems of combinatorial dimension d.
A function / : Ed -> U is strictly convex when
f(Xa + (1 - X)b) < Xf(a) + (1 - X)f(b), for all Figure 1: Minima are different under ve
a,bEEd andO < A < 1.
we observe that if a function w has some refine-
Strictly convex programming ment v such that (H, v) meets Condition 1 and has
Input: A family H of compact convex subsets of combinatorial dimension d, then so does (H,w).
Ed, and a strictly convex function f. So Lexicographic Convex Programming is a GLP
Output: The minimum of f over(~\H. problem of combinatorial dimension d, since (H, ve)
The minimum is achieved at one unique point since is a convex program and so meets Condition 1 and
any point x on the the line segment between any has combinatorial dimension d, and (H,w) meets
two feasible points y, z with /(y) = f(z) has f{x) < Condition 2 as well.
f(y) = f(z). The computational requirement under which any
The lexicographic function f : Ed —* Tld takes a of the combinatorial LP algorithms can be applied
point to it's coordinates x =< xu ..., xd >, which to any GLP problem is that there is a subroutine
are totally ordered so that x > y if xx > yt, or if available for the following problem:
Xi = yl and x2 > y2, and so on. Basis computation

342
Input: A basis G and a constraint h. function over f]H. The volume of a box (x,a),
Output: A basis G' C G + h such that w(G') = negated, is given by
w{G + h). d
This operation corresponds to a pivot step in the 5(o)=-n°«'
simplex algorithm. In d-dimensional convex pro-
gramming, a basis computation minimizes / over with all the a,- constrained to be positive. This is
f]G, where \G\ < d + 1. When a basis compu- not a convex function, but
tation can be done in constant time, then any of
[C90], [S90], [MSW92] require expected 0(n) time, d d

where n = \H\. All of these algorithms have been /(a) = -log(na.) = -EloS(a')
:=1 «'=1
implemented for LP, and the algorithm in [S90] has
also been applied to the particular convex program is a strictly convex function. Minimizing / over
of finding the smallest ball enclosing a family of f| H is a strictly convex programming problem in
points in Ed [W91]. E2d.
D
3 Bounded boxes When the elements of K are linear halfspaces, then
the constraints are as well. When the elements of
In this section we prove K are of constant complexity, so that a basis com-
putation requires O(l) time for fixed d, the largest
Theorem 3.1 Finding the largest volume axis- volume axis-aligned box can be found in expected
aligned box in the intersection of a family K of n 0{n) time. Note that / and g are minimized at
convex bodies in Ed is a strictly convex program in the same point, so the basis computation may be
E2d with 2dn constraints. implemented using g.
Proof sketch: We parameterize an axis-aligned
box by a pair of vectors x, a € TZd, where x1;..., xj 4 Hausdorff distance
are the coefficients of the lexicographically mini-
mum vertex of the box, and aa,..., a<j are positive Now we consider the problem of finding the trans-
offsets in each coordinate direction. This parame- lation and scaling which minimize the Hausdorff
teriztion defines a space of boxes, in which we will distance between two convex polytopes A and B in
construct a convex program. Ed. The boundary of the set of points at distance
For each convex body C € K, we will define 2d A from A (that is, the Minkowski sum of A with
constraints, one for each box vertex. Note that a the closed disk of radius A centered at the origin)
box is contained in a convex body C if and only if is called the X-offset surface. H(B,A) < A when
all of its vertices are. Let us label the vertices with
0-1 vectors in the natural way, so that (0,..., 0) is
the lexicographic minimum corner of the box. The
set of boxes for which vertex u is contained in C is
h = {x,a\x + (u®a) £ C} (here <g> is coordinate- V
wise multiplication, and + is translation). This is
convex.
To prevent the largest volume box determined Figure 2: Offset surface
any subproblem from being unbounded, we require
the bounded box to be contained in a very large every vertex of B lies within the A-offset surface of
bounding box which is guranteed to contain f| K. A.
This adds one more convex constraint to the prob- We can think of the scaling and translation
lem in the space of boxes. transformations as being applied to A alone. We
It remains to show that maximizing the volume define a (d + 2)-dimensional transformation space
of the box corresponds to minimizing some convex in which the coordinates of each point represent a

343
d-dimensional translation vector r to be applied to Proof: We redefine each polygon as the intersec-
A, a scale factor a to be applied to A, and an offset tion of pieces of constant complexity, and associate
distance A. For any point b € B, let H$Ta A) be the each piece with a subset of the vertices of the other
subset of transformation space such that b is within polygon. Each piece is the infinite wedge formed
the A-offset surface of the homothet of A scaled by by a vertex of one of the polygons and the rays sup-
a and translated by r. Similarly, let H?ra A) be the porting the adjacent sides, which we shall call an
set of translations and scalings of A which put a angle. If every vertex of A is within the A-offset sur-
point a 6 A inside the A-offset surface of B. face of every angle from B, and visa versa, H(A, B)
Theorem 4.1 The scaling and translation that is no greater than A. This gives a GLP with 0(n2)
minimizes the Hausdorff distance between two poly- constraints, pairing every vertex of A with every
topes in Ed can be found by a lexicographic convex angle from B, and visa versa.
program in Ed+2. We get a linear number of constraints by noting
that for every angle a from B, all of A is within the
Proof: Let V(A) and V(B) be the vertex sets of
A-offset surface of a if every vertex from a critical
A and B, respectively. Consider a vertex b £ V(B).
subset of V(A) is. The faces of B divide the cir-
Fixing CT = 1 and A = 0, we find that the set of
translations of A which cover b, H*T 1 0), is itself a
translate of the convex set — A. Allowing a to vary,
we find that H^ra^ is a cone over —A, also convex,
into the direction of the a coordinate. Finally, we
allow A to vary as well. Notice that, as A varies,
the set of disks of radius A centered at the origin
forms a convex cone, C. H^TaA) is the Minkowski
sum of H*Ta^ with C. This is convex because the
Minkowski sum of convex bodies is convex. Each
Figure 3: Intervals on the circle of normals
vertex of B produces one such convex constraint.
Now consider a vertex a G V(A). Again if(arl 0)
cle of normal directions into a family IB of closed
is convex, this time a translate of —B. As a varies,
intervals, each interval corresponding to an angle.
A scales, and vertex a moves in some direction v,
A vertex v of A is critical for an angle a if v is
along line a + av. So H^Tafi) is a convex cylinder
extremal in A for any direction in the interval in-
over — B, and H*T^X) is the Minkowski sum of the
duced by a. The face normals of A also divide the
cylinder with C.
circle of normal directions into a family IA of closed
We use the objective function given by the lexi-
intervals, each corresponding to the set of direc-
cographic function / on the transformation space,
tions in which a particular vertex of A is extremal.
where A is the most significant coordinate, followed
When the interval corresponding to a vertex v in-
by a and then the d coordinates of the transla-
tersects the interval corresponding to an angle a,
tion r. The minimum point in the intersection of
v is extremal for a. The critical subsets for every
the constraints H*TrjX) and H^TaX), with respect to
angle can be found by merging IA and IB in linear
/, represents a scaling and translation which min-
time. Each of the n intersections of an interval in
imizes the Hausdorff distance between A and B.
IA with an interval in IB gives a vertex-angle pair
D
which produces a constraint. We also construct the
n constraints induced by angles of A and vertices
In the plane, the most important case for ex-
of B.
isting applications, we can implement this convex
The lexicographic minimum point in the inter-
program so that
section of any four constraints can be found in con-
Theorem 4.2 The scaling and translation which stant time, so we get an expected 0(n) time algo-
minimizes the Hausdorff distance between two poly- rithm.
gons in the plane can be found in expected 0(n) D
time, where n = \V(A)\ + \V(B)\.

344
We now turn our attention to the problem of
minimizing the one-directional Hausdorff distance
H(P,A) from a set of P points to a convex poly-
tope A. We can always scale A so that it is large
enough to cover all the points, making H{P,A)
zero. When the only transformation allowed is
translation, however, we find Figure 4: Generating family of l\
Theorem 4.3 The translation that minimizes the
one-directional Hausdorff distance from a set P kind of like dumbbells. The family formed by tak-
of •points to a convex polytope A in Ed can be ing the intersection of every subfamily of J forms
found by a lexicographic convex program in Ed+1. an intersectional family 1%, since every intersection
For d = 2, we can solve the problem in expected consists of at most two convex components.
min{0(mn),0(nlgn + m)}) time, where n = \P\ Morris [Mo73] proved the following
and m = |V(A)|.
Theorem 5.2 Any intersectional family l\ C C\
Proof sketch: If the 0(mn) term is less than has Helly number k(d + 1).
the 0(nlgn + m) term (few vertices and many We use Theorem 4.1 to give a new short and intu-
points), we construct a convex program in which itive proof. Given any finite family H C Ijj, we con-
each point in P produces n constraints of constant struct a GLP problem with H as the constraints.
complexity, similar to those in the previous reduc- Let / be the lexicographic objective function on
tion. If not, we compute the convex hull of P and
Ed, and define w(G) = mm{f(x) | x G f]G}, for
use a one-directional, translation-only modification
all G C H. Since minima are identified with points,
of the previous construction. we will speak of w(G) as a point and ignore the fine
Note that the Hausdorff distance used in this distinction between the point x itself and the value
section can be derived from any metric on Ed, not
just L2.
Theorem 5.3 Finding w{H) is a GLP problem of
combinatorial dimension k(d+ 1) — 1.
5 A new proof of an interesting
Helly-type theorem Proof: It is easy to see that the problem satis-
fies Condition 1, since adding constraints to a sub-
In this section we will use an easy but powerful the- problem can only increase the minimum. And is
orem from [A93], which gives us a simple technique satisfies Condition 2 since every value of w(G) is
for proving Helly-type theorems. identified with a unique point, which is either in or
out of h.
Theorem 5.1 Let (H,w) be a GLP problem with
Recall that the combinatorial dimension is the
combinatorial dimension d. The intersection of H
largest cardinality of any basis B such that f]B
is nonempty if and only if the intersection of every
is nonempty. We will count the constraints in any
G C H with \G\ < d+1 is nonempty.
basis B by carefully removing selected constraints
Let C\ be the family of all sets in Rd consisting one by one, while building up a subfamily S of
of the disjoint union of at most k closed convex "sacred" constraints which may not be removed in
sets. A family I of sets is intersectional if, for ev- later steps.
ery H C 7, f| H G I. C% is not intersectional. But We will maintain two invariants. The first is that
consider some subfamily l\ C C\ which is intersec- w(B-h) < w{B) for all h G B - S. The second
tional. This may "just happen" to be true, or Id invariant is that for all h G B — S, the minimum
may be intersectional for some geometric reason. point w(B — h) lies in a different convex component
For example consider of any family J of sets like of f)(B — h) from the point w(B).
the one in figure 4 where each set is a pair of balls First we choose the subfamily S so that the in-
of diameter 8, separated by a distance of at least 6, variants are true initially. Since f|J3 ^ 0, there

345
is a minimum point w(B) in some convex compo- come part of some larger component, it will never
nent of fl B. Each h G B is the disjoint union become part of a larger component with a lower
of convex sets; for each h, the point w(B) is con- minimum point. Each subsequent component cre-
tained in exactly one of them. Call this convex set ated by the removal of another constraint from B
Ch, and let C = {Ch \ h G B). The pair (C,w) will in fact have a lower minimum point, so the
is a lexicographic convex programming problem, a component containing w(B — h) must remain dis-
GLP problem of combinatorial dimension d, with tinct from all later components. Thus every re-
w(C) = w(B). So C must contain a basis Bc with moved constraint h will account for at least one
\BC\ <d. We set S = {he B\Che Bc). distinct component in f] S.
How does this ensure the invariants? Since B Since l£ is an intersectional family, no subfamily
is a basis, the first invariant holds for any subset of constraints can have more than k convex com-
S. The second invariant holds because all the con- ponents in its intersection. Since f] B was initially
straints which contributed a convex component to nonempty, we started with at least one convex com-
Be are in S, and for any h G B — S, w(B — h) < ponent, and at most d constraints in S. No more
w(B) = w(Bc)- That is, since the point w(B) is than k — 1 constraints were removed, and each con-
the lowest point in (~)BC, and w(B — h) is lower straint removed added at most d constraints to S.
than w(B), the point w(B — h) cannot be in f| Bc, So the total size of \B\ < (k-l) + \S\ < k(d+l)-l.
and hence must be in a different convex component
ofD(B-Ä). a
Now we turn our attention to selecting a con-
straint to remove from B. We use the fact that all Theorems 4.1 and 4.3 together imply Theorem
the points w(B — h) are distinct, for all h G B — S. 4.2.
This is true because the point w(B — h) g h, so
that for any other hi G B, since h G (B — h'),
w(B - h) i f](B - h'). Since the w(B - h) are
References
distinct, there is some hmax G B — S such that [A93] Nina Amenta, Helly Theorems and
w(B - hmax) > w(B - h) for all other h G B - S. Generalized Linear Programming,
So consider removing hmax from B. Since w(B — Proceedings of the 7th Annual Sym-
h) < w(B — hmax), for any other h G B — S, cer- posium on Computational Geome-
tainly w(B - h - hmax) < w(B - hmax). So the try, (1993) pages 63-72.
first invariant is maintained for B — hmax and S.
To re-establish the second invariant, we have to add [A93'] Nina Amenta, Helly Theorems and
more elements to S. We do this in the same way as Generalized Linear Programming
before, by finding the at most d constraints which (PhD thesis), Geometry Center
determine the minimum of the convex component Technical Report, Number GCG61,
containing w(B — hmax). We add these constraints (1993).
to 5, and set B = B — hmax.
[ABB91] Helmut Alt, Bernd Behrends, and
We iterate this process, selecting constraints to
Johannes Blömer.
remove from B and adding constraints to S, un-
Approximate matching of polygonal
til B — S is empty, that is, B = S. We now show
shapes, Proceedings of the 7th An-
that each removed constraint h accounts for at least
nual Symposium on Computational
one convex component Ch in f] S. Removing h
Geometry, (1991), pages 186-93.
from B caused a new minimum point w(B — h)
to be created. This point was the minimum point [AK89] James Arvo and David Kirk. A
in some convex component Ch of f)(B — h). We survey of ray tracing acceleration
added the constraints determining w(B — h) to S, techniques, in An Introduction to
so w(B — h) has to remain the minimum point in its Ray Tracing (Andrew Glassner, ed),
convex component, throughout the rest of the pro- Academic Press, San Diego, (1989),
cess. This ensures that, although Ch may later be- pages 201-262.

346
[A83] Mikhail J. Atallah. A linear time al- the American Mathematical Society,
gorithm for the Hausdorff distance vol. 12, (1961) pages 607-613.
between convex polygons, Informa-
[HKS91] Daniel
tion Processing Letters 17 (1983),
P. Huttenlocher, Klara Kedam and
pages 207-9.
Micha Sharir. The Upper Envelope
[CGHKKK94] of Voronoi Surfaces and its Appli-
L. Paul Chew, Michael T. Goodrich, cations, Proceedings of the 7th An-
Daniel P. Huttenlocher, Klara Ke- nual Symposium on Computational
dem, Jon M. Kleinberg, and Dina Geometry, (1991) pages 194-203.
Kravets. Geometric Pattern Match-
[L68] D.G. Larman. Helly type proper-
ing under Euclidean Motion, Pro-
ties of unions of convex sets, Math-
ceedings of the Fifth Canadian Con-
ematika 15 (1968) pages 53-59.
ference on Computational Geome-
try, (1993) pages 151-156 [M94] Jifi Matousek. On geometric op-
timization with few violated con-
[C90] Kenneth L. Clarkson. Las Vegas al- straints, These Proceedings.
gorithms for linear and integer pro-
gramming when the dimension is [MSW92] Jifi Matousek, Micha Sharir and
small, manuscript, 1990. An ear- Emo Welzl. A subexponential bound
lier version appeared in Proceedings for linear programming, Proceed-
of the 29th Annual Symposium on ings of the 8th Annual Symposium
Foundations of Computer Science, on Computational Geometry (1992)
pages 452-5, 1988. pages 1-8.

[DMR93] Karen Daniels, Victor Milenkovic [Mo73] Howard Cary Morris. Two Pigeon
and Dan Roth. Finding the maxi- Hole Principles and Unions of Con-
mum area axis-parallel rectangle in vexly Disjoint Sets, PhD thesis,
a polygon, Proceedings of the Fifth California Institute of Technology,
Canadian Conference on Computa- Pasadena, California (1973).
tional Geometry, (1993) pages 322- [S90] Raimund Seidel. Linear program-
327. ming and convex hulls made easy,
Proceedings of the 6th Annual Sym-
[DGK63] Ludwig Danzer, Branko Grünbaum,
posium on Computational Geome-
and Victor Klee. Helly's Theorem
try, (1990) pages 211-215.
and it's relatives, Proceedings of the
Symposium on Pure Mathematics, [SW92] Micha Sharir and Emo Welzl. A
Vol. 7, Convexity (1963) pages 101- combinatorial bound for linear pro-
180. American Mathematical Soci- gramming and related problems,
ety, Providence, RI. Proceedings of the 9th Annual Sym-
posium on Theoretical Aspects of
[E93] Jürgen Eckhoff. Helly, Radon and
Computer Science (1992), Lecture
Carathody type theorems, Chapter
Notes in Computer Science 577,
2.1 in Handbook of Convex Geome-
pages 569-579.
try, P.M. Grub er and J.M. Willis,
eds., (1993) Elsevier Science Pub- [W91] Emo Welzl. Smallest enclosing disks
lishers B. V., Amsterdam. (balls and ellipsoids), Technical re-
port number B 91-09 Fachbere-
[GM61] Branko Grünbaum and Theodore ich Mathematik, Freie Universität
S. Motzkin. On components in Berlin, Berlin, Germany (1991)
some families of sets, Proceedings of

347
Computing Envelopes in Four Dimensions with Applications"
Pankaj K. Agarwal^ Boris Aronov"'" Micha Sharif

Abstract a simple polygon in the plane, and (c) computing


the smallest-width annulus covering a planar point
Let F be a collection of n d-variate, possibly par- set. The solutions to these problems run in time
tially defined, functions, all algebraic of some con- 0(n17/11+6), for any e > 0, improving previous so-
stant maximum degree. We present a randomized lutions that run in time 0(n8/5+£). We also present
algorithm that computes the vertices, edges, and 2- data structures for (i) performing nearest-neighbor
faces of the lower envelope (i.e., pointwise minimum) and related queries for fairly general collections of
of T in expected time 0(nd+e), for any e > 0. For objects in 3-space and for collections of moving ob-
d = 3, by combining this algorithm with the point lo- jects in the plane, and (ii) performing ray-shooting
cation technique of Preparata and Tamassia, we can and related queries among n spheres or more gen-
compute, in randomized expected time 0(n3+£), for eral objects in 3-space. Both of these data structures
any e > 0, a data structure of size 0(n3+£) that, require 0(n3+e) storage and preprocessing time, for
given any query point q, can determine in 0(log2 n) any e > 0, and support polylogarithmic-time queries.
time whether q lies above, below or on the envelope. These structures improve previous solutions to these
As a consequence, we obtain improved algorithmic problems.
solutions to many problems in computational geom-
etry, including (a) computing the width of a point
set in 3-space, (b) computing the biggest stick in 1 Introduction
*Work on this paper by the first author has been supported Let T — {/i, ... , /„} be a collection of n d-variate,
by NSF Grant CCR-93-01259 and an NYI award. Work on
this paper by the second author has been supported by NSF
possibly partially defined, functions, all algebraic of
Grant CCR-92-11541. Work by the third author has been sup- some constant maximum degree b (and if they are
ported by NSF grant CCR-91-22103, by a Max-Planck Re- partially defined, their domains of definition are also
search Award, and by grants from the U.S.-Israeli Binational described each by a constant number of polynomial
Science Foundation, the G.I.F. — the German-Israeli Founda-
tion for Scientific Research and Development, and the Fund equalities and inequalities of maximum degree b).
for Basic Research administered by the Israeli Academy of Abusing the notation slightly, we will not distinguish
Sciences. between a function and its graph. The lower enve-
tDepartment of Computer Science, Box 90129, Duke Uni- lope Ejr of T is defined as Ejr(x) = min /j(x), where
versity, Durham, NC 27708-0129 USA
* Department of Computer Science, Polytechnic University,
the minimum is taken over all functions of T that are
Brooklyn, NY 11201 USA defined at x. The minimization diagram Mjr of T is
^School of Mathematical Sciences, Tel Aviv University, the decomposition of Rd into maximal connected re-
Tel Aviv 69978, Israel, and Courant Institute of Mathematical gions (of any dimension), called cells, so that within
Sciences, New York University, New York, NY 10012 USA
each cell the same subset of functions appears on the
envelope £>. (A more detailed definition, treating
Permission to copy without fee all or part of this material is also the case of partially-defined functions, is given
granted provided that the copies are not made or distributed for
direct commercial advantage, the ACM copyright notice and the in [28].) The combinatorial complexity of My and of
title of the publication and its date appear, and notice is given Ejr is the number of faces of all dimensions in My.
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee Recently, there has been significant progress in the
and/or specific permission. analysis of the combinatorial complexity of lower en-
velopes of multivariate functions [19, 28]. In partic-
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
ular, it was shown in [28] that the maximum com-

348
plexity of M?- is 0(nd+£), for any e > 0, where the per envelopes in 4-space. These applications fall into
constant of proportionality depends on e, d and b. two main categories: preprocess-for-queries problems,
This result almost settles a major open problem and which call for the construction of such an envelope,
has already led to many applications [6, 19, 28]. How- to be queried repeatedly later, and batched problems,
ever, less progress has been made on the correspond- where all the queries are known in advance, and the
ing algorithmic problem, which calls for the efficient goal is to produce the answers to all of them effi-
construction of the lower envelope of such a collec- ciently. We will present some of these applications,
tion T, in time 0(nd+£), for any e > 0. The ideal as listed in the abstract, where our new algorithm for
output of an algorithm that computes the envelope computing lower envelopes in four dimensions leads
is a data structure of size 0(nd+e), which can return, to improved solutions.
for a given point x 6 IRd, the identity of the func- The paper is organized as follows. In Section 2
tion^) attaining the envelope at x in logarithmic (or we present a general efficient randomized technique,
polylogarithmic) time. Weaker solutions might pro- which we believe to be of independent interest, for
vide just an enumeration of the cells of Mjr, each cell computing all the 0, 1, and 2-dimensional features
augmented with its description as a semialgebraic set, of lower envelopes in any dimension. Then, in Sec-
and/or with a representative point lying in it, and tion 3, we apply this algorithm to the case of tri-
possibly include explicit adjacency structure, repre- variate functions. This gives us an initial representa-
senting all pairs of cells where one cell is contained in tion of the lower envelope of such a collection, which
the closure of the other. we then augment by additional features, resulting in
The paper [28] presents an algorithm for computing a representation suitable for the application of the
the lower envelope of bivariate functions, having the Preparata-Tamassia technique. In Sections 4 and 5
properties listed above, which runs in time 0(n2+£), we present applications of our result to a variety of
for any £ > 0. Other algorithms with a similar per- problems in computational geometry, as listed in the
formance are given in [9, 16]. The simplest solution abstract.
to this problem, involving a deterministic divide-and-
conquer algorithm, was recently presented in [3]. All 2 Lower Envelopes in Arbitrary Di-
these algorithms facilitate point location queries of
the sort described above. Unfortunately, these meth-
mension
ods fail in higher dimensions. For example, the tech- In this section we present a randomized technique for
nique of [28] relies on the existence of a vertical de- computing a partial description of lower envelopes of
composition of the minimization diagram MR of a d-variate functions, for d > 2, whose expected run-
sample R of r functions of !F, into a small number ning time is 0{nd+£), for any e > 0. This technique
(that is, 0(rd+£)) of cells of constant descriptional only computes the vertices, edges, and 2-faces of the
complexity. Such decompositions exist (and are easy envelope, which is sufficient for the construction of
to compute) for d = 2, but their existence in higher envelopes in 4-space, as will be explained in Section
dimensions is still an open problem. 3 below.
In this paper we present an efficient algorithm for Let T = {/i,..-,/n} be a collection of (partial)
computing the vertices, edges, and two-dimensional d-variate functions in Rd+1, satisfying the conditions
faces of the lower envelopes of d-variate functions described in the introduction. We assume that the
having the properties assumed above. We can use functions of T are in general position (see [28] for
this algorithm to compute the entire lower envelope more details and for a discussion of this assumption).
of a collection of tri-variate functions, which has all To compute the lower envelope Ejr of J-, in the above
the desired characteristics; in particular, it supports sense, we proceed as follows. Let E be the family
queries for determining whether a given point lies of all [d - l)-subsets of T. We fix a subset a —
above or below the envelope. The algorithm by- {/i,...,/d-i} G S, and let
passes the problem of having to construct small-size
vertical decomposition by applying the technique of IF = {x e Rd | /i(x) /d-i(x)}.
Preparata and Tamassia [26] for point location in cer-
tain types of 3-dimensional subdivisions. This allows Since the /j's are assumed to be in general position,
us to use a coarser decomposition of the minimization Ua is a two-dimensional surface (or a surface patch).
diagram, whose size is close to cubic. For the sake of simplicity, we assume that W is con-
Several recent papers [4, 11, 23] have studied a va- nected and x 1X2-monotone (i.e., any (d — 2)-flat or-
riety of geometric problems whose solution calls for thogonal to the xiX2-plane meets IIer in at most one
the construction of, and searching in, lower or up- point); otherwise we decompose it into a constant

349
number of connected portions so that each portion is The analysis of the expected running time of the
an rr^-monotone surface patch, and work with each algorithm proceeds along the same lines as described
patch separately. For each i > d, let in [12, 29]. We define the weight, W(T), of a pseudo-
trapezoid r, defined by the arcs of r°", to be the num-
li {xenCT|/i(x) = /1(x) = ...-/d_1(x)}; ber of functions f%, for i = d, d + 1,..., n (excluding
7i is a 1-dimensional curve, which partitions IF into the up to 4 functions whose intersections with IF de-
two (not necessarily connected) regions, Kf, K~, fine T), such that /;(x) < /x(x) = • • • = /d-i(x) for
where some point x G r.
As shown in [12], the cost of the above procedure
Kt = {xGnff|/l(x)>/1(x) = = /d-i(x)} is proportional to the number of pseudo-trapezoids
K- = {xenff|/l(x)</1(x) = = /d-i(x)}.
that are created during the execution of the algo-
rithm, plus the sum of their weights, plus an over-
Then the intersection Qa = f]i>dK^ is the portion head term of 0(nd), needed to prepare the collec-
of IF over which the envelope Ejr is attained by the tions of curves 7^ over all 2-dimensional intersection
functions of a. The algorithm will compute the re- manifolds IF. The analysis given below deals only
gions Qa, over all choices of (d - l)-tuples a of func- with pseudo-trapezoids that are defined by exactly
tions, thereby yielding all the vertices, edges and 2- four such functions (plus the d—\ functions defining
faces of Mjr (because of the general position assump- IIer), and easy and obvious modifications are neces-
tion, any such feature must show up as a feature of sary to handle all other pseudo-trapezoids.
at least one of the regions Qa). Let Ta denote the set of pseudo-trapezoids (or
We compute Qa using a randomized incremental 'cells' for brevity) defined by four arcs of Ya (again,
approach, similar to the ones described in [12, 16, see [12] for details), and let T = \JaeSTcr. Each cel1
24, 25, 29]. Since the basic idea is by now fairly in T is defined byd-l + 4 = <i + 3 functions of T.
standard, we only give a brief overview of the al- In what follows we implicitly assume that the speci-
gorithm, and refer the reader to [12, 29] for details. fication of a cell T £ T includes the d + 3 functions
Let Ya = {~fi | d < i < n}. We first compute the defining r, where there is a clear distinction between
set F17. (We need to assume an appropriate model the first d—1 functions (constituting the set a), and
of computation, in which any of the various prim- the last four functions (defining the four curves that
itive operations required by the algorithm can be generate r along IF). For an integer k > 0 and a
performed in constant time. For example, we can subset R C T, let Tk(R) C T (resp. T<k(R) C T)
assume the model used in computational real alge- denote the set of cells, defined by d + 3 functions of
braic geometry [27], where each algebraic operation, R, as above, with weight k (resp. at most k). Let
involving a constant number of polynomials of con- Nk{R) = \Tk(R)\ and Nk(r) = m&xRNk{R), where
stant maximum degree, can be performed exactly, us- the maximum is taken over all subsets R of T of size
ing rational arithmetic, in constant time.) Next, we r. Similarly, we define N<k(R) and N<k(r). Since
add the curves 7* one by one in a random order, and each cell of To(R) lies on the lower envelope of R, it
maintain the intersection of the regions Kf for the follows that N0(r) = 0{rd+e). Adapting the analysis
curves added so far. Let (7^,7^+1, ... ,7„) be the technique of Clarkson and Shor [15], we have
(random) insertion sequence, and let Qf denote the
intersection of if j", ... , Kf. We construct and main- Lemma 2.1 The probability that a cell T G Tfc(jT)
is created during the incremental construction of Qa,
tain the 'vertical decomposition' Qf ofQf, defined as
where a G E is the tuple for which IF contains T, is
the partitioning of each 2-face </> of Qf into 'pseudo-
trapezoids', obtained by drawing, from each vertex
of 6 and from each locally xi-extreme point on dcj>, a Lemma 2.2 For any 0 < k < n and for any e > 0,
curve within </> orthogonal to the zi-axis, and extend
it (in both directions if necessary) until it hits dip N<k{n) = 0{{k + 1) 3-£„_d+e
again. Each pseudo-trapezoid is defined by at most
four curves of Ta; conversely, any four or fewer curves For a cell T £T, let AT be the event that r e Qf,
of TCT define a constant number of pseudo-trapezoidal for the tuple a G E for which IF contains r, and
cells, namely, those formed along IT7 when only these for some d < i < n. The expected running time
curves are inserted. (Note that this construction is of the algorithm, over all choices of {d — l)-tuples of
well-defined since IF is an siX2-monotone surface.) functions, is thus proportional to
In the (i + l)s*-step we add Kf+l and compute Qf+l
J2(w(r) + l)-Pr[Ar] + 0(nd)
from Qf, using the technique described in [12].

350
J2 £ (k+l)-Pr[AT} + 0(nd) 2-faces F, lie along 0(n2) curves in M3, each be-
k>ÜTETk(T) ing the xyz-projection of the locus of all singular

"£3™<£>+0(n*>
points or points with ^-vertical tangency along some
2-manifold fi = fj, for a pair of indices i ^ j, or
fc=0 (T) along the boundary of some /*. We consider below
only the former case; the latter case can be han-
where the last inequality follows from Lemma 2.1. dled in almost the same (and, actually, simpler) man-
Since Nk{F) = N<k{T) - 7V<(fc_i)(J"), we obtain, ner. Let 6 be one of these curves. We consider the
using Lemma 2.2, 2-dimensional surface Vs, within the xyz-space, ob-
-d-3
tained as the union of all lines passing through points
(fc+l)ATfc(.T) of 6 and parallel to the z-axis; let V6+, V^- denote the
E
fc=0 (T) portions of Vs that lie, respectively, above and below
6. (Note that Vg may have self-intersections along
some vertical lines, along which VÄ+ and Vf are not
(A; + 4)(fc + 3)(fc + 2) well-defined; we omit here details of the (rather easy)
n —d—4 handling of such cases.)
k3-£nd+e
= 0[nd+£ + £ (fc + 4)(fc + 3)(A: + 2)(fc + l)
Let <50 be the portion of 6 over which the functions
fc=i fi and fj attain the envelope Eyr. Clearly, 60 is the
• -d-4
n—d—4 - \ union of all arcs 7F that are contained in 6, and each
= 0(n^- £ ^)=0(n**). such edge of E? is contained in some connected com-
v
fc=i 7 ponent of 60, so the number of connected components
in <50, over all intersection curves, is 0{n3+£). Let w
We thus obtain: be a point in 60. Then the cell c of My lying imme-
Theorem 2.3 The vertices, edges, and 2-faces of the diately above w in ^-direction is such that within c
lower envelope of n (partial) d-variate functions, sat- the envelope Ejr is attained by either fx or fj. Thus
isfying the conditions stated in the introduction, can the upward-directed ^-vertical ray emanating from w
be computed in randomized expected time 0(nd+£), leaves c (if at all) at a point that lies on a 2-manifold
for any e > 0. of the form fi = fk or fj = fk. For fixed i and j,
there are only 0(n) possible 2-manifolds of this kind.
We compute the lower envelope E^ of these 0(n)
3 Envelopes in Four Dimensions 2-manifolds, restricted to Vs+. It is easily seen that
We next apply the results of the preceding section the complexity of E^ is 0(\q(n)), for some constant
q depending on the maximum degree and shape of
to obtain an efficient algorithm for constructing the
lower envelope of a collection T of n tri-variate func- these 2-manifolds; Xq(n) is the maximum length of
tions, satisfying the assumptions made above, in the Davenport-Schinzel sequences of order q, and is close
following strong sense: One can preprocess T, in ran- to linear for any fixed q [3]. We next take the portions
of the graph of E^ that lie over <50, and "etch" them
domized expected time 0(n3+£), for any e > 0, into a
data structure of size 0(n3+£) that supports queries along the corresponding 2-faces of £y. We apply a
fully symmetric procedure within Vf, for all curves
of the form: given a point tȣl3, compute the func-
S. The overall combinatorial complexity of all the
tion^) attaining E? at w; each query can be an-
added curves is thus 0(n2A9(n) + n3+e) = 0(n3+s),
swered in 0(log2 n) time.
We first apply the algorithm summarized in Theo- and they can be computed in 0(n3+£) time, as is eas-
rem 2.3, to compute the vertices, edges, and 2-faces ily verified.
of the minimization diagram My of T. We next par- Let M'-p denote the refined cell decomposition of
tition the cells of Mjr into 'monotone' subcells, in 1R3, obtained by adding to Mjr the arcs 7F, the etched
the sense of Lemma 3.1 below, to obtain a refinement arcs of the upper and lower envelopes in the vertical
M'-p of My. We then use the point-location technique manifolds Vs, and the z-vertical walls (i.e., union of all
of Preparata and Tamassia [26] to produce the data ^-vertical segments) contained in Vs and connecting
structure representing the lower envelope in the above the arcs JF to the etched arcs. As just argued, the
manner. combinatorial complexity of M'-p is still 0(n3+£), and
We define and construct M'-p as follows. We mark, M'-p has the following crucial property:
along each 2-face F of My, the locus 7F of all points
of F which are either singular or have a vertical Lemma 3.1 For each 3-cell c of M'T, every con-
tangency (in the z-direction). The arcs -yp, for all nected component of a cross section of c by a plane

351
parallel to the xz-plane is x-monotone. at any of the critical y values in Lemma 3.2, can be
expressed as a constant number of operations of the
Let M'-pdjo) denote the cross section of M'T by the types mentioned above.In summary, we thus obtain
plane y = y0. Lemma 3.1 implies that Af^(y0) is an the following main result of the paper:
x-monotone planar subdivision, for each y0. Hence, if
we orient the edges of M'T in the positive x-direction, Theorem 3.3 Let T be a given collection of n tri-
add a pair of nominal points s,t at x = -co and variate, possibly partially defined, functions, all al-
at x - +co. respectively, and connect them to the gebraic of constant maximum degree, and whose do-
appropriate unbounded edges of M'r(y0), this map mains of definition (if they are partially defined) are
becomes a planar si-graph, in the notation of [26]. each defined by a constant number of algebraic equal-
(Note that the vertical decomposition that generates ities and inequalities of constant maximum degree.
M'T from MT may create ^-vertical edges; if these Then, for any e > 0, the lower envelope Eyr of T can
edges are oriented consistently, say in the upward z- be computed in randomized expected time 0(n3+s),
direction, then M'T remains an si-graph.) We denote and stored in a data structure of size 0(n3+E), so
this si-graph also by M^(y0). It is easy to verify the that, given any query point w G R3, we can compute
following statement.
Ejr(w), as well as the function(s) attaining ET at w,
in 0(log2 n) time.
Lemma 3.2 Let I be an open interval of the y-axis
that does not contain the y-coordinate of any vertex
°f M'jr, or of any local y-extremum along any edge of 4 Applications: Query Problems
M'jr. Then, for each yi,y2 G /, the st-graphs M'^yi),
-MM2/2) are isomorphic, as labeled embedded planar In this section we apply Theorem 3.3 to two problems,
st-graphs. involving preprocessing and querying certain collec-
tions of objects in 3-space.
We are now in a position to apply the point lo-
cation technique of Preparata and Tamassia [26].
4.1 Ray shooting amidst spheres
They show that, given a 3-dimensional subdivision of
combinatorial complexity N, it can be preprocessed Given a collection S of n spheres in 3-space, we wish
in time 0(7Vlog2Ar) into a data structure of size to preprocess S into a data structure that supports
0(N log2 N), which supports 0(log2 7V)-time point- ray-shooting queries, each seeking the first sphere,
location queries in the given subdivision. However, if any, met by a query ray. This problem has re-
for this to hold, the subdivision must have the prop- cently been studied in [2, 5, 23]. The first two pa-
erties that (a) (the 1-skeleton of) each cross section pers present a data structure that requires 0(n4+£)
of the subdivision by a plane parallel to the xz-plane storage and preprocessing, for any e > 0, and an-
is a planar si-graph, whose faces are all monotone in swers a query in time 0(log2 n). The third paper [23]
the x-direction and whose edges are all oriented in gives a rather elaborate and improved solution that
the positive x-direction (or, for vertical edges, in the requires 0(n3+£) preprocessing and storage, for any
positive z-direction), and (b) at each point where the £ > 0, and answers a query in 0{ne) time. These
cross section, as an si-graph, changes, the graph can algorithms use the technique described in [1], and re-
be updated by a constant number of operations from duce the problem to that of determining whether a
the following collection: (1) insertion of a vertex in query segment e intersects any sphere of S. Then,
the middle of an edge, or the complementary opera- using a multi-level data structure, they reduce the
tion of deleting a vertex of in-degree and out-degree problem to that of detecting whether the line A con-
1 and replacing the two incident edges by one, while taining the segment e intersects any sphere of S. As
maintaining x-monotonicity of the incident faces; (2) observed in [5, 23], this problem can be further re-
insertion of an edge partitioning an x-monotone face duced to point location in the upper envelope of a
into two x-monotone subfaces, or, conversely, deletion set of certain tri-variate functions, as follows. Let 7r
of an edge and merging its two adjacent faces, pro- be the plane passing through A and orthogonal to the
vided their union remains x-monotone; and (3) merg- vertical plane V passing through A. Let TT+ (resp. 7r~)
ing two adjacent vertices into one vertex (collapsing be the half-space lying above (resp. below) w. Let S
the edge connecting them), or splitting a vertex into be a sphere whose center lies in n+ and which inter-
two vertices (forming a new edge between these ver- sects V in a disc D. Then the center of D lies above
tices), again maintaining x-monotonicity. A, so either A intersects S or passes below S, in the
It is easily verified that, indeed, each change oc- sense that A and S are disjoint and there is a point
curring in the structure of the cross section M^-(-), on A that lies vertically below a point in S. A similar

352
property holds if the center of S lies in TT~ . We pre- 4.2 Nearest neighbor queries
process the centers of spheres of S into a half-space
range-searching data structure, of size 0{n3+£), for Let S = {Si,...,Sn} be a collection of n pairwise-
a query A, we can decompose S into 0(1) canonical disjoint convex objects ('sites') in 3-space, each hav-
subsets, so that, within each subset, either the cen- ing constant description complexity, namely, each de-
ters of all spheres lie in 7r+, or they all lie in ir~. Let fined by a constant number of algebraic equalities and
us consider the case when the centers of all spheres inequalities of constant maximum degree. We wish to
compute the Voronoi diagram Vor(S) of S, and pre-
lie in ir+.
process it for efficient point location queries. That is,
Hence, we need to solve the following subproblem:
each query specifies a point w in 3-space and seeks
Given a set <S of n spheres in 3-space, and given a
the site of S nearest to w (say, under the Euclidean
query line A with the property that for each sphere distance). This is a generalization to 3-space of the
S 6 S, either A intersects S or there is no point of
classical Post Office Problem.
S lying vertically below A, determine whether A in-
As observed in [18], the problem is equivalent to
tersects any sphere of S. We reduce this problem
the computation of the following lower envelope in 4-
to point location in the lower envelope of certain tri-
space. For each S € S, define Fs(x,y,z) to be the
variate functions, as follows. We can parametrize a
Euclidean distance from (x, y, z) to S, and let $ be
line A in 3-space by four parameters (£1,62, £3, £4))
the lower envelope of these functions. Then, given a
so that the equations defining A are y = z£i + £2,
query point (x,y,z), the site(s) S £ S nearest to w
z = x£3 + £4. (We assume here that A is not parallel
are those for which Fs attains $ at (x,y,z). Thus,
to the yz-plane; such lines can be handled in a dif-
by Theorem 3.3, this can be done using 0{n3+£) pre-
ferent, and much simpler manner.) For each sphere
processing time and storage, for any e > 0, and each
S € S, define a function £4 = Fsßu&b), so that
query can be answered in 0(log2 n) time. (Note that
the line A(£i,£2,£3,£4) is tangent to S from below
Theorem 3.3 is indeed applicable here, because the
(Fs is only partially defined, and we put Fs = +00
functions Fs are all (piecewise) algebraic of constant
when it is undefined; it is easily checked that Fs is
maximum degree, as is easy to verify from the condi-
algebraic of bounded degree, and that its boundary
is also algebraic of bounded degree). Let $ be the tions assumed above.)
lower envelope of the functions Fs, for S G S. Then a This is a fairly general framework, and admits nu-
query line A(£i, £2, £3, £4) having the above properties merous generalizations, e.g., we may replace the Eu-
misses all spheres of S if and only if £4 < $(£1, £2, £3)- clidean distance by other distances, perform queries
Thus, by Theorem 3.3, one can answer such queries with objects other than points (as long as the location
in time 0(log2n), using 0(n3+£) preprocessing time of a query object can be specified by only 3 real pa-
and storage, for any e > 0. Plugging the half-space rameters; this is the case, e.g., if the query objects are
range searching data structure and the point location translates of some rigid convex object), etc. An inter-
data structure into the multi-level data structure de- esting generalization is to dynamic nearest-neighbor
scribed in [5, 23], we obtain a data structure for the queries in the plane, where each object of S moves
segment-emptiness problem. A closer analysis of this along some given trajectory, and each query (x, y, t)
data structure shows that the preprocessing time and asks for the object of S nearest to the point (x,y)
storage of the overall data structure is still 0(n3+£), at time t. Using the same approach as above, this
for any e > 0, and that the query time is 0(log2n). can be done, under appropriate assumptions on the
Finally, plugging this data structure for the segment- shape and motion of the objects of S, with 0(n3+£)
emptiness query into the general ray-shooting tech- preprocessing time and storage, for any e > 0, and
nique by Agarwal and Matousek [1], we obtain a fi- 0(log2 n) query time.
nal data structure, still requiring near-cubic storage Remark: There is a prevailing conjecture that the
and preprocessing, using which one can answer a ray- complexity of generalized Voronoi diagrams in 3-
shooting query in time 0(log4n). That is, we have space, and of dynamic Voronoi diagrams in the plane,
shown: is only near-quadratic, under reasonable assumptions
concerning the distance function and the shape of the
sites (and of their motions). This was indeed proved
Theorem 4.1 A set Sofn spheres in R3 can be pre- recently in [14] for the case where the sites are lines
processed in randomized expected time 0{n3+£) into in 3-space and the distance function is induced by a
a data structure of size 0(n3+e), for any e > 0, so convex polyhedron. If this conjecture is established,
that a ray shooting query can be answered in time then the above algorithm, of near-cubic cost, is far
0(log4n). from being optimal, and will need to be improved

353
considerably. sphere §2 C I3. The vertices of M are points on §2,
each being the outward normal of a face of V, the
5 Applications: Batched Problems edges of M are great circular arcs, each being the
locus of the outward normal directions of all planes
We next consider batched applications. These appli- supporting V at some fixed edge, and the faces of
cations solve a variety of rather unrelated problems, M are regions, each being the locus of the outward
but they all involve an almost identical subproblem, normal directions of all planes supporting V at a ver-
where lower (or upper) envelopes in 4-space play a tex. M can be computed in linear time from V. Let
role. To avoid repetition, we describe in detail only M' denote the spherical map M reflected through
one application, and then state the improved bounds the origin, and consider the superposition of M and
for the other applications without proof, referring the M!. It suffices to consider the top parts of M and
reader to the relevant literature. M', i.e., their portions within the hemisphere z > 0.
The following applications are based on the para- Each intersection point between an edge of M and an
metric search technique of Megiddo [22], which, in edge of M' gives us a direction u for which there exist
our case, requires a parallel algorithm for computing two parallel planes orthogonal to u and supporting V
the lower envelope of a set of surfaces. However, the at two so-called antipodal edges. Thus the problem
algorithm presented above is highly unparallelizable, reduces to that of finding an intersection point for
because it uses an incremental insertion procedure of which the distance between the corresponding paral-
regions into 2-D arrangements, and later uses a plane- lel supporting planes is minimized.
sweep in 3-space. To finesse this difficulty, we apply We centrally project the edges of (the top portions
the parametric search technique with an additional of) M and M! onto the plane z = 1. Each edge
twist that avoids the need to use a parallel algorithm. projects to a line segment or a ray. Let £ and £' be the
resulting set of segments and rays in the plane. Using
the algorithm described in [10], we can decompose
5.1 Width in 3-space
£ x £', in time 0(n log2 n) into a family of 'canonical
Let S be a set of n points in 3-space. The width of S is subsets'
the smallest distance between a pair of parallel planes
so that the closed slab between the planes contains S. r = {(£i,£'1),(£2A),---,(£t,£l)}, (i)
In two dimensions, the problem can be easily solved in such that
O(nlogn) time. An 0(n2)-time algorithm for three
dimensions was presented in [21]. Recently, Chazelle (i) £i C £ and £[ C £'■
et al. [11] presented an 0(n8/5+£)-time algorithm, for
any e > 0. In this subsection, we present an improved
(ii) ^(|^| + |^|) = 0(nlog2n);
randomized algorithm, whose expected running time
i=l
isO(n17/11+£)=0(n1-546).
Clearly, it suffices to compute the width of the con- (iii) each segment in £, intersects every segment of
vex hull of S, so assume that the points of S are in £[; and
convex position, and that the convex hull V of S is
(iv) for every pair e, e' of intersecting segments in £ x
given. It is known that any two planes defining the
£', there is an i such that e e £t and e' G £[.
width of S are such that either one touches a face
of V and one touches a vertex of V, or each of them By property (iv), it suffices to consider each pair
touches an edge of V; see [11, 21]. The first case can {£,£[) separately. Let d (resp. £<) denote the set of
be handled in O(nlogn) time [11, 21]. The difficult lines containing the edges of V corresponding to the
case is to compute the smallest distance between a edges of £t (resp. £[). By construction, all lines of d
pair of parallel planes supporting V at two 'antipo- lie above all lines of £•. Property (iii) implies that
dal' edges, because, in the worst case, there can be every pair of parallel planes 7r, ir', where n contains a
6(n2) such pairs of edges. Chazelle et al. [11] pre- line A of d and n' contains a line A' of dt, are support-
sented an 0(n8/5+£)-time algorithm to find the small- ing planes of V as well. Hence, we want to compute
est distance, using the parametric search technique. the smallest distance between two such planes. Since
We will present a randomized algorithm, whose ex- the distance between n and n', as above, is equal to
pected running time is 0{nl7/ll+£), for any e > 0, the distance between A and A', it follows that this
using a somewhat different approach. problem is equivalent to that of computing the clos-
Let M denote the Gaussian diagram (or normal est pair of lines in d x d- Hence, we need to solve
diagram) of V. M is a spherical map on the unit the following problem: Given a set C of m 'red' lines

354
and another set £' of n 'blue' lines in R3, such that all problem of computing R2 thus reduces to computing
red lines lie above all blue lines, compute the closest the set of points tl>(£), for £ G £ \ R\, that lie below
pair of lines in £ x £'. For any pair of lines £, £' G R3, the upper envelope F. By Theorem 3.3, this can be
let d{£,£') be the Euclidean distance between them, accomplished in time 0(n3+£ + m log2 n), for any e >
and let d(£, £') = mmeect e>ec d(£,£'). 0. The total time spent in Steps (iii) and (iv) is thus
We first describe a simple randomized divide-and- 0(n3+£+m log2 n). Let T(m, n) denote the maximum
conquer algorithm for computing d(£, £'), whose ex- expected running time of the algorithm. Then
pected running time is 0(n3+£ + m\og2n). If m =
0(1), we compute d{£,£') for all pairs £ G £, £' G £', T{m,n)<T{r^,n) + 0(n3+e + mlog2 n).
and choose the minimum distance. Otherwise, the
algorithm performs the following steps: The solution to this recurrence is easily seen to be
0(n3+e log TO + m log2 n) = 0(n3+£ + m log2 n), for
(i) Choose a random subset R\ C £ of m/2 red any e' > e. Hence, we can conclude:
lines; each subset of size m/2 is chosen with equal
probability. Lemma 5.1 Given a set £ of m lines and another
set £' of n lines in R3, such that all lines in £ lie
(ii) Solve the problem recursively for {R\,C). Let above all lines of £', the closest pair of lines in £ x £'
Si=d(R1,C). can be computed in time 0(n3+e +mlog n), for any
e> 0.
(iii) Compute the set R2 {£ G £\Ri I d{£,£') <
Si}. Next, we describe another algorithm for computing
d(£,£'), which uses the above procedure as a sub-
(iv) Compute d(£,£') for all pairs £ G R2, £' G £', routine. We first describe an algorithm for the 'fixed-
and output the minimum distance (or output Si size' problem that, given a parameter S, determines
if R2 is empty). whether <*(£,£') < 0, d(£,£') = S, or d(£,£') > 6.
Next, we apply the parametric search technique to
For a line £' G £', let R<-e') = {£ G £ | d(^,f) < ft},
this algorithm, with an additional twist, to compute
so that i?2 = Ufe£' ^ ^ Using a standard prob-
abilistic argument, we can show that the expected d(£,£').
Consider the fixed-size problem. If m > n3+e, the
size of R{e) is 0(1), for each £' G £'. Therefore the
problem can be solved, in 0(m log2 n) time, by com-
expected size of R2 is 0(n). Consequently, the ex-
puting S* = d(£,£'), using Lemma 5.1, and by com-
pected running time of Step (iv) is 0(n2). The only
paring 6* with 8. So assume that m < n3.
non-trivial step in the above algorithm is Step (iii).
We now map each line £' G £' to the point tp(£'),
We compute R2 as follows. We map each line £ G £
as defined above, and each line £ G £ to a surface
to a point tp(£) = (01,02,03,04) in R4, where y =
<j>(£) which is the locus of all points ip(£') such that
a\X + 02 is the equation of the xy-projection of £,
d(£, £') = S and £' lies below £. (This is a dual rep-
and z = C13U + 04 is the equation of £ in the ver-
resentation of the problem, where the roles of £ and
tical plane y = a\X + 02 (where u denotes the axis
of £' are interchanged.) The open region <j>~ lying
orthogonal to the z-axis). We can also map a line
below (j>(£) consists of points corresponding to lines
£' to a surface 7 = ~y(£') which is the locus of all
£' that lie below £ and satisfy d{£,£') > 6. Again,
points tp(£) such that d{£,£') = 8\ and £ lies above
each surface (f>(£) is xia;2^3-monotone, i.e., <f>{£) is the
£'. Removal of 7 partitions R4 into two subsets, one,
graph of a function X4 = ge(xi,x2, X3). Let
denoted by 7", consisting of points for which the cor-
responding lines either lie below £', or lie above £' and G(xi,X2,xz) — min< (xi,x2,x3)
d(£,£') < 6\, and the other subset, 7+, consisting
of points whose corresponding lines lie above £' and be the lower envelope of these functions. By the same
d(£,£') > Si. Our choice of parameters ensures that argument as above, d(£,£') < S if and only if there
7(^') is xia;2X3-monotone, i.e., any line parallel to the is a point ip(£'), for some £' G £', that lies above the
^4-axis intersects '){£') in at most one point. Hence, lower envelope G, and d(£,£') = 5 if and only if no
7(£') is the graph of a function £4 = fe>(xi,X2,xs). point corresponding to the lines of £' lies above G
Let and at least one such point lies on G. To detect these
F(xi,x2,x3) = ma,xfe'(x1,x2,x3) two conditions, we proceed as follows.

be the upper envelope of the set {fe> | £' G £'}. For (i) Fix a sufficiently large constant r. Choose a ran-
a line £ G £ with ip(£) = (01,02,03,04), we have dom subset R C £ of size t = cr log r, where c is
a4 > F(CLI, 02,03) if and only if d({£},£') > Si. The some appropriate constant independent of r.

355
(ii) Let TR = {ge \ £ G R} be the set of t tri-variate how to parallelize the first algorithm. We therefore
functions corresponding to the lines of R, and let simulate the above sequential algorithm at 6 = 6*,
GR be the lower envelope of TR. Decompose the with the additional twist that, instead of just sim-
region of R4 lying below GR into a collection E = ulating the solution of the fixed-size problem at 8*,
{n, ... ,rfc} of k = 0(t4ß(t)) = 0(r4ß(r) log4r) the algorithm will attempt to compute 8* explicitly.
semialgebraic cells of constant description com- Since r is chosen to be constant, the set E can be
plexity each; here ß(r) is a slowly growing func- computed by making only r°^ implicit "sign tests"
tion whose exact form is determined by the alge- involving 6*, thus only a constant number, r°^l\ of
braic degree of the surfaces in T. Such a decom- solutions of the fixed-size problem are needed; see
position can be obtained using the algorithms [4, 11] for details. It can be checked that the prob-
described in [4, 11]. It is based on a decompo- lem of determining whether a surface <t>(£) intersects a
sition of E3 into a family E' of 0(r4ß(r) log4 r) prism T G S or whether a point ip(£') lies in T can be
cells of constant description complexity, so that, reduced to computing the signs of a constant number
within each cell, the same set of function graphs of univariate polynomials, each of constant degree, at
appear on the lower envelope GR. The decompo- 6*. Let n = {Pl(S), ... ,p„(6)}, s = 0{m + n), be
sition E is then defined as the following collection the set of these polynomials, over all lines of £, £'
of semi-unbounded 'prisms': and over all prisms of S. Let 6\ < ■ ■ ■ < 8U be the
real roots of these polynomials. By a binary search
E = {{(x.z) |xeA,z< Gfl(x)} | A e S'} . over these roots we compute the largest root 8a such
that 8a < d(£, £'). Each step of the binary search
(iii) For each prism r G E, let £T = {£ G £ | <f>{£) n involves comparing 8* with some Si, which in turn
r ^ 0}, and C'T = {£' G £' | ip{£') G r}. involves solving an instance of the fixed size problem
for some S^. If 6a =8*, we have found the value of
(iv) If LUH-C ^ £' (i-e-, there is a line £' G £' 8* so we stop right away. Thus, assume that <5Q < 8*.
such that the point ip{£') lies above GR), then
We can now easily resolve the signs of all polynomi-
return «5 > 6*. If there is a r G S such that
als of II by evaluating them at (6a + 8a+\)/2. Once
|£T| > m/r + 1, then go back to Step (i).
we have computed CT,CT for all T G E, we compute
(v) For each prism r G S, if both CT,C'T are d(CT, C'T) recursively and return minT€S d(£T,£'T) as
nonempty, then solve the problem recursively for d(C, £'). (Note that \JTeE C'T = £', since we are sim-
£T and C'T. If there is a subproblem for which ulating the algorithm at 6*.) The correctness of the
6 > d(CT,C'T), then return 6 > 8*. If there is no algorithm is established by the following lemma.
such subproblem, but there is one subproblem
Lemma 5.2 If none of the calls to the fixed size prob-
for which 8 = 6*, then return 6 = 6*. Finally, if
lem in Steps (i)-(iv) returns the value of d(£, £'),
none of these two cases occur, then return 6 < 6*.
then d{C, £') = minTgH d(£T, L'T).
The correctness of the algorithm follows from the Proof: Let d(C,C') = 6*, and let £ G £, £' G £' be
above observations. As for the running time, the well- a pair of lines such that d(£,£') = 8*. Since we are
known results on random sampling [15, 20] imply that simulating the fixed-size problem at 8 = 5*, no point
if c is chosen sufficiently large then, with high proba- corresponding to the lines of £' lies above the lower
bility, |£r| < m/r+1 for every T G E. Hence, the ex- envelope of the surfaces defined by £ (for 6 = 8*),
pected number of times we have to go back to Step (i) i.e., there exists a prism r G E such that £' G £'T
from Step (iv) is only a constant. Let T(m, n) denote (i.e., ip(£') lies in r). If £ does not belong to £r, then
the expected running time of the algorithm. Then ip(£') lies below cj>(£), which implies that d{£,£') > 8*,
k a contradiction. Hence the pair (£, £') appears in the
T{m, n) < Y^ T(- + 1, rii) + 0(m + n), subproblem involving £T and £'T. D
t=i Let T'(m,n) denote the maximum expected run-
ning time of the algorithm. Then we obtain the fol-
for m < n3+e, where £\ nt = n. The solu- lowing recurrence
tion of the above recurrence is easily seen to be
0(m8/11+e'n9/11+e' +m1+e' +n1+£'), for any e' > e.
Next, we describe how to apply the parametric T'(m, n)<YJT'(~ + 1, nt) + r°^ ■ T(m,n),
i=\
search technique to this algorithm. As mentioned
earlier, we cannot use this algorithm directly in the 3+£
for m < n . The solution of the above recurrence is
parametric search paradigm, because we do not know also 0{m^n+e'ng/n+E' +ml+£' +n1+£'), for a differ-

356
ent but still arbitrarily small constant e' > e. Hence, 5.3 Minimum-width annulus
we can conclude Let S be a set of n points in the plane. We wish
Lemma 5.3 Given a set £ of m lines and another to find the (closed) annulus of smallest width that
set £' of n lines such that all lines in £ lie above all contains 5, i.e., we want to compute two concentric
lines of £', the closest pair of lines in £ x £' can be disks Di and D2 of radii n and r2, such that all
computed in time 0(m8/11+en9/11+£ + m1+£ + nl+s), points of S lie in the (closure of) D2 - D\ and r2 - n
for any e > 0. is minimized. This problem has been studied in [4]. It
is known [4, 17] that the center of such an annulus is
Finally, we apply Lemma 5.3 to all subsets either a vertex of the closest-point Voronoi diagram,
(&,£•) of T (cf. (1)), and output the mini- Voic(S), of S, a vertex of the farthest-point Voronoi
mum of the distances obtained for each subprob- diagram, Vor/(5), of S, or the intersection point of
lem. This is equal to the minimum distance be- an edge of Yovc(S) and an edge of Vor/(5). The
tween any pair of parallel planes, each supporting difficult part is testing the intersection points of edges
an edge of V. The total expected running time of the two diagrams, because there can be 6(n2) such
is E!=i O (|^|8/11+£|^'|9/11+£ + |£|1+£ + I3l1+e) = points in the worst case. Following the same idea as
0(n17/11+e'), where e' is yet another but still arbi- in [4], which reduces the problem to that of batched
trarily small positive constant. Putting everything searching of points relative to an envelope of functions
together, we can conclude: in 4 dimensions, but using the technique described
above for computing the width in 3-space, we obtain:
Theorem 5.4 The width of a set of n points in
R3 can be computed in randomized expected time
Theorem 5.6 The smallest-width annulus contain-
0(nl7/u+£), for anye > 0.
ing a set of n points in the plane can be computed in
randomized expected time 0(n17/u+£), for any e > 0.
5.2 Biggest stick in a simple polygon
Let P be a simple polygon in the plane having n
edges. We wish to find the longest line segment e References
that is contained in (the closed set) P. Chazelle and
[1] P. Agarwal and J. Matousek, Ray shooting and para-
Sharir presented in [13] an 0(n199)-time algorithm metric search, SIAM J. Comput. 22 (1993), 794-806.
for this problem, which was later improved by Agar-
wal et al. [4] to 0(n8/5+e), for any e > 0. The latter [2] P. Agarwal and J. Matousek, Range searching with
paper reduces this problem, just as in the computa- semialgebraic sets, Proc. 17th Symp. on Mathemati-
tion of the width of a point set in 3-space, to that of cal Foundations of Computer Science, 1992, 1-13.
finding the extreme value of a certain function of two
parameters, optimized over all intersection points be- [3] P. Agarwal, O. Schwarzkopf and M. Sharir, The
tween the edges of two planar maps. This problem, in overlay of lower envelopes and its applications,
turn, reduces to the problem of optimizing the func- manuscript, 1993.
tion over all intersection points of pairs of lines in [4] P. Agarwal, M. Sharir and S. Toledo, New applica-
£i x £2, where C\,£2 are two appropriate families of tions of parametric searching in computational ge-
lines. By regarding the lines of £\ as data points, and ometry, to appear in J. Algorithms.
each line of £2 as inducing a certain function over the
lines of C\, and by using an appropriate parametriza- [5] P. Agarwal, L. Guibas, M. Pellegrini, and M. Sharir,
tion of these points and functions, the problem can Ray shooting among spheres, manuscript, 1992.
be reduced to that of testing whether any point in a
certain set of points in 4-space lies above the lower [6] P. Agarwal and M. Sharir, On the number of views of
polyhedral terrains, Proc. 5th Canadian Conf. Com-
envelope of a certain collection of tri-variate func-
putational Geometry, 1993, 55-61.
tions. Combining the approach of [4] with the one
described in the previous subsection, we can compute [7] B. Aronov and M. Sharir, Triangles in space, or:
the longest segment e in expected time 0(n17/11+e), Building (and analyzing) castles in the air, Combi-
for any e > 0. Omitting all the details, which can be natorica 10 (1990), 137-173.
found in [4], we conclude:
[8] J.D. Boissonnat, O. Devillers, R. Schott, M. Teillaud
Theorem 5.5 One can compute the biggest stick and M. Yvinec, Applications of random sampling to
that fits inside a simple polygon with n edges, in ran- on-line algorithms in computational geometry, Dis-
domized expected time 0(n17/n+e), for any e > 0. crete Comput. Geom. 8 (1992), 51-71.

357
[9] J.D. Boissonnat and K. Dobrindt, On-line random- [24] K. Mulmuley, A fast planar partition algorithm, I,
ized construction of the upper envelope of triangles J. Symbolic Computing 10 (1990), 253-280.
and surface patches in R3, manuscript, 1993.
[25] K. Mulmuley, A fast planar partition algorithm, II,
[10] B. Chazelle, H. Edelsbrunner, L. Guibas and M. J. ACM38 (1991), 74-103.
Sharir, Algorithms for bichromatic line segment
problems and polyhedral terrains, Algorithmica 11 [26] F.R Preparata and R. Tamassia, Efficient point loca-
(1994), 116-132. tion in a convex spatial cell-complex, SIAM J. Corn-
put. 21 (1992), 267-280.
[11] B. Chazelle, H. Edelsbrunner, L. Guibas and M.
Sharir, Diameter, width, closest line pair, and para- [27] J. Heintz, T. Recio and M.-F. Roy, Algorithms in
metric searching, Discrete Comput. Geom. 10 (1993) real algebraic geometry and applications to compu-
183-196. tational geometry, in Discrete and Computational
[12] B. Chazelle, H. Edelsbrunner, L. Guibas, M. Sharir Geometry: Papers from the DIM ACS Special Year
(J.E. Goodman, R. Pollack and W. Steiger, Eds.),
and J. Snoeyink, Computing a single face in an ar-
AMS Press, Providence, RI 1991, pp. 137-163.
rangement of line segments and related problems,
SIAM J. Computing 22 (1993), 1286-1302. [28] M. Sharir, Almost tight upper bounds for lower en-
[13] B. Chazelle and M. Sharir, An algorithm for general- velopes in higher dimensions, Proc. 34th IEEE Symp.
ized point location and its applications, J. Symbolic on Foundations of Computer Science, 1993, 498-507.
Computation 10 (1990), 281-309. (Also to appear in Discrete Comput. Geom.)

[14] L.P. Chew, K. Kedem, M. Sharir and E. Welzl, [29] M. Sharir and P. Agarwal, Davenport-Schinzel Se-
Voronoi diagrams of lines in 3-space under a poly- quences and Their Geometric Applications, Cam-
hedral convex distance function, in preparation. bridge University Press, to appear.

[15] K. Clarkson and P. Shor, Applications of random


sampling in computational geometry II, Discrete
Comput. Geom. 4 (1989), 387-421.

[16] M. de Berg, K. Dobrindt and O. Schwarzkopf,


On lazy randomized incremental construction, Proc.
26th ACM Symp. on Theory of Computing, 1994, to
appear.

[17] H. Ebara, N. Fukuyama, H. Nakano and Y. Nakan-


ishi, Roundness algorithms using the Voronoi dia-
grams, First Canadian Conf. Computational Geom-
etry, 1989.

[18] H. Edelsbrunner and R. Seidel, Voronoi diagrams


and arrangements, Discrete Comput. Geom. 1
(1986), 25-44.

[19] D. Halperin and M. Sharir, New bounds for lower


envelopes in 3 dimensions, with applications to visi-
bility in terrains, Proc. 9th ACM Symp. on Compu-
tational Geometry, 1993, 11-18. (Also to appear in
Discrete Comput. Geom.)

[20] D. Haussler and E. Welzl, e-nets and simplex range


queries, Discrete Comput. Geom. 2 (1987), 127-151.

[21] M. Houle and G. Toussaint, Computing the width of


a set, Proc. 1st ACM Symp. Computational Geome-
try, 1985, pp. 1-7.

[22] N. Megiddo, Applying parallel computation algo-


rithms in the design of serial algorithms, J. ACM
30 (1983), 852-865.

[23] S. Mohaban and M. Sharir, Ray shooting amidst


spheres in three dimensions, manuscript, 1993.

358
Query-Sensitive Ray Shooting

Joseph S. B. Mitchell* David M. Mount1, Subhash Suri*

1 Introduction put size, there exist configurations of obstacles and rays


for which solving ray shooting queries is intuitively very
Ray shooting is the problem of determining the first in- easy, and others for which it is quite a bit more com-
tersection of a ray with a set of obstacles. We assume plicated. Practical experience suggests that worst-case
that obstacles are modeled as polygons in the plane, or scenarios are rare for many applications. By concen-
generally polyhedra in higher dimensions. Since many trating on worst-case asymptotic performance, algorithm
ray shooting queries may be applied to a given set of ob- designers may overlook simple approaches that perform
stacles, it is desirable to preprocess the obstacles so that very well in the vast majority of practical situations, even
query processing is as efficient as possible. The problem though their worst-case performance can be quite poor.
of ray shooting in a simple polygon with n vertices has One approach for dealing with this phenomenon is to de-
been studied by [7, 6, 10]. In all cases, with linear sign algorithms for special-purpose classes of inputs, e.g.
space, ray shooting queries can be answered in O(logn) for convex, star-shaped, or monotone polygons. How-
time. Ray shooting amidst a set of polygonal obstacles ever, these approaches may not be useful if inputs do
has been considered by [1, 6, 8, 10, 15]. In all these not satisfy these conditions. An alternative approach
cases, space is within a polylogarithmic factor of linear, is to design algorithms with good expected-case perfor-
and the best query time is 0{yßlog n) query time. mance. However, there does not seem to be a useful
One of the shortcomings of these approaches is that notion of "random" polygon or "random" polyhedron
they fail to account for the geometric structure of the that captures the structure existing in many geometric
obstacle set and query ray. Analyses based solely upon applications.
input size cannot account for the fact that, for a fixed in- In this paper we suggest a different approach. We
•jsbm@ams.sunysb.edu, Applied Math, SUNY, Stony Brook, present a fully general algorithm for the ray shooting
NY 11794-3600. Partially supported by grants from Boeing Com- problem, whose performance is not described as a func-
puter Services, Air Force Office of Scientific Research contract tion of input, but rather as a function of the complexity
AFOSR-91-0328, and by NSF Grants ECSE-8857642 and CCR- of a query with respect to an intrinsic parameter of the
9204585.
tmount@cs.umd.edu, Dept. of Computer Science and Insti- input. This parameter is called the simple cover com-
tute for Advanced Computer Studies, University of Maryland, Col- plexity, and will be defined shortly. We feel that this
lege Park, MD 20742. Partially supported by NSF Grant CCR- parameter intuitively captures the geometric complexity
9310705. of a given query. As in [6, 10], we construct a carefully
'suri@bellcore.com, Bellcore, Room 2Q-358, 445 South Street,
Morristown, NJ 07960.
designed subdivision of free space that has low "stabbing
number" with respect to that portion of a query segment
Permission to copy without fee all or part of this material is that lies within free space. This allows query processing
granted provided that the copies are not made or distributed for to proceed by a simple "walk" through the subdivision.
direct commercial advantage, the ACM copyright notice and the
title of the publication and its date appear, and notice is given We focus on a generalization of ray shooting, called
that copying is by permission of the Association of Computing
Machinery. To copy otherwise, or to republish, requires a fee directed segment shooting (or just segment shooting, for
and/or specific permission. short). Given a set of obstacles and a directed line seg-
ment pq, determine the first intersection (if any) with an
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50 obstacle for a point traveling along this segment from p

359
to q. If there is no intersection, the point q is returned. have a smaller complexity value than a ray that grazes
The reason for this formulation is that there are applica- the boundary of the obstacles. In this sense, we feel
tions of ray shooting arising in motion simulation where that this complexity measure is a reasonable reflection
a number of short segment queries are used to approx- of the intrinsic difficulty of solving a ray shooting query.
imate more complex curved motion. Furthermore, in Observe that complexity is invariant under orthogonal
some interference-detection algorithms for virtual reality transformations of the plane; however, it is not invariant
applications, one tracks the motion of an object through under general affine transformations, since balls are not
free-space by performing segment-shooting queries for preserved.
each boundary edge of the moving object [12]. We present two results. For ray shooting queries in
Before defining the complexity parameter referred to arbitrary dimensions, we analyze the performance of a
above, we give some definitions. Let P denote a fi- simple variant of an existing data structure, called a PM
nite collection of pairwise-disjoint polygonal obstacles in k-d tree [16], with respect to simple cover complexity.
the plane, or, more generally, polyhedral obstacles in d- Samet [16], gives an analysis of the maximum depth of
space. Because our algorithms are based on repeated this tree in terms of the minimum separation distance
subdivision of space into sufficiently simple regions, we between nonadjacent vertices and edges. We show that
need to make the bounded incidence assumption that the size of the data structure and the time complexity
each point is incident to at most a constant number, of segment shooting queries can be related to the sim-
ß, of faces of dimensions < d - 1. Here face refers to ple cover complexity of the obstacle set and the query
boundary fiats of all dimensions < d - 1. Define a ball segment, respectively. In the plane, we strengthen these
of radius r to be the (open) set of points that are less results. Given a set of polygonal obstacles with a total
than distance r from a given center point. In the plane, of n vertices, we show how to to build a subdivision of
a ball is simple if it intersects at most 2 edges of P. In size 0(n) in 0(n log n) time, such that segment shooting
dimension d > 3, the value 2 can be replaced with any queries can be answered in time 0(logn + scc(s)), where
constant > ß. Given any e > 0, we say that a ball of ra- scc(s) is the simple cover complexity of the obstacle-free
dius r is e-strongly simple if the ball with the same center portion of the query segment.
and radius (1 + e)r is simple. Given e, a strongly simple Because we terminate our search along a query ray as
cover of a domain D, is a collection of e-strongly sim- soon as it hits an obstacle, it is possible to make a further
ple balls whose union contains D. (Note that the balls improvement in the planar analysis. We say that two
themselves cover D, but their expansion by (1 + e) is points can reach one another if there is a path between
simple.) Finally, the simple cover complexity of D (with them that does not intersect any obstacle. A region of
respect to e), scc(D), is defined to be the cardinality of space is connected if all points within this region are mu-
the smallest strongly simple cover of D. We will use the tually reachable, and a connected component of the re-
term complexity for short. gion is a maximally connected subset of the region. We
For example, in Fig 1, we show a strongly simple cover can modify the definition of simplicity, by saying that a
of size 4 for a line segment (shown as a dashed line). The ball that contains some point p is C-simple (where "C"
e value is 1/4. Solid circles are the balls of the cover, and stands for connected) if p's connected component in the
dotted circles are balls of radius (1 + e)r. ball is bounded by at most two obstacle edges. We can
modify the definition of complexity using C-simplicity,
to derive a notion of C-complexity. It is easy to see that
any ball that is simple is also C-simple, and thus the
C-complexity of an object is not greater than its com-
plexity. Consider, for example, the line segment shown
as a dashed line in Fig. 2. Its standard complexity would
be quite high, but because the connected components of
the two covering balls containing this segment are sim-
ple, its C-complexity is only 2. Our results in the plane
hold under this connected notion of simple cover com-
plexity.
Before describing our algorithms we mention one tech-
nical fact. The definition of simplicity is based on a pa-
rameter e > 0. In the following theorem we observe that
the choice of e affects the complexity of a domain by
Figure 1: Strongly simple cover. only a constant factor, and so henceforth we exclude ref-
erences to e when deriving asymptotic bounds. Its proof
Intuitively, it is easy to see that a ray that is short is straightforward, and is omitted from this version.
and geometrically well separated from all obstacles will

360
To: support segment shooting queries, we make one
modification, which we call smoothing. (Smoothing is a
well known operation on quad tree data structures and
is better known under the names of "restriction" [11]
or "balancing" [14, 4, 13]. We prefer the term "smooth-
ing" because it avoids confusion with balancing in binary
trees.) The idea of smoothing is quite simple. We say
two cells are neighbors if they share a common bound-
ary of dimension d-l. Define the size of a cell to be
the length of its longest dimension. If there are two
neighboring cells whose sizes differ by more than some
constant factor (at least 2), then the larger cell is split.
Figure 2: C-complexity. Splitting is repeated until all neighboring cells satisfy
the size threshold. It has been shown by Moore[14] that
smoothing does not alter the size of the subdivision ex-
Lemma 1.1 Let 0 < e < e', and let D be some do- cept by a constant factor (in general depending on di-
main. Let scc(D) denote the simple cover complexity of mension).
D with respect to e, and let scc'(D) denote the simple To analyze the time for query processing, we first need
cover complexity with respect to e'. Then there is a con- to provide a relationship between the size of cells in
stant c (depending on e, e' and dimension) such that the subdivision and strongly simple balls. For these re-
sults, we use the standard notion of simplicity (not C-
scc(D) < scc'(D) < c ■ scc(D).
simplicity).

Lemma 2.1 Let e > 0, and let b be an e-strongly simple


2 A Simple Approach ball of radius r. Ifb intersects a cell of the decomposition
In this section we give a query-sensitive analysis of a sim- of size s, then s > ar for some constant a (depending
ple, practical decomposition strategy, which illustrates on e and dimension).
the essential features of our method. The decomposition
Proof: Let a = e/(6\/d). For concreteness, assume
strategy is similar to one described by Samet [16], called
that in smoothing, we split a cell if a neighbor is of size
a PM k-d tree.
We begin by assuming that we are given a set of poly- less than 1/2 of its size, and that e < 1. Suppose to
hedral obstacles in d-dimensional space. As mentioned the contrary that there exists a cell that violates the
in the introduction, we assume that faces bounding these conditions of this lemma. Consider the smallest such
obstacles are simple in the sense that each point is in- cell c, let s denote the size of c, and let p denote the
cident to at most a constant number, ß, of faces of di- parent box of c. Box p may have split for one of two
mension < d-l. We also assume that the obstacles are reasons. Either (1) p itself is not simple, or (2) p is the
contained within a minimal bounding hypercube. (Such neighbor of a cell c' whose size is less than 1/2 the size
a hypercube is easy to construct in linear time.) This hy- of p, and we split p for smoothing. The size of p is at
percube is our initial box. Let R denote the side length most 2s, and hence the diameter of p is at most 2syd.
of this hypercube. A box is said to be crowded if it in- In case (1), since c intersects b, then within distance
tersects more faces than some given threshold (at least 2sVd of the boundary of b there is a crowded cell. But,
as large as the incidence bound, /?). If a box is crowded,
r- r- 1er\fd _
then it is split by a hyperplane passing through the center 2sVd < 2arVd = 7r < er.
of the box and perpendicular to its longest dimension. §Vd
(Ties for the longest dimension can be broken arbitrar-
Therefore, the (1 + e) expansion of b is not simple, a
ily, e.g., taking the lowest numbered axis.) The splitting
contradiction.
process naturally defines a binary tree. The original box
In case (2), let s' denote the size of c'. Since s' <
is the parent of the resulting boxes in this tree. The
2s/2 = s, and since sizes vary by factors of 2, s' < s/2.
splitting process terminates when no remaining boxes
We claim that there is an e-strongly simple ball b' of
are crowded. The resulting boxes, called cells, form a
radius r/2 that contains c' (see Fig. 3). This will provide
subdivision of space, each of which contains a constant
us with the desired contradiction, because c' satisfies the
number of obstacle boundary elements.
conditions of the lemma (since c was the smallest cell not
Observe that splitting will eventually terminate, be-
satisfying the lemma and s' < s), and hence
cause of the bounded incidence assumption. However,
the number of cells in the subdivision cannot be bounded s , r
simply as a function of n.
361
terminates at a region that contains q and whose size s
obeys s < „ .„ . But Lemma 2.1 implies that s > ar,
for a constant a, so that k — 0(log(R/r)). D

Segment shooting queries are processed by first locat-


ing the cell containing the origin of the segment, and
then walking along the segment, cell by cell, through the
subdivision. Because neighboring cells differ in size by
a constant amount, the number of neighbors of a given
cell is at most a constant (dependent on d). By the
Figure 3: Proof of Lemma 2.1. fact that each cell contains a constant number of bound-
ary elements, it follows that the time to perform this
walking is proportional to the number of cells visited
implying s > ar, contradicting our earlier hypothesis. (with constant factors depending on d). Let scc(s) de-
To prove the existence of b', first observe that since note the simple cover complexity of a segment s (more
the size of c' is at most s/2, its diameter is at most precisely, the complexity of the obstacle-free initial sub-
s\/d/2. Since c' is a neighbor of p, and since p intersects segment of s), and let B be a strongly simple cover for s.
b, c' is contained within a ball centered within 6, whose By Lemma 2.2, the number of subdivision cells intersect-
radius is the sum of the diameters of p and c', which is ing each ball in B is a constant, and hence, since these
less than Ss^/d. (This is the smallest circle in Fig. 3.) balls cover s, the number of subdivision cells traversed
Since s < ar it is easy to verify that the radius of this by s is 0(\B\) = 0(scc(s)). By combining this with the
ball is less than re/2. Assuming e < 1, it is easy to see previous lemma, it follows that segment shooting queries
that there is a ball b' of radius r/2 that contains this can be answered in 0((log R/r) + scc(s)) time. Observe
ball, and is no further from boundary of b. Because b is that, by a similar argument, the number of cells in the
within distance 3s\/d of the boundary of 6, the (1 + e) subdivision is 0(scc(P)), where scc(P) denotes the sim-
expansion of b' is at most a distance ple cover complexity of the obstacle-free space. Since
each cell contains only a constant number of boundary
e- + 3sVd < e- + SarVd = er elements, the size of the final subdivision is 0{scc(P)).
From this we have the following analysis of the smoothed
from the boundary of b. Thus, b' lies within the (1 + e) PM k-d tree subdivision.
expansion of b, and so is simple. □
Theorem 2.1 Let P be a collection of polyhedral obsta-
cles satisfying the bounded incidence assumption. There
Lemma 2.2 Given an e-strongly simple ball b of radius exists a data structure of size 0(scc(P)) from which seg-
r, the number of cells that intersect b in the subdivision ment shooting queries can be answered in 0((logR/r) +
is bounded above by a constant (depending on e and di- scc(s)) time.
mension).
At this point we remark that there is another way to
Proof: By Lemiha 2.1, the size of a cell intersecting achieve the same result without the use of smoothing.
6 is bounded from below by ar. Thus, the number of The purpose of smoothing the subdivision is to guaran-
such cells is bounded above by the number of squares tee that the number of cells that are neighbors to any
of this side length that can be packed around (inside or given cell is a constant. However, it is possible to avoid
touching) b, which is on the order of l/ad. D smoothing, and instead traverse the tree structure itself
to locate neighboring cells (see [2], for example). It can
be shown that finding neighboring cells by searching the
Lemma 2.3 Let q be a point in the enclosing hypercube. tree does not increase the asymptotic running time of
We can locate the cell containing q in time 0(log(R/r)), segment shooting queries. We have presented here the
where r is the radius of the largest strongly simple ball approach based on smoothing, since smoothing will be
containing q, and R is the side length of the bounding needed for the approach described in the next section.
hypercube. This PM k-d tree-based data structure has the advan-
tages of simplicity and ease of generalization to higher di-
Proof: The search for q is a simple descent through mensions. Its principle disadvantages are that the space
the PM k-d tree. With every d levels of descent, the size and, hence, preprocessing time bounds are dependent on
of the associated regions decreases by a factor of 1/2. the simple cover complexity of the obstacle set, rather
Thus, if the search continues for k steps, then the search than a function of n.

362
3 The Planar Case vertex, then the decomposition terminates here. Other-
. wise, as with k-d trees, we split the box into two identical
In this section we modify the simple PM k-d tree con- boxes by passing a horizontal or vertical line through its
struction given in the previous section to handle segment longest side, provided that there exists at least one vertex
shooting for a set of polygonal obstacles, P, in the plane. on either side of this splitting line. If so, we partition the
The principle improvements are the following. vertices into these two boxes, and recursively subdivide
each. This process is called splitting.
• Query time is based on C-complexity rather than
standard simple cover complexity.
• Preprocessing time is 0(n log n). •

• Space is 0(n). • 4

Interestingly, the subdivision presented here has a


number of similarities to the quality mesh triangulations
of [4, 13]. Since there are no restrictions on the geomet-
L
ric structure of our subdivision, we can provide the space
and preprocessing time improvements listed above. (In (a)
mesh generation, the size of the triangulation depends
on the geometric structure of the input.)

3.1 Box Decomposition


Preprocessing is based on a hierarchical subdivision sim-
ilar to the PM k-d tree decomposition described in the
"IF"
last section, but in which a new operation called shrink-
ing may be applied. The resulting structure is called a
box-decomposition tree. This is a standard decomposi-
tion procedure for point sets, which can be found, for (b)
example, in [2, 3, 5, 9, 17]. As in the previous section,
the subdivision partitions an enclosing square contain-
ing the obstacle set into a collection of cells, with each
cell being bounded by a constant number of edges, which
may be either segments of obstacle edges or axis aligned
segments. We do not require that our subdivision be a
cell complex, since there may be vertices lying in the in-
terior of edges; however, the number of vertices in the
interior of any edge will be a constant. Thus, we can eas-
s=
ily augment such a subdivision into a cell complex or a (c)
triangulation with a linear number of additional Steiner
points. Figure 4: Box decomposition.
Each node of the box-decomposition tree corresponds
to one of two types of objects called enclosures: (1) boxes, Without the provision above that there exists a ver-
which are rectangles with the property that the ratio of tex on each side of the splitting line, the splitting process
the longest to shortest side is at most 2, and (2) dough- could result in an arbitrarily long series of trivial splits,
nuts, which consist of the set theoretic difference of two in which no vertices are separated from any other, and
boxes, an inner box contained within an outer box. The this in turn could result in a subdivision of size greater
size of a box is defined to be the length of its longest than 0(n). To avoid this, if there is not a vertex on
side, and the size of a doughnut is the size of its outer either side of the splitting line, we perform a different
box. As mentioned earlier, the subdivision construction decomposition step called shrinking. Shrinking consists
begins by assuming that the set of obstacles are con- of finding the smallest k-d tree box that contains all the
tained within a unit square. We begin by constructing a vertices. By a k-d box, we mean any box that could be
box-decomposition tree for the vertex set of the obstacles generated by some repeated application of the k-d split-
(ignoring obstacle edge). For completeness, we outline ting rule. This box can be computed in constant time as-
the procedure here. suming a model of computation where integer logarithm
Inductively, we assume that the vertex set to be de- and floors can be computed in constant time. (This as-
composed is contained within a box. If there is only one sumption can be overcome with a somewhat more flex-

363
ible definition of boxes and shrinking.) This produces split (or else we will undo the space savings achieved by
two enclosures. One is the bounding box containing the shrinking). Henceforth, we assume the algorithm main-
vertices, and the other is the surrounding doughnut that tains, for each enclosure, a list of pointers to all larger
contains no vertices. We recursively subdivide the region neighboring enclosures. Note that there can be at most
lying within the bounding box. Note that after applying a constant number of such enclosures.
a shrinking step, the next step will be a splitting step. The second phase of smoothing is to determine when-
See Fig. 4(a) for an illustration of the decomposition. ever two neighboring enclosures differ in size by more
By associating enclosures by containment, we natu- than some constant factor (at least 2); in such a case,
rally have a tree-structure, the box-decomposition tree, the larger enclosure is repeatedly split (never shrunk),
where each internal node has two children (either the left until the difference in size falls below this factor. When
and right side from a split, or the doughnut and inner splitting is applied to a shrinking node, the doughnut is
box from a shrink). The leaves of this tree define a sub- split. Because we have chosen inner boxes to be k-d en-
division of the plane into boxes and doughnuts. These closures, it is not possible that the splitting line will pass
are called basic enclosures. through the inner box. Thus, after splitting a doughnut,
there will be a new smaller doughnut with the same inner
3.2 Smoothing box, and a regular box (which will contain no vertices).
If the doughnut shrinks so far that the outer box and
To handle segment shooting by walking the ray through
inner box become equal, this trivial shrinking node can
the subdivision, we will need to smooth the subdivision
be deleted from the box-decomposition tree.
as in the previous section. The presence of shrinking re-
quires that this be done more carefully than in the pre-
vious section, in order to keep the size of the resulting
data structure from growing by more than a constant
1
factor. The problem is that shrinking, by its very na-
ture, introduces neighboring enclosures of significantly
different sizes. Thus, the operations of shrinking and
smoothing are incompatible in some sense. We over-
come this by performing smoothing in two phases; the
first phase handles inner boxes, and the second is the
standard smoothing process. (a)
The first phase of smoothing is to surround the inner
box of each doughnut with a "buffer zone" of eight iden-
tical boxes (see Fig. 4(b)). If the inner box touches the
boundary of the outer box, then these boxes may spill
over into neighboring enclosures. In the case of spill-over,
these boxes may already be a part of the decomposition,
and no further action is needed. If spill-over occurs, and
these boxes are not part of the decomposition, then this
neighbor is decomposed by applying either splitting or
shrinking appropriately, until we have produced a legal (b)
box-decomposition. This can be implemented by imag-
ining that each of these newly created boxes contains a Figure 5: Smoothing: Second step.
vertex of the obstacle set at its center, and then reap-
plying the box-decomposition algorithm described above This phase of the smoothing process is implemented
(see Fig. 4(c)). in a bottom-up manner, working from small enclosures
As before, we define a neighbor of a basic enclosure to to larger enclosures. When a small enclosure identifies
be any other basic enclosure such that the two share a a sufficiently large neighboring enclosure, it splits the
common line segment on their boundaries. However, for neighbor, creating a constant number of new enclosures.
the purpose of the second phase of smoothing we make In Fig. 5(a) we show the output of the first smoothing
the following exception. Any enclosure which was cre- phase, and in (b) we show the final output of the second
ated as part of the buffer zone for an inner box (and smoothing phase. (Observe that the shaded enclosure in
hence is empty) is not considered to have any larger en- (b) did not induce the large enclosure to its left to be
closures as a neighbor. This exception is made for a split, since the shaded enclosure is part of a buffer zone,
couple of technical reasons. The most important is that and hence is not a neighbor of the larger enclosure.)
we do not want the buffer zone around a small inner Lemma 3.1 The smoothed box-decomposition tree can
box to induce a much larger surrounding doughnut to be constructed in O(nlogn) time and 0(n) space.

364
Proof: The proof that the initial box-decomposition that since c" is in a surrounding cell of the c', c" must
construction can be performed in 0(n log n) time and be contained within one of the 8 enclosures surrounding
0(n) space is well known (see, e.g. [2] or [5].) The first c (see Fig 6). We claim that this enclosure must be part
phase of smoothing is effectively equivalent to running of JVi. This can only fail to be true if c" is enclosed
a box-decomposition with at most 8n additional points, directly within a much larger shrinking node. But this
and so can be accomplished within the same time bound. would imply that c" is part of a buffer zone, and hence
We claim: (1) that the second smoothing phase can be could not have induced c' to split.
performed in time proportional to the size of the final For our charging scheme, we charge each node in N2
decomposition, and (2) that the final decomposition is that is split to a node of equal size in JVi. We have just
of size 0(n). To prove (1) it suffices to observe that each established the existence of this node. Since each node
splitting operation can be performed in 0(1) time and in Ni can be assessed charges only by itself or the nodes
results in the creation of at least one new enclosure. The corresponding to one of its 8 surrounding enclosures, it
algorithm maintains the box-decomposition tree and, for follows that each node of Ni is charged at most 9 times,
each enclosure, it maintains the enclosure's size and a and hence \N2\ < 9\Ni\. (For tighter bounds on the size
list of pointers to all larger neighboring enclosures (of of smoothed subdivisions, see [14].) □
which there can be only a constant number). With this
information, each splitting operation can be performed
in 0(1) time.
To establish (2) we apply a charging argument. As Lemma 3.2 After smoothing, the number of neighbors
noted, the size of the box-decomposition tree for a set of any basic enclosure is 0(1).
of n points is 0(n). Thus the number of nodes in the
box-decomposition tree after the first phase is 0(n). Let
Ni denote this set of nodes, and let N2 denote the nodes Proof: Smoothness guarantees that, except for the case
of the tree after the second phase. For each node in N2 of the enclosures of a buffer zone, neighboring enclosures
that is split we will charge this node to a node of Ni in are of roughly equal size. This implies that along any
such a way that no node in Ni is charged more than a edge of any enclosure, there can be at most a constant
constant number of times. This will complete the proof number of neighboring enclosures. In the case of the en-
by establishing that the size of N2 is 0(n). closures of a buffer zone, observe that no matter how
densely points are packed into the inner box, the prop-
agation of splitting can result in the outer edges of the
buffer zone being split at most once. This is illustrated
in Fig. 7. E
O

\ !
s
i

J
c'
v 1. C"

Figure 6: Charging scheme.

Let c be a node of N2, and let s be the size of c. If the


box which c represents is split as a result of smoothing,
we claim that either c or at least one of the 8 identical Figure 7: Propagation of smoothing.
boxes that surround c corresponds to a node which exists
in N\. We prove this by induction on the size of the
enclosures. The reason that c split is either because c was Due to the doughnuts, basic enclosures may not be
already split in Ni (in which case the claim is trivially convex; indeed, the vertices of an inner box of a dough-
true), or because there is a neighboring enclosure of size nut are reflex vertices. We can make the overall subdi-
no greater than s/4. This neighbor cannot be part of a vision convex by extending the left and right (vertical)
buffer zone, for otherwise it could not induce c to split. sides of each inner box until they contact the boundary
Therefore, the parent of this neighbor, denoted c', is an of the outer box. This subdivides each doughnut into
enclosure of size at most s/2 that is also a neighbor of c. four rectangles. Observe that this increases the stabbing
By the induction hypothesis, the parent of c' or one of number of any directed segment by at most a constant
its 8 surrounding enclosures of size s/2 corresponds to a factor, and so has no significant effect on the complexity
node in Ni that was split. Call this node c". Observe arguments to be made later.

365
3.3 Adding Obstacle Edges (which includes box-decomposition edges as well as ob-
To complete the description of the decomposition al- stacle edges) into a planar subdivision data structure.
gorithm, we introduce the obstacle edges. The prob- The 2-faces of the resulting subdivision, which are nec-
lem with simply adding the obstacle edges to the box- essarily convex, are called cells. We say that two
decomposition is that the number of intersections be- cells are neighbors if they share a common nonobsta-
tween obstacle edges and box-decomposition edges may cle (box-decomposition) edge. An example of this is
be much larger than 0(n). To guarantee that the num- shown in Fig. 9, where (a) shows the initial smooth box-
ber of intersections is linear in n, we apply a simple trim- decomposition of the point set, and (b) shows the re-
ming procedure, which trims each edge of the smoothed sult of trimming. (In connecting obstacle vertices to the
box-decomposition subdivision at its first and last inter- sides of the subdivision, we have used as few segments
section with an obstacle boundary. Let us assume that as needed to resolve the reflex angles.)
both the obstacle set and box-decomposition have been
preprocessed (by standard means—e.g., trapezoidiza- Notice that the resulting subdivision inherits one
tion, and a point location data structure) to support essential feature of the smoothed box-decomposition,
horizontal and vertical ray-shooting queries in O(logn) namely, that each cell in the subdivision has at most
time. Intuitively, one can imagine each vertex of the a constant number of neighbors. Also observe that each
box-decomposition subdivision firing a bullet along each cell of the resulting subdivision is convex and is bounded
of its incident horizontal and vertical edges, until either by at most 6 sides (two obstacle edges and the four sides
reaching the end of this edge, or until hitting an obstacle. of a bounding rectangle).
The edges are then trimmed so only these bullet-path
subedges remain.

1 1

1—1 ,,—, 1—1 —,,—, —,,

Figure 8: The problem with simple trimming.

Directly applying the simple trimming procedure de-


scribed above can result in regions of complexity fi(n)
(see Fig. 8). To deal with this, we isolate obstacle ver-
tices within the subdivision. Before doing any trim-
ming, for each obstacle vertex v we determine its asso-
ciated enclosure, c, in the smoothed box decomposition
(this is given to us by the decomposition). We join v
to the boundary of c by at most 4 vertical/horizontal
segments, omitting any such connection that penetrates
the obstacle containing v; this results in at most 4 new
(subdivision) vertices. This modification of the box-
decomposition subdivision can be performed for all n
vertices in total time 0(n), while increasing the size of
the subdivision by only a constant factor.
Now we apply the above-mentioned trimming proce-
dure for each edge of the modified box-decomposition
subdivision. Since this involves shooting 0(n) directed
(horizontal/vertical) segments, the entire process takes
0(n log n) time. Observe that the resulting subdi-
vision has total size 0(n), since we have created at
most two new edges for each of the 0{n) edges in Figure 9: The final trimming procedure.
the box-decomposition subdivision. Within this same
time bound we can convert this collection of segments

366
3.4 Merging bounded complexity, bounded number of neighbors, and
convexity. The outcome of this merging procedure is
If we stop at this point, we claim that the subdivision shown in Fig. 10(b).
constructed so far has the property that any segment Summarizing the discussion of this section, we have
s stabs as many cells of the subdivision as the simple the following result.
cover complexity of s. However, we want to strengthen
this to C-simple cover complexity. This is generally not Lemma 3.3 Given a collection of polygonal obstacles P
true, since it may contain cells that are smaller than in the plane with n total vertices, the size of the final sub-
they should be. It is important that, for every point p division is 0(n), and the subdivision can be constructed
in the plane, the size of the cell containing p is at least in 0{n log n) time. The cells of this subdivision satisfy
a constant factor of the radius of the largest C-simple properties (l)-(3) above.
ball that contains p. (This is the C-simple version of
Lemma 2.1.) This may be violated because the place- At this point we can present the result analogous to
ment of box-decomposition vertices was made without Lemma 2.1. Recall that in order to make cells convex,
knowledge of the underlying structure of obstacle edges. we introduced new edges incident to the vertices of in-
An example is shown in Fig. 10(a). A large number of ner boxes (in Section 3.2) and to obstacle vertices (in
small subdivision cells lie to the right of edge e in this Section 3.3). The effect of adding these edges was to
figure. The existence of these cells is justified from the subdivide each enclosure of the smoothed box decompo-
vertices lying to the left of e. However, a ray lying just sition into a constant number of convex subcells. Since
to the right of e and parallel to e will have a very low C- each enclosure of the box decomposition can contain at
simple cover complexity because these other vertices are most a constant number of nonreflex vertices (as a con-
not reachable from the ray, and hence we cannot afford sequence of box decomposition), the creation of these
to traverse these small cells. subcells does not affect the number of cells traversed in
query processing by more than a constant factor. Thus,
we can define the size of such subcells to be the size of
original enclosures.
Lemma 3.4 For every point p in the plane, the size of
the cell containing p in the subdivision is at least a con-
stant factor times the radius of the largest C-simple ball
that contains p.
Proof: Let r denote the radius of the largest C-simple
ball that contains p. Let s be the size of the cell c con-
taining p. Let d be the sibling of c in the subdivision (or
in general, the next neighboring cell that would be con-
sidered for merging with c). The cells c and d were not
We apply the following merging process to eliminate merged because of a violation of one of the conditions
these unnecessary regions. We traverse the enclosures (1), (2), or (3) above.
of the box-decomposition subdivision, in a bottom-up In the case of (1), the merger of c and d would result in
fashion (starting at the bottom of the box-decomposition a cell having 3 or more reachable vertices within distance
tree) visiting enclosures in increasing order of size. Con- s2\/2. Thus the ball of radius S2A/2 centered at p is
sider a pair of neighboring cells that were siblings in the not C-simple. This implies that any C-simple ball that
decomposition process (in the sense that they were once covers p can be of radius at most s2^/2, and hence s >
part of a parent node that was split or shrunken). If r/{2V2).
their union satisfies the following properties: In the case of (2), the proof is by induction on the size
(1) it has at most two obstacle edges on its boundary, of cells. If c' was separated from c by splitting (as op-
posed to shrinking), then c and d are of equal size. The
(2) it does not have more than a constant number c fact that condition (2) is violated implies that there is
neighboring cells (where c > 8), and a reachable cell c" neighboring either c or c" that is no
larger than s/2 (since otherwise there could be at most
(3) it is convex, 8 neighbors of their union). Applying the induction hy-
then merge these two cells into one cell (effectively undo- pothesis to the closest point p' to p in c", implies that
ing the decomposition performed by the decomposition the largest C-simple ball containing p' is of size as/2, for
algorithm). Repeat this until no sibling cells remain that some constant a. Note that p' cannot be further than
can be merged. After this merging process has been fin- s2y/2 from p, and so any C-simple ball that covers p
ished, observe that cells still satisfy the properties of can be of radius at most S(2A/2 + a/2). Choosing any

367
a > 4\/2 will satisfy the hypothesis. If c and d were sep- 5th Annu. ACM Sympos. Comput. Geom., pages 11-22,
arated by shrinking, then one of these cells is a doughnut 1989.
and the other is an inner box. If c is the doughnut, then [2] S. Arya, D. M. Mount, N. S. Netanyahu, R. Silverman,
d is smaller than c, and the same induction argument and A. Wu. An optimal algorithm for approximate near-
can be applied. We claim that c cannot be the inner box, est neighbor searching. In Proc. 5th ACM-SIAM Sym-
since any neighbor of the neighbors of an inner box are a pos. Discrete Algorithms, 1994, 573-582.
subset of the neighbors of the doughnut. Thus, merging [3] M. Bern. Approximate closest-point queries in high di-
c and d could not violate condition (2). mensions. Inform. Process. Lett., 45:95-99, 1993.
Finally, in the case of condition (3), the edge separat-
[4] M. Bern, D. Eppstein, and J. Gilbert. Provably good
ing c and d has been added simply to resolve a reflex mesh generation. In Proc. Slst Annu. IEEE Sympos.
vertex. We can simply apply the arguments given in Found. Comput. Sei., pages 231-241, 1990.
cases (1) or (2) to the larger enclosure of size s in the
[5] P. B. Callahan and S. R. Kosaraju. A decomposition
box decomposition that contains this vertex. D
of multi-dimensional point-sets with applications to Ä;-
nearest-neighbors and w-body potential fields. In Proc.
The analogue to Lemma 2.2 follows from exactly the 24th Annu. ACM Sympos. Theory Comput., pages 546-
same argument as before. 556, 1992.
[6] B. Chazelle, H. Edelsbrunner, M. Grigni, L. Guibas,
Lemma 3.5 Given a C-simple ball b of radius r, the J. Hershberger, M. Shark, and J. Snoeyink. Ray shoot-
number of cells that intersect any connected component ing in polygons using geodesic triangulations. In Proc.
of b in the subdivision is bounded above by a constant. 18th Internat. Colloq. Automata Lang. Program., vol-
ume 510 of Lecture Notes in Computer Science, pages
661-673. Springer-Verlag, 1991.
3.5 Query Processing [7] B. Chazelle and L. J. Guibas. Visibility and intersection
As we mentioned earlier, query processing involves two problems in plane geometry. In Proc. 1st Annu. ACM
steps. Given a directed segment pq, we first apply any Sympos. Comput. Geom., pages 135-146, 1985.
point location algorithm to determine the location of the [8] S. W. Cheng and R. Janardan. Space-efficient ray shoot-
starting point p in O(logn) time. Once the cell contain- ing and intersection searching: algorithms, dynamiza-
ing p has been located, the algorithm simply walks from tion and applications. In Proc. 2nd ACM-SIAM Sympos.
one cell to the next. This can be done in time propor- Discrete Algorithms, pages 7-16, 1991.
tional to the number of cells traversed, since each cell [9] K. L. Clarkson. A randomized algorithm for closest-
is bounded by a constant number of edges (at most two point queries. SIAM J. Comput., 17:830-847, 1988.
obstacle edges and at most four horizontal and vertical [10] J. Hershberger and S. Suri. A pedestrian approach to
edges of the associated (trimmed) enclosure), and each ray shooting: Shoot a ray, take a walk. In Proc. 4th
cell has a constant number of neighbors. ACM-SIAM Sympos. Discrete Algorithms, pages 54-63,
To analyze the running time of query processing it 1993.
suffices to count the number of cells visited. Let scc(s) [11] B. Von Herzen and A. H. Barr. Accurate triangulations
denote the C-simple cover complexity of a segment s (or of deformed, intersecting surfaces. Computer Graphics,
actually the complexity of the obstacle free initial sub- 21(4):103-110, July 1987.
segment of s), and let B be a strongly C-simple cover [12] J.S.B. Mitchell. Computational geometry methods for
for s. By Lemma 3.5, the number of subdivision cells in- virtual reality. Manuscript, Applied Math, SUNY Stony
tersecting each ball in B is a constant, and hence, since Brook, 1993.
these balls cover s, the number of subdivision cells tra- [13] S. A. Mitchell and S. A. Vavasis. Quality mesh gen-
versed by s is 0(|-B|) = 0(scc(s)). eration in three dimensions. In Proc. 8th Annu. ACM
Sympos. Comput. Geom., pages 212-221, 1992.
Theorem 3.1 Let P be a collection of polygonal obsta- [14] D. W. Moore. Simplicial mesh generation with applica-
cles in the plane (satisfying the bounded incidence as- tions. Ph.D. thesis, Dept. Comput. Sei., Cornell Univ.,
sumption). Let n denote the number of vertices in P. Ithaca, NY, 1992. Report 92-1322.
Ln time O(nlogn) a data structure of size 0(n) can be
[15] M. Overmars, H. Schipper, and M. Sharir. Storing line
constructed, from which segment shooting queries can be segments in partition trees. BIT, 30:385-403, 1990.
answered in 0(logn + scc(s)) time.
[16] H. Samet. The Design and Analysis of Spatial Data
Structures. Addison-Wesley, Reading, MA, 1990.
References [17] P. M. Vaidya. An O(nlogn) algorithm for the all-
nearest-neighbors problem. Discrete Comput. Geom.,
[1] P. K. Agarwal. A deterministic algorithm for partition- 4:101-115, 1989.
ing arrangements of lines and its applications. In Proc.

368
Efficient Algorithms for Generalized Intersection Searching on
Non-Iso-Oriented Objects

Prosenjit Gupta* Ravi Janardan* Michiel Smidt

Abstract triangle range searching. The techniques used in-


clude: computing suitable sparse representations of
Generalized intersection searching problems are a the input, persistent data structures, and filtering
class of geometric query-retrieval problems where search.
the questions of interest concern the intersection Keywords: Computational geometry, data struc-
of a query object with aggregates of geometric ob- tures, filtering search, geometric duality, intersec-
jects (rather than with individual objects.) This tion searching, persistence.
class contains, as a special case, the well-studied
class of standard intersection searching problems
and is rich in applications. Unfortunately, the solu- 1 Introduction
tions known for the standard problems do not yield
efficient solutions to the generalized problems. Re- Consider the following generic searching problem:
cently, efficient solutions have been given for gen- Suppose that we are given a set S of n geomet-
eralized problems where the input and query ob- ric objects in 1Zd. Moreover assume that the ob-
jects are iso-oriented (i.e., axes-parallel) or where jects come aggregated in disjoint groups, where the
the aggregates satisfy additional properties (e.g., grouping is dictated by the underlying application.
connectedness). In this paper, efficient algorithms (The number of groups can range from 1 to 0(n).)
are given for several generalized problems involv- Our goal is to preprocess S into a data structure
ing non-iso-oriented objects. These problems in- so that given any query object q, we can report
clude: generalized halfspace range searching, seg- or count efficiently the groups that are intersected
ment intersection searching, triangle stabbing, and by q. (We say that q intersects a group iff q in-
tersects some object in the group.) Notice that we
'Department of Computer Science, University of Min- are not interested in reporting or counting thejn-
nesota, Minneapolis, MN 55455, U.S.A. Email: {pgupta,
dividua! objects intersected by q as is the case in
janardan}«cs. umn.edu. The research of these authors was
supported in part by NSF grant CCR-92-00270. Portions of a standard intersection searching problem. Indeed
this work were done while RJ was visiting MS at the Max- the standard problem is a special case of the above
Planck-Institut für Informatik, in Saarbrücken, Germany, in formulation, where each group has cardinality 1.
July 1993. RJ would like to thank the MPI for its generous
For this reason, we call our version a generalized
support.
f
Max-Planck-Institut für Informatik, D-66123 Saarbrüc- intersection searching problem.
ken, Germany. Email: michieiempi-sb.mpg.de. This au- For our purposes, it will be convenient to asso-
thor was supported by the ESPRIT Basic Research Actions ciate with each group a different color and imagine
Program, under contract No. 7141 (project ALCOM II).
that all the objects in the group have that color.
Suppose that q intersects i groups. Then, we can
Permission to copy without tee all or part of this material is
granted provided that the copies are not made or distributed for
restate our problem as: "Preprocess a set S of n
direct commercial advantage, the ACM copyright notice and the colored geometric objects so that for any query ob-
title of the publication and its date appear, and notice is given
that copying is by permission of the Association of Computing
ject q, the i distinct colors of the objects that are
Machinery. To copy otherwise, or to republish, requires a fee intersected by q can be reported or counted effi-
and/or specific permission.
369
10th Computational Geometry 94-6/94 Stony Brook, NY, USA
© 1994 ACM 0-89791-648-4/94/0006..$3.50
ciently." This is the version that we will consider have been less studied. The generalized problems
throughout the paper. were first considered in [JL93], where efficient so-
Before going further, let us illustrate the useful- lutions were given for several problems defined on
ness of our generalized formulation with some ap- iso-oriented objects (i.e., the input and the query
plications: (1) In designing a VLSI chip, the wires objects are axes-parallel). In [GJS93a], efficient so-
(line segments) can be grouped naturally accord- lutions were given for the counting, reporting, and
ing to the circuits they belong to. A problem of dynamic versions of several iso-oriented problems.
interest to the designer is determining which cir- In [GJS93b], solutions were given for generalized
cuits (rather than wires) become connected when problems involving circular and circle-like objects
a new wire is to be added. This is an instance (among other results). In [AvK93], Agarwal and
of the generalized segment intersection searching van Kreveld consider the problem of reporting the
problem. (2) Consider a collection of supply points intersections of a query fine segment with color
(e.g., warehouses) of different types in 7Z2. We classes consisting of line segments and satisfying
would like to preprocess these points so that given the property that each color class is a simple poly-
a demand point q and a radius r, we can determine gon or a connected component.
the types of supply points that are within distance
r from q. By using a well-known "lifting" trans-
1.3 Summary of results and techniques
formation, this problem can be transformed to an
instance of generalized halfspace range searching in In this paper, we present efficient solutions to
TV. several generalized intersection searching prob-
lems that are defined on non-iso-oriented objects.
1.1 Potential approaches Specifically, we consider the following problems:
generalized halfspace range searching in 7ld, for
One approach to solving a generalized problem is any fixed d > 2, generalized segment intersection
to take advantage of known solutions for the corre- searching, triangle stabbing, and triangle range
sponding standard problem. For example, to solve searching in 7Z2. Our main results are summa-
a generalized reporting problem, we can determine rized in Table 1. No results were known pre-
all the objects intersected by q (a standard prob- viously for any of these problems, with the ex-
lem) and then read off the distinct colors among ception of generalized segment intersection search-
these. However, with this approach the query time ing: For this problem, the following results were
can be very high since q could intersect fl(n) ob- known: (a) 0(n1+c) space and (^(n1/2^ + i)
jects but only 0(1) distinct colors. Thus, the chal- query time for color classes consisting of simple
lenge in the generalized reporting problem is to polygons or connected components [AvK93]; (b)
attain a query time that is sensitive to the out- 0((n + x)2logn) (resp. 0((n + x)2)) space and
put size i, typically of the form 0(f(n) + i) or O(logn + i) (resp. 0(log2n + i)) query time for
O(f(n) + i--polylog(n)), where /(n) is "small" (e.g., general color classes [JL93]; and (c) 0(nl+e) space
polylog(n) or np, where 0 < p < 1). For a general- and 0((i + lJVnlog0^) n) query time for general
ized counting problem, it is not even clear how one color classes [AvK93]. (x is the number of pairwise-
can use the solution for the corresponding standard intersecting segments.)
problem (a mere count) to determine how many Our results are based on a combination of sev-
distinct colors are intersected. Nevertheless, we eral techniques: (1) Computing for each color class
seek here query times of the form 0{f{n)). Of a sparse representation which, captures essential in-
course, in both cases, we seek solutions that are formation about the color class and allows us to
also as space-efficient as possible. reduce the generalized problem at hand to a stan-
dard problem. (2) The persistence-addition tech-
1.2 Previous work nique of Driscoll et al. [DSST89], which allows us
to reduce a generalized problem to a generalized
While the standard problems have been investi- dynamic problem one dimension lower. (3) A ver-
gated extensively, their generalized counterparts sion of filtering search which, in combination with

370
Input objects Query object Space Query time
#
d=2 n log n log^ n + i
„i/a
n log"' n n^+' + i
Points Halfspace d=3 n2+< log2 n + i
n2/3+,
1 mKd inTld nlogn
d>2 nld^+< log n + i log"1 n
Halfplane nlogn logJ n -I- i
2 Line segs.
in ft2 Vertical ray nor(n)logn log'' n + t
(n«("))1/2
Line segs. of
length > a Line nlogn log2 n + i
3 constant in
unit square
4 Lines Vertical line n"-"logn n^ + i
in ft2 segment n2 log n log n + i
Vertical line
5 Line segs. segment (n + x)logn log n + i
in ft2 Arbitrary line
segment log2 n + i log n
3/2
6 Triangles Point n logn log n + i
Fat-Wedges nlogn log n +1
7 Points Fat-Triangle n loga n log n + i log n

Table 1: Summary of main results for generalized intersection searching problems; additional results
can be found in the text. Wherever the output size, t', is missing in a query time bound, it is a
counting problem. A fat-wedge or fat-triangle is one where each interior angle is greater than or
equal to a fixed constant. Here:
n input size
i output size (number of distinct colors intersected)
e arbitrarily small constant > 0
tunable parameter, 0.5 < /i < 1
X number of pairwise-intersecting segments, 0 < x < (2)
o(n) slow-growing inverse of Ackermann's function

persistence, yields a space-query time tradeoff. Generalized halfspace range


Moreover, when the input objects or query objects searching in 1Zd
satisfy certain reasonable conditions (e.g., fatness),
then we use further ideas to obtain very efficient so- Let 5 be a set of n colored points in Hd, for any
lutions. Due to space limitations, we will describe fixed d > 2. We show how to preprocess S so that
only a subset of our results here and will omit all for any query hyperplane Q, the i distinct colors
proofs and many details. The full paper is avail- of the points lying in the halfspace Q~ (i.e., be-
able as [GJS93c]. low Q) can be reported or counted efficiently. We
371
first give solutions for TZ2 and TZ3. Let T denote coordinate. At each node v visited, we need to
the well-known point-hyperplane duality transform report or count the lines intersected by r. But, by
[Ede87]. Using T we map S to a set S' of hyper- duality, this is equivalent to answering, in TZ2, a
planes (lines in TZ2 and planes in TZ3) and map Q halfplane query at v using the query T(q)~ = Q~,
to the point q = T(Q). Our problem is now equiv- which we do using H(v).
alent to: "Report or count the i distinct colors of
the hyperplanes lying on or above q, i.e., the hy- Theorem 2.1 A set S of n colored points in TZ2
perplanes that are intersected by the vertical ray r can be stored in a data structure of size O(nlogn)
emanating upwards from g." so that the i distinct colors of the points lying in
Let Sc be the set of hyperplanes of color c. For any query halfplane can be reported (resp. counted)
each color c, we compute the upper envelope Ec of in time O(log2 n + i) (resp. 0(n1/2)/). □
the hyperplanes in Sc- In TZ2, Ec is an unbounded
convex chain, and in TZ3, Ec is an unbounded con- Using a similar approach, we can also solve Prob-
vex polytope whose facets are convex polygons. It lem 2 in Table 1.
is clear that (i) r intersects a c-colbred hyperplane
iff r intersects Ec and, moreover, (ii) if r intersects
2.2 Solving the ray-envelope intersec-
Ec, then r intersects the interior of a unique facet
tion problem in TZ3
of Ec. (For this version of the paper, we assume
that r does not intersect two or more facets of Ec We triangulate the facets of Ec for all colors c. For
at a common boundary; in the full paper [GJS93c], any triangle t, let h(t) be its supporting plane. Let
we show how to remove this assumption.) Let £ t' and q' be the projections of t and q (the origin
be the collection of the envelopes of the different of ray r) on the xy-plane respectively. Clearly, t is
colors. By the above discussion, our problem is intersected by r iff (a) fs interior contains q' and
equivalent to: "Report or count the facets of £ (b) h(t) is on or above q.
that are intersected by r", which is a standard in- Wlog assume that t' has a vertical side; other-
tersection searching problem! Since we use differ- wise decompose it into two such triangles. To find
ent techniques to solve this problem in TZ2 and in the triangles satisfying condition (a), we store each
TZ3, we will discuss each case separately. t' in a segment tree T according to its a;-span. Let
v be any node of T and let A{v) be the set of tri-
2.1 Solving the ray-envelope intersec- angles allocated to v. Let m = \A{v)\. Note that if
tion problem in TZ2 t' € A(v) then both its non-vertical sides, call the
upper one t'u and the lower one t\, cross Strip(v). If
We store the ^-projections of the line segments q' £ Strip(v), then q' is in i"s interior iff q' is above
of £ in a segment tree T. Let v be any node of t'j and below t'u. Since t\ and t'u behave like fines
T. Associated with v is an z-interval I(v). Let within Strip(v), by duality we have that q' £ t' iff
Strip(v) be the vertical strip defined by I(v). We in TZ2 one endpoint of Jr(t'l)yr(t'u) lies in the open
say that a segment s G £ is allocated to a node halfplane F{q')~ and the other lies in the open half-
v G T iff I(v) ^ 0 and s crosses Strip(v) but plane JF(g')+. Next, consider condition (b). By
not Strip (parent(v)). Let £(v) be the set of seg- duality, h(t) is on or above q iff in TZ3 the point
ments allocated to v. Within Strip(v), the seg- F(h(i)) is in the halfspace T(q)~.
ments of £(v) can be viewed as lines since they So, our problem at v is to report or count the
cross Strip(v) completely. Let £'{v) be the set of iv triangles of A(v) that satisfy the above half-
points dual to these fines. We store £'{y) in an plane and halfspace queries. We can do this by
instance H{y) of the standard halfplane reporting augmenting v with a 3-level data structure V(v),
(resp. counting) structure for TZ2 given in [CGL85] using partition trees [Mat92a] in the outer two lev-
(resp. [Mat92b]). This structure has size 0(m) els of V{v) and the data structure of [AHL90] for
and a query time of O(logm + kv) (resp. 0(m}l2)), halfspace range reporting at the innermost level.
where m = \£(v)\ and kv is the output size at v. For the counting problem, we use partition trees
To answer a query, we search in T using g's x- at all three levels. V(v) can be built in space

372
0(mlog m) (resp. 0(m)) so that all the desired We note that the reporting (resp. counting) prob-
triangles can be reported (resp. counted) in time lem can also be solved in 0(nd+c) space and
0(mi/2+< + ^ (resp. 0(m2/3+£)). For the re. 0(logn -f i) (resp. O(logn)) time, using constant-
porting problem, instead of partition trees, we can depth cutting trees.
also use 2-dimensional cutting trees [Mat91a] for
the two outer levels of V(v). Then V(v) has size
0(m2+e) and query time 0(logm + iv)- Plugging
3 Generalized intersection re-
these bounds into the segment tree, we get: porting on lines and line seg-
Theorem 2.2 The reporting version of the gener- ments
alized halfspace range searching problem for a set of
We consider several versions of the generalized in-
n colored points in TZ3 can be solved in 0(n log2 n)
tersection searching problem for a set S of n colored
(resp. 0(n2+c)) space and 0(nll2Jrt + i) (resp.
lines or line segments; the query q is a line or a line
0(log2 n + i)) query time, where i is the output
segment.
size and e > 0 is an arbitrarily small constant. The
counting version is solvable in 0(n log n) space and
0(n2/3+e) query time. □ 3.1 Querying colored line segments with
a line
2.3 Generalized halfspace range report- We dualize the colored line segments of S to a set
ing in d > 2 dimensions 5" of colored doublewedges and map the query line
The preceding approach extends to 1Z , d > 3, but q to a point q'. Thus, our problem reduces to re-
the space bound is high, namely, 0(ndL'V2.l+£). We porting the i distinct colors that are stabbed by q'.
now give an approach for the reporting problem in In Section 4, we solve this problem in 0(n3'2logn)
Hd (d > 2) that needs much less space. In pre- space with a query time of 0(log2 n + i). In the
processing, we store the distinct colors in the input rest of this section, we consider the case where the
point-set S at the leaves of a balanced binary tree segments of S all He in the unit square U and each
CT (in no particular order). For any node v of segment has length at least A, where A > 0 is a con-
CT, let C(v) be the colors stored in the leaves of stant. These assumptions are reasonable for prac-
u's subtree and let S(v) be the points of S colored tical applications and they allow a very efficient
with the colors in C(v). At v, we store a data solution.
structure HSE(v) to solve the halfspace emptiness For now assume that all the segments intersect
problem on S(v), i.e., "does a query halfspace con- the i/-axis Y. Thus, one endpoint of s has neg-
tain any points of S(u)?" HSE(v) returns "true" ative ^-coordinate and the other, has positive x-
iff the query halfspace is empty. If \SV\ = nv, then coordinate. Thus in the corresponding dual dou-
blewedge one of the bounding lines has positive
HSE(v) uses 0(nz ' * ) space and has query time
slope and the other has negative slope. We split
O(lognv) [Mul93, page 290].
each doublewedge into a left-wedge and a right-
To answer a generalized halfspace reporting
wedge. Note that each wedge is y-monotone. Con-
query we do a depth-first search in CT and query
sider the right-wedges. Because of y-monotonicity,
HSE(v) at each node v visited. If v is a non-leaf
q' is contained in a right-wedge w iff the horizon-
then we continue searching below v iff the query
tal, leftward-directed ray r emanating from q' in-
returns "false"; if v is a leaf, then we output the
tersects the boundary of w. Thus for each color c,
color stored there iff the query returns "false".
we compute the left-envelope of the boundaries of
Theorem 2.3 For any fixed d > 2, a set S of n all c-colored right wedges. If there are nc c-colored
colored points in TZd can be stored in a structure of right wedges, then the c-colored left-envelope has
size 0(nLd/2-l+£) such that the i distinct colors of size 0(nc) (see [Ede87, page 357, Problem 15.6]).
the points contained in a query halfspace Q~ can In this way, we obtain a collection 5"" of colored line
be reported in time O(log n + ilog2 n). Here e > 0 segments. Note that (i) r intersects the boundary
is an arbitrarily small constant. □ of a c-colored right-wedge iff r intersects a c-colored

373
left-envelope and (ii) if r intersects a c-colored left- lem is now equivalent to the following generalized
envelope then it intersects a unique line segment 1-dimensional range searching problem: Given col-
of this envelope. Thus we have a standard prob- ored integers 1,2, ...,n (where integer j gets the
lem which we can solve in 0(n log n) space and color of £j), report the distinct colors in the query
O(log2 n + i) query time by using a segment tree interval [a, b]. In [GJS93a], this problem is solved
as in Section 2.1. using a structure Dk of size 0(n) and a query time
What if the segments of S do not all intersect Y1 O(logn + i). Dk supports updates in O(logn) time
Suppose that there is a constant K such that each with O(logn) memory modifications. By sweeping
segment intersects one of K fixed lines Y\,..., YK- over the strips Vk, 1 < k < t, and making the asso-
Let S{ C S be the set of segments intersecting Yj. ciated Dk's partially persistent, we get a solution
(If a segment intersects more than one Yj-, we put with space O(n2logn) and query time O(log7i + i).
it in any one of the 5,'s; thus the 5,'s partition S.) In a nutshell, the idea for the space-query-time
For 1 < i < K, we create a coordinate system C,, tradeoff is as follows: We extract from the se-
where Y| is the y-axis and any line perpendicular quence £ = (Ei,..., Et+i) a smaller subsequence
to Yi is taken as the x-axis. We give the segments £' = (E[,...,E'm) such that (i) E'- and E'j+1 differ
of Si coordinates in C,- and store them in the data in just two (not necessarily adjacent) positions, (ii)
structure described above. To answer a query, we for each Ek £ £ there is an E'- € £' which "approx-
query each of the K structures separately. The imates" Ei in a sense that we will elaborate upon
space and query time are as above. later, and (iii) m = 0(n2-5~ß), where 0.5 < /i < 1
We can now solve the problem stated at the is a tunable parameter. Properties (i) and (iii) sug-
beginning. Wlog assume that the origin is at gest that we can apply persistence to £' and get a
the bottom-left corner of U. Consider the K = scheme with space bound o(n2); property (ii) sug-
2 + 2|"N/2/A] lines x = i ■ X/y/2 and y = i- X/y/2, gests that instead of querying Ek, as we might in
where 0 < i < [V2/A]. Since each segment has the simple scheme, we can query E'- in the new
length at least A, either its z-span or its y-span is scheme and still be assured of correctness.
at least \/y/2. Thus each segment intersects one Formally, we define a sequence &I,62,...,&B of
of the K lines. We now use the above structure. distinguished list positions called borders, where
bi = (i - l)|n" + 1J + 1 and B = Q(nl~») .
Theorem 3.1 Let A > 0 be a constant and lettl be We construct £' by scanning £. Let Ei be the
the unit square. A set S of n colored line segments currently scanned list of £. Let E'- be the most
in 1Z2, where each segment has length at least A and recently constructed list of £' and suppose that
all segments lie in U, can be stored in a structure we constructed E1- when we reached Es- € £. If
of size 0(n log n) such that the i distinct colors of Ei+i is obtained from Ei by swapping lines across
the segments that are intersected by a query line q some border bk, i.e. by swapping the 6^th line a
can be reported in time 0(log2 n + i). □ with either the (bk - l)th line ß or the (bk + l)th
line 7, then we create E'j+1 from E'- by swap-
3.2 Querying colored lines with a verti- ping a with ß or 7, as appropriate; we also set
6j+i = i + l. It can be shown that E'- approx-
cal line segment
imates any list Ek G {ESj,ESj+i,... ,ESj+1-i} in
We give a simple approach based on persistence the following sense: for any two successive borders
[DSST89], and then show how to incorporate fil- bi and 6;+i, the (unordered) set of lines at positions
tering search to get a space-query time tradeoff. b\ +1,..., 6;+1 in E'j is the same as the (unordered)
We divide the plane into t — 0(n2) strips set of lines in Ek at these same positions. More-
by drawing vertical lines through the intersection over, it can be shown that the border-lines in E'
points of the n lines. Within any strip, Vk, the and Ek are the same; this implies that the border-
lines are totally ordered from top to bottom, as lines in {Esj,E$j+i,..., EsJ+1-i} are the same and
Ek : ^i,^2? • • • »Al- Suppose that the vertical query can be totally ordered. Finally, using k-set theory,
segment q is in V* and let £a and £/, be the highest it can be proved that \£'\ = 0(n2,5~ß).
and lowest lines of Ek intersected by q. Our prob- The data structure consists of (1) a red-black

374
tree T storing the total order of the border lines sweep over the strips starting at the leftmost non-
of E'j, (2) an instance D'j of the generalized 1- empty strip. Let si,s2,...,sm be the segments
dimensional range searching structure built on the that cross this strip, sorted from bottom to top.
colored integers Ij : (l,2,...,n), where integer p For 1 < i < m, we give st- a label Z(s,-) = i and give
gets the color of the pth line of E'j, and (3) a red- this label the color of s,-. We store the segments
black tree I'j storing Ij. We make all these struc- 5i,..., sm in this order in a partially persistent red-
tures persistent. black tree Ts- We also store the colored labels l(s{),
Given q, suppose we need to query E'j. We find 1 < i < m, in a partially persistent version T; of
the smallest border ba on or above q's upper end- the data structure of [GJS93a] for the generalized
point and, symmetrically the greatest border bg. 1-dimensional range reporting problem.
We query the structure D'j with [ba + l,bg]. Then Suppose we sweep from the zth to the (i + l)th
we scan all the integers bs,bs — l,...,6s-i + 1 in Ij strip. The cases where we encounter a right end-
and report the distinct colors of the lines of E'j at point of a segment or the intersection point of two
these positions that are intersected by q; symmet- segments are easy to handle [GJS93c]. If we en-
rically for bg. counter the left endpoint of segment s, then in the
current version of Ts, we locate 5. Let t and u
be the segments that are immediately below and
Theorem 3.2 A set S of n colored lines in V? can
above s in the (i + l)th strip. We insert s into the
be stored in a data structure of size 0(n25~ß log n)
current version of Ts and store with it a label l(s)
such that the i distinct colors of the lines that are
that lies between l(t) and l(u). Moreover, we give
intersected by a vertical query line segment can be
the label l(s) the same color as s and insert this
reported in 0{nß + i) time. Here /x is a tunable
colored number into the current version of T/.
parameter in the range 0.5 < \i < 1. The problem
In this scheme, we need to assign special labels
is also solvable in 0(n2 log n) space and O(log n+i)
to the segments as we encounter them because all
query time. O the segments are not present in each strip. How-
ever, we must be careful in choosing the labels since
We remark that our method is based on an idea otherwise we may end up getting labels consisting
used in [AvK093] for a different (standard) prob- of 0(n) bits. Towards this end, we use a label-
lem. However, there are several crucial differences: ing scheme due to Dietz and Sleator [DS87]. Using
(i) because our problem is a generalized one, our their approach we take integer labels in the range
algorithm for constructing £' uses a different swap [O..0(n2)], i.e., labels consisting of only O(logn)
criterion, (ii) because our query is a vertical line bits. We need to give segment s a label that lies in
segment rather than a ray (as in [AvK093]), our between l(t) and l(u). Using the scheme of [DS87],
choice of borders needs to be different in order to this may result in the relabeling of other segments.
get a sublinear query time. Further discussion of Dietz and Sleator show how to choose the labels
this appears in [GJS93c]. such that only 0(1) amortized relabelings are nec-
essary per update. If we relabel segment s from
3.3 Querying colored line segments with l(s) to l'(s), then we just delete the colored num-
a line segment ber l(s) from T\ and insert the number l'(s), having
the same color as l(s), into it.
3.3.1 Vertical query line segments Now let q be a vertical query segment. We locate
We can use an approach similar to the one at the strip containing q and then search in the version
the beginning of Section 3.2. However, since we of Ts corresponding to this strip for the lowest and
are now dealing with line segments rather than highest segments s and t that intersect q. Finally,
lines, we must overcome a subtle problem that can we search in the version of T; corresponding to this
arise. We discuss this later. We draw vertical lines strip for the distinct colors of all labels that are
through the endpoints and the intersection points contained in the interval [l(s),l(t)].
of the segments of S. Within any strip, the seg-
ments that cross it can be totally ordered. We Theorem 3.3 A set S of n colored line segments

375
in the plane can be preprocessed into a data struc- in Vi. Let Wij be any such substrip within Vi and
n suc
ture of size 0((n + x)l°g ) ^ that the i dis- let Tij consist of the triangles of T/ that cross Wij.
tinct colors of the segments intersected by a vertical Note that, by construction, no triangle of Tij can
query line segment q can be reported in O(log n-\- i) have a vertex inside Wij. (This partitioning tech-
time. Here x, 0 < x 5- Q); *s the number of pair- nique is reminiscent of a method used in [OY88] for
wise intersections among the segments in S. □ computing the measure of the union of iso-oriented
boxes in TZd.)
3.3.2 Arbitrary query line segments Given the query point q, suppose that q £ Vi
and q £ Wij. Then we need to only report the
If q is not vertical, then we use a different approach distinct colors of the triangles of T,- and of Tij that
which we sketch briefly. We break up the input seg- are stabbed by q. We discuss how to do this for V,
ments at their X intersection points and store them and T{. (The discussion for Wij and Tij is similar.)
in a segment tree T. For any node v £ T, the set For any triangle t £ Tt-, let p{t) be the vertex of
S(v) of segments allocated to v can be totally or- t shared by the horizontal side h(t) of t and the
dered within Strip(v) as si,...,sm, from bottom slanted side s(t) of/ which crosses Vi. Let w(t) be
to top. Suppose q = ab is such that a, b G Strip(v), the wedge defined by p(t) and (the extensions of)
with a below b. Let su be the lowest segment h(t) and s(t). Consider the set Ä,- C T,- that yields
of S(v) that is above a; define sw symmetrically right-facing wedges. Clearly, q stabs / € R{ iff the
w.r.t. b. Clearly it suffices to report the distinct horizontal, leftward directed ray from q intersects
colors in {su, su+i,..., sw}, which we can solve us- w(t). We can now solve the resulting generalized
ing a structure for generalized 1-dimensional range ray-rightwedge intersection problem by computing
searching. If q — [a, b] is not as above, then we can left envelopes and using a segment tree (as in Sec-
identify a set V of O(logn) nodes in T such that tion 3.1). Symmetrically for left-facing wedges.
for each v £ V, the segment qv = q D Strip(v) is as
above. We simply query at each such v with qv.
Theorem 4.1 A set S of n colored triangles in
7Z2 can be stored in a data structure of size
Theorem 3.4 A set S of n colored line segments
0(n3'2logn) such that the i distinct colors of the
in 1Z2 can be preprocessed into a data structure of
triangles that are stabbed by a query point q can be
size 0((n + x)logn) so that the i distinct colors
reported in O(log2 n -f i) time. □
of the segments that are intersected by a query seg-
ment q can be reported in O(log2 n -f- ilogn) time.
Here x> 0 < x < (2) ls the number of pairwise 5 Generalized triangle range
intersections between segments in S. □
searching
4 Generalized triangle stabbing We wish to preprocess a set S of n colored points
in 7Z2 so that the i distinct colors of the points
We consider the following problem: "Preprocess contained in a query triangle q can be reported
a set S of n colored triangles in TZ2, so that the efficiently. For arbitrary q we note that the problem
i distinct colors of the triangles stabbed by any can be solved in 0(n2+c) space and O(logn + i)
query point q can be reported efficiently." query time using constant-depth cutting trees. In
Wlog assume that each triangle t £ S has a hor- the rest of this section, we give an efficient solution
izontal side. We group the triangle vertices into for query triangles that are fat. We define a fat-
©(n1'2) vertical strips each of size ©(n1'2). The triangle to be a triangle in which each internal angle
triangles that intersect any strip Vi form two dis- is at least 7 for some constant 7 > 0.
joint subsets T, and T/, where T,- (resp. T{) consists We begin with a solution for a query fat-wedge q.
of triangles having no (resp. at least one) vertex i.e., a wedge where the internal angle at the vertex
inside V{. We further subdivide Vi into vertical vq of q is at least 7. For now assume that q is y-
strips by taking each triangle in T[ and drawing a monotone. We store the points of S at the leaves of
vertical line through each of its vertices that lies a balanced binary search tree T by non-decreasing

376
^-coordinates from left to right. We augment each 6 Conclusions and further work
node v of T with an instance HP(v) of the struc-
ture of Theorem 2.1 for generalized halfplane range We have presented efficient solutions to several
reporting; HP(v) is built on the points in t>'s de- generalized intersection problems involving non-
scendant leaves. iso-oriented objects. Our methods have included
sparse representations, persistence, and filtering
Given q, we divide it into an upper wedge qa and
search.
a lower wedge qb, by drawing a horizontal line L
Besides improving our bounds, three problems
through vg. Consider qa. Let la be the line con-
are of particular interest: (i) obtaining dynamic
taining the slanted side of qa. We search in T us-
data structures for the generalized problems con-
ing the y-coordinate of vq and determine a set Va
sidered here, (ii) obtaining linear-space or near
of nodes that lie to the right of the search path.
linear-space solutions with output-sensitive query
We query HP(v) at each v G Va with the halfplane
times (of the form 0(np+i) or 0(np+i-polylog(n)),
l~. Symmetrically for"<ft. It can be shown that
0 < p < 1) for the generalized halfspace range
the space used is 0(nlog2 n) and the query time is
searching problem in d > 4 dimensions and for
O(log3n + ilogn).
the generalized simplex range searching problem
What if q is not y-monotone? In preprocess- in d > 2 dimensions, and (iii) solving the counting
ing, we select t = [~27r/7] coordinate systems d = versions of Problems 3-7 in Table 1.
(x,y,), where all the C; share the same origin and
d+i is offset from C; by an angle *f,0<i<t-l
(indices are modulo t.) Within each C, we build References
an instance of the data structure for t/,-monotone
fat-wedges. Given a query fat-wedge q, we locate a [AHL90] A. Aggarwal, M. Hansen, and T. Leigh-
d such that q is y.-monotone and then query the ton. Solving query-retrieval problems
associated structure. (It is easily seen that such a by compacting Voronoi diagrams. In
d exists.) Proceedings of the 18th Annual ACM
Now consider the case of a query fat-triangle Symposium on Theory of Computing,
q. We store the points by non-decreasing x- pages 331-340, 1990.
coordinates from left to right in a balanced search
[AvK93] P.K. Agarwal and M. van Kreveld. Con-
tree T" and augment each node v with an in-
nected component and simple polygon
stance FW{v) of the structure given above for fat-
intersection searching. In Proceedings of
wedges, which is built on the points in u's descen-
the 1993 Workshop on Algorithms and
dant leaves. Given q, we divide it into two triangles
Data Structures, pages 36-47, August
qi and qT, each with a vertical side s, with qi to the
1993.
left of s and qr to the right. We search in T" with
the z-coordinate of s and identify a set Vi of nodes [AvK093] P.K. Agarwal, M. van Kreveld, and
that he to the left of the search path. For each M. Overmars. Intersection queries for
node v 6 V;, we query FW(v) with the wedge sup- curved objects. Journal of Algorithms,
porting qi, which is a fat-wedge. Symmetrically for 15:229-266,1993.

[CGL85] B.M. ChazeUe, L.J. Guibas, and D.T.


Lee. The power of geometric duality.
BIT, 25:76-90, 1985.
Theorem 5.1 Let 7 > 0 be a constant. A set S
of n colored points in "R? can be stored in a data [DS87] P.F. Dietz and D.D. Sleator. Two al-
structure of size O(nlog3n) such that the i distinct gorithms for maintaining order in a list.
colors of the points that are contained in a query In Proceedings of the 19th Annual ACM
triangle q each of whose internal angles is at least Symposium on Theory of Computing,
7 can be reported in time O(log4n + ilog n). □ pages 365-372, 1987.

377
[DSST89] J.R. Driscoll, N. Sarnak, D.D. Sleator, [OY88] M.H. Overmars and C.K. Yap. New
and R.E. Tarjan. Making data struc- upper bounds in Klee's measure prob-
tures persistent. Journal of Computer lem. In Proceedings of the 29th An-
and System Sciences, 38:86-124, 1989. nual IEEE Symposium on Foundations
[Ede87] H. Edelsbrunner. Algorithms in Com- of Computer Science, pages 550-556,
1988.
binatorial Geometry. Springer-Verlag,
1987.
[GJS93a] P. Gupta, R. Janardan, and M. Smid.
Further results on generalized intersec-
tion searching problems: counting, re-
porting, and dynamization. In Proceed-
ings of the 1993 Workshop on Algo-
rithms and Data Structures, pages 361-
372, August 1993.
[GJS93b] P. Gupta, R. Janardan, and M. Smid.
On intersection searching problems in-
volving curved objects. Technical Re-
port TR-93-42, Dept. of Computer Sci-
ence, University of Minnesota, 1993.
Submitted.
[GJS93c] P. Gupta, R. Janardan, and M. Smid.
Efficient algorithms for generalized
intersection searching with non-iso-
oriented objects. Technical Report TR-
93-73, Dept. of Computer Science, Uni-
versity of Minnesota, 1993. Submitted.
[JL93] R. Janardan and M. Lopez. Generalized
intersection searching problems. Inter-
national Journal of Computational Ge-
ometry & Applications, 3:39-69, 1993.
[Mat91a] J. Matousek. Cutting hyperplane ar-
rangements. Discrete & Computational
Geometry, 6:385-406, 1991.
[Mat92a] J. Matousek. Efficient partition trees.
Discrete & Computational Geometry,
8:315-334, 1992.
[Mat92b] J. Matousek. Range searching with ef-
ficient hierarchical cuttings. In Pro-
ceedings of the 8th Annual ACM Sym-
posium on Computational Geometry,
pages 276-285, 1992.
[Mul93] K. Mulmuley. Computational Geome-
try: An introduction through random-
ized algorithms. Prentice-Hall, 1993.

378
Video Review

379
380
3rd Annual Video Review of Computational Geometry
Computational geometry concepts are often easiest to understand visually.
Indeed, most papers in computational geometry rely on diagrams to communi-
cate the intuition behind their results. However, static figures are not always
adequate to describe geometric algorithms, since algorithms are inherently dy-
namic. The accompanying videotape showcases advances in the use of algorithm
animation, visualization, and interactive computing in the study of computa-
tional geometry. The following pages contain short descriptions of the eight
segments in the videotape.
The eight video segments present a variety of geometric algorithms and con-
cepts, organized by dimensionality. The first three segments are animations of
two-dimensional algorithms: a polygonal approximation algorithm from cartog-
raphy, an algorithm for computing the rectangle discrepancy, and a fixed-radius
neighbor-searching algorithm. The fourth video presents the GASP system for
animating geometric algorithms in two or three dimensions; GASP is used by
two other segments in the review. The last four segments illustrate algorithms
and concepts in three or more dimensions: The fifth segment explores the rela-
tionship between penumbral shadows in three dimensions and four-dimensional
polytopes. The final three segments show three-dimensional algorithms for in-
teractive collision detection, polyhedral separators, and interactive display of
alpha hulls.
We thank the members of the Video Program Committee for their help in
evaluating the entries. The members of the committee were Marshall Bern
(Xerox PARC), Marc Brown (DEC SRC), Leo Guibas (Stanford), John Hersh-
berger (Mentor Graphics), Jim Ruppert (NASA Ames), and Jenny Zhao (Silicon
Graphics).
We also thank Bob Taylor of the DEC Systems Research Center for his
support in publishing the 1st and 2nd Annual Video Reviews. Both are avail-
able free of charge upon request. The '92 Review is SRC Research Report
#87a (a written guide) and #87b (the videotape), and the '93 Review is re-
ports #101a and #101b. You can obtain either by sending electronic mail to
src-report@src.dec.com, or physical mail to Librarian, DEC Systems Re-
search Center, 130 Lytton Ave., Palo Alto, CA 94301. You can also get the
written guides by anonymous ftp from gatekeeper.dec.com in the directory
pub/DEC/SRC/research-reports.

Marc H. Brown
John Hershberger
Video Review Co-Chairs

381
382
An O(nlogn) Implementation Of The Douglas-Peucker Algorithm
For Line Simplification
John Hershberger Jack Snoeyink
Mentor Graphics Department of Computer Science
University of British Columbia

Introduction vision [8] and computational geometry [9]. Our


video animates two different implementations of
An important task of the cartographer's art is to this simplification method—the straightforward im-
extract features from detailed data and represent plementation suggested in Douglas and Peucker and
them on a simple and readable map. As com- the implementation of Hershberger and Snoeyink
puters become increasingly involved in automated that improves the worst-case running time.
cartography, efficient algorithms are needed for the We describe the method, the implementations,
tasks of extraction and simplification. Cartogra-
and the animation.
phers [1, 6] have identified the line simplification
problem as an important part of representing linear
features. Given a polygonal chain, a sequence of Method
vertices V = {v0, vi,..., vn}, the problem is to Given a polygonal chain V — {v0, vlt..., vn}, the
find a subsequence of vertices that approximates recursive line simplification method proceeds as fol-
the chain V. We assume that the input chain V lows: Initially, approximate V by the line segment
has no self-intersections (but not the output). v0vn. Determine the farthest vertex vj from the
line v~ävZ,. If its distance d(vf,$övZ) is at most a
given tolerance e > 0, then accept the segment vovn
as a good approximation to V. Otherwise, break
V at Vf and recursively approximate the sub chain
{v0,vi,...,vf} and {vf,...,v„}.

Algorithms
The two implementations differ in the way they find
vj, the farthest vertex from VQVn.
The straightforward approach measures distance
from v~ävZ. for eacn vertex and takes the maxi-
mum. Thus, the running time of this algorithm
will satisfy a quicksort-like recurrence, with best
case 0(nlogn). Since geometry determines the far-
In 1973, Douglas and Peucker (now Poiker) [3]
thest vertex, the worst-case running time is 0(n2).
published a simple recursive simplification method
One cannot use linear-time median finding or ran-
in the cartography literature that has become the
domization to improve the running time. (If one
favorite of many [5, 10]. This method has been
assumes that the input data is such that farthest
independently proposed in other contexts such as
vertices are found near the middle of chains, then
one expects 0(n log n) behavior.)
The second implementation uses a path hull data
structure [2, 4] to maintain a dynamic convex hull
of the polygonal chain V. Using Melkman's convex
hull algorithm [7], we compute two convex hulls
from the middle of the chain outward. We can find

383
Build
FindExtr.

a farthest vertex Vf from a line by locating two References


extreme points on each hull using binary search.
[1] B. Buttenfield. Treatment of the cartographic line.
When we split V at vertex vj, we undo one of the
Cartographica, 22:1-26, 1985.
hull computations to obtain the hull from the "mid-
dle" to vj, recursively approximate the subchain [2] D. Dobkin, L. Guibas, J. Hershberger, and
J. Snoeyink. An efficient algorithm for finding the
containing the middle, then build hulls for the other
CSG representation of a simple polygon. Algorith-
subchain and recursively approximate it. One can
mica, 10:1-23, 1993.
use a simple credit argument to show that the total
time taken by the algorithm is 0(n log n). The best [3] D. H. Douglas and T. K. Peucker. Algorithms for
the reduction of the number of points required to
case can even be linear, if all the hulls are small and
represent a line or its caricature. The Canadian
splits occur at the ends.
Cartographer, 10(2):112-122, 1973.
Unfortunately for us, the statistical properties of
[4] J. Hershberger and J. Snoeyink. Speeding up the
cartographic data usually means that the straight- Douglas-Peucker line simplification algorithm. In
forward implementation is slightly faster than the Proc. 5th Intl. Symp. Spatial Data Handling, pages
path hull implementation. Since the variance of 134-143. IGU Commission on GIS, 1992.
the running time of the path hull implementation
[5] R. B. McMaster. A statistical analysis of mathe-
is smaller, it may be interesting for parallel or in- matical measures for linear simplification. Amer.
teractive applications. Cartog., 13:103-116, 1986.
[6] R. B. McMaster. Automated line generalization.
Cartographica, 24(2):74-lll, 1987.
Animation [7] A. A. Melkman. On-line construction of the convex
hull of a simple polyline. Info. Proc. Let., 25:11-12,
The programs were run on a Silicon Graphics Crim- 1987.
son in the GraFiC lab at UBC and output was
recorded to video in real time. [8] U. Ramer. An iterative procedure for the polygonal
approximation of plane curves. Comp. Vis. Graph.
Image Proc, 1:244-256, 1972.
[9] G. Rote. Quadratic convergence of the sandwich
Acknowledgements algorithm for approximating convex functions and
convex figures in the plane. In Proc. 2nd Can.
Scott Andrews extracted the data of the coastline Con}. Comp. Geom., pages 120-124, Ottawa, On-
of British Columbia from the Digital Chart of the tario, 1990.
World. NSERC and the B.C. Advanced Systems
[10] E. R. White. Assessment of line-generalization
Institute supported the work on this video. DEC algorithms using characteristic points. Amer. Car-
Systems Research Center has also provided partial tog., 12(l):17-27, 1985.
support for the research.

384
Computing the Rectangle Discrepancy
David P. Dobkin Dimitrios Gunopulos
Department of Computer Science
Princeton University
Princeton, NJ 08544

This is the animation of an algorithm that computes the We also define the following simpler functions for A £T
rectangle discrepancy of a two-dimensional point set. Our
main motivation comes from sampling problems in com- V,(A) = In(A)/\X\ - Area(A)
puter graphics. Supersampling is one of the most general
ways of attacking antialiasing. In this approach we sample and
the picture at a very high rate, and then we resample by V0{A) = Area(A) - In(A)/\X\
averaging supersamples within the pixel area to compute
the pixel value. Ray tracing, a technique used to produce The algorithm we present in this animation computes
realistic images of computer modeled scenes, is another in-
stance of supersampling. Here we sample the radiance at a MaxVi(X) = maxAzrCDAA))
set of points in each pixel.
for a given input set X, in time O(|-V|2log 1*1). The same
The discrepancy theory provides a measure of the qual- techniques however can be used to maximize V0, and so
ity of the sampling patterns. The rectangle discrepancy this problem is equivalent to finding MaxV(X).
in particular gives a good measure on how well a sample
pattern, when applied to the area of one or more pixels, We explain the main idea of the algorithm in a series of
captures small details in the picture. This algorithm allows simple lemmata. First we show that we have to consider
us to find sampling sets with very low rectangle discrep- at most 0(\X|4) rectangles, more specifically the ones that
ancy. Interestingly the problem of computing the rectangle have all their edges pass through a point in X.
discrepancy also arises in the context of learning theory [4]. This allows us to study pairs of points in in X. For each
The algorithm is presented in [2]. We give the problem such pair we find the rectangle that maximizes V\ over all
and we show the main techniques used in the algorithm. rectangles with horizontal edges that pass through the points
Finally we run the algorithm on a sample point set. of the given pair.

Let us consider a point set X in the unit square. Let T This problem is much easier now because we know the y
be the set of all rectangles in the unit square with edges coordinates of the rectangle. Assuming that the two points
parallel to the two axis. For an axis oriented rectangle A are pb,pt (pb(y) < pt(y)l and the height of the rectangle
(A G T), we define the function is dy, {dy = pt(y) - pb(y)) we have to find the following
maximum
In(A) = \AnX\
maxA€Ti3{dxA dy - In(A)/\X\)
The rectangle discrepancy of a rectangle A G T is
where Tij is the set of rectangles that pass through points
V(A) = \In(A)/\X\ - Area(A)\ pb and pu and dxA is the width of A. If we eliminate the
points in X that either lie above the top y coordinate of
The maximum rectangle discrepancy of the set X is the rectangle or below the lower y coordinate, this becomes
an one-dimensional problem. We project the points on the
MaxV(X) = maxA€T(V(A)) x axis and obtain a new set X' of one-dimensional points.
"This work supported in part by the National Science Foundation under Grant We can equivalently maximize the following function
Number CCR93-012S4 and by The Geometry Center, University of Minnesota, an
STC funded by NSF, DOE, and Minnesota Technology, Inc. maxA€[o,i],pb(x)€A(Length(A) - In(A)/\X'\)

We can reduce this problem to the problem of computing


the halfspace discrepancy of one-dimensional point sets, a
simpler problem studied in [1]. Here we want to find the

385
anchored interval that maximizes REFERENCES
maxA=[0i2i](zi - i/\Z\)
[1] D.P. Dobkin and D. Eppstein, Computing the Discrep-
for a given one-dimensional set Z = {zx... zn} with 0 < ancy. Proceedings of the ninth annual Symposium on
Zi < Zi+i < 1. This is a linear function of the rank and the Computational Geometry, (1993).
coordinate of the point. To solve it we find the convex hull [2] D.P. Dobkin and D. Gunopulos, Computing the Rectan-
of the set {{z\ ,l)...(zn,n)} and find the maximum with a gle Discrepancy. Princeton University Technical Report
binary search. From this maximum we obtain the solution 443-94.
to the original maximization problem.
[3] D.P. Dobkin and A. Tal, GASP - A System to Facilitate
In this way we compute the maximum rectangle for all Animating Geometric Algorithms. Third Annual Video
pairs of points. Clearly the rectangle that maximizes T>i is Review of Computational Geometry, to appear, (1994)
the maximum of these Od^l2) rectangles.
[4] W. Maass, Efficient Agnostic PAC-Learning with Sim-
Finally, we show how to use the dynamic data structure ple Hypotheses. Submitted to COLT '94.
of [5] to solve a sequence of one-dimensional problems
efficiently. With the use of this technique we can maintain [5] Preparata, F. An optimal real time algorithm for planar
the convex hull at a cost of O(log \X\) time per insertion. convex hulls. Comm. ACM 22, (1979).
This in turn allows us to find the maximum rectangle for
each pair of points in O(log \X\) time, and yields the final
running time of O(|#|2log|;t|).
This video was prepared in the Computer Science de-
partment at Princeton University. The implementation of
the algorithm was written in C, to run under UNIX on a
Silicon Graphics Iris workstation. The animation was cre-
ated with the animation system GASP that Ayellet Tal and
David Dobkin are developing in this department [3]. Figure
1 shows the animation running on a sample input set. The
rectangle that maximizes V\ is now displayed on the screen.
Recording was done at the Interactive Computer Graphics
Lab at Princeton and editing was done with the assistance
of the Department of Media Services at Princeton.

max (In(A)/iXI - Area(A)}

Fig. 1: The rectangle that maximizes V\

386
An animation of a fixed-radius all-nearest-neighbors algorithm"

Hans-Peter Lenhof Michiel Smid

This video shows an animation of an algorithm we compute all pairs that are at distance at most 8
due to the authors [2] for solving the fixed-radius for a suitable choice of 8. This gives for each point
all-nearest-neighbors problem. In this problem, we a neighbor list containing all points that are at dis-
are given a set S of n points and a real number tance at most 8 to it. Given these lists, we can
8, and we have to report all pairs of points that triangulate the surface incrementally: An edge of
are at distance at most 8. The algorithm works in the current triangulation is called an outer edge, if
two stages. In the first stage, a grid is computed. it belongs to only one triangle. All outer edges are
Instead of a standard grid, we use a so-called de- maintained in a queue. With each edge, we store
graded grid that is easier to construct by means of a so-called common neighbor list, which is the in-
a simple sweep algorithm. This degraded grid con- tersection of the two neighbor lists of the points
sists of boxes with sides of length at least 8. If a belonging to this edge. We start with any trian-
box contains points of S, then its sides are of length gle. Its edges and their common neighbor lists are
exactly 8. In the second stage, this grid is used for inserted into the queue. As long as the queue is
the actual enumeration. For each non-empty box, non-empty, we do the following: We take any edge
it suffices to compare each of its points with all from the queue and look at all points in its common
points in the same box or in one of the neighbor- neighbor fist. Each such point defines a triangle
ing boxes. Although the algorithm may compare with the current edge. We take that point defin-
many pairs having distance more than 8, it can be ing the smallest triangle. This triangle becomes
shown that the total number of pairs considered part of the triangulation and we update the queue
is proportional to the number of pairs that are at appropriately.
most 8 apart. As a result, the total running time The video was produced at the Max-Planck-
of the algorithm is proportional to nlogn plus the Institute for Computer Science, using Silicon
number of pairs that are at distance at most 8. Graphics Indy and Indigo2 machines, and using
As an application, we give an animation of the Showcase and Geomview-1.1 software. We thank
algorithm of Heiden at al.[l] for triangulating the Roland Berberich, Jack Hazboun, Dirk Louis and
contact surface of a molecule. In a first step, points Peter Müller for their help in producing this video.
on this surface are computed. Given these points,
References
*This work was supported by the ESPRIT Basic Re-
search Actions Program, under contract No. 7141 (project [1] W. Heiden, M. Schlenkrich and J. Brickmann.
ALCOM II). Authors' address: Max-Planck-Institut für In-
formatik, D-66123 Saarbrücken, Germany.
Triangulation algorithms for the representation
of molecular surface properties. J. Comp. Aided
Mol. Des. 4 (1990), pp. 255-269.

[2] H.P. Lenhof and M. Smid. Enumerating the


k closest pairs optimally. Proceedings FOCS
1992, pp. 380-386.

387
GASP - A System to Facilitate Animating Geometric
Algorithms *
Ayellet Tal David Dobkin
Department of Computer Science
Princeton University
Princeton, NJ 08544

The GASP system helps in the creation and viewing To begin, we show a clip from [6]. This is the hierarchi-
of animations for geometric algorithms. The user need cal data structure for representing convex polyhedra [4, 5].
not have any knowledge of computer graphics in order to We explain a single pluck and then show how the hierarchy
quickly generate an animation. GASP allows the fast pro- progresses from level to level. To create the animation for
totyping of algorithm animations. A typical animation can explaining a single pluck the user need only write the fol-
be produced in a matter of days or even hours. Even highly lowing short code. The animation was an aid in debugging
complex geometric algorithms can be animated with ease. the algorithm for detecting plane-polyhedral intersection.
The system is also intended to facilitate the task of imple-
menting and debugging geometric algorithms.
explain_pluck(poly_3£er£_nQ, polyjtertices,
The application's code specifies only the structure of the poly _face_.no, poly_faces, poly_nanies,
animation (which building blocks are included), and the 3terl_aQ, vertices, face_no, laces)
structure of each scene (e.g., the position of the objects). {
The user need not be concerned with the way the animation /* create the polyhedron. */
appears on the screen. If the user wishes to influence the Begin_a£QrjUG(upQlyu);
look of the animation and not only its structure, he can edit Create_polyh.edron( UEQU, poly_3£ert_nQ,
an ASCII "Style File" which controls viewing aspects of poly_f ace_.no, pQly_j_ert_.ces, poly_faces);
the animation. Even when the user changes the style file, Rotate_Horld();
the user needs no specific knowledge of computer graphics. EncLatomicO ;
The animation is generated automatically by the system.
But a different animation will be generated if the style file /* remote vertices and con.es */
is modified. Begin_atomic("pluck");
Split_pQlynedron(poly_names, ''EQ'l,
The GASP's environment allows the viewer to control the 3tert_no, vertices) ;
execution of the algorithm in an easy way. The animation End_atomic();
can be run at varying speeds: fast(>>), slow(>) or step by
step (> |). The analogous <, << and | < push buttons run /* add nest faces */
the algorithm in reverse. The viewer can PAUSE at any time Begin_alomic(uadd_facesu);
to suspend the execution of the algorithm or can EJECT the Add_laces(poly_names[Q] , face_no, faces);
movie. The environment is invaluable for education and End_atomic() ;
debugging.
/* undo plncking */
This video shows five examples of GASP in action.
IIndo(2);
These examples were chosen to give a sense of the range
of possible applications of GASP. In addition, two other
videos [1], [3] that use our system appear in this collection
of animations. The second animation, based on [10] is a remake of [9].
The animation shows a configuration of six tetrahedra that
cannot be taken apart by translation with two hands. Then,
*This work supported in part by the National Science Foundation under Grant it presents a configuration of thirty objects that cannot be
Number CCR93-01254 and by The Geometry Center, University of Minnesota, an
STC funded by NSF, DOE, and Minnesota Technology, Inc. taken apart by applying an isometry to any proper sub-
set. The purpose of the animation is to illustrate the use of
GASP as an illustration tool for geometric configurations.
It took us far less than a day to generate that animation.
The animation was created by the following function.

388
hands(){ allow students to interact with the algorithm. A student can
for (i = Q_; i £ stick_no; i±±H choose the initial line segments by editing an ASCII file
/* stick i */ and view how the animation is changing.
get.polyhedronCftpQinis, ^indices, finmax,
fcfmax, &aIomic_iiame, ftstick_name); The last clip animates heapsort. The colored rods have
lengths to be sorted. We first display the initial creation
Begin_aiomic(atQmic_name); of the heap. Next, simple motions are used to control the
Creaie_polyhedian(stick_nanie, nmax, fmax, repeated operations of removing the largest element, and
points, indices); reheaping. Heapsort is given as an example for using GASP
to facilitate the animation of any algorithm that involves the
End_atomic();
display of three dimensional geometries.
This video was prepared in the computer science depart-
Begin_atQmic(uaQtalBu); ment at Princeton University. The programs were written
Rotate_Horld() ; in C to run under UNIX on a Silicon Graphics Iris. Record-
End_atomicO; ing was done at the Interactive Computer Graphics Lab at
Princeton and editing was done with the assistance of the
Princeton Department of Media Services.
The following is part of the style file for the above anima- We thank Kirk Alexander and Mike Mills for their help
tion. The style file determines the following aspects of the in producing the final video.
animation. The background color is light gray. The colors
to be chosen by GASP are colors which fit the creation of
a video (rather than the screen). Each atomic unit spans 10
REFERENCES
frames. Rotation of the world is done 380 degrees around
the Y axis, and it is executed over 160 frames, instead of
over 10. The color of the stick which fades in during atomic [1] H. Bronnimann. Almost optimal set covers in finite
unit stickQ is red. (Similarly, the style file includes colors VC-dimensions. In The Third Annual Video Review of
for the other sticks.) Computational Geometry, 1994.
[2] B. Chazelle and H. Edelsbrunner. An optimal algo-
ßegin_glohal_style rithm for intersecting line segments in the plane. Jour-
background = Q.2 Q.9 Q.9; nal of the ACM, 39(l):l-54, 1992.
color = EIDEQ; [3] D. Dobkin and D. Gunopulos. Computing the rectan-
frames = 1Q;
gle descrepency. In The Third Annual Video Review of
end_glohal_ style
Computational Geometry, 1994.
hegin_nnit_style Rotate [4] D. Dobkin and D. Kirkpatrick. Fast detection of poly-
frames = 16Q; hedral intersections. Journal of Algorithms, 6:381-
rotalion_Horld = I 38Q.Q; 392, 1985.
end_nnit_style
[5] D. Dobkin and D. Kirkpatrick. Determining the sepa-
oegin_nnit_style stickQ
ration of preprocessed polyhedra - a unified approach.
color = Q.625 Q.2Z34Z5 Q.2Z34Z5;
ICALP, pages 400-413, 1990.
end_imit_ style [6] D. Dobkin and A. Tal. Building and using polyhedral
hierarchies (video). In The Ninth Annual ACM Sym-
Next we show an animation of a motion planning algo- posium on Computational Geometry, page 394, May
rithm [7]. It is a repeat of the first part of [8]. The object 1993.
to be moved is a disc and the obstacles are simple disjoint [7] H. Rohnert. Moving a disc between polygons. Algo-
polygons. The goal of the animation is to show the use of rithmica, 6:182-191, 1991.
GASP in creating two-dimensional animations.
[8] S. Schirra. Moving a disc between polygons (video).
The forth animation, which is based on [2], shows a line In The Ninth Annual ACM Symposium on Computa-
segment intersection algorithm in action and illustrates its tional Geometry, pages 395-396, May 1993.
most important features. The animation consists of three
phases. The first phase presents the initial line segments and [9] J. Snoeyink. Objects that cannot be taken apart with
the visibility map that needs to be built. The second phase two hands (video). In The Ninth Annual ACM Sym-
demonstrates that the visibility map is being constructed posium on Computational Geometry, page 405, May
by operating in a sweepline fashion, scanning the segments 1993.
from left to right, and maintaining the vertical visibility [10] J. Snoeyink and J. Stolfi. Objects that cannot be taken
map of the region swept along the way. The third phase apart with two hands. In The Ninth Annual ACM Sym-
demonstrates that the cross section along the sweepline is posium on Computational Geometry, pages 247-256,
maintained in a lazy fashion. The animation is used as May 1993.
an aid in explaining a highly complex algorithm and to
389
Penumbral Shadows

Adrian Mariano* Linus Upson^

The shadows cast by polygonal occluding objects illu- the edges or vertices of the light source through vertices
minated by polygonal light sources are complicated. Un- or edges of the occluder onto the plane of the shadow.
like shadows cast by point sources, they are divided into The video illustrates that when a square occluding ob-
regions where the shadow intensity changes at different ject is illuminated by a square light source, the shadow
rates. The boundaries between these different regions diagram is a projection of a four-dimensional hypercube.
form the shadow diagram. In general, the shadow diagrams for an arbitrary light
The video tape depicts shadows cast by a square light source and occluder can be seen as projections of four-
source with a square occluding object. We have included dimensional polytopes by considering the lines which in-
two types of images: flat shadow scenes and perspective tersect the plane of the shadow. Let S be the plane of
views. The flat shadow images were calculated using the shadow and let P be a different plane parallel to S.
the exact formula for radiative energy transfer. This If a line intersects S at the point (xs, ys) and it intersects
calculation depends only on the boundary of the visible P at the point (xp,yp) then the line can be mapped to
light source. For polygons, it can be reduced to a simple a point (x„, ys,xp,yp) in in R4. Now let D be the set of
summation. [1] all lines which intersect both the light source and the oc-
Finding the boundary of the visible portion of the illu- cluder. When D is mapped into R4, the result is a four-
minating polygon when it is occluded by a second poly- dimensional polytope. If this polytope is projected into
gon requires computing the intersection of two polygons. R by discarding the last two coordinates of each point,
General purpose algorithms for computing intersections the shadow diagram results. Because P can be changed,
of arbitrary polygons in the plane are quite complicated, this construction describes a particular shadow diagram
so we used the Sutherland-Hodgman algorithm [2] which as the projections of any one of a family of polytopes.
cannot handle concave polygons, but which is much sim-
pler than the fully general methods [3]. We created the
three-dimensional perspective views from the flat images References
using the texture mapping capabilities of Rayshade.
[1] Hottel and Sarofim. Radiative Transfer. McGraw
The shadow diagrams can be obtained by projecting Hill, New York. 1967.
* adrian@cam.cornell.edu, Center for Applied Math, 657 ETC, [2] Foley, van Dam, Feiner and Hughes. Computer
Cornell University, NY 14853-3801.
t LinusJJpson@NeXT.com, NeXT, 900 Chesapeake Drive, Red-
Graphics Principles and Practice. Addison-Wesley,
wood City, CA 94063. New York. 1990.

[3] Vatti, Bala. "A Generic Solution to Polygon Clip-


ping." Communications of the ACM, July 1992.
[4] Teller, Seth. "Computing the Antipenumbra of an
Area Light Source." SIGGRAPH '92 Conference Pro-
ceedings, July 1992.

390
Exact Collision Detection for Interactive Environments
Jonathan D. Cohen Ming C. Lin Dinesh Manocha *
Computer Science Department Computer Science Department Computer Science Department
University of North Carolina Naval Postgraduate School University of North Carolina
Chapel Hill, NC 27599-3175 Monterey, CA 93943 Chapel Hill, NC 27599-3175

Madhav K. Ponamgi
Computer Science Department
University of North Carolina
Chapel Hill, NC 27599-3175

Abstract:
We demonstrate algorithms for collision detection in
Applicability Test °«g*
large-scaled, interactive environments. Such environments
are characterized by the number of objects undergoing rigid -•r :3k
motion and the complexity of the models. We do not as- ...••- ! R,
-f - }fC? j \
sume that the motions of the objects are expressible as
closed form functions of time, nor do we assume any upper 1 I \: «2 \
bounds on their velocities.
Over the last few years, a great deal of interest has been
generated in virtual or synthetic environments, such as ar-
chitectural walkthroughs, visual simulation systems for de-
signing the shapes of mechanical parts, training systems, Object A
etc. Interactive, large-scaled virtual environments pose new (Fa, Vy ->(£„, vy since Vb fails the applicabil-
challenges to the collision detection problem, because they ity test imposed by the constraint plane CP.
require performance at interactive rates for thousands, of
pairwise intersection tests [1].
Our algorithms use a two-level hierarchical detection Figure 1: An Example of collision detection for convex
test for each model to selectively compute the precise polyhedra
contact between objects, achieving real-time performance objects or articulated bodies by using a sub-part hierarchi-
without compromising accuracy. At the top level, we use cal tree representation.
a dimension reduction approach (based on a technique • Exact Collision Detection
termed as sweep and prune) and the temporal and geomet- The Voronoi regions form a partition of space outside the
ric coherence that exists between successive frames to over- polytope according to the closest feature. The collection of
come the bottleneck of 0{n2) pairwise comparison tests in Voronoi regions of each polytope is the generalized Voronoi
a large environment of n moving objects [1]. After we elim- diagram of the polytope. Note that the generalized Voronoi
inate the objects pairs which are not in the close vicinity of diagram of a convex polytope has linear size and consists
each other, we employ an exact collision detection scheme. of polyhedral regions. Each Voronoi region is bounded by
The exact convex polytope collision detection algorithm is a set of constraint planes with pointers to the neighboring
based upon [2]: locality (captured by walking from one cells (which each share a constraint plane with it).
Voronoi region of the candidate feature to one of its neigh-
If a point lies on a constraint plane, then it is equi-
boring feature's Voronoi region according to the constraints
distant from the two features which share this constraint
failed) and coherence (used to reduce computation efforts
plane in their Voronoi regions. If a point P on object A
in a dynamic environment). We can deal with non-convex
lies inside the Voronoi region of the feature /s on object
'Supported in part by a Junior Faculty Award and ARPA Con- B, then /B is a closest feature to the point P.
tract #DAEA 18-90-C-0044 Our method is straightforward. We start with a candi-
date pair of features, one from each polytope, and check
whether the closest points lie on these features. Since the
polytopes and their faces are convex, this is a local test
involving only the neighboring features of the current can-
didate features. If either feature fails the test, we step to
a neighboring feature of one or both candidates, and try

391
again. With some simple preprocessing, we can guarantee Architecture for Multi-body
that every feature has a constant number of neighboring
features. This is how we can verify or update the closest
Collision Detection
feature pair in expected constant time. Fig. 1 shows how «form «vwrt«p
this algorithm works on a pair of simple convex polytopes. PS fSfNj 9m»pmxiPwm
• Sweep and Prune
The exact polytope collision detection algorithm is fast
enough to perform collision detection at real-time, in a
multi-body environment of moderate size. However, the
0(n2) pairwise detection tests become a bottleneck for
large n. By exploiting the spatial and temporal coherence,
we use a method whose running time is a linear function of
colMen
the number of objects and the number of pairs of objects
in close vicinity of each other.
For each object in the environment, we compute a small-
est fitting, axis-aligned bounding box, which is dynamically
resized using a hill-climbing algorithm based on the prop- Figure 2: The Architecture for multi-body simulation
erties of convex polytopes and the principle of coherence. walkthrough and a multi-body dynamic simulation environ-
These bounding boxes are used to prune down the num- ment. The video footage of walkthrough was taken from a
ber of pairwise collision detection tests. We take the or- user's actual walkthrough experience. The collision de-
thogonal projections of the bounding boxes onto the x, y, tection algorithm performs very well in large environments
and z axes and sort the intervals in three separate lists. If composed of hundreds of polytopes. The kitchen, like most
the projections overlap in all three dimensions, we activate realistic environments, is fairly static; therefore, we can sort
the exact collision detection algorithm. At each frame, we the bounding boxes of the polytopes in sub-linear time at
sweep over the sorted lists of intervals, updating them and each instance (this requires a modified sorting algorithm
culling out the pairs of non-overlapping bounding boxes. which sorts only the moving objects). We see very little
Each polytope in the environment now has a bounding degradation of frame rate when we add the capability of
box. We only call the exact collision detection algorithm collision detection to our walkthrough environment.
between two objects when their bounding boxes overlap. We further demonstrate a multi-body simulation with
Due of coherence, the sorted lists of intervals, constructed several complex objects in a moderately dense environment.
from the projections of the bounding boxes, change lit- The objects are placed in a bounded 3-dimensional simula-
tle from frame to frame, so we use a bubble or insertion tion volume whose walls act as barriers. (The architecture
sort to update these lists in expected linear time. Without of multi-body simulation is shown is Fig. 2.) Unlike the
the bounding box hierarchy, we would have to perform a walkthrough environment, all the objects move indepen-
quadratic number of pairwise exact detection tests. dently. The dynamics of multi-body simulation assumes
• Video Description elastic collision. In order to show the asymptotic time
We have successfully demonstrated the algorithm in an bound on the algorithm, we increase the number of pos-
architectural walkthrough environment and a multi-body sible interactions quadratically, but the frame time using
simulation system. For simulations consisting of thousands our collision detection algorithm increases only linearly.
of models, the overall algorithm has exhibited linear time
performance in practice.
• Acknowledgements We are grateful to Dr. Fred
We first demonstrate how the polytope collision detec-
Brooks and the walkthrough group at UNC Chapel Hill for
tion algorithm [2] tracks the closest features between two
the model of the kitchen.
convex polytopes in real time. We maintain and update
the closest features using the Voronoi regions of the poly-
topes. Since the polytopes move only slightly between the References
frames, the temporal and geometric coherence is well pre-
[1] J. Cohen, M. Lin, D. Manocha, and K. Ponamgi. Inter-
served. Thus, the expected running time of this algorithm
active and exact collision detection for large-scaled envi-
is constant, independent of the complexity of the polytopes.
ronments. Technical Report TR94-005, Department of
This is followed by demonstration the algorithm on an
Computer Science, University of North Carolina, 1994.
articulated body, namely a hand, represented by the union
of multiple convex polytopes. To demonstrate the efficiency [2] M. C. Lin. Efficient Collision Detection for Anima-
of the algorithm and effectiveness of the coherence, we keep tion and Robotics. PhD thesis, University of California
track of all pairs of closest features between each finger and at Berkeley, December 1993. Department of Electrical
the nearby objects. However, using a subpart hierarchical Engineering and Computer Science.
tree representation as in [2] can eliminate the unnecessary
computation.
The over all collision detection algorithm is tested on a

392
Almost Optimal Polyhedral Separators
HEHVE BRQNNIMANN*
Department UL Computer Science
Princeton University
PrirK-.rf.on, NI Q8544, USA
E-mail: hbraca.princetQa.ed.11

Abstract 2 Contents of the yideo


We first familiarke the viewer with the two polyhe-
We animate two detemuiuktic paiynorniai time meth-
dra Q C R; Q is seen inside hy means of transparency
ods for üiidiiig a separator ton two nested convex poly-
hedxa in 3d. While this prohleui is N.E-complete, we (Eig. 1). We explain how to obtain canonical separa-
tors, and how to construct, the set system. The portion
show a reduction to set cover. We then animate the
of the arrangement A of Ti(Q) on the boundary of id is
greedy method [4] and the weighted method [1].
vknalked (Eig. 2), and some rows of the set system are
then shown sequentially (Eig. 3), one corresponding to
each facet of this arraugement.
1 Introduction To explain the greedy method on this set system, an
approach which is proposed hy Mitchell and Suri [4], we
Let Q C R he two convex polyhedra in äid. The prob-
show how the choice of a facet removes a portion of the
lem, of finding a separating convex polyhedra hetween
boundary of £ (Eig. 4), and how the greedy method
R and Q with as tew facets as possible is believed to
proceeds sequentially hy choosing the facet which cod-
he Aid-hard [2], hut one tan find good approximations ers the higgest remaining portion (measured by the
for it. Mitchell and Snri [A] cast the problem, as a set
number of cells of A it separates from Q). After four
cover problem. Let H — 7i(Q) denote the set of snp-
iterations, we skip to the final greedy separator, which
porting hyperpianes of Q. Let the CüüCL sei aj/aiero he
has li facets, in general, the greedy separator is guar-
(H, {Hp : v £ dR}), where, tor any point p, Tip consists
anteed to have at most aapt log \Q\ facets, where a^t ^
of those hyperplanes in H for which p and Q lie on op-
the ske of an optimal canonical separator.
posite sides. They show that a hitting set for the coyer
Another algorithm is then animated, it is the
set system gives a subset of facets of Q whose support-
weighting method described hy Goodrich and the au-
ing halfkpaces define a poiytope whose houndary lies
thor in [1]. We show how putting a weight on the faces
between Q and R. of Q induces a weight for the cells of the arrangement
A poiytope QL between Q and R such that each A, and how keeping only the heavy cells yields a sep-
facet of Ql is supported hy a facet of Q is called cauaui- arator which is nothing else than a (l/2t;)-net for the
aiL The smallest (with respect to the number of facets) planes Ti{Q) supporting faces of Q (Eig. 5). We then
canonical poiytope contained in R can he ohtained from explain the reweighting strategy in this context. Even-
a minimal hitting set of this set system and is within 3 tually, a separator is found that has 13 facets (Eig. 6).
times the optimal separating polyhedron (in the num- In general, the weighted separator is guaranteed to have
ber of faces). Therefore, in this video, we just show 0(uapt) facets.
how to obtain an optimal canonical separator.

"Snppurted in pad hy NSE Grant CCa-93-Q12ä4, the Ge-


ometry Center., University ar Minnesota, an SIC funded hy
3 Implementation notes
NSE, DDE, and. Minnesota Technology Inc., and. Ecule Normale
Both algorithms are implemented and animated us-
Superienre u£ Earis.
ing GASH, a Geometric Animation System created
at Erinceton University hy Ayellet Tal and David
üohkin [3]. The implementation is written in C and
runs on a Silicon Graphics Iris workstation. The algo-
rithm is fully animated, in the sense that it produces an
animation for any given data R and Q. The data used
for the video were created with a random generator of

393
planes tangent ta toe sphere, then intersected to obtain
Q, which, was blown np tu yield R.

Acknowledgements
We would like to thank Ayeilet Tal and liayid Dohkin
tor the customized GASH environment and their iu-
yalnahie help. Thanks also go to Kirk Alexander and
Keyin Eerry, of inleractiye Coruputer Graphics Lab at
Erinceton Uniyersity and Mike Mills, of the Erinceton
Department of Media Services. Eignre 3: The row generated hy a particular ceil con-
sists of the facets of Q yisihle from that cell (highlighted
References iu the picture).

[1] H. Brünmmann and M. T. Güudrich. Almost optimal


set covers in finite YC-dimeiisiuii. 'These proceedings.
[2] G. Das. Appmximatiau schamaii. iu cnuiputatiaual yz-
amatry. Eh.D. thesis, University of Wisconsin, 19.ÜÜ.
[3] D. E. DühMn and. A. Tal. Gasp-a system to facilitate an-
imating geometric algorithms (Yideo). These proceed-
ings.
[4] T S. ii. Mitchell and S. Suri. Separation and approxi-
mation of polyhedral surfaces, in Ema. 3rd AC MSI A M
S^ympaa. lUsximta. Alyarithma, pages 2ÜÜ-ÜÜÜ, lüä'2.

Eignre 4: The greedy method chose the highlighted


facet on Q, thereby chopping off a few ceils on id.

BJgjUS« :::'■■

f •-■ ■^&'>s$J3z>l&
S
4^111i
ki flippy

Eignre 1: Shown here are the two nested polyhedra.

Eignre 5: The set of heawy cells on R. The cover for


those ceils is a (l/2c)-uet for the planes with weight, it
is shown highlighted on th boundary of Q.

Eignre 2: The arrangement üLH(Q) on the boundary Eignre 6: The weighted separator is shown in trans-
of R. Each ceil generates a row of the coyer set system. parency between R and Q.

394
Interactive Visualization of Weighted Three-dimensional Alpha Hulls

Amitabh Varshney Frederick P. Brooks, Jr. William V. Wright

Department of Computer Science


University of North Carolina at Chapel Hill
Chapel Hill, NC 27599-3175

Abstract weighted a-hulls for three dimensions and the smooth molec-
ular surface of a molecule with a probe-radius a have the
An interactive visualization of weighted three-dimensional same definitions. In this video we present the visualization
a-hulls is presented for static and dynamic spheres. The of weighted a-hulls as used to define molecular surfaces.
a-hull is analytically computed and represented by a tri-
angulated mesh. The entire surface is computed and dis- 2 Our Approach
played in real-time at interactive rates. The weighted three-
dimensional a-hulls are equivalent to smooth molecular sur- Computation of a-hulls and a-shapes has traditionally been
faces of biochemistry. Biochemistry applications of interac- done by first constructing power diagrams or regular tri-
tive computation and display of a-hulls or smooth molecular angulations. Since these methods involve computing the
surfaces are outlined. entire diagram or triangulation first and then culling away
the parts that are not required, their complexity is 0(n ) in
1 Introduction time, where n is the number of points. This is worst-case
optimal, since an a-shape in three dimensions could have a
The a-hull has been defined as a generalization of the con- complexity of 0(n2).
vex hull of point-sets by Edelsbrunner, Kirkpatrick, and Sei- However, when a-hulls are used as molecular surfaces,
del [4, 3]. Given a set of points P, a ball b of radius a is one can do better. Let M = {Si,..., Sn}, be a set of
defined as an empty a-ball if b n P = <f>. For 0 < a < oo, spheres, where each sphere, S,, is expressed as a pair (a, r;),
the a-hull of P is defined as the complement of the union c, being the center of the sphere and n being the radius of
of all empty a-balls [3]. It has been shown that it is pos- the sphere. Collections of spheres representing molecules
sible to compute the a-hull of a set of points P from the have two interesting properties: (i) the minimum distance
Voronoi diagram of P. For a = oo the a-hull over the set d,j between any two centers a and CJ is greater than or
of points P is the same as their convex hull. Edelsbrunner equal to a positive constant lmin — the smallest bond-length
and Mücke [5] have denned the a-shape over P to be the in the molecule and (ii) the values of all the radii can be
polytope that approximates the a-hull over P by replacing bounded from above and below by strictly positive values,
circular arcs of the a-hull by straight edges and spherical 0 < Tmi„ < Ti < Tmax- We take advantage of the first prop-
caps by triangles. An a-shape of a set of points P is a sub- erty to arrive at better running times for our algorithm.
set of the Delaunay triangulation of P. Edelsbrunner [3], Stated simply, the first property says that the number of
has extended the concept of a-shapes to deal with weighted neighboring atoms within a fixed distance from any atom
points (i.e. spheres with possibly unequal radii) in three di- i, is always bounded from above by a constant kmax that
mensions. An a-shape of a set of weighted points Pw is a depends on the minimum spacing between any two atoms.
subset of the regular triangulation of Pw. We refer to two atoms i and j as neighboring if it is possible
The smooth molecular surface of a molecule is defined as to place a probe sphere such that it is contact with both S;
the surface which an exterior probe-sphere touches as it is and Sj.
rolled over the spherical atoms of that molecule. This defini- A power cell (as described by Aurenhammer [1]) for a
tion of a molecular surface was first proposed by Richards [8]. given sphere Si with respect to M can be computed as the
This surface is useful in studying the structure and inter- intersection of n — 1 halfspaces, each halfspace contributed
actions of proteins, in particular for attacking the protein- by the pair (Si, Sj), 1 < j < n,j^ i. If the average number
substrate docking problem. The analytic computation of of neighbors for an atom is k, then for our purposes it is suf-
the molecular surface was first done by Connolly [2]. ficient to just compute an approximation to the power cell,
Looking at the above definitions, one can see that the which we call a feasible cell, as an intersection of k halfspaces
(one halfspace contributed by each neighbor). This can be
done in deterministic time 0(Mog k). For n atoms, this task
can be parallelized over n processors, each processor com-
puting the feasible cell for one atom. To check if a feasible
cell is non-null, we use a randomized linear programming
algorithm that has linear expected time complexity and is
quite fast in practice [9]. For details of our approach the
interested reader can refer to [10].

395
We have used ideas from the theory of packing and cover- and David C. Richardson during various stages of this work.
ing of spheres to estimate the value for k, the average num- We would also like to acknowledge Michael E. Pique and
ber of neighboring atoms, for an atom in protein molecules. Victoria Roberts at the Scripps Clinic for the molecular dy-
We can prove that for proteins, k < 140 for a probe-sphere namics data. We would like to thank the anonymous ref-
radius of 1.4Ä - the radius of a water molecule. Details erees for their suggestions which have led to improvements
about this result can be found in [11]. In practice we have in the presentation of this extended abstract as well as the
found that for protein molecules and for a probe-radius of video. This work was supported by NIH National Center
1.4Ä, k is around 45 for Research Resources grant number 5-P41-RR02170.
In the algorithms for computing the convex hull of a set
of points, it is assumed that the points are in a general po- References
sition, i.e. no more than d points lie on the same d — 1
dimensional hyperplane. In reality this assumption often [1] F. Aurenhammer. Power diagrams: Properties, algo-
fails to hold, leading to problems. For example, planar ben- rithms and applications. SIAM Journal of Computing,
zene rings occur often in proteins, causing six carbon and 16(l):78-96, 1987.
six hydrogen atoms to be all coplanar. One of the recent
approaches to solving this problem has been to perturb the [2] M. L. Connolly. Analytical molecular surface calcula-
input point set slightly to avoid these degeneracies. The ap- tion. Journal of Applied Crystallography, 16:548-558,
proach of Emiris and Canny [6] perturbs the jth dimension 1983.
of the ith point as:
[3] H. Edelsbrunner. Weighted alpha shapes. Technical Re-
€ = e J m port UIUCDCS-R-92-1740, Department of Computer
P*,j( ) Pi,j + (i °d ?)1 < * < ra, 1 < .;' < <f (1)
Science, University of Illinois at Urbana-Champaign,
where e is a symbolic infinitesimal and q is the smallest 1992.
prime greater than n. Instead of performing exact integer [4] H. Edelsbrunner, D. G. Kirkpatrick, and R. Seidel. On
arithmetic, we just perturb the centers of the spheres by
the shape of a set of points in the plane. IEEE Transac-
the above scheme and that has worked quite well for us in
tions on Information Theory, IT-29(4):551-559, 1983.
practice.
With no preprocessing, we can compute the molecular [5] H. Edelsbrunner and E. P. M"ucke. Three-dimensional
surface for a 396 atom Crambin and a probe-radius of 1.4A, alpha shapes. ACM Transactions on Graphics, 13(1),
using 40 Intel i860 processors in 0.2 seconds. We have imple- 1994.
mented a-hulls on Pixel-Planes 5 [7], though the method is
general enough to be easily implemented on any other par- [6] I. Emiris and J. Canny. An efficient approach to remov-
allel architecture. Our approach is analytically exact. The ing geometric degeneracies. In Eighth Annual Sympo-
only approximation is the degree of tessellation of spherical sium on Computational Geometry, pages 74-82, Berlin,
and toroidal patches. Germany, June 1992. ACM Press.
[7] H. Fuchs, J. Poulton, J. Eyles, T. Greer, J. Gold-
3 Applications in Biochemistry feather, D. Ellsworth, S. Molnar, G. Turk, B. Tebbs,
and L. Israel. Pixel-planes 5: A heterogeneous mul-
Interactive computation and display of molecular surfaces tiprocessor graphics system using processor-enhanced
should benefit biochemists in three important ways. First, memories. In Computer Graphics: Proceedings of SIG-
the ability to change the probe-radius interactively helps one GRAPH'89, volume 23, No. 3, pages 79-88. ACM SIG-
study the surface. Second, it helps in visualizing the chang- GRAPH, 1989.
ing surface of a molecule as its atom positions are changed.
These changes in atom positions could be due to user-defined [8] F. M. Richards. Areas, volumes, packing and pro-
forces as the user attempts to modify a molecular model on tein structure. Ann. Rev. Biophys. Bioengg., 6:151-176,
a computer. Third, it assists in incorporating the effects of 1977.
the solvent into the overall potential energy computations
during the interactive modifications of a molecule on a com- [9] R. Seidel. Linear programming and convex hulls made
puter. easy. In Sixth Annual ACM Symposium on Computa-
tional Geometry, pages 211-215, Berkeley, California,
June 1990. ACM Press.
4 Scope for further work
[10] A. Varshney and F. P. Brooks, Jr. Fast analytical com-
At present we are not using any incremental temporal in- putation of Richards's smooth molecular surface. In
formation in constructing these surfaces. Thus, if the atoms G. M. Nielson and D. Bergeron, editors, IEEE Visual-
move slightly from their positions, the whole surface is re- ization '93 Proceedings, pages 300-307, October 1993.
computed from the beginning, although one could conceiv-
ably store the feasible cell description with each atom. As- [11] A. Varshney, W. V. Wright, and F. P. Brooks, Jr.
suming the atoms of the molecule move along continuous Bounding the number of unit spheres inside a larger
trajectories, it should be possible to compute such surfaces sphere. Technical Report UNC-CS-TR-93-039, Depart-
(and indeed a-hulls and a-shapes) incrementally and effi- ment of Computer Science, University of North Car-
ciently by using the information from previous time steps. olina at Chapel Hill, 1993.

Acknowledgements

We would like to acknowledge the valuable discussions we


had with Pankaj K. Agarwal, Dinesh Manocha, Jan F. Prins,

396
Index Mitchell, J. 103, 359
Mitchell, S. 221
Agarwal, P. 67, 76, 348 Mount, D. 359
Aichholzer, 0. 85 Narasimhan, G. 132, 259
Alt, H. 85 Orletzky, M. 103
Amenta, N. 340 Overmars, M. 31, 113
Aronov, B. 21, 348 Pach, J. 198
Atallah, M. 150 Pollack, R. 192
Barequet, G. 93 Ponamgi, M. 391
Bern, M. 221 Rajasekaran, S. 57
Böse, P. 123 Ramaiyer, K. 150
Bremner, D. 123 Ramaswami, S. 57
Brooks, F. 395 Robins, G. 250
Brönnimann, H. 293, 393 Rote, G. 85
Chazelle, B. 231 Ruppert, J. 221
Choi, J. 41 Salowe, J. 250
Clarkson, K. 160 Schwarzkopf, O. 67, 76
Cohen, J. 391 Seilen, J. 41
Das, G. 132, 259 Shah, N. 285
Datta, A. 175 Shahrokhi, F. 198
De Berg, M. 1, 67 Sharir, M. 11, 21, 93, 348
Dey, T. 277 Shouraboura, N. 231
Dickerson, M. 211 Smid, M. 165, 369, 387
Dobkin, D. 385, 388 Snoeyink, J. 383
Drysdale, R. 211 Suri, S. 359
Du, D-Z. 183 Szegedy, M. 198
Eades, P. 49 Tal, A. 388
Edelsbrunner, H. 203, 285 Tan, T-S. 240
Gao, B. 183 Upson, L. 390
Goodman, J. 192 Valtr, P. 203
Goodrich, M. 103, 150, 293, 322 Van Der Stappen, A. F. 31
Graham, R. 183 Van Kreveld, M. 123
Guibas, L. 1, 267 Varshney, A. 395
Gunopulos, D. 385 Welzl, E. 203, 211
Gupta, P. 369 Wenger, R. 192
Halperin, D. 1, 11, 113 Whitesides, S. 49
Hershberger, J. 267, 383 Wright, W. 395
Icking, C. 175 Yap. C. 41
Imai, H. 332
Inaba, M. 332
Janardan, R. 369
Jaromczyk, J. 303
Kapoor, S. 140, 165
Katoh, N. 332
Kowaluk, M. 303
Lenhof, H-P. 387
Lin, M. 391
Manocha, D. 391
Mariano, A. 390
Matousek, J. 67, 76, 312
McElfresh, S. 211

397

You might also like