SicHash -- Small Irregular Cuckoo Tables for Perfect Hashing

Hans-Peter Lehmann, Peter Sanders, Stefan Walzer
10/4/2022
cs.DS

Official code: ByteHamster/SicHash (20 stars, C++, GPL-3.0, last commit 2025-09-30).

Abstract

A Perfect Hash Function (PHF) is a hash function that has no collisions on a given input set. PHFs can be used for space efficient storage of data in an array, or for determining a compact representative of each object in the set.

Show full abstract

In this paper, we present the PHF construction algorithm SicHash - Small Irregular Cuckoo Tables for Perfect Hashing. At its core, SicHash uses a known technique: It places objects in a cuckoo hash table and then stores the final hash function choice of each object in a retrieval data structure. We combine the idea with irregular cuckoo hashing, where each object has a different number of hash functions. Additionally, we use many small tables that we overload beyond their asymptotic maximum load factor. The most space efficient competitors often use brute force methods to determine the PHFs. SicHash provides a more direct construction algorithm that only rarely needs to recompute parts. Our implementation improves the state of the art in terms of space usage versus construction time for a wide range of configurations. At the same time, it provides very fast queries.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

A (Minimal) Perfect Hash Function based on irregular cuckoo hashing, retrieval, and overloading.

201C++, TeXAug 24, 20221 years agoGPL-3.0

Similar Papers

Cite this paper

@article{lehmann2022sichash,
  title  = {SicHash -- Small Irregular Cuckoo Tables for Perfect Hashing},
  author = {Hans-Peter Lehmann and Peter Sanders and Stefan Walzer},
  year   = {2022},
  eprint = {2210.01560},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.01560}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.01560.svg)](https://codeofpaper.com/paper/2210.01560)

Discussion