Pattern Overlay Method

Advanced methods and approaches for solving Sudoku puzzles

Re: Pattern Overlay Method

Postby P.O. » Fri Mar 21, 2025 9:27 am

rjamil wrote:However, don't know how pjb and yourself are doing.

there's no point in discussing with you if you don't remember anything from the previous posts.
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby pjb » Wed Mar 26, 2025 10:26 pm

My methodology for the Pattern Overlay Method is clearly described in the "Help Files" section of my website.

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

Re: Pattern Overlay Method

Postby rjamil » Thu Mar 27, 2025 12:25 am

Hi pjb,

Read your POM help. It seems to me that you have implemented single-digit and double-digit POM methods. It is clear that the single-digit POM method is same for all (or at least the results are same).

Will you please provide in flowchart or steps-by-step or debugging form, with example, for double-digit POM method.

Your first example puzzle and current pencilmark state are different in POM Help. It tells "No pattern of 3 includes r1c1, r4c4 so 3 can be deleted from r1c1, r4c4". Same step detected by my POM solver first.
Then your solver tells as second step, "No pattern of 9 includes r1c1, r1c2, r1c3, r1c4, r1c7, r1c8, r2c1, r3c1, r4c1, r4c4, r4c5, r4c6, r4c7, r4c8, r5c4, r6c4, r7c1, r7c4, r7c7, r7c8 so 9 can be deleted from r1c1, r1c2, r1c3, r1c4, r1c7, r1c8, r2c1, r3c1, r4c1, r4c4, r4c5, r4c6, r4c7, r4c8, r5c4, r6c4, r7c1, r7c4, r7c7, r7c8". Again, same step detected by my solver.
In step 3. your solver tells, "Between them r6c6 and r8c8 include all patterns of 9, so patterns of 3 which include both cells can be deleted. As a result, no pattern of 3 includes r4c7 so 3 can be deleted from r4c7".
Where as, my solver tells:
"Double-digit POM: 3 @ r1c2346789 r2c12347 r3c12347 r4c1236789 r5c1478 r6c1467 r7c123789 r8c178 r9c5
and POM: 9 @ r1c569 r2c2347 r3c2347 r4c239 r5c1578 r6c167 r7c23569 r8c1478 r9c147
Digit 3 not in 68 Templates => -3 @ r4c7"
After third step, both solvers - no POMs found.

In Advanced POMs, your solver tells,"Between them r4c2 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted. As a result, no pattern of 2 includes r7c3, r8c8 so 2 can be deleted from r7c3, r8c8".
Why 4 can not be placed first in r4c2 and r9c4 even if all patterns of 4 include them with single-digit POM move?
My solver tells first:
Single-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c247 r8c1278 r9c45
Digit 4 not in 6 Templates => -4 @ r7c4
Single-digit POM: 7 @ r1c456 r2c1 r3c9 r4c25678 r5c24568 r6c24578 r7c467 r8c78 r9c3
Digit 7 not in 34 Templates => -7 @ r7c7
Then, in second step:
Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c2347 r8c2378 r9c49
and POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
Digit 2 not in 6 Templates => -2 @ r7c3 r7c7
Double-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
and POM: 9 @ r1c89 r2c5 r3c2 r4c4 r5c189 r6c378 r7c367 r8c1378 r9c69
Digit 4 not in 5 Templates => -4 @ r8c2

For your kind information, my double-digit POM method solve 88 out of 100 puzzles from T2.txt file.

Accept my appology for asking as there is no such discriptive information available for implementing the POM differently.

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

Re: Pattern Overlay Method

Postby P.O. » Fri Mar 28, 2025 6:10 pm

Between them r4c2 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted.

this should be understood as follows:
there are n templates for 4, p of them have cell r4c2, q have cell r9c4 and r have both cells with p+q+r = n and r < n
so any template for a value other than 4 that has these two cells is invalid because the template for 4 of the solution has either r4c2 or r9c4 or both
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Sat Mar 29, 2025 1:09 am

Hi P.O.,

P.O. wrote:
Between them r4c2 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted.

this should be understood as follows:
there are n templates for 4, p of them have cell r4c2, q have cell r9c4 and r have both cells with p+q+r = n and r < n
so any template for a value other than 4 that has these two cells is invalid because the template for 4 of the solution has either r4c2 or r9c4 or both

True.

And how it works for double-digit POM move, as I understand is as follows:
  1. Find a subset of valid templates for each digit from universal template set and keep them separately;
  2. Now, merge two digits' subset templates and keep product of the same separately;
  3. Then, check each template from product one-by-one, and remove invalid (overlapping) templates from product (i.e., filtering)
  4. Check remaining product templates, if one digit found in another digit's all templates then perform elimination move

Where as I am sharing my double-digit POM routine logic as follows:
Count valid templates cell positions of a digit having at least one non-overlapping valid template of another digit found.

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

Re: Pattern Overlay Method

Postby P.O. » Sat Mar 29, 2025 8:53 am

hi R.Jamil ,
i do and check the size 2 combinations as you describe
and for combinations (2 4) and (4 9), i find the same eliminations as you
Code: Select all
initialization:
#VT: (5 10 5 6 6 9 34 12 6)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil nil nil (58) nil nil (61) nil nil                -> r7c4<>4   r7c7<>7

2      13     4      378    137    178    5      689    69             
7      5      38     6      9      4      238    28     1               
6      9      138    358    2      158    348    48     7               
8      12467  126    9      1457   1567   27     2567   3               
49     2467   5      3478   347    678    1      26789  269             
3      167    169    578    157    2      789    56789  4               
5      234    239    27     6      79     249    1      8               
49     246    269    1      8      3      2479   2479   5               
1      8      7      245    45     59     6      3      29             
141 candidates.

1: (2 4)   21 instances

#VT: (5 6 5 6 6 9 34 12 6)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil (57 61) nil nil nil nil nil nil nil             -> r7c3<>2   r7c7<>2

2: (4 9)   13 instances

#VT: (5 6 5 5 6 9 34 12 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil nil nil (65) nil nil nil nil nil                -> r8c2<>4

2      13     4      378    137    178    5      689    69             
7      5      38     6      9      4      238    28     1               
6      9      138    358    2      158    348    48     7               
8      12467  126    9      1457   1567   27     2567   3               
49     2467   5      3478   347    678    1      26789  269             
3      167    169    578    157    2      789    56789  4               
5      234    39     27     6      79     49     1      8               
49     26     269    1      8      3      2479   2479   5               
1      8      7      245    45     59     6      3      29             
138 candidates.
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Sat Mar 29, 2025 1:23 pm

Hi P.O.,

I think, now we both understand how we do POM routine search differently.

However, in advanced POMs example puzzle, did you notice that pjb solver reports:
Between them r4c2 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted. As a result, no pattern of 2 includes r7c3, r8c8 so 2 can be deleted from r7c3, r8c8

Where as your reports:
1: (2 4) 21 instances

#VT: (5 6 5 6 6 9 34 12 6)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil (57 61) nil nil nil nil nil nil nil -> r7c3<>2 r7c7<>2

Where as mine reports:
Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c2347 r8c2378 r9c49
and POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
Digit 2 not in 6 Templates => -2 @ r7c3 r7c7

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

Re: Pattern Overlay Method

Postby P.O. » Sat Mar 29, 2025 2:11 pm

hi R.Jamil
the method that pjb describes does not consist of combining the templates, it looks for 2 cells that gather all the templates of a value and then it eliminates for the other values all the templates that have these two cells

here is the complete resolution using POM for this puzzle in pjb solver, his method finds r8c8<>2 in addition to the eliminations that the combinations (2 4) and (4 9) find:
4s at r9c45 only ones in row/column => -4 r7c4.
7s at r8c78 only ones in row/column => -7 r7c7.
Naked quads of 1378 at r1c2456 => -8 r1c8

8s at r1c46 only ones in row/column => -8 r3c46.

Between them r4c2 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted. As a result, no pattern of 2 includes r7c3, r8c8 so 2 can be deleted from r7c3, r8c8

Between them r7c7 and r9c4 include all patterns of 4, so patterns of 2 which include both cells can be deleted. As a result, no pattern of 2 includes r7c7 so 2 can be deleted from r7c7

Between them r5c1 and r7c7 include all patterns of 9, so patterns of 4 which include both cells can be deleted. As a result, no pattern of 4 includes r8c2 so 4 can be deleted from r8c2
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Sat Mar 29, 2025 2:55 pm

Hi P.O.,

here is the complete resolution using POM for this puzzle in pjb solver, his method finds r8c8<>2 in addition to the eliminations that the combinations (2 4) and (4 9) find:

It means that the pjb procedure for POM move differs from both of us. Similarly, all basic moves are mandatory.

R. Jamil
Added as on 20250401: Find below the output of my POM routine for reference please:
Hidden Text: Show
Code: Select all
2.4...5..75.694..169..2...78..9....3..5...1..3....2..45...6..18...183..5187...63.
 +----------------+------------------+------------------+
 | 2   13     4   | 378   137   178  | 5     689    69  |
 | 7   5      38  | 6     9     4    | 238   28     1   |
 | 6   9      138 | 358   2     158  | 348   48     7   |
 +----------------+------------------+------------------+
 | 8   12467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467   5   | 3478  347   678  | 1     26789  269 |
 | 3   167    169 | 578   157   2    | 789   56789  4   |
 +----------------+------------------+------------------+
 | 5   234    239 | 247   6     79   | 2479  1      8   |
 | 49  246    269 | 1     8     3    | 2479  2479   5   |
 | 1   8      7   | 245   45    59   | 6     3      29  |
 +----------------+------------------+------------------+
1) Single-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c247 r8c1278 r9c45
Digit 4 not in 6 Templates => -4 @ r7c4
Single-digit POM: 7 @ r1c456 r2c1 r3c9 r4c25678 r5c24568 r6c24578 r7c467 r8c78 r9c3
Digit 7 not in 34 Templates => -7 @ r7c7
 +----------------+------------------+------------------+
 | 2   13     4   | 378   137   178  | 5     689    69  |
 | 7   5      38  | 6     9     4    | 238   28     1   |
 | 6   9      138 | 358   2     158  | 348   48     7   |
 +----------------+------------------+------------------+
 | 8   12467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467   5   | 3478  347   678  | 1     26789  269 |
 | 3   167    169 | 578   157   2    | 789   56789  4   |
 +----------------+------------------+------------------+
 | 5   234    239 | 27    6     79   | 249   1      8   |
 | 49  246    269 | 1     8     3    | 2479  2479   5   |
 | 1   8      7   | 245   45    59   | 6     3      29  |
 +----------------+------------------+------------------+
2) Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c2347 r8c2378 r9c49
and POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
Digit 2 not in 6 Templates => -2 @ r7c3 r7c7
Double-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
and POM: 9 @ r1c89 r2c5 r3c2 r4c4 r5c189 r6c378 r7c367 r8c1378 r9c69
Digit 4 not in 5 Templates => -4 @ r8c2
 +----------------+------------------+------------------+
 | 2   13     4   | 378   137   178  | 5     689    69  |
 | 7   5      38  | 6     9     4    | 238   28     1   |
 | 6   9      138 | 358   2     158  | 348   48     7   |
 +----------------+------------------+------------------+
 | 8   12467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467   5   | 3478  347   678  | 1     26789  269 |
 | 3   167    169 | 578   157   2    | 789   56789  4   |
 +----------------+------------------+------------------+
 | 5   234    39  | 27    6     79   | 49    1      8   |
 | 49  26     269 | 1     8     3    | 2479  2479   5   |
 | 1   8      7   | 245   45    59   | 6     3      29  |
 +----------------+------------------+------------------+
3) Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c24 r8c2378 r9c49
and POM: 3 @ r1c245 r2c37 r3c347 r4c9 r5c45 r6c1 r7c23 r8c6 r9c8
Digit 2 not in 5 Templates => -2 @ r8c8
 +----------------+------------------+------------------+
 | 2   13     4   | 378   137   178  | 5     689    69  |
 | 7   5      38  | 6     9     4    | 238   28     1   |
 | 6   9      138 | 358   2     158  | 348   48     7   |
 +----------------+------------------+------------------+
 | 8   12467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467   5   | 3478  347   678  | 1     26789  269 |
 | 3   167    169 | 578   157   2    | 789   56789  4   |
 +----------------+------------------+------------------+
 | 5   234    39  | 27    6     79   | 49    1      8   |
 | 49  26     269 | 1     8     3    | 2479  479    5   |
 | 1   8      7   | 245   45    59   | 6     3      29  |
 +----------------+------------------+------------------+
4) Triple-digit POM: 8 @ r1c468 r2c378 r3c34678 r4c1 r5c468 r6c478 r7c9 r8c5 r9c2
and POM: 6 @ r1c89 r2c4 r3c1 r4c2368 r5c2689 r6c238 r7c5 r8c23 r9c7
and POM: 9 @ r1c89 r2c5 r3c2 r4c4 r5c189 r6c378 r7c367 r8c1378 r9c69
Digit 8 not in 10 Templates => -8 @ r1c8 r3c4 r3c6
Triple-digit POM: 9 @ r1c89 r2c5 r3c2 r4c4 r5c189 r6c378 r7c367 r8c1378 r9c69
and POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c24 r8c237 r9c49
and POM: 6 @ r1c89 r2c4 r3c1 r4c2368 r5c2689 r6c238 r7c5 r8c23 r9c7
Digit 9 not in 4 Templates => -9 @ r5c8
 +----------------+------------------+------------------+
 | 2   13     4   | 378   137   178  | 5     69     69  |
 | 7   5      38  | 6     9     4    | 238   28     1   |
 | 6   9      138 | 35    2     15   | 348   48     7   |
 +----------------+------------------+------------------+
 | 8   12467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467   5   | 3478  347   678  | 1     2678   269 |
 | 3   167    169 | 578   157   2    | 789   56789  4   |
 +----------------+------------------+------------------+
 | 5   234    39  | 27    6     79   | 49    1      8   |
 | 49  26     269 | 1     8     3    | 2479  479    5   |
 | 1   8      7   | 245   45    59   | 6     3      29  |
 +----------------+------------------+------------------+
5) Triple-digit POM: 1 @ r1c256 r2c9 r3c36 r4c2356 r5c7 r6c235 r7c8 r8c4 r9c1
and POM: 7 @ r1c456 r2c1 r3c9 r4c25678 r5c24568 r6c24578 r7c46 r8c78 r9c3
and POM: 8 @ r1c46 r2c378 r3c378 r4c1 r5c468 r6c478 r7c9 r8c5 r9c2
Digit 1 not in 3 Templates => -1 @ r1c6 r4c2
 +---------------+------------------+------------------+
 | 2   13    4   | 378   137   78   | 5     69     69  |
 | 7   5     38  | 6     9     4    | 238   28     1   |
 | 6   9     138 | 35    2     15   | 348   48     7   |
 +---------------+------------------+------------------+
 | 8   2467  126 | 9     1457  1567 | 27    2567   3   |
 | 49  2467  5   | 3478  347   678  | 1     2678   269 |
 | 3   167   169 | 578   157   2    | 789   56789  4   |
 +---------------+------------------+------------------+
 | 5   234   39  | 27    6     79   | 49    1      8   |
 | 49  26    269 | 1     8     3    | 2479  479    5   |
 | 1   8     7   | 245   45    59   | 6     3      29  |
 +---------------+------------------+------------------+
No POMs found
rjamil
 
Posts: 837
Joined: 15 October 2014
Location: Karachi, Pakistan

Re: Pattern Overlay Method

Postby P.O. » Wed Apr 02, 2025 5:35 am

after having retrieved the possible templates or after having made the combinations it is possible to test their validity in the context of the current possible templates:
- a possible template for a value is valid if it is compatible with at least one possible template for each of the other values
- an instance of a combination of size n for values V(i) of (1 2 3 4 5 6 7 8 9) is valid if it is compatible with at least one of the possible templates of each of the values (1 2 3 4 5 6 7 8 9) - V(i)
by performing these operations the puzzle is solved with two size 2 combinations:
Hidden Text: Show
Code: Select all
2.4...5..75.694..169..2...78..9....3..5...1..3....2..45...6..18...183..5187...63.
initialization:
#VT: (5 5 5 5 6 9 24 12 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil (57 61 71) nil (58 65) nil nil (61) nil nil

2      13     4      378    137    178    5      689    69             
7      5      38     6      9      4      238    28     1               
6      9      138    358    2      158    348    48     7               
8      12467  126    9      1457   1567   27     2567   3               
49     2467   5      3478   347    678    1      26789  269             
3      167    169    578    157    2      789    56789  4               
5      234    39     27     6      79     49     1      8               
49     26     269    1      8      3      2479   479    5               
1      8      7      245    45     59     6      3      29             
137 candidates.

1: (2 5)   9 instances

#VT: (5 4 5 5 4 6 17 12 4)
Cells: nil (58 81) nil nil nil nil (60) nil (78)
SetVC: ( n2r7c4   n7r7c6   n9r9c6   n2r9c9 )

#VT: (5 4 5 5 4 6 17 12 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates: nil nil nil nil nil (44) nil nil (66)

2: (1 6)   1 instance

#VT: (1 1 1 1 1 1 1 1 1)
Cells: (5 21 33 47) (17 34 38 66) (2 16 22 41 57) (25 32 37 56 71 76) (24 35 49 77)
       (9 30 42 53 65) (4 29 44 50 70) (6 12 26 40 52) (8 45 48 61 64)
SetVC: ( n3r1c2   n7r1c4   n1r1c5   n8r1c6   n9r1c8   n6r1c9   n8r2c3   n3r2c7
         n2r2c8   n1r3c3   n3r3c4   n5r3c6   n4r3c7   n8r3c8   n7r4c2   n6r4c3
         n4r4c5   n1r4c6   n2r4c7   n5r4c8   n4r5c1   n2r5c2   n8r5c4   n3r5c5
         n6r5c6   n7r5c8   n9r5c9   n1r6c2   n9r6c3   n5r6c4   n7r6c5   n8r6c7
         n6r6c8   n4r7c2   n3r7c3   n9r7c7   n9r8c1   n6r8c2   n2r8c3   n7r8c7
         n4r8c8   n4r9c4   n5r9c5 )
2 3 4   7 1 8   5 9 6
7 5 8   6 9 4   3 2 1
6 9 1   3 2 5   4 8 7
8 7 6   9 4 1   2 5 3
4 2 5   8 3 6   1 7 9
3 1 9   5 7 2   8 6 4
5 4 3   2 6 7   9 1 8
9 6 2   1 8 3   7 4 5
1 8 7   4 5 9   6 3 2
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Apr 03, 2025 7:51 am

Hi P.O.,

P.O. wrote:after having retrieved the possible templates or after having made the combinations it is possible to test their validity in the context of the current possible templates:
- a possible template for a value is valid if it is compatible with at least one possible template for each of the other values
- an instance of a combination of size n for values V(i) of (1 2 3 4 5 6 7 8 9) is valid if it is compatible with at least one of the possible templates of each of the values (1 2 3 4 5 6 7 8 9) - V(i)

Well, this is exactly what I understand from step D of Dobrichev logic to implement the multi-digit POM move.

However, I still did not get the same results. After disabling triple-digit POM move, below is the single-digit POM VT count comparision aswhat my program tells:
RJ VT: 5 10 5 6* 6 9 34* 12 6
PO VT: 5 5 5 5 6 9 24 12 5

Where as, in first step, my routine detect single-digit POM move for '*' marks as follows:
Single-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c247 r8c1278 r9c45
Digit 4 not in 6 Templates => -4 @ r7c4
Single-digit POM: 7 @ r1c456 r2c1 r3c9 r4c25678 r5c24568 r6c24578 r7c467 r8c78 r9c3
Digit 7 not in 34 Templates => -7 @ r7c7

In next step, my routine shows double-digit POM move, without further detecting any single-digit POM move:
RJ VT: 5 10 5 6 6 9 34 12 6

Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c2347 r8c2378 r9c49
and POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
Digit 2 not in 6 Templates => -2 @ r7c3 r7c7
Double-digit POM: 4 @ r1c3 r2c6 r3c78 r4c25 r5c1245 r6c9 r7c27 r8c1278 r9c45
and POM: 9 @ r1c89 r2c5 r3c2 r4c4 r5c189 r6c378 r7c367 r8c1378 r9c69
Digit 4 not in 5 Templates => -4 @ r8c2

In third step:
RJ VT: 5 6 5 5 6 9 34 12 6

Double-digit POM: 2 @ r1c1 r2c78 r3c5 r4c2378 r5c289 r6c6 r7c24 r8c2378 r9c49
and POM: 3 @ r1c245 r2c37 r3c347 r4c9 r5c45 r6c1 r7c23 r8c6 r9c8
Digit 2 not in 5 Templates => -2 @ r8c8

In forth step:
RJ VT: 5 5 5 5 6 9 34 12 6
No POM move found.

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

Re: Pattern Overlay Method

Postby P.O. » Thu Apr 03, 2025 9:49 am

i have the same number of VT and the same eliminations as you when i don't check the validity of the templates and combinations, and the size 2 combinations don't solve the puzzle
it's when i eliminate the templates that i find invalid that i reduce the number of VT and solve the puzzle with two size 2 combinations
at initialization:
Code: Select all
(5 10 5 6 6 9 34 12 6)  #VT before checking the templates validity
(5  5 5 5 6 9 24 12 5)  #VT after checking the templates validity

for example here the templates for value 2 before and after:
Code: Select all
#10: ((1 17 23 34 38 51 58 66 81) (1 17 23 30 45 51 61 65 76) (1 17 23 30 45 51 56 70 76)
      (1 17 23 29 45 51 61 66 76) (1 17 23 29 45 51 57 70 76) (1 16 23 35 38 51 58 66 81)
      (1 16 23 30 45 51 56 71 76) (1 16 23 30 44 51 58 65 81) (1 16 23 29 45 51 57 71 76)
      (1 16 23 29 44 51 58 66 81))

#5:  ((1 17 23 34 38 51 58 66 81) (1 17 23 30 45 51 56 70 76) (1 16 23 35 38 51 58 66 81)
      (1 16 23 30 44 51 58 65 81) (1 16 23 29 44 51 58 66 81))

and here the templates eliminated because they are not compatible with at least one of the templates for (1 3 4 5 6 7 8 9)
Code: Select all
((1 17 23 30 45 51 61 65 76) (1 17 23 29 45 51 61 66 76) (1 17 23 29 45 51 57 70 76)
 (1 16 23 30 45 51 56 71 76) (1 16 23 29 45 51 57 71 76))

templates 1 2 3 and 5 are not compatible with any of the templates for 4 and template 4 is not compatible with any of the templates for 3
here the templates for 3:
Code: Select all
((5 16 21 36 40 46 56 69 80) (5 12 25 36 40 46 56 69 80) (4 16 21 36 41 46 56 69 80)
 (4 12 25 36 41 46 56 69 80) (2 16 22 36 41 46 57 69 80))

here the templates for 4:
Code: Select all
((3 15 26 32 38 54 61 64 76) (3 15 26 32 37 54 61 65 76) (3 15 26 32 37 54 56 70 76)
 (3 15 26 29 41 54 61 64 76) (3 15 26 29 40 54 61 64 77) (3 15 25 32 37 54 56 71 76))
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Apr 03, 2025 11:22 am

Hi P.O.,

P.O. wrote:i have the same number of VT and the same eliminations as you when i don't check the validity of the templates and combinations, and the size 2 combinations don't solve the puzzle
it's when i eliminate the templates that i find invalid that i reduce the number of VT and solve the puzzle with two size 2 combinations

I see, you are doing something special to eliminate the single-digit templates that are invalid; and then solve the puzzle with two double-digit combinations. Are you checking digit1 templates with all other digits at once, i.e., digit2 to digit9.

Will you please elaborate. (Will you please share your source code if not copyright to investigate how you do it.)

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

Re: Pattern Overlay Method

Postby P.O. » Thu Apr 03, 2025 1:36 pm

hi R.Jamil
what i do is simple, i have all possible templates for each value in a list
((VT for 1) (VT for 2) (...))
and i loop on this list as long as i find templates to eliminated
and the reason why a template for a value is eliminated is that it is incompatible, i.e. overlaps, with all the templates of another value
i'm programming in Common Lisp, here's the function that checks templates, i have an equivalent one that checks combinations
the list of VT is in the variable *VTleft*
Hidden Text: Show
Code: Select all
(defun CheckVTleft ()
(let (tocheck rang invalids tpoff)
 (loop
  (setf tpoff (make-list 9))
  (tagbody
  (dotimes (n 9)
   (setf tocheck (remove n `(0 1 2 3 4 5 6 7 8)))
   (setf rang -1)
   (dolist (tp1 (nth n *VTleft*))
    (incf rang)
    (dolist (val tocheck)
     (dolist (tp2 (nth val *VTleft*)) (unless (intersection tp1 tp2) (go out)))
     (push rang invalids)
     (go next)
   out )
   next )
   (when invalids
    (setf (nth n tpoff) invalids)
    (dolist (invalid invalids) (setf (nth invalid (nth n *VTleft*)) nil))
    (setf (nth n *VTleft*) (remove nil (nth n *VTleft*)))
    (setf invalids nil)) ))
 (unless (position nil (mapcar 'null tpoff)) (return))) )) 
P.O.
 
Posts: 1885
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Apr 03, 2025 2:34 pm

Hi P.O.,

P.O. wrote:what i do is simple, i have all possible templates for each value in a list
((VT for 1) (VT for 2) (...))
and i loop on this list as long as i find templates to eliminated
and the reason why a template for a value is eliminated is that it is incompatible, i.e. overlaps, with all the templates of another value

Ok. Now I understand what you are doing.

If you are collecting a subset of each digit templates from universal template set first. Then check each digit subset template with other all digit subset templates. If any subset template overlap (incompatible) with one of the other digit all subset templates then eliminate it.

Is it then check single-digit POM elimination/placement move first?

I think, there is no elimination/placement possible for double-digit POM move as all subset combinations contain only valid (possible) templates against each other.

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

PreviousNext

Return to Advanced solving techniques