SlideShare a Scribd company logo
Lesson 31 The Assignment Problem Math 20 Algebra and Multivariable Mathematics for Social Sciences December 10, 2007
The Problem Three air conditioners need to be installed in the same week by three different companies Bids for each job are solicited from each company To which company should each job be assigned? 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution There are only 6 possible assignments of companies to jobs Check them and compare
Na ïve Solution—Guess #1 Total Cost = 53 + 87+ 36 = 176 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Guess #2 Total Cost = 53 + 92+ 41 = 186 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Guess #3 Total Cost = 47 + 96 + 36 = 179 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Guess #4 Total Cost = 47 + 92 + 37 = 176 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Guess #5 Total Cost = 47 + 96 + 41 = 197 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Guess #6 Total Cost = 60 + 87 + 37 = 184 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
Na ïve Solution—Completion 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1
Disadvantages of Na ïve Solution How does the time-to-solution vary with problem size? Answer: O(n!)
Rates of Growth
Mathematical Modeling of the Problem Given a  Cost Matrix   C  which lists for each “company”  i  the “cost” of doing “job”  j .  Solution is a  permutation matrix  X   : all zeros except for one 1 in each row and column Objective is to minimize the total cost
An Ideal Cost Matrix All nonnegative entries An possible assignment of zeroes, one in each row and column In this case the minimal cost is apparently zero!
The Hungarian Algorithm Find an “ideal” cost matrix that has the same optimal assignment as the given cost matrix From there the solution is easy!
Critical Observation Let  C  be a given cost matrix and consider a new cost matrix  C’  that has the same number added to each entry of a single row of  C For each assignment, the new total cost differs by that constant The optimal assignment is the same as before
Critical Observation Same is true of columns So: we can subtract  minimum  entry from each row and column to insure nonnegative entries
On our given matrix
Still Not Done No assignment of zeros in this matrix
Still Not Done No assignment of zeros in this matrix
Still Not Done No assignment of zeros in this matrix
Still Not Done No assignment of zeros in this matrix
Still Not Done No assignment of zeros in this matrix ?
Still Not Done No assignment of zeros in this matrix Still, we can create new zeroes by subtracting the smallest entry from some rows
Still Not Done No assignment of zeros in this matrix Still, we can create new zeroes by subtracting the smallest entry from some rows Now we can preserve nonnegativity by adding that entry to columns which have negative entries
Solutions
Na ïve Solution—Completion 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1
The Hungarian Algorithm Find the minimum entry in each row and subtract it from each row Find the minimum entry in each column and subtract it from each column Resulting matrix is nonnegative
The Hungarian Algorithm 3.   Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix Find a way to do this with a minimum number of lines (≤n)
The Hungarian Algorithm 4.  If you can only do this with n lines, an assignment of zeroes is possible.
The Hungarian Algorithm Otherwise, determine the smallest entry not covered by any line. Subtract this entry from all uncovered entries Add it to all double-covered entries Return to Step 3.
The Hungarian Algorithm 3.   Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
The Hungarian Algorithm 3.   Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
The Hungarian Algorithm 3.   Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
The Hungarian Algorithm 4.  If you can only do this with n lines, an assignment of zeroes is possible.
Solutions
Example 2 A cab company gets four calls from four customers simultaneously Four cabs are out in the field at varying distance from each customer Which cab should be sent where to minimize total (or average) waiting time?  11.5 9.5 11.0 4.5 D 10.5 9.0 9.5 12.5 C 6.5 5.5 8.5 3.5 B 8 7.5 7.5 9 A Cab 4 3 2 1 Customer
Integerizing the Matrix
Non-negativizing the Matrix
Covering the Zeroes Can do it with three!
Find Smallest Uncovered Entry
Subtract and Add
Cover Again Still three!
Find Smallest Uncovered
Subtract and Add
Cover Again Done!
Solutions Done!
Solutions Total Cost = 27.5
Other Applications of AP Assigning teaching fellows to time slots Assigning airplanes to flights Assigning project members to tasks Determining positions on a team Assigning brides to grooms (once called the  marriage problem )

More Related Content

PPTX
Transportation problems
PPTX
Hungarian Method
PPTX
Assignment problem
PPTX
Hungarian algorithm
PDF
Assignment problems
PPTX
Assignment Problem
PDF
Assignment Poblems
PDF
Well done company case final [compatibility mode]
Transportation problems
Hungarian Method
Assignment problem
Hungarian algorithm
Assignment problems
Assignment Problem
Assignment Poblems
Well done company case final [compatibility mode]

What's hot (20)

PPT
Assignment Problem
PPT
Transportation problem
PPT
simplex method
PPTX
Hungarian Assignment Problem
PPTX
Modified distribution method (modi method)
PPTX
Assignment problem
PDF
Asssignment problem
PDF
Integer programming
PPTX
Vogel's Approximation Method
PPTX
MODI Method (Operations Research)
PPTX
Assignment problem maximum
PPT
Formulation Lpp
PDF
Assignment Chapter - Q & A Compilation by Niraj Thapa
PDF
Operation research-Network analysis (Critical Path Method)
PPTX
Solving Degenaracy in Transportation Problem
PPTX
Dynamic Programming
PPTX
Transportation Problem- Stepping Stone Method
PPTX
Assignment model
DOCX
Formulation of lp problems
Assignment Problem
Transportation problem
simplex method
Hungarian Assignment Problem
Modified distribution method (modi method)
Assignment problem
Asssignment problem
Integer programming
Vogel's Approximation Method
MODI Method (Operations Research)
Assignment problem maximum
Formulation Lpp
Assignment Chapter - Q & A Compilation by Niraj Thapa
Operation research-Network analysis (Critical Path Method)
Solving Degenaracy in Transportation Problem
Dynamic Programming
Transportation Problem- Stepping Stone Method
Assignment model
Formulation of lp problems
Ad

Similar to Lesson 33: The Assignment Problem (20)

PDF
Assignment problem notes
PPTX
Muzammil irshad.pptxhdududududiufufufufu
PDF
A study on solving Assignment Problem
PPTX
Chapter 1 Assignment Problems (DS) (1).pptx
PDF
Decision Science.pdf
PPTX
Algorithm for Hungarian Method of Assignment
PDF
qadm-ppt-150918102124-lva1-app6892.pdf
PPT
Quantitative Analysis For Decision Making
PPT
System of linear equation and matrices
PPT
Assignment problem
PDF
Assgnment=hungarian method
PDF
A Comparative Analysis Of Assignment Problem
PDF
A0280115(1)
PDF
Assignment problem
PDF
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
PPTX
Class 8 IAshhjjj3hwjkwkwmmdjjsignment Problem.pptx
PDF
Solving ONE’S interval linear assignment problem
PDF
Assignment
PPTX
04-Unit Four - OR.pptx
PPTX
Matching problem
Assignment problem notes
Muzammil irshad.pptxhdududududiufufufufu
A study on solving Assignment Problem
Chapter 1 Assignment Problems (DS) (1).pptx
Decision Science.pdf
Algorithm for Hungarian Method of Assignment
qadm-ppt-150918102124-lva1-app6892.pdf
Quantitative Analysis For Decision Making
System of linear equation and matrices
Assignment problem
Assgnment=hungarian method
A Comparative Analysis Of Assignment Problem
A0280115(1)
Assignment problem
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Class 8 IAshhjjj3hwjkwkwmmdjjsignment Problem.pptx
Solving ONE’S interval linear assignment problem
Assignment
04-Unit Four - OR.pptx
Matching problem
Ad

More from Matthew Leingang (20)

PPT
Making Lesson Plans
PPT
Streamlining assessment, feedback, and archival with auto-multiple-choice
PDF
Electronic Grading of Paper Assessments
PDF
Lesson 27: Integration by Substitution (slides)
PDF
Lesson 26: The Fundamental Theorem of Calculus (slides)
PDF
Lesson 26: The Fundamental Theorem of Calculus (slides)
PDF
Lesson 27: Integration by Substitution (handout)
PDF
Lesson 26: The Fundamental Theorem of Calculus (handout)
PDF
Lesson 25: Evaluating Definite Integrals (slides)
PDF
Lesson 25: Evaluating Definite Integrals (handout)
PDF
Lesson 24: Areas and Distances, The Definite Integral (handout)
PDF
Lesson 24: Areas and Distances, The Definite Integral (slides)
PDF
Lesson 23: Antiderivatives (slides)
PDF
Lesson 23: Antiderivatives (slides)
PDF
Lesson 22: Optimization Problems (slides)
PDF
Lesson 22: Optimization Problems (handout)
PDF
Lesson 21: Curve Sketching (slides)
PDF
Lesson 21: Curve Sketching (handout)
PDF
Lesson 20: Derivatives and the Shapes of Curves (slides)
PDF
Lesson 20: Derivatives and the Shapes of Curves (handout)
Making Lesson Plans
Streamlining assessment, feedback, and archival with auto-multiple-choice
Electronic Grading of Paper Assessments
Lesson 27: Integration by Substitution (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 27: Integration by Substitution (handout)
Lesson 26: The Fundamental Theorem of Calculus (handout)
Lesson 25: Evaluating Definite Integrals (slides)
Lesson 25: Evaluating Definite Integrals (handout)
Lesson 24: Areas and Distances, The Definite Integral (handout)
Lesson 24: Areas and Distances, The Definite Integral (slides)
Lesson 23: Antiderivatives (slides)
Lesson 23: Antiderivatives (slides)
Lesson 22: Optimization Problems (slides)
Lesson 22: Optimization Problems (handout)
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (handout)
Lesson 20: Derivatives and the Shapes of Curves (slides)
Lesson 20: Derivatives and the Shapes of Curves (handout)

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Spectroscopy.pptx food analysis technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectroscopy.pptx food analysis technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools

Lesson 33: The Assignment Problem

  • 1. Lesson 31 The Assignment Problem Math 20 Algebra and Multivariable Mathematics for Social Sciences December 10, 2007
  • 2. The Problem Three air conditioners need to be installed in the same week by three different companies Bids for each job are solicited from each company To which company should each job be assigned? 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 3. Na ïve Solution There are only 6 possible assignments of companies to jobs Check them and compare
  • 4. Na ïve Solution—Guess #1 Total Cost = 53 + 87+ 36 = 176 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 5. Na ïve Solution—Guess #2 Total Cost = 53 + 92+ 41 = 186 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 6. Na ïve Solution—Guess #3 Total Cost = 47 + 96 + 36 = 179 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 7. Na ïve Solution—Guess #4 Total Cost = 47 + 92 + 37 = 176 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 8. Na ïve Solution—Guess #5 Total Cost = 47 + 96 + 41 = 197 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 9. Na ïve Solution—Guess #6 Total Cost = 60 + 87 + 37 = 184 36 92 60 C 41 87 47 B 37 96 53 A Bldg3 Bldg2 Bldg1
  • 10. Na ïve Solution—Completion 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1
  • 11. Disadvantages of Na ïve Solution How does the time-to-solution vary with problem size? Answer: O(n!)
  • 13. Mathematical Modeling of the Problem Given a Cost Matrix C which lists for each “company” i the “cost” of doing “job” j . Solution is a permutation matrix X : all zeros except for one 1 in each row and column Objective is to minimize the total cost
  • 14. An Ideal Cost Matrix All nonnegative entries An possible assignment of zeroes, one in each row and column In this case the minimal cost is apparently zero!
  • 15. The Hungarian Algorithm Find an “ideal” cost matrix that has the same optimal assignment as the given cost matrix From there the solution is easy!
  • 16. Critical Observation Let C be a given cost matrix and consider a new cost matrix C’ that has the same number added to each entry of a single row of C For each assignment, the new total cost differs by that constant The optimal assignment is the same as before
  • 17. Critical Observation Same is true of columns So: we can subtract minimum entry from each row and column to insure nonnegative entries
  • 18. On our given matrix
  • 19. Still Not Done No assignment of zeros in this matrix
  • 20. Still Not Done No assignment of zeros in this matrix
  • 21. Still Not Done No assignment of zeros in this matrix
  • 22. Still Not Done No assignment of zeros in this matrix
  • 23. Still Not Done No assignment of zeros in this matrix ?
  • 24. Still Not Done No assignment of zeros in this matrix Still, we can create new zeroes by subtracting the smallest entry from some rows
  • 25. Still Not Done No assignment of zeros in this matrix Still, we can create new zeroes by subtracting the smallest entry from some rows Now we can preserve nonnegativity by adding that entry to columns which have negative entries
  • 27. Na ïve Solution—Completion 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1 36 92 60 C 41 87 47 B 37 96 53 A 3 2 1
  • 28. The Hungarian Algorithm Find the minimum entry in each row and subtract it from each row Find the minimum entry in each column and subtract it from each column Resulting matrix is nonnegative
  • 29. The Hungarian Algorithm 3. Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix Find a way to do this with a minimum number of lines (≤n)
  • 30. The Hungarian Algorithm 4. If you can only do this with n lines, an assignment of zeroes is possible.
  • 31. The Hungarian Algorithm Otherwise, determine the smallest entry not covered by any line. Subtract this entry from all uncovered entries Add it to all double-covered entries Return to Step 3.
  • 32. The Hungarian Algorithm 3. Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
  • 33. The Hungarian Algorithm 3. Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
  • 34. The Hungarian Algorithm 3. Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix
  • 35. The Hungarian Algorithm 4. If you can only do this with n lines, an assignment of zeroes is possible.
  • 37. Example 2 A cab company gets four calls from four customers simultaneously Four cabs are out in the field at varying distance from each customer Which cab should be sent where to minimize total (or average) waiting time? 11.5 9.5 11.0 4.5 D 10.5 9.0 9.5 12.5 C 6.5 5.5 8.5 3.5 B 8 7.5 7.5 9 A Cab 4 3 2 1 Customer
  • 40. Covering the Zeroes Can do it with three!
  • 49. Other Applications of AP Assigning teaching fellows to time slots Assigning airplanes to flights Assigning project members to tasks Determining positions on a team Assigning brides to grooms (once called the marriage problem )