champagne wrote:I try a quick answer.
Just assume that your puzzle has only 2 solutions due to a UR not solved through a given. Then, you can face very similar difficulties as in any other valid puzzle.
You have several other problems with puzzles having multiples solutions:
a) using rules based on uniqueness, you can come to a false result (you are not authorized to use such rules unless you know that you have a valid puzzle)
b) in most case, you'll try without any success the most difficult rules you have in your basket.
That's why I never try to solve with "nice rules" a puzzle without having applied the brute force to check that the puzzle is valid.
It is true that rules based on uniqueness can not be used with an invalid puzzle, and a solver would have to be modified in such a way to not use them when grading invalid puzzles.
Maybe it would be better if I gave an example.
Take for example this puzzle
- Code: Select all
+-------+-------+-------+
| 3 . . | 7 . . | 4 . . |
| . 2 . | . 8 . | . 5 . |
| . . 1 | . . 9 | . . 6 |
+-------+-------+-------+
| 7 . . | 4 . . | 1 . . |
| . 8 . | . . . | . 2 . |
| . . 9 | . . 6 | . . 3 |
+-------+-------+-------+
| 4 . . | 1 . . | 7 . . |
| . 5 . | . 2 . | . 8 . |
| . . 6 | . . 3 | . . 9 |
+-------+-------+-------+
300700400020080050001009006700400100080000020009006003400100700050020080006003009
There are 8 possible solutions to this puzzle, they are listed below.
365712498927684351841359276732498165684531927519276843498165732153927684276843519
365712498927684351841539276732498165684351927519276843498165732153927684276843519
368715492927684351541239876735492168684351927219876543492168735153927684876543219
368751492927684351541239876735492168684315927219876543492168735153927684876543219
395762418624381957871549236762438195183957624549216873438195762957624381216873549
395762418624381957871549236762438195583917624149256873438195762957624381216873549
398765412624381957571249836763452198185937624249816573432198765957624381816573249
398765412624381957571249836765432198183957624249816573432198765957624381816573249
We can create a pencilmarked 'solution' grid by comparing these.
In all solutions, we see that r1c2 is either a 6 or a 9, therefore we can write 69 into r2c2 of our solution grid. For r1c3 all solutions result in either a 5 or an 8, therefore for that cell we can write in 58. If we repeat this process for all cells in the grid, we arrive at the following.
- Code: Select all
+--------------+--------------+--------------+
| 3 69 58 | 7 156 125 | 4 19 28 |
| 69 2 47 | 36 8 14 | 39 5 17 |
| 58 47 1 | 235 345 9 | 28 37 6 |
+--------------+--------------+--------------+
| 7 36 235 | 4 359 28 | 1 69 58 |
| 156 8 345 | 359 135 157 | 69 2 47 |
| 125 14 9 | 28 157 6 | 58 47 3 |
+--------------+--------------+--------------+
| 4 39 28 | 1 69 58 | 7 36 25 |
| 19 5 37 | 69 2 47 | 36 8 14 |
| 28 17 6 | 58 47 3 | 25 14 9 |
+--------------+--------------+--------------+
As the puzzle has multiple solutions we would not be able to determine a value for all cells using valid logical techniques, however we can remove candidates. A simple sweep produces the following grid.
- Code: Select all
+--------------+----------------+--------------+
| 3 69 58 | 7 156 125 | 4 19 128 |
| 69 2 47 | 36 8 14 | 39 5 17 |
| 58 47 1 | 235 345 9 | 238 37 6 |
+--------------+----------------+--------------+
| 7 36 235 | 4 359 258 | 1 69 58 |
| 156 8 345 | 359 13579 157 | 569 2 457 |
| 125 14 9 | 258 157 6 | 58 47 3 |
+--------------+----------------+--------------+
| 4 39 238 | 1 569 58 | 7 36 25 |
| 19 5 37 | 69 2 47 | 36 8 14 |
| 128 17 6 | 58 457 3 | 25 14 9 |
+--------------+----------------+--------------+
There are a number of differences between this and our 'solution' grid above, so we continue to remove candidates. We see that it is possible eliminate 5 from r5c79, through a naked pair with 58 r4c9 and r6c7, as well as eliminating 5 from r79c5 with the naked pair at r9c4 and r6c7.
After a number of other basics we arrive at the following.
- Code: Select all
+--------------+----------------+--------------+
| 3 69 58 | 7 156 125 | 4 19 28 |
| 69 2 47 | 36 8 14 | 39 5 17 |
| 58 47 1 | 235 345 9 | 28 37 6 |
+--------------+----------------+--------------+
| 7 36 235 | 4 359 28 | 1 69 58 |
| 156 8 345 | 359 13579 157 | 69 2 47 |
| 125 14 9 | 28 157 6 | 58 47 3 |
+--------------+----------------+--------------+
| 4 39 28 | 1 69 58 | 7 36 25 |
| 19 5 37 | 69 2 47 | 36 8 14 |
| 28 17 6 | 58 47 3 | 25 14 9 |
+--------------+----------------+--------------+
We can then use some simple coloring to eliminate the final candidates
- Code: Select all
+--------------+--------------+--------------+
| 3 69 58 | 7 156 125 | 4 19 28 |
| 69 2 47 | 36 8 14 | 39 5 17 |
| 58 47 1 | 235 345 9 | 28 37 6 |
+--------------+--------------+--------------+
| 7 36 235 | 4 359 28 | 1 69 58 |
| 156 8 345 | 359 135 157 | 69 2 47 |
| 125 14 9 | 28 157 6 | 58 47 3 |
+--------------+--------------+--------------+
| 4 39 28 | 1 69 58 | 7 36 25 |
| 19 5 37 | 69 2 47 | 36 8 14 |
| 28 17 6 | 58 47 3 | 25 14 9 |
+--------------+--------------+--------------+
As this is equivalent to our 'solution' grid, we may now stop. We may then rate the puzzle based on the solution path used.
This of course would only work for puzzles with multiple solutions, but for those with no solutions grading could be done on the path up to the first contradiction (first empty cell).