Presentation is loading. Please wait.

Presentation is loading. Please wait.

Goals and aims To introduce Linear Programming To find a knowledge on graphical solution for LP problems To solve linear programming problems using excel.

Similar presentations


Presentation on theme: "Goals and aims To introduce Linear Programming To find a knowledge on graphical solution for LP problems To solve linear programming problems using excel."— Presentation transcript:

1

2 Goals and aims To introduce Linear Programming To find a knowledge on graphical solution for LP problems To solve linear programming problems using excel. Goals, Aims, and Requirements

3 You have a set of logos 8 small bricks 6 large bricks These are your “raw materials”. You have to produce tables and chairs out of these logos. These are your “products”. The Lego Production Problem

4 Weekly supply of raw materials: 6 Large Bricks 8 Small Bricks Products: Table Chair Profit = $20/TableProfit = $15/Chair The Lego Production Problem

5 X1 is the number of Chairs X2 is the number of Tables Large brick constraint X1+2X2 <= 6 Small brick constraint 2X1+2X2 <= 8 Objective function is to Maximize 15X1+20 X2 X1>=0 X2>= 0 Problem Formulation

6 0 Graphical Solution to the Prototype Problem 123456 1 2 3 4 5 Chairs Tables X1 + 2 X2 = 6 Large Bricks

7 0 Graphical Solution to the Prototype Problem 123456 1 2 3 4 5 Chairs Tables 2 X1 + 2 X2 = 8 Small Bricks

8 0 Graphical Solution to the Prototype Problem 123456 1 2 3 4 5 Chairs Tables X1 + 2 X2 = 6 Large Bricks 2 X1 + 2 X2 = 8 Small Bricks

9 0 Graphical Solution to the Prototype Problem 123456 1 2 3 4 5 Chairs Tables X1 + 2 X2 = 6 Large Bricks 2 X1 + 2 X2 = 8 Small Bricks

10 Z = 15 X1 + 20 X2 Lets draw it for 15 X1 + 20 X2 = 30 In this case if # of chair = 0, then # of table = 30/20 = 1.5 if # of table = 0, then # of chair = 30/15 = 2 The Objective Function

11 0 Graphical Solution to the Prototype Problem 123456 1 2 3 4 5 Chairs Tables X1 + 2 X2 = 6 Large Bricks 2 X1 + 2 X2 = 8 Small Bricks

12 We can make Product1 and or Product2. There are 3 resources; Resource1, Resource2, Resource3. Product1 needs one unit of Resource1, nothing of Resource2, and three units of resource3. Product2 needs nothing from Resource1, two units of Resource2, and two units of resource3. Available amount of resources 1, 2, 3 are 4, 12, 18, respectively. Net profit of product 1 and Product2 are 3 and 5, respectively. Formulate the Problem Solve it graphically Solve it using excel. A second example

13 Objective Function Z = 3 x 1 +5 x 2 Constraints Resource 1 x 1  4 Resource 2 2x 2  12 Resource 3 3 x 1 + 2 x 2  18 Nonnegativity x 1  0, x 2  0 Problem 2 Product 1 needs 1 hour of Plant 1, and 3 hours of Plant 3. Product 2 needs 2 hours of plant 2 and 2 hours of plant 3 There are 4 hours available in plant 1, 12 hours in plant 2, and 18 hours in plant 3

14 12345678910 1 2 3 4 5 6 7 8 9 x 2 x 1 Max Z = 3x 1 + 5x 2 Subject to x 1  4 2x 2  12 3 x 1 + 2 x 2  18 x 1  0, x 2  0 Problem 2 : Original version

15 12345678910 1 2 3 4 5 6 7 8 9 x 2 x 1 Max Z = 3x 1 + 5x 2 Subject to x 1  4 2x 2  12 3 x 1 + 2 x 2  18 x 1  0, x 2  0 Problem 2

16 1.Start by Organizing the data for the model on the spreadsheet. Type in the coefficients of the constraints and the objective function 2.For each constraint, create a formula in a separate cell that corresponds to the left-hand side (LHS) of the constraint. 3.Assign a set of cells to represent the decision variable in the model. 4.Create a formula in a cell that corresponds to the objective function. Implementing LP Models in Excel

17 Constraint cells - the cells in the spreadsheet representing the LHS formulas on the constraints Changing cells - the cells in the spreadsheet representing the decision variables Target cell - the cell in the spreadsheet that represents the objective function Constraint LHS, Variables, Objective Function

18 Enter the input data and construct relationships among data elements in a readable, easy to understand way. Make sure there is a cell in your spreadsheet for each of the following: every quantity that you might want to constraint (include both sides of the constraint) every decision variable the quantity you wish to maximize or minimize Usually we don’t have any particular initial values for the decision variables. The problem starts with assuming a value of 0 in each decision variable cell. Solving LP Models with Excel

19 Z = 3 x 1 +5 x 2 x 1  4 2x 2  12 3 x 1 + 2 x 2  18 x 1  0, x 2  0 Wyndor Example Product 1 needs 1 hour of Plant 1, and 3 hours of Plant 3. Product 2 needs 2 hours of plant 2 and 2 hours of plant 3 There are 4 hours available in plant 1, 12 hours in plant 2, and 18 hours in plant 3 Go to EXCEL, solve this problem in EXCEL first

20 Wyndor Example; Enter data

21 Noncomputational Entries

22 SUMPRODUCT function is used to multiply element by element of two tables and addup all values. In EXCELterminology, SUMPRODUCT sums the products of individual cells in two ranges. For example, SUMPRODUCT(C6:D6, C4:D4) sums the products C6*C4 plus D6*D4. The two specified ranges must be of the same size ( the same number of rows and columns). For linear programming you should try to always use the SUMPRODUCT function (or SUM) for the objective function and constraints. This is to remember that the equations are all linear. Sumproduct

23 Solving LP Models with Excel

24

25

26

27

28 Designing the Target Cell ( Objective Function)

29 You have already defined the target cell. It contains an equation that defines the objective and depends on the decision variables. You can ONLY have one objective function, therefore the target cell must be a single cell. In the Solver dialogue box select the “Set Target Cell” window, then click on the cell that you have already defined it as the objective function. This is the cell you wish to optimize. Then lick on the radio button of either “Max” or “Min” depending on whether the objective is to maximize or minimize the target cell. Defining the Target Cell ( The Objective Function)

30 Designing the Target Cell ( Objective Function)

31 You next tell Excel which cells are decision variables, i.e., which cells Excel is allowed to change when trying to optimize. Move the cursor to the “By Changing Cells” window, and drag the cursor across all cells you wish to treat as decision variables Identifying the Changing Cells ( Decision Variables)

32

33 If the decision variables do not all lie in a connected rectangle in the spreadsheet, then Drag the cursor across one group of decision variables. Ctrl after that group in the “By Changing Cells” window. Drag the cursor across the next group of decision variables. etc.... Dragging with non-adjacent cells

34 Click on the “Add” button to the right of the constraints window. A new dialogue box will appear. The cursor will be in the “Cell Reference” window within this dialogue box. Click on the cell that contains the quantity you want to constrain. The default inequality that first appears for a constraint is “<= ”. To change this, click on the arrow beside the “<= ” sign. After setting the inequality, move the cursor to the “Constraint” window. Click on the cell you want to use as the constraining value for that constraint. Adding Constraints

35

36

37

38 You may define a set of similar constraints (e.g., all = constraints) in one step if they are in adjacent rows. Simply select the range of cells for the set of constraints in both the “Cell Reference” and “Constraint” window. After you are satisfied with the constraint(s), click the “Add” button if you want to add another constraint, or click the “OK” button if you want to go back to the original dialogue box. Notice that you may also force a decision variable to be an integer or binary (i.e., either 0 or 1) using this window. Adding Constraints

39 The Solver dialogue box now contains the optimization model, including the target cell (objective function), changing cells (decision variables), and constraints. Some Important Options

40 There is one important step. Click on the “Options” button in the Solver dialogue box, and click in both the “Assume Linear Model” and the “Assume Non-Negative” box. The “Assume Linear Model” option tells Excel that it is a linear program. This speeds the solution process, makes it more accurate, and enables the more informative sensitivity report. The “Assume Non-Negative” box adds non-negativity constraints to all of the decision variables. Some Important Options

41

42 After setting up the model, and selecting the appropriate options, it is time to click “Solve”. The Solution

43

44 When it is done, you will receive one of four messages: Solver found a solution. All constraints and optimality conditions are satisfied. This means that Solver has found the optimal solution. Cell values did not converge. This means that the objective function can be improved to infinity. You may have forgotten a constraint (perhaps the non-negativity constraints) or made a mistake in a formula. Solver could not find a feasible solution. This means that Solver could not find a feasible solution to the constraints you entered. You may have made a mistake in typing the constraints or in entering a formula in your spreadsheet. Conditions for Assume Linear Model not satisfied. You may have included a formula in your model that is nonlinear. There is also a slim chance that Solver has made an error. (This bug shows up occasionally.) The Solution

45 If Solver finds an optimal solution, you have some options. First, you must choose whether you want Solver to keep the optimal values in the spreadsheet (you usually want this one) or go back to the original numbers you typed in. Click the appropriate box to make you selection. you also get to choose what kind of reports you want. Once you have made your selections, click on “OK”. You will often want to also have the “Sensitivity Report”. To view the sensitivity report, click on the “Sensitivity Report” tab in the lower-left-hand corner of the window. The Solution

46

47 Binding (or Active) Constraints Non-Binding (or Inactive) Constraints Redundant Constraints Slack/Surplus Tightening a Constraint Loosening a Constraint Terminology

48 0 The Objective Function of the Prototype Problem

49 Solve the Problem using Solver

50 What is the optimal solution? What is the profit ( value of the O.F.) for the optimal solution? If the net profit per table changes, will the solution change? If the net profit per chair changes, will the solution change? If more (or less) large bricks are available, how will this affect our profit? If more (or less) small bricks are available, how will this affect our profit? Questions Answered by Excel

51 Then, choose “Sensitivity” under Reports. Sensitivity

52 The Sensitivity Report

53 Final ValueThe value of the variable in the optimal solution Reduced CostIncrease in the objective function value per unit increase in the value of a zero-valued variable (a product that the model has decided not to produce). AllowableDefines the range of the cost coefficients in Increase/ the objective function for which the current Decrease solution (value of the variables in the optimal solution) will not change. Output from Computer Solution : Changing Cells

54 Final Value The usage of the resource in the optimal solution. Shadow price The change in the value of the objective function per unit increase in the right hand side of the constraint: Z  = (Shadow Price)(RHS  ) (Only for change is within the allowable range) Output from Computer Solution : Constraints

55 Constraint The current value of the right hand side of the R.H. Side constraint (the amount of the resource that is available). Allowable The range of values of the RHS for which Increase/ the shadow price is valid and hence for which Decrease the new objective function value can be calculated. (NOT the range for which the current solution will not change.) Output from Computer Solution : Constraints

56 Net Profit from Tables = $28

57 Net Profit from Tables = $30

58 Net Profit from Tables = $35

59 Seven Large Bricks

60 Nine Large Bricks

61 Wyndor Optimal Solution What is the optimal Objective function value for this problem? What is the allowable range for changes in the objective coefficient for activity 2 What is the allowable range for changes in the RHS for resource 3. If the coefficient of the activity 2 in the objective function is changed to 7 What will happen to the value of the objective function? If the coefficient of the activity 1 in the objective function is changed to 8 What will happen to the value of the objective function? If the RHS of resource 2 is increased by 2 What will happen to the objective function. If the RHS of resource 1 is increased by 2 What will happen to the objective function. If the RHS of resource 2 is decreased by 10 What will happen to the objective function.

62 Wyndor Optimal Solution

63

64 Assignment The following 11 Questions refer to the following sensitivity report.

65 Assignment ( Taken from The management Sciences Hillier and Hillier) What is the optimal objective function value for this problem? a.It cannot be determined from the given information. b.$1,200. c.$975. d.$8,250. e.$500. What is the allowable range for the objective function coefficient for Activity 3? a.150 ≤ A3 ≤ ∞. b.0 ≤ A3 ≤ 650. c. 0 ≤ A3 ≤ 250. d.400 ≤ A3 ≤ ∞. e.300 ≤ A3 ≤ 500. What is the allowable range of the right-hand-side for Resource A? a.–∞ ≤ RHSA ≤ 60. b.0 ≤ RHSA ≤ 110. c.–∞ ≤ RHSA ≤ 110. d.110 ≤ RHSA ≤ 1600. e.0 ≤ RHSA ≤ 160.

66 Assignment ( Taken from The management Sciences Hillier and Hillier) If the coefficient for Activity 2 in the objective function changes to $400, then the objective function value: a.will increase by $7,500. b.will increase by $2,750. c.will increase by $100. d.will remain the same. e.can only be discovered by resolving the problem. If the coefficient for Activity 1 in the objective function changes to $50, then the objective function value: a.will decrease by $450. b.is $0. c.will decrease by $2750. d.will remain the same. e.can only be discovered by resolving the problem. If the coefficient of Activity 2 in the objective function changes to $100, then: a.the original solution remains optimal. b.the problem must be resolved to find the optimal solution. c.the shadow price is valid. d.the shadow price is not valid. e.None of the above.

67 Assignment ( Taken from The management Sciences Hillier and Hillier) If the right-hand side of Resource B changes to 80, then the objective function value: a.will decrease by $750. b.will decrease by $1500. c.will decrease by $2250. d.will remain the same. e.can only be discovered by resolving the problem. If the right-hand side of Resource C changes to 140, then the objective function value: a.will increase by $137.50. b.will increase by $57.50. c.will increase by $80. d.will remain the same. e.can only be discovered by resolving the problem. If the right-hand side of Resource C changes to 130, then: a.the original solution remains optimal. b.the problem must be resolved to find the optimal solution. c.the shadow price is valid. d.the shadow price is not valid.

68 More than one profit OR More than one resource If the sum of the ratio of (Change)/(Change in the Corresponding Direction) <=1 Things remain the same. If we are talking about profit, the production plan remains the same. If we are talking about RHS, the shadow prices remain the same.

69 Assignment ( Taken from The management Sciences Hillier and Hillier) If the objective coefficients of Activity 2 and Activity 3 are both decreased by $100, then: a.the optimal solution remains the same. b.the optimal solution may or may not remain the same. c.the optimal solution will change. d.the shadow prices are valid. e.None of the above. If the right-hand side of Resource C is increased by 40, and the right-hand side of Resource B is decreased by 20, then: a.the optimal solution remains the same. b.the optimal solution will change. c.the shadow price is valid. d.the shadow price may or may not be not valid. e.None of the above. Solver can be used to investigate the changes in how many data cells at a time? a.1 b.2 c.3 d.All of the above. e.a or b.

70

71 The Transportation Problem D (demand) D (demand) D (demand) S (supply) S (supply) S (supply)

72 There are 3 plants, 3 warehouses. Production of Plants 1, 2, and 3 are 300, 200, 200 respectively. Demand of warehouses 1, 2 and 3 are 250, 250, and 200 units respectively. Transportation costs for each unit of product is given below Transportation problem : Narrative representation Warehouse 123 1161811 Plant 2141213 3131517 Formulate this problem as an LP to satisfy demand at minimum transportation costs.

73 Supply Demand Supply Demand Data for the Transportation Model Quantity demanded at each destination Quantity supplied from each origin Cost between origin and destination.

74 $600 $400 $300 $200 WaxdaleBramptonSeaford Min.Milw.Chicago $700 $900 $100 $700 $800 Supply Locations Demand Locations 204050 Data for the Transportation Model

75 Our Task Our main task is to formulate the problem. By problem formulation we mean to prepare a tabular representation for this problem. Then we can simply pass our formulation ( tabular representation) to EXCEL. EXCEL will return the optimal solution. What do we mean by formulation?

76 Supply D -3D -2D -1 O -1 O -2 O -3 Demand 30 2060 20 40 50 600 400 300 700200900 800700100 110

77 Excel

78

79

80

81

82

83 Assignment: Problem at the middle of page 281 Solve the problem using excel

84 Assignment; Solve it using excel We have 3 factories and 4 warehouses. Production of factories are 100, 200, 150 respectively. Demand of warehouses are 80, 90, 120, 160 respectively. Transportation cost for each unit of material from each origin to each destination is given below. Destination 1234 14771 Origin 212388 3810165 Formulate this problem as a transportation problem

85 Excel : Data


Download ppt "Goals and aims To introduce Linear Programming To find a knowledge on graphical solution for LP problems To solve linear programming problems using excel."

Similar presentations


Ads by Google