Ordering binary matrices for reflection/rotation

133 Views Asked by At

I have a collection of $n\times n$ binary matrices and I would like to reduce it for symmetry ($D_4$ -- reflections and rotations). The naive method of testing each pair is very slow because the collection is large. Is there some ordering I can use so that duplicates will be nearby (or even a canonicalization)? If it's easy enough to implement this could reduce the number of comparisons from $\sim n^2/2$ to $\sim n\log_2n$ which would be a big improvement.