projects skfr-fast-rating and sudoku-multi-purpose-program

Programs which generate, solve, and analyze Sudoku puzzles

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Sun Jun 10, 2018 12:03 pm

emerentius_ wrote:Google Code has gone down and with it all the links to source code in this thread. Could you make the code available again, champagne?

I've been working on extending my library with a human strategy solver for use in SudokuExplainer like programs as well as for fast rating. Maybe not as fast as a specialized rater, but fast nonetheless. It would be useful to compare my code to prior art.


No problem to deliver the skfr sources, (just the time to find where they are on the web) but where you are, I think that it is of small value.

As I could write in other places, I have in hands a frame about 10 times faster than skfr.

The previous version (skmpp) has been coded till the nested simple cases, The current version (skmppv2) is for the time being in the low ratings (<6.5) but with a coding cloning in a better way Sudoku Explainer. It seems to be 15 times faster than skfr in the range 1.0 6.2

I am open to built a team to work on it and I can share without any restriction the code, except that the working files are still very dirty. Not a good situation to put them in a "github" repository.
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby emerentius_ » Sun Jun 10, 2018 3:43 pm

That would be cool, but it may still be nice to have old code available for reference. I don't think there is a minimum code quality before things can be thrown on github. One can always put the code in side-branches and clean it up later or even nuke the whole repo (I do like to keep history rewriting of master to a minimum). Alternatively, Gitlab offers free private repos.

It seems like most people here are on windows. I may have to adapt the code a bit so that it compiles on linux. I'm interested to see how my solver compares. So far I haven't found any rater's source code to compare it to. Information is somewhat scattered across the forum.

Edit: Oh, it looks like skfr at least is part of dobrichev's gridchecker repo
emerentius_
 
Posts: 23
Joined: 09 January 2018

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Mon Jun 11, 2018 4:12 am

emerentius, I answered thru pm, see your pm box
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby yzfwsf » Thu Jul 25, 2019 5:21 pm

can skfr output the total number of chains
yzfwsf
 
Posts: 905
Joined: 16 April 2019

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Thu Jul 25, 2019 7:42 pm

yzfwsf wrote:can skfr output the total number of chains

Hi yzfwsf,
Not an easy answer to such a question.

In skfr, "f" is "fast". To be fast (toward the rating rules of Sudoku Explainer), you have many by-pass when the highest rating has been reached.

But as long as the highest rating has not been reached, the -t option (log of the output), shows the detailed path used for the rating.
Not so easy to read, but I can help you if it is of interest in your case.
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby yzfwsf » Fri Jul 26, 2019 8:02 am

Hi champagne, can easy modify the code to provide a option for output the total number of chains, I’m using dll version. Tks
yzfwsf
 
Posts: 905
Joined: 16 April 2019

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Fri Jul 26, 2019 9:42 am

yzfwsf wrote:Hi champagne, can easy modify the code to provide a option for output the total number of chains, I’m using dll version. Tks

If you have a clear definition of the total number of chains , surely this can be done (although this is an old code not changed for years). But I have to confess that I have no idea of what can be your definition.
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby 1to9only » Fri Jul 26, 2019 11:10 am

SudokuExplainer (SE) can analyse a sudoku grid, and it displays a summary of techniques used to solve.

For example, if this puzzle is in a file named puzzle.txt:
Code: Select all
..4....3..2.1..9..6.......7.9.5..1......2.8.3.......4..5.28....3....4.....8.9....

You can have more than one puzzle in the file, one puzzle per line.

Run SE as follows:
Code: Select all
java.exe -Xrs -Xmx500m -cp SudokuExplainer.jar diuf.sudoku.test.Tester puzzle.txt puzzle.log

The output (in puzzle.log) looks like this:
Code: Select all
Analyzing Sudoku #1
57 Hidden Single
2 Direct Hidden Pair
1 Naked Single
10 Pointing
2 Claiming
5 Naked Pair
3 Hidden Pair
1 Naked Triplet
1 XY-Wing
1 XYZ-Wing
3 Turbot Fish
1 Forcing X-Chain
1 Bidirectional Y-Cycle
8 Forcing Chain
1 Nishio Forcing Chains
1 Region Forcing Chains
4 Dynamic Cell Forcing Chains
52 Dynamic Contradiction Forcing Chains
7 Dynamic Region Forcing Chains
Hardest technique: Dynamic Contradiction Forcing Chains
Difficulty: 9.5

The only thing is: SE is slow!!
User avatar
1to9only
 
Posts: 4177
Joined: 04 April 2018

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Fri Jul 26, 2019 1:30 pm

1to9only wrote:SudokuExplainer (SE) can analyse a sudoku grid, and it displays a summary of techniques used to solve.

Sudoku Explainer solves step by step. To save time, SKFR does as much as possible in parallel, a similar list would be shorter, showing at each step the active "family" or rules applied, this would be a "short" of the log file.
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby yzfwsf » Fri Jul 26, 2019 2:45 pm

If you have a clear definition of the total number of chains , surely this can be done (although this is an old code not changed for years). But I have to confess that I have no idea of what can be your definition.

Hi champagne, I mean following SolvingTechnique in skfr
AlignedPairExclusion
AIC_X_cycle
Forcing_ChainX
AIC_XY
AlignedTripletExclusion
NishioForcingChain
MultipleForcingChain
DynamicForcingChain
DynamicForcingChainPlus
NestedForcingChain
NestedLevel3
NestedLevel4
NesttedLevel5
yzfwsf
 
Posts: 905
Joined: 16 April 2019

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Fri Jul 26, 2019 6:59 pm

The sequence here will be exactly the same as in Sudoku Explainer (see 1to9only post).
As far as I remember, nested levels 4 5 have never been seen. I am not sure that nested level 3 has been active.
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby yzfwsf » Sun Jul 28, 2019 3:23 am

champagne wrote:Sudoku Explainer solves step by step. To save time, SKFR does as much as possible in parallel, a similar list would be shorter, showing at each step the active "family" or rules applied, this would be a "short" of the log file.

Hi champagne,means one cycle parallel do many step? I already modified int PUZZLE::Traite(char * ze) like if (stepbystep || (ermax < 74)),but still not stepbystep :cry:
yzfwsf
 
Posts: 905
Joined: 16 April 2019

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Sun Jul 28, 2019 5:34 am

yzfwsf wrote:
champagne wrote:Sudoku Explainer solves step by step. To save time, SKFR does as much as possible in parallel, a similar list would be shorter, showing at each step the active "family" or rules applied, this would be a "short" of the log file.

Hi champagne,means one cycle parallel do many step? I already modified int PUZZLE::Traite(char * ze) like if (stepbystep || (ermax < 74)),but still not stepbystep :cry:

Hi yzfwsf,

Keep in mind that skfr has been written to rate "in the mood of Sudoku Explainer", but much faster for the interactive game.
The output of Sudoku Explainer (serate) is then ER/EP/ED that's it.

All valid shortcuts in the process have been used to speed up the rating.
In a "skfr cycle", the first "rule" that can be applied is searched. Then all possible actions fitting with the rule and the rating are done.
Take for example the UR rule. If several UR's can be solved in the cycle giving the same rating, they are all applied. Same with XY chains; NIshio .....

Changing this would be a big task.

On my side, skfr is obsolete and I have in my new frame something much faster. I am still using skfr for the last level not yet implemented in my new frame. 'nested levels"
I did not change my preference which is to do in one cycle all actions of "same difficulty".
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby yzfwsf » Sun Jul 28, 2019 5:48 am

champagne wrote:Hi yzfwsf,

Keep in mind that skfr has been written to rate "in the mood of Sudoku Explainer", but much faster for the interactive game.
The output of Sudoku Explainer (serate) is then ER/EP/ED that's it.

All valid shortcuts in the process have been used to speed up the rating.
In a "skfr cycle", the first "rule" that can be applied is searched. Then all possible actions fitting with the rule and the rating are done.
Take for example the UR rule. If several UR's can be solved in the cycle giving the same rating, they are all applied. Same with XY chains; NIshio .....

Changing this would be a big task.

On my side, skfr is obsolete and I have in my new frame something much faster. I am still using skfr for the last level not yet implemented in my new frame. 'nested levels"
I did not change my preference which is to do in one cycle all actions of "same difficulty".

Hi champagne,when apply same rating step,can counts the steps only for chains?
yzfwsf
 
Posts: 905
Joined: 16 April 2019

Re: projects skfr-fast-rating and sudoku-multi-purpose-progr

Postby champagne » Sun Jul 28, 2019 7:26 am

yzfwsf wrote:Hi champagne,when apply same rating step,can counts the steps only for chains?

Having the source, you can change what you want.
Having no idea of the final target, it's not easy to answer in the right way.
What is for sure is that the chains used to make eliminations are not too hard to identify, although they are not at the same place in fast mode (rating already very high) and in normal mode
champagne
2017 Supporter
 
Posts: 7455
Joined: 02 August 2007
Location: France Brittany

PreviousNext

Return to Software