Templates as patterns

Advanced methods and approaches for solving Sudoku puzzles

Re: Templates as patterns

Postby denis_berthier » Mon Oct 21, 2024 5:34 am

P.O. wrote:Hi Denis, T2 and T3 are the same.

OK, thanks for noticing. I copied the same list twice. It's corrected.
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Mon Oct 21, 2024 10:20 am

i have the same results for T0 and T2, not for T3
the first difference is the first puzzle that i classify in 4-template

at initialization i make 7 assertions: n6r4c8 n1r5c8 n2r8c9 n7r1c7 n9r7c4 n1r7c9 n2r9c4
and 6 eliminations: r3c23<>4 r3c7<>3569
in combination of 2: 1 elimination: r5c6<>3
and in 3: 7 eliminations: r5c2<>2 r6c7<>2 r4c1<>4 r1c6<>8 r3c6<>8 r7c2<>8 r8c3<>8

in combination of 4 i make 4 assertions: n3r2c9 n3r3c6 n4r2c1 n8r9c3

in order to analyze our differences i would need your resolution path
3-template:
Hidden Text: Show
Code: Select all
..34......5...912.7...2.....1.5.7..86...9...7.......34..2.............9.9...61.75

128     2689    3       4       158     568     7       58      69               
48      5       468     3678    378     9       1       2       36               
7       4689    14689   1368    2       3568    345689  458     369             
234     1       49      5       34      7       29      6       8               
6       2348    458     38      9       2348    25      1       7               
258     2789    5789    168     18      268     259     3       4               
3458    34678   2       9       34578   3458    3468    48      1               
13458   34678   145678  378     34578   3458    3468    9       2               
9       348     48      2       6       1       348     7       5               
170 candidates.

#VT: (2 5 23 21 15 15 4 250 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (25) (20 21) (25) (25) nil nil (25)
 2combs
#VT: (2 5 21 19 12 12 4 191 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 2combs
#VT: (2 5 21 19 12 12 4 190 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 3combs
#VT: (2 3 19 15 10 12 4 78 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil (38 52) nil (28) nil nil nil nil nil
 2combs
#VT: (2 3 12 15 10 12 4 71 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (42) nil nil nil nil nil nil
 2combs
#VT: (2 3 12 15 10 12 4 57 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 3combs
#VT: (2 3 12 14 10 12 4 31 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil (6 24 56 66) nil

Left in pool: (39 56 26 21 17 52 9 110 87 56 44 157 66 61 98 77 155 79 62 26
               120 30 20 114 22 69 18 96 92 138 132 57 116 42 81 204 118 152 72
               176 56 122 22 55 222 28 81 18 71 109 203 115 145 188 288 93 351
               168 66 403 87 118 72 393 301 79 142 129 194 531 192 208 128 323
               124 740 94 137 34 254 194 42 313 125)
#VT: (2 3 12 14 10 12 4 31 4)

128    2689   3      4      158    56     7      58     69             
48     5      468    3678   378    9      1      2      36             
7      689    1689   1368   2      356    48     458    369             
23     1      49     5      34     7      29     6      8               
6      348    458    38     9      248    25     1      7               
258    2789   5789   168    18     268    59     3      4               
3458   3467   2      9      34578  3458   3468   48     1               
13458  34678  14567  378    34578  3458   3468   9      2               
9      348    48     2      6      1      348    7      5               
156 candidates.

4-template:
Hidden Text: Show
Code: Select all
..34......5...912.7...2.....1.5.7..86...9...7.......34..2.............9.9...61.75

128     2689    3       4       158     568     7       58      69               
48      5       468     3678    378     9       1       2       36               
7       4689    14689   1368    2       3568    345689  458     369             
234     1       49      5       34      7       29      6       8               
6       2348    458     38      9       2348    25      1       7               
258     2789    5789    168     18      268     259     3       4               
3458    34678   2       9       34578   3458    3468    48      1               
13458   34678   145678  378     34578   3458    3468    9       2               
9       348     48      2       6       1       348     7       5               
170 candidates.

#VT: (2 5 23 21 15 15 4 250 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (25) (20 21) (25) (25) nil nil (25)
 2combs
#VT: (2 5 21 19 12 12 4 191 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 2combs
#VT: (2 5 21 19 12 12 4 190 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 3combs
#VT: (2 3 19 15 10 12 4 78 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil (38 52) nil (28) nil nil nil nil nil
 2combs
#VT: (2 3 12 15 10 12 4 71 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (42) nil nil nil nil nil nil
 2combs
#VT: (2 3 12 15 10 12 4 57 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 3combs
#VT: (2 3 12 14 10 12 4 31 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil (6 24 56 66) nil
 4combs
#VT: (2 3 3 8 6 6 4 5 3)
Cells: nil nil (18 24) (10) nil nil nil (75) nil
SetVC: ( n4r2c1   n3r2c9   n3r3c6   n8r9c3   n6r2c3   n5r3c8
         n8r1c8   n4r3c7   n4r7c8   n3r9c7   n4r9c2   n8r3c2
         n8r6c1   n3r5c2   n8r5c4   n1r6c5   n5r1c5   n6r1c6
         n9r1c9   n7r2c4   n8r2c5   n1r3c4   n6r3c9   n2r4c1
         n9r4c7   n6r6c4   n2r6c6   n5r6c7   n3r8c4   n1r1c1
         n2r1c2   n9r3c3   n4r4c3   n3r4c5   n5r5c3   n4r5c6
         n2r5c7   n7r6c3   n7r7c5   n5r8c1   n1r8c3   n4r8c5
         n8r8c6   n6r8c7   n9r6c2   n3r7c1   n6r7c2   n5r7c6
         n8r7c7   n7r8c2 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 2 3
7 8 9   1 2 3   4 5 6
2 1 4   5 3 7   9 6 8
6 3 5   8 9 4   2 1 7
8 9 7   6 1 2   5 3 4
3 6 2   9 7 5   8 4 1
5 7 1   3 4 8   6 9 2
9 4 8   2 6 1   3 7 5

(2 2 3 2 2 3 4)
puzzle in 4(1)-Template
P.O.
 
Posts: 1688
Joined: 07 June 2021

Re: Templates as patterns

Postby denis_berthier » Mon Oct 21, 2024 10:39 am

Solution in T3:
(solve "..34......5...912.7...2.....1.5.7..86...9...7.......34..2.............9.9...61.75")
...
Code: Select all
Resolution state after Singles:
   +----------------------+----------------------+----------------------+
   ! 128    2689   3      ! 4      158    568    ! 7      58     69     !
   ! 48     5      468    ! 3678   378    9      ! 1      2      36     !
   ! 7      4689   14689  ! 1368   2      3568   ! 345689 458    369    !
   +----------------------+----------------------+----------------------+
   ! 234    1      49     ! 5      34     7      ! 29     6      8      !
   ! 6      2348   458    ! 38     9      2348   ! 25     1      7      !
   ! 258    2789   5789   ! 168    18     268    ! 259    3      4      !
   +----------------------+----------------------+----------------------+
   ! 3458   34678  2      ! 9      34578  3458   ! 3468   48     1      !
   ! 13458  34678  145678 ! 378    34578  3458   ! 3468   9      2      !
   ! 9      348    48     ! 2      6      1      ! 348    7      5      !
   +----------------------+----------------------+----------------------+
170 candidates

entering level T1_with_<Fact-3671>
candidate in no template[1] for digit 9 ==> r3c7≠9
candidate in no template[1] for digit 6 ==> r3c7≠6
candidate in no template[1] for digit 5 ==> r3c7≠5
candidate in no template[1] for digit 3 ==> r3c7≠3
candidate in no template[1] for digit 4 ==> r3c3≠4
candidate in no template[1] for digit 4 ==> r3c2≠4
entering level T2_with_<Fact-4012>
entering level T3 with <Fact-13951>
candidate in no template[1] for digit 9 ==> r6c3≠9
candidate in no template[1] for digit 4 ==> r4c1≠4
candidate in no template[1] for digit 8 ==> r6c3≠8
candidate in no template[1] for digit 8 ==> r3c4≠8
candidate in no template[1] for digit 8 ==> r1c5≠8
candidate in no template[1] for digit 2 ==> r6c7≠2
candidate in no template[1] for digit 8 ==> r6c6≠8
candidate in no template[1] for digit 8 ==> r5c3≠8
candidate in no template[1] for digit 8 ==> r7c1≠8
candidate in no template[1] for digit 8 ==> r8c1≠8
candidate in no template[1] for digit 8 ==> r6c4≠8
candidate in no template[1] for digit 8 ==> r6c5≠8
stte
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Mon Oct 21, 2024 5:25 pm

my analysis:

among the eliminations of T3 it is that of r6c5<>8 alone which solves the puzzle, all the others together do not, 8r6c5 is a size 1-antibackdoor in singles

r6c5 is cell 50 and its candidates are (1 8)

i will follow what happens to cell 50 during the formation of the combinations, as the elimination is in T3 whatever the template eliminations performed by T2 they do not lead to the elimination r6c5<>8 which means that combinations (1 8) have been formed and pass along to the formation of size 3 combinations

since i don't know which templates T2 eliminated i'll take the situation left by 2-template

templates for each value after 2-template:
Hidden Text: Show
Code: Select all
1:
((5 16 21 29 44 49 63 64 78) (1 16 22 29 44 50 63 66 78))
2:
 ((2 17 23 34 42 46 57 72 76) (2 17 23 28 43 51 57 72 76)
  (2 17 23 28 42 52 57 72 76) (1 17 23 34 42 47 57 72 76)
  (1 17 23 34 38 51 57 72 76))
3:
 ((3 18 24 32 38 53 55 67 79) (3 18 24 28 40 53 61 68 74)
  (3 18 24 28 40 53 59 70 74) (3 18 24 28 40 53 59 65 79)
  (3 18 24 28 40 53 56 68 79) (3 18 22 32 38 53 55 69 79)
  (3 18 22 28 42 53 61 68 74) (3 18 22 28 42 53 59 70 74)
  (3 18 22 28 42 53 59 65 79) (3 18 22 28 42 53 56 68 79)
  (3 14 27 28 42 53 61 67 74) (3 14 27 28 42 53 56 67 79)
  (3 14 27 28 40 53 61 69 74) (3 14 27 28 40 53 60 70 74)
  (3 14 27 28 40 53 60 65 79) (3 14 27 28 40 53 56 69 79)
  (3 13 27 32 38 53 60 64 79) (3 13 27 32 38 53 55 69 79)
  (3 13 27 28 42 53 61 68 74) (3 13 27 28 42 53 59 70 74)
  (3 13 27 28 42 53 59 65 79))
4:
 ((4 12 26 32 38 54 60 64 79) (4 12 26 32 38 54 55 69 79)
  (4 12 26 28 42 54 61 68 74) (4 12 26 28 42 54 59 70 74)
  (4 12 25 28 42 54 62 68 74) (4 10 26 32 39 54 61 69 74)
  (4 10 26 32 39 54 60 70 74) (4 10 26 32 39 54 60 65 79)
  (4 10 26 32 39 54 56 69 79) (4 10 26 32 38 54 61 69 75)
  (4 10 26 32 38 54 60 70 75) (4 10 26 32 38 54 60 66 79)
  (4 10 26 30 42 54 61 68 74) (4 10 26 30 42 54 59 70 74)
  (4 10 26 30 42 54 59 65 79) (4 10 26 30 42 54 56 68 79)
  (4 10 25 32 39 54 62 69 74) (4 10 25 32 38 54 62 69 75)
  (4 10 25 30 42 54 62 68 74))
5:
 ((8 11 24 31 43 48 55 68 81) (8 11 24 31 43 46 59 66 81)
  (8 11 24 31 39 52 59 64 81) (8 11 24 31 39 52 55 68 81)
  (6 11 26 31 43 48 55 68 81) (6 11 26 31 43 46 59 66 81)
  (6 11 26 31 39 52 59 64 81) (6 11 26 31 39 52 55 68 81)
  (5 11 26 31 43 48 60 64 81) (5 11 26 31 43 48 55 69 81)
  (5 11 26 31 39 52 60 64 81) (5 11 26 31 39 52 55 69 81))
6:
 ((9 13 21 35 37 51 61 65 77) (6 18 21 35 37 49 61 65 77)
  (6 18 21 35 37 49 56 70 77) (9 13 20 35 37 51 61 66 77)
  (9 12 24 35 37 49 61 65 77) (9 12 24 35 37 49 56 70 77)
  (9 12 22 35 37 51 61 65 77) (9 12 22 35 37 51 56 70 77)
  (6 12 27 35 37 49 61 65 77) (6 12 27 35 37 49 56 70 77)
  (2 18 22 35 37 51 61 66 77) (2 13 27 35 37 51 61 66 77))
7:
 ((7 14 19 33 45 48 56 67 80) (7 13 19 33 45 48 59 65 80)
  (7 13 19 33 45 48 56 68 80) (7 13 19 33 45 47 59 66 80))
8
 ((8 14 21 36 42 47 55 67 79) (8 14 21 36 40 47 60 64 79)
  (8 14 21 36 40 47 55 69 79) (8 14 21 36 42 46 61 67 74)
  (8 14 21 36 42 46 56 67 79) (8 14 21 36 40 46 61 69 74)
  (8 14 21 36 40 46 60 70 74) (8 14 21 36 40 46 60 65 79)
  (8 14 21 36 40 46 56 69 79) (8 14 21 36 38 51 55 67 79)
  (8 14 21 36 38 49 60 64 79) (8 14 21 36 38 49 55 69 79)
  (8 13 21 36 42 47 59 64 79) (8 13 21 36 42 47 55 68 79)
  (8 13 21 36 42 46 61 68 74) (8 13 21 36 42 46 59 70 74)
  (8 13 21 36 42 46 59 65 79) (8 13 21 36 38 51 59 64 79)
  (8 13 21 36 38 51 55 68 79) (8 14 20 36 42 48 55 67 79)
  (8 14 20 36 40 48 60 64 79) (8 14 20 36 40 48 55 69 79)
  (8 14 20 36 42 46 61 67 75) (8 14 20 36 40 46 61 69 75)
  (8 14 20 36 40 46 60 70 75) (8 14 20 36 40 46 60 66 79)
  (8 14 20 36 39 51 55 67 79) (8 14 20 36 39 49 60 64 79)
  (8 14 20 36 39 49 55 69 79) (8 13 20 36 42 46 61 68 75)
  (8 13 20 36 42 46 59 70 75) (8 13 20 36 42 46 59 66 79)
  (8 13 20 36 39 51 59 64 79) (8 13 20 36 39 51 55 68 79)
  (8 13 20 36 39 50 55 69 79) (8 12 24 36 40 47 59 64 79)
  (8 12 24 36 40 47 55 68 79) (8 12 24 36 40 46 61 68 74)
  (8 12 24 36 40 46 59 70 74) (8 12 24 36 40 46 59 65 79)
  (8 12 24 36 40 46 56 68 79) (8 12 24 36 38 50 55 67 79)
  (8 12 24 36 38 49 59 64 79) (8 12 24 36 38 49 55 68 79)
  (8 12 22 36 42 47 55 68 79) (8 12 22 36 42 46 61 68 74)
  (8 12 22 36 42 46 59 70 74) (8 12 22 36 42 46 59 65 79)
  (8 12 22 36 42 46 56 68 79) (8 12 22 36 38 51 55 68 79)
  (8 12 22 36 38 50 55 69 79) (6 12 26 36 40 47 59 64 79)
  (6 12 26 36 40 47 55 68 79) (6 12 26 36 40 46 59 70 74)
  (6 12 26 36 40 46 59 65 79) (6 12 26 36 40 46 56 68 79)
  (6 12 26 36 38 50 55 67 79) (6 12 26 36 38 49 59 64 79)
  (6 12 26 36 38 49 55 68 79) (6 12 25 36 40 46 62 68 74)
  (5 12 26 36 42 47 55 67 79) (5 12 26 36 40 47 60 64 79)
  (5 12 26 36 40 47 55 69 79) (5 12 26 36 42 46 61 67 74)
  (5 12 26 36 42 46 56 67 79) (5 12 26 36 40 46 60 70 74)
  (5 12 26 36 40 46 60 65 79) (5 12 26 36 40 46 56 69 79)
  (5 12 26 36 38 51 55 67 79) (5 12 26 36 38 49 60 64 79)
  (5 12 26 36 38 49 55 69 79) (5 12 25 36 42 46 62 67 74)
  (5 12 25 36 40 46 62 69 74) (8 10 24 36 40 48 61 68 74)
  (8 10 24 36 40 48 56 68 79) (8 10 24 36 40 47 61 68 75)
  (8 10 24 36 40 47 59 70 75) (8 10 24 36 40 47 59 66 79)
  (8 10 24 36 39 50 61 67 74) (8 10 24 36 39 50 56 67 79)
  (8 10 24 36 39 49 61 68 74) (8 10 24 36 39 49 59 70 74)
  (8 10 24 36 39 49 59 65 79) (8 10 24 36 39 49 56 68 79)
  (8 10 24 36 38 50 61 67 75) (8 10 24 36 38 49 61 68 75)
  (8 10 24 36 38 49 59 70 75) (8 10 22 36 42 48 61 68 74)
  (8 10 22 36 42 47 61 68 75) (8 10 22 36 42 47 59 70 75)
  (8 10 22 36 39 51 61 68 74) (8 10 22 36 39 51 59 70 74)
  (8 10 22 36 39 51 59 65 79) (8 10 22 36 39 51 56 68 79)
  (8 10 22 36 39 50 61 69 74) (8 10 22 36 39 50 60 70 74)
  (8 10 22 36 39 50 60 65 79) (8 10 22 36 39 50 56 69 79)
  (8 10 22 36 38 51 61 68 75) (8 10 22 36 38 51 59 70 75)
  (8 10 22 36 38 51 59 66 79) (8 10 22 36 38 50 61 69 75)
  (8 10 22 36 38 50 60 70 75) (8 10 22 36 38 50 60 66 79)
  (6 10 26 36 40 47 59 70 75) (6 10 26 36 40 47 59 66 79)
  (6 10 26 36 39 50 56 67 79) (6 10 26 36 39 49 59 65 79)
  (6 10 26 36 38 50 61 67 75) (6 10 26 36 38 49 59 70 75)
  (6 10 25 36 40 48 62 68 74) (6 10 25 36 40 47 62 68 75)
  (6 10 25 36 39 50 62 67 74) (6 10 25 36 39 49 62 68 74)
  (6 10 25 36 38 50 62 67 75) (6 10 25 36 38 49 62 68 75)
  (5 10 26 36 40 48 60 65 79) (5 10 26 36 40 48 56 69 79)
  (5 10 26 36 40 47 61 69 75) (5 10 26 36 40 47 60 70 75)
  (5 10 26 36 39 51 56 67 79) (5 10 26 36 39 49 60 65 79)
  (5 10 26 36 39 49 56 69 79) (5 10 26 36 38 51 61 67 75)
  (5 10 26 36 38 49 61 69 75) (5 10 26 36 38 49 60 70 75)
  (5 10 25 36 42 48 62 67 74) (5 10 25 36 40 48 62 69 74)
  (5 10 25 36 42 47 62 67 75) (5 10 25 36 40 47 62 69 75)
  (5 10 25 36 39 51 62 67 74) (5 10 25 36 39 49 62 69 74)
  (5 10 25 36 38 51 62 67 75) (5 10 25 36 38 49 62 69 75)
  (2 14 26 36 42 48 55 67 79) (2 14 26 36 40 48 60 64 79)
  (2 14 26 36 40 48 55 69 79) (2 14 26 36 42 46 61 67 75)
  (2 14 26 36 40 46 61 69 75) (2 14 26 36 40 46 60 70 75)
  (2 14 26 36 40 46 60 66 79) (2 14 26 36 39 51 55 67 79)
  (2 14 26 36 39 49 60 64 79) (2 14 26 36 39 49 55 69 79)
  (2 14 25 36 42 46 62 67 75) (2 14 25 36 40 46 62 69 75)
  (2 13 26 36 42 46 61 68 75) (2 13 26 36 42 46 59 70 75)
  (2 13 26 36 42 46 59 66 79) (2 13 26 36 39 51 59 64 79)
  (2 13 26 36 39 51 55 68 79) (2 13 26 36 39 50 55 69 79)
  (2 13 25 36 42 46 62 68 75) (1 14 26 36 42 48 61 67 74)
  (1 14 26 36 42 48 56 67 79) (1 14 26 36 40 48 60 70 74)
  (1 14 26 36 40 48 60 65 79) (1 14 26 36 40 48 56 69 79)
  (1 14 26 36 42 47 61 67 75) (1 14 26 36 40 47 61 69 75)
  (1 14 26 36 40 47 60 70 75) (1 14 26 36 40 47 60 66 79)
  (1 14 26 36 39 51 61 67 74) (1 14 26 36 39 51 56 67 79)
  (1 14 26 36 38 51 61 67 75) (1 14 25 36 42 48 62 67 74)
  (1 14 25 36 40 48 62 69 74) (1 14 25 36 42 47 62 67 75)
  (1 14 25 36 40 47 62 69 75) (1 14 25 36 39 51 62 67 74)
  (1 14 25 36 38 51 62 67 75) (1 13 26 36 42 47 61 68 75)
  (1 13 26 36 42 47 59 70 75) (1 13 26 36 42 47 59 66 79)
  (1 13 26 36 39 51 61 68 74) (1 13 26 36 39 51 59 70 74)
  (1 13 26 36 39 51 59 65 79) (1 13 26 36 39 50 60 70 74)
  (1 13 26 36 39 50 60 65 79) (1 13 26 36 38 51 61 68 75)
  (1 13 26 36 38 51 59 70 75) (1 13 26 36 38 51 59 66 79)
  (1 13 26 36 38 50 61 69 75) (1 13 26 36 38 50 60 70 75)
  (1 13 26 36 38 50 60 66 79) (1 13 25 36 42 47 62 68 75)
  (1 13 25 36 39 51 62 68 74) (1 13 25 36 39 50 62 69 74)
  (1 13 25 36 38 51 62 68 75) (1 13 25 36 38 50 62 69 75))
9:
 ((9 15 21 34 41 47 58 71 73) (9 15 20 34 41 48 58 71 73)
  (9 15 20 30 41 52 58 71 73) (2 15 27 30 41 52 58 71 73)))

there are 7 combinations of size 3 that can be formed from (1 8): ((1 2 8) (1 3 8) (1 4 8) (1 5 8) (1 6 8) (1 7 8) (1 8 9))

there are 2 templates for 1:
- one that includes cell 50 and therefore cannot be combined with the templates for 8 that include cell 50
- and one that does not include cell 50 and forms instances of the 7 possible combinations of size 3 containing (1 8)

here they are:
Hidden Text: Show
Code: Select all
(1 2 8)
.2..1..8....8..12..81.2.....1....2.8..8..2.1.2..18....8.2.....11....8..2...2.18..
82..1.......8..12...1.2..8..1....2.8..8..2.1.2..18......2..8..11.....8.2.8.2.1...
82..1.......8..12...1.2..8..1....2.8..8..2.1.2..18......2..8..118......2...2.18..
82..1.......8..12...1.2..8..1....2.8.8...2.1.2..18......2..8..11.....8.2..82.1...
82..1.......8..12...1.2.8...1....2.8..8..2.1.2..18......2....811....8..2.8.2.1...
82..1.......8..12...1.2.8...1....2.8.8...2.1.2..18......2....811....8..2..82.1...
.2..1..8....8..12..81.2....21......8..8...21....182...8.2.....11....8..2...2.18..
82..1.......8..12...1.2..8.21......8..8...21....182.....2..8..11.....8.2.8.2.1...
82..1.......8..12...1.2..8.21......8..8...21....182.....2..8..118......2...2.18..
82..1.......8..12...1.2..8.21......8.8....21....182.....2..8..11.....8.2..82.1...
82..1.......8..12...1.2.8..21......8..8...21....182.....2....811....8..2.8.2.1...
82..1.......8..12...1.2.8..21......8.8....21....182.....2....811....8..2..82.1...
2...1..8....8..12..81.2.....1....2.8..8..2.1..2.18....8.2.....11....8..2...2.18..
(1 3 8)
8.3.1.......8..1.3..1..3.8..1..3...8.38....1....18..3.3....8..11..3..8...8...13..
8.3.1.......8..1.3..1..38...1..3...8.38....1....18..3.3......811..3.8....8...13..
..3.1..8....8..1.3.81..3...31......8..83...1....18..3.8.....3.11...38....3...18..
8.3.1.......8..1.3..1..3.8.31......8..83...1....18..3......83.118..3.....3...18..
8.3.1.......8..1.3..1..3.8.31......8.8.3...1....18..3......83.11...3.8...38..1...
8.3.1.......8..1.3..1..38..31......8.8.3...1....18..3.......3811...38....38..1...
..3.1..8....8..1.3.81..3...31......8..83...1....18..3.8...3...11....83...3...18..
8.3.1.......8..1.3..1..3.8.31......8..83...1....18..3.....38..118....3...3...18..
8.3.1.......8..1.3..1..38..31......8.8.3...1....18..3.....3..811....83...38..1...
8.3.1.......8..1.3..1..3.8.31......8..83...1....18..3.....38..113....8...8...13..
8.3.1.......8..1.3..1..3.8.31......8.8.3...1....18..3.....38..113....8....8..13..
8.3.1.......8..1.3..1..38..31......8..83...1....18..3.....3..8113...8....8...13..
8.3.1.......8..1.3..1..38..31......8.8.3...1....18..3.....3..8113...8.....8..13..
8.3.1.......8..1.3..1..3.8.31......8..83...1....18..3..3...8..11...3.8...8...13..
8.3.1.......8..1.3..1..3.8.31......8.8.3...1....18..3..3...8..11...3.8....8..13..
8.3.1.......8..1.3..1..38..31......8..83...1....18..3..3.....811...38....8...13..
8.3.1.......8..1.3..1..38..31......8.8.3...1....18..3..3.....811...38.....8..13..
8.3.1.......8..1.3..13...8..1..3...8.38....1....18..3.3....8..11....38...8...13..
8.3.1.......83.1....1....8331......8..83...1....18..3......83.118...3....3...18..
8.3.1.......83.1....1....8331......8.8.3...1....18..3......83.11....38...38..1...
..3.1..8....83.1...81.....331......8..83...1....18..3.8....3..11....83...3...18..
8.3.1.......83.1....1...8.331......8.8.3...1....18..3......3.811....83...38..1...
8.3.1.......83.1....1...8.331......8..83...1....18..3......3.8113...8....8...13..
8.3.1.......83.1....1...8.331......8.8.3...1....18..3......3.8113...8.....8..13..
8.3.1.......83.1....1....8331......8..83...1....18..3..3...8..11....38...8...13..
8.3.1.......83.1....1....8331......8.8.3...1....18..3..3...8..11....38....8..13..
(1 4 8)
8..41....4..8..1....1...84..1..4...8.84....1....18...4.....4.811....84...48..1...
8..41....4..8..1....1...84..1..4...8.84....1....18...4.....4.8114...8.....8..14..
...41..8.4..8..1...81....4..1..4...8.48....1....18...48....4..11....84....4..18..
8..41....4..8..1....1...84..1..4...8.48....1....18...4.....4.811....84...84..1...
8..41....4..8..1....1...84..1..4...8.48....1....18...4.....4.811.4..8....8...14..
...41..8.4..8..1...81....4..14.....8..8..4.1....18...48.....4.11...48....4...18..
8..41....4..8..1....1...84..14.....8.8...4.1....18...4......4811...48....48..1...
...41..8.4..8..1...81....4..14.....8..8..4.1....18...48...4...11....84...4...18..
8..41....4..8..1....1...84..14.....8.8...4.1....18...4....4..811....84...48..1...
8..41....4..8..1....1...48..1..4...8.84....1....18...4.....8.411....48...48..1...
8..41....4..8..1....1...48..1..4...8.48....1....18...4.....8.411....48...84..1...
8..41....4..8..1....1...48..1..4...8.48....1....18...4.....8.4118...4.....4..18..
...41..8.4..8..1...81...4...14.....8..8..4.1....18...48......411...48....4...18..
8..41....4..8..1....1...48..14.....8..8..4.1....18...4.....8.4118..4.....4...18..
8..41....4..8..1....1...48..14.....8.8...4.1....18...4.....8.411...4.8...48..1...
(1 5 8)
8...1..5..5.8..1....1..5.8..1.5....8..8...51...518....5....8..11...5.8...8...1..5
8...1..5..5.8..1....1..5.8..1.5....8..8...51...518....5....8..118..5.........18.5
8...1..5..5.8..1....1..5.8..1.5....8.8....51...518....5....8..11...5.8....8..1..5
8...1..5..5.8..1....1..58...1.5....8..8...51...518....5......811...58....8...1..5
8...1..5..5.8..1....1..58...1.5....8.8....51...518....5......811...58.....8..1..5
8...1..5..5.8..1....1..5.8..1.5....8..8...51.5..18........58..11.5...8...8...1..5
8...1..5..5.8..1....1..5.8..1.5....8..8...51.5..18........58..1185...........18.5
8...1..5..5.8..1....1..5.8..1.5....8.8....51.5..18........58..11.5...8....8..1..5
8...1..5..5.8..1....1..58...1.5....8..8...51.5..18........5..811.5..8....8...1..5
8...1..5..5.8..1....1..58...1.5....8.8....51.5..18........5..811.5..8.....8..1..5
8...1..5..5.8..1....1..5.8..1.5....8.85....1....18.5..5....8..11...5.8....8..1..5
8...1..5..5.8..1....1..58...1.5....8.85....1....18.5..5......811...58.....8..1..5
8...15....5.8..1....1...85..1.5....8..8...51...518....5......811...58....8...1..5
8...15....5.8..1....1...85..1.5....8.8....51...518....5......811...58.....8..1..5
....15.8..5.8..1...81....5..1.5....8..8...51.5..18....8...5...11.5..8........18.5
8...15....5.8..1....1...85..1.5....8..8...51.5..18........5..811.5..8....8...1..5
8...15....5.8..1....1...85..1.5....8.8....51.5..18........5..811.5..8.....8..1..5
8...15....5.8..1....1...85..1.5....8.85....1....18.5..5......811...58.....8..1..5
(1 6 8)
....1..86..68..1...816......1.....686.8....1....186...8.....6.116...8.......618..
8...1...6..68..1....16...8..1.....686.8....1....186........86.116....8...8..61...
8...1...6..68..1....16...8..1.....6868.....1....186........86.116....8....8.61...
8...1...6..68..1....16..8...1.....686.8....1....186.........68116...8....8..61...
8...1...6..68..1....16..8...1.....6868.....1....186.........68116...8.....8.61...
....1..86..68..1...816......1.....686.8....1....186...86......11....86......618..
8...1...6..68..1....16...8..1.....686.8....1....186....6...8..118....6......618..
8...1...6..68..1....16..8...1.....686.8....1....186....6.....811....86...8..61...
8...1...6..68..1....16..8...1.....6868.....1....186....6.....811....86....8.61...
.6..1..8....8..1.6.816......1.....686.8....1....186...8.....6.11.6..8.......618..
86..1.......8..1.6..16...8..1.....686.8....1....186........86.11.6...8...8..61...
86..1.......8..1.6..16...8..1.....686.8....1....186........86.1186..........618..
86..1.......8..1.6..16...8..1.....6868.....1....186........86.11.6...8....8.61...
86..1.......8..1.6..16..8...1.....686.8....1....186.........6811.6..8....8..61...
86..1.......8..1.6..16..8...1.....6868.....1....186.........6811.6..8.....8.61...
(1 7 8)
....1.78....87.1..781.......1...7..8..8....17..718....87......11..7.8........187.
8...1.7.....87.1..7.1....8..1...7..8..8....17..718.....7...8..11..7..8...8...1.7.
8...1.7.....87.1..7.1....8..1...7..8..8....17..718.....7...8..118.7..........187.
8...1.7.....87.1..7.1....8..1...7..8.8.....17..718.....7...8..11..7..8....8..1.7.
8...1.7.....87.1..7.1...8...1...7..8..8....17..718.....7.....811..7.8....8...1.7.
8...1.7.....87.1..7.1...8...1...7..8.8.....17..718.....7.....811..7.8.....8..1.7.
(1 8 9)
.9..1..8....8.91...81.....9.19.....8..8.9..1....18.9..8..9....11....8.9.9....18..
8...1...9...8.91...91....8..1....9.8..8.9..1...918.......9.8..11.....89.98...1...
8...1...9...8.91...91....8..19.....8..8.9..1....18.9.....9.8..11.....89.98...1...
89..1.......8.91....1....89.19.....8..8.9..1....18.9.....9.8..11.....89.98...1...
8...1...9...8.91...91....8..1....9.8..8.9..1...918.......9.8..118.....9.9....18..
8...1...9...8.91...91....8..19.....8..8.9..1....18.9.....9.8..118.....9.9....18..
89..1.......8.91....1....89.19.....8..8.9..1....18.9.....9.8..118.....9.9....18..
8...1...9...8.91...91....8..1....9.8.8..9..1...918.......9.8..11.....89.9.8..1...
8...1...9...8.91...91....8..19.....8.8..9..1....18.9.....9.8..11.....89.9.8..1...
89..1.......8.91....1....89.19.....8.8..9..1....18.9.....9.8..11.....89.9.8..1...
8...1...9...8.91...91...8...1....9.8..8.9..1...918.......9...811....8.9.98...1...
8...1...9...8.91...91...8...19.....8..8.9..1....18.9.....9...811....8.9.98...1...
89..1.......8.91....1...8.9.19.....8..8.9..1....18.9.....9...811....8.9.98...1...
8...1...9...8.91...91...8...1....9.8.8..9..1...918.......9...811....8.9.9.8..1...
8...1...9...8.91...91...8...19.....8.8..9..1....18.9.....9...811....8.9.9.8..1...
89..1.......8.91....1...8.9.19.....8.8..9..1....18.9.....9...811....8.9.9.8..1...

for 8 to be eliminated from cell 50, there must be no more template for 8 with cell 50
there are instances of the 7 possible combinations of size 3 with (1 8) with a template for 8 including cell 50
the rule of candidate elimination of the resolution by templates cannot be applied
the puzzle is not solved in 3-template
P.O.
 
Posts: 1688
Joined: 07 June 2021

Re: Templates as patterns

Postby eleven » Mon Oct 21, 2024 11:22 pm

Hm, i don't have my template program anymore, so i can't check that.
It seems to me, that P.O. (and probably myself in old times) just takes a grid, and calculates the k-template eliminations once, while Denis repeats the calculation after each elimination (which is done in whatever order).
P.O., could you verify, if Denis' eliminations are justified after previous eliminations ?
I also wonder, why Denis did not find P.O.'s 2-template elimination.
eleven
 
Posts: 3136
Joined: 10 February 2008

Re: Templates as patterns

Postby denis_berthier » Tue Oct 22, 2024 2:17 am

P.O. wrote:among the eliminations of T3 it is that of r6c5<>8 alone which solves the puzzle, all the others together do not, 8r6c5 is a size 1-antibackdoor in singles

It doesn't imply that eliminating only n8r6c5 by templates will give you the right template-depth.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Tue Oct 22, 2024 2:45 am

eleven wrote:It seems to me, that P.O. (and probably myself in old times) just takes a grid, and calculates the k-template eliminations once, while Denis repeats the calculation after each elimination (which is done in whatever order)

Somehow, yes. Though it requires a few more details.

Templates work like any pattern (whence the title of this thread). In any application of CSP-Rules (Sudoku, Kakuro,....) with any chosen set of resolution rules, in any resolution state, a rule is "randomly" selected among those applicable and it is applied. This changes the resolution state and this, in turn, changes which rules can be applied at the next step. Some rules that were applicable no longer are and some rules that weren't applicable become applicable.

Because the template rules can only eliminate templates, and because the template creation rules could create new templates only if new candidates or new templates were created, during resolution templates can only be eliminated - except upon entering template level k for the first time, when all the valid templates[k] in the current RS are computed,

What SudoRules does is apply iteratively all the rules, each in the current extended resolution state (which consists not only of candidates, but of all the templates).
After the application of a rule in resolution state RS1, the resolution state is automatically updated into some RS2 (which guarantees that all the rules valid in this new state RS2 and only them can be used at the next step): any template that depended on the just eliminated candidate/template is eliminated in RS2. Dependencies work:
- directly upwards: if a candidate/template is eliminated in RS2, all the templates containing/extending it are eliminated in RS2 (of course, this works recursively upwards);
- indirectly downwards: if a candidate/template is eliminated in RS2, this may make available in RS2 new rules that are downwards (in a lower Tk), which will in turn allow new possibilities of eliminations in RS2.
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Tue Oct 22, 2024 3:33 am

@eleven
after each template elimination i start the formation of the combinations again from 2-template, this is seen in the resolution path:
the initialization gives this template situation (2 5 23 21 15 15 4 250 5)
the first round of 2-template reduces it thus (2 5 21 19 12 12 4 191 4)
so a second round of 2-template takes place which eliminates a template for the 8 (2 5 21 19 12 12 4 190 4)
and so a third round of 2-template takes place which is not indicated because it eliminates nothing
and the hand passes to the 3-template whose template eliminations lead to the elimination of 3 candidates
so it starts again at 2-template and it is in this round that there is an elimination of candidate due to the combinations of 2-template
so a second round of 2-template with more template eliminations for the 8 and so a third round that gives nothing and the hand passes to 3-template
the 3-template leads to 4 candidate eliminations so again a round of 2-template which gives nothing a round of 3-template which gives nothing and the hand passes to the 4-template which solves the puzzle
hence the schema (2 2 3 2 2 3 4)

@Denis
if 8 is eliminated from r6c5 the puzzle is solved, doing r6c5<>8 with templates means that there is no more template for 8 with cell 50
what i mean is that we can focus on the instances of the combinations (1 8) which pass from T2 to T3 to form the combinations ((1 2 8) (1 3 8) (1 4 8) (1 5 8) (1 6 8) (1 7 8) (1 8 9)) but since i don't have this information i argue on the data provided by my implementation

and in my implementation after the last round of 2-template there are instances of (1 8) with templates for 8 including cell 50 which allows the formation of combinations (1 2 8) etc. with cell 50 for the 8 keeping in 3-template templates for 8 including cell 50

so it would seem that in your implementation T2 does not produce instances of (1 8) with cell 50 for 8 and since there are only 2 possible templates for 1 the one that can be combined with templates for 8 including cell 50 must have been eliminated by T2 which allows T3 to do r6c5<>8
P.O.
 
Posts: 1688
Joined: 07 June 2021

Re: Templates as patterns

Postby denis_berthier » Tue Oct 22, 2024 3:43 am

.
Focusing on eliminating the backdoor is not guaranteed to lead to the right template-depth (no more than it would lead to the right W rating).
As you can see in my resolution path, this elimination comes after many different ones are done.
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Tue Oct 22, 2024 4:05 am

T3 solves the puzzle because it eliminates 8 from r6c5, if it were only for all the other eliminations it makes the puzzle would not be solved and T4 would be triggered
a template procedure only works in one way: the elimination of templates leads to the elimination or assertion of candidates
eliminations or assertion of candidates are consequences of eliminations of templates, candidates have no active role in the procedure
P.O.
 
Posts: 1688
Joined: 07 June 2021

Re: Templates as patterns

Postby denis_berthier » Tue Oct 22, 2024 4:15 am

.
I've given a precise definition of template rules. Nothing to add, nothing to withdraw.
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby eleven » Tue Oct 22, 2024 4:22 pm

@P.O: the problem i had with your analysis was, that the postet templates contain digits, which have been eliminated by Denis before (e.g. 8r6c3).
But, if i did not make a mistake manually, also for the grid with the eliminated digits in all (18x)-templates one can be found, which contains 8r6c5. This would show, that 8r6c5 cannot be eliminated with a 3-template in Denis' sequence.
Code: Select all
+-------------------------+-------------------------+-------------------------+
| 128     2689    3       | 4       15      568     | 7       58      69      |
| 48      5       468     | 3678    378     9       | 1       2       36      |
| 7       689     1689    | 136     2       3568    | 48      458     369     |
+-------------------------+-------------------------+-------------------------+
| 23      1       49      | 5       34      7       | 29      6       8       |
| 6       2348    45      | 38      9       2348    | 25      1       7       |
| 258     2789    57      | 16      18      26      | 59      3       4       |
+-------------------------+-------------------------+-------------------------+
| 345     34678   2       | 9       34578   3458    | 3468    48      1       |
| 1345    34678   145678  | 378     34578   3458    | 3468    9       2       |
| 9       348     48      | 2       6       1       | 348     7       5       |
+-------------------------+-------------------------+-------------------------+
82..1.......8..12...1.2..8.21......8.8....21....182.....2..8..11.....8.2..82.1...
8.3.1.......8..1.3..1..3.8.31......8.8.3...1....18..3......83.11...3.8...38..1...
8..41....4..8..1....1...84..1..4...8.84....1....18...4.....4.811....84...48..1...
8...1..5..5.8..1....1..5.8..1.5....8.8....51...518....5....8..11...5.8....8..1..5
8...1...6..68..1....16...8..1.....6868.....1....186........86.116....8....8.61...
8...1.7.....87.1..7.1....8..1...7..8.8.....17..718.....7...8..11..7..8....8..1.7.
8...1...9...8.91...91....8..19.....8.8..9..1....18.9.....9.8..11.....89.9.8..1...
eliminated (a for 3569, b for 89)
....8..............448..a..4..........8.8......b8.82..8........8.................
eleven
 
Posts: 3136
Joined: 10 February 2008

Re: Templates as patterns

Postby P.O. » Tue Oct 22, 2024 4:52 pm

here is Denis's resolution path, i mark ** the elimination i do, in my implementation all other eliminations are not done so in my implementation there are templates for all of them, and the data posted comes from my implementation

we don't have Denis data to analyze his process but the nature of elimination by templates implies that the templates for these candidates have been eliminated in his implementation

our procedures are very different which leads to classifications which have nothing to do with each other, i am waiting to see the first puzzle classified by Denis beyond T4

entering level T1_with_<Fact-3671>
candidate in no template[1] for digit 9 ==> r3c7≠9 **
candidate in no template[1] for digit 6 ==> r3c7≠6 **
candidate in no template[1] for digit 5 ==> r3c7≠5 **
candidate in no template[1] for digit 3 ==> r3c7≠3 **
candidate in no template[1] for digit 4 ==> r3c3≠4 **
candidate in no template[1] for digit 4 ==> r3c2≠4 **
entering level T2_with_<Fact-4012>
entering level T3 with <Fact-13951>
candidate in no template[1] for digit 9 ==> r6c3≠9
candidate in no template[1] for digit 4 ==> r4c1≠4 **
candidate in no template[1] for digit 8 ==> r6c3≠8
candidate in no template[1] for digit 8 ==> r3c4≠8
candidate in no template[1] for digit 8 ==> r1c5≠8
candidate in no template[1] for digit 2 ==> r6c7≠2 **
candidate in no template[1] for digit 8 ==> r6c6≠8
candidate in no template[1] for digit 8 ==> r5c3≠8
candidate in no template[1] for digit 8 ==> r7c1≠8
candidate in no template[1] for digit 8 ==> r8c1≠8
candidate in no template[1] for digit 8 ==> r6c4≠8
candidate in no template[1] for digit 8 ==> r6c5≠8
stte
P.O.
 
Posts: 1688
Joined: 07 June 2021

Re: Templates as patterns

Postby denis_berthier » Wed Oct 23, 2024 3:09 am

.
After classifying more puzzles wrt template-depth, nothing really new appeared:
- for puzzles in T&E(1), they are all in T1, T2 or T3 (now based on the first 50,000 controlled-bias ones);
- for puzzles in T&E(3) (all of which have a tridagon), most of them are in T3, except a very small part in T4 (now based on 40,000 puzzles);
- for puzzles in T&E(2), those with BxB≥7 that have a tridagon are in T3; the only 3 in B7B with no tridagon are in T4;
- new results: for the other old puzzles in T&E(2) (BxB<7), I used a part of eleven's tamagotchi collection. I found puzzles in only T4 or T3, with the proportion of T3 higher in the lower part of the collection (i.e. when SER is lower).

As of now, I found no puzzle with template-depth > 4; the above results show that, even if they exist, they must be quite rare.
(In particular, all the results obtained with incomplete implementations of templates and leading to higher values prove to fall in T4. If anyone has more such puzzles to submit, I'll check them.)

The T classification is not completely independent of the T&E-depth one, but whether it brings anything useful for the analysis of puzzles remains to be seen.
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Thu Oct 24, 2024 10:36 am

.
I've' now computed the template-depth of the first 254,760 puzzles of the controlled-bias collection (https://github.com/denis-berthier/Controlled-bias_Sudoku_generator_and_collection).

The template-depth distribution for it is:
Code: Select all
template-depth       0       1        2        3        >3
%                    35.13   17.09    8.69     39.09    0



Using the SudoRules unbiased-distribution functions, the unbiased distribution for template-depth is:
Code: Select all
template-depth       0       1        2      3      >3
%                    29.26   16.03    9.55   45.16  0



Based on this larger sample, the correlation between the W (or B) rating and the template-depth is unchanged: 0.72
.
denis_berthier
2010 Supporter
 
Posts: 4142
Joined: 19 June 2007
Location: Paris

PreviousNext

Return to Advanced solving techniques