NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

How many users have been here for a long time? Efficient solutions for counting long aggregated visits

Peyman Afshani, Rezaul Chowdhury, Inge Li Gørtz, Mayank Goswami, Francesco Silvestri, Mariafiore TognonarXiv 2026

TL;DR

This paper introduces and analyzes the Counting Long Aggregated Visits (CLAV) problem, a framework designed to query massive mobility datasets while preserving user privacy. The authors provide a comprehensive suite of exact and approximate data structures alongside tight theoretical lower bounds for both general and geometric settings.

What Problem Does This Paper Address?

Large-scale mobility data—collected via GPS or mobile network logs—is massive. Companies like TomTom and Vodafone log tens of billions of data points daily. To make sense of this data for urban planning, economics, or tourism, analysts need to answer cross-regional, threshold-based queries such as: "How many distinct commuters spent more than 1 hour total stuck on a specific set of highway segments?"

Existing spatiotemporal data structures or streaming algorithms fall short here. They either fail to aggregate time across arbitrary combinations of regions specified only at query time, or their space requirements scale poorly with user dwell times. Furthermore, due to privacy concerns, these systems must return aggregate counts rather than tracking or listing individual user identities. The authors formalize this challenge as the CLAV problem, aiming to optimize the space-time tradeoffs for these complex queries.

Methods

The authors analyze the problem under two main settings: general $(k, r)$-CLAV (where regions are abstract sets) and Geometric-CLAV (where regions are points in $\mathbb{R}^d$ and queries are hyperrectangles). They propose several novel algorithmic approaches:

  • Exact General Case: They design a data structure that partitions regions into "large" and "small" sets based on user traffic. This allows them to balance precomputation space against query time, establishing a provably tight space-time tradeoff.
  • Sampling-Based Approximation: For scenarios where linear space is required, they introduce a method that samples data triplets uniformly at random. This creates an unbiased estimator of the user count with provable additive error guarantees via Hoeffding's inequality.
  • Sketch-Based Approximation: To drastically compress the data, they combine Flajolet-Martin (FM) sketches (used for distinct counting) with Count-Min sketches (used for frequency tracking). By replacing the standard bit positions of an FM sketch with Count-Min counters, they create mergeable summaries for each region.
  • Geometric Case: For spatial data, they reduce the problem to a 2D colored dominance counting problem in 1D space, and then leverage tabulation techniques to scale the solution to higher dimensions.

Datasets

This is a purely theoretical paper focused on data structure design and complexity analysis; therefore, no empirical evaluation on physical datasets was conducted. However, the practical utility of the problem is motivated by real-world data scales, such as Vodafone's 30 billion daily records in Italy and TomTom's 61 billion daily GPS points.

Key Insights and Ideas

  • The Merging Challenge: Standard heavy-hitter or distinct-counting sketches cannot filter users based on a cross-regional predicate when the query regions are completely unknown during the preprocessing phase.
  • FM + Count-Min Synergy: The "aha moment" for the approximate sketch lies in replacing the bits of an FM sketch with Count-Min counters. This elegantly tracks both distinct user identities and their aggregated time across merged region sketches without letting the space complexity explode based on total dwell times.
  • Proving Hardness: By linking the CLAV problem to foundational hardness conjectures in computer science—specifically the $r$-Set Disjointness Conjecture and the Boolean-Matrix-Multiplication (BMM) Conjecture—the authors prove that their proposed space-time tradeoffs are nearly optimal and that the problem is inherently difficult.

Key Results

The paper's main contributions are theoretical upper and lower bounds, which are comprehensively mapped out in the paper's summary table:

Summary of upper and lower bounds for CLAV variants.
  • Exact $(k,r)$-CLAV: Achieves a query time of $\tilde{O}(r\lambda)$ using $O((N/\lambda)^r n + N)$ space, matching the conditional lower bound.
  • Sketch-Based Approximation: Reduces space requirements to just $O(m\epsilon^{-1}\log^2 n \log r)$ bits while maintaining a fast query time of $O(\epsilon^{-1}\log^2 n)$.
  • Geometric CLAV: In $d$ dimensions, the exact solution achieves an efficient $O(\log_w n_{Q,k})$ query time using $O(\min\{Nm^{2d-2}, m^{2d}\})$ space.

Limitations and Future Work

A primary limitation of the exact solutions is their exponential dependency on either the query size $r$ (in the general case) or the spatial dimension $d$ (in the geometric case), making them less practical for high-dimensional data or massive region combinations. Additionally, the sketch-based approximation introduces a slight relaxation in its guarantees: it may occasionally include users whose aggregate time is slightly below the threshold (up to a factor of $1 - 1/r$).

For future work, the authors conjecture that the sketch size could be further optimized from a dependency of $\epsilon^{-1}$ to $\epsilon^{-2}$ by utilizing more advanced $\epsilon$-approximate distinct counting sketches. Implementing and benchmarking these structures on actual planetary-scale mobility data also remains an open practical next step.

Summary updated

BibTeX
@misc{afshani2026how,
  author = {Peyman Afshani and Rezaul Chowdhury and Inge Li Gørtz and Mayank Goswami and Francesco Silvestri and Mariafiore Tognon},
  title = {{How many users have been here for a long time? Efficient solutions for counting long aggregated visits}},
  year = {2026},
  eprint = {2601.09489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.09489},
}
Figure