Sorry, I donβt know the correct terminology to use, but I have a 3x3 matrix like this
1 3 4
5 4 5
2 2 5
and I want to get the highest score by selecting a value from each row / column, but I cannot select the same row or column more than once, so the answer is in this case
3 + 5 + 5 = 13 (row0, col1 + row1, col0 + row2, col2)
4 + 5 + 5 = 14 is not allowed because I would select two values ββfrom col2
I use Java, and usually the matrix will be 15 by 15.
Is there a name for what I'm trying to do and what is an algorithm
thanks Paul
EDIT: Note: the Hungarian algorithm only works when none of the rows is equal to the number of columns, and in my case it is not always the case that I regularly have 10x12 or 11x13 cases. But it seems you can get around this by adding extra dummy lines.
EDIT hmm by trying one of these implications, and it doesn't seem to work unless I understand it.
100.0,100.0,100.0,100.0,30.0,80.0,80.0,100.0,100.0,80.0,
80.0,100.0,100.0,100.0,80.0,80.0,25.0,100.0,100.0,80.0,
80.0,100.0,100.0,100.0,80.0,25.0,80.0,100.0,100.0,80.0,
100.0,25.0,80.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,
0.0,100.0,100.0,100.0,100.0,80.0,80.0,100.0,100.0,100.0,
100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,25.0,100.0,
100.0,100.0,100.0,25.0,100.0,100.0,100.0,75.0,100.0,100.0,
100.0,80.0,30.0,100.0,75.0,100.0,100.0,100.0,100.0,100.0,
100.0,100.0,100.0,100.0,80.0,80.0,80.0,100.0,100.0,25.0,
100.0,100.0,100.0,75.0,100.0,100.0,100.0,25.0,100.0,100.0,
Results calculated
0:4,0,
1:3,1,
2:7,2,
3:6,3,
4:0,4,
5:2,5,
6:1,6,
7:9,7,
8:5,8,
9:8,9,