Problem
I have a matrix X of multiple elements, here (C1,C2,C3,C4)
C1 C2 C3 C4
C1 2 7 1 0
C2 6 2 8 9
C3 8 1 1 5
C4 0 2 8 2
I am looking for an algorithm that moves larger values to the diagonal and smaller values to the upper and lower triangle under the constraint that is only allowed to switch two columns or two rows with each iteration's step.
Please note that the matrices I am having are dense and their values are real values (not integers)!
For example, after applying the algorithm I would the previous matrix to look like:
C3 C4 C1 C2
C4 8 2 0 2
C2 8 9 6 2
C3 1 5 8 1
C1 1 0 2 7
Comparison to other posts and literature
A similar problem is asked for in https://stackoverflow.com/questions/15351835/how-to-move-larger-values-close-to-matrix-diagonal-in-a-correlation-matrix where is asked for a solution for a sparse matrix with missing values. A solution for a sparse matrix without missing values is the Cuthill–McKee algorithm. In opposite to those two algorithm, my matrix has no missing values and it is dense.
Edit
Could it be possible to solve this with a special matrix factorization? I have no idea how though...