solve_sudoku( sudoku_grid_in )
Sudoku grid solver
The input of this function is an incomplete sudoku grid represented by a
9x9 matrix, where empty fields are represented as zeros. The output is a
9x9 matrix with all empty fields filled. This script uses the intlinprog
function that is the part of the optimization toolbox. The sudoku grid is
solved by representing the sudoku problem as a constraint of a integer
linear programming problem while ignoring the optimization part of the
intlinprog function. For a sudoku grid with multiple solutions the function returns one of the solutions without looking for the other ones. If there isn't any solution the function will return an empty matrix.
You can use the function plot_sudoku_grid.m to display the sudoku grid.
The function example_script.m gives you an example of how to use the script as well as proving that the sudoku solver works correctly.
Citation pour cette source
Adam Ivansky (2026). solve_sudoku( sudoku_grid_in ) (https://fr.mathworks.com/matlabcentral/fileexchange/58710-solve_sudoku-sudoku_grid_in), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
- Gaming > Number games > Sudoku >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 |
