Search an HNSW Graph

hard
Unit 26 · Vector Search0/0 to milestone

HNSW (hierarchical navigable small world) is the index behind most vector databases. It's a stack of proximity graphs: upper layers are sparse "highways", and layer 0 contains every point.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Search an HNSW Graph · TechGradify