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

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 statelksudoku

let me now try to apply that to the last situation (rated 4.6)
and to try another wording for any situation

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  `

we work on column "H" UR r56c8

here k=7.

As in the "degree" we include one "equivalent cell" for the UR,
we can not have the condition "equal", so the hidden set must be considered.

we have a hidden triplet rating 4.5+.01*(3-2)=4.6

If this is correct, I could have spent hours on examples before having understood the rule.

So hidden sets are omitted only if k is an even number and only if the hidden set size is then k/2

three possibilities:

k=6 with a hidden triplet
k=4 with a hidden pair

this is somehow simpler that what I understood, but with a rating "depending on the set size".

the final table should be

Code: Select all
`                UR   ULhidden pair     4.5  4.6hidden triplet  4.6  4.7hidden quad     4.7  4.8nacked pair     4.6  4.7nacked triplet  4.7  4.8nacked quad     4.8  4.9`

Hope to be now close enough to the truth.

I am waiting for your ok to think of the final coding.

champagne
champagne
2017 Supporter

Posts: 6250
Joined: 02 August 2007
Location: France Brittany

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

champagne wrote:So hidden sets are omitted only if k is an even number and only if the hidden set size is then k/2

three possibilities:

k=6 with a hidden triplet
k=4 with a hidden pair

Except that k=8 is impossible [edit: See counter-examples here. ], that's what I understand as well. IOW naked sets would be reported for the other two. It'll be interesting to see an example with k=6 and a UR naked triple rating.

champagne wrote:
Code: Select all
`                UR   ULhidden pair     4.5  4.6hidden triplet  4.6  4.7hidden quad     4.7  4.8nacked pair     4.6  4.7nacked triplet  4.7  4.8nacked quad     4.8  4.9`

That's good for uniqueness loops with 4 and 6 cells. You need two more columns for the 8 cell and >=10 cell cases.
Last edited by ronk on Wed Oct 27, 2010 11:11 pm, edited 1 time in total.
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

champagne wrote:let me now try to apply that to the last situation (rated 4.6)
and to try another wording for any situation

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  `

we work on column "H" UR r56c8

here k=7.

As in the "degree" we include one "equivalent cell" for the UR,
we can not have the condition "equal", so the hidden set must be considered.

we have a hidden triplet rating 4.5+.01*(3-2)=4.6

If this is correct, I could have spent hours on examples before having understood the rule.

So hidden sets are omitted only if k is an even number and only if the hidden set size is then k/2

three possibilities:

k=6 with a hidden triplet
k=4 with a hidden pair

this is somehow simpler that what I understood, but with a rating "depending on the set size".

the final table should be

Code: Select all
`                UR   ULhidden pair     4.5  4.6hidden triplet  4.6  4.7hidden quad     4.7  4.8nacked pair     4.6  4.7nacked triplet  4.7  4.8nacked quad     4.8  4.9`

Hope to be now close enough to the truth.

I am waiting for your ok to think of the final coding.

champagne

You are right, I think that these rules are errornous because
1. A hidden set of degree k/2 (k even) has lower rating than the naked set of degree k/2, yet it will not be used
2. A hidden set is not simpler than a naked set of the same degree yet it rates lower

k can be 8, and infect any number between 2 to 9

I suggest fixing what I consider errornous, either by fixing error 1 or error 2

Your table completely (together with the k even hidden set rule) describes all current ratings of UR type 3
lksudoku

Posts: 90
Joined: 06 October 2010

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

About the project code, are you using PIsaacson code or champagne code? or maybe some combination of the two?
lksudoku

Posts: 90
Joined: 06 October 2010

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

ronk wrote:It'll be interesting to see an example with k=6 and a UR naked triple rating.

That was easy. The very first "ER=4.7 Unique Rectangle type 3" I looked at had this situation. IOW despite a UR hidden triple, which would be rated ER=4.6, Explainer "finds" a UR naked triple rated ER=4.7.

Code: Select all
`.1..2.39..948.352.253.9...6.276...5..3.1..762.6..72...34...8.79.729..1.8.89.....5 678   1     68    | 45     2     456   | 3     9     47 67    9     4     | 8     *16    3     | 5     2     17 2     5     3     | 47     9     17    | 48    18    6-------------------+--------------------+----------------- 1489  2     7     | 6     #348   49    | 489   5     134 4589  3     58    | 1     #48-5  459   | 7     6     2 1459  6     158   | 345    7     2     | 489   18    134-------------------+--------------------+----------------- 3     4     156   | 25    *156   8     | 26    7     9 56    7     2     | 9    #*3456  456   | 1    *34    8 16    8     9     | 2347 #*1346  17    | 26   *34    5quantum naked triple: (156)r2789c5 ==> r5c5<>5ORquantum hidden triple: (348)r4589c5 ==> r5c5<>5`
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

lksudoku wrote:
champagne wrote:

the final table should be

Code: Select all
`                UR   ULhidden pair     4.5  4.6hidden triplet  4.6  4.7hidden quad     4.7  4.8nacked pair     4.6  4.7nacked triplet  4.7  4.8nacked quad     4.8  4.9`

Hope to be now close enough to the truth.

I am waiting for your ok to think of the final coding.

champagne

You are right, I think that these rules are errornous because
1. A hidden set of degree k/2 (k even) has lower rating than the naked set of degree k/2, yet it will not be used
2. A hidden set is not simpler than a naked set of the same degree yet it rates lower

k can be 8, and infect any number between 2 to 9

I suggest fixing what I consider errornous, either by fixing error 1 or error 2

Your table completely (together with the k even hidden set rule) describes all current ratings of UR type 3

unhappily this is not yet exact.

we should have several columns for UL.

I already noticed a split with a 0.1 penalty for UL having more than 6 cells.
hereabove, a new puzzle rated 5.0 due to a UL of 10 cells
apparently, here a penalty around 0.4

1..2....3
.....547.
....3..6.
.....7.8.
....2.3..
.5.1....2
9.1......
2..4.....
.73.....6

may be iksudoku can again help us and give the rule for the penalty related to the length of the loop

regarding the code used, it's very simple, Paul is working using it's existing coe, I am doing the same;

I announced I'll open a thread to make my "clone" in construction public. As I'll have 2 weeks off with a limited access to the net, I intend to pepare the stuff to be in a position to open the thread around the 10th of November.
The first publication should include the code with a rating below 6.2

champagne

PS: I would be in favour of a change in SE rating in that area and I think the best would be
. to kill the "k" rule
. to use the shortest set, either hidden or nacked.
. to have the same rating at equal length.

but this should not be done during the tes phase; It would weaken the quality of the pattern game results as sample file.

edit ps2

from above remark, it appears that rating 5.0 is a mixture of UL and naked quad.
I suspect the same for the following ratings.
champagne
2017 Supporter

Posts: 6250
Joined: 02 August 2007
Location: France Brittany

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

champagne wrote:unhappily this is not yet exact.

we should have several columns for UL.

Your description completely covers UR type 3
UR of other types have different rules, maybe I will describe them later on

Each UR type (1/2/3/4) have different rules

champagne wrote:PS: I would be in favour of a change in SE rating in that area and I think the best would be
. to kill the "k" rule
. to use the shortest set, either hidden or nacked.
. to have the same rating at equal length.

but this should not be done during the tes phase; It would weaken the quality of the pattern game results as sample file.

I suggest correcting the SE rating, and then re-rate the pattern game results, thus using the corrected pattern game results for testing
lksudoku

Posts: 90
Joined: 06 October 2010

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

lksudoku wrote:
champagne wrote:unhappily this is not yet exact.

we should have several columns for UL.

Your description completely cover UR type 3
UR of other types have different rules, maybe I will describe them later on

Each UR type (1/2/3/4) have different rules

I think we have covered the type 3 for UR's.
What comes on top of it is the additional penalty for UL that I see in that way (but I can be wrong)

UL up to 6 cells penalty 0.1 giving the ratings in the column "UL" of my table
UL 7_8? cells penalty 0.2
UL 10?? penalty 0.4??

but this will be easier to sort out of examples.

champagne
champagne
2017 Supporter

Posts: 6250
Joined: 02 August 2007
Location: France Brittany

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

[edit: Post withdrawn; should never believe my read of someone else's code]
Last edited by ronk on Tue Oct 26, 2010 8:05 pm, edited 2 times in total.
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

ronk wrote:
Code: Select all
`  UL cells -->   4    6    8   >=10hidden pair     4.5  4.6  4.7  4.8hidden triplet  4.6  4.7  4.8  4.9hidden quad     4.7  4.8  4.9  5.0nacked pair     4.6  4.7  4.8  4.9nacked triplet  4.7  4.8  4.9  5.0nacked quad     4.8  4.9  5.0  5.1`
[/

There is no hidden/naked set of UL with size>4, all such UL are type 2 and have their own rating rules

type 1,3,4 are UR with 4 cells, each with its own rating rules

Maybe I will describe these rules later on
lksudoku

Posts: 90
Joined: 06 October 2010

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

champagne wrote:regarding the code used, it's very simple, Paul is working using it's existing coe, I am doing the same;

I announced I'll open a thread to make my "clone" in construction public. As I'll have 2 weeks off with a limited access to the net, I intend to pepare the stuff to be in a position to open the thread around the 10th of November.
The first publication should include the code with a rating below 6.2

I find it a little problematic for a team project or any open source project

What you stated is that only after you have created a complete clone up to forcing chains will the code be available

That makes me wonder if I should switch to Paul's code or change my role to just improving SE code regardless of this project
lksudoku

Posts: 90
Joined: 06 October 2010

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

lksudoku wrote:
champagne wrote:regarding the code used, it's very simple, Paul is working using it's existing coe, I am doing the same;
...
The first publication should include the code with a rating below 6.2

I find it a little problematic for a team project or any open source project
What you stated is that only after you have created a complete clone up to forcing chains will the code be available
That makes me wonder if I should switch to Paul's code or change my role to just improving SE code regardless of this project

Yeh, I had been thinking of striking the word "Team" from the title of this thread. But what the hey, let's see what happens.
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

lksudoku wrote:
champagne wrote:regarding the code used, it's very simple, Paul is working using it's existing coe, I am doing the same;

I announced I'll open a thread to make my "clone" in construction public. As I'll have 2 weeks off with a limited access to the net, I intend to pepare the stuff to be in a position to open the thread around the 10th of November.
The first publication should include the code with a rating below 6.2

I find it a little problematic for a team project or any open source project

What you stated is that only after you have created a complete clone up to forcing chains will the code be available

That makes me wonder if I should switch to Paul's code or change my role to just improving SE code regardless of this project

well, that code exists in my solver anyway, this is just one way to "open" it.

I took that decision after I saw little progress in that thread during several months.

I have not seen any alternative proposal up to now, so i feel quite confortable doing that.

I am at least sure that at te end I'll have a very efficient tool to participate to the pattern game.

I am prepared to share it, and to make of it a common tools modified and improved by the team, but if it does not fit with others expectations, I'll keep it for me.

Believe me, just preparing explanations in english and cleaning my code to make it easier to understand and to modify is a huge task for a non native english speaker.

And if at the end it is paul's code that seems the best as a basis for the project, it's ok for me.

After that, I must confess I am very close to give up the idea to open a specific thread and very close as well to stop any participation in that thread.

champagne
champagne
2017 Supporter

Posts: 6250
Joined: 02 August 2007
Location: France Brittany

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

To whomever still has interest in this as a group effort:

I have stated before that anyone interested in obtaining my C++ source need only PM me so that I can send you a current snap-shot and instructions on compilation, configuration etc. If you want to collaborate, then we need to talk - at least electronically via e-mail.

I indicated in a prior post what techniques I have coded/debugged. I'm still debugging the last stage dynamic/plus/region/recursive/forcing chains logic. My latest implementation is only about 2x faster than using Java x64, so I'm unhappy with my current semi-blind port. Since the final stages of forcing chain logic seems more like T&E, I'm not very motivated to continue along these lines. I'm more interested in providing a frame-work plus a variety of modern techniques (along with those currently in SE up to some rational limit). To that end, I'm working on implementing something similar to Allan Barker's Ribbons I think, but that topic appears to be lost so I only have my prior notes to review...

Anyone who wants my code need only ask... There's been no flood of requests so far, so I think Champagne and I are pretty much going it alone.

Champagne,

I think it's time for you and I to exchange e-mail and code. I'll PM you with my offer and the ball will then be in your court.

Cheers,
Paul
PIsaacson

Posts: 249
Joined: 02 July 2008

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

ronk wrote:
champagne wrote:So hidden sets are omitted only if k is an even number and only if the hidden set size is then k/2

three possibilities:

k=6 with a hidden triplet
k=4 with a hidden pair

Except that k=8 is impossible ...

lksudoku wrote:k can be 8, and infect any number between 2 to 9

It was relatively easy to find examples that show k=8 is possible. (Since I erroneously thought the two UR/UL cells were excluded from the count, my "k=8 is impossible" statement was incorrect.)

Code: Select all
`......5......6..18..1.2.43..7...2..9..4.3.6..8..7...5..49.5.1..73..1......5...... *34     689    78     |#*34+1   789    134    | 5      269    26*34     259    27     |#*34+59  6      3459   | 79     1      8 569    5689   1      | *589    2      5789   | 4      3      67----------------------+-----------------------+-------------------- 15     7      6      | *15     48     2      | 3      48     9 1259   1259   4      | *1589   3      1589   | 6      78     17 8      19     3      |  7      49     6      | 2      5      14----------------------+----------------------+-------------------- 26     4      9      | #236-8  5      378    | 1      267    2367 7      3      28     | #246-9  1      49     | 89     2469   5 126    1268   5      | #2346-9 79     349    | 789    246    2346UR(34)r12c14 type 3Quantum hidden quad: (2346)r12789c4 ==> r7c4<>8, r89c4<>9 (ER=4.7)ORQuantum naked quad: (1589)r12345c4 ==> r7c4<>8, r89c4<>9 (ER=4.8)Due to the "k-rule", Explainer finds the naked quad for ER=4.8`

Code: Select all
`...........12.34...4.5.6.7..58...23.....8.....62...89..2.7.5.6...34.95...........   237    37    *56     | 89     479    478    | 169    125  #*56+129*56     78     1      | 2      79     3      | 4      58   #*56+9 28     4      9      | 5      1      6      | 3      7     *28----------------------+----------------------+--------------------- 149    5      8      | 169    479    147    | 2      3     #467-1 1349   13     7      | 1369   8      2      | 16     15    #456-1 134    6      2      | 13     5      147    | 8      9     #47-1----------------------+----------------------+--------------------- 18     2      4      | 7      3      5      | 19     6     *189 17     178    3      | 4      6      9      | 5      128   *12*56     9     *56     | 18     2      18     | 7      4      3UL(56)r129c139 type 3, aka BUG-LiteQuantum hidden quad: (4567)r12456c9 ==> r456c9<>1 (ER=4.8)ORQuantum naked quad: (1289)r12378c9 ==> r456c9<>1 (ER=4.9)Due to the "k-rule", Explainer finds the naked quad for ER=4.9`
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

PreviousNext