Abstract 1 Introduction 2 Our contributions 3 Technical overview 4 Preliminaries 5 Dynamic algorithm with insertions and deletions References

Dynamic and Streaming Algorithms for Union Volume Estimation

Sujoy Bhore ORCID Indian Institute of Technology Bombay, Mumbai, India    Karl Bringmann ORCID Saarland University and Max-Planck-Institute for Informatics, Saarbrücken, Germany    Timothy M. Chan ORCID University of Illinois at Urbana-Champaign, IL, USA    Yanheng Wang ORCID Saarland University and Max-Planck-Institute for Informatics, Saarbrücken, Germany
Abstract

The union volume estimation problem asks to (1±ε)-approximate the volume of the union of n given objects X1,,Xnd. In their seminal work in 1989, Karp, Luby, and Madras solved this problem in time O(n/ε2) in an oracle model where each object Xi can be accessed via three types of queries: obtain the volume of Xi, sample a random point from Xi, and test whether Xi contains a given point x. This running time was recently shown to be optimal [Bringmann, Larsen, Nusser, Rotenberg, and Wang, SoCG’25]. In another line of work, Meel, Vinodchandran, and Chakraborty [PODS’21] designed algorithms that read the objects in one pass using polylogarithmic time per object and polylogarithmic space; this can be phrased as a dynamic algorithm supporting insertions of objects for union volume estimation in the oracle model.

In this paper, we study algorithms for union volume estimation in the oracle model that support both insertions and deletions of objects. We obtain the following results:

  1. 1.

    an algorithm supporting insertions and deletions in polylogarithmic update and query time and linear space (this is the first such dynamic algorithm, even for 2D triangles);

  2. 2.

    an algorithm supporting insertions and suffix queries (which generalizes the sliding window setting) in polylogarithmic update and query time and space;

  3. 3.

    an algorithm supporting insertions and deletions of convex bodies of constant dimension in polylogarithmic update and query time and space.

Keywords and phrases:
union volume estimation, dynamic algorithms, streaming algorithms
Copyright and License:
[Uncaptioned image] © Sujoy Bhore, Karl Bringmann, Timothy M. Chan, and Yanheng Wang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
; Theory of computation Streaming, sublinear and near linear time algorithms ; Theory of computation Data structures design and analysis
Related Version:
Full Version: https://arxiv.org/pdf/2602.16306 [5]
Funding:
Karl Bringmann and Yanheng Wang: This work is part of the project TIPEA that has received funding from the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation programme (grant agreement No. 850979).
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

In the union volume estimation problem, we are given objects X1,,Xn, which are assumed to be measurable sets in d, and the task is to (1±ε)-approximate the volume of i=1nXi.111A discrete variant of the problem, estimating the cardinality of the union of sets X1,,Xnd, can be easily reduced to the continuous version, by replacing each grid point with a unit grid cell. This is a fundamental problem in computer science, with connections to several areas such as network reliability [32, 34], DNF counting [34], general model counting [45, 14], probabilistic databases [35, 21, 46], and probabilistic query evaluation on databases [13, 12]. Perhaps the most popular special case in computational geometry is Klee’s measure problem [36], where each object is a d-dimensional axis-aligned box. There has been extensive work on Klee’s measure problem (either exact or approximate) in constant dimensions [44, 15, 16, 37, 27, 10].

To capture a wide variety of input objects with a unified framework, Karp and Luby [33] introduced an oracle model. An algorithm in this model can access each object Xi exclusively via three types of queries: (i) Xi.size() gives the volume of Xi, (ii) Xi.sample() samples a point uniformly at random from the set Xi, and (iii) Xi.contains(x) tests whether a given point x is contained in Xi. The time complexity of the algorithm is measured by the number of queries plus the number of additional steps; that is, each query is assumed to take unit time. In a seminal result, Karp, Luby, and Madras [34] gave an algorithm in the oracle model that solves union volume estimation in time O(n/ε2) with constant success probability, where ε is the approximation precision. Black-box usage of this result also yields the best known algorithms for several applications, including DNF counting. (For Klee’s measure problem, it implies an O(nd/ε2)-time approximation algorithm [9]; in small dimensions, this was improved to O((n+1/ε2)logO(d)n) time at last year’s SoCG [10].) Only recently has a matching lower bound been established: Ω(n/ε2) queries are necessary to solve union volume estimation in the oracle model [10].

With the static setting now fully understood, attention naturally shifts to the dynamic setting, where the input evolves over time through insertions and deletions of objects. The study of dynamic union volume estimation has a twofold motivation. On one hand, it captures modern data-driven applications where datasets are inherently mutable, and volume estimates must be maintained continuously rather than recomputed from scratch after each update. On the other hand, the dynamic setting presents a compelling theoretical challenge, as it is far from obvious whether the tools developed for the static setting can be dynamized efficiently. Indeed, dynamic geometric problems have repeatedly proven to be substantially more difficult than their static counterparts. An extensive body of work in recent years deals with dynamic geometric problems such as set cover [2, 17], independent set [28, 7, 6], planar point location [43], connectivity [19, 18], and nearest neighbor search [1], yet in this broader context dynamic union volume estimation remains largely unexplored. The following question has not been resolved even for very simple classes of objects such as triangles in 2:

Q1: Can we solve dynamic union volume estimation in the oracle model under insertions and deletions of objects in poy(logn,1ε) update and query time?

An even more demanding paradigm is the (one-pass) streaming setting, where the algorithm has to not only handle updates, but use space that is typically required to be polylogarithmic in the input size. Earlier work has explored streaming algorithms under strong restrictions on the input objects. For example, Tirthapura and Woodruff [47] designed a dynamic streaming algorithm for Klee’s measure problem on axis-aligned boxes. However, the problem remains unaddressed for more general classes of objects:

Q2: Can we solve dynamic union volume estimation in the oracle model under insertions and deletions of objects in poy(logn,1ε) space as well as update and query time?

In the restricted insertion-only setting, Meel, Vinodchandran, and Chakraborty [40] gave a positive answer to this question, using O(1ε2log2(n)(loglog(n)+log(1ε))) time per update and query, and O(1ε2log(n)) space in the oracle model.222In this paper, we assume that points from the input objects and O(logn)-bit integers fit into a machine word, and space complexity counts the number of machine words. An arithmetic operation on machine words is assumed to take unit time. Both are natural assumptions for a continuous universe. Some previous work such as [40] focuses on sets from a finite universe and studies bit complexity; when stating previous work in the introduction, we have translated their results into our setting. In the finite universe Ω, different trade-offs between log(n) and log|Ω| were obtained in [39, 42]. However, their algorithm cannot handle deletions.

2 Our contributions

2.1 Dynamic algorithm with insertions and deletions

We answer our driving question (Q1) positively, not only for 2D triangles, 3D simplices, and other common types of objects encountered in computational geometry, but in the full generality of the oracle model. Our new dynamic algorithm can handle arbitrary sequences of both insertions and deletions.

More precisely, we consider an initially empty multiset of objects 𝒳 under the updates insert(X), which adds object X to 𝒳, and delete(X), which removes object X from 𝒳. Upon query estimate(), the algorithm outputs a (1±ε)-approximation to the volume vo(X𝒳X).

During insertion/deletion the algorithm is given oracle access to the inserted/deleted object. We also need the ability to store objects (or their oracles), in case of future lookup of the previously inserted objects. We make the natural assumption that (i) the argument of insert(X) and delete(X) is a pointer to the oracle of X, (ii) we can store a pointer in a machine word, and (iii) knowing the pointer allows us to access the oracle to which the pointer is pointing. In this interpretation, 𝒳 is treated as a multiset of pointers: the same pointer can be inserted multiple times, and upon deletion, the multiplicity of the pointer is decreased by one. Naturally, the multiplicity of any pointer must be non-negative throughout the process (in particular, objects being deleted must have previously been inserted).

Theorem 1.

There is a dynamic algorithm in the oracle model that maintains a multiset 𝒳 of objects under updates insert(X) and delete(X). Upon query estimate(), it outputs a (1±ε)-approximation to vo(X𝒳X) with high probability. The amortized expected update time is O(log5(n/ε)/ε2), the query time is O(log4(n)/ε2), and the space complexity is O(n+log4(n)/ε2).

Note that since the algorithm operates in the general oracle model, it works well even for high-dimensional objects (e.g., for simplices in d, with polynomial dependence on d).

2.2 Streaming algorithm with insertions and suffix queries

In our remaining results, we turn to streaming algorithms and our driving question (Q2) and show that polylogarithmic time and space can be achieved in certain settings. We first consider the sliding window setting [22], which supports insertions of objects and querying over the last w objects for a fixed window size w; thus, objects are deleted in the same order as they are inserted. Numerous results and techniques have been developed in the sliding window setting (see [41, 3, 8] for an overview and [48, 30, 25] for recent work), but no such result was known for union volume estimation.

We obtain the first efficient sliding-window algorithm for union volume estimation. Again, it works in the general oracle model! Moreover, the result holds in an extension of the sliding-window setting, where at each time t=1,,n an object Xt is inserted (but cannot be deleted), and a query estimate(s) may return a (1±ε)-approximation to the volume of the suffix vo(XsXt) with high probability for any number s the user specifies.

Theorem 2.

There is an algorithm that implicitly maintains a sequence of objects X1,,Xt of aspect ratio M. The algorithm supports update insert(X), which appends an object X (as Xt+1) to the sequence, and query estimate(s), which outputs a (1±ε)-approximation to vo(XsXt) with high probability. The update time is O(log2(n/ε)/ε2), the query time is O(log(n)/ε2), and the space complexity is O(log(M)log(n)/ε2).

Our algorithm not only generalizes previous insertion-only results [40], but is also remarkably simple. Note that the space bound depends on the aspect ratio M, defined as the ratio of the largest volume of any object ever inserted and the smallest volume of any object ever inserted. In many applications, M is a polynomial in n and thus log(M)=O(logn). Furthermore, geometric algorithms in the sliding window setting [24, 20] usually have logarithmic dependencies on parameters such as the aspect ratio or spread.

2.3 Streaming algorithm for convex bodies with insertions and deletions

Lastly, we consider streaming algorithms that support both insertions and deletions. We manage to develop an efficient algorithm for a reasonably wide class of geometric objects – namely, convex bodies in any constant dimension:

Theorem 3.

Given Rr>0, there is an algorithm that implicitly maintains a multiset 𝒳 of convex bodies in [0,R]d, where each convex body contains a ball of radius r, under updates insert(X) and delete(X). Upon query estimate(), it outputs a (1±ε)-approximation to vo(X𝒳X) with high probability. The expected update and query time and space are O(poyog(nRεr)/ε2) for constant d.

The bounds depend polylogarithmically on R/r, which is common in volume estimation algorithms for a single convex object [23] as well as geometric streaming algorithms [29, 26].

Previously, Tirthapura and Woodruff obtained an efficient dynamic streaming algorithm only for axis-aligned boxes [47] (with poy(logn,logΔ,1ε,d) update time and space in a discrete universe {1,,Δ}d). To emphasize the generality of our algorithm, note that many non-convex objects can be decomposed into a small number of convex objects, e.g., non-convex polyhedra of constant combinatorial complexity in constant dimensions can be decomposed into a constant number of simplices, to which our algorithm can be applied.

3 Technical overview

3.1 Dynamic algorithm with insertions and deletions

Karp, Luby and Madras’ algorithm [34] and subsequent work are based on the observation that we can estimate the volume of a union U by maintaining a finite random subset S()U that selects every point independently with probability density 1/2. It turns out that the “right” choice of is one such that |S()|log(n)/ε2; in this case 2|S()| provides a good estimate of the volume of U.

Meel, Vinodchandran, and Chakraborty [40] described a particularly simple way to maintain such a random set S() for insertion-only updates: when a new object X is inserted, we remove from S() all points that are contained in X, then add to S() freshly sampled points in X with density 1/2. This step is inexpensive for the right choice of since |S()| is logarithmic. If |S()| becomes too big, we increment (thereby halving the sampling rate and also |S()| in expectation) and move on.

Difficulty arises in the presence of deletions: the volume is no longer monotonically increasing, and the right choice of may increase or decrease over time. Our first observation is that the deletion-only case can be handled by a variant of Meel, Vinodchandran, and Chakraborty’s insertion-only algorithm. Roughly, we can maintain S() for the right by keeping a counter on the number of objects containing each sample point (recall that |S()| is logarithmic for the right ). When an object X is deleted, we decrement the counters of all points in S()X, and when a counter drops to 0, the point is removed from S(). When the number of surviving sample points drops below logarithmic, we decrease , rebuild S() by iterating over all objects that has not been deleted (recall that we can store pointers to all objects), and reinitialize the counters.

A popular technique in dynamic computational geometry by Bentley and Saxe [4], called the logarithmic method, transforms deletion-only data structures into fully dynamic ones. It works by decomposing a fully dynamic set into logarithmically many deletion-only subsets, increasing the update and query time by typically just a logarithmic factor. The logarithmic method applies to so-called decomposable problems that satisfy the following property: if the input is decomposed into subsets, then the answer to the original problem can be quickly obtained from the answers to the individual subsets. Unfortunately, union volume estimation is not a decomposable problem: We cannot determine the volume of the union of 𝒳0𝒳logn just from the volume of the union of each 𝒳i.

Nevertheless, we show that a novel variant of the logarithmic method can still work. Recall that the deletion-only data structure already maintains a sample for each 𝒳i. For each sample point we keep track of more counters – specifically, how many sets from the other 𝒳i’s contain the point. These counters provide enough information to avoid double counting and help us estimate the union volume accurately. One issue though is that many counters need to be adjusted when one of the deletion-only data structures changes and recomputes S(). Fortunately, we manage to bound the total number of such changes, so the amortized cost for maintaining all counters remains polylogarithmic. See Section 5 for details.

3.2 Streaming algorithm with insertions and suffix queries

The dynamic algorithm with arbitrary insertions and deletions needs linear space because the data structure rebuilds on the remaining objects when the “right” decreases. However, in the sliding window setting and more generally the setting of suffix queries, the remaining objects are contiguous in time and need not be stored explicitly. We obtain a streaming algorithm in this case by a simple yet non-trivial generalization of Meel, Vinodchandran, and Chakraborty’s algorithm. Specifically, we keep the timestamp when each point in S() is sampled. For each we keep track of the largest timestamp s() such that discarding points older than s() from S() makes |S()| logarithmically bounded. This timestamp s() is monotonically increasing over time for each fixed . To estimate the volume of the union of XsXt for a given s at time t, we identify the smallest for which s()s, and output 2|S()(XsXt)|. See Section 6 in the full version [5] for details.

3.3 Streaming algorithm for convex bodies with insertions and deletions

Our streaming algorithm for low-dimensional convex objects for arbitrary insertions and deletions is based on another simple sampling strategy. First, it is not difficult to discretize the space d to a grid [Δ]d for some large Δ, so that the volume of the union U is close to the number of grid points in U[Δ]d. The idea now is to select a random subset R() of the grid [Δ]d in the beginning, and maintain the intersection S():=UR() during the updates. Using a pairwise independent family of hash functions, R() can be represented implicitly with logarithmically many bits.

When we insert or delete an object X, we just need to insert or delete XR() to or from S() (viewed as a multiset of points). An issue is that the space usage may be large for a S() with a “wrong” sampling rate, and we do not know which is the right choice beforehand. Furthermore, a wrong choice may become right at a later time. This issue can be resolved by representing S() by data structures for sparse vectors [26, 31], which support adding numbers to a given coordinate, as well as recovering the vector when its norm is below a threshold. In this way, we essentially just pay for the space at the right sampling rate.

A question remains: how to enumerate the points of XR() for a given object X and for our implicitly represented set R()? For the case where the objects are rotated (non-axis-aligned) boxes in constant dimension, and for a particular pairwise independent family of hash functions, we observe that this subproblem directly reduces to integer linear programming (ILP) with a constant number of constraints and variables, and therefore can be solved efficiently by well-known algorithms [38]. For more general convex objects in constant dimension, we bound each object X by a small rotated box BX, use an ILP to enumerate the points of BR() and discard those not in X. By “small” we mean that the volume of B is comparable to that of X, so in particular the number of discarded points is small. See Section 7 in the full version [5] for details.

Our approach is related to Tirthapura and Woodruff’s algorithm [47] for axis-aligned boxes. Their idea was to directly adapt a streaming algorithm for approximately counting distinct elements to estimate |U[Δ]d|: to insert or delete an object X, we cannot afford to literally insert or delete all points in |X[Δ]d|, but they showed how to efficiently simulate the effect for a specific distinct elements algorithm in the case of axis-aligned boxes. Our approach is more modular in that we apply sparse recovery only as a black box. Our main contribution however is the realization, via solving an ILP, that this type of approach works far more generally than for axis-aligned boxes, namely, for general convex objects.

4 Preliminaries

We assume that all relevant parameters (the precision ε, an upper bound n on the number of operations, etc.) are given at initialization. Knowing n is in line with the usual assumptions in streaming algorithms; it can easily be avoided but this complicates notation. The phrase “with high probability” means that the probability is at least 1nΩ(1). We denote [n]:={1,2,n}. The notation ab±c means that bcab+c. Similarly, a(1±ε)b means that (1ε)ba(1+ε)b, and we say that a is a (1±ε)-approximation to b.

As in all previous work, our algorithms exploit the close relation between volume estimation and sampling. The notion of -samples is central:

Definition 4 (-sample).

Let U be a measurable set and . A random finite subset SU is an -sample of U, denoted SPois(U,), if |SV|Pois(vo(V)/2) for every measurable subset VU.

It follows from this definition that: (i) if SPois(U,), then SVPois(V,) for any measurable subset VU; (ii) if SPois(U,) and TPois(V,) are independent and U,V are disjoint, then STPois(UV,).

Definition 5 (level).

For a measurable set U, we define eve(U) as the unique integer such that 32lognε2vo(U)2eve(U)<64lognε2.

We will see later that if SPois(U,) where eve(U), then |S| concentrates around its expectation vo(U)/2.

Let U denote the union we are interested in. Each of our algorithms morally maintains an -sample S() of U for every throughout the updates; upon query, it identifies some Leve(U) and outputs 2L|S(L)|. However, there are two pitfalls. First, the identification of L actually requires inspecting the outcomes of the random sets S(), so L is a random variable and this complicates the concentration analysis. Second, we cannot afford to maintain all sets S() at once. Our algorithms only explicitly store those S() with eve(U); for such we have 𝔼|S()|vo(U)/2eve(U)=Θ(log(n)/ε2). For eve(U) the set S() is too large and must be compressed or discarded. Naturally, this further complicates the algorithms.

5 Dynamic algorithm with insertions and deletions

In this section, we prove Theorem 1 by presenting a fully dynamic (non-streaming) algorithm for union volume estimation in linear space and polylogarithmic update time. Throughout we assume that the volume of each object is in the range [(3n/ε)2,(3n/ε)4]. The general case can be easily reduced to this case; see Lemma 4.1 in the full version [5].

5.1 Preparations

We will use the Karp–Luby–Madras algorithm as a subroutine:

Theorem 6 (Karp, Luby, Madras [34]).

Let n be a parameter. There is an algorithm KLM(𝒳) that computes a (1±0.5)-approximation to vo(X𝒳X) with probability at least 1n3 and runs in time O(|𝒳|logn).

We need a somewhat technical notion that is “close” to an -sample at the right level .

Definition 7.

Let U be a measurable set. A family of pairs {(1,R1),,(N,RN)} is called an ensemble of U if keve(U)±1 and RkPois(U,k) for all k[N]. A random pair (L,S) is called a (δ,N)-digest of U if there exists an ensemble of U such that ||N and [(L,S)]δ. The ensemble is called a support ensemble of the digest (L,S).

Lemma 8.

Fix measurable sets VU. If is an ensemble of U, then with probability at least 12||n4, we have |2|RV|vo(V)|εvo(U) for all (,R).

Proof.

Consider an arbitrary (,R). By definition, eve(U)+1 and RPois(U,). In particular, |RV|Pois(λ) where λ:=vo(V)/2. Let us write d:=εvo(U)/2ελ. By concentration of Poisson variables [11],

(|2|RV|vo(V)|>εvo(U))=(||RV|λ|>d)
2exp(d22(λ+d))2exp(εd2(1+ε))=2exp(ε2vo(U)2(1+ε)2)2e4logn2n4

where the second last step uses vo(U)2vo(U)2eve(U)+116lognε2. Taking a union bound over all (,R) proves the lemma.

Corollary 9.

Fix measurable sets VU. If S is a (δ,N)-digest of U, then

(|2L|SV|vo(V)|εvo(U))1δ2Nn4.

Proof.

Let be a support ensemble of (L,S), so ||N and [(L,S)]δ. The event in the statement is implied by (L,S) and the event in Lemma 8.

Lemma 10.

Let n and ε(0,14] be parameters. There is an algorithm erase-resample(𝒳,L) that, given a multiset 𝒳 of mn objects and a random variable L, returns a set S of size |S|=O(log(n)/ε2) such that (L,S) is a (δ,3)-digest of U:=X𝒳X for δ:=2n3+[Leve(U)±1]. The algorithm runs in time O(mlog(n)/ε2).

Algorithm 1 Digesting a decremental union.

Proof.

The algorithm is described as Algorithm 1. The bound on the size |S| is clear. The running time analysis is also easy: there are m iterations, each running in time O(log(n)/ε2) due to the bound on |S| (and on |S|+N).

Next, we show the correctness. Assume first that the algorithm does not return from the if-clause. Let X1,,Xm be the objects in 𝒳 in the order enumerated by the foreach-loop, and write U:=i=1mXi. We define the random set Xi(L) as the set of points sampled from Xi in the for-k-loop; observe that Xi(L)Pois(Xi,L) for every i[n]. Let Si be the set S at the end of the iteration for X=Xi. Note that with S0:= the algorithm computes Si=(Si1Xi)Xi(L) in each iteration. It follows that Si=j=1iXj(L)(Xj+1Xi). Since the random sets Xj(L)(Xj+1Xi)Pois(Xj(Xj+1Xi),L) are L-samples with disjoint supports and the union of supports is j=1iXj, we have SiPois(j=1iXj,L).

Now let us analyze the probability of the algorithm aborting. Observe that the algorithm aborts if and only if |Si|>160log(n)/ε2 for some i[n]. By the monotonicity of the size of the support j=1iXj, we have [|S1|>160log(n)/ε2][|Sn|>160log(n)/ε2]. Fix Leve(U)±1. Since (1+ε)vo(U)2L(1+ε)vo(U)2eve(U)1(1+ε)128lognε2160lognε2, we have

(|Sn|>160lognε2)(|Sn|>(1+ε)vo(U)2L)2n4,

where the second inequality follows from Lemma 8 by interpreting (L,Sn) as a size-1 ensemble of U and plugging in V:=U. By a union bound over all events |Si|>160log(n)/ε2, it follows that the algorithm aborts with probability at most 2n3, if Leve(U)±1.

If the algorithm does not abort, then we have shown above that it returns a set S=SnPois(j=1nXj,L)=Pois(U,L). It follows that we can compare the distribution of (L,S) with the size-3 ensemble :={(,Pois(U,)):eve(U)±1}. We can bound the error probability [(L,S)] by the probability that Leve(U)±1 plus the probability that the algorithm aborts assuming Leve(U)±1, and we have bounded the latter probability by 2n3. This proves the claim.

5.2 Digesting decremental union

Next we study the decremental setting. That is, we receive a set of objects 𝒳 and want to build a data structure that allows efficient deletions. At any time, it needs to quickly report a digest of the union of the surviving objects (i.e., objects that have not been deleted).

Algorithm 2 Digest data structure for decremental union.
Lemma 11.

Let n and ε(0,116] be parameters. Algorithm 2 supports initialize(𝒳), which initializes with a multiset 𝒳 of mn objects whose volumes are in [(3n/ε)2,(3n/ε)4], and delete(X), which removes object X from 𝒳. The algorithm maintains a pair (L,S) which is a (18n2,6n)-digest of X𝒳X at any point in time, and |S|=O(log(n)/ε2). In total, initialize and any sequence of delete operations run in expected time O(mlog2(n/ε)/ε2). The space complexity is O(m+log(n)/ε2).

Moreover, the set S only rarely gains new points: delete(X) returns true if the set S after the deletion is not a subset of the set S before the deletion (and false otherwise); and over any sequence of deletions only O(log(n/ε)) deletions return true, with probability 1O(n2).

Proof.

Fix the initial objects and an arbitrary sequence of m deletions. After t=0,1,,m deletions, let Ut be the union of the surviving objects, and let Lt,St be the variables L,S in the algorithm. We claim that (Lt,St) is a (9(t+1)n3,3(t+1))-digest of Ut.

Let us prove the claim by induction. First consider initialization (t=0). By Theorem 6, with probability at least 1n3 KLM computes v(1±0.5)vo(U0), and in this case the algorithm computes Leve(U0)±1. Thus, erase-resample returns a (3n3,3)-digest (L0,S0) of U0 by Lemma 10.

Now we proceed to t1. By the induction hypothesis, (Lt1,St1) is a (9tn3,3t)-digest of Ut1. Let be a support ensemble of (Lt1,St1). Define

:={(,RUt):(,R),eve(Ut)+1}.

Observe that ||||3t and is an ensemble of Ut since eve(Ut)eve(Ut+1) .

Let E be the event that (Lt1,St1). Let F be the event that |2|RUt|vo(Ut)|εvo(Ut1) for all (,R). Note that (E¯)9tn3 by the induction hypothesis, and (F¯)23tn4<6n3 by Lemma 8.

Assuming EF, we have Lt1eve(Ut1)±1 and 2Lt1|St1Ut|vo(Ut)±εvo(Ut1). Let us distinguish three cases and derive further consequences:

  1. (1)

    If Lt1eve(Ut), then

    |St1Ut|vo(Ut)2eve(Ut)εvo(Ut1)2eve(Ut1)132lognε2ε128lognε224lognε2.

    So the algorithm does not refresh. As a result, Lt=Lt1eve(Ut) and St=St1Ut, thus (Lt,St).

  2. (2)

    If Lt1eve(Ut)+2, then

    |St1Ut|vo(Ut)2eve(Ut)+2+εvo(Ut1)2eve(Ut1)1<16lognε2+ε128lognε224lognε2.

    So the algorithm refreshes. During refresh, the algorithm computes Leve(Ut)±1 with probability at least 11n3 by Theorem 6, and then we have Lt=min{Lt11,L}=Leve(Ut)±1. Hence, it returns a (3n3,3)-digest (Lt,St) of Ut by Lemma 10.

  3. (3)

    Otherwise Lt1=eve(Ut)+1, and the algorithm may or may not refresh. If it does, then (Lt,St) is a (3n3,3)-digest of Ut as in case (2). If it does not, then Lt=Lt1=eve(Ut)+1 and St=St1Ut, thus (Lt,St).

Taking all cases into account, recalling (EF¯)(E¯)+(F¯)9t+6n3, and adding the error probability 3n3 of the new digest after refreshing, we conclude that (Lt,St) is a (9(t+1)n3,3(t+1))-digest of Ut. (In particular, it is a (18n2,6n)-digest of the union of the remaining objects.)

As a consequence, with probability at least 1O(n2) we have L0eve(U0)±1 and Lm1eve(Um1)±1. On the other hand, eve(U0)O(log(n/ε)) and eve(Um1)0 (because each object has volume in [(3n/ε)2,(3n/ε)4]), and every refresh causes L to decrease by at least one. So the number of calls to refresh is bounded by O(log(n/ε)). Since we have StSt1 except when we do a refresh, it follows that the set S can only gain points during O(log(n/ε)) many deletions, with probability 1O(n2).

The size bound |S|=O(log(n)/ε2) follows from Lemma 10.

It remains to bound the running time and space usage. For initialize and refresh, the subroutine KLM runs in O(mlogn) time by Theorem 6; the subroutine erase-resample runs in O(mlog(n)/ε2) time by Lemma 10; and the loop runs in O(mlog(n)/ε2) time since |S|=O(log(n)/ε2) and each point in S is tested against at most m objects.

For delete, we spend O(log(n)/ε2) time in the loop. An extra O(mlog(n)/ε2) time may be incurred by a refresh. As we argued before, there are at most O(log(n/ε)) refreshes throughout the deletion sequence with probability 1O(n2). There can be at most m refreshes with the remaining probability O(n2). So the expected time for the whole deletion sequence is O(mlog(n)/ε2(log(n/ε)+m/n2))O(mlog2(n/ε)/ε2).

Finally, let us analyze the space complexity. Storing 𝒳 in a binary search tree needs O(m) space. Storing S and the counters mx in a table needs O(log(n)/ε2) space. Storing L needs constant space. So the algorithm uses O(m+log(n)/ε2) space in total.

5.3 Handling insertions

In this section, we apply the decremental data structure from the previous section to derive a dynamic algorithm for union volume estimation, using a novel variant of the logarithmic method [4]. Throughout the algorithm, the remaining objects are partitioned into bins 𝒳0,,𝒳logn. Each bin 𝒳j holds at most 2j objects and is implemented by the decremental data structure. Every now and then, we merge some (small) bins into a larger bin by re-initializing the target bin with the objects in the source bins. Between any two merges that involve a bin 𝒳j, it undergoes deletions only. At any time, we can access a digest (𝒳j.L,𝒳j.S) of the union X𝒳jX. Additionally, for every point x𝒳j.S, we keep track of the number nx:=#{X𝒳0𝒳j1:xX}.

Theorem 12.

Let n and ε^(0,116] be parameters. Algorithm 3 maintains an initially empty multiset 𝒳 of objects, where each object has volume in [(3n/ε^)2,(3n/ε^)4], under updates insert(X) and delete(X) and query estimate(), which (1±ε^)-approximates the volume of the union of 𝒳 and is correct with high probability. The amortized expected update time is O(log5(n/ε^)/ε^2), the query time is O(log4(n)/ε^2), and the space complexity is O(n+log4(n)/ε^2).

Algorithm 3 Dynamic union volume estimation with arbitrary insertions and deletions.

Proof.

Fix a sequence of at most n insertions and deletions. Then the partition of surviving objects into bins 𝒳1,,𝒳logn is determined; in particular Uj:=X𝒳jX is determined, and we write Vj:=Uj(U0Uj1). Note that the union of the surviving objects U:=j=0lognUj=j=0lognVj is a disjoint union of Vj’s, thus vo(U)=j=0lognvo(Vj).

Now let us consider a call to estimate. By Lemma 11, each Sj is a (18n2,6n)-digest of Uj. Note that the algorithm computes Rj:=VjSj, so by Corollary 9, we have 2Lj|Rj|vo(Vj)±εvo(Uj) with probability at least 118n212nn4=1O(n2). By a union bound, this holds for all j simultaneously with probability 1O(n1). Under this event,

j=0logn2Lj|Rj|vo(U)±εj=0lognvo(Uj).

We can crudely bound the additive error by ε(1+logn)vo(U)=ε^vo(U), just as desired.

Next we analyze the running time. We will charge the cost of delete to insertions. Note that in delete, it takes time O(log2(n)) to compute the bin j containing X, if for each j we store (pointers to) all objects in 𝒳j in a binary search tree. The last for-loop takes time O(log2(n)/ε2). To bound the running time of the “if refreshed” block, we change our viewpoint and focus on the sequence of deletions occurring between two merges of a particular bin 𝒳j.

  • The total cost of 𝒳j.delete is O(2jlog2(n/ε)/ε2) in expectation by Lemma 11.

  • With probability 1O(n2), there are O(log(n/ε)) refreshes between two merges of bin 𝒳j by Lemma 11, so the if-block is executed O(log(n/ε)) times. Each time, the algorithm recomputes nx for every xSj by testing against at most k=0j12k2j objects, which takes time O(2jlog(n)/ε2). Therefore, the total contribution of the if-block is O(2jlog2(n/ε)/ε2) in expectation.

Therefore, over the sequence of deletions between two merges of 𝒳j, deletions from 𝒳j take expected total time O(2jlog2(n/ε)/ε2). Note that at least 2j insertions occur between two merges of bin 𝒳j. We can thus charge the cost of deletions to insertions. Each insertion is charged O(logn) times (once for every bin), so we charge each insertion with a cost of O(log3(n/ε)/ε2) in expectation.

Now we analyze the running time of insert. It depends on the value h. By Lemma 11, the merge step costs O(j=0h2jlog2(n/ε)/ε2)=O(2hlog2(n/ε)/ε2), which can be expensive in the worst case. However, bin 𝒳h is merged at most once every 2h updates, so it contributes amortized cost O(log2(n/ε)/ε2) to each insertion. Summing over all h, the amortized cost of merges is O(log3(n/ε)/ε2) per insertion. Next we consider the foreach-loops. Since each digest contains O(log(n)/ε2) points by Lemma 11, and the algorithm spends constant time on each point, these loops take time O(log2(n)/ε2). To summarize, insert runs in amortized expected time O(log3(n/ε)/ε2)=O(log5(n/ε)/ε^2) (and delete runs in amortized time 0).

The running time of estimate is clearly O(log2(n)/ε2)=O(log4(n)/ε^2).

The space of bin 𝒳j is O(2j+log(n)/ε2) by Lemma 11, and we can charge the space of counters nx to it. In total the space complexity is O(j=0logn(2j+log(n)/ε2))=O(n+log4(n)/ε^2).

Theorem 1 now follows from Theorem 12 together with Lemma 4.1 in [5].

References

  • [1] Pankaj K. Agarwal, Lars Arge, and Frank Staals. Improved dynamic geodesic nearest neighbor searching in a simple polygon. In Proc. 34th International Symposium on Computational Geometry (SoCG), volume 99 of LIPIcs, pages 4:1–4:14, 2018. doi:10.4230/LIPIcs.SOCG.2018.4.
  • [2] Pankaj K. Agarwal, Hsien-Chih Chang, Subhash Suri, Allen Xiao, and Jie Xue. Dynamic geometric set cover and hitting set. ACM Transactions on Algorithms, 18(4):40:1–40:37, 2022. doi:10.1145/3551639.
  • [3] Brian Babcock, Shivnath Babu, Mayur Datar, Rajeev Motwani, and Jennifer Widom. Models and issues in data stream systems. In Proc. 21st ACM Symposium on Principles of Database Systems (PODS), pages 1–16, 2002. doi:10.1145/543613.543615.
  • [4] Jon Louis Bentley and James B Saxe. Decomposable searching problems I. Static-to-dynamic transformation. Journal of Algorithms, 1(4):301–358, 1980. doi:10.1016/0196-6774(80)90015-2.
  • [5] Sujoy Bhore, Karl Bringmann, Timothy M. Chan, and Yanheng Wang. Dynamic and streaming algorithms for union volume estimation, 2026. arXiv:2602.16306.
  • [6] Sujoy Bhore and Timothy M. Chan. Fast static and dynamic approximation algorithms for geometric optimization problems: Piercing, independent set, vertex cover, and matching. In Proc. 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2357–2386, 2025. doi:10.1137/1.9781611978322.79.
  • [7] Sujoy Bhore, Martin Nöllenburg, Csaba D. Tóth, and Jules Wulms. Fully dynamic maximum independent sets of disks in polylogarithmic update time. In 40th International Symposium on Computational Geometry (SoCG), volume 293 of LIPIcs, pages 19:1–19:16, 2024. doi:10.4230/LIPIcs.SOCG.2024.19.
  • [8] Vladimir Braverman. Sliding window algorithms. In Ming-Yang Kao, editor, Encyclopedia of Algorithms, pages 2006–2011. Springer New York, New York, NY, 2016. doi:10.1007/978-1-4939-2864-4_797.
  • [9] Karl Bringmann and Tobias Friedrich. Approximating the volume of unions and intersections of high-dimensional geometric objects. Computational Geometry, 43(6-7):601–610, 2010. doi:10.1016/J.COMGEO.2010.03.004.
  • [10] Karl Bringmann, Kasper Green Larsen, André Nusser, Eva Rotenberg, and Yanheng Wang. Approximating Klee’s measure problem and a lower bound for union volume estimation. In Proc. 41st International Symposium on Computational Geometry (SoCG), pages 25:1–25:16, 2025. doi:10.4230/LIPIcs.SOCG.2025.25.
  • [11] Clément Canonne. A short note on Poisson tail bounds, 2019. URL: https://github.com/ccanonne/probabilitydistributiontoolbox/blob/master/poissonconcentration.pdf.
  • [12] Nofar Carmeli, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld, and Mirek Riedewald. Tractable orders for direct access to ranked answers of conjunctive queries. ACM Transactions on Database Systems, 48(1):1–45, 2023. doi:10.1145/3578517.
  • [13] Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Benny Kimelfeld, and Nicole Schweikardt. Answering (unions of) conjunctive queries using random access and random-order enumeration. In Proc. 39th ACM Symposium on Principles of Database Systems (PODS), pages 393–409, 2020. doi:10.1145/3375395.3387662.
  • [14] Supratik Chakraborty, Kuldeep S. Meel, and Moshe Y. Vardi. A scalable approximate model counter. In Proc. 19th International Conference on Principles and Practice of Constraint Programming (CP), pages 200–216, 2013. doi:10.1007/978-3-642-40627-0_18.
  • [15] Timothy M. Chan. A (slightly) faster algorithm for Klee’s measure problem. Computational Geometry, 43(3):243–250, 2010. doi:10.1016/J.COMGEO.2009.01.007.
  • [16] Timothy M. Chan. Klee’s measure problem made easy. In Proc. 54th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 410–419, 2013. doi:10.1109/FOCS.2013.51.
  • [17] Timothy M. Chan, Qizheng He, Subhash Suri, and Jie Xue. Dynamic geometric set cover, revisited. SIAM Journal on Computing, 54(3):664–701, 2025. doi:10.1137/23M1596582.
  • [18] Timothy M. Chan and Zhengcheng Huang. Dynamic geometric connectivity in the plane with constant query time. In 40th International Symposium on Computational Geometry (SoCG), volume 293 of LIPIcs, pages 36:1–36:13, 2024. doi:10.4230/LIPIcs.SOCG.2024.36.
  • [19] Timothy M. Chan, Mihai Pătraşcu, and Liam Roditty. Dynamic connectivity: Connecting to networks and geometry. SIAM Journal on Computing, 40(2):333–349, 2011. doi:10.1137/090751670.
  • [20] Timothy M. Chan and Bashir S. Sadjad. Geometric optimization problems over sliding windows. Int. J. Comput. Geom. Appl., 16(2-3):145–158, 2006. doi:10.1142/S0218195906001975.
  • [21] Nilesh N. Dalvi and Dan Suciu. Efficient query evaluation on probabilistic databases. The VLDB Journal, 16(4):523–544, 2007. doi:10.1007/S00778-006-0004-3.
  • [22] Mayur Datar, Aristides Gionis, Piotr Indyk, and Rajeev Motwani. Maintaining stream statistics over sliding windows. SIAM Journal on Computing, 31(6):1794–1813, 2002. doi:10.1137/S0097539701398363.
  • [23] Martin E. Dyer, Alan M. Frieze, and Ravi Kannan. A random polynomial time algorithm for approximating the volume of convex bodies. Journal of the ACM, 38(1):1–17, 1991. doi:10.1145/102782.102783.
  • [24] Joan Feigenbaum, Sampath Kannan, and Jian Zhang. Computing diameter in the streaming and sliding-window models. Algorithmica, 41(1):25–41, 2005. doi:10.1007/S00453-004-1105-2.
  • [25] Shiyuan Feng, William Swartworth, and David P. Woodruff. Tight bounds for heavy-hitters and moment estimation in the sliding window model. In Proc. 52nd International Colloquium on Automata, Languages, and Programming (ICALP), pages 75:1–75:19, 2025. doi:10.4230/LIPIcs.ICALP.2025.75.
  • [26] Gereon Frahling, Piotr Indyk, and Christian Sohler. Sampling in dynamic data streams and applications. In Proc. 21st ACM Symposium on Computational Geometry (SoCG), pages 142–149, 2005. doi:10.1145/1064092.1064116.
  • [27] Egor Gorbachev and Marvin Künnemann. Combinatorial designs meet hypercliques: Higher lower bounds for Klee’s measure problem and related problems in dimensions d4. In Proc. 39th International Symposium on Computational Geometry (SoCG), pages 36:1–36:14, 2023. doi:10.4230/LIPIcs.SOCG.2023.36.
  • [28] Monika Henzinger, Stefan Neumann, and Andreas Wiese. Dynamic approximate maximum independent set of intervals, hypercubes and hyperrectangles. In 36th International Symposium on Computational Geometry (SoCG), volume 164 of LIPIcs, pages 51:1–51:14, 2020. doi:10.4230/LIPIcs.SOCG.2020.51.
  • [29] Piotr Indyk. Algorithms for dynamic geometric problems over data streams. In Proc. 36th annual ACM Symposium on Theory of Computing, pages 373–380, 2004. doi:10.1145/1007352.1007413.
  • [30] Rajesh Jayaram, David P. Woodruff, and Samson Zhou. Truly perfect samplers for data streams and sliding windows. In Proc. 41st ACM Symposium on Principles of Database Systems (PODS), pages 29–40, 2022. doi:10.1145/3517804.3524139.
  • [31] Hossein Jowhari, Mert Saglam, and Gábor Tardos. Tight bounds for Lp samplers, finding duplicates in streams, and related problems. In Proc. 30th ACM Symposium on Principles of Database Systems (PODS), pages 49–58, 2011. doi:10.1145/1989284.1989289.
  • [32] David R. Karger. A randomized fully polynomial time approximation scheme for the all-terminal network reliability problem. SIAM Review, 43(3):499–522, 2001. doi:10.1137/S0036144501387141.
  • [33] Richard M. Karp and Michael Luby. Monte-Carlo algorithms for the planar multiterminal network reliability problem. Journal of Complexity, 1(1):45–64, 1985. doi:10.1016/0885-064X(85)90021-4.
  • [34] Richard M. Karp, Michael Luby, and Neal Madras. Monte-Carlo approximation algorithms for enumeration problems. Journal of Algorithms, 10(3):429–448, 1989. doi:10.1016/0196-6774(89)90038-2.
  • [35] Benny Kimelfeld, Yuri Kosharovsky, and Yehoshua Sagiv. Query efficiency in probabilistic XML models. In Proc. ACM SIGMOD International Conference on Management of Data, pages 701–714, 2008. doi:10.1145/1376616.1376687.
  • [36] Victor Klee. Can the measure of 1n[ai,bi] be computed in less than O(nlogn) steps? The American Mathematical Monthly, 84(4):284–285, 1977. doi:10.1080/00029890.1977.11994336.
  • [37] Marvin Künnemann. A tight (non-combinatorial) conditional lower bound for Klee’s measure problem in 3D. In Proc. 63rd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 555–566, 2022. doi:10.1109/FOCS54457.2022.00059.
  • [38] Hendrik W. Lenstra Jr. Integer programming with a fixed number of variables. Mathematics of Operations Research, 8(4):538–548, 1983. doi:10.1287/moor.8.4.538.
  • [39] Kuldeep S. Meel, Sourav Chakraborty, and N. V. Vinodchandran. Estimation of the size of union of Delphic sets: Achieving independence from stream size. In Proc. 41st ACM Symposium on Principles of Database Systems (PODS), pages 41–52, 2022. doi:10.1145/3517804.3526222.
  • [40] Kuldeep S. Meel, N. V. Vinodchandran, and Sourav Chakraborty. Estimating the size of union of sets in streaming models. In Proc. 40th ACM Symposium on Principles of Database Systems (PODS), pages 126–137, 2021. doi:10.1145/3452021.3458333.
  • [41] Shanmugavelayutham Muthukrishnan. Data streams: Algorithms and applications. Foundations and Trends® in Theoretical Computer Science, 1(2):117–236, 2005. doi:10.1561/0400000002.
  • [42] Mridul Nandi, N. V. Vinodchandran, Arijit Ghosh, Kuldeep S. Meel, Soumit Pal, and Sourav Chakraborty. Improved streaming algorithm for the Klee’s measure problem and generalizations. In Proc. 27th International Workshop on Approximation, Randomization, and Combinatorial Optimization (APPROX/RANDOM), pages 26:1–26:21, 2024. doi:10.4230/LIPIcs.APPROX/RANDOM.2024.26.
  • [43] Yakov Nekrich. Dynamic planar point location in optimal time. In 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 1003–1014, 2021. doi:10.1145/3406325.3451100.
  • [44] Mark H. Overmars and Chee-Keng Yap. New upper bounds in Klee’s measure problem. SIAM Journal on Computing, 20(6):1034–1045, 1991. doi:10.1137/0220065.
  • [45] A. Pavan, N. Variyam Vinodchandran, Arnab Bhattacharyya, and Kuldeep S. Meel. Model counting meets F0 estimation. ACM Transactions on Database Systems, 48(3):1–28, 2023. doi:10.1145/3603496.
  • [46] Christopher Ré, Nilesh Dalvi, and Dan Suciu. Efficient top-k query evaluation on probabilistic data. In Proc. 23rd IEEE International Conference on Data Engineering, pages 886–895, 2006. doi:10.1109/ICDE.2007.367934.
  • [47] Srikanta Tirthapura and David Woodruff. Rectangle-efficient aggregation in spatial data streams. In Proc. 31st ACM Symposium on Principles of Database Systems (PODS), pages 283–294, 2012. doi:10.1145/2213556.2213595.
  • [48] David P. Woodruff and Samson Zhou. Tight bounds for adversarially robust streams and sliding windows via difference estimators. In Proc. 62nd Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 1183–1196, 2021. doi:10.1109/FOCS52979.2021.00116.