re: gsf's software

Programs which generate, solve, and analyze Sudoku puzzles

Re: re: gsf's software

Postby enxio27 » Fri Nov 03, 2017 3:39 am

StrmCkr wrote:I have an email some where from gsf on how to use the commands with good explanations it take some digging to find it from 6 years back... Haven't used his program in a long time.. But If I find it I'll post what I do find.

I'd like to see that if you can find it.

Right now I can't see how to canonicalize without destroying the pattern.
User avatar
enxio27
 
Posts: 271
Joined: 13 November 2007

Re: re: gsf's software

Postby StrmCkr » Fri Nov 03, 2017 5:16 am

Right now I can't see how to canonicalize without destroying the pattern.

as far as i know/ theorize, canonicalize will always destroy the pattern as it removes every clue not needed for minimal canonical form.

Code: Select all
123456789
45           


every puzzle is converted to that format for starting 11 digits then every other house is filled in with minimal identifiers that id's which puzzle form or group its from...

meaning pattern smashed every time as the first 11 digits can be skipped displaying for canonicalized form.

if my fuzzy memory is correct. {that and i'm not the best person at answering this type of question...}

isomorphic puzzles will retain the pattern shape and form and change digits/position, but pattern is retained.
Some do, some teach, the rest look it up.
User avatar
StrmCkr
 
Posts: 647
Joined: 05 September 2006

Re: re: gsf's software

Postby m_b_metcalf » Fri Nov 03, 2017 8:39 am

enxio27 wrote:Right now I can't see how to canonicalize without destroying the pattern.

Do you perhaps mean the type of canonicalization that is useful in the Patterns Game? This is simply a renumbering, as in (using your post):
Code: Select all
. 6 . . 1 . . 2 .
. . 5 2 . . . . 4
. . . . . . . . .
3 . . . . 8 . . .
. 7 . . 4 . . . 6
. . 9 3 . . . 7 .
7 . 3 5 . . . 6 .
. 4 . . 9 . . . 8
. . 2 . . 6 . . .   ED=8.4/8.4/3.4

 . 1 . . 2 . . 3 .
 . . 4 3 . . . . 5
 . . . . . . . . .
 6 . . . . 7 . . .
 . 8 . . 5 . . . 1
 . . 9 6 . . . 8 .
 8 . 6 4 . . . 1 .
 . 5 . . 9 . . . 7
 . . 3 . . 1 . . .

That's an easy piece of code to write oneself.

HTH

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

Re: re: gsf's software

Postby enxio27 » Fri Nov 03, 2017 2:24 pm

m_b_metcalf wrote:Do you perhaps mean the type of canonicalization that is useful in the Patterns Game? This is simply a renumbering, as in (using your post):


Yes, exactly.

That's an easy piece of code to write oneself.

Easy for you to say! :D

While we're on this, is there a switch for gsf sudoku to enforce non-isomorphism when generating puzzles?
User avatar
enxio27
 
Posts: 271
Joined: 13 November 2007

Re: re: gsf's software

Postby tarek » Fri Nov 03, 2017 6:22 pm

Iirc you have to use the option -p to control the isomorphism of the output. Using the (uniq) also guarantees that your output is unique.

I'll try and dig for an example (no promises :ugeek: )

Tarek
User avatar
tarek
 
Posts: 2622
Joined: 05 January 2006

Re: re: gsf's software

Postby tarek » Sat Nov 04, 2017 12:48 pm

As promised:

If you are reading puzzles from an input file with some comma separated data next to the puzzle on each line (for instances difficulty from an external solver or name) then use the -c option:
Sudoku -c1,Puzzle,Difficulty,Solution -qF-G -e"uniq(%%#Pc)" -f"%%(Puzzle)f,%%(Solution)f,%%(Difficulty)f
The number 1 after c tells the solver that the puzzle is in the 1st column but it could be 2,3,4, ....

if you want to permute the puzzle use the -p option:
Sudoku -qF-G -pv(12384)(5967) -qF-G -f"%%v"
The above example permutes the values (-pv)
The permutation works in a cyclical way (possibly somebody can explain it better than me)
User avatar
tarek
 
Posts: 2622
Joined: 05 January 2006

re: isomorphs

Postby Pat » Sun Nov 05, 2017 11:30 am

m_b_metcalf, your re-numbering would help find SOME of the isomorphs

tarek, thanks for pointing to the uniq function!
    gsf wrote:

      uniq() returns 1 if the current puzzle is different up to isomorphism from the previously listed puzzles.

      Too many different puzzles/formats
      may exhaust memory.


    sudoku -gt -qNF -euniq()*(23==clues)*(1==minimal) -n100 -f%%v <template.TXT >output.TXT
User avatar
Pat
 
Posts: 3438
Joined: 18 July 2005

Re: re: gsf's software

Postby enxio27 » Wed Nov 08, 2017 1:03 am

From the Patterns Game Strategies thread:

gsf wrote: <snip>
the output of this process is filtered by
Code: Select all
sudoku -e '(%#Hq)==(%#Dq)'

before being passed to sudoku explainer for rating
this selects puzzles with the hardest rating (%#Hq) equal to the diamond rating (%#Dq)

I keep getting an "invalid token" error when using this command line.

I''m using it in a batch file like this:

Code: Select all
sudoku -e '(%%#Hq)==(%%#Dq)' <0295-4.out >0295-4.pd


Any help from anyone? What am I missing?
User avatar
enxio27
 
Posts: 271
Joined: 13 November 2007

Re: re: gsf's software

Postby tarek » Wed Nov 08, 2017 12:59 pm

I wouldn't know if this sorts it but I wouldn't leave a space between -e and what follows it. Secondly, I would also try using quotation marks instead To see if it makes a difference (it possibly doesn't but worth a try)

Tarek
User avatar
tarek
 
Posts: 2622
Joined: 05 January 2006

Re: re: gsf's software

Postby enxio27 » Thu Nov 09, 2017 1:20 am

tarek wrote:I wouldn't know if this sorts it but I wouldn't leave a space between -e and what follows it. Secondly, I would also try using quotation marks instead To see if it makes a difference (it possibly doesn't but worth a try)

Removing the space didn't help. Changing to quote marks instead of apostrophes got rid of the error message, but it didn't work as expected. It gave me a much smaller list of puzzles (presumably collected from the input file produced by the generator), but there doesn't seem to be a rhyme or reason as to the selections it made. In any case, it's not filtering out the lower-ER puzzles.
User avatar
enxio27
 
Posts: 271
Joined: 13 November 2007

Previous

Return to Software