Hungarian algorithm: Difference between revisions

Content deleted Content added
m Robot-assisted disambiguation link repair (you can help!): Hungarian
Line 5:
==Modeling==
 
The algorithm models an assignment problem as a ''n''×''m'' cost matrix, where each element represents the cost of assigning the ''n''th worker to the ''m''th job. By default, the algorithm performs minimization on the elements of the matrix; hence in the case of a price-minimization problem, it is sufficient to begin [[Gaussian elimination]] to make zeros appear (at least one zero per line and per column). However, in the case of a profit-maximization problem, the cost matrix needs to be modified so that minimization of its elements results in maximizing the original cost values. In an infinite-cost problem, the initial cost matrix can be re-modelled by subtracting every element of each line from the maximum value of the element of that line (or column respectively). In a finite-cost problem, all the elements are subtracted from the maximum value of the whole matrix.
 
==Algorithm==