Download presentation
Presentation is loading. Please wait.
Published byTobias Stevens Modified over 6 years ago
1
Optimizing Minmax Alpha-Beta Pruning Real Time Decisions
Why do we need it? What is it? How can we apply it? Real Time Decisions
2
Why do we need it The more moves we have the bigger the tree is.
3
What is alpha-beta pruning?
Algorithm that allows for pruning of nodes in a tree but doesn’t affect final outcome. Alpha – best, highest value choice found along the path for MAX Beta – best, lowest value choice in the MIN path.
4
Pruning example
5
Pruning example
6
Pruning example
7
Pruning example
8
Pruning example
9
Benefits Alpha Beta pruning is twice as fast as minmax
Looks deeper in the tree than minmax. Takes O(b^m/2) to look for a best answer rather than O(b^m)
10
Real Time Decisions Making choices in a given time interval.
How to find the best terminal state under such circumstances. Save time when making a move.
11
Real Time Decisions Cuttoff Test Evaluation Function
Determines when a Evaluation Function is to be applied. Evaluation Function Determines how well the move is given the current of the env. Replaces Utility.
12
Evaluation Function Expected Value.
If we know current state gives us 20% win, 8% loss and 0 draw (.72x1)+(.20x-1)+(.08x0) = .52 or 52% this state will result in a win.
13
Material Function Give a score to a given move.
Chess: certain moves in chess reward the player with X number of points. Bishop = 3 points Rook = 5 Weighted Liner Function Must be independent. A bishop is worth less in the beginning but more towards the end of the game.
14
Weighted Liner Function
Eval(s) = w1f1(s) + w2f2(s)+…+wnfn(s) W = weight F = feature of position Example: Chess board for black as 2 pawns, and 1 rook 2(1)+2(5) = 12
15
Cuttoff – Issues Move may look like a wining move. Horizon Effect
Black has more pieces on the board in this move Following move white takes blacks queen. Real winner was White. Horizon Effect moves which appear to be good may ultimately lead to the same losing conclusion. Losing condition is beyond the depth we are allowed to search in.
16
Cuttoff – When to use Can only apply to quiescent position.
Quiescent: positions which wont have wild swings in value. Example: Capturing high value chess pieces will result in different game play. This not quiescent.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.