Implementation of the DPLL and WalkSAT algorithm to solve sudoku puzzles
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DPLL.class
DPLL.java
DPLLSatisfiable.class
DPLLSatisfiable.java
README.md
Sudoku.class
Sudoku.java
SudokuSolver.class
SudokuSolver.java

README.md

sudoku-solver

Implementation of the DPLL and WalkSAT algorithm to solve sudoku puzzles with Java and the aima-java library.

Implementation

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.