Help With Sudoku Explainer

Interactive on-site game threads go here

Re: Help With Sudoku Explainer

Postby m_b_metcalf » Wed Jan 06, 2021 10:35 am

1to9only wrote:Wished there was a way to flag these users for deletion??


A PM to Pat?
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13637
Joined: 15 May 2006
Location: Berlin

Re: Help With Sudoku Explainer

Postby JPF » Mon Jun 14, 2021 10:16 pm

This puzzle
Code: Select all
+---+---+---+
|...|...|432|
|...|...|716|
|...|...|589|
+---+---+---+
|...|726|...|
|...|451|...|
|...|938|...|
+---+---+---+
|287|314|695|
|416|895|327|
|935|267|148|
+---+---+---+
has 10 solutions.
The 10 solutions have cells in common, giving what I call the "closure" of the puzzle.
Here is the closure:
Code: Select all
+---+---+---+
|...|.79|432|
|3..|582|716|
|...|.43|589|
+---+---+---+
|..3|726|.5.|
|...|451|..3|
|...|938|2..|
+---+---+---+
|287|314|695|
|416|895|327|
|935|267|148|
+---+---+---+

two questions:
  • how to use Sudoku Explainer to find the closure?
  • what is the corresponding rating?
Note: when a puzzle has a unique solution, its closure is its solution grid.

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

Re: Help With Sudoku Explainer

Postby 999_Springs » Tue Jun 15, 2021 12:08 am

JPF wrote:two questions:
  • how to use Sudoku Explainer to find the closure?
  • what is the corresponding rating?
Note: when a puzzle has a unique solution, its closure is its solution grid.

JPF

for a multi solution (or no solution) puzzle you can use the GUI and click "solve step" and keep track of the highest rating of the steps. when it goes above 6.2, it'll start yelling at you that the puzzle is invalid, but you can click on "get next hint" to ignore the warnings. note that there is a limit at which SE stops giving hints on invalid puzzles, i believe it works up to dynamic (+), but not dynamic (+ fc). so if no hints show up under "get next hint" either you have reached the closure or the next step is 10+. also note that if you do this, you really have to disable uniqueness and BUG techniques because you can't use them for multi solution puzzles.

i actually did this a while ago to try to identify hard 6x6 sudokus by cramming 7,8,9 into the remaining cells and ignoring all the bright red warnings on screen, before 1to9only came up with the modified SE for 6x6s

your puzzle is 7.2/2.0/2.0

m_b_metcalf wrote:
1to9only wrote:Wished there was a way to flag these users for deletion??


A PM to Pat?

Pat isn't really active much here anymore and this wouldn't work anyway because a forum mod can't delete accounts, only posts (i know this as i have been a forum mod elsewhere)

you can report a post by clicking the triangular ! at the top next to the quote button, which will alert it to jasonlion, but he has shown himself to be notoriously incompetent at identifying spam accounts over these years as you can clearly see from all the obvious spambot posts building up in the general and off topic sections recently
999_Springs
 
Posts: 591
Joined: 27 January 2007
Location: In the toilet, flushing down springs, one by one.

Re: Help With Sudoku Explainer

Postby JPF » Tue Jun 15, 2021 10:32 am

Thanks 999_Springs!
The method is a bit rustic, but it works for this puzzle.

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

re: spam

Postby Pat-Moderator » Wed Jul 07, 2021 11:55 am


    now banned

      Zitmet
      meghanhal1978
User avatar
Pat-Moderator
Moderator
 
Posts: 54
Joined: 18 July 2005

SukakuExplainer (2021.9.23)

Postby 1to9only » Thu Sep 23, 2021 3:55 pm

JPF wrote:This puzzle
Code: Select all
+---+---+---+
|...|...|432|
|...|...|716|
|...|...|589|
+---+---+---+
|...|726|...|
|...|451|...|
|...|938|...|
+---+---+---+
|287|314|695|
|416|895|327|
|935|267|148|
+---+---+---+
has 10 solutions.
The 10 solutions have cells in common, giving what I call the "closure" of the puzzle.
Here is the closure:
Code: Select all
+---+---+---+
|...|.79|432|
|3..|582|716|
|...|.43|589|
+---+---+---+
|..3|726|.5.|
|...|451|..3|
|...|938|2..|
+---+---+---+
|287|314|695|
|416|895|327|
|935|267|148|
+---+---+---+

two questions:
  • how to use Sudoku Explainer to find the closure?
  • what is the corresponding rating?
Note: when a puzzle has a unique solution, its closure is its solution grid.

JPF

I've modified my version (2021.9.23) of SukakuExplainer here to rate sudokus with multiple solutions.
Use -M for sudokus with multiple solutions. Using -M disables the UL and BUG solving techniques (as noted by 999_Springs in his response).
Code: Select all
java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate -M --input=sample.txt --output=sample.se

java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.pencilmarks -M --input=sample.txt >sample.p

java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.hints -M --input=sample.txt >sample.h

The 10-solutions sudoku posted by JPF is rated ED=7.2/2.0/2.0:
Code: Select all
2.0, Direct Hidden Pair: Cells R2C6,R3C6: 2,3 in block: r2c6<>9, r1c6=9
2.0, Direct Hidden Pair: Cells R1C4,R3C4: 1,6 in block: r1c4<>5, r2c4=5
2.0, Direct Hidden Pair: Cells R4C9,R6C9: 1,4 in block: r4c9<>3, r5c9=3
2.0, Direct Hidden Pair: Cells R5C8,R6C8: 6,7 in block: r6c8<>5, r4c8=5
2.0, Direct Hidden Pair: Cells R4C7,R5C7: 8,9 in block: r5c7<>2, r6c7=2
3.0, Naked Pair: Cells R6C3,R6C9: 1,4 in row: r6c1<>1, r6c2<>4
7.1, Forcing Chain (w/6 nodes): R4C3.1 off: r4c3<>1
7.1, Forcing Chain (w/6 nodes): R4C1.3 off: r4c1<>3
1.2, Hidden Single: R4C3: 3 in block 4: r4c3=3
7.2, Forcing Chain (w/8 nodes): R2C3.8 off: r2c3<>8
7.2, Forcing Chain (w/8 nodes): R2C2.2 off: r2c2<>2
3.0, Naked Pair: Cells R2C2,R4C2: 4,9 in column: r3c2<>4, r5c2<>9
7.2, Forcing Chain (w/8 nodes): R1C5.7 on: r1c5<>8, r1c5=7
1.2, Hidden Single: R2C5: 8 in block 2: r2c5=8
1.0, Hidden Single: R3C5: 4 in column 5: r3c5=4
2.0, Direct Hidden Pair: Cells R2C2,R2C3: 4,9 in row: r2c3<>2, r2c6=2
1.0, Hidden Single: R3C6: 3 in column 6: r3c6=3
1.2, Hidden Single: R2C1: 3 in block 1: r2c1=3
ED=7.2/2.0/2.0
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: Help With Sudoku Explainer

Postby JPF » Sat Sep 25, 2021 9:48 am

Thanks again 1to9only for this new feature in SukakuExplainer!

As I wrote to you by PM, there are situations where the number of solutions is very large but where the closure or/and the rating is/are obvious.
Example:
Code: Select all
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
|...|123|...|
|...|4.6|...|
|...|789|...|
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+

Without precaution, the program loops ad infinitum.
You gave me the method by PM; it may be useful to disclose it to any reader.

I tested the program on this puzzle:
Code: Select all
+---+---+---+
|...|...|9..|
|.5.|..3|...|
|7..|.4.|..2|
+---+---+---+
|...|..5|.3.|
|..1|.9.|7..|
|.8.|6..|...|
+---+---+---+
|2..|.1.|..7|
|...|8..|.6.|
|..9|...|4..|
+---+---+---+    Game 434 highest rating, r1c3 deleted

86 solutions
closure = initial puzzle ; ie no cell placement
ED=12.2/0.0/11.5
timing: about 6 hours
Pencilmarks:
Code: Select all
initial:
+----------------------+----------------------+----------------------+
| 13468  12346  23468  | 1257   25678  12678  | 9      14578  134568 |
| 14689  5      2468   | 1279   2678   3      | 168    1478   1468   |
| 7      1369   368    | 159    4      1689   | 13568  158    2      |
+----------------------+----------------------+----------------------+
| 469    24679  2467   | 1247   278    5      | 1268   3      14689  |
| 3456   2346   1      | 234    9      248    | 7      2458   4568   |
| 3459   8      23457  | 6      237    1247   | 125    12459  1459   |
+----------------------+----------------------+----------------------+
| 2      346    34568  | 3459   1      469    | 358    589    7      |
| 1345   1347   3457   | 8      2357   2479   | 1235   6      1359   |
| 13568  1367   9      | 2357   23567  267    | 4      1258   1358   |
+----------------------+----------------------+----------------------+

final:
+----------------------+----------------------+----------------------+
| 13468  124    23468  | 1257   25678  12678  | 9      14578  134568 |
| 1489   5      248    | 1279   2678   3      | 168    147    1468   |
| 7      1369   368    | 159    4      1689   | 3568   158    2      |
+----------------------+----------------------+----------------------+
| 469    24679  2467   | 1247   278    5      | 1268   3      14689  |
| 3456   2346   1      | 234    9      248    | 7      2458   4568   |
| 3459   8      23457  | 6      237    1247   | 125    12459  1459   |
+----------------------+----------------------+----------------------+
| 2      346    34568  | 3459   1      469    | 358    589    7      |
| 1345   1347   3457   | 8      2357   2479   | 1235   6      1359   |
| 13568  1367   9      | 2357   23567  267    | 4      1258   1358   |
+----------------------+----------------------+----------------------+

6 candidate eliminations

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

Re: Help With Sudoku Explainer

Postby 1to9only » Sat Sep 25, 2021 10:35 am

JPF wrote:As I wrote to you by PM, there are situations where the number of solutions is very large but where the closure or/and the rating is/are obvious.
Example:
Code: Select all
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
|...|123|...|
|...|4.6|...|
|...|789|...|
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+

Without precaution, the program loops ad infinitum.
You gave me the method by PM; it may be useful to disclose it to any reader.

The sudoku still has lots of pencilmarks, this slows down SE considerably when it tries to find (Dynamic/Nested) Forcing Chains.
This particular sudoku (ED=1.0/1.0/1.0) can be rated (quickly) by turning off some of the Chains techniques:
-Open SE GUI, goto "Options->Solving techniques..." and disable some Forcing Chains (the last 3 or 4), exit GUI.
-Rate the sudoku with -M and -T options (-T = use the saved techniques, options are saved in a json file).
Code: Select all
java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate -M -T --input=sample.txt --output=sample.se

After, re-enable all solving techniques in "Options->Solving techniques...", or delete the json file (it gets recreated next time SE is run).
E.g.: After disabling Dynamic and Nested Forcing Chains, this should be in the json file:
Code: Select all
"techniques":"111111111111111111111111000",

JPF wrote:I tested the program on this puzzle:
Code: Select all
+---+---+---+
|...|...|9..|
|.5.|..3|...|
|7..|.4.|..2|
+---+---+---+
|...|..5|.3.|
|..1|.9.|7..|
|.8.|6..|...|
+---+---+---+
|2..|.1.|..7|
|...|8..|.6.|
|..9|...|4..|
+---+---+---+    Game 434 highest rating, r1c3 deleted

86 solutions
closure = initial puzzle ; ie no cell placement
ED=12.2/0.0/11.5
timing: about 6 hours

If you are able to build PGExplainer.jar, comment out line 181 in Solver.java:
From:
Code: Select all
            if (hint == null) {
                difficulty = 20.0;
                break;
            }

To:
Code: Select all
            if (hint == null) {
//              difficulty = 20.0;
                break;
            }

The resulting PGExplainer.jar should serate several times faster than my SukakuExplainer.jar. I've not tried this myself.
No -M or -T options are required (not needed/implemented).
The modified PGExplainer should still work with Patterns Games puzzles which are minimal and have unique solutions.
Edit: You probably have to disable UL and BUG solving techniques for serate to work correctly with sudokus with multiple solutions.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: Help With Sudoku Explainer

Postby 1to9only » Sun Sep 26, 2021 7:21 am

1to9only wrote:
JPF wrote:ED=12.2/0.0/11.5
timing: about 6 hours

If you are able to build PGExplainer.jar, comment out line 181 in Solver.java:

Using a modified PGExplainer, I got the same rating after 2h37m.
If there is interest (it will save you a bit of time on future runs), I can look into releasing a PGExplainer for sudokus with multiple solutions.
Otherwise no release, as I already have too many versions of SE to want to maintain!
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: Help With Sudoku Explainer

Postby JPF » Sun Sep 26, 2021 2:07 pm

1to9only wrote:If you are able to build PGExplainer.jar...
I'm afraid I am not.
you wrote:If there is interest (it will save you a bit of time on future runs), I can look into releasing a PGExplainer for sudokus with multiple solutions.
Sure, thanks!
BTW, does PGExplainer "only" serate puzzles, without giving the techniques used and the successive candidate eliminations ?

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

Re: Help With Sudoku Explainer

Postby 1to9only » Sun Sep 26, 2021 4:03 pm

I created PGExplainer (for speed) for the Patterns Game by removing all code not needed by serate from SE.

I'll update PGExplainer (to rate sudokus with multiple solutions) in the next few days.
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

SukakuExplainer (2021.9.28)

Postby 1to9only » Tue Sep 28, 2021 8:53 am

New version (2021.9.28) of SukakuExplainer here to rate custom extra regions sudokus, use -U option.
To use this feature in command-line: serate, hints, pencilmarks and solve:
In GUI, setup the sudoku with the correct extra regions layout. Exit GUI. This saves the layout in SukakuExplainer.json.
Example:
Code: Select all
java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate -U -X --input=custom.txt --output=custom.se
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

PGExplainer (2021.9.28)

Postby 1to9only » Tue Sep 28, 2021 9:49 am

1to9only wrote:I'll update PGExplainer (to rate sudokus with multiple solutions) in the next few days.

PGExplainer (2021.9.28): see http://forum.enjoysudoku.com/pgexplainer-a-minimal-sudokuexplainer-in-56-712-bytes-t39049-15.html#p310358
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: Help With Sudoku Explainer

Postby 1to9only » Tue Oct 05, 2021 9:03 am

I've added Odd/Even sudokus to SukakuExplainer (2021.10.5).

Image
OddEven-X sudoku from this thread: here.

Code: Select all
.3.........2......4..6.........1..7.3.7...5.1.8..3.........8..2......4.........9.

...e..o......e.o.........ooe.........e.....e.........eoo.........o.e......o..e...


Under 'Variants', select 'Odd/Even... (text input)' to enter the 81-chars Odd/Even layout to indicate the cells with odd and even numbers; use 'o' and 'e' for odd and even cells.

To use command-line SE, use the -V option:
Code: Select all
-V      for odd/eVen sudokus (odd or even, or both odd and even in sudoku)

Use the GUI to setup the sudoku with the correct Odd/Even layout. Exit GUI. This saves the layout in SukakuExplainer.json.

Example:
Code: Select all
java.exe -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate -V --input=oddeven.txt --output=oddeven.se

For diagonals, add -X.

Some Odd/Even sudokus I grabbed off the internet: Show
Code: Select all
7.3.5..64.8.....57.............9.......2.1.......6...38........14.....8.37..2.6.9 ED=1.5/1.2/1.2
...................ee..ooooe..e.o...e..e.ooo.e..e.o....ee..oooo..................

Source: https://letssudoku.blogspot.com/2018/08/sudoku-5-odd-even-sudoku_1.html

Code: Select all
.6...123.3....456..................2.........6..................412....7.964...5. ED=2.0/1.2/1.2
...................oeo.eoe..e.e.o....o.o.eoe..e.e.o....oeo.eoe...................

Source: https://www.gmpuzzles.com/blog/2018/06/even-odd-sudoku-by-kishore-kumar-sridharan/

Code: Select all
.....7216.....4975.............................................2745.....9582..... ED=3.2/2.5/2.5
...........o.......o.o......o.o..ee..o.o.e.....o..eee......e.........ee..........

sublime "odd even" sudoku, created by sam cappleman-lynes
featured on Cracking The Cryptic: https://www.youtube.com/watch?v=Q7hhVgE8zGM

Code: Select all
..68.45...5..7..1.7...2...61.......5.64...72.5.......19...4..6..1..3.2....31.5... ED=1.2/1.2/1.2
eoeeoeoooeooooeeoeoeooeooeeoeoeeeooooeeooooeeooeoeoeeooooeeeoeoeoeeooeooeeooooeoe

Source: https://rishipuri.blogspot.com/2013/01/even-odd-sudoku-2013-2.html

Code: Select all
....4..9......9..6..9...7.....7...6.1...6...5.2...5.....3...4..2..4...5..7..5.... ED=1.5/1.2/1.2
...e.......e.e.....e...e...e.....e...e.....e...e.....e...e...e.....e.e.......e...

Source: https://www.gmpuzzles.com/blog/2019/07/even-odd-sudoku-by-ashish-kumar-4/

Code: Select all
....4..9......9..6..9...7.....7...6.1...6...5.2...5.....3...4..2..4...5..7..5.... ED=2.8/1.2/1.2
...o.......o.o.....o...o...o.....o...o.....o...o.....o...o...o.....o.o.......o...

Source: https://www.gmpuzzles.com/blog/2019/07/even-odd-sudoku-by-ashish-kumar-5/
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Postby 1to9only » Wed Mar 23, 2022 10:30 am

[Repost from some stuff I posted on GitHub]

SE Chains ratings are made up of a Base Rating + a Complexity Rating which depends on the total (including nested) chain length. In the SE code chain length is also referred to as chain complexity. And elsewhere I refer to nodes, which is just chain complexity minus 2.

BASE RATING
Code: Select all
Technique               Chain   Nesting                         Base
                        Level   Level   Multi   Dynamic Nishio  Rating

ForcingChainCycle       0               false   false   false    6.6    7.0 if both X-/Y- chains

NishioForcingChain      0                        true    true    7.5
DynamicForcingChain     0                true    true            8.5
MultipleForcingChain    0                true                    8.0

DynamicForcingChainPlus 1       0        true    true            9.0  + nested sets!

NestedForcingChain      2       0        true    true            9.5  + nested ForcingChainCycle        (6.6)
NestedForcingChain      3       0        true    true           10.0  + nested MultipleForcingChain     (8.0)

NestedForcingChain      4       0        true    true           10.5  + nested DynamicForcingChain      (8.5)
NestedForcingChain      4       1        true    true           10.5  + nested DynamicForcingChainPlus  (9.0)
NestedForcingChain      4       2        true    true           10.5  + nested NestedForcingChain       (9.5)

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

So it is possible to get similar rated puzzles with vastly different chains length:
Code: Select all
11.6, Contradiction Forcing Chain (w/816 nodes)
11.6, Nested Forcing Chains (+ Multiple Forcing Chains), ED=10.0 + 1.6 (769-1024 nodes)
4.69......2...8...5..6..7..9.4...5..........8.1...7.3...74..6.......9..1....3..2. # 0414  12  11.6/11.6/9.3

11.6, Region Forcing Chains (w/158 nodes)
11.6, Nested Forcing Chains (+ Dynamic Forcing Chains), ED=10.5 + 1.1 (129-192 nodes)
.....3..7.7.....1...9.6.8.......1..5..8.2.9..4..6.......6.4.2...5.....3.2..8..... # 0427   2  11.6/11.6/9.9

The 2 puzzles are from the Patterns Game.

In Classic Sudoku, typically the highest rated puzzles have 257-384 nodes (ED=11.8) and 385-512 nodes (ED=11.9).

In 16x16 Sudoku, the highest rated puzzle I've seen has 24577-32768 nodes (ED=13.1).
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

PreviousNext

Return to Interactive games