PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Interactive on-site game threads go here

PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Postby 1to9only » Wed May 19, 2021 4:18 pm

It is Nicolas Juillerat's SudokuExplainer 1.2.1, with Glenn Fowler's serate code (SE 1.2.1.3), with the multi-threaded chaining code from my SukakuExplainer, and with a number of additional code changes by me.

All code not needed in the serate process have also been removed.

Usage - serate
Code: Select all
java.exe -Xrs -Xmx500m -cp PGExplainer.jar sudoku.serate --input=puzzles.txt --output=output.txt

Options - Only these options are supported:
Code: Select all
-f, --format=FORMAT
-i, --input=FILE
-o, --output=FILE

The default FORMAT is "%g ED=%r/%p/%d", so this does not have to be specified.

Comparison of time taken to rate all sudokus posted in Patterns Game 415 (87 sudokus, including more's):
Code: Select all
                        Version     Size            Rating Time

SudokuExplainer.jar   - 1.2.1.3   - 304,777 bytes - 10 m 34 s

SukakuExplainerPG.jar - 1.4.0     - 144,432 bytes -  6 m 51 s   https://github.com/1to9only/SukakuExplainerPG

PGExplainer.jar       - 2021.3.30 - 56,712 bytes  -  2 m 45 s   (8 logical cores) https://github.com/1to9only/PGExplainer

PGExplainer.jar       - 2022.7.1  - 56,761 bytes  -  1 m 17 s   (20 logical cores) PGE built from code commit 2f356d6 on Jul 4, 2022


GitHub: here. Download: PGExplainer.jar.
Last edited by 1to9only on Fri Sep 15, 2023 2:44 pm, edited 1 time in total.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

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

Postby m_b_metcalf » Thu May 20, 2021 12:28 pm

1to9only wrote:
The default FORMAT is "%g ED=%r/%p/%d", so this does not have to be specified.

Comparison of time taken to rate all sudokus posted in Patterns Game 415 (87 sudokus, including more's):.


Thanks for all your efforts. All your timings are far faster than mine, I suppose because you're multithreading and I'm not.

And a reminder to all Windows users that any % has to become %%.

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

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

Postby Hajime » Sat May 22, 2021 8:15 am

Great solver/rating program.
Is there a list of all possible ratings with the method used?
User avatar
Hajime
 
Posts: 1375
Joined: 20 April 2018
Location: Fryslân

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

Postby 1to9only » Sat May 22, 2021 8:45 am

Hajime wrote:Is there a list of all possible ratings with the method used?

Not long ago, I posted a comprehensive list here: http://forum.enjoysudoku.com/hodoko-rating-system-question-t38778.html#p301563
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

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

Postby Hajime » Sat May 22, 2021 12:59 pm

1to9only wrote:
Hajime wrote:Is there a list of all possible ratings with the method used?

Not long ago, I posted a comprehensive list here: http://forum.enjoysudoku.com/hodoko-rating-system-question-t38778.html#p301563
Thanks
I missed that post and it is exactly what I asked :P
User avatar
Hajime
 
Posts: 1375
Joined: 20 April 2018
Location: Fryslân

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

Postby tarek » Thu Jun 03, 2021 7:32 pm

Great addition 1to9only!!
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

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

Postby denis_berthier » Fri Jun 04, 2021 8:29 am

1to9only wrote:
Hajime wrote:Is there a list of all possible ratings with the method used?

Not long ago, I posted a comprehensive list here: http://forum.enjoysudoku.com/hodoko-rating-system-question-t38778.html#p301563


I had this list already, but I now realise it is not totally comprehensive. It stops at 11.7. It's easy to guess the general form of what's beyond - just different upper bounds for the numbers of nodes. But, as you have worked on this, could you give the upper bounds for 11.8 and 11.9?
This might also explain why nobody has ever found a 12.0.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

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

Postby 1to9only » Fri Jun 04, 2021 9:38 am

I've used the table as a guide, and not spent much time over it. It was produced a long time ago, and I now think it contains inaccuracies!!

The section of SudokuExplainer code that handles chains length difficulty is:
Code: Select all
protected double getLengthDifficulty() {
    double added = 0.0;
    int ceil = 4;
    int length = getComplexity() - 2;
    boolean isOdd = false;
    while (length > ceil) {
        added += 0.1;
        if (!isOdd)
            ceil = (ceil * 3) / 2;
        else
            ceil = (ceil * 4) / 3;
        isOdd = !isOdd;
    }
    /*
    final int[] steps = new int[] {4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128,
        192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192};
    int length = getComplexity() - 2;
    double added = 0;
    int index = 0;
    while (index < steps.length && length > steps[index]) {
        added += 0.1;
        index++;
    }
     */
    return added;
}

This turns into: (the (commented out) static table 'steps' in the code looks to be correct)
Code: Select all
add diff: nodes

+ 0.0:     1 -     4
+ 0.1:     5 -     6
+ 0.2:     7 -     8
+ 0.3:     9 -    12
+ 0.4:    13 -    16
+ 0.5:    17 -    24
+ 0.6:    25 -    32
+ 0.7:    33 -    48
+ 0.8:    49 -    64
+ 0.9:    65 -    96
+ 1.0:    97 -   128
+ 1.1:   129 -   192
+ 1.2:   193 -   256
+ 1.3:   257 -   384
+ 1.4:   385 -   512
+ 1.5:   513 -   768
+ 1.6:   769 -  1024
+ 1.7:  1025 -  1536
+ 1.8:  1537 -  2048
+ 1.9:  2049 -  3072
+ 2.0:  3073 -  4096
+ 2.1:  4097 -  6144
+ 2.2:  6145 -  8192
+ 2.3:  8193 - 12288
+ 2.4: 12289 - 16384
+ 2.5: 16385 - 24576
+ 2.6: 24577 - 32768
+ 2.7: 32769 - 49152
+ 2.8: 49153 - 65536
+ 2.9: 65537 - 98304

The list of all SE Ratings can be updated/extended from the table shown above.

Edit: Updated nodes table!
Last edited by 1to9only on Tue Jun 15, 2021 12:00 pm, 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 » Fri Jun 04, 2021 10:06 am

Thanks for your answer.
I guess that there is no a priori upper bound for the number of "steps" (8192 is very far from the max 288 in 11.7) and for the SER.

But, taking the last 2 ratings explicitly given in your previous reference:
Code: Select all
11.6 [Dynamic + Dynamic Forcing Chains (145-192 nodes) Cell Forcing Chains]
11.7 [Dynamic + Dynamic Forcing Chains (193-288 nodes) Double Forcing Chains]

I can't see how your table
- is compatible with the +0.1 between 11.6 and 11.7
- allows to extend this to the 11.8, 11.9 and above ratings
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

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

Postby 1to9only » Fri Jun 04, 2021 11:49 am

denis_berthier wrote:I can't see how your table
- is compatible with the +0.1 between 11.6 and 11.7
- allows to extend this to the 11.8, 11.9 and above ratings

I did not produce this table, I occasionally reference it, and I've no plan to create one of my own.

I found the table in one of the forum threads and copied it off. I do not have a reference to the original post, so currently cannot assign credit to the author.

The highest ratings (in my view) should be looking like this:
Code: Select all
11.6 Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5 + 1.1 : 129 - 192 nodes
11.7 Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5 + 1.2 : 193 - 256 nodes
11.8 Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5 + 1.3 : 257 - 384 nodes
11.9 Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5 + 1.4 : 385 - 512 nodes
12.0 Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5 + 1.5 : 513 - 768 nodes

The Nested Forcing Chains have the following base ratings:
Code: Select all
Nested Forcing Chains Level 1: (+), ED=9.0
Nested Forcing Chains Level 2: (+ Forcing Chains), ED=9.5
Nested Forcing Chains Level 3: (+ Multiple Forcing Chains), ED=10.0
Nested Forcing Chains Level 4: (+ Dynamic Forcing Chains), ED=10.5

The other chain base ratings are:
Code: Select all
Forcing Chains, 6.5+,
Forcing Cycles, 7.0+
Nishio Forcing Chains, 7.5+
Multiple Forcing Chains, 8.0+
Dynamic Forcing Chains, 8.5+
Dynamic Forcing Chains (+), 9.0+

So it is possible to obtain all combinations of chains SE Rating from the chain base rating + chain length difficulty.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

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

Postby 999_Springs » Fri Jun 04, 2021 12:00 pm

1to9only wrote:
denis_berthier wrote:I can't see how your table
- is compatible with the +0.1 between 11.6 and 11.7
- allows to extend this to the 11.8, 11.9 and above ratings

I did not produce this table, I occasionally reference it, and I've no plan to create one of my own.

I found the table in one of the forum threads and copied it off. I do not have a reference to the original post, so currently cannot assign credit to the author.

the original reference is from a VERY old thread by Mike Barker who has long since left, and dates from the beginning of 2008 here and reposted by himself with some minor changes here. i think some of this is pure speculation, since he says "(this is) how i think SE rates puzzles", that "I'm not sure of the 'node' count or how 'nodes' are calculated", and he can't reproduce anything in [square brackets] including anything at 11.4 or above

there are a few errors at the low end like the rounding errors leading to the 6.699999999999999 rating for the 3 strong link x-chain has since been fixed in SE 1.2.1.3, and i have no idea where he got 4.3 for "direct hidden quad" since it doesn't exist, and i discovered the first 5.3 (UL10 type 3 with naked quad) in 2018

i've been able to find a few examples of where the ratings for a certain type of chain go lower than mike's list e.g. dynamic(+) at 9.2 or dynamic+fc at 9.9, and i believe mith has a few examples of ratings that go higher than the list says
999_Springs
 
Posts: 591
Joined: 27 January 2007
Location: In the toilet, flushing down springs, one by one.

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

Postby 1to9only » Fri Jun 04, 2021 1:22 pm

999_Springs wrote:i have no idea where he got 4.3 for "direct hidden quad" since it doesn't exist

The 4.3 rating exists in the source code, but as you rightly say it cannot exist in 9x9 sudokus. I have not come across it (yet!) in 16x16 sudokus!!
Thanks for digging up the Mike Barker posts.

There is also overlap of ratings, and SudokuExplainer output (it only shows the chain type) is not always helpful, e.g.
Code: Select all
8.6, Region Forcing Chains, -> (w/26 nodes): -> Multiple Forcing Chains, ED=8.0 + 0.6:   25 -   32 nodes
8.7, Cell Forcing Chains,   -> (w/34 nodes): -> Multiple Forcing Chains, ED=8.0 + 0.7:   33 -   48 nodes

8.8, Region Forcing Chains, -> (w/11 nodes): -> Dynamic Forcing Chains,  ED=8.5 + 0.3:    9 -   12 nodes

9.0, Cell Forcing Chains,   -> (w/22 nodes): -> Dynamic Forcing Chains,  ED=8.5 + 0.5:   17 -   24 nodes
9.1, Cell Forcing Chains,   -> (w/27 nodes): -> Dynamic Forcing Chains,  ED=8.5 + 0.6:   25 -   32 nodes


I have a version of SE that also outputs the number of nodes in the chains, the rest of the info can be inferred.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

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

Postby 1to9only » Fri Jun 04, 2021 1:31 pm

The discussion has also gone very off topic: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

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

Postby denis_berthier » Fri Jun 04, 2021 2:09 pm

1to9only wrote:The discussion has also gone very off topic: PGExplainer - a Minimal SudokuExplainer, in 56,712 bytes

Knowing what the ratings are based upon is not so much off topic. Aren't you using the same ratings as SE?
I think it's good that your fast version of it allowed to clarify this point that had always been very nebulous.
denis_berthier
2010 Supporter
 
Posts: 4208
Joined: 19 June 2007
Location: Paris

SE Ratings List

Postby 1to9only » Fri Jun 11, 2021 9:36 am

I've built a list of SE Ratings from puzzles submitted in the Patterns Game ONLY (up to 0420 inclusive)!!
It is different (and may be missing items) from the Mike Barker list!!!

Short List: https://github.com/1to9only/patterns-game/raw/main/001-420-short.txt [deleted]
Long List: https://github.com/1to9only/patterns-game/raw/main/001-420-long.txt [deleted]

[To View: Click on link] [To Save: Right-click on link, and select 'Save linked content as...']
The Long List contains (for some SE Ratings) the most recent (I think!) puzzle (up to PG420) where the SE Rating appeared.
999_Springs's ED=5.3 appears in both lists!!

Edit 04/26: files have been deleted.
Last edited by 1to9only on Tue Apr 26, 2022 9:57 am, edited 2 times in total.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Next

Return to Interactive games