On Degeneracy in Geometric Computations*
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 3 On Degeneracy in Geometric Computations* Christoph Burnikelt Kurt Mehlhornt S tefan Schirrat Abstract solves P and z is a degenerate problem instance The main goal of this paper is to argue against the then x is also degenerate for A. Typical cases belief that perturbation is a “theoretical paradise” and of degeneracy are four cocircular points, three to put forward the claim that it is simpler (in terms collinear points, or two points with the same x- of programming effort) and more efficient (in terms of coordinate. Degeneracy is considered to be a running time) to avoid the perturbation technique and curse in geometric computations. It is common to deal directly with degenerate inputs. We substantiate belief that the requirement to handle degenerate our claim on two basic problems in computational geometry, the line segment intersection problem and the inputs leads to difficult and boring case analyses, convex hull problem. complicates algorithms, and produces cluttered code. 1 Introduction. Fortunately, there is a general technique for Following Emiris and Canny [EC921 we view a coping with degeneracies: the perturbation tech- geometric problem P as a function from IRnd to nique introduced by Edelsbrunner and Miicke S x IR,“, where n, m, and d are integers and S is [EM901 and later refined by Yap [YapSO] and some discrete space, modelling the symbolic part of Emiris and Canny [EC92]. In this technique, the the output (e.g., a planar graph or a face incidence input is perturbed symbolically, e.g., Emiris and lattice). A problem instance z E lRnd, which for Canny propose to replace the j-th coordinate ~;j concreteness we view as n points in d-dimensional of the i-th input point by x;j + E . ii, where E is a space, is called degenerate if P is discontinuous positive infinitesimal, and the computation2 is car- at 2. For example, if d = 2 and P(z) is the ried out on the perturbed input (all intermediate Voronoi diagram of Z, i.e., a straight-line planar results are now polynomials in E). It can be shown graph together with coordinates for its vertices, that the Emiris and Canny scheme removes many then 2 is degenerate iff z contains four cocircular geometric degeneracies, e.g., collinearity of three points. A geometric algorithm can be viewed as points, at only a constant factor increase in run- a decision tree where the decision nodes test the ning time. The same statement holds for the other sign (+, -, or 0) of some function (usually a low perturbation schemes, although with a larger con- degree polynomial) of the input variables. An stant of proportionality. So perturbation seems to instance x is called degenerate with respect to some be the perfect solution for the problem of degen- algorithm A if the computation of A on input x eracy. As Yap [YapSO] puts it: the perturbation contains a test with outcome zero. Clearly’, if A technique is “the theoretical paradise in which de- generacies are abolished”. *This work was supported by the ESPRIT Basic Research The main goal of this paper is to argue against Actions Program under contract No. 7141 (project Alcom II) this belief and to put forward the claim that it is and by the BMFT (F&derungskenmeichen ITS 9103). simpler (in terms of programming effort) and more tMax-Planck-Institut fiir Informatik, Im Stadtwald, 66123 efficient (in terms of running time) to avoid the Saarbriicken, Germany perturbation technique and to deal directly with tMax-Plan&-Institut fiir Informatik, Im Stadtwald, 66123 Saarbticken, Germany and Fachbereich Lnformatik, Universitlt des Saarlandes 2throughout this paper we assume that all computations are 1 this assumes all tests to be continuous functions of the inputs carried out exactly. 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, R; = {XI . ., xi} and let conv R; be the 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.