It's simple and elegant. Try implementing for small tilesets and you should get it right away. My bias is still toward search methods for texture synth over neural techniques. Results tend to have fewer artefacts, better long range order ;)<p>Original repo:<p><a href="https://github.com/mxgmn/WaveFunctionCollapse" rel="nofollow">https://github.com/mxgmn/WaveFunctionCollapse</a>
For reference, this is better known as sampling from Markov random fields. There is a sizeable literature dating back to the 1960's under that name.