-1

I'm creating playing chess algorithm and i use transposition table, but searching for position that occured before takes a lot of time on deeper levels.

My comparing is just creating Zobrist's hash of the position and going through my table with previosly added positions.

Is there any way to improve this comparing? Should it look like this (values below) or am I doing something wrong? My search calculates 7 plies.

Here are some numbers: without transposition table: 577576 nodes in 4928ms (117 nodes per ms)

transposition table search on ply 3 and 4: 407658 nodes in 3852ms (105 nodes per ms)

transposition table search on ply 3,4,5: 243348 nodes in 2695ms (90 nodes per ms)

transposition table search on ply 3,4,5,6: 197984 nodes in 2757ms (71 nodes per ms)

Fafkorn
  • 7
  • 2
  • Your transposition table improves the search space a lot (fewer nodes searched) so the problem might be that your implementation of the table is pretty slow. Two ways to improve the speed is to a) store the table contents in continuous memory (in c++ that would be a std::vector or an array ( *not* *a* *linked* *list* ) and b) to improve you zobrist key gen function. You dont need to recalculate the whole key since xor operations are commutative. You can find more information here: https://en.wikipedia.org/wiki/Zobrist_hashing#Updating_the_hash_value – Darius Duesentrieb Apr 24 '18 at 23:41

1 Answers1

0

You must have done something nasty, as your implementation with the table is slower than without! There're many many transpositions in chess, your results doesn't make any sense.

  • Check if you have a bug
  • Check if the time for you to generate a hashing key is significant, it has to be very efficient
  • Check the code for accessing your actual table
ABCD
  • 7,914
  • 9
  • 54
  • 90
  • I've created a random position with 4494720 nodes visited at the bottom level using transposition table and it worked like this: 668 positions repeated at 3 depth, 823 at 4 depth, 22812 at 5 depth and 28917 at 6 depth. How far from many many transposition this score is? – Fafkorn Apr 24 '18 at 19:43