From the course: AI Algorithms for Gaming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The alpha-beta search algorithm

The alpha-beta search algorithm - Python Tutorial

From the course: AI Algorithms for Gaming

Start my 1-month free trial

The alpha-beta search algorithm

- [Instructor] Here's the pseudocode for the Alpha-Beta Search Algorithm. This is pretty much the same as the Minimax decision algorithm. A wrapper for the top max node function. Now notice that max value takes two more arguments than its Minimax version. These arguments are alpha and beta, with initial values of minus infinity and plus infinity respectively. These values tell our algorithm that it starts knowing nothing about the values it will eventually choose. So formally, alpha is the best max value reported by the parent node. Initializing it in minus infinity means that the first value we consider will be the best so far. Conversely, beta is the best min value reported by the parent node. This is initialized at plus infinity for the same reason. Now, here's the Alpha-Beta version of max value. If you look at the code, you'll see that it works just as the Minimax version of max value, except that it does three…

Contents