Skip to main content
QUICK REVIEW

[Paper Review] Twenty (or so) Questions: $D$-ary Bounded-Length Huffman Coding

Michael B. Baer|arXiv (Cornell University)|Feb 25, 2006
Algorithms and Data CompressionComputer Science27 references1 citations
TL;DR

This paper presents an O(n(lmax − lmin))-time, O(n)-space Package-Merge-based algorithm for computing optimal D-ary source codes with bounded codeword lengths within [lmin, lmax], minimizing average codeword length or other convex coding penalties. It improves upon prior dynamic programming methods by enabling efficient nonbinary length-limited Huffman coding with reduced time and space complexity.

ABSTRACT

The game of Twenty Questions has long been used to illustrate binary source coding. Recently, a physical device has been developed that mimics the process of playing Twenty Questions, with the device supplying the questions and the user providing the answers. However, this game differs from Twenty Questions in two ways: Answers need not be only “yes” and “no,” and the device continues to ask questions beyond the traditional twenty; typically, at least 20 and at most 25 questions are asked. The nonbinary variation on source coding is one that is well known and understood, but not with such bounds on length. An upper bound on the related property of fringe, the difference between the lengths of the longest and the shortest codewords, has been considered, but no polynomial-time algorithm currently finds optimal fringe-limited codes. An O(n(lmax − lmin))-time O(n)-space Package-Merge-based algorithm is presented here for finding an optimal D-ary (binary or nonbinary) source code with all n codeword lengths (numbers of questions) bounded to be within the interval [lmin, lmax]. This algorithm minimizes average codeword length or, more generally, any other quasiarithmetic convex coding penalty. In the case of minimizing average codeword length, time complexity can often be improved via an alternative graph-based reduction. This has, as a special case, a method for nonbinary length-limited Huffman coding, which was previously solved via dynamic programming with O(n² lmax log D) time and O(n 2 log D) space. These algorithms can also be used to efficiently find a code that is optimal given a limit on fringe.

Motivation & Objective

  • To address the lack of polynomial-time algorithms for optimal D-ary source codes with bounded codeword lengths.
  • To minimize average codeword length or convex coding penalties under length constraints [lmin, lmax].
  • To improve upon existing O(n² lmax log D) time and space complexity for nonbinary length-limited Huffman coding.
  • To provide an efficient solution for fringe-limited coding, where the difference between longest and shortest codewords is bounded.

Proposed method

  • Adapts the Package-Merge algorithm to D-ary alphabets for bounded-length codeword generation.
  • Uses a dynamic programming framework with bounded length intervals [lmin, lmax] to ensure codeword length constraints are met.
  • Applies a convex penalty function to model average codeword length or related metrics.
  • Reduces time complexity to O(n(lmax − lmin)) and space to O(n) by leveraging the structure of the Package-Merge technique.
  • Introduces a graph-based reduction for further time complexity improvements in the average-length minimization case.
  • Supports both binary and nonbinary alphabets, generalizing prior results for nonbinary length-limited coding.

Experimental results

Research questions

  • RQ1Can an optimal D-ary source code be computed efficiently under bounded codeword length constraints [lmin, lmax]?
  • RQ2What is the minimal achievable average codeword length under such length bounds for D-ary codes?
  • RQ3Can the time and space complexity of nonbinary length-limited Huffman coding be reduced below O(n² lmax log D)?
  • RQ4Is there an efficient method to compute codes with bounded fringe (difference between longest and shortest codewords)?
  • RQ5Can the Package-Merge technique be extended to nonbinary alphabets with length constraints?

Key findings

  • The proposed algorithm achieves O(n(lmax − lmin)) time and O(n) space complexity for optimal D-ary coding under bounded codeword lengths.
  • The algorithm minimizes average codeword length or any convex coding penalty under the given length constraints.
  • For average length minimization, an alternative graph-based reduction further improves time complexity.
  • The method generalizes to nonbinary alphabets, solving a previously open problem with improved complexity over dynamic programming.
  • The algorithm enables efficient computation of optimal codes with bounded fringe, a property previously lacking efficient solutions.
  • The approach outperforms prior O(n² lmax log D) time and space methods for nonbinary length-limited Huffman coding.

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.