This is an algorithm I designed to quickly solve even the most difficult sudoku puzzles using a backtracking algorithm.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project started as a fascination with tree traversal and to try my hand at creating a recursive algorithm from scratch. While there are many sudoku solvers out there, this served as a learning by experiment.
The algorithm itself is written in Javascript and the front end was built as a means to visually display its capabilities.
To get a local copy up and running follow these simple example steps.
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/amhaag/sudoku-solver.git
- Spin up the develoment environment
npm run dev
The function begins by finding all cells that have a definite answer and entering that answer. It will keep going through the board until it a completes a full iteration with no new values found. It then finds the cell with the fewest possibilities and implements a guess and then recursively calls the function. It will continue to work assuming that the guess was correct until the entire board is full and the solutionis validated or until it is impossible to contiune. If it is impossible to continue it will work back up the tree trying alternate guesses.
While not built to be anything more than practice, contributions are welcome. If you'd like to contribute please follow the steps below.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.
Aaron Haag - @aaronmhaag - aaronm.haag@gmail.com
Project Link: https://github.com/amhaag/sudoku-solver
- The T3 Community
- For being an excellent place to get and stay excited about wed development.
- otheneildrew
- for creating this excellent read me template