Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iphoting/sudokusolver.java
A Java implementation of a Sudoku Solver
https://github.com/iphoting/sudokusolver.java
Last synced: about 1 month ago
JSON representation
A Java implementation of a Sudoku Solver
- Host: GitHub
- URL: https://github.com/iphoting/sudokusolver.java
- Owner: iphoting
- Created: 2011-11-18T04:34:55.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2011-11-27T10:23:12.000Z (almost 13 years ago)
- Last Synced: 2024-04-09T22:37:18.368Z (7 months ago)
- Language: Java
- Homepage:
- Size: 98.6 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SudokuSolver
## Introduction
This is a java implementation of a Sudoku solver which was initially posted to me as a java exercise question from my IS200 IS Foundations course. I'm posting this up for the fun of it.Currently a brute-force, backtracking (BFBT) algorithm is used to solve the puzzle and is inefficient at puzzles with minimal hints. One of the highest-difficulty puzzle currently takes approximately 1000 milliseconds under this algorithm.
## Usage
This solver takes in 81 arguments, one for each cell, separated by a space, as the initial puzzle state.$ java SudokuSolver \
0 6 3 4 9 0 0 0 1 \
0 0 0 0 0 0 7 0 9 \
0 1 9 0 0 0 0 0 0 \
0 0 1 0 0 2 9 3 0 \
9 0 0 1 0 7 0 0 2 \
0 7 8 9 0 0 4 0 0 \
0 0 0 0 0 0 8 2 0 \
3 0 6 0 0 0 0 0 0 \
4 0 0 0 2 9 1 7 0## TODO
There are plans to implement the following:1. Improve the current brute-force, backtracking (BFBT) algorithm by iterating through a list of valid numbers in random order, rather than just blindly going through 1–9.
2. Supersede the current BFBT algorithm with [Dancing Links (DLX)][1], keeping BFBT as an option.## Contributions
All suggestions on improving efficiency, or coding improvements, are welcome via pull requests.
[1]: http://en.wikipedia.org/wiki/Dancing_Links