[dba-Tech] Questions about 2 Unusual Databases

Shamil Salakhetdinov shamil at users.mns.ru
Thu Oct 28 17:39:11 CDT 2004


> Something you didn't address that I would really like your opinion on is
> the "teleology" approach. Assume the Book of Endings is coded, and that
> player Shamil at move 22 is presented with situation X, which is only
> two or three moves away from a known victory derived from the Book of
> Endings. The unintelligent distance between the current position and the
> known position is huge, but the more intelligent analysis would somehow
> subtract all the similarities, note the differences and see if there's a
> way to get that knight over here and that rook over there, at which
> point the positions are identical and the victory guaranteed.
Arthur, I've never tried to write chess programs.
IMO what are you looking for isn't an easy task.
I don't know optiomal solution.
I'd use a "brute force" method here.
I'd have coded, say 10,000 best games'(or just games' endings) moves and
stored them in a database the way I proposed.
Let's say an average game has 50 moves. These are 100 partial-moves. Or
semi-moves? (sorry I don't know how these are called in English - the move
of every color within a move.)
These will result in about 100*10,000*32 =  ~32MB (if we add the 4 bytes
identity key and 2 bytes long
move number and 4 byte used for fixed binary fields) then it will become
~42MB.
Then I'd have calculate a 4 bytes long hash key for a position after every
partial-move of each of these games.
The total size of the row for a partial move will become 48bytes.
I'd have indexed this hash code.
For modern computers all that info about 10,000 games can be easily stored
in RAM.
Even 200,000 games' coded info with hash codes will occupy "only" ~1GB RAM.
Having such memory is not a problem today too.
And access by hash code in RAM can be very well optimized.
The program would calcualte a hash code for every position within the
current position decision tree and use this code to look in the database of
"the best games".(Or better in the cached array of the hash codes.) If it
finds a matching hash code(let's assume for simplicity that there are no
hash codes collisions) it will use the decision path leading to this hash
code's position...

That's all for now I can say,
Shamil

----- Original Message ----- 
From: "Arthur Fuller" <artful at rogers.com>
To: "Discussion of Hardware and Software issues"
<dba-tech at databaseadvisors.com>
Sent: Thursday, October 28, 2004 5:09 AM
Subject: Re: [dba-Tech] Questions about 2 Unusual Databases


> Shamil Salakhetdinov wrote:
>
> >Arthur,
> >
> >I will dare to advise on the chess database design.
> >Using KISS principle & if we assume you don't care to waste some space &
> >that I didn't miss something here is a possible solution :
> >
> >- position after every move can be represented using 32 bytes(4bits *
64);
> >- you put position information(code) into binary field and create an
index
> >on it so you'll have something like:
> >
<<<tail skipped>>>




More information about the dba-Tech mailing list