English

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

Data Structures and Algorithms 2026-01-15 v1

Abstract

This paper addresses the Counting Long Aggregated Visits problem, which is defined as follows. We are given nn users and mm regions, where each user spends some time visiting some regions. For a parameter kk and a query consisting of a subset of rr regions, the task is to count the number of distinct users whose aggregate time spent visiting the query regions is at least kk. This problem is motivated by queries arising in the analysis of large-scale mobility datasets. We present several exact and approximate data structures for supporting counting long aggregated visits, as well as conditional and unconditional lower bounds. First, we describe an exact data structure that exhibits a space-time tradeoff, as well as efficient approximate solutions based on sampling and sketching techniques. We then study the problem in geometric settings where regions are points in Rd\mathbb{R}^d and queries are hyperrectangles, and derive exact data structures that achieve improved performance in these structured spaces.

Keywords

Cite

@article{arxiv.2601.09489,
  title  = {How many users have been here for a long time? Efficient solutions for counting long aggregated visits},
  author = {Peyman Afshani and Rezaul Chowdhury and Inge Li Gørtz and Mayank Goswami and Francesco Silvestri and Mariafiore Tognon},
  journal= {arXiv preprint arXiv:2601.09489},
  year   = {2026}
}
R2 v1 2026-07-01T09:04:21.184Z