Nearly Optimal Distinct Elements and Heavy Hitters on Sliding Windows

Abstract

We study the distinct elements and p-heavy hitters problems in the sliding window model, where only the most recent n elements in the data stream form the underlying set. We first introduce the composable histogram, a simple twist on the exponential (Datar et al., SODA 2002) and smooth histograms (Braverman and Ostrovsky, FOCS 2007) that may be of independent interest. We then show that the composable histogram along with a careful combination of existing techniques to track either the identity or frequency of a few specific items suffices to obtain algorithms for both distinct elements and p-heavy hitters that are nearly optimal in both n and ε. Applying our new composable histogram framework, we provide an algorithm that outputs a (1+ε)-approximation to the number of distinct elements in the sliding window model and uses O(1ε2 n1ε n+1ε2 n) bits of space. For p-heavy hitters, we provide an algorithm using space O(1εp3 n( n+1ε)) for 0<p 2, improving upon the best-known algorithm for 2-heavy hitters (Braverman et al., COCOON 2014), which has space complexity O(1ε43 n). We also show lower bounds of (1ε2 n+1ε2 n) for distinct elements and (1εp2 n) for p-heavy hitters.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…