Game. Definition. MinMax Algorithm. MinMax Example. MinMax steps

Definition Game MinMax Alpha-Beta ItIt is is aa Search Search depth depth Tree Tree Defined by : Defined by : Initial Initial state state (how (how ...
Author: Penelope Lyons
0 downloads 2 Views 246KB Size
Definition

Game MinMax Alpha-Beta

ItIt is is aa Search Search depth depth Tree Tree Defined by : Defined by : Initial Initial state state (how (how the the board board isis set set up) up) Operators Operators (legal (legal moves) moves) Terminal Terminal state state (game (game isis over) over) Utility Utility or or payoff payoff function function (who (who won, won, by by how how much) much)

Two Two strategies strategies have have been been defined: defined: MinMax MinMax algorithm algorithm Alpha-Beta Alpha-Beta algorithm algorithm

MinMax Algorithm

MinMax Example

Two-player games with perfect information, the minmax can determine the best move for a player by enumerating (evaluating) the entire game tree. Player 1 is called Max Maximizes result

Player 2 is called Min Minimizes opponent’s result

MinMax steps Int MinMax (state s, int depth, int type) { if( terminate(s)) return Eval(s); if( type == max ) { for ( child =1, child BestScore) BestScore = Value; } } if( type == min ) { for ( child =1, child = Beta ) return Beta; } return Alpha; } if( type == min ) { for ( child =1, child

Suggest Documents