Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company...

31
Chapter 4 Chapter 4 Linear Programming Models Linear Programming Models

Transcript of Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company...

Page 1: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Chapter 4Chapter 4

Linear Programming ModelsLinear Programming Models

Page 2: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Example 4.1 – Advertising ModelExample 4.1 – Advertising Model

►General Flakes Company advertises a low-fat General Flakes Company advertises a low-fat breakfast cereal in a variety of 30 second breakfast cereal in a variety of 30 second television ads placed in a variety of television television ads placed in a variety of television shows.shows.

►The ads in different shows vary by cost and by The ads in different shows vary by cost and by the type of viewers they are likely to reach.the type of viewers they are likely to reach. Viewers have been separated into six mutually Viewers have been separated into six mutually

exclusive categories.exclusive categories.

►The rating service can supply information on The rating service can supply information on the number of viewers.the number of viewers.

Page 3: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) - Advertising Ex. 4.1(cont’d) - Advertising ModelModel

► It wants to know how many ads to place It wants to know how many ads to place on each of several television shows to on each of several television shows to obtain required exposures at minimum obtain required exposures at minimum costs.costs.

►This model is essentially the opposite of This model is essentially the opposite of the product mix model.the product mix model.

►LP models ten to fall into “types” from a LP models ten to fall into “types” from a structural point of view, even though their structural point of view, even though their actual contexts might be very different.actual contexts might be very different.

Page 4: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – The ModelEx. 4.1(cont’d) – The Model

Page 5: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Developing the Ex. 4.1(cont’d) – Developing the ModelModel

► Follow these steps to develop the model:Follow these steps to develop the model:1.1.Input values and range namesInput values and range names. Enter the inputs . Enter the inputs

given.given.

2.2.Ads purchasedAds purchased. Enter . Enter anyany values in the values in the Number_ads_purchased range.Number_ads_purchased range.

3.3.Exposures obtainedExposures obtained. Enter the formula . Enter the formula =SUMPRODUCT(B6:I6,Number_ads_purchased)=SUMPRODUCT(B6:I6,Number_ads_purchased) in cell B23 and copy it down to cell B28.in cell B23 and copy it down to cell B28.

4.4.Total costTotal cost. In cell B31 enter the formula . In cell B31 enter the formula =SUMPRODUCT(B14:I14,Number_ads_purchased=SUMPRODUCT(B14:I14,Number_ads_purchased))

► The solution is not one that would be expected.The solution is not one that would be expected.

Page 6: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Sensitivity Ex. 4.1(cont’d) – Sensitivity AnalysisAnalysis

►Solver’s sensitivity report is enlightening for Solver’s sensitivity report is enlightening for this solution.this solution.

Page 7: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Dual Objective Ex. 4.1(cont’d) – Dual Objective Extension of the ModelExtension of the Model

► General Flakes has two competing objectivesGeneral Flakes has two competing objectives1.1. Obtain as many exposures as possibleObtain as many exposures as possible

2.2. Keep the total advertising cost as low as possibleKeep the total advertising cost as low as possible

► The original model minimized total cost and The original model minimized total cost and constrained the exposures to be at least as constrained the exposures to be at least as large as a required level.large as a required level.

► An alternative is to maximize the total An alternative is to maximize the total number of excess exposures and put a number of excess exposures and put a budget constraint on total cost.budget constraint on total cost.

Page 8: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Dual Objective Ex. 4.1(cont’d) – Dual Objective Extension of the ModelExtension of the Model

►To implement the alternative requires only minor To implement the alternative requires only minor modifications to the original.modifications to the original. Excess exposuresExcess exposures. Enter the formula =B23-D23 in cell . Enter the formula =B23-D23 in cell

F23. This cell becomes the new target cell to maximize.F23. This cell becomes the new target cell to maximize. Budget constraintBudget constraint. Calculate total cost but constrain it . Calculate total cost but constrain it

to be less than or equal to cell D23.to be less than or equal to cell D23. Solver dialog boxSolver dialog box. Modify the Solver dialog box as . Modify the Solver dialog box as

shown.shown.

Page 9: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Dual Objective Ex. 4.1(cont’d) – Dual Objective Extension of the ModelExtension of the Model

►For two objective models, one For two objective models, one objective must be optimized and a objective must be optimized and a constraint must be put on the other.constraint must be put on the other.

►The result is a “trade-off curve”.The result is a “trade-off curve”.

Page 10: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.1(cont’d) – Using Integer Ex. 4.1(cont’d) – Using Integer ConstraintsConstraints

►To force the changing cells to have integer To force the changing cells to have integer values, you simply add another constraint in values, you simply add another constraint in the Solver dialog box.the Solver dialog box.

►Be aware that Solver must do a Be aware that Solver must do a lotlot more more work to solve problems with integer work to solve problems with integer constraints.constraints.

Page 11: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Example 4.2 – Static Workforce Example 4.2 – Static Workforce ModelModel

►A post office requires different numbers of A post office requires different numbers of full-time employees on different days of the full-time employees on different days of the week. The number of full-time employees week. The number of full-time employees required each day is given.required each day is given.

►Union rules state that each full-time Union rules state that each full-time employee must work 5 consecutive days and employee must work 5 consecutive days and then receive 2 days off. They only want to then receive 2 days off. They only want to employ full-time employees.employ full-time employees.

► Its objective is to minimize the number of Its objective is to minimize the number of full-time employees that must be hired.full-time employees that must be hired.

Page 12: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – The Ex. 4.2 (cont’d) – The SolutionSolution

► In real employee scheduling problems In real employee scheduling problems much of the work involves forecasting and much of the work involves forecasting and queuing analysis to obtain worker queuing analysis to obtain worker requirements. All of which must be done requirements. All of which must be done before any schedule optimizing.before any schedule optimizing.

►The key to this model is choosing the The key to this model is choosing the correct changing cells.correct changing cells.

►The trick is to define to numbers of The trick is to define to numbers of employees working each of the 7 possible employees working each of the 7 possible 5 day shifts.5 day shifts.

Page 13: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – The ModelEx. 4.2 (cont’d) – The Model

Page 14: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – Developing Ex. 4.2 (cont’d) – Developing the Modelthe Model

► To form the spreadsheet, proceed as follows.To form the spreadsheet, proceed as follows.1.1.Inputs and range namesInputs and range names. Enter the number of . Enter the number of

employees needed on each day of the week. employees needed on each day of the week. 2.2.Employees beginning each dayEmployees beginning each day. Enter any trial . Enter any trial

values for the number of employees beginning work on values for the number of employees beginning work on each day in the Employee_starting range.each day in the Employee_starting range.

3.3.Employees on hand each dayEmployees on hand each day. Enter the formula . Enter the formula =$B$4=$B$4 in cell B14 and copy it across to cell F14. in cell B14 and copy it across to cell F14. Proceed similarly for rows 15-20, being careful to take Proceed similarly for rows 15-20, being careful to take “wrap arounds” into account.“wrap arounds” into account.

After completing these rows calculate the total number After completing these rows calculate the total number who show up each day by entering the formula who show up each day by entering the formula =SUM(B14:B20)=SUM(B14:B20) in cell B21 and copying across to cell in cell B21 and copying across to cell H21.H21.

4.4.Total employeesTotal employees. Calculate the total number of . Calculate the total number of employees in cell B25 with the formula employees in cell B25 with the formula =SUM(Employees_Starting).=SUM(Employees_Starting).

Page 15: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – The SolverEx. 4.2 (cont’d) – The Solver

► Invoke Solver with this dialog box.Invoke Solver with this dialog box.

Page 16: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – The Ex. 4.2 (cont’d) – The SolutionSolution

►A drawback is the number of A drawback is the number of employees starting work on some employees starting work on some days is a fraction. days is a fraction. It’s simple to add an integer It’s simple to add an integer

constraint on the changing cells.constraint on the changing cells.

►Set Solver’s Tolerance to 0 to Set Solver’s Tolerance to 0 to ensure that you get the optimal ensure that you get the optimal solution. solution.

Page 17: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – Sensitivity Ex. 4.2 (cont’d) – Sensitivity AnalysisAnalysis

►How does the work schedule and the total How does the work schedule and the total number of employees change as the number of number of employees change as the number of employees required each day changes?employees required each day changes? Use SolverTable after altering the model slightly.Use SolverTable after altering the model slightly. Move the original requirements up to row 12, enter a Move the original requirements up to row 12, enter a

trail value for the extra number required per day in trail value for the extra number required per day in cell K12.cell K12.

Enter the formula Enter the formula =B12+$K$12=B12+$K$12 in cell B27 and copy in cell B27 and copy it across to H27.it across to H27.

►Solver’s sensitivity report was not used Solver’s sensitivity report was not used Solver does not offer a sensitivity report for models Solver does not offer a sensitivity report for models

with integer constraints.with integer constraints. The sensitivity report is not suited for questions The sensitivity report is not suited for questions

about multiple input changes.about multiple input changes.

Page 18: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – Sensitivity Ex. 4.2 (cont’d) – Sensitivity Analysis for the ModelAnalysis for the Model

Page 19: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.2 (cont’d) – Modeling Ex. 4.2 (cont’d) – Modeling IssuesIssues

►This type of problem dealt with what is called This type of problem dealt with what is called a a staticstatic scheduling model, because it is scheduling model, because it is assumed that the post office faces the same assumed that the post office faces the same situation each week. situation each week.

► In reality demands change and In reality demands change and dynamic dynamic scheduling models are needed.scheduling models are needed.

► In many scheduling models, In many scheduling models, heuristic heuristic methods (clever trial and error algorithms) methods (clever trial and error algorithms) can often be used.can often be used.

►Heuristic solutions are often close to optimal, Heuristic solutions are often close to optimal, but they are never guaranteed to be optimal.but they are never guaranteed to be optimal.

Page 20: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Example 4.3 – Aggregate Example 4.3 – Aggregate Planning ModelPlanning Model

►During the next four months the SureStep During the next four months the SureStep Company must meet (on time) the following Company must meet (on time) the following demands for pairs of shoes.demands for pairs of shoes.

►At the beginning of month 1, 500 pairs of At the beginning of month 1, 500 pairs of shoes are on hand, and SureStep has 100 shoes are on hand, and SureStep has 100 workers.workers.

►A worker is paid $1,500 per month. Each A worker is paid $1,500 per month. Each worker can work up to 160 hours a month worker can work up to 160 hours a month before he or she receives overtime.before he or she receives overtime.

►A worker is forced to work 20 hours of A worker is forced to work 20 hours of overtime per month and is paid $13 per hour overtime per month and is paid $13 per hour for overtime labor.for overtime labor.

Page 21: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – Ex. 4.3 (cont’d) – Aggregate Planning ModelAggregate Planning Model► It takes 4 hours of labor and $15 of raw It takes 4 hours of labor and $15 of raw

material to produce a pair of shoes.material to produce a pair of shoes.►At the beginning of each month workers can At the beginning of each month workers can

be hired or fired. Each hired worker costs be hired or fired. Each hired worker costs $1600, and each fired worker cost $2000.$1600, and each fired worker cost $2000.

►At the end of each month, a holding cost of At the end of each month, a holding cost of $3 per pair of shoes left in inventory is $3 per pair of shoes left in inventory is incurred. incurred.

►SureStep wants to us LP to determine its SureStep wants to us LP to determine its optimal production schedule and labor policy.optimal production schedule and labor policy.

Page 22: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – The Ex. 4.3 (cont’d) – The SolutionSolution

►Most difficult aspect is knowing which Most difficult aspect is knowing which variables the company gets to choose variables the company gets to choose and which are and which are determineddetermined by these by these decisions.decisions.

►The company gets to chooseThe company gets to choose The number of workers to hire and fire.The number of workers to hire and fire. The number of shoes to produce.The number of shoes to produce. How many overtime hours to use within How many overtime hours to use within

this limit.this limit.

►All the rest of the are determined.All the rest of the are determined.

Page 23: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – The Ex. 4.3 (cont’d) – The ModelModel

Page 24: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – Ex. 4.3 (cont’d) – Developing the ModelDeveloping the Model

►Developed as follows:Developed as follows: InputsInputs. Enter the input data in the range B4:B14 and in . Enter the input data in the range B4:B14 and in

the Forecasted_demand range.the Forecasted_demand range. Production, hiring and firing plansProduction, hiring and firing plans. Enter any trial . Enter any trial

values for the number of pairs of shoes produced each values for the number of pairs of shoes produced each month, the overtime hours used each month, the workers month, the overtime hours used each month, the workers hired each month, and the workers fired each month. hired each month, and the workers fired each month.

Workers available each monthWorkers available each month. In cell B17 enter the . In cell B17 enter the initial number of workers available with the formula initial number of workers available with the formula =B5=B5. .

Because the number of workers available at the Because the number of workers available at the beginning of any other month is equal to the number of beginning of any other month is equal to the number of workers from the previous month, enter the formula workers from the previous month, enter the formula =B20=B20 in cell C17 and copy it to the range D17:E17. in cell C17 and copy it to the range D17:E17.

Then in cell B20 calculate the number of workers Then in cell B20 calculate the number of workers available in month 1 with the formula available in month 1 with the formula =B17+B18-B19=B17+B18-B19 and copy this formula to the range C20:E20. and copy this formula to the range C20:E20.

Overtime capacityOvertime capacity. Enter the formula . Enter the formula =$B$7*B20=$B$7*B20 in in cell B25 and copy it to the range C25:E25.cell B25 and copy it to the range C25:E25.

Page 25: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – Developing the Ex. 4.3 (cont’d) – Developing the ModelModel

Production capacityProduction capacity. Calculate the regular-time hours available in . Calculate the regular-time hours available in month 1 in cell B22 with the formula month 1 in cell B22 with the formula =$B$6*B20=$B$6*B20 and copy it to the and copy it to the range C22:E22 for the other months. range C22:E22 for the other months.

Then calculate the total hours available for production in cell B27 Then calculate the total hours available for production in cell B27 with the formula with the formula =SUM(B22:B23)=SUM(B22:B23) and copy it to the range and copy it to the range C27:E27. C27:E27.

Calculate the production capacity for month 1 by entering the Calculate the production capacity for month 1 by entering the formula formula =B27/$B$12=B27/$B$12 in cell B32, and copy it to the range C32:E32. in cell B32, and copy it to the range C32:E32.

Inventory each monthInventory each month. Enter the formula . Enter the formula =B4+B30=B4+B30 in cell B34. in cell B34.

For any other month, the inventory after production is the previous For any other month, the inventory after production is the previous month’s ending inventory plus tat month’s production, so enter the month’s ending inventory plus tat month’s production, so enter the formula formula =B37+C30=B37+C30 in cell C34 and copy it to the range D34:E34. in cell C34 and copy it to the range D34:E34.

Then calculate the month 1 ending inventory in cell B37 with the Then calculate the month 1 ending inventory in cell B37 with the formula formula =B34-B36=B34-B36 and copy it to the range C37:E37. and copy it to the range C37:E37.

Page 26: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – Developing the Ex. 4.3 (cont’d) – Developing the ModelModel

Monthly costsMonthly costs. Calculate the various costs shown in rows 40 . Calculate the various costs shown in rows 40 through 45 for month 1 by entering the formulas through 45 for month 1 by entering the formulas

=$B$8*B18=$B$8*B18

=$B$9*B19=$B$9*B19

=$B$10*B20=$B$10*B20

=$B$11*B23=$B$11*B23

=$B$13*B30=$B$13*B30

=$B$14*B37=$B$14*B37

in cells B40 through B45. Then copy the range B40:B45 to the in cells B40 through B45. Then copy the range B40:B45 to the range C40:E45 to calculate these costs for the other months.range C40:E45 to calculate these costs for the other months.

TotalsTotals. In row 46 and column F, use the SUM function to . In row 46 and column F, use the SUM function to calculate cost totals, with the value in F46 being the overall calculate cost totals, with the value in F46 being the overall total cost.total cost.

Page 27: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – Using Ex. 4.3 (cont’d) – Using SolverSolver

► It is often best to ignore such constraints, It is often best to ignore such constraints, especially when the optimal values are fairly especially when the optimal values are fairly large, as are the production quantities in this large, as are the production quantities in this model.model.

► If the solution then has noninteger values, they If the solution then has noninteger values, they can be rounded to integers for a solution that is can be rounded to integers for a solution that is at least close to the optimal integer solution.at least close to the optimal integer solution.

Page 28: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) –Solution & Ex. 4.3 (cont’d) –Solution & Sensitivity AnalysisSensitivity Analysis

►Because integer constraints make a Because integer constraints make a model harder to solve, use them sparingly model harder to solve, use them sparingly – only when they are really needed.– only when they are really needed.

►To ensure that Solver finds the optimal To ensure that Solver finds the optimal solution in a problem where some or all of solution in a problem where some or all of the changing cells must be integers, set the changing cells must be integers, set the tolerance to 0. the tolerance to 0.

►Many sensitivity analyses could be Many sensitivity analyses could be performed on this model.performed on this model.

►One of them uses SolverTable to see how One of them uses SolverTable to see how the overtime hours used and tot total cost the overtime hours used and tot total cost vary with the overtime wage rate.vary with the overtime wage rate.

Page 29: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Ex. 4.3 (cont’d) – The Rolling Ex. 4.3 (cont’d) – The Rolling Planning Horizon ApproachPlanning Horizon Approach

►Aggregate planning model is usually Aggregate planning model is usually implemented via a rolling planning horizon.implemented via a rolling planning horizon.

►SureStep works with a 4-month planning SureStep works with a 4-month planning horizon.horizon.

►To implement the rolling planning horizon To implement the rolling planning horizon context, view the “demands” as forecasts context, view the “demands” as forecasts and solve a 4-month model with these and solve a 4-month model with these forecasts.forecasts.

►Only month 1 production is implemented. Only month 1 production is implemented. ►Month 1’s actual demand is observed and Month 1’s actual demand is observed and

then used to calculate the next 4 months.then used to calculate the next 4 months.

Page 30: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

Backlogging & NonSmooth Backlogging & NonSmooth FunctionsFunctions

►The term “backlogging” means that the The term “backlogging” means that the customer's demand will be met at a later date. customer's demand will be met at a later date. Backordering means the same thing.Backordering means the same thing.

►Formulas that contain IF functions accurately Formulas that contain IF functions accurately compute holding and shortage costs but they compute holding and shortage costs but they make the target cell a make the target cell a nonlinearnonlinear function of the function of the changing cells.changing cells.

►When certain functions are used to relate the When certain functions are used to relate the target cell to the changing cells, the resulting target cell to the changing cells, the resulting model becomes not only nonlinear but model becomes not only nonlinear but “nonsmooth”“nonsmooth”

►““Nonsmooth” functions can have discontinuities Nonsmooth” functions can have discontinuities and should be avoided in optimization models. and should be avoided in optimization models. They can be handled with a They can be handled with a genetic genetic algorithm.algorithm.

Page 31: Chapter 4 Linear Programming Models. Example 4.1 – Advertising Model General Flakes Company advertises a low- fat breakfast cereal in a variety of 30.

4.5 Blending Models4.5 Blending Models

►Linear programming can find the Linear programming can find the optimal combination of outputs as optimal combination of outputs as well as the “mix” of inputs that are well as the “mix” of inputs that are used to produce the desired outputs.used to produce the desired outputs.

►Blending models usually have various Blending models usually have various “quality” constraints, often expressed “quality” constraints, often expressed as required percentages of various as required percentages of various ingredients.ingredients.

►To keep these models linear (and To keep these models linear (and avoid dividing by 0), it is important to avoid dividing by 0), it is important to “clear denominators.“clear denominators.