Abstract
In this paper we discuss a variation of the classical Huffman coding problem: finding optimal prefix-free codes for unequal letter costs. Our problem consists of finding a minimal cost prefix-free code in which the encoding alphabet consists of unequal cost (length) letters, with lengths α and β. The most efficient algorithm known previously required O(n 2+max(α,β)) time to construct such a minimal-cost set of n codewords. In this paper we provide an O(n max(α,β)) time algorithm. Our improvement comes from the use of a more sophisticated modeling of the problem combined with the observation that the problem possesses a “Monge property” and that the SMAWK algorithm on monotone matrices can therefore be applied.
The work of the second author was partially supported by Hong Kong RGC CERG grant 652/95E, that of the third author by NSF grant CCR-9503441
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Julia Abrahams, “Code and Parse Trees for Lossless Source Encoding,” Sequences’97, (1997).
Doris Altenkamp and Kurt Mehlhorn, “Codes: Unequal Probabilities, Unequal Letter Costs,” J. Assoc. Comput. Mach. 27(3) (July 1980), 412–427.
A. Aggarwal, M. Klawe, S. Moran, P. Shor, and R. Wilber, Geometric applications of a matrix-searching algorithm, Algorithmica 2 (1987), pp. 195–208.
Siu-Ngan Choi and M. Golin, “Lopsided trees: Algorithms, Analyses and Applications,” Automata, Languages and Programming, Proceedings of the 23rd International Colloquium on Automata, Languages, and Programming (ICALP 96).
N. Cot, “A linear-time ordering procedure with applications to variable length encoding,” Proc. 8th Annual Princeton Conference on Information Sciences and Systems, (1974), pp. 460–463.
E. N. Gilbert, “Coding with Digits of Unequal Costs,” IEEE Trans. Inform. Theory, 41 (1995).
M. Golin and G. Rote, “A Dynamic Programming Algorithm for Constructing Optimal Prefix-Free Codes for Unequal Letter Costs,” Proceedings of the 22nd International Colloquium on Automata Languages and Programming (ICALP’ 95), (July 1995) 256–267. Expanded version to appear in IEEE Trans. Inform. Theory.
Sanjiv Kapoor and Edward Reingold, “Optimum Lopsided Binary Trees,” Journal of the Association for Computing Machinery 36(3) (July 1989), 573–590.
R. M. Karp, “Minimum-Redundancy Coding for the Discrete Noiseless Channel,” IRE Transactions on Information Theory, 7 (1961) 27–39.
Abraham Lempel, Shimon Even, and Martin Cohen, “An Algorithm for Optimal Prefix Parsing of a Noiseless and Memoryless Channel,” IEEE Transactions on Information Theory, IT-19(2) (March 1973), 208–214.
L. L. Larmore, T. Przytycka, W. Rytter, Parallel computation of optimal alpha-betic trees, SPAA93.
K. Mehlhorn, “An Efficient Algorithm for Constructing Optimal Prefix Codes,” IEEE Trans. Inform. Theory, IT-26 (1980) 513–517.
G. Monge, Déblai et remblai, Mémoires de l’Académie des Sciences, Paris, (1781) pp. 666–704.
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) (April 1975), 202–214
Serap A. Savari, “Some Notes on Varn Coding,” IEEE Transactions on Information Theory, 40(1) (Jan. 1994), 181–186.
Robert Sedgewick, Algorithms, Addison-Wesley, Reading, Mass.. (1984).
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bradford, P., Golin, M.J., Larmore, L.L., Rytter, W. (1998). Optimal Prefix-Free Codes for Unequal Letter Costs: Dynamic Programming with the Monge Property. In: Bilardi, G., Italiano, G.F., Pietracaprina, A., Pucci, G. (eds) Algorithms — ESA’ 98. ESA 1998. Lecture Notes in Computer Science, vol 1461. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-68530-8_4
Download citation
DOI: https://doi.org/10.1007/3-540-68530-8_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64848-2
Online ISBN: 978-3-540-68530-2
eBook Packages: Springer Book Archive