{"title":"一种快速且节省空间的最小冗余前缀码计算算法","authors":"R. Milidiú, A. Pessoa, E. Laber","doi":"10.1109/SPIRE.1999.796587","DOIUrl":null,"url":null,"abstract":"The minimum redundancy prefix code problem is to determine, for a given list W=[w/sub 1/,...,w/sub n/] of n positive symbol weights, a list L=[l/sub 1/,...,l/sub n/] of n corresponding integer codeword lengths such that /spl Sigma//sub i=1//sup n/2/sup -li//spl les/1 and /spl Sigma//sub i=1//sup n/w/sub i/l/sub i/ is minimized. With the optimal list of codeword lengths, an optimal canonical code can be easily obtained. If W is already sorted, then this optimal code can also be represented by the list M=[m/sub 1/,...,m/sub H/], where m/sub l/, for l=1,...,H, denotes the number of codewords with length l and H is the length of the longest codeword. Fortunately, H is proved to be O(min{log(1/p/sub 1/),n}, where p/sub 1/ is the smallest symbol probability, given by w/sub 1///spl Sigma//sub i=1//sup n/w/sub i/. The E-LazyHuff algorithm uses a lazy approach to calculate optimal codes in O(nlog(n/H)) time, requiring only O(H) additional space. In addition, the input weights are not destroyed during the code calculation. We propose a new technique, which we call homogenization, that can be used to improve the time efficiency of algorithms for constructing optimal prefix codes. Next, we introduce the Best LazyHuff algorithm (B-LazyHuff) as an application of this technique. B-LazyHuff is an O(n)-time variation of the E-LazyHuff algorithm. It also requires O(H) additional space and does not destroy the input data.","PeriodicalId":131279,"journal":{"name":"6th International Symposium on String Processing and Information Retrieval. 5th International Workshop on Groupware (Cat. No.PR00268)","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1999-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"A fast and space-economical algorithm for calculating minimum redundancy prefix codes\",\"authors\":\"R. Milidiú, A. Pessoa, E. Laber\",\"doi\":\"10.1109/SPIRE.1999.796587\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The minimum redundancy prefix code problem is to determine, for a given list W=[w/sub 1/,...,w/sub n/] of n positive symbol weights, a list L=[l/sub 1/,...,l/sub n/] of n corresponding integer codeword lengths such that /spl Sigma//sub i=1//sup n/2/sup -li//spl les/1 and /spl Sigma//sub i=1//sup n/w/sub i/l/sub i/ is minimized. With the optimal list of codeword lengths, an optimal canonical code can be easily obtained. If W is already sorted, then this optimal code can also be represented by the list M=[m/sub 1/,...,m/sub H/], where m/sub l/, for l=1,...,H, denotes the number of codewords with length l and H is the length of the longest codeword. Fortunately, H is proved to be O(min{log(1/p/sub 1/),n}, where p/sub 1/ is the smallest symbol probability, given by w/sub 1///spl Sigma//sub i=1//sup n/w/sub i/. The E-LazyHuff algorithm uses a lazy approach to calculate optimal codes in O(nlog(n/H)) time, requiring only O(H) additional space. In addition, the input weights are not destroyed during the code calculation. We propose a new technique, which we call homogenization, that can be used to improve the time efficiency of algorithms for constructing optimal prefix codes. Next, we introduce the Best LazyHuff algorithm (B-LazyHuff) as an application of this technique. B-LazyHuff is an O(n)-time variation of the E-LazyHuff algorithm. It also requires O(H) additional space and does not destroy the input data.\",\"PeriodicalId\":131279,\"journal\":{\"name\":\"6th International Symposium on String Processing and Information Retrieval. 5th International Workshop on Groupware (Cat. No.PR00268)\",\"volume\":\"30 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1999-09-21\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"6th International Symposium on String Processing and Information Retrieval. 5th International Workshop on Groupware (Cat. No.PR00268)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/SPIRE.1999.796587\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"6th International Symposium on String Processing and Information Retrieval. 5th International Workshop on Groupware (Cat. No.PR00268)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SPIRE.1999.796587","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
A fast and space-economical algorithm for calculating minimum redundancy prefix codes
The minimum redundancy prefix code problem is to determine, for a given list W=[w/sub 1/,...,w/sub n/] of n positive symbol weights, a list L=[l/sub 1/,...,l/sub n/] of n corresponding integer codeword lengths such that /spl Sigma//sub i=1//sup n/2/sup -li//spl les/1 and /spl Sigma//sub i=1//sup n/w/sub i/l/sub i/ is minimized. With the optimal list of codeword lengths, an optimal canonical code can be easily obtained. If W is already sorted, then this optimal code can also be represented by the list M=[m/sub 1/,...,m/sub H/], where m/sub l/, for l=1,...,H, denotes the number of codewords with length l and H is the length of the longest codeword. Fortunately, H is proved to be O(min{log(1/p/sub 1/),n}, where p/sub 1/ is the smallest symbol probability, given by w/sub 1///spl Sigma//sub i=1//sup n/w/sub i/. The E-LazyHuff algorithm uses a lazy approach to calculate optimal codes in O(nlog(n/H)) time, requiring only O(H) additional space. In addition, the input weights are not destroyed during the code calculation. We propose a new technique, which we call homogenization, that can be used to improve the time efficiency of algorithms for constructing optimal prefix codes. Next, we introduce the Best LazyHuff algorithm (B-LazyHuff) as an application of this technique. B-LazyHuff is an O(n)-time variation of the E-LazyHuff algorithm. It also requires O(H) additional space and does not destroy the input data.