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)
- 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.