
NSW (Navigable Small World)
Graph-based algorithm for approximate nearest neighbor search where vertices represent vectors and edges are constructed heuristically. Foundation for HNSW with (poly/)logarithmic search complexity using greedy routing.
About this tool
Overview
NSW (Navigable Small World) is a graph-based algorithm that finds approximate nearest neighbors in a dataset. An NSW is a graph where the vertices represent vectors and the edges are constructed heuristically from the similarity between vectors so that most vectors are reachable from anywhere via a small number of hops.
How NSW Works
Vector search using Navigable Small World graphs was introduced over the course of several papers from 2011-14. The key idea is that if we build a proximity graph with both long-range and short-range links, search times are reduced to (poly/)logarithmic complexity.
Search Algorithm
- Begin at a pre-defined entry point
- Identify which nearby vertices is closest to the query vector
- Move to that vertex
- Repeat greedy-routing search process by identifying nearest neighboring vertices
- Continue moving from vertex to vertex until local minimum is reached
Evolution to HNSW
The Hierarchical navigable small world (HNSW) algorithm builds on NSW by combining it with Skip Lists, generating a multi-layer NSW graph that enables logarithmic time complexity for approximate nearest neighbor search.
Performance Characteristics
Navigable small world models achieve (poly/)logarithmic complexity using greedy routing. The algorithm greedily traverses to connected vertices that are nearer to the query vector.
Applications
NSW graphs serve as the foundation for many modern vector similarity search systems and are used in production vector databases for efficient approximate nearest neighbor search.
Loading more......
Information
Categories
Tags
Similar Products
6 result(s)