You are on page 1of 47

Chapter 2

Linear Programming: Basic


Concepts
©2019 McGraw-Hill Education. All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of
2.1
McGraw-Hill Education.
Table of Contents
The Wyndor Glass Company Product Mix Problem (Section 2.1) 2.2
Formulating the Wyndor Problem on a Spreadsheet (Section 2.2) 2.3–2.8
The Algebraic Model for Wyndor (Section 2.3) 2.9
The Graphical Method Applied to the Wyndor Problem (Section 2.4) 2.10–2.20
Using Excel’s Solver with the Wyndor Problem (Section 2.5) 2.21–2.25
Analytic Solver (Section 2.6) 2.26–2.33
A Minimization Example—The Profit & Gambit Co. (Section 2.7) 2.34–2.39

2.2
© 2019 McGraw-Hill Education.
Wyndor Glass Co. Product Mix
Problem
Wyndor has developed the following new products:
• An 8-foot glass door with aluminum framing.
• A 4-foot by 6-foot double-hung, wood-framed window.

The company has three plants


• Plant 1 produces aluminum frames and hardware.
• Plant 2 produces wood frames.
• Plant 3 produces glass and assembles the windows and doors.

Questions:
1. Should they go ahead with launching these two new products?
2. If so, what should be the product mix?

2.3
© 2019 McGraw-Hill Education.
Developing a Spreadsheet Model 1

Step #1: Data Cells


• Enter all of the data for the problem on the spreadsheet.
• Make consistent use of rows and columns.
• It is a good idea to color code these “data cells” (e.g., light blue).

A B C D E F G
1 Wyndor Glass Co. Product-Mix Problem
2
3 Doors Windows
4 Unit Profit $300 $500
5 Hours
6 Hours Used Per Unit Produced Available
7 Plant 1 1 0 4
8 Plant 2 0 2 12
9 Plant 3 3 2 18

2.4
© 2019 McGraw-Hill Education.
Developing a Spreadsheet Model 2

Step #2: Changing Cells


• Add a cell in the spreadsheet for every decision that needs to be made.
• If you don’t have any particular initial values, just enter 0 in each.
• It is a good idea to color code these “changing cells” (e.g., yellow with border).

A B C D E F G
1 Wyndor Glass Co. Product-Mix Problem
2
3 Doors Windows
4 Unit Profit $300 $500
5 Hours
6 Hours Used Per Unit Produced Available
7 Plant 1 1 0 4
8 Plant 2 0 2 12
9 Plant 3 3 2 18
10
11 Doors Windows
12 Units Produced 0 0

2.5
© 2019 McGraw-Hill Education.
Developing a Spreadsheet Model 3

Step #3: Objective Cell


• Develop an equation that defines the objective of the model.
• Typically this equation involves the data cells and the changing cells in order to
determine a quantity of interest (e.g., total profit or total cost).
• It is a good idea to color code this cell (e.g., orange with heavy border).

2.6
© 2019 McGraw-Hill Education.
Developing a Spreadsheet Model 4

Step #4: Constraints


• For any resource that is restricted, calculate the amount of that resource used in a
cell on the spreadsheet (an output cell).
• Define the constraint in three consecutive cells. For example, if Quantity A <=
Quantity B, put these three items (Quantity A, <=, Quantity B) in consecutive cells.

A B C D E F G
1 Wyndor Glass Co. Product-Mix Problem
2
3 Doors Windows
4 Unit Profit $300 $500
5 Hours Hours
6 Hours Used Per Unit Produced Used Available
7 Plant 1 1 0 0 <= 4
8 Plant 2 0 2 0 <= 12
9 Plant 3 3 2 0 <= 18
10
11 Doors Windows Total Profit
12 Units Produced 0 0 $0

2.7
© 2019 McGraw-Hill Education.
Formulas for the Spreadsheet Model

2.8
© 2019 McGraw-Hill Education.
A Trial Solution

The spreadsheet for the Wyndor problem with a trial solution (4


doors and 3 windows) entered into the changing cells.

2.9
© 2019 McGraw-Hill Education.
Algebraic Model for Wyndor
Glass Co.
Let D = the number of doors to produce
W = the number of windows to produce

Maximize P = $300D + $500W


subject to
D≤4
2W ≤ 12
3D + 2W ≤ 18
and
D ≥ 0, W ≥ 0.

2.10
© 2019 McGraw-Hill Education.
Graphing the Product Mix
W

Production rate (units per week) for windows


A product mix of
7 D = 4 and W = 6

6 (4, 6)

4 A product mix of
D = 2 and W = 3
3 (2, 3)

1
Origin

-2 -1 0 1 2 3 4 5 6 7 8 D
Production rate (units per week) for doors
-1

-2

2.11
© 2019 McGraw-Hill Education.
Graph Showing Constraints: D ≥ 0
and W ≥ 0
W

6
Production rate for windows

0 2 4 6 8 D
Production rate for doors

2.12
© 2019 McGraw-Hill Education.
Nonnegative Solutions Permitted
by D ≤ 4
W

D=4

6
Production rate for windows

0 2 4 6 8 D
Production rate for doors

2.13
© 2019 McGraw-Hill Education.
Nonnegative Solutions Permitted
by 2W ≤ 12
Production rate for windows
W

2 W = 12
6

0 2 4 6 8 D
Production rate for doors

2.14
© 2019 McGraw-Hill Education.
Boundary Line for Constraint
3D + 2W ≤ 18
Production rate for windows
W
10

(0, 9)

8
1
(1, 7 _)
2

6 (2, 6)

3 D + 2 W = 18
1
(3, 4 _)
2
4

(4, 3)

2
1
(5, 1 _)
2

(6, 0)
0 2 4 6 8 D
Production rate for doors

2.15
© 2019 McGraw-Hill Education.
Changing Right-Hand Side Creates
Parallel Constraint Boundary Lines
Production rate for windows
W
12

10

3D + 2W = 24

3D + 2W = 18
4

2 3D + 2W = 12

0 2 4 6 8 10 D
Production rate for doors

2.16
© 2019 McGraw-Hill Education.
Nonnegative Solutions
Permitted by 3D + 2W ≤ 18
Production rate for windows
W
10

3D + 2W = 18
4

0 2 4 6 8 D
Production rate for doors

2.17
© 2019 McGraw-Hill Education.
Graph of Feasible Region
Production rate for windows
W
10

3 D + 2 W = 18
8

D=4

6 2 W =12

Feasible

region
2

0 2 4 6 8 D
Production rate for doors

2.18
© 2019 McGraw-Hill Education.
Objective Function (P = 1,500)
W
Production rate

for windows
8

Feasible
4
region
P = 1500 = 300D + 500W

0 2 4 6 8 D
Production rate for doors

2.19
© 2019 McGraw-Hill Education.
Finding the Optimal Solution
Production rate W
for windows
8

P = 3600 = 300D + 500W


Optimal solution

P = 3000 = 300D + 500W 6 (2, 6)

Feasible
4
region
P = 1500 = 300D + 500W

0 2 4 6 8 10 D
Production rate for doors

Access the long description slide.


2.20
© 2019 McGraw-Hill Education.
Summary of the Graphical
Method 1

• Draw the constraint boundary line for each constraint. Use the origin
(or any point not on the line) to determine which side of the line is
permitted by the constraint.
• Find the feasible region by determining where all constraints are
satisfied simultaneously.
• Determine the slope of one objective function line. All other objective
function lines will have the same slope.
• Move a straight edge with this slope through the feasible region in the
direction of improving values of the objective function. Stop at the last
instant that the straight edge still passes through a point in the feasible
region. This line given by the straight edge is the optimal objective
function line.
• A feasible point on the optimal objective function line is an optimal
solution.
2.21
© 2019 McGraw-Hill Education.
Identifying the Objective Cell and Changing Cells

• Choose the “Solver” from the Data tab.


• Select the cell you wish to optimize in the “Set Objective” window.
• Choose “Max” or “Min” depending on whether you want to maximize or minimize the
objective cell.
• Enter all the changing cells in the “By Changing Variable Cells” window.

Access the long description slide.


2.22
© 2019 McGraw-Hill Education.
Adding Constraints
• To begin entering constraints, click the “Add” button to the right of
the constraints window.
• Fill in the entries in the resulting Add Constraint dialogue box.

2.23
© 2019 McGraw-Hill Education.
The Complete Solver Dialogue Box

Access the long description slide.


2.24
© 2019 McGraw-Hill Education.
The Solver Results Dialogue Box

2.25
© 2019 McGraw-Hill Education.
The Optimal Solution 1

2.26
© 2019 McGraw-Hill Education.
Analytic Solver

2.27
© 2019 McGraw-Hill Education.
Specifying the Objective Cell with
Analytic Solver

2.28
© 2019 McGraw-Hill Education.
Specifying the Changing Cells
with Analytic Solver

2.29
© 2019 McGraw-Hill Education.
Adding Constraints with Analytic
Solver 1

2.30
© 2019 McGraw-Hill Education.
Adding Constraints with Analytic
Solver 2

2.31
© 2019 McGraw-Hill Education.
Making Changes with the Model
Pane in Analytic Solver

Access the long description slide.


2.32
© 2019 McGraw-Hill Education.
Specifying Options with Analytic
Solver

Access the long description slide.


2.33
© 2019 McGraw-Hill Education.
The Optimal Solution with
Analytic Solver

2.34
© 2019 McGraw-Hill Education.
The Profit & Gambit Co.
Management has decided to undertake a major advertising campaign
that will focus on the following three key products:
• A spray prewash stain remover.
• A liquid laundry detergent.
• A powder laundry detergent.
The campaign will use both television and print media
The general goal is to increase sales of these products.
Management has set the following goals for the campaign:
• Sales of the stain remover should increase by at least 3%.
• Sales of the liquid detergent should increase by at least 18%.
• Sales of the powder detergent should increase by at least 4%.
Question: how much should they advertise in each medium to
meet the sales goals at a minimum total cost?
2.35
© 2019 McGraw-Hill Education.
Profit & Gambit Co. Spreadsheet
Model

Access the long description slide.


2.36
© 2019 McGraw-Hill Education.
Algebraic Model for Profit &
Gambit
Let TV = the number of units of advertising on television
PM = the number of units of advertising in the print media

Minimize Cost = TV + 2PM (in millions of dollars)


subject to
Stain remover increased sales: PM ≥ 3
Liquid detergent increased sales: 3TV + 2PM ≥ 18
Powder detergent increased sales: −TV + 4PM ≥ 4
and
TV ≥ 0, PM ≥ 0.

2.37
© 2019 McGraw-Hill Education.
Applying the Graphical Method
Amount of print media advertising
PM

Feasible
10
region

PM = 3
2
-TV + 4 PM = 4
3 TV + 2 PM = 18

-4 -2 0 2 4 6 8 10 TV
Amount of TV advertising

2.38
© 2019 McGraw-Hill Education.
The Optimal Solution 2

PM

10
Feasible
Cost = 15 = TV + 2 PM region

Cost = 10 = TV + 2 PM

4
(4,3)
optimal
solution
0 5 10 15 TV
Amount of TV advertising

Access the long description slide.


2.39
© 2019 McGraw-Hill Education.
Summary of the Graphical
Method 2

• Draw the constraint boundary line for each constraint. Use the origin
(or any point not on the line) to determine which side of the line is
permitted by the constraint.
• Find the feasible region by determining where all constraints are
satisfied simultaneously.
• Determine the slope of one objective function line. All other
objective function lines will have the same slope.
• Move a straight edge with this slope through the feasible region in
the direction of improving values of the objective function. Stop at
the last instant that the straight edge still passes through a point in
the feasible region. This line given by the straight edge is the optimal
objective function line.
• A feasible point on the optimal objective function line is an optimal
solution.
2.40
© 2019 McGraw-Hill Education.
Finding the Optimal Solution Long
Description
Price equals 3,600 is downward sloping and touches
the feasible region at (2, 6) only. Price equals 3,000 is
downward sloping (0, 6) across the region. Price equals
1,500 is downward sloping from (0, 3) across the
region.

Return to slide containing original image.


2.41
© 2019 McGraw-Hill Education.
Identifying the Objective Cell and
Changing Cells Long Description
The following values are shown: $G$12 in the “Set
Objective” field; “To:” is set to max; $C$12:$D$12 is in
the “By Change Variable Cells” field; and the selected
solved method is GRG Nonlinear

Return to slide containing original image.


2.42
© 2019 McGraw-Hill Education.
The Complete Solver Dialogue
Box Long Description
The following values are shown: Total Profit in the
“Set Objective” field; “To:” is set to max; Units
Produced is in the “By Change Variable Cells” field;
“Subject to the Constraints” has Hours Used <= Hours
Available; Make Uncontraed Variables Non-Negative is
checked, and the selected solved method is Simplex
LP.

Return to slide containing original image.


2.43
© 2019 McGraw-Hill Education.
Making Changes with the Model Pane
in Analytic Solver Long Description
Under Objective is Total Profit (Max). Under Variables
is Normal and Recourse, with Normal open and Units
Produced is checked. Under Contraints is Normal,
which is open and HoursUsed <= HoursAvailable is
checked.

Return to slide containing original image.


2.44
© 2019 McGraw-Hill Education.
Specifying Options with Analytic
Solver Long Description
Values under General are Max Time 100; Iterations
100; Primal Tolerance 1e-007; Dual Tolerance 1e-007;
Show Iterations False; Use Automatic Scaling False;
Assume Non-Negative True; Bypass Solver Reports
False; Presolve True; and Derivatives Forward. Values
under Integer are Maximum subproblems [empty];
Maximum Feasible Sol…[empty]; Integer Tolerance
0.01; Integer Cutoff [empty]; PreProcessing Automatic;
Cuts Automatic; and Heuristics Automatic.

Return to slide containing original image.


2.45
© 2019 McGraw-Hill Education.
Profit & Gambit Co. Spreadsheet
Model Long Description
Figure shows Profit and Gambit spreadsheet across the
top, the solver parameters below and left, formulas in
Cells E6 to E10 and G12 to G14 below and right, and a
range name and cell table at the bottom right.

Return to slide containing original image.


2.46
© 2019 McGraw-Hill Education.
The Optimal Solution Long
Description
Print media is on the vertical axis, and television
advertising is on the horizontal. The feasible region is
the area above a line from (0, 9) to (4,3) to (8, 3.2) to
(15, 5). The optimal solution is point (4, 3). Cost equals
15 is a line from (0, 8.5) to (15, 0). Cost equals 10 is a
line from (0, 5) through (4, 3) and (10, 0).

Return to slide containing original image.


2.47
© 2019 McGraw-Hill Education.

You might also like