Fundamentals of Operation Research
Online BA · Sem 6
0% complete
0/10 lessons
Lesson 7 of 10Economics
Assignment Problem: Hungarian Method
Fundamentals of Operation Research
About the video
Assignment Problem | Hungarian Method | Example of Assignment Problem
Dr.Gajendra Purohit
Study notes
The assignment problem assigns n jobs to n agents one-to-one so that total cost is minimised. The Hungarian method solves it by reducing the cost matrix until an optimal assignment can be made using zero-cost cells.
Problem Setup
- There is an n x n cost matrix c_ij, and x_ij = 1 if agent i does job j, otherwise 0.
- Each row and each column receives exactly one assignment.
- It is a special case of the transportation problem in which every supply and demand equals 1.
- For a non-square matrix, add a dummy row or column of zeros.
- For a maximisation problem, subtract every entry from the largest entry, then minimise.
- For a forbidden assignment, use a very large cost M.
Hungarian Method Steps
- 1. Row reduction: subtract each row's minimum from every entry in that row.
- 2. Column reduction: subtract each column's minimum from every entry in that column.
- 3. Cover all zeros using the minimum number of horizontal and vertical lines.
- 4. If the number of lines equals n, an optimal assignment exists among the zeros.
- 5. Otherwise, find the smallest uncovered value k; subtract k from all uncovered entries and add k to entries at line intersections. Return to step 3.
- 6. Make the assignment: pick a row or column with a single zero, assign it, cross out the other zeros in its row and column, and repeat.
Why It Works
- Subtracting a constant from an entire row or column does not change which assignment is optimal.
- A complete assignment using only zeros therefore has the minimum cost.
- Calculate the total cost using the original matrix.
Key terms
- Assignment problem
- A one-to-one allocation of n jobs to n agents that minimises total cost.
- Hungarian method
- An algorithm that solves the assignment problem through matrix reductions and covering zeros with lines.
- Dummy row/column
- A row or column of zero costs added to make the matrix square.
- Line covering
- The minimum number of lines needed to cover all zeros; when it equals n, the assignment is optimal.
Takeaways
- Reduce rows first, then columns.
- Optimal when the minimum number of covering lines = n.
- Convert maximisation problems by subtracting each entry from the maximum.
- Compute the total cost from the original costs.
Contribute
Was this lesson helpful?
We read every rating and fix the weakest lessons first.