Pattern Overlay Method

Advanced methods and approaches for solving Sudoku puzzles

Re: Pattern Overlay Method

Postby P.O. » Thu Apr 03, 2025 3:39 pm

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.

each time templates are eliminated, i check whether there is placement or elimination of candidates
combinations are made from possible templates, but some of them do not fit into the combinations and are therefore eliminated and as the combinations are checked for validity this results in new template eliminations
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:
(5 10 5 6 6 9 34 12 6)      #VT before checking
(5  5 5 5 6 9 24 12 5)      #VT after checking

#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        eliminations found

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. 34 values.

 2combs done
 (18 11 14 15 21 43 23 14 12 11 11 11 45 18 12 9 19 31 39 17 11 13 24 34 28 11 22 43 23 12 71 46 10 94 43 34)
 number of instances of the 36 size 2 combinations in lexical order (1 2) (1 3) etc.
 they are checked for validity and reduce the number of templates from (5 5 5 5 6 9 24 12 5) to (5 4 5 5 4 8 16 8 4) which are then checked for validity
 
(5 4 5 5 4 8 16 8 4)      #VT before checking
(5 4 5 5 4 6 14 8 3)      #VT after checking

#VT: (5 4 5 5 4 6 14 8 3)
Cells: NIL (58 81) NIL NIL NIL NIL (60) NIL (78)              placements found
SetVC: ( n2r7c4   n7r7c6   n9r9c6   n2r9c9 )

#VT: (5 4 5 5 4 6 14 8 3)
Cells: NIL NIL NIL NIL NIL NIL NIL NIL NIL
Candidates: NIL NIL NIL NIL NIL (44) NIL (8 22 24) (44 66)    eliminations found

2      13     4      378    137    18     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   156    27     2567   3               
49     2467   5      3478   347    68     1      278    69             
3      167    169    578    157    2      789    56789  4               
5      34     39     2      6      7      49     1      8               
49     26     26     1      8      3      479    479    5               
1      8      7      45     45     9      6      3      2               
116 candidates. 38 values.

 2combs done
 36 new sets of size 2 combinations
(16 11 12 8 7 26 13 9 8 10 9 9 31 10 11 8 11 17 20 11 9 8 14 24 17 8 12 25 11 7 45 24 8 32 25 14)
they are checked for validity and reduce the number of templates from (5 4 5 5 4 6 14 8 3) to (3 4 5 5 3 5 13 6 3) which are then checked for validity

(3 4 5 5 3 5 13 6 3)    #VT before checking
(1 1 1 1 1 1 1 1 1)     #VT after checking

#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)       ste.
       (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: 1869
Joined: 07 June 2021

Re: Pattern Overlay Method

Postby rjamil » Thu Apr 03, 2025 6:23 pm

Hi P.O.,

P.O. wrote:each time templates are eliminated, i check whether there is placement or elimination of candidates
combinations are made from possible templates, but some of them do not fit into the combinations and are therefore eliminated and as the combinations are checked for validity this results in new template eliminations

Now, it seems to me that, after filter performed, single-digit POM move should be checked. If no single-digit POM elimination/placement found then there will also be no double-digit POM elimination/placement found.

Now, if I comment about your above mentioned method in database model, it is called many-to-many relationship method, i.e., complexity and redundancy at the cost of time impact. (However, if you achieved positive results with no time barriers then its up to you.)

Where as, I am using normalized one-to-many relationship only without any barriers.

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

Re: Pattern Overlay Method

Postby P.O. » Fri Apr 04, 2025 8:49 am

i have a template procedure that solves puzzles by combining templates only, with no relation to the grid other than initially retrieving the possible templates
combining templates has the effect of eliminating those that are not part of the solution(s), and that alone is enough to solve all puzzles
it should also be noted that it is not necessary to check the validity of templates or combinations, doing so only speeds up the process by eliminating more templates earlier and in the case of a single-solution puzzle may reduce the maximum size of the combinations needed to solve it
here are the three situations with this puzzle
2.4...5..75.694..169..2...78..9....3..5...1..3....2..45...6..18...183..5187...63.
without n4r1c3 it has 13 solutions:
Hidden Text: Show
Code: Select all
2.....5..75.694..169..2...78..9....3..5...1..3....2..45...6..18...183..5187...63.

2      134    1348   378    137    178    5      4689   69             
7      5      38     6      9      4      238    28     1               
6      9      1348   358    2      158    348    48     7               
8      12467  1246   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    2349   247    6      79     2479   1      8               
49     246    2469   1      8      3      2479   2479   5               
1      8      7      245    45     59     6      3      29             
153 candidates. 33 values.

initialization
(7 7 6 13 6 9 31 17 5)

2 combs
(7 6 6 9 6 8 23 14 4)

2 combs
(7 5 6 9 6 8 18 14 4)

2 combs
(7 5 6 9 6 8 18 14 4)

3 combs
(6 5 6 5 4 8 8 9 4)

2 combs
(5 4 6 5 4 7 8 9 4)

2 combs
(5 4 6 5 4 7 8 9 4)

3 combs
(4 4 5 5 4 5 8 7 4)

2 combs
(4 4 5 5 4 5 8 7 4)

3 combs
(4 4 4 5 4 5 8 7 4)

2 combs
(4 4 4 5 4 5 8 7 4)

3 combs
(4 4 4 5 4 5 8 7 4)

4 combs
(4 4 4 5 4 5 8 7 4)

5 combs
(4 4 4 5 4 5 8 7 4)

6 combs
(4 4 4 5 4 5 8 7 4)

7 combs
(4 4 4 5 4 5 8 7 4)

8 combs
(4 4 4 5 4 5 8 7 4)

9 combs
(4 4 4 5 4 5 8 7 4)

(2 2 2 3 2 2 3 2 3 2 3 4 5 6 7 8 9)
puzzle in 9-template
13 solutions
248731569753694821691825347874916253925348176316572984539267418462183795187459632
248371569753694821691825347874916253925438176316752984539267418462183795187549632
243871569758694321691325847874916253925438176316752984539267418462183795187549632
248731569753694281691825347824916753975348126316572894539267418462183975187459632
248371569753694281691825347824916753975438126316752894539267418462183975187549632
248731569753694821691825347814976253925348176376512984539267418462183795187459632
248731596753694281691825347812946753465378129379512864534267918926183475187459632
248371596753694281691825347812946753465738129379512864534267918926183475187459632
248371596753694281691528347812945763475836129369712854534267918926183475187459632
243718596758694321691325487876941253425836179319572864534267918962183745187459632
234718596758694321691325487876941253425836179319572864543267918962183745187459632
248317596753694821691528347824951763975436182316872954532769418469183275187245639
241378596753694281698521347812945763475836129369712854534267918926183475187459632

without verification it requires size 4 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.

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             
143 candidates. 34 values.

initialization
(5 10 5 6 6 9 34 12 6)

2 combs
(5 5 5 5 6 9 34 12 5)

2 combs
(5 5 5 5 6 9 24 12 5)

2 combs
(5 5 5 5 6 9 24 12 5)

3 combs
(5 5 5 5 6 8 21 10 4)

2 combs
(5 5 5 5 6 8 21 10 4)

3 combs
(5 5 5 5 6 8 19 10 4)

2 combs
(5 5 5 5 6 8 19 10 4)

3 combs
(5 5 5 5 6 8 19 10 4)

4 combs
(5 4 4 5 4 7 14 7 4)

2 combs
(5 4 4 5 4 7 12 7 3)

2 combs
(5 4 4 5 4 6 12 7 3)

2 combs
(5 4 4 5 4 6 12 7 3)

3 combs
(5 4 4 5 4 6 12 7 3)

4 combs
(3 3 3 5 3 6 8 6 3)

2 combs
(3 3 3 5 3 6 8 4 3)

2 combs
(3 3 1 5 3 6 8 4 3)

2 combs
(3 1 1 4 2 6 5 4 1)

2 combs
(3 1 1 2 2 1 3 4 1)

2 combs
(1 1 1 2 1 1 3 2 1)

2 combs
(1 1 1 2 1 1 1 1 1)

2 combs
(1 1 1 1 1 1 1 1 1)

(2 2 2 3 2 3 2 3 4 2 2 2 3 4 2 2 2 2 2 2 2)
puzzle in 4-template
1 solution
234718596758694321691325487876941253425836179319572864543267918962183745187459632

with verification size 2 combinations are sufficient:
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             
143 candidates. 34 values.

initialization
(5 5 5 5 6 9 24 12 5)

2 combs
(5 4 5 5 4 6 14 8 3)

2 combs
(1 1 1 1 1 1 1 1 1)

(2 2)
puzzle in 2-template
1 solution
234718596758694321691325487876941253425836179319572864543267918962183745187459632
P.O.
 
Posts: 1869
Joined: 07 June 2021

Previous

Return to Advanced solving techniques