In permutation Procrustes, the error is computed by explicit multiplications like (A x P) or (P1 x A x P2). This is extremely inefficient because one is only rearranging rows/columns of A (an O(n^2) operation) but one is using matrix multiplication (which is O(n^3)) to do this. This can be done efficiently by:
For each permutation matrix, construct the corresponding permutation of indices; then constructed the matrix with permuted rows/columns with fancy indexing.
For each permutation matrix and the original matrix, construct a sparse matrix; use sparse matrix multiplication. The sparse matrix representation for A should be constructed only once or otherwise you'll give up much of the gains due to overhead.
(a) would be preferred in my view. It amounts to a more efficient way to evaluate the error function for k-opt in its application to Procrustes.
In permutation Procrustes, the error is computed by explicit multiplications like (A x P) or (P1 x A x P2). This is extremely inefficient because one is only rearranging rows/columns of A (an O(n^2) operation) but one is using matrix multiplication (which is O(n^3)) to do this. This can be done efficiently by:
(a) would be preferred in my view. It amounts to a more efficient way to evaluate the error function for k-opt in its application to Procrustes.