Main Content

Solve linear assignment problem

solves the linear assignment
problem for the rows and columns of the matrix `M`

= matchpairs(`Cost`

,`costUnmatched`

)`Cost`

. Each row is
assigned to a column in such a way that the total cost is minimized.
`costUnmatched`

specifies the cost per row of not assigning each row, and
also the cost per column of not having a row assigned to each column.

`[`

additionally returns indices for unmatched rows in `M`

,`uR`

,`uC`

] = matchpairs(`Cost`

,`costUnmatched`

)`uR`

and indices for
unmatched columns in `uC`

.

`[___] = matchpairs(`

specifies the goal of the optimization using any of the output argument combinations in
previous syntaxes. `Cost`

,`costUnmatched`

,`goal`

)`goal`

can be `'min'`

or
`'max'`

to produce matches that either minimize or maximize the total
cost.

[1] Duff, I.S. and J. Koster. "On
Algorithms For Permuting Large Entries to the Diagonal of a Sparse Matrix." *SIAM J.
Matrix Anal. & Appl.* 22(4), 2001. pp 973–996.

`dmperm`

| `equilibrate`

| `sprank`