0

Say you have a 2D matrix,Is there a particular algorithm or way to do this in excel or matlab that would find the max of each row and column, such that each column and each row has only one maximal number N, where summing all N would result in the largest possible sum,i.e. is a row or column has a max number that is repeated., as such with the simple example below

1 2 4          
3 1 4         
1 2 4         

the out put would be

1 2 4

3 2 4

1 2 4

4

1 に答える 1

1

行列がエッジの重み行列を表す (完全な) グラフで最大の二部一致を探しています。この値は、ハンガリー語アルゴリズムを使用して計算できます(MATLAB 実装は File Exchange からダウンロードできます)。最大の一致が必要なため、マトリックス内のすべての数値を否定して、この関数に入力します。2 つの出力が返されます。1 つは最大合計 (の負数) で、もう 1 つは最大要素が各行と列で発生し、それ以外はゼロであるバイナリ行列です。

于 2012-09-15T19:47:56.610 に答える