creint wrote:denis_berthier wrote:Then the following whip gives a single step solution (stte):
- Code: Select all
whip[15]: c9n6{r5 r6} - c9n2{r6 r8} - b8n2{r8c4 r9c6} - r6n2{c6 c7} - r6n1{c7 c6} - r5n1{c6 c9} - r1n1{c9 c7} - r4c7{n1 n8} - b9n8{r7c7 r8c8} - c6n8{r8 r1} - r1n5{c6 c1} - c1n4{r1 r9} - r9c7{n4 n7} - r9c2{n7 n6} - c5n6{r9 .} ==> r5c3 ≠ 6
stte
Of course, this is a long chain, but for single-step solution lovers, that's the best one I could find.
How long did it take to find this, how fast is CLIPS?
First, this is not the normal solution in SudoRules. I gave the normal solution in one of the first posts of this thread and it takes 5s when all the rules are activated; it takes only 2s when only whips are activated. All this is done using the simplest-first strategy and no chain of length > 4 is necessary.
As for the whip[15], it's more difficult to answer about time, because part of the process is currently manual:
- I you want a single-step solution, provided there's one, you first need to find the anti-backdoors; in the present case, it takes 5 seconds to find the 5 W1-anti-backdoors.
- after that you have to use newly defined function (try-to-eliminate-candidates xxx) , where xxx is one of these anti-backdoors; for most of them, there's no whip based on xxx and it takes less than 0.1s to find this; for n6r5c3, it's a little longer, but not extremely long because the search is focused on a fixed target (2.5 minutes). Remember that a whip[15] is exceptionally long.
[Edit: all computations times are for an old MacBookPro Retina Mid-2012 i7 2.7GHz, 16GB 1600MHz DDR3, MacOS 10.15.7]
creint wrote:Do you have a method to find the first/best rank 0 for a give sudoku state?
For any set of rules and any resolution state, SudoRules will find one of the simplest rules applicable, thanks to its simplest-first strategy.
The rules in CSP-Rules are not based on set coverings, so rank 0 has no meaning for them. However, if you can code such rules, CSP-Rules simplest-first strategy will be applicable. If you activate only Subset rules, they are rank 0 and Subsets will be found according to the same simplest-first strategy. See all the Mith puzzles where I have given lots of solutions of this kind (none of which takes more than a few seconds - and generally less than 1s.)
The problem with set coverings is, nobody has ever been able to code all the possible rules of rank 0 based on set covers of any fixed size. The reason is obvious: combinatorial explosion. What you see in existing solvers is only special cases of rank 0.
Remember that you can experiment all this by yourself, as CSP-Rules is now public: https://github.com/denis-berthier/CSP-Rules-V2.1
and I've updated the user's manual a few days ago so as to include these new functions.