incomplete search
DESCRIPTION
General Game PlayingLecture 4. Incomplete Search. Michael Genesereth Spring 2012. Evaluation Functions. Complete search is usually impractical. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/1.jpg)
Incomplete Search
General Game Playing Lecture 4
Michael Genesereth Spring 2012
![Page 2: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/2.jpg)
2
Evaluation Functions
Complete search is usually impractical.
Alternative is to limit search depth in some way and apply a heuristic evaluation function to fringe states (whether terminal or non-terminal).
Chess examples: Piece count Board control
![Page 3: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/3.jpg)
3
Example - Mobility
Mobility is a measure of the number of things a player can do.
Basis - number of actions in a state or number of states reachable from that state.
Horizon - current state or n moves away.
![Page 4: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/4.jpg)
4
Example - Focus
Focus is a measure of the narrowness of the search space. It is the inverse of mobility.
Sometimes it is good to focus to cut down on search space.
Often better to restrict opponents’ moves while keeping one’s own options open.
![Page 5: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/5.jpg)
5
Some General Evaluation Functions
Conservative value = 0 for all nonterminal states
Mobility and Focus Maximize own Minimize opponent’s
Novelty (especially with reversibility) New states better than old states or vice versa Similarity of states (compare state descriptors)
Goal proximity
![Page 6: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/6.jpg)
6
Weighted Linear Evaluation Functions
Definition
f(s) = w1 f1(s) + … + wn fn(s)
Examples: Piece count in chess Board control in chess Combination of piece count and board control
Mobility Goal proximity Novelty
![Page 7: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/7.jpg)
7
Minimax
function maxscore (role, state) {if (terminalp(state)) {return goal(role,state)}; var value = []; for (var action in legals(role,state)) {value[action] = minscore(role, action, state)}; return max(value)}
function minscore (role, action, state) {var value = []; for (move in findmoves(role,action,state)) {value[move] = maxscore(role,next(move,state))}; return min(value)}
![Page 8: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/8.jpg)
8
Minimax’
function maxscore (role, state, level) {if terminalp(state) return payoff(state); if level>levels then return evalfun(state); var value = []; for (action in findactions(role,state)) {value[action] = minscore(role,action,state,level)}; return max(value)}function minscore (role, action, state, level) {var value = []; for (move in findmoves(role,action,state)) {ns = next(move,state); value[move] = maxscore(role,ns,level+1))}; return min(value)}
![Page 9: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/9.jpg)
9
Problems With Depth-Limited Search
Horizon Problem white gains a rook but loses queen or loses game example - sequence of captures in chess
Local Maxima
![Page 10: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/10.jpg)
10
Variable Depth Search
Idea - use expansion function in place of fixed depth
Examples: Quiescence search (attacks horizon problem) Evaluation function values
![Page 11: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/11.jpg)
11
Minimax’’
function maxscore (role, state, level) {if (terminalp(state)) {return goal(role,state)}; if (!expfun(state,level)) then {return evalfun(state)}; var value = new Array(); for (action in legals(role,state)) {value[action] = minscore(role,action,state,level)}; return max(value)}
![Page 12: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/12.jpg)
12
![Page 13: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/13.jpg)
13
Monte Carlo Method / Depth Charge
Basic Idea (1) Explore game graph to some level storing generated states (2) Beyond this, explore to end of game making random choices for moves of all players, not storing states (to limit space growth) (3) Assign expected utilities to states by summing utilities and dividing by number of trials
Features Fast because no search Small space because nothing stored
![Page 14: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/14.jpg)
14
Monte Carlo
![Page 15: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/15.jpg)
15
Monte Carlo
100 0 0 0 0 100 100 0 0 0 0 0 100 0 100 100
![Page 16: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/16.jpg)
16
Monte Carlo
25 50 0 75
100 0 0 0 0 100 100 0 0 0 0 0 100 0 100 100
![Page 17: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/17.jpg)
17
Problems With Monte Carlo Methods
Optimistic opponent *might* not respect probabilities
No higher level reasoning does not utilize game structure in any way
CadiaPlayer’s answer - UCT (see paper)
![Page 18: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/18.jpg)
18
Evaluation Functions in GGP
General Methods that are applicable to all games Just discussed
Statistical Estimate payoffs by random samples Just discussed
Guaranteed Find features that vary directly with final payoff Sometimes doable in time proportional to description More on this in weeks to come
![Page 19: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/19.jpg)
19
![Page 20: Incomplete Search](https://reader035.vdocuments.us/reader035/viewer/2022062321/56813dcb550346895da79498/html5/thumbnails/20.jpg)
20