skip to main content
article
Free Access

Design and analysis of dynamic Huffman codes

Published:01 October 1987Publication History
Skip Abstract Section

Abstract

A new one-pass algorithm for constructing dynamic Huffman codes is introduced and analyzed. We also analyze the one-pass algorithm due to Faller, Gallager, and Knuth. In each algorithm, both the sender and the receiver maintain equivalent dynamically varying Huffman trees, and the coding is done in real time. We show that the number of bits used by the new algorithm to encode a message containing t letters is < t bits more than that used by the conventional two-pass Huffman scheme, independent of the alphabet size. This is best possible in the worst case, for any one-pass Huffman method. Tight upper and lower bounds are derived. Empirical tests show that the encodings produced by the new algorithm are shorter than those of the other one-pass algorithm and, except for long messages, are shorter than those of the two-pass method. The new algorithm is well suited for on-line encoding/decoding in data networks and for tile compression.

References

  1. 1 BENTLEY, Jf L., SLEATOR, D. D., TARJAN, R. E., AND WEI, V. K. A locally adaptive data compression scheme. Commun.4CM 29, 4 (Apr. 1986), 320-330. Google ScholarGoogle Scholar
  2. 2 ELIAS, P. Interval and recency-rank source coding: Two online adaptive variable-length schemes. IEEE Trans. Inf. Theory. To be published. Google ScholarGoogle Scholar
  3. 3 FALLER, N. An adaptive system for data compression. In Record of the 7th .4silomar Conference on Circuits, Systems, and Computers. 1973, pp. 593-597.Google ScholarGoogle Scholar
  4. 4 GALLAGER, R.G. Variations on a theme by Huffman. IEEE Trans. Inf. Theory 17"-24, 6 (Nov. 1978), 668-674.Google ScholarGoogle Scholar
  5. 5 HUFFMAN, D.A. A method for the construction of minimum redundancy codes. In Proc. IRE 40 (1951), 1098-1101.Google ScholarGoogle Scholar
  6. 6 KNUTH, D.E. Dynamic Huffman coding. J. Algorithms 6 (1985), 163-180. Google ScholarGoogle Scholar
  7. 7 MCMASTER, C. L. Documentation of the compact command. In UNIX User's Manual, 4.2 Berkeley Software Distribution, Virtual VAX-11 Version, Univ. of California, Berkeley, Berkeley, Calif., Mar. 1984.Google ScholarGoogle Scholar
  8. 8 SCHWARTZ, E.S. An Optimum Encoding with Minimum Longest Code and Total Number of Dip~ts. Inf. Control 7, 1 (Mar. 1964), 37-44.Google ScholarGoogle Scholar
  9. 9 VlYrER, J.S. Dynamic Huffman Coding. ACM Trans. Math. Sofiw. Submitted 1986.Google ScholarGoogle Scholar
  10. 10 VITTER, J. S., AND CHEN, W.C. Design and Analysis of Coalesced Hashing. Oxford University Press, New York, 1987. Google ScholarGoogle Scholar

Index Terms

  1. Design and analysis of dynamic Huffman codes

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image Journal of the ACM
          Journal of the ACM  Volume 34, Issue 4
          Oct. 1987
          254 pages
          ISSN:0004-5411
          EISSN:1557-735X
          DOI:10.1145/31846
          Issue’s Table of Contents

          Copyright © 1987 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 October 1987
          Published in jacm Volume 34, Issue 4

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader