1 / 50

Some slides adapted from Prof. Kauchak and others

Some slides adapted from Prof. Kauchak and others. 1 2 3 4 5 6 7 8 9. A B C D E F G H I. Alpha-Beta pruning: 2-Ply (2 turns). Range of possible values. MAX. MIN. 14. 1. 2. 3. 12. 8. 2. 9. 1. Alpha-Beta pruning. Perform DFS until we reach a leaf:.

Download Presentation

Some slides adapted from Prof. Kauchak and others

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Some slides adapted from Prof. Kauchak and others

  2. 1 2 3 4 5 6 7 8 9 A B C D E F G H I

  3. Alpha-Beta pruning: 2-Ply (2 turns) Range of possible values MAX MIN 14 1 2 3 12 8 2 9 1

  4. Alpha-Beta pruning Perform DFS until we reach a leaf: [-∞, +∞] Range of possible values MAX MIN [-∞, +∞]

  5. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] Range of possible values MAX What do we know about this node? MIN [-∞, +∞] 3

  6. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] Range of possible values MAX β = 3 MIN [-∞, 3] 3

  7. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] Range of possible values MAX β = 3 Now what do we know? MIN [-∞, 3] 3 12

  8. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] Range of possible values MAX β = 3 MIN [-∞, 3] 3 12

  9. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] Range of possible values MAX β = 3 Now what do we know? MIN [-∞, 3] 3 12 8

  10. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN [-∞, +∞] What do we know about this node? Range of possible values MAX β =3 MIN 3 12 8

  11. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Range of possible values MAX β =3 MIN 3 12 8

  12. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Range of possible values MAX β =3 What do we know? MIN [-∞, +∞] 3 12 8 2

  13. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Range of possible values MAX β = 2 β =3 What do we know? MIN [-∞, 2] 3 12 8 2

  14. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Range of possible values MAX β = 2 β =3 [-∞, 2] MIN Prune! 3 12 8 2 X X

  15. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 Does anything about this node change ? [3, +∞] Range of possible values MAX β =2 β =3 MIN Prune! 3 12 8 2 X X

  16. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Range of possible values MAX β =2 [-∞, +∞] β =3 MIN What do we know? 14 3 12 8 2 X X

  17. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, +∞] Anything about this node? Range of possible values MAX β = 14 β =2 [-∞, 14] β =3 MIN 14 3 12 8 2 X X

  18. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, 14] Range of possible values MAX β = 14 β =2 [-∞, 14] β =3 MIN 14 3 12 8 2 X X

  19. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, 14] Range of possible values MAX β = 1 β =2 [-∞, 1] β =3 MIN 14 1 3 12 8 2 X X

  20. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α = 3 [3, 14] Range of possible values MAX What do we know? β = 1 β =2 [-∞, 1] β =3 MIN 14 1 X 3 12 8 2 X X Prune!

  21. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α=3 [3, 3] Range of possible values MAX β =2 β =1 β =3 MIN 14 1 X 3 12 8 2 X X

  22. Alpha-Beta pruning alpha = best guaranteed value so far for MAX beta = best guaranteed value so far for MIN α=3 Range of possible values MAX β =2 β =1 β =3 MIN 14 1 X 3 12 8 2 X X

  23. Alpha-Beta Pruning (4-Ply)

  24. Alpha-Beta Pruning (4-Ply) [3]

  25. [-∞, 3] [3]

  26. [3, ∞] [-∞, 3] [3]

  27. [3, ∞] [-∞, 3] [3] [5, ∞]

  28. [3, ∞] [-∞, 3] [3] [5, ∞]

  29. [3, ∞] [3] [3] [5, ∞]

  30. [3, ∞] [3] [-∞, 0] [3] [0] [5, ∞]

  31. [3, ∞] [3] [-∞, 0] [3] [0] [5, ∞]

  32. [3, ∞] [3] [-∞, 0] [3] [0] [5, ∞] [2, ∞]

  33. [3, ∞] [3] [-∞, 2] [-∞, 0] [3] [0] [5, ∞] [2]

  34. [3, ∞] [3] [-∞, 2] [-∞, 0] [3] [0] [5, ∞] [2]

  35. [3] [3] [-∞, 2] [-∞, 0] [3] [0] [5, ∞] [2]

  36. MAX MIN T^3, 2-ply look-ahead w/ difference in available wins evaluation function All possible moves not shown

  37. Ideas?

  38. Horizon Effect • Quiescence Search • when evaluation function is frequently changing, search further down than the depth limit • Search for a point when game “quiets down”

  39. Chess evaluation functions Ideas?

  40. Chess EVAL • Assume each piece has the following values • pawn = 1; • knight = 3; • bishop = 3; • rook = 5; • queen = 9; • EVAL(state) = • sum of the value of white pieces – • sum of the value of black pieces = 31 - 36 = -5

  41. Chess EVAL • Assume each piece has the following values • pawn = 1; • knight = 3; • bishop = 3; • rook = 5; • queen = 9; • EVAL(state) = • sum of the value of white pieces – • sum of the value of black pieces Any problems with this?

  42. Chess EVAL Most valuable Less valuable Least valuable Ignores actual positions!

  43. Chess EVAL Ignores actual positions! Actual heuristic functions are oftena weighted combination of features

  44. Chess EVAL 1 if king has knighted, 0 otherwise number of attacked knights number of pawns A feature can be any numerical information about the board • as general as the number of pawns • to specific board configurations Deep Blue: 8000 features!

  45. Chess EVAL 1 if king has knighted, 0 otherwise number of attacked knights number of pawns How can we determine the weights (especially if we have 8000 of them!)?

  46. Chess EVAL 1 if king has knighted, 0 otherwise number of attacked knights number of pawns • Machine learning! • play/examine lots of games • adjust the weights so that the EVAL(s) correlates with the actual utility of the states

More Related