Templates as patterns

Advanced methods and approaches for solving Sudoku puzzles

Re: Templates as patterns

Postby coloin » Fri Nov 01, 2024 8:36 pm

P.O. wrote: ...if Coloin means 6-template why doesn't he say it?

I didnt mean to offend .. indeed I was differentiating it ..am glad that the puzzle was in 6-template....I will use your terminology in future :oops: !!

Edit ... will add the puzzle to the solvers thread to see what they can do wit it.... along with a suitable reference name for the puzzle... !
Last edited by coloin on Fri Nov 01, 2024 10:01 pm, edited 1 time in total.
coloin
 
Posts: 2493
Joined: 05 May 2005
Location: Devon

Re: Templates as patterns

Postby blue » Fri Nov 01, 2024 8:43 pm

P.O. wrote:3 last puzzles? what puzzles are you talking about?

My mistake.

I thought Colin (and you) were talking about one of the 3 puzzles from a few posts up in this thread -- two in T4.
Edit: My mistake again. it's only two puzzles, one in T4.

"DoubleTrouble" and "Shining Mirror", I have as both in "6-template".
blue
 
Posts: 1037
Joined: 11 March 2013

Re: Templates as patterns

Postby blue » Sat Nov 02, 2024 6:57 pm

Four more in T4, from thhis thread: The making of a gotchi, a simple way to find extreme sudokus

Code: Select all
..3......4...8..36..8...1...4..6..73...9..........7..5..4.7..686....2...7.....5..
..3......4...8..36..8...1...4..6..73...9........7.2..5..4.7..686........7.....5..
1..4...8..5...9..2..9.........6..8.36.......4....41.6...2.7.5...7.......8..3...4.
..3..2...4...8..36..8...1...4..6..73...9.......6........4.7..686........7.....59. # 78304 FNBP C22.m/M2.4.11480 

"6-template", all 4.
blue
 
Posts: 1037
Joined: 11 March 2013

Re: Templates as patterns

Postby denis_berthier » Sun Nov 03, 2024 5:51 am

.
Great. So, now we have 6 puzzles in T4. They are rare but not impossible to find.

BTW, following the discovery of missing eliminations in SudoRules for T3 (not all the relevant permutations were automatically eliminated by the Clips TMS when a Template[2] was eliminated*), I have updated all my posts mentioning puzzles in T4 (apart from the few real ones). I also kept the old solutions found in T4, so that the numbers of facts and computation times can be compared. Not having to compute templates[4] leads to drastic gains in all the cases.

(*) I don't mean there is any problem with Truth Maintenance in Clips. On the contrary, it works exactly as it should.
But, for sparing memory, I coded only templates[k] for increasing values of digits n1,.., nk. As a result, I had to code several Clips elimination rules for the full implementation of the abstract rule Tk-delete defined in the first posts.
When template[k] is deleted, all the templates[k+1] that extend it with a number nk+1 > n1,...nk are automatically deleted by the Clips TMS. However, this has to be coded manually for values of nk+1 that are not > nk. I had forgotten to do it in my first quick implementation.
.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby coloin » Sun Nov 03, 2024 2:51 pm

Those new puzzles from blue/eleven look like they are from the same grid, but in the minlexgrid format they obviously arnt.
Its not clear which is the 2nd puzzle from the posts...
Ive added 3 possible but unlikely contenders of note from the search vault...

Code: Select all
12.....8...7..9..66...2.1.....93...4..4.7.9.......4.6...6..7..3.......5.8..5.....#Denis1 #T4# 98509 FNBP C23.m/M2.2.72160   #SXTratt:   3908 ,    1431 ,## ED=11.3/11.3/10.6
.2....7..4....9.3.6..2.3.4.....1......89.....9....4.6..94....5.5.....6.3.....5...#Blue1  #T4# 96787 FNBP C22.m/M2.4.26240   #SXTratt:   8606 ,    3675 ,## ED=10.9/10.9/2.6
..3......4...8..36..8...1...4..6..73...9........7.2..5..4.7..686........7.....5..#Blue2  #T4# 42333 FNBP C22.m/M2.11.596    #SXTratt:   7201 ,    2681 ,## ED=10.8/10.8/2.6
1..4...8..5...9..2..9.........6..8.36.......4....41.6...2.7.5...7.......8..3...4.#Blue3  #T4# 98774 FNBP C22.m/M2.1.262440  #SXTratt:   6174 ,    2177 ,## ED=11.1/11.1/2.6
12...67....7....36....7.....9..........5.......1.6.3....2.3.65.8......4...6.2.1..#Blue4  #T4# 78848 FNBP C22.m/M2.4.11480   #SXTratt:   8395 ,    3071 ,## ED=10.9/1.2/1.2 
.2..56...45....2....92......1....35..7....6.1.3.....27...7.1..2....25.6....63.1..#DT     #T?# 99295 FNBP C26/M2.4.4920      #SXTratt:   4114 ,    2708 ,## ED=11.7/11.7/2.6
.2...67..4...8..3...83.......9..3..5.8..1..9.7..9..1.....5...4.6....1....9..3...2#SM     #T?# 98483 FNBP C24.m/M2.7.5622    #SXTratt:   1645 ,    1227 ,## ED=11.4/11.4/11.3
....56.8..5.7....3..8......2.....9...4.5....7....92.6.3.4.....15..1..4...1.....7.#VP     #T3# 99368 FNBP C23.m/M3.361.1472  #SXTratt:   3835 ,    2124 ,## ED=11.7/11.7/2.6
1..4.......7.8...6.9....41......3....3.8..9....5.6...7..2......5....8..2.7..2.65.#another#  # 98375 FNBP C23.m/M2.5.9184    #SXTratt:   4312 ,    2074 ,## ED=11.5/11.5/2.6
1...5..8..5...91.....13...62..3......4..9.3....7..4..8.1.9..4....2.....16......7.#another#  # 98239 FNBP C24.m/M2.1.583929  #SXTratt:   3123 ,    1758 ,## ED=11.2/11.2/11.1
12...6.....71..2..8......51..9..3..5.1..4..9.7..9..8.......4....7.2..9......6..3.#another#  # 98003 FNBP C24.m/M2.5.9184    #SXTratt:   3337 ,    1998 ,## ED=11.4/11.4/11.1
coloin
 
Posts: 2493
Joined: 05 May 2005
Location: Devon

Re: Templates as patterns

Postby denis_berthier » Sun Nov 03, 2024 3:32 pm

coloin wrote:Those new puzzles from blue/eleven look like they are from the same grid, but in the minlexgrid format they obviously arnt.
Its not clear which is the 2nd puzzle from the posts...
Ive added 3 possible but unlikely contenders of note from the search vault...

The last 6 ones are in T3.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Sun Nov 03, 2024 4:25 pm

.
I've pushed further the analysis of the controlled-bias collection (with all its puzzles in T&E(1)), in particular the relationship between the B rating and the template-depth T.

Let me first recall my previous result that the correlation between B and T is 0.73 (when excluding the puzzles with B=0), i.e. it isn't meaningful.
However, this has no impact on what happens when we look at extreme values (they are rare and they don't count much in the correlation). Remember that B ≥ 7 is rare.

1) for the full collection of 5,926,343 puzzles: all the puzzles with B ≥ 7 are in T3.
This includes puzzles with B=13 (3), B=12 (6), B=11 (20), B=10 (85), B=9 (429), B=8 (2059) and B=7 (10,166)

2) For the first 254,760 puzzles in the collection:
- for puzzles in B6 (1884), all are in T3, except 1 in T2 and 1 in T1.

- for puzzles in T2 (22,141), the min value of the B rating is 2 (because W1=B1 is included in T1) and the max value 6 (only 1 puzzle);
- for puzzles in T1 (43,551), the min value of the B rating is 1 and the max value 6 (only 1 puzzle).


It seems that the border between T=2 and T=3 coincides in a fuzzy way with the border between W=6 and W=7, i.e. the border of what is solvable by a human solver (special patterns aside).
.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Mon Nov 04, 2024 4:09 am

.
I've now found all the T4 puzzles from eleven's collection of 26,370 high SER puzzles (all of which are in T&E(2)). Note that all the other puzzles in the collection are in T3. Here are the 24 in T4:

Code: Select all
12.....8...7..9..66...2.1.....93...4..4.7.9.......4.6...6..7..3.......5.8..5.....  11.3 11.3 10.6
....5.7....71....6......41.2...9.....3...5.....67...4...8...1..5...3...8.9...2..4  11.2 11.2 11.2
...4.6..94..7...2...9.2....2...4...6.....5.1...56..3.....8......31...8..9...6...7  11.2 11.2 07.6
..34....9....8....6....7.1..8....6......1..7...95....453.2.......2.4....9....3..2  11.1 11.1 10.4
..34..........9...6...271..2...7..1...98....2.4....5..5...6...1..6..8.5..3....67.  11.1 11.1 09.9
.2.4...8...6.8....7....3..6...9.....6....7..1..4.2.9...67.....55.....31..1...5...  11.1 11.1 02.6
1.....7...5...9.3.....2...1..6....4.3.5..4....4.96......87....2.3...5.6.......8..  11.1 11.1 02.6
1...5.7....7..9.3..8...7....4..1........6...29....51....4.....87..5..6...3.....2.  11.1 11.1 02.6
1..4...8..5...9..2..9.........6..8.36.......4....41.6...2.7.5...7.......8..3...4.  11.1 11.1 02.6
.....678....1....6.6..7..4.2..9.......5...39..4...7..83.....8...1...8..4...52....  11.1 01.2 01.2
..34..7......89.3..8......42...6.....3.9...4.6.1...2...7.8...9......5..1..5......  11.0 11.0 11.0
..34....9....8.2.........1..7...8...3..5....7.4...26..5...6.....3.9....49.....1..  11.0 11.0 02.6
.....67....71.9...68..7......6.1.9...3......1.......2...8.6.1..5.......4..129.8..  11.0 01.2 01.2
.....67....71.9...68..7......6.1.9...3......1.......2...1.6.8..5.......4..829.1..  11.0 01.2 01.2
12...6.8...6......78..2............55..9..3....8.7..2..4....9.....3....4..7.6..1.  10.9 10.9 10.6
...4..7..4...89..3.9..3.....4.9....7......2....1....6..7.3....8.3.8....2..2..5...  10.9 10.9 10.4
..3....8.4..7......89.3...4.....56...1.......9...7..4.3...9..7......3..28..24..3.  10.9 01.2 01.2
1...5...9..6.......9...2.4..1..9...55.7..8...6.....3.......42....1.6...7...8...3.  10.9 01.2 01.2
1.3..6.8...6..913....1..5.....96..7......78.3..7.......4.........8..3.9.....2....  10.8 01.2 01.2
1.3..6.8...6..91.....13.5.....96..7......78.3..7.......4.........8..3.9.....2....  10.8 01.2 01.2
....5..8...71..2..6....2..4....139....9..5....7.9....2..25..3..8.5.....6.4...1...  10.6 10.6 10.5
...4.....4....92...8.23....2..9..8....6.....1.7...5.4.5...9.3....1..8.6.........7  10.6 10.6 10.4
...4.67....7.....6....7..152..9....8..5.4.1.......2...5..3.....83.....9...4.6.5..  10.6 10.6 10.3
.......8.4...8...3..91..5...3.....47..16..9......7..........2..69.2.......2.15...  10.6 10.6 02.6


Note that they are neither the highest SER nor the highest BxB (they are only in B2B, B3B and B4B)


References:
[eleven 2011a]: the-making-of-a-gotchi-a-simple-way-to-find-extreme-sudokus-t30150.html
[eleven 2011b]: 26,370 T&E(2) puzzles, original broken link: https://sites.google.com/site/sudoeleven/%2008/07/2011
the collection is reproduced here, with eleven's permission: https://github.com/denis-berthier/Classification-of-TE2-Sudokus

[Edit 2024 Nov. 4]: corrected #21 and #22 (thanks to Blue for noticing); added #23
[Edit 2024 Nov. 5]: I've now finished scanning the whole collection, I added a final 24th T4 puzzle, added blue colour and updated the first line of this post.
.
Last edited by denis_berthier on Tue Nov 05, 2024 7:07 am, edited 2 times in total.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby m_b_metcalf » Mon Nov 04, 2024 2:02 pm

denis_berthier wrote:.
I now have 22 T4 puzzles from eleven's collection of 26,370 high SER puzzles (all in T&E(2)).

Playing with your puzzles, one of them is one clue short of having a rotationally symmetric morph. Adding that clue to make it symmetric yields a nice diamond:
Code: Select all
 4 . . . 1 . . . 8
 . . 9 5 . . . 2 .
 . . . . . 9 . . .
 6 . . . . . 8 3 .
 . 3 . . 6 . . 4 .
 . 4 1 . . . . . 6
 . . . 7 . . . . .
 . 7 . . . 2 5 . .
 3 . . . 8 . . . 4   11.1/11.1/11.1, 3r5c2 added, diamond

which, in turn, has a few high-rated (minimal) siblings:
Code: Select all
1...2...3..45...6......4...7.....32..2..7..1..18.....7...9......9...65..8...3...1   11.1/11.1/11.1
1...2...3..45...6......4...7.....81..1..7..3..32.....7...9......9...65..2...8...1   11.1/11.1/11.1
1...2...3..45...6......4...7.....32..2..7..1..18.....7...9......9...65..8...1...2   11.1/11.1/10.1
1...2...3..45...6......4...7.....83..3..7..1..12.....7...9......5...69..2...8...1   11.1/11.1/10.5

Just being curious,

Mike
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13618
Joined: 15 May 2006
Location: Berlin

Re: Templates as patterns

Postby denis_berthier » Mon Nov 04, 2024 2:57 pm

.
The four siblings don't inherit a T4 grade. They are in T3.
.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby blue » Mon Nov 04, 2024 4:10 pm

denis_berthier wrote:(*) I don't mean there is any problem with Truth Maintenance in Clips. On the contrary, it works exactly as it should.
But, for sparing memory, I coded only templates[k] for increasing values of digits n1,.., nk. As a result, I had to code several Clips elimination rules for the full implementation of the abstract rule Tk-delete defined in the first posts.
When template[k] is deleted, all the templates[k+1] that extend it with a number nk+1 > n1,...nk are automatically deleted by the Clips TMS. However, this has to be coded manually for values of nk+1 that are not > nk. I had forgotten to do it in my first quick implementation.

I thought it might be something along those lines.
Nice to see it's fixed.

denis_berthier wrote:.
I now have 22 T4 puzzles from eleven's collection of 26,370 high SER puzzles (all in T&E(2)).

Code: Select all
12.....8...7..9..66...2.1.....93...4..4.7.9.......4.6...6..7..3.......5.8..5.....  11.3 11.3 10.6
....5.7....71....6......41.2...9.....3...5.....67...4...8...1..5...3...8.9...2..4  11.2 11.2 11.2
...4.6..94..7...2...9.2....2...4...6.....5.1...56..3.....8......31...8..9...6...7  11.2 11.2 07.6
..34....9....8....6....7.1..8....6......1..7...95....453.2.......2.4....9....3..2  11.1 11.1 10.4
..34..........9...6...271..2...7..1...98....2.4....5..5...6...1..6..8.5..3....67.  11.1 11.1 09.9
.2.4...8...6.8....7....3..6...9.....6....7..1..4.2.9...67.....55.....31..1...5...  11.1 11.1 02.6
1.....7...5...9.3.....2...1..6....4.3.5..4....4.96......87....2.3...5.6.......8..  11.1 11.1 02.6
1...5.7....7..9.3..8...7....4..1........6...29....51....4.....87..5..6...3.....2.  11.1 11.1 02.6
1..4...8..5...9..2..9.........6..8.36.......4....41.6...2.7.5...7.......8..3...4.  11.1 11.1 02.6
.....678....1....6.6..7..4.2..9.......5...39..4...7..83.....8...1...8..4...52....  11.1 01.2 01.2
..34..7......89.3..8......42...6.....3.9...4.6.1...2...7.8...9......5..1..5......  11.0 11.0 11.0
..34....9....8.2.........1..7...8...3..5....7.4...26..5...6.....3.9....49.....1..  11.0 11.0 02.6
.....67....71.9...68..7......6.1.9...3......1.......2...8.6.1..5.......4..129.8..  11.0 01.2 01.2
.....67....71.9...68..7......6.1.9...3......1.......2...1.6.8..5.......4..829.1..  11.0 01.2 01.2
12...6.8...6......78..2............55..9..3....8.7..2..4....9.....3....4..7.6..1.  10.9 10.9 10.6
...4..7..4...89..3.9..3.....4.9....7......2....1....6..7.3....8.3.8....2..2..5...  10.9 10.9 10.4
..3....8.4..7......89.3...4.....56...1.......9...7..4.3...9..7......3..28..24..3.  10.9 01.2 01.2
1...5...9..6.......9...2.4..1..9...55.7..8...6.....3.......42....1.6...7...8...3.  10.9 01.2 01.2
1.3..6.8...6..913....1..5.....96..7......78.3..7.......4.........8..3.9.....2....  10.8 01.2 01.2
1.3..6.8...6..91.....13.5.....96..7......78.3..7.......4.........8..3.9.....2....  10.8 01.2 01.2
.2.45...9..6..9......2..4..........1.91..52...4...25..3.......8.6...49....4.7....  10.7 01.2 01.2
.23.5......67....27......5..1...49..6...2...3...9...1.3...6...7..8...4.......8...  10.7 01.2 01.2


Note that they are neither the highest SER nor the highest BxB (they are only in B2B, B3B and B4B)

I haven't finished scanning the collection, so that a few more from the end of the collection may be expected.

When you first posted this list, it has 20 items, all in T4.
The last two (10.7's), are in T3.
Are you (still?) using the updated rules ?

I have four more in T4, from eleven't list, but I'll keep quiet on which ones they are.
blue
 
Posts: 1037
Joined: 11 March 2013

Re: Templates as patterns

Postby denis_berthier » Mon Nov 04, 2024 4:51 pm

blue wrote:When you first posted this list, it has 20 items, all in T4.
The last two (10.7's), are in T3. Are you (still?) using the updated rules ?
I have four more in T4, from eleven't list, but I'll keep quiet on which ones they are.

I had not copied the proper puzzles #21 and #22 from my list (I proceed by batches of 1000 and I copied from the wrong batch). I've corrected + added a 23rd. As I said, I haven't finished the computations.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Tue Nov 05, 2024 7:08 am

.
I've now finished the computations and updated my post.
.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Re: Templates as patterns

Postby denis_berthier » Thu Nov 07, 2024 11:37 am

.
What's fun with Sudoku is, it always keeps surprises in store.

I computed the template-depths of puzzles with extreme numbers of clues (in the lower and upper ends).
Nothing special to say about the T values obtained: they span the T0 to T3 levels, as expected after my previously reported calculations for the controlled-bias collection.

But, if you consider the computation times, the results are quite noticeable:

- computations for the 17-clue puzzles (49,158, all in T&E(0 or 1) are slower than for the controlled-bias collection;
- most of the known puzzles with 39 clues (2,650, all in T&E(1)) are in T3 (23 in T1, 473 in T2, 2,154 in T3), but the computations are much faster than for T&E(1) to T&E(2) puzzles in a similar range of T values;
- most of the 1st 100,000 puzzles with 38 clues (almost all in T&E(1) with just a few in T&E(2)) are in T3 (77 in T0, 4,710 in T1, 23,058 in T2 and 72,155 in T3), but again the computations are much faster than for puzzles with a similar range of T values.

You'd say that all is well and works as should be expected! Slower [resp. faster] computations mean more [resp. fewer] templates being considered. Note that fewer [resp. more] clues implies (statistically) more [resp. fewer] candidates - which should leave more [resp. fewer] possibilities to place a template[1] or a template[k>1]. This seems to explain the above computation times.

On the other hand, the computations for the controlled-bias collection show that, in T&E(1), there's no correlation between the number of clues or candidates and the template-depth of a puzzle.

Informal conclusion: for puzzles in T&E(1) (the only ones of interest for a human solver - leaving aside special patterns), the template-depth is not correlated with the number of templates to consider during resolution.
(The latter number is not an intrinsic property of a puzzle: it depends on the search order. However, it provides some informal measure of the computational complexity of solving with templates - be it manually or with a program).

All this incites me to conclude that templates are of little interest in the human solving or in the formal analysis of puzzles. (They're also slower than DFS, so they're of no interest for fast solving.)
.
denis_berthier
2010 Supporter
 
Posts: 4197
Joined: 19 June 2007
Location: Paris

Previous

Return to Advanced solving techniques

cron