跳到正文

个人记录

KTT 和其近似问题

jerry3128约 40 分钟
原文
文章信息与版本

文章信息

发布
2025年11月2日
收录
2026年3月7日
更新
2026年11月18日
篇幅
约 40 分钟

版本

  1. v1当前

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 F={f1,f2,…,fN}F = \{f_1,f_2,\dots,f_N\} be an indexed set of univariate polynomial functions: fi:R→Rf_{i}:\mathbb{R}\rightarrow \mathbb{R}. The upper envelope UF(x)\mathfrak U_F(x), lower envelope LF(x)\mathfrak L_F(x), and extent EF(x)\mathfrak E_F(x) are defined as:

​​UF(x)=max⁡{fi(x)∣fi∈F}​LF(x)=min⁡{fi(x)∣fi∈F}​EF(x)=UF(x)−LF(x)​\begin{equation} ​ \begin{aligned} ​ \mathfrak U_F(x) & = \max\{f_i(x) \mid f_i \in F\} \\ ​ \mathfrak L_F(x) & = \min\{f_i(x) \mid f_i \in F\} \\ ​ \mathfrak E_F(x) & = \mathfrak U_F(x) - \mathfrak L_F(x) ​ \end{aligned} \end{equation}

We wish to maintain FF under a sequence of the following operations online:

  • Insert(i,fii, f_i): Add a new function fif_i at index ii.

  • Delete(ii): Remove the function at index ii.

  • TranslateI_I(α,β\alpha, \beta): For all functions fjf_j in a contiguous interval of indices II, apply the transformation fj(x)←fj(x+α)+βf_j(x) \leftarrow f_j(x + \alpha) + \beta. This is a bulkt ranslation.

  • QueryMax(xqx_q): Return an approximate value U~(xq)\widetilde{U}(x_q) such that UF(xq)≥U~(xq)≥UF(xq)−ϵEF(xq).\mathfrak U_F(x_q) \geq \widetilde{\mathfrak U}(x_q) \geq \mathfrak U_F(x_q) - \epsilon \mathfrak E_F(x_q).

  • QueryMin(xqx_q): Return an approximate value L~(xq)\widetilde{L}(x_q) such that LF(xq)≤L~(xq)≤LF(xq)+ϵEF(xq).\mathfrak L_F(x_q) \leq \widetilde{\mathfrak L}(x_q) \leq \mathfrak L_F(x_q) + \epsilon \mathfrak E_F(x_q).

To make it more convenient, let QQ, MM, TT and NN denote the numberof q ueries, insertions/deletions, interval translations and functions, we regard Q,M,T=O(N)Q, M, T = O(N). Let ss 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 NN lines has complexity Θ(N)\Theta(N) and can be computed in optimal O(Nlog⁡N)O(N \log N) 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 O(log⁡2N)O(\log^2 N) time per update. This directly solves the exact dynamic upper envelope problem for lines. Brodal and Jacob [@1181985] later improved this to O(log⁡N)O(\log N) amortized time.

These exact structures, while optimal for lines, do not extend efficiently to non-linear functions. The upper envelope of NN parabolas, for instance, can have complexity Θ(Nα(N))\Theta(N \alpha(N)) [@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 x(t)x(t).

  • 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 Ω(N2)\Omega(N^2) 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 xx. 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 ϵ\epsilon-approximations.

  • Coresets and Simplified Envelopes: Agarwal et al. [@10.1145/1008731.1008736] introduced the concept of ϵ\epsilon-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 O(1/ϵ)O(1/\sqrt{\epsilon}) 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 ϵ\epsilon-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 ϵ\epsilon-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 NN, depending only on ϵ\epsilon.

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 O(log⁡N)O(\log N) 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 ((n,s)(n, s) Davenport-Schinzel Sequences [@AGARWAL20001]).

Let nn and ss be two positive integers. A sequence U=⟨u1,…,um⟩U=\langle u_1,\dots ,u_m \rangle of integers is an (n,s)(n, s) Davenport-Schinzel Sequences if it satisfies the following conditions:

  • 1≤ui≤n1\leq u_i \leq n for each i≤mi\leq m,
  • ui≠ui+1u_i \neq u_{i+1} for each i<mi < m,
  • there do not exist s+2s+2 indices 1≤i1<i2<⋯<is+2≤m1\leq i_1 < i_2 < \dots < i_{s+2}\leq m such that ​ui1=ui3=ui5=⋯=a,ui2=ui4=ui6=⋯=b, ​ u_{i_1}=u_{i_3}=u_{i_5}=\cdots=a, \quad u_{i_2}=u_{i_4}=u_{i_6}=\cdots=b, and a≠ba\neq b.

We define

​λs(n)=max{∣U∣ ∣ U is an (n,s) Davenport-Schinzel Sequences}\begin{equation} ​ \lambda_s(n) = max\{|U|\ |\ U \text{ is an $(n, s)$ Davenport-Schinzel Sequences}\} \end{equation}

Theorem 2 ([@AGARWAL20001]). Let F={f1,…,fn}F=\{f_1,\dots,f_n\} be a collection of nn real-valued, continuous totally defined functions, with highest ss degree. The number of intersection points on the lower envelope of FF is λs(n)\lambda_s(n)

To solve the exact problem, Kinetic Tournament Tree is promoted, but requires an extra property on QQ queries:

xq≤xq+1,∀q∈[1,Q−1]\begin{equation} x_q \leq x_{q+1}, \quad \forall q \in [1, Q - 1] \end{equation}

Because the translate operation is in a contiguous interval of incdices, the naive idea is to store fif_i at index ii. 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 22 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 O(N)O(N) compares and the root node is the function with minimal slope. As the xqx_q increasing, some certificates become invalid. We search it from the root and update the certificate for each.

Lemma 3. *Let NN and QQ denote the number of functions and queries. Kinetic Tournament Tree answers queries in O(λs(N)log⁡2N+Q)​O(\lambda_{s}(N)\log^2 N + Q)​ time complexity.

Proof. The number of intersection points of among NN ss-degree functions are λs(N)\lambda_s(N). The total intersection points of all Kinetic Tree vertices is O(λs(N)log⁡N)O(\lambda_s(N)\log N). Because the tournament tree is balanced, with height O(log⁡N)O(\log N), each intersection point will invalidate a certificate, an update costs O(log⁡N)O(\log N). Thus totally we can maintain the upper envelope in O(λs(n)log⁡2N)O(\lambda_{s}(n)\log^2 N) with answering each query in constant time. ◻

Although the result is not satisfied, compare to the result of fractional cascading [@Chazelle1986] in O(λs(N)log⁡N)O(\lambda_s(N)\log N), 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 FF be a collection of nn partially defined, continuous, univariate functions, with at most ss intersection points between the graphs of any pair. Then the complexity of lower envelope is O(λs+2(n))O(\lambda_{s+2}(n)).

Lemma 5. Let NN, MM and QQ denote the number of functions, insertions/deletions and queries. Kinetic Tournament Tree answers all queries in O(λs+2(N+M)log⁡2N+Q)O(\lambda_{s+2}(N+M)\log^2 N + Q) time complexity.

Proof. We regard insertion and deletion as the functions are partially defined on the time line. Thus we have at most (N+M)(N+M) partially functions. By Theorem 4, The complexity is O(λs+2(N+M)O(\lambda_{s+2}(N+M)). Using the same method without insertions and deletions, we can maintain the upper envelope in O(λs+2(N+M)log⁡2N+Q)O(\lambda_{s+2}(N+M)\log^2 N + Q). ◻

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 NN, MM, TT and QQ denote the number of functions, insertions/deletions, interval translations and queries, Kinetic Tournament Tree answers all queries in O(Ns(log⁡N)1+log⁡2(s+1)+(M+T)s(log⁡n)2+log⁡2(s+1))O(Ns (\log N)^{1+\log_2{(s+1)}} + (M+T)s(\log n)^{2+\log_2{(s+1)}}) time complexity.

Let d(x)d(x) and I(x)I(x) denote, the depth of a vertex and the number of intersection points of two functions from xx‘s children, after current xqx_q. The root has depth of 11. We consider to use amortized analysis. Let ϕ(x)\phi(x) denotes the potential of a tree vertex. we define ϕ(x)\phi(x) as:

​ϕ(x)=d(x)log⁡2(s+1)I(x)\begin{equation} ​ \phi(x) = d(x)^{\log_2{(s+1)}}I(x) \end{equation}

Then, let Φ\Phi be the potential of the whole data structure. We define Φ\Phi as:

​Φ=∑xϕ(x)\begin{equation} ​ \Phi = \sum_x\phi(x) \end{equation}

Let cc denote the actual cost of one certificate invalidate, and c^\hat{c} denote the amortized cost of one certificate invalidate. We define c=1c=1, then c^=1+ΔΦ\hat{c} = 1+\Delta\Phi. Let Φ\Phi and Φ#\Phi^\# denote the potential before and after an certificate invalidation is solved.

​​c^=1+ΔΦ​=1+Φ#−Φ​=1+(ϕ#(parentx)−ϕ(parentx))+(ϕ#(x)−ϕ(x))​≤1+s(d(x)−1)log⁡2(s+1)−d(x)log⁡2(s+1)​≤0​\begin{equation} ​ \begin{aligned} ​ \hat{c} &= 1 + \Delta\Phi\\ ​ &= 1 + \Phi^\# - \Phi\\ ​ &= 1 + (\phi^\#(\text{parent}_x) - \phi(\text{parent}_x)) + (\phi^\#(x) - \phi(x))\\ ​ &\leq 1 + s(d(x)-1)^{\log_2{(s+1)}} - d(x)^{\log_2{(s+1)}}\\ ​ &\leq 0 ​ \end{aligned} \end{equation}

Then, plug in c^\hat{c} back to the time complexity analysis equation.

​​∑c=∑c^−Φt+Φs​≤Φs−Φt​=O(Ns(log⁡N)log⁡2(s+1))​\begin{equation} ​ \begin{aligned} ​ \sum c &= \sum \hat{c} - \Phi_t + \Phi_s\\ ​ &\leq \Phi_s - \Phi_t\\ ​ &= O(Ns (\log N)^{\log_2{(s+1)}}) ​ \end{aligned} \end{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 O(s(log⁡N)1+log⁡2(s+1))O(s(\log N)^{1+\log_2{(s+1)}}) In total, certificate invalidation will happen O(Ns(log⁡N)log⁡2(s+1)+(M+T)s(log⁡N)1+log⁡2(s+1))O(Ns (\log N)^{\log_2{(s+1)}} + (M+T)s(\log N)^{1+\log_2{(s+1)}}), For each update of certificate, it costs O(log⁡N)\mathcal O(\log N). Finally, we can complete all of these operations in O(Ns(log⁡N)1+log⁡2(s+1)+(M+T)s(log⁡N)2+log⁡2(s+1))O(Ns (\log N)^{1+\log_2{(s+1)}} + (M+T)s(\log N)^{2+\log_2{(s+1)}}).

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 ϵ\epsilon-kernel with a higher precision in each tree vertex for its whole subtree. In the root vertex we can find an ϵ\epsilon-approximate result of all functions, without the restriction on the monotonicity of queries.

Definition 7 (ϵ\epsilon-kernel [@10.1145/1008731.1008736]). Let F={f1,…,fn}F = \{f_1,\dots,f_n\} be a set of univariate functions defined over x∈Rx\in R. Let ϵ>0\epsilon > 0 be a parameter, and Δ\Delta be a subset of R\mathbb{R}. We say that a subset G⊆FG\subseteq F is an ϵ\epsilon-kernel of FF within Δ\Delta if (1−ϵ)EF(x)≤EG(x)(1-\epsilon)\mathfrak E_{F}(x) \leq \mathfrak E_{G}(x) for each x∈Δx\in \Delta. if Δ=R\Delta = \mathbb{R}, we say that GG is an ϵ\epsilon-kernel of FF.

Our goal is to maintain the ϵ\epsilon-kernel of the functions under the operations.

Linear Functions

Theorem 8 ([@10.1145/1008731.1008736]). Let HH be a set of nn univariate functions and let ϵ>0\epsilon > 0 be a parameter. We can compute in O(n+1/ϵ)O(n+1/\epsilon) time an ϵ\epsilon-kernel of HH of size O(1/ϵ)O(1/\epsilon), or in O(n+1/ϵ3/2)O(n+1/\epsilon^{3/2}) time an ϵ\epsilon-kernel of HH of size O(1/ϵ1/2)O(1/\epsilon^{1/2}).

We construct the ϵ\epsilon-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 ϵ\epsilon-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 O(log⁡N)O(\log N), for each layer, we allow an error of (ϵ/log⁡N)(\epsilon / \log N), and add them up to have an ϵ\epsilon-kernel.

Therefore, each vertex stores (ϵ/log⁡nN)(\epsilon/\log nN)-kernel of its subtree. Totally we can construct the data structure in O((1/ϵ)Nlog⁡2n)O((1/\epsilon)N\log^2 n).

Lemma 9 ([@10.1145/1008731.1008736]). Let T:R→RT : \mathbb{R} \to \mathbb{R} be a translation transformation, i.e., there exists c∈Rc \in \mathbb{R} such that T(x)=x+cT(x) = x + c for all x∈Rx \in \mathbb{R}. Let FF be a family of univariate functions f:D→Rf : D \to \mathbb{R} with D⊂RD \subset \mathbb{R}, and let G⊆FG \subseteq F be an ϵ\epsilon-kernel of FF. Define T(F)={T∘f∣f∈F}T(F) = \{ T \circ f \mid f \in F \} and T(G)={T∘g∣g∈G}T(G) = \{ T \circ g \mid g \in G \}. Then T(G)T(G) is an ϵ\epsilon-kernel of T(F)T(F).

Thus, it is trivial to using lazy propagation to maintain the ϵ\epsilon-kernel of a vertex, and update its parent.

Because for each vertex on tree, the ϵ\epsilon-kernel it records is of size O(1/ϵ)O(1/\sqrt{\epsilon}), thus when we update the vertex, the time complexity is only O(1/ϵ)O(1/\epsilon)

Therefore, in total, the time complexity is O((1/ϵ)(N+M+T)log⁡2N)O((1/\epsilon)(N+M+T)\log^2 N).

Polynomial Functions

By using the linearization technique, we can transfrom the kk-degree polynomial functions into the kk-variable linear functions. Based on this, we can non-trivially get the solution for O((1/ϵ)k(N+M+T)log⁡1+kn)O((1/\epsilon)^k(N+M+T)\log^{1+k}n), but we can achieve better results.

Theorem 10 ([@10.1145/1008731.1008736]). Let F={f1,…,fn}F=\{f_1,\dots,f_n\} be a family of univariate polynomials that admits a linearization of dimension k, and let ϵ>0\epsilon > 0 be a parameter. We can compute in time O(n+1/ϵ3k/2)O(n+1/\epsilon^{3k/2}) an ϵ\epsilon-kernel of FF of size O(1/ϵ)O(1/\epsilon).

Based on Theorem 10, we can still conclude that O(1/ϵ)O(1/\epsilon) size of ϵ\epsilon-kernel is stored on each tree vertex. Hence the complexity of univariate polynomial functions, is bounded by O((1/ϵ2)(N+M+T)log⁡3n)O((1/\epsilon^2)(N+M+T)\log^3 n).

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.

原文