given 2 inputs m1, m2 and let h1, h2 be their hashing values using a particular hashing algorithm. The question is wheather the relative distance between m1 and m2 equals the distance between their hashing values h1 and h2; if yes is this property always true for all hashing algorithms otherwise why it's not true? ultimately is there a mathematical prof to this .
Does hashing functions (algorithms) preserve distances?
1–2 of 2 posts
Re: Does hashing functions (algorithms) preserve distances?
#2Most don't. Because it is not useful for them to preserve the relative distance.
However https://en.wikipedia.org/wiki/Locality-sensitive_hashing is class of hash functions designed to preserve distance.
> In other words, these are hash functions where the relative distance between the input values is preserved in the relative distance between the output hash values; input values that are closer to each other will produce output hash values that are closer to each other.