710 likes | 760 Views
Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs.Pramela Devi, Mrs.Sindhuja.K Mrs.Annapoorani Department:CSE. UNIT 6: Transportation and Assignment Problems. 1.The transportation problem 2.A streamlined simplex method for the transportation problem
E N D
Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs.Pramela Devi, Mrs.Sindhuja.K Mrs.Annapoorani Department:CSE
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.
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.
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)
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).
D1 D2 D3 Supply 30 20 15 S1 50 30 40 35 S2 30 Demand 25 45 10 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.
Problem formulation • 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
Transportation Problem • The transportation problem is solved in two phases: • Phase I -- Obtaining an initial feasible solution • Phase II -- Moving toward optimality • 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. • 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.
Initial Tableau • There are many method for finding the initial tableau for the transportation problem which are: • Northwest corner • Vogle’s approximation method • Russell’s approximation method
D1 D2 D3 Supply 25 25 30 20 15 S1 50 30 20 40 10 35 S2 30 Demand 25 45 10 Northwest corner • 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).
Northwest corner method Steps: • assign largest possible allocation to the cell in the upper left-hand corner of the tableau • Repeat step 1 until all allocations have been assigned • Stop. Initial tableau is obtained
Northwest-Corner Rule • Assign 100 tubs from Des Moines to Albuquerque (exhausting Des Moines’s supply) • Assign 200 tubs from Evansville to Albuquerque (exhausting Albuquerque’s demand) • Assign 100 tubs from Evansville to Boston (exhausting Evansville’s supply) • Assign 100 tubs from Fort Lauderdale to Boston (exhausting Boston’s demand) • Assign 200 tubs from Fort Lauderdale to Cleveland (exhausting Cleveland’s demand and Fort Lauderdale’s supply)
To (A) Albuquerque (B) Boston (C) Cleveland Factory capacity From $5 $4 $3 100 100 (D) Des Moines $8 $4 $3 200 100 300 (E) Evansville $9 $7 $5 100 200 300 (F) Fort Lauderdale Warehouse requirement 300 200 200 700 • Means that the firm is shipping 100 bathtubs from Fort Lauderdale to Boston Northwest-Corner Rule
Vogel’s approximation method • Operational steps: • Step 1: for each column and row, determine its • penalty cost by subtracting their two of their • least cost • Step 2: select row/column that has the highest penalty cost • in step 1 • Step 3: assign as much as allocation to the • selected row/column that has the least cost • Step 4: Block those cells that cannot be further allocated • Step 5: Repeat above steps until all allocations have been • assigned (to p17)
subtracting their two of their least cost Step 1 (8-6) (11-7) (5-4) (6-4) (8-5) (11-10)
Steps 2 & 3 Step 2: Highest penalty cost Step 3: this has the least cost
Step 4 --- ---
Step 5Second Iteration --- --- ---
3rd Iteration of VAM --- --- (to p22) --- ---
Optimal solution? • Initial solution from: • Northeast cost, total cost =$5,925 • The min cost, total cost =$4,550 • VAM, total cost = $5,125 • It shows that the second one has the min cost, but is it the optimal solution?
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.
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.
Step 4: Examine the matrix of cell evaluation dij for negativeentries 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 alternatesolution 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.
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.
Assignment Problem Network Representation • c11 1 1 • c12 • c13 • c21 2 2 • c22 • c23 • c32 • c31 3 3 • c33 • WORKERS • JOBS
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.
Optimization Methods: M4L3 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
Optimization Methods: M4L3 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
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.
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.
Optimization Methods: M4L3 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.
Optimization Methods: M4L3 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 or m > n, respectively • Cost coefficient cij for this dummy will be zero.
Formulation of Assignment Problem …contd. • Let xij be the decision variable • The objective function is
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.
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)?
Example: Hungry Owner • Network Representation 50 West. A 36 16 28 Fed. B 30 18 32 35 Gol. C 20 25 25 Univ. 14
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)
Example: Hungry Owner • LP Formulation • Objective Function • Minimize total distance: • Min 50x11 + 36x12 + 16x13 + 28x21 + 30x22 + 18x23 • + 35x31 + 32x32 + 20x33 + 25x41 + 25x42 + 14x43
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)
Example: Hungry Owner • Optimal Assignment • Subcontractor Project Distance • Westside C 16 • Federated A 28 • Universal B 25 • Goliath (unassigned) • Total Distance = 69 miles
Variations of Assignment Problem • Total number of agents not equal to total number of tasks • Maximization objective function • Unacceptable assignments
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
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.
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.
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?
Example: Hungry Owner • Network Representation (note the dummy project) 50 West. A 36 16 0 28 Fed. B 30 18 0 Projects Subcontractors 32 35 Gol. C 20 0 25 25 Univ. Dum. 14 0
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
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
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).