Original Post
Hey, I've started working on my own Xboard compatible Java chess engine. I have used pages such as the Beowulf project's Chess Programming Theory and the GameDev.net article on Chess Programming as references. My doubt arises in the implementation of transposition tables. I have managed to implement the hashing scheme to identify a Game State (board position) and to store it's score and the depth to which it is searched in a hashtable. However, this means that everytime I come across a transposition during a full tree search, I have to still generate all legal moves from that position again if I want to search deeper. In my opinion, the move generation could be avoided if we just stored a list of legal moves from the position in the transposition table as well, but this would increase the size of each item in the hashtable from around 20 bytes to 150-200 bytes. Considering that my application requires millions of entries in the hashtable at any given time, I don't know if this is viable solution. Does anybody have any idea of which method is better? Also, when does one start cleaning the hashtable? There is no point storing the transpositions occured at ply 2 when the game is at around ply 40 because that is never going to occur again. One way I can think of solving this is to add a 'lastUsed' variable for each transposition in the table, and before each search, prune the entire hashtable of old states. However, this would mean iterating through millions of hashtable entries at every search... So is this a viable option? What other solutions can be implemented? Please help...