© 1993 by British Computer Society
A Linear Time Algorithm for Finding Minimal Perfect Hash Functions

1 Institutes of Computer Science, Silesia University of Technology, and Polish Academy of Sciences, 44-100 Gliwice, Poland, 2 Key Centre for Software Technology, University of Queensland, Queensland 4071, Australia
A new algorithm for finding minimal perfect hash functions (MPHF) is proposed. The algorithm given three pseudorandom functions, h0, h1 and h2, searches for a function g such that F(w)=(h0(w)+(h1(w))+g(h2(w)) mod m is a MPHF, where m is a number of input words. The algorithm involves generation of random bipartite graphs and runs in linear time. The hash function generated is represented by using 2m+O(1) memory words of log m bits each. The empirical observations show that the algorithm runs very fast in practice.
Received July 7, 1992. revised November 25, 1992.
* Institutes of Computer Science, Silesia University of Technology, and Polish Academy of Sciences, 44-100 Gliwice, Poland
Key Centre for Software Technology, University of Queensland, Queensland 4072, Australia