A Two-phase Practical Parallel Algorithm for Construction of Huffman Codes

The construction of optimal prefix codes plays a significant and influential role in applications concerning information processing and communication. For decades, different algorithms were proposed treating the issue of Huffman codes construction and various optimizations were introduced. In this paper we propose a detailed practical time-efficient parallel algorithm for generating Huffman codes on CREW PRAM model exploiting n processors, where n is equal to the number of symbols in alphabet. We first compute the codewords lengths for all symbols concurrently with an innovative direct parallelization of the Huffman tree construction algorithm, alleviating the complexity of dealing with the original tree-like data structure. Then Huffman codes corresponding to symbols are generated in parallel based on a recursive formula introduced in [5]. The proposed algorithm achieves an O(n) time in the worst case when one-sided Huffman tree is formed, which is rarely encountered in practice, and O(log((logn – 1)!)) time in the best case when Huffman tree is nearly balanced.

[1]  Reza Hashemian Direct Huffman coding and decoding using the table of code-lengths , 2003, Proceedings ITCC 2003. International Conference on Information Technology: Coding and Computing.

[2]  Jan van Leeuwen,et al.  On the Construction of Huffman Trees , 1976, ICALP.

[3]  David A. Huffman,et al.  A method for the construction of minimum-redundancy codes , 1952, Proceedings of the IRE.

[4]  Ruy Luiz Milidiú,et al.  A work-efficient parallel algorithm for constructing Huffman codes , 1999, Proceedings DCC'99 Data Compression Conference (Cat. No. PR00096).

[5]  Alistair Moffat,et al.  In-Place Calculation of Minimum-Redundancy Codes , 1995, WADS.

[6]  Clyde P. Kruskal,et al.  Searching, Merging, and Sorting in Parallel Computation , 1983, IEEE Transactions on Computers.

[7]  Mikhail J. Atallah,et al.  Constructing trees in parallel , 1989, SPAA '89.

[8]  S. Ho,et al.  Efficient hardware decoding method for modified Huffman code , 1991 .

[9]  Kuo-Liang Chung,et al.  A space-efficient Huffman decoding algorithm and its parallelism , 2000, Theor. Comput. Sci..

[10]  Lawrence L. Larmore,et al.  Constructing Huffman Trees in Parallel , 1995, SIAM J. Comput..

[11]  Shang-Hua Teng The construction of Huffman-equivalent prefix code in NC , 1987, SIGA.

[12]  LAWRENCE L. LARMORE Height Restricted Optimal Binary Trees , 1987, SIAM J. Comput..

[13]  Lawrence L. Larmore,et al.  A fast algorithm for optimal length-limited Huffman codes , 1990, JACM.

[14]  David G. Kirkpatrick,et al.  Parallel construction of near optimal binary trees , 1990, SPAA '90.

[15]  Thomas J. Ferguson,et al.  Self-synchronizing Huffman codes , 1984, IEEE Trans. Inf. Theory.

[16]  Michael Buro,et al.  On the Maximum Length of Huffman Codes , 1993, Inf. Process. Lett..

[17]  Yue-Li Wang,et al.  A Memory-Efficient and Fast Huffman Decoding Algorithm , 1999, Inf. Process. Lett..

[18]  Shmuel Tomi Klein,et al.  Skeleton Trees for the Efficient Decoding of Huffman Encoded Texts , 2000, Information Retrieval.

[19]  Donald E. Knuth,et al.  Dynamic Huffman Coding , 1985, J. Algorithms.

[20]  Alistair Moffat,et al.  On the implementation of minimum redundancy prefix codes , 1997, IEEE Trans. Commun..

[21]  Reza Hashemian Memory efficient and high-speed search Huffman coding , 1995, IEEE Trans. Commun..