Is there efficient algorithm to encode keys in hash function with provided collisions? By efficient I mean with lowest runtime of **lookup operation** (taking constants into account) and deterministic. For example, I have set $x = {1, 4, 5.5, 7, 20, 24}$ and during the building (static table) I would like to put ${1, 5.5, 24}$ to have the same bucket, ${7, 20}$ to be in another bucket. In example there are floats, but strings or integers are also valid solution. The entries can be treated as unique (multiple values will be stored as one), the hash should be perfect (apart of collisions given in advance). This is about creating hash function. The most important part is **efficient** in terms of lookup, and less important, but still crucial to some point - creating such function should have low runtime (not exponential, smaller is better, but this is secondary concern). The working set will have at least $10^7$ elements, and bucket saturation will be in range [1-20]. The table is static, all values are known in advance. Creating double hashing scheme is good working solution, but in terms of lookup it gives overhead (if evaluation of good hash + weak hash < the best hash, otherwise it is optimal). Bloom filter is very cool option, which increases average throughtput of access, but does not increase the main function runtime - also the overhead of Bloom filter increases more than savings are.