Download presentation
Presentation is loading. Please wait.
Published bySpencer Butler Modified over 9 years ago
1
Games as adversarial search problems Dynamic state space search
2
D Goforth - COSC 4117, fall 20032 Requirements of adversarial game space search on-line search: planning cannot be completed before action multi-agent environment dynamic environment
3
D Goforth - COSC 4117, fall 20033 Features of gamesKing’s Court deterministic/stochastic perfect/partial information number of agents: n>1 optimization function interaction scheduling deterministic perfect 2 zero-sum turn-taking
4
D Goforth - COSC 4117, fall 20034 Games as state spaces state space variables describe relevant features of game start state(s) define initial conditions for play any legal state of the game is a state in the space transition edges in the space define legal moves by players two player turn-taking games define bi-partite state spaces terminal states (no out-edges) are determined by a ‘terminal test’ and define end-of-game
5
D Goforth - COSC 4117, fall 20035 Example game: turn-taking zero-sum game: two players: Max (plays first), Min n tokens rules: take 1, 2 or 3 tokens start state: 5 tokens, Max to play goal: take last token
6
D Goforth - COSC 4117, fall 20036 Example game: state space Turn Max Min Max Min Max 5 4 3 2 1 0 0 2 101 0 1 00 3 2 1 0 0 1 0 0 2 10 0 0 State: (number of tokens remaining, whose turn) e.g., (2,Max)
7
D Goforth - COSC 4117, fall 20037 Example game: Max’s preferences Turn Max Min Max Min Max 5 4 3 2 1 0 0 2 101 0 1 00 3 2 1 0 0 1 0 0 2 10 0 0 evaluation function for Max: + for win (0, Min), - for loss at terminal state (0, Max) + ++ + +++ ---- --
8
D Goforth - COSC 4117, fall 20038 Example game: Max’s move, why? Turn Max Min Max Min Max 5 4 3 2 1 0 0 2 101 0 1 00 3 2 1 0 0 1 0 0 2 10 0 0 Minimax back propagation of terminal states assumption: opponent (Min) is also smart + ++ + +++ ---- -- ---- + + + + +++ -- + see p.166, Fig. 6.3
9
D Goforth - COSC 4117, fall 20039 Minimax algorithm Back propagation in dynamic environment evaluate state space to decide one move attempt to find move that is best for all possible reactions Minimax assumption worst case assumption about dynamic aspect of environment (opponent’s choice) if assumption wrong, situation is better than assumed
10
D Goforth - COSC 4117, fall 200310 Minimax algorithm Deterministic if environment is deterministic (no random factors) Exhaustive search to terminal states - time complexity is O(b m ) b: number of moves in a game m: number of actions per move e.g. chess b 50, m 20, b m 10 33
11
D Goforth - COSC 4117, fall 200311 Minimax search in interesting games space is too large to search to terminal states (except possibly in endgames) use of heuristic functions to evaluate partial paths deeper search evaluates ‘closer’ to terminal states
12
D Goforth - COSC 4117, fall 200312 Minimax in large state space heuristic evaluation from viewpoint of Max minimization maximization
13
D Goforth - COSC 4117, fall 200313 The search-evaluate tradeoff branching factor n execution time for heuristic evaluation t search to level k total time: n k t = n k-1 (nt) to go a level deeper in same time, evaluation function must be n times more efficient special situations: start game, end game
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.