My question is the same one from the google answers back in 2002 [1].
Here is the question quoted from the google answers.
"I am trying to compute the maximum possible sum of values from a matrix or 2d array or table or any suitable structure. The restriction is that once you select a particular row,column value to add to your sum, no other values from that row or column may be used in calculating the sum."
The only way I have been able to solve this is by going through every possible combination and store the potential result in a set of all possible potential results. I then select the maximum. This seems to chew up a lot of memory in my program which generates errors. The program is written in Java.
I have provided an example below for further clarification
e.g. 3 X 3 matrix with the following values
0.5 0.1 0.4
0.3 0.8 0.7
0.2 0.4 0.6
All possible combinations
0.5 + 0.8 + 0.6 = 1.9
0.5 + 0.7 + 0.4 = 1.6
0.1 + 0.3 + 0.6 = 1.0
0.1 + 0.7 + 0.2 = 1.0
0.4 + 0.3 + 0.4 = 1.1
0.4 + 0.8 + 0.2 = 1.4
So the maximum possible sum is 1.9.
If there is no other way to get the exact maximum, is there something I can do to get an approximate value?
Duplicates can appear in the matrix and the matrix is not necessarily square.