Game Playing Using MiniMax with Alpha-Beta Cutoff

ALPHA-BETA cutoff is a method for reducing the number of nodes explored in the Minimax strategy. For the nodes it explores it computes, in addition to the score, an alpha value and a beta value.

ALPHA value of a node

BETA value of a node

It Is Guaranteed That:

Function MINIMAX-AB

function MINIMAX-AB(N, A, B) is ;; Here A is always less than B begin if N is a leaf then return the estimated score of this leaf else Set Alpha value of N to -infinity and Beta value of N to +infinity; if N is a Min node then For each successor Ni of N loop Let Val be MINIMAX-AB(Ni, A, Min); Set Beta value of N to Min; When A >= Beta value of N then Return Beta value of N endloop; Return Beta value of N; else For each successor Ni of N loop Let Val be MINIMAX-AB(Ni, Max, B); Set Alpha value of N to Max; When Alpha value of N >= B then Return Alpha value of N endloop; Return Alpha value of N; end MINIMAX-AB;

Starting the Game