Presentation is loading. Please wait.

Presentation is loading. Please wait.

Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory.

Similar presentations


Presentation on theme: "Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory."— Presentation transcript:

1 Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory

2 Contents Introduction Definitions Game trees Minimax algorithm Alpha-beta pruning Iterative deepening Code example Dynamic programming

3 Introduction  “Computers cannot play chess.”  Deep Blue beats the world champion in 1997, Garry Kasparov.  (Kasparov thought IBM cheated with human chess players behind the machine.)  Deep Blue was capable of evaluating 200 million positions per second.  Deep Fritz beats world chess champion Vladimir Kramnik, 4-2 in 2006.  Deep Fritz ran on a personal computer housing two Intel Core 2 Duo CPUs, only capable of evaluating 8 million positions per second.  Anti-computer tactics - Arimaa; Exploiting computer evaluations.

4 Definitions Ply: Refers to one turn taken by one of the players. Partisan game: Some moves are available to one player and not to the other. Branching factor: Number of children at each node. Depth of a tree: Number of edges from the root to the node. Perfect information: Each player is perfectly informed of all the events that have previously occurred. Solved game: A game whose outcome can be correctly predicted from any position, given that both players play perfectly. Zero-sum game: A situation in which each players gain/loss of utility is exactly balanced by another players losses/gains. (Solved with Minimax)

5 Computer chess strategy?  If-Then Rules to determine the next move.  Tactics/Strategy to determine the next best move.  Evaluate Upcoming Moves to determine the next best move.

6 Game trees A directed graph (V, E) where V represents the positions in a game and E represents the moves. Let’s look at a game tree for tic-tac-toe… A complete game tree starts at the initial position of a game and contains all possible moves from each position.

7 Game tree: tic-tac-toe Plies 255,168 leaf nodes! So what can we do with a game tree?

8 Minimax algorithm Numbers in nodes at the bottom are the values of the board from the perspective of the player at the top, MAX

9 Minimax algorithm Easily searchable! Nope!

10 Alpha-beta pruning algorithm Now let’s calculate the values one at a time…

11 Alpha-beta pruning But how can we calculate moves in a given time frame when there isn’t enough time to generate the best move?

12 Iterative deepening

13 Example code

14 Dynamic programming Game tree

15 Other ways to speed up search How did Deep Fritz reach plies deeper than Deep Blue with only a fraction of Deep Blue’s computing power?  Transposition table (DP/Memoization): Hash table of each position analyzed up to a certain depth, on encountering a new position the program checks the table to see if the position has already been analyzed in constant time.  Killer Move Heuristic: Attempts to cutoff a branch assuming that a move that produced a cutoff in another branch at the same depth is likely to produce a cutoff in the current position.  History Heuristic: Dynamic move ordering based on the number of cutoffs caused by a given a move.  Principal Variation Search: Better than alpha-beta when there is a good move ordering.

16 Links/References  https://en.wikipedia.org/wiki/Game_tree https://en.wikipedia.org/wiki/Game_tree  https://en.wikipedia.org/wiki/Minimax https://en.wikipedia.org/wiki/Minimax  https://en.wikipedia.org/wiki/Game_complexity https://en.wikipedia.org/wiki/Game_complexity  https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search  https://en.wikipedia.org/wiki/Alpha-beta_pruning https://en.wikipedia.org/wiki/Alpha-beta_pruning  http://web.mit.edu/6.034/wwwbob/handout3-fall11.pdf http://web.mit.edu/6.034/wwwbob/handout3-fall11.pdf  https://www.youtube.com/watch?v=STjW3eH0Cik (Great Lecture) https://www.youtube.com/watch?v=STjW3eH0Cik  http://thesai.org/Downloads/Volume5No5/Paper_10- A_Comparative_Study_of_Game_Tree_Searching_Methods.pdf http://thesai.org/Downloads/Volume5No5/Paper_10- A_Comparative_Study_of_Game_Tree_Searching_Methods.pdf


Download ppt "Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory."

Similar presentations


Ads by Google