# Algorithmic counting of nonequivalent compact Huffman codes

**Authors:** Christian Elsholtz, Clemens Heuberger, Daniel Krenn

arXiv: 1901.11343 · 2024-10-17

## TL;DR

This paper presents an efficient algorithm for counting nonequivalent compact Huffman codes and related structures, significantly improving previous computational bounds by using power series division.

## Contribution

It introduces a method to compute the sequence for all n < N with nearly linear complexity in N, surpassing earlier cubic and quartic bounds.

## Key findings

- Efficient computation of the sequence for all n < N
- Reduction of complexity from O(N^3) to approximately N^{1+ε}
- Applicable to various combinatorial structures related to Huffman codes

## Abstract

It is known that the following five counting problems lead to the same integer sequence~$f_t(n)$: the number of nonequivalent compact Huffman codes of length~$n$ over an alphabet of $t$ letters, the number of `nonequivalent' canonical rooted $t$-ary trees (level-greedy trees) with $n$~leaves, the number of `proper' words, the number of bounded degree sequences, and the number of ways of writing $1= \frac{1}{t^{x_1}}+ \dots + \frac{1}{t^{x_n}}$ with integers $0 \leq x_1 \leq x_2 \leq \dots \leq x_n$. In this work, we show that one can compute this sequence for \textbf{all} $n<N$ with essentially one power series division. In total we need at most $N^{1+\varepsilon}$ additions and multiplications of integers of $cN$ bits, $c<1$, or $N^{2+\varepsilon}$ bit operations, respectively. This improves an earlier bound by Even and Lempel who needed $O(N^3)$ operations in the integer ring or $O(N^4)$ bit operations, respectively.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1901.11343/full.md

## References

33 references — full list in the complete paper: https://tomesphere.com/paper/1901.11343/full.md

---
Source: https://tomesphere.com/paper/1901.11343