Pattern Overlay Method

Advanced methods and approaches for solving Sudoku puzzles

Re: Pattern Overlay Method

Postby P.O. » Mon Jan 06, 2025 6:27 am

hi R.Jamil,
whatever the link you give concerning one method or another of resolution by templates their common trait is that they all use the knowledge of all the templates for each value, this example of Dobrichev is a new illustration of it

then the logic used for the elimination of templates is obviously the same for all these methods only the way of expressing it differs and the analysis which leads to putting or removing a candidate once again is the same

regarding the example given by Dobrichev, after initializing the puzzle and retrieving the templates we observe that there are 4 for each of the values ​​6 and 7 and the analysis of their compatibility shows that only 6 instances can be constructed, leading to the exclusion of one of the templates for 7, forcing the cells (50 63 78) to take the value 7 and a grid update solves the puzzle

Code: Select all
.  .  .  .  .  1  .  .  2
.  .  3  .  4  .  .  5  .
.  6  .  7  .  .  8  .  .
.  .  6  .  .  .  .  7  .
.  4  .  .  2  .  .  .  3
1  .  .  .  .  4  9  .  .
.  .  8  .  .  9  5  .  .
.  7  .  8  .  .  .  6  .
6  .  .  .  5  .  .  .  .

.....1..2..3.4..5..6.7..8....6....7..4..2...31....49....8..95...7.8...6.6...5....

#VT: (36 28 54 28 14 4 6 14 42)
Cells: nil nil nil nil nil (54) nil nil nil
SetVC: ( n6r6c9   n1r5c7   n8r5c8   n2r6c8   n4r4c7   n5r4c9
         n8r9c9 )

#VT: (10 14 54 12 7 4 4 4 30)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil (11) nil

45789  589    4579   3569   3689   1      367    349    2               
2789   129    3      269    4      268    67     5      179             
2459   6      12459  7      39     235    8      1349   149             
2389   2389   6      139    1389   38     4      7      5               
579    4      579    569    2      567    1      8      3               
1      358    57     35     378    4      9      2      6               
234    123    8      12346  1367   9      5      134    147             
23459  7      12459  8      13     23     23     6      149             
6      1239   1249   1234   5      237    237    1349   8               
166 candidates.

#6: (7 15 20 30 40 54 59 71 73) (7 13 20 30 42 54 59 71 73)
    (5 16 20 30 42 54 58 71 73) (4 16 20 30 42 54 59 71 73)
 
#7: (7 10 22 35 39 50 63 65 78) (3 16 22 35 37 50 63 65 78)
    (1 18 22 35 42 48 59 65 79) (1 16 22 35 39 50 63 65 78)

1: (6 7) 6 instances

..7...6.......67...6.7.......6....7.7..6.........7...6....6...7.7.....6.6....7...
7.....6.......67...6.7.......6....7...76.........7...6....6...7.7.....6.6....7...
..7...6.....6..7...6.7.......6....7.7....6.......7...6....6...7.7.....6.6....7...
7.....6.....6..7...6.7.......6....7...7..6.......7...6....6...7.7.....6.6....7...
....6.7..7.....6...6.7.......6....7...7..6.......7...6...6....7.7.....6.6....7...
...6..7..7.....6...6.7.......6....7...7..6.......7...6....6...7.7.....6.6....7...

......6.......6....6.........6.........6.............6....6...........6.6........
......6.....6......6.........6...........6...........6....6...........6.6........
....6..........6...6.........6...........6...........6...6............6.6........
...6...........6...6.........6...........6...........6....6...........6.6........

......7..7...........7............7...7..........7............7.7............7...
..7............7.....7............7.7............7............7.7............7...
7..............7.....7............7...7..........7............7.7............7...

#VT: (10 14 54 12 7 4 3 4 30)
Cells: nil nil nil nil nil nil (50 63 78) nil nil
SetVC: ( n7r6c5   n7r7c9   n7r9c6   n5r6c3   n3r6c4   n8r4c6
         n8r6c2   n5r8c1   n5r1c2   n8r1c5   n8r2c1   n5r5c4
         n5r3c6   n6r7c5   n6r5c6   n7r2c7   n2r2c6   n3r8c6
         n2r8c7   n3r9c7   n6r1c7   n1r8c5   n9r1c4   n6r2c4
         n3r3c5   n1r4c4   n9r4c5   n3r1c8 )

#VT: (3 4 2 4 1 1 2 1 2)
Cells: nil nil nil nil nil nil nil nil (11 37)
SetVC: ( n9r2c2   n1r2c9   n9r5c1   n7r5c3   n4r1c3   n2r3c1
         n1r3c3   n3r4c1   n2r4c2   n4r7c1   n2r7c4   n1r7c8
         n9r8c3   n4r8c9   n1r9c2   n2r9c3   n4r9c4   n9r9c8
         n7r1c1   n4r3c8   n9r3c9   n3r7c2 )
7 5 4   9 8 1   6 3 2
8 9 3   6 4 2   7 5 1
2 6 1   7 3 5   8 4 9
3 2 6   1 9 8   4 7 5
9 4 7   5 2 6   1 8 3
1 8 5   3 7 4   9 2 6
4 3 8   2 6 9   5 1 7
5 7 9   8 1 3   2 6 4
6 1 2   4 5 7   3 9 8
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Tue Jan 07, 2025 4:22 am

Hi P.O.,

Wish to inform that I have implemented two-digit POM elimination only move successfully.

I just checked first-digit all templates against second-digit template. If at least one template of second-digit found then count first-digit template cell positions. For example, just check digit 1 all possible templates with one of the digit 2 possible template. Then proceed to perform digit 1 POM elimination only.

For first-digit placement move, need to check at least one of the all other-digits template, i.e., check digit 1 all templates with one of the digit 2, 3, 4, 5, 6, 7, 8 and 9 template.

Partial success achieved.

R. Jamil

Added as on 20250109: My GitHub repositories has been updated accordingly.
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby rjamil » Fri Jan 17, 2025 12:36 am

Hi experts,

Please note that, I have built Pattern Overlay Method routine for single-digit (univalue both placement and eliminaton move) and two-digit (bivalue elimination move only) successfully, instead of tracking/storing intermediate templates, by just counting possible combination of templates.

Looking here and there for two-digit (or multi-digit) POM placement(s) example with no success.

Found interesting correspondence between ronk and daj95376 here regarding POM.

However, is there any real example available in which bivalue (or multivalue) POM move containing placement(s) (with or without eliminations)?

Similarly, if I'll count all possible templates of digit 1 with one of 2-9 digit possible template each, is it possible then to perform digit 1's single-digit POM placement move too?

R. Jamil
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Fri Jan 17, 2025 11:18 am

hi R.JAMIL
consider again the second list of puzzles here that are solved with combinations of 2 templates, 74 of these puzzles are solved with only 1 combination of 2 templates, that is to say that these combinations of 2 templates lead to the elimination of templates then the grid is solved either with placement or elimination of candidates

here is the list of 74 puzzles:
(3 4 5 7 8 9 11 12 13 14 15 18 19 21 23 24 25 26 27 28 29 30 31 32 33 34 35 37
38 41 42 45 46 47 48 49 50 52 53 54 56 58 59 60 63 64 65 67 68 69 70 72 74 76
77 78 79 80 82 83 84 85 86 87 88 89 91 92 93 94 96 97 99 100)
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Sat Jan 18, 2025 12:01 am

Hi P.O.,

Thanks for pointing the three test files. Find herewith link to each files output solved with RJSudoku.c program as T1 - 100 single-digit POM puzzles, T2 - 100 double-digit POM puzzles and T3 - 100 triple-digit POM puzzles.

First two files, containing single-digit and double-digit POM move puzzles respectively, are solved without guess completely. However, third file containing triple-digit POM move puzzles, solved with guesses. No POM placement move needed to solve the T1 and T2 puzzles.

Need sample puzzle that need to solve with (bivalue) double-digit POM placement move only.

R. Jamil
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Sat Jan 18, 2025 3:08 pm

rjamil wrote:First two files, containing single-digit and double-digit POM move puzzles respectively, are solved without guess completely.

i don't agree with this statement because in your T2.txt file it is mentioned 12 times that you use Trial & Error, for puzzles (2 10 13 20 22 44 51 61 73 90 95 98)

your analysis is based entirely on candidate cells and not on template combinations

for example for puzzle 20 we do the same eliminations of candidates until you resort to Trial & Error, but at this point if you had made the combination (2 6) you would have noticed that the number of templates for 6 goes from 14 to 10 and the analysis of the remaining templates would have allowed you to eliminate 6 from the cells (19 20 21) which solves the puzzle
Code: Select all
..3.5.78......9......1....5.1..7.6....45.3......6..9.23728........2......48..5..6

169     269     3       4       5       26      7       8       19               
14567   2568    16      37      368     9       1234    12346   134             
4679    2689    69      1       368     267     234     23469   5               
2       1       5       9       7       8       6       34      34               
69      69      4       5       2       3       18      17      178             
8       3       7       6       14      14      9       5       2               
3       7       2       8       1469    146     5       149     149             
1569    569     169     2       13469   1467    1348    13479   134789           
19      4       8       37      139     5       123     12379   6               
143 candidates.

#VT: (28 6 12 22 2 14 3 4 12)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(72) nil nil nil nil (68 69) nil nil (72)

169    269    3      4      5      26     7      8      19             
14567  2568   16     37     368    9      1234   12346  134             
4679   2689   69     1      368    267    234    23469  5               
2      1      5      9      7      8      6      34     34             
69     69     4      5      2      3      18     17     178             
8      3      7      6      14     14     9      5      2               
3      7      2      8      1469   146    5      149    149             
1569   569    169    2      1349   147    1348   13479  3478           
19     4      8      37     139    5      123    12379  6               
139 candidates.

2combs
#VT: (18 5 12 20 2 14 3 4 8)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(10) nil nil nil nil nil nil nil (19 20)

169    269    3      4      5      26     7      8      19             
4567   2568   16     37     368    9      1234   12346  134             
467    268    69     1      368    267    234    23469  5               
2      1      5      9      7      8      6      34     34             
69     69     4      5      2      3      18     17     178             
8      3      7      6      14     14     9      5      2               
3      7      2      8      1469   146    5      149    149             
1569   569    169    2      1349   147    1348   13479  3478           
19     4      8      37     139    5      123    12379  6               
136 candidates.

2combs
#VT: (18 5 12 20 2 10 3 4 8)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil (19 20 21) nil nil nil
EraseCC: ( n9r3c3   n9r1c9   n1r1c1   n6r2c3   n1r8c3   n9r9c1
           n2r1c2   n6r1c6   n8r3c2   n3r3c5   n6r5c1   n9r5c2
           n5r8c1   n6r8c2   n1r9c5   n5r2c2   n7r2c4   n8r2c5
           n2r3c6   n4r3c7   n6r3c8   n4r6c5   n1r6c6   n4r7c6
           n1r7c9   n9r8c5   n7r8c6   n3r9c4   n2r9c7   n7r9c8
           n4r2c1   n3r2c9   n7r3c1   n4r4c9   n1r5c8   n6r7c5
           n9r7c8   n8r8c9   n1r2c7   n2r2c8   n3r4c8   n8r5c7
           n7r5c9   n3r8c7   n4r8c8 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 2 3
7 8 9   1 3 2   4 6 5
2 1 5   9 7 8   6 3 4
6 9 4   5 2 3   8 1 7
8 3 7   6 4 1   9 5 2
3 7 2   8 6 4   5 9 1
5 6 1   2 9 7   3 4 8
9 4 8   3 1 5   2 7 6

same for puzzle 51, we reach the same resolution state before you resort to Trial & Error:
Code: Select all
2combs
#VT: (3 1 4 3 1 2 3 3 1)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil (59) nil nil nil

1      2      3      4      5      68     7      68     9               
4      5      6      7      38     9      18     2      13             
7      8      9      13     136    2      5      36     4               
2      3      4      18     18     7      9      5      6               
5      6      7      9      34     34     2      1      8               
8      9      1      6      2      5      3      4      7               
3      147    8      5      47     46     16     9      2               
6      17     5      2      9      38     4      378    13             
9      47     2      38     34678  1      68     37     5               
56 candidates.

not doing the template combinations you miss the placements of 1 in cells (22 32) and 3 in cells (42 76)
Code: Select all
2combs
#VT: (2 1 2 3 1 2 3 3 1)
Cells: (22 32) nil (42 76) nil nil nil nil nil nil
SetVC: ( n1r3c4   n8r4c4   n1r4c5   n3r5c6   n8r8c6   n3r9c4
         n7r9c8   n6r1c6   n8r1c8   n1r2c7   n3r2c9   n3r3c5
         n6r3c8   n4r5c5   n7r7c5   n4r7c6   n6r7c7   n3r8c8
         n1r8c9   n4r9c2   n6r9c5   n8r9c7   n8r2c5   n1r7c2
         n7r8c2 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 2 3
7 8 9   1 3 2   5 6 4
2 3 4   8 1 7   9 5 6
5 6 7   9 4 3   2 1 8
8 9 1   6 2 5   3 4 7
3 1 8   5 7 4   6 9 2
6 7 5   2 9 8   4 3 1
9 4 2   3 6 1   8 7 5

one last example puzzle 61, we reach the same resolution state before you resort to Trial & Error:
Code: Select all
#VT: (1 2 3 6 5 2 2 1 2)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil

1     25    23    4     35    6     7     8     9             
345   45    6     7     8     9     1     2     35             
7     8     9     1     35    2     35    46    3456           
2     457   47    56    49    8     39    1     36             
45    3     8     56    49    1     2     69    7             
9     6     1     3     2     7     4     5     8             
34    9     34    2     6     5     8     7     1             
6     27    27    8     1     3     59    49    45             
8     1     5     9     7     4     6     3     2             
58 candidates.

i make the combinations of templates
a first time, which makes the number of templates go from (1 2 3 6 5 2 2 1 2) to (1 2 3 5 4 2 2 1 2) without modification of the resolution state
Code: Select all
2combs
#VT: (1 2 3 5 4 2 2 1 2)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil

1     25    23    4     35    6     7     8     9             
345   45    6     7     8     9     1     2     35             
7     8     9     1     35    2     35    46    3456           
2     457   47    56    49    8     39    1     36             
45    3     8     56    49    1     2     69    7             
9     6     1     3     2     7     4     5     8             
34    9     34    2     6     5     8     7     1             
6     27    27    8     1     3     59    49    45             
8     1     5     9     7     4     6     3     2             
58 candidates.

as there were template eliminations i make the combinations of templates a second time which makes the number of templates go from (1 2 3 5 4 2 2 1 2) to (1 2 3 4 4 2 2 1 2) which allows the placement of 4 in cell 41 and solves the puzzle
Code: Select all
2combs
#VT: (1 2 3 4 4 2 2 1 2)
Cells: nil nil nil (41) nil nil nil nil nil
SetVC: ( n4r5c5   n9r4c5   n3r4c7   n6r4c9   n5r5c1   n6r5c4
         n9r5c8   n4r8c8   n5r8c9   n3r2c9   n5r3c7   n6r3c8
         n4r3c9   n5r4c4   n9r8c7   n4r2c1   n5r2c2   n3r3c5
         n3r7c1   n4r7c3   n2r1c2   n3r1c3   n5r1c5   n7r4c3
         n7r8c2   n2r8c3   n4r4c2 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 2 3
7 8 9   1 3 2   5 6 4
2 4 7   5 9 8   3 1 6
5 3 8   6 4 1   2 9 7
9 6 1   3 2 7   4 5 8
3 9 4   2 6 5   8 7 1
6 7 2   8 1 3   9 4 5
8 1 5   9 7 4   6 3 2

my point of view regarding the technique of resolution by templates is that the placement or elimination of candidates is the consequence of the elimination of templates realized by their combinations
you cannot make these combinations if you do not have all the templates for each value

in your T3.txt file you have used Trial & Error more than 200 times which is an indication that the more the size of the combinations increases the less the method you are using gives results
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Sat Jan 18, 2025 6:31 pm

Hi P.O.,

First of all, many thanks for your prompt response. I really appreciate your assistance.

I have coded for single-digit POM placement and eliminaion move and double-digit POM elimination move only. Similarly, I haven't coded for triple-digit POM move.

I need experts guidance for double-digit POM move at the moment, as it need to be checked and confirmed by experts (or just by your goodself) on its fitness. Actually, I considered 88 puzzles solved without guess means it is almost same results with yours, i.e., 74 puzzles solved with only one combination of double-digit POM move.

However, my single-digit POM placement and elimination move is supposed to be correct. if there is any bug in the same then it will be identified in T1.txt file.

Your detail reply help to do thorough investigation and debug the double-digit POM elimination move routine accordingly. However, is there any double-digit POM placement move present?

R. Jamil
N.B.: I have changed univalue with single-digit, bivalue with double-digit wordings. Similarly, plan to use triple-digit and quad-digit for POM move accordingly.
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Tue Jan 21, 2025 5:24 pm

rjamil wrote:However, is there any double-digit POM placement move present?

here are some 17c puzzles that i solve with one size 2 combination with placement(s), but as i always look for placements first it does not mean that they cannot be solved with only eliminations
the numbering is for the list referenced here
Hidden Text: Show
Code: Select all
.................1.....2.3.....4...5..2.1...6..3..78.....9.32...1.....4..5.......   #7
.................1.....2.34.....4.....5...6....6.3.....3..5.....7..6.8..24......7   #15
.................1..1..2.3.....4.....4.56.7...8.....2...2........3..1...7...8...4   #116
.................1..2..3.4........2..5..6.3..16..7.........8.....4..2....7..1...6   #375
.................1..2..3.4........5......23...6..1...7...67......81.....5.9....8.   #381
.................1..2..3.4......253..16..7....8...........1.....5..8....4......27   #649
.................1..2..3.4......43...1.......56.........7...83...9.1...52...6....   #692
.................1..2..3.4......5....3....6..7...1...8.....625..8..9....1......3.   #738
.................1..2..3.4......5....6.......71......6....1..5....68.7....47...2.   #741
.................1..2..3.4......56...7.......18..........18...7..69..2..3...7....   #886
.................1..2..3.4......562..1...7..8.9...........1.......89......4.3.2..   #899
.................1..2..3.45.......6.....7.....5819.........8.3.7....6...9.....7..   #949
.................1..2.34..........3...4.5.2...6.1..........34...1.7....88.......6   #1147
.................1..2.34.........23....5...6..7.1.........2..8..9.......41.7....9   #1208
.................1..2.34.........35....6..2...7.18.......5....2.3....4..68.......   #1235
.................1..2.34........2.5..3......67..1.........5..2..8.....4.16.7.....   #1333
.................1..2.34........234..1....5..6..7........18...6..4.......7.5.....   #1340
.................1..2.34........234..156.....7...........1....8..9....2.3..7.....   #1357
.................1..2.34........5......16...7..3....2......8.4..1.7.....9.6...3..   #1410
.................1..2.34........5.....4....3..6.1....7....6..2...5...4..1.87.....   #1438
.................1..2.34......2...3..5....4...6.17.......8....6..4...5..7...1....   #1591
.................1..2.34......5.......6...37..8.1.9......8....93.7....6.4........   #1597
.................1..2.34......5......6....37..8...1......86..3...1...9....5.4....   #1599
................12.....3..4....1..5...2...3....64........6.78...1......9.5...2...   #1858
................12....34................563...17....2......1.8.39....4..5..2.....   #1902
................12....34...............1..56..23.....7......2.8..9.....35.4..9...   #1903
................12....34..............5...6.3.7.1...2......83.512.7.....9........   #1946
................12....34..............5...6.3.7.1...2.....8.3.512.7.....9........   #1948
................12....34...........3..51...6..7.8.........7.4..1..2.....6.9...3..   #2034
................12....34...........5...2...6...3..74........3...2..1....61.8..7..   #2060
................12....34.........3.......54.6.17.........8.....3.....79.4..21....   #2140
................12....34.........3......5.4.6.17.........8.....3..2.1...4.....79.   #2151
................12....34.........3......5.6.4.178........28...54........6.1......   #2156
................12....34.........3.....1.5.....6...7.4.....647..5.......21..8....   #2166
................12....34.........3....1.......567..8.....26...934......58........   #2206
................12....34.........3....1.......567..8.....26...934.....5.8........   #2207
................12....34.........3....5.....1.675........18...734....6..9........   #2261
................12....34.........3....5...4.6.7..1.......78......91.....2.3...9..   #2284
................12....34.........3....51......34...6........4..67.......8..9.1.5.   #2316
................12....34.........3.5..2........678.......1.9.6..3.......45.2.....   #2372
................12....34.........3.5..4...6...7.2.........6.4.3.8.......12.7.....   #2378
................12....34.........5....31.......6..73.......645..7.......12..8....   #2454
................12....34........1.4...5...3...6.2........6..5.7..4.......2..8...6   #2496
................12....34..5..............64.3.178........1...8.3..7.....5.2......   #2770
................12....34..5..............64.3.178........7...8.3..1.....52.......   #2771
................12....34..5.....1.....6.......35...7......7.8..1..2.....8.4....6.   #2836
................12....345..........6..3...4....51......4........7..5....86.2....9   #2953
................12....345.......63....1.......678........21...834.......5........   #3018
................12...345...........3..6...4...17..6........8.6.....7....3..21....   #3047
................12...345........34....6...7...182........67......2......4.....5..   #3081
................12...345.......16.....5.2......7...3...6.4..8...9.......21.......   #3091
................12..1.34........53...6.......72.1........2....7..3...4...8..9....   #3186
................12..3..4.................34.516.....2.....17.8....86.3....5......   #3216
................12..3..4.................35.612..7...........8....26...74.5...3..   #3233
................12..3..4.................35.612..7.........8.9....26....4.5...3..   #3234
................12..3..4.................53.612......7....2....4.6...5..8..7..9..   #3269
................12..3..4.................53.612......7....2...8...7..9..4.6...5..   #3270
................12..3..4.................56.312..7..........3.5...8.....87.12....   #3349
................12..3..4................5...1.46..73......8.....5....94..9.12....   #3450
................12..3..4................5...6.4.12.........73..1......4.52..86...   #3456
................12..3..4................5.4.6.7.12......84.73...2.......4....6...   #3466
................12..3..4..............4..53...1.26.........34.7.2.....5.6...8....   #3558
................12..3..4...........3.....54...5..1..6......73...6.....5.18..2....   #3626
................12..3..4...........3.2.56....7.....4.8....2..5....19......8...3..   #3677
................12..3..4...........3.2.56....7.....4.8....2..5....91......8...3..   #3678
................12..3..4...........3.5.16....7.8...4.......53....4.....71..2.....   #3683
................12..3..4...........5..612.....1..7.......6.38...2.....6..7...5...   #3816
................12..3..4.........15......67...4..2.........84..16......92..5.....   #3842
................12..3..4.........3.......56...1..7.........34...7...6...12..8..7.   #3861
................12..3..4.........3....5...4...6..1.........374..5...7...21.8.....   #3962
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby P.O. » Wed Jan 29, 2025 12:23 pm

this puzzle
Code: Select all
1  .  3  .  .  6  .  8  .
4  .  .  .  8  .  1  .  .
.  8  .  1  .  .  .  6  .
.  4  .  .  9  5  .  .  3
.  .  7  .  .  .  .  .  .
.  .  .  3  .  .  .  .  .
3  .  .  5  .  4  .  9  7
8  .  .  .  6  3  .  1  .
.  .  5  .  .  .  .  .  .

1.3..6.8.4...8.1...8.1...6..4..95..3..7.........3.....3..5.4.978...63.1...5......

1       279     3       4       5       6       279     8       29               
4       25679   269     279     8       279     1       3       259             
2579    8       29      1       3       279     2579    6       4               
26      4       1       8       9       5       267     27      3               
259     3       7       6       24      1       2459    25      8               
2569    2569    8       3       247     27      245679  257     1               
3       126     26      5       12      4       8       9       7               
8       279     4       279     6       3       25      1       25               
279     1279    5       279     127     8       3       4       6               
108 candidates.

initialization:
#VT: (2 44 1 2 3 4 5 1 10)
Cells: nil nil nil nil nil nil (35) nil (9)
SetVC: ( n9r1c9   n7r4c8 )

#VT: (2 13 1 2 3 4 5 1 10)
Cells: nil (28) nil nil nil nil nil nil nil
SetVC: ( n2r4c1   n6r4c7   n6r6c1 )

#VT: (2 13 1 2 2 2 5 1 6)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil (43 52 65 67) nil nil (43 52) nil nil nil (11 13 19)

after initialization i get this resolution state, it is identical to the one indicated by Denis 'after Singles and whips[1]' and also identical to the one obtained by rjamil after 'Single-digit POM':
Code: Select all
1     27    3     4     5     6     27    8     9             
4     2567  269   27    8     279   1     3     25             
57    8     29    1     3     279   257   6     4             
2     4     1     8     9     5     6     7     3             
59    3     7     6     24    1     49    25    8             
6     59    8     3     247   27    49    25    1             
3     126   26    5     12    4     8     9     7             
8     79    4     79    6     3     25    1     25             
79    1279  5     279   127   8     3     4     6       
74 candidates.

from there to continue the resolution by templates i must consider the combinations of templates, and this is also what rjamil does and in fact the examination of the combination (2 5) is enough to solve the puzzle
there are 13 possible templates for 2 and 2 possible templates for 5:
Code: Select all
Value:           2
Value Cells:     (28)
Candidate Cells: (2 7 11 12 13 15 18 21 24 25 41 44 50 51 53 56 57 59 70 72 74 76 77)
Union csets:     (2 7 11 12 13 15 18 21 24 25 41 44 50 51 53 56 57 59 70 72 74 76 77)
Complementary Sets: 13
(2 13 25 44 51 57 72 77)
(2 15 25 41 53 57 72 76)
(2 15 25 44 50 57 72 76)
(2 18 24 41 53 57 70 76)
(2 18 24 44 50 57 70 76)
(7 11 24 41 53 57 72 76)
(7 11 24 44 50 57 72 76)
(7 12 24 41 53 56 72 76)
(7 12 24 44 50 56 72 76)
(7 13 21 44 51 56 72 77)
(7 13 21 44 51 59 72 74)
(7 15 21 41 53 56 72 76)
(7 15 21 44 50 56 72 76)


Value:           5
Value Cells:     (5 33 58 75)
Candidate Cells: (11 18 19 25 37 44 47 53 70 72)
Union csets:     (11 18 19 25 37 44 47 53 70 72)
Complementary Sets: 2
(11 25 37 53 72)
(18 19 44 47 70)

the examination of their compatibility eliminates 8 templates for 2:
Code: Select all
(2 5): 5 instances
....5.2.......2..55.2......2....5.......2..5..5.....2..2.5...........5.2..52.....
....5.2....2.....55....2...2....5.......2..5..5.....2..2.5...........5.2..52.....
....5.2...2......55....2...2....5.......2..5..5.....2...25...........5.2..52.....
.2..5.....5......2.....25..2....5...5......2.....2..5...25...........2.5..52.....
.2..5.........2..55.....2..2....5.......2..5..5.....2...25...........5.2..52.....

......2.......2.....2......2............2...........2..2...............2...2.....
......2....2...........2...2............2...........2..2...............2...2.....
......2...2............2...2............2...........2...2..............2...2.....
.2...............2.....2...2...............2.....2......2............2.....2.....
.2............2.........2..2............2...........2...2..............2...2.....

....5............55.............5..........5..5..........5...........5....5......
....5.....5.............5.......5...5...............5....5.............5..5......

here we can either start by looking if candidates belong to all the templates which allows their placement, and this is what i usually do, and i find that all the templates for 2 have in common the cell 76 which places 2 in r9c4 and solves the puzzle:
Code: Select all
#VT: (2 5 1 2 2 2 5 1 6)
Cells: nil (76) nil nil nil nil nil nil nil
SetVC: ( n2r9c4   n7r2c4   n1r7c5   n9r8c4   n7r9c5   n7r8c2
         n9r9c1   n1r9c2   n2r1c2   n7r1c7   n9r3c3   n2r3c6
         n5r3c7   n5r5c1   n2r5c8   n9r6c2   n7r6c6   n4r6c7
         n5r6c8   n6r7c2   n2r7c3   n2r8c7   n5r8c9   n5r2c2
         n6r2c3   n9r2c6   n2r2c9   n7r3c1   n4r5c5   n9r5c7
         n2r6c5 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 3 2
7 8 9   1 3 2   5 6 4
2 4 1   8 9 5   6 7 3
5 3 7   6 4 1   9 2 8
6 9 8   3 2 7   4 5 1
3 6 2   5 1 4   8 9 7
8 7 4   9 6 3   2 1 5
9 1 5   2 7 8   3 4 6

but of course it is just as possible to start by looking if candidates no longer belong to any templates, which allows them to be eliminated and this is what rjamil does:
Code: Select all
Double-digit POM: 2 in r1c27 r2c23469 r3c367 r4c1 r5c58 r6c568 r7c235 r8c79 r9c245
         and POM: 5 in r1c5 r2c29 r3c17 r4c6 r5c18 r6c28 r7c4 r8c79 r9c3
Digit 2 not in 5 Templates => -2 @ r2c4 r6c6 r7c5 r9c2 r9c5;

doing the same i find the same eliminations as rjamil and these are sufficient to solve the puzzle:
Code: Select all
#VT: (2 5 1 2 2 2 5 1 6)
Candidates:nil (13 51 59 74 77) nil nil nil nil nil nil nil
EraseCC: ( n7r2c4   n7r6c6   n1r7c5   n9r8c4   n2r9c4   n7r9c5
           n7r8c2   n9r9c1   n1r9c2   n2r1c2   n7r1c7   n9r3c3
           n2r3c6   n5r3c7   n5r5c1   n2r5c8   n9r6c2   n4r6c7
           n5r6c8   n6r7c2   n2r7c3   n2r8c7   n5r8c9   n5r2c2
           n6r2c3   n9r2c6   n2r2c9   n7r3c1   n4r5c5   n9r5c7
           n2r6c5 )
1 2 3   4 5 6   7 8 9
4 5 6   7 8 9   1 3 2
7 8 9   1 3 2   5 6 4
2 4 1   8 9 5   6 7 3
5 3 7   6 4 1   9 2 8
6 9 8   3 2 7   4 5 1
3 6 2   5 1 4   8 9 7
8 7 4   9 6 3   2 1 5
9 1 5   2 7 8   3 4 6

the resolution path by templates given by Denis solves the puzzle without resorting to template combinations, as the eliminations which appear there do not contain that of 'Singles and whips[1]' we can suppose that its starting point is the resolution state after these
Denis' first two eliminations state that cells r7c5 and r9c2, in other words cells 59 and 74, do not belong to any template for 2:
candidate in no template[1] for digit 2 ==> r9c2≠2
candidate in no template[1] for digit 2 ==> r7c5≠2
but examining the resolution state shows that there is indeed one template for 2 including these two cells, this one:
Code: Select all
(7 13 21 28 44 51 59 72 74)
     . . . . . . 2 . .
     . . . 2 . . . . .
     . . 2 . . . . . .
     2 . . . . . . . .
     . . . . . . . 2 .
     . . . . . 2 . . .
     . . . . 2 . . . .
     . . . . . . . . 2
     . 2 . . . . . . .

so what Denis' implementation does still remains a mystery.

mystery solved
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Mon Feb 03, 2025 5:06 am

Hi P.O.,

P.O. wrote:here are some 17c puzzles that i solve with one size 2 combination with placement(s), but as i always look for placements first it does not mean that they cannot be solved with only eliminations
the numbering is for the list referenced here
...

Find attached herewith 17c.txt file containing all 70 17 clue puzzles solved without guessing with double-digit POM placement/elimination move.

Please note that, after implementing double-digit POM placement move, notice that there is no effect in solving more puzzles than elimination only move. The only effect shown is to solve the puzzle with less steps only.

R. Jamil
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Mon Feb 03, 2025 9:22 am

rjamil wrote:Please note that, after implementing double-digit POM placement move, notice that there is no effect in solving more puzzles than elimination only move. The only effect shown is to solve the puzzle with less steps only.

in his new book Denis recalls a proof given by blue in the thread Templates as patterns that the placement of a candidate can always be replaced by eliminations + singles so in effect this does not bring additional power but as you point out it is faster
Code: Select all
Theorem 16.2: in T1, rule T1-assert is not necessary.
Proof (due to Blue): if, in some resolution  state RS, rule T1-assert would assert n1r1c1, then we have successively:
1) every template[1] for n1, includes rc-cell r1c1,
2) no template[1] for n1 includes a cell that can “see” r1c1,
3) for any i≠1, cell r1ci “sees” r1c1 and rule T1-delete can therefore eliminate n1r1ci,
4) after step 3 has been applied to all the i≠1, there remains a Hidden Single for n1 in r1c1 and n1r1c1 can be eliminated in BRT.

here are some 17c puzzles that i classify in 3-template and solve with only one size 3 combination
there can be several such size 3 combinations
Hidden Text: Show
Code: Select all
.................1.....2.3......3.2...1.4......5....6..3......4.7..8...962...7...   #1
.................1.....2.34.....56....7....8..8..1.7.....8.....3..6.....9.5.....3   #22
.................1....23..........2...14....536.....7....8.......415.....7....36.   #25
.................1....23.4......2.3...1.45.....6...7.....71.....4.......23.....8.   #54
.................1....23.4......4.5...1....2..67.........1....75....8...9.....8.6   #64
.................1....23.4......5.6...2....3..7.8........1..7.83.6..8...5........   #78
.................1....23.4.....45.2...6.7.....18.........1....6.2.....9.34.......   #102
.................1....23.4....5....6.23......7.8.........6..7...9....2..5..1.7...   #112
.................1..1..2.3.......4....5.....6..7.38....4.61.....6.5.....9......8.   #114
.................1..2..3........4....5...2.6.61..7...8....1.5....4....2.9...8....   #149
.................1..2..3........4.5..1...5.3..67.........27...6.8..1...74........   #159
.................1..2..3..4.......2.....5....16..7........1.5....3..4....89..2.3.   #180
.................1..2..3..4.......5...4.6.....7..5.86......2....9.1.4...5......8.   #198
.................1..2..3..4.....1....5.......67.....5.....5.37...18.......476....   #204
.................1..2..3..4.....1....5.......67.....5....57.3....1.8......46...7.   #205
.................1..2..3..4.....1....5...6...76.....5.....5.3....18.......4.7..6.   #206
.................1..2..3..4.....235..1..6....7...8........1...7..5...9...9...4...   #226
.................1..2..3..4.....256..14.7.....8...........8.......1...5...3..9.2.   #229
.................1..2..3..4.....256..14.7.....8...........8.......1...5...9..6.2.   #230
.................1..2..3.4...............526..7..1...8...4.2.3..8.......91......7   #274
.................1..2..3.4...............526..78.1.......4.2.3..8.......91......7   #275
.................1..2..3.4...............526..78.1.......4.2.5..8.......91......7   #276
.................1..2..3.4..............1.5.6..7..4....5...283.16..5....9........   #281
.................1..2..3.4..............45.2..6.1....7.....243..8.......71.6.....   #302
.................1..2..3.4........2.......5.3.6..4.........2..7.8.9.5...17......4   #341
.................1..2..3.4........2......536..7..8........1.7....3.....86.5..2...   #344
.................1..2..3.4........2....56.....34....7......7....5....8.6.8..1...5   #351
.................1..2..3.4........2..1..5.....67..83......1........6...5..4...83.   #366
.................1..2..3.4........5......4.6.78...........9...7..6.......1.27.9.8   #384
.................1..2..3.4........5......623..1..7.......4.2....8..3....6.5.....8   #388
.................1..2..3.4........5......642..7..8.......4.2.3..1........89.....7   #393
.................1..2..3.4.......2.5.1..46....7..3........7..6...51.......8...3..   #436
.................1..2..3.4.......2.5.1.46.....7..3........7..6...51.......8...3..   #437
.................1..2..3.4.......25.....1.....6..7.3.....46...82....5...37.......   #457
.................1..2..3.4.......25.....6.3...7..8.......41...7.83......2....5...   #458
.................1..2..3.4.......25...4....3..6..7.........2..6..35.8....1....7..   #459
.................1..2..3.4......2....1....5.6.7......8....68.....4....2.7..1...9.   #513
.................1..2..3.4......2.3..1....5.6.7...8.......1...7..8...2..3...6....   #558
.................1..2..3.4......2.3..1...5..6.7......8....1...7....8....5.4....2.   #559
.................1..2..3.4......2.5..1.....6..7..8........1.3.7..9.......452.....   #575
.................1..2..3.4......2.5..1.....6.784..........1........8.7....9...23.   #576
.................1..2..3.4......25...4...6...51......7....1..8.....7......6.9.3..   #633
.................1..2..3.4......253..1........6....7......48..2..5.......7.1....9   #644
.................1..2..3.4......253..1........6....7......84..2..5.......7.1....9   #645
.................1..2..3.4......4........562.17...........7.2....6....5..4.81....   #659
.................1..2..3.4......4..5.1......63...72......8...7...4....2..5.6.....   #667
.................1..2..3.4......423..5.....6..7..8.......1..7.8..9......6.3......   #689
.................1..2..3.4......425..1........6.....3.....1.6.7....8....3.5...9..   #690
.................1..2..3.4......425..6.......71..8.......7.......6.1.....9....43.   #691
.................1..2..3.4......452..6.......71..8.......7.......6.1.....9....43.   #713
.................1..2..3.4......5........62.5.14.....7....7......6...5...3..1..8.   #717
.................1..2..3.4......5........67.2.14.....8....8......6...3...5..1..9.   #718
.................1..2..3.4......5........67.2.14.....8....8......6...3..5...1..9.   #719
.................1..2..3.4......5........67.214......8....8......6...3...5..1..9.   #720
.................1..2..3.4......5........67.214......8....8......6...3..5...1..9.   #721
.................1..2..3.4......5.....3.2.....1....6.7...6...5...8...3...6.17....   #725
.................1..2..3.4......5....1.....673...28.......1......9...2...5.7..8..   #732
.................1..2..3.4......5....6.......17......6...67...3..41.......5.8.9..   #739
.................1..2..3.4......5....6.......17....68.....7......46..8....5....34   #740
.................1..2..3.4......5..6.1....7.8.7...4.......2..5....81......6...3..   #766
.................1..2..3.4......5..6.3...2...17......8....1.7......8...4..5...2..   #769
.................1..2..3.4......5.3..6...2...17.....8.....7.......91...6..5...9..   #790
.................1..2..3.4......5.6..7...2...18.....3.....8.......91...7..5...9..   #806
.................1..2..3.4......52....6.4.....1....7.8...1.......5...32.9..8.....   #811
.................1..2..3.4......52...6......417...........8.......71...6..36..7..   #821
.................1..2..3.4......523..1........6..7........1.8.6..5...7...4...9...   #826
.................1..2..3.4......542..6.......71..8.......7.......6.1.....9....53.   #879
.................1..2..3.4.....1.......56...7.38....9.....24...51.......6.....3..   #918
.................1..2..3.4.....1.......56...7.38....9.....42...51.......6.....3..   #919
.................1..2..3.4.....24.5....6......7......8....5.23..6.......81.7.....   #926
.................1..2..3.4.....25.6....7......8......9....4.23..7.......91.8.....   #927
.................1..2..3.4.....25.6....7......8......9....4.25..7.......91.8.....   #928
.................1..2..3.4.....253...6.......71......8...18.....8.7.....9......5.   #931
.................1..2..3.45........6.1.47....7...8..........87......19....3..6...   #945
.................1..2..3.45.....26...1..7..3..8..........1.4..8..6...2....7......   #961
.................1..2..3.45....2..6....6..7....5.1........85..3.6.......7.....9..   #971
.................1..2.13..4.....5..6.7.......89..........7...9...4...3....698....   #975
.................1..2.13..4.....5.6....7.6.....8...9......4.1.8.5........6..9....   #977
.................1..2.13..4.....5.6....7.6.....8...9......4.1.8.5.......6...9....   #978
.................1..2.13.4......2.3..5......6.7...8......76...5..3........9.5....   #979
.................1..2.13.4.....5..3..6......78...4.......9.7..6..4..6.....5......   #981
.................1..2.34.................245.16.........47..5...3.1...76.8.......   #984
.................1..2.34................2546..7.1........8...79..5.....8.14......   #988
.................1..2.34................5634..7.1........8...79..5.....8.13......   #989
.................1..2.34...............1.5.6...78..2.......94.8.5.......16..7....   #1000
.................1..2.34..............3....4..1.56.7........23....6...8.96.1.....   #1017
.................1..2.34..............35.2....6...7..4....8.23..1..9.....7....5..   #1027
.................1..2.34..............5...34..6.7........1.6..8..98......74....9.   #1029
.................1..2.34..............5..2.4..6.7....5......42....6...3..7.1..8..   #1031
.................1..2.34.............5.1.....6.3...47.........8...9...153.4.2....   #1039
.................1..2.34.............5.1.....6.3...47.........8...9...153.4.6....   #1040
.................1..2.34...........3...1.5.46..7..2.........28..5...7...61.......   #1046
.................1..2.34...........3...5...2467.8..........81....4.......8.7..6..   #1048
.................1..2.34...........3...5.1....5.6...7.....2..8..1....5..46.7.....   #1051
.................1..2.34...........5...6...17.34.8......8.2.4..1..5.....7........   #1060
.................1..2.34...........5...6...17.34.8......8.9.4..1..5.....7........   #1062
.................1..2.34..........2......5..6.7.1.8......7.1..5..9......2.3....4.   #1075
.................1..2.34..........2....1....5.6.7.8......6.1..7..9......2.3....4.   #1079
.................1..2.34..........2....1....5.6.7.8......6.1..82.3....4.9........   #1080
.................1..2.34..........2....5...6..5.1.7........1..8..67.....2.4....3.   #1092
.................1..2.34..........2..1....34..5.6........7....8..4....9..6.1.9...   #1098
.................1..2.34..........2..1....34..5.6.7......5....6.8.1.....4.9......   #1100
.................1..2.34..........2..1....34..5.6.7.....85....6.9.1.....4........   #1101
.................1..2.34..........2..1...53...6.7........1.6..8...5.....3.9....4.   #1104
.................1..2.34..........2..5.....346..1........62.7.....8...5..74......   #1110
.................1..2.34..........2..5....34..6.7..8.....5....9..4......3.9.2....   #1113
.................1..2.34..........25......36..7.8.........2.7...9..6....18......4   #1115
.................1..2.34..........3....5..2...6.7.........2.84..1..8....5.6.....7   #1132
.................1..2.34..........3...4..5.2..6.7.........2.48..1...6....7....3..   #1146
.................1..2.34..........35.....2.4..6.1........5....6..3....7.8.4..1...   #1167
.................1..2.34..........5...6...72..1.8.9.......2.46.....7..3..9.......   #1180
.................1..2.34..........5...6..78...9...1......89...4..3.5....1.......9   #1184
.................1..2.34..........53....61....5.7...6.....2..8..1.......47.6.....   #1194
.................1..2.34..........53...6.1....5.7...6.....2..8..1.......47.5.....   #1195
.................1..2.34.........23....5......67..1......82.4...1........9..5...6   #1205
.................1..2.34.........23....5....6.5.1.........2..4..6..7....51......8   #1207
.................1..2.34.........23..5........6.7..........83....3...5.7..816....   #1213
.................1..2.34.........23..5........6.7........5.8..6..3...5.7..81.....   #1215
.................1..2.34.........23..5........6.7........57...6..3...58...81.....   #1216
.................1..2.34.........34..1.5...2..6...7......1.6..5...7.....3.8......   #1226
.................1..2.34.........34..1.5...2..6...7......1.6..5...7.....8.3......   #1227
.................1..2.34.........35......1....6...7..8....2.8...7..5....19......7   #1228
.................1..2.34........1....5.....636..7...5.....2..8.1........74.5.....   #1243
.................1..2.34........1....5.....636..7...5.....2..8.1........74.6.....   #1244
.................1..2.34........2....4..5....6..1....7.....8.3...3...54.1..6.....   #1278
.................1..2.34........2....5...6...71......8...5..36....7.....9.....42.   #1279
.................1..2.34........2..5..3..6....7.....18...7...3.2.....4..5..8.....   #1281
.................1..2.34........2.3..1...5....6....7.8...1.......4....2..7.6...9.   #1289
.................1..2.34........2.3..1...5...6..7....8...1....5..3....9.7..6.....   #1291
.................1..2.34........2.4...5....3..6.1........7....6..3....5.8.4..1...   #1305
.................1..2.34........2.4..1.5.6....7......8...1.......4....2..8.7....5   #1319
.................1..2.34........2.5..1....3..6..7........6.......7.1.....85...24.   #1331
.................1..2.34........2.5..16.....7.8...5......1........6..9.8..4....2.   #1332
.................1..2.34........2.5..6........7.1....6...7.......4...82...5...43.   #1334
.................1..2.34........3......1.5..6.76....4.....7.3...1.8...2.5........   #1378
.................1..2.34........324..1.....3..5.....6.....7.......51...86.4......   #1386
.................1..2.34........325..1.....3..6.....7....16...8...9.....4.5......   #1393
.................1..2.34........5......6.1.4...7....2.....7...8.4..9....91......5   #1420
.................1..2.34........5.....4..2....6......7..5....8..1..7....3..16..2.   #1440
.................1..2.34........5..6..4..2....7.....18...1..2....5...3...3.8.....   #1464
.................1..2.34........5..6.1......783..........1...3...5...9..4....7.8.   #1465
.................1..2.34........5.2..13.......6....5.....3.......4...7....781.6..   #1472
.................1..2.34........5.4..6....35..7.8........16...72...9....4........   #1507
.................1..2.34........5.42.6.......71..........17......8....3..5.6..9..   #1509
.................1..2.34........5.6...3....4..7.1........8..7....4....2.5.9..1...   #1511
.................1..2.34........523..1........6.7....8...1....6..3....7.9....8...   #1519
.................1..2.34........523..1.6....7.8..........1....8..3...6..9....7...   #1524
.................1..2.34........526..3.......7......4....17...3...5......46....8.   #1542
.................1..2.34........534..1.6......7....2.....72......3......8..1....5   #1549
.................1..2.34........534..6.......71.....2....1.8..6...9.......3....7.   #1552
.................1..2.34........534..6.......71....2.....18...6...9.......4...7..   #1553
.................1..2.34.......15..4...6......74....8...3...2..1........5....8.7.   #1568
.................1..2.34.......15..4...6......74....8...9...3..1........5....8.7.   #1569
.................1..2.34......1...3...5...4...6..7.2.....6....73........81...5...   #1580
.................1..2.34......5........6.1..7..3.......1....34.6...8..9.7....6...   #1593
.................1..2.34......5........6.1..7..3.......1....3466...8..9.7........   #1594
.................1..2.34..5.....3..6.7.......89..........7...9...5...4....698....   #1631
.................1..2.34..5.....6..2.7.......89..........7...9...1...4....598....   #1635
.................1..2.34.5.............6....7.34....2.....8.43.6........7.19.....   #1660
.................1..2.34.5.............6....7.34....2....8......5....49.6..17....   #1662
.................1..2.34.5.............6....7.34....8.....5.43.6........7.19.....   #1663
.................1..2.34.5.............6....7.35....2....8......5....39.6..1.7...   #1664
.................1..2.34.5.............6....7.35....4....8......5....39.6..1.7...   #1665
.................1..2.34.5...........1....3.66....7..8.....9.2....68......3....7.   #1671
.................1..2.34.5.......32..1.....4..6.7.......3..2....8.1....65........   #1712
.................1..2.34.5.......6.....1....7..3..5..8....6..2..1.7......4.....3.   #1719
.................1..2.34.5......2.4..1.67.....8..........8..1.6..3.....7..4......   #1727
.................1..2.34.5......63...7....6...8.9........8....9..6...2..4.3......   #1775
.................1..2.34.5......634..7........8.9........8....9..4......5.3....2.   #1778
.................1.23.45........2...6....3.4.7.1.....6...7......5.....3.8..1.....   #1798
................12.....3..4...........5..67..12..........14...5..68..9..3...2....   #1808
................12.....3..4.....56....1.......72........412....6...8.3..9..7.....   #1839
................12.....3..4....2......3.4.5....6...37.....5.....8...67..21.......   #1863
................12.....34.............125.....6..1.7........3.......764.2.5.8....   #1868
................12.....34......1......3.5..6..74...8..16.......2..7..3..5........   #1874
................12.....34.5.....56....1.2.....78..........18.......7....54....3..   #1876
................12....34.................134...56..7......8...5.1.....2.34..7....   #1882
................12....34.................54.6.17...8.....1...7.4.....3..59.2.....   #1899
................12....34.................54.6.23.7.......12...8..9......4.5...6..   #1901
................12....34..............1.....5.6...74......58..174.2.....9.....3..   #1905
................12....34..............1.....536...74......8.37...9.......251.....   #1908
................12....34..............1...3.4..56.7......2...5..4..8.9..7..1.....   #1912
................12....34..............12....5..6...3.4...7...8..4...6...35.....2.   #1918
................12....34..............12...5...6...34....7....8.4...6...35......1   #1923
................12....34..............15......6...74.....2...81.9......543..6....   #1925
................12....34..............5...3.4.6.1.7........58...1.....7..23.4....   #1937
................12....34..............5...3.4.6.1.7........85...1.....7.32..4....   #1938
................12....34..............5...3.627.1............5.1.3...4..8..26....   #1944
................12....34...........1..5...3...6.7.8........56..1..2.....3.4....9.   #1971
................12....34...........3..1.......567........8...6.3.219....9.....4..   #1993
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Feb 06, 2025 12:31 am

Hi P.O.,

P.O. wrote:in his new book Denis recalls a proof given by blue in the thread Templates as patterns that the placement of a candidate can always be replaced by eliminations + singles so in effect this does not bring additional power but as you point out it is faster
Code: Select all
Theorem 16.2: in T1, rule T1-assert is not necessary.
Proof (due to Blue): if, in some resolution  state RS, rule T1-assert would assert n1r1c1, then we have successively:
1) every template[1] for n1, includes rc-cell r1c1,
2) no template[1] for n1 includes a cell that can “see” r1c1,
3) for any i≠1, cell r1ci “sees” r1c1 and rule T1-delete can therefore eliminate n1r1ci,
4) after step 3 has been applied to all the i≠1, there remains a Hidden Single for n1 in r1c1 and n1r1c1 can be eliminated in BRT.

By the way, in page 365 of 2025-UMRN2.pdf, last line says, "(It is also useless for fast solving, as DFS is much faster.)", i.e., Denis and yourself, still unsure about the speed that I achieved by introducing template indexing for skipping, reduced redundent templates with highly compressed static data implementation, dobrichev step D with JasonLion acknowledged implementation, without intermediate template tracking/storing, without loosing single instance and achieved faster solving.

However, thanks one again for providing 70 17c puzzles for testing the T3 routine after coding.

R. Jamil
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Thu Feb 06, 2025 7:48 am

if the goal is speed of resolution there is no point in bothering with templates there are faster algorithms as Ruud already noted: "I have both templates and DLX implemented in SudoCue, and DLX is definitely faster."

DFS is a trial and error algorithm, it makes guesses and if it is wrong it goes back and makes another guess
in the case of 9x9 single-solution puzzle the search space is finite and very short for modern computers, it is traversed very quickly by such an algorithm and you use such an algorithm when your current template implementation fails to solve a puzzle

templates can be used with a DFS algorithm, and i have one such process to count and collect the solutions of a puzzle whether it is a single-solution puzzle or a multi-solution puzzle and its performance depends on the number of solutions of the puzzle and the number of templates by values as it is a simple question of combinatorics

but template solving is not about speed but about implementing a logic without guessing and the speed of execution of this logic is just an optimization to be done once it has has been properly put in place

step D of Dobrichev algorithm comes after step B where all templates for each digit are collected and step D acts as a filter on this collection of templates eliminating those which do not conform to the logic and it seems to me that this is what every template implementation does
P.O.
 
Posts: 1829
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Feb 06, 2025 11:40 am

Hi P.O.,

Thanks for providing such a helpful link. However, it did not mentioned about template pre-indexed and skipping method that I have used. Similarly, it did not mentioned to check all templates of one digit against one of the template of another digit for validity.

Comparision between POM/Templating with DLX or DFX, in terms of speed is calculated by number of iterations (or recursions). I have roughly calculated my optimised, robust and exhaustive POM routine and found that 9 x 8 = 72 times for double-digit POM, 9 x 8 x 7 = 504 times for triple-digit POM and 9 x 8 x 7 x 6 = 3024 times for quad-digit POM, as mentioned myself here, without keep storing intermediate templates result in linked list (or memory allocation).

As far as, I have implemented first digit position searching in row 1 first, then rest of 8 digit positions with the help of templating, for improvement in terms of speed. However, it will be converted back in to digit searching in all 9 positions template easily, with indexed templates and quick skipping algorithm. Slightly more compressed form than as mentioned by Ruud here in first post.

I feel like I'm intellectually inferior to my peers. I literally cannot grab most concepts without some sort of a visual representation on examplers form. I need to ask many questions in order to grasp things. May be, this is due to language barrier or my capabilities of comprehension.

R. Jamil

NB: Page 1, Page 2, Page 3.
rjamil
 
Posts: 810
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Thu Feb 06, 2025 6:17 pm

rjamil wrote:Similarly, it did not mentioned to check all templates of one digit against one of the template of another digit for validity.

Ruud's algorithm does this operation, first post here:
"My program keeps a library of all 46656 configuration templates, and maintains a list for each of the 9 values.
When a cell is filled, the list is filtered to the templates that contain that value at the cell's position.
When a cell is blocked for a value, all templates containing that value at the cell's position are removed from the list."

here is another list of 17c puzzles that i classify as 2-template and solve with more than one size 2 combination, i would be interested to know if your double-digit POM implementation solves them all
Hidden Text: Show
Code: Select all
.................1..2.34...........5...6...17.34.2......8.9.4..1..5.....7........   #1058
.................1..2.34...........5...6...17.34.8......9.2.4..1..5.....7........   #1063
.................1..2.34........1.45..6...2...7...8.......9.62..1..5....8........   #1262
................12....34...........1..3.....5.56.7.......8..6..1..25....9.4......   #1960
................12....34...........1..5.....6.63.5.......7..5..1..26....8.4......   #1965
................12....34...........1..5.....6.63.7.......8..5..1..26....9.4......   #1966
................12....34.........3....1.......5..6.4.7.....1.8.3..2.8...7.....6..   #2198
................12....34.........3.4...5..6...271........21..8.4.5......6........   #2336
................12....34........53....6.......517........86..7.34.....9.8........   #2607
................12....345................64...172........81...94.3...8..5........   #2948
................12....345........3.6...2.......71.8......7.2.8..5.......43.......   #2989
................12..1..3........4.5..2..6.7..84...........2...4..3........59...7.   #3102
................12..1.34..........2....5...67.34..8.........4..6....5...7..2.....   #3175
................12..3..4................567...1.2....8.....763..2.1.....89.......   #3512
................12..3..4..............412.....5..6...7....8.3..2..75....9......4.   #3580
................12..3..4...........3.5.26....7.8...4.......53....4.....72..1.....   #3684
................12..3..4...........5....1......6..74.3...8..7...1.....9.29...3...   #3731
................12..3..4...........5..6.7.4...3.1.........46...2....5...81.....3.   #3813
................12..3..4...........5.6..7.3..7..21..........8....5..34.91........   #3822
................12..3..4.........3.....15......67..8.......3....5.48....12......6   #3918
................12..3..4.........3....5...6...7.18.........645.21..9....7........   #4005
................12..3..4.........3....5.6.4...7.1.........8.57...4......21.7.....   #4036
................12..3..4.........3...1..5....65.7....4...81..5...2....9...4......   #4131
................12..3..4.........3.5....2.6...7.18.......4.7....2.......3....69..   #4305
................12..3..4.........3.5....6.....7.21......4..58..1........6......29   #4316
................12..3..4.........5......1.....643..7.......849..7.......21..5....   #4544
................12..3..4........3.......56....1.....7.....8.3...2....4..67.1...5.   #4939
................12..3..4........34...1..5.....6....7......6......4...8.9.251.....   #5129
................12..3..4........35...1..6.....7....4......2..7..84...3..6..1.....   #5368
................12..3..4........35...6.......12..7........6.3....45..8...7..2....   #5410
................12..3..4........35...6......78...6........8..3...5...4..67..2....   #5423
................12..3..4........5..6..7...4...1..2........783..2...9....4.....5..   #5768
................12..3..4........5..6.2....4..17..8........2......96..3..8.5......   #5829
................12..3..4........5..6.2..1.....78...9.....17.......4..8....5...3..   #5831
................12..3..4........53.6.1......78....3.......1........8.4....6.2.9..   #6165
................12..3..4........54...1.......26..7........1......5...3.4.87.6....   #6281
................12..3..4........56...1...2....78....9.....1......4.7.3...9....8..   #6519
................12..3..4.......1..5.....6.....72...3......234...5.....6.1....8...   #6746
................12..3..4..5..............367..2..5......6...4...5.18.....8..2....   #6807
................12..3..4..5........6.2..7.5..17..6.........3.......1..7...4...8..   #6956
................12..3..4..5......3......2.....6..1..7....4.35...7...5...81.......   #7024
................12..3..4..5.....34...5...6...12......7....7.......52....8.....6..   #7298
................12..3..4..5.....5..6.1.....7..8...3.......1..8...5...3..4...7....   #7422
................12..3..4..5.....53.4.1..6.....7...........7.......81..6..24......   #7443
................12..3..4..5.....63...1....7...2.....8.....8.......21....9.63.....   #7578
................12..3.45.................34..16.7.......4...5..2..1....68...9....   #8044
................12..3.45.................34..16.7.......4...5..2..1...6.8...9....   #8046
................12..3.45.................63.714...2.......1.4....7.8.9..6........   #8233
................12..3.45.................67.5.1..8.......29..4.6.5...3..7........   #8362
................12..3.45...............1....6.74...5.....21.......6....8.89...4..   #8468
................12..3.45...............1....6.74.3........8.5..19.2.....6.....4..   #8475
................12..3.45...............1.2.65.46....7.....3..8..5.......2..8.....   #8702
................12..3.45...............1.3..6.45...7......8.5..19.2.....7........   #8707
................12..3.45...............1.3..6.45..78........5..19.2.....8........   #8710
................12..3.45...............3.6..7.54.8...9......5.....2.....2..71....   #8891
................12..3.45...............6....724.1.........8..4...7...5..3.62.....   #8926
................12..3.45...............6.1..7.89...5.....2......4....8..2..1.7...   #8961
................12..3.45...............6.34..17......8...2.......4...5..9..81....   #9035
................12..3.45...............6.35..17......8...2.......5...4..9..81....   #9039
................12..3.45..............4..15...6.2...7.....3.8...1.......72.6.....   #9175
................12..3.45..............6..37...1.....8....1....9..7...3...2.86....   #9397
................12..3.45.............4.1....6.57...4....4..75...8.......1..2.....   #9603
................12..3.45...........3......4.6.2...7.......3..7..8..6....21.....5.   #9720
................12..3.45...........3......4.6.2.7.........3..7..1..6....28.....5.   #9721
................12..3.45...........3......4.6.2.7.........3..7..8..6....21.....5.   #9722
................12..3.45...........3.....65...2.1........2...7..65...8..9...3....   #9725
................12..3.45...........4...2......678.1.......3..7..54.....11........   #9907
................12..3.45...........4.2.1.6....6....7.......1.6...4.3......7...8..   #10023
................12..3.45...........6.....34..27..........2.8.7...4...1..5..9.....   #10141
................12..3.45...........6...1.7....54...3........5....89.....1..2...7.   #10249
................12..3.45...........6...2..7....4.1.........75.3.18......4.......7   #10286
................12..3.45...........6..41.......78..9.......634..1.2.....8........   #10387
................12..3.45...........6..7...4...8.2.1..5....3........7.89..1.......   #10404
................12..3.45...........6..72..8...4...1.......6....1......4.9...3.7..   #10431
................12..3.45..........45...1.63...6.............5..2..7.....3..28....   #10531
................12..3.45.........3....6...4...7.1...8......4.......36...81.....7.   #10739
................12..3.45.........3....67......1.2.8......1.......5.3.9..8.....5..   #10756
................12..3.45.........3.4.2.......16...7......8.......5.3.....9.2...6.   #10887
................12..3.45.........4.....1......3.2.6......78...9.1.....7.4.5......   #11168
................12..3.45.........4.....1......6.7.2.......8..7..2.....6.5.4....2.   #11209
................12..3.45.........4.....1..2...6.7.2.......8..7..2.....6.5.4......   #11283
................12..3.45.........4.....5....6.71..2.........8...2..6....6..9..5..   #11367
................12..3.45.........4...1.......67.1........2...7...4..658...9......   #11636
................12..3.45.........4...1.....6.72.8........2...7...4...5...6..9....   #11679
................12..3.45.........4.5.2.......61.7...........7.....1.8.6.2.5......   #12064
................12..3.45.........4.6.5...7...72.1.........6.......2..8....4...5..   #12244
................12..3.45.........6.......7..315...2.......3.....8..6....7......24   #12351
................12..3.45.........6...1.......7....35.....28..9.5.4......6..1.....   #12466
................12..3.45........1.....6...5...7.2...8.....3.4...1.......82......9   #12819
................12..3.45........1.....6...5...7.2.8.......9.4.3.1.......8...7....   #12821
................12..3.45........1..6..4...3....78.........7.5...1.......28.....9.   #12878
................12..3.45........1.6...7...5...8.2...9.....3.4...1.......92.......   #12981
................12..3.45........3..6..72.....48....5.....6..3...2.1.....5........   #13297
................12..3.45........34....6.......7.1......1.2....7.58......4......2.   #13347
................12..3.45........36.5...1.....27.8........2...7...6...3..4........   #13714
................12..3.45........4......16...7..5...3.......85...2.......71...6...   #13785
................12..3.45........43...1.......26...........6...7..5.7.4..8..2.....   #13836
................12..3.45........6......1...7..85...4......7.5..17.9.....2........   #14055
................12..3.45........6......1.27....8....5.....8.43..2.7.....6........   #14172
................12..3.45........6......1.27....8....5.....8.93..2.7.....6........   #14173
................12..3.45........6.....5...4...7.1....8....8.5..18.9.....2........   #14274
................12..3.45........64....1.....7.2.8........27......61..9..4........   #14757
................12..3.45........64...1.......72......8...2...7....8.....5.4...3..   #14862
................12..3.45........65...1.......72......8...2...7....8.....4.5...3..   #15301
................12..3.45........65...1.......72.8........2....7..5...4...9...8...   #15308
................12..3.45........65...1.......72.8........2....7..5...4...9..8....   #15309
................12..3.45........65...1.2.....7......4....61....5.4...3..8........   #15348
................12..3.45........65...1.2.....7......8....1....6..5.3.4..4........   #15351
................12..3.45......1......2.....4..6.7.3......2....6..4...5.3.8.......   #15882
................12..3.45......1....4..5...3...6.78.......2.6.8..1.......4........   #15908
................12..3.45......1....4..5...3...6.78.......26..8..1.......4........   #15909
................12..3.45......1.3.6....7.......4........8...5.4.1..9....6..2.....   #16125
................12..3.45......6..4....5.....7.2.18......4...3..7..2.....9........   #16186
................12..3.45..6.....2......1.6.....7...5...2.......4...7....8...3.4..   #16321
................12..3.456........4.....1......1.7...8....23..7.4.5......6........   #16446
................12..3.456........4.....1......7.8.9......2.7..8..6......5.4......   #16453
................12..3.456........4.....1......7.8.9......2.7..9..6......5.4......   #16454
...............123..4..5........6..7.8......591...........8.......12......7....64   #16691
...............123..4.56...........5...1.7.....6....8.....4..9..15......83.......   #16817
...............123..4.56........4..7.6.......12....8.....2........3....5..6.....4   #16946
..............1..2..1.3..4.....5.13..2.4.....6...........6.......3...7..7..2.8...   #17182
..............1..2..3....4..............56.2.17......8...5..3..2...4....9.6.....1   #17670
..............1..2..3....4.............56..3.17..8........5.9....6.3....2.....7.1   #17741
..............1..2..3....4............4.5..3..6...7..1...34..5..1......62..8.....   #17757
..............1..2..3....4.........1....4.3....56..7.....89..6..7....9..12.......   #17838
..............1..2..3....4.........5.....21.6.78.3..........38..1.......6...45...   #18007
..............1..2..3....4.........5....6.7.1..8.3.......24..3..5......917.......   #18205
..............1..2..3....4.........5....6.7.1..8.3.......24..3..5....9..17.......   #18206
..............1..2..3....4.........5..4.3.....2...6..1...47..3..1.....8..5......6   #18321
..............1..2..3....4.........5..4.3.....2...6..1...47..3..1.....8..5......9   #18322
..............1..2..3....4.......2.1...56....57...........4.36..8.......21.7.....   #18698
..............1..2..3....4.......5.......6..1.47.2........4..8.1.....6..52.3.....   #18745
..............1..2..3....4.......5.6..4.......2...7..1...48..3..1.....8..6..3....   #19034
..............1..2..3....4......5.......26..7.14...3....849....2........6.......1   #19359
..............1..2..3....4......5.......6.7.1.28..........3.68..1.7.....5......2.   #19387
..............1..2..3....4......5.3..1...6....7..2.......4........83...9.25.....7   #19574
..............1..2..3....4......5.3..1..2.....6...7......4........83...9.25.....6   #19576
..............1..2..3....4......5.3..1..6.....2...7......4........83...1.95.....6   #19580
..............1..2..3....4.....3.......4...5.67......1...58..3..1....7...2..6....   #19940

an example accompanied by an explanation in non-formal language is certainly one of the best ways to know what we are talking about
P.O.
 
Posts: 1829
Joined: 07 June 2021

PreviousNext

Return to Advanced solving techniques