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 PIsaacson » Sat Dec 11, 2010 9:16 am

Using my code with SE conformance on:
Code: Select all
$ sudoku -bv < test.in

124968573309200864608304192030790085095406731000503029000830206080640307063105948 puzzle 1

  1)  2.6 r7c2 <> 5 locked candidates type 1 (pointing) b1/c2
  2)  2.0 r7c2 <= 4    direct hidden pair b7x14.<59>
  3)  1.5 r6c2 <= 1 hidden single in c2
  4)  1.2 r4c6 <= 1 hidden single in b5
  5)  1.2 r2c5 <= 1 hidden single in b2
  6)  1.2 r3c5 <= 5 hidden single in b2
  7)  1.0 r2c6 <= 7 full house in b2
  8)  1.0 r2c2 <= 5 full house in r2
  9)  1.0 r3c2 <= 7 full house in b1
 10)  1.2 r5c5 <= 2 hidden single in b5
 11)  1.0 r5c1 <= 8 full house in r5
 12)  1.0 r6c5 <= 8 full house in b5
 13)  1.0 r9c5 <= 7 full house in c5
 14)  1.0 r9c1 <= 2 full house in r9
 15)  1.2 r4c3 <= 2 hidden single in b4
 16)  1.2 r6c3 <= 6 hidden single in b4
 17)  1.2 r6c1 <= 7 hidden single in b4
 18)  1.0 r4c1 <= 4 full house in b4
 19)  1.0 r4c7 <= 6 full house in r4
 20)  1.0 r6c7 <= 4 full house in r6
 21)  1.2 r7c3 <= 7 hidden single in b7
 22)  1.0 r8c3 <= 1 full house in c3
 23)  1.2 r8c6 <= 2 hidden single in b8
 24)  1.0 r7c6 <= 9 full house in c6
 25)  1.2 r8c1 <= 9 hidden single in b7
 26)  1.0 r7c1 <= 5 full house in c1
 27)  1.0 r7c8 <= 1 full house in r7
 28)  1.0 r8c8 <= 5 full house in r8
124968573309200864608304192030790085095406731000503029000830206080640307063105948;2.6/2.6/2.6

With SE conformance turned off (-c0 runtime param):
Code: Select all
$ sudoku -bv < test.in -c0

124968573309200864608304192030790085095406731000503029000830206080640307063105948 puzzle 1


  1)  2.0 r7c2 <= 4    direct hidden pair r78c1.<59>
  2)  2.0 r7c1 <> 47   direct hidden pair r78c1.<59>
  3)  2.0 r8c1 <> 2    direct hidden pair r78c1.<59>
  4)  1.5 r6c2 <= 1 hidden single in c2
  5)  1.2 r4c6 <= 1 hidden single in b5
  6)  1.2 r2c5 <= 1 hidden single in b2
  7)  1.2 r3c5 <= 5 hidden single in b2
  8)  1.0 r2c6 <= 7 full house in b2
  9)  1.0 r2c2 <= 5 full house in r2
 10)  1.0 r3c2 <= 7 full house in b1
 11)  1.2 r5c5 <= 2 hidden single in b5
 12)  1.0 r5c1 <= 8 full house in r5
 13)  1.0 r6c5 <= 8 full house in b5
 14)  1.0 r9c5 <= 7 full house in c5
 15)  1.0 r9c1 <= 2 full house in r9
 16)  1.2 r4c3 <= 2 hidden single in b4
 17)  1.2 r6c3 <= 6 hidden single in b4
 18)  1.2 r6c1 <= 7 hidden single in b4
 19)  1.0 r4c1 <= 4 full house in b4
 20)  1.0 r4c7 <= 6 full house in r4
 21)  1.0 r6c7 <= 4 full house in r6
 22)  1.2 r7c3 <= 7 hidden single in b7
 23)  1.0 r8c3 <= 1 full house in c3
 24)  1.2 r8c6 <= 2 hidden single in b8
 25)  1.0 r7c6 <= 9 full house in c6
 26)  1.2 r8c1 <= 9 hidden single in b7
 27)  1.0 r7c1 <= 5 full house in c1
 28)  1.0 r7c8 <= 1 full house in r7
 29)  1.0 r8c8 <= 5 full house in r8
124968573309200864608304192030790085095406731000503029000830206080640307063105948;2.0/2.0/2.0

The hidden <59> in column 1 is there from the start, but SE doesn't "notice" it until the 5 is eliminated in r7c2. By then, the score has already advanced to 2.6 due to the pointing locked candidates. The hidden <59> in r78c1 can indeed operate on box 7 right from the start because it eliminates the 4r7c1, and that exposes the 4r7c2 assignment. That's how my solver "sees" it with SE conformance disabled, but that's too much of a deviation from how SE operates, hence the conformance switch(s). What's interesting is that if you load this puzzle in Simple Sudoku, the naked pair r23c2.<57> is right there staring you in the face. I have a tough time believing that it should really be ranked 3.0 while the far harder to spot (for me) direct hidden pair scores 2.0. But SE scoring is non-negotiable. It is what it is.

Cheers,
Paul
PIsaacson
 
Posts: 249
Joined: 02 July 2008

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

Postby BryanL » Sat Dec 11, 2010 11:51 pm

PIsaacson wrote:The hidden <59> in column 1 is there from the start, but SE doesn't "notice" it until the 5 is eliminated in r7c2. By then, the score has already advanced to 2.6 due to the pointing locked candidates. The hidden <59> in r78c1 can indeed operate on box 7 right from the start because it eliminates the 4r7c1, and that exposes the 4r7c2 assignment. That's how my solver "sees" it with SE conformance disabled, but that's too much of a deviation from how SE operates, hence the conformance switch(s). What's interesting is that if you load this puzzle in Simple Sudoku, the naked pair r23c2.<57> is right there staring you in the face. I have a tough time believing that it should really be ranked 3.0 while the far harder to spot (for me) direct hidden pair scores 2.0.

Yes the hidden pair does expose the hidden single 4r7c2 right from the start but it is not a direct hidden pair because until the 5r7c2 is eliminated, the hidden pair only existed in c1.

It is almost as if a direct naked pair rating is required, where if the pair is limited to a box with 7 givens and also in a mini row/col.
And also, I "see" naked triplets and sometimes even quads, easier than I see hidden pairs, let alone hidden triplets.
Same for naked quads before xy-wings. For quads, the eyes can take in a row, col or box all at once. But for wings beyond x-wings, it takes a systematic process of matching up every duo with every other possibility across the whole puzzle.

But SE scoring is non-negotiable. It is what it is.


Yeah well that is what I find so hard to fathom.

Now is the perfect time to address these oddities and set something in stone that is more generally acceptable.

By the way, I really like your config file setup which allows changes in order and value of techniques. Really provides flexibility if someone wants to approach from a different angle for whatever reason.
BryanL
 
Posts: 247
Joined: 28 September 2010

re: "Direct"

Postby Pat » Tue Dec 14, 2010 1:41 pm

on page 18, lksudoku wrote:
BryanL wrote:
Thanks Pat,

but what a can of worms!

The hidden pair example, where the hidden pair is in both a column and a box, fails to recognise the resultant single in the box as a direct hidden pair. If the pair was in the column only (in two boxes) I could understand.

But, you go on to show that for direct locked candidates (i hate the pointing and claiming terms), the resultant single has to be in the box. Which makes me wonder if there could ever be a direct locked candidate type 2???



I do not see any bug in direct methods,


In the SE definition of direct hidden pair, the hidden single must be in the same house of the hidden pair (in which the hidden pair was found)


For claiming/pointing, if there is a locked set based on 3 cells in one box aligned in one column inside that box, the hidden single must lie in one of the boxes inside the chute containing the box, in one of the other boxes above/below it
For 3 cells in a row inside one box, again the hidden single must be in the same chute in the box to the left/right of the locked set box

if the locked set is in a column with 3 cells in the column in the same box, the hidden single must lie in one of the columns crossing that box
if the locked set is in a row with 3 cells in the row in the same box, the hidden single must lie in one of the rows crossing that box

That is the code implementation, and it is not necessarily a bug, just a definition

If you can find an example to contradict this definition, post it and I will see what part of the code definition was not correct


(1) re "Direct Hidden Pair",
yes, you are absolutely right,
i have stated several times that there is no bug

(2) re "Direct Pointing" and "Direct Claiming",
i gave the relevant quote from Nicolas Juillerat
along with examples which i consider to demonstrate the bug
( by bug i mean that his code-implementation differs from his stated definition )

~ Pat
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

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

Postby gsf » Tue Dec 14, 2010 3:37 pm

PIsaacson wrote:Glenn,

Converting the calling convention from C++ methods to C by passing the current grid as a param is one of those massive change items that I have on my to-do list, but I'm torn here. If I commit to this, then releasing early will be postponed until I can complete this task and it's immense. How important is this in your opinion???

not important for the moment, but something to keep in mind
gsf
2014 Supporter
 
Posts: 7306
Joined: 21 September 2005
Location: NJ USA

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

Postby daj95376 » Tue Dec 14, 2010 6:14 pm

Let me see if I have this correct.

Direct Hidden Pair: You go to the trouble of finding a Hidden Pair, but you don't actually perform its eliminations. Instead, you perform just the Hidden Single that would be exposed (in the same house) if the Hidden Pair had been performed.

And you are using this program to rate puzzles?
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

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

Postby ronk » Tue Dec 14, 2010 6:31 pm

daj95376 wrote:Let me see if I have this correct.

Direct Hidden Pair: You go to the trouble of finding a Hidden Pair, but you don't actually perform its eliminations. Instead, you perform just the Hidden Single that would be exposed (in the same house) if the Hidden Pair had been performed.

And you are using this program to rate puzzles?

Things make a lot more sense after one realizes ... Ratings 1.0 through 2.5 are based on solving without pencilmarks. :idea:
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

Postby RW » Tue Dec 14, 2010 9:18 pm

ronk wrote:
daj95376 wrote:Let me see if I have this correct.

Direct Hidden Pair: You go to the trouble of finding a Hidden Pair, but you don't actually perform its eliminations. Instead, you perform just the Hidden Single that would be exposed (in the same house) if the Hidden Pair had been performed.

And you are using this program to rate puzzles?

Things make a lot more sense after one realizes ... Ratings 1.0 through 2.5 are based on solving without pencilmarks. :idea:

The direct hidden pair is still rated too low IMO. When solving without pencilmarks, you first have to find the hidden pair, then realize that this leads to a single somewhere else in the unit. This is not very hard, but certainly requires more effort than locked candidates.

On the other hand, you could say that the immediate placement does make it easier, because you can immediately write down the solved single and don't have to remember any new information. The hard part with locked candidates is not to spot the elimination, but to remember it when the information is useful to make a placement. Perhaps this is what Mr. Juillerat had in mind...

Looking at the puzzle Paul posted above without pencilmarks, the UR in r23 is by far the easiest move to spot. With pencilmarks it becomes even more obvious.

RW
RW
2010 Supporter
 
Posts: 1010
Joined: 16 March 2006

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

Postby ronk » Wed Dec 15, 2010 1:30 pm

RW wrote:
ronk wrote:Things make a lot more sense after one realizes ... Ratings 1.0 through 2.5 are based on solving without pencilmarks.

Looking at the puzzle Paul posted above without pencilmarks, the UR in r23 is by far the easiest move to spot. With pencilmarks it becomes even more obvious.

The rating range 1.0 through 2.5 results in placements ... and a UR Type 1 with only one internal extra candidate certainly would qualify. So too would a UR Type 4 with only one external DP buster (in either of two units containing the UR cells with the extra candidates).

Do you ever use the UR Type 4 when solving without pencilmarks? How about "uniqueness Type 1 & Type 4 tests" with BUGs and BUG-Lites?
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

Postby RW » Wed Dec 15, 2010 2:51 pm

ronk wrote:The rating range 1.0 through 2.5 results in placements ... and a UR Type 1 with only one internal extra candidate certainly would qualify. So too would a UR Type 4 with only one external DP buster (in either of two units containing the UR cells with the extra candidates).

Do you ever use the UR Type 4 when solving without pencilmarks? How about "uniqueness Type 1 & Type 4 tests" with BUGs and BUG-Lites?

I certainly use type 4. And type 2, which also often might result in a direct placement. Type 3 URs I use more rarely. BUG-lites of 6-8 cells are not very much harder to find than URs, but BUGs are just about impossible to spot without pencilmarks.

In my opinion all uniqueness techniques are quite overrated by SE. I think this is because the author thought that they are not very well known and not very obvious to figure out for someone who doesn't learn techniques from forums like this. Once you know the techniques, they are certainly not as hard to use as some other lower rated techniques. With or without pencilmarks a UR type 1 is for sure easier to spot than a XYZ-wing, and with pencilmarks a BUG+1 stares you in the eye, while a Jellyfish can be quite hard to catch.

RW
RW
2010 Supporter
 
Posts: 1010
Joined: 16 March 2006

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

Postby PIsaacson » Wed Dec 15, 2010 9:46 pm

RW,

I have GOT to study your Solving without pencilmarks thread in detail. Being able to visualize URs and other patterns without pencilmarks must take tremendous concentration. I'm afraid my brain would explode! But as my dearest friends would say, that's not much of a loss...

Cheers and season's greeting (it's getting to be a lot like Xmas!) to all,
Paul
PIsaacson
 
Posts: 249
Joined: 02 July 2008

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

Postby champagne » Mon Dec 20, 2010 2:42 pm

I updated both the thread describing the way I intend to clone SE.


here

and the part of my website where pages are stored

here

Also

A new zip file including the code for the range 1.0 to 7.0 can be downloaded here

The code delivered is a preliminary draft. I made some tests but meantime I prepared comments and made some minor non tested changes in it.

Next step will be to revisit all that part of the code and to make a benchmark based on the last version prepared by our friend lksudoku (FFIXED8.)

I hope to finish that task before the end of this year. I’ll then update the download and disappear for about two and half months

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 » Sun Dec 26, 2010 11:33 am

Hi,

I started a revision of my code to match SE results as of {lksudoku ffixed8 version in “batch mode”}.
The sample file has 5569 puzzles in the range 1.0 to 6.9 and I have still so far 24 non matching puzzles.
The 2 first puzzles in that state are the following (4.7 versus 5.0)
Code: Select all
 
..8.6..4.
34...5.2.
..2...9.5
.3..2....
1..3.8..7
....5..1.
4.3...6..
.8.6...54
.9..8.1..  locked here
 
A  B  C  |D  E   F   |G  H  I 
79 5  8  |2  6   379 |37 4  1 
3  4  79 |1  79  5   |8  2  6 
6  1  2  |8  37  4   |9  37 5 
------------------------------
79 3  4  |79 2   1   |5  6  8 
1  6  5  |3  4   8   |2  9  7 
8  2  79 |79 5   6   |4  1  3 
------------------------------
4  7  3  |5  1   2   |6  8  9 
2  8  1  |6  379 379 |37 5  4 
5  9  6  |4  8   37  |1  37 2 


Where my “clone” process that loop

r1c7 r8c7 r8c5 r3c5 r3c8 r9c8 r9c6 r1c6 r1c7

==========================================


Code: Select all
..1.....2
.3...4.5.
6.....7..
.....8.6.
....5...9
.4.7.3...
..2...4..
.6.5...3.
7...8...1  locked here
 

A  B   C  |D   E  F  |G  H  I 
4  7   1  |6   3  5  |89 89 2 
29 3   89 |289 7  4  |1  5  6 
6  289 5  |289 29 1  |7  4  3 
------------------------------
5  29  7  |29  1  8  |3  6  4 
8  1   3  |4   5  6  |2  7  9 
29 4   6  |7   29 3  |5  1  8 
------------------------------
3  89  2  |1   6  7  |4  89 5 
1  6   89 |5   4  2  |89 3  7 
7  5   4  |3   8  9  |6  2  1 


Where the clone process the UL loop

r2c1 r6c1 r6c5 r3c5 r3c2 r4c2 r4c4 r2c4



These loops are not recognized by SE, due to the fact that they have “0 solution” (thanks to lksudoku who pointed that);

I see no logic in that filter.


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 » Sun Dec 26, 2010 12:38 pm

champagne wrote: Where my “clone” process that loop

r1c7 r8c7 r8c5 r3c5 r3c8 r9c8 r9c6 r1c6 r1c7

==========================================
Where the clone process the UL loop

r2c1 r6c1 r6c5 r3c5 r3c2 r4c2 r4c4 r2c4

These loops are not recognized by SE, due to the fact that they have “0 solution” (thanks to lksudoku who pointed that);

I see no logic in that filter.

That "filter" may be rather subtle. For example, I think at least one of the weak links must be in a mini-row or mini-column, which is not the case for your loops.

edit: A counter-example to that thought.

Code: Select all
 .  .  .  | .  .  . 
 .  .  ab | .  .  ab
 .  ab .  | .  ab . 
----------+----------
 .  .  .  | .  .  . 
 .  .  ab | .  .  ab
 .  ab .  | .  ab .
Last edited by ronk on Mon Dec 27, 2010 12:10 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

Postby champagne » Sun Dec 26, 2010 1:10 pm

ronk wrote:That "filter" may be rather subtle. For example, I think at least one of the weak links must be in a mini-row or mini-column, which is not the case for your loops.


The filter is quite simple. The loop has "0 solution". This is seen thru a "parity check" in the process.

But why should we exclude a loop with "o solution"? It is a deadly pattern.

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 » Sun Dec 26, 2010 1:13 pm

ronk wrote:That "filter" may be rather subtle. For example, I think at least one of the weak links must be in a mini-row or mini-column, which is not the case for your loops.

I know the exact logic of that "filter", the question is whether this filter is a bug and therefore a new SE version is required that does not have this filter, or, the SE clone needs to use the same filter
lksudoku
 
Posts: 90
Joined: 06 October 2010

PreviousNext

Return to Software