Question: Alpha-Beta pruning is not actually a new algorithm, rather an optimization technique for minimax algorithm. It reduces the computation time by a huge factor. This




Alpha-Beta pruning is not actually a new algorithm, rather an optimization technique for minimax algorithm. It reduces the computation time by a huge factor. This allows us to search much faster and even go into deeper levels in the game tree. It cuts off branches in the game tree which need not be searched because there already exists a better move available. It is called Alpha-Beta pruning because it passes 2 extra parameters in the minimax function, namely alpha and beta. Following the following the pseudo code for minimax function, please answer the question, assuming that we call the function minimax(0,0, true, -INFINITY, +INFINITY) for the first time. \begin{tabular}{|l|} \hline function minimax(node, depth, isMaximizingPlayer, alpha, beta): \\ if node is a leaf node: \\ \hline return value of the node \\ \hline if isMaximizingPlayer: \\ \hline bestVal = -INFINITY \\ \hline for each child node: \\ \hline value = minimax(node, depth +1, false, alpha, beta) \\ \hline bestVal = max( bestVal, value) \\ \hline alpha = max( alpha, bestVal) \\ \hline if beta +1, true, alpha, beta) \\ \hline bestVal = min(bestVal, value) \\ \hline beta = min( beta, bestVal) \\ \hline if beta MAX minimax(0,0, true, -INFINITY, +INFINITY) MIN MAX (2) (3) (4) 3 (4) (7) (6)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
