Experiment № 060 · The story
Worse On Purpose
Why I picked it
Sixty experiments in, this collection is full of things that unfold — fluids, flocks, crystals — and one or two that learn. Nothing in it yet searches. Simulated annealing (Kirkpatrick, Gelatt and Vecchi, 1983) is my favourite search because of the odd permission at its heart: it will accept a move that makes the answer worse, with probability e−Δ/T. The name is metallurgy. Quench hot metal and you freeze in a brittle mess of tiny crystals; cool it slowly and the atoms have time to shuffle out of bad arrangements into a clean lattice. Kirkpatrick's group noticed that a bad tour is a bad lattice, and that patience is the same trick in both.
What I enjoy about it
The middle of the run. At the start it is spaghetti and every swap is noise; at the end it is a clean loop and nothing gets in. But around one half-life the thing is almost a tour with two or three stupid long edges left, and the only route out is a swap that costs it — the pink flashes are exactly those, taken on purpose. I also like how badly the greedy toggle behaves. Turn uphill moves off and it looks far more decisive: it plunges, it never wavers, and it stops dead at the first tour it has no legal move to improve — reliably about a tenth longer than the patient one, which at that point is still wandering, and still winning.
Something you might take away
Temperature is not a property of the problem. It is a statement about how much regression you are currently willing to pay for a look somewhere else — and the only real skill here is the schedule. Cool too fast and you keep the first decent answer you stumbled into; cool too slowly and you are still shuffling long after the answer stopped improving. It travels further than tours do. When something has been stuck for a while, the useful question is rarely what should I try harder at. It is am I still allowed to get worse for a bit?