"A backtracking method for constructing perfect hash functions from a set of mapping functions" - читать интересную книгу автора (Yang W.P., Du M.W.)