This is a repo to store a pair of sudoku solving projects in Odin. Both use a depth first search algorithm for solving, and prioritise cells with fewer possibilities, but they differ in how they find those cells in the grid.
The first uses a simple linear search, and was easy to implement, but is very inefficient, as many cells are needlessly checked to see if they are the minimum.
My second approach utilises a dway heap as a priority queue to find the cell with the minimum number of options at each stage of the recursive algorithm. By benchmarking I found that for this application the optimal branch factor was 4, with other branch factors being only slightly worse.
When the two resulting programs are timed against one-another using the 50 sudoku puzzles here, heapdoku is around 4 times faster, and when solving an example deigned to be hard for depth first search the difference is even more pronounced, with the heap-based algorithm running at least 10 times faster.