【问题标题】:Alpha-beta pruning with transposition tables使用转置表进行 Alpha-beta 修剪
【发布时间】: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


【解决方案1】:

再想一想,这个问题是微不足道的:)

确实,如果子节点的值太好而导致beta-cutoff(value ≥ β),这意味着父节点的移动至少与value,但也许有一些更好的举动。所以 value 是确切节点值的 LOWERBOUND。

value ≤ alphaOrig 表示所有动作都比alphaOrig 差。这意味着 value 是所有移动结果的上界。

Lower 和 Upper 是当前节点的值的边界,而不是我暗示的根节点。

【讨论】:

    猜你喜欢
    • 2015-07-11
    • 1970-01-01
    • 1970-01-01
    • 2021-04-15
    • 1970-01-01
    • 1970-01-01
    • 2021-04-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多