Professional Documents
Culture Documents
Degeneracy Geometry
Degeneracy Geometry
16
ON DEGENERACY IN GEOMETRIC COMPUTATIONS 17
degenerate inputs. Our argument rests on the folklore for the plane sweep algorithm, was shown
following three observations: by Seidel [SeiSl] for the randomized incremental
l On degenerate inputs the perturbation algorithm, and is a new result for the optimal de-
schemes may incur an arbitrary overhead in terministic algorithm, cf. Section 3.
running time. In the conwez hull problem, the input is a multi-
set S of n points in IRd and the output is their con-
l The complexity of the postprocessing required vex hull, e.g., represented through its set of facets
to retrieve the answer P(z) for a degenerate and their incidence graph. Consider first an in-
input z from the answer P(z(E)) to the per- stance which consists of n copies of the same point,
turbed input Z(E) is significant. say Xij = 0 for all i and j with 1 5 i 5 n and
l For many geometric problems algorithms han- 1 5 j 5 n. The Emiris and Canny perturbation
dling degeneracies directly are only moder- scheme changes these coordinates into xij = E . ij,
ately more complex than algorithms assuming i.e., the perturbed input consists of n points on the
non-degenerate inputs. moment curve [Ede87, Section 6.2.11. The resulting
Before we substantiate these observations we hull is a monster; it has nldi21 facets and it takes
want to remark that degenerate inputs arise fre- at least that long to compute it. The algorithm
quently in practice. For example, 100 points with of this paper runs in time O(n). We admit that
integer coordinates between 0 and 1023, i.e., 100 a simple preprocessing step will catch this input.
pixels on a standard screen, are very likely to con- The following example escapes simple preprocess-
tain three collinear points. ing techniques. Assume that the input consists of
To substantiate the first claim let us consider the corners of a triangle and n - 3 additional points
two basic problems in computational geometry, the which lie on one of the sides of the triangle. Per-
line segment intersection problem and the convex turbation may turn the convex hull into an n-gon.
hull problem. Perturbation combined with any of the standard
In the line segment intersection problem the in- hull algorithms (Graham scan, plane sweep, divide-
put consists of n line segments in the plane, i.e., a and-conquer, randomized incremental) leads to a
point in lR4n, and the output is the planar graph running time of Q(nlogn). The algorithm of this
whose vertices are the endpoints and the crossings paper runs in time O(n). More generally, we will
of the segments and whose edges are the subseg- show in Section 2 that the running time of our al-
ments induced by the vertices. Alternatively, we gorithm is determined by the structural complexity
may want to compute a triangulation of this pla- of the convex hull of S (and random subsets of S).
nar graph or the related trapezoidal diagram. We Algorithms with structure-sensitive running time
use m to denote the number of vertices of this pla- were previously only known for non-degenerate in-
nar graph and s to denote the number of pairs of puts: gift-wrapping [CK70], the algorithm of Sei-
intersecting segments. Note that s might be as de1 [Sei86], and the randomized incremental algo-
large as m2, e.g., if all segments pass through the rithms [CS89,BDS+92,CMS93] work in time IF] en,
origin. The perturbation technique yields running IF] *log n, and expected time IFI respectively, where
timeO(( n + s )l o g n ) w h en combined with Bentley- F is the number of facets of conv 5’. Our algorithm
Ottmann plane-sweep, and time O(s + nlog n) is a modification of [CMS93].
when combined with the randomized incremen- Let us now turn to our second claim: perturba-
tal algorithms of Clarkson and Shor, Mulmuley, tion requires non-trivial postprocessing. Let x be
Boissonnat et al, or Seidel [CS89,Mu189,BDS+92, a problem instance of a geometric problem P. Per-
SeiSl], or the optimal deterministic algorithm of turbation computes P(x(E)) instead of P(x) where
Chazelle and Edelsbrunner [CE92]. On the other E is an infinitesimal. For degenerate inputs z the
hand there are variants of these algorithms han- mapping x H P(x) is non-continuous at x and
dling degeneracies directly and running in time therefore we can in general not obtain P(x) as the
O(mlogn) and O(m+nlogn) respectively. This is limit of P(x(E)) as E goes to zero. Rather we should
18 BURNIKEL ET AL.
expect some non-trivial changes in the symbolic Xl.. . . ., xi} and let conv R; be the
xi, R; = {XI
part of the output. Let us be more concrete. In convex hull of the’ points in R;. Let d = dimR
the line segment intersection problem we may have be the dimension of the convex hull of R and
the endpoint of some segment lying in the relative let DJ = {x~~,x~~,. . . ,~j~+~} with 1 < jr 5
interior of some other segment. Perturbation may . . . 5 j, 5 n be the set of dimension jumps
remove the point of intersection. This intersection where Xk is called a dimension jump if dimRk-i <
is hard to retrieve from the perturbed output. Hard dimRk. Clearly, ji = 1. In the incremental
here means hard compared to the simplicity of the construction of conv R we maintain a triangulation
plane sweep intersection algorithm. In the case of A(n;) of conv R;: a simplical complex whose union
the convex hull problem the limit process is also is conv R; (a simplical complex is a collection of
non-trivial, one needs to remove empty facets and simplices such that the intersection of any two is
identify some ridges. A small variation of the prob- a face of both). The vertices of the simplices in
lem - compute all points contained in the boundary A(7r;) are points in R;. The triangulation A(r;)
of the hull - makes the limit process very difficult. induces a triangulation CH(r;) of the boundary of
In summary, we may state that the perturbation conv R;: it consists of all facets of A(n;) which are
technique entails complex postprocessing. incident to only one simplex of a(~,). If x E aff Ri
With respect to the third claim we observe that then a facet F of CH(n;) is called visible from 2
the algorithms presented in this paper are modifi- or x-visible (we also say: x can see the facet) if x
cations of algorithms designed for non-degenerate does not lie in the closed halfspace of aff Ri that is
inputs. We can also offer some experimental supported by F and contains conv R;.
evidence. The LEDA-implementation [Nah93b, The triangulation A consists of the single
Nah93a] of the plane sweep algorithm for line seg- simplex {xi}. For i 2 2, the triangulation A(ni)
ment intersection has 581 lines of code out of which is obtained from A(n;-1) as follows. If 2; is a
about 100 deal with degeneracies (vertical seg- dimension jump, i.e., x; 4 aff R;-1, then x; is
ments and high-degree intersections). For our con- added to the vertex set of every simplex of A(ni-1).
vex hull algorithm (without deletion) the LEDA- If xi is not a dimension jump then a simplex
implementation by Michael Miiller and Joachim S(F U {xi}) = conv(F U {Xi}) is added for every
Ziegler [MZ93] has 1124 lines of code. Out of this xi-visible facet of CH(?ri-1). Figure 1 gives an
134 lines deal with degeneracies. example. For a simplex S let vert(S) denote the
set of vertices that define this simplex. It is clear
2 Convex Hull Maintenance. that A(n) contains a simplex whose vertex set is
We show how to maintain convex hulls in arbi- precisely the set of dimension jumps. We call this
trary dimension without any non-degeneracy as- simplex the origin simplex of A(a). For every
sumption. Our solution is a minor3 modification simplex S (besides the origin simplex) we call the
of the randomized incremental algorithm of Clark- vertex in vert(S)- DJ, that has been inserted last,
son, Mehlhorn, and Seidel [CMS93]. Its expected the pealcof S and the facet of S opposite to the peak
running time is structure-sensitive. the base facet of S.
We will first describe our data structure for The triangulation A(n) does not change if the
maintaining convex hulls. Insertions and deletions dimension jumps are inserted first. More precisely,
are then treated in Sections 2.1 and 2.2 respec- for T c R let 7r \ T denote the insertion order
tively. with the elements in T removed, e.g., ‘IT\ {x;} =
Let R = {XI,. . . , z,} be the multi-set of points x1 . . .Xi-lXi+1 ee+X,.
whose convex hull has to be maintained and let LEMMA 2.1. Let DJ = {xjl, . . . , xj,,,} be the
7r = Xl...X, be the insertion order. Let xi = set of dimension jumps, 1 = jr < jz < . . . < jd+r 5
n. Then
3Recall that one of our claims is precisely that many algorithms
require only minor modifications
A(n) = A(xjlxj, . . . zj,+, r \ DJ).
ON DEGENERACY IN GEOMETRIC COMPUTATIONS 19
2.1 Insertions.
We give additional details of the insertion process.
Consider the addition of the i-th point 2 = x;,
i 1 2. First decide whether 2 is a dimension jump
(an O(d3) test). If 2 is a dimension jump then add
x; to I(S) for every simplex of i%(n;-r ) and add
the simplex S(FU {n}) to s(,;) for every bounded
simplex F of h(r;-r ).
LEMMA 2.4. If x; is a dimension jump then
Figure 1: A triangulation. The dimension jumps
are points x1, x2, and ~5. l~(~)l = Ii&-~>l + IA(T-I)I
and h(n;) can be constructed from h(r;-1) in time
This is an immediate consequence of O(d”l+-111).
LEMMA 2.2. Let y be a dimension jump, i.e., If 5; is not a dimension jump then we proceed
y $8aff Rk. Then as described in [CMS93]. We first compute all
xi-visible facets F of CH(r;-r) and then update
A(nk-GW/) = .+/4/a).
the extended triangulation h as follows: For each
The triangulation CH(r) induces a triangula- xi-visible facet F of CH(r;-r) (3 xi-visible base
tion of every facet F of the convex hull of R. This facet of an unbounded simplex in i%(~;-1)) we
triangulation depends only on the insertion order alter the simplex S(F U {D}) of h(r;-r) into
of the points in R n aff F. S(Fu{x;}). M oreover, for each new hull facet F E
LEMMA 2.3. Let F be a facet of conv R and CH(ni) \ CH(T-I) we add the unbounded simplex
let RF = {x E R; x E aff F}. Furthermore, let S(Fu{a}). I n o th er words, for each horizon ridge
rF = w \ (R - RF). Then f of CH(vl), i.e., ridge where exactly one of the
incident facets is xi-visible, we add the simplex
A(rF) = {G E CH(7r); G E aff F}. S(f u {x;,o)). Th e set of xi-visible facets F
of CH(r;-I) can be found by visiting simplices
It is convenient to extend A(n) to a triangu-
according to the rule: Starting at the origin simplex
lation h(n) by also making the facets of CH(7r)
visit any neighbor of a visited simplex that has an
the base facet of some simplex: z(r) is obtained
xi-visible base facet.
from A(n) by adding a simplex S(F U (8)) with
LEMMA 2.5. If x; is not a dimension jump
base facet F and peak a for every facet F of
then the time to add x; is O(d2) times the number
CH(r). Here D is a fictitious point without ge-
ometric meaning. We propose to store h(n) as of simplices in a(~;-1) with x;-visible base facet
the set of its simplices together with some addi- plus O(d3) times the number of altered and new
tional information: For each simplex S E n(n) we simplices.
store its set of vertices, the equation of its base We next turn to the analysis of the insertion
facet normalized such that the peak lies in the pos- algorithm. Let T(R) (T(R)) denote the expected5
itive halfspace, and for each simplex S and vertex number of (bounded) simplices in the extended tri-
z E vert(S) we store the other simplex sharing the angulation of R and let U(R) denote the expected
facet with vertex set vert(S) \ {x}. We also store -
*A simplex is called bounded if 0 does not belong to its vertex
a pointer to the origin simplex and a suitable rep- set and it is called unbounded otherwise.
resentation of aff R, e.g., a maximal set of affinely 5all expectationsare computed with respect to the n! insertion
independent points. The simplical complex a(nr) orders
20 BURNIKEL ET AL.
number of simplices incident to the point inserted it a bit. The expected time for the n-th insertion
first. For R’ C R and z E R’ let H(R’,x) be the is O(d2h,/n + d3U(R)) according to item 4. The
set of horizon ridges of conv R’ \ 2 with respect to first term accounts for the time to construct new
Z, i.e., the set of ridges of conv R’ \ z with exactly hull facets and the second term accounts for the
one incident z-visible facet. Finally, say that a set time to search visible hu’ll facets. If R is in quasi-
R is in quasi-general position if any d points of R general position then hk/k is simply the expected
have dimension d - 1 where d = dimR (however, size of the horizon for a random subset R’ C_ R of
a hyperplane may contain an arbitrary number of size k and a random point z E R’ times a factor
points of R). that accounts for later dimension jumps. Moreover,
LEMMA 2.6. Let n = IR/ and d = dimR. U(R) is also determined by the hk’s. As a concrete
f. If dimR = 0 then F(R) = 2 and T(R) = example, assume hk/k 2 k’ for some positive E and
U(R) = 1. all k. Then ?;(R) = nr+‘, U(R) = nE and the ex-
pected cost of the k-th insertion is O(k”). If R is
2. Zf dimR > 1 then T(R) 5 T(R) 2 2 * 2d + not in quasi-general position then the running time
c 2<k<n hk/k J where depends also on the structural properties of lower
dimensional faces.
We close with a comparison with perturbation
hk= 6 RFR2d--dimR’x c T(R’naff r) methods.
NR’TEH(R’,X) LEMMA 2.7. 1. For every n and d there is
IR’Fk
an example where the algorithm above runs in
3. The expected time for the n-th insertion is linear time but the Emiris and Canny scheme
O(d2h,/n + d3U(R)). produces a hull with IR(nLd/2J ) facets.
S(zl), and let P(zl) be the set of vertices that are paragraph describes reinsertion of a dimension
opposite6 to 21. jump.
The global plan is as follows: Let 2; be the Let us first consider reinsertion of xk, where
point to be deleted. First of all, we check whether xk is not a new dimension jump. A facet F E
z; E DJ. Then we delete all simplices in H(X) \ CH(vc-I \ xi) is called new if it is not constructed
ii(~ \ {x;}). N ex t we basically reinsert the points in A(rk-1). We have
zk, k > i, thereby creating the simplices in x(a \ LEMMA 2.9. Let F be a facet ofCH(nk-r \x;).
{z;}) \n(~) according to the insertion order. Dur- If dim(Rk \ {x;}) = dim(&-r \ {x;}) we have
ing the reinsertion process different strategies apply S(F,xk) E A(nk \ {xi}) - A(Q) if and only if F
to dimension jumps and non-dimension-jumps. is xk-visible and either F is xi-visible or F is new
The simplices to be deleted are exactly the and xi E aff F.
simplices in S(z;). Hence it is not necessary to reinsert points that
LEMMA 2.8. Let 5’ be a simplex in h(n). S # are not in R(x;). We assume inductively that we
h(7r \ {xi}) if and only if S E S(xi) . have A(nk-r \ {xi}) and A(w \ (2;)) fl A(n) and
If 5; was a dimension jump we have either the set B&r of facets of CH(nk-r \x;), that are x;-
dim(R \ {x;}) = dimR - 1 or we get a new visible or contain x; in their affine hull and are new.
dimension jump, say xj. Deletion of s; reduces If x; e DJ, B; is the collection of facets opposite
dimension if all other points lie in aff(DJ \ {xi}). to x; in the simplices in S;(x;). Reinsertion of
If P(z;) = 0 and aff(R(z;) \ {x;}) = aff(OJ \ {z;}) xk means to add a simplex S(F, xk) for every xk-
then 5; reduces dimension. We simply remove all visible facet F of B&r. The procedure for finding
unbounded simplices that do not have Z; in their xk-visible facets of Bk-r is analogous to [CMS93].
vertex set and remove 5; from the vertex set of Let us finally consider reinsertion of a new
the remaining simplices. Otherwise we get a new dimension jump zj. Since a new dimension jump
dimension jump xi where is reinserted first we can assume j = i + 1 wlog. If
xi and x;+i are on the same side of aff(D J \ {xi}),
j = min{k; zk E R(x;)lJP(z;), cck fi? aff(DJ\{z;})}. then we take the simplices in S;(x;), replace x; by
s;+r and add them to A. B;+l is the collection
By Lemma 2.1 dimension jumps can be moved of facets on the boundary of the union of these
to the front of the insertion order. Hence we have simplices that are not opposite to x;+i. If x; and
x;+i are on different sides of aff( D J \ {xi}), no
A@ \ {xi>> = A(aa \ ({xi) u DJ)) simplices are added. Here B;+l is the collection of
if x; # DJ and facets opposite to x; in the simplices in S;+r(x;).
in [CE92, capsule 121; high degree vertices re- [CS89] K. L. Clarkson and P. W. Shor. Appli-
quire only minor adaptions. The total time for cations of random sampling in computational
computing companions is O(n + m). geometry, II. Discrete and Computational Ge-
ometry, 4:387-421, 1989.
4. We finally insert the fragments starting at the
[EC921 Ionnais Emiris and John Canny. An effi-
sweep line into the web. Consider any frag-
cient approach to removing geometric degen-
ment p starting at the sweep line. When we
eracies. In Proc. of the 8th Symp. on Compu-
follow p through the web we split regions as we
tational Geometry, pages 74-82, 1992.
go along. The first region to be split is given
[Ede87] H. Edelsbrunner. Algorithms in Combina-
by companion(p). Whenever a region is left,
torial Geometry. Springer Berlin-Heidelberg,
say through vertex V, the region to be entered
1987.
is readily determined by inspecting the edges
[EM901 H. Edelsbrunner and E.P. Miicke. Simula-
adjacent to p at D. Note that the insertion
tion of simplicity: A technique to cope with
order guarantees that only segments passing
degenerate cases in geometric algorithms.
through v have been encountered so far and so
ACM Trans. Graphics, 9(1):67-104, 1990.
the proper association between incoming and
[HMRT86] K. Hoffmann, K. Mehlhorn, P. Rosen-
outgoing edges is easily maintained. The edges
stiehl, and R. Tarjan. Sorting Jordan se-
of each region are stored in a finger search tree
quences in linear time using level-linked search
[HMRT86]. This data structure allows a re-
trees. Information and Control, 68:170-184,
gion to be split in amortized time O(1). Our
1986.
amortization argument is more complex than
[Mu1891 K. Mulmuley. A fast planar partition algo-
the one used in [CE92, capsules 4 and 51 as
rithm II. Proc. 5th Symp. on Computational
we cannot use their argument for terminating
Geometry, pages 33-43, 1989.
regions (capsule 5); it is however in the same
[MZ93] M. M ii 11er and J. Ziegler. An implementa-
spirit. The total time for traversing regions is
tion of a convex hull algorithm. manuscript,
O(n + m).
1993.
In summary we have shown how to solve the
[Nah93a] St. Naher. personal communication,
line segment intersection problem in time O(m +
1993.
n log n).
[Nah93b] St. Naher. LEDA Manual. Max-Planck-
References Institut fiir Informatik, 1993.
[BDS+92] J.D. B oissonnat, 0. Devillers, R. Schott, [Sei86] R. Seidel. C onstructing higher dimensional
M. Teillaud, and M. Yvinec. Applications convex hulls at logarithmic cost per face.
of random sampling to on-line algorithms in Proc. of the 18th Symp. on Theory of Com-
computational geometry. Discrete and Com- puting, 1986.
putational Geometry, 8:51-71, 1992. [SeiSl] R. Seidel. Backwards analysis of random-
[CE92] B. Ch aze11e and H. Edelsbrunner. An op- ized geometric algorithms. ALCOM Summer-
timal algorithm for intersecting line segments school on efficient algorithms design, Arhus,
in the plane. Journal of the ACM, 39:1-54, Denmark, 1991.
1992. [YapSO] C. K. Yap. Symbolic treatment of ge-
[CK70] D.R. Chand and S.S. Kapur. An algorithm ometric degeneracies. J. Symbolic Comput.,
for convex polytopes. Journal of the ACM, 10:349-370,199o.
17:78-86, 1970.
[CMS93] Kenneth L. Clarkson, Kurt Mehlhorn,
and Raimund Seidel. Four results on ran-
domized incremental constructions. Compu-
tational Geometry: Theory and Applications,
3(4):185-212,1993.