.
If the challenge is to minimise the number of steps (not counting singles):
===> the first step is to find the anti-backdoors:
- Code: Select all
(init-sudoku-string "..15...4...3.4.....567....9..7....3..........8.5..26...3...89.....3.75....9.2..73")
(find-anti-backdoors)
8 BRT-ANTI-BACKDOORS FOUND: n6r8c1 n6r4c5 n1r4c1 n8r3c8 n1r3c5 n6r2c6 n6r1c9 n8r1c5
===> the second step is to try each of them in turn:
-load some rules, here whips, by selecting (in the config file):
- Code: Select all
(bind ?*whips* TRUE)
-and try each of the anti-backdoors (say nrc) in turn:
- Code: Select all
(try-to-eliminate-candidates nrc)
It happens that any of the 8 above anti-backdoors can indeed be eliminated by a whip (there's of course no
a priori guarantee for this to happen), giving rise to 8 different 1-step solutions:
- Code: Select all
681 : whip[7]: r4c1{n6 n1} - c5n1{r4 r3} - c7n1{r3 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r8c1 ≠ 6
stte
645 : whip[8]: r5n6{c6 c2} - r4c1{n6 n1} - c5n1{r4 r3} - c7n1{r3 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r4c5 ≠ 6
stte
141 : whip[7]: c5n1{r4 r3} - c7n1{r3 r5} - c6n1{r5 r9} - c4n1{r9 r6} - r6n4{c4 c2} - r9c2{n4 n6} - b4n6{r4c2 .} ==> r4c1 ≠ 1
stte
838 : whip[9]: r3c5{n8 n1} - r4c5{n1 n6} - r5n6{c6 c2} - r4c1{n6 n1} - c7n1{r4 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r3c8 ≠ 8
stte
135 : whip[8]: r4c5{n1 n6} - r5n6{c6 c2} - r4c1{n6 n1} - c7n1{r4 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r3c5 ≠ 1
stte
626 : whip[9]: c5n6{r1 r4} - r5n6{c6 c2} - r4c1{n6 n1} - c5n1{r4 r3} - c7n1{r3 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r2c6 ≠ 6
stte
619 : whip[9]: c5n6{r1 r4} - r5n6{c6 c2} - r4c1{n6 n1} - c5n1{r4 r3} - c7n1{r3 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r1c9 ≠ 6
stte
815 : whip[9]: r3c5{n8 n1} - r4c5{n1 n6} - r5n6{c6 c2} - r4c1{n6 n1} - c7n1{r4 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r1c5 ≠ 8
stte
Note that none of the above eliminations can be done by a bivalue-chain or a z-chain.
Of course, if I had to select only one answer, I'd take one of the two shortest whips.
If one allows whips[1], there is an additional W1-anti-backdoor: n6r5c2, giving rise to one more 1-step solution (but this time, modulo steps in W1 (indeed, a single one in this case):
- Code: Select all
whip[7]: r4c1{n6 n1} - c5n1{r4 r3} - c7n1{r3 r5} - r6c8{n1 n9} - r6c2{n9 n4} - r9c2{n4 n1} - c6n1{r9 .} ==> r5c2 ≠ 6
whip[1]: r5n6{c6 .} ==> r4c4 ≠ 6, r4c5 ≠ 6, r4c6 ≠ 6
stte
Another approach is to use nukes, i.e. Forcing-T&E, which can also solve this puzzle in one step:
- Code: Select all
(init-sukaku-grid
2 7 1 5 68 9 3 4 68
9 8 3 2 4 16 7 156 156
4 5 6 7 18 3 12 128 9
16 12469 7 14689 168 1456 124 3 12458
3 12469 24 14689 7 1456 124 12589 12458
8 149 5 149 3 2 6 19 7
7 3 24 146 5 8 9 126 1246
16 1246 8 3 9 7 5 126 1246
5 146 9 146 2 146 8 7 3
)
(apply-FTE-to-all-bivalue-pairs TRUE)
gives:
- Code: Select all
FORCING-T&E(BRT) applied to bivalue candidates n1r4c1 and n1r8c1 :
===> 13 values decided in both cases: n2r3c7 n4r4c7 n1r5c7 n9r6c8 n2r8c2 n4r8c9 n4r7c3 n6r7c4 n4r9c6 n2r5c3 n6r5c6 n5r4c6 n6r1c5
===> 63 candidates eliminated in both cases: n8r1c5 n6r1c9 n6r2c6 n1r2c8 n1r2c9 n1r3c7 n2r3c8 n1r4c2 n2r4c2 n4r4c2 n1r4c4 n4r4c4 n6r4c4 n6r4c5 n1r4c6 n4r4c6 n6r4c6 n1r4c7 n2r4c7 n1r4c9 n4r4c9 n5r4c9 n8r4c9 n1r5c2 n2r5c2 n6r5c2 n4r5c3 n1r5c4 n6r5c4 n8r5c4 n1r5c6 n4r5c6 n5r5c6 n2r5c7 n4r5c7 n1r5c8 n2r5c8 n9r5c8 n1r5c9 n2r5c9 n4r5c9 n9r6c2 n9r6c4 n1r6c8 n2r7c3 n1r7c4 n4r7c4 n1r7c8 n6r7c8 n4r7c9 n6r7c9 n1r8c2 n4r8c2 n6r8c2 n2r8c8 n1r8c9 n2r8c9 n6r8c9 n4r9c2 n4r9c4 n6r9c4 n1r9c6 n6r9c6
RESOLUTION STATE:
2 7 1 5 6 9 3 4 8
9 8 3 2 4 1 7 56 56
4 5 6 7 18 3 2 18 9
16 69 7 89 18 5 4 3 2
3 49 2 49 7 6 1 58 58
8 14 5 14 3 2 6 9 7
7 3 4 6 5 8 9 2 12
16 2 8 3 9 7 5 16 4
5 16 9 1 2 4 8 7 3
stte
Notice that the regular solution for SudoRules is as follows:
CSP-Rules/SudoRules regular solution: Show (solve "..15...4...3.4.....567....9..7....3..........8.5..26...3...89.....3.75....9.2..73")
***********************************************************************************************
*** SudoRules 20.1.s based on CSP-Rules 2.1.s, config = W+SFin
*** Using CLIPS 6.32-r779
*** Download from:
https://github.com/denis-berthier/CSP-Rules-V2.1***********************************************************************************************
20 singles
137 candidates, 620 csp-links and 620 links. Density = 6.66%
- Code: Select all
RESOLUTION STATE:
2 7 1 5 68 9 3 4 68
9 8 3 2 4 16 7 156 156
4 5 6 7 18 3 12 128 9
16 12469 7 14689 168 1456 124 3 12458
3 12469 24 14689 7 1456 124 12589 12458
8 149 5 149 3 2 6 19 7
7 3 24 146 5 8 9 126 1246
16 1246 8 3 9 7 5 126 1246
5 146 9 146 2 146 8 7 3
whip[1]: c7n4{r5 .} ==> r5c9 ≠ 4, r4c9 ≠ 4
whip[1]: c4n8{r5 .} ==> r4c5 ≠ 8
naked-pairs-in-a-row: r4{c1 c5}{n1 n6} ==> r4c9 ≠ 1, r4c7 ≠ 1, r4c6 ≠ 6, r4c6 ≠ 1, r4c4 ≠ 6, r4c4 ≠ 1, r4c2 ≠ 6, r4c2 ≠ 1
finned-x-wing-in-rows: n4{r6 r9}{c2 c4} ==> r7c4 ≠ 4
whip[1]: b8n4{r9c6 .} ==> r9c2 ≠ 4
naked-pairs-in-a-block: b7{r8c1 r9c2}{n1 n6} ==> r8c2 ≠ 6, r8c2 ≠ 1
finned-x-wing-in-columns: n6{c2 c4}{r5 r9} ==> r9c6 ≠ 6
whip[1]: b8n6{r9c4 .} ==> r5c4 ≠ 6
finned-x-wing-in-columns: n1{c7 c5}{r3 r5} ==> r5c6 ≠ 1, r5c4 ≠ 1
biv-chain-cn[3]: c1n1{r8 r4} - c5n1{r4 r3} - c6n1{r2 r9} ==> r9c2 ≠ 1
stte
It uses only very elementary patterns. Needless to say that I prefer a few small easy steps to a single hard one.