🤖 AI Summary
This paper investigates the optimal binary variable-length coding problem under a “1-count constraint”: constructing prefix codes or lexicographic codes with minimum average codeword length, subject to the restriction that each codeword contains at most D ones. We propose the first dynamic programming algorithm with time complexity O(n²D), significantly improving upon the prior O(n^{2+D}) approach. We establish the first Kraft-type feasibility inequality for 1-count-constrained coding, providing a necessary and sufficient condition for the existence of an optimal code. Furthermore, we unify the treatment of prefix codes and lexicographic codes within a single framework, thereby extending the expressive power of classical coding theory for constrained coding models. Our results are directly applicable to energy-efficient communication and storage systems where Hamming weight—particularly the number of 1-bits—is critical for power consumption or physical-layer constraints.
📝 Abstract
In this paper, we consider the problem of constructing optimal average-length binary codes under the constraint that each codeword must contain at most $D$ ones, where $D$ is a given input parameter. We provide an $O(n^2D)$-time complexity algorithm for the construction of such codes, where $n$ is the number of codewords. We also describe several scenarios where the need to design these kinds of codes naturally arises. Our algorithms allow us to construct both optimal average-length prefix binary codes and optimal average-length alphabetic binary codes. In the former case, our $O(n^2D)$-time algorithm substantially improves on the previously known $O(n^{2+D})$-time complexity algorithm for the same problem. We also provide a Kraft-like inequality for the existence of (optimal) variable-length binary codes, subject to the above-described constraint on the number of 1's in each codeword.