# Hashing algorithm which minimizes distribution

Consider applications A1, A2 .. AN having properties P11, P12,... PN1, PN2.. Also consider buckets B1, B2 ... BN where each property needs to be mapped. We have the following constraints -

total number of properties >> number of applications

total number of properties >> number of buckets

number of buckets ~= number of applications


Is there a hash algorithm which minimizes the number of distinct application each bucket is mapped to while still guaranteeing even distribution of properties? In other words, if one of the buckets were to be hidden temporarily, the number of distinct applications affected should be minimal.

• If it exists, as they are a finite number you can check all. Not exactly efficient, though. – vonbrand May 2 '20 at 15:53
• @vonbrand did you mean to suggest going through all existing hash functions? – aandis May 3 '20 at 1:32
• Do you really need the absolute minimum, or is something that is close to minimal acceptable? A random assignment is likely to be pretty good (close to optimal) when all three numbers are large. – D.W. May 3 '20 at 7:18
• Close to minimum @D.W. – aandis May 3 '20 at 11:25
• Please edit the question to incorporate that information. We want questions to stand on their own, so people don't have to read the comments to understand what you are asking. – D.W. May 3 '20 at 15:25