Five points trace an L-shaped bend through space. Point C sits right at the corner — closer, in a straight line, to both ends of the L than plain distance would suggest. How do you build a map of "who's really a neighbor of whom" that respects the bend instead of cutting across it?
C sits at the elbow of the path. Even though A and E are only two hops away along the bend, C's actual nearest neighbors are always B and D — never A or E — no matter whether you ask for its 1 or 2 closest points. The neighbor graph tracks the path, not a straight ruler laid across the page.
UMAP builds a fuzzy neighbor graph: instead of a hard yes/no "is this a neighbor," every pair of points gets a membership strength between 0 and 1.
- — point 's local radius: the distance to its single closest neighbor.
- — the distance between points and .
- — a bandwidth controlling how fast membership decays with distance (fixed here for exact arithmetic; real UMAP solves for it per point).
- — the directed membership of in 's neighborhood: at the local radius, decaying beyond it, and exactly once isn't among 's nearest neighbors at all.
- Every point gets a full-strength connection to its nearest neighbor
Subtracting shifts the exponential so that 's membership is exactly right at 's local radius — regardless of whether lives in a dense or sparse region. That's what makes this "uniform": density doesn't change how strongly a point connects to its own closest neighbor.
- Membership is directed, and can disagree in each direction
answers "how much does consider a neighbor" — which need not match , the reverse question. C might see B as an obvious neighbor while B has closer points of its own to worry about.
- Symmetrize with a fuzzy-set union, not an average
An edge counts as long as either direction sees it — the same logic as a union of probabilities of independent events. A plain average would let one side's "no" cancel out the other side's "yes."
Starting from a random-looking jumble, the same attract-along-edges, repel-everywhere-else rule that drives the real optimizer pulls A and B — connected at full strength — together almost immediately, while A and D — never neighbors — drift apart. Step forward and watch the gap between "A to B" and "A to D" open up.
Point A's true nearest neighbor is B, one unit away; C sits two units from A, and A doesn't make C's own shortlist:
- A's local radius
— A's nearest neighbor is exactly one unit away, so full-strength membership starts there.
- A's view of C
, so . A genuinely considers C a neighbor — just a weaker one than B.
- C's view of A — nothing at all
C's two nearest neighbors are B and D, not A — so . From C's side, A isn't close enough to register.
- The symmetrized edge survives on A's vote alone
. The fuzzy union means A's "yes" is enough to create a real, if partial, edge — even though C's own answer was "no."
Drag the steps slider until A is at least 1.5 units closer to its true neighbor B than to the unconnected D. (Watch out — one lone step can briefly make things worse before they settle.)
UMAP turns raw distances into a fuzzy graph — full strength at each point's own local radius, decaying beyond it, symmetrized by a union rather than an average — and then lays that graph out in low dimensions by pulling connected points together and pushing everything else apart. The result preserves local neighbor structure (who's close to whom) even when the manifold itself bends through the original space, the way C's true neighbors stayed B and D no matter how the raw straight-line distances to A and E looked.