[Paper Review] Approximation ratio of RePair
This paper improves the lower bound on the approximation ratio of the RePair grammar-based compressor from Ω(√log n) to Ω(log n / log log n), using a family of binary-encoded strings. The analysis shows that RePair's SLP size grows quadratically in k (where k = Θ(log n)), while the optimal SLP size is linear in k, demonstrating a significant gap in compression efficiency for certain inputs.
In a seminal paper of Charikar et al.~on the smallest grammar problem, the authors derive upper and lower bounds on the approximation ratios for several grammar-based compressors. Here we improve the lower bound for the famous {\sf RePair} algorithm from $Ω(\sqrt{\log n})$ to $Ω(\log n/\log\log n)$. The family of words used in our proof is defined over a binary alphabet, while the lower bound from Charikar et al. needs an alphabet of logarithmic size in the length of the provided words.
Motivation & Objective
- To improve the known lower bound on the approximation ratio of the RePair algorithm for grammar-based compression.
- To construct a family of binary strings where RePair's performance is provably suboptimal relative to the smallest possible SLP.
- To close the gap between known upper and lower bounds on RePair's approximation ratio in the worst case.
- To show that the lower bound holds even with a fixed binary alphabet, unlike prior results requiring growing alphabets.
Proposed method
- Construct a family of strings s_k over a binary alphabet using binary representations of integers derived from a base string B_⌈log k⌉.
- Define s_k as a sequence of a-blocks separated by b's, where each a-block's length corresponds to a binary number formed from the prefix of w_k.
- Prove that the smallest SLP for s_k has size O(k) using recursive nonterminal construction based on binary encoding.
- Analyze RePair's behavior over k−1 rounds, showing it processes a-blocks independently due to the sparsity of b's.
- Establish that RePair's start rule contains Ω(k² / log k) distinct factors of length Θ(log k), using the structure of binary prefixes.
- Apply Lemma 1 (factor count bound) to show that any SLP for RePair's start rule must have size Ω(k² / log k), leading to the final approximation ratio.
Experimental results
Research questions
- RQ1What is the true worst-case approximation ratio of the RePair algorithm for grammar-based compression?
- RQ2Can a lower bound of Ω(log n / log log n) be established for RePair using only a binary alphabet?
- RQ3How does RePair's performance compare to the optimal SLP size on structured, highly repetitive strings?
- RQ4Does RePair's greedy replacement of maximal digrams lead to suboptimal SLPs on certain inputs?
Key findings
- The smallest SLP for the constructed string s_k has size O(k), where k = Θ(log n).
- RePair produces an SLP of size Ω(k² / log k) for s_k, due to the proliferation of distinct factors in its start rule.
- The approximation ratio of RePair on s_k is Ω(k / log k), which translates to Ω(log n / log log n) in terms of n.
- The lower bound holds for RePair even when restricted to replacing maximal digrams, confirming the robustness of the result.
- The construction uses only a binary alphabet, contrasting with prior lower bounds that required alphabets growing with n.
- The gap between RePair's performance and the optimal SLP remains large, as the upper bound is O((n / log n)^{2/3}).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.