On the Huffman and alphabetic tree problem with general cost functions

  • Authors:
  • Hiroshi Fujiwara;Tobias Jacobs

  • Affiliations:
  • Department of Information and Computer Sciences, Toyohashi University of Technology, Toyohashi, Japan;National Institute of Informatics, Tokyo, Japan

  • Venue:
  • ESA'10 Proceedings of the 18th annual European conference on Algorithms: Part I
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

We study a wide generalization of two classical problems, the Huffman Tree and Alphabetic Tree Problem. We assume that the cost caused by the ith leaf is fi(di), where di is its depth in the tree under consideration, and fi : N0 → R0+ is an arbitrary function. All solution methods known for the classical cases fail to compute the optimum here. For the generalized Alphabetic Tree Problem, we give a dynamic programming algorithm solving it in time O(n4), using space O(n3). Furthermore, we show that the runtime can be reduced to O(n3) if the cost functions are nondecreasing and convex. The improved algorithm can also be used in the setting where the cost functions are nondecreasing and the objective function is the maximum leaf cost. We also prove 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. For the latter problem, we show that the case where the cost functions are nondecreasing admits a polynomial time algorithm.