Skip to main content
QUICK REVIEW

[Paper Review] An Embarrassingly Parallel Optimal-Space Cardinality Estimation Algorithm

Emin Karayel|arXiv (Cornell University)|Jan 1, 2023
Cryptography and Data SecurityComputer Science2 citations
TL;DR

This paper presents a novel, embarrassingly parallel cardinality estimation algorithm that achieves optimal space complexity of O(ε⁻² ln(δ⁻¹) + ln n), matching Błasiok's 2020 sequential optimal algorithm, while enabling efficient merge operations for distributed and parallel processing. The method transforms Błasiok's algorithm into a history-independent, mergeable form using a novel hash-based state representation and a randomized merge procedure, reducing implementation complexity and the number of required pseudo-random objects.

ABSTRACT

In 2020 Blasiok (ACM Trans. Algorithms 16(2) 3:1-3:28) constructed an optimal space streaming algorithm for the cardinality estimation problem with the space complexity of $\mathcal O(\varepsilon^{-2} \ln(δ^{-1}) + \ln n)$ where $\varepsilon$, $δ$ and $n$ denote the relative accuracy, failure probability and universe size, respectively. However, his solution requires the stream to be processed sequentially. On the other hand, there are algorithms that admit a merge operation; they can be used in a distributed setting, allowing parallel processing of sections of the stream, and are highly relevant for large-scale distributed applications. The best-known such algorithm, unfortunately, has a space complexity exceeding $Ω(\ln(δ^{-1}) (\varepsilon^{-2} \ln \ln n + \ln n))$. This work presents a new algorithm that improves on the solution by Blasiok, preserving its space complexity, but with the benefit that it admits such a merge operation, thus providing an optimal solution for the problem for both sequential and parallel applications. Orthogonally, the new algorithm also improves algorithmically on Blasiok's solution (even in the sequential setting) by reducing its implementation complexity and requiring fewer distinct pseudo-random objects.

Motivation & Objective

  • To address the lack of optimal-space, mergeable cardinality estimation algorithms in distributed streaming settings.
  • To preserve the optimal space complexity O(ε⁻² ln(δ⁻¹) + ln n) of Błasiok's 2020 sequential algorithm while enabling parallel and distributed processing.
  • To reduce implementation complexity and the number of distinct pseudo-random objects required compared to prior mergeable algorithms.
  • To provide a solution that is both optimal in space and fully compatible with distributed systems, including Map-Reduce and OLAP pipelines.

Proposed method

  • Transforms Błasiok's sequential optimal-space algorithm into a history-independent form, ensuring state determinism regardless of stream element order.
  • Introduces a novel merge operation that combines states from independent processing units by aggregating hash-based counters using a randomized merge procedure.
  • Employs a hierarchical hash structure where each level tracks the minimum hash value in a subset of the stream, enabling efficient merging.
  • Uses a randomized sampling strategy to estimate the number of distinct elements based on the minimum hash values observed at each level.
  • Applies concentration bounds and tail inequalities (e.g., Markov’s and Chebyshev’s inequalities) to prove correctness and error bounds under the merge operation.
  • Reduces the number of required pseudo-random objects by reusing hash functions across levels and processes, improving efficiency.

Experimental results

Research questions

  • RQ1Can an optimal-space cardinality estimation algorithm be made both mergeable and embarrassingly parallel without sacrificing space efficiency?
  • RQ2How can Błasiok’s 2020 optimal-space sequential algorithm be modified to support a deterministic merge operation across distributed processes?
  • RQ3What is the minimal number of pseudo-random objects required to achieve optimal space complexity in a mergeable setting?
  • RQ4Can the implementation complexity of existing mergeable algorithms be reduced while maintaining optimal space and error bounds?
  • RQ5Does the proposed merge operation preserve the relative error guarantee ε and failure probability δ of the original algorithm?

Key findings

  • The proposed algorithm achieves the optimal space complexity of O(ε⁻² ln(δ⁻¹) + ln n), matching Błasiok’s 2020 sequential algorithm.
  • The algorithm supports a fully distributed, embarrassingly parallel execution model with a correct and efficient merge operation.
  • The merge operation is proven to preserve the original algorithm’s error bounds, ensuring P(|Y − |A|| ≤ ε|A|) ≥ 1 − δ.
  • The method reduces the number of required distinct pseudo-random objects compared to prior mergeable algorithms, improving practical efficiency.
  • The algorithm is history-independent: the final state depends only on the set of elements processed, not their order or execution tree structure.
  • Theoretical analysis confirms that the merge operation maintains concentration properties, with failure probability bounded by δ and error bounded by ε.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.