On Tue, Dec 8, 2009 at 5:49 PM, Petr Baudis <pa...@ucw.cz> wrote: > Hi! > > In most papers I've read, three-valued Zobrist hashes are used - per > intersection, values for "empty", "black" and "white" coloring [1]. > I'm not clear on why is the "empty" value needed, however, shouldn't > only "black", "white" values work just fine? Is the hash behaving better > with extra values for empty intersections? Has anyone measured it?
You can mathematically prove the two systems are almost the same, so there's no need to test. For simplicity, suppose you're doing a 3-color hash of just hashing two intersections, and your Zobrist values are b1, w1, e1, b2, w2, and e2 (where e.g. e1 means the first intersection is empty and b2 means the second intersection is black). This is equiavlent to using the Zobrist values b1' = (b1 xor e1), w1' = (w1 xor e1), e1' = 0, b2' = (b2 xor e2), w2' = (w2 xor e2), e2' = 0, and then when you're finished, xoring the result with (e1 xor e2). So a 3-color Zobrist with one set of constants is equivalent to a 2-color Zobrist (and zero for empty) with a different set of constants, plus a constant. Assuming your Zobrist values are random, the random 3-color Zobrist is equivalent to a random 2-color Zobrist (failing to hash the empty squares) plus a random constant. > > [1] In pattern-matching, it is desirable to also use "edge" coloring. > > Thanks, > > Petr "Pasky" Baudis _______________________________________________ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/