343H: Honors AI
Lecture 6: Adversarial Search 2/4/2014
Kristen Grauman UT-Austin
1
343H: Honors AI Lecture 6: Adversarial Search 2/4/2014 Kristen - - PowerPoint PPT Presentation
343H: Honors AI Lecture 6: Adversarial Search 2/4/2014 Kristen Grauman UT-Austin Slides courtesy of Dan Klein, UC-Berkeley Unless otherwise noted 1 Announcements Assignments Reminder - PS1 due Thursday by 11:59 pm PS2 will be out
1
score (… though the autograder is quite good, and if your code autogrades as wrong, the autograder is almost always correct)
2
3
7
Image from vias.org
8
Chinook ended 40-year-reign of human world champion Marion Tinsley in
involving 8 or fewer pieces on the board, a total of 443,748,401,247
six-game match in 1997. Deep Blue examined 200 million positions per second, used very sophisticated evaluation and undisclosed methods for extending some lines of search up to 40 ply. Current programs are even better, if less historic.
though the best humans still beat the best machines. In go, b > 300! Classic programs use pattern knowledge bases, but big recent advances using Monte Carlo (randomized) expansion methods.
17
maximizes and the other minimizes
Adapted from Dan Klein
perfect information:
cube
best outcome it can reach
its children (the max value)
sums as before (utilities at end)
leads to best node
win lose lose
2 0 … 2 6 …. 4 6 8
2 0 … 2 6 …. 4 6 8
Value of a state: the best achievable outcome (utility) from that state Terminal states: Non-terminal states:
Terminal states: States under agent’s control: States under opponent’s control:
Agent Agent
Opponent Opponent
minimax value: best achievable utility against a rational (optimal) adversary
8 2 5 6 max min 2 5 5 Terminal values: part of the game Minimax values: computed recursively
def max-value(state): initialize v = -∞ for each successor of state: v = max(v, min-value(successor)) return v def min-value(state): initialize v = +∞ for each successor of state: v = min(v, max-value(successor)) return v
def max-value(state): initialize v = -∞ for each successor of state: v = max(v, value(successor)) return v def min-value(state): initialize v = +∞ for each successor of state: v = min(v, value(successor)) return v
12 8 5 2 3 2 14 4 6 3 2 2 3
10 10 9 100 max min
10
9
10
Adapted from Dan Klein
search to leaves!
evaluation function for non-terminal positions
explore 10K nodes / sec
chess program ? ? ? ?
4 9 4 min min max
4
Iterative deepening uses DFS as a subroutine:
length 1 or less. (DFS gives up on any path of length 2)
….and so on. … b
horizon, two here)
west in the next round of replanning!
12 8 5 2 3 2 14 3
<= 2 <= 14 <= 5
2 3
any choice point along the current path from the root
avoid it, so can stop considering n’s
MAX MIN MAX MIN
a n
b v
If so large that MIN prefers β elsewhere in the tree, then stop.
12 5 1 3 2 8 14 ≥8 3 ≤2 ≤1 3