Huffman compression

Also known as Huffman encoding, an algorithm for the lossless compression of files based on the frequency of occurrence of a symbol in the file that is being compressed. The Huffman algorithm is based on statistical coding, which means that the probability of a symbol has a direct bearing on the length of its representation. The more probable the occurrence of a symbol is, the shorter will be its bit-size representation. In any file, certain characters are used more than others. Using binary representation, the number of bits required to represent each character depends upon the number of characters that have to be represented. Using one bit we can represent two characters, i.e., 0 represents the first character and 1 represents the second character. Using two bits we can represent four characters, and so on.

Unlike ASCII code, which is a fixed-length code using seven bits per character, Huffman compression is a variable-length coding system that assigns smaller codes for more frequently used characters and larger codes for less frequently used characters in order to reduce the size of files being compressed and transferred.

For example, in a file with the following data:


the frequency of “X” is 6, the frequency of “Y” is 4, and the frequency of “Z” is 2. If each character is represented using a fixed-length code of two bits, then the number of bits required to store this file would be 24, i.e., (2 x 6) + (2x 4) + (2x 2) = 24.

If the above data were compressed using Huffman compression, the more frequently occurring numbers would be represented by smaller bits, such as:

X by the code 0 (1 bit)
Y by the code 10 (2 bits)
Z by the code 11 (2 bits)

therefore the size of the file becomes 18, i.e., (1x 6) + (2 x 4) + (2 x 2) = 18.

In the above example, more frequently occurring characters are assigned smaller codes, resulting in a smaller number of bits in the final compressed file.

Huffman compression was named after its discoverer, David Huffman.

Read Also:

  • Human Resources Management System

    A Human Resources Management System (HRMS) is a software application that combines many human resources functions, including benefits administration, payroll, recruiting and training, and performance analysis and review into one package.

  • HyperCard

    A hypertext programming environment for the Macintosh introduced by Apple in 1987. The HyperCard model consists of cards, and collections of cards, called stacks. You can connect the cards in various ways, and leaf through them the way you would with a set of Rolodex cards. In addition to data, each card can contain graphics […]

  • HyperDisco

    In hypermedia systems, a HyperDisco architecture is based on three levels of tools consisting of a combination of hypermedia tools and integrated third-party applications, as well as tool integrators. Tool integrators provide the hypermedia services to tools and act as session managers to coordinate a users’ access to multiple workspaces. In this system, the workspace […]

  • HyperOffice

    A collaboration tool with features ranging from e-mail to shared workspaces to project management. It offers Outlook integration that specifically targets the challenges of extended team members, and also helps users break free from reliance on Exchange or SharePoint. Some of its newest features include collaboration tools that connect the Apple iPhone to corporate e-mail, […]

  • HyperTransport

    HyperTransport technology is a high-speed, low-latency, point-to-point link designed to increase the communication speed between integrated circuits in computers, servers, embedded systems, and networking and telecommunications equipment up to 48 times faster than some existing technologies. HyperTransport technology is usually integrated directly into the processor, but in some cases HyperTransport is used as an integrated, […]

Disclaimer: Huffman compression definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.