Hierarchical navigable small world (HNSW)
a fundamental breakthrough in approximate nearest neighbor search for high-dimensional vector spaces. Introduced by Yury Malkov and Dmitry Yashunin in 2016. The algorithm achieves logarithmic search complexity through a sophisticated multi-layer graph structure that separates connections by characteristic distance scales, enabling efficient navigation from coarse to fine granularity during search operations. - Medium / Wikipedia
see also
- Scaling HNSWs - most of Redis is single-threaded, but antirez decided to use threads for the HNSW.
- How hierarchical navigable small world (HNSW) algorithms can improve search - everyone is connected by just a few people. That same principle powers hierarchical navigable small world (HNSW) algorithms, which link data points so queries can reach the right match in far fewer hops.
Written on March 24, 2026, Last update on
algorithm
search
nearest-neighbor
