marek stefanik wrote:More complex DPs can sometimes significantly simplify certain eliminations.
Consider this puzzle:
.657.....9...83...8.7.564..5...4.86..7............1.9..4....5.....37...1..3....2.
Suppose you manage to eliminate 1r2c3, 2r2c4, 2r3c2, and 1r4c2.
I've a much better idea: suppose the puzzle is solved.
As for a solution, there's a simple one based on 2 UR1s:
(Note that accepting uniqueness for this puzzle doesn't lead to much simplification: only -1 in max-length of chains.)
- Code: Select all
Resolution state after Singles:
+----------------------+----------------------+----------------------+
! 1234 6 5 ! 7 129 249 ! 1239 138 2389 !
! 9 12 124 ! 124 8 3 ! 1267 157 2567 !
! 8 123 7 ! 129 5 6 ! 4 13 239 !
+----------------------+----------------------+----------------------+
! 5 1239 129 ! 29 4 7 ! 8 6 23 !
! 12346 7 124689 ! 25689 2369 2589 ! 123 1345 2345 !
! 2346 238 2468 ! 2568 236 1 ! 237 9 23457 !
+----------------------+----------------------+----------------------+
! 1267 4 12689 ! 12689 1269 289 ! 5 378 36789 !
! 26 2589 2689 ! 3 7 24589 ! 69 48 1 !
! 167 1589 3 ! 145689 169 4589 ! 679 2 46789 !
+----------------------+----------------------+----------------------+
199 candidates, 1189 csp-links and 1189 links. Density = 6.04%
- Code: Select all
DP4-2-1s-OR4-relation for digits: 12
in cells (marked #): (r4c3 r4c2 r2c3 r2c2)
with 4 guardians (in cells marked @) : n9r4c3 n3r4c2 n9r4c2 n4r2c3
+----------------------+----------------------+----------------------+
! 1234 6 5 ! 7 129 249 ! 1239 138 2389 !
! 9 12# 124#@ ! 124 8 3 ! 1267 157 2567 !
! 8 123 7 ! 129 5 6 ! 4 13 239 !
+----------------------+----------------------+----------------------+
! 5 1239#@ 129#@ ! 29 4 7 ! 8 6 23 !
! 12346 7 124689 ! 25689 2369 2589 ! 123 1345 2345 !
! 2346 238 2468 ! 2568 236 1 ! 237 9 23457 !
+----------------------+----------------------+----------------------+
! 1267 4 12689 ! 12689 1269 289 ! 5 378 36789 !
! 26 2589 2689 ! 3 7 24589 ! 69 48 1 !
! 167 1589 3 ! 145689 169 4589 ! 679 2 46789 !
+----------------------+----------------------+----------------------+
DP4-2-1-OR3-relation for digits: 12
in cells (marked #): (r3c4 r3c2 r2c4 r2c2)
with 3 guardians (in cells marked @) : n9r3c4 n3r3c2 n4r2c4
+----------------------+----------------------+----------------------+
! 1234 6 5 ! 7 129 249 ! 1239 138 2389 !
! 9 12# 124 ! 124#@ 8 3 ! 1267 157 2567 !
! 8 123#@ 7 ! 129#@ 5 6 ! 4 13 239 !
+----------------------+----------------------+----------------------+
! 5 1239 129 ! 29 4 7 ! 8 6 23 !
! 12346 7 124689 ! 25689 2369 2589 ! 123 1345 2345 !
! 2346 238 2468 ! 2568 236 1 ! 237 9 23457 !
+----------------------+----------------------+----------------------+
! 1267 4 12689 ! 12689 1269 289 ! 5 378 36789 !
! 26 2589 2689 ! 3 7 24589 ! 69 48 1 !
! 167 1589 3 ! 145689 169 4589 ! 679 2 46789 !
+----------------------+----------------------+----------------------+
whip[1]: r4n1{c3 .} ==> r5c3≠1, r5c1≠1
finned-x-wing-in-rows: n3{r4 r3}{c2 c9} ==> r1c9≠3
naked-triplets-in-a-row: r2{c2 c3 c4}{n2 n1 n4} ==> r2c9≠2, r2c8≠1, r2c7≠2, r2c7≠1
naked-triplets-in-a-column: c7{r2 r8 r9}{n7 n6 n9} ==> r6c7≠7, r1c7≠9
singles ==> r6c9=7, r6c4=5
whip[1]: r6n8{c3 .} ==> r5c3≠8
whip[1]: r6n4{c3 .} ==> r5c1≠4, r5c3≠4
whip[1]: c7n9{r9 .} ==> r7c9≠9, r9c9≠9
naked-pairs-in-a-block: b6{r4c9 r6c7}{n2 n3} ==> r5c9≠3, r5c9≠2, r5c8≠3, r5c7≠3, r5c7≠2
naked-single ==> r5c7=1
finned-x-wing-in-columns: n3{c7 c1}{r1 r6} ==> r6c2≠3
swordfish-in-rows: n3{r3 r4 r7}{c8 c2 c9} ==> r1c8≠3
biv-chain[3]: r4c9{n3 n2} - r4c4{n2 n9} - r3n9{c4 c9} ==> r3c9≠3
biv-chain[3]: r6c7{n2 n3} - r1n3{c7 c1} - c1n4{r1 r6} ==> r6c1≠2
z-chain[3]: r9n7{c1 c7} - c7n9{r9 r8} - r8n6{c7 .} ==> r9c1≠6
DP4-2-1-OR3-whip[3]: r3c9{n2 n9} - OR3{{n9r3c4 n3r3c2 | n4r2c4}} - r2n2{c4 .} ==> r3c2≠2naked-pairs-in-a-row: r3{c2 c8}{n1 n3} ==> r3c4≠1
naked-pairs-in-a-column: c4{r3 r4}{n2 n9} ==> r9c4≠9, r7c4≠9, r7c4≠2, r5c4≠9, r5c4≠2, r2c4≠2
whip[1]: r2n2{c3 .} ==> r1c1≠2
biv-chain[3]: r6c2{n8 n2} - b1n2{r2c2 r2c3} - c3n4{r2 r6} ==> r6c3≠8
hidden-single-in-a-block ==> r6c2=8
DP4-2-1s-OR4-whip[3]: b1n2{r2c2 r2c3} - OR4{{n4r2c3 n3r4c2 n9r4c2 | n9r4c3}} - r4n1{c3 .} ==> r4c2≠2biv-chain[4]: r1n3{c1 c7} - c8n3{r3 r7} - b9n7{r7c8 r9c7} - r9c1{n7 n1} ==> r1c1≠1
whip[1]: c1n1{r9 .} ==> r7c3≠1, r9c2≠1
hidden-pairs-in-a-block: b7{n1 n7}{r7c1 r9c1} ==> r7c1≠6, r7c1≠2
biv-chain[3]: b8n5{r8c6 r9c6} - r9c2{n5 n9} - c7n9{r9 r8} ==> r8c6≠9
biv-chain[3]: r1n1{c5 c8} - r3c8{n1 n3} - r1c7{n3 n2} ==> r1c5≠2
z-chain[3]: b7n8{r8c3 r7c3} - b7n6{r7c3 r8c1} - r8c7{n6 .} ==> r8c3≠9
DP4-2-1-OR3-whip[3]: r2n1{c3 c4} - OR3{{n4r2c4 n3r3c2 | n9r3c4}} - r1c5{n9 .} ==> r3c2≠1stte