Templates as patterns

Advanced methods and approaches for solving Sudoku puzzles

Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 3:58 am

.
TEMPLATES AS PATTERNS

The purpose of this thread is to consider the old templates technique as being a pattern-based one, where the patterns are templates[n].
Seeing templates as patterns has a clear practical advantage: once the abstract patterns are written, SudoRules and the CLIPS inference engine can automatically do all the associated pattern-matching work. It will also lead to intrinsic definitions (independent of any implementation, provided that it is correct).

Templates are an old solving technique, generally associated with T&E, DFS and other techniques considered as last resort ones (i.e. to be used only when nothing else works).
In my view, T&E (with my precise definition of it) can still be a last resort technique, but it is mainly a general (and universal) very broad classification tool (T&E-depth). But that's an aside that doesn't change the above remark.

A (negative) main difference of templates with T&E or DFS is, it is not generic: it depends in an essential way on application-specific structures, the templates.

But a generally overlooked difference is, templates can be defined in pure pattern-based (though application-specific) terms. It is the purpose of this thread to elaborate on this view.
As a result, templates could be understood as being in the same category as e.g. Subsets. But there's a major difference that blocks such a view. In order to apply the template patterns, one must not know only one of their instantiations (as is the case for Subsets), but all of them at once. This makes the technique too complex and therefore useless for a manual solver for most of the puzzles.

Like "whips" or "braids", "templates" is a general term that doesn't refer to any pattern. In reality, template patterns will only appear as template[1], template[2], template[3]... And, contrary to chain patterns, for reasons that will appear later, I won't speak of the length of a template but of its depth (or combinatorial depth).
Two main questions are therefore:
- is this template-depth intrinsic (independent of any particular implementation)? YES
- is it related to other useful classifications? It remains to be seen.


There's nothing really new about the definition below, except maybe its explicit formulation in terms of first order variables.
(Question marks indicate variables, by opposition to fixed, possibly arbitrary, values.)

Definition 1: the template[1] pattern is defined by:
- a digit ?nb
- a set of 9 rc-cells (?ri, ?ci), i=1...9 such that:
for any pair i≠j , (?ri, ?ci) and (?rj, ?cj) are not in the same row, not in the same column and not in the same block.
(Note: this can easily be transformed into a formula in the first order Sudoku language defined in [HLS], [CRT] or [PBCS], i.e. into a precise pattern according to my definitions there.
It can therefore straightforwardly be coded in SudoRules.)

By ordering the rows from 1 to 9 (i.e. setting ri=i), it is trivial to see that this is equivalent to:

Definition 1bis: the template[1] pattern is defined by:
- a digit ?nb
- a sequence of 9 columns ?ci, i=1...9 such that:
for any pair i≠j , the cells (i, ?ci) and (j, ?cj) are not in the same column and not in the same block.
As this is much simpler, I'll always use this definition.
(Note: this also can easily be transformed into a formula in the first order Sudoku language.
It can therefore straightforwardly be coded in SudoRules. Indeed, it is coded this way.)


Definition: instantiation (or occurrence) of the template[1] pattern
Given a puzzle and a resolution state RS for it, an occurrence of the template[1] pattern in RS is defined by:
- a fixed digit n,
- a fixed sequence of columns c1...c9,
such that:
- they satisfy the conditions of the template[1] pattern and
- in each of the (i, ci) rc-cell, the digit n is still a possible candidate (possibly a decided value).


Said otherwise, an instantiation is any full assignment of 9 compatible places in the grid for digit n.
The conditions of the template[1] pattern guarantee that each of its instantiations is a priori possible in any puzzle - until it appears to somehow contradict the givens.
It is easy to compute that, in an empty grid, there are 46,656 instantiations of the template[1] pattern, for each digit. In practice, in a real puzzle there may be much fewer; but the real number is highly variable from one puzzle to the other.

Remark: one might ask about a super-symmetric version of the template[1] pattern. Would it not be for the block constraint, the rn or cn version would respectively be the assignment of a full column or a full row. But:
- there are many more possible assignments for a single row or column in an empty grid, namely 9! = 362,880;
- due to the block constraint, a single row provides much less information than a template[1] instantiation;
- whenit comes to combine templates, it would be much more complicated (though feasible).



Extended resolution rules based on template[1]
There are two extended resolution rules based on template[1] (the following is just a reformulation of rules that have been known for years):
- rule T1-assert: if a fixed candidate C=(n r c) belongs to all the instantiations of the template[1] pattern with digit n, then assert C as True;
- rule T1-delete: if a fixed candidate C=(n r c) belongs to none of the instantiations of the template[1] pattern with digit n, then delete C.

Their proofs are obvious.
They are not resolution rules in the strict sense I've given this expression, i.e. "pattern instantiation => assertion or elimination of a candidate".
Two obvious problems with needing all the instantiations at once instead of only one at a time for any rule application are:
- complexity is a priori higher than for usual resolution rules;
- it's impossible in practice to print all the instantiations used for the conclusion. In the following examples, I'll give only the general information used for each rule application.


The T1 extended resolution theory
Define T1 as the union of:
- BRT (the universal Basic Resolution Theory, i.e. Singles, Elementary Constraints Propagation, Solution Detection, Contradiction Detection - as defined in [HLS], [CRT], or [PBCS]),
- T1-assert
- T1-delete.

Theorem: T1 is stable under confluence and it has the confluence property.
If a candidate C1 is asserted or deleted for any reason, any other candidate C that could have been asserted or eliminated by T1 can still be. The reason is, the change in C1 can only leads to the deletion of instantiations for templates[1]. But rules T1-assert and T1-delete remain obviously applicable to the same candidates after such instantiations disappear.


References
Myth Jellies 2006: http://forum.enjoysudoku.com/converting-from-candidate-space-to-pom-space-and-beyond-t4398.html
pjb 2012: http://forum.enjoysudoku.com/new-solving-technique-i-think-t30444.html
Myth Jellies 2016: http://forum.enjoysudoku.com/basics-of-pom-pattern-overlay-method-t33451.html
(anonymous, undated): https://sudopedia.org/wiki/Pattern_Overlay_Method
(anonymous, undated): https://www.sudokuwiki.org/Pattern_Overlay
P.O. 2022: http://forum.enjoysudoku.com/pattern-overlay-method-t40180.html

[Edit: added colour to rules T1-assert and T1-delete]
[Edit: added reference]
.
Last edited by denis_berthier on Sat Oct 19, 2024 5:26 am, edited 2 times in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:01 am

.
FIRST EXAMPLE

The first questions that come to mind about templates are:
- how powerful T1 is ;
- and how it is related to familiar resolution theories.
We'll see this later, but let's first give an example.

It is almost obvious that any puzzle solvable in W1 is solvable in T1 (easy exercise for the reader).
But the converse is not true. Here's an easy example, for a puzzle (#48 in the cbg-000 collection) in W2:

Code: Select all
     +-------+-------+-------+
     ! . 2 . ! . . . ! 7 8 . !
     ! . . 6 ! . 8 9 ! . . 3 !
     ! . . . ! 1 2 . ! . 6 . !
     +-------+-------+-------+
     ! 2 . . ! . . . ! . . 1 !
     ! . . . ! . . . ! 2 4 . !
     ! 8 . 1 ! 2 9 . ! . . . !
     +-------+-------+-------+
     ! . 6 . ! . . . ! . . 4 !
     ! 5 4 . ! . 6 . ! . . . !
     ! . . 8 ! 3 . . ! . . . !
     +-------+-------+-------+
.2....78...6.89..3...12..6.2.......1......24.8.129.....6......454..6......83..... 278879

Code: Select all
Resolution state after Singles:
   +-------------------+-------------------+-------------------+
   ! 1     2     359   ! 4     35    6     ! 7     8     59    !
   ! 4     57    6     ! 57    8     9     ! 1     2     3     !
   ! 379   8     3579  ! 1     2     357   ! 4     6     59    !
   +-------------------+-------------------+-------------------+
   ! 2     3579  4     ! 6     357   3578  ! 3589  3579  1     !
   ! 6     3579  3579  ! 578   1357  13578 ! 2     4     5789  !
   ! 8     357   1     ! 2     9     4     ! 356   357   567   !
   +-------------------+-------------------+-------------------+
   ! 379   6     2379  ! 5789  157   12578 ! 3589  13579 4     !
   ! 5     4     2379  ! 789   6     1278  ! 389   1379  2789  !
   ! 79    1     8     ! 3     4     257   ! 569   579   25679 !
   +-------------------+-------------------+-------------------+
144 candidates

entering level T1_with_<Fact-3695>
candidate common to all the templates[1] for digit 9 ==> r5c2=9
candidate in no template[1] for digit 3 ==> r4c6≠3
candidate in no template[1] for digit 3 ==> r4c5≠3
candidate in no template[1] for digit 9 ==> r9c9≠9
candidate in no template[1] for digit 5 ==> r9c9≠5
candidate in no template[1] for digit 9 ==> r8c9≠9
candidate in no template[1] for digit 8 ==> r8c6≠8
candidate in no template[1] for digit 5 ==> r6c9≠5
candidate in no template[1] for digit 5 ==> r5c9≠5
candidate in no template[1] for digit 7 ==> r5c4≠7
candidate in no template[1] for digit 5 ==> r5c4≠5
stte

Now, one can also combine T1 with W1, in order to better show what T1 solves that is not already solved in W1 alone.
The good starting point is now the
Code: Select all
Resolution state after Singles and whips[1]:
   +-------------------+-------------------+-------------------+
   ! 1     2     359   ! 4     35    6     ! 7     8     59    !
   ! 4     57    6     ! 57    8     9     ! 1     2     3     !
   ! 379   8     3579  ! 1     2     357   ! 4     6     59    !
   +-------------------+-------------------+-------------------+
   ! 2     357   4     ! 6     57    578   ! 3589  3579  1     !
   ! 6     9     57    ! 578   1357  13578 ! 2     4     78    !
   ! 8     357   1     ! 2     9     4     ! 356   357   67    !
   +-------------------+-------------------+-------------------+
   ! 379   6     2379  ! 5789  157   12578 ! 3589  13579 4     !
   ! 5     4     2379  ! 789   6     1278  ! 389   1379  278   !
   ! 79    1     8     ! 3     4     257   ! 569   579   267   !
   +-------------------+-------------------+-------------------+
129 candidates.


entering level T1_with_<Fact-6690>
candidate in no template[1] for digit 8 ==> r8c6≠8
candidate in no template[1] for digit 7 ==> r5c4≠7
candidate in no template[1] for digit 5 ==> r5c4≠5
stte

Note the solution in W2:
hidden-pairs-in-a-row: r5{n1 n3}{c5 c6} ==> r5c6≠8, r5c6≠7, r5c6≠5, r5c5≠7, r5c5≠5
biv-chain[2]: r2n5{c2 c4} - r5n5{c4 c3} ==> r1c3≠5, r3c3≠5, r4c2≠5, r6c2≠5
stte
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:11 am

.
TEMPLATE[n], n>1
As far as now, I guess there's nothing fundamentally new in terms of results reachable by T1 and there's no divergence with results of other implementations.

What comes now leads to different classifications as those previously reported and it must therefore have some different underlying principle. But what appears in the references about templates for several digits is utterly unclear.


Definition: two template[1] patterns for different digits ?n1 and ?n2 are said compatible if their respective sets or sequences of rc-cells don't overlap.
If you call these sets ci, i=1...9, and c'i, i=1..9, this means ci≠c'i for all i.


Definition: the template[2] pattern is defined by:
- two different digits ?n1 and ?n2
- two compatible templates[1], respectively for ?n1 and ?n2.

(Note: these two definitions can easily be transformed into formulae in the first order Sudoku language defined in [HLS], [CRT] or [PBCS], thus making the template[2] a precise pattern according to my definitions.
It can therefore straightforwardly be coded in SudoRules.)

The definition for the instantiations of the template[1] pattern can easily be extended to the template[2] pattern.


Extended resolution rules based on templates[2]
In my approach of templates, templates[2] can be used in one and only one way - without any further restrictions:
- rule T2-delete: Given an instantiation I of a template[1] for number n1, if there's a number n2≠n1 such that I is not compatible with any instantiation of a template[1] for number n2, then the instantiation I must be deleted.


Define the extended resolution theory T2 as the union of:
- T1
- T2-delete.

Theorem: T2 is stable under confluence and it has the confluence property.
(note that the meanings of "stable under confluence" and "confluence property" must be extended to template patterns, but this is trivial and the proof is trivial also.)


The template[k] pattern and the Tk extended resolution theory
Definition: the template[k] pattern is defined by:
- k different digits ?n1, ... and ?nk
- k compatible templates[1], respectively for ?n1, ... and ?nk.
(compatible means: for i=1...9, the k cells (i, ci1)...(i, cis) are different; said otherwise, the k sets of rc-cells don't overlap.)

In my approach of templates, templates[k] can be used in one and only one way - without any further restrictions:
- rule Tk-delete: Given an instantiation I of a template[k-1] for numbers n1... nk-1, if there's a number nk≠n1,...nk-1 such that no instantiation of the template[1] for number nk is compatible with I, then the instantiation I of the template[k-1] must be deleted.


Define recursively the extended resolution theory Tk as the union of:
- Tk-1
- Tk-delete.

Theorem: Tk is stable under confluence and it has the confluence property.

As a result, any global strategy can be imposed on Tk, such as the following priorities used in SudoRules:
BRT > T1 > T2 > T3 > T4.....
This means e.g. that:
- if a Single becomes available before all the rules of level Ti have been applied, it is applied;
- if a Ti rule becomes available before all the rules of level Ti+1 have been applied, it is applied.

This also implies that any Tn can be combined with any resolution theory with the confluence property and confluence remains valid, as shown in [CRT] or [PBCS]. In this case, the priorities are:
All the classical resolution rules, with their own relative priorities > T1 > T2 > T3 > T4.....


The template-depth of a puzzle
is defined in my usual way: it is the smallest k such that the puzzle is solved by Tk.

Considering the generalised confluence property of the Tk theories, this definition is intrinsic.


Now, this is where discrepancies appear with other reported classifications based on templates. See the next post.


[Edit: added colour to rule T2-delete]
[Edit: added colour to rule Tk-delete]

.
Last edited by denis_berthier on Fri Oct 18, 2024 8:36 am, edited 2 times in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:11 am

.
I don't know if there are any discrepancies here, but starting with the controlled-bias collection seemed to be a good starting point.
I used only the small cbg-000 part of 21,375 puzzles. Result: all the puzzles in it are at template-depth ≤ 3.

One more result is, the non0-correlation between the W (or B) rating and the template-depth is 0.72, i.e. not useful for any practical purposes.
("non0" means the trivial puzzles in W0=BRT are not taken into account: they don't use templates.)


More surprisingly, I also tried mith's collection of puzzles in T&E(3): the first few thousands are at template-depth ≤ 3.


[Edit: added the correlation results]
.
Last edited by denis_berthier on Fri Oct 18, 2024 4:52 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:30 am

.
This is were I first found discrepancies with published results: http://forum.enjoysudoku.com/pattern-overlay-method-t40180-3.html
All the puzzles reported there as "6-template" to "4-template" appear to be at template-depth 4
Below, I keep the original k-template classification and I give the puzzle, original comments if any, the template depth Tk (all T4), the number of facts, which is approximately the number of template instantiations ever considered, and finally the SudoRules computation time.

"6-templates"
Code: Select all
........7.2.4...6.1.....5...9...2.4....8..6..6..9.......5..3....3..8..2.7....4..1 tungsten rod
T4
nb-facts = <Fact-5415175>
init-time = 0.09s, solve-time = 4m 49.2s, total-time = 4m 49.29s

.......12........3..23..4....18....5.6..7.8.......9.....85.....9...4.5..47...6... platinum blonde
T4
nb-facts = <Fact-5790191>
init-time = 0.09s, solve-time = 4m 53.15s, total-time = 4m 53.24s

..3......4...8..36..8...1...4..6..73...9..........2..5..4.7..686........7..6..5.. eleven 6539 second strategy
this puzzle is also the first of the following list, those of the list that i tested need 6 templates and their breaking point is the combination (1 2 5 6 7 9) after which the number of templates collapses.
http://forum.enjoysudoku.com/post206442.html#p206442
T4
nb-facts = <Fact-21476464>
init-time = 0.09s, solve-time = 2h 40m 54.83s, total-time = 2h 40m 54.92s

1...5......7..9.3...9..754...4..3.7..6........9.8........79..2......24.3..2...... eleven 2548 second strategy
T4
nb-facts = <Fact-11845018>
init-time = 0.09s, solve-time = 41m 11.85s, total-time = 41m 11.94s

1..4....9.56..9.......1..6..6....8..5....4.9.9....5.1..7....2..6....1.5....3..... eleven 25832 second strategy
T4
nb-facts = <Fact-10046247>
init-time = 0.09s, solve-time = 21m 45.06s, total-time = 21m 45.14s



"5-templates"
Code: Select all
.......39.....1..5..3.5.8....8.9...6.7...2...1..4.......9.8..5..2....6..4..7..... golden nugget
T4
nb-facts = <Fact-4251319>
init-time = 0.08s, solve-time = 5m 11.62s, total-time = 5m 11.7s

12.3.....4.....3....3.5......42..5......8...9.6...5.7...15..2......9..6......7..8 Kolk
T4
nb-facts = <Fact-2912787>
init-time = 0.09s, solve-time = 2m 16.23s, total-time = 2m 16.32s

..3..6.8....1..2......7...4..9..8.6..3..4...1.7.2.....3....5.....5...6..98.....5. imam bayildi
T4
nb-facts = <Fact-3038329>
init-time = 0.09s, solve-time = 2m 21.54s, total-time = 2m 21.63s

1.......9..67...2..8....4......75.3...5..2....6.3......9....8..6...4...1..25...6. eleven 5
T4
nb-facts = <Fact-2818847>
init-time = 0.09s, solve-time = 2m 3.81s, total-time = 2m 3.9s

12.4..3..3...1..5...6...1..7...9.....4.6.3.....3..2...5...8.7....7.....5.......98 discrepancy
T4
nb-facts = <Fact-4691739>
init-time = 0.09s, solve-time = 5m 12.11s, total-time = 5m 12.2s

12.3.....34....1....5......6.24..5......6..7......8..6..42..3......7...9.....9.8. cigarette
T4
nb-facts = <Fact-3426125>
init-time = 0.09s, solve-time = 3m 1.03s, total-time = 3m 1.13s

.2..5.7..4..1....68....3...2....8..3.4..2.5.....6...1...2.9.....9......57.4...9.. cheese
T4
nb-facts = <Fact-2586816>
init-time = 0.09s, solve-time = 1m 33.97s, total-time = 1m 34.07s

........3..1..56...9..4..7......9.5.7.......8.5.4.2....8..2..9...35..1..6........ fata morgana
T4
nb-facts = <Fact-5947329>
init-time = 0.09s, solve-time = 8m 36.59s, total-time = 8m 36.68s




"4-templates"
Code: Select all
12.3.....4.5...6...7.....2.6..1..3....453.........8..9...45.1.........8......2..7 patience
T4
nb-facts = <Fact-2628868>
init-time = 0.09s, solve-time = 1m 17.19s, total-time = 1m 17.28s

12.3....435....1....4........54..2..6...7.........8.9...31..5.......9.7.....6...8 red dwarf 
T4
nb-facts = <Fact-2126145>
init-time = 0.06s, solve-time = 1m 1.61s, total-time = 1m 1.67s


[Edit 2024 Nov 2]:Following the discovery of missing eliminations in T3, all the above puzzles are now found in T3.
.
Last edited by denis_berthier on Sat Nov 02, 2024 7:18 am, edited 2 times in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:48 am

.
Example of a puzzle at template-depth >1: Easter Monster, at template-depth 4:

I keep the information about the number of facts at the entry of each template level, to give an idea how the number of template[k] instantiations increases with k. It's approximately: number on entering level k+1 - number on entering level k. For the final level k (=4 here), take the final <nb-facts> as the number on entering level k+1.

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

Code: Select all
Resolution state after Singles:
   +----------------------+----------------------+----------------------+
   ! 1      478    34578  ! 3567   3689   5678   ! 3489   369    2      !
   ! 238    9      378    ! 4      12368  12678  ! 138    5      368    !
   ! 23458  248    6      ! 1235   12389  1258   ! 7      139    3489   !
   +----------------------+----------------------+----------------------+
   ! 2468   5      1478   ! 9      1246   3      ! 128    1267   678    !
   ! 234689 12468  13489  ! 126    7      1246   ! 123589 12369  35689  !
   ! 2369   1267   1379   ! 8      5      126    ! 1239   4      3679   !
   +----------------------+----------------------+----------------------+
   ! 7      148    14589  ! 1235   12348  12458  ! 6      239    3459   !
   ! 456    3      145    ! 12567  1246   9      ! 245    8      457    !
   ! 45689  468    2      ! 3567   3468   45678  ! 3459   379    1      !
   +----------------------+----------------------+----------------------+
239 candidates


entering level T1_with_<Fact-3693>
entering level T2_with_<Fact-4169>
entering level T3 with <Fact-49241>
candidate in no template[1] for digit 2 ==> r5c6≠2
candidate in no template[1] for digit 6 ==> r5c9≠6
candidate in no template[1] for digit 7 ==> r1c3≠7
candidate in no template[1] for digit 1 ==> r5c6≠1
entering level T4 with <Fact-941608>
candidate in no template[1] for digit 6 ==> r9c5≠6
candidate in no template[1] for digit 6 ==> r5c1≠6
candidate in no template[1] for digit 6 ==> r9c1≠6
candidate in no template[1] for digit 8 ==> r2c6≠8
candidate in no template[1] for digit 3 ==> r1c8≠3
candidate in no template[1] for digit 2 ==> r7c5≠2
candidate in no template[1] for digit 8 ==> r5c2≠8
candidate in no template[1] for digit 1 ==> r5c3≠1
candidate in no template[1] for digit 5 ==> r8c4≠5
candidate in no template[1] for digit 8 ==> r1c3≠8
candidate in no template[1] for digit 6 ==> r1c4≠6
candidate in no template[1] for digit 2 ==> r5c7≠2
candidate in no template[1] for digit 3 ==> r3c9≠3
candidate in no template[1] for digit 4 ==> r5c2≠4
candidate in no template[1] for digit 3 ==> r9c4≠3
candidate in no template[1] for digit 1 ==> r3c5≠1
candidate in no template[1] for digit 4 ==> r9c1≠4
candidate in no template[1] for digit 4 ==> r5c3≠4
candidate in no template[1] for digit 2 ==> r5c1≠2
candidate in no template[1] for digit 2 ==> r6c1≠2
candidate in no template[1] for digit 4 ==> r7c3≠4
candidate in no template[1] for digit 9 ==> r7c8≠9
candidate in no template[1] for digit 2 ==> r4c8≠2
candidate in no template[1] for digit 8 ==> r3c1≠8
candidate in no template[1] for digit 1 ==> r6c3≠1
candidate in no template[1] for digit 1 ==> r3c6≠1
candidate in no template[1] for digit 6 ==> r6c6≠6
candidate in no template[1] for digit 6 ==> r5c2≠6
candidate in no template[1] for digit 4 ==> r8c5≠4
candidate in no template[1] for digit 8 ==> r1c6≠8
candidate in no template[1] for digit 3 ==> r1c7≠3
candidate in no template[1] for digit 9 ==> r6c3≠9
candidate in no template[1] for digit 9 ==> r5c7≠9
candidate in no template[1] for digit 8 ==> r9c2≠8
candidate in no template[1] for digit 8 ==> r7c5≠8
candidate in no template[1] for digit 6 ==> r9c4≠6
candidate in no template[1] for digit 6 ==> r5c6≠6
naked-single ==> r5c6=4
candidate in no template[1] for digit 6 ==> r1c5≠6
candidate in no template[1] for digit 1 ==> r7c3≠1
candidate in no template[1] for digit 2 ==> r7c4≠2
candidate in no template[1] for digit 3 ==> r3c4≠3
candidate in no template[1] for digit 7 ==> r9c6≠7
candidate in no template[1] for digit 7 ==> r1c4≠7
candidate in no template[1] for digit 8 ==> r3c5≠8
candidate in no template[1] for digit 8 ==> r1c2≠8
candidate in no template[1] for digit 9 ==> r5c8≠9
candidate in no template[1] for digit 9 ==> r3c9≠9
candidate in no template[1] for digit 2 ==> r4c1≠2
candidate in no template[1] for digit 2 ==> r3c2≠2
candidate in no template[1] for digit 2 ==> r2c6≠2
candidate in no template[1] for digit 1 ==> r6c7≠1
candidate in no template[1] for digit 1 ==> r5c4≠1
candidate in no template[1] for digit 1 ==> r2c6≠1
candidate in no template[1] for digit 8 ==> r2c7≠8
candidate in no template[1] for digit 8 ==> r9c5≠8
candidate in no template[1] for digit 8 ==> r5c9≠8
candidate in no template[1] for digit 8 ==> r4c3≠8
candidate in no template[1] for digit 8 ==> r3c6≠8
candidate in no template[1] for digit 8 ==> r2c1≠8
candidate in no template[1] for digit 6 ==> r6c9≠6
candidate in no template[1] for digit 6 ==> r4c1≠6
candidate in no template[1] for digit 6 ==> r2c6≠6
naked-single ==> r2c6=7
hidden-single-in-a-row ==> r1c2=7
candidate in no template[1] for digit 4 ==> r9c7≠4
candidate in no template[1] for digit 4 ==> r8c3≠4
candidate in no template[1] for digit 3 ==> r5c8≠3
candidate in no template[1] for digit 1 ==> r8c4≠1
candidate in no template[1] for digit 1 ==> r5c7≠1
candidate common to all the templates[1] for digit 2 ==> r2c1=2
candidate in no template[1] for digit 3 ==> r6c7≠3
candidate in no template[1] for digit 3 ==> r5c3≠3
candidate common to all the templates[1] for digit 8 ==> r3c2=8
stte

nb-facts = <Fact-2426045>
init-time = 0.09s, solve-time = 1m 14.43s, total-time = 1m 14.51s

[Edit 2024 Nov 2]:Following the discovery of missing eliminations in T3, this puzzle is now found in T3. I keep the above resolution path so that comparisons of resolution times can be made.
entering level T1 with <Fact-3693>
entering level T2 with <Fact-4169>
entering level T3 with <Fact-49241>
candidate in no template[1] for digit 6 ==> r5c9≠6
candidate in no template[1] for digit 9 ==> r5c8≠9
candidate in no template[1] for digit 8 ==> r1c3≠8
candidate in no template[1] for digit 1 ==> r7c5≠1
candidate in no template[1] for digit 7 ==> r1c3≠7
candidate in no template[1] for digit 8 ==> r2c6≠8
candidate in no template[1] for digit 8 ==> r2c5≠8
candidate in no template[1] for digit 6 ==> r5c1≠6
candidate in no template[1] for digit 1 ==> r5c6≠1
candidate in no template[1] for digit 3 ==> r3c9≠3
candidate in no template[1] for digit 3 ==> r7c8≠3
candidate in no template[1] for digit 2 ==> r5c6≠2
candidate in no template[1] for digit 6 ==> r1c5≠6
candidate in no template[1] for digit 2 ==> r5c7≠2
candidate in no template[1] for digit 5 ==> r8c4≠5
candidate in no template[1] for digit 4 ==> r8c5≠4
candidate in no template[1] for digit 4 ==> r5c2≠4
candidate in no template[1] for digit 8 ==> r7c2≠8
candidate in no template[1] for digit 8 ==> r5c2≠8
candidate in no template[1] for digit 3 ==> r1c7≠3
candidate in no template[1] for digit 2 ==> r7c5≠2
candidate in no template[1] for digit 2 ==> r7c4≠2
candidate in no template[1] for digit 2 ==> r5c1≠2
candidate in no template[1] for digit 8 ==> r1c2≠8
candidate in no template[1] for digit 6 ==> r6c1≠6
candidate in no template[1] for digit 3 ==> r9c7≠3
candidate in no template[1] for digit 7 ==> r6c9≠7
candidate in no template[1] for digit 7 ==> r4c3≠7
candidate in no template[1] for digit 1 ==> r7c4≠1
candidate in no template[1] for digit 8 ==> r4c1≠8
candidate in no template[1] for digit 8 ==> r2c3≠8
candidate in no template[1] for digit 4 ==> r9c6≠4
candidate in no template[1] for digit 4 ==> r5c3≠4
candidate in no template[1] for digit 6 ==> r9c5≠6
candidate in no template[1] for digit 6 ==> r5c6≠6
naked-single ==> r5c6=4
candidate in no template[1] for digit 6 ==> r4c8≠6
candidate in no template[1] for digit 4 ==> r9c7≠4
candidate in no template[1] for digit 4 ==> r8c3≠4
candidate in no template[1] for digit 2 ==> r5c8≠2
candidate in no template[1] for digit 8 ==> r9c6≠8
candidate in no template[1] for digit 8 ==> r2c7≠8
candidate in no template[1] for digit 7 ==> r1c6≠7
candidate in no template[1] for digit 1 ==> r5c7≠1
candidate in no template[1] for digit 8 ==> r9c5≠8
candidate in no template[1] for digit 8 ==> r7c3≠8
candidate in no template[1] for digit 8 ==> r5c1≠8
candidate in no template[1] for digit 4 ==> r9c1≠4
candidate in no template[1] for digit 6 ==> r9c2≠6
candidate in no template[1] for digit 6 ==> r8c5≠6
candidate in no template[1] for digit 6 ==> r4c1≠6
candidate in no template[1] for digit 2 ==> r2c5≠2
candidate common to all the templates[1] for digit 6 ==> r8c1=6
candidate in no template[1] for digit 4 ==> r7c9≠4
candidate in no template[1] for digit 5 ==> r3c6≠5
candidate common to all the templates[1] for digit 2 ==> r7c8=2
candidate in no template[1] for digit 9 ==> r3c9≠9
candidate in no template[1] for digit 2 ==> r3c5≠2
candidate in no template[1] for digit 1 ==> r7c3≠1
candidate in no template[1] for digit 1 ==> r5c2≠1
candidate common to all the templates[1] for digit 1 ==> r7c2=1
naked-single ==> r8c3=5
naked-single ==> r8c7=4
naked-single ==> r8c9=7
hidden-single-in-a-block ==> r4c8=7
hidden-single-in-a-block ==> r3c9=4
hidden-single-in-a-column ==> r4c1=4
hidden-single-in-a-block ==> r3c1=5
candidate in no template[1] for digit 3 ==> r6c3≠3
candidate in no template[1] for digit 3 ==> r2c5≠3
candidate in no template[1] for digit 3 ==> r1c8≠3
candidate in no template[1] for digit 8 ==> r5c7≠8
candidate in no template[1] for digit 1 ==> r2c5≠1
naked-single ==> r2c5=6
hidden-single-in-a-row ==> r1c8=6
hidden-single-in-a-row ==> r4c9=6
candidate in no template[1] for digit 8 ==> r3c6≠8
candidate in no template[1] for digit 9 ==> r6c3≠9
candidate in no template[1] for digit 9 ==> r5c7≠9
candidate in no template[1] for digit 3 ==> r5c9≠3
candidate in no template[1] for digit 2 ==> r6c2≠2
candidate in no template[1] for digit 2 ==> r6c6≠2
candidate in no template[1] for digit 2 ==> r3c4≠2
candidate in no template[1] for digit 1 ==> r6c7≠1
candidate in no template[1] for digit 1 ==> r5c3≠1
candidate in no template[1] for digit 3 ==> r6c7≠3
candidate in no template[1] for digit 3 ==> r5c3≠3
candidate in no template[1] for digit 3 ==> r2c1≠3
candidate in no template[1] for digit 3 ==> r1c5≠3
candidate in no template[1] for digit 5 ==> r7c6≠5
naked-single ==> r7c6=8
naked-single ==> r1c6=5
candidate in no template[1] for digit 9 ==> r6c1≠9
candidate in no template[1] for digit 9 ==> r5c9≠9
candidate common to all the templates[1] for digit 3 ==> r6c1=3
stte

nb-facts = <Fact-947907>
init-time = 0.05s, solve-time = 38.96s, total-time = 39.01s

.
Last edited by denis_berthier on Sat Nov 02, 2024 7:23 am, edited 2 times in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 5:02 am

.
Example: the puzzle with the most templates

This puzzle has been mentioned by P.O. as the one requiring the largest number of templates in his calculations. It is also the case in the SudoRules calculations.

Code: Select all
     +-------+-------+-------+
     ! . . 3 ! . . . ! . . . !
     ! 4 . . ! . 8 . ! . 3 6 !
     ! . . 8 ! . . . ! 1 . . !
     +-------+-------+-------+
     ! . 4 . ! . 6 . ! . 7 3 !
     ! . . . ! 9 . . ! . . . !
     ! . . . ! . . 2 ! . . 5 !
     +-------+-------+-------+
     ! . . 4 ! . 7 . ! . 6 8 !
     ! 6 . . ! . . . ! . . . !
     ! 7 . . ! 6 . . ! 5 . . !
     +-------+-------+-------+
..3......4...8..36..8...1...4..6..73...9..........2..5..4.7..686........7..6..5.. eleven 6539


Code: Select all
Resolution state after Singles:
   +-------------------------+-------------------------+-------------------------+
   ! 1259    125679  3       ! 12457   12459   145679  ! 24789   24589   2479    !
   ! 4       12579   12579   ! 1257    8       1579    ! 279     3       6       !
   ! 259     25679   8       ! 23457   23459   345679  ! 1       2459    2479    !
   +-------------------------+-------------------------+-------------------------+
   ! 12589   4       1259    ! 158     6       158     ! 289     7       3       !
   ! 12358   1235678 12567   ! 9       1345    134578  ! 2468    1248    124     !
   ! 1389    136789  1679    ! 13478   134     2       ! 4689    1489    5       !
   +-------------------------+-------------------------+-------------------------+
   ! 12359   12359   4       ! 1235    7       1359    ! 239     6       8       !
   ! 6       123589  1259    ! 123458  123459  134589  ! 23479   1249    12479   !
   ! 7       12389   129     ! 6       12349   13489   ! 5       1249    1249    !
   +-------------------------+-------------------------+-------------------------+
268 candidates


entering level T1_with_<Fact-3723>
candidate in no template[1] for digit 8 ==> r6c2≠8
candidate in no template[1] for digit 6 ==> r6c2≠6
candidate in no template[1] for digit 8 ==> r5c2≠8
candidate in no template[1] for digit 6 ==> r5c2≠6
entering level T2_with_<Fact-4697>
entering level T3 with <Fact-145330>
entering level T4 with <Fact-4309456>
candidate in no template[1] for digit 1 ==> r1c6≠1
candidate in no template[1] for digit 1 ==> r1c6≠1
candidate in no template[1] for digit 1 ==> r1c5≠1
candidate in no template[1] for digit 2 ==> r3c2≠2
candidate in no template[1] for digit 1 ==> r5c1≠1
candidate in no template[1] for digit 2 ==> r1c8≠2
candidate in no template[1] for digit 1 ==> r5c3≠1
candidate in no template[1] for digit 2 ==> r3c1≠2
candidate in no template[1] for digit 5 ==> r1c1≠5
candidate in no template[1] for digit 2 ==> r1c7≠2
candidate in no template[1] for digit 5 ==> r7c2≠5
candidate in no template[1] for digit 1 ==> r6c1≠1
candidate in no template[1] for digit 1 ==> r5c2≠1
candidate in no template[1] for digit 9 ==> r9c2≠9
candidate in no template[1] for digit 4 ==> r8c9≠4
candidate in no template[1] for digit 7 ==> r1c4≠7
candidate in no template[1] for digit 7 ==> r6c2≠7
candidate in no template[1] for digit 4 ==> r9c6≠4
candidate in no template[1] for digit 5 ==> r5c3≠5
candidate in no template[1] for digit 5 ==> r4c3≠5
candidate in no template[1] for digit 5 ==> r3c1≠5
naked-single ==> r3c1=9
candidate in no template[1] for digit 9 ==> r9c3≠9
candidate in no template[1] for digit 9 ==> r8c3≠9
candidate in no template[1] for digit 9 ==> r6c2≠9
candidate in no template[1] for digit 2 ==> r5c7≠2
candidate in no template[1] for digit 1 ==> r6c4≠1
candidate in no template[1] for digit 1 ==> r8c4≠1
candidate in no template[1] for digit 1 ==> r5c6≠1
candidate in no template[1] for digit 1 ==> r9c6≠1
candidate in no template[1] for digit 1 ==> r8c6≠1
candidate in no template[1] for digit 2 ==> r8c7≠2
candidate in no template[1] for digit 2 ==> r7c2≠2
candidate in no template[1] for digit 2 ==> r3c4≠2
candidate in no template[1] for digit 1 ==> r9c2≠1
candidate in no template[1] for digit 1 ==> r4c4≠1
candidate in no template[1] for digit 1 ==> r6c8≠1
candidate in no template[1] for digit 1 ==> r5c5≠1
candidate in no template[1] for digit 2 ==> r1c9≠2
candidate in no template[1] for digit 2 ==> r8c5≠2
candidate in no template[1] for digit 8 ==> r6c7≠8
candidate in no template[1] for digit 2 ==> r9c2≠2
candidate in no template[1] for digit 4 ==> r1c6≠4
candidate in no template[1] for digit 5 ==> r3c4≠5
candidate in no template[1] for digit 5 ==> r2c6≠5
candidate in no template[1] for digit 2 ==> r9c9≠2
candidate in no template[1] for digit 2 ==> r8c4≠2
candidate in no template[1] for digit 4 ==> r8c7≠4
candidate in no template[1] for digit 4 ==> r6c8≠4
candidate in no template[1] for digit 9 ==> r9c6≠9
candidate in no template[1] for digit 5 ==> r8c2≠5
candidate in no template[1] for digit 2 ==> r5c3≠2
candidate in no template[1] for digit 5 ==> r1c2≠5
candidate in no template[1] for digit 4 ==> r5c8≠4
candidate in no template[1] for digit 5 ==> r3c2≠5
candidate in no template[1] for digit 5 ==> r2c4≠5
candidate in no template[1] for digit 8 ==> r4c6≠8
candidate in no template[1] for digit 3 ==> r9c5≠3
candidate in no template[1] for digit 7 ==> r3c4≠7
candidate in no template[1] for digit 5 ==> r1c6≠5
candidate in no template[1] for digit 4 ==> r6c4≠4
candidate in no template[1] for digit 9 ==> r6c7≠9
candidate in no template[1] for digit 2 ==> r8c9≠2
candidate in no template[1] for digit 2 ==> r3c8≠2
candidate in no template[1] for digit 7 ==> r3c9≠7
candidate in no template[1] for digit 7 ==> r2c6≠7
candidate in no template[1] for digit 4 ==> r3c6≠4
candidate in no template[1] for digit 5 ==> r5c5≠5
candidate in no template[1] for digit 5 ==> r3c6≠5
candidate in no template[1] for digit 4 ==> r3c8≠4
naked-single ==> r3c8=5
candidate in no template[1] for digit 3 ==> r3c6≠3
candidate in no template[1] for digit 2 ==> r5c1≠2
candidate in no template[1] for digit 2 ==> r2c2≠2
candidate in no template[1] for digit 2 ==> r1c5≠2
candidate in no template[1] for digit 8 ==> r6c4≠8
candidate in no template[1] for digit 8 ==> r5c7≠8
candidate in no template[1] for digit 8 ==> r4c1≠8
candidate common to all the templates[1] for digit 7 ==> r6c4=7
candidate in no template[1] for digit 8 ==> r5c8≠8
candidate in no template[1] for digit 2 ==> r7c1≠2
candidate in no template[1] for digit 2 ==> r5c2≠2
candidate in no template[1] for digit 2 ==> r4c7≠2
candidate in no template[1] for digit 2 ==> r2c3≠2
candidate in no template[1] for digit 2 ==> r1c4≠2
candidate in no template[1] for digit 9 ==> r1c6≠9
candidate in no template[1] for digit 9 ==> r8c6≠9
candidate common to all the templates[1] for digit 9 ==> r2c6=9
candidate in no template[1] for digit 1 ==> r7c4≠1
candidate in no template[1] for digit 3 ==> r7c4≠3
candidate common to all the templates[1] for digit 3 ==> r3c4=3
candidate in no template[1] for digit 4 ==> r5c9≠4
candidate in no template[1] for digit 4 ==> r1c7≠4
candidate in no template[1] for digit 1 ==> r8c2≠1
candidate in no template[1] for digit 1 ==> r4c3≠1
candidate in no template[1] for digit 1 ==> r9c5≠1
candidate in no template[1] for digit 1 ==> r8c9≠1
candidate in no template[1] for digit 1 ==> r8c3≠1
candidate in no template[1] for digit 1 ==> r1c2≠1
candidate common to all the templates[1] for digit 5 ==> r1c5=5
candidate in no template[1] for digit 4 ==> r5c5≠4
naked-single ==> r5c5=3
candidate in no template[1] for digit 4 ==> r8c5≠4
candidate in no template[1] for digit 4 ==> r9c5≠4
candidate in no template[1] for digit 4 ==> r8c8≠4
candidate in no template[1] for digit 2 ==> r9c8≠2
candidate in no template[1] for digit 2 ==> r8c3≠2
stte

nb-facts = <Fact-21476464>
init-time = 0.09s, solve-time = 2h 40m 54.83s, total-time = 2h 40m 54.92s

Notice the total number of facts used: 21,476,464. If we discard the original 3,723 facts on entering level T1, that leaves 21,472,741 facts corresponding to instantiations of templates[≤4] (minus of few technical "control facts" and "tracking facts").


[Edit 2024 Nov 3]:Following the discovery of missing eliminations in T3, this puzzle is now solved in T3. I keep the above resolution path so that comparisons of resolution times can be made.
entering level T1 with <Fact-3723>
candidate in no template[1] for digit 8 ==> r6c2≠8
candidate in no template[1] for digit 6 ==> r6c2≠6
candidate in no template[1] for digit 8 ==> r5c2≠8
candidate in no template[1] for digit 6 ==> r5c2≠6
entering level T2 with <Fact-4697>
entering level T3 with <Fact-145330>
candidate in no template[1] for digit 2 ==> r9c2≠2
candidate in no template[1] for digit 1 ==> r9c2≠1
candidate in no template[1] for digit 3 ==> r7c4≠3
candidate in no template[1] for digit 9 ==> r9c2≠9
candidate in no template[1] for digit 1 ==> r9c6≠1
candidate in no template[1] for digit 1 ==> r8c2≠1
candidate in no template[1] for digit 1 ==> r5c1≠1
candidate in no template[1] for digit 1 ==> r5c2≠1
candidate in no template[1] for digit 1 ==> r5c3≠1
candidate in no template[1] for digit 1 ==> r5c6≠1
candidate in no template[1] for digit 9 ==> r6c7≠9
candidate in no template[1] for digit 5 ==> r3c2≠5
candidate in no template[1] for digit 5 ==> r3c4≠5
candidate in no template[1] for digit 9 ==> r6c3≠9
candidate in no template[1] for digit 3 ==> r8c5≠3
candidate in no template[1] for digit 5 ==> r8c2≠5
candidate in no template[1] for digit 3 ==> r7c2≠3
candidate in no template[1] for digit 4 ==> r1c5≠4
candidate in no template[1] for digit 9 ==> r1c8≠9
candidate in no template[1] for digit 1 ==> r6c8≠1
candidate in no template[1] for digit 1 ==> r5c5≠1
candidate in no template[1] for digit 9 ==> r1c7≠9
candidate in no template[1] for digit 3 ==> r7c6≠3
candidate in no template[1] for digit 2 ==> r5c3≠2
candidate in no template[1] for digit 4 ==> r8c7≠4
candidate in no template[1] for digit 2 ==> r5c7≠2
candidate in no template[1] for digit 1 ==> r8c6≠1
candidate in no template[1] for digit 1 ==> r8c9≠1
candidate in no template[1] for digit 5 ==> r3c5≠5
candidate in no template[1] for digit 4 ==> r5c9≠4
candidate in no template[1] for digit 5 ==> r5c3≠5
candidate in no template[1] for digit 9 ==> r8c3≠9
candidate in no template[1] for digit 2 ==> r8c2≠2
candidate in no template[1] for digit 2 ==> r7c7≠2
candidate in no template[1] for digit 9 ==> r8c8≠9
candidate in no template[1] for digit 2 ==> r1c7≠2
candidate in no template[1] for digit 5 ==> r3c6≠5
candidate in no template[1] for digit 2 ==> r3c2≠2
candidate in no template[1] for digit 3 ==> r5c6≠3
candidate in no template[1] for digit 8 ==> r6c7≠8
candidate in no template[1] for digit 1 ==> r8c4≠1
candidate in no template[1] for digit 4 ==> r8c9≠4
candidate in no template[1] for digit 1 ==> r8c3≠1
candidate in no template[1] for digit 4 ==> r5c6≠4
candidate in no template[1] for digit 5 ==> r7c4≠5
candidate in no template[1] for digit 3 ==> r5c2≠3
candidate in no template[1] for digit 9 ==> r9c9≠9
candidate in no template[1] for digit 9 ==> r6c1≠9
candidate in no template[1] for digit 9 ==> r3c8≠9
candidate in no template[1] for digit 4 ==> r8c5≠4
candidate in no template[1] for digit 4 ==> r3c8≠4
candidate in no template[1] for digit 2 ==> r3c8≠2
naked-single ==> r3c8=5
candidate in no template[1] for digit 1 ==> r6c1≠1
candidate in no template[1] for digit 7 ==> r2c6≠7
candidate in no template[1] for digit 4 ==> r6c7≠4
naked-single ==> r6c7=6
hidden-single-in-a-row ==> r5c3=6
candidate in no template[1] for digit 7 ==> r1c6≠7
candidate in no template[1] for digit 2 ==> r8c9≠2
candidate in no template[1] for digit 4 ==> r9c5≠4
candidate in no template[1] for digit 4 ==> r1c9≠4
candidate in no template[1] for digit 1 ==> r7c4≠1
naked-single ==> r7c4=2
candidate in no template[1] for digit 2 ==> r5c2≠2
candidate in no template[1] for digit 2 ==> r2c3≠2
candidate in no template[1] for digit 2 ==> r4c3≠2
candidate in no template[1] for digit 2 ==> r3c1≠2
naked-single ==> r3c1=9
candidate common to all the templates[1] for digit 9 ==> r4c3=9
hidden-single-in-a-block ==> r6c8=9
candidate in no template[1] for digit 4 ==> r5c5≠4
candidate in no template[1] for digit 8 ==> r5c1≠8
candidate in no template[1] for digit 1 ==> r9c5≠1
candidate in no template[1] for digit 1 ==> r2c6≠1
candidate in no template[1] for digit 5 ==> r1c1≠5
candidate in no template[1] for digit 5 ==> r8c4≠5
candidate in no template[1] for digit 5 ==> r2c6≠5
naked-single ==> r2c6=9
hidden-single-in-a-row ==> r1c9=9
naked-single ==> r8c9=7
hidden-single-in-a-row ==> r9c5=9
candidate in no template[1] for digit 5 ==> r5c6≠5
candidate in no template[1] for digit 2 ==> r1c1≠2
stte

nb-facts = <Fact-4321792>
init-time = 0.06s, solve-time = 9m 16.83s, total-time = 9m 16.89s

Notice the drastically reduced number of facts and computation time, due to not having to consider templates[4].
.
Last edited by denis_berthier on Sun Nov 03, 2024 5:30 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Fri Oct 18, 2024 7:57 am

Hi Denis, could you try this one? Thanks.
P.O.
 
Posts: 1764
Joined: 07 June 2021

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 8:17 am

P.O. wrote:Hi Denis, could you try this one? Thanks.

It's a relatively easy one for a puzzle in T4:

Code: Select all
Resolution state after Singles:
   +----------------------+----------------------+----------------------+
   ! 1      23467  237    ! 2345   24568  2368   ! 5678   368    9      !
   ! 34679  5      379    ! 1349   1468   13689  ! 2      1368   3678   !
   ! 369    2369   8      ! 7      1256   12369  ! 156    4      356    !
   +----------------------+----------------------+----------------------+
   ! 2      1679   1579   ! 149    3      179    ! 145689 1689   4568   !
   ! 3679   13679  4      ! 8      127    5      ! 169    12369  236    !
   ! 359    8      1359   ! 6      124    129    ! 1459   7      2345   !
   +----------------------+----------------------+----------------------+
   ! 3789   12379  6      ! 123    1278   4      ! 789    5      278    !
   ! 345789 23479  23579  ! 235    25678  23678  ! 46789  2689   1      !
   ! 4578   1247   1257   ! 125    9      12678  ! 3      268    24678  !
   +----------------------+----------------------+----------------------+
239 candidates


entering level T1_with_<Fact-3693>
candidate in no template[1] for digit 9 ==> r4c7≠9
entering level T2_with_<Fact-4074>
entering level T3 with <Fact-35271>
entering level T4 with <Fact-692770>
candidate in no template[1] for digit 9 ==> r2c1≠9
candidate in no template[1] for digit 7 ==> r7c2≠7
candidate in no template[1] for digit 9 ==> r8c7≠9
candidate in no template[1] for digit 9 ==> r8c1≠9
candidate in no template[1] for digit 9 ==> r4c2≠9
candidate in no template[1] for digit 3 ==> r8c1≠3
candidate in no template[1] for digit 3 ==> r2c4≠3
candidate in no template[1] for digit 5 ==> r6c3≠5
candidate in no template[1] for digit 8 ==> r8c8≠8
candidate in no template[1] for digit 8 ==> r4c8≠8
candidate in no template[1] for digit 7 ==> r7c1≠7
candidate in no template[1] for digit 6 ==> r4c8≠6
candidate in no template[1] for digit 6 ==> r3c7≠6
candidate in no template[1] for digit 6 ==> r8c8≠6
candidate in no template[1] for digit 6 ==> r5c8≠6
candidate in no template[1] for digit 7 ==> r8c3≠7
candidate in no template[1] for digit 1 ==> r5c8≠1
candidate in no template[1] for digit 6 ==> r4c9≠6
candidate in no template[1] for digit 2 ==> r8c6≠2
candidate in no template[1] for digit 9 ==> r4c8≠9
naked-single ==> r4c8=1
hidden-single-in-a-block ==> r3c7=1
candidate in no template[1] for digit 5 ==> r4c9≠5
candidate in no template[1] for digit 8 ==> r9c9≠8
candidate in no template[1] for digit 3 ==> r2c1≠3
candidate in no template[1] for digit 1 ==> r7c5≠1
candidate in no template[1] for digit 8 ==> r2c9≠8
candidate in no template[1] for digit 6 ==> r1c8≠6
candidate in no template[1] for digit 3 ==> r3c9≠3
candidate in no template[1] for digit 3 ==> r2c6≠3
candidate in no template[1] for digit 3 ==> r1c2≠3
candidate in no template[1] for digit 2 ==> r7c5≠2
candidate in no template[1] for digit 6 ==> r5c2≠6
candidate in no template[1] for digit 7 ==> r4c2≠7
naked-single ==> r4c2=6
candidate in no template[1] for digit 8 ==> r1c5≠8
candidate in no template[1] for digit 2 ==> r9c9≠2
candidate in no template[1] for digit 4 ==> r9c1≠4
candidate in no template[1] for digit 4 ==> r6c9≠4
candidate in no template[1] for digit 3 ==> r8c6≠3
candidate in no template[1] for digit 3 ==> r3c1≠3
candidate in no template[1] for digit 3 ==> r1c4≠3
candidate common to all the templates[1] for digit 5 ==> r3c9=5
candidate in no template[1] for digit 3 ==> r6c3≠3
candidate in no template[1] for digit 3 ==> r5c8≠3
candidate in no template[1] for digit 3 ==> r2c9≠3
candidate in no template[1] for digit 9 ==> r8c2≠9
candidate in no template[1] for digit 3 ==> r8c2≠3
candidate in no template[1] for digit 2 ==> r7c2≠2
candidate in no template[1] for digit 2 ==> r6c9≠2
naked-single ==> r6c9=3
candidate in no template[1] for digit 2 ==> r5c5≠2
candidate in no template[1] for digit 2 ==> r3c6≠2
candidate in no template[1] for digit 9 ==> r5c1≠9
candidate in no template[1] for digit 7 ==> r5c2≠7
candidate in no template[1] for digit 2 ==> r8c5≠2
candidate in no template[1] for digit 9 ==> r6c6≠9
candidate in no template[1] for digit 9 ==> r4c3≠9
candidate in no template[1] for digit 4 ==> r1c5≠4
candidate in no template[1] for digit 8 ==> r8c5≠8
candidate common to all the templates[1] for digit 9 ==> r4c4=9
stte

nb-facts = <Fact-2437472>
init-time = 0.06s, solve-time = 1m 15.72s, total-time = 1m 15.79s


[Edit 2024 Nov 3]:Following the discovery of missing eliminations in T3, this puzzle is now solved in T3. I keep the above resolution path so that comparisons of resolution times can be made.
entering level T1 with <Fact-3693>
candidate in no template[1] for digit 9 ==> r4c7≠9
entering level T2 with <Fact-4074>
entering level T3 with <Fact-35271>
candidate in no template[1] for digit 7 ==> r7c2≠7
candidate in no template[1] for digit 6 ==> r3c6≠6
candidate in no template[1] for digit 6 ==> r5c8≠6
candidate in no template[1] for digit 7 ==> r8c3≠7
candidate in no template[1] for digit 6 ==> r3c2≠6
candidate in no template[1] for digit 3 ==> r2c1≠3
candidate in no template[1] for digit 3 ==> r1c4≠3
candidate in no template[1] for digit 2 ==> r8c6≠2
candidate in no template[1] for digit 7 ==> r9c3≠7
candidate in no template[1] for digit 9 ==> r8c1≠9
candidate in no template[1] for digit 8 ==> r8c8≠8
candidate in no template[1] for digit 9 ==> r2c1≠9
candidate in no template[1] for digit 7 ==> r1c2≠7
candidate in no template[1] for digit 1 ==> r4c7≠1
candidate in no template[1] for digit 9 ==> r8c7≠9
candidate in no template[1] for digit 5 ==> r6c3≠5
candidate in no template[1] for digit 9 ==> r4c2≠9
candidate in no template[1] for digit 3 ==> r8c1≠3
candidate in no template[1] for digit 2 ==> r9c9≠2
candidate in no template[1] for digit 6 ==> r2c6≠6
candidate in no template[1] for digit 6 ==> r1c8≠6
candidate in no template[1] for digit 2 ==> r8c5≠2
candidate in no template[1] for digit 1 ==> r5c8≠1
candidate in no template[1] for digit 1 ==> r2c5≠1
candidate in no template[1] for digit 6 ==> r2c8≠6
candidate in no template[1] for digit 3 ==> r8c6≠3
candidate in no template[1] for digit 3 ==> r3c9≠3
candidate in no template[1] for digit 3 ==> r2c4≠3
candidate in no template[1] for digit 3 ==> r1c2≠3
candidate in no template[1] for digit 2 ==> r7c2≠2
candidate in no template[1] for digit 3 ==> r8c3≠3
candidate in no template[1] for digit 3 ==> r5c1≠3
candidate in no template[1] for digit 7 ==> r5c2≠7
candidate in no template[1] for digit 5 ==> r8c3≠5
candidate in no template[1] for digit 1 ==> r2c6≠1
candidate in no template[1] for digit 8 ==> r7c7≠8
candidate in no template[1] for digit 2 ==> r8c4≠2
candidate in no template[1] for digit 1 ==> r7c5≠1
candidate in no template[1] for digit 1 ==> r6c6≠1
candidate in no template[1] for digit 1 ==> r5c2≠1
candidate in no template[1] for digit 8 ==> r9c6≠8
candidate in no template[1] for digit 8 ==> r1c5≠8
candidate in no template[1] for digit 3 ==> r3c2≠3
candidate in no template[1] for digit 8 ==> r4c8≠8
candidate in no template[1] for digit 8 ==> r1c7≠8
candidate in no template[1] for digit 1 ==> r6c7≠1
candidate in no template[1] for digit 9 ==> r7c2≠9
candidate in no template[1] for digit 9 ==> r5c7≠9
candidate in no template[1] for digit 7 ==> r8c5≠7
candidate in no template[1] for digit 7 ==> r7c7≠7
naked-single ==> r7c7=9
candidate in no template[1] for digit 2 ==> r9c4≠2
candidate in no template[1] for digit 2 ==> r1c5≠2
candidate in no template[1] for digit 1 ==> r9c2≠1
candidate in no template[1] for digit 6 ==> r3c5≠6
candidate in no template[1] for digit 9 ==> r5c2≠9
candidate in no template[1] for digit 2 ==> r9c6≠2
candidate in no template[1] for digit 2 ==> r7c9≠2
candidate in no template[1] for digit 2 ==> r5c8≠2
candidate in no template[1] for digit 8 ==> r2c8≠8
candidate in no template[1] for digit 6 ==> r5c9≠6
candidate in no template[1] for digit 6 ==> r1c7≠6
candidate in no template[1] for digit 3 ==> r2c3≠3
candidate in no template[1] for digit 1 ==> r4c3≠1
candidate common to all the templates[1] for digit 8 ==> r4c7=8
candidate in no template[1] for digit 4 ==> r2c4≠4
candidate in no template[1] for digit 4 ==> r8c1≠4
candidate common to all the templates[1] for digit 7 ==> r1c7=7
candidate in no template[1] for digit 5 ==> r9c1≠5
candidate in no template[1] for digit 5 ==> r8c4≠5
naked-single ==> r8c4=3
candidate in no template[1] for digit 5 ==> r6c9≠5
candidate in no template[1] for digit 5 ==> r3c5≠5
candidate in no template[1] for digit 3 ==> r6c1≠3
candidate in no template[1] for digit 1 ==> r9c4≠1
stte

nb-facts = <Fact-693546>
init-time = 0.01s, solve-time = 18.59s, total-time = 18.6s

Here again, number of facts and computation time are greatly reduced.
Last edited by denis_berthier on Sun Nov 03, 2024 5:35 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby P.O. » Fri Oct 18, 2024 9:28 am

well, my implementation gives the same results as the one used by Eleven at the time regarding template elimination if only combinations of 5 are used: from (39 50 62 8 24 95 28 43 31) to (11 14 17 8 14 24 14 28 13)
so the question i ask myself is: what does your implementation do to find as many eliminations in combination of 4 which escapes these two implementations?
here are three applications of my procedure on this puzzle: the first goes up to combinations of 4, the second of 5 and the third solves the puzzle at 6
pools indicates the number of instances remaining for the 126 combinations of 4 and 5 respectively
4-Template:
Hidden Text: Show
Code: Select all
1       23467   237     2345    24568   2368    5678    368     9               
34679   5       379     1349    1468    13689   2       1368    3678             
369     2369    8       7       1256    12369   156     4       356             
2       1679    1579    149     3       179     145689  1689    4568             
3679    13679   4       8       127     5       169     12369   236             
359     8       1359    6       124     129     1459    7       2345             
3789    12379   6       123     1278    4       789     5       278             
345789  23479   23579   235     25678   23678   46789   2689    1               
4578    1247    1257    125     9       12678   3       268     24678           
239 candidates.

#VT: (39 50 62 8 24 95 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil (34)
 3combs
#VT: (38 50 61 8 24 92 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 4combs
#VT: (23 34 36 8 24 87 27 43 18)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(14 34) (5 68 81) (10 18 64) nil nil nil nil nil (10 64 70)

Left in pool: (2073 2428 12507 4439 10766 232 2393 10830 3597 9621 837 30277
               9305 19538 2599 25777 69068 8905 21560 2526 9288 3094 15089 7194
               10880 1247 22144 9139 13257 2158 27495 46316 7867 19181 3239
               6523 6694 2938 3100 1566 6427 11485 5281 5119 1672 4439 17398
               22175 16799 9225 5138 10849 19552 11499 31185 8780 3366 12672
               5305 12808 1444 32806 14302 22791 3395 28297 65129 8639 25158
               3681 10027 9509 4328 4963 3147 6585 15201 6733 6834 2436 7917
               40933 56538 40166 23147 14262 29485 37925 19845 58212 18843
               11254 7095 5431 3322 11608 18874 9200 10956 4862 9070 34459
               36536 26682 18739 11876 17279 31121 19919 41698 17184 2587 1930
               7116 1228 3352 3941 1587 3772 7937 3724 7740 24010 34280 12969
               18602)
#VT: (23 34 36 8 24 87 27 43 18)

1      23467  237    2345   4568   2368   5678   368    9               
467    5      379    1349   468    13689  2      1368   678             
369    2369   8      7      1256   12369  156    4      356             
2      1679   1579   149    3      179    4568   1689   4568           
3679   13679  4      8      127    5      169    12369  236             
359    8      1359   6      124    129    1459   7      2345           
3789   12379  6      123    1278   4      789    5      278             
4578   23479  23579  235    5678   23678  4678   2689   1               
4578   1247   1257   125    9      12678  3      268    4678           
227 candidates.

5-Template:
Hidden Text: Show
Code: Select all
5-Template:
1       23467   237     2345    24568   2368    5678    368     9               
34679   5       379     1349    1468    13689   2       1368    3678             
369     2369    8       7       1256    12369   156     4       356             
2       1679    1579    149     3       179     145689  1689    4568             
3679    13679   4       8       127     5       169     12369   236             
359     8       1359    6       124     129     1459    7       2345             
3789    12379   6       123     1278    4       789     5       278             
345789  23479   23579   235     25678   23678   46789   2689    1               
4578    1247    1257    125     9       12678   3       268     24678           
239 candidates.

#VT: (39 50 62 8 24 95 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil (34)
 3combs
#VT: (38 50 61 8 24 92 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 4combs
#VT: (23 34 36 8 24 87 27 43 18)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(14 34) (5 68 81) (10 18 64) nil nil nil nil nil (10 64 70)
 5combs
#VT: (19 25 24 8 16 29 16 31 16)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (13) nil (48) (20 24 38 44) (38 56 66) nil nil
 4combs
#VT: (17 24 24 8 16 29 16 31 15)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(29) nil nil nil nil nil nil nil (29)
 4combs
#VT: (16 24 24 8 16 29 16 31 15)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (15 23 23 8 14 27 16 30 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (15 22 23 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (13 20 20 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 20 20 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 4combs
#VT: (11 18 20 8 14 27 15 29 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 17 17 8 14 26 14 28 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 14 17 8 14 24 14 28 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil (78) nil nil nil nil nil nil nil

Left in pool: (336 1016 687 1684 72 791 485 1361 73 805 1627 149 1262 98 245
               814 589 1159 237 536 1828 334 1723 177 836 1017 2581 1148 1846
               577 2134 1617 705 2107 1275 1278 1175 1275 325 955 2066 547 2505
               508 986 1009 1942 832 1806 518 1181 1632 521 1605 965 493 852
               910 825 618 1076 651 474 1236 995 1151 1303 3514 1698 1662 786
               555 938 433 452 2067 638 1653 468 1434 982 2311 922 1939 786
               2128 1675 591 1784 1322 466 836 1111 920 895 1874 484 386 1641
               1234 1925 2050 5796 3920 2042 661 976 1459 1243 1400 1975 880
               814 2768 2945 1368 1296 4312 2938 2206 139 869 1439 1238 767
               2727)
#VT: (11 14 17 8 14 24 14 28 13)

1      23467  237    2345   4568   2368   5678   368    9               
467    5      379    149    468    13689  2      1368   678             
369    239    8      7      1256   1239   156    4      356             
2      67     1579   149    3      179    4568   1689   4568           
3679   139    4      8      127    5      169    1239   236             
359    8      139    6      124    129    1459   7      2345           
3789   1239   6      123    1278   4      789    5      278             
4578   23479  2359   235    5678   23678  4678   2689   1               
4578   1247   1257   125    9      1678   3      268    4678           
215 candidates.

6-Template:
Hidden Text: Show
Code: Select all
6-Template
1.......9.5....2....87...4.2...3......48.5....8.6...7...6..4.5.........1....9.3..

1       23467   237     2345    24568   2368    5678    368     9               
34679   5       379     1349    1468    13689   2       1368    3678             
369     2369    8       7       1256    12369   156     4       356             
2       1679    1579    149     3       179     145689  1689    4568             
3679    13679   4       8       127     5       169     12369   236             
359     8       1359    6       124     129     1459    7       2345             
3789    12379   6       123     1278    4       789     5       278             
345789  23479   23579   235     25678   23678   46789   2689    1               
4578    1247    1257    125     9       12678   3       268     24678           
239 candidates.

#VT: (39 50 62 8 24 95 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil (34)
 3combs
#VT: (38 50 61 8 24 92 28 43 31)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 4combs
#VT: (23 34 36 8 24 87 27 43 18)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(14 34) (5 68 81) (10 18 64) nil nil nil nil nil (10 64 70)
 5combs
#VT: (19 25 24 8 16 29 16 31 16)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (13) nil (48) (20 24 38 44) (38 56 66) nil nil
 4combs
#VT: (17 24 24 8 16 29 16 31 15)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(29) nil nil nil nil nil nil nil (29)
 4combs
#VT: (16 24 24 8 16 29 16 31 15)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (15 23 23 8 14 27 16 30 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (15 22 23 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (13 20 20 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 20 20 8 14 27 15 29 14)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 4combs
#VT: (11 18 20 8 14 27 15 29 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 17 17 8 14 26 14 28 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 5combs
#VT: (11 14 17 8 14 24 14 28 13)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil (78) nil nil nil nil nil nil nil
 6combs
#VT: (7 8 9 6 8 7 7 13 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(30 44) (41 54) (2 27 44) (73) (7 23) (5 10 17 23 36 71) (10 63) (5 18 71 80) (37)
EraseCC: ( n4r2c1 )

#VT: (7 8 9 4 8 7 7 13 5)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 2combs
#VT: (7 8 8 4 8 7 7 13 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (19) nil nil nil nil nil (30 65)
 3combs
#VT: (5 4 7 4 8 6 7 11 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(50 51) (4 6 20 56 59 66 69 80) (4 48 69) nil nil (25 35) nil (55) nil
EraseCC: ( n6r9c8 )

#VT: (5 4 7 4 8 18 7 11 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil nil nil nil nil nil nil nil
 2combs
#VT: (4 4 7 4 8 13 7 11 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:(58 74) nil nil nil nil nil nil nil nil
 2combs
#VT: (4 4 6 4 8 13 7 11 4)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (56) nil nil nil nil nil nil
 3combs
#VT: (4 4 4 4 8 5 5 8 3)
Cells: nil nil nil nil nil nil nil nil nil
Candidates:nil nil (6 65) nil nil (2 27 34) (29 55) (7 35) (35 51)
EraseCC: ( n5r3c9   n6r4c2   n1r4c8   n2r6c6   n1r3c7   n4r6c5
           n3r6c9   n5r1c5   n2r3c5   n9r4c4   n7r4c6   n1r5c5
           n4r1c4   n1r2c4   n5r4c3   n9r6c1   n1r6c3   n5r6c7
           n3r7c1   n2r7c4   n8r7c9   n9r8c3   n2r8c8   n5r9c4
           n6r3c1   n4r4c9   n7r5c1   n3r5c2   n9r5c8   n1r7c2
           n7r7c5   n9r7c7   n3r8c4   n8r9c1   n1r9c6   n7r9c9
           n6r2c9   n9r3c2   n3r3c6   n8r4c7   n6r5c7   n2r5c9
           n5r8c1   n4r8c7   n2r9c3   n7r1c7   n8r2c5   n9r2c6
           n3r2c8   n7r8c2   n6r8c5   n8r8c6   n4r9c2   n2r1c2
           n3r1c3   n6r1c6   n8r1c8   n7r2c3 )
1 2 3   4 5 6   7 8 9
4 5 7   1 8 9   2 3 6
6 9 8   7 2 3   1 4 5
2 6 5   9 3 7   8 1 4
7 3 4   8 1 5   6 9 2
9 8 1   6 4 2   5 7 3
3 1 6   2 7 4   9 5 8
5 7 9   3 6 8   4 2 1
8 4 2   5 9 1   3 6 7

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

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 10:08 am

.
I don't have the means to answer your question.
Except for a single elimination in T1:
Code: Select all
candidate in no template[1] for digit 9 ==> r4c7≠9

nothing happens before entrance in T4.


The few rules I use are clear (I've coloured them in blue in my previous posts). They are used systematically, in combination with the simplest-first strategy, with absolutely no restriction.
It seems that you and eleven are missing some eliminations, but I can't say at which level. Maybe you should try with simpler cases first and see if the results are the same up to T3. The fact that there is only one elimination at T1 at the start before T4 doesn't imply that your program does all the eliminations at T2 or T3 that become available later.
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 10:22 am

.
As a humorous note, I browse the thread after the post you mentioned above (http://forum.enjoysudoku.com/post215225.html#p215225). I didn't remember ever taking (small) part in a discussion about templates.
I remembered having written some code long ago, which I had completely set aside and which I updated 3 days ago before opening this thread.

Anyway, forget whatever I may have written there or at any other place about templates (I haven't re-checked it). All that's needed in my approach is present is this thread.
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 12:10 pm

.
Here's now something totally unexpected from computations that just finished running.

I tried a small collection of T&E(2) puzzles, namely the collection of 153 puzzles that I introduced as the standard T&E(2) examples for the SHC (see [HCCS2] and http://forum.enjoysudoku.com/the-sudoku-hierarchical-classifier-shc-t42075.html).
This collection has 10 puzzles for each value of BxB, except for B11B and B12B that had no known puzzles at that time and B13B that had only 3 known puzzles.

My first surprise was:
- whereas the collection is ordered by the increasing values of BxB, the first part of the puzzles is in T4 and the second part in T3 (template-depth varies in the inverse order).

And here comes my second surprise:
The split happens after the first 3 puzzles in B7B.
The puzzles in the first part of the list are old T&E(2) puzzles with no tridagon (including the only 3 old known ones in B7B); the puzzles in the second part are recent T&E(2) puzzles, all with a tridagon. It seems that the presence of a tridagon reduces the template-depth to 3 (regardless of the T&E-depth, if we take into account my previous calculations with the first few thousand puzzles in T&E(3) - all of which have a tridagon.

Of course, this is just a small sample; but it's nevertheless too large to be pure chance.
The tridagon pattern imposes very strict conditions on 3 digits. It may be that these conditions in turn have consequences on the templates. This obviously requires more studies.

.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Fri Oct 18, 2024 4:01 pm

.
As a step to understanding the above results, it can be noticed that the trivalue oddagom pattern (with no guardians) can be proven contradictory in T3.
The proof is almost the same as proving the contradiction in T&E(3).
Due to the 4 tridagon blocks, there can be no instantiation of the template[3].
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Sat Oct 19, 2024 3:02 am

.
Consider the two theorems:
- the trivalue oddagom pattern (with no guardians) can be proven contradictory in T&E(3) (proven here: http://forum.enjoysudoku.com/the-tridagon-rule-t39859.html)
- the trivalue oddagom pattern (with no guardians) can be proven contradictory in T3 (proven above).
A priori, none of the two implies anything about puzzles that have a tridagon with guardians.

It is a fact that no puzzle with a tridagon is known in T&E(n>3) but puzzles with a tridagon are known in T&E(n<3).
It was also a fact until now that:
- no puzzle with a tridagon was known with T<3.
- it seemed that no puzzle with a tridagon would have T>3.

However, I've now done more calculations with puzzles in T&E(3) and the conclusions appear to be different:
- still no puzzle with a tridagon and T<3 is known;
- puzzles with a tridagon and with T>3 are rare but they exist. In the first 10,000 puzzles in mith's collection of 158,276 min-expands in T&E(3), there are only 9 and they are in T4.
Take this with some grain of salt: I haven't yet searched enough puzzles in T&E(1 or 2).


I've found nothing special about the 9 puzzles in T4. If anyone wants to analyse them further, here they are:

Code: Select all
......7..4....9...6.8..7.......1537.3.5.2..91...9.35.2...3.19.7.3.5..12..1...2.53;893;16198 #4956
..34.678...718..36....374.129..6....5........73....6.837..4.........3.......718.3;933;22275 #5067
..34.678...718..36....374.129..6....37....6.85........73..4.........3.......718.3;934;22276 #5074
.2345.78.4.7.8.2...8..........5.4.7.....6....7..91....3.5...4.78....532...2..3.58;1245;23134 #6120
.2..5.......1....6.8.73.....1........98...62...4...8.1.61..49..8.2...46..4...8.12;1247;29659 #6124
.2..5.......1....6...73.....1........98...62...4...8.1.61..49.88.2...46.94...8.12;1247;28794 #6125
12..56......1.92.6...23.1........5.1.4.......87...2.....2.9.36....3..9.2..962..15;1449;62715 #6696
1..45....4.71.9.......271.42.4...........16.8......3...4279..1.57..1..9.9.15.....;1451;62714 #6700
12.4.........8...6....731..2.45..96....9...1.91....5...4....62.59....4.16........;2317;298786 #9524



[Edit 2024 Nov 2]:Following the discovery of missing eliminations in T3, after fixing the problem in SudoRules, these puzzles are now solved in T3.
.
Last edited by denis_berthier on Sat Nov 02, 2024 8:52 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Next

Return to Advanced solving techniques