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: 1860
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: 2690
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: 829
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: 1860
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: 829
Joined: 15 October 2014
Location: Karachi, Pakistan

Previous

Return to Advanced solving techniques