Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 1.32 KB

README.md

File metadata and controls

14 lines (8 loc) · 1.32 KB

SudokuSolver

Christmas 2019 Project: Sudoku Solving Algorithm Visualizer.

Capture

To begin this project, I created an algorithm to generate a valid Sudoku board. This works by using a 9x9 2D array. Each cell has a 25% chance that a value will populate it, and that value is checked for legality in the vertical row, horizontal collum, and the 3x3 block it resides in.

Capture2

I then implemented a recursive backtracking algorithm to solve the Sudoku board. This reccursive algorithm works by finding the first empty space on the board, filing it with '1', then continuing to the next empty space. It will try '1', then see that it is not legal and try '2'. This will go on until it can no longer find a legal value to place in the empty space. When this occurs, it will backtrack to the immediate previous block, increase the value until it is legal, then move onwards again.

Capture3

Used JavaFX to create a clean GUI to visualize the algorithm.