xsl-list
[Top] [All Lists]

RE: Sudoku stylesheet

2006-02-13 08:34:09
The reason why this is so hard with XSLT is because you can't update
variables, which rules out Backtracking. 

No: my knight's tour stylesheet does backtracking quite happily. The two
problems seem conceptually quite similar. The main difficulty in both cases
is that each "move" involves a small change to a fairly large data
structure, which can be quite inefficient since it's likely that the entire
structure will be copied. For this reason in the knight's tour the most
efficient solution was the one that represented the entire board as a single
string value, and I suspect this might also be the most efficient
representation of a SuDoKu board.

You need to have enough stack available to handle the maximum number of
moves recursively, but at 81 that shouldn't be too difficult.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>