Assignment Problems Guoming Tang CSC 545 - Graduate Lecture.

Slides:



Advertisements
Similar presentations
February 14, 2002 Putting Linear Programs into standard form
Advertisements

The Assignment Problem
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)
Assignment Meeting 15 Course: D Deterministic Optimization Year: 2009.
1 Transportation Problems Transportation is considered as a “special case” of LP Reasons? –it can be formulated using LP technique so is its solution (to.
Operations Research Assignment Problem.
Quantitative Techniques for Decision Making M.P. Gupta & R.B. Khanna © Prentice Hall India.
The Transportation and Assignment Problems
Approximation Algorithms
Chapter 10: Iterative Improvement
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 68 Chapter 9 The Theory of Games.
Linear Programming Applications
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
LINEAR PROGRAMMING SIMPLEX METHOD.
Hungarian Algorithm Vida Movahedi Elderlab, York University June 2007.
Slide 1 of 27 Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and edited by Longin Jan Latecki.
Chapter 7 Transportation, Assignment & Transshipment Problems
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
Mechanical Engineering Department 1 سورة النحل (78)
Advanced Operations Research Models Instructor: Dr. A. Seifi Teaching Assistant: Golbarg Kazemi 1.
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.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
Network Flow Problems – The Assignment Problem
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 Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs.Pramela Devi, Mrs.Sindhuja.K Mrs.Annapoorani Department:CSE 3/1/2016.
Assignment Problem. Concepts What is the Assignment Problem? The assignment problem deals with assigning machines to tasks, workers to jobs, soccer players.
Business Mathematics MTH-367 Lecture 14. Last Lecture Summary: Finished Sec and Sec.10.3 Alternative Optimal Solutions No Feasible Solution and.
Distribution Model Meaning Types Transportation Model Assignment Model.
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
deterministic operations research
St. Edward’s University
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
Chap 10. Sensitivity Analysis
ENGM 535 Optimization Assignment Problems.
Lecture 3.
The minimum cost flow problem
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
NAME: OLUWATOSIN UTHMAN ZUBAIR (145919) COURSE: NETWORK FLOW
Perturbation method, lexicographic method
Linear programming Simplex method.
Introduction to Operations Research
1.3 Modeling with exponentially many constr.
Chapter 4 Linear Programming: The Simplex Method
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.
Chap 3. The simplex method
Analysis of Algorithms
Chapter 7 Transportation, Assignment & Transshipment Problems
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving.
Operations Research (OR)
Linear programming Simplex method.
1.3 Modeling with exponentially many constr.
Transportation Problems
Chapter 5 Transportation, Assignment, and Transshipment Problems
Flow Feasibility Problems
Chapter 2. Simplex method
Decision Science Chapter 6 Assignment Models.
Chapter 10: Iterative Improvement
Assignment Problem: Hungarian Algorithm and Linear Programming collected from the Internet and extended by Longin Jan Latecki.
Chapter 2. Simplex method
Presentation transcript:

Assignment Problems Guoming Tang CSC 545 - Graduate Lecture

A Practical Problem Workers: A, B, C, D Jobs: P, Q, R, S. Cost matrix: Given: each worker need perform only one job and each job need be assigned to only one worker. Question: how to assign the jobs to the workers to minimize the cost? Job P Job Q Job R Job S Worker A 1 2 3 4 Worker B 6 8 Worker C 9 12 Worker D 16 2019/4/4 CSC 545 - Graduate Lecture

Assignment Problem Teachers vs. Courses Jobs vs. Machines …… Performance Maximize the total performance Jobs vs. Machines Time Minimize the total time …… Applications of assignment problems are varied in the real world. Certainly it can be useful for the classic task of assigning employees to tasks or machines to production jobs, but its uses are more widespread. It could be used to assign fleets of aircrafts to particular trips, or assigning school buses to routes, or networking computers. In rare cases, it can even be used to determine marriage partners! 2019/4/4 CSC 545 - Graduate Lecture CSC 545 - Graduate Lecture

Formulation of Assignment Problem Consider m workers to whom n jobs are assigned. The cost of assigning worker i to job j is cij. Let xij = 0 , if job j is not assigned to worker i 1 , if job j is assigned to worker i 2019/4/4 CSC 545 - Graduate Lecture

Formulation of Assignment Problem Objective function: Constraints: m Each worker is assigned one job Each job is assigned one worker 2019/4/4 CSC 545 - Graduate Lecture

Solution of Assignment Problem Brute-force method Enumerate all candidates sets n! possible assignment sets Exponential runtime complexity 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. 4! = 24 10! = 3,628,800 100! ≈ 9.3 ×10157 2019/4/4 CSC 545 - Graduate Lecture CSC 545 - Graduate Lecture

Solution of Assignment Problem Simplex method Is it feasible to solve AP? Yes. [The Integrality Theorem] If a transshipment problem: minimize cx subject to Ax=b, x≥0, such that all the components of b are integers, has at least one feasible solution, then it has an integer-valued feasible solution; if it has an optimal solution, then it has an integer-valued optimal solution. 2019/4/4 CSC 545 - Graduate Lecture

Solution of Assignment Problem Simplex method More variables (an n assignments needs n2 variables.) More slack variables result in a sparse dictionary matrix, which may lead to more iterations. Inefficient. 2019/4/4 CSC 545 - Graduate Lecture

Solution of Assignment Problem Network simplex method Tree based network optimization method Can apply to transshipment problem, maximum flows through networks Works well in practice for assignment problems. Is there any easier way to solve the assignment problem? 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Introduction A combinatorial optimization algorithm Based on two Hungarian mathematicians’ works Developed and published by Harold Kuhn, 1955 Polynomial runtime complexity [Wikipedia] O(n4), can be modified to O(n3) Much easier to implement There are various ways to solve assignment problems. Certainly it can be formulated as a linear program (as we saw above), and the simplex method can be used to solve it. In addition, since it can be formulated as a network problem, the network simplex method may solve it quickly. However, sometimes the simplex method is inefficient for assignment problems (particularly problems with a high degree of degeneracy). The Hungarian Algorithm developed by Kuhn ( computer algorithm provided by netlib) has been used with a good deal of success on these problems. In addition, there are various algorithms for network problems that may prove efficient. As a side note, neural networks have also been used to solve the assignment problem. Although these have not proven as computationally efficient as the simplex approach yet, they provide an interesting contrast. (See Wolfe and Wang in the References section.) 2019/4/4 CSC 545 - Graduate Lecture CSC 545 - Graduate Lecture

Hungarian Method Process (1/5) Assume the cost matrix For each row, subtract the minimum number in that row from all numbers in that row; do the same for each column. [Network optimization: Theorem 2.9] There exists an optimal solution, when # of assignments = minimum # of lines required to cover all 0s. 2 1 c’ = 3 6 5 6 7 c = 4 3 2 8 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Process(2/5) How can we find the optimal solution? One efficient way in [Network optimization] (a) Locate a row/column in c’ with exactly one 0, circle it and draw a vertical/horizontal line through it. If no such row/column exists, locate a row/column with the smallest number of 0s. (b) Repeat (a) till every 0 in the matrix has at least one line through it. (c) If # of lines equal to n, the circled 0s show the optimal solution. Apply it to c’. 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Process(3/5) Why is it optimal? [Network optimization: Theorem 2.17] Suppose c is the cost matrix and c’ is the matrix obtained by adding a number t to each element in the ith row or to each element in the ith column. Then a solution is optimal with respect to c’ if and only if it is optimal with respect to c. 2 1 c’ = 3 6 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Process(4/5) Is that all? No. No matching can result in 0 total cost. Remember: (c) If # of lines equals to n, we find the optimal solution. Then what if # of lines is not equal to n? 3 2 1 c’ = 4 6 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Process(5/5) 3 2 1 c’ = 4 6 Modify c’ further: Subtract the smallest uncovered element from each uncovered element and add it to each doubly covered element. Check the solution. 2 c’’= 1 4 5 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method the Whole Course 1. Given the cost matrix c (n×n), get modified c’: (a) For each row, subtract the minimum number in that row from all numbers in that row (b) Do the same for each column. 2. Check if there exists an optimal solution: (a) Locate a row/column in modified matrix with exactly one 0, circle it and draw a vertical/horizontal line through it. If no such row/column exists, locate a row/column with the smallest number of 0s. (b) Repeat (a) until every 0 in the matrix has at least one line through it. (c) If # of lines = n, the circled 0s show the optimal solution, end; if not, go to step 3. 3. Further modify c’: (a) Subtract the smallest uncovered element from each uncovered element and add it to each doubly covered element. (b) Repeat step 2. 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method Special Considerations Hungarian method requires # of rows = # of columns. What if not? Considering a case like assigning workers to jobs, what if worker i cannot do job j ? Maximization objective, such as maximize the profits. Solutions: Add dummy rows/columns with 0 assignment costs Assign cij = +M Create a loss matrix 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (1/7) Teachers: A, B, C, D; Courses: P, Q, R Teachers’ performance matrix Assign courses to teachers to maximize the sums of their performance. P Q R A 90 76 67 B 68 70 69 C 75 72 71 D 65 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (2/7) Transfer Maximum to Minimum: Create the loss matrix: subtract each score in each column from the highest score in that column. Add a dummy column with 0 score loss. P Q R A 4 B 22 6 2 C 15 D 21 11 P Q R S A 4 B 22 6 2 C 15 D 21 11 Cost matrix c 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (3/7) Step 1. Given the cost matrix c, get modified c’ 4 c = 22 6 2 15 21 11 4 c’= 22 6 2 15 21 11 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (4/7) Step 2. check if there exists an optimal solution # of lines ≠ 4, go to step 3. 4 c’= 22 6 2 15 21 11 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (5/7) Step 3. Further modify c’ # of lines ≠ 4, continue step 3. 4 c’= 22 6 2 15 21 11 8 4 c’’= 18 2 11 17 7 6 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (6/7) Step 3. Further modify c’’ # of lines = 4, get the optimal solution. 8 4 c’’= 18 2 11 17 7 6 8 6 c’’’= 16 11 2 15 5 4 2019/4/4 CSC 545 - Graduate Lecture

Hungarian Method an Example (7/7) The optimal solution Assignment: A—P, B—R, C—Q or A—P, B—Q, C—R Maximum score: Z = 90 +69 +72 = 90 +70 +71 = 231 8 6 c’’’= 16 11 2 15 5 4 2019/4/4 CSC 545 - Graduate Lecture

Tools for AP & LP A Parametric Visualization Software for the Assignment problem. University of Macedonia, Greece. (http://users.uom.gr/~samaras/gr/yujor/yujor.htm ) LINGO: a comprehensive tool designed to help you build and solve linear, optimization models quickly, easily, and efficiently. ( http://www.lindo.com/ ) MATLAB: linprog function for general LP; Toolbox YALMIP for (mixed) integer LP. …… 2019/4/4 CSC 545 - Graduate Lecture

Thanks for Your Attention. Assignment Problems Guoming Tang