Prefix codes: Equiprobable words, unequal letter costs

  • Mordecai J. Golin
  • Neal Young
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 820)


We consider the following variant of Huffman coding in which the costs of the letters, rather than the probabilities of the words, are non-uniform: Given an alphabet of unequal-length letters, find a minimum-average-length prefix-free set of n codewords over the alphabet. We show new structural properties of such codes, leading to an O(n log2r) time algorithm for finding them. This new algorithm is simpler and faster than the previously best known O(nr min{log n, r}) one due to Perl, Garey, and Even [5].


Algorithms Huffman Codes Prefix Codes Trees 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Doris Altenkamp and Kurt Melhorn. Codes: Unequal probabilies, unequal letter costs. Journal of the Association for Computing Machinery, 27(3):412–427, July 1980.Google Scholar
  2. [2]
    D. A. Huffman. A method for the construction of minimum redundancy codes. In Proc. IRE 40, volume 10, pages 1098–1101], September 1952.Google Scholar
  3. [3]
    Richard Karp. Minimum-redundancy coding for the discrete noiseless channel. IRE Transactions on Information Theory, January 1961.Google Scholar
  4. [4]
    Donald E. Knuth. The Art of Computer Programming, Volume III: Sorting and Searching Addison-Wesley, Reading, Mass., 1973.Google Scholar
  5. [5]
    Y. Perl, M. R. Garey, and S. Even. Efficient generation of optimal prefix code: Equiprobable words using unequal cost letters. Journal of the Association for Computing Machinery, 22(2):202–214, April 1975.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Mordecai J. Golin
    • 1
  • Neal Young
    • 2
  1. 1.Hong Kong USTKowloonHong Kong
  2. 2.UMIACSUniversity of MarylandCollege Park

Personalised recommendations