文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > Constructing Huffman Trees in parallel
侵权投诉

Constructing Huffman Trees in parallel

We present a parallel algorithm for the Huffman Coding problem. We reduce the Huffman Coding problem to the Concave Least Weight Subsequence problem and give a parallel algorithm that solves the latter problem in O( p n log n) time with n processors on a C

1 Introduction Throughout this paper, a tree is a regular binary tree (i.e. a binary tree in which each internal node has two children). The level of a node in a tree is its distance from the root. The problem of constructing a Hu man tree is, given a sequence of n non-negative real numbers, x; x;:::; xn, to construct a tree with n leaves where the leaves of the tree are in one-to-one correspondence with elements of the sequence, to minimize the following cost function 1 2 1

c(T )=

n X i=1

xi`i

(1)

where`i is the level of the leaf corresponding to xi . The value xi associated with a leaf v is called the weight of v. The Hu man tree problem, also called the Hu man Coding problem, can be solved in O(n log n) sequential time 9], linear time if the input sequence is sorted. Yet, despite substantial e ort, no good parallel algorithm is known for the problem. Currently, the best NC algorithm for the Hu man coding problem takes O(log n) time with roughly n CREW PRAM processors 3]. An approximate solution for the Hu man coding problem can be computed in O(log n log n) time using a linear number of CREW processors 10, 16]. In this paper we present the rst sublinear time, o(n )-work parallel algorithm for the Hu man coding problem. At the heart of our algorithm is the reduction of the Hu man coding problem to the Concave Least Weight Subsequence (CLWS) problem. This reduction leads to a new linear time (if the input sequence of weights is sorted) sequential algorithm for the Hu man coding problem. The CLWS problem has a number of applications, including paragraph breaking. A good parallel algorithm for this problem is thus interesting in its own right. Hirschberg and Larmore 7] de ne the Least Weight Subsequence (LWS) problem as follows: Given an integer n, and a real-valued weight function w(i; j ) de ned for integers 0 i< j n, nd a sequence of integers= (0=<<:::< k?< k= n) such that w( )= Pk? w( i; i ) i is minimized. Thus, the LWS problem reduces trivially to the

minimum path problem on a weighted directed acyclic graph. The Single Source LWS problem is to nd such a minimal sequence 0=<<:::< k?< k= m for all m n. The weight function is said to be concave if for all 0 i i< j j n, 2 2 2 2 0 1 1 1=0+1 0 1 1 0 1 0 1

w(i; j )+ w(i; j ) w(i; j )+ w(i; j ): 0 0 1 1 0 1 1 0

(2)

This correspondence need not preserve order. The paragraph breaking problem is to nd the best way of breaking a paragraph of text into lines, a problem that must be handled by text processing software such as TEX. 1 2

1

上一页第2页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email