Skip to Main Content
This note considers an n-letter alphabet in which the ith letter is accessed with probability pi. The problem is to design efficient algorithms for constructing near-optimal, depth-constrained Huffman and alphabetic codes. We recast the problem as one of determining a probability vector q*=(q*1,...,q*n) in an appropriate convex set, S, so as to minimize the relative entropy D(p||q) over all q∈S. Methods from convex optimization give an explicit solution for q* in terms of p. We show that the Huffman and alphabetic codes so constructed are within 1 and 2 bits of the corresponding optimal depth-constrained codes.