## Solving methods where execution order does matter.

Advanced methods and approaches for solving Sudoku puzzles

### Solving methods where execution order does matter.

Recently I put the top50000 to my solver and it solved 8676 of the sudokus.
After reorganizing some aspects which affect evaluation order, the same solver
solved 8677 of the sudokus (no backup to spot the diff )
I asked myself if I did make (or correct) a bug without noticing.
Then I asked myself if for the solving methods I use, ordering makes a
difference, i.e. the application of a specific solving method and the
subsequent elimination of candidates prevented some other method to
match.
In my case the methods were:
APE, X/XY/XYZ/WXYZ-Wing, XY-Chain and Simple Coloring.
(no fishy stuff, no methods depending on uniquenes, no advanced ALS,...)

Does anybody have an example where the elimination of one of these
techniques prevented use of another one, when ordered "the wrong way"?
algernon

Posts: 25
Joined: 26 June 2006

### Order of logical solutions

Interesting Story:
Once in a while, (during the early creation of Logical Algorithms for my SudokuTrainer program), some puzzles were not being solved correctly.
These algorithms had been written to apply or demonstrate (if in train mode) only one logical solution, and only those numbers found with that logical solution were shown in a unique color on the screen. This allows the player or solver to see exactly what that logical solution (X-Wing) did.
I walked through the algorithm watching the code execute step by step and could find no problem...yet wrong numbers were being created for blank cells. My program allows saving a puzzle at any point, so going back to the "starting test point in the puzzle" was easy.
Finally I realized that I had written the algorithms assuming that all obvious solutions had been removed ie:
5--|345|345| In this case the algorithm was using the 345 and doing its thing...sometimes incorrectly. By adding checks to assure that all of these situations were cleared, the algorithm worked perfectly.
Greg Fiore
GregFiore

Posts: 10
Joined: 26 January 2006