Streaming Euclidean k-median and k-means with o(log n) Space

Vincent Cohen-Addad, David P. Woodruff, Samson Zhou · DOI

Introduction

Clustering is a cornerstone of data science, with $k$-median and $k$-means being the most widely used objectives. In the streaming model, data points arrive sequentially, and the challenge is to maintain a high-quality clustering using minimal memory—ideally far less than the total number of points $n$.

For over two decades, the "merge-and-reduce" framework has been the standard for building coresets (small, weighted proxies for the full dataset) in streams. However, this framework inherently incurs a "logarithmic tax," requiring $O(\log n)$ words of memory due to its binary tree structure. This paper shatters this long-held belief, demonstrating that approximate clustering is possible in $o(\log n)$ (sub-logarithmic) space for insertion-only streams.

Methods: Bypassing Traditional Constraints

The authors introduce three primary innovations to overcome the space limitations of traditional streaming algorithms.

1. Online Sensitivity Sampling

Traditional coreset construction often relies on offline sensitivity sampling. The authors develop an online variant, based on the insight that a coreset maintained up to time $t-1$ provides a sufficiently accurate estimate of the "importance" (sensitivity) of the point arriving at time $t$. By sampling points based on these evolving estimates, they generate a much smaller "implicit stream" that can be processed by standard frameworks without the typical space explosion.

2. Wasserstein-$z$ Bicriteria Embedding

To handle the $k$-means objective ($z=2$) and dynamic streams, the paper proposes a new quadtree-based embedding. While standard quadtrees often suffer from high distortion for $k$-means, this method achieves low distortion by employing a "bicriteria" approximation. By outputting slightly more than $k$ centers (specifically $O(k)$), the algorithm ensures the clustering cost is preserved even across cell boundaries.

Hierarchical structure of streaming clustering frameworks.

3. Two-Pass Dynamic Strategy

For dynamic streams involving deletions, the authors prove that a single-pass algorithm cannot break the $o(\log n)$ space barrier. They circumvent this mathematical impossibility with a two-pass approach: the first pass estimates sensitivities, and the second pass performs sampling using sparse recovery sketches.

Key Results

The primary contribution is a one-pass algorithm for $(k, z)$-clustering in insertion-only streams that uses $\tilde{O}(\frac{dk}{\epsilon^2} \cdot \text{poly}(\log \log(n\Delta)))$ words of memory. This represents the first result to achieve a $\text{poly}(\log \log n)$ dependency on the stream length.

Comparison of streaming algorithms for k-median and k-means clustering.

Beyond the main space bound, the paper establishes:

  • Fundamental Limits: A lower bound of $\Omega(\log n)$ words for any one-pass algorithm in dynamic streams, justifying the need for two passes.
  • Improved Sensitivity Bounds: A new, simpler upper bound for the sum of online sensitivities: $O(2^{2z} k \log^2(nd\Delta))$.

Conclusion and Future Directions

By reducing the stream size via online sampling before applying the merge-and-reduce framework, the height of the processing tree—and thus the space complexity—becomes dependent on $\log \log n$ rather than $\log n$.

While this work significantly advances streaming clustering, several open questions remain. The space complexity still depends polynomially on the dimension $d$ and the number of clusters $k$. Furthermore, extending these $o(\log n)$ techniques from Euclidean space to general metric spaces is a promising area for future research.

Summary updated

BibTeX
@inproceedings{cohenaddad2023streaming,
  author = {Vincent Cohen-Addad and David P. Woodruff and Samson Zhou},
  title = {{Streaming Euclidean k-median and k-means with o(log n) Space}},
  booktitle = {FOCS},
  year = {2023},
  url = {https://openreview.net/forum?id=xjhEsD4SfL},
}
Figure