3 ms·
A closely related technique to SAT solvers is the "Constraint Satisfaction Problem" which I've been looking into recently. Constraint Programming and SAT are
by dragontamer 8y ago
A closely related technique to SAT solvers is the "Constraint Satisfaction Problem" which I've been looking into recently.
Constraint Programming and SAT are BOTH NP-complete problems, and as such, they are mathematically equivalent. However, its sometimes more "obvious" to write problems in one form vs the other.
For example, Sudoku is simply written 27 constraints:
* All Different (X11, X12, X13, X14, X15, X16, X17, X18, X19)
* All Different (X21, X22, X23, X24, X25, X26, X27, X28, X29)
...
* All Different (X11, X21, X31, X41, X51, X61, X71, X81, X91)
...
* All Different (X11, X12, X13, X21, X22, X23, X31, X32, X34)
...
etc. etc.
Then define each "X" variable as "between 1 and 9" and bam, you're done with defining the problem in terms of "Constraints".
Representing Sudoku as a SAT problem is possible of course, but its just... harder. It just feels more humanly natural to represent Sudoku in terms of constraints. Or maybe not. Read "Part 1" if you want to see how the original blogger solved it in terms of 3-SAT (https://codingnest.com/modern-sat-solvers-fast-neat-underused-part-1-of-n/ https://codingnest.com/modern-sat-solvers-fast-neat-underuse...)
----------
Here's an article from IBM hyping up their "CPLEX" Constraint solver for Sudoku for example: https://www.ibm.com/developerworks/community/blogs/jfp/entry/solving_the_hardest_sudoku?lang=en https://www.ibm.com/developerworks/community/blogs/jfp/entry...
----------
Anyway, just plugging in a similarly fast, neat, and underused (and mathematically equivalent) solver to what the blogpost talks about. I personally don't know too much about SAT-solvers or their algorithms, aside from "They're same same, but different" to Constraint Programming.
- taeric 8y agoFor those having fun with the rabbit hole that is solving sudoku and similar problems with a computer, I highly recommend taking a look at Knuth's Dancing Links. I had fun with the idea here: http://taeric.github.io/Sudoku.html http://taeric.github.io/Sudoku.html His latest book which is due out this year goes into quite a lot of depth specifically on sudoku. The one he released last year using SAT solvers has a few fun exercises. In particular, he uses a SAT solver to construct sudoku boards that have a unique solution, but do not have any forced moves on the board.
- vinaybn 8y agoThis is a great related talk that explores how puzzles can be solved using SAT solvers, constraint solvers and dancing links: https://www.youtube.com/watch?v=TA9DBG8x-ys https://www.youtube.com/watch?v=TA9DBG8x-ys