Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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

2 2 2 Slide UNIT 6: Transportation and Assignment Problems 1.The transportation problem 2.A streamlined simplex method for the transportation problem 3.The assignment problem 4.A special algorithm for the assignment problem.

3 3 3 Slide Transportation Problem The transportation problem seeks to minimize the total shipping costs of transporting goods from m origins or sources (each with a supply si) to n destinations (each with a demand dj), when the unit shipping cost from source, i, to a destination, j, is cij.

4 4 4 Slide Transportation Problem LP Formulation The linear programming formulation in terms of the amounts shipped from the sources to the destinations, xij, can be written as: m n Min z=∑ ∑ cijxij (total transportation cost) i=0 j=0 s.t. ∑xij = si for each source i (supply constraints) j ∑xij = dj for each destination j (demand constraints) i xij > 0 for all i and j (nonnegativity constraints)

5 5 5 Slide Transportation Problem To solve the transportation problem by its special purpose algorithm, it is required that the sum of the supplies at the sources equal the sum of the demands at the destinations. If the total supply is greater than the total demand, a dummy destination is added with demand equal to the excess supply, and shipping costs from all sources are zero. Similarly, if total supply is less than total demand, a dummy source is added. When solving a transportation problem by its special purpose algorithm, unacceptable shipping routes are given a cost of +M (a large number).

6 6 6 Slide Transportation Problem A transportation tableau is given below. Each cell represents a shipping route (which is an arc on the network and a decision variable in the LP formulation), and the unit shipping costs are given in an upper right hand box in the cell. Supply 30 50 35 20 40 30 30 Demand104525 S1 S2 D3D2D115

7 7 7 Slide Problem formulation n n The LP model for this problem is as follows: Min Z = 15 X11 + 30 X12 + 20 X13 + 30 X21 + 40X22 + 35X23 S.t. X11 + X12 + X13 ≤ 50 Supply constraints X21 + X22 + X23 ≤ 30 X11 + X21 = 25 X12 + X22 = 45 X13 + X23 = 10 demand constraints X11, …, X23  0

8 8 8 Slide Transportation Problem n n The transportation problem is solved in two phases: Phase I -- Obtaining an initial feasible solution Phase II -- Moving toward optimality n n In Phase I, the Minimum-Cost Procedure can be used to establish an initial basic feasible solution without doing numerous iterations of the simplex method. n n In Phase II, the Stepping Stone, by using the MODI method for evaluating the reduced costs may be used to move from the initial feasible solution to the optimal one.

9 9 9 Slide Initial Tableau n n There are many method for finding the initial tableau for the transportation problem which are: 1. 1. Northwest corner 2. 2. Vogle’s approximation method 3. 3. Russell’s approximation method

10 10 Slide Northwest corner n n Northwest corner: Begin by selecting X11 (that is, start in the northwest corner of the transportation tableau). Therefore, if Xij was the last basic variable (occupied cell) selected, then select Xij+1 (that is, move one column to the right) if source I has any supply remaining. Otherwise, next select Xi+1 j (that is, move one row down). Supply 30 50 25 20 10 35 20 40 30 30 Demand104525 S1 S2 D3D2D115

11 11 Slide 11 Northwest corner method Steps: 1. 1. assign largest possible allocation to the cell in the upper left-hand corner of the tableau 2. 2. Repeat step 1 until all allocations have been assigned 3. 3. Stop. Initial tableau is obtained

12 12 Slide Northwest-Corner Rule 1. Assign 100 tubs from Des Moines to Albuquerque (exhausting Des Moines’s supply) 1. Assign 200 tubs from Evansville to Albuquerque (exhausting Albuquerque’s demand) 2. Assign 100 tubs from Evansville to Boston (exhausting Evansville’s supply) 3. Assign 100 tubs from Fort Lauderdale to Boston (exhausting Boston’s demand) 4. Assign 200 tubs from Fort Lauderdale to Cleveland (exhausting Cleveland’s demand and Fort Lauderdale’s supply)

13 13 Slide To (A) Albuquerque (B) Boston (C) Cleveland (D) Des Moines (E) Evansville (F) Fort Lauderdale Warehouse requirement 300200 Factory capacity 300 100 700 $5 $4 $3 $9 $8 $7 From Northwest-Corner Rule 100 200 1. Means that the firm is shipping 100 bathtubs from Fort Lauderdale to Boston

14 14 Slide 14 Vogel’s approximation method 1. 1. Operational steps: 2. 2. Step 1: for each column and row, determine its 3. 3. penalty cost by subtracting their two of their 4. 4. least cost 5. 5. Step 2: select row/column that has the highest penalty cost 6. 6. in step 1 7. 7. Step 3: assign as much as allocation to the 8. 8. selected row/column that has the least cost 9. 9. Step 4: Block those cells that cannot be further allocated 10. 10. Step 5: Repeat above steps until all allocations have been 11. 11. assigned (to p17)

15 15 Slide subtracting their two of their least cost Step 1 (8-6) (11-7) (5-4) (6-4) (8-5) (11-10)

16 16 Slide Steps 2 & 3 Highest penalty cost Step 2: Step 3: this has the least cost

17 17 Slide Step 4 ---

18 18 Slide Step 5 Second Iteration ---

19 19 Slide 3rd Iteration of VAM --- (to p22)

20 20 Slide 1. 1. Initial tableau for VAM

21 21 Slide 21 Optimal solution? 1. 1. Initial solution from: 2. 2. Northeast cost, total cost =$5,925 3. 3. The min cost, total cost =$4,550 4. 4. VAM, total cost = $5,1255. 6. 6. It shows that the second one has the min cost, but is it the optimal solution?

22 22 Slide Optimality Test: Once an initial solution is obtained, the next step is to check its optimality. An optimal solution is one where there is no other set of transportation routes (allocations) that will further reduce the total transportation cost. Thus, we have to evaluate each un-occupied cell in the transportation table in terms of an opportunity of reducing total transportation cost. If we have a B.F.S. consisting of (m+ n–1) independent positive allocations and a set of arbitrary number ui and vj (i=1,2,...m; j=1,2,...n) such that cij = ui+vj for all occupied cells (i, j) then the evaluation dij corresponding to each empty cell (i, j) is given by : dij = cij – (ui+ vj) This evaluation is also called the opportunity cost for un-occupied cells.

23 23 Slide u-v Method Step 1: Start with B.F.S. consisting of (m+ n–1) allocations in independent positions. Step 2: Determine a set of m+n numbers ui (i=1,2,....m) and vj (j=1,2,...n) for all the rows and columns such that for each occupied cell (i,j), the following condition is satisfied : cij = ui+vj Step 3: Calculate cell evaluations (opportunity cost) dij for each empty cell (i,j) by using the formula : dij = cij – ( ui+vj ) for all i & j.

24 24 Slide Step 4: Examine the matrix of cell evaluation dij for negative entries and conclude that (i) If all dij > 0, then solution is optimal and unique. (ii)If at least one dij = 0, then solution is optimal and alternate solution also exists. (iii)If at least one dij < 0,then solution is not optimal and an improved solution can be obtained. In this case, the un-occupied cell with the largest negative value of dij is considered for the new transportation schedule. Step 5: Construct a closed path (loop) for the unoccupied cell having largest negative opportunity cost. Mark a (+) sign in this cell and move along the rows (or columns) to find an occupied cell. Mark a (-) sign in this cell and find out another occupied cell. Repeat the process and mark the occupied cells with (+) and (-) signs alternatively. Close the path back to the selected unoccupied cell.

25 25 Slide Step 6: Select the smallest quantity amongst the cells marked with (-) sign. Allocate this value to the unoccupied cell of the loop and add and subtract it in the occupied cells as per their signs. Thus an improved solution is obtained by calculating the total transportation cost by this method. Step 7: Test the revised solution further for optimality. The procedure terminates when all dij ≥ 0, for unoccupied cells.

26 26 Slide Assignment Problem Network Representation 22 33 11 22 33 11 c11 c12 c13 c21 c22 c23 c31 c32 c33 WORKERSJOBS

27 27 Slide Assignment Problem 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 cij. It assumes all workers are assigned and each job is performed. 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. The network representation of an assignment problem with three workers and three jobs is shown on the next slide.

28 28 Slide D Nagesh Kumar, IISc Optimization Methods: M4L3 28 Introduction Assignment problem is a particular class of transportation linear programming problems Supplies and demands will be integers (often 1) Traveling salesman problem is a special type of assignment problem

29 29 Slide D Nagesh Kumar, IISc Optimization Methods: M4L3 29 Objectives To structure and formulate a basic assignment problem To demonstrate the formulation and solution with a numerical example To formulate and solve traveling salesman problem as an assignment problem

30 30 Slide 30 Structure of Assignment Problem Assignment problem is a special type of transportation problem in which Number of supply and demand nodes are equal. Supply from every supply node is one. Every demand node has a demand for one. Solution is required to be all integers.

31 31 Slide 31 Structure of Assignment Problem …contd. Goal of an general assignment problem: Find an optimal assignment of machines (laborers) to jobs without assigning an agent more than once and ensuring that all jobs are completed The objective might be to minimize the total time to complete a set of jobs, or to maximize skill ratings, maximize the total satisfaction of the group or to minimize the cost of the assignments This is subjected to the following requirements: Each machine is assigned no more than one job. Each job is assigned to exactly one machine.

32 32 Slide D Nagesh Kumar, IISc Optimization Methods: M4L3 32 Formulation of Assignment Problem Consider m laborers to whom n tasks are assigned No laborer can either sit idle or do more than one task Every pair of person and assigned work has a rating Rating may be cost, satisfaction, penalty involved or time taken to finish the job N2 such combinations of persons and jobs assigned Optimization problem: Find such job-man combinations that optimize the sum of ratings among all.

33 33 Slide D Nagesh Kumar, IISc Optimization Methods: M4L3 33 Formulation of Assignment Problem …contd. Representation of this problem as a special case of transportation problem laborers as sources tasks as destinations Supply available at each source is 1 Demand required at each destination is 1 Cost of assigning (transporting) laborer i to task j is cij. It is necessary to first balance this problem by adding a dummy laborer or task depending on whether m n, respectively Cost coefficient cij for this dummy will be zero.

34 34 Slide 34 Formulation of Assignment Problem …contd. Let xij be the decision variable The objective function is

35 35 Slide 35 Formulation of Assignment Problem …contd. Since each task is assigned to exactly one laborer and each laborer is assigned only one job, the constraints are Due to the special structure of the assignment problem, the solution can be found out using a more convenient method called Hungarian method.

36 36 Slide Example: Hungry Owner 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 A B C Westside 50 36 16 Subcontractors Federated 28 30 18 Goliath 35 32 20 Universal 25 25 14 How should the contractors be assigned to minimize total distance (and total cost)?

37 37 Slide Example: Hungry Owner n Network Representation 50 36 16 28 30 18 35 32 20 25 25 14 West.West. CC BB AA Univ.Univ. Gol.Gol. Fed.Fed.

38 38 Slide Example: Hungry Owner LP Formulation Decision Variables Defined xij = 1 if subcontractor i is assigned to project j = 0 otherwise where: i = 1 (Westside), 2 (Federated), 3 (Goliath), and 4 (Universal) j = 1 (A), 2 (B), and 3 (C)

39 39 Slide Example: Hungry Owner LP Formulation Objective Function Minimize total distance: Min 50x11 + 36x12 + 16x13 + 28x21 + 30x22 + 18x23 + 35x31 + 32x32 + 20x33 + 25x41 + 25x42 + 14x43

40 40 Slide Example: Hungry Owner LP Formulation Constraints x11 + x12 + x13 < 1 (no more than one x21 + x22 + x23 < 1 project assigned x31 + x32 + x33 < 1 to any one x41 + x42 + x43 < 1 subcontractor) x11 + x21 + x31 + x41 = 1 (each project must x12 + x22 + x32 + x42 = 1 be assigned to just x13 + x23 + x33 + x43 = 1 one subcontractor) all xij > 0 (non- negativity)

41 41 Slide Example: Hungry Owner Optimal Assignment Subcontractor Project Distance Westside C 16 Federated A 28 Universal B 25 Goliath (unassigned) Total Distance = 69 miles

42 42 Slide Variations of Assignment Problem Total number of agents not equal to total number of tasks Maximization objective function Unacceptable assignments

43 43 Slide Hungarian Method The Hungarian method solves minimization assignment problems with m workers and m jobs. Special considerations can include: number of workers does not equal the number of jobs -- add dummy workers or jobs with 0 assignment costs as needed worker i cannot do job j -- assign cij = +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 method

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

45 45 Slide Hungarian Method 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 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.

46 46 Slide Example: Hungry Owner 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. Projects A B C Westside 50 36 16 Subcontractors Federated 28 30 18 Goliath 35 32 20 Universal 25 25 14 How should the contractors be assigned to minimize total costs?

47 47 Slide Example: Hungry Owner n Network Representation (note the dummy project) 50 36 16 0 28 30 18 0 35 32 20 0 25 25 14 0 West.West. Dum.Dum. CC BB AA Univ.Univ. Gol.Gol. Fed.Fed. Projects Subcontractors

48 48 Slide Example: Hungry Owner 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: A B C Dummy Westside 50 36 16 0 Federated 28 30 18 0 Goliath 35 32 20 0 Universal 25 25 14 0

49 49 Slide Example: Hungry Owner Step 1: Subtract minimum number in each row from all numbers in that row. Since each row has a zero, we would simply generate the same matrix above. 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 Westside 25 11 2 0 Federated 3 5 4 0 Goliath 10 7 6 0 Universal 0 0 0 0

50 50 Slide Example: Hungry Owner Step 3: Draw the minimum number of lines to cover all zeroes. 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. A B C Dummy Westside 25 11 2 0 Federated 3 5 4 0 Goliath 10 7 6 0 Universal 0 0 0 0 Step 4: The minimum uncovered number is 2 (circled).

51 51 Slide Example: Hungry Owner Step 5: Subtract 2 from uncovered numbers; add 2 to all numbers covered by two lines. This gives: A B C Dummy Westside23 9 0 0 Federated 1 3 2 0 Goliath 8 5 4 0 Universal 0 0 0 2

52 52 Slide Example: Hungry Owner Step 3: Draw the minimum number of lines to cover all zeroes. A B C Dummy Westside 23 9 0 0 Federated 1 3 2 0 Goliath 8 5 4 0 Universal 0 0 0 2 Step 4: The minimum uncovered number is 1 (circled).

53 53 Slide Example: Hungry Owner Step 5: Subtract 1 from uncovered numbers. Add 1 to numbers covered by two lines. This gives: A B C Dummy Westside 23 9 0 1 Federated 0 2 1 0 Goliath 7 4 3 0 Universal 0 0 0 3

54 54 Slide 54 Example (1) Consider three jobs to be assigned to three machines. The cost for each combination is shown in the table below. Determine the minimal job – machine combinations

55 55 Slide 55 Example (1)… contd. Solution: Step 1: Create zero elements in the cost matrix (zero assignment) by subtracting the smallest element in each row (column) from the corresponding row (column). Considering the rows first, the resulting cost matrix is obtained by subtracting 5 from row 1, 10 from row 2 and 13 from row 3

56 56 Slide 56 Example (1)… contd. Step 2: Repeating the same with columns, the final cost matrix is The italicized zero elements represent a feasible solution Thus the optimal assignment is (1,1), (2,3) and (3,2) The total cost is equal to (5 +12+13) = 60

57 57 Slide 57 Example (2) In the above example, it was possible to obtain the feasible assignment But in more complicate problems, additional rules are required which are explained in the next example. Example 2 (Taha, 1982) Consider four jobs to be assigned to four machines. Determine the minimal job – machine combinations.

58 58 Slide 58 Example (2) …contd.  The cost for each combination is shown in the table below

59 59 Slide 59 Example (2) …contd. Solution: Step 1: Create zero elements in the cost matrix by subtracting the smallest element in each row from the corresponding row.

60 60 Slide 60 Example (2) …contd. Step 2: Repeating the same with columns, the final cost matrix is Rows 1 and 3 have only one zero element Both of these are in column 1, which means that both jobs 1 and 3 should be assigned to machine 1

61 61 Slide 61 Example (2) …contd. As one machine can be assigned with only one job, a feasible assignment to the zero elements is not as in the previous example Step 3: Draw a minimum number of lines through some of the rows and columns so that all the zeros are crossed out

62 62 Slide 62 Example (2) …contd. Step 4: Select the smallest uncrossed element (which is 1 here). Subtract it from every uncrossed element and also add it to every element at the intersection of the two lines. This will give the following table

63 63 Slide 63 Example (2) …contd. This gives a feasible assignment (1,1), (2,3), (3,2) and (4,4) And the total cost is 1+10+5+5 = 21. If the optimal solution had not been obtained in the last step, then the procedure of drawing lines has to be repeated until a feasible solution is achieved.

64 64 Slide 64 Formulation of Traveling Salesman Problem (TSP) as an Assignment Problem A traveling salesman has to visit n cities and return to the starting point He has to start from any one city and visit each city only once. Suppose he starts from the kth city and the last city he visited is m Let the cost of travel from ith city to jth city be cij. Then the objective function is

65 65 Slide 65 Formulation of Traveling Salesman Problem (TSP) as an Assignment Problem …contd. subject to the constraints Solution Procedure: Solve the problem as an assignment problem using the method used to solve the above examples If the solutions thus found out are cyclic in nature, then that is the final solution

66 66 Slide 66 Formulation of Traveling Salesman Problem (TSP) as an Assignment Problem …contd. Solution Procedure …contd. If it is not cyclic, then select the lowest entry in the table (other than zero) Delete the row and column of this lowest entry and again do the zero assignment in the remaining matrix Check whether cyclic assignment is available If not, include the next higher entry in the table and the procedure is repeated until a cyclic assignment is obtained.

67 67 Slide 67 Traveling Salesman Problem (TSP) - Example Consider a four city TSP for which the cost between the city pairs are as shown in the figure below. Find the tour of the salesman so that the cost of travel is minimal. Cost matrix

68 68 Slide 68 Traveling Salesman Problem (TSP) – Example …contd. Solution: Step 1: The optimal solution after using the Hungarian method is shown below. The optimal assignment is 1→ 4, 2→ 3, 3→ 2, 4→ 1 which is not cyclic

69 69 Slide 69 Traveling Salesman Problem (TSP) – Example …contd. Step 2: Consider the lowest entry ‘2’ of the cell (2,1) If there is a tie in selecting the lowest entry, then break the tie arbitrarily Delete the 2nd row and 1st column Do the zero assignment in the remaining matrix

70 70 Slide 70 Traveling Salesman Problem (TSP) – Example …contd. The resulting table is Next optimal assignment is 1→ 4, 2→1, 3→ 2, 4→ 3 which is cyclic Required tour is 1→ 4→3→ 2→ 1 Optimal total travel cost is 5 + 9 + 4 + 6 = 24


Download ppt "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."

Similar presentations


Ads by Google