##
###
Maintenance of configurations in the plane

Mark H. Overmars, Jan van Leeuwen

1981
*
Journal of computer and system sciences (Print)
*

For a number of common configurations of points (lines) in the plane, we develop data structures in which insertions and deletions of points (or lines, respectively) can be processed rapidly, without sacrificing much of the efficiency of query answering which known static structures for these configurations attain. As a main result we establish a fully dynamic maintenance algorithm for convex hulls that can process insertions and deletions of single points in only O(log* n) steps per
## more »

... , where n is the number of points currently in the set. The algorithm has several intriguing applications, including the fact that the "trimmed" mean of a set of n points in the plane can be determined in only O(n log2 n) steps. Likewise, efficient algorithms are obtained for dynamically maintaining the common intersection of a set of halfspaces and for dynamically maintaining the maximal elements of a set of points. The results are all derived by means of one master technique, which is applied repeatedly and which captures an appropriate notion of "decomposability" for configurations closely related to the existence of divide-and-conquer solutions. While the theory as it stands is applicable to a wide variety of "point problems," Saxe and Bentley [23, Appendix] observed already that their techniques were apparently insufficient to handle entire configurations (such as convex hulls) dynamically as well. Yet many of the geometric configurations commonly considered intuitively are "decomposable." We shall prove for a number of different types of geometric configurations that efficient dynamizations can be achieved and identify the concept of decomposability which all these configurations seem to share. In the sections to follow we shall present efficient algorithms to dynamically maintain the convex hull of a set of points, the common intersection of a collection of halfspaces and the contour of maximal elements of a set of points. The results show that insertions and deletions of objects can be performed in only O(log* n) steps each, where n is the current number of objects in the set. In several instances no better bounds than O(n) or worse were known before; in some the problem to support deletions also has never been discussed before. An extensive list of applications is discussed in various intermediate sections, some of immediate interest to such areas as computational statistics (cf. Shamos [25] ). For example, we shall present a method to maintain two sets of points in the plane at a cost of only O(log* n) time for each insertion or deletion, such that the question of whether the two sets are separable by a straight line can be answered in only O(log n) time. An interesting feature of the algorithms we present is that they all follow (more or less) by applying one and the same technique, which takes advantage of the existence of "similar" divide-and-conquer solutions for the construction of the configurations at hand. Some of the searching problems we consider, such as containment in the common intersection of a set of halfspaces, are even decomposable in Bentley's sense. It will appear that the efficiency of algorithms derived by applying any of the standard dynamizations (as they are known) to the currently best static solutions of these problems does not even come near the efficiency attained by the especially engineered maintenance algorithms we develop here. On the other hand, we have no proof that the bounds and methods we use are anywhere near optimality and further improvements remain open. DYNAMICALLY MAINTAINING A CONVEX HULL (PRELUDE) In the past many different algorithms have been proposed to determine the convex hull of a set of n points p"..., p" in the plane [4, 9, 10, 12, 15, 211. The algorithms usually operate on a static set and have a worst case running time of O(n log n) or O(nh), where h is the number of points appearing on the hull. An early algorithm of Graham [IO], for example, operates by locating an interior point S of the convex hull first and ordering all pointsp, top" by polar angle around S. In this order the points span the contour of a simple, star-shaped polygon and it only takes a single walk around the polygon to "draw in" the convex hull (Fig. 1) . Since it always has to sort, Graham's algorithm will be tied to an a(n log n) worst case lower bound. On the other hand, the very fact that we normally want to obtain 168 MARK H. OVERMARS AND JAN VAN LEEUWEN FIGURE I the ordered contour of the convex hull implies that sorting must be implicit in any algorithm and the Q(n log n) worst case lower bound applies to all of them which deliver a convex hull in such terms [26] . Even if we merely want to mark which of the pi are hull-points (duplicates allowed) and do not care about the actual contour at all, then an a(n log n) worst case lower bound can still be shown [29] , even in a quadratic decision tree model [ 3 11. Nearly all convex hull algorithms known today (like Graham's) require that all inputs are read and stored before any processing can begin. Such algorithms are said to operate "off-line." Shamos [25] apparently first noted that in certain applications one might want to have an efficient "on-line" algorithm instead, which will have the convex hull of p, to pi complete and ready before pi+ I is added to the set. Because of the n log n lower bound, updates of the convex hull due to the addition of a single point will cost at least O(log n) on the average. Preparata [20] recently showed an algorithm to insert a point and update the convex hull in a way which never exceeds the O(log n) even as a worst case bound. Briefly, his technique amounts to the following. Suppose the extreme points among p1 to pi are kept ordered by polar angle around an interior point S of the current hull and are stored in a proper, concatenable queue (see [ 11). When pi+, is presented we first determine whether it lies inside or outside the current hull, by inspecting the sector to which it belongs (which can be found by binary search around S, see Fig. 2a ). When pi+ I lies in the interior no update is needed. When pi+, lies in the exterior (see Fig. 2b ), determine the tangents Vi+1 and YPi+i to the current hull, omit the points on the arc between x and y "illuminated" by pi+ I and insert pi+, for them instead. The non-easy part concerns the design of a proper queue structure (a geared-up A IX-tree will do), such that binary search on the hull can be performed in only O(log n) steps in worst case (e.g., to find the tangents needed) in addition to the ordinary O(log n) insertion, deletion and splitting behaviour. It is clear that none of the previous algorithms are fully dynamic, since at best they support insertions only. Yet there are a number of practical problems (cf. Section 5) in which it is required to have an efficient algorithm to restore the convex hull when points are deleted from the set. This creates a tremendous problem for all existing algorithms, even for Preparata's [20] . They virtually all go by the principle that points found to be in the interior of the (current) convex hull will not be needed ever MAINTENANCE OFCONFIGURATIONS INTHE PLANE 169 \ '\

doi:10.1016/0022-0000(81)90012-x
fatcat:juqd5jtfxnemrnjb5ygwo6jamq