theochem / procrustes

Python library for finding the optimal transformation(s) that makes two matrices as close as possible to each other.
https://procrustes.qcdevs.org/
GNU General Public License v3.0
109 stars 20 forks source link

Improve efficiency of kopt implementation #65

Open FarnazH opened 3 years ago

FarnazH commented 3 years ago

Actually, why make a permutation matrix (mostly zeros and ones) and multiply by A (cost of O(n^3)). You can directly compute A with permuted rows/columns, then compute the error in (permuted) A. This has cost O(n^2) (computing the error) instead of O(n^3). IF the error is reduced, you can return the permutation, or even the permutation matrix (which can be constructed at the very end).

_Originally posted by @PaulWAyers in https://github.com/theochem/procrustes/pull/62#discussion_r588938851_

PaulWAyers commented 3 years ago

This supersedes https://github.com/theochem/procrustes/issues/79 which I closed.