PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Interactive on-site game threads go here

Re:

Postby mith » Wed Aug 23, 2023 2:46 pm

[deleted, wrong thread!]
mith
 
Posts: 996
Joined: 14 July 2020

Postby 1to9only » Thu Aug 24, 2023 8:33 am

1to9only wrote:I have fixed the lksudoku fix!!

Some of info below is reposted from other threads, to make it easier to find...

PGExplainer
PGE is a faster optimised version of (original) SE to be used for the Patterns Game. PGE is about 3 times faster than SE. Download latest (2022.4.4) version from here.
Usage:
Code: Select all
java.exe -jar PGExplainer.jar --input=puzzles.txt --output=output.txt
or
java.exe -cp PGExplainer.jar sudoku.serate --input=puzzles.txt --output=output.txt

PGXplainer
PGX is PGE with my fix for lksudoku's fix to address (original) SE mis-rating the same puzzle or morphs of the puzzle as observed in the Patterns Game.
PGX gives same ratings for the same puzzle and morphs even after renumbering. Download (2022.7.6) version from here.
Usage:
Code: Select all
java.exe -jar PGXplainer.jar --input=puzzles.txt --output=output.txt
or
java.exe -cp PGXplainer.jar sudoku.serate --input=puzzles.txt --output=output.txt
Last edited by 1to9only on Sat Aug 26, 2023 9:04 am, edited 1 time in total.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Thu Aug 24, 2023 10:43 am

.
How to compile it?
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Postby 1to9only » Thu Aug 24, 2023 10:04 pm

denis_berthier wrote:.
How to compile it?

See this post.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Postby 1to9only » Mon Aug 28, 2023 8:00 am

From another thread:
denis_berthier wrote:
1to9only wrote:PGX should be used as it always rates, with same ratings given for the same puzzle and morphs even after renumbering.

Is that really sure. I thought mith had provided counterexamples.

In the context of Patterns Game, morphs as determined by g.r.emlin have the same minlex (gsf -qFN -f%#.c).
E.g. Both puzzles were submitted in PG#0444, but the 2nd one submitted got flagged 'duplicate puzzle'.
Code: Select all
..1...7...4.....2.8....6..3.....5..8...219...9..8.....3..6....9.2.....1...7...4.. ED=9.6/9.6/9.0
..1...2...3.....4.5....6..7.....8..5...239...9..5.....7..6....9.4.....1...2...3.. ED=9.7/9.7/9.0

Note: SE, PGE and PGX rate the 2 puzzles as above!! So in the Patterns Game, you'll need a minlexer and a duplicate finder!!

So this is probably more correct:
1to9only re- wrote:PGX should be used as it always gives with same rating for the same puzzle.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re:

Postby denis_berthier » Mon Aug 28, 2023 8:24 am

Hi 1to9only.
My questions may seem naive, but I'm really naive in minlex topics.
1to9only wrote:In the context of Patterns Game, morphs as determined by g.r.emlin have the same minlex (gsf -qFN -f%#.c).

Isn't that equivalent to saying they are really isomorphic? Or is there a bug is gsf's program?

1to9only wrote:E.g. Both puzzles were submitted in PG#0444, but the 2nd one submitted got flagged 'duplicate puzzle'.
Code: Select all
..1...7...4.....2.8....6..3.....5..8...219...9..8.....3..6....9.2.....1...7...4.. ED=9.6/9.6/9.0
..1...2...3.....4.5....6..7.....8..5...239...9..5.....7..6....9.4.....1...2...3.. ED=9.7/9.7/9.0

Note: SE, PGE and PGX rate the 2 puzzles as above!! So in the Patterns Game, you'll need a minlexer and a duplicate finder!!

To be clear: are these two puzzles isomorphic or not? Do they have the same gsf minlex form or not?


1to9only re- wrote:So this is probably more correct:
PGX should be used as it always gives with same rating for the same puzzle.

By "same" you really mean "exactly the same string"?
Do you have an example where e.g. SER would give different ratings if run several times on the exact same puzzle?
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Postby 1to9only » Mon Aug 28, 2023 9:22 am

denis_berthier wrote:
1to9only wrote:E.g. Both puzzles were submitted in PG#0444, but the 2nd one submitted got flagged 'duplicate puzzle'.
Code: Select all
..1...7...4.....2.8....6..3.....5..8...219...9..8.....3..6....9.2.....1...7...4.. ED=9.6/9.6/9.0
..1...2...3.....4.5....6..7.....8..5...239...9..5.....7..6....9.4.....1...2...3.. ED=9.7/9.7/9.0

Note: SE, PGE and PGX rate the 2 puzzles as above!! So in the Patterns Game, you'll need a minlexer and a duplicate finder!!

To be clear: are these two puzzles isomorphic or not? Do they have the same gsf minlex form or not?

Both puzzles have the same minlex:
Code: Select all
gsf.exe -qFN -f%#.c puzzles.txt
...4........18...66..7.2....9.....5.3....8..7..1...4...4.....9.8...7...3..5...1..
...4........18...66..7.2....9.....5.3....8..7..1...4...4.....9.8...7...3..5...1..

gsf's minlex has known issues (documented elsewhere is these forum).

kaito's (has bugs!) and dclamage's (the one to use) give 'true' minlex:
Code: Select all
........1.....2.34..2...5.6..3..7.6..1..8....9..4.......7..63...8..9....4..1.....
........1.....2.34..2...5.6..3..7.6..1..8....9..4.......7..63...8..9....4..1.....

denis_berthier wrote:Do you have an example where e.g. SER would give different ratings if run several times on the exact same puzzle?

I posted examples here, parts of which are reposted below:

Test file (from PG#0435):
Code: Select all
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4

The same puzzle is repeated 4 times in test file (can be more if you wish, but 4 seems to show off the SE/PGE bug for me!).

PGE output:
Code: Select all
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=9.9/9.9/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=9.9/9.9/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4

Running (several times) SE/PGE on the 4 puzzles will probably give the misratings is different orders!

PGX output:
Code: Select all
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4
1.85......32.6..5.65...2...8.......9.2.....3...9...1.......7.13.6..3.47....4..9.5 PG#0435 ED=10.0/10.0/9.4 ED=10.0/10.0/9.4

Closed. I wont be posting about these again.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Mon Aug 28, 2023 9:28 am

.
OK, thanks. It's clear now.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Mon Sep 04, 2023 6:53 am

.
A different topic.
After you cleaned SE, the structure of the software is clear. Most files define specific rules and a few files manage the whole program.

Am I write to think that, in order to cancel all the rules based on Uniqueness, it's enough to comment out the following 4 lines in file Solver.java

in public Solver(Grid grid) {
Code: Select all
        // indirectHintProducers.add( new UniqueLoops());
        // indirectHintProducers.add( new BivalueUniversalGrave());

+ same lines in public Solver(Grid grid, int multi, int dynamic, int nested) {
Code: Select all
        // indirectHintProducers.add( new UniqueLoops());
        // indirectHintProducers.add( new BivalueUniversalGrave());


I can compile and run the program after these changes. But does it do what I want?
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Postby 1to9only » Mon Sep 04, 2023 7:29 am

denis_berthier wrote:Am I write to think that, in order to cancel all the rules based on Uniqueness, it's enough to comment out the following 4 lines in file Solver.java
...
I can compile and run the program after these changes. But does it do what I want?

Yes, that will do it.
But you can avoid having multiple versions of PGE/PGX by using the unmodified versions - use the -M option to rate sudokus with Multiple solutions. You can also use -N and -D options to disable running of Nested and Dynamic chains if serate is taking to long! See this post and a number of subsequent posts.
Usage:
Code: Select all
java.exe -jar PGExplainer.jar [-M] [-N] [-D] --input=puzzles.txt --output=output.txt
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Mon Sep 04, 2023 10:07 am

.
Sure, that's cleaner. Thanks.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Fri Sep 08, 2023 9:45 am

.
I have a question for people who have used SER and PGXplainer intensively.
It seems to me that PGXplainer generates more parallelism. (I can see more threads at the same time) and if I run it on an old Mac the fans start running full speed.)
Has anyone compared the total processor time of the two softwares, especially for hard puzzles (say SER ≥ 11.7)?
.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Postby 1to9only » Fri Sep 08, 2023 4:42 pm

There are some serate timings in the 1st post of this thread, shows PGE/PGX is (on average) about 3 times faster than original SE (1.2.1.3 version) which I've hardly used for the past few years!!
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re:

Postby denis_berthier » Fri Sep 08, 2023 5:18 pm

1to9only wrote:There are some serate timings in the 1st post of this thread, shows PGE/PGX is (on average) about 3 times faster than original SE (1.2.1.3 version) which I've hardly used for the past few years!!

They don't answer the question I'm asking. If there's more multi-threading, it will obviously lead to a shorter solving time. My question is about cumulated time over all the processors.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

Re: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby denis_berthier » Tue Sep 19, 2023 6:29 am

.
Is there an option in SE or PGX for outputting the computation time (e.g. in the terminal window)?
I mean besides using the Unix time function
.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

PreviousNext

Return to Interactive games