the optimisation that is slower, kept on purpose
The core loop of a memory-hard puzzle generator is a trimming pass: visit a very large edge set repeatedly, drop nodes that have only one neighbour, stop when nothing changes. Each pass needs counts per region, and the counts have to be…