3 ms·
Soduku is trivially directly solvable for puzzles that are not in the hard/ultra hard level by propagating constraints. For cases where that's not possible, it
by wiredfool 9y ago
Soduku is trivially directly solvable for puzzles that are not in the hard/ultra hard level by propagating constraints.
For cases where that's not possible, iterative approaches can be very effective -- with not particularly optimized python, the worst solution time I ever saw was 1 sec on a 1st gen eeepc netbook. That had about 6 layers of iterative backtracking before it came up with the solution.
- jcoffland 9y agoI wrote a Soduku solver in Python while waiting in the airport on a long layover that solves even the most difficult puzzles in a few seconds on an now old laptop. It requires some backtracking but it's really not that hard. Edit: I decided to publish my implementation on GitHub. https://github.com/jcoffland/fsudoku https://github.com/jcoffland/fsudoku
- deleted 9y ago[deleted]
- wiredfool 9y agoYeah, I was seeing if I could do the complete solution faster than a single solution. But I was at the inlaw's dinner table, not the airport. This is it, uploaded a few years later in a repo for soduku over sms: https://github.com/wiredfool/sms-doku/blob/master/so.py https://github.com/wiredfool/sms-doku/blob/master/so.py