I have a random binary matrix $A$
$$ A=\left[\begin{array}{c c c c c}0&0&0&0&1\\0&1&0&1&0\\1&1&1&1&0\\0&1&1&0&0\\1&0&1&1&1 \end{array}\right] $$ and a permutation of the identity matrix (denoted later as $I_p$) that will filter it. I want to find the best permutation $I_p$ (using row/column swapping) so as to maximize $\text{sum}(AI_p)$
- $\text{sum}(AI_p)$ is computed using element-wise sum and multiplication
ex.
$$ A=\left[\begin{array}{c c c}0&1&0\\1&0&1\\1&0&0 \end{array}\right] $$
the maximum $\text{sum}(AI)$ would be from $$ I_p= \left[\begin{array}{c c c}0& 1& 0\\0& 0 &1\\1 &0& 0 \end{array}\right] $$
I am currently checking every possible column permutation of $I$, which scales terribly.