Sure cuts a lot 5 tutorials8/14/2023 Move order is an important aspect of alpha-beta pruning. The effectiveness of alpha-beta pruning is highly dependent on the order in which each node is examined. Hence the optimal value for the maximizer is 3 for this example. ![]() Following is the final game tree which is the showing the nodes which are computed and nodes which has never computed. Step 8: C now returns the value of 1 to A here the best value for A is max (3, 1) = 3. Now at C, α=3 and β= 1, and again it satisfies the condition α>=β, so the next child of C which is G will be pruned, and the algorithm will not compute the entire sub-tree G. Step 7: Node F returns the node value 1 to node C, at C α= 3 and β= +∞, here the value of beta will be changed, it will compare with 1 so min (∞, 1) = 1. Step 6: At node F, again the value of α will be compared with left child which is 0, and max(3,0)= 3, and then compared with right child which is 1, and max(3,1)= 3 still α remains 3, but the node value of F will become 1. At node A, the value of alpha will be changed the maximum available value is 3 as max (-∞, 3)= 3, and β= +∞, these two values now passes to right successor of A which is Node C.Īt node C, α=3 and β= +∞, and the same values will be passed on to node F. Step 5: At next step, algorithm again backtrack the tree, from node B to node A. If beta=β, so the right successor of E will be pruned, and algorithm will not traverse it, and the value at node E will be 5. If MaximizingPlayer then // for Maximizer PlayerĮva= minimax(child, depth-1, alpha, beta, False) If depth =0 or node is a terminal node then The main condition which required for alpha-beta pruning is:įunction minimax(node, depth, alpha, beta, maximizingPlayer) is Note: To better understand this topic, kindly study the minimax algorithm. Hence by pruning these nodes, it makes the algorithm fast.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |