IT lexicon › Programming › Wave function collapse

Wave function collapse

Programming På svenska → Updated: 2026-10-24

A procedural-generation algorithm that assembles a large output from small tiles by repeatedly fixing the most-constrained cell.

Published by Maxim Gumin in 2016, it borrows its name (loosely) from quantum mechanics. Each output cell starts in superposition — it could be any tile. The solver repeatedly collapses the cell with the fewest remaining options to a single tile, then propagates the adjacency constraints to its neighbours so that their possibilities shrink.

Done well, the result is locally identical to a small example image yet globally novel, which is why it caught on for generating tilemaps, dungeons and textures in indie games. At heart it is a constraint-propagation solver dressed in evocative terminology, and it can get stuck in a contradiction and need a restart.

← Back to the lexicon