A free biweekly review · Issue 01 · December 1, 2026

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

15 min read

Recursive partitions of space, and the search sphere that ends up touching them all.
Drag · Throw · Hold 6s
Image from the article Above a few dozen dimensions, your k-d tree loses to brute force, by Franco Fernandonewsletter.francofernando.comAbove 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.

Image and text © Franco Fernando, The Polymathic Engineer.

Three ideas to take away

  1. 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.

  2. 02

    Three queries in one traversal: the same pruned descent answers nearest neighbour, m-nearest neighbours (with a bounded heap) and geographic disc search.

  3. 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.

Continue with Franco — read the original ↗

The author

Franco Fernando

Systems engineer · PhD in computer engineering · Author of The Polymathic Engineer

Zurich, Switzerland

Software engineer, researcher and technical author. Computer science degrees from the University of Florence and a PhD in computer engineering (computer vision, image processing, machine learning); safety-critical systems engineer and author of the weekly newsletter The Polymathic Engineer (200+ issues).

More by Franco

What did this piece make you think? Leave a note in the guestbook →