You are on page 1of 32

The Assignment Problem

The Assignment Problem

In many business situations, management needs to assign - personnel to jobs, - jobs to machines, machines to job locations, or - salespersons to territories. Consider the situation of assigning n jobs to n machines. When a job i (=1,2,....,n) is assigned to machine j (=1,2, .....n) that incurs a cost Cij. The objective is to assign the jobs to machines at the least possible total cost.

The Assignment Problem

This situation is a special case of the Transportation Model And it is known as the assignment problem. Here, jobs represent sources and machines represent destinations. The supply available at each source is 1 unit And demand at each destination is 1 unit.

The Assignment Problem

The assignment model can be expressed mathematically as follows: Xij= 0, if the job j is not assigned to machine i 1, if the job j is assigned to machine i

The Assignment Problem

The Assignment Problem Example

Ballston Electronics manufactures small electrical devices. Products are manufactured on five different assembly lines (1,2,3,4,5). When manufacturing is finished, products are transported from the assembly lines to one of the five different inspection areas (A,B,C,D,E). Transporting products from five assembly lines to five inspection areas requires different times (in minutes)

The Assignment Problem Example

Under current arrangement, assignment of inspection areas to the assembly lines are 1 to A, 2 to B, 3 to C, 4 to D, and 5 to E. This arrangement requires 10+7+12+17+19 = 65 man minutes.

The Assignment Problem Example

Management would like to determine whether some other assignment of production lines to inspection areas may result in less cost. This is a typical assignment problem. n = 5 And each assembly line is assigned to each inspection area. It would be easy to solve such a problem when n is 5, but when n is large all possible alternative solutions are n!, this becomes a hard problem.

The Assignment Problem Example

Assignment problem can be either formulated as a linear programming model, or it can be formulated as a transportation model. However, An algorithm known as Hungarian Method has proven to be a quick and efficient way to solve such problems. This technique is programmed into many computer modules such as the one in WINQSB.

The Assignment Problem Example


WINQSB solution for this problem is as follows:

Hungarian Method Example

Step 1: Select the smallest value in each row. Subtract this value from each value in that row Step 2: Do the same for the columns that do not have any zero value.

Hungarian Method Example

If not finished, continue with other columns.

Hungarian Method Example


Step 3: Assignments are made at zero values. Therefore, we assign job 1 to machine 1; job 2 to machine 3, and job 3 to machine 2. Total cost is 5+12+13 = 30. It is not always possible to obtain a feasible assignment as in here.

Hungarian Method Example 2

Hungarian Method Example 2

A feasible assignment is not possible at this moment. In such a case, The procedure is to draw a minimum number of lines through some of the rows and columns, Such that all zero values are crossed out.

Hungarian Method Example 2

The next step is to select the smallest uncrossed out element. This element is subtracted from every uncrossed out element and added to every element at the intersection of two lines.

Hungarian Method Example 2

We can now easily assign to the zero values. Solution is to assign (1 to 1), (2 to 3), (3 to 2) and (4 to 4). If drawing lines do not provide an easy solution, then we should perform the task of drwaing lines one more time. Actually, we should continue drawing lines until a feasible assignment is possible.

The Traveling Salesman Problem


In the traveling salesman problem, there are m locations (or nodes) And unit costs (Cij) are associated with traveling between locations i and j. The goal is to find the cycle that minimizes the total (traveling) distance required to visit all locations (nodes) without visiting any location twice. The Traveling salesman begins its journey from his/her home city And visits other cities (in no particular order) before returning home.

The Traveling Salesman Problem


Example: Emergency management set up a home office at Northridge in response to an Earthquake in California. The director is responsible for visiting each of 4 local offices and return to home office to file his reports.

The Traveling Salesman Problem


Following table gives estimated travel times between each pair of offices (in minutes)

The Traveling Salesman Problem

The director wishes to visit each local office and return to home office in the shortest time. This is a Symmetric traveling salesman problem Because the travel time between each pair of offices is the same in either direction.

The Traveling Salesman Problem


Network representation of the problem

The Traveling Salesman Problem


Cycle 1. H-O1-O2-O3-O4-H 2. H-O1-O2-O4-O3-H 3. H-O1-O3-O2-O4-H 4. H-O1-O3-O4-O2-H 5. H-O1-O4-O2-O3-H 6. H-O1-O4-O3-O2-H 7. H-O2-O3-O1-O4-H 8. H-O2-O1-O3-O4-H 9. H-O2-O4-O1-O3-H 10. H-O2-O1-O4-O3-H 11. H-O3-O1-O2-O4-H 12. H-O3-O2-O1-O4-H Total Cost (distance in minutes) 210 195 The shortest cycle 240 200 A problem with m nodes 225 (locations) has (m-1)! Possible 200 cycles. 265 235 For symmetric problems, this 250 number is divided by 2. 220 260 260

The Traveling Salesman Problem


Here, there are 5 nodes, m=5, therefore there are (5-1)! / 2= 4! / 2 = 12 possible cycles for this problem. As the table indicates, the optimal cycle is H-O1-O2O4-O3-H with a traveling time of 195 minutes. Of course, This trial approach can only be used for small problems. For example, the number of possible cycles is 181,440 for a problem with 10 nodes. For a problem with 15 nodes, it is 840 trillion. (A typical NP hard problem)

The Traveling Salesman Problem

Basically, the traveling salesman problem can be considered as being similar to the Assignment Problem. Each node is assigned to another, and there is only 1 assignment for each node.

The Traveling Salesman Problem

However, when solved in this way, instead of resulting in a Single Cycle, the solution is in the form of separated cycles. The optimum result is two cycles: (H-O2-O1-H) and (O3-O4-O3)

The Traveling Salesman Problem

However, as we said before, using this assignment approach alone Will result in separate cycles. To prevent separate cycles, additional constraints must be added to the model given above.

The Traveling Salesman Problem

For example, to state that the sub-cycle (H-O2-O1-H) is not feasible, the single connections of (H-O2); (O2-O1) and (O1-H) are not allowed to enter the solution at the same time. If we give the index number 5 for the Home office, the following constraint makes sure that the sub-cycle of (H-O2-O1-H) is not feasible: X52 + X21 + X15 2 (because this sub-cycle can only be feasible if X52, X21, and X15 are all equal to 1 at the same time. This constraint makes this occasion impossible)

The Traveling Salesman Problem


As another example, to state that sub-cycle of (O1-O2O3-O4-O1) is not feasible: X12 + X23 + X34 + X41 3 To develop the LP model for traveling salesman problem, all possible unfeasible sub-cycles should be eliminated by employing additional constraints in the similar manner. For our example problem we should add the following constraints, accordingly: For single node sub-cycles: X11 0, X22 0, X33 0, X44 0, X55 0.

The Traveling Salesman Problem


For two node sub-cycles: X12 + X21 1 X13 + X31 1 X14 + X41 1 X15 + X51 1 X23 + X32 1 X24 + X42 1 X25 + X52 1 X34 + X43 1 X35 + X53 1 X45 + X54 1 For three node sub-cycles: X12 + X23 + X31 2 X12 + X24 + X41 2 X12 + X25 + X51 2 X13 + X34 + X41 2 X13 + X35 + X51 2 X14 + X45 + X51 2 X23 + X34 + X42 2 X23 + X35 + X52 2 X24 + X45 + X52 2 X34 + X45 + X53 2

The Traveling Salesman Problem


For four node sub-cycles: X12 + X23 + X34 + X41 3 X12 + X23 + X35 + X51 3 X12 + X24 + X45 + X51 3 X13 + X34 + X45 + X51 3 X23 + X34 + X45 + X51 3

The Traveling Salesman Problem

The WinQSB software can solve traveling salesman problems that have relatively few nodes (< 10). It uses assignment and Branch and Bound approaches in combination. To solve this problem, we may use the Network Modeling Module of WinQSB. Its result is the same: That is 195 minutes with the cycle of (H-O1-O2-O4-O3-H)

You might also like