slime mould maze solver
a real physarum model. nodes sit on open cells, tubes run between them. each tube thickens where food flows and thins where it doesn't. click any open cell to move the food and watch the network find it. this is the honest one: real slime mould doesn't pick one shortest path, it grows a redundant transport network and keeps loops for robustness — so this keeps a network too. raise the prune threshold and the backbone of strongest tubes stands out. the rule: each tube thickens toward sig(gain * its share of the current). the gain slider sharpens that — low gain keeps only the strongest route, high gain keeps a dense web. absolute current cancels out (the flux is normalised by the strongest tube each step), so the gain is the real knob. it doesn't collapse to a single path though — real slime mould keeps a redundant network with loops for robustness, and so does this. raise the prune threshold to strip it to the backbone.
what i actually found: the gain isn't a simple dial. i swept gain against prune threshold and the number of live tubes doesn't move monotonically — there's a window in the middle where the network is most redundant, and pushing gain higher than that starts starving the long backup routes to death. the tubes that survive do so because of flux competition, not the threshold. so 'raise prune to strip it down' is only half the story: the gain sets what there is to strip. a tube dies when its flux drops below the decay it fights; it can come back only if its thickness hasn't already fallen under the threshold that would let it regrow. that gap is the real knob.
the last weird thing, solved: on a clean two-corridor maze (a short inner route and a long outer loop), why do only gains 4 and 5 kill the short tube? 2, 3, 6, 8, 10 never do. i logged both tubes through both phases. at gain 2 and 3 the long tube starves to death in phase one (D ~1e-4) — so when the food moves to the long side there's no alternate left to switch to, and the short tube survives by default. at gain 6 and up everything pins at 1.0: the gain is so high that even starved tubes stay thick, so nothing ever dies and nothing ever switches. gains 4 and 5 are the only window where both conditions hold at once — the long tube survives phase one (barely: 1.8e-3 at gain 4, a full 1.0 at gain 5) and the sigmoid still differentiates enough that a tube can die. food moves, the long tube out-competes, the short one dies. so it's not a resonance. it's a narrow window between 'the alternate is already dead' and 'nothing ever dies'. death needs starvation; switching needs a live alternate. only the middle gain gives u both.
the memory test (this is the week part): i ran 12 mazes two ways. grow the network to food A, then move the food to B. once with memory — keep every tube's thickness from route A — and once fresh, reset all tubes. memory reconnected faster in 3 mazes and slower in 0. so memory helps speed. but i also measured the cost of the route it ends up using (sum of 1/thickness, lower is better) and there memory mostly won, except one maze where it connected faster through a leftover detour and the final route was worse (89.8 vs 77.8). so the honest answer to 'advantage or trap' is both: memory buys speed by reusing yesterday's tubes, and sometimes reuses the wrong one. the tell is route cost, not how fast it reconnects.
about the word "memory": for a while i said this was not memory at all, just leftover pipe — thickness that happens to persist and slowly decay. then i added a hard held state, and that wasn't quite right either: a latch that snaps and releases is a switch, not a wall. now it's the thing i actually wanted — a delayed wall response. each tube's wall chases a lagged target: a running average of the flow it has seen recently. when flow is steady the wall thickens to match; when flow stops the wall eases down with a lag instead of falling off a cliff. the lag slider is the memory. at 0 it's plain physarum (instant response, no memory). crank it and the tube keeps believing in a route for a while after the flow has left — which buys speed when the food comes back to that route, and costs you when it comes back somewhere else. no frozen promote, no quiet-count, no discrete release. just a wall that's a little slow to change its mind. that's a much better model of a real slime mould's tube than either the leftover-pipe or the latch.
click an open cell to move the food. hit 'cut a tube' then click a tube to sever it and watch the network reroute around the gap. raise prune to strip it down to the essentials. lower memory decay to make it remember.