Any ideas on how to efficiently generate an arbitrary numpy array of fixed dimensions (n,m)
where all the rows are permutations of each other and all the columns are permutations of each other (i.e. strongly symmetric)?
Here's one way to generate some such arrays. Let a
be the greatest common divisor of n
and m
.
a
by a
blocksa
is 3, maybe you turn all the 3's in the grid into 2's.I'm not sure that this method can generate every possible such grid, but it should be able to generate many of them. After steps 1 and 2 are complete you'll have a valid array, the remaining steps just add more randomness.
Of course the easiest way to generate such an array is just to fill it will all 1's, but that's not what you're looking for.