Skip to Main Content
In this paper, we compare the performance of two types of universal data compression algorithms: context-dependent grammar-based (CDG-based) codes and context-free grammar-based (CFG-based) codes. The theoretical comparison of two algorithm is complicated by the following two facts observed: 1) Both CDG-based codes and CFG-based codes are universal for the class of stationary, ergodic sources with a finite alphabet; and 2) When the number of distinct contexts is upper bounded by a fixed number, the upper bounds on worst-case redundancy of CDG-based codes and CFG-based codes against any finite context arithmetic codes are in the same order of O(log log n/ log n). previously, two universal algorithms were compared only on the basis of some individual sequences. It was shown that for any sequential lossless code that is performable on a computer, there exists a sequence that is not compressible by the given code.