Exploring Chess Programming: Algorithms and Mathematics

In summary, chess programs assign a value to a position on the board and include databases for common patterns, openings, and end games. The improvement in algorithms is due to the increase in CPU speeds, allowing for deeper searches and larger databases. The use of multi-processing and faster CPUs has led to computer programs consistently defeating human opponents. However, doubling the speed of a computer does not necessarily result in a significant increase in ply, as the improvement becomes less significant with deeper searches. The typical branching factor in a chess engine depends on its pruning mechanism and position analysis function. The best chess program may look ahead up to 40 ply, but this is unlikely with current hardware limitations.
  • #1
kant
388
0
I know very little about chess programming, but i would like know more about it. I want to know every thing i could about it. how do chess programs flind, and plan a move algorithmically? What nice mathematics are there for the game of chess?
 
Technology news on Phys.org
  • #2
The chess programs assign a value to a position on the board, and include databases for certain patterns, openings, and end games scenarios. Although not a real chess fan, I bought Deep Junior 8 to help out with some co-workers that were interested in chess programs. This is one of the chess programs that have won against world class grand master players.

The algorithms have gotten reasonably good, but the real improvement is due to the shear brute force of the cpu speeds in moderately high end PC's (3+ghz hyperthreading cpus), with 1 or 2 gb of ram, that allow these games to look ahead 13 to 17 moves, and space enough to hold huge opening and endgame databases. The computers are winning most of the human versus computer matches these days when they host events.

With cpu speeds capping out at 4ghz due to heat dissipation issues, multi-processing, like dual core cpus with hyperthreading, will be the way the games push look ahead capabilities further still. Eventually humans won't stand a chance against these programs.
 
  • #3
There is a good forum for chess programming on: http://216.25.93.108/forum/"

Check the "Computer Chess Club: Programming and Technical Discussions" section.
 
Last edited by a moderator:
  • #4
Jeff Reid said:
The algorithms have gotten reasonably good, but the real improvement is due to the shear brute force of the cpu speeds in moderately high end PC's (3+ghz hyperthreading cpus), with 1 or 2 gb of ram, that allow these games to look ahead 13 to 17 moves, and space enough to hold huge opening and endgame databases.
Sure, but without alpha beta trimming you would only be able to look ahead five or six ply, not 13.
 
  • #5
Currently an improvement of CPU speed primarily gives a faster result but not a necessarily better result. For instance even a doubling of CPU power is not going to make a dramatic effect on the quality of the selected move, it is just going to be delivered twice as fast. The time saved is hardly enough to do another ply since we are already so deep.

But needless to say faster is always better in chess computing. :wink:

Currently the dual core Athlons blow away any Intel when it comes to chess computer speed. Overclock some 4800+ dual core Athlons and rock!

Deep Blue in 1997 benchmarked about 200 million positions per second while now on the PC we can already reach over 3.5 million positions per second.
 
  • #6
Currently an improvement of CPU speed primarily gives a faster result but not a necessarily better result. For instance even a doubling of CPU power is not going to make a dramatic effect on the quality of the selected move, it is just going to be delivered twice as fast. The time saved is hardly enough to do another ply since we are already so deep.
I was referring to the fact that early PC chess programs were running on 6mhz 286 cpu's, and now run on 3+ghz pentiums, that's a 500 fold increase in speed. Earlier still, there were chess programs that ran on 1mhz 6502 (Apple II) and 2mhz 6502 (Atari 400/800/65/130) cpu's.
 
  • #7
MeJennifer said:
Currently an improvement of CPU speed primarily gives a faster result but not a necessarily better result. For instance even a doubling of CPU power is not going to make a dramatic effect on the quality of the selected move, it is just going to be delivered twice as fast. The time saved is hardly enough to do another ply since we are already so deep.
Doubling the speed of the computer should give a constant increase in ply, whether you're already at 3 ply or at 12. I think it would be less than 1 ply though.
 
  • #8
0rthodontist said:
Doubling the speed of the computer should give a constant increase in ply, whether you're already at 3 ply or at 12. I think it would be less than 1 ply though.
Incorrect, the increase in ply is not constant, the deeper the CPU calculates the less the improvement when the speed doubles.
 
  • #9
No, the deeper the CPU calculates, the less improvement when the speed increases by a constant amount. When the speed doubles, the ply increases by a constant amount because the n'th layer of the game tree is exponential in n. If for example the branching factor in the game tree is 2, the ply will increase by roughly 1 for every doubling in speed, regardless of current ply, because the number of leaves is roughly equal to the number of internal nodes. If the branching factor is 4, the ply will increase by roughly 1/3 for every doubling in speed, because the number of leaves in this case is roughly equal to three times the number of internal nodes.

I don't know what the typical branching factor is in a chess engine--probably it is larger than that so a doubling in speed will yield a smaller fraction of a ply.
 
  • #10
All engines use pruning since a raw calculation (e.g. the brute force approach) is a waste of resources for obviously bad moves. The branching factor depends on the pruning mechanism for the particular chess engine. Obviously you can have an engine that calculates more ply but prunes too much. Furthermore if your position analysis function is too advanced you slow down your processing.
 
Last edited:
  • #11
I think that I read the best chess program looks ahead 40 ply. I can kick any computers @$$ at chess...all I have to do is unplug it.. ;)
 
  • #12
buddyholly9999 said:
I think that I read the best chess program looks ahead 40 ply. I can kick any computers @$$ at chess...all I have to do is unplug it.. ;)
I doubt that 40 is at all possible with current hardware.
Of course it depends on the amount of pruning. Typically chess engines search deeper on certain branches they consider "interesting", things like king attack or possible pawn promotion etc, so some branches might get to 40 but not on the whole.
 

1. What is chess programming?

Chess programming is the process of creating computer programs that are capable of playing the game of chess. This involves developing algorithms and strategies that can analyze game positions and make decisions on the best move to make.

2. What are some common algorithms used in chess programming?

Some common algorithms used in chess programming include minimax, alpha-beta pruning, and Monte Carlo tree search. These algorithms help the computer evaluate different moves and determine the best course of action.

3. How important is mathematics in chess programming?

Mathematics plays a crucial role in chess programming as it helps in creating efficient algorithms, evaluating different game positions, and predicting future moves. Concepts such as combinatorics, probability, and graph theory are commonly used in chess programming.

4. Can chess programs beat human players?

Yes, chess programs have been able to beat human players since the 1990s. With advancements in technology and algorithms, modern chess programs are now able to defeat even the strongest human players.

5. Are there any ethical concerns with chess programming?

There have been ethical concerns surrounding the use of chess programs in tournaments and matches. Some argue that it takes away the human element of the game and diminishes the value of human achievement. However, others argue that chess programs can help improve the game and aid in chess education.

Similar threads

  • Computing and Technology
Replies
2
Views
271
Replies
29
Views
3K
  • Programming and Computer Science
Replies
7
Views
2K
  • General Discussion
2
Replies
42
Views
3K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
1
Views
727
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
6
Views
3K
  • General Math
6
Replies
195
Views
19K
Back
Top