Download presentation
Presentation is loading. Please wait.
1
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles1 Artificially Narrow Alpha & Beta AlphaBeta cuts off the search of the rest of a node’s children if/when it encounters one child whose minimaxed value exceeds (hope). Reduced values of result in more child nodes being cut off. Searching a tree - or any subtree - with a narrower window between & will cause more cutoffs. The search may be more efficient. But it may no longer return the right answer! Increased values of become reduced values for at the next deeper level; So increasing results in more grandchildren being cut off.
2
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles2 Aspiration Search - at the root of a tree If you are about to search a tree to some depth D, And you have a fair idea V guess what the minimax value is likely to be, (You can use the result of a search to depth D-1) Then you can search with a window V guess - , V guess + instead of - , + If you are right, you will obtain the true value V true with less search. The smaller is, the less search you do, but the less likely you are right. If you are wrong, and the true value V true ≤ V guess - Fail Low: Search again using window - , V guess If you are wrong, and the true value V true ≥ V guess + Fail High: Search again using window V guess, +
3
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles3 Iterative-Deepening Aspiration Search Algorithm {int guess = 0, depth = 1, delta = Pick_A_Number(); while Resources_Available() {int score, alpha=guess-delta, beta=guess+delta; score:= (alpha,beta,depth); if score ≥ beta /* Fail High */ then score:= (score,+ ,depth) else if score ≤ alpha /* Fail Low */ then score:= (- ,score,depth); guess:=score; depth:=depth+1} return guess}
4
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles4 Null windows If = +1, (and if evaluations return integers not reals), search will always either fail high or fail low. Such a search can be thought of as answering the boolean question: is V true ≤ V guess ? Such a search is used in NegaScout / PVS to confirm cheaply that subsequent move choices are in fact inferior to the move believed to be best but when subsequent moves are not in fact inferior, they must be searched again.
5
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles5 Negascout / PVS algorithm PVS( , , d) /* =- , =+ at root node */ {if d=0 then return evaluation( , ) else {mk(1); score:=-PVS(- ,- ,d-1); unmk(1); if score < then for m from 2 to Move_Count() {LB:=max( ,score); UB:=LB+1; mk(m); temp:=-PVS(-UB,-LB,d-1); if (temp≥UB and temp< ) then temp:=-PVS(- ,-temp,d-1); unmk(m); score:=max(score,temp); if temp ≥ then break} return score} }
6
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles6 NegaScout / PVS effect -9-7-6 -8-14 ( =-20, =+30) Suppose a negamax search of the suppressed subtrees would give the indicated values for the child nodes … the top node would have value +14
7
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles7 NegaScout / PVS effect (-30, +20) -9 -9 ( =-20, =+30)
8
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles8 NegaScout / PVS effect (-30, +20) -9 -9 ( =-20, =+30) UB=+9 +9
9
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles9 NegaScout / PVS effect (-30, +20) -9 (-10, -9) -7 -9-7 ( =-20, =+30) UB=+9 +7
10
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles10 NegaScout / PVS effect (-30, +20) -9 (-10, -9) -6 (-10, -9) -7 -9-7-6 ( =-20, =+30) UB=+9 +6
11
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles11 NegaScout / PVS effect (-30, +20) -9 (-10, -9) -12 (-10, -9) -6 (-10, -9) -7 -9-7-6 -12 ( =-20, =+30) UB=+9 +12
12
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles12 NegaScout / PVS effect (-30, +20) -9 (-10, -9) -12 (-10, -9) -6 (-10, -9) -7 -9-7-6 -12 ( =-20, =+30) UB=+9 +12
13
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles13 NegaScout / PVS effect (-30, +20) -9 (-30, +12) -14 (-10, -9) -12 (-10, -9) -6 (-10, -9) -7 -9-7-6 ( =-20, =+30) UB=+9
14
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles14 NegaScout / PVS effect (-30, +20) -9 (-30, +12) -14 (-10, -9) -12 (-10, -9) -6 (-10, -9) -7 -9-7-6 -14 ( =-20, =+30) UB=+14 +14
15
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles15 NegaScout / PVS effect (-30, +20) -9 (-30, +12) -14 (-15, -14) -8 (-10, -9) -12 (-10, -9) -6 (-10, -9) -7 -9-7-6 -8-12 ( =-20, =+30) UB=+14 +8
16
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles16 The SCOUT algorithm Takes to an extreme the idea that minimal-window searches are cheap Replaces general with a divide-and-conquer approach First guess midway in range of possible values - say [-512,+512] Guess 0, use window [0,+1] A result of say +24 means only that the true result exceeds 0 oTry again, with window [+256,+257] oA result of say +24 means only that the true result is no more than 256 –Try again, window [+128,+129] * and so on, cutting range in half each time, * eventually finding the N such that value > N-1 & value ≤ N
17
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles17 MTD(f) Algorithm Scout’s divide-and-conquer approach does not take advantage of the result of a previous iterative-deepening search to make a good 1st guess. MTD(f) does, then creeps toward correct answer. score=0; d=0; while resources permit, {d:=d+1; LB=- ; UB=+ ; while LB < UB {if score = LB then window:=score else window:=score-1; score:= (window,window+1,d); if score <= window then UB:=score else LB:=score} } return score
18
http://csiweb.ucd.ie/Staff/acater/comp30260.html Artificial Intelligence for Games and Puzzles18 Reflection on variants Aspiration Search, NegaScout, Scout, MTD(f) All these variations on may involve repeating searches with different choices for and . This can make savings, but probably only if a transposition table is also used, to allow results of previous partial searches to be reused. For chess, MTD(f) seems to need on average 3 - 5 iterations to converge, and saves 5%-15% in terms of number of nodes generated. [ref Schaeffer: http://www.cs.ualberta.ca/~jonathan/Courses/657/Notes/7.Windows.pdfhttp://www.cs.ualberta.ca/~jonathan/Courses/657/Notes/7.Windows.pdf ] is fundamentally a depth-first tree search algorithm. Iterative Deepening gives an effect rather like breadth-first search.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.