我无法理解为什么 alpha-beta 剪枝算法不应该在这里剪枝 C?
这是我的终端输出:
eval A
min 2 min1 -9223372036854775807 10.0
eval B
min 2 min2 10.0 10.0
*** FAIL: test_cases/q3/6-tied-root.test
*** Incorrect generated nodes for depth=3
*** Student generated nodes: A B max min1 min2
*** Correct generated nodes: A B C max min1 min2
*** Tree:
*** max
*** / \
*** min1 min2
*** | / \
*** A B C
*** 10 10 0
我的理解是,一旦对 B 进行求值,min2 就会发现 max 不会选择任何低于 10 的值,因此,即使找到更小的值 (x<=10),也不会产生影响。在这种情况下,只有当 B 大于 10 时,min2 才会被激励去查看 C。
提前致谢
最佳答案
My understanding was that once B is evaluated, min2 will see that max will not pick anything lower than 10, therefore, even if a smaller value is found (x<=10) it would not make a difference.
这是正确的,可以使用在线模拟器进行验证(例如 http://homepage.ufp.pt/jtorres/ensino/ia/alfabeta.html 或 https://raphsilva.github.io/utilities/minimax_simulator/ ):
min2 would only be incentivized to look at C if B was greater than 10.
同样正确:
<小时/>min2 还必须检查 C
(如果 A 小于 10
)。
这可能是一个错误的测试用例吗?
关于python - Alpha Beta 剪枝算法的绑定(bind)根,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60219543/