From the course: AI Algorithms for Gaming
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
A word on complexity - Python Tutorial
From the course: AI Algorithms for Gaming
A word on complexity
- [Instructor] Since we've already seen a scary scenario for these algorithms, it's important to get a sense of how well our algorithms will work. So let's talk about the complexity of minimax. Suppose we have a search tree with a constant branching factor b, and a maximum depth m. In other words, each state has b possible moves, and game goes on for m turns. Well, the time complexity of minimax is O of b to the m, and its space complexity is O of m. Now this is asymptotic notation, so these are not exact expressions for the running time or the memory needed by the algorithm. Instead, these expressions refer to an upper bound of how the running time or the memory requirement grows as b or m grow. As you can see, the time complexity is exponential, just as you might have expected. Minimax takes billions of years to produce one move. This is because at each level we have b more possible states to analyze, and this will go…
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 45s
-
(Locked)
Code example: A perfect cat in a small world6m
-
(Locked)
Alpha-beta pruning5m 32s
-
(Locked)
The alpha-beta search algorithm5m 9s
-
(Locked)
Code example: A pruning cat3m 25s
-
-
-
-
-