Anthony Cozzie. Quite possibly the nerdiest activity in the world But actually more fun than human chess Zappa o alpha-beta searcher, with a lot of tricks.

Slides:



Advertisements
Similar presentations
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Advertisements

Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Computers playing games. One-player games Puzzle: Place 8 queens on a chess board so that no two queens attack each other (i.e. on the same row, same.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
For Friday Finish chapter 5 Program 1, Milestone 1 due.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
CS 484 – Artificial Intelligence
L.O. Today you will learn how to play chess. How to Play Chess.
Applied Neuro-Dynamic Programming in the Game of Chess James Gideon.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Adversarial Search Board games. Games 2 player zero-sum games Utility values at end of game – equal and opposite Games that are easy to represent Chess.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Problem Solving Using Search Reduce a problem to one of searching a graph. View problem solving as a process of moving through a sequence of problem states.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
Max Min Max Min Starting node and labels Figure 4.20 (pp. 153) Alpha-Beta Prune.
Adversarial Search: Game Playing Reading: Chess paper.
CSE (c) S. Tanimoto, 2008 Alpha-Beta Search 1 Alpha-Beta Search Outline: Two-person, zero-sum, perfect info games. Static evaluation functions.
Games & Adversarial Search Chapter 6 Section 1 – 4.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
CSC 412: AI Adversarial Search
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Chess Applications:Alpha- Beta Search Greg Parker ‘03 Senior Thesis Advisor: Andrew Appel.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Adversarial Search CS30 David Kauchak Spring 2015 Some material borrowed from : Sara Owsley Sood and others.
Game Playing.
Prepared by : Walaa Maqdasawi Razan Jararah Supervised by: Dr. Aladdin Masri.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Algorithms & Data Structures for Games
Instructor: Vincent Conitzer
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Chess and AI Group Members Abhishek Sugandhi Sanjeet Khaitan Gautam Solanki
For Friday Finish chapter 6 Program 1, Milestone 1 due.
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
Parallel Programming in Chess Simulations Tyler Patton.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
Adversarial Search 2 (Game Playing)
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Parallel Programming in Chess Simulations Part 2 Tyler Patton.
Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory.
1 Chapter 6 Game Playing. 2 Chapter 6 Contents l Game Trees l Assumptions l Static evaluation functions l Searching game trees l Minimax l Bounded lookahead.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Game playing Types of games Deterministic vs. chance
Adversarial Search and Game-Playing
EA C461 – Artificial Intelligence Adversarial Search
Instructor: Vincent Conitzer
BACE Bowron – Abernethy Chess Engine Christopher Bowron Rob Abernethy.
#1 Chess Engine of Spring 2017 at S&T
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Pengantar Kecerdasan Buatan
Dakota Ewigman Jacob Zimmermann
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Instructor: Vincent Conitzer
Instructor: Vincent Conitzer
CSE (c) S. Tanimoto, 2007 Search 2: AlphaBeta Pruning
Games & Adversarial Search
CS51A David Kauchak Spring 2019
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Anthony Cozzie

Quite possibly the nerdiest activity in the world But actually more fun than human chess Zappa o alpha-beta searcher, with a lot of tricks o World Computer Chess Champion 2005 o Much, much better than Deep Blue

Key move Nxh6 Novag Diablo: 7.5 months o 1991, 16MHz 16-bits Deep Blue: 6 hours Zappa: 2 minutes

Key move Nxe6 TASC R30: 1 month o 1993, 30MHz ARM o Chessmaster engine Deep Blue: 2.5 hours Zappa: 1 minute

Key move axb5 TASC R30: centuries Deep Blue: gave up o (more system time than they cared to use, they estimated at a few days) Zappa: 10 minutes

Will feel like a collection of tricks Search (tweaks to alpha-beta) o Move ordering o Extensions o Forward Pruning o  Branching factor 2-3 instead of sqrt(35) Evaluation o Automatic tuning

When do we stop searching? Depth 1: capture the biggest piece we can, regardless of whether opponent can recapture Qsearch: try captures, checks, check evasions o No depth parameter o Can stand pat (terminate if eval>beta) o Prune stupid captures

Big hash table storing the results of the search Prevents engine from researching the same position (still exponential time, though) o 1. e4 d6 2. d4 o 1. d4 d6 2. e4 64-bit key Zobrist hash key o (hashA1[pieceA1] ^ hashA2[pieceA2] ^ … )

The fine print of alpha-beta: “Thou must search thy best move first” Iterative deepening Store best move transposition (hash) table History heuristic: o Table[piece-type][start-square][dest-square] o Increment when move fails high Result: 93% of fail highs occur on the first move

What happens if we search at the root with a smaller window? Alphabeta(a, a+1)  is score > a? o All over the place in chess engines Aspirated alpha beta (change root score) MTD(f): continue to try zero-window searches until a goal is reached o (not in Zappa)

int NegaScout ( position p; int alpha, beta ) { /* compute minimax value of position p */ int a, b, t, i; if ( d == maxdepth ) return Evaluate(p); /* leaf node */ determine successors p_1,...,p_w of p; a = alpha; b = beta; for ( i = 1; i a) && (t 1) && (d = beta ) return a; /* cut-off */ b = a + 1; /* set new null window */ } return a; } int NegaScout ( position p; int alpha, beta ) { /* compute minimax value of position p */ int a, b, t, i; if ( d == maxdepth ) return Evaluate(p); /* leaf node */ determine successors p_1,...,p_w of p; a = alpha; b = beta; for ( i = 1; i <= w; i++ ) { t = -NegaScout ( p_i, -b, -a ); if ( (t > a) && (t 1) && (d < maxdepth-1) ) a = -NegaScout ( p_i, -beta, -t ); /* re-search */ a = max( a, t ); if ( a >= beta ) return a; /* cut-off */ b = a + 1; /* set new null window */ } return a; } int NegaScout ( position p; int alpha, beta ) { /* compute minimax value of position p */ int a, b, t, i; if ( d == maxdepth ) return Evaluate(p); /* leaf node */ determine successors p_1,...,p_w of p; a = alpha; b = beta; for ( i = 1; i a) && (t 1) && (d = beta ) return a; /* cut-off */ b = a + 1; /* set new null window */ } return a; }

Having the move is usually good in chess If we can skip our turn and still win, we will win bigger without skipping Depth reduction R, usually 2/3 or 3 o Cut a depth 10 search if we could skip our turn and still win with a depth 6 search Worth a few plies of search depth

Short-Timman Search looks like: Kh2 NULL Kg3 NULL Kf4 NULL Kg5 NULL Kh6 NULL Qg7 (10 + 5R = 25 ply)

Suppose Zappa searches o A B C D E F G with score 0.1 o A B C D E F G H with score -1 Can play different moves instead of A C E G o  Deeper search implies more places to change! o Alpha-beta is completely blind to whether alternatives are OK or terrible

One move is much better than the alternatives o Classic example; QxQ PxQ Check with additional searches of (d-m, m usually 4-5 ply) o Costs nodes because normally at cut nodes we only search one move Originally done by Deep Blue team

Count pieces o Standard chess weights are 1/3/3/5/9 o Zappa uses 1/4/4/6/12 Chess is easier than Go o Smaller branching factor (35 moves vs 200) o Material is the #1 term in the evaluation

Count squares a piece can attack Queen > Bishop because queen attacks more squares Potentially move wins Random eval works!

Pretty chess specific Two connected passed pawns on the 6th rank are worth about a rook to Zappa A king with no pawn protection is about 1- 2 pawns o Rises to 5+ when attacked by a bunch of pieces About 1000 heuristics, 5,000 terms.

Very annoying to tune by hand o Fix one position, break another Have some test, use genetic programming or simulated annealing Problem is it takes ~50,000 games to determine a few elo improvement Open problem Also: automatically generating new terms

Just ideas discussed here gives you a super-GM strength program But be careful, because computer chess is surprisingly addictive