Partial alphabetic trees

被引:2
|
作者
Barkan, A [1 ]
Kaplan, H [1 ]
机构
[1] Tel Aviv Univ, Fac Exact Sci, Sch Comp Sci, IL-69978 Tel Aviv, Israel
关键词
Huffman tree; Huffman codes; alphabetic tree; alphabetic code; Hu-Tucker algorithms; partial alphabetic tree;
D O I
10.1016/j.jalgor.2005.06.001
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
In the partial alphabetic tree problem we are given a multiset of non-negative weights W = {w(1),..., w(n)}, partitioned into m <=, n blocks B-1,.... B-m. We want to find a binary tree T where the elements of W reside in its leaves such that if we traverse the leaves from left to right then all leaves of B-i precede all leaves of B-j for every i < j. Furthermore among all such trees, T has to minimize Sigma(n)(i=1) w(i)d(w(i)), where d(w(i)) is the depth of uti in T. The partial alphabetic tree problem generalizes the problem of finding a Huffman tree over W (there is only one block) and the problem of finding a minimum cost alphabetic tree over W (each block consists of a single item). This problem arises when we need an optimal binary code for a set of items with known frequencies, such that we have a lexicographic restriction for some of the codewords. Our main result is a pseudo-polynomial time algorithm that finds the optimal tree. Our algorithm runs in O((W-sum/W-min)(2 alpha) log(W-sum/W-min)n(2)) time where W-sum = Sigma(i=1)(n) w(i), W-min = min(i) w(i), and alpha = 1/log phi approximate to 1.44 (phi = (root 5 + 1)/2 approximate to 1.618 is the golden ratio). In particular the running time is polynomial in case the weights are bounded by a polynomial of n. To bound the running time of our algorithm we prove an upper bound of [alpha log(W-sum/W-min) + 0.56] on the depth of the optimal tree. Our algorithm relies on a solution to what we call the layered Huffman forest problem which is of independent interest. In the layered Huffman forest problem we are given an unordered multiset of weights W = {w(1),..., w(n)), and a multiset of integers D = {d(1),..., d(k)). We look for a forest F with k trees, T-1..., T-k, where the weights in W correspond to the leaves of F, that minimizes Sigma(n)(i=1) w(i)d(F)(w(i)) where d(F)(w(i)) is the depth of w(i) in its tree plus d(j) if w(i) is an element of T-j. Our algorithm for this problem runs in O(kn(2)) time. (C) 2005 Elsevier Inc. All rights reserved.
引用
收藏
页码:81 / 103
页数:23
相关论文
共 50 条
  • [1] Partial alphabetic trees
    Barkan, A
    Kaplan, H
    ALGORITHMS-ESA 2002, PROCEEDINGS, 2002, 2461 : 114 - 125
  • [2] ALPHABETIC MINIMAX TREES
    KIRKPATRICK, DG
    KLAWE, MM
    SIAM JOURNAL ON COMPUTING, 1985, 14 (03) : 514 - 526
  • [3] Optimum alphabetic binary trees
    Hu, T.C.
    Morgenthaler, J.D.
    Lecture Notes in Computer Science, 1120
  • [4] TESTING THE OPTIMALITY OF ALPHABETIC TREES
    RAMANAN, P
    THEORETICAL COMPUTER SCIENCE, 1992, 93 (02) : 279 - 301
  • [5] An Encryption Algorithm Based on Alphabetic Trees
    Arafat, Shymaa M.
    3RD ACS/IEEE INTERNATIONAL CONFERENCE ON COMPUTER SYSTEMS AND APPLICATIONS, 2005, 2005,
  • [6] Optimal alphabetic trees for binary search
    Hu, TC
    Tucker, PA
    INFORMATION PROCESSING LETTERS, 1998, 67 (03) : 137 - 140
  • [7] Correctness of constructing optimal alphabetic trees revisited
    Karpinski, M
    Larmore, LL
    Rytter, W
    THEORETICAL COMPUTER SCIENCE, 1997, 180 (1-2) : 309 - 324
  • [8] A New Algorithm for Building Alphabetic Minimax Trees
    Gagie, Travis
    FUNDAMENTA INFORMATICAE, 2009, 97 (03) : 321 - 329
  • [9] Optimal integer alphabetic trees in linear time
    Hu, TC
    Larmore, LL
    Morgenthaler, JD
    ALGORITHMS - ESA 2005, 2005, 3669 : 226 - 237
  • [10] ALPHABETIC MINIMAX TREES OF DEGREE AT MOST T
    COPPERSMITH, D
    KLAWE, MM
    PIPPENGER, NJ
    SIAM JOURNAL ON COMPUTING, 1986, 15 (01) : 189 - 192