Solving Sudoku via Production Rules
-
14-10-2019 - |
Question
I'm trying to solve any Sudoku puzzle using production rules, with Drools as my inference engine. One of the examples packed with Drools is precisely a Sudoku solver, here are the relevant rules:
... But it doesn't work right. All of the time, one or more cells in the grid end up empty and the program reports the puzzle as "unsolved".
Has anybody built a working inference rule-based solver for Sudoku? it doesn't matter the language or engine used, I would like to see the set of rules so that I can adapt them for Drools
Solution
There's a sudoku solver written in CLIPS here: https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/63x/examples/sudoku/
OTHER TIPS
Don't use trunk (master on github now), as that's unstable. Use the latest release from the download page. Apparently this example's been broken already in the 5.1 release, so you'd need the 5.0 release... Here's the issue, it might be solved for 5.2.0.M1 which will be released any day now, otherwise later.