Efficient Implementation of the WARM-UP Algorithm for the Construction of Length-Restricted Prefix Codes

  • Authors:
  • Ruy Luiz Milidiú;Artur Alves Pessoa;Eduardo Sany Laber

  • Affiliations:
  • -;-;-

  • Venue:
  • ALENEX '99 Selected papers from the International Workshop on Algorithm Engineering and Experimentation
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given an alphabet Σ = {a1, ..., an} with a corresponding list of positive weights {w1, ..., wn} and a length restriction L, the length-restricted prefix code problem is to find, a prefix code that minimizes Σni=1 wili, where li, the length of the codeword assigned to ai, cannot be greater than L, for i = 1, ..., n. In this paper, we present an efficient implementation of the WARM-UP algorithm, an approximative method for this problem. The worst-case time complexity of WARMUP is O(n log n + n log wn), where wn is the greatest weight. However, some experiments with a previous implementation of WARM-UP show that it runs in linear time for several practical cases, if the input weights are already sorted. In addition, it often produces optimal codes. The proposed implementation combines two new enhancements to reduce the space usage of WARM-UP and to improve its execution time. As a result, it is about ten times faster than the previous implementation of WARM-UP and overcomes the LRR Package Method, the faster known exact method.