As assignments are made, the system depends on two basic routines to make the resultant eliminations: checking for naked and hidden tuples and box/line reductions.
This is the sequence of operations:
- 1. Box1 is randomly seeded with a full set of digits
2. In each mini-row and column, one digit is randomly selected to repeat in the opposite diagonal direction to the other two.
__ This braiding analysis approach doesn't result in any assignments, but it does reduce the mini-rows in tier1 and the mini-columns in stack1 to triples.
3. Box9 is randomly seeded with full set of digits and this is repeated if necessary until no empty cells result in boxes 3 or 7.
__ An empty cell will be caused by a chance matching of a triple in b3 or b7 with a triple in the opposite direction in b9.
4. Two digits are randomly set in diagonal cells in box5 and then in the six remaining boxes.
5. The cells in box 5 are now filled by randomly selecting candidates, prioritising the cells that hold the fewest.
6. The great majority of cells will now be reduced to singles, but for those that aren't, the final candidates to assign are selected as for box 5.
- Code: Select all
*-------------------------*-------------------------*-------------------------*
| 2 7 9 | 36 36 8 | 15 15 4 |
| 1 6 3 | 45 45 9 | 7 8 2 |
| 8 4 5 | 127 127 127 | 3 6 9 |
*-------------------------*-------------------------*-------------------------*
| 346 9 127 | 8 1234567 1234567 | 1245 157 36 |
| 346 8 127 | 1234567 9 1234567 | 1245 157 36 |
| 346 5 127 | 123467 123467 123467 | 124 9 8 |
*-------------------------*-------------------------*-------------------------*
| 9 12 46 | 12467 12467 12467 | 8 3 5 |
| 7 23 8 | 9 235 235 | 6 4 1 |
| 5 13 46 | 1346 8 1346 | 9 2 7 |
*-------------------------*-------------------------*-------------------------*
This example grid shows the state of play at the end of step 4.
It shows that in step 3, if r7c7 had held (3) rather than (8), then r3c7 would have been empty as (369)r3c789 would have been matched by (369)r789c7.
This sequence aims to get the fastest descent by keeping the focus narrow at every stage, and by restricting the available choices as quickly as possible. Clearly naked and hidden singles must be assigned as soon as they are revealed, but after the eliminations resulting from pairs are made, trials have shown that they can be safely ignored until after box 5 has been assigned. In combination, these assignments produce a larger number of follow-on eliminations, which will convert most of these ignored pairs into singles in the process.
From limited manual trials, it appears that only step 3 can cause an invalid grid to be produced, and this can be quickly checked and corrected when necessary. However, this needs to be tested using a much bigger sample size. Depending on circumstances, I may code this approach into a worksheet function, but I would like to hear any comments from more experienced programmers first.
DPB
.