This project provides a C++ implementation of the KKP2 linear-time algorithm for computing the LZ77 factorization, as presented in [1]. LZ77 factorization is a foundational method in data compression, widely used in formats such as gzip and PNG.
- C++ compiler with C++11 support or newer (e.g., g++ >= 4.8.1, clang++ >= 3.3)
- GNU Make
- No additional libraries required
To build the main program, run:
$ make
This produces the executable compute_lz77, which constructs the LZ77 factorization of a given file.
$ ./compute_lz77 input.txt
This reads the text in input.txt, computes its LZ77 factorization, and writes the result to input.txt.lz77.
You can specify an alternative output file using:
$ ./compute_lz77 input.txt -o output.lz77
To perform correctness tests of the implementation:
$ cd tests
$ make
$ ./test
This runs built-in tests to verify the correctness of the LZ77 factorization.