An Optimal Dynamic Data Structure for Stabbing-Semigroup Queries

Let $S$ be a set of $n$ intervals in $\mathbb{R}$, and let $(\mathbf{S}, +)$ be any commutative semigroup. We assign a weight $\omega(s) \in \mathbf{S}$ to each interval in $S$. For a point $x \in \mathbb{R}$, let $S(x) \subseteq S$ be the set of intervals that contain $x$. Given a point $q \in \mathbb{R}$, the stabbing-semigroup query asks for computing $\sum_{s \in S(q)} \omega(s)$. We propose a linear-size dynamic data structure, under the pointer-machine model, that answers queries in worst-case $O(\log n)$ time and supports both insertions and deletions of intervals in amortized $O(\log n)$ time. It is the first data structure that attains the optimal $O(\log n)$ bound for all three operations. Furthermore, our structure can easily be adapted to external memory, where we obtain a linear-size structure that answers queries and supports updates in $O(\log_B n)$ I/Os, where $B$ is the disk block size. For the restricted case of a nested family of intervals (either every pair of intervals is disjoint or one contains the other), we present a simpler solution based on dynamic trees.

[1]  Norbert Zeh,et al.  External-memory algorithms and data structures , 2010 .

[2]  Pankaj K. Agarwal,et al.  An optimal dynamic interval stabbing-max data structure? , 2005, SODA '05.

[3]  Stephen Alstrup,et al.  Marked ancestor problems , 1998, Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280).

[4]  Robert E. Tarjan,et al.  A data structure for dynamic trees , 1981, STOC '81.

[5]  Robert E. Tarjan,et al.  A Class of Algorithms which Require Nonlinear Time to Maintain Disjoint Sets , 1979, J. Comput. Syst. Sci..

[6]  H. Edelsbrunner A new approach to rectangle intersections part I , 1983 .

[7]  Haim Kaplan,et al.  Dynamic rectangular intersection with priorities , 2003, STOC '03.

[8]  Alok Aggarwal,et al.  The input/output complexity of sorting and related problems , 1988, CACM.

[9]  Xin-She Yang,et al.  Introduction to Algorithms , 2021, Nature-Inspired Optimization Algorithms.

[10]  S. Muthukrishnan,et al.  Efficient Dynamic Method-Lookup for Object Oriented Languages (Extended Abstract) , 1996, Embedded Systems and Applications.

[11]  Jennifer Widom,et al.  Incremental computation and maintenance of temporal aggregates , 2003, The VLDB Journal.

[12]  Jeffrey Scott Vitter,et al.  Optimal External Memory Interval Management , 2003, SIAM J. Comput..

[13]  Lars Arge,et al.  External Memory Data Structures , 2001, ESA.

[14]  Anja Feldmann,et al.  Tradeoffs for packet classification , 2000, Proceedings IEEE INFOCOM 2000. Conference on Computer Communications. Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies (Cat. No.00CH37064).

[15]  X. Liy Dynamic Algorithms in Computational Geometry , 2007 .

[16]  Mikkel Thorup Space efficient dynamic stabbing with fast queries , 2003, STOC '03.

[17]  Nick McKeown,et al.  Algorithms for packet classification , 2001, IEEE Netw..

[18]  Andrew Chi-Chih Yao,et al.  Should Tables Be Sorted? , 1981, JACM.

[19]  Sartaj Sahni,et al.  Data structures for one-dimensional packet classification using most-specific-rule matching , 2002, Proceedings International Symposium on Parallel Architectures, Algorithms and Networks. I-SPAN'02.

[20]  Kurt Mehlhorn,et al.  Dynamic fractional cascading , 1990, Algorithmica.

[21]  Erik D. Demaine,et al.  Logarithmic Lower Bounds in the Cell-Probe Model , 2005, SIAM J. Comput..

[22]  Clifford Stein,et al.  Introduction to Algorithms, 2nd edition. , 2001 .

[23]  Mark de Berg,et al.  Computational geometry: algorithms and applications , 1997 .

[24]  Mark de Berg,et al.  Multi-method dispatching: a geometric approach with applications to string matching problems , 1999, STOC '99.

[25]  VitterJeffrey Scott External memory algorithms and data structures , 2001 .