solve_sudoku( sudoku_grid_in )

Sudoku solver based on intlinprog function
73 téléchargements
Mise à jour 14 août 2016

Afficher la licence

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
Créé avec R2015a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Sudoku dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0.0