13
Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Embed Size (px)

Citation preview

Page 1: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Algorithms & Computer ChessA presentation byZachary FiskinChristopher Cruzen

Page 2: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

What is computer chess?

• We define computer chess as the use of hardware and software design to create an autonomous (without human aid) chess player.

Page 3: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

How smart is the computer?• The computer you play is NOT “smart”.• Most chess computers play the game blindly, without specific

strategies or habits present.• A typical human player might learn these over time, but the

machine will not think in the same fashion.• The computer is not limited to seeing only a number of

possible moves at a time, but can see every possible move for a given turn.

Page 4: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Limited Knowledge• If the computer can know all the moves possible, why is it that

I can defeat it on my own machine?

• A computer only has so much memory. It, physically, can not remember every unique board state or combination of moves at one time. The number of board states is simply too astronomical.

Page 5: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Game ComplexityTurn 1• White has a choice of any one

of [20] moves to begin the game. (16 pawn moves + 4 knight moves)

• Black has the same number of options. [20]

• [20] x [20] = [400] possible states

Page 6: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Game Complexity• Turn 2: [8902] possible states*• Turn 4: [197,742] possible states• Turn 7: [10,921,506] possible states

• An average chess game will run from 40 to 60 turns.• Based on this, an Estimated Upper Bound can be calculated to

approximately game states

*(One of these states is already checkmate against white)

Page 7: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

How the computer thinks• A typical chess computer will save a library of game states in a

tree type data structure.• From each state, the tree branches off into every possible

state to come from it.

• This results in a pseudo-complete map of every move in the game.

• Problem: How does the computer decide which of these moves works best in the current game?

Page 8: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Heuristics• Definition: “Short-cuts for complex problem solving which

don’t guarantee an optimal solution, but deliver a satisfactory result in a short time.”

• Two Primary Algorithms• Forward Minmax with Alpha-Beta Pruning• Endgame Theory

Page 9: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Forward Minmax with Alpha-Beta Pruning

• Traverses predefined height• Evaluates each move• Value assigned by set of

factors

• Alpha-Beta Pruning• Ignore low scores• Increase time spent on

‘good’ moves

Page 10: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Endgame Theory

• A reversed approach to the opening is common.

• Instead of finding the best possible next-state for the game, the computer tries to find the current game-state through a series of moves from a desired end-state.

• This is simpler than the opening due to reduced piece count.

Page 11: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Pruning Methods

1. Transposition Tables• Archiving move analysis for similar situations later in the game

2. Refutation Tables• Archiving certain types of universally disadvantageous moves to

save processing time for other possibilities

3. Pondering• “Thinking” during the opponent’s turn

Page 12: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Advancing into other fields

Page 13: Algorithms & Computer Chess A presentation by Zachary Fiskin Christopher Cruzen

Question & Answer