Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.

Similar presentations


Presentation on theme: "Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test."— Presentation transcript:

1 Chapter 6 Adversarial Search

2

3 Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test Payoff Function Payoff Function Numeric value for terminal states Numeric value for terminal states Usually + for one player -- for the other player Usually + for one player -- for the other player

4 Mini-Max Algorithm function maxValue(state) if (terminal) return value; for s in succ(state) maxValue = max(minValue(s), maxValue) return maxValue function minValue(state) if (terminal) return value; for s in succ(state) minValue = min(maxValue(s), minValue) return minValue

5 Mini-Max Example

6 Mini-max Algorithm Complete Depth-First Search Complete Depth-First Search Space Complexity Space Complexity O(bd) O(bd) Time Complexity Time Complexity O(b d ) O(b d ) Need Some method of pruning the search tree Need Some method of pruning the search tree

7 Alpha-Beta Pruning Some parts of the tree clearly do not need to be searched Some parts of the tree clearly do not need to be searched

8 Alpha-Beta Pruning alpha (α) : best choice so far for Max alpha (α) : best choice so far for Max beta (β) :best choice so far for Min beta (β) :best choice so far for Min alpha cut-off if alpha cut-off if min on a branch is < alpha min on a branch is < alpha beta cut-off if beta cut-off if Max on a branch is > beta Max on a branch is > beta

9 Alpha-Beta Algorithm function maxValue(state,A,B) if (terminal) return value; for s in succ(state) v = max(minValue(s,A,B), v) if (v >= B) then return v A = max(A,v) return v function minValue(state,A,B) if (terminal) return value; for s in succ(state) v = min(maxValue(s,A,B), v) if (v <= A) then return v B = min(B,v) return v

10 Alpha-Beta Pruning Effectiveness Effectiveness Highly dependent on which node is expanded first Highly dependent on which node is expanded first However, if a good ordering can be found However, if a good ordering can be found O(b d/2 ) instead of O(b d ) O(b d/2 ) instead of O(b d ) Effective branching factor is sqrt(b) Effective branching factor is sqrt(b) Chess 6 vs 35 Chess 6 vs 35

11 Imperfect Real-time decisions Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test Payoff Function Payoff Function Numeric value for terminal states Numeric value for terminal states Usually + for one player -- for the other player Usually + for one player -- for the other player

12 Imperfect Real-time decisions Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test Heuristic Evaluation Function Heuristic Evaluation Function Numeric value for terminal states Numeric value for terminal states Usually + for one player -- for the other player Usually + for one player -- for the other player

13 Imperfect Real-time decisions Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test Heuristic Evaluation Function Heuristic Evaluation Function Numeric value for terminal states Numeric value for terminal states Usually + for one player -- for the other player Usually + for one player -- for the other player

14 Evaluation Functions Properties of a good evaluation function Properties of a good evaluation function Accurate Accurate Fast Fast Features Features Important aspects of the Game Important aspects of the Game Chess Chess Material Advantage Material Advantage Positional Advantage Positional Advantage Pawn Structure Pawn Structure King Safety King Safety Checkers? Checkers?

15 Evaluation Function Weighted Linear Function Weighted Linear Function Assumes Feature Independence Assumes Feature Independence


Download ppt "Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test."

Similar presentations


Ads by Google