Method
Hierarchical Navigable Small World (HNSW)
Hierarchical Navigable Small World (HNSW) is a graph index for approximate nearest-neighbor search. It organizes data points into layers so search can move quickly across long distances, then refine its results among closer points.
What it is
How it works
To build the index, HNSW inserts points one at a time. It randomly assigns each point a highest layer, with the probability of appearing in a layer decreasing exponentially at higher layers; the point is then included in that layer and the layers below it. At each layer, the new point is linked to selected neighbors, using a heuristic to choose links.14
To search, HNSW starts at an entry point in the top layer and follows edges toward points closer to the query. When it reaches a local minimum at that layer, it descends to the next layer from the current point and searches again. It repeats this process down to the bottom layer, where it refines the nearest-neighbor results.43
Where it came from
Yu. A. Malkov and D. A. Yashunin introduced Hierarchical NSW in their 2016 paper, “Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs.” It extends Navigable Small World graphs by adding layers that separate links by distance scale. The layered design also draws on the probability skip list, introduced by William Pugh in 1990; NSW work preceded HNSW.14
Versions and relatives
Strengths and limits
HNSW uses a fully graph-based index and does not need a separate search structure for coarse search. Its layered search and distance-scale separation are intended to improve performance over a Navigable Small World graph; the original description says this allows logarithmic complexity scaling.1
The graph can require substantial memory. Increasing the number of connections can improve recall and accuracy, but uses more memory and can slow index building and search; considering more candidates during construction can improve graph quality but takes longer. Considering more candidates at search time can improve accuracy while increasing search time.3
How recent papers use it
Papers that mention Hierarchical Navigable Small World (HNSW)
19 Nov 2026Introduced here
Exploring Semantic Table Search in Data Lakes
HNSW is used for approximate nearest-neighbor search over entity embeddings to prefilter tables.
17 Nov 2026Used
SIMQ: A Single Graph-based Index for Multi-Vector Query
HNSW is the default graph-based approximate nearest-neighbor index used by SIMQ.
16 Nov 2026Used
UniGraph: A Unified Graph-based Index for Dynamic Hybrid Dense-Sparse Vector Retrieval
It is used as the dense index and as a dense candidate generator.
Sources
- 1Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphsPaper abstract on arXiv
- 2A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor Searcharxiv.org
- 3HNSW | Milvus Documentationmilvus.io
- 4Hierarchical Navigable Small Worlds (HNSW) | Pineconepinecone.io
- 5AQR-HNSW: Accelerating Approximate Nearest Neighbor Search via Density-aware Quantization and Multi-stage Re-rankingPaper abstract on arXiv
- 6MESS: Fast and Private Semantic Search on Multi-Graph HNSWPaper abstract on arXiv
- 7Exploring Semantic Table Search in Data LakesPaper explained on this site
- 8SIMQ: A Single Graph-based Index for Multi-Vector QueryPaper explained on this site
- 9UniGraph: A Unified Graph-based Index for Dynamic Hybrid Dense-Sparse Vector RetrievalPaper explained on this site
Every paragraph above was checked against the sources it cites before it was published.