# Is Hopfield network more efficient than a naive implementation of Hamming distance comparator?

Is Hopfield network more efficient than a naive implementation of Hamming distance that compare an input pattern and return the nearest pattern ?

• "and return the nearest pattern", return the nearest pattern from where? The memory? A database? The Hamming distance is a value that represents the dissimilarity between two strings (at most, it is an algorithm to compute such value), whereas the Hopfield network is a model. These are two apparently completely different concepts. So, why are you even trying to compare them?
– nbro
Jul 23, 2019 at 7:31
• From a database which contains all the vectors of 1 and -1 possible. Yes, this is why I wrote "a naive implementation of Hamming distance that compare patterns" and not just "Hamming distance". So I am not trying to compare a (metrical) distance with a network, but the algorithm that implements brutally / naively comparisons (which criteria is the Hamming distance) of an input pattern with all the patterns that we want to retrieve. Jul 23, 2019 at 8:03
• For example, imagine we stored two vectors (1 1 1) and (-1 -1 -1) in database and when we give an input like (1 1 -1) we want the algorithm to return (1 1 -1) after having him compare the input (1 1 -1) with (1 1 1) and with (-1 -1 -1) and find that the input (1 1 -1) is closer to (1 1 1) than to (-1 -1 -1). Jul 23, 2019 at 8:07