[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Sudoku stylesheet

Subject: Re: Sudoku stylesheet
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 16 Feb 2006 11:57:47 +0000
sudoku backtracking
On 2/13/06, andrew welch <andrew.j.welch@xxxxxxxxx> wrote:
> On 2/13/06, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > > 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.
>
> Yes I thought of your Knights Tour stylesheet as I wrote that - the
> crucial difference for me is that Backtracking involves unwinding the
> stack and carrying on with a different value, whereas in XSLT you
> can't unwind the stack - there is no *back* tracking as such - you
> just carry on from the same point (which is why you need all that
> stack).

Hmmm thinking about it I'm wrong to say that.  The call stack really
does unwind - even for recursive named templates the stack can unwind.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.