411 Null Move Heuristic Seminar(2)

19
Computer Chess Null Move pruning Lucas Bradstreet [email protected] AAI411 Seminar Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

description

411 Null Move Heuristic Seminar(2)

Transcript of 411 Null Move Heuristic Seminar(2)

Page 1: 411 Null Move Heuristic Seminar(2)

Computer Chess

Null Move pruning

Lucas [email protected]

AAI411 Seminar

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 2: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Introduction

Computer chess popular AI field — well known by public.

Brute force Deep Blue beat Kasparov in 1997.

Current computer chess players use pruning methods tocut down search tree.

Pruning done at the cost of search stability...

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 3: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Minimax search

Recall that Minimax search is at cost bm.

With α/β pruning cost can be reduced to bm2 .

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 4: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Minimax algorithm with α/β

maxValue (Node n, α, β, depth)if TerminalCondition(n) then

return utility(n)end iffor all valid moves for node n do

Clone node n and update with actionα = Min (minValue(n, α, β), α, depth-1)

if β <= α thenreturn β

end ifend forreturn α

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 5: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Limitations

Assuming perfect move ordering, cost is now bm2 .

Reduction in Minimax cost is not enough.

Deep Blue custom evaluated 200 million nodes persecond.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 6: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Null Move Pruning

Introduction to unsafe-pruning.

Pruning allows deeper searches to be made.

Worthwhile if tactical mistakes can be limited.

Null move pruning popularised by Donninger [1] in 1993.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 7: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Null Move Pruning - extended

Uses Null move as an indication of strength of position.

Idea is that no move is the worst move.

Humans do this without thinking about it.

Passes play back to opponent with reduced depth.

Uses this result to prune.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 8: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Minimax with Null move extension

maxValue (Node n, α, β, depth)if TerminalCondition(n) then

return utility(n)end ifif AllowNullMove(n) then

Make null move// R is reduction factor, reduces depth of searchnullVal = minValue (nullnode, β − 1, β, depth - R - 1);if nullVal ≥ β then

return βend if

end if. . .

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 9: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Conditions on the Null-Move

Conditions exist where null move is a good move!

Includes zugzwang positions, frequent in end games.

Don’t use null move in end-game.

Cannot be done while King is in check (illegal).

Don’t use Null-move if parent is a null move.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 10: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

A zugzwang position

Figure: A zugzwang position — making a null move would be errorprone, may lead to loss of a draw. Image fromhttp://www.seanet.com/ brucemo/topics/nullmove.htm

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 11: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Other problems

With care zugzwang positions can be avoided...

Main other issue is the horizon effect.

Horizon effect caused by depth reduction in Null Movesearch.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 12: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Adaptive Null-Move Pruning

Recent work to do with horizon effect.

Bigger depth reduction faster but may cause tactical errors.

Best constant depth reduction R = 2 [2].

Adaptive Null-Move pruning by Heinz [2] applies adaptivedepth reduction.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 13: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Adaptive Null-Move Depth Reduction

Radaptive =

{2 if (depth ≤ 6) or ((depth ≤ 8) & (maxpieces < 3))

3 if (depth > 8) or ((depth > 6) & (maxpieces ≥ 3))(1)

Maximises use of depth reduction 3 where safe.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 14: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Results for Adaptive Null-Move

On standard Test Suite chess board configurations, Adaptive Rcompared to R = 2:

10%− 30% reduction in number of nodes evaluated.

Number of games solved is the almost the same as R = 2.

Adaptive R compared to R = 3

17%− 19% increase in number of nodes evaluated.

Increases number of solutions found by 2%.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 15: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Verified Null Move Pruning

Introduced by Tabibi et al. [3] in 2002.

Attempts to limit missed solutions when cutoffs occurimmediately.

Searches null move with R = 3.

If cutoff occurs note it and continue search.

If child node also has null-move cutoff, return utility.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 16: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Figure: Illustration of verified null-move pruning [3]

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 17: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Verified Null-Move Pruning Results

Figure: Tree sizes for R = 2, R = 3 and verified R = 3 [3]

Verified null move pruning also finds more solutions for testedconfigurations than R = 2 and R = 3.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 18: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

Conclusion

Null move pruning useful technique for cutting downsearch tree.

Very effective — used by almost all top computer chessplayers.

Verified null move pruning gives biggest reduction andmisses less solutions.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!

Page 19: 411 Null Move Heuristic Seminar(2)

Computer ChessIntroduction to Computer ChessMinimax and α/β

Null move pruning

References

C Donninger.Null move and deep search: Selective search heuristics forobtuse chess programs.ICCA Journal, 16(3):137–143, 1993.

Ernst A. Heinz.Adaptive null-move pruning.ICCA Journal, 22(3):123–132, 1999.

Omid David Tabibi and Nathan S. Netanyahu.Verified null-move pruning.Technical Report CAR-TR-980, CS-TR-4406,UMIACS-TR-2002-39, Center for Automation Research,University of Maryland, 2002.Published in ICGA Journal, Vol. 25, No. 3, pp. 153–161.

Lucas Bradstreet [email protected] Null Move Pruning - Extra ply for little cost!