Lempel-Ziv algorithms are a class of Universal source coding Data compression algorithms which achieve the entropy limit asymptotically for Stationary ergodic process
On the Complexity of Finite Sequences
A Universal Algorithm for Sequential Data Compression (LZ77)
See also Algorithm to compute LZ complexity measure for implementation and explanation.
Elegant Compression in Text (The LZ 77 Method) - Computerphile http://www.data-compression.com/lossless.html
The LZ77 Compression Family (Ep 2, Compressor Head)
LZW algorithm