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 - Python Tutorial
From the course: AI Algorithms for Gaming
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Minimax overview4m 1s
-
(Locked)
Minimax example5m
-
(Locked)
The minimax algorithm3m 41s
-
(Locked)
A word on complexity2m 46s
-
(Locked)
Code example: A perfect cat in a small world6m
-
(Locked)
Alpha-beta pruning5m 32s
-
(Locked)
The alpha-beta search algorithm5m 10s
-
(Locked)
Code example: A pruning cat3m 25s
-
-
-
-
-