【NEGAMAX】

负极大值算法是极小化极大算法的一个变体,其基本原理是基于下面的公式:

                                  max (a,b) = - min ( - a, - b)

    即在几个节点中选择得分最小的节点相当于将这些节点的得分乘以-1然后取得分最大的节点。这样Negamax算法就将每一步递归过程都统一了起来,每一次递归都选取最大值。

伪代码:

function negamax(node, depth)
if node is a terminal node or depth = 0
    return the heuristic value of node
 let best := -foreach child of node
     best := max(α, -negamax(child, depth-1))
return best

 

posted @ 2016-06-27 10:49  琥珀川||雨露晨曦  阅读(538)  评论(0)    收藏  举报