https://github.com/formix/sudoku
A Java Sudoku Solver
https://github.com/formix/sudoku
Last synced: about 2 months ago
JSON representation
A Java Sudoku Solver
- Host: GitHub
- URL: https://github.com/formix/sudoku
- Owner: formix
- License: mit
- Created: 2015-09-24T23:15:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T13:30:47.000Z (about 8 years ago)
- Last Synced: 2025-12-26T16:51:40.666Z (6 months ago)
- Language: Java
- Size: 1.41 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sudoku
*A Java Sudoku Solver*
Born from my frustration of not being able to solve even a simple sudoku
myself, I did this solver without looking at any existing algorithms. I
consider that I do not have to bother to solve a single sudoku anymore
since I solved them all with this program.
[Version 1.0.0](https://github.com/formix/sudoku/releases/tag/1.0.0)

It takes under 2 seconds 80% of the time to solve an evil grid. Sometimes,
the resolver get stuck in a local optimum and will take more than 10 seconds
or more to resolve. In these rare cases, the output message list (bottom
section) may becomes too big and past 10000 messages, it slows down the whole
application. This is not a core solver algorithm issue but a UI problem. When it
happens, cancel the execution, press the "Clear" button and try solving again.
The algorithm is based on [Markov Decision Process](https://en.wikipedia.org/wiki/Markov_decision_process)
principle.
## How To Start The Program
### From Source
From Eclipse, run the class `org.formix.sudoku.gui.SudokuSolver`.
### From The Executable Jar
From the command line, run `javaw -jar sudokusolver-1.0.0-jwd.jar`
## Usage
You can create your own sudoku by entering your base numbers and then
CTRL-Clicking the cell you want to freeze.
### Top Button Bar
#### Level DropDown
Allows selection of the level of difficulty for the downloaded grid.
#### Download
Gets a sudoku grid from [websudoku.com](http://like.websudoku.com) of the
selected level.
#### Generate
Generates a random sudoku with 26 fixed cells without regard of the selected
level. My sudoku generation algorithm is crude and produce multi-solution
easy-to-resolve grids. It sucks.
#### Cancel
Stops the current execution.
### Left Button Bar
#### Load
Loads a previously saved sudoku grid.
#### Save
Saves the current sudoku grid.
#### Solve
Solves the current sudoku grid.
#### Clear
Clears all writable cells. Keep frozen cells in place.
#### Empty
Empties the whole grid and the message log.
### Message Log
The bottom list displays messages generated while solving the grid.