Geometric Range Searching*
Total Page:16
File Type:pdf, Size:1020Kb
Geometric range searching Jir Matousek Department of Applied Mathematics Charles University Malostranskenam Praha Czech Republic Abstract In geometric range searching algorithmic problems of the following typ e are considered Given an np oint set P in the plane build a data structure so that given a query triangle R the number of points of P lying in R can b e determined quickly Problems of this typ e are of crucial imp ortance in computational geometry as they can b e used as subroutines in many seemingly unrelated algorithms We presenta survey of results and main techniques in this area Contents Intro duction Geometric range searching Intuition and lower b ounds Algorithms with approximately linear space Algorithms with logarithmic query time Extensions and examples of applications Halfspace range rep orting and other sp ecial situations Dynamization Multilevel data structures Searching with more general ranges Ray sho oting and linear optimization More on applications Last paragraph Part of the work on this pap er was done while the author was visiting the Computer Science Institute Free University Berlin The work has b een supp orted by the GermanIsraeli Foundation of Scientic Research and Development GIF Intro duction This pap er considers an algorithmic problem called range searching We de scrib e the problem and outline current theoretical knowledge ab out it including the main ideas of several pro ofs and constructions Together with the main material we also include various extensions historical notes etc Many of them are somewhat sub jective Several notions and results of computational geometry app earing in our discussion but not directly related to range searching are explained in separate b oxes Table on page summarizes the currentbestknown complexity b ounds for simplex and halfspace range searching Computational geometry general remarks The considered prob lems b elong into the area of computational geometry In the rest of this section we briey intro duce this eld and mention some features and conventions which seem particular to it reader somewhat familiar with computational geometry may probably skip the rest of section safely Older computational geometry monographs of a wide scop e are PS Ede Meh a recent one is Mul Useful survey pap ers can b e found in Pac GPS The sub ject of computational geometry is the design and analysis of ef cient algorithms for computing various prop erties and parameters of nite congurations of geometric ob jects The last sentence may sound rather in comprehensible and the reader can get a better picture from few examples of simple problems studied in computational geometry P Given an np oint set P in the plane or in a Euclidean space of dimension d nd a pair of p oints of P with a smallest distance P Given n segments in the plane compute the numb er of their intersections P Given a convex p olytop e P in ddimensional space sp ecied as an inter section of n halfspaces determine a p ointofP minimizing a given linear function P Given a polygon P in the plane not necessarily convex and two points a b in its interior nd a shortest path from a to b inside P or another version a path from a to b consisting of a minimum p ossible number of segments And so on In computational geometry it is deceptively easy to formu late problems Many problems have practical or theoretical motivations and for almost any problem one can makeup an acceptable lo oking ap plication ex post In the pioneer era of the eld say around the year and few years later it was not to o dicult to nd an unsolved elemen tary and interesting problem Today more complicated and more p owerful metho ds are known and nding a really remarkable new problem b ecame quite hard This is probably the most frequentpreamble of a problem in computational geometry The sub ject of computational geometry is similar to the areas of interest of other elds such as geometric asp ects of combinatorial optimization etc For instance a careful reader might have recognized Problem P as a linear programming problem The approach of computational geometry is usually distinguished by twotypical features The problems are considered in a xed dimension and an innite precision mo del of computation is used Dimension and hidden constants The original computational geometry problems were formulated in the plane or in dimensional space Generaliza tions to an arbitrary dimension are also studied but almost always we imagine that the dimension is quite small say at most while the number of objects p oints segments etc app earing in the problem is large Formally the dimension is usually considered as a constant The eciency of typical computational geometry algorithms decreases with the dimension quite rapidly for example the multiplicative constants in the asymptotic b ounds for the complexity of the algorithms are usually exp onential in the dimension this is also the case for range searching This xed dimension assumption contrasts eg with the theory of linear programming algorithms where the dimension is comparable with the numb er of constraints In theoretical research the eciency of algorithms is compared almost exclusivelyby the asymptotic order of growth of their complexity as a function of the input size One can raise various ob jections against this criterion mainly from the practical p oint of view but no b etter theoretical criterion seems to b e available For simpler algorithms mainly older ones the eectivity expressed in this way agrees with the intuitive notion how fast the algorithm computes and even with the sp eed of actual implementations for real life problems For more complicated algorithms this touch with reality is sometimes lost Sometimes it is even apparent that an asymptotic improvementhas nothing to do with the sp eed of computation for any physically feasible inputs Attempts to improve an algorithm with O n log log n complexity to an O n log n algorithm mightlooklike some p eculiar kind of sp ort In defense of such activities one can say that the actual goal is or at least should be a b etter understanding of the studied problem A discovery of a complicated and quite impractical algorithm with a good asymptotic complexity indicates the p ossibility of an improvement and often a simpler and easily implementable algorithm of a similar complexity is found so on afterwards Mo del of computation rounding problems Algorithms in computa tional geometry are designed for an ideal computer mo del of computation called Real RAM This is an analog of the usual RAM ie of an abstraction of an actual computer programmed in a machine co de However a Real RAM can store an arbitrary real number in one register and p erform arithmetic op era tions with real numb ers in unit time while the usual RAM works with integers whose size is b ounded by a p olynomial in the input size In the sequel we will also use the Real RAM mo del of computation The innite precision computation in the Real RAM mo del is very conve nient theoretically but it often behaves quite dierently than an actual com putation with limited precision Not only that the result of a calculation will b e imprecise a carelessly programmed algorithm may give completely wrong results with a limited precision as the combinatorial information derived from comparisons of imprecise numbers may be erroneous or inconsistent Dicul ties with rounding errors are a very serious p otential obstacle p erhaps the most serious one to successful implementation of geometric algorithms Several promising attempts have app eared at developing program pack ages for a suciently precise and relatively quick arithmetic eg FvW However probably wehave to exp ect that if a more complicated geomet ric algorithm is implemented reliably ie in such a waythat it cannot give an erroneous result b ecause of rounding errors it causes a signicant slowdown compared to a straightforward implementation ignoring these asp ects General p osition assumption In many computational geometry algo rithms one has to deal separately with congurations of input ob jects that are degenerate in some sense for instance when three input p oints lie on a common line Such exceptions complicate both the description and implementation of algorithms Luckily for theoreticians it is known howtoavoid such degenerate cases systematically although at the cost of a slowdown by a constant factor at least in versions published until now Conceptually one p erturbs the input ob jects by innitesimal amounts which brings them into a general p ositions Such metho ds are called simulation of simplicity The idea of innitesimal p er turbations can be realized in various ways see eg EM EC EC and the b est metho d is still b eing sought Simulation of simplicity has also theoretical drawbacks Since we are in eect replacing a given input problem by a dierent problem although an innitesimally close one an algorithm run on this dierent problem may sometimes yield a dierent answer than the correct one for the original problem and it may actually be quite complicated to recover a correct answer to the original problem Of course we may say that the input numbers for a real world problem are inaccurate anyway and so the answer for the perturbed problem is equally appropriate as the one for the original problem However this is not suitable for many applications where degeneracies in the input are not mere coincidences