Two Discrete Optimization Problems Problem The Transportation Problem
Two Discrete Optimization Problems Problem: The Transportation Problem
Formulating Graph Problems You already know the following steps formulating a graph problem (such as the TSP and the Shortest-Path Problem): 1. Identify the vertices that represent objects in a problem. 2. Identify the edges that are lines connecting selected pairs of vertices to indicated a relationship between the objects associated with the two connected vertices. 3. Identify additional data by writing those values next to the corresponding vertices and/or edges. 4. State the objective in the context of the graph and given data. Let’s do this for a new problem… 2
The Transportation Problem (TP) CCC has 1000 computers at each of three plants this month. Three customers have requested 1100, 800, and 1100 computers, respectively. These data are summarized in the table below, along with the cost of shipping one computer from each plant to each customer. You have been asked to develop a least-cost shipping plan for CCC. 3
Creating a Graph for the TP Step 1: Identify the Vertices. Use one vertex for each plant and one for each customer: Plants 1 1 Note: An edge is a relationship and not a number. 2 2 Customers 3 3 Step 2: Identify the Edges. Use an edge to connect a vertex i to a vertex j to represent the possibility of shipping computers from Plant i to Customer j. 4
Creating a Graph for the TP Step 3: Identify Additional Data. (Supplies) 1000 Plants Customers (Demands) 5 1 1 1100 2 800 3 1100 3 2 4 1000 2 7 8 6 1000 3 7 4 (Unit Shipping Costs) 5
Step 4: State the Objective You can use words, for example, for the TSP: Find the order in which to visit every vertex exactly once and return to the starting vertex with least total “cost”. OR use variables, objective function, and constraints: Step 4(a): Identify the variables, which are those quantities whose values, once determined, constitute the solution to the problem. To identify the variables, ask yourself the following questions: 1. What can you choose or control? 2. What decisions do you have to make? 3. What items affect costs or profits? 4. If you had to implement the solution, what information would you need to know? 6
Identifying Variables for CCC A = the number of computers to ship from P 1 to C 1. OR X 1 = the number of computers to ship from P 1 to C 1. X 2 = the number of computers to ship from P 1 to C 2. Question: What does X 5 mean for this problem? Note: Choose notation that is easy to understand. Xij = the number of computers to ship from Plant i to Customer j (i, j = 1, 2, 3) Cust 1 Cust 2 Cust 3 Plant 1 X 12 X 13 Plant 2 X 21 X 22 X 23 Plant 3 X 31 X 32 X 33 7
Identifying the Obj. Func. For CCC Step 4(b): Identify the Objective Function (a math expression in terms of the variables and data that reflect the goal). Words: Minimize total transportation cost Decompose: Total transportation cost = Key Point: You can use decomposition more than once. Decompose (again): Transportation cost from Plant 1 = 5 X 11 + 3 X 12 + 2 X 13 Math: Plant 1 Plant 2 Plant 3 8
Identifying Constraints for CCC Step 4(c): Identify Constraints (restrictions on the values of the variables so that those values are acceptable). Note: Use grouping to identify groups of constraints. Demand Constraints ( 3 ) Words: Total number of computers received by Customer 1 should be equal to the number requested. Decompose: Total number of computers received by Customer 1 = Mathematics: 9
Identifying Constraints for CCC Step 4(c): Identify Constraints (cont. ) Supply Constraints ( 3 ) Words: Total number of computers shipped from Plant 1 should be equal to the available supply. Decompose: Total number of computers shipped from Plant 1 = Mathematics: Logical Constraints: and integer 10
Transportation Problem of CCC Find values for the variables Xij (i = 1, 2, 3; j = 1, 2, 3) so as to s. t. Demand Constraints Supply Constraints 3000 Logical Constraints 3000 Qn: Is this a linear program? NO…it is an integer program; HOWEVER… 11
The Optimal Solution for CCC If you solve the problem as an LP, the optimal solution will have all integer values for the variables (this is because of the special mathematical properties of the Supply and Demand constraints). The following optimal solution for CCC was obtained using the Excel file Transportation. Alg. xlsm posted on the web at: http: //cgm. cs. mcgill. ca/~avis/Kyoto/courses/ia/2015/ia. html Optimal Solution for CCC Plant 1 Plant 2 Plant 3 Demands Customer 1 Customer 2 Customer 3 0 800 200 1000 0 0 100 0 900 1100 800 1100 Supplies 1000 Cost = 11000 12
More Efficient Methods There are “special purpose” computer packages for solving the Transportation Problem (and many other graph problems) much more efficiently than as an LP. However, these algorithms require that the Transportation Problem be balanced, that is, total supply = total demand. This was the case for the problem of CCC, but what should you do if your problem is not balanced? 13
Handling Too Much Demand Question: What do you do if total supply < total demand? (Supplies) Plants 1000 Customers 5 1 (Demands) 1 1100 2 800 3 2 4 1000 2 7 8 6 1000 500 3 7 4 3 1600 0 Dum 3500 3000 3500 Means that some customers will not receive all of their demand. Note: Shipping one unit from the Dummy Plant to Customer j means that Customer j will not receive one unit of their demand. 14
Handling Too Much Supply Question: What do you do if total supply > total demand? (Supplies) Plants 1000 5 1 2 4 1500 3 2 800 7 7 3 4 0 3500 1100 8 6 0 (Demands) 1 3 2 1000 Customers 1100 0 Dum 500 3000 3500 Means that some plants will not ship all of their supplies. Note: Shipping one unit from Plant i to the Dummy Customer means that Plant i will have one unit of supply not shipped. 15
Solving Another Problem The ABC Consulting Company has 3 consultants in Miami, 4 in New Orleans, and 5 in Los Angeles. Their offices in Atlanta, Austin, Sacramento and Boston want 3, 2, 4, and 5 of those consultants, respectively. Given the following travel distances in miles, determine how many consultants to send from Miami, New Orleans and Los Angeles to the offices in Atlanta, Austin, Sacramento and Boston to incur the least total miles traveled. Which offices do not receive all of the consultants they want? Supplies 3 4 5 Demands 3 2 4 5 16
The Optimal Solution for ABC The following optimal solution for the unbalanced problem of ABC was obtained using the Excel file Transportation. Alg. xlsm. Atlanta Austin Sacramento Boston Miami 0 0 0 3 New Orleans 3 1 0 0 Los Angeles 0 1 4 0 DUMMY 0 0 0 2 Demands 3 2 4 5 Supplies 3 4 5 2 Cost = 13159 Question: Which office does not receive the number of consultants they want? Answer: Because 2 consultants are sent from the DUMMY to Boston, this means that Boston will not receive 2 of the 5 consultants they wanted. 17
Variations of the Trans. Prob. • Capacitated/Uncapacitated Problems • Prohibited Routes • Transshipment Nodes • Incorporating Unequal Production Costs • Incorporating Unequal Revenue • Lower Bounds on Supplies and Demands 18
Summary Formulating a graph problem involves the following steps: 1. Identify the vertices by using circles to represent objects in a problem. 2. Identify the edges by using lines to connect selected pairs of vertices to indicated a relationship between the objects associated with the two connected vertices. 3. Identify other data by writing those values next to the corresponding vertices and/or edges. 4. State the objective in the context of the graph using either: • Words, or • Variables, an objective function, and constraints. 19
- Slides: 19