The Sudoku Hierarchical Classifier (SHC)

Programs which generate, solve, and analyze Sudoku puzzles

The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Fri Oct 06, 2023 4:44 pm

.
This is to announce the publication of a software by François Cordoliani (Defise on this forum) on GitHub, the Sudoku Hierarchical Classifier (SHC): https://github.com/denis-berthier/Sudoku_Hierarchical_Classifier

The SHC computes 4 classifications of 9x9 puzzles:
    T&E-depth
    B-rating for the puzzles in T&E(1)
    BxB classification for the puzzles in T&E(2)
    BxBB classification for the puzzles in T&E(3)
The development of the SHC was based on the same references as CSP-Rules or SudoRules but the implementations were totally independent.

All the classification results of the SHC and of SudoRules completely coincide on the large collections of puzzles used to compare them.

The SHC is much faster than SudoRules for the functionalities it implements.
It is hoped that the T&E-depth and BpB parts will be very useful in the search for the "hardest" puzzles in T&E(2).

Details are available on GitHub.
See also :http://forum.enjoysudoku.com/hierarchical-classifications-in-constraint-satisfaction-t42076.html for theoretical background, classification results, computation times and their comparison with SER times.

[Edit:] Renamed BpB and BpBB as BxB and BxBB
.
Last edited by denis_berthier on Sat Aug 31, 2024 2:35 am, edited 1 time in total.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Thu Oct 19, 2023 11:01 am

.
Today's update on GitHub includes a few speed improvements (up to 30% for the BpB calculations).
In the examples directory, "message" files" have been updated to reflect the new computation times.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Wed Nov 01, 2023 2:12 pm

.
Today's update on GitHub includes large speed improvements made by François. Here are the factors computation times have to be divided by, wrt to the previous version, for the standard examples:

TE-depth : 18,6
B : 4,2
BpB : 5,3
BpBB : 10,5

In the examples directory, "message" files" have also been updated to reflect the new computation times.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby Hajime » Wed Nov 01, 2023 3:36 pm

I read the pdf 2023-HCCS.pdf.
In it is a table from SER=10.6 to 11.9 and from SHC=B2B to B7B.
Apart from a higher granularity in SER (14 steps) versus SHC (6 steps) , how is the SHC rating below SER 10.6 ?
User avatar
Hajime
 
Posts: 1375
Joined: 20 April 2018
Location: Fryslân

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Wed Nov 01, 2023 4:24 pm

Hajime wrote:I read the pdf 2023-HCCS.pdf.
In it is a table from SER=10.6 to 11.9 and from SHC=B2B to B7B.
Apart from a higher granularity in SER (14 steps) versus SHC (6 steps) , how is the SHC rating below SER 10.6 ?


Note that there's no SHC rating per se. SHC is a program that computes 4 classifications.

Table 2.2 is for puzzles in T&E(2).
All the classification results in T&E(2) must be taken with some grain of salt. We have no unbiased collection of T&E(2) puzzles - and not even one with a known bias.
I chose eleven's collection for this table because it was built without using patterns (contrary to the ph2010 database). But even so, we don't know how its distribution is related to the real distribution within T&E(2).

As for puzzles with SER < 10.6 [and > 9.1, because those with SER < 9.1 are usually in T&E(1)]:
- we have no collection that could serve as a reference;
- the T&E(1) vs T&E(2) line cuts somewhere in this range of SERs (but depending on each puzzle);
- therefore, different sub-classifications will apply (B vs BpB)
- based on the results of table 2.2, one can conjecture that, for the T&E(2) part, each value B1B, B2B, B3B spreads over several SER values.

In short, I have no real answer.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Fri Nov 10, 2023 3:56 pm

.
A few minor changes today.
Following the discovery of puzzles in BpB for p>7 (http://forum.enjoysudoku.com/the-bpb-classification-of-t-e-2-puzzles-t41922-5.html), the default values of buffer-size have been increased, because such cases may require more partial-braids.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Thu Nov 23, 2023 9:15 am

.
fix rare out-of-memory bug
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Sun Nov 26, 2023 11:10 am

.
1) In order to make it easier to identify which version number you are using and to report possible problems, a command has been added:
Code: Select all
java -jar SHC.jar version

gives the version number: *** SHC version 5.2 ***


2) In case a negative value is obtained for the classification of some puzzle in a file (which might be unnoticed by the user), a message is now issued in the Terminal / Command Window:
Code: Select all
===> Problem encountered while processing your input file.
===> Check your output file for negative values and see the manual for their interpretation.


The manual gives the following interpretations:
Code: Select all
-1 : this puzzle is not in the right format, or it has no solution, or it has several solutions; check your puzzle;
-2 : <max-time> allowed is too short for this puzzle; try increasing it;
-3 : <buffer-size> is too small for this puzzle; try increasing it;
-4 :  other problems encountered, such as:
         . <classif> is not  relevant for this puzzle (e.g. applying the BpB rating to a puzzle in T&E(3)); check the T&E-depth of this puzzle;<br>
         . <max-length> is too small for this puzzle (can appear mainly in case <classif> = B); try increasing it;
                 ( note that if you increase <max-length>, you may also have to increase <max-time> and/or <buffer-size>).
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Mon Dec 04, 2023 12:03 pm

.
Only one small change today, but it will make it easier to include SHC in scripts (in particular in the search for the "hardest" puzzles).
(This was suggested by Coloin and Hendrik. Thanks to them for their remarks.)
Version number is 5.3

A new option appears in the command line: (-auto-end <auto-end>). <auto-end> is true by default. It means that, at the end of computations, the process will terminate automatically. If SHC is embedded in a script, the script will not be blocked.
Set <auto-end> to false if you want to restore the old behaviour (that's useful only on Windows, if you want to have time to see the messages in the console at the end of computations).

[Edit]: One more change I forgot to mention: the -erase option is now true by default. (Keeping old values in files led me to too many errors when trying to extract puzzles with fixed rating.) You can change it to false it you prefer keeping the previous results.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Fri Dec 08, 2023 4:41 am

.
SHC 5.4 fixed a bug that occurred in case there were 81 clues.
Not a situation very likely to happen - but it happened to one user, so we made the road safer.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Mon Feb 05, 2024 5:00 am

.
A new utility has been added: expansion by Singles. Syntax:
java -jar Expand.jar (-input <input-file>) (-output <output-file>) (-erase <erase>) (-auto-end <auto-end>) (-puzzle <puzzle>)
with all the options working the same way as in SHC.jar.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Thu Feb 15, 2024 7:16 am

.
Following the discovery of puzzles in B14B by Hendrik and Coloin, the default max-length value for the BpB rating is now 14. (You can always change it with the options).
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Thu May 02, 2024 6:41 am

.
In order to avoid any confusion between the BpB classification and the BpB rating of a puzzle, the BpB classification has been renamed BxB classification. This is more consistent with the common usage that x is the unknown.
Reminder:
- in "BxB classification", the "x" is the value to be found for the puzzle.
- in "BpB rating", p is fixed and what's to be found is the minimal length of Bp-braids necessary to solve the puzzle.

As a result, the SHC line command has changed: in <classif>, BxB and BxBB must now be used instead of BpB and BpBB.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Wed Sep 25, 2024 8:25 am

.
The new release 6.1 of the SHC brings speed increases for the B and BxB calculations.
Little change will appear for small values of B or BxB, but the larger the value of x, the larger the difference will be in the mean.
The gain factor may be as large as 7 for high BxB and as large as 24 for the highest known B values.
This is expected to be very useful in the current hunting of snarks with high BxB values.

BEWARE that the meaning of parameter <max-time> has changed; it now applies only to the full list of of puzzles in a file. See the README.md for details.

.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris

Re: The Sudoku Hierarchical Classifier (SHC)

Postby denis_berthier » Thu Oct 03, 2024 6:32 am

.
Following the speed improvements brought by François to SHC 6.1, I've expanded the standard set of BxB examples. See thehttp://forum.enjoysudoku.com/hierarchical-classifications-in-constraint-satisfaction-t42076.html thread for the corresponding updated table.
.
denis_berthier
2010 Supporter
 
Posts: 4213
Joined: 19 June 2007
Location: Paris


Return to Software