What is alpha-beta pruning algorithm?

As we said before, the disadvantage of minimax search always needs to traverse the whole game tree. So, the number of game states minimax search has to examine is exponential in the depth of the tree. Unfortunately, we can’t eliminate the exponent, but it turns out we can effectively cut it in half. The trick is that it is possible to compute the correct minimax decision without looking at every node in the game tree. The particular technique we examine is called alpha–beta pruning. When applied to a standard minimax tree, it returns the same move as minimax would, but prunes away branches that cannot possibly influence the final decision.

Different from the minimax algorithm nodes, nodes in alpha-beta pruning algorithms will be assigned two values --- α\alpha value and β\beta value. α value is the lower bound utility value that can be found so far and β\beta value is the upper bound utility value that can be found so far.

For MAX, if one subtree contains value vv that is lower than MAX’s α\alpha value, then this subtree will have the utility no greater than α\alpha value. In this case, alpha-beta pruning algorithm will prune this branch. For MIN, the algorithm will prune the branch that has the utility value vv > β\beta value.

When first explore the node, initialize its α\alpha value to -\infty and its β\beta value to \infty. Starting from node AA, use DFS to search down the tree. The first successor under node BB is 3. So, now node BB, as a MIN, has the value at most 3 (βB\beta_B = 3).

Continue the DFS, the second successor under node BB has the value 12. As a MIN, node BB won’t choose this move. So, node BB is still at most 3.

The third successor under node BB has value 8. Node BB will still avoid this move. So, the value of BB is still at most 3. At this point, all the possible successors of BB are explored. Now node BB’s value is sure to be 3 (αB\alpha_B = 3, βB\beta_B = 3). Node AA now has a value that is at least 3 (αA\alpha_A = 3).

Continue the DFS, the first successor of node CC has value of 2. The value of CC now is at most 2 (βC\beta_C = 2) which is lower than αA\alpha_A. Node AA, as a MAX, will definitely avoid move to CC. So, there’s no need to keep search the successor of node CC. The algorithm will prune the remaining branches under node CC.

Now the algorithm explores node DD. The first successor of DD is 14. Set βD\beta_D = 14. Since node DD’s value now is at most 14 and is higher than node AA’s current best move, the algorithm will set 14 to the upper bound of AA to 14 (βA\beta_A = 14) and continue exploring.

After keep exploring the successors of DD and updating the value of DD as a MIN. Now node DD’s utility value is exactly 2 (αD\alpha_D = 2, βD\beta_D = 2) which is not the best choice now. So, node AA will choose the move to BB and its utility value is exactly 3 (αA\alpha_A = 3, βA\beta_A = 3).

results matching ""

    No results matching ""