Skip to content

A depth first backtracking algorithm to solve Sodoku puzzles very quickly.

Notifications You must be signed in to change notification settings

AMHaag/sudoku-solver

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Sudoku Solver

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
  1. About The Project
  2. Getting Started
  3. How it Works
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Product Name Screen Shot

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.

(back to top)

Built With

  • Next
  • React

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/amhaag/sudoku-solver.git
  2. Spin up the develoment environment
    npm run dev

(back to top)

How It Works

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.

(back to top)

Contributing

While not built to be anything more than practice, contributions are welcome. If you'd like to contribute please follow the steps below.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License.

(back to top)

Contact

Aaron Haag - @aaronmhaag - aaronm.haag@gmail.com

Project Link: https://github.com/amhaag/sudoku-solver

(back to top)

Acknowledgments

  • The T3 Community
    • For being an excellent place to get and stay excited about wed development.
  • otheneildrew
    • for creating this excellent read me template

(back to top)