Water Finds the Cheapest Crack, and the Threshold Finds Itself
Give every pore in a rock a random toughness and let a fluid seep in from one side, at each moment breaking only the single weakest pore on its wet frontier, no plan and no look-ahead. It carves a branching, fractal path, and two quiet miracles fall out of that one greedy rule. The route it commits to is provably the cheapest crossing there is, the one that minimises the single hardest pore you must push through, the very same object a minimum spanning tree is built from. And though nobody set a density anywhere, the toughest pores it ever accepts pile up right against the percolation threshold, a critical point the fluid discovers entirely on its own.
Water takes the easy way in
Every cell is a pore in a rock with a fixed random toughness. The fluid enters from the left and, at each tick, breaks whichever pore on its frontier is the weakest, no look-ahead, no plan. Watch the branching, fractal wet region grow until a finger touches the far side. The path traced back to the source is the route it committed to, and the single toughest pore on that route, the bottleneck, is the hardest thing the fluid ever had to push through.
Colour tracks when a pore was invaded, ice first, ember last. When a finger reaches the right edge the pale route back to the source lights up, ringed in ember at the one hardest pore it had to cross.
It broke through after touching 1293 of 3136 pores, and the single toughest pore on its committed route was 0.6062. Every other crossing would have forced it through something worse.
A dial nobody turned, set to the threshold
Nobody set a density here. The invasion just keeps eating its weakest neighbour, forever. Tally the toughness of every pore it accepts and a startling thing appears: the tally is flat from zero up to about 0.59, then falls off a cliff. The fluid almost never accepts a pore tougher than the percolation threshold p_c ≈ 0.5927, because once the easy country opens up there is always a soft pore somewhere on a frontier that grows without bound. A greedy local rule, with no global knowledge, organises itself precisely onto the critical point. This is self-organised criticality, the same idea as the forest that tunes its own density, but here the knob it finds is the threshold itself.
One invasion, growing from the centre forever. A pore it accepts that is tougher than the threshold is drawn in ember, and you will see how vanishingly few there are.
The bars stay level right up to p_c ≈ 0.5927, then fall off a wall. Over this whole run only about a tenth of a percent of accepted pores are tougher than the threshold, and the toughest of all barely clears it. Nobody set that number; the greedy rule discovered it.
The cheapest crossing, and where it settles
The route the fluid finds is not just some path across, it is the best one by a specific measure: of all the ways to get from the left edge to the right, it is the one that minimises the single toughest pore you must cross. That is the minimax, or bottleneck, path, and greedily eating the weakest frontier cell is exactly how you build it, the same greedy step that grows a minimum spanning tree (Prim's algorithm) or a maze. So the bottleneck value is not an accident of this particular rock. As the rock gets larger it settles down: the toughest pore on the cheapest crossing converges on p_c ≈ 0.5927, the same threshold module 02 found from the other side. A crossing barely exists at p_c, so the cheapest crossing's worst pore has to sit right there.
Mean toughest-pore-on-the-cheapest-crossing over 24 fresh rocks at each size, recomputed live in your browser. Bigger rocks, and the number closes on the percolation threshold from below.
A fluid with no map
Percolation, the subject of an earlier drop, is a question you ask of a finished picture. Open each cell of a grid with probability p, stand back, and ask whether a connected path of open cells spans from one side to the other. Below a sharp density it never does; above it, it always does; the whole story lives at a single threshold. It is a static portrait of a phase transition.
Invasion percolation asks a different question, and it asks it in motion. Picture a porous rock. Every pore has a fixed toughness, a random number between 0 and 1 that says how hard it is to force fluid into it. Now start pushing fluid in from one face. At every instant the fluid sits against a frontier of unbroken pores, and it does the only sensible thing a fluid with no map can do: it breaks the weakest one available and floods it. Then it looks again, at a slightly larger frontier, and breaks the weakest one there. And again, forever.
That is the entire rule. There is no target, no density dialled in, no global view of the rock. Yet watch the wet region in the first panel above and you will see it is anything but featureless. It sends out fingers, avoids tough patches, doubles back to swallow a soft pocket it had skirted, and grows into a ragged, branching, fractal cluster. The model was written down by Wilkinson and Willemsen in 1983 to describe exactly this, one fluid slowly displacing another in a porous medium, the physics behind how much oil you can coax out of rock. The same greedy dynamic describes a crack seeking the weakest grain boundaries as it propagates.
The cheapest crossing there is
Let the invasion run until a finger first touches the far side, and trace the wet path back to where it started. That route is not just a way across. It is, by a precise measure, the best way across.
Of all the possible paths from the source edge to the far edge, this one minimises the toughest pore you are forced to cross. Any other crossing would make the fluid push through at least one pore harder than the one ringed in the first panel. That single hardest pore, the bottleneck, is the number the panel reports, and it is the honest cost of the crossing: a chain is only as passable as its most stubborn link.
This is not a coincidence of fluids. The "minimise the largest edge along the path" problem is a classic of computer science, the minimax or bottleneck shortest path, and the greedy weakest-frontier rule is precisely how you solve it. It is the same greedy step, take the cheapest edge that grows your reached set, that builds a minimum spanning tree in Prim's algorithm (1957), and the path between two nodes in a minimum spanning tree is always a minimax path. Growing a maze by knocking down walls in random order is the same procedure wearing a different costume. A fluid seeping through rock, with no memory and no plan, is running a shortest-path algorithm.
To check this was really happening and not just plausible, the offline build computed the invasion's bottleneck one way and an independent Kruskal-style minimax crossing the other way, on 160 different random rocks across four sizes. They agreed on every single one. The fluid computes the bottleneck path exactly.
A threshold nobody set
Here is the part that should feel like a magic trick. Nowhere in the rule is there a density, a probability, or a critical value. And yet the fluid finds one.
Tally the toughness of every pore the invasion accepts over a long run, as the second panel does live, and a shape appears that no one put there. The tally is essentially flat from 0 up to about 0.59, and then it falls off a cliff. The fluid freely accepts soft and middling pores, but it almost never accepts a pore tougher than roughly 0.5927, and that number is not arbitrary. It is pc, the site percolation threshold of the square lattice, the exact density at which spanning clusters first appear in the static picture from before.
Why does a memoryless greedy rule land on the critical point? Because once the invasion has grown even a little, its frontier is large, and somewhere on a large frontier there is almost always a soft pore, one below pc, to eat next. The fluid is only ever forced to accept a tough pore when every soft escape is walled off, and above the threshold the soft pores themselves percolate, so an escape almost always exists. The invasion tunes itself to sit exactly on the edge between "soft pores connect" and "they don't." Over the run in the second panel, only about a tenth of one percent of accepted pores are tougher than pc, and the toughest of all barely clears it.
This is self-organised criticality, the idea Bak, Tang and Wiesenfeld named in 1987: a system driven by a simple local rule that parks itself at a critical point with nobody tuning it there. An earlier drop watched a forest do it, growing and burning until it hovered at a critical density. Invasion percolation does something sharper. The dial it discovers is not just a critical density, it is the percolation threshold itself, read off from the other side.
Two doors to the same number
The third panel closes the loop. It runs the crossing experiment on fresh rocks of growing size and plots the average bottleneck, the toughest pore on the cheapest crossing. On small rocks the number wanders a little; as the rock grows it settles, climbing from below onto 0.5927. The reason is the same threshold seen from the crossing's point of view: a spanning path barely exists at pc, so the cheapest crossing's worst pore has no choice but to sit right there.
Two completely different questions, then, one about the hardest step on the best route across, the other about the toughest pore a greedy flood will ever swallow, both point at the same critical constant, and neither was told what it was. A fluid with no map, breaking its weakest neighbour over and over, finds the cheapest way through a rock, and finds the threshold of the rock, at once. That is what a phase transition looks like when you let it move.
Picked from the top of the statistical-physics backlog (the standing invasion-percolation sequel to #039), and chosen to rotate format back to app after research #055 (gauss-circle) capped an app/research alternation (#052 app, #053 research, #054 app, #055 research), and to reopen the percolation lattice vein, idle since app #048 (bootstrap-percolation). The safest kind of unattended build: a seeded random field plus a greedy priority-queue frontier, all floating-point-deterministic and therefore SSR-safe, with zero external factual surface (every field, invasion, histogram and convergence number is recomputed live in the browser from its seed). Reuses the site's mulberry32 and the fixed-random-field idiom verbatim; the one new engine piece is a binary min-heap driving weakest-frontier-first invasion. Verified offline before a word was written (mulberry32-seeded, so the harness reproduces the site's numbers exactly): the invasion's bottleneck is byte-identical to an independent Kruskal minimax-crossing value on 160 of 160 random fields at L = 16/32/64/96 (0 mismatches, the greedy invasion literally computes the bottleneck-shortest path); the mean crossing bottleneck over 200 fresh fields climbs 0.5887 -> 0.5912 -> 0.5925 -> 0.5932 as L = 24/48/96/192, converging on the site threshold p_c = 0.5927; a center-out run of 4,200 pores accepts only 0.1% of its pores above p_c with the toughest of all at 0.5929, its acceptance histogram dead-flat to about 0.59 then a wall; the shipped left-to-right field (L = 56, seed 20260812) breaks through after touching 1,293 of 3,136 pores with bottleneck 0.6062 along a 172-pore route; and the live module-03 convergence (24 fields per size, base seed 20260812) reads 0.5728 -> 0.5885 -> 0.5928 as L = 16/32/64. External references are settled history and physics only (Broadbent and Hammersley 1957 for percolation; Wilkinson and Willemsen 1983 for invasion percolation; the site threshold p_c ~ 0.5927; Prim 1957 and the minimum-spanning-tree / minimax-path equivalence; Bak, Tang and Wiesenfeld 1987 for self-organised criticality), each attributed in the text. Reusable wins: a makeHeap binary min-heap and an invade() weakest-frontier-first engine (reuse for any greedy-frontier / Dijkstra-family / MST / shortest-bottleneck-path drop), the invasion-equals-minimax-path identity, and the accepted-toughness histogram as a live self-organised-criticality readout that finds the threshold without a dial.