Sign in to follow this  
BitSet

NegaScout & TT

Recommended Posts

Hi, I use NegaScout along with Transposition Table but I don't save results obtained via calls with zero-window: alpha, alpha+1. In fact I don't use TT in zero-window search at all. I'm not sure but I think saving these results may lead to mistakes. Can I somehow make use of zero-window search result in context of transposition table?

Share this post


Link to post
Share on other sites
You should definitely store and use the results of zero-window searches. If you also store a flag indicating whether the stored result is an exact score, a lower bound or an upper bound, this shouldn't lead to any mistakes.

Some pseudo code:
int NegaScout(Board &b, int depth, int alpha, int beta) {
if (depth<=0)
return static_eval(b, depth);

HashEntry *he = hash_search(b);
if (he != 0) {
if (he->depth >= depth) { // Don't use the score otherwise
switch (he->flag) {
case LOWER_BOUND:
alpha = max(alpha, he->score);
break;
case UPPER_BOUND:
beta = min(beta, he->score);
break;
case EXACT_SCORE:
return he->score;
}
if (alpha>=beta)
return alpha;
}
}

// The loop goes here. Make sure to search the move stored in the hash table
// first, even if (he->depth < depth). Also, break out of the loop in case of
// a beta cut-off, instead of simply returning the score. This will give you
// an opportunity to update the hash table, the history-heuristic table, etc.

HashFlag flag = (best_score <= alpha) ? LOWER_BOUND
: (best_score >= beta) ? UPPER_BOUND
: EXACT_SCORE;

store_hash(b, depth, score, flag, best_move);

return best_score;
}


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this