+ All Categories
Home > Documents > Incomplete Search

Incomplete Search

Date post: 07-Jan-2016
Category:
Upload: dorjan
View: 24 times
Download: 2 times
Share this document with a friend
Description:
General Game PlayingLecture 4. Incomplete Search. Michael Genesereth Spring 2012. Evaluation Functions. Complete search is usually impractical. - PowerPoint PPT Presentation
Popular Tags:
20
Incomplete Search General Game Playing Lecture 4 Michael Genesereth Spring 2012
Transcript
Page 1: Incomplete Search

Incomplete Search

General Game Playing Lecture 4

Michael Genesereth Spring 2012

Page 2: Incomplete Search

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

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

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

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

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

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

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

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

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

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

12

Page 13: Incomplete Search

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

14

Monte Carlo

Page 15: Incomplete Search

15

Monte Carlo

100 0 0 0 0 100 100 0 0 0 0 0 100 0 100 100

Page 16: Incomplete Search

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

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

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

19

Page 20: Incomplete Search

20


Recommended