help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sudoku solver


From: Etienne Grossmann
Subject: Sudoku solver
Date: Sat, 31 Dec 2005 14:55:37 -0500
User-agent: Mutt/1.4.2.1i

  Hi All,

here is a sudoku solver I wrote recently. I tried it on just 3 probs,
the last ones from The Providence Journal, which it seems to solve. 

## [output,feasible] = sudoku (input) - Try to solve a sudoku problem
##
## This function applies brutish force and may or may not work properly. The
## method (1) excludes impossible values of cells within each group (row,
## column and 3x3 block), (2) deduces the value of a cell that is the only
## one to be able to assume that value within a group and (3) makes guesses
## and sees where they lead (depth-first search). Does not check for
## unicity. May or may not detect unsolvalble cases properly.
##
## Please report success/failure to me <address@hidden>.
##
## input   : 9 x 9 : initial grid w/ unknown values set to 0.
##
## output  : 9 x 9 : final grid. 
## feasible: true if a solution was found, 0 otherwise.

  Good resolution for 2006: Do more useful things than the above!

  Cheers,

  Etienne

-- 
Etienne Grossmann ------ http://www.cs.uky.edu/~etienne

Attachment: sudoku.m
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]