40 likes | 173 Views
Ch. 6 – Adversarial Search. Supplemental slides for CSE 327 Prof. Jeff Heflin. Tic-Tac-Toe Successor Function. O to bottom-center. O to top-left. O to top-center. O to top-right. Minimax Algorithm.
E N D
Ch. 6 – Adversarial Search Supplemental slides for CSE 327 Prof. Jeff Heflin
Tic-Tac-Toe Successor Function O tobottom-center O to top-left O totop-center O to top-right
Minimax Algorithm function MINIMAX-DECISION(state) returns an action v MAX-VALUE(state)return the action in SUCCESSORS(state) with value v function MAX-VALUE(state) returns a utility valueif TERMINAL-TEST(state) then return UTILITY(state)v -for each <a,s> in SUCCESSORS(state) dov MAX(v, MIN-VALUE(s))return v function MIN-VALUE(state) returns a utility valueif TERMINAL-TEST(state) then return UTILITY(state)v +for each <a,s> in SUCCESSORS(state) dov MIN(v, MAX-VALUE(s))return v From Figure 6.3, p. 166
Minimax with Cutoff Limit function MINIMAX-DECISION(state) returns an action v MAX-VALUE(state, 0)return the action in SUCCESSORS(state) with value v function MAX-VALUE(state, depth) returns a utility valueif CUTOFF-TEST(state, depth) then return EVAL(state)v -for each <a,s> in SUCCESSORS(state) dov MAX(v, MIN-VALUE(s, depth + 1))return v function MIN-VALUE(state, depth) returns a utility valueif CUTOFF-TEST(state, depth) then return EVAL(state)v +for each <a,s> in SUCCESSORS(state) dov MIN(v, MAX-VALUE(s, depth + 1))return v