Team project: C or C++ Explainer-like rating program

Programs which generate, solve, and analyze Sudoku puzzles

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Mon Oct 25, 2010 6:12 am

I loaded my file of puzzles from the pattern game (games 1_122)
http://gpenet.pagesperso-orange.fr/downloads/igames.txt

this is an unofficial file, but it should contain nearly all puzzles submitted

champagne
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Mon Oct 25, 2010 7:45 am

some work for iksudoku.

I face huge difficulties to match SE results in the UR/UL area

I am already using Fixed3 version from iksudoku to eliminate some bugs, but others seem to be there;

here a lot of puzzles where my solver finds a hidden pair rated 4.5.
instead, SE uses a naked pair rated 4.6.

I don't understand why.

If we want to succeed in our project, we must switch one day to a fixed version of SE. The only question seems to be when?

champagne

Code: Select all
1...2...3
.4.....5.
...6.7...
..5...1..
6...8...7
..3...9..
...5.9...
.7.....1.
2...6...8

A   B   C   |D     E   F   |G   H    I   
1   5   67  |489   2   48  |78  679  3   
89  4   67  |1389  19  138 |27  5    26 
389 23  28  |6     5   7   |48  49   1   
----------------------------------------
47  289 5   |2379  479 236 |1   2368 246
6   129 129 |12349 8   5   |234 234  7   
47  128 3   |127   147 126 |9   268  5   
----------------------------------------
38  6   18  |5     147 9   |237 237  24 
5   7   4   |28    3   28  |6   1    9   
2   139 19  |147   6   14  |5   347  8   

hidden pair ->UR 
P1=r4c1 47
P2=r4c5 479
P3=r6c1 47
P4=r6c5 147

here we have a hidden pair, rated 4.5
instead, SE use the naked pair rated 4.6


Code: Select all
2....9..5..7.4.....1.7.......5..3..7.2.....1.6.....9...9...1.8...3.7.4.....5....3

2  3  4  |168 168 9   |68  7   5 
89 5  7  |3   4   268 |268 269 1 
89 1  6  |7   28  5   |3   4   29
---------------------------------
4  8  5  |19  19  3   |26  26  7 
3  2  9  |68  68  7   |5   1   4 
6  7  1  |2   5   4   |9   3   8 
---------------------------------
5  9  2  |4   3   1   |7   8   6 
1  6  3  |89  7   28  |4   5   29
7  4  8  |5   269 26  |1   29  3 



hidden pair
P1=r4c7 26
P2=r2c7 268
P3=r4c8 26
P4=r2c8 269

same problem I guess



Code: Select all
1.2.3.4.5.........6..7.8..2..8...7..7...9...6..3...2..9..5.1..4.........3.5.4.8.1

A  B   C    |D     E     F     |G    H     I   
1  78  2    |69    3     69    |4    78    5   
58 35  79   |124   125   245   |1369 36789 3789
6  345 49   |7     15    8     |139  39    2   
-----------------------------------------------
2  69  8    |1346  156   3456  |7    13459 39   
7  145 14   |2348  9     2345  |35   3458  6   
45 69  3    |1468  15678 4567  |2    14589 89   
-----------------------------------------------
9  278 67   |5     2678  1     |36   2367  4   
48 14  1467 |23689 2678  23679 |569  25679 79   
3  27  5    |269   4     2679  |8    2679  1   

hidden pair
P1=r1c6 69
P2=r9c6 2679
P3=r1c4 69
P4=r9c4 269

same



Code: Select all
1.2...3.......5.1.6...2...9...7...4...8.1.7...2...9...3...6...5.4.5.......6...4.1
A  B  C  |D   E   F  |G  H  I 
1  79 2  |689 789 67 |3  5  4 
8  79 4  |39  379 5  |2  1  6 
6  3  5  |1   2   4  |8  7  9 
------------------------------
9  6  3  |7   5   28 |1  4  28
4  5  8  |236 1   36 |7  9  23
7  2  1  |38  4   9  |5  6  38
------------------------------
3  1  7  |4   6   28 |9  28 5 
2  4  9  |5   38  1  |6  38 7 
5  8  6  |239 379 37 |4  23 1 


hidden pair
P1=r1c2 79
P2=r1c5 789
P3=r2c2 79
P4=r2c5 379

same
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby gsf » Mon Oct 25, 2010 12:27 pm

champagne wrote:I loaded my file of puzzles from the pattern game (games 1_122)
http://gpenet.pagesperso-orange.fr/downloads/igames.txt

this is an unofficial file, but it should contain nearly all puzzles submitted

the Patterns Game Results thread contains all submitted puzzles for each game
one game per post
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Mon Oct 25, 2010 1:16 pm

gsf wrote:
champagne wrote:I loaded my file of puzzles from the pattern game (games 1_122)
http://gpenet.pagesperso-orange.fr/downloads/igames.txt

this is an unofficial file, but it should contain nearly all puzzles submitted

the Patterns Game Results thread contains all submitted puzzles for each game
one game per post



That's the way i collected them slowly, but it's not an easy task.

This is the reason why I somewhere suggested to have the entire file available in an easy form (or at least the "rarity" summary).

I first collected the game/game files to make my own prevision of "rarity".

I also use it intensively as test file.

champagne
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby ronk » Mon Oct 25, 2010 1:43 pm

champagne wrote:That's the way i collected them [edit: the Pattern Game results] slowly, but it's not an easy task.

This is the reason why I somewhere suggested to have the entire file available in an easy form (or at least the "rarity" summary).

I first collected the game/game files to make my own prevision of "rarity".

Contestants in the Patterns Game are perfectly capable of creating and maintaining their own "rarity library" ... so I disagree with the posting of an "official flat file." It would just become something else for gsf or g.r.emlin to maintain.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Team project: C or C++ Explainer-like rating program

Postby lksudoku » Mon Oct 25, 2010 2:02 pm

ronk wrote:Contestants in the Patterns Game are perfectly capable of creating and maintaining their own "rarity library" ... so I disagree with the posting of an "official flat file."


I think that a ready made collection of puzzles can be handy, why duplicate the process of creating such a library by every individual? actually I suggest some kind of a script that creates such a ready collection automatically

EDIT: and may I add that I am not a contestant of the Patterns Games, nor did this project description require any participation in the Patterns Game
Last edited by lksudoku on Mon Oct 25, 2010 4:44 pm, edited 2 times in total.
lksudoku
 
Posts: 90
Joined: 06 October 2010

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Mon Oct 25, 2010 3:26 pm

ronk wrote:Contestants in the Patterns Game are perfectly capable of creating and maintaining their own "rarity library" ... so I disagree with the posting of an "official flat file." It would just become something else for gsf or g.r.emlin to maintain.



I am somehow surprised buy your post.

1) it seems not logic to say newcomers in the pattern game should be helped and to state each one should bear the burden of preparing it's own summary of past submissions.

2) gremlin has such a summary ready. This is compulsory to compute the "rarity".

3) Rarity is really something of value for newcomers. For skilled players, focusing on rarity is a very dangerous strategy.
On top of it, rarity is a "value" only in low and middle ratings. Very quickly, a diamond strategy pays more.

BTW, in that thread we need also a wide sample of ratings. It would have been stupid to ask to anybody to compile the pattern game results.

champagne
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby lksudoku » Mon Oct 25, 2010 8:51 pm

champagne wrote:some work for iksudoku.

I face huge difficulties to match SE results in the UR/UL area

I am already using Fixed3 version from iksudoku to eliminate some bugs, but others seem to be there;

here a lot of puzzles where my solver finds a hidden pair rated 4.5.
instead, SE uses a naked pair rated 4.6.

I don't understand why.

Code: Select all
1...2...3
.4.....5.
...6.7...
..5...1..
6...8...7
..3...9..
...5.9...
.7.....1.
2...6...8

A   B   C   |D     E   F   |G   H    I   
1   5   67  |489   2   48  |78  679  3   
89  4   67  |1389  19  138 |27  5    26 
389 23  28  |6     5   7   |48  49   1   
----------------------------------------
47  289 5   |2379  479 236 |1   2368 246
6   129 129 |12349 8   5   |234 234  7   
47  128 3   |127   147 126 |9   268  5   
----------------------------------------
38  6   18  |5     147 9   |237 237  24 
5   7   4   |28    3   28  |6   1    9   
2   139 19  |147   6   14  |5   347  8   

hidden pair ->UR 
P1=r4c1 47
P2=r4c5 479
P3=r6c1 47
P4=r6c5 147

here we have a hidden pair, rated 4.5
instead, SE use the naked pair rated 4.6


Looking at the code, it looks as if the bug is that a hidden pair is rated 4.5 instead of 4.6; the comment says it should be 4.6, but the way it is computed suggests a bug in the difficulty calculation

The way UR hidden sets and naked sets are calculated is so that in case of a tie where there is a hidden set and an equivalent naked set of the same degree, the naked equivalent set is chosen.

Your example shows such a tie, the hidden and naked pairs are equivalent

I suggest increasing the rating of all UR hidden sets by 0.1, but another option is that in case of a hidden/naked set equivalence, choose the hidden set, I can fix it either way, what is your preference?
lksudoku
 
Posts: 90
Joined: 06 October 2010

Re: Team project: C or C++ Explainer-like rating program

Postby ronk » Tue Oct 26, 2010 3:31 am

lksudoku wrote:
champagne wrote: here we have a hidden pair, rated 4.5
instead, SE use the naked pair rated 4.6

Looking at the code, it looks as if the bug is that a hidden pair is rated 4.5 instead of 4.6; the comment says it should be 4.6, but the way it is computed suggests a bug in the difficulty calculation

The way UR hidden sets and naked sets are calculated is so that in case of a tie where there is a hidden set and an equivalent naked set of the same degree, the naked equivalent set is chosen.

Your example shows such a tie, the hidden and naked pairs are equivalent

I suggest increasing the rating of all UR hidden sets by 0.1, but another option is that in case of a hidden/naked set equivalence, choose the hidden set, I can fix it either way, what is your preference?

Another option is for the clone to actually do some cloning ... and see what happens for larger sets before making any decision.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Tue Oct 26, 2010 5:18 am

ronk wrote:
lksudoku wrote:
champagne wrote: here we have a hidden pair, rated 4.5
instead, SE use the naked pair rated 4.6

Looking at the code, it looks as if the bug is that a hidden pair is rated 4.5 instead of 4.6; the comment says it should be 4.6, but the way it is computed suggests a bug in the difficulty calculation

The way UR hidden sets and naked sets are calculated is so that in case of a tie where there is a hidden set and an equivalent naked set of the same degree, the naked equivalent set is chosen.

Your example shows such a tie, the hidden and naked pairs are equivalent

I suggest increasing the rating of all UR hidden sets by 0.1, but another option is that in case of a hidden/naked set equivalence, choose the hidden set, I can fix it either way, what is your preference?

Another option is for the clone to actually do some cloning ... and see what happens for larger sets before making any decision.



let me coment both iksudoku's remarks and ronk's remarks here.

Ronk "Another option is for the clone to actually do some cloning" I am not sure to catch exactly what you mean.
but I would agree that we need more investigations in the field of UR/ULs before taking a decision.

regarding iksudoku findings, I have new questions.

As far as I can se, hidden sets are usually rated 0.1 below naked sets, so it is very surprising to come to the situation found by you.

When trying to match the results at the 4.7 level (I am now working step by step. In a global approach, i only found contradictions in ratings)
I found many puzzles having a hidden set not seen by SE.
I checked one example using On-line SE. The hidden set is just not seen, even asking for all equivalent hints.
Looking at the pattern of some of theese puzzles, I have the feeling that SE does not look for hidden sets if it does not find one cell having both common digits. I'll put that filter to see what happens.

For the time being, my rules are more or less the following:

Code: Select all
1) same basic processing for UR and UL :
2) add 0.1 to UL against UR
3) add 0.2 to UL if they have more than 6 cells
4) basic rating for
   one cell with extra digits
   one extra digit
5) whith 2 cells in the same rowcolbox (the lowest result if they belong to box&row or box&col)
   basic rating for bivalues of one of the common digits
   basic rating for a hiiden pair
   basic + 0.1 for a nacked pair of a hidden set (not pair)
   basic + 0.2 for a nacked set (not pair)


I am now excluding for test hidden sets without a cell containing the pair of common digits

champagne
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby ronk » Tue Oct 26, 2010 5:55 am

champagne wrote:When trying to match the results at the 4.7 level (I am now working step by step. In a global approach, i only found contradictions in ratings)

Does that mean type 3 URs with hidden triplets (ER=4.6) tested OK?
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Tue Oct 26, 2010 6:15 am

ronk wrote:
champagne wrote:When trying to match the results at the 4.7 level (I am now working step by step. In a global approach, i only found contradictions in ratings)

Does that mean type 3 URs with hidden triplets (ER=4.6) tested OK?


right but I did not have at that moment the filter on the cell containing both common digits.

After that condition has been included, it works better (exect for "hidden pair" not found by SE).

I have still to introduce the rule seen by iksudoku, changing the priorities :

" to choose betwen nacked set and hidden set
1)take the set with the lowest length
2) at equal lenght take the naked set".


I am preparing the changes in the code to do that

champagne

PS: if this gives as good results as expected, the main bug to fix is to extract missing " hiddden pair".
this should lead to a nearly perfect match
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby lksudoku » Tue Oct 26, 2010 9:35 am

champagne wrote:As far as I can se, hidden sets are usually rated 0.1 below naked sets, so it is very surprising to come to the situation found by you.

hidden sets are always rated 0.1 below naked sets, meaning that a hidden naked pair is rated as the easiest UR there is; both common sense and the code comments suggest that it should be rated exactly as naked sets, or at least not as the simplest UR there is when there is a hidden UR pair


champagne wrote:I have still to introduce the rule seen by iksudoku, changing the priorities :

" to choose betwen nacked set and hidden set
1)take the set with the lowest length
2) at equal lenght take the naked set".


I am preparing the changes in the code to do that

That is not the rule I described
1) as long as the length is not maximal, take both naked and hidden sets
2) at equal length when the sets are equivalnet meaning that the length is equal and maximal take the naked set
lksudoku
 
Posts: 90
Joined: 06 October 2010

Re: Team project: C or C++ Explainer-like rating program

Postby champagne » Tue Oct 26, 2010 12:17 pm

lksudoku wrote:
champagne wrote:As far as I can se, hidden sets are usually rated 0.1 below naked sets, so it is very surprising to come to the situation found by you.

hidden sets are always rated 0.1 below naked sets, meaning that a hidden naked pair is rated as the easiest UR there is; both common sense and the code comments suggest that it should be rated exactly as naked sets, or at least not as the simplest UR there is when there is a hidden UR pair


champagne wrote:I have still to introduce the rule seen by iksudoku, changing the priorities :

" to choose betwen nacked set and hidden set
1)take the set with the lowest length
2) at equal lenght take the naked set".


I am preparing the changes in the code to do that

That is not the rule I described
1) as long as the length is not maximal, take both naked and hidden sets
2) at equal length when the sets are equivalnet meaning that the length is equal and maximal take the naked set



we have pieces of truth everywhere, the ptoblem is to extract the right pieces and to build the right logic.

I made a regression test at the level 4.6 and found 2 puzzles creating problem.

here is the first one at the point where the rating is 4.6 in SE

Code: Select all
A    B    C    |D     E     F      |G    H    I   
1    5789 2    |5689  5789  456789 |3    69   4689
3789 4    379  |13689 13789 6789   |268  5    2689
6    589  39   |3589  34589 2      |7    49   1   
--------------------------------------------------
3579 679  3679 |2     589   1      |4    79   389 
3579 12   3479 |589   6     4589   |1258 1279 2389
459  12   8    |7     459   3      |1256 1269 269 
--------------------------------------------------
2    689  5    |4     1389  689    |16   136  7   
79   3    4679 |1569  12579 5679   |126  8    246 
478  678  1    |368   2378  678    |9    2346 5   


UR r56c2;r56c8

1) here is a hidden triplet without any cell having both common digits
2) the rating for that hidden set is 4.6 as stated by iksudoku.

so I have to rally iksudoku last comments and make new tests.

1) no restriction in the search of hidden sets
hidden sets rated basic +0.1
2) even if there is no logic in it, take the nacked set rated higher in case of equivalent length
3) I guess this is true as well for hidden pair and naked pair. I'll check my puzzles appearing with a lower rating than in SE.


ps: I have some doubts on the wording of point 2 of iksudoku. I first try the lowest length
ps2: it seems that with the priority given to nacked sets at equal length, hidden sets higher than "pair' are quite uncommon
champagne
champagne
2017 Supporter
 
Posts: 7465
Joined: 02 August 2007
Location: France Brittany

Re: Team project: C or C++ Explainer-like rating program

Postby lksudoku » Tue Oct 26, 2010 1:00 pm

lksudoku wrote:2) at equal length when the sets are equivalnet meaning that the length is equal and maximal take the naked set

Let me elaborate on this rule

For a house(row/col/block), suppose that there are k cells that are not found yet (with more than one candidate), two of these are UR cells

When we have a UR naked set of degee ceil(k/2) there will always be an equivalent hidden set of degree floor(k/2).
When ceil(k/2)=floor(k/2) SE will ignore the hidden set of degree floor(k/2)

For all UR hidden sets with degree <ceil(k/2), SE will find these hints

EDIT: After all the hints that were not ignored are found, a hint with the lowest rating out of them will be used for the rating

Regarding the SE UR type 3 current rating
The rating of a UR naked set of degree j is 4.5+0.1*(j-1)
The rating of a UR hidden set of degree j is 4.5+0.1*(j-2)

I think the original intention was that the rating of a UR hidden set of degree j would be 4.5+0.1*(j-1), that is also what the comments state
lksudoku
 
Posts: 90
Joined: 06 October 2010

PreviousNext

Return to Software