带有换位表的Alpha-beta修剪

问题描述

我不明白为什么原样使用表条目的标志。考虑例如Negamax with alpha-beta pruning and transposition tables的伪代码,并专注于TT部分。

(* Transposition Table Lookup; node is the lookup key for ttEntry *)
ttEntry := transpositionTableLookup(node)
if ttEntry is valid and ttEntry.depth ≥ depth then
    if ttEntry.flag = EXACT then
        return ttEntry.value
    else if ttEntry.flag = LOWERBOUND then
        α := max(α,ttEntry.value)
    else if ttEntry.flag = UPPERBOUND then
        β := min(β,ttEntry.value)

    if α ≥ β then
        return ttEntry.value

没关系。如果条目包含精确值的下限,我们尝试从左侧缩小窗口,依此类推。

(* Transposition Table Store; node is the lookup key for ttEntry *)
ttEntry.value := value
if value ≤ alphaOrig then
    ttEntry.flag := UPPERBOUND
else if value ≥ β then
    ttEntry.flag := LOWERBOUND
else
    ttEntry.flag := EXACT
ttEntry.depth := depth  
transpositionTableStore(node,ttEntry)

这部分我不明白。如果 value 太小,为什么还要设置UPPERBOUND标志? value 位于搜索窗口的左侧-小于已知的下限- alpha 。因此,看来 value 应该是LOWERBOUND。

从我的测试以及每个人都使用该版本的事实可以看出,我肯定对这种逻辑有误。但是我不明白为什么。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)