- Code: Select all
`1) ALS(1) -{1}- ALS(2) -{n}- n cannot be 1`

2) ALS(1) -{12}- ALS(2) -{nm}- nm must be 12

3) ALS(1) -{n}- ALS(2) -{12}- n must be either 1 or 2

4) ALS(1) -{12}- ALS(2) -{n} n must be either 1 or 2 depending on:

Backtrack prior sub-chain {12} dual-links to the beginning (origin) single.

a) If the number of prior {12}s is odd, then n must be the same as the origin RCD.

b) If the number of prior {12}s is even, then n cannot be the same as the origin RCD.

a) als -1- als -12- als -1- Odd length subchain extends the origin RCD

b) als -1- als -12- als -12- als -2- Even length subchain "flips" the origin RCD

Rule (1) conforms with the prior adjacency rule prohibiting RCD reuse in consecutive ALSs.

Rule (2) allows for sub-chains of dual-linked ALSs, specifically conjugate pairs as in XY chains.

Rules (3) and (4) define the entry/exit conditions for such sub-chains.

Loop checking becomes trickier when a potential loop "starts"/"ends" with a dual-link. You have to locate the corresponding origin/terminal ALSs, count the number of dual-linked conjugate pairs in-between, then check that the loop is valid. Since a circle has no end, I skip potential loops that "start" with a dual-link and wait until it is rediscovered with the dual-link sub-chain at the "end" and the terminal ALS at the "start" of the chain. This made the loop checking easier to code. The terms "start" and "end" are only meaningful in terms of how the chain is developed/linked. Once it loops, "start" and "end" are arbitrary at best.

The prior version of my ALS engine found 80333 eliminations in 1183 seconds from the royle17 collection of 36628 puzzles.

The new version found 88075 eliminations in 3247 seconds. A 10% increase in eliminations at the cost of a 3-fold increase in run-time. But there were 1375 unsolved with the old method and only 810 unsolved with the new using only the ALS engine and simple techniques previously documented. That's about a 40% improvement in solving to completion.

- Code: Select all
`Prior New`

plain ALS 25340 26150

overlap ALS 23863 30043

cannibal ALS 2165 2022

overlap/cannibal ALS 8013 7601

---------------------------------------------- -----

All ALS types 59381 65816

plain ALS loop 566 592

overlap ALS loop 122 189

cannibal ALS loop 97 101

overlap/cannibal ALS loop 26 57

---------------------------------------------- -----

All ALS loops (included in above) 811 939

I'll post the updated code later tonight. Those who want to experiment with comparisons to XY chains can use:

sudoku -bv -A2 -B8 -w <puzzle>

The -w flag switches to the new RCD rules. Testing with/without the -w flag will demonstrate the effectiveness of the new rules, especially for XY chaining example puzzles. If chain length -B8 (which is really 10 for those who read the brief explanation of the options) is insufficient, try a larger number such as -B12. Interestingly, the overlapping ALSs are now more common (and productive in terms of eliminations) than the plain non-overlapping variety.