Slide 1 of 27 Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and edited by Longin Jan Latecki.

Slides:



Advertisements
Similar presentations
The Assignment Problem
Advertisements

Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and edited by Longin Jan Latecki.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Transportation Problem (TP) and Assignment Problem (AP)
1 1 Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri.
Chapter 10, Part A Distribution and Network Models
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Transportation, Assignment, and Transshipment Problems
Transportation and Assignment Models
1 1 Slide © 2001 South-Western College Publishing/Thomson Learning Anderson Sweeney Williams Anderson Sweeney Williams Slides Prepared by JOHN LOUCKS QUANTITATIVE.
Masalah Penugasan.
Assignment Meeting 15 Course: D Deterministic Optimization Year: 2009.
Operations Research Assignment Problem.
Quantitative Techniques for Decision Making M.P. Gupta & R.B. Khanna © Prentice Hall India.
BA 452 Lesson B.1 Transportation 1 1Review We will spend up to 30 minutes reviewing Exam 1 Know how your answers were graded.Know how your answers were.
The Transportation and Assignment Problems
The Hungarian algorithm for non-square arrays
Presentation: H. Sarper
Linear Programming Applications
LINEAR PROGRAMMING SIMPLEX METHOD.
Kerimcan OzcanMNGT 379 Operations Research1 Transportation, Assignment, and Transshipment Problems Chapter 7.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
Hungarian Algorithm Vida Movahedi Elderlab, York University June 2007.
1 1 Slide Transportation, Assignment, and Transshipment Professor Ahmadi.
Assignment Model Lecture 21 By Dr Arshad Zaheer. RECAP  Transportation model (Maximization)  Illustration (Demand > Supply)  Optimal Solution  Modi.
Chapter 7 Transportation, Assignment & Transshipment Problems
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming: The Simplex Method Chapter 5.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
 Consists of nodes representing a set of origins and a set of destinations.  An arc is used to represent the route from each origins to each destinations.
Chapter 7 Transportation, Assignment, and Transshipment Problems
Assignment Problem. Definition Assignment Problem is a balanced transportation problem in which all supplies and demand are equal to 1.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
DISTRIBUTION AND NETWORK MODELS (1/2)
1 1 Slide © 2005 Thomson/South-Western Linear Programming: The Simplex Method n An Overview of the Simplex Method n Standard Form n Tableau Form n Setting.
Chapter 4 Linear Programming: The Simplex Method
The Assignment Algorithm A loading technique for committing two or more jobs to two or more workers or machines in a single work center. With one job assigned.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
IE 311 Operations Research– I
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Transportation, Assignment, and Transshipment Problems Pertemuan 7 Matakuliah: K0442-Metode Kuantitatif Tahun: 2009.
Network Flow Problems – The Assignment Problem
Transportation Problems Joko Waluyo, Ir., MT., PhD Dept. of Mechanical and Industrial Engineering.
TM 631 Optimization Assignment Problems. Prototype Problem K-Corp has 3 parts, each of which can be assigned to 1 of 3 machines. The problem is to assign.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or.
1 1 Slide Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs.Pramela Devi, Mrs.Sindhuja.K Mrs.Annapoorani Department:CSE 3/1/2016.
QUANTITATIVE METHODS FOR MANAGERS ASSIGNMENT MODEL.
Chapter 16: Learning Objectives Instructor Slides You should be able to: 1.Explain what scheduling involves and the importance of good scheduling 2.Describe.
1 1 Slide Dr. Mohamed Abdel Salam Operations Research (OR) Chapter 8 Transportation, Assignment, and Transshipment Problems.
1 1 Slide Operations Research (OR) Transportation, Assignment, and Transshipment Problems.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
Example Program Development
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
The Transportation and Assignment Problems
ENGM 535 Optimization Assignment Problems.
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
Assignment Problem A balanced transportation problem in which
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
Chapter 7 Transportation, Assignment & Transshipment Problems
Operations Research (OR)
Chapter 5 Transportation, Assignment, and Transshipment Problems
Assignment Problems Guoming Tang CSC Graduate Lecture.
Slides by John Loucks St. Edward’s University.
Decision Science Chapter 6 Assignment Models.
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
Presentation transcript:

Slide 1 of 27 Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and edited by Longin Jan Latecki

Slide 2 of 27 n Introduction to Assignment Problem n Let C be an nxn matrix representing the costs of each of n workers to perform any of n jobs. The assignment problem is to assign jobs to workers so as to minimize the total cost. Since each worker can perform only one job and each job can be assigned to only one worker the assignments constitute an independent set of the matrix C. n An arbitrary assignment is shown above in which worker a is assigned job q, worker b is assigned job s and so on. The total cost of this assignment is 23. n An arbitrary assignment is shown above in which worker a is assigned job q, worker b is assigned job s and so on. The total cost of this assignment is 23. n Can you find a lower cost assignment? n Can you find the minimal cost assignment? n Remember that each assignment must be unique in its row and column.

Slide 3 of 27 Assignment Problem n An assignment problem seeks to minimize the total cost assignment of m workers to m jobs, given that the cost of worker i performing job j is c ij. n It assumes all workers are assigned and each job is performed. n An assignment problem is a special case of a transportation problem in which all supplies and all demands are equal to 1; hence assignment problems may be solved as linear programs. n The network representation of an assignment problem with three workers and three jobs is shown on the next slide.

Slide 4 of 27 Assignment Problem n Network Representation c 11 c 12 c 13 c 21 c 22 c 23 c 31 c 32 c 33 WORKERSJOBS

Slide 5 of 27 Assignment Problem n Linear Programming Formulation Min  c ij x ij Min  c ij x ij i j i j s.t.  x ij = 1 for each resource (row) i s.t.  x ij = 1 for each resource (row) i j  x ij = 1 for each job (column) j  x ij = 1 for each job (column) j i x ij = 0 or 1 for all i and j. x ij = 0 or 1 for all i and j. Note: A modification to the right-hand side of the first constraint set can be made if a worker is permitted to work more than 1 job.Note: A modification to the right-hand side of the first constraint set can be made if a worker is permitted to work more than 1 job.

Slide 6 of 27 n Linear Programming (LP) problems can be solved on the computer using Matlab, and many others. n There are special classes of LP problems such as the assignment problem (AP). n Efficient solutions methods exist to solve AP. n AP can be formulated as an LP and solved by general purpose LP codes. n However, there are many computer packages, which contain separate computer codes for these models which take advantage of the problem network structure.

Slide 7 of 27 n A brute-force algorithm for solving the assignment problem involves generating all independent sets of the matrix C, computing the total costs of each assignment and a search of all assignment to find a minimal-sum independent set. The complexity of this method is driven by the number of independent assignments possible in an nxn matrix. There are n choices for the first assignment, n-1 choices for the second assignment and so on, giving n! possible assignment sets. Therefore, this approach has, at least, an exponential runtime complexity. n As each assignment is chosen that row and column are eliminated from consideration. The question is raised as to whether there is a better algorithm. In fact there exists a polynomial runtime complexity algorithm.

Slide 8 of 27 n From en.wikipedia.org/wiki/Hungarian_algorithm n The Hungarian method is a combinatorial optimization algorithm which solves the assignment problem in polynomial time. It was developed and published by Harold Kuhn in 1955, who gave the name "Hungarian method" because the algorithm was largely based on the earlier works of two Hungarian mathematicians: Dénes Kőnig and Jenő Egerváry. n James Munkres reviewed the algorithm in 1957 and observed that it is (strongly) polynomial. Since then the algorithm has been known also as Kuhn-Munkres or Munkres assignment algorithm. The time complexity of the original algorithm was O(n 4 ), however later it was noticed that it can be modified to achieve an O(n 3 ) running time. n In 2006, it was discovered that Carl Gustav Jacobi had solved the assignment problem in the 19th century, and published posthumously in 1890 in Latin.

Slide 9 of 27 Hungarian Method n The Hungarian method solves minimization assignment problems with m workers and m jobs. n Special considerations can include: number of workers does not equal the number of jobs — add dummy workers/jobs with 0 assignment costs as needednumber of workers does not equal the number of jobs — add dummy workers/jobs with 0 assignment costs as needed worker i cannot do job j — assign c ij = + Mworker i cannot do job j — assign c ij = + M maximization objective — create an opportunity loss matrix subtracting all profits for each job from the maximum profit for that job before beginning the Hungarian methodmaximization objective — create an opportunity loss matrix subtracting all profits for each job from the maximum profit for that job before beginning the Hungarian method

Slide 10 of 27 Hungarian Method n Step 1: For each row, subtract the minimum number in that row from all numbers in that row. n Step 2: For each column, subtract the minimum number in that column from all numbers in that column. n Step 3: Draw the minimum number of lines to cover all zeroes. If this number = m, STOP — an assignment can be made. n Step 4: Determine the minimum uncovered number (call it d ). Subtract d from uncovered numbers.Subtract d from uncovered numbers. Add d to numbers covered by two lines.Add d to numbers covered by two lines. Numbers covered by one line remain the same.Numbers covered by one line remain the same. Then, GO TO STEP 3.Then, GO TO STEP 3.

Slide 11 of 27 Hungarian Method n Finding the Minimum Number of Lines and Determining the Optimal Solution Step 1: Find a row or column with only one unlined zero and circle it. (If all rows/columns have two or more unlined zeroes choose an arbitrary zero.)Step 1: Find a row or column with only one unlined zero and circle it. (If all rows/columns have two or more unlined zeroes choose an arbitrary zero.) Step 2: If the circle is in a row with one zero, draw a line through its column. If the circle is in a column with one zero, draw a line through its row. One approach, when all rows and columns have two or more zeroes, is to draw a line through one with the most zeroes, breaking ties arbitrarily.Step 2: If the circle is in a row with one zero, draw a line through its column. If the circle is in a column with one zero, draw a line through its row. One approach, when all rows and columns have two or more zeroes, is to draw a line through one with the most zeroes, breaking ties arbitrarily. Step 3: Repeat step 2 until all circles are lined. If this minimum number of lines equals m, the circles provide the optimal assignment.Step 3: Repeat step 2 until all circles are lined. If this minimum number of lines equals m, the circles provide the optimal assignment.

Slide 12 of 27 Example 1: AP A contractor pays his subcontractors a fixed fee plus mileage for work performed. On a given day the contractor is faced with three electrical jobs associated with various projects. Given below are the distances between the subcontractors and the projects. Project Project A B C A B C Westside Westside Subcontractors Federated Subcontractors Federated Goliath Goliath Universal Universal How should the contractors be assigned to minimize total costs? Note : There are four subcontractors and three projects. We create a dummy project Dum, which will be assigned to one subcontractor (i.e. that subcontractor will remain idle)

Slide 13 of 27 Example 1: AP n Network Representation (note the dummy project) West.West. Dum.Dum. CC BB AA Univ.Univ. Gol.Gol. Fed.Fed.

Slide 14 of 27 Example 1: AP n Initial Tableau Setup Since the Hungarian algorithm requires that there be the same number of rows as columns, add a Dummy column so that the first tableau is (the smallest elements in each row are marked red): A BC Dummy A BC Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 15 of 27 Example 1: AP n Step 1: Subtract minimum number in each row from all numbers in that row. Since each row has a zero, we simply generate the original matrix (the smallest elements in each column are marked red). This yields: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 16 of 27 Example 1: AP n Step 2: Subtract the minimum number in each column from all numbers in the column. For A it is 25, for B it is 25, for C it is 14, for Dummy it is 0. This yields: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 17 of 27 Example 1: AP n Step 3: Draw the minimum number of lines to cover all zeroes (called minimum cover). Although one can "eyeball" this minimum, use the following algorithm. If a "remaining" row has only one zero, draw a line through the column. If a remaining column has only one zero in it, draw a line through the row. Since the number of lines that cover all zeros is 2 < 4 (# of rows), the current solution is not optimal. A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal n Step 4: The minimum uncovered number is 2 (circled).

Slide 18 of 27 Example 1: AP n Step 5: Subtract 2 from uncovered numbers; add 2 to all numbers at line intersections; leave all other numbers intact. This gives: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 19 of 27 Example 1: AP n Step 3: Draw the minimum number of lines to cover all zeroes. Since 3 (# of lines) < 4 (# of rows), the current solution is not optimal. A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal n Step 4: The minimum uncovered number is 1 (circled).

Slide 20 of 27 Example 1: AP n Step 5: Subtract 1 from uncovered numbers. Add 1 to numbers at intersections. Leave other numbers intact. This gives: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 21 of 27 Example 1: AP Find the minimum cover: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal n Step 4: The minimum number of lines to cover all 0's is four. Thus, the current solution is optimal (minimum cost) assignment.

Slide 22 of 27 Example 1: AP The optimal assignment occurs at locations of zeros such that there is exactly one zero in each row and each column: A B C Dummy A B C Dummy Westside Westside Federated Federated Goliath Goliath Universal Universal

Slide 23 of 27 Example 1: AP The optimal assignment is (go back to the original table for the distances): Subcontractor Project Distance Subcontractor Project Distance Westside C 16 Westside C 16 Federated A 28 Federated A 28 Universal B 25 Universal B 25 Goliath (unassigned) Goliath (unassigned) Total Distance = 69 miles Total Distance = 69 miles

Slide 24 of 27 Example 1: AP via LP n In our example the LP formulation is: Min z = 50x x x x x x x x x x x x x x x x 44 s.t. x 11 + x 12 + x 13 + x 14 = 1(row 1) x 21 + x 22 + x 23 + x 24 = 1(row 2) x 31 + x 32 + x 33 + x 34 = 1(row 3) x 41 + x 42 + x 43 + x 44 = 1(row 4) x 11 + x 21 + x 31 + x 41 = 1(column 1) x 12 + x 22 + x 32 + x 42 = 1(column 2) x 13 + x 23 + x 33 + x 43 = 1 (column 3) x 14 + x 24 + x 34 + x 44 = 1 (column 4) x ij >= 0 for i = 1, 2, 3, 4 and j = 1, 2, 3, 4 (nonnegativity)

Slide 25 of 27 Example 1: AP via LP n The solver formulation is:

Slide 26 of 27 Example 1: AP via LP n The solver solution is: