I have a symmetric m
-by-m
matrix A
. Each element has a value between 0 and 1. I now want to choose n
rows / columns of A
which form an n
-by-n
sub-matrix B
.
The criteria for choosing these elements, is that the sum of all elements of B
must be the minimum out of all possible n
-by-n
sub-matrices of A
.
For example, suppose that A
is a 4-by-4 matrix:
A = [0 0.5 1 0; 0.5 0 0.5 0; 1 0.5 1 1; 0 0 1 0.5]
And n
is set to 3. Then, the best B
is the one taking the first, second and fourth rows / columns of A
:
B = [0 0.5 0; 0.5 0 0; 0 0 0.5]
Where the sum of these elements is 0 + 0.5 + 0 + 0.5 + 0 + 0 + 0 + 0 + 0.5 = 1.5, which is smaller than another other possible 3-by-3 sub-matrices (e.g. using the first, third and fourth rows / columns).
How can I do this?
This is partly a mathematics question, and partly a Matlab one. Any help with either would be great!