.
- Code: Select all
Resolution state after Singles and whips[1]:
+-------------------+-------------------+-------------------+
! 3489 145 2 ! 189 3589 6 ! 7 1349 149 !
! 34789 1457 1589 ! 1789 35789 3578 ! 6 2 149 !
! 6 17 19 ! 4 2 37 ! 5 139 8 !
+-------------------+-------------------+-------------------+
! 2789 3 89 ! 6 1 478 ! 29 47 5 !
! 278 1257 4 ! 278 3578 9 ! 23 17 6 !
! 279 6 159 ! 27 357 3457 ! 239 8 147 !
+-------------------+-------------------+-------------------+
! 5 9 7 ! 3 4 1 ! 8 6 2 !
! 24 24 6 ! 789 789 78 ! 1 5 3 !
! 1 8 3 ! 5 6 2 ! 4 79 79 !
+-------------------+-------------------+-------------------+
1) There is an easy solution with bivalue-chains[≤4]:- Code: Select all
hidden-pairs-in-a-block: b4{n1 n5}{r5c2 r6c3} ==> r6c3 ≠ 9, r5c2 ≠ 7, r5c2 ≠ 2
hidden-single-in-a-column ==> r8c2 = 2
naked-single ==> r8c1 = 4
whip[1]: b4n7{r6c1 .} ==> r2c1 ≠ 7
x-wing-in-columns: n5{c3 c6}{r2 r6} ==> r6c5 ≠ 5, r2c5 ≠ 5, r2c2 ≠ 5
finned-x-wing-in-rows: n1{r5 r3}{c8 c2} ==> r2c2 ≠ 1, r1c2 ≠ 1
hidden-triplets-in-a-row: r6{n1 n4 n5}{c3 c9 c6} ==> r6c9 ≠ 7, r6c6 ≠ 7, r6c6 ≠ 3
singles ==> r9c9 = 7, r9c8 = 9, r3c3 = 9, r4c3 = 8
whip[1]: c6n3{r3 .} ==> r1c5 ≠ 3, r2c5 ≠ 3
naked-pairs-in-a-row: r4{c6 c8}{n4 n7} ==> r4c1 ≠ 7
x-wing-in-rows: n1{r3 r5}{c2 c8} ==> r1c8 ≠ 1
biv-chain[3]: r2n4{c9 c2} - c2n7{r2 r3} - b1n1{r3c2 r2c3} ==> r2c9 ≠ 1
biv-chain[3]: r2n5{c6 c3} - r1c2{n5 n4} - r2c2{n4 n7} ==> r2c6 ≠ 7
biv-chain[3]: r1c1{n8 n3} - r2n3{c1 c6} - b2n5{r2c6 r1c5} ==> r1c5 ≠ 8
biv-chain[3]: r1c5{n9 n5} - r2n5{c6 c3} - r2n1{c3 c4} ==> r2c4 ≠ 9
biv-chain[4]: r3c2{n7 n1} - b4n1{r5c2 r6c3} - r6c9{n1 n4} - r2n4{c9 c2} ==> r2c2 ≠ 7
stte
2) 1-step solutions:- Code: Select all
***********************************************************************************************
*** SudoRules 20.1.s based on CSP-Rules 2.1.s, config = TyW+W
*** Using CLIPS 6.32-r779
*** Running on MacBookPro Retina Mid-2012 i7 2.7GHz, 16GB 1600MHz DDR3, MacOS 10.15.7
*** Download from: https://github.com/denis-berthier/CSP-Rules-V2.1
***********************************************************************************************
(find-sudoku-1-steppers-wrt-W1 "..2..67.........2.6..4..5.8.3..1...5..4..9..6.......8.59.34...2......1.318.56.4..")
===> There are 13 W1-anti-backdoors:
n5r1c5 n4r1c8 n5r2c3 n1r3c2 n7r3c6 n3r3c8 n4r4c6 n7r4c8 n5r5c2 n1r5c8 n1r6c3 n5r6c6 n4r6c9
all of which lead to a 1-step solution with whips[≤8].
The simplest require a whip[6], e.g.:
- Code: Select all
whip[6]: c6n5{r2 r6} - r6n4{c6 c9} - c8n4{r4 r1} - r1c2{n4 n1} - r3n1{c3 c8} - c8n3{r3 .} ==> r1c5 ≠ 5
stte
OR:
whip[6]: c9n4{r2 r6} - r6n1{c9 c3} - r5n1{c2 c8} - r3n1{c8 c2} - r1c2{n1 n5} - b4n5{r5c2 .} ==> r1c8 ≠ 4
stte
OR:
whip[6]: c6n5{r2 r6} - r6n4{c6 c9} - c8n4{r4 r1} - r1c2{n4 n1} - r3n1{c3 c8} - c8n3{r3 .} ==> r2c3 ≠ 5
stte
OR:
whip[6]: c3n1{r3 r6} - c3n5{r6 r2} - r1c2{n5 n4} - r2n4{c2 c9} - r6n4{c9 c6} - c6n5{r6 .} ==> r3c2 ≠ 1
stte
OR:
whip[6]: r6n1{c9 c3} - b4n5{r6c3 r5c2} - r5n1{c2 c8} - r3n1{c8 c2} - r1c2{n1 n4} - c8n4{r1 .} ==> r6c9 ≠ 4
stte
(Note: SudoRules total computation time for this result = 11.45s on an old MacBookPro).
My conclusion: for this puzzle, the requirement for a 1-step solution leads to totally absurd solutions, compared to the simplest-first one.
3) 2-step-solutions:Considering there's no reasonable 1-step solution, it's natural to try the 2-step ones.
- Code: Select all
***********************************************************************************************
*** SudoRules 20.1.s based on CSP-Rules 2.1.s, config = TyW+W
*** Using CLIPS 6.32-r779
*** Running on MacBookPro Retina Mid-2012 i7 2.7GHz, 16GB 1600MHz DDR3, MacOS 10.15.7
*** Download from: https://github.com/denis-berthier/CSP-Rules-V2.1
***********************************************************************************************
(find-sudoku-2-steppers-wrt-W1 "..2..67.........2.6..4..5.8.3..1...5..4..9..6.......8.59.34...2......1.318.56.4..")
There remains 127 candidates after Singles and whips[1] have been applied.
===> 62 of them can be eliminated by rules in W8:
n4r1c1 n9r1c1 n1r1c2 n4r1c2 n3r1c5 n5r1c5 n1r1c8 n4r1c8 n9r1c8 n1r1c9 n4r2c1 n7r2c1 n8r2c1 n9r2c1 n1r2c2 n5r2c2 n7r2c2 n5r2c3 n8r2c3 n9r2c3 n8r2c4 n3r2c5 n5r2c5 n3r2c6 n7r2c6 n8r2c6 n1r2c9 n4r2c9 n1r3c2 n1r3c3 n7r3c6 n3r3c8 n9r3c8 n7r4c1 n8r4c1 n9r4c3 n4r4c6 n8r4c6 n7r4c8 n7r5c1 n8r5c1 n2r5c2 n5r5c2 n7r5c2 n7r5c4 n3r5c5 n7r5c5 n8r5c5 n1r5c8 n1r6c3 n9r6c3 n5r6c5 n3r6c6 n5r6c6 n7r6c6 n4r6c9 n7r6c9 n2r8c1 n4r8c2 n7r8c6 n7r9c8 n9r9c9
This leaves 5921 candidate pairs as possible anti-backdoor-pairs
After checking each of them, there are 1028 W1-anti-backdoor-pairs for the rules in W8.
1023 of them lead to a 2-step solution in W8. Here are the simplest 8:
- Code: Select all
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: r1n5{c2 c5} - c6n5{r2 r6} - b5n4{r6c6 r4c6} - c8n4{r4 r1} ==> r1c2 ≠ 4
stte
OR:
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: c6n5{r2 r6} - b5n4{r6c6 r4c6} - c8n4{r4 r1} - r1c2{n4 n5} ==> r1c5 ≠ 5, r2c2 ≠ 5, r2c3 ≠ 5
stte
OR:
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: b6n4{r4c8 r6c9} - r6n1{c9 c3} - b4n5{r6c3 r5c2} - r1c2{n5 n4} ==> r1c8 ≠ 4
stte
OR:
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: c6n5{r2 r6} - b5n4{r6c6 r4c6} - c8n4{r4 r1} - r1c2{n4 n5} ==> r2c3 ≠ 5, r1c5 ≠ 5, r2c2 ≠ 5
stte
OR:
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: r6n4{c6 c9} - c8n4{r4 r1} - r1c2{n4 n5} - b4n5{r5c2 r6c3} ==> r6c6 ≠ 5
stte
OR:
z-chain-rn[2]: r5n1{c2 c8} - r3n1{c8 .} ==> r1c2 ≠ 1
biv-chain[4]: r6n1{c9 c3} - b4n5{r6c3 r5c2} - r1c2{n5 n4} - c8n4{r1 r4} ==> r6c9 ≠ 4
stte
OR:
biv-chain[4]: r1n5{c2 c5} - c6n5{r2 r6} - b5n4{r6c6 r4c6} - c8n4{r4 r1} ==> r1c2 ≠ 4
biv-chain[3]: r1c2{n1 n5} - c3n5{r2 r6} - b4n1{r6c3 r5c2} ==> r3c2 ≠ 1, r2c2 ≠ 1
stte
OR:
biv-chain-bn[2]: b4n1{r5c2 r6c3} - b4n5{r6c3 r5c2} ==> r5c2 ≠ 2, r5c2 ≠ 7
hidden-single-in-a-column ==> r8c2 = 2
naked-single ==> r8c1 = 4
whip[1]: b4n7{r6c1 .} ==> r2c1 ≠ 7
biv-chain[4]: c8n3{r1 r3} - r3c6{n3 n7} - c2n7{r3 r2} - c2n4{r2 r1} ==> r1c8 ≠ 4
stte
(Note: SudoRules total computation time for this result = 15m 44s on the same old MacBookPro; juts what I needed to take my second morning tea.)
Notice that some of them require only bivalue-chains[≤4] and no z-chain. You can consider the computation time as very long, but:
- I activated rules much longer than reasonable (max-length 8, when 4 or 5 was the upper limit of reasonable)
- SudoRules had to consider 5921 candidate-pairs before finding only a few interesting ones.
Needless to say, a human solver would've to do the same job and has 0 chance to find these 2-step solutions.
[Edit]: I tried to restrict max chain length to 4, but still keeping all the possible chains, typed or not:
There remains 127 candidates after Singles and whips[1] have been applied.
===> 21 of them can be eliminated by rules in W4:
n4r1c1 n1r1c2 n4r1c2 n1r1c8 n4r2c1 n7r2c1 n9r2c1 n1r2c2 n5r2c2 n5r2c5 n1r3c3 n9r3c8 n2r5c2 n7r5c2 n9r6c3 n5r6c5 n3r6c6 n7r6c6 n7r6c9 n2r8c1 n4r8c2
This leaves 2436 candidate pairs as possible anti-backdoor-pairs
After checking each of them, there are 280 W1-anti-backdoor-pairs for the rules in W4.
19 of them lead to a 2-step solution in W4. Of course, the simplest of them are as before.
Total computation time is reduced to 3m 11s
[end edit]