计算机科学 > 数据结构与算法
[提交于 2026年3月11日]
标题:Huffman-Bucket Sketch: A Simple $O(m)$ Algorithm for Cardinality Estimation
查看中文 PDF 查看原文 PDF EasyResearch 阅读摘要:We introduce the Huffman-Bucket Sketch (HBS), a simple, mergeable data structure that losslessly compresses a HyperLogLog (HLL) sketch with $m$ registers to optimal space $O(m+\log n)$ bits, with amortized constant-time updates, acting as a drop-in replacement for HLL that retains mergeability and substantially reduces memory requirements. We partition registers into small buckets and encode their values with a global Huffman codebook derived from the strongly concentrated HLL rank distribution, using the current cardinality estimate for determining the mode of the distribution. We prove that the Huffman tree needs rebuilding only $O(\log n)$ times over a stream, roughly when cardinality doubles. The framework can be extended to other sketches with similar strongly concentrated distributions. We provide preliminary numerical evidence that suggests that HBS is practical and can potentially be competitive with state-of-the-art in practice.
提交历史
来自:Matti Karppa[v1] 2026年3月11日 星期三 16:14:52 UTC