Package org.sosy_lab.java_smt.example
Class Sudoku
- java.lang.Object
-
- org.sosy_lab.java_smt.example.Sudoku
-
public class Sudoku extends Object
This program parses user-given Sudoku and solves it with an SMT solver.This program is just an example and clearly SMT is not the best solution for solving Sudoku. There might be other algorithms out there that are better suited for solving Sudoku.
The more numbers are available in a Sudoku, the easier it can be solved. A completely empty Sudoku will cause the longest runtime in the solver, because it will guess a lot of values.
The Sudoku is read from StdIn and should be formatted as the following example:
2..9.6..1 ..6.4...9 ...52.4.. 3.2..7.5. ...2..1.. .9.3..7.. .87.5.31. 6.3.1.8.. 4....9...
The solution will then be printed on StdOut, just like the following solution:
248976531 536148279 179523468 312487956 764295183 895361742 987652314 623714895 451839627
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSudoku.BooleanBasedSudokuSolverstatic classSudoku.IntegerBasedSudokuSolverstatic classSudoku.SudokuSolver<S>
-
Field Summary
Fields Modifier and Type Field Description static intSIZE
-
-
-
Field Detail
-
SIZE
public static final int SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(String... args) throws InvalidConfigurationException, SolverException, InterruptedException, IOException
-
-