• Keine Ergebnisse gefunden

42.1 Alpha-Beta Search

N/A
N/A
Protected

Academic year: 2022

Aktie "42.1 Alpha-Beta Search"

Copied!
4
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)Foundations of Artificial Intelligence May 17, 2021 — 42. Board Games: Alpha-Beta Search. Foundations of Artificial Intelligence 42. Board Games: Alpha-Beta Search. 42.1 Alpha-Beta Search. Malte Helmert. 42.2 Move Ordering. University of Basel. 42.3 Summary. May 17, 2021. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 1 / 16. M. Helmert (University of Basel). Foundations of Artificial Intelligence. 42. Board Games: Alpha-Beta Search. May 17, 2021. 2 / 16. Alpha-Beta Search. Board Games: Overview. chapter overview: I 40. Introduction and State of the Art I 41. Minimax Search and Evaluation Functions. 42.1 Alpha-Beta Search. I 42. Alpha-Beta Search I 43. Monte-Carlo Tree Search: Introduction I 44. Monte-Carlo Tree Search: Advanced Topics I 45. AlphaGo and Outlook. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 3 / 16. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 4 / 16.

(2) 42. Board Games: Alpha-Beta Search. Alpha-Beta Search. Alpha-Beta Search. Alpha-Beta Search. Alpha-Beta Search: Generally 3. MAX A1. A2. A3. 3. MIN A11. 42. Board Games: Alpha-Beta Search. A12. 2 A13. A21 A22. 2. A23. A31 A32. Player A33. Opponent 3. 12. 8. 2. 4. 6. 14. 5. .. .. ... Can we save search effort? We do not need to consider all the nodes! A1. 3 M. Helmert (University of Basel). A2. A12 A13. 12. A3. Opponent. ≤2. 3. MIN A11. Player. 3. MAX. 8. A21 A22. 2. m. 2. A23. n. 2 A31 A32. 14. Foundations of Artificial Intelligence. 5. If m > n, then node with utility n will never be reached when playing perfectly!. A33. 2 May 17, 2021. 42. Board Games: Alpha-Beta Search. 5 / 16. M. Helmert (University of Basel). Alpha-Beta Search. 42. Board Games: Alpha-Beta Search. Alpha-Beta Search: Idea. Foundations of Artificial Intelligence. May 17, 2021. 6 / 16. Alpha-Beta Search. Alpha-Beta Search: Pseudo Code. idea: Use two values α and β during minimax depth-first search, such that the following holds for every recursive call: I If the utility value in the current subtree is ≤ α, then the subtree is not interesting because MAX will never enter it when playing perfectly. I If the utility value in the current subtree is ≥ β, then the subtree is not interesting because MIN will never enter it when playing perfectly.. I algorithm skeleton the same as minimax I function signature extended by two variables α and β function alpha-beta-main(p) hv , movei := alpha-beta(p, −∞, +∞) return move. If α ≥ β in the subtree, then the subtree is not interesting and does not have to be searched further (α-β pruning). Starting with α = −∞ and β = +∞, alpha-beta search produces the identical result as minimax, with lower seach effort.. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 7 / 16. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 8 / 16.

(3) 42. Board Games: Alpha-Beta Search. Alpha-Beta Search. Alpha-Beta Search: Pseudo-Code. 42. Board Games: Alpha-Beta Search. Alpha-Beta Search. Alpha-Beta Search: Example. function alpha-beta(p, α, β) if p is terminal position: return hu(p), nonei initialize v and best move for each hmove, p 0 i ∈ succ(p): hv 0 , best move0 i := alpha-beta(p 0 , α, β) update v and best move if player(p) = MAX: if v ≥ β: return hv , nonei α := max{α, v } if player(p) = MIN: if v ≤ α: return hv , nonei β := min{β, v } return hv , best movei M. Helmert (University of Basel). Foundations of Artificial Intelligence. 42. Board Games: Alpha-Beta Search. 3, [3, ∞]. MAX [as in minimax] A1. [as in minimax]. 3. A12 A13. 12. 8. A3. 2, [3, ∞]. 3, [−∞, 3]. MIN A11. A2. A21 A22. A23. 2. 2, [3, 5] A31 A32. 14. A33. 5. 2. Cf. screen slides for detailed steps. 9 / 16. M. Helmert (University of Basel). Move Ordering. 42. Board Games: Alpha-Beta Search. May 17, 2021. Foundations of Artificial Intelligence. May 17, 2021. 10 / 16. Move Ordering. Alpha-Beta Search: Example 3, [3, ∞]. MAX A1. 42.2 Move Ordering. 3. A12 A13. 12. 8. A3. 2, [3, ∞]. 3, [−∞, 3]. MIN A11. A2. A21 A22. A23. 2. 2, [3, 5] A31 A32. 14. A33. 5. 2. If the last successor had been first, the rest of the subtree would have been pruned.. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 11 / 16. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 12 / 16.

(4) 42. Board Games: Alpha-Beta Search. Move Ordering. Move Ordering. 42. Board Games: Alpha-Beta Search. Move Ordering. How Much Do We Gain with Alpha-Beta Search? assumption: uniform game tree, depth d, branching factor b ≥ 2; assumption: MAX and MIN positions alternating. idea: first consider the successors that are likely to be best I perfect move ordering. I Domain-specific ordering function. I best move at every position is considered first (this cannot be done in practice – Why?) I maximizing move for MAX, minimizing move for MIN I effort reduced from O(b d ) (minimax) to O(b d/2 ) I doubles the search depth that can be achieved in same time. e.g. chess: captures < threats < forward moves < backward moves I Dynamic move-ordering I first try moves that have been good in the past I e.g., in iterative deepening search: best moves from previous iteration. I random move ordering I effort still reduced to O(b 3d/4 ) (for moderate b). In practice, it is often possible to get close to the optimum.. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 42. Board Games: Alpha-Beta Search. 13 / 16. M. Helmert (University of Basel). Summary. 42. Board Games: Alpha-Beta Search. Foundations of Artificial Intelligence. May 17, 2021. 14 / 16. Summary. Summary. alpha-beta search I stores which utility both players can force somewhere else in the game tree I exploits this information to avoid unnecessary computations I can have significantly lower search effort than minimax. 42.3 Summary. I best case: search twice as deep in the same time. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 15 / 16. M. Helmert (University of Basel). Foundations of Artificial Intelligence. May 17, 2021. 16 / 16.

(5)

Referenzen

ÄHNLICHE DOKUMENTE

Potentially, a change in divorce legislation can impact on the age at marriage or, equivalently, the probability of transition from singlehood to marriage, both by directly changing

Hamza and the other gendarmes present said that whether he had confessed or not… ‘we know this thug’ Souley then asked the boy ‘To, me kake so?’, ‘What do you want?’ but

Seetõttu nõustus Jumala Sõna täiuslikuks inimeseks saama, jäädes samal ajal täieliku jumaliku armastuse kandjaks, mis oligi Tema inimeseks kehastumise ainuke

The ethyl acetate extract of leaves of Moldenhawera nutans Queiroz &amp; Alkin (Legumino- sae) furnished, besides methyl gallate and gallic acid, the flavonols named

The lower dashed horizontal line in the negative parity channel is the sum of the nucleon and kaon mass at rest in the ground state obtained from a separate calculation on the

Theorem (time complextive of iterative deepening DFS) Let b be the branching factor and d be the minimal solution length of the given state space. State-Space Search: Depth-first

Alpha-Beta Search: Idea idea: Use two values α and β during minimax depth-first search, such that the following holds for every recursive call: If the utility value in the

There had in fact been projected in the Sienese pavement a panel designed by Luca Si- gnorelli with Solomon close to the Mountain of Wis- dom, which