Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri 1 Chapter 6, Part A Distribution and Network Models Transportation Problem • Network Representation • General LP Formulation Assignment Problem • Network Representation • General LP Formulation Transshipment Problem • Network Representation • General LP Formulation 2 Transportation, Assignment, and Transshipment Problems A network model is one which can be represented by a set of nodes, a set of arcs, and functions (e.g. costs, supplies, demands, etc.) associated with the arcs and/or nodes. Transportation, assignment, transshipment, shortest-route, and maximal flow problems of this chapter as well as the minimal spanning tree and PERT/CPM problems (in others chapter) are all examples of network problems. 3 Transportation, Assignment, and Transshipment Problems Each of the five problems of this chapter can be formulated as linear programs and solved by general purpose linear programming codes. For each of the five problems, if the right-hand side of the linear programming formulations are all integers, the optimal solution will be in terms of integer values for the decision variables. However, there are many computer packages that contain separate computer codes for these problems which take advantage of their network structure. 4 Transportation Problem The transportation problem seeks to minimize the total shipping costs of transporting goods from m origins (each with a supply si) to n destinations (each with a demand dj), when the unit shipping cost from an origin, i, to a destination, j, is cij. The network representation for a transportation problem with two sources and three destinations is given on the next slide. 5 Transportation Problem Network Representation s1 s2 1 c11 Sources c23 d1 2 d2 3 d3 c12 c13 c21 2 1 c22 Destinations 6 Transportation Problem: Example #1 Acme Block Company has orders for 80 tons of concrete blocks at three suburban locations as follows: Northwood -- 25 tons, Westwood -- 45 tons, and Eastwood -- 10 tons. Acme has two plants, each of which can produce 50 tons per week. Delivery cost per ton from each plant to each suburban location is shown on the next slide. How should end of week shipments be made to fill the above orders? 7 Transportation Problem: Example #1 Delivery Cost Per Ton Plant 1 Plant 2 Northwood 24 30 Westwood 30 40 Eastwood 40 42 Decision Variables. the tons of concrete blocks, xij , to be shipped from source i to destination j. Plant 1 Plant 1 Northwood x11 x21 Westwood x12 x22 Eastwood x13 x23 8 Transportation Problem: Example #2 Define the Objective Function Minimize the total shipping cost. Min: (shipping cost per ton for each origin to destination) × (number of pounds shipped from each origin to each destination). Min: 24x11 + 30x12 + 40x13 + 30x21 + 40x22 + 42x23 9 Transportation Problem: Example #2 = Constraints Define the Constraints Supply constraints: (1) x11 + x12 + x13 = 50 (2) x21 + x22 + x23 = 50 Demand constraints: (4) x11 + x21 = 25 (5) x12 + x22 = 45 (6) x13 + x23 = 10 Non-negativity of variables: xij > 0, i = 1, 2 and j = 1, 2, 3 10 Transportation Problem: Example #2 ≤ and ≥ Constraints Define the Constraints Supply constraints: (1) x11 + x12 + x13 ≤ 50 (2) x21 + x22 + x23 ≤ 50 Demand constraints: (4) x11 + x21 ≥ 25 (5) x12 + x22 ≥ 45 (6) x13 + x23 ≥ 10 Non-negativity of variables: xij > 0, i = 1, 2 and j = 1, 2, 3 11 Transportation Problem: Example #1 Partial Spreadsheet Showing Problem Data A B C 1 2 3 4 D E F G H X22 X23 RHS LHSCoefficients Constraint X11 X12 X13 #1 1 1 1 #2 5 #3 6 #4 7 #5 8 Obj.Coefficients X21 50 1 1 1 1 1 30 1 40 30 50 25 1 24 1 40 45 1 10 42 30 12 Transportation Problem: Example #1 Cost Table Plant 1 Plant 2 Northwood Westwood Eastwood 24 30 40 30 40 42 ` Decision Variable Table RHS Northwood Westwood Eastwood LHS Plant 1 5 45 0 50 ≤ 50 Plant 2 20 0 10 30 ≤ 50 LHS 25 45 10 2490 ≥ ≥ ≥ RHS 25 45 10 13 Transportation Problem: Example #1 Sensitivity Report Variable Cells Cell $B$9 $C$9 $D$9 $B$10 $C$10 $D$10 Name Plant 1 Northwood Plant 1 Westwood Plant 1 Eastwood Plant 2 Northwood Plant 2 Westwood Plant 2 Eastwood Final Reduced Objective Allowable Allowable Value Cost Coefficient Increase Decrease 5 0 24 4 4 45 0 30 4 36 0 4 40 1E+30 4 20 0 30 4 4 0 4 40 1E+30 4 10 0 42 4 42 Constraints Cell $B$11 $C$11 $D$11 $E$9 $E$10 Name LHS Northwood LHS Westwood LHS Eastwood Plant 1 LHS Plant 2 LHS Final Shadow Constraint Allowable Allowable Value Price R.H. Side Increase Decrease 25 30 25 20 20 45 36 45 5 20 10 42 10 20 10 50 -6 50 20 5 30 0 50 1E+30 20 14 Transportation Problem: Example #2 The Navy has 9,000 pounds of material in Albany, Georgia that it wishes to ship to three installations: San Diego, Norfolk, and Pensacola. They require 4,000, 2,500, and 2,500 pounds, respectively. Government regulations require equal distribution of shipping among the three carriers. The shipping costs per pound for truck, railroad, and airplane transit are shown on the next slide. Formulate and solve a linear program to determine the shipping arrangements (mode, destination, and quantity) that will minimize the total shipping cost. 15 Transportation Problem: Example #2 Mode Truck Railroad Airplane Destination San Diego Norfolk Pensacola $12 20 30 $6 11 26 $5 9 28 16 Transportation Problem: Example #2 Define the Decision Variables We want to determine the pounds of material, xij , to be shipped by mode i to destination j. The following table summarizes the decision variables: Truck Railroad Airplane San Diego Norfolk Pensacola x11 x12 x13 x21 x22 x23 x31 x32 x33 17 Transportation Problem: Example #2 Define the Objective Function Minimize the total shipping cost. Min: (shipping cost per pound for each mode per destination pairing) x (number of pounds shipped by mode per destination pairing). Min: 12x11 + 6x12 + 5x13 + 20x21 + 11x22 + 9x23 + 30x31 + 26x32 + 28x33 18 Transportation Problem: Example #2 Define the Constraints Equal use of transportation modes: (1) x11 + x12 + x13 = 3000 (2) x21 + x22 + x23 = 3000 (3) x31 + x32 + x33 = 3000 Destination material requirements: (4) x11 + x21 + x31 = 4000 (5) x12 + x22 + x32 = 2500 (6) x13 + x23 + x33 = 2500 Non-negativity of variables: xij > 0, i = 1, 2, 3 and j = 1, 2, 3 19 Transportation Problem: Example #2 Cost Table Truck Railroad Airplane San Siego 12 20 30 ` Decision Variable Table San Siego Truck 1000 Railroad 0 Airplane 3000 LHS 4000 ≥ RHS 4000 Norfolk 6 11 26 Norfolk 2000 500 0 2500 ≥ 2500 Pensacola 5 9 28 Pensacola 0 2500 0 2500 ≥ 2500 LHS RHS 3000 ≤ 3000 3000 ≤ 3000 3000 ≤ 3000 142000 20 Transportation Problem Linear Programming Formulation Using the notation: xij = number of units shipped from origin i to destination j cij = cost per unit of shipping from origin i to destination j si = supply or capacity in units at origin i dj = demand in units at destination j continued 21 Transportation Problem Linear Programming Formulation (continued) Min m n c x i 1 j 1 n x j 1 ij si i 1, 2, ,m Supply ij > dj j 1, 2, ,n Demand m x i 1 ij ij xij > 0 for all i and j 22 Transportation Problem LP Formulation Special Cases • Total supply exceeds total demand: No modification of LP formulation is necessary. • Total demand exceeds total supply: Add a dummy origin with supply equal to the shortage amount. Assign a zero shipping cost per unit. The amount “shipped” from the dummy origin (in the solution) will not actually be shipped. 23 Transportation Problem LP Formulation Special Cases (continued) • The objective is maximizing profit or revenue: Solve as a maximization problem. • Minimum shipping guarantee from i to j: xij > Lij • Maximum route capacity from i to j: xij < Lij • Unacceptable route: Remove the corresponding decision variable. 24 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. 25 Assignment Problem Network Representation 1 Agents c11 c13 c21 2 1 c12 Tasks c22 2 c23 c31 3 c33 c32 3 26 Assignment Problem: Example An electrical 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. Subcontractor Westside Federated Goliath Universal Projects A B C 50 36 16 28 30 18 35 32 20 25 25 14 How should the contractors be assigned so that total mileage is minimized? 27 Assignment Problem: Example Network Representation West. Subcontractors 50 36 16 28 Fed. 18 35 Gol. Univ. 20 25 A Projects 30 B 32 C 25 14 28 Assignment Problem: Example Linear Programming Formulation Min s.t. 50x11+36x12+16x13+28x21+30x22+18x23 +35x31+32x32+20x33+25x41+25x42+14x43 x11+x12+x13 < 1 x21+x22+x23 < 1 Agents x31+x32+x33 < 1 x41+x42+x43 < 1 x11+x21+x31+x41 = 1 x12+x22+x32+x42 = 1 Tasks x13+x23+x33+x43 = 1 xij = 0 or 1 for all i and j 29 Assignment Problem: Example Linear Programming Formulation Min s.t. 50x11+36x12+16x13+28x21+30x22+18x23 +35x31+32x32+20x33+25x41+25x42+14x43 x11+x12+x13 < 1 x21+x22+x23 < 1 Agents x31+x32+x33 < 1 x41+x42+x43 < 1 x11+x21+x31+x41 ≥ 1 x12+x22+x32+x42 ≥ 1 Tasks x13+x23+x33+x43 ≥ 1 xij = 0 or 1 for all i and j 30 Transportation Problem: Example #2 Cost Table Project A 50 Westside 28 Federated 35 Goliath 25 Universal ` Decision Variable Table San Siego 0 Westside 1 Federated 0 Goliath 0 Universal 1 LHS ≥ 1 RHS Project B 36 30 32 25 Norfolk 0 0 0 1 1 ≥ 1 Project C 16 18 20 14 Pensacola 1 0 0 0 1 ≥ 1 LHS 1 1 0 1 69 ≤ ≤ ≤ ≤ RHS 1 1 1 1 31 Assignment Problem: Example The optimal assignment is: Subcontractor Project Distance Westside C 16 Federated A 28 Goliath (unassigned) Universal B 25 Total Distance = 69 miles 32 Assignment Problem Linear Programming Formulation Using the notation: xij = 1 if agent i is assigned to task j 0 otherwise cij = cost of assigning agent i to task j continued 33 Assignment Problem Linear Programming Formulation (continued) Min m n c x i 1 j 1 n x j 1 ij 1 i 1, 2, ,m Agents ij 1 j 1, 2, ,n Tasks m x i 1 ij ij xij > 0 for all i and j 34 Assignment Problem LP Formulation Special Cases •Number of agents exceeds the number of tasks: Extra agents simply remain unassigned. •Number of tasks exceeds the number of agents: Add enough dummy agents to equalize the number of agents and the number of tasks. The objective function coefficients for these new variable would be zero. 35 Assignment Problem LP Formulation Special Cases (continued) •The assignment alternatives are evaluated in terms of revenue or profit: Solve as a maximization problem. •An assignment is unacceptable: Remove the corresponding decision variable. •An agent is permitted to work t n x j 1 ij t i 1, 2, ,m tasks: Agents 36 Transshipment Problem Transshipment problems are transportation problems in which a shipment may move through intermediate nodes (transshipment nodes)before reaching a particular destination node. Transshipment problems can be converted to larger transportation problems and solved by a special transportation program. Transshipment problems can also be solved by general purpose linear programming codes. The network representation for a transshipment problem with two sources, three intermediate nodes, and two destinations is shown on the next slide. 37 Transshipment Problem Network Representation s1 c15 Supply s2 3 c13 1 c37 c14 Sources c25 6 c46 c47 4 c23 2 c36 c56 c24 5 Demand 7 c57 d1 d2 Destinations Intermediate Nodes 38 Transshipment Problem Linear Programming Formulation Using the notation: xij = number of units shipped from node i to node j cij = cost per unit of shipping from node i to node j si = supply at origin node i dj = demand at destination node j continued 39 Transshipment Problem Linear Programming Formulation (continued) Min c ij xij xij xij all arcs s.t. arcs out ij si Origin nodes i x ij 0 Transhipment nodes arcs in arcs out x arcs in x arcs in ij xij d j Destination nodes j arcs out xij > 0 for all i and j continued 40 Transshipment Problem LP Formulation Special Cases • Total supply not equal to total demand • Maximization objective function • Route capacities or route minimums • Unacceptable routes The LP model modifications required here are identical to those required for the special cases in the transportation problem. 41 Transshipment Problem: Example The Northside and Southside facilities of Zeron Industries supply three firms (Zrox, Hewes, Rockrite) with customized shelving for its offices. They both order shelving from the same two manufacturers, Arnold Manufacturers and Supershelf, Inc. Currently weekly demands by the users are 50 for Zrox, 60 for Hewes, and 40 for Rockrite. Both Arnold and Supershelf can supply at most 75 units to its customers. Additional data is shown on the next slide. 42 Transshipment Problem: Example Because of long standing contracts based on past orders, unit costs from the manufacturers to the suppliers are: Zeron N Arnold 5 Supershelf 7 Zeron S 8 4 The costs to install the shelving at the various locations are: Zrox Zeron N 1 Zeron S 3 Hewes Rockrite 5 8 4 4 43 Transshipment Problem: Example Network Representation ZROX 75 ARNOLD Arnold 5 Zeron N 8 75 4 50 Hewes HEWES 60 RockRite 40 5 8 3 7 Super Shelf 1 Zrox Zeron WASH BURN S 4 4 44 Transshipment Problem: Example Linear Programming Formulation • Decision Variables Defined xij = amount shipped from manufacturer i to supplier j xjk = amount shipped from supplier j to customer k where i = 1 (Arnold), 2 (Supershelf) j = 3 (Zeron N), 4 (Zeron S) k = 5 (Zrox), 6 (Hewes), 7 (Rockrite) • Objective Function Defined Minimize Overall Shipping Costs: Min 5x13 + 8x14 + 7x23 + 4x24 + 1x35 + 5x36 + 8x37 + 3x45 + 4x46 + 4x47 45 Transshipment Problem: Example Constraints Defined Amount Out of Arnold: Amount Out of Supershelf: Amount Through Zeron N: Amount Through Zeron S: Amount Into Zrox: Amount Into Hewes: Amount Into Rockrite: x13 + x14 < 75 x23 + x24 < 75 x13 + x23 - x35 - x36 - x37 = 0 x14 + x24 - x45 - x46 - x47 = 0 x35 + x45 = 50 x36 + x46 = 60 x37 + x47 = 40 Non-negativity of Variables: xij > 0, for all i and j. 46 Transshipment Problem: Example Cost Table Zeron N Arnold 5 Supershelf 7 Zeron S 8 4 Decision Variable Table Zeron N Zeron S Arnold 75 0 Supershelf 0 75 75 75 Zeron N Zeron S 75 75 ≤ ≤ 75 75 Hewes 5 4 Rockrite 8 4 Zrox Hewes 25 35 60 ≥ 60 Rockrite 50 0 50 ≥ 50 ` Zeron N Zeron S Zeron N Zeron S Zrox 1 3 0 0 = = 0 40 40 ≥ 40 75 75 1150 0 0 47 Transshipment Problem: Example Solution ZROX 75 ARNOLD Arnold 5 75 Zeron N 8 75 4 50 Hewes HEWES 60 RockRite 40 5 8 3 4 7 Super Shelf 1 Zrox Zeron WASH BURN S 4 48 Transshipment Problem: Example Variable Cells Cell $B$8 $C$8 $B$9 $C$9 $I$8 $J$8 $K$8 $I$9 $J$9 $K$9 Final Reduced Objective Allowable Allowable Name Value Cost Coefficient Increase Decrease Arnold Zeron N 75 0 5 2 2 Arnold Zeron S 0 2 8 1E+30 2 Supershelf Zeron N 0 4 7 1E+30 4 Supershelf Zeron S 75 0 4 2 1E+30 Zeron N Zrox 50 0 1 3 6 Zeron N Hewes 25 0 5 2 2 Zeron N Rockrite 0 3 8 1E+30 3 Zeron S Zrox 0 3 3 1E+30 3 Zeron S Hewes 35 0 4 2 2 Zeron S Rockrite 40 0 4 3 10 Constraints Cell $D$14 $D$15 $D$8 $D$9 $I$10 $J$10 $K$10 Name Zeron N Zeron S Arnold Supershelf Zrox Hewes Rockrite Final Shadow Constraint Allowable Allowable Value Price R.H. Side Increase Decrease 0 5 0 0 75 0 6 0 0 25 75 0 75 1E+30 0 75 -2 75 25 0 50 6 50 0 50 60 10 60 0 25 40 10 40 0 25 49 Transshipment Problem: Example Computer Output (continued) Constraint 1 2 3 4 5 6 7 Slack/Surplus 0.000 0.000 0.000 0.000 0.000 0.000 0.000 Dual Values 0.000 2.000 -5.000 -6.000 -6.000 -10.000 -10.000 50 Transshipment Problem: Example Computer Output (continued) OBJECTIVE COEFFICIENT RANGES Variable Lower Limit Current Value Upper Limit X13 X14 X23 X24 X35 X36 X37 X45 X46 X47 3.000 6.000 3.000 No Limit No Limit 3.000 5.000 0.000 2.000 No Limit 5.000 8.000 7.000 4.000 1.000 5.000 8.000 3.000 4.000 4.000 7.000 No Limit No Limit 6.000 4.000 7.000 No Limit No Limit 6.000 7.000 51 Transshipment Problem: Example Computer Output (continued) RIGHT HAND SIDE RANGES Constraint 1 2 3 4 5 6 7 Lower Limit 75.000 75.000 -75.000 -25.000 0.000 35.000 15.000 Current Value Upper Limit 75.000 No Limit 75.000 100.000 0.000 0.000 0.000 0.000 50.000 50.000 60.000 60.000 40.000 40.000 52 Transshipment Transformed into Transportation Problem Cost Table Zeron N Arnold 5 Supershelf 7 Zeron N 0 Zeron S 1000 ` Zeron S 8 4 1000 0 Zrox 1000 1000 1 3 Hewes 1000 1000 5 4 Rockrite 1000 1000 8 4 Decision Variable Table Zeron N Zeron S Arnold 75 0 Supershelf 0 75 Zeron N 75 0 Zeron S 0 75 LHS 150 150 = = RHS 150 150 Zrox 0 0 50 0 50 = 50 Hewes 0 0 25 35 60 = 60 Rockrite 0 0 0 40 40 = 40 LHS 75 75 150 150 1150 = = = = RHS 75 75 150 150 53 End of Chapter 6, Part A 54