Game Trees and Minimax Algorithm J.-S. Roger Jang (張智星) MIR Lab, CSIE Dept. National Taiwan University jang@mirlab.org, http://mirlab.org/jang 2019/5/24
Game trees Game trees Minimax algorithm a-b pruning A tree to represent the progression of states during a two-player game Minimax algorithm A way of finding an optimal move in a two-player game (or in a game tree) a-b pruning A way of speeding up minimax algorithm
MinMax Rule: Game Tree of Tic-Tac-Toc O’s move! 1: O wins 0: Draw -1: O loses X X O Max O X O -1 -1 X’s move! X X O X X O X X O Min O O O O O X O X O O X O 1 -1 -1 1 X X O X X O X X O X X O X X O X X O Max O O X O O X O O X X O O O O X O X O X X O O X O O X O X O X 1 1 X X O X X O X X O X X O Min O O X O O O O O X O O O X O O X O X X O O X O X
Example: a-b Pruning in a Game Tree (1/3) Source Max Min Max Min 8 7 3 9 9 8 2 4 1 8 8 9 9 9 3 4
Example: a-b Pruning in a Game Tree (2/3) Source Stey-by-step DFS! Max Min Max Min 3 17 2 12 15 25 2 5 3 2 14
Example: a-b Pruning in a Game Tree (3/3) Source
Exercise 1: a-b Pruning in a Game Tree Display how the search can be reduced via a-b Pruning Max Min Max Min 5 7 3 9 6 5 2 4 1 8 1 6 4 9 3 4
Exercise 2: a-b Pruning in a Game Tree Display how the search can be reduced via a-b Pruning Max Min Max Min 8 7 3 9 2 5 5 4 1 8 6 1 4 9 3 4