
Simulation of Simplicity A Technique to Cop e with Degenerate Cases 1 in Geometric Algorithms Herb ert Edelsbrunner and Ernst Peter Muc ke Abstract This pap er describ es a generalpurp ose programming technique called the Simulation of Simplicity which can b e used to cop e with degenerate input data for geometric algorithms It relieves the programmer from the task to provide a consistent treatment for every single sp ecial case that can o ccur The programs that use the technique tend to b e considerably smaller and more robust than those that do not use it We b elieve that this technique will b ecome a standard to ol in writing geometric software Keywords Computational geometry degenerate data implementation programming to ol p erturbation determinants symb olic computation ACM Transactions on Graphics 1 Research of b oth authors was supp orted by Amo co Foundation Faculty Development Grant CS It was partially carried out while b oth authors were with the Institutes for Information Pro cessing at the Technical University of Graz Austria The rst author also acknowledges supp ort by the National Science Foundation under grant CCR 2 Department of Computer Science University of Illinois at UrbanaChampaign West Springeld Avenue Urbana Illinois USA Simulation of Simplicity Intro duction This pap er intro duces a general technique that can b e used to cop e with degenerate cases encoun tered by computer programs Consider for example a program that sorts an array of integers using a comparison as a primitive op eration A sp ecial or degenerate case o ccurs when the pro gram attempts to decide which one of two equal numb ers is smaller than the other A typical way to resolve this tie is to pretend that the numb er with smaller index is smaller assuming the integers are indexed eg by their p ositions in an array Or think of Kruskals algorithm for constructing a minimum spanning tree of a weighted graph see AHU At each step it cho oses the shortest edge that can b e added to the current collection of edges without creating a cycle If this edge is not unique then any one of the candidate edges is taken The thus generated minimum spanning tree is therefore not unique unless we sp ecify deterministic rules to break ties In b oth problems sorting and constructing minimum spanning trees the sp ecial cases are easily dealt with partly b ecause the ties can b e broken arbitrarily without creating inconsistencies The situation is usually far more complicated for geometric problems Consider for example the following seemingly straightforward algorithm for the p ointinp olygon problem which is sometimes called the Parity Algorithm Let r b e the horizontal halfline whose left endp oint is the test p oint Count the numb er of intersections b etween r and the edges of the p olygon If that numb er is o dd then the test p oint lies within the p olygon and if the numb er is even then it lies outside the p olygon As p ointed out in Fo it is not a trivial matter to implement this algorithm even if we assume that the test p oint do es not lie on the b oundary of the p olygon There are only two nondegenerate cases Either the intersection b etween r and an edge e is empty or r crosses e see Figure I a and b There are however four degenerate cases as illustrated in Figure I c through f that have to b e taken into account a b c d e f Figure I The dierent cases in the Parity Algorithm A correct answer is obtained if cases c and e are counted as one crossing and cases d and f are not counted at all If we write the co de for the ab ove algorithm we realize that a substantial amount of the eort is required to cover the four degenerated cases Observe also that there are several seemingly plausible ways to treat the degenerate cases and that some of them lead to incorrect algorithms We app eal to the imagination of the reader to envision the bizarre structure of degenerate cases one encounters in generalizing the p ointinp olygon problem to three or higher dimensions Another problem with a set of degenerate cases that is considerably richer than the Simulation of Simplicity one of the p ointinp olygon problem is obtained if one intersects a p olygon with a geometric ob ject that is more complicated than a halfline When it comes to implementing geometric algorithms degenerate cases are very costly in partic ular if there are many such cases that have to b e distinguished This is caused by the p ositive correlation b etween the numb er of degenerate cases and a variety of factors that contribute to the overall cost of a piece of software These factors include the length of the program which for itself correlates p ositively with the amount of time required to write it to debug it and to maintain it Of course the degree of robustness of the program decreases with increasing complication The correctness of a program relies on the consistent treatment of all dierent cases In this context it is worthwhile to mention that more ecient algorithms tend to b e more complicated and also more sensible to slight inconsistencies in treating degenerate cases This pap er presents a general technique called Simulation of Simplicity SoS that can b e used to cop e with the problems mentioned ab ove Intuitively it simulates a conceptual p erturbation of the input data that eliminates all degeneracies We hasten to mention that the p erturbation is never ever computed it is assumed to b e arbitrarily small although not vanishing which is enough to simulate the nondegenerate top ology Another interpretation of the technique views it as a general way to break ties consistently The tiebreaking part of the co de app ears in the lowest level of the algorithm namely in the pro cedures that implement the needed primitive op erations Dierent techniques following the same main approach have recently b een suggested in Ya Ya A large part of this pap er is devoted to demonstrating that the overhead in time caused by the use of the more elab orate primitive pro cedures required by SoS is negligible The outline of this pap er is as follows Section presents the general idea of the technique and works out some guidelines needed to implement it eectively Section considers a class of problems for nite p oint sets that can b e solved using a common set of geometric primitives It also discusses how the p erturbation inuences the geometric primitives Section demonstrates ecient implementations of the primitive op erations In Section we show that the geometric primitives intro duced for p oint set problems can b e used to solve a variety of other problems dened for p olygons hyp erplanes circles spheres and other geometric ob jects Finally in Section we discuss the p erturbation technique and its limitations SoS the General Idea Degeneracies o ccur with probability zero if we draw a nite numb er of geometric ob jects each represented by a nite set of numb ers from the innite set of all such ob jects provided there is no b ound on the precision of the numb ers used In reallife computing this is not the case that is there is only a nite set of available numb ers and thus a b ound on the precision that can b e achieved As a consequence we are do omed to work with degenerate data On the other hand even innite precision do es not guarantee the nonexistence of degeneracies This section gives the general outline of a technique called the Simulation of Simplicity SoS we use simple as a synonym for nondegenerate which allows us to neglect degeneracies when we write programs A similar but less elab orate metho d has b een used to solve degenerate linear programs This leads to the implementation of the simplex algorithm referred to as the lexicographical metho d see Ch DOW Da or Ch for details In computational geometry this technique has b een used in a couple of pap ers including Ed and EW to avoid the otherwise necessary Simulation of Simplicity discussion of degenerate cases This pap er presents the theoretical foundations of SoS as well as details of its implementation The basic idea of SoS is to p erturb the given ob jects slightly which amounts to changing the numb ers that represent the ob jects these numb ers will b e called the coordinates or the parameters of the ob jects It is imp ortant that the p erturbation is small enough so that it do es not change the nondegenerate p osition of ob jects relative to each other Coming up with such a p erturbation is rather dicult and may require much higher precision than used for the original set of ob jects For this reason we p erform the p erturbation only symb olically by replacing each co ordinate by a p olynomial in The p olynomials will b e chosen in such a way that the p erturb ed set go es towards the original set as go es to zero We will see that it is not imp ortant to know the exact value of to p erform the simulation rather it is sucient to assume that is p ositive and suciently small Thus it will b e p ossible to use as an indeterminant and to handle primitive op erations symb olically The future user of SoS will neither have to b e concerned with the role that plays in the p erturba tion nor with the symb olic manipulation of p olynomials We may think of SoS as a package that provides the primitive op erations needed for a certain computation Ideally the inside of these op erations is hidden from the user who communicates with them like with an oracle It turns out that a large numb er of geometric problems can b e solved using a surprisingly small numb er of primitives Some of these primitives will b e discussed
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages38 Page
-
File Size-