Parallel Construction of Huffman Codes

  • S. Arash Ostadzadeh
  • M. Amir Moulavi
  • Zeinab Zeinalpour
  • B. Maryam Elahi
Conference paper


For decades, different algorithms were proposed addressing the issue of constructing Huffman Codes. In this paper we propose a detailed time-efficient three-phase parallel algorithm for generating Huffman codes on CREW PRAM model exploiting n processors, where n is equal to the number of symbols in the input alphabet. First the codeword length for each symbol is computed concurrently with a direct parallelization of the Huffman tree construction algorithm eliminating the complexity of dealing with the original tree-like data structure. Then the Huffman codes corresponding to symbols are generated in parallel based on a recursive formula. The performance of the proposed algorithm depends directly on the height of the corresponding Huffman tree. It achieves an O(n) time complexity in the worst case whichis rarely encountered in practice.


Data Structures Parallel Algorithms Huffman Codes Optimal Prefix Codes PRAM 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    M. J. Atallah, S. R. Kosaraju, L. L. Larmore, G. L. Miller and S -H. Teng, "Constructing trees in parallel", ACMSIGACT, Proc. 1st Annual ACM Symposium on Parallel Algorithms and Architectures, June 1989, pp. 421-431.Google Scholar
  2. [2]
    M. Buro, “On the maximum length of Huffman codes”, Information Processing Letters, 45(5), April 1993, pp. 219-223.zbMATHCrossRefMathSciNetGoogle Scholar
  3. [3]
    H. C. Chen, Y. L. Wang and Y. F. Lan, “A memory efficient and fast Huffman decoding algorithm”, Information Processing Letter, 69(1999), pp. 119-122.CrossRefMathSciNetGoogle Scholar
  4. [4]
    T. J. Fexguson and J. H. Rabinowitz, “Self-synchronizing Huffman Codes”, IEEE Trans. Inform. Theory, Vol. IT-30, July 1984, pp. 687-693.Google Scholar
  5. [5]
    R. Hashemian, “Memory Efficient and High Speed search Huffman codes”. IEEE Trans. On Comm., Vol.43, No.10, Oct. 1995.Google Scholar
  6. [6]
    R. Hashemian, “Direct Huffman coding and decoding using the table of code-lengths”, Proc. International Conf. on Inform. Technology, Computers and Communications (ITCC’03), 2003.Google Scholar
  7. [7]
    S. Ho and P. Law. “Efficient hardware decoding method for modified Huffman code”, Electronics Letters, Vol.27, no.10, May 1991, pp. 855-856.CrossRefGoogle Scholar
  8. [8]
    D. A. Huffman, “A method for the construction of minimum redundancy codes,” Proc. IRE, Vol. 40, pp. 1098-1101, Sept. 1952.CrossRefGoogle Scholar
  9. [9]
    S. T. Klein, “Skeleton trees for the efficient decoding of Huffman coded text”, Kluwer Journal of Inform. Retrieval, 3(2000), pp. 7-23.CrossRefGoogle Scholar
  10. [10]
    D. E. Knuth, “Dynamic Huffman coding”, Journal of Algorithms 6(1985), pp. 163-180.zbMATHCrossRefMathSciNetGoogle Scholar
  11. [11]
    D. G. Kirkpatrick and T. M. Przytycka, “Parallel construction of near optimal binary search trees”, ACM SIGACT, Proc, 2nd Annual ACM Sump. on Parallel Algorithms and Architectures, July 1990, pp. 234-243.Google Scholar
  12. [12]
    C. Kruskal. “Searching, merging and sorting in parallel computations”, IEEE Trans. Comput., pp. 942-946, 1983.Google Scholar
  13. [13]
    L. L. Larmore, “Height restricted optimal binary trees”, SIAM Journal on Computing, 16(1987), pp. 1115-1123.zbMATHCrossRefMathSciNetGoogle Scholar
  14. [14]
    Y. Lin, K. Chung, “A space-efficient Huffman decoding algorithm and its parallelism”, Journal of Theoretical Computer Science, Vol. 246 (2000), pp. 227-238.zbMATHCrossRefMathSciNetGoogle Scholar
  15. [15]
    L. L. Larmore and D. S. Hirschberg, “A fast algorithm for optimal length-limited Huffman codes”, Journal of ACM, 37(1990), pp. 464-473.zbMATHCrossRefMathSciNetGoogle Scholar
  16. [16]
    L. L. Larmore and T. M. Przytycka, “Constructing Huffman trees in parallel”, SLAM Journal on computing, 24(6), December 1995, pp. 1163-1169.zbMATHCrossRefMathSciNetGoogle Scholar
  17. [17]
    A. Moffat and J. Katajainen, “In-place calculation of minumum-redundancy codes”. 4th Intl. Workshop, Algorithms and Data Structures, Vol. 955, Aug. 1995, pp. 393-402.MathSciNetGoogle Scholar
  18. [18]
    R. L. Milidiú, E. S. Laber and A. A. Pessoa, “A work efficient parallel algorith for constructing Huffman codes”, DCC’99, Proc. Date Compression Conference, Mar. 1999.Google Scholar
  19. [19]
    A. Moffat and A. Turpin, “On the implementation of the minimum redundancy prefix codes”, IEEE Trans. Commun. 45, 1997, pp. 1200-1207.CrossRefGoogle Scholar
  20. [20]
    S. A. Ostadzadeh, M. A. Moulavi, Z. Zeinalpour, “Massive Concurrent Deletion of Keys in B*-tree”, Technical Report, Azad University of Mashhad, Mashhad, Iran, Sep. 2005.Google Scholar
  21. [21]
    S-H. Teng, “The construction of Huffman-equivalent prefix code in NC”, ACM SIGACT, 18(4), 1987, pp. 54-61.CrossRefGoogle Scholar
  22. [22]
    J. Van Leeuwen, "On the construction of Huffman trees”, 3rd International Colloquium on Automata, Languages and Programming, Jul. 1976, pp. 382-410.Google Scholar

Copyright information

© Springer 2006

Authors and Affiliations

  • S. Arash Ostadzadeh
    • 1
  • M. Amir Moulavi
    • 2
  • Zeinab Zeinalpour
    • 3
  • B. Maryam Elahi
    • 4
  1. 1.Computer Engineering Department Ostad Yousefi St. Ghasem AbadIslamic Azad University of Mashhad, Faculty of EngineeringIran
  2. 2.Young Researchers Club, Islamic Azad University of MashhadEmamiyeh Blvd., Ghasem AbadIran
  3. 3.Young Researchers Club, Islamic Azad University of MashhadEmamiyeh Blvd., Ghasem AbadIran
  4. 4.Young Researchers Club, Islamic Azad University of MashhadEmamiyeh Blvd., Ghasem AbadIran

Personalised recommendations