Skip to main content

Optimal Prefix-Free Codes for Unequal Letter Costs: Dynamic Programming with the Monge Property

  • Conference paper
  • First Online:
Algorithms — ESA’ 98 (ESA 1998)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1461))

Included in the following conference series:

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

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Julia Abrahams, “Code and Parse Trees for Lossless Source Encoding,” Sequences’97, (1997).

    Google Scholar 

  2. Doris Altenkamp and Kurt Mehlhorn, “Codes: Unequal Probabilities, Unequal Letter Costs,” J. Assoc. Comput. Mach. 27(3) (July 1980), 412–427.

    MATH  MathSciNet  Google Scholar 

  3. A. Aggarwal, M. Klawe, S. Moran, P. Shor, and R. Wilber, Geometric applications of a matrix-searching algorithm, Algorithmica 2 (1987), pp. 195–208.

    Article  MATH  MathSciNet  Google Scholar 

  4. 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).

    Google Scholar 

  5. 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.

    Google Scholar 

  6. E. N. Gilbert, “Coding with Digits of Unequal Costs,” IEEE Trans. Inform. Theory, 41 (1995).

    Google Scholar 

  7. 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.

    Google Scholar 

  8. Sanjiv Kapoor and Edward Reingold, “Optimum Lopsided Binary Trees,” Journal of the Association for Computing Machinery 36(3) (July 1989), 573–590.

    MATH  MathSciNet  Google Scholar 

  9. R. M. Karp, “Minimum-Redundancy Coding for the Discrete Noiseless Channel,” IRE Transactions on Information Theory, 7 (1961) 27–39.

    Article  MathSciNet  Google Scholar 

  10. 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.

    Article  Google Scholar 

  11. L. L. Larmore, T. Przytycka, W. Rytter, Parallel computation of optimal alpha-betic trees, SPAA93.

    Google Scholar 

  12. K. Mehlhorn, “An Efficient Algorithm for Constructing Optimal Prefix Codes,” IEEE Trans. Inform. Theory, IT-26 (1980) 513–517.

    Article  MathSciNet  Google Scholar 

  13. G. Monge, Déblai et remblai, Mémoires de l’Académie des Sciences, Paris, (1781) pp. 666–704.

    Google Scholar 

  14. 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

    MATH  MathSciNet  Google Scholar 

  15. Serap A. Savari, “Some Notes on Varn Coding,” IEEE Transactions on Information Theory, 40(1) (Jan. 1994), 181–186.

    Article  MATH  MathSciNet  Google Scholar 

  16. Robert Sedgewick, Algorithms, Addison-Wesley, Reading, Mass.. (1984).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics