3.66667

3.7 | 3 ratings Rate this file 3 Downloads (last 30 days) File Size: 1.79 KB File ID: #8466

MATLAB Sodoku Solver - Improved

by Geoff Boynton

 

11 Sep 2005 (Updated 12 Sep 2005)

Solves sodoku puzzles faster.

| Watch this File

File Information
Description

This is an improvement on the previously submitted recursive program that finds all possible solutions to a given sodoku puzzle.

Thanks to a clever suggestion by Leif Warland, this new program finds solutions about 20 times faster.

Acknowledgements
This submission has inspired the following:
Powerful Sudoku Solver
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
12 Sep 2005 per isakson

Nice recursion tutorial.

"if minsize == 1, break, end" at the end of the first loop cuts the execution time in half for the example given in the code.

18 Sep 2005 dvvvd v h hh

hhggtr

28 Oct 2005 Paul Larson

The program fails when three solid diagonal blocks are given. For example:
M=[1,2,3,0,0,0,0,0,0;4,5,6,0,0,0,0,0,0;7,8,9,0,0,0,0,0,0;...
0,0,0,5,6,7,0,0,0;0,0,0,8,9,1,0,0,0;0,0,0,2,3,4,0,0,0;...
0,0,0,0,0,0,9,1,2;0,0,0,0,0,0,3,4,5;0,0,0,0,0,0,6,7,8];

11 Jan 2006 mother goose

uhh

16 Oct 2006 zalata salata

good for you

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
games Geoff Boynton 22 Oct 2008 07:59:49
sodoku Geoff Boynton 22 Oct 2008 07:59:49
recursive Geoff Boynton 22 Oct 2008 07:59:49
faster Geoff Boynton 22 Oct 2008 07:59:49

Contact us at files@mathworks.com