i haven't read all the forum posts so i'm not claiming this is new.
it is a way to retrieve single-solution puzzles from a multi-solution puzzle
this puzzle has 1064 solutions:
9...14.2..4.5..31.8.1.2..6...5..2....19.3.2..628.5..3...3..1...164.7............. 1064 sols
first thing is to get all the solutions
collecting all values common to all solutions gives this expanded form, it simply makes explicit redundant values, values which when set dont lower the number of solutions.
9...14.2..4.5..31.8.1.2..6.375..2...419.3.2..628.5..3...3..1...164.7............. expanded
the cells of these values are the single-value cells, the complementary cells are the multi-value cells, they are the database from which the single-solution puzzles are retrieved.
the multi-solution puzzle looks like this:
- Code: Select all
9 35 67 3678 1 4 578 2 578
27 4 267 5 689 6789 3 1 789
8 35 1 379 2 379 4579 6 4579
3 7 5 14689 4689 2 14689 489 14689
4 1 9 678 3 678 2 578 5678
6 2 8 1479 5 79 1479 3 1479
257 89 3 24689 4689 1 456789 45789 2456789
1 6 4 2389 7 3589 589 589 23589
257 89 27 234689 4689 35689 1456789 45789 123456789
the values in multi-value cells are not candidates they belong to some solutions
each multi-value cell partitions the set of solutions as their values are mutually exclusive
the database is the NxM matrix with each row consisting of the values of the multi-value cells for one solution: N(#mvc)xM(#sols)
the first rows of the matrix for this puzzle:
- Code: Select all
(5 6 3 7 8 7 2 6 8 9 3 9 7 5 4 1 8 9 4 6 7 6 8 5 4 9 1 7 5 8 6 9 4 7 2 2 5 8 9 3 2 9 7 8 4 3 6 5 1)
(5 6 3 7 8 7 2 6 8 9 3 9 7 5 4 1 8 9 4 6 7 6 8 5 4 9 1 7 5 9 8 4 6 7 2 2 5 8 9 3 2 8 7 6 9 3 4 5 1)
(5 6 3 7 8 7 2 8 6 9 3 9 7 4 5 1 6 9 8 4 7 8 5 6 4 9 1 7 5 9 8 4 6 7 2 2 5 8 9 3 2 8 7 6 9 3 5 4 1)
(5 6 3 7 8 7 2 8 6 9 3 9 7 4 5 1 6 8 9 4 7 8 5 6 4 9 1 7 5 9 8 4 6 7 2 2 5 9 8 3 2 8 7 6 9 3 5 4 1)
(5 6 3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 1 4 8 9 6 8 6 5 7 9 7 1 4 5 9 4 8 6 7 2 2 5 9 8 3 2 8 7 6 9 3 5 4 1)
(5 6 3 7 8 7 2 6 8 9 3 7 9 4 5 1 4 8 9 6 8 6 5 7 9 7 1 4 5 8 4 9 6 7 2 2 5 9 8 3 2 9 7 6 8 3 5 4 1)
(3 6 7 8 5 7 2 8 6 9 5 9 3 7 4 1 6 9 4 8 8 7 5 6 4 9 1 7 5 8 6 9 4 7 2 2 8 5 9 3 2 9 7 3 4 5 6 8 1)
(3 6 7 5 8 7 2 6 8 9 5 9 3 7 4 1 8 9 4 6 6 7 8 5 4 9 1 7 5 9 8 4 6 7 2 2 5 8 9 3 2 8 7 3 9 6 4 5 1)
(3 6 8 7 5 7 2 6 9 8 5 7 3 9 4 1 9 4 8 6 6 8 5 7 4 7 1 9 5 8 9 4 6 7 2 2 5 8 9 3 2 9 7 3 8 6 5 4 1)
(...)
transpose this matrix so that the first column becomes the first row, etc. and count the occurrences of each value gives the number of solutions when that value is set in that cell: for example n3r1c2 gives 764 solutions n5r1c2 gives 300 solutions and they add up to 1064 solutions
the table of occurrences:
- Code: Select all
value 1 2 3 4 5 6 7 8 9
#cell
2: 0 0 764 0 300 0 0 0 0 #sols
3: 0 0 0 0 0 944 120 0 0
4: 0 0 300 0 0 120 402 242 0
7: 0 0 0 0 533 0 330 201 0
9: 0 0 0 0 231 0 212 621 0
10: 0 573 0 0 0 0 491 0 0
12: 0 491 0 0 0 120 453 0 0
14: 0 0 0 0 0 479 0 375 210
15: 0 0 0 0 0 465 39 447 113
18: 0 0 0 0 0 0 81 242 741
20: 0 0 300 0 764 0 0 0 0
22: 0 0 282 0 0 0 351 0 431
24: 0 0 482 0 0 0 272 0 310
25: 0 0 0 533 179 0 214 0 138
27: 0 0 0 531 121 0 227 0 185
31: 587 0 0 187 0 106 0 65 119
32: 0 0 0 612 0 120 0 90 242
34: 161 0 0 117 0 325 0 213 248
35: 0 0 0 47 0 0 0 623 394
36: 316 0 0 101 0 513 0 73 61
40: 0 0 0 0 0 453 197 414 0
42: 0 0 0 0 0 385 184 495 0
44: 0 0 0 0 634 0 364 66 0
45: 0 0 0 0 430 226 319 89 0
49: 477 0 0 265 0 0 114 0 208
51: 0 0 0 0 0 0 569 0 495
52: 138 0 0 388 0 0 238 0 300
54: 449 0 0 411 0 0 143 0 61
55: 0 192 0 0 673 0 199 0 0
56: 0 0 0 0 0 0 0 566 498
58: 0 208 0 454 0 89 0 154 159
59: 0 0 0 295 0 120 0 304 345
61: 0 0 0 20 143 634 237 24 6
62: 0 0 0 284 153 0 573 2 52
63: 0 664 0 11 95 221 55 14 4
67: 0 807 188 0 0 0 0 30 39
69: 0 0 173 0 774 0 0 42 75
70: 0 0 0 0 76 0 0 618 370
71: 0 0 0 0 140 0 0 354 570
72: 0 257 703 0 74 0 0 20 10
73: 0 299 0 0 391 0 374 0 0
74: 0 0 0 0 0 0 0 498 566
75: 0 573 0 0 0 0 491 0 0
76: 0 49 294 158 0 296 0 159 108
77: 0 0 0 157 0 345 0 295 267
78: 0 0 409 0 290 214 0 80 71
79: 765 0 0 6 133 105 45 8 2
80: 0 0 0 733 137 0 127 19 48
81: 299 143 361 10 113 104 27 5 2
this puzzle has no single-solution puzzle by setting only one value
performing the same operations on each partition will get the single-solution puzzles by setting two values
for example retrieving the 120 solutions that have 7 in r1c3 and counting the occurrences give this table:
- Code: Select all
2: 0 0 120 0 0 0 0 0 0
3: 0 0 0 0 0 0 120 0 0
4: 0 0 0 0 0 120 0 0 0
7: 0 0 0 0 94 0 0 26 0
9: 0 0 0 0 26 0 0 94 0
10: 0 120 0 0 0 0 0 0 0
12: 0 0 0 0 0 120 0 0 0
14: 0 0 0 0 0 0 0 56 64
15: 0 0 0 0 0 0 39 64 17
18: 0 0 0 0 0 0 81 0 39
20: 0 0 0 0 120 0 0 0 0
22: 0 0 37 0 0 0 44 0 39
24: 0 0 83 0 0 0 37 0 0
25: 0 0 0 68 0 0 22 0 30
27: 0 0 0 52 0 0 17 0 51
31: 63 0 0 30 0 0 0 13 14
32: 0 0 0 57 0 26 0 28 9
34: 25 0 0 11 0 37 0 22 25
35: 0 0 0 8 0 0 0 52 60
36: 32 0 0 14 0 57 0 5 12
40: 0 0 0 0 0 0 56 64 0
42: 0 0 0 0 0 94 11 15 0
44: 0 0 0 0 52 0 47 21 0
45: 0 0 0 0 68 26 6 20 0
49: 57 0 0 33 0 0 20 0 10
51: 0 0 0 0 0 0 33 0 87
52: 16 0 0 37 0 0 56 0 11
54: 47 0 0 50 0 0 11 0 12
55: 0 0 0 0 75 0 45 0 0
56: 0 0 0 0 0 0 0 74 46
58: 0 37 0 34 0 0 0 19 30
59: 0 0 0 36 0 33 0 19 32
61: 0 0 0 4 11 68 27 6 4
62: 0 0 0 46 21 0 45 2 6
63: 0 83 0 0 13 19 3 0 2
67: 0 83 28 0 0 0 0 2 7
69: 0 0 13 0 88 0 0 10 9
70: 0 0 0 0 6 0 0 64 50
71: 0 0 0 0 26 0 0 44 50
72: 0 37 79 0 0 0 0 0 4
73: 0 0 0 0 45 0 75 0 0
74: 0 0 0 0 0 0 0 46 74
75: 0 120 0 0 0 0 0 0 0
76: 0 0 55 23 0 0 0 22 20
77: 0 0 0 27 0 61 0 17 15
78: 0 0 24 0 32 26 0 31 7
79: 79 0 0 0 9 15 15 2 0
80: 0 0 0 66 21 0 28 1 4 single solution
81: 41 0 41 4 13 18 2 1 0 single solution
it is easy to find the two single solutions n7r1c3 + n8r9c8 or n8r9c9
all cells that have the same number of solutions as r1c3 have a redundant value
here the results of checking all partitions at depth 1, the first value combined with one of the following values gives a single-solution puzzle:
- Code: Select all
n7r1c3: n8r9c8 n8r9c9
n6r1c4: n8r9c8 n8r9c9
n5r1c7: n9r7c9
n8r1c7: n9r7c9
n8r1c9: n9r7c9
n2r2c1: n9r9c7 n9r9c9
n7r2c1: n9r7c7 n9r7c9 n9r9c7 n9r9c9
n2r2c3: n9r7c7 n9r7c9 n9r9c7 n9r9c9
n6r2c3: n8r9c8 n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1c7 n8r1c9 n7r2c1 n7r2c3 n2r2c3 n8r5c8 n8r5c9 n5r5c9 n8r8c7 n5r8c8 n2r9c1 n7r9c3
n8r8c6: n9r2c6 n7r2c9 n7r5c9 n9r6c4 n7r6c6 n4r7c8 n7r7c9 n4r9c4
n5r8c7: n7r2c6
n8r8c7: n9r7c9
n5r8c8: n9r2c6 n9r7c9
n2r9c1: n9r7c7 n9r7c9 n9r9c7 n9r9c9
n5r9c1: n4r7c9
n7r9c1: n9r9c7 n9r9c9
n2r9c3: n9r9c7 n9r9c9
n7r9c3: n9r7c7 n9r7c9 n9r9c7 n9r9c9
n2r9c4: n7r7c9
n3r9c4: n7r7c9
n4r9c4: n8r8c6
n9r9c4: n8r4c4
n9r9c5: n7r2c9
n5r9c6: n9r2c6
n9r9c6: n7r9c9
n6r9c7: n5r7c8
n9r9c7: n7r2c1 n2r2c1 n7r2c3 n2r2c3 n7r9c1 n2r9c1 n7r9c3 n2r9c3
n7r9c8: n4r7c9
n8r9c8: n7r1c3 n6r1c4 n6r2c3 n7r2c6
n7r9c9: n9r9c6
n8r9c9: n7r1c3 n6r1c4 n6r2c3 n7r2c6 n1r4c4 n6r4c9 n6r5c6 n7r5c9 n7r6c4 n1r6c9
n9r9c9: n7r2c1 n2r2c1 n7r2c3 n2r2c3 n7r9c1 n2r9c1 n7r9c3 n2r9c3
what emerges is a tree whose root is the database and whose leaves are layer after layer the refinement of the partitions