Sudoku Solver using a Wave Function Algorithm.
The Wave Function Collapse (WFC) algorithm was developed by Maxim Gumin. For a more detailed page about the algorithm, see the Wikipedia page.
- Select the Sudoku Cube with the lowest entropy (least amount of available states)
- If the cube already has a value:
- Found a Solution!
- If the cube has no value nor available states:
- Invalid Board! Return to the previous state.
- Select an state and propagate the selection to the cubes in the same row, column and square
Some examples can be found in puzzles. All of them were extracted from Sudoku.com. There is one puzzle for each of the available difficulties: Easy, Medium, Hard, Expert, Master, and Extreme.
Each test contains the initial board. All the empty spaces are represented by zeros.