bconniff/Jadoku
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
JAVA SUDOKU SOLVER Jadoku is a program for solving Sudoku puzzles using Knuth's Dancing Links algortihm, written in Java and licensed under the 3-clause BSD license. You can find license details in the LICENSE file, located in the root directory of the source distribution. The program solves Sudoku grids by converting them into an instance of the exact cover problem, solving the exact cover with a Dancing Links implementation of Knuth's Algorithm X. This is significantly faster than the previous implementation which used a pencil-and-paper approach. The program will also detect if a puzzle is unsolvable. FILE FORMAT This program can take a list of files as arguments. Each file contains a list of puzzles, one per line. Each puzzle is a string of 81 digits with no spaces, representing the cells on a Sudoku grid from top-left to bottom-right. Cells numbered as 0 represent empty cells. In the Jadoku GUI, each puzzle will be opened in an individual window. COMPILATION Building the sudoku solver is simple. You will need Apache's Ant build system, and a minimum JDK version of 1.5. To compile, simply navigate to the root directory of the solver, and enter the command: $ ant This will produce a jar file, titled "Jadoku.jar", as the output. This jar can be run by the usual methods; double-clicking the file if you're on Windows or Mac, or using the command: $ java -jar Jadoku.jar [file]... If you're on UNIX or Linux. COMMAND LINE TOOL Jadoku comes with a command line tool as well, which can be invoked with the command: $ java -cp Jadoku.jar Cli [file]... This tool takes a list of files as arguments. Each file contains a list of puzzles, one per line. Each puzzle is a string of 81 digits with no spaces, representing the cells on a Sudoku grid from top-left to bottom-right. Cells numbered as 0 represent empty cells. The tool attempts to solve each puzzle, and, if successful, reports the time it took and the number of guesses (and the number of incorrect guesses). If the puzzle couldn't be solved, the time is reported as well as the fact that the puzzle wasn't solved. Once the program finishes execution, the total amount of time spent solving puzzles is displayed. INSTALLATION The jar file generated by Ant is entirely self-contained, so you can feel free to copy it anywhere you'd like.