Now take out any dummy rows or columns that you added.The zeros in the final matrix correspond to the ideal assignment in the original matrix.But the cost will remain the same for different sets of allocations.
In the second phase, the solution is optimized on iterative basis.
In a given problem, if the number of rows is not equal to the number of columns and vice versa, then add a dummy row or a dummy column.
Because 3 obviously doesn't equal 4, as in the number of rows in the square matrix, we move on to step 4.
In this step, we identify the smallest uncovered element in the matrix as 10, and we subtract it from the uncovered elements and add it to any element that's covered by two lines.
You want to assign the employees to jobs in such a way that the overall cost is minimized.
This is an example of an assignment problem that we can use the Hungarian Algorithm to solve.The Hungarian Algorithm is used to find the minimum cost when assigning people to activities based on cost, and each activity must be assigned to a different person.To use the Hungarian Algorithm, we first arrange the activities and people in a matrix with rows being people, columns being activity, and entries being the costs.Subtract this smallest element with all other remaining elements that are NOT COVERED by lines and add the element at the intersection of lines.Leave the elements covered by single line as it is. Take any row or column which has a single zero and assign by squaring it.Reduce the new matrix given in the following table by selecting the smallest value in each column and subtract from other values in that corresponding column.In column 1, the smallest value is 0, column 2 is 4, column 3 is 3 and column 4 is 0.The column-wise reduction matrix is shown in the following table.Take the smallest element of the matrix that is not covered by single line, which is 3. Now, draw minimum number of lines to cover all the zeros and check for optimality. Select a row that has a single zero and assign by squaring it. Subtract 3 from all other values that are not covered and add 3 at the intersection of lines. Here in table minimum number of lines drawn is 4 which are equal to the order of matrix. Strike off remaining zeros if any in that row or column. As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more.