Conference paper
Cite …

Combined Search and Encoding for Seeds, with an Application to Minimal Perfect Hashing

Hans-Peter Lehmann  ORCID iD icon 1, Peter Sanders  ORCID iD icon 1, Stefan Walzer  ORCID iD icon 1, Jonatan Ziegler  2, Anne Benoit [Ed.], Haim Kaplan [Ed.], Sebastian Wild [Ed.] and Grzegorz Herman [Ed.]
1 Institute of Theoretical Informatics (ITI), Karlsruhe Institute of Technology (KIT)
2 Karlsruhe Institute of Technology (KIT)
DOI: 10.5445/IR/1000185753
Publisher's version published on Oct 15, 2025
CC BY 4.0
Abstract

Randomised algorithms often employ methods that can fail and that are retried with independent randomness until they succeed. Randomised data structures therefore often store indices of successful attempts, called seeds. If $n$ such seeds are required (e.g., for independent substructures) the standard approach is to compute for each $i ∈ [n]$ the smallest successful seed $S_i$ and store $S = (S_1,…,S_n)$.

The central observation of this paper is that this is not space-optimal. We present a different algorithm that computes a sequence $S' = (S_1',…,S_n')$ of successful seeds such that the entropy of $S'$ undercuts the entropy of $S$ by $Ω(n)$ bits in most cases. To achieve a memory consumption of $OPT+εn$, the expected number of inspected seeds increases by a factor of $O(1/ε)$.

We demonstrate the usefulness of our findings with a novel construction for minimal perfect hash functions that, for $n$ keys and any $ε ∈ [n^{-3/7},1]$, has space requirement $(1+ε)OPT$ and construction time $O(n/ε)$. All previous approaches only support $ε = ω(1/log n)$ or have construction times that increase exponentially with $1/ε$. Our implementation beats the construction throughput of the state of the art by more than two orders of magnitude for $ε ≤ 3$%.