Expand description
The linear sum assignment problem (SciPy’s linear_sum_assignment): match rows to columns of
a cost matrix, one-to-one, to minimise (or maximise) the total cost, by the shortest
augmenting path algorithm of Jonker and Volgenant as described by Crouse (2016).
See the book entry Assignment, trust regions and global optimisation.
Functions§
- linear_
sum_ assignment - The optimal assignment: pairs
(rowᵢ, colᵢ), as many as the smaller dimension, sorted by row, minimisingΣ cost[rowᵢ][colᵢ](maximising withmaximize). Each row in turn is joined to the current matching by a shortest augmenting path in the reduced costs, and the dual variablesu,vare updated so that all reduced costs stay non-negative (the Hungarian method’s invariant). A tall matrix is transposed first.O(n³). Infinite costs forbid a pair; an error is returned if no complete assignment avoids them, or for NaN or−∞.