Talk:Zobrist hashing
This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||
|
New section
[edit]Zobrist hashing was originally invented for computer chess and is the most popular hash method there. For chess you need 13 different values (for 6 piece types for each side, or an empty square) at each square. In addition it is best to hash in the castling and en-passent status as well. All this makes it a bit more complicated than for go, but still quite manageable. There are the same benefits, in that it is very efficient to incrementally update the hash value after making a move: only the squares affected need their contributuitions recalculated rather than the whole board. 198.142.44.32 00:37, 23 March 2007 (UTC)
Chess positions
[edit]The text says:
Zobrist hashing starts by randomly generating bitstrings for each possible element of a board game, i.e. for each combination of a piece and a position (in the game of chess, that's 12 pieces × 64 board positions, or 14 if a king that may still castle and a pawn that may capture en passant are treated separately)
I believe that's incorrect. There are 10 different pieces that can be anywhere in the board (5 for each side). The pawns can be in any of (64-16) possible places, because they can't be at the first or last row. A white pawn that can capture en passant can only be in one of eight positions, and same for a black pawn, not in the whole 64 positions. A white king that may still castle must be in its original position, and there's no mention of rooks that may still castle, for which there is also one additional position for each. So the actual total is (5×64+1×(64-16)+1×8+1+2)×2. --pgimeno (talk) 14:51, 19 July 2014 (UTC)
- You may be correct, but the algorithm you describe isn't Zobrist hashing. We don't don't get to define it as we want, or think it should be - it's defined in the original paper by Zobrist and it is what it is. As a description of that algorithm, the text is correct.Sbalfour (talk) 15:16, 24 September 2019 (UTC)
Pseudocode = original art
[edit]The pseudocode is uncited, and almost certainly original art. I propose deleting it, if such citation is not forthcoming.Sbalfour (talk) 15:18, 24 September 2019 (UTC)
merge proposal
[edit]Besides the pseudocode, in two sections (which is original art and must go), the entire article rambles... the one paragraph presentation in Tabulation hashing#History is a very concise and very accurate presentation. Maybe we can dispose of this article altogether and just redirect the page to that section. See also Hash function#Zobrist hashing - we could also merge it there. We need to get it out of our heads that the encyclopedia is a how-to manual. We describe the algorithm, we don't code it.Sbalfour (talk) 15:34, 24 September 2019 (UTC)
- I am opposed to a merger. Google scholar has roughly 235 hits for Zobrist hashing; it is clearly a notable topic, independent from tabulation hashing, which (despite being closely related) has different purposes. This article could use some cleanup but that isn't a good reason to get rid of it. And expanding the discussion of Zobrist hashing within the tabulation hashing article, to cover it properly rather than merely describing it briefly as a precursor to tabulation hashing, would unbalance that article and make it worse. —David Eppstein (talk) 21:08, 27 May 2020 (UTC)
- I second Eppsteins point of view. Zobrist hashing is a key part of many game algorithms and is of importance independent of the more general topic of tabulation hashing. vT. 14:02, 30 August 2020 (UTC) — Preceding unsigned comment added by 2003:CA:171F:5300:D6BE:D9FF:FE3A:7ED0 (talk)
- Closing, given the uncontested objections. Klbrain (talk) 07:45, 20 September 2020 (UTC)