Download presentation
Presentation is loading. Please wait.
Published byGiuliana Fragoso Amaro Modified over 6 years ago
1
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Seminar on Game Playing in AI by: Gaurav Phapale 05 IT 6010 11/6/2018 School of Information Technology
2
School of Information Technology
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 11/6/2018 School of Information Technology
3
School of Information Technology
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. 11/6/2018 School of Information Technology
4
Characteristics of game playing
Unpredictable Opponent. Time Constraints. 11/6/2018 School of Information Technology
5
Typical structure of the game in AI
2- person game Players alternate moves Zero-sum game: one player’s loss is the other’s gain Perfect information: both players have access to complete information about the state of the game. No information is hidden from either player. No chance (e.g. using dice) involved E.g. Tic- Tac- Toe, Checkers, Chess 11/6/2018 School of Information Technology
6
School of Information Technology
Game Tree Tic – Tac – Toe Game Tree Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
7
School of Information Technology
MAX 11/6/2018 School of Information Technology
8
School of Information Technology
MAX cont.. 11/6/2018 School of Information Technology
9
School of Information Technology
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. 11/6/2018 School of Information Technology
10
School of Information Technology
MINIMAX Tree.. Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
11
Assignment of MINIMAX Values
Minimax_value(u) { //u is the node you want to score if u is a leaf return score of u; else if u is a min node for all children of u: v1, .. vn ; return min (Minimax_value(v1),..., Minimax_value(vn)) return max (Minimax_value(v1),..., Minimax_value(vn)) } 11/6/2018 School of Information Technology
12
School of Information Technology
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) 11/6/2018 School of Information Technology
13
School of Information Technology
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? 11/6/2018 School of Information Technology
14
School of Information Technology
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 11/6/2018 School of Information Technology
15
Evaluation Function cont..
One of the evaluation function for Tic- Tac- Toe can be defined as: f( n) = [# of 3- lengths open for me] - [# of 3- lengths open for you] where a 3- length is a complete row, column, or diagonal 11/6/2018 School of Information Technology
16
School of Information Technology
Alpha Beta Pruning At each MAX node n, alpha(n) = maximum value found so far At each MIN node n, beta(n) = minimum value found so far 11/6/2018 School of Information Technology
17
Alpha Beta Pruning Cont..
Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
18
Alpha Beta Pruning Cont..
Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
19
Alpha Beta Pruning Cont..
Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
20
Alpha Beta Pruning Cont..
Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
21
Alpha Beta Pruning Cont..
Ref: Lehre/Einfuehrung-KI-SS2003/folien06.pdf 11/6/2018 School of Information Technology
22
Effectiveness of Alpha Beta Pruning.
Worst-Case branches are ordered so that no pruning takes place alpha-beta gives no improvement over exhaustive search Best-Case each player’s best move is the left-most alternative (i.e., evaluated first) In practice often get O(b(d/2)) rather than O(bd) e.g., in chess go from b ~ 35 to b ~ 6 this permits much deeper search in the same amount of time makes computer chess competitive with humans! 11/6/2018 School of Information Technology
23
Iterative Deepening Search.
IDS runs alpha-beta search with an increasing depth-limit The “inner” loop is a full alpha-beta search with a specified depth limit m When the clock runs out we use the solution found at the previous depth limit 11/6/2018 School of Information Technology
24
School of Information Technology
Applications Entertainment Economics Military Political Science 11/6/2018 School of Information Technology
25
School of Information Technology
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. 11/6/2018 School of Information Technology
26
School of Information Technology
References 'Artificial Intelligence: A Modern Approach' (Second Edition) by Stuart Russell and Peter Norvig, Prentice Hall Pub. Theodore L. Turocy, Texas A&M University, Bernhard von Stengel, London School of Economics "Game Theory" CDAM Research Report Oct. 2001 11/6/2018 School of Information Technology
27
School of Information Technology
Thank you…… 11/6/2018 School of Information Technology
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.