Diffusion-limited aggregation growing from a center seed. Each particle performs a random walk until it neighbors the cluster, then locks in place. Color tracks generation, blue to gold as branches extend. Switch modes for bottom-seed dendrites or multi-seed competition.
In 1981, T. A. Witten Jr. and L. M. Sander published a short paper in Physical Review Letters: "Diffusion-Limited Aggregation, a Kinetic Critical Phenomenon." It described a Monte Carlo algorithm so simple you could fit it on an index card. Plant a seed particle at the origin. Release a new particle somewhere far away. Let it walk randomly, one grid step at a time. The moment it lands adjacent to the growing cluster, freeze it. Repeat. The result, surprisingly, looked nothing like a compact circle. It grew into a fractal, branching and fingered, with dimension approximately 1.71 in two dimensions. The paper has been cited over a thousand times and became one of the cleaner theoretical descriptions of how nature builds complicated things cheaply.
The mechanism behind the fractal geometry is screening. Once a branch extends beyond the center, incoming walkers are far more likely to hit its tip than to diffuse all the way inward to the gaps between branches. The interior starves. Branches that get ahead stay ahead. The structure self-organizes around this asymmetry without any global coordination; each particle makes a purely local decision, and the branched form emerges from probability alone. You see exactly this pattern in zinc electrodeposition, in dielectric breakdown (the lightning-bolt structure inside Lichtenberg figures), in coral growth, and in the dendritic frost that forms on a cold window.
The simulation uses a grid to track occupied cells and grows the cluster outward from a single center seed (or a bottom edge, or multiple scattered seeds depending on mode). The core logic is in walkParticle, which runs one random walker to completion:
function walkParticle(maxSteps) {
let [gx, gy] = spawnWalker(); // spawn on a circle just beyond cluster edge
const killR = maxR + 100; // discard walkers that escape too far
for (let step = 0; step < maxSteps; step++) {
const dir = Math.floor(Math.random() * 4);
if (dir === 0) gx++;
else if (dir === 1) gx--;
else if (dir === 2) gy++;
else gy--;
const [wx, wy] = gridToWorld(gx, gy);
const r2 = wx*wx + wy*wy;
if (r2 > killR*killR) return false; // escaped — discard
if (hasNeighbor(gx, gy)) {
stick(gx, gy, stuckCount); // adjacent to cluster — lock it
return true;
}
}
return false;
}
The stick function assigns a generation number at the moment of freezing, which drives the color. Blue particles hit early, when the cluster is small and the spawn radius tight. Gold particles arrive late, walking farther before they land, extending branches that have already escaped screening. The artifact runs three modes (radial (classic Witten-Sander), bottom-seed (vertical dendrite), and scattered seeds (multiple competing clusters)) switching the seed geometry while keeping the same diffusion physics.
What the original 1981 paper established is that fractal dimension is not a property of the medium. It is a property of the growth rule. Sand, zinc, lightning, coral: the same screening dynamic produces the same geometry because the same constraint governs them all: diffusion rates matter, attachment rates do not. When diffusion limits, you get 1.71. The algorithm does not know it is modeling zinc. The zinc does not know it is running an algorithm.
DLA
Diffusion-limited aggregation: random walkers freeze on contact with the cluster, building fractal coral from probability alone.
View artifact →