Jump to content
  • Advertisement
Sign in to follow this  
BitSet

NegaScout & TT

This topic is 3146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Yes, I store value type indicator. I wasn't only sure about zero-window. Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!