flok wrote:flok wrote:Something I'm not entirely sure of:
Can I compare the score at different ply depths (of the same color) when determing alpha/beta? And would it make sense?
Also: when doing iterative deepening, can I use the score of the previous selected move as the alpha value for the next iteration?
OK let's say you do a search at depth 1 with a full window (root node)
Code: Select all
score = search(depth=1, alpha=-inf, beta=+inf)
Let's say that score = 50cp. Now you do a search at depth 2 with alpha=50:
Code: Select all
score = search(depth=2, alpha=+50, beta=+inf)
(i) if the score > 50, you can trust this result, and you have gained a bit of pruning (more beta cutoffs) because of this reduced window.
(ii) if the score is <= 50, it cannot be trusted. So you could research the full window:
Code: Select all
score = search(depth=2, alpha=-inf, beta=+inf)
and now you get a correct score.
This scheme is clearly not optimal, but if you devise a better one, the tradeoff (benefit of (i) versus cost of (ii)) can be significantly positive. It's called
Aspiration Windows:
http://chessprogramming.wikispaces.com/ ... on+Windows
A simple scheme could be something like that:
(0) search the wull window at depth 1 and get score(1).
(1) set alpha=score(1)-100cp and beta=score(1)+100cp, and search depth=2 with that window:
(i) if score is within the bounds: all good, proceed to the next iteration (set depth=3 and go to (1)).
(ii) if score <= alpha, then set alpha=-inf and retry (go back to (1))
(iii) if score >= beta, then set beta=+inf and retry (go back to (1))
You can already do some experiments with that, and see how to improve it. It's just a basic aspiration algorithm, to give you an idea.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.