threat analysis to reduce the effects of the horizon problem in shogi

21
PYIWIT'02 1 to Reduce the Effects of the Horizon Problem in Shogi Reijer Grimbergen Department of Information Science Saga University

Upload: erasto

Post on 06-Jan-2016

34 views

Category:

Documents


0 download

DESCRIPTION

Threat Analysis to Reduce the Effects of the Horizon Problem in Shogi. Reijer Grimbergen Department of Information Science Saga University. Presentation Outline. Game programming Time limits and the horizon effect Pruning and extension techniques Threat analysis in two-player games - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 1

Threat Analysis to Reduce the Effects of

the Horizon Problem in Shogi

Reijer Grimbergen

Department of Information Science

Saga University

Page 2: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 2

Presentation Outline

Game programming

Time limits and the horizon effect

Pruning and extension techniques

Threat analysis in two-player games

Application to shogi

Implementation issues

Preliminary results

Conclusions and future work

Page 3: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 3

Game ProgrammingDefinitions

Two-player perfect information gamesOnly two players involved

Game state is fully accessible to both players

Goal: win the game against all the possible replies of the opponent

Page 4: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 4

Game ProgrammingSearch vs. knowledge

Two basic approaches for game programmingSearch

Knowledge

Problem of search: impossible to search to the end of the game

Search space of chess is

Problem of knowledge: expert knowledge is hard to capture

12380 1035

Page 5: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 5

Time Limits and the Horizon EffectSearch in games

Search in games:Most successful methodDecisions have to be made under strict time constraints

Basic search method is iterative deepeningSearch with increasing nominal search depthUse an evaluation function to estimate the probability of winning

Horizon effect: no way of knowing what will happen beyond the nominal search depth

Page 6: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 6

Pruning and Extension TechniquesExample

Starting position

Nominal

search depth

Pruning

Extensions

Page 7: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 7

Pruning and Extension TechniquesResearch objective

Merits of pruning and extensionsPruning saves timeExtensions improve reliability

Risks of pruning and extensionsImportant moves are discardedMeaningless extensions can be costly

For each game, careful tuning is vital

Page 8: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 8

Doesn’t carry over to other games

Pruning and Extension TechniquesPractical use

Pruning and extensions in chessFutility pruning: search is terminated when it is unlikely to recover from a material lossQuiescence search: play out captures beyond the nominal search depth

Research Objective

Construct a general framework for

pruning and extension decisions

Page 9: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 9

Threat AnalysisGeneral idea

IdeaPruning and extension decisions

should be based on threats

The problems that the search is facing

Page 10: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 10

Threat AnalysisDefinitions

Assume two players B and W (B to move first)

A set of threats

A partial order on the set of threatsIf (Ti) > (Tj) then Ti has a higher priority than Tj

Two sets of unresolved threats

nTTT ,,, 21

w1

v1

yry2y11r1211

xqx2x11q1211

μ,,μ,μ,,μ,,μ,μ

andδ,,δ,δ,,δ,,δ,δ

where,

W

B

WB

Page 11: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 11

Threat AnalysisDefinitions

: the set of threats against B at search depth i

: the set of threats against W at search depth i

Maximum operator Γ

: initial threat sets against B and W

iB

iW

11 and WB

UiiB BU

Page 12: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 12

Threat AnalysisGeneral goals

Safety

All threats against player B are resolved

Control

There is a stronger threat against W than any of the threats against B

Problem: how to judge that a threat is resolved?Search is still needed to resolve threats

0B

UTBW UT

Page 13: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 13

Pruning rule 1

Prune all moves at search depth N-1 (N is the nominal search depth) that do not resolve any threats

Pruning rule 2

Prune all moves at depth i that introduce threats against W with a lower priority than the highest priority threat against B

Threat AnalysisPruning rules

UTNBNBNN UTBB 11

iiW BT T

Page 14: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 14

Extension rule 1

Extend the search if the highest priority threat of the initial set is still unresolved

Extension rule 2

Extend the search if the highest priority threat extends a certain threshold

Threat AnalysisExtension rules

NBB 1

βNB

Page 15: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 15

Empty the threat stack

IF

THEN execute

ELSE defend against

Threat AnalysisExtensions

NN WB

NB

NW

Page 16: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 16

Threat Analysis in ShogiFeatures of shogi

The assumptions behind futility pruning and

quiescence search do not apply in shogi

Pieces captured from the opponent can be re-used

Evaluation is a combination of

material, attack and defense

Page 17: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 17

Threat Analysis in ShogiThreat set

Tmin : no threatM1,…M7: material threats

Capture of a pawn, lance, knight, silver, gold, bishop or rook

K1,…,K4: threats against the king. Based on the attack and defense of the eight squares around the king

Tmax: maximum threat, i.e. threat to capture the king

max4171min ,,,,,,, TKKMMT

Page 18: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 18

Threat Analysis in ShogiPartial order of threats

Tmax

Tmin

M6 M7

M4 M5

M2 M3

M1

K4

K3

K2

K1

Page 19: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 19

Threat Analysis in ShogiImplementation issues

Partial implementation in the shogi program SPEAR

Both of the pruning rules

Neither of the extension rules

A static search extension to empty and NB

NW

Page 20: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 20

ResultsTactical problem test

300 tactical problems from Shukan ShogiCompare the performance of a program without threat analysis (NTA) to a program with threat analysis (TA)60 seconds per problem on an Athlon 1.2GHz standard PC

Version Solved % Total Time

NTA 100 34% 2:52:00

TA 107 36% 2:54:16

Page 21: Threat Analysis  to Reduce the Effects of  the Horizon Problem in Shogi

PYIWIT'02 21

Conclusions and Future Work

Preliminary results indicate that threat analysis might improve the tactical ability of a shogi program

A full implementation of the method is needed to further investigate the merits of the method

Self-play experiments are needed to establish whether the improved tactical ability is actually leading to an improvement in playing strength