Author: Dann Corbit
Date: 13:01:19 07/17/02
Go up one level in this thread
On July 17, 2002 at 15:57:55, Russell Reagan wrote: >Granted that I've never attempted an opening book, but it seems like using a >hashing technique might be a little much. It's a very natural keyed lookup. A hashed index in a database should be able to extract a record in O(1). Typically, it only reads one block from disk. It really starts to shine when the file is big. When small, probably b+ tree is faster. >I think there is an acceptable method >that would work without hashing, and it shouldn't take tons of time. Maybe have >an offset into the file where moves at ply 1 start, where moves at ply 2 start, >and so on, then sort those sections according to the source square, then by the >destination square. Or something similar. This seems like it would be simpler, >less buggy, and you'd never have to worry about a hash collision resulting in an >inferior move. The goal of the opening book is to avoid playing those moves that >are ever so slightly inferior. Against most human opponents chess engines play >the opening better than their human opponent (usually), but there is only a >small difference in the quality of opening moves when you play a commercial >engine or a GM, so I think you shouldn't run the risk of a hash collision in >this case. In addition to that, it seems like it would be more work to use a >hashing scheme for your opening book. What do you think? I think a regular SQL database is the best way to do it. Second best is an ISAM approach like GDBM, SDBM, DBM. Third best is a proprietary binary format. Worst is a big text file that gets parsed as the game goes along.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.