About

What this is

An interactive encyclopedia of the classic algorithms — and the modern ones that run at scale — where you don't just read about each, you watch it work, see why it's correct, feel what it costs, and learn where it lives.

The four lenses

Every entry looks at one algorithm through the same four lenses:

Motion. The algorithm runs live on a canvas, manipulable — change the input, the size, the speed; play, pause, single-step, scrub. You can see it work, and break it.

The guarantee. The reason the answer is trustworthy, shown and not just stated. For a classic algorithm that's an invariant — the quiet fact that stays true through every step and, at the end, is the proof the answer is right (binary search: the target is always in the live window; Dijkstra: a settled distance is final). For a modern randomized or approximate algorithm it's a probabilistic / approximation bound, shown empirically — Count–Min never undercounts; the Bloom filter never misses a member; a random projection preserves every distance to within (1±ε).

The cost. Operations counted live, complexity stated with best/average/worst and why — no hand-waving "it's O(n log n)."

In the wild. Real history (the original paper) and where the algorithm actually runs today — with honesty about the gap between the textbook version and what production really uses.

Two wings: invariant and guarantee

The atlas spans two wings. The classic foundations — sorting, searching, graphs, strings, geometry, numerical methods, data structures, dynamic programming — are exact, and their soul is the invariant. The modern wing — sketching & streaming, locality-sensitive hashing and high-dimensional search, spectral graph theory, hashing, optimization — is mostly randomized or approximate, and its soul is a guarantee you can only see by measuring: run it thousands of times and watch the estimate concentrate, the error stay inside its proven envelope, the collision curve match theory. Most algorithm visualizers stop at the classics; the modern toolkit is beautiful, runs at scale today, and is almost never shown. Both wings are here, and held to the same bar.

One algorithm, written once

Each algorithm is implemented exactly once, as an instrumented generator that yields a snapshot of its state after every meaningful step. The animation you watch and the automated correctness test consume the same code — so a bug can't hide in the gap between "what we showed" and "what we tested," because there is no gap. The shipped site is dependency-free: vanilla HTML, CSS, and Canvas, no frameworks, no build step to view it. Open it in a browser and it will still run in twenty years.

How to read an entry

Press play and watch the motion; the colored highlights are the guarantee (often green) and the active step. Read the short explainer below the canvas — What you're seeing, The rule (clear pseudocode), The invariant or guarantee, The cost, In the wild, and a Try this that invites you to break it. Every factual claim has a real source in the references. When something is a teaching simplification rather than the production reality, the entry says so.

See the colophon for how the atlas is built and verified, and the glossary for the recurring terms.