- Practice Mathematical Algorithm
- Mathematical Algorithms
- Pythagorean Triplet
- Fibonacci Number
- Euclidean Algorithm
- LCM of Array
- GCD of Array
- Binomial Coefficient
- Catalan Numbers
- Sieve of Eratosthenes
- Euler Totient Function
- Modular Exponentiation
- Modular Multiplicative Inverse
- Stein's Algorithm
- Juggler Sequence
- Chinese Remainder Theorem
- Quiz on Fibonacci Numbers
Hungarian Algorithm for Assignment Problem | Set 1 (Introduction)
- For each row of the matrix, find the smallest element and subtract it from every element in its row.
- Do the same (as step 1) for all columns.
- Cover all zeros in the matrix using minimum number of horizontal and vertical lines.
- Test for Optimality: If the minimum number of covering lines is n, an optimal assignment is possible and we are finished. Else if lines are lesser than n, we haven’t found the optimal assignment, and must proceed to step 5.
- Determine the smallest entry not covered by any line. Subtract this entry from each uncovered row, and then add it to each covered column. Return to step 3.
Try it before moving to see the solution
Explanation for above simple example:
An example that doesn’t lead to optimal value in first attempt: In the above example, the first check for optimality did give us solution. What if we the number covering lines is less than n.
Time complexity : O(n^3), where n is the number of workers and jobs. This is because the algorithm implements the Hungarian algorithm, which is known to have a time complexity of O(n^3).
Space complexity : O(n^2), where n is the number of workers and jobs. This is because the algorithm uses a 2D cost matrix of size n x n to store the costs of assigning each worker to a job, and additional arrays of size n to store the labels, matches, and auxiliary information needed for the algorithm.
In the next post, we will be discussing implementation of the above algorithm. The implementation requires more steps as we need to find minimum number of lines to cover all 0’s using a program. References: http://www.math.harvard.edu/archive/20_spring_05/handouts/assignment_overheads.pdf https://www.youtube.com/watch?v=dQDZNHwuuOY
Similar Reads
- Mathematical
Improve your Coding Skills with Practice
What kind of Experience do you want to share?
Procedure, Example Solved Problem | Operations Research - Solution of assignment problems (Hungarian Method) | 12th Business Maths and Statistics : Chapter 10 : Operations Research
Chapter: 12th business maths and statistics : chapter 10 : operations research.
Solution of assignment problems (Hungarian Method)
First check whether the number of rows is equal to the numbers of columns, if it is so, the assignment problem is said to be balanced.
Step :1 Choose the least element in each row and subtract it from all the elements of that row.
Step :2 Choose the least element in each column and subtract it from all the elements of that column. Step 2 has to be performed from the table obtained in step 1.
Step:3 Check whether there is atleast one zero in each row and each column and make an assignment as follows.
Step :4 If each row and each column contains exactly one assignment, then the solution is optimal.
Example 10.7
Solve the following assignment problem. Cell values represent cost of assigning job A, B, C and D to the machines I, II, III and IV.
Here the number of rows and columns are equal.
∴ The given assignment problem is balanced. Now let us find the solution.
Step 1: Select a smallest element in each row and subtract this from all the elements in its row.
Look for atleast one zero in each row and each column.Otherwise go to step 2.
Step 2: Select the smallest element in each column and subtract this from all the elements in its column.
Since each row and column contains atleast one zero, assignments can be made.
Step 3 (Assignment):
Thus all the four assignments have been made. The optimal assignment schedule and total cost is
The optimal assignment (minimum) cost
Example 10.8
Consider the problem of assigning five jobs to five persons. The assignment costs are given as follows. Determine the optimum assignment schedule.
∴ The given assignment problem is balanced.
Now let us find the solution.
The cost matrix of the given assignment problem is
Column 3 contains no zero. Go to Step 2.
Thus all the five assignments have been made. The Optimal assignment schedule and total cost is
The optimal assignment (minimum) cost = ` 9
Example 10.9
Solve the following assignment problem.
Since the number of columns is less than the number of rows, given assignment problem is unbalanced one. To balance it , introduce a dummy column with all the entries zero. The revised assignment problem is
Here only 3 tasks can be assigned to 3 men.
Step 1: is not necessary, since each row contains zero entry. Go to Step 2.
Step 3 (Assignment) :
Since each row and each columncontains exactly one assignment,all the three men have been assigned a task. But task S is not assigned to any Man. The optimal assignment schedule and total cost is
The optimal assignment (minimum) cost = ₹ 35
Related Topics
Privacy Policy , Terms and Conditions , DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.
IMAGES
VIDEO