Chromatic Patterns

Advanced methods and approaches for solving Sudoku puzzles

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 3:39 am

.
I could easily modify a few of the existing functions (to make them able to read your input). Just to make sure: all your patterns lie in the first two bands? (I completed with one full band). For allowing to check what"s solved, the starting pattern is printed (in the form usable by SudoRules).

Here is what I get for the first puzzles in the 10-cells list (when only Subsets, Finned Fish and whips are loaded):

Code: Select all
#1
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123       ! 123456789 123       123       !
   ! 123456789 123456789 123       ! 123456789 123       123       ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+

Resolution state after Singles and whips[1]:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123       ! 123456789 123       123       !
   ! 123456789 123456789 123       ! 123456789 123       123       ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
669 candidates.

naked-triplets-in-a-row: r6{c3 c5 c6}{n3 n2 n1} ==> r6c9≠3, r6c9≠2, r6c9≠1, r6c8≠3, r6c8≠2, r6c8≠1, r6c7≠3, r6c7≠2, r6c7≠1, r6c4≠3, r6c4≠2, r6c4≠1, r6c2≠3, r6c2≠2, r6c2≠1, r6c1≠3, r6c1≠2, r6c1≠1
naked-triplets-in-a-row: r5{c6 c8 c9}{n3 n2 n1} ==> r5c7≠3, r5c7≠2, r5c7≠1, r5c5≠3, r5c5≠2, r5c5≠1, r5c4≠3, r5c4≠2, r5c4≠1, r5c3≠3, r5c3≠2, r5c3≠1, r5c2≠3, r5c2≠2, r5c2≠1, r5c1≠3, r5c1≠2, r5c1≠1
naked-triplets-in-a-block: b5{r5c6 r6c5 r6c6}{n3 n2 n1} ==> r4c6≠3, r4c6≠2, r4c6≠1, r4c5≠3, r4c5≠2, r4c5≠1, r4c4≠3, r4c4≠2, r4c4≠1
naked-triplets-in-a-block: b6{r4c9 r5c8 r5c9}{n3 n2 n1} ==> r4c8≠3, r4c8≠2, r4c8≠1, r4c7≠3, r4c7≠2, r4c7≠1
naked-triplets-in-a-column: c9{r3 r4 r5}{n3 n2 n1} ==> r9c9≠3, r9c9≠2, r9c9≠1, r8c9≠3, r8c9≠2, r8c9≠1, r7c9≠3, r7c9≠2, r7c9≠1, r2c9≠3, r2c9≠2, r2c9≠1, r1c9≠3, r1c9≠2, r1c9≠1
naked-triplets-in-a-column: c6{r3 r5 r6}{n3 n2 n1} ==> r9c6≠3, r9c6≠2, r9c6≠1, r8c6≠3, r8c6≠2, r8c6≠1, r7c6≠3, r7c6≠2, r7c6≠1, r2c6≠3, r2c6≠2, r2c6≠1, r1c6≠3, r1c6≠2, r1c6≠1
naked-triplets-in-a-row: r3{c3 c6 c9}{n3 n2 n1} ==> r3c8≠3, r3c8≠2, r3c8≠1, r3c7≠3, r3c7≠2, r3c7≠1, r3c5≠3, r3c5≠2, r3c5≠1, r3c4≠3, r3c4≠2, r3c4≠1, r3c2≠3, r3c2≠2, r3c2≠1, r3c1≠3, r3c1≠2, r3c1≠1
whip[3]: r6n1{c6 c3} - r4n1{c3 c9} - r3n1{c9 .} ==> r5c6≠1
whip[1]: r5n1{c9 .} ==> r4c9≠1
whip[1]: r4n1{c3 .} ==> r6c3≠1
whip[3]: r6n2{c6 c3} - r4n2{c3 c9} - r3n2{c9 .} ==> r5c6≠2
naked-single ==> r5c6=3
hidden-single-in-a-block ==> r4c9=3
hidden-single-in-a-row ==> r3c3=3
GRID 1 HAS NO SOLUTION : NO CANDIDATE FOR FOR BN-CELL b4n3
MOST COMPLEX RULE TRIED = W[3]


Code: Select all
#2
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123       ! 123456789 123       123       !
   ! 123456789 123456789 123       ! 123       123       123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+

Resolution state after Singles and whips[1]:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123       ! 123456789 123       123       !
   ! 123456789 123456789 123       ! 123       123       123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
669 candidates.

naked-triplets-in-a-row: r6{c3 c4 c5}{n3 n2 n1} ==> r6c9≠3, r6c9≠2, r6c9≠1, r6c8≠3, r6c8≠2, r6c8≠1, r6c7≠3, r6c7≠2, r6c7≠1, r6c6≠3, r6c6≠2, r6c6≠1, r6c2≠3, r6c2≠2, r6c2≠1, r6c1≠3, r6c1≠2, r6c1≠1
naked-triplets-in-a-row: r5{c6 c8 c9}{n3 n2 n1} ==> r5c7≠3, r5c7≠2, r5c7≠1, r5c5≠3, r5c5≠2, r5c5≠1, r5c4≠3, r5c4≠2, r5c4≠1, r5c3≠3, r5c3≠2, r5c3≠1, r5c2≠3, r5c2≠2, r5c2≠1, r5c1≠3, r5c1≠2, r5c1≠1
naked-triplets-in-a-block: b5{r5c6 r6c4 r6c5}{n3 n2 n1} ==> r4c6≠3, r4c6≠2, r4c6≠1, r4c5≠3, r4c5≠2, r4c5≠1, r4c4≠3, r4c4≠2, r4c4≠1
naked-triplets-in-a-block: b6{r4c9 r5c8 r5c9}{n3 n2 n1} ==> r4c8≠3, r4c8≠2, r4c8≠1, r4c7≠3, r4c7≠2, r4c7≠1
naked-triplets-in-a-column: c9{r3 r4 r5}{n3 n2 n1} ==> r9c9≠3, r9c9≠2, r9c9≠1, r8c9≠3, r8c9≠2, r8c9≠1, r7c9≠3, r7c9≠2, r7c9≠1, r2c9≠3, r2c9≠2, r2c9≠1, r1c9≠3, r1c9≠2, r1c9≠1
naked-triplets-in-a-row: r3{c3 c6 c9}{n3 n2 n1} ==> r3c8≠3, r3c8≠2, r3c8≠1, r3c7≠3, r3c7≠2, r3c7≠1, r3c5≠3, r3c5≠2, r3c5≠1, r3c4≠3, r3c4≠2, r3c4≠1, r3c2≠3, r3c2≠2, r3c2≠1, r3c1≠3, r3c1≠2, r3c1≠1
whip[3]: r6n1{c5 c3} - r4n1{c3 c9} - r3n1{c9 .} ==> r5c6≠1
whip[1]: r5n1{c9 .} ==> r4c9≠1
whip[1]: r4n1{c3 .} ==> r6c3≠1
whip[3]: r6n2{c5 c3} - r4n2{c3 c9} - r3n2{c9 .} ==> r5c6≠2
naked-single ==> r5c6=3
hidden-single-in-a-block ==> r4c9=3
hidden-single-in-a-row ==> r3c3=3
GRID 2 HAS NO SOLUTION : NO CANDIDATE FOR FOR BN-CELL b4n3
MOST COMPLEX RULE TRIED = W[3]


and at the end of dealing with all the puzzles in the file:
Code: Select all
No-sol list = (1 2 3 4 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28)

For this list in particular, the hardest rule necessary to prove a contradiction in each puzzle is a whip[3].
For the other puzzles, harder techniques than the above listed ones must be used.

In case a puzzle is not proven contradictory with the chosen set of rules, here is how it appears:
Code: Select all
#5
Resolution state after Singles and whips[1]:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   ! 123456789 123456789 123       ! 123456789 123       123456789 ! 123456789 123       123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
669 candidates.

naked-triplets-in-a-row: r6{c3 c5 c8}{n3 n2 n1} ==> r6c9≠3, r6c9≠2, r6c9≠1, r6c7≠3, r6c7≠2, r6c7≠1, r6c6≠3, r6c6≠2, r6c6≠1, r6c4≠3, r6c4≠2, r6c4≠1, r6c2≠3, r6c2≠2, r6c2≠1, r6c1≠3, r6c1≠2, r6c1≠1
naked-triplets-in-a-row: r5{c3 c6 c9}{n3 n2 n1} ==> r5c8≠3, r5c8≠2, r5c8≠1, r5c7≠3, r5c7≠2, r5c7≠1, r5c5≠3, r5c5≠2, r5c5≠1, r5c4≠3, r5c4≠2, r5c4≠1, r5c2≠3, r5c2≠2, r5c2≠1, r5c1≠3, r5c1≠2, r5c1≠1
naked-triplets-in-a-block: b6{r4c9 r5c9 r6c8}{n3 n2 n1} ==> r4c8≠3, r4c8≠2, r4c8≠1, r4c7≠3, r4c7≠2, r4c7≠1
naked-triplets-in-a-column: c9{r3 r4 r5}{n3 n2 n1} ==> r9c9≠3, r9c9≠2, r9c9≠1, r8c9≠3, r8c9≠2, r8c9≠1, r7c9≠3, r7c9≠2, r7c9≠1, r2c9≠3, r2c9≠2, r2c9≠1, r1c9≠3, r1c9≠2, r1c9≠1
naked-triplets-in-a-row: r3{c3 c6 c9}{n3 n2 n1} ==> r3c8≠3, r3c8≠2, r3c8≠1, r3c7≠3, r3c7≠2, r3c7≠1, r3c5≠3, r3c5≠2, r3c5≠1, r3c4≠3, r3c4≠2, r3c4≠1, r3c2≠3, r3c2≠2, r3c2≠1, r3c1≠3, r3c1≠2, r3c1≠1
naked-triplets-in-a-column: c3{r3 r5 r6}{n3 n2 n1} ==> r9c3≠3, r9c3≠2, r9c3≠1, r8c3≠3, r8c3≠2, r8c3≠1, r7c3≠3, r7c3≠2, r7c3≠1, r4c3≠3, r4c3≠2, r4c3≠1, r2c3≠3, r2c3≠2, r2c3≠1, r1c3≠3, r1c3≠2, r1c3≠1
PUZZLE 5 IS NOT SOLVED. 81 VALUES MISSING.
Final resolution state:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 123456789 123456789 456789    !
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 123456789 123456789 456789    !
   ! 456789    456789    123       ! 456789    456789    123       ! 456789    456789    123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 456789    456789    123       !
   ! 456789    456789    123       ! 456789    456789    123       ! 456789    456789    123       !
   ! 456789    456789    123       ! 456789    123       456789    ! 456789    123       456789    !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 123456789 123456789 456789    !
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 123456789 123456789 456789    !
   ! 123456789 123456789 456789    ! 123456789 123456789 123456789 ! 123456789 123456789 456789    !
   +-------------------------------+-------------------------------+-------------------------------+


Before I try the other files and harder techniques, is this the kind of result you were looking for?
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby eleven » Wed May 04, 2022 7:40 am

Yes, exactly.
eleven
 
Posts: 3173
Joined: 10 February 2008

Re: Chromatic Patterns

Postby ryokousha » Wed May 04, 2022 8:16 am

Until we have a good way to generate and classify all the patterns in an arbitrary number of boxes up to a certain number of cells, here are a few more patterns I found manually. Forgive me if they already came up as morphs, I didn't check too carefully.
10 cells in 6 boxes (this might be in the latest list by eleven, but as a nice variation on the Patto Patto pattern it's notable)
Code: Select all
. . . | . . . | . . .
. * . | . * . | . * .
. . . | . . . | . . .
------+-------+------
. * . | * . . | . * .
. . . | . * . | . . .
. * . | . . * | . * .
------+-------+------
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .

Then there are a couple more in 6 boxes:
This variation of the "socks" pattern
Hidden Text: Show
Code: Select all
* . . | . . . | * . .
. . * | . . . | . * .
. * . | . * . | . . *
------+-------+------
. . . | . . . | . . .
. . * | . * . | . . .
. . . | . . . | . . .
------+-------+------
* . . | . * . | . * .
. * . | . . . | * . .
. . * | . . . | . . *

also these three
Hidden Text: Show
Code: Select all
. . . | . . . | . . .
. . * | . * . | * . .
. . . | . . . | . . .
------+-------+------
* . . | * . . | * . .
. . . | . * . | . . .
. . * | . . * | . . *
------+-------+------
. . . | . . . | . . .
* . . | . * . | . . *
. . . | . . . | . . .

Code: Select all
. . . | . . . | . . .
. . * | . * . | * . .
. . . | . . . | . . .
------+-------+------
. * . | . . . | * . .
* . . | . * . | . . *
. . * | . . . | . * .
------+-------+------
. . . | . . . | . . .
. * . | . * . | . * .
. . . | . . . | . . .

Code: Select all
* . . | * . . | . * .
. * . | . * . | . . .
. . * | . . * | . . .
------+-------+------
. . . | . . . | . . .
. * . | . * . | . * .
. . . | . . . | . . .
------+-------+------
. . . | . . . | . . .
. * . | . * . | . * .
. . . | . . . | . . .


Also I do have two more examples for higher "chromatic numbers".
This is not 4-colorable
Code: Select all
. . . | . . . | . . .
. . . | . . . | . . .
. . * | . * . | * . .
------+-------+------
. . . | . * . | . . .
. . * | * . * | * . .
. . . | . * . | . . .
------+-------+------
. . * | * . * | * . .
. . * | * . * | * . .
. . . | . . . | . . .

(r3c5 is limited to r78 in c37, the resulting x-wing excluding it from b8. Can also be seen as a finned (multi-)fish, excluding all digits from r3c5)
Using complements, it follows that patterns with all "chromatic numbers" from 2 to 8 exist in 9x9 Sudoku. Here's an explicit example for a non-5-colorable one:
Code: Select all
. * . | * . * | . * .
. . . | . . . | . . .
. * . | * . * | . * .
------+-------+------
. * . | . . . | . * .
* . * | . . * | * . *
. * . | . . . | . * .
------+-------+------
. . . | . . . | . . .
. * . | * . * | . * .
. . . | . . . | . . .
ryokousha
 
Posts: 37
Joined: 30 April 2022

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 8:19 am

eleven wrote:Yes, exactly.

Good
Still using the same set of rules (Subsets + Finned Fish +Whips of any length), here are the results for all your lists:
(being in no-sol-list means contradiction is proven with only these rules)

10 cells:
Code: Select all
No-sol list = (1 2 3 4 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28)

Most complex rule used: whip[3]

12 cells:
Code: Select all
No-sol list = (4 7 8 9 10 12 13 14 15 16 17 19 20 21 22 23 24)

Most complex rule used: whip[4]

13 cells:
Code: Select all
 No-sol list = (1 3 4 5 10 11 12 13 14 15 16 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 125 126 127 128 129 130 131 132 133 134 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 182 188 191 192 193 194 195 196 197 198 199 200 213 215 216 217 218 219 221 228 229 230)

Most complex rule used: whip[4] (but most patterns require only whips[3]

14 cells:
Code: Select all
No-sol list = ()


15 cells:
Code: Select all
 No-sol list = (1 2 3 4 5 6 7 8 11 12 13 14 19 20 23 24 25 26)

Most complex rule used: whip[4] (all the patterns)

16 cells:
Code: Select all
 No-sol list = ()


The next step would be to check which patterns can be proven contradictory in T&E(SFin) or in T&E(2). But for reasonable computation times, I still have to restrict the candidates tried.
Are you interested in having the specially modified functions in SudoRules (in Goodies) so that you can try your own combinations of rules?
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby ryokousha » Wed May 04, 2022 8:41 am

Denis' approach looks fruitful to find the most "interesting" patterns among all the generated ones. Another line of thinking would be to classify the patterns by the edge- and node-minimal 4-chromatic subgraph(s) they contain (could potentially be multiple of these). The structure of these subgraphs should then correspond somehow to the complexity of the resolving strategy.

I haven't implemented this with the minimality condition yet. Just classifying eleven's list by isomorphism of the full connection graphs gives this - somewhat unsatisfying - result:

10c: 29 patterns -> 19 graphs
12c: 29 patterns -> 23 graphs
13c: 213 patterns -> 135 graphs
14c: 46 patterns -> 41 graphs
15c: 42 patterns -> 32 graphs
16c: 3 patterns -> 3 graphs

For example these 7 patterns have the same connection graph:
Code: Select all
000000000000001011001001001000001000000010011001010100
000000000000001011001001001000001000000010011001100100
000000000000001011001001001001000000010000011010001100
000000000000001011001001001001000000010000011100001100
000000000000001011001001100000001000000010011001010001
000000000000001011001001100000001000000010011001100001
000000000000001011001001100000001000001000011001010001


Note that not all cell patterns can be classified this way. For example the connection graph of
Code: Select all
* * * | . . . | . . .
. . . | * * * | . . .
. . . | . . . | . . .
------+-------+------
. . . | . . . | . . .
. . . | . . . | . . *
. . . | . . . | . . *
------+-------+------
. . . | . . . | . * .
. . . | . . . | . * .
. . . | . . . | . * .

is 3-chromatic, but the pattern is not 3-colorable in a Sudoku grid. Such patterns (I doubt there are very many of them) would fall out during the classification process.
Last edited by ryokousha on Wed May 04, 2022 10:31 pm, edited 1 time in total.
ryokousha
 
Posts: 37
Joined: 30 April 2022

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 9:27 am

.
I've finally checked which patterns can be proven contradictory in T&E(2). Only 1 cannot:


Code: Select all
15-cells #37:
+-------------------------------+-------------------------------+-------------------------------+
! 123456789 123456789 123456789 ! 123456789 123456789 123       ! 123456789 123456789 123       !
! 123456789 123456789 123       ! 123456789 123456789 123456789 ! 123456789 123       123456789 !
! 123456789 123       123456789 ! 123456789 123       123456789 ! 123       123456789 123456789 !
+-------------------------------+-------------------------------+-------------------------------+
! 123456789 123456789 123456789 ! 123456789 123       123456789 ! 123456789 123456789 123       !
! 123456789 123456789 123       ! 123456789 123456789 123       ! 123       123456789 123456789 !
! 123456789 123       123456789 ! 123       123456789 123456789 ! 123456789 123       123456789 !
+-------------------------------+-------------------------------+-------------------------------+
! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
+-------------------------------+-------------------------------+-------------------------------+


Which makes me wonder: the trivalue oddagon is not in your list of 12-cells?
Last edited by denis_berthier on Wed May 04, 2022 9:46 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby eleven » Wed May 04, 2022 9:35 am

What you mean with the "No-sol list" ? Those are the easy patterns, which only require whip[3] ?
I never have used Sudo Rules, so i don't know, what effort it would be to do it myself (as i suppose yours, my free time is restricted).

[Added:]
E.g. from my point of view nr 6 of the 10 cell patterns is easy to see:
X in r4c9 kills Xr3c9 and leaves an x.wing in r56c36, which kills the other 2 X's in r3. Is this a whip(4) for Sudo Rules ?
Code: Select all
 .  .  . |  .  .  . |  .  .  .
 .  .  . |  .  .  . |  .  .  .
 .  .  X |  .  .  X |  .  .  X
-------------------------------
 .  .  . |  .  .  . |  .  .  X
 .  .  X |  .  .  X |  .  X  .
 .  .  X |  .  .  X |  .  X  .
eleven
 
Posts: 3173
Joined: 10 February 2008

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 9:49 am

eleven wrote:What you mean with the "No-sol list" ? Those are the easy patterns, which only require whip[3] ?
I never have used Sudo Rules, so i don't know, what effort it would be to do it myself (as i suppose yours, my free time is restricted).


Being in no-sol-list means the pattern is proven contradictory with the selected set of rules.

SudoRules is very easy to use. You just have to select your rules in the configuration file.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 10:24 am

eleven wrote:[Added:]
E.g. from my point of view nr 6 of the 10 cell patterns is easy to see:
X in r4c9 kills Xr3c9 and leaves an x.wing in r56c36, which kills the other 2 X's in r3. Is this a whip(4) for Sudo Rules ?
Code: Select all
 .  .  . |  .  .  . |  .  .  .
 .  .  . |  .  .  . |  .  .  .
 .  .  X |  .  .  X |  .  .  X
-------------------------------
 .  .  . |  .  .  . |  .  .  X
 .  .  X |  .  .  X |  .  X  .
 .  .  X |  .  .  X |  .  X  .

No, whips don't include x-wings as sub-patterns.
It may be an S2-whip - not coded in SudoRules.
If it was a whip[4], SudoRules would find it.

Here is what you get in detail; it cannot be proven contradictory using only Subests+FinnedFish+whips:
For this pattern and these rules, SudoRules finds only Subsets and Finned-Fish.
Code: Select all
000000000000000000001001001000000001001001010001001010
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123       123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123       123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+

Resolution state after Singles and whips[1]:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123456789 123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123       !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123       123456789 !
   ! 123456789 123456789 123       ! 123456789 123456789 123       ! 123456789 123       123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
669 candidates.

naked-triplets-in-a-row: r6{c3 c6 c8}{n3 n2 n1} ==> r6c9≠3, r6c9≠2, r6c9≠1, r6c7≠3, r6c7≠2, r6c7≠1, r6c5≠3, r6c5≠2, r6c5≠1, r6c4≠3, r6c4≠2, r6c4≠1, r6c2≠3, r6c2≠2, r6c2≠1, r6c1≠3, r6c1≠2, r6c1≠1
naked-triplets-in-a-row: r5{c3 c6 c8}{n3 n2 n1} ==> r5c9≠3, r5c9≠2, r5c9≠1, r5c7≠3, r5c7≠2, r5c7≠1, r5c5≠3, r5c5≠2, r5c5≠1, r5c4≠3, r5c4≠2, r5c4≠1, r5c2≠3, r5c2≠2, r5c2≠1, r5c1≠3, r5c1≠2, r5c1≠1
naked-triplets-in-a-block: b6{r4c9 r5c8 r6c8}{n3 n2 n1} ==> r4c8≠3, r4c8≠2, r4c8≠1, r4c7≠3, r4c7≠2, r4c7≠1
naked-triplets-in-a-column: c6{r3 r5 r6}{n3 n2 n1} ==> r9c6≠3, r9c6≠2, r9c6≠1, r8c6≠3, r8c6≠2, r8c6≠1, r7c6≠3, r7c6≠2, r7c6≠1, r4c6≠3, r4c6≠2, r4c6≠1, r2c6≠3, r2c6≠2, r2c6≠1, r1c6≠3, r1c6≠2, r1c6≠1
naked-triplets-in-a-row: r3{c3 c6 c9}{n3 n2 n1} ==> r3c8≠3, r3c8≠2, r3c8≠1, r3c7≠3, r3c7≠2, r3c7≠1, r3c5≠3, r3c5≠2, r3c5≠1, r3c4≠3, r3c4≠2, r3c4≠1, r3c2≠3, r3c2≠2, r3c2≠1, r3c1≠3, r3c1≠2, r3c1≠1
naked-triplets-in-a-column: c3{r3 r5 r6}{n3 n2 n1} ==> r9c3≠3, r9c3≠2, r9c3≠1, r8c3≠3, r8c3≠2, r8c3≠1, r7c3≠3, r7c3≠2, r7c3≠1, r4c3≠3, r4c3≠2, r4c3≠1, r2c3≠3, r2c3≠2, r2c3≠1, r1c3≠3, r1c3≠2, r1c3≠1
finned-swordfish-in-rows: n3{r6 r5 r3}{c6 c3 c8} ==> r2c8≠3, r1c8≠3
finned-swordfish-in-rows: n2{r6 r5 r3}{c6 c3 c8} ==> r2c8≠2, r1c8≠2
finned-swordfish-in-rows: n1{r6 r5 r3}{c6 c3 c8} ==> r2c8≠1, r1c8≠1
PUZZLE 6 IS NOT SOLVED. 81 VALUES MISSING.
Final resolution state:
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 123456789 456789    123456789 !
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 123456789 456789    123456789 !
   ! 456789    456789    123       ! 456789    456789    123       ! 456789    456789    123       !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 456789    456789    123       !
   ! 456789    456789    123       ! 456789    456789    123       ! 456789    123       456789    !
   ! 456789    456789    123       ! 456789    456789    123       ! 456789    123       456789    !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 123456789 123456789 123456789 !
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 123456789 123456789 123456789 !
   ! 123456789 123456789 456789    ! 123456789 123456789 456789    ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+


It cannot be proven contradictory in T&E(S2, 2) - probably because it requires Subsets[3] at the start.

It can be proven contradictory in T&E(2).

It can also easily be proven contradictory in T&E(S3+W3, 1) as shown below:
Code: Select all
(solve-eleven-sudoku-string "000000000000000000001001001000000001001001010001001010")
naked-triplets-in-a-row: r6{c3 c6 c8}{n3 n2 n1} ==> r6c9≠3, r6c9≠2, r6c9≠1, r6c7≠3, r6c7≠2, r6c7≠1, r6c5≠3, r6c5≠2, r6c5≠1, r6c4≠3, r6c4≠2, r6c4≠1, r6c2≠3, r6c2≠2, r6c2≠1, r6c1≠3, r6c1≠2, r6c1≠1
naked-triplets-in-a-row: r5{c3 c6 c8}{n3 n2 n1} ==> r5c9≠3, r5c9≠2, r5c9≠1, r5c7≠3, r5c7≠2, r5c7≠1, r5c5≠3, r5c5≠2, r5c5≠1, r5c4≠3, r5c4≠2, r5c4≠1, r5c2≠3, r5c2≠2, r5c2≠1, r5c1≠3, r5c1≠2, r5c1≠1
naked-triplets-in-a-block: b6{r4c9 r5c8 r6c8}{n3 n2 n1} ==> r4c8≠3, r4c8≠2, r4c8≠1, r4c7≠3, r4c7≠2, r4c7≠1
naked-triplets-in-a-column: c6{r3 r5 r6}{n3 n2 n1} ==> r9c6≠3, r9c6≠2, r9c6≠1, r8c6≠3, r8c6≠2, r8c6≠1, r7c6≠3, r7c6≠2, r7c6≠1, r4c6≠3, r4c6≠2, r4c6≠1, r2c6≠3, r2c6≠2, r2c6≠1, r1c6≠3, r1c6≠2, r1c6≠1
naked-triplets-in-a-row: r3{c3 c6 c9}{n3 n2 n1} ==> r3c8≠3, r3c8≠2, r3c8≠1, r3c7≠3, r3c7≠2, r3c7≠1, r3c5≠3, r3c5≠2, r3c5≠1, r3c4≠3, r3c4≠2, r3c4≠1, r3c2≠3, r3c2≠2, r3c2≠1, r3c1≠3, r3c1≠2, r3c1≠1
naked-triplets-in-a-column: c3{r3 r5 r6}{n3 n2 n1} ==> r9c3≠3, r9c3≠2, r9c3≠1, r8c3≠3, r8c3≠2, r8c3≠1, r7c3≠3, r7c3≠2, r7c3≠1, r4c3≠3, r4c3≠2, r4c3≠1, r2c3≠3, r2c3≠2, r2c3≠1, r1c3≠3, r1c3≠2, r1c3≠1

*** STARTING T&E IN CONTEXT 0 with 0 csp-variables solved and 573 candidates remaining ***

        STARTING PHASE 1 IN CONTEXT 0 with 0 csp-variables solved and 573 candidates remaining

GENERATING CONTEXT 1 AT DEPTH 1, SON OF CONTEXT 0, FROM HYPOTHESIS n3r6c8.
x-wing-in-columns: n3{c3 c6}{r3 r5} ==> r3c9≠3
naked-pairs-in-a-column: c9{r3 r4}{n1 n2} ==> r1c9≠1, r1c9≠2, r2c9≠1, r2c9≠2, r7c9≠1, r7c9≠2, r8c9≠1, r8c9≠2, r9c9≠1, r9c9≠2
whip[2]: c9n2{r4 r3} - c6n2{r3 .} ==> r4c5≠2, r4c4≠2
whip[1]: b5n2{r5c6 .} ==> r3c6≠2
whip[2]: r4n2{c1 c9} - r3n2{c9 .} ==> r6c3≠2, r5c3≠2
naked-single ==> r6c3=1
naked-single ==> r6c6=2
naked-single ==> r5c3=3
naked-single ==> r5c6=1
naked-single ==> r5c8=2
naked-single ==> r4c9=1
NO POSSIBLE VALUE for csp-variable 231 IN CONTEXT 1. RETRACTING CANDIDATE n3r6c8 FROM CONTEXT 0.

BACK IN CONTEXT 0 with 0 csp-variables solved and 572 candidates remaining.
whip[3]: b6n3{r4c9 r5c8} - c3n3{r5 r6} - c6n3{r6 .} ==> r3c9≠3
x-wing-in-rows: n3{r3 r6}{c3 c6} ==> r5c6≠3, r5c3≠3
hidden-single-in-a-row ==> r5c8=3
naked-pairs-in-a-column: c9{r3 r4}{n1 n2} ==> r9c9≠2, r9c9≠1, r8c9≠2, r8c9≠1, r7c9≠2, r7c9≠1, r2c9≠2, r2c9≠1, r1c9≠2, r1c9≠1
whip[2]: c9n2{r3 r4} - b5n2{r4c4 .} ==> r3c6≠2
whip[1]: c6n2{r6 .} ==> r4c4≠2, r4c5≠2
whip[2]: r3n2{c3 c9} - r4n2{c9 .} ==> r6c3≠2, r5c3≠2
naked-single ==> r5c3=1
naked-single ==> r5c6=2
naked-single ==> r6c3=3
naked-single ==> r3c3=2
naked-single ==> r3c9=1
naked-single ==> r3c6=3
naked-single ==> r4c9=2
GRID 0 HAS NO SOLUTION : NO CANDIDATE FOR FOR BN-CELL b4n2


Note that all the above results about contradictory patterns don't say much about the puzzles built close to them. Other clues can completely reduce their complexity.

But I consider them as filters for possible hard patterns. If your goal is to find hard puzzles, you should try with pattern #37 in the 15-cells list.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby eleven » Wed May 04, 2022 10:27 am

Ah, thanks. So it's what basically i wanted, to filter out the easier ones.

The clips binary is not running on linux (Exec format error), so i will have to install one for linux (it's not in the standard ubuntu libraries). I'll have a look another time.
eleven
 
Posts: 3173
Joined: 10 February 2008

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 10:40 am

eleven wrote:Ah, thanks. So it's what basically i wanted, to filter out the easier ones.

The clips binary is not running on linux (Exec format error), so i will have to install one for linux (it's not in the standard ubuntu libraries). I'll have a look another time.

easy: compile it by typing "make" in the CLIPS/clips-core directory
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby eleven » Wed May 04, 2022 11:02 am

Ah, it's there and compiles.

Yes, this is a nice pattern.
Code: Select all
 .  .  . |  .  .  . |  .  .  b
 .  .  . |  .  X  X |  .  a  .
 .  .  b |  a  .  . |  .  X  .
------------------------------
 .  . ac |  .  .  . |  .  . ac
 .  X  . |  X  .  . |  X  .  .
 .  X  . |  X  .  . |  X  .  .

ar3c4 must be in r2c8 too, and br3c3 in r1c9.
a in r4c3 or r4c9 lead to bc in r56c49 or r56c24, so no a is left two a's are forced in the other box.
eleven
 
Posts: 3173
Joined: 10 February 2008

Re: Chromatic Patterns

Postby denis_berthier » Wed May 04, 2022 1:34 pm

.
Now that things are clearer, I tried more things with #37
Considering it's not provably contradictory in T&E(2) - like the trivalue oddagon pattern - I wondered if it could be harder.
But no; they are at exactly at the same place in the T&E(Wk, 2) sub-hierarchy of T&E(3):
- none of them can be proven contradictory in T&E(W1, 2);
- both of them can be proven contradictory in T&E(W2, 2).
Indeed, whips[1] play NO role in these patterns.
(This is assuming my simplified T&E procedures, where only candidates in the 123-cells are tested for contradictions.)

So, it's interesting to see if one can find puzzles related to it and not in T&E(2).
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Chromatic Patterns

Postby eleven » Thu May 05, 2022 12:01 am

Hi Denis,
i have tried SudoRules now, but cannot find quickly, how to input sukakus (in 729 format) from a file and write the results to a file.
Is it possible and can you give me additional hints for classifying these sukakus (using harder than the default rules), please ?
eleven
 
Posts: 3173
Joined: 10 February 2008

Re: Chromatic Patterns

Postby denis_berthier » Thu May 05, 2022 2:48 am

eleven wrote:i have tried SudoRules now, but cannot find quickly, how to input sukakus (in 729 format) from a file and write the results to a file.


There is a function for solving a sukaku in 729-string format, solve-sukaku-string:
Code: Select all
(solve-sukaku-string "..3.5678.1.3456789123456789.23456789...4.678912.4567891234567891.34567891..45.789123. 567891.3...7..12345.7..123....891234.678912.4...8.123..6.891........12345.789123456789 1234567..12345678.123456.8912345678912345678.123.56.89123456..9123456789.23456789...4. 678912.4567891.3.567891.34567891..45.789.234567891..4.678912.456789.23..6.891234.67891 23456789123.567891.3...7.912345.789123.567891234.678912.4..78.123456.891234.6...123456 789123.56..91234567.91234..7..123456.891234.6...12345678.1234567891...5678912.45678912 345678912345678.12.45678..23.567891.3456789123456789123.567891.....7.912.45.789123..6. 891234.678912.4..78..23.567891.3...7.912345.789123.56..91234567.9123456789123456.89123 4.6...12345678.1234567891234567.912345.7..")


There's a much better function, using the much more readable list format: solve-sukaku-list.


By default, all the results (resolution path, solution...) are printed to the standard output (Terminal / Command Window). You can change this by using the CLIPS function "dribble-on":
Code: Select all
(dribble-on "my-file")


I still have to write in the [BUM] many things about functions for sudokus in files; it seems I've been the only user of these functions until now:
- there are many more than the currently documented "solve-n-grids-after-first-p-from-text-file";
- in particular, there's a function "solve-n-grids-after-first-p-from-text-file-excluding" (which allows not to re-try those already solved or proven contradictory);
- there are also more specific functions for writing ratings to a file - but they are not useful when T&E is involved.
However, there's currently no function for dealing with collections of sukakus written in a file (in either format). I could easily add this.(°)

What I have done with your patterns until now is write a special function to read your 54-string format and properly initialise the corresponding sukaku + adaptations to T&E for restricting it to candidates in the cells of the pattern. I can publish all this (as a SudRules example) if you're interested.


I don't know exactly what you want in terms of classification, but two of the main tools for collections of puzzles are global variables:
- ?*solved-list* gives you the list of puzzles that have been solved by the current set of rules (by their number in the list)
- ?*no-sol-list* gives you the list of puzzles that can have no solution (e.g. patterns proven to be contradictory with the curent set of rules/techniques)
In order to get them, just type their name and "return" when SudoRules has finished its computations.
This is all I've used for all my results reported in this thread: I select a set of rules and/or T&E and I check which patterns are proven contradictory (are present in ?*no-sol-list*). For those that do not appear in this list, I launch new calculations with more powerful rules/techniques, using function "solve-n-grids-after-first-p-from-text-file-excluding".

eleven wrote:Is it possible and can you give me additional hints for classifying these sukakus (using harder than the default rules), please ?

The only way to select which rules (or forms of T&E) you want to apply is via the SudoRules configuration file - by adding or deleting leading semi-colons on the relevant lines (see chapter 5 of the [BUM], available in the Docs folder, for all the details). This also allows you to finely control what is printed.

In order to really understand how all this works, you need to carefully read at least chapter 5 (configuration file) and sections 1 to 3 of chapter 6 (SudoRules) of the [BUM].

*[Edit]: I've just added a few functions for this purpose. See http://forum.enjoysudoku.com/csp-rules-sudorules-kakurules-t38200-56.html
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

PreviousNext

Return to Advanced solving techniques