Say I have a matrix (array) where elements are in the set {0,1} subject to the constraint that all rows and columns each sum to 1.