next up previous
Next: ALGORITHM 673 Dynamic Huffman Up: DATA COMPRESSION Previous: DATA COMPRESSION

Design and Analysis of Dynamic Huffman Codes

J. S. Vitter. ``Design and Analysis of Dynamic Huffman Codes,'' Journal of the ACM, 34(4), October 1987, 825-845. A shortened version appears in ``The Design and Analysis of Dynamic Huffman Coding,'' Proceedings of the 26th Annual IEEE Symposium on Foundations of Computer Science (FOCS '85), Portland, OR, October 1985, 293-302.

Publication version (Adobe pdf format)

Technical report version (gzip-compressed postscript)

We introduce and analyze a new one-pass algorithm for constructing dynamic Huffman codes and 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 < tbits 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 online encoding/decoding in data networks and for file compression.


next up previous
Next: ALGORITHM 673 Dynamic Huffman Up: DATA COMPRESSION Previous: DATA COMPRESSION
Jeff Vitter
2008-04-02