Game Trees and Minimax Algorithm J S Roger

  • Slides: 8
Download presentation
Game Trees and Minimax Algorithm J. -S. Roger Jang (張智星) MIR Lab, CSIE Dept.

Game Trees and Minimax Algorithm J. -S. Roger Jang (張智星) MIR Lab, CSIE Dept. National Taiwan University jang@mirlab. org, http: //mirlab. org/jang

Game trees � A tree to represent the progression of states during a two-

Game trees � 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 2/16

Min. Max Rule: Game Tree of Tic-Tac-Toc 0 O’s move! Max X’s move! Min

Min. Max Rule: Game Tree of Tic-Tac-Toc 0 O’s move! Max X’s move! Min 0 -1 X XO OO XO 0 Max 1: O wins 0: Draw -1: O loses X XO O XOO 1 X XO OOX XO OO XOX 0 1 X XO OOX XOO -1 X XO OOO XOX -1 X XO XO XOO X XO OO XO 0 X XO OX XOO 0 X XO OOX XOO -1 X XO XO 1 X XO OO XOX 1 X XO OOO XOX 3/16

Example: a-b Pruning in a Game Tree (1/3) Source Max Min 8 7 3

Example: a-b Pruning in a Game Tree (1/3) Source Max Min 8 7 3 9 9 8 2 4 1 8 8 9 9 9 3 4 4/16

Example: a-b Pruning in a Game Tree (2/3) Source Stey-by-step DFS! Max Min 3

Example: a-b Pruning in a Game Tree (2/3) Source Stey-by-step DFS! Max Min 3 17 2 12 15 25 0 2 5 3 2 14 5/16

Example: a-b Pruning in a Game Tree (3/3) Source 6/16

Example: a-b Pruning in a Game Tree (3/3) Source 6/16

Exercise 1: a-b Pruning in a Game Tree Display how the search can be

Exercise 1: a-b Pruning in a Game Tree Display how the search can be reduced via a-b Pruning Max Min 5 7 3 9 6 5 2 4 1 8 1 6 4 9 3 4 7/16

Exercise 2: a-b Pruning in a Game Tree Display how the search can be

Exercise 2: a-b Pruning in a Game Tree Display how the search can be reduced via a-b Pruning Max Min 8 7 3 9 2 5 5 4 1 8 6 1 4 9 3 4 8/16