Skip to content

Naive implementations of some ANNS (Approximate Nearest Neighbor Search) algorithms without any optimization and generalization.

Notifications You must be signed in to change notification settings

hhy3/SimpleANNS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

SimpleANNS

Naive implementations of some ANN (Approximate Nearest Neighbor) search algorithms without any optimization and generalization.

Progess

  • FLAT
  • IVF_FLAT
  • IVF_SQ8
  • IVF_PQ
  • HNSW
  • RHNSW_FLAT
  • RHNSW_SQ
  • RHNSW_PQ

Algorithms

The algorithms used in ANN search can generally be classified as tree based, LHS based, graph based and IVF based, where graph and IVF based algorithms are more popular today but tree and LHS based algorithms are no longer commonly used. Moreover, quantization can be used to compress data and reduce memory usage.

[CVPR20 Tutorial] Billion-scale Approximate Nearest Neighbor Search is a good tutorial for ANN beginners.

ann-benchmarks contains some tools to benchmark various implementations of approximate nearest neighbor (ANN) search for different metrics.

Tree Based

Based on the idea of partitioning vector space, performs poorly in high demensional vector space due to the curse of dimensionality.

LHS (Locality Sensitive Hashing) Based

Instead of collision avoidance, the general idea of hashing, the idea of LSH is to expolit collisions for mapping points which are nearby into the same bucket. It is popular in theory area, but performs poorly in practice with real-world data.

Graph Based

Popular in recent years, mostly based on the idea of proximity graph. Given a query, start from a source point (randomly chosen or supplied by a separate algorithm), greedily find the closest point to the query.

Blog: Proximity Graph-based Approximate Nearest Neighbor Search

Inverted Index Based

This algorithm clusters the dataset to partition the space to Voronoi Cells, and by searching only neighbor cells reduces the data points needed to search.

Quantization

Datasets

About

Naive implementations of some ANNS (Approximate Nearest Neighbor Search) algorithms without any optimization and generalization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published