Twin Sun and Daughter

Post puzzles for others to solve here.

Twin Sun and Daughter

Postby mith » Tue Dec 22, 2020 5:19 pm

Code: Select all
+-------+-------+-------+
| . . . | . . 9 | . . . |
| . . 9 | 5 . . | . . 3 |
| . 6 . | . 2 . | . 1 . |
+-------+-------+-------+
| . 1 . | . 6 . | . 7 . |
| . . 4 | 2 . . | . . 5 |
| 8 . . | . . . | . . . |
+-------+-------+-------+
| . . . | . . . | 7 . . |
| . . 3 | 9 . . | . . 4 |
| . 7 . | 4 1 . | . 6 . |
+-------+-------+-------+
.....9.....95....3.6..2..1..1..6..7...42....58..............7....39....4.7.41..6.


Hidden Text: Show
With letters, for the theme:
Code: Select all
+-------+-------+-------+
| . . . | . . U | . . . |
| . . U | K . . | . . H |
| . L . | . E . | . A . |
+-------+-------+-------+
| . A . | . L . | . N . |
| . . I | E . . | . . K |
| Q . . | . . . | . . . |
+-------+-------+-------+
| . . . | . . . | N . . |
| . . H | U . . | . . I |
| . N . | I A . | . L . |
+-------+-------+-------+
.....U.....UK....H.L..E..A..A..L..N...IE....KQ..............N....HU....I.N.IA..L.


Who knew Han was short for Hank all this time? >_>
mith
 
Posts: 996
Joined: 14 July 2020

Re: Twin Sun and Daughter

Postby pjb » Tue Dec 22, 2020 11:57 pm

3 MSLSs and basics:

19 cell truths: r13479 c1349
19 links: 167r1, 7r3, r4, 16r7, r9, 23459c1, 258c3, 38c4, 289c9
10 Eliminations: -7 r1c5, -6 r1c7, -7 r3c6, -6 r7c6, -2 r2c1, -4 r2c1, -2 r8c1, -3 r6c4, -2 r6c9, -9 r6c9

Naked triplets of 167 at r6c349 => -1 r6c67, -6 r6c7, -7 r6c56
Naked quins of 23458 at r34679c6 => -2 r8c6, -3 r5c6, -5 r8c6, -8 r58c6
Hidden pairs of 16 at r5c7 and r6c9
Hidden triples of 389 at r5c2, r5c5 and r5c8

16 cell Truths: r3479 c3469 +r6c6
16 links: 7r3, 2r4, 126r7, 2r9, 58c3, 38c4, 3458c6, 89c9
13 eliminations: r3c1<>7, r4c1<>2, r4c7<>2, r7c1<>1, r7c1<>2, r7c1<>6, r7c2<>2, r7c8<>2, r9c1<>2, r9c7<>2, r1c3<>5, r1c3<>8, r1c9<>8

Naked triplets of 258 at r349c3 => -2 r7c3, -5 r7c3, -8 r7c3
Naked quads of 3459 at r3479c1 => -5 r8c1

16 cell Truths: c2578 r1258
16 links: 8c2, 78c5, 168c7, 8c8, 345r1, 24r2, 39r5, 25r8
6 eliminations: r7c2<>8, r7c5<>8, r3c7<>8, r4c7<>8, r9c7<>8, r7c8<>8

Naked triplets of 459 at r7c12, r9c1 => -5 r8c2, r9c3
Naked quads of 3459 at r7c1258 => -3 r7c46, -5 r7c6, -9 r7c9

then:
Code: Select all
 2       3458    17     | 16     348    9      | 458    458    67     
 17      48      9      | 5      478    16     | 2468   248    3     
 345     6       58     | 378    2      348    | 459    1      789   
------------------------+----------------------+---------------------
 359     1       25     | 38     6      3458   | 349    7      289   
 67      39      4      | 2      389    17     | 16     389    5     
 8       2359    67     | 17     3459   345    | 2349   2349   16     
------------------------+----------------------+---------------------
 459     459     16     | 68     35     28     | 7      359    128   
 16      28      3      | 9      578    67     | 1258   258    4     
 59      7       28     | 4      1      2358   | 359    6      289   

(3)r4c1 - (3=8)r4c4|(3=9)r5c2 - (89=3)r5c5 - (3=5)r7c5
(9=3)r5c2 - r1c2 = r1c5 - (3=5)r7c5
(3)r6c2 - r1c2 = r1c5 - (3=5)r7c5 => -3 r7c5; stte

Phil
pjb
2014 Supporter
 
Posts: 2672
Joined: 11 September 2011
Location: Sydney, Australia

Re: Twin Sun and Daughter

Postby denis_berthier » Wed Dec 23, 2020 5:18 am

I'll use this puzzle for one more illustration of a new functionality of CSP-Rules, combining two recently added features:
- function solve-sukaku-grid
- output of the final RS (=PM) when a puzzle is not completely solved.

As this is a puzzle from mith, I'm expecting lots of Subsets. So, let's first try to find as many of them as possible, by activating only Subsets in the configuration file:

Code: Select all
 (bind ?*Subsets* TRUE)


(solve ".....9.....95....3.6..2..1..1..6..7...42....58..............7....39....4.7.41..6.")
***********************************************************************************************
*** SudoRules 20.1.s based on CSP-Rules 2.1.s, config = S
*** Using CLIPS 6.32-r773
***********************************************************************************************
234 candidates, 1590 csp-links and 1590 links. Density = 5.83%
hidden-pairs-in-a-block: b4{r5c1 r6c3}{n6 n7} ==> r6c3 ≠ 5, r6c3 ≠ 2, r5c1 ≠ 9, r5c1 ≠ 3
hidden-pairs-in-a-block: b2{r1c4 r2c6}{n1 n6} ==> r2c6 ≠ 8, r2c6 ≠ 7, r2c6 ≠ 4, r1c4 ≠ 8, r1c4 ≠ 7, r1c4 ≠ 3
swordfish-in-columns: n1{c3 c4 c9}{r7 r1 r6} ==> r7c1 ≠ 1, r6c7 ≠ 1, r6c6 ≠ 1, r1c1 ≠ 1
swordfish-in-columns: n9{c2 c5 c8}{r7 r6 r5} ==> r7c9 ≠ 9, r7c1 ≠ 9, r6c9 ≠ 9, r6c7 ≠ 9, r5c7 ≠ 9
swordfish-in-columns: n6{c3 c4 c9}{r6 r7 r1} ==> r7c6 ≠ 6, r7c1 ≠ 6, r6c7 ≠ 6, r1c7 ≠ 6
hidden-pairs-in-a-block: b6{n1 n6}{r5c7 r6c9} ==> r6c9 ≠ 2, r5c7 ≠ 8, r5c7 ≠ 3
hidden-pairs-in-a-block: b7{n1 n6}{r7c3 r8c1} ==> r8c1 ≠ 5, r8c1 ≠ 2, r7c3 ≠ 8, r7c3 ≠ 5, r7c3 ≠ 2
swordfish-in-rows: n7{r2 r5 r8}{c5 c1 c6} ==> r6c6 ≠ 7, r6c5 ≠ 7, r3c6 ≠ 7, r3c1 ≠ 7, r1c5 ≠ 7, r1c1 ≠ 7
hidden-triplets-in-a-column: c1{n1 n6 n7}{r2 r8 r5} ==> r2c1 ≠ 4, r2c1 ≠ 2
hidden-triplets-in-a-row: r1{n1 n6 n7}{c3 c4 c9} ==> r1c9 ≠ 8, r1c9 ≠ 2, r1c3 ≠ 8, r1c3 ≠ 5, r1c3 ≠ 2
naked-pairs-in-a-block: b1{r1c3 r2c1}{n1 n7} ==> r3c3 ≠ 7
hidden-triplets-in-a-column: c6{n1 n6 n7}{r5 r2 r8} ==> r8c6 ≠ 8, r8c6 ≠ 5, r8c6 ≠ 2, r5c6 ≠ 8, r5c6 ≠ 3
naked-triplets-in-a-row: r5{c1 c6 c7}{n6 n7 n1} ==> r5c5 ≠ 7
hidden-pairs-in-a-block: b5{n1 n7}{r5c6 r6c4} ==> r6c4 ≠ 3
swordfish-in-columns: n2{c3 c6 c9}{r4 r9 r7} ==> r9c7 ≠ 2, r9c1 ≠ 2, r7c8 ≠ 2, r7c2 ≠ 2, r7c1 ≠ 2, r4c7 ≠ 2, r4c1 ≠ 2
hidden-single-in-a-column ==> r1c1 = 2
jellyfish-in-columns: n8{c3 c9 c4 c6}{r9 r3 r7 r4} ==> r9c7 ≠ 8, r7c8 ≠ 8, r7c5 ≠ 8, r7c2 ≠ 8, r4c7 ≠ 8, r3c7 ≠ 8
hidden-pairs-in-a-block: b7{n2 n8}{r8c2 r9c3} ==> r9c3 ≠ 5, r8c2 ≠ 5
naked-quads-in-a-row: r7{c1 c2 c8 c5}{n5 n4 n9 n3} ==> r7c6 ≠ 5, r7c6 ≠ 3, r7c4 ≠ 3
x-wing-in-columns: n3{c1 c4}{r3 r4} ==> r4c7 ≠ 3, r4c6 ≠ 3, r3c6 ≠ 3
x-wing-in-columns: n3{c6 c7}{r6 r9} ==> r6c8 ≠ 3, r6c5 ≠ 3, r6c2 ≠ 3
PUZZLE 0 NOT SOLVED. 58 VALUES MISSING.
Code: Select all
FINAL RESOLUTION STATE:
   2         3458      17        16        348       9         458       458       67       
   17        48        9         5         478       16        2468      248       3         
   345       6         58        378       2         48        459       1         789       
   359       1         25        38        6         458       49        7         289       
   67        39        4         2         389       17        16        389       5         
   8         259       67        17        459       345       234       249       16       
   45        459       16        68        35        28        7         359       128       
   16        28        3         9         578       67        1258      258       4         
   59        7         28        4         1         2358      359       6         289       

We have our expected lot of Subsets (20, allowing 78 eliminations and a placement), but we can see that they are not enough.

Let's now try to add bivalue-chains, i.e. choose the following settings in the configuration file (to be loaded in another instance of CLIPS):
Code: Select all
 (bind ?*Subsets* TRUE)
 (bind ?*Bivalue-Chains* TRUE)


and continue from the previous resolution state:

Code: Select all
(solve-sukaku-grid
   2         3458      17        16        348       9         458       458       67       
   17        48        9         5         478       16        2468      248       3         
   345       6         58        378       2         48        459       1         789       
   359       1         25        38        6         458       49        7         289       
   67        39        4         2         389       17        16        389       5         
   8         259       67        17        459       345       234       249       16       
   45        459       16        68        35        28        7         359       128       
   16        28        3         9         578       67        1258      258       4         
   59        7         28        4         1         2358      359       6         289       
)
***********************************************************************************************
*** SudoRules 20.1.s based on CSP-Rules 2.1.s, config = BC+S
*** Using CLIPS 6.32-r773
***********************************************************************************************
150 candidates, 537 csp-links and 537 links. Density = 4.81%
biv-chain[3]: r4c4{n3 n8} - b6n8{r4c9 r5c8} - b6n3{r5c8 r6c7} ==> r6c6 ≠ 3
stte

We can see that a single bivalue-chain[3] is enough to finish the puzzle.

[Edit: corrected the printing of Hidden Subsets in blocks]
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris


Return to Puzzles