dobrichev suggested that his (excellent) Sudoku solver can be used to identify UA sets as follows:
- assume we have a multi-solution puzzle
- identify the unsolved cells at the point of the last guess made
- this set is invariably a minimal UA
I think this might not always be the case, and will provide what I believe are counter-examples.
I have tested both normal Sudoku and SudokuP solvers. Examples here are using normal Sudoku.
Our test grid:
- Code: Select all
123456789456897231978312456247638915385149672691725843862571394714963528539284167
I generated test cases by removing random clues until the first occurrence of multiple-solutions. The UA (last set of unsolved cells) was then tested in the normal way by:
- setting grid X = full solution grid minus those clues identified in the UA
- testing whether every individual UA clue when added to X gave a unique solution
Most of the time the UA was valid, but in about 25% of cases some clues did not pass the test. Here are 3 examples of when the test failed. P is the puzzle selected by random reduction, U is the UA identified from the solver's last guess.
The UA clues marked "?" are clues in the UA that failed the test, "X" indicates a valid UA clue:
- Code: Select all
P: ...45..8.4.689.2.......2...2.76.89...851.96.2..1.25.43....7......49....8539.8.167
U: X....X..X.?......?X?..X..?X.......??.........??........X...X...?X..X.............
P: ...4.6..9..6..7.3..78..245..4.6..9153......72.9.72....86...1.94...9635..5......6.
U: ?X?.X..X..X.X..X.X.........X.X..........................XXX.?..X?.....XX.?.XX.X.X
P: .23..678...689.....7...2....4...8..53....9.72.91......8...71.947...63.2.539..41.7
U: X..?....?X......XX?..XX.X.XX..XX.......XX.X..X...X..XX...........................
In order to verify that the dodgy UA's weren't simply an artefact created by failure to identify the "last guess" point correctly, I ran the test with the solver set to record ALL guesses, then scanned this list testing each unsolved clue set, but this did not turn up any other valid UA set.
I'm hoping I have made some elementary error in this process, because having to filter the UA's to remove invalid entries is an overhead, so it would be nice if this was not needed.
Either way, it is still a nice easy way of getting UA's.