||Previous Page||Better Brute Force||Next Page|
Well. That's not as bad. In fact, it is at least a few trillion times faster then the last solution. But it is still debatable as to whether or not it will finish in our life times.
There's one small improvement I want to make before moving on though. Take a look at:
Does anything seem wrong with it?
It has 2 3's in a 9x9 square, and is part of a constraint violation. I think that it seems kind of silly to try assigning a 3 to the highlighted cell, when it is blatantly obvious that that would violate the constraints of the problem. We could probably cut the number of states we need to explore in half by limiting the values we try for a cell to only those that won't violate current constraints.
This has the effect that, rather than violating constraints being the sign of 'its time to backtrack', we'll generate cells which have no valid values which can be assigned. That is important to remember in the next section.
|Previous Page||Better Brute Force||Next Page|