LZW Compression

Final Project: Tufts University COMP150 - Special Topics Data Structures and Algorithms

Obtaining and Building the Source Code

The source code for the compressor, and the data analysis code, are available on GitHub here. Building the compressor requires g++; it has been tested with GCC 6.3, but should compile correctly on GCC 5. The analysis code requires Wolfram Mathematica, and has only been tested on Mathematica 11, though it should work with any reasonably recent version.

Once the source code has been acquired, move into the src directory and run make. This will create the bin directory alongside the src directory, and the lzw executable inside of it.

Invocation and Options

The lzw program should be invoked as follows:

lzw [OPTION] INFILE
with the file being compressed or decompressed as INFILE. The possible options are:

Statistics File Format

The files generated with the -s flag above during compression are normal ASCII comma-separated values files. Each line corresponds to the state of the compressor after emitting a code. Note that in general all sizes are measured in bits. The columns represent, in order: