Upcoming SlideShare
×

# 5-1 Network Modeling Chapter 5

1,895 views

Published on

Published in: Technology, Business
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

### 5-1 Network Modeling Chapter 5

1. 1. Network Modeling Chapter 5
2. 2. Introduction <ul><li>A number of business problems can be represented graphically as networks. </li></ul><ul><li>Advantages of Network Models versus LPs: </li></ul><ul><ul><li>Networks are convenient way to think about and model many problems </li></ul></ul><ul><ul><li>Network flow models yield integer solutions naturally as long as the supply and demand data is integer </li></ul></ul><ul><ul><li>Specialized extremely fast algorithms have been developed for network problems  Critical for very large problems. However, Solver does include these algorithm and we shall simply use the regular LP simplex algorithm available </li></ul></ul><ul><li>We will focus on a few such problems: </li></ul><ul><ul><li>Transshipment </li></ul></ul><ul><ul><li>Shortest Path </li></ul></ul><ul><ul><li>Transportation/Assignment </li></ul></ul><ul><ul><li>Maximal Flow </li></ul></ul>
3. 3. Network Flow Problem Characteristics <ul><li>General network flow problems (transshipment problems) can be represented as a collection of nodes connected by arcs. </li></ul><ul><li>There are three types of nodes: </li></ul><ul><ul><li>Supply </li></ul></ul><ul><ul><li>Demand </li></ul></ul><ul><ul><li>Transshipment </li></ul></ul><ul><li>We’ll use negative numbers to represent supplies and positive numbers to represent demand. </li></ul><ul><li>There exists efficient algorithms for the transshipment problem that are one or more orders of magnitude faster than the standard Simplex LP solver; however, Solver only has one generic Simplex solver for all LP problems </li></ul>
4. 4. A Transshipment Problem: The Bavarian Motor Company Newark 1 Boston 2 Columbus 3 Atlanta 5 Richmond 4 J'ville 7 Mobile 6 \$30 \$40 \$50 \$35 \$40 \$30 \$35 \$25 \$50 \$45 \$50 -200 -300 +80 +100 +60 +170 +70
5. 5. Defining the Decision Variables <ul><li>For each arc in a network flow model </li></ul><ul><li>we define a decision variable as: </li></ul><ul><li>X ij = the amount being shipped (or flowing) from node i to node j </li></ul>For example… X 12 = the # of cars shipped from node 1 (Newark) to node 2 (Boston) X 56 = the # of cars shipped from node 5 (Atlanta) to node 6 (Mobile) <ul><li>Notes: </li></ul><ul><li>The number of arcs determines the number of variables </li></ul><ul><li>Lower and upper bounds could be placed on the flow </li></ul>
6. 6. Defining the Objective Function <ul><li>Minimize total shipping costs. </li></ul><ul><li>MIN : 30X 12 + 40X 14 + 50X 23 + 35X 35 </li></ul><ul><li> +40X 53 + 30X 54 + 35X 56 + 25X 65 </li></ul><ul><li>+ 50X 74 + 45X 75 + 50X 76 </li></ul>
7. 7. Constraints for Network Flow Problems: Balance-of-Flow Concepts or “Rules” Supply Nodes: Inflow – Outflow = Supply Demand Nodes: Inflow – Outflow = Demand Transshipment Nodes: Inflow – Outflow = 0 Total Supply = Total Demand Supply Nodes: Inflow – Outflow = Supply ( Not Inflow – Outflow <= Supply) Demand Nodes: Inflow – Outflow <= Demand Transshipment Nodes: Inflow – Outflow = 0 Total Supply < Total Demand Supply Nodes: Inflow – Outflow >= Supply Demand Nodes: Inflow – Outflow >= Demand (Or Inflow – Outflow = Demand) Transshipment Nodes: Inflow – Outflow = 0 Total Supply > Total Demand Apply The Following: For Minimum Cost Network Flow Problem Where:
8. 8. Motivation Behind “Rules” Consider the following two cases for a hypothetical node 1 (rest of network not shown): Case B Case A 1 X 21 +100 X 13 X 41 X 15 1 X 21 -100 X 13 X 41 X 15
9. 9. Illustration of Rule 1 Case A Case B Total Supply > Total Demand which means, in general, we should be able to meet all the demand  Inflow-Outflow >= Supply or Demand Case A: X 21 +X 41 -X 13 -X 15 >=-100, or -X 21 -X 41 +X 13 +X 15 <=100 (i.e., not all supply from node 1 has to be used) Case B: X 21 +X 41 -X 13 -X 15 >=100, or X 21 +X 41 -X 13 -X 15 =100 (i.e., all demand at node 1 has to be met) 1 X 21 +100 X 13 X 41 X 15 1 X 21 -100 X 13 X 41 X 15
10. 10. Illustration of Rule 2 Case A Case B Total Supply < Total Demand which means, we cannot to meet all the demand even if use all the supply  Inflow-Outflow = Supply Inflow –Outflow <= Demand Case A: X 21 +X 41 -X 13 -X 15 =-100, or -X 21 -X 41 +X 13 +X 15 =100 (i.e., all supply from node 1 is used) Note that -X 21 -X 41 +X 13 +X 15 > =100 is wrong! Case B: X 21 +X 41 -X 13 -X 15 <=100, or (i.e., not all demand at node 1 has to be met) 1 X 21 +100 X 13 X 41 X 15 1 X 21 -100 X 13 X 41 X 15
11. 11. Illustration of Rule 3 Case A Case B Total Supply = Total Demand which means, we should be able to exactly meet all the demand  Inflow-Outflow = Supply or Demand Case A: X 21 +X 41 -X 13 -X 15 =-100, or -X 21 -X 41 +X 13 +X 15 =100 (i.e., all supply from node 1 is used) Case B: X 21 +X 41 -X 13 -X 15 =100, or (i.e., all demand at node 1 is met) 1 X 21 +100 X 13 X 41 X 15 1 X 21 -100 X 13 X 41 X 15
12. 12. A Word of Caution <ul><li>These rules are there to help us write the proper flow balance constraints. </li></ul><ul><li>In reality, the essential underlying rule is that what comes into a node (via arcs or external supply) comes out of the node (again via arcs or external demand). </li></ul><ul><li>Note that the stated rules make the implicit assumption that the supplies, regardless at what nodes they occur at, can be routed through the network to meet demands at their appropriate nodes. </li></ul><ul><ul><li>This assumption may not always be true. </li></ul></ul><ul><ul><li>When this assumption is untrue, we may have an infeasible model </li></ul></ul><ul><ul><li>We will look later on at one way to handle the infeasibility </li></ul></ul>
13. 13. Defining the Constraints <ul><li>In the BMC problem: </li></ul><ul><ul><li>Total Supply = 500 cars </li></ul></ul><ul><ul><li>Total Demand = 480 cars </li></ul></ul><ul><li>For each supply or demand node we need a constraint like this: </li></ul><ul><ul><li>Inflow - Outflow >= Supply or Demand </li></ul></ul><ul><li>Constraint for node 1: </li></ul><ul><ul><li>–X 12 – X 14 >= – 200 (Note: there is no inflow for node 1) </li></ul></ul><ul><li>This is equivalent to: </li></ul><ul><ul><li>+X 12 + X 14 <= 200 </li></ul></ul>(Supply >= Demand)
14. 14. Defining the Constraints <ul><li>Flow constraints </li></ul><ul><ul><li>– X 12 – X 14 >= –200 } node 1 </li></ul></ul><ul><ul><li>+X 12 – X 23 >= +100 } node 2 </li></ul></ul><ul><ul><li>+X 23 + X 53 – X 35 >= +60 } node 3 </li></ul></ul><ul><ul><li>+ X 14 + X 54 + X 74 >= +80 } node 4 </li></ul></ul><ul><ul><li>+ X 35 + X 65 + X 75 – X 53 – X 54 – X 56 >= +170} node 5 </li></ul></ul><ul><ul><li>+ X 56 + X 76 – X 65 >= +70 } node 6 </li></ul></ul><ul><ul><li>– X 74 – X 75 – X 76 >= –300 } node 7 </li></ul></ul><ul><li>Nonnegativity conditions </li></ul><ul><ul><li>X ij >= 0 for all ij </li></ul></ul>
15. 15. Implementing the Model <ul><li>See file Fig5-2.xls </li></ul>
16. 16. Optimal Solution to the BMC Problem Newark 1 Boston 2 Columbus 3 Atlanta 5 Richmond 4 J'ville 7 Mobile 6 \$30 \$40 \$50 \$40 \$50 \$45 -200 -300 +80 +100 +60 +170 +70 120 80 20 40 70 210
17. 17. The Shortest Path Problem <ul><li>Many decision problems boil down to determining the shortest (or least costly) route or path through a network. </li></ul><ul><ul><li>Ex. Emergency Vehicle Routing </li></ul></ul><ul><li>This is a special case of a transshipment problem where: </li></ul><ul><ul><li>There is one supply node with a supply of -1 </li></ul></ul><ul><ul><li>There is one demand node with a demand of +1 </li></ul></ul><ul><ul><li>All other nodes have supply/demand of +0 </li></ul></ul><ul><li>There exists efficient algorithms for the shortest path problem that can solve huge networks (say, with 10,000 nodes and 1 million variables) in a matter of seconds; however, Solver only has one generic Simplex solver for all LP problems. </li></ul>
18. 18. The American Car Association B'ham Atlanta G'ville Va Bch Charl. L'burg K'ville A'ville G'boro Raliegh Chatt. 1 2 3 4 6 5 7 8 9 10 11 2.5 hrs 3 pts 3.0 hrs 4 pts 1.7 hrs 4 pts 2.5 hrs 3 pts 1.7 hrs 5 pts 2.8 hrs 7 pts 2.0 hrs 8 pts 1.5 hrs 2 pts 2.0 hrs 9 pts 5.0 hrs 9 pts 3.0 hrs 4 pts 4.7 hrs 9 pts 1.5 hrs 3 pts 2.3 hrs 3 pts 1.1 hrs 3 pts 2.0 hrs 4 pts 2.7 hrs 4 pts 3.3 hrs 5 pts -1 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0
19. 19. Solving the Problem <ul><li>There are two possible objectives for this problem </li></ul><ul><ul><li>Finding the quickest route (minimizing travel time) </li></ul></ul><ul><ul><li>Finding the most scenic route (maximizing the scenic rating points) </li></ul></ul><ul><li>See file Fig5-7.xls </li></ul>
20. 20. The Equipment Replacement Problem <ul><li>The problem of determining when to replace equipment is another common business problem. </li></ul><ul><li>It can also be modeled as a shortest path problem… </li></ul>
21. 21. The Compu-Train Company <ul><li>Compu-Train provides hands-on software training. </li></ul><ul><li>Computers must be replaced at least every two years. </li></ul><ul><li>Two lease contracts are being considered: </li></ul><ul><ul><li>Each requires \$62,000 initially </li></ul></ul><ul><ul><li>Contract 1: </li></ul></ul><ul><ul><ul><li>Prices increase 6% per year </li></ul></ul></ul><ul><ul><ul><li>60% trade-in for 1 year old equipment </li></ul></ul></ul><ul><ul><ul><li>15% trade-in for 2 year old equipment </li></ul></ul></ul><ul><ul><li>Contract 2: </li></ul></ul><ul><ul><ul><li>Prices increase 2% per year </li></ul></ul></ul><ul><ul><ul><li>30% trade-in for 1 year old equipment </li></ul></ul></ul><ul><ul><ul><li>10% trade-in for 2 year old equipment </li></ul></ul></ul>
22. 22. Network for Contract 1 Cost on arc: cost of new computers minus salvage value for traded in computers Costs for arcs out of node 1: Cost of trading after 1 year (arc to node 2): 1.06*\$62,000 - 0.6*\$62,000 = \$28,520 Cost of trading after 2 years (arc to node 3): 1.06 2 *\$62,000 - 0.15*\$62,000 = \$60,363 Costs for arcs out of node 2: Cost of trading after 1 year (arc to node 3): 1.06 2 *\$62,000 - 0.6*1.06*\$62,000 = \$30,231 Cost of trading after 2 years (arc to node 4): 1.06 3 *\$62,000 - 0.15*1.06*\$62,000 = \$63,985 And so on … 1 3 5 2 4 -1 +1 +0 +0 +0 \$28,520 \$60,363 \$30,231 \$63,985 \$32,045 \$67,824 \$33,968
23. 23. Solving the Problem <ul><li>See file Fig5-12.xls </li></ul>
24. 24. Transportation & Assignment Problems <ul><li>Some network flow problems don’t have trans-shipment nodes; only supply and demand nodes. These are termed “transportation problems” (Example covered in Chapter 3). </li></ul><ul><li>Transportation problems with flows that are either zero or 1 are called “assignment problems” (e.g., assigning jobs to machines on next slide). </li></ul><ul><li>There exists efficient algorithms for each of these two different problems that are one or more orders of magnitude faster than generic LP solvers ; however, Solver only has one generic Simplex solver for all LP problems. </li></ul>These problems are implemented more effectively using the approach in Chapter 3 (Fig 3-24.xls). Mt. Dora 1 Eustis 2 Clermont 3 Ocala 4 Orlando 5 Leesburg 6 Distances (in miles) Capacity Supply 275,000 400,000 300,000 225,000 600,000 200,000 Groves Processing Plants 21 50 40 35 30 22 55 25 20
25. 25. <ul><li>Assignment models are used to assign, on a one-to-one basis, members of one set to members of another set in a least-cost (or least-time) manner. </li></ul><ul><li>Assignment models are special cases of transportation models where all flows are 0 or 1. </li></ul><ul><li>It is identical to the transportation model except with different inputs. </li></ul>Assignment Problems
26. 26. <ul><li>There are four jobs that must be completed by five machines. Machines 1, 3 and 5 can hold at most one job each, whereas machines 2 and 4 can handle two jobs each. </li></ul>1 1 1 2 2 1 1 1 1 Machine 1 Machine 2 Machine 3 Machine 4 Machine 5 Job 1 Job 2 Job 3 Job 4 \$14 \$5 \$8 \$7 . . . Example
27. 27. <ul><li>The objective is to minimize the overall cost. </li></ul><ul><li>Refer to Assignment.xls file referenced under Lecture. </li></ul>Assignment Problem Example - Continued Machine Job \$8 \$4 \$5 \$5 5 \$10 \$6 \$4 \$2 4 \$9 \$3 \$8 \$7 3 \$5 \$6 \$12 \$2 2 \$7 \$8 \$5 \$14 1 4 3 2 1
28. 28. The Maximal Flow Problem <ul><li>In some network problems, the objective is to determine the maximum amount of flow that can occur through a network. </li></ul><ul><li>The arcs in these problems have upper and lower flow limits. </li></ul><ul><li>Examples </li></ul><ul><ul><li>How much water can flow through a network of pipes? </li></ul></ul><ul><ul><li>How many cars can travel through a network of streets? </li></ul></ul><ul><li>There exists efficient algorithms for the maximal problem that can solve huge networks (say, with 10,000 nodes and 1 million variables) in a matter of seconds; however, Solver only has one generic Simplex solver for all LP problems. </li></ul>
29. 29. The Northwest Petroleum Company Oil Field Pumping Station 1 Pumping Station 2 Pumping Station 3 Pumping Station 4 Refinery 1 2 3 4 5 6 UB =6 UB = 4 UB = 3 UB = 6 UB = 4 UB = 5 UB = 2 UB = 2
30. 30. The Northwest Petroleum Company Oil Field Pumping Station 1 Pumping Station 2 Pumping Station 3 Pumping Station 4 Refinery 1 2 3 4 5 6 UB = 6 UB = 4 UB = 3 UB = 6 UB = 4 UB = 5 UB = 2 UB = 2
31. 31. Formulation of the Max Flow Problem <ul><li>MAX: X 61 </li></ul><ul><li>Subject to: +X 61 - X 12 - X 13 = 0 </li></ul><ul><li>+X 12 - X 24 - X 25 = 0 </li></ul><ul><li>+X 13 - X 34 - X 35 = 0 </li></ul><ul><li>+X 24 + X 34 - X 46 = 0 </li></ul><ul><li>+X 25 + X 35 - X 56 = 0 </li></ul><ul><li>+X 46 + X 56 - X 61 = 0 </li></ul><ul><li>with the following bounds on the decision variables: </li></ul><ul><li>0 <= X 12 <= 6 0 <= X 25 <= 2 0 <= X 46 <= 6 </li></ul><ul><li>0 <= X 13 <= 4 0 <= X 34 <= 2 0 <= X 56 <= 4 </li></ul><ul><li>0 <= X 24 <= 3 0 <= X 35 <= 5 0 <= X 61 <= inf </li></ul>
32. 32. Implementing the Model <ul><li>See file Fig5-24.xls </li></ul>
33. 33. Optimal Solution Oil Field Pumping Station 1 Pumping Station 2 Pumping Station 3 Pumping Station 4 Refinery 1 2 3 4 5 6 6 4 3 6 4 5 2 2 5 3 2 4 2 5 4 2
34. 34. Special Modeling Considerations: Flow Aggregation 1 2 3 4 5 6 -100 -100 +75 +50 +0 +0 \$3 \$4 \$4 \$5 \$5 \$5 \$3 \$6 Suppose the total flow into nodes 3 & 4 must be at least 50 and 60, respectively. How would you model this?
35. 35. 1 2 3 4 5 6 -100 -100 +75 +50 +0 +0 \$3 \$4 \$4 \$5 \$5 \$5 \$3 \$6 30 40 +0 +0 L.B.=50 L.B.=60 Nodes 30 & 40 aggregate the total flow into nodes 3 & 4, respectively. This allows us to place lower bounds on the aggregate flows into these nodes. Special Modeling Considerations: Flow Aggregation
36. 36. Special Modeling Considerations: Multiple Arcs Between Nodes 1 -75 \$8 2 +50 Two (or more) arcs can share the same beginning and ending nodes. You just need to label them differently in the algebraic formulation : e.g., X 121 and X 122 . Implementation in Excel would be identical to before. The book also offers an alternative scheme … \$6 U.B. = 35 1 10 2 +0 +50 -75 \$0 \$6 U.B. = 35 \$8
37. 37. Special Modeling Considerations: Capacity Restrictions on Total Supply <ul><li>Supply exceeds demand, but the upper bounds prevent the demand from being met. </li></ul><ul><li>Note that this situation may even happen without the capacity restrictions. It may be that the network is not connected in a fashion to allow the available supply to reach the required demand. </li></ul>1 -100 2 -100 3 +75 4 +80 \$5, UB=40 \$3, UB=35 \$6, UB=35 \$4, UB=30
38. 38. Special Modeling Considerations: Capacity Restrictions on Total Supply <ul><li>Now, demand exceeds total supply and you can use Rule 2. </li></ul><ul><li>As much “real” demand as possible will be met in the least costly way. </li></ul>1 -100 2 -100 3 +75 4 +80 \$5, UB=40 \$3, UB=35 \$6, UB=35 \$4, UB=30 0 +200 \$999, UB=100 \$999, UB=100
39. 39. End of Chapter 5