hgm wrote:bob wrote:A math question.
...
Indeed a difficult math question. What takes more time? Searching 40 moves with open window, or searching 3...
Not searching 40 with an open window here, so don't care, although the answer is obvious.
BTW you will _never_ search just 3 moves with open window to find the best 3, unless you have perfect root move ordering. So the real question here is, given a set of (say) 40 moves, what is the most efficient way to find the best three moves, when they might be in any of the 40 positions in the move list?
If you search the first, then artificially lower alpha so that you can discover the second, how much do you lower alpha? What if none trip that bound? Lower again? What if you lower it too far so that every move will trip it and fail high? Both of the approaches (one originally posted, the one I use in Crafty's annotate command) have some issues.
I like the idea of searching for the best, removing it, searching for the best, letting the hash table help with search efficiency. Older versions of annotate.c completely cleared the hash table between picking out each move as keeping it leads to some interesting conditions, where (say) the second move comes back with a better score than the best move, because of grafting. I decided that this was a bad idea and removed the clearing code with the proviso that the moves are in order of 1st to nth, even if the scores might not be in descending order. Scores are not exactly precise things in today's programs anyway.