This project demonstrates a hybrid implementation of Huffman Encoding, combining GPU-accelerated frequency analysis using CuPy with traditional CPU-based Huffman tree construction and encoding. It runs smoothly on Google Colab with GPU support.
- β Frequency counting on GPU using CuPy for high-speed analysis
- β Huffman tree construction on CPU
- β Compression of large strings with customizable input
- β Fully executable on Google Colab (no local GPU required)
π Click here to open in Colab
- Python 3.x
- CuPy (compatible with CUDA 12.x on Colab)
Install CuPy in your Colab notebook with:
!pip install cupy-cuda12x- Input a large text/string to be compressed.
- GPU acceleration is used for counting symbol frequencies.
- Huffman tree is built on the CPU from the frequency table.
- Data is encoded into a compressed bitstring using the generated Huffman codes.
.
βββ LICENSE
βββ README.md
βββ file_structure
βββ main.py
βββ main_notebook.ipynb
1 directory, 5 files
This project is licensed under the MIT License.