next up previous
Next: About this document ...


Foundations of Artificial Intelligence

CSE 573 -- Fall 2001

Game PlayingKautz


Game Playing - Why?
















  1. Game playing is one of the oldest areas of AI. In 1950's Claude Shannon the inventor of information theory) and Alan Turing wrote some of the first chess programs. Since then steady progress has been made in many games and several programs can challenge world champions (two things led to this - speed of computers and better search methods).
  2. Provides a structured task in which it is very easy to measure success or failure. True. What's nice about it is that typically games are well-defined.
  3. Not much knowledge required intially ...thought that straightforward search would be the solution. Turned out not to be the case except for the simplest of games -- the search space is just too big.
  4. Why is tic-tac-toe boring? Search space is small enough that most adults can determine the perfect move.
  5. Focus has been on games of perfect information: tic-tac-toe, chess, checkers, Go, Othello, backgammon. Knowledge available to each person is the same. Games of imperfect information include poker (can't see the other's hand) and bridge.


Game Playing An AI Favorite


Game Playing

Initial State
Operators
Terminal Test
Utility Function

A game can be defined as a search problem with the following components:

We've already converted some games into search problems, e.g., 8-puzzle...

Initial State
initial board/position and an indication of whose move it is.
Operators
define the set of legal moves from any position
Terminal Test
determines when the game is over, hopefully the game is in a goal state (i.e., you have won).
Utility Function
gives a numeric outcome for the game. Example in tic-tac-toe and chess the outcome is win (+1), draw (0), lose(-1) Some games have wider payoffs. For example, backgammon has a payoff range from +192 to -192.


Game Playing

Initial State
is the initial board/position
Operators
define the set of legal moves from any position
Terminal Test
determines when the game is over
Utility Function
gives a numeric outcome for the game


Game Playing as Search



1#1


Winston, p. 102. Generic game tree. Original board; new boards, etc.
  1. Want to find path from initial state to goal. What if we try to apply one of our usual search algorithms. Exhaustive search: definitely not practical. Heuristic search? Fine for single-player games. Search for sequence of moves that leads to winning position.

  2. Two player games are different. Second player has some say about his/her moves and probably won't choose the move that helps the first player.

  3. This kind of tree is referred to as an and-or tree. (regular search is an OR tree.) Want to find a subtree (starting at the root), such that exactly one branch is selected when it's Max'x move and every branch is considered at Min's move. Strategy has to anticipate anything that Min does. OR-for Max, can choose move 1 or 2 or 3. AND-at Min level; have to consider all of Min's possible moves.


Partial Search Tree for Tic-Tac-Toe

2#2



3#3


Simple Minimax

4#4



5#5


Simplified Minimax Algorithm
  1. Expand the entire tree below the root.
  2. Evaluate the terminal nodes as wins for the minimizer or maximizer.
  3. Select an unlabeled node, 6#6, all of whose children have been assigned values. If there is no such node, we're done -- return the value assigned to the root.
  4. If 6#6 is a minimizer move, assign it a value that is the minimum of the values of its children. If 6#6 is a maximizer move, assign it a value that is the maximum of the values of its children. Return to Step 3.


Another Example

7#7



  1. In game tree search, a move is a pair of actions. One player's action is a ply. 2-ply = one move.
  2. Called a minimax decision because it maximizes the utility under the assumption that the opponent will play perfectly to minimize it.
  3. Time complexity: 8#8 (9#9 plies and 10#10 branching.) Impractical for e.g. chess (11#11 to 12#12).


The Need for Imperfect Decisions
Problem:
Minimax assumes the program has time to search to the terminal nodes.
Solution:


The Need for Imperfect Decisions
Problem:
Minimax assumes the program has time to search to the terminal nodes.
Solution:
Cut off search earlier and apply a heuristic evaluation function to the leaves.


13#13


Static Evaluation Functions Minimax depends on the translation of board quality into a single, summarizing number. Can be difficult. Expensive.


14#14


Design Issues of Heuristic Minimax
Evaluation Function:
What features should we evaluate and how should we use them? An evaluation function should:


15#15


Linear Evaluation Functions


21#21


Creating Evaluation Functions


22#22


Design Issues of Heuristic Minimax
Search:
search to a constant depth
Problems:















23#23


Design Issues of Heuristic Minimax




next up previous
Next: About this document ...
Don Patterson 2001-12-14