Finding a puzzle based on known given squares

Everything about Sudoku that doesn't fit in one of the other sections

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Fri May 15, 2020 3:51 am

m_b_metcalf wrote:
denis_berthier wrote:Anyway, I find this puzzle very interesting. It has very few minimals compared to the other hard ones.
You might be interested in a pattern that was used in both games 1 and 39 in 'Patterns Game 1.0' (pages 1 and 99), again devised by jpf.
Code: Select all
 . . . 6 . . . . .
 5 7 4 1 . . . 3 .
 2 . . . . . 1 8 5
 . . . . . . . 4 .
 . . . . 5 . . . .
 . 1 . . . . . . .
 6 3 9 . . . . . 2
 . 8 . . . 9 5 7 6
 . . . . . 4 . . .
It yields only five known valid puzzles:


I see. I tried it, but I got nothing after 30 minutes, so I killed the process.

However, the underlying pattern (...X.....XXXX...X.X.....XXX.......X.....X.....X.......XXX.....X.X...XXXX.....X...) gave me this, after some 20 minutes:
...3.....7548...3.6.....215.......4.....9.....7.......398.....4.6...2578.....6... # 16 FN C23.m/S2.p
(probably a morph of some of the 5 known ones)

What makes the Metcalf-B7B (I've seen no other name, so I got used to name it so) so different to me is, the pattern itself doesn't yield much compared to the other hard ones. Though I guess it doesn't matter in a top-down search for the hardest, as the digits are given.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby m_b_metcalf » Fri May 15, 2020 7:40 am

denis_berthier wrote:However, the underlying pattern (...X.....XXXX...X.X.....XXX.......X.....X.....X.......XXX.....X.X...XXXX.....X...) gave me this, after some 20 minutes:
...3.....7548...3.6.....215.......4.....9.....7.......398.....4.6...2578.....6... # 16 FN C23.m/S2.p
(probably a morph of some of the 5 known ones)

I should have written that there are only five known ratings rather than five known puzzles. This is a different puzzle but has the same 1.2 rating as the first of the others.

Regards,

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

Re: Finding a puzzle based on known given squares

Postby coloin » Wed May 20, 2020 2:32 pm

I guess these sorts of puzzle generators like gsf's program - the speed of production depends on the number of ED puzzles which have that particular pattern.
The 23C pattern used in patterns game 1 and 39 with only 3 clues in the middle band actually has over 23000 ED minimal/ mostly non-minimal puzzles, but apparently only 5 different ratings.
Normally these generators would produce many more puzzles much more rapidly , as a more average pattern with 23C might have 1 billion ED puzzles.

In the finite world of sudoku puzzles .....this may well be the same process in the pattern from m_b_metcalf puzzle [ I think it has inherited that tag] ... as this has only 20C it wil have much less puzzles than the 22C patterns in eleven#3 and eleven#22,
Udate
My generation process has stopped at only 112 ED all minimal puzzles for the 20C pattern of the m_b_metcalf puzzle no wonder they were hard to come by !
coloin
 
Posts: 2502
Joined: 05 May 2005
Location: Devon

Using gsf's program

Postby denis_berthier » Fri Nov 27, 2020 5:20 am

I've recently used gsf's program to generate puzzles with very specific (and symmetric) patterns of givens.

It's the first time I'm generating puzzles (except the controlled-bias ones) and I think it's an interesting exercise, as it shows that patterns are very unequal. Some patterns yield nothing after hours, others yield too many easy puzzles. But all the symmetric patterns I've used give many more high SER (9.0 to 9.3) puzzles than can be obtained with top-down generators. I know this effect of symmetry has already been reported, but it's a different thing to see it by oneself.

Does anyone know the meaning of what appears after the puzzle in the output, on each line, e.g.:
4.......1.5..9..3...2...7.....4.7....8..3..5....8.2.....7...4...3..1..8.9.......5 # 96464 FNBTHWYK C21.m/S8.f
..9..4..1.7..5..3.4..1..5....3..6..7.2..1..9.6..9..1....6..8..2.4..6..7.3..4..8.. # 999 FNBTHXY C27.m/S4.da


C21.m and C27.m give the number of clues but what are 58.f and 54.da?

I guess the FNBTHWYK refer to the rules necessary to solve the puzzle.

But what are the ratings (?) 96464 and 999

I've been looking for a manual for the program, but I couldn't find one.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Using gsf's program

Postby 1to9only » Fri Nov 27, 2020 8:31 am

denis_berthier wrote:I've been looking for a manual for the program, but I couldn't find one.

for manual: download sudoku.html from: https://drive.google.com/drive/folders/0BwwKLhARRO-BZmFjU1kzaVVwdzQ
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: Using gsf's program

Postby denis_berthier » Fri Nov 27, 2020 9:21 am

1to9only wrote:
denis_berthier wrote:I've been looking for a manual for the program, but I couldn't find one.

for manual: download sudoku.html from: https://drive.google.com/drive/folders/0BwwKLhARRO-BZmFjU1kzaVVwdzQ


Thanks, there are commands that can't be re-invented.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Mon May 27, 2024 9:46 am

.
Has anyone ever used gsf's program to generate minimal puzzles, starting from puzzles instead of patterns of cells?
If so, what's the command line?
Can the input puzzles be multi-solution?
.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby mith » Mon May 27, 2024 4:50 pm

denis_berthier wrote:.
Has anyone ever used gsf's program to generate minimal puzzles, starting from puzzles instead of patterns of cells?
If so, what's the command line?
Can the input puzzles be multi-solution?
.


I really need to get my code on github.

This is approximately what I use in the T&E(3) scripts:

Code: Select all
./sudoku-linux.i386-64 -f'%#mc' -go{-2+1} -qFN -e'M>0&&uniq()' [input_puzzle] | sed s/0/./g

-f'%#mc'  - minlex form (gsf minlex, not true minlex); other formats I use are
-f'%#.c' - solution minlex (the puzzle morphed to match the minlex form of the solution)
-f'%C' - the solution itself

-go{-2+1} - this is the neighborhood search, change the numbers to whatever neighborhood you want to search (-g is the puzzle generating option for gsf, it can take other parameters but o is the one for neighborhood search)

-qFN - this is the solving constraints; this tells gsf to only check for singles and otherwise brute force the solution; this is much faster than the default, the default checks for a bunch of things to produce a rating, I don't use that now (but previously used -q1 and -q2 for rating filters).

-e'M>0&&uniq()' - this requires that the puzzle have a backdoor size greater than 0 (so, not solvable with singles) and is unique among the output puzzles (less important when I'm generating from a single puzzle at a time, but very useful when generating from a batch of puzzles); if you want only minimal puzzles, you can add '&&minimal==1' to this; you may also want to add 'valid' or 'v' (the M>0 requirement takes care of this in my scripts, IIRC, been a while since I actually put these together).

[input puzzle] - replace with your string of 81 characters, '.' or '0' for empty cell (you can also put an input file here instead and it will take each input puzzle from that file)

| sed s/0/./g - this is not part of gsf, it's just a pipe I add to put it in the format I prefer; gsf by default will output puzzles with empty cells as 0, this replaces all '0' characters with '.'


I only work with puzzles that have a unique solution, but it should work the same with multisolution inputs.
mith
 
Posts: 996
Joined: 14 July 2020

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Tue May 28, 2024 6:36 am

.
Hi mith
Thanks for your answer
[Edit: delete wrong example]
.
Last edited by denis_berthier on Wed May 29, 2024 2:47 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby P.O. » Tue May 28, 2024 7:14 pm

hi Denis, the puzzle you started with is a minimal single-solution puzzle and all the puzzles you've had with it are non-minimal single-solution puzzles.
P.O.
 
Posts: 1759
Joined: 07 June 2021

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Wed May 29, 2024 2:46 am

.
OK
I didn't use the right puzzle in the command line. I deleted the example.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby JPF » Sat Jun 01, 2024 3:16 pm

m_b_metcalf wrote:
denis_berthier wrote:However, the underlying pattern (...X.....XXXX...X.X.....XXX.......X.....X.....X.......XXX.....X.X...XXXX.....X...) gave me this, after some 20 minutes:
...3.....7548...3.6.....215.......4.....9.....7.......398.....4.6...2578.....6... # 16 FN C23.m/S2.p
(probably a morph of some of the 5 known ones)

I should have written that there are only five known ratings rather than five known puzzles. This is a different puzzle but has the same 1.2 rating as the first of the others.
Regards,
Mike

To be more precise (all minimals):
Code: Select all
...1.....2345...1.6.....743.......2.....8.....1.......369.....7.2...1498.....5... ED=7.2/1.2/1.2
...1.....2345...1.5.....624.......3.....4.....7.......712.....8.9...5761.....9... ED=7.1/1.2/1.2
...1.....2345...1.6.....728.......6.....7.....1.......328.....9.6...1487.....5... ED=5.6/1.2/1.2
...1.....2345...1.6.....734.......2.....4.....8.......956.....1.4...7895.....2... ED=4.4/1.2/1.2
...1.....2345...1.6.....478.......8.....9.....1.......729.....4.8...1369.....5... ED=4.2/1.2/1.2
...1.....2345...6.5.....247.......2.....7.....8.......658.....4.7...4895.....3... ED=3.0/1.2/1.2
...1.....2345...6.1.....543.......2.....7.....8.......671.....4.4...1798.....2... ED=2.6/1.2/1.2
...1.....2345...6.1.....427.......8.....6.....1.......923.....8.8...3751.....8... ED=2.5/1.2/1.2
...1.....2345...6.1.....527.......4.....8.....9.......351.....4.8...1972.....4... ED=2.3/1.2/1.2
...1.....2345...1.1.....675.......2.....4.....8.......763.....4.1...9837.....5... ED=2.0/2.0/2.0
...1.....2345...6.1.....728.......4.....6.....9.......821.....3.5...1679.....3... ED=2.0/1.5/1.5
...1.....2345...6.1.....473.......2.....6.....1.......367.....8.5...7149.....8... ED=2.0/1.2/1.2
...1.....2345...6.1.....273.......4.....8.....9.......371.....6.5...1829.....6... ED=1.7/1.5/1.5
...1.....2345...6.7.....425.......4.....6.....1.......385.....2.6...5139.....7... ED=1.7/1.2/1.2
...1.....2345...1.1.....675.......2.....3.....8.......463.....7.7...9841.....5... ED=1.5/1.5/1.5
...1.....2345...6.1.....273.......4.....7.....8.......859.....4.7...3829.....4... ED=1.5/1.2/1.2
...1.....2345...6.1.....372.......4.....7.....8.......958.....4.7...2839.....4... ED=1.2/1.2/1.2


JPF
JPF
2017 Supporter
 
Posts: 6139
Joined: 06 December 2005
Location: Paris, France

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Mon Jun 03, 2024 6:43 am

mith wrote:This is approximately what I use in the T&E(3) scripts:

Code: Select all
./sudoku-linux.i386-64 -f'%#mc' -go{-2+1} -qFN -e'M>0&&uniq()' [input_puzzle] | sed s/0/./g
[...]
-go{-2+1} - this is the neighborhood search, change the numbers to whatever neighborhood you want to search (-g is the puzzle generating option for gsf, it can take other parameters but o is the one for neighborhood search)

I only work with puzzles that have a unique solution, but it should work the same with multisolution inputs.


Do I understand it right? There seems to be no way to ask for all the minimals of a (say single solution) puzzle.
One has to try successively all the {-1+0}, {-2+0}, {-4+0}... without ever being sure that minimals haven't been missed because one didn't go far enough in the number of deleted clues.
This would be a very inefficient way to look for minimals (this would amount to doing BFS when DFS is much better). There must be some other command than the -go{-p+q}.
.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Re: Finding a puzzle based on known given squares

Postby mith » Mon Jun 03, 2024 3:34 pm

Sorry, I misunderstood what you were asking for. For *all* minimals, you just use the -m option, not -g.
mith
 
Posts: 996
Joined: 14 July 2020

Re: Finding a puzzle based on known given squares

Postby denis_berthier » Mon Jun 03, 2024 5:31 pm

.
Thanks
Actually, I was interested in both - for occasional use.
I don't plan to spend much time in finding new puzzles. My own tools are better adapted to analysing puzzles found by others. But occasionally, I want to tweak a few puzzles.
I've found 16,453 puzzles with a degenerate-cyclic tridagon in the whole controlled-bias collection (5,926,343 minimal puzzles). I'm curious to see what they become under small changes.
.
denis_berthier
2010 Supporter
 
Posts: 4233
Joined: 19 June 2007
Location: Paris

Previous

Return to General