No. 08 · High dimensions · Issue 01
Above a few dozen dimensions, your k-d tree loses to brute force
by Franco Fernando · The Polymathic Engineer · November 20, 2026
Above a few dozen dimensions, your k-d tree loses to brute forceRead the full article ↗Why we chose it
Recursively partitioning space with a k-d tree wins in low dimensions on static, median-balanced points — but collapses geometrically beyond a few dozen dimensions, when the search sphere ends up crossing almost every hyper-rectangle.
Three ideas to take away
- 01
Fragile to insertion order: adding points along a north-west to south-east highway systematically unbalances alternating x/y cuts, which forces static median construction and makes deletion expensive.
- 02
Three queries in one traversal: the same pruned descent answers nearest neighbour, m-nearest neighbours (with a bounded heap) and geographic disc search.
- 03
The critical threshold of the curse of dimensionality: the equidistant ring-road edge case and the empirical tipping point (k ≈ 20 for a million uniform points, k ≈ 30 for a billion) explain why modern vector search gave up exactness for approximate heuristics.
What did this piece make you think? Leave a note in the guestbook →

