Sudoku Solver

This upload consists of two files Sudoku_Main.m and Sudoku_Func.m. Sudoku_Main exists to pass a puzzle into Sudoku_Func to be solved.
21 Downloads
Updated 3 Sep 2019

View License

Sudoku_Main.m exists to format puzzles into a 9x9 matrix (a format suitable for Sudoku_Func to operate on) where they can then be solved and returned. Currently, this script is very bare-bones but I hope to update it in the future to add some functionality and potentially allow for different modes of input.

Sudoku_Func.m is where the puzzle is actually solved. First, a traditional 'note' method (similar to how a human would go about solving a basic sudoku puzzle) is employed in order to narrow down some obvious answers. This method can solve very basic puzzles on its own, but fails for more advanced puzzles. I still included the note method in the file as it can help to partially solve the puzzle which, depending on the difficulty of the puzzle, can reduce runtime significantly. After the note method, the partially-solved puzzle is then passed through a brute-force algorithm which guesses answers and then checks for errors.

Cite As

Nicholas DiGiacomo (2026). Sudoku Solver (https://www.mathworks.com/matlabcentral/fileexchange/72647-sudoku-solver), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Sudoku in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0