A Data-Structure for Approximate Dynamic Envelope in 2D
中文版在施工。
Introduction
The maintenance of geometric envelopes---the pointwise maximum or minimum of a set of functions---is a fundamental problem in computational geometry with far-reaching applications in computer graphics, motion planning, and optimization. As a result, there has been a great deal of work on implementing high-speed algorithm for maintaining geometric envelopes around last decades [@Edelsbrunner1989; @BASCH19991; @ALEXANDRON2007144]. After finding the tight upper bound of this problem [@Sharir1994], approximate algorithms are introduced [@BAREQUET200191; @10.1145/1008731.1008736; @Schulz2011]. Then, in dynamic settings, algorithms are created to maintain the envelopes [@10.1145/1008731.1008736; @ALEXANDRON2007144; @Botana2017].
Problem Formulation
Let be an indexed set of univariate polynomial functions: . The upper envelope , lower envelope , and extent are defined as:
We wish to maintain under a sequence of the following operations online:
-
Insert(): Add a new function at index .
-
Delete(): Remove the function at index .
-
Translate(): For all functions in a contiguous interval of indices , apply the transformation . This is a bulkt ranslation.
-
QueryMax(): Return an approximate value such that
-
QueryMin(): Return an approximate value such that
To make it more convenient, let , , and denote the numberof q ueries, insertions/deletions, interval translations and functions, we regard . Let denotes the degree of functions.
Literature Review
The problem of maintaining the envelope of a set of functions in 2D has deep roots in computational geometry and has been approached from multiple perspectives, ranging from exact solutions for specific function classes to approximate generalized frameworks. This review systematically examines the evolution of these techniques, with particular attention to the key challenges of dynamism, approximation, and handling complex operations like bulk translations.
Exact Envelope Structures for Linear Functions
The foundation of envelope maintenance lies in the study of the convex hull of points in the plane, which is dual to the upper envelope of lines.
-
Static Upper Envelope of Lines: The classical result establishes that the upper envelope of lines has complexity and can be computed in optimal time using a sweep-line algorithm or divide-and-conquer [@KEIL1991121; @AGARWAL20001].
-
Dynamic Convex Hull (Logarithmic Time): Overmars and van Leeuwen [@OVERMARS1981166] presented a seminal data structure maintaining the convex hull under point insertions and deletions in time per update. This directly solves the exact dynamic upper envelope problem for lines. Brodal and Jacob [@1181985] later improved this to amortized time.
These exact structures, while optimal for lines, do not extend efficiently to non-linear functions. The upper envelope of parabolas, for instance, can have complexity [@AGARWAL20001], and maintaining it exactly under dynamic updates becomes significantly more complex.
Kinetic Data Structures for Moving Points
The problem of tracking attributes of moving points, such as the convex hull, introduced the concept of kinetic data structures (KDS)[@BASCH19991].
-
Kinetic Heaps and Tournament Trees: A kinetic heap [@BASCH19991] maintains the maximum of a set of values changing over time. It functions by storing certificates that guarantee the current maximum is valid and processing certificate failures as time progresses. This is highly relevant for querying the upper envelope at a moving point .
-
Kinetic Convex Hull: KDS frameworks can maintain the convex hull of points moving with known trajectories. While efficient for pseudo-algebraic motions, a general KDS for the convex hull may require processing events in the worst case, and updating the structure upon insertions or deletions is non-trivial.
The KDS framework is a natural fit for the translate operation, as a translation corresponds to a change in the time variable . However, standard KDS focuses on fixed motion plans and is not primarily designed for the bulk updates and dynamic function insertions or deletions central to our problem.
Approximation Schemes for Envelopes
To overcome the high complexity of exact envelopes, a rich line of research has focused on -approximations.
-
Coresets and Simplified Envelopes: Agarwal et al. [@10.1145/1008731.1008736] introduced the concept of -coresets for extent measures. For the width of a point set (dually, the vertical distance between upper and lower envelopes), they show that a coreset of size can be maintained, which can be seen as storing a simplified envelope. This result is foundational for our approach, as it justifies that a small number of functions can suffice for an -approximation.
-
Mergeable Summaries: The work of Agarwal et al. [@agarwal2011mergeable] on mergeable summaries for extent measures provides a direct technical tool. They demonstrate how to maintain small, approximate summaries for the extent of a point set that can be efficiently merged, which is precisely the operation required to combine the -kernel of two children in our segment tree.
These approximation schemes form the mathematical basis of it, demonstrating that the complexity of the envelope can be made independent of , depending only on .
Data Structures for Bulk Updates
Handling bulk operations efficiently requires moving beyond point updates to range updates.
-
Segment Trees with Lazy Propagation: The segment tree is the canonical data structure for range updates and queries on an array. Its extension with lazy propagation allows range updates to be applied in time. This project adapts this classic idea, but the update is an affine transformation applied to a set of functions.
-
Affine Transformations in Geometric Structures: The problem of maintaining geometric structures under rigid motions or affine transformations has been studied. For instance, the work of Basch et al. [@BASCH19991] on kinetization can be viewed as handling continuous transformations. However, applying this to a discrete, bulk update over an interval of indices in a dynamic set of functions is a novel combination of these ideas.
Background - Kinetic Tournament Tree
First, we introduce Davenport-Schinzel Sequences [@AGARWAL20001], used to analysis the time complexity of the Kinetic Tournament Tree.
Definition 1 ( Davenport-Schinzel Sequences [@AGARWAL20001]).
Let and be two positive integers. A sequence of integers is an Davenport-Schinzel Sequences if it satisfies the following conditions:
- for each ,
- for each ,
- there do not exist indices such that and .
We define
Theorem 2 ([@AGARWAL20001]). Let be a collection of real-valued, continuous totally defined functions, with highest degree. The number of intersection points on the lower envelope of is
To solve the exact problem, Kinetic Tournament Tree is promoted, but requires an extra property on queries:
Because the translate operation is in a contiguous interval of incdices, the naive idea is to store at index . Thus we can construct the kinetic tournament tree by store the functions in the leaf node, the certificate for each node is to compare the function value from children at current queries. The winner is kept in the current node, and its information is provided to the node’s parent.
Queries Only
In the construction of the Kinetic Tournament Tree, it costs compares and the root node is the function with minimal slope. As the increasing, some certificates become invalid. We search it from the root and update the certificate for each.
Lemma 3. *Let and denote the number of functions and queries. Kinetic Tournament Tree answers queries in time complexity.
Proof. The number of intersection points of among -degree functions are . The total intersection points of all Kinetic Tree vertices is . Because the tournament tree is balanced, with height , each intersection point will invalidate a certificate, an update costs . Thus totally we can maintain the upper envelope in with answering each query in constant time. ◻
Although the result is not satisfied, compare to the result of fractional cascading [@Chazelle1986] in , we will see the potential of this approach for more complex problems.
Insertions and Deletions
Based on insertions and deletions, we can regard the functions as partially functions, which starts from the query just after inserting it and ends at the query just before deleting it.
Theorem 4 ([@AGARWAL20001]). Let be a collection of partially defined, continuous, univariate functions, with at most intersection points between the graphs of any pair. Then the complexity of lower envelope is .
Lemma 5. Let , and denote the number of functions, insertions/deletions and queries. Kinetic Tournament Tree answers all queries in time complexity.
Proof. We regard insertion and deletion as the functions are partially defined on the time line. Thus we have at most partially functions. By Theorem 4, The complexity is ). Using the same method without insertions and deletions, we can maintain the upper envelope in . ◻
Bulk Updates
It is trivial to complete the operation. Using the lazy propagation to record the amount by which the function shifts to the left and up separately. The key challenge is to analysis the time it costs.
Theorem 6. Let , , and denote the number of functions, insertions/deletions, interval translations and queries, Kinetic Tournament Tree answers all queries in time complexity.
Let and denote, the depth of a vertex and the number of intersection points of two functions from ‘s children, after current . The root has depth of . We consider to use amortized analysis. Let denotes the potential of a tree vertex. we define as:
Then, let be the potential of the whole data structure. We define as:
Let denote the actual cost of one certificate invalidate, and denote the amortized cost of one certificate invalidate. We define , then . Let and denote the potential before and after an certificate invalidation is solved.
Then, plug in back to the time complexity analysis equation.
After that, we need to analysis the impact from modification to the potential of data structure. For an insertion, deletion, or interval translation operation, each will at most increasing In total, certificate invalidation will happen , For each update of certificate, it costs . Finally, we can complete all of these operations in .
Our Method
Kinetic Tournament Tree greatly solve the problem, but requires extra property of monotonicity on queries. We can only translate functions to one side of left and right. However, the problem itself does not provide such property.
To address this case, we introduce a new data structure for approximate result of problem. The main idea is to store the -kernel with a higher precision in each tree vertex for its whole subtree. In the root vertex we can find an -approximate result of all functions, without the restriction on the monotonicity of queries.
Definition 7 (-kernel [@10.1145/1008731.1008736]). Let be a set of univariate functions defined over . Let be a parameter, and be a subset of . We say that a subset is an -kernel of within if for each . if , we say that is an -kernel of .
Our goal is to maintain the -kernel of the functions under the operations.
Linear Functions
Theorem 8 ([@10.1145/1008731.1008736]). Let be a set of univariate functions and let be a parameter. We can compute in time an -kernel of of size , or in time an -kernel of of size .
We construct the -kernel of the functions by dual them as the points and then using affine operations to make them as a fat-node set, which can be done in linear time [@BAREQUET200191]. Finally, within the fat-node set, the ratio of distance around all direction from origin between segments on original convex hull and -kernel’s convex hull can be easily guaranteed, so dose the construction algorithm.
However, merging kernels requires strict restrictions [@agarwal2011mergeable]. Thus because the height of tournament tree is , for each layer, we allow an error of , and add them up to have an -kernel.
Therefore, each vertex stores -kernel of its subtree. Totally we can construct the data structure in .
Lemma 9 ([@10.1145/1008731.1008736]). Let be a translation transformation, i.e., there exists such that for all . Let be a family of univariate functions with , and let be an -kernel of . Define and . Then is an -kernel of .
Thus, it is trivial to using lazy propagation to maintain the -kernel of a vertex, and update its parent.
Because for each vertex on tree, the -kernel it records is of size , thus when we update the vertex, the time complexity is only
Therefore, in total, the time complexity is .
Polynomial Functions
By using the linearization technique, we can transfrom the -degree polynomial functions into the -variable linear functions. Based on this, we can non-trivially get the solution for , but we can achieve better results.
Theorem 10 ([@10.1145/1008731.1008736]). Let be a family of univariate polynomials that admits a linearization of dimension k, and let be a parameter. We can compute in time an -kernel of of size .
Based on Theorem 10, we can still conclude that size of -kernel is stored on each tree vertex. Hence the complexity of univariate polynomial functions, is bounded by .
References
[1] P. K. Agarwal, G. Cormode, Z. Haung, J. M. Phillips, Z. Wei, and K. Yi. Mergeable coresets. 2011.
[2] P. K. Agarwal, S. Har-Peled, and K. R. Varadarajan. Approximating extent measures of points. J. ACM, 51(4):606–635, July 2004.
[3] P. K. Agarwal and M. Sharir. Davenport-schinzel sequences and their geometric applica- tions. In J.-R. Sack and J. Urrutia, editors, Handbook of Computational Geometry, pages 1–47. North-Holland, Amsterdam, 2000.
[4] G. Alexandron, H. Kaplan, and M. Sharir. Kinetic and dynamic data structures for convex hulls and upper envelopes. Computational Geometry, 36(2):144–158, 2007.
[5] G. Barequet and S. Har-Peled. Efficiently approximating the minimum-volume bounding box of a point set in three dimensions. Journal of Algorithms, 38(1):91–109, 2001.
[6] J. Basch, L. J. Guibas, and J. Hershberger. Data structures for mobile data. Journal of Algorithms, 31(1):1–28, 1999.
[7] F. Botana and T. Recio. Computing envelopes in dynamic geometry environments. Annals of Mathematics and Artificial Intelligence, 80(1):3–20, may 2017.
[8] G. Brodal and R. Jacob. Dynamic planar convex hull. In The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings., pages 617–626, 2002.
[9] B. Chazelle and L. J. Guibas. Fractional cascading: II. applications. Algorithmica, 1(1):163–191, nov 1986.
[10] H. Edelsbrunner, L. J. Guibas, and M. Sharir. The upper envelope of piecewise linear functions: Algorithms and applications. Discrete & Computational Geometry, 4(1):311– 336, aug 1989.
[11] M. Keil. A simple algorithm for determining the envelope of a set of lines. Information Processing Letters, 39(3):121–124, 1991.
[12] M. H. Overmars and J. van Leeuwen. Maintenance of configurations in the plane. Journal of Computer and System Sciences, 23(2):166–204, 1981.
[13] T. Schulz and B. J¨uttler. Envelope computation in the plane by approximate implicitization. Applicable Algebra in Engineering, Communication and Computing, 22(4):265–288, nov 2011. 10
[14] M. Sharir. Almost tight upper bounds for lower envelopes in higher dimensions. Discrete & Computational Geometry, 12(1):327–345, sep 1994.