denis_berthier wrote:I don't think it worth to base any general technique on this example.
With my graphical interface, I can visualize simultaneously T-backdoors and targets of whips[<=n].
So for me the work is already done, at least in semi-automatic mode.
denis_berthier wrote:The only purpose of my remark was to underline an extreme example where steepest-descent doesn't work. It looks like the following mountain, where you start at x. Steepest descent takes you to the left side; you'll need many steps to reach the base. But, if you had delayed steepest-descent by 2 steps, you'd find the really shortest path.
...
Not only is steepest-descent not guaranteed to find the shortest path, it's also guaranteed not to find it in some easy to imagine cases.
I have observed this as well and, to reduce this problem a little, I improved my algorithm.
First of all, I remind you my goal is to reduce the number of whips[>=2] (which are patterns with a single target). So that's less general than your “Fewer-steps” algorithm.
In summary, instead of choosing a best score target of a whip[<=n] at each step, my improvement consists in choosing a best score
pair of targets.
The score (S) of a pair of targets (t1,t2) is defined as
S = 2 + number of candidates that would be deleted with basics if t1 and t2 were deleted. This, considering that t1 and t2 exist
simultaneously as targets in the current resolution state (for version V2A).
But there is a second version (V2b) that allows me to also search for pairs (t1,t2) where t2 only appears as a target after removing t1 and executing basics. In this case I will call (t1,t2) a pair of
consecutive targets.
Obviously V2b is much more expensive in execution time than V2a.
Finally I have 3 versions:
V1: For each step, deletion of a best score target. (initial version).
V2a: For each step, deletion of a best score pair of simultaneous targets.
V2b: For each step, deletion of a best score pair of targets (consecutive or simultaneous).
Application to this puzzle (Cornered)
With version V1: in W4 15 tries all gave a path with 3 whips + 1 naked pairs. Here is one:
20 singles.
Box/Line: 6r3b1 => -6r2c3
whip[4]: b1n9{r2c3 r3c2}- c5n9{r3 r7}- b9n9{r7c8 r8c7}- b3n9{r1c7 .} => -9r5c3
Single: 9r2c3
Box/Line: 7b1r3 => -7r3c5 -7r3c8
Box/Line: 7c8b6 => -7r5c7
whip[2]: r7n7{c5 c2}- c3n7{r8 .} => -7r5c5
Singles: 7r7c5, 7r8c3
Box/Line: 9r7b9 => -9r8c7
whip[2]: c5n9{r3 r5}- c7n9{r5 .} => -9r3c8
Singles: 8r3c8, 7r2c7, 9r1c7, 9r3c5
Naked pairs: 68r5c37 => -6r5c1 -8r5c4 -8r5c5 -8r5c6 -8r5c9
STTE.
With version V2a: in W4 one try gave this path with 2 whips + 2 naked pairs:
20 singles
Box/Line: 6r3b1 => -6r2c3
whip[4]: r7n7{c5 c2}- c3n7{r8 r2}- r3n7{c1 c8}- c7n7{r1 .} => -7r5c5
whip[4]: c3n9{r5 r2}- r3n9{c2 c8}- r7n9{c8 c9}- b6n9{r5c9 .} => -9r5c5
Naked pairs: 58c5r59 => -8r3c5 -8r7c5
Single: 8r3c8
Box/Line: 7c8b6 => -7r5c7
Box/Line: 9b3c7 => -9r5c7 -9r8c7
Box/Line: 9r8b8 => -9r7c5
Singles: 7r7c5, 9r3c5, 9r1c7, 7r2c7, 9r2c3, 7r8c3
Naked pairs: 68r5c37 => -6r5c1 -8r5c4 -8r5c5 -8r5c6 -8r5c9
STTE
With version V2b: in W4 one try gave the same path.