课程: AI Algorithms for Game Design with Python

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

The alpha-beta search algorithm

The alpha-beta search algorithm

- [Instructor] Here's the pseudo code 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 things with alpha and beta. The first usage of alpha and beta is in…

内容