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 eleven » Fri Dec 03, 2010 10:44 pm

When i posted my opinion about UR implementations here 6 weeks ago, there was no reaction. So i had the impression, that no one was interested in a neat implementation. Hopefully you think about that now, having RW's details at hand :)
eleven
 
Posts: 3151
Joined: 10 February 2008

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

Postby PIsaacson » Sat Dec 04, 2010 1:33 am

Eleven,

From your prior posting:
eleven wrote:If you can get different ratings in a single step solver using uniqueness techniques depends on your implementation and rating of these steps. A main point here is, if your program can distinguish between given and derived numbers.

I don't understand the implication here. A solver/scorer which accepts an 81 char puzzle as input obvious knows the original givens at any step in the solution path. This allows me to execute avoidable ur techniques which depend on such knowledge. But, SE has no such equivalent techniques so I'm missing something (probably obvious) here. Could you elaborate??? As for not receiving comments: I didn't understand it the first time, didn't want to sound too stupid, but I'm willing to forego that now for enlightenment.

Let me re-explain my dilemma using the puzzle and SE:
Code: Select all
001002003020010400300900070006000004010090030800000900030004007004050090600700200

If you enter this into SE and hit the F2 button 34 times, you should arrive at the display of a UR Type 1 r1c78/r7c78.<56> If you continue from this point or apply the 2nd UR, you'll eventually encounter the BUG Type 3 with Naked Quad 7 steps later which causes the puzzle to score 6.0. Restart and when you hit the UR Type 1, this time hit F5 (get all hints) select the last UR Type 1 r4c48/r6c48.<12> hit F4 (apply hint) and continue. You'll encounter a BUG Type 1 8 steps later which causes this solution path to only score 5.6. Start over once again and this time apply the first UR, but also apply the eliminations which would have occured if you applied all 3 UR Type 1s: r4c4 <> 128 and r1c8 <> 56. Step 6 more times and you get a BUG Type 3 with Naked Pair which scores the puzzle as 5.8.

So, you have 3 possible scores 5.6, 5.8 and 6.0 depending on which UR Type 1 you selected and/or how many you selected. Due to the processing order of finding URs, my code found them in a different order than SE, selected the first and found the 5.6 scoring path. SE correctly found all 3 URs, but selected an unfortunate one that led to the 6.0 score. Selecting either all 3 or the right 2 out of 3 leads to the in-between 5.8 score.

The way I have currently coded my processing order, I will score this puzzle either a 5.6 or 5.8 when selecting to process all URs at the same level. But I can see this turning out the opposite way where SE, by random fortune, selects a lower scoring path than my code. At least the "batch processing" mode delivers an average of the two extremes, but that's probably just random luck as well.

I hate to think that the scores involve a random "luck factor" and I can't think of anyway out of this other than generating a solution tree containing all possible solution paths, and then execute a final tree walk to determine the lowest scoring path. At the single branch point above, there are 7 possible solution paths stemming from the UR Type 1 processing selections.

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

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

Postby ronk » Sat Dec 04, 2010 3:54 am

PIsaacson wrote:The way I have currently coded my processing order, I will score this puzzle either a 5.6 or 5.8 when selecting to process all URs at the same level. But I can see this turning out the opposite way where SE, by random fortune, selects a lower scoring path than my code. At least the "batch processing" mode delivers an average of the two extremes, but that's probably just random luck as well.

I hate to think that the scores involve a random "luck factor" and I can't think of anyway out of this other than generating a solution tree containing all possible solution paths, and then execute a final tree walk to determine the lowest scoring path. At the single branch point above, there are 7 possible solution paths stemming from the UR Type 1 processing selections.

I don't think the term "random" is relevant here. For a given puzzle, do different runs using Explainer on your computer give different ratings? For a given puzzle, do runs on different computers using Explainer give different ratings? Do runs using different versions of Explainer (v1.2 and v1.2.1) give different ratings? I've not seen or heard of any such occurrences.

If Explainer's result is deterministic, surely a clone of Explainer can be deterministic as well. I recognize morphs of a given puzzle might produce different ratings, but that's a horse of a different color. :)
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

Postby JasonLion » Sat Dec 04, 2010 3:58 am

PIsaacson wrote:I hate to think that the scores involve a random "luck factor" and I can't think of anyway out of this other than generating a solution tree containing all possible solution paths, and then execute a final tree walk to determine the lowest scoring path.

In the general case, there are many fascinating questions involved in developing puzzle difficulty rating systems. However, in the specific context of developing a replacement for SE for use in the patterns game, very few of them apply. My sense is that patterns game players are willing to accept a few very very minor deviations from the exact current behavior of SE as it exists today, mostly in the form of "bug fixes". Changes of the magnitude suggested by recent discussion seem extremely unlikely to be accepted by the pattern game community.

Looking at this a different way: The recent discussion seems to have wandered away from the original context of an SE replacement for use in the patterns game, without spelling out any specific alternative goal/context. There are other contexts/goals where solution path trees are much more interesting to talk about. For example, many people outside of the patterns game would love an SE like program that supported many more solving techniques and provided various way to explore the tree of possible solving paths. Such a tool could allow a configuration setting that enforced "classic" SE scoring, and thus serve both purposes. However, unless you state such a goal explicitly, I really don't understand where several of the recent posts are headed.
Last edited by JasonLion on Sat Dec 04, 2010 12:27 pm, edited 1 time in total.
User avatar
JasonLion
2017 Supporter
 
Posts: 642
Joined: 25 October 2007
Location: Silver Spring, MD, USA

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

Postby daj95376 » Sat Dec 04, 2010 4:40 am

Seems to me that Ron should change the title of this thread to:

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

As for "bug fixes", are there really any bugs when whatever SE produces is the only thing acceptable?

Since SE (as Ron contends) produces consistent results from one run to the next on a puzzle, and from one computer to the next, then any discussion on comparing ratings for a morphed puzzle should be unacceptable because you are now talking about a different puzzle as far as SE is concerned.
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

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

Postby PIsaacson » Sat Dec 04, 2010 9:17 am

Ron,

I'm sorry about mis-using the term "random". I only meant that when SE sorts a collection of possible operations, it selects the first one not knowing whether or not that is the best decision. I'm suggesting that there are alternative methods that offer faster collapsing to a solution and/or shorter paths with better stability across morphing. I realize that's not the goal here, but I think the discussion points are valid, just probably not in this thread.

Mea culpa,
Paul
PIsaacson
 
Posts: 249
Joined: 02 July 2008

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

Postby BryanL » Sat Dec 04, 2010 1:22 pm

in the SE file rule.java, he uses the terms direct pointing & claiming, direct hidden pair & triplet (1.7, 1.9, 2.0, 2.5), distinguished from pointing & claiming, hidden pair & triplet (2.6, 2.8, 3.4, 4.0).

could someone explain what the difference is between what he calls "direct" and otherwise? :?

thanks, bryan
BryanL
 
Posts: 247
Joined: 28 September 2010

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

Postby lksudoku » Sat Dec 04, 2010 1:37 pm

BryanL wrote:could someone explain what the difference is between what he calls "direct" and otherwise? :?

Direct method means that after you apply the method, you have a hidden single, a method with no hidden single as a result of applying it is not direct

When a direct method is found, only the resulting hidden single is found (not the method results themselves)

It is a mean for producing puzzles solvable without pencil marks

Sometimes the resulting hidden single must lie in certain houses and not everywhere
lksudoku
 
Posts: 90
Joined: 06 October 2010

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

Postby lksudoku » Sat Dec 04, 2010 2:01 pm

JasonLion wrote:Looking at this a different way: The recent discussion seems to have wandered away from the original context

I agree and that is why at the beginning I stated that the different rating for the specific puzzle cannot be avoided and may be considered as correct

It is also possible to choose the new batch mode of SE (see this thread) as a target, but I am not sure if this is what is needed

About the assumption that SE is consistent and will always return the same rating for the same puzzle, for version 1.2.1 that is not correct as seen in bug (c) in the fixes thread
lksudoku
 
Posts: 90
Joined: 06 October 2010

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

Postby ronk » Sat Dec 04, 2010 2:20 pm

lksudoku wrote:About the assumption that SE is consistent and will always return the same rating for the same puzzle, for version 1.2.1 that is not correct as seen in bug (c) in the fixes thread

Unless others are keeping them secret, that is the only known excption.


daj95376 wrote:Seems to me that Ron should change the title of this thread to:

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

"Explainer-clone" was considered when making the last (the 2nd) title change. Since cloning the GUI was not one of goals, I thought it was misleading. Perhaps "Team project: C or C++ Explainer-rating clone" would be better.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

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

Postby daj95376 » Sat Dec 04, 2010 6:54 pm

ronk wrote:
lksudoku wrote:About the assumption that SE is consistent and will always return the same rating for the same puzzle, for version 1.2.1 that is not correct as seen in bug (c) in the fixes thread

Unless others are keeping them secret, that is the only known excption.


daj95376 wrote:Seems to me that Ron should change the title of this thread to:

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

"Explainer-clone" was considered when making the last (the 2nd) title change. Since cloning the GUI was not one of goals, I thought it was misleading. Perhaps "Team project: C or C++ Explainer-rating clone" would be better.

I came thiiiiiiiiiisssssss close to suggesting that name change. :)
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

re: "Direct"

Postby Pat » Sun Dec 05, 2010 8:23 am

lksudoku wrote:
BryanL wrote:in the SE file rule.java,
he uses the terms direct pointing & claiming, direct hidden pair & triplet (1.7, 1.9, 2.0, 2.5),
distinguished from pointing & claiming, hidden pair & triplet (2.6, 2.8, 3.4, 4.0).

could someone explain what the difference is between what he calls "direct" and otherwise?

"Direct" means that after you apply the method, you have a hidden single

When a direct method is found, only the resulting hidden single is found (not the method results themselves)


Nicolas Juillerat's definitions are stated here

i gave the relevant quotes here


lksudoku wrote:Sometimes the resulting hidden single must lie in certain houses and not everywhere

to qualify as "Direct",
the resulting "hidden single" must ( always ) be in a certain house

    this is also the subject of his bug ( for "Direct Pointing" and "Direct Claiming" )
    which i described 2008.Jan.20 ( URL above )
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

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

Postby BryanL » Mon Dec 06, 2010 7:35 am

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???

Bryan
BryanL
 
Posts: 247
Joined: 28 September 2010

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

Postby champagne » Mon Dec 06, 2010 8:20 am

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???

Bryan


I would agree that many features in that program are irritating. (i can even say that I strongly disagree on some view of the hierachy in chains)

If we try to go back at the time where the program has been written, i guess that Nicolas Juillerat tried to find in priority some rating rules not sensitive to morphs.

Just considering that point, part of the rating scale can be explained.

but it does not make easier the production of a clone.


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

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

Postby BryanL » Mon Dec 06, 2010 10:11 am

champagne wrote:
I would agree that many features in that program are irritating. (i can even say that I strongly disagree on some view of the hierachy in chains)

If we try to go back at the time where the program has been written, i guess that Nicolas Juillerat tried to find in priority some rating rules not sensitive to morphs.

Just considering that point, part of the rating scale can be explained.

but it does not make easier the production of a clone.

champagne

Hi Chapagne,

I always find your comments balanced.

I don't mean to be too disparaging of SE. Nicolas J created something that at this point I am not capable of - if only because I haven't coded any advanced techniques.

But I have always felt that with this project it was the perfect time to revisit the rating scale and performance. Clearly the performance of whatever PI, lk, you and anyone else who chips in, come up with, will blow SE away which is great.
Regarding the rating scale, all you guys who are in the sudoku forums have a lot of knowledge and experience and "instinctively know", or otherwise, where difficulty levels lie. Why is your collective knowledge being ignored?
Whenever there has been mention of changing the ratings there seems to be quite a lot of resistance. A lot from Ron - a perception, sorry if I am mistaken - and yet Ron you said, in the 5th post of this thread :

In the end, duplicating the solution path of Sudoku Explainer will, I believe, be the most difficult challenge. If that doesn't happen, ratings would assuredly change. However, if the compiled Explainer is really fast, we might not mind recalculating some ratings.

Why the change?

I push this line because the "project", although progressed a good way, seems to bog down around duplicating SE ratings.

I don't mean to be negative towards what has been done so far either. There will be a much better performing rating engine soon enough... I guess I am a bit too much of a purist.

On another point, the issue of attaining equivalent ratings of morphs is easily solved - as I think Danny mentioned - rate the minlex puzzle - so simple. This has been another sticking point to progress. There is discussion either way, but no one makes a decision - we are like a government committee... ;)

[/rant] :)
BryanL
 
Posts: 247
Joined: 28 September 2010

PreviousNext

Return to Software