本文介绍了α-β剪枝的极小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了一整天试图实现极小没有真正理解它。现在,我想我知道如何极小的作品,但不是α-β剪枝。

I have spent a whole day trying to implement minimax without really understanding it. Now, , I think I understand how minimax works, but not alpha-beta pruning.

这是我的极大极小的理解:

This is my understanding of minimax:

  1. 生成的所有可能的行动清单,直到深度限制。

  1. Generate a list of all possible moves, up until the depth limit.

评估如何有利的游戏区域是底部的每个节点。

Evaluate how favorable a game field is for every node on the bottom.

对于每一个节点,(从底部开始),该节点的分数是最高分的是孩子,如果该层是最大。如果该层为最小,该节点的得分是最低分的是孩子。

For every node, (starting from the bottom), the score of that node is the highest score of it's children if the layer is max. If the layer is min, the score of that node is the lowest score of it's children.

执行具有最高的分数,如果你正在尝试到最大,或者移动最低,如果你想最小得分。

Perform the move that has the highest score if you are trying to max it, or the lowest if you want the min score.

我的α-β剪枝的理解是,如果父层分钟,你的节点有更高的分数比最低分数,那么你可以修剪它,因为​​它不会影响结果。

My understanding of alpha-beta pruning is that, if the parent layer is min and your node has a higher score than the minimum score, then you can prune it since it will not affect the result.

不过,我不明白的是,如果你能制定出一个节点的分数,你需要知道上了一层比节点下所有节点的得分(在我的极小的理解)。这意味着you'llstill是使用CPU功率的量相同。

However, what I don't understand is, if you can work out the score of a node, you will need to know the score of all nodes on a layer lower than the node (in my understanding of minimax). Which means that you'llstill be using the same amount of CPU power.

任何人都可以请指出什么我越来越错了吗?这个答案(Minimax解释了白痴)帮助我理解极小,但我不明白怎么α+β修剪会有所帮助。

Could anyone please point out what I am getting wrong? This answer ( Minimax explained for an idiot ) helped me understand minimax, but I don't get how alpha beta pruning would help.

感谢你。

推荐答案

要了解α-β,考虑以下情况。它的白人转,白了就是想最大限度地得分,黑正试图将比分减少。

To understand Alpha-Beta, consider the following situation. It's Whites turn, white is trying to maximize the score, black is trying to minimize the score.

白色的计算结果将A,B,C和发现的最好成绩是20℃。现在考虑评估此举D会发生什么:

White evaluates move A,B, and C and finds the best score is 20 with C. Now consider what happens when evaluating move D:

如果白色选择将研发,我们需要考虑反举动黑色。在早期,我们发现黑可以捕捉的白皇后,那树得到了MIN比分5由于失去皇后。然而,我们没有考虑所有的黑人反移动。难道是值得一试的休息吗?没有。

If white selects move D, we need to consider counter-moves by black. Early on, we find black can capture the white queen, and that subtree gets a MIN score of 5 due to the lost queen. However, we have not considered all of blacks counter-moves. Is it worth checking the rest? No.

我们不关心黑人可以得到的分数低于5,因为白人将C可以保持比分为20黑不会选择反举措,得分高于5,因为他正试图减少得分和已经发现的举动与5.对于白色的高分,移动C是尽快pferred在移动D用作MIN为D(5至今)$ P $低于但是C(20肯定)。因此,我们修剪树的其他部分存在,重新弹出一个等级,评估白色移动E,F,G,H ....到最后。

We don't care if black can get a score lower than 5 because whites move "C" could keep the score to 20. Black will not choose a counter-move with a score higher than 5 because he is trying to MINimize the score and has already found move with a score of 5. For white, move C is preferred over move D as soon as the MIN for D (5 so far) goes below that of C (20 for sure). So we "prune" the rest of the tree there, pop back up a level and evaluate white moves E,F,G,H.... to the end.

希望有所帮助。

这篇关于α-β剪枝的极小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 16:18