Difference between revisions of "Hash Table"

From Chessprogramming wiki
Jump to: navigation, search
Line 90: Line 90:
 
* [[Maurizio Monge]] ('''2011'''). ''[http://scholar.google.com/citations?view_op=view_citation&hl=en&user=gpgb4LgAAAAJ&citation_for_view=gpgb4LgAAAAJ:UeHWp8X0CEIC On perfect hashing of numbers with sparse digit representation via multiplication by a constant]''. [http://www.sciencedirect.com/science/article/pii/S0166218X11000837 Discrete Applied Mathematics, Vol. 159, No. 11] » [[Magic Bitboards]]
 
* [[Maurizio Monge]] ('''2011'''). ''[http://scholar.google.com/citations?view_op=view_citation&hl=en&user=gpgb4LgAAAAJ&citation_for_view=gpgb4LgAAAAJ:UeHWp8X0CEIC On perfect hashing of numbers with sparse digit representation via multiplication by a constant]''. [http://www.sciencedirect.com/science/article/pii/S0166218X11000837 Discrete Applied Mathematics, Vol. 159, No. 11] » [[Magic Bitboards]]
 
* [[John Tromp]] ('''2014'''). ''[https://github.com/tromp/cuckoo/blob/master/cuckoo.pdf Cuckoo Cycle: a memory-hard proof-of-work system]''. [http://www.informatik.uni-trier.de/~ley/db/journals/iacr/iacr2014.html#Tromp14 IACR Cryptology ePrint Archive] <ref>[https://bitcointalk.org/index.php?topic=405483.0 Cuckoo Cycle: a new memory-hard proof-of-work system] by [[John Tromp]], [https://bitcointalk.org/index.php Bitcoin Forum], January 08, 2014</ref> <ref>[https://en.wikipedia.org/wiki/Cuckoo_hashing Cuckoo hashing from Wikipedia]</ref>
 
* [[John Tromp]] ('''2014'''). ''[https://github.com/tromp/cuckoo/blob/master/cuckoo.pdf Cuckoo Cycle: a memory-hard proof-of-work system]''. [http://www.informatik.uni-trier.de/~ley/db/journals/iacr/iacr2014.html#Tromp14 IACR Cryptology ePrint Archive] <ref>[https://bitcointalk.org/index.php?topic=405483.0 Cuckoo Cycle: a new memory-hard proof-of-work system] by [[John Tromp]], [https://bitcointalk.org/index.php Bitcoin Forum], January 08, 2014</ref> <ref>[https://en.wikipedia.org/wiki/Cuckoo_hashing Cuckoo hashing from Wikipedia]</ref>
 +
* [[David Eppstein]], [[Mathematician#MTGoodrich|Michael T. Goodrich]], [[Mathematician#MMitzenmacher|Michael Mitzenmacher]], [https://dblp.uni-trier.de/pers/hd/p/Pszona:Pawel Paweł Pszona] ('''2014'''). ''Wear Minimization for Cuckoo Hashing: How Not to Throw a Lot of Eggs into One Basket''. [https://arxiv.org/abs/1404.0286 arXiv:1404.0286]
  
 
=Forum Posts=
 
=Forum Posts=

Revision as of 08:07, 20 July 2019

Home * Programming * Data * Hash Table

A small phone book as a hash table [1]

A Hash Table, or a Hash Map, is a data structure that associates identifiers or keys (names, chess positions) with values (i. e. phone number, score of a position). A hash function is used for turning the key into a relatively small integer, the hash, that serves as an index into an array.

In a well-dimensioned hash table, the average cost for each lookup is independent of the number of elements stored in the table. In general programming as well in computer chess, hash tables often serve as cache for once calculated values, to save relative expensive computations over and over again.

Perfect Hashing

A perfect hash function [2]

If all of the keys are known at compile or initialization time and their cardinality is reasonable small, a perfect hash table can be created, in which there will be no collisions, since each key has an unique index. Opposed to Minimal Perfect Hashing, the lookup array contains either gaps or multiple entries.

Applications in computer chess are hashing of masked occupied bitboards, to map for instance attack sets of sliding pieces (rooks, bishops) on a particular square, or pawn shield stuff. Another application, despite a reversible hash function, is a precomputed table indexed by some material key, likely an incremental updated dot-product of all piece-type counts in some fixed order, by a vector of cumulated maximum count products of pieces ordered below, usually ignoring unusual material configurations due to promotions [3] . Persistent, or on the fly generated Endgame Tablebases and Bitbases containing perfect knowledge by retrograde analyses of certain material constellations with a few pieces in late endings might be considered as a kind of perfect hashing as well.

Minimal Perfect Hashing

Minimal perfect hash function [4]

If the hash array has no gaps and unique, distinct values, so called Minimal Perfect Hashing is applied, like in following bitboard hashing for bitscan purpose or determining pre-calculated move lists by move target sets of knights and king.

Search Tables

The classical hash table implementation in computer chess are the transposition tables, indexed by Zobrist- or BCH keys of the position, modulo number of entries inside the table, to store search results, evaluation, pawn structure related stuff and repetitions.

Class Libraries

Publications

1968

1970 ...

1980 ...

1990 ...

2000 ...

2010 ...

Forum Posts

1998 ...

2000 ...

2005 ...

2010 ...

2015 ...

External Links

Secure Hash Algorithm from Wikipedia
Merkle–Damgård construction from Wikipedia
Koorde based on Chord and De Bruijn Sequence
Pierre Courbois, Jasper van 't Hof, Toto Blanke, Sigi Busch

References

Up one Level