[math-fun] Fast scheme to recognize polyominos?
A "polyomino" is an interior-connected set of grid squares in the plane, and for my purposes we may demand also "simply connected" (i.e. no holes). Two polyominos are equivalent if congruent. The number of N-square polyominos is here: http://oeis.org/A000104 Your (admittedly somewhat vaguely defined) mission is to figure out a fast algorithm to recognize which polyomino I just gave you. I might rotate it any of 4 ways, mirror it or not, and translate it by any integers (x,y) before giving it to you. --- I have a solution in mind incidentally, which for an N-omino will run in O(N) operations and output a unique bitstring polyomino name which is at most 3*N*lg3 bits long (lgX=log base 2 of X). This is optimal except for the constant hidden in the "O" and the constant 3*lg3=4.754887... which perhaps could somehow be improved to about 2.0224 which then would be optimal assuming certain standard conjectures about polyomino-count asymptotics. The scheme I have in mind will not do that and is stuck at 4.75..., but by "hashing" my scheme's bitstring down to a smaller bitlength we could reduce this to 4.0448 which is a factor of two times optimal and a "random hash function" (if one exists) would do this collisionlessly with good probability. But it might be possible to do better than my scheme.
participants (1)
-
Warren Smith