ab wrote:Then rather than starting with a completed grid, you start with an empty grid a fill it, until your solver has found a solution. Which, if you programmed the solver to use techniques based on logic, will be a unique solution.
This might be clear without saying, but I'll add it to this thread anyway to avoid mistakes: In this case you cannot regard any uniqueness-based technique as a techique based on logic. Why? Because it's a logical technique only in a puzzle with one unique solution. Here's a puzzle where your uniqueness test would fail if you allowed your solver to use uniqueness technique as a part of the test:
- Code: Select all
*-----------*
|2..|.7.|9.3|
|.7.|..9|..8|
|..9|2..|.1.|
|---+---+---|
|...|.12|..7|
|...|8.7|...|
|4..|95.|...|
|---+---+---|
|.6.|..3|4..|
|7..|1..|.9.|
|3.8|.9.|..1|
*-----------*
With singles we get this far:
- Code: Select all
*-----------------------------------------------------------*
| 2 8 46 | 45 7 1 | 9 56 3 |
| 1 7 346 | 345 346 9 | 56 2 8 |
| 56 35 9 | 2 36 8 | 7 1 4 |
|-------------------+-------------------+-------------------|
| 8 9 35 | 34 1 2 | 56 456 7 |
| 56 235 2356 | 8 34 7 | 1 45 9 |
| 4 1 7 | 9 5 6 | 8 3 2 |
|-------------------+-------------------+-------------------|
| 9 6 1 | 7 2 3 | 4 8 5 |
| 7 *245 25 | 1 8 *45 | 3 9 6 |
| 3 *45 8 | 6 9 *45 | 2 7 1 |
*-----------------------------------------------------------*
To avoid the Bug-lite pattern we could solve r8c2=2 and then solve the remaining cells as singles. But in fact this puzzle has 5 solutions.
Can you see where the test fails?
RW