Diffusion-Limited Aggregation, Explained
After reading this you will understand how random walkers build a branched fractal crystal one particle at a time, how to predict its fractal dimension from a log-log plot, and why the tips always win.
What it is and one hook example
Diffusion-limited aggregation (DLA) grows a cluster by releasing particles one at a time far from a seed. Each particle takes a random walk. The moment it touches the existing cluster, it freezes in place and becomes part of it. Repeat a few thousand times and you get a spidery, branched deposit that looks nothing like a filled disk.
Here is the hook. Imagine a single frozen dot at the center of the screen. You send in one wandering particle. It jitters left, right, up, down at random until it happens to touch the dot, then it sticks. Now there are two frozen dots. The next walker has a slightly larger, slightly bumpier target. Over 20000 walkers the target grows outward in fingers, because a walker drifting in from far away almost always brushes an outer tip before it can thread its way into an interior gap. The result is the same rough branching you see in mineral dendrites on limestone and in zinc electrodeposits.
The tool starts from a single seed in the center. Particles enter on a ring around the cluster, walk in Brownian steps, and freeze on contact. Color encodes age: deep violet for the oldest core, through magenta and gold, to white for the newest growth at the tips.
When to use this model, and when not
Use DLA when growth is limited by how fast material arrives, not by anything happening at the surface. That is the meaning of "diffusion-limited." The surface grabs every particle that reaches it, so the bottleneck is transport through the surrounding medium. This regime describes electrodeposition at low voltage, viscous fingering between glass plates, dielectric breakdown, and mineral dendrites.
Do not use DLA when the surface itself controls the rate. If atoms can hop along the surface and settle into low-energy sites, you get faceted crystals with flat faces, not fractal fingers. DLA also assumes the arriving particles do not interact with each other in flight and that the cluster does not melt back. A real snowflake is partly DLA-like and partly governed by surface tension and heat diffusion, so treat the snowflake mode here as a stylized demonstration, not a physics-grade snowflake.
The screening instability that makes DLA branch is the same one, called Mullins-Sekerka, that sharpens real solidification dendrites and electrodeposits. The toy model captures the geometry of that instability without solving the full heat and concentration equations.
The update rule and its intuition
The simulation runs a discrete loop. A walker at grid position (x, y) takes a step to one of its neighbors with equal probability. On a square lattice with four neighbors each step is
Here p is the probability of each of the four moves. The walk continues until the walker lands adjacent to a frozen site. At that point the stickiness parameter s decides the outcome: with probability s the walker freezes, and with probability 1 - s it steps again and keeps wandering.
When s = 1 the walker sticks on first contact, so it almost always attaches to an exposed tip. That gives the loosest, most branched clusters. When s is small, a walker can bounce off a tip many times and roll deeper into a gap before it finally sticks, which fills in the fjords and produces a denser deposit.
The remarkable fact is that the finished cluster is a fractal. Its mass N (the number of frozen particles) grows with cluster radius r as a power law:
D is the fractal dimension, C is a constant that depends on units, and r is measured from the seed. A solid disk would have D = 2 because mass scales with area. DLA sits at about 1.71 in the plane, so it is genuinely less than two-dimensional: doubling the radius multiplies the mass by 2^{1.71} \approx 3.27, not by 2^2 = 4.
A worked example reproducing the demo
The demo button uses the field defaults: a single central seed, free-form growth (snowflake mode off), stickiness s = 1, and enough walkers to build a cluster of a few thousand particles. Work through the mass-radius scaling by hand.
Estimating the fractal dimension from the readout
As the simulation runs it reports particle count and cluster radius. Suppose you pause it at four moments and record these pairs, which are typical for a default DLA run:
| Radius r (px) | Particles N | ln r | ln N |
|---|---|---|---|
| 20 | 170 | 2.996 | 5.136 |
| 40 | 560 | 3.689 | 6.328 |
| 80 | 1830 | 4.382 | 7.512 |
| 160 | 6000 | 5.075 | 8.700 |
- Take logs of each pair, as shown in the last two columns. The power law N = C r^{D} becomes the straight line \ln N = \ln C + D \ln r.
- The slope between the first and last points is the dimension estimate: D = \tfrac{8.700 - 5.136}{5.075 - 2.996} = \tfrac{3.564}{2.079}.
- Compute the ratio: D \approx 1.714. That matches the accepted plane value of about 1.71.
- Check consistency between neighboring points. From r = 40 to r = 80 the radius doubles and mass goes from 560 to 1830, a factor of 3.27. Since 2^{1.71} = 3.27, the scaling holds across the whole run.
Reading and interpreting the results
Three numbers tell you most of the story: particle count, radius, and the color gradient.
The particle count is the mass N. The radius is the reach of the outermost frozen particle. Plotting one against the other on log axes and reading the slope gives you the fractal dimension, exactly as in the worked example. If your slope comes out near 1.7 you have a clean DLA cluster; a slope near 1.9 means the growth is denser, which happens with low stickiness.
The color gradient is a growth history. Violet marks the oldest core, white the newest tips. Because new particles almost never reach the interior, the violet core stays frozen in time while white growth extends the tips. If you see white deep inside the cluster, something is wrong with your run: walkers are somehow reaching the interior, which usually means the entry ring is too small.
To measure the dimension yourself, pause at several radii, record the pairs, and fit a line to \ln N against \ln r. Use at least four points spanning a factor of eight in radius, or the slope estimate will be noisy.
Common mistakes
Reading density instead of dimension. A DLA cluster looks like it has "gaps," but the fractal dimension is not the same as the fraction of filled pixels. Dimension is a scaling exponent, measured across radii, not a single ratio at one radius.
Confusing stickiness with speed. Lowering stickiness does not slow the simulation in physical time; it changes the shape. Each rejected contact means one extra walk step, so the cluster fills gaps and gets denser and rounder, pushing D up toward 1.9. Do not read a low-stickiness compact blob as a "failed" DLA. It is a different growth regime.
Expecting a real snowflake. Snowflake mode mirrors each deposit into six-fold symmetry, which produces a pretty dendritic star. Real snowflakes owe their shape to surface tension and latent heat, physics this model does not include. Treat the six-fold star as a symmetry demonstration.
Too small a starting ring. If walkers launch too close to the cluster, they preferentially fill the near side and break the isotropy of the growth. Launch particles from a ring comfortably larger than the current cluster radius so each walker forgets where it started.
Related tools on this site
DLA is one member of a family of pattern-forming models. If you want to see chemistry-driven patterns rather than transport-limited ones, the Reaction-Diffusion Patterns tool grows coral, spots, and stripes from two competing chemicals. For self-organizing waves in an excitable medium, the Belousov-Zhabotinsky Reaction tool shows rotating spirals. To watch an actual faceted crystal form from atoms that interact and settle, rather than freeze on first contact, cool a fluid in the Molecular Dynamics: Phases of Matter tool. And for a very different transport process, the Flame Simulator lets you shape fire with fuel and turbulence.
Frequently asked questions
Why is the fractal dimension 1.71 and not a round number?
It is an empirical constant of the model, not something derived from a simple argument. Extensive plane simulations converge on about 1.71. In three dimensions the value is roughly 2.5. No exact closed form is known, which is part of what makes DLA interesting.
Why do the tips always grow faster than the interior?
A walker drifting in from the launch ring must survive a long random walk to reach an interior gap. It is far more likely to brush a protruding branch first. This screening means exposed tips capture almost all incoming particles, so the branches sharpen and the gaps stay open.
What does the stickiness slider actually change?
It sets the probability that a walker freezes when it touches the cluster. At s = 1 it freezes on first contact, giving open fractals with D \approx 1.71. At low s the walker bounces off tips and penetrates gaps before sticking, giving denser clusters with D closer to 1.9.
Is this how real crystals grow?
Only when growth is limited by diffusion of material to the surface, as in low-voltage electrodeposition, viscous fingering, and mineral dendrites. When surface atoms can rearrange, crystals form flat faces instead, and DLA does not apply.
How many walkers do I need to see the fractal scaling?
A few thousand is enough to see clear branching. To measure the dimension reliably you want the radius to span at least a factor of eight, which typically needs on the order of 10000 particles or more.