【发布时间】:2020-12-18 07:42:17
【问题描述】:
我不明白为什么要按原样使用表条目的标志。考虑例如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。
我的逻辑肯定是错误的,从我的测试和每个人都使用该版本的事实中可以看出。但我不明白为什么。
【问题讨论】:
-
在您引用的维基百科页面上有一个关于这个主题的非常有趣的讨论:https://en.wikipedia.org/wiki/Talk:Negamax
-
@TheSlater,谢谢,这是一个有趣的讨论。起初,我和那里的一个固执的人一样做了同样的虚假“优化”。同样有趣的是,Carolus 广泛引用的文本包含一个错误,该错误源于我的问题的虚假逻辑。
标签: algorithm language-agnostic artifactory alpha-beta-pruning negamax