Implementation of the DPLL and WalkSAT algorithm to solve sudoku puzzles with Java and the aima-java library.
The implementation of the sudoku representation as a SAT problem references to this paper.
The implemented strategies are DPLL (dpll) and WalkSAT (walksat).
- DPLL: systematic backtracking algorithm to solve SAT problems (command line parameter: dpll)
- WalkSAT: local search algorithm to solve SAT problems (command line parameter: walksat)
Running the program
- Clone the repository
- Run the following command:
java SudokuSolver <strategy> <input_file> <output_file>
For example, if you're running:
java SudokuSolver walksat test.sudoku test.solution
It means that you're looking for a sudoku solution of test.sudoku using the WalkSAT strategy, where the solution will be saved in test.solution.