von **apo** » Dienstag 7. Januar 2014, 20:49

Hi James

It probably depends a little bit on what you are willing to accept as an algorithm: the best way is to go through all the numbers 1-9 for each row/column and simulate if there is still a solution possible when you would skip the number. So: assume you would skip number 1 in row 1 -> will you then still be able to fill the compartments in row 1 without violating the rule that numbers are consecutive and only occur once? To determine this you could either simply check the basics (consecutive and unique) or you could simulate all other rules that you have (like stranded digit, high low, stranded sequence etc). This is I think also what we do when we try to resolve it with our brain (limited to a small number of moves we can anticipate). Whenever you reach a situation where you run into a contradiction you obviously hit a sure candidate.

The problem is (I think) that you want a solver not to be too clever - otherwise you could simply write an algorithm trying each and every combination until you hit the solution. So you have to answer to yourself how far you want to go with your algorithm for this check.

Maybe you start with a limited check (like only the sum of all sure candidates from all compartments of a row /column) and see how far you get with this? I assume you need to determine the SC for a check of Setti's rule?

At least some results you should get this way.

Cheers

apo