2021-10-25T18:10:15Zhttps://soar-ir.repo.nii.ac.jp/oaioai:soar-ir.repo.nii.ac.jp:000195682021-10-12T00:43:29Z1221:1222On the Huffman and Alphabetic Tree Problem with General Cost FunctionsFujiwara, HiroshiJacobs, TobiasOptimal treeBinary treeMulti-ary treeDynamic programmingHuffman codingAlphabetic treeWe address generalized versions of the Huffman and Alphabetic Tree Problem where the cost caused by each individual leaf i, instead of being linear, depends on its depth in the tree by an arbitrary function. The objective is to minimize either the total cost or the maximum cost among all leaves. We review and extend the known results in this direction and devise a number of new algorithms and hardness proofs. It turns out that the Dynamic Programming approach for the Alphabetic Tree Problem can be extended to arbitrary cost functions, resulting in a time O(n (4)) optimal algorithm using space O(n (3)). We identify classes of cost functions where the well-known trick to reduce the runtime by a factor of n via a "monotonicity" property can be applied. For the generalized Huffman Tree Problem we show that even the k-ary version can be solved by a generalized version of the Coin Collector Algorithm of Larmore and Hirschberg (in Proc. SODA'90, pp. 310-318, 1990) when the cost functions are nondecreasing and convex. Furthermore, we give an O(n (2)logn) algorithm for the worst case minimization variants of both the Huffman and Alphabetic Tree Problem with nondecreasing cost functions. Investigating the limits of computational tractability, we show that the Huffman Tree Problem in its full generality is inapproximable unless P = NP, no matter if the objective function is the sum of leaf costs or their maximum. The alphabetic version becomes NP-hard when the leaf costs are interdependent.ArticleALGORITHMICA. 69(3): 582-604 (2014)journal articleSPRINGER2014application/pdfALGORITHMICA3695826040178-4617https://soar-ir.repo.nii.ac.jp/record/19568/files/On_the_Huffman_and_Alphabetic_Tree_Problem_with_General_Cost_Functions.pdfeng10.1007/s00453-013-9755-6https://doi.org/10.1007/s00453-013-9755-6The original publication is available at www.springerlink.com