Sudoku Solver
Input the partially filled problem as a 9 by 9 matrix and the out put will be given.
Uses a simple greedy and back tracking algorithm.
No error correction is done so please make sure that the inputs are valid
Blank squares of the puzzle should be given an input of value zero '0'.
Sample Input:
sudoku9([1 0 0 0 6 0 0 0 0; 0 0 0 0 0 0 7 8 2;0 0 0 0 4 2 0 0 9;0 7 0 0 0 0 4 0 0;6 0 0 5 0 8 0 0 3;
0 0 8 0 0 0 0 9 0;9 0 0 7 3 0 0 0 0;2 5 6 0 0 0 0 0 0;0 0 0 0 9 0 0 0 6])
Cite As
Mathew Goonewardena (2024). Sudoku Solver (https://www.mathworks.com/matlabcentral/fileexchange/30727-sudoku-solver), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |