Game Playing in AI
Game Playing in AI
Game Playing in AI
by: Gaurav Phapale 05 IT 6010
4/8/2012 School of Information Technology 1
Definition. Game
Game playing is a search problem defined by: 1. Initial state 2. Successor function 3. Goal test 4. Path cost / utility / payoff function
4/8/2012
Types of Games
Perfect Information Game: In which player knows all the possible moves of himself and opponent and their results. E.g. Chess. Imperfect Information Game: In which player does not know all the possible moves of the opponent. E.g. Bridge since all the cards are not visible to player.
4/8/2012
4/8/2012
4/8/2012
Game Tree
Tic Tac Toe Game Tree
MAX
4/8/2012
MAX cont..
4/8/2012
MINIMAX..
2 players.. MIN and MAX. Utility of MAX = - (Utility of MIN). Utility of game = Utility of MAX. MIN tries to decrease utility of game. MAX tries to increase utility of game.
4/8/2012 School of Information Technology 9
MINIMAX Tree..
4/8/2012
10
else if u is a min node for all children of u: v1, .. vn ; return min (Minimax_value(v1),..., Minimax_value(vn)) else for all children of u: v1, .. vn ; return max (Minimax_value(v1),..., Minimax_value(vn)) }
4/8/2012 School of Information Technology 11
MINIMAX Algorithm..
Function MINIMAX-DECISION (state) returns an operator For each op in OPERATORS[game] do VALUE [op] = MINIMAX-VALUE (APPLY (op, state), game) End Return the op with the highest VALUE [op]
Function MINIMAX-VALUE (state, game) returns a utility value If TERMINAL-TEST (state) then Return UTILITY (state) Else If MAX is to move in state then Return the highest MINIMAX-VALUE of SUCCESSORS (state) Else Return the lowest MINIMAX-VALUE of SUCCESSORS (state)
4/8/2012
12
Properties of MINIMAX
Complete: Yes, if tree is finite Optimal: Yes, against an optimal opponent. Time: O(bd) (depth- first exploration) Space: O(bd) (depth- first exploration) b: Branching Factor d: Depth of Search Tree Time constraints does not allow the tree to be fully explored. How to get the utility values without exploring search tree up to leaves?
4/8/2012 School of Information Technology 13
Evaluation Function
Evaluation function or static evaluator is used to evaluate the goodness of a game position. The zero-sum assumption allows us to use a single evaluation function to describe the goodness of a position with respect to both players. E.g. f(n) is the evaluation function of the position n. Then, f(n) >> 0: position n is good for me and bad for you f(n) << 0: position n is bad for me and good for you f(n) near 0: position n is a neutral position
4/8/2012 School of Information Technology 14
4/8/2012
15
4/8/2012
16
4/8/2012
17
4/8/2012
18
4/8/2012
19
4/8/2012
20
4/8/2012
21
When the clock runs out we use the solution found at the previous depth limit
4/8/2012 School of Information Technology 23
Applications
Entertainment
Economics
Military Political Science
4/8/2012 School of Information Technology 24
Conclusion
Game theory remained the most interesting part of AI from the birth of AI. Game theory is very vast and interesting topic. It mainly deals with working in the constrained areas to get the desired results. They illustrate several important points about Artificial Intelligence like perfection can not be attained but we can approximate to it.
4/8/2012
25
References
'Artificial Intelligence: A Modern Approach' (Second Edition) by Stuart Russell and Peter Norvig, Prentice Hall Pub. http://www.cs.umbc.edu/471/notes/pdf/games.pdf http://l3d.cs.colorado.edu/courses/AI-96/sept23glecture.pdf Theodore L. Turocy, Texas A&M University, Bernhard von Stengel, London School of Economics "Game Theory" CDAM Research Report Oct. 2001 http://www.uni-koblenz.de/~beckert/Lehre/Einfuehrung-KISS2003/folien06.pdf http://ai-depot.com/LogicGames/MiniMax.html
4/8/2012
26
Thank you
4/8/2012
27