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.
Minimax example - Python Tutorial
From the course: AI Algorithms for Gaming
Minimax example
- [Instructor] So let me show you how minimax works on the tree we just saw. The only argument we need is the current state of the game at the moment we are called to produce our next move. This is the top min node. Now recall that minimax operates in a depth first traversal. This is the order of evaluation you'll see in this example, we'll go from left to right. Recall that we have three possible moves, A, B and C. So the agent is going to decide which of these three moves minimizes our maximum loss. Or in other words, which of these moves will yield the best result for us. Since this is a max node, we are going to choose the maximum of these three options. So we start by analyzing move A. This produces a new state in a min node, which in turn has three possible moves. Notice that to choose the minimum value here, we need the values, so we need to dig deeper. Starting at the leftmost move, which takes us to yet another…
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
-
-
-
-
-