The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal-dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name “Hungarian method” fundamentals of operations research by prof g srinivasan pdf the algorithm was largely based on the earlier works of two Hungarian mathematicians: Dénes Kőnig and Jenő Egerváry. Munkres algorithm or Munkres assignment algorithm.
Ford and Fulkerson extended the method to general transportation problems. In 2006, it was discovered that Carl Gustav Jacobi had solved the assignment problem in the 19th century, and the solution had been published posthumously in 1890 in Latin.
In this simple example there are three workers: Armond, Francine, and Herbert. One of them has to clean the bathroom, another sweep the floors and the third washes the windows, but they each demand different pay for the various tasks. The problem is to find the lowest-cost way to assign the jobs. The problem can be represented in a matrix of the costs of the workers doing the jobs.
6, achieved by having Armond clean the bathroom, Francine sweep the floors, and Herbert wash the windows. We have to find an assignment of the jobs to the workers that has minimum cost. If the goal is to find the assignment that yields the maximum cost, the problem can be altered to fit the setting by replacing each cost with the maximum cost subtracted by the cost.
The algorithm is easier to describe if we formulate the problem using a bipartite graph. We want to find a perfect matching with minimum cost.
It can be seen that the cost of each perfect matching is at least the value of each potential. T to S form a matching M. In each step, either we modify y so that its value increases, or modify the orientation to obtain a matching with more edges.
We maintain the invariant that all the edges of M are tight. We are done if M is a perfect matching. This can be computed by breadth-first search. Thus the size of the corresponding matching increases by 1.
The resulting y is still a potential. We orient the new edges from S to T. We repeat these steps until M is a perfect matching, in which case it gives a minimum cost assignment. 1, 2, 3 and 4.
1, a2, a3, a4 denote the penalties incurred when worker “a” does task 1, 2, 3, 4 respectively. The same holds true for the other symbols as well. The matrix is square, so each worker can perform only one task.