From the course: AI Algorithms for Game Design with Python
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
The alpha-beta search algorithm - Python Tutorial
From the course: AI Algorithms for Game Design with Python
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…
Contents
-
-
-
-
Minimax overview4m 1s
-
(Locked)
Minimax example5m
-
(Locked)
The minimax algorithm3m 41s
-
(Locked)
A word on complexity2m 45s
-
(Locked)
Challenge: A perfect cat in a small world4m 49s
-
(Locked)
Solution: A perfect cat in a small world8m 24s
-
Alpha-beta pruning5m 32s
-
(Locked)
The alpha-beta search algorithm5m 9s
-
(Locked)
Challenge: A pruning cat49s
-
(Locked)
Solution: A pruning cat2m 19s
-
-
-
-
-