Chapter 14b Solution Details
Chapter 14b Solution Details
Chapter 14b
Linear Programming:
Solution Details
(Chapter 14.1 – 14.2)
1
Example 1
We’ll now explore Excel’s Solver tool by applying it
to our “Example 0” problem from the first set of
slides
Tables sell for $16 and chairs sell for $10
A table uses 2 long pieces and 2 short pieces
A chair uses 1 long piece and 2 short pieces
You have 5 long pieces and 12 short pieces
3
Example 1: Objective Function
The Objective Function is the number we are trying
to optimize – which could mean minimize (such as
costs) or maximize (such as revenue or profits)
4
Example 1: Constraints
Constraints: we are limited to how much of each
type of lumber we have
5
LP using Excel
We’ve just done the hardest part of the problem:
identifying the components of the problem and
expressed them in terms of formulas
6
LP Template
But even before we do that, we need a standard
approach to these problems since there are a
myriad of variations to these problems, but they all
have the same components
• One objective
value
• Multiple
constraints
9
LP Template: Notes
10
LP Template: DVs
There will only be one
row and one value for
each Decision Variable
13
LP Template: Constraints
A constraint is a
value being less
than, equal to,
or greater than
another value
• LHS: Left Hand Side
The calculated value of one of the constraints
It is not the limitation, it is the number that is
being consumed (the # of tables)
14
LP Template: Constraints
A constraint is a
value being less
than, equal to,
or greater than
another value
• Sign: The relationship of that calculated value
to the limit. “<“, “<=“, “=“, “>=“, or “>”
It shows the desired relationship between
The LHS and the RHS
• RHS: Right Hand Side
The limit as given in the problem
It’s a fixed number, not a formula
15
LP Template
• Yellow cells are
calculated (the solution)
16
Example 1: DVs
The problem identifies
two decision variables:
the number of tables
and the number of
chairs
• Those are the values to be found or calculated –
the values that will maximize our revenue
• Each one is named for easy reference (always
label every cell in an Excel file)
• The problem has only 2 DVs, so we have only 2
columns
17
Example 1: Objective
The problem asks that
we maximize revenue,
so the metric cell is
labeled
18
SUMPRODUCT
SUMPRODUCT
19
SUMPRODUCT
Example: Invoice Total
26
Example 1: Constraints
27
Example 1: Constraints
28
Example 1: Constraints
29
Example 1: Constraints
30
Example 1: Our Model
31
Excel Absolute Reference
32
Configuring Solver
33
Example 1: DVs
Decision
Variables
Objective
Function
Constraints
34
Example 1: Objective
Decision
Variables
Objective
Function
Constraints
35
Example 1: Objective
Decision
Variables
Objective
Function
Notice that we must also tell it how to deal
with the objective function:
Constraints
Are we trying to maximize it, minimize it,
or set it to a specific value
36
Example 1: Constraints
Decision
Variables
Objective
Function
Constraints
37
Example 1: Constraints
Notice that we must also tell it that all the Decision Variables
must be positive
38
Example 1: Constraints
Trivia: The very first time Solver is used, this box is not
checked.
39
Example 1: Technique
Three are
available, we
will always use
the Simplex LP
method
40
Example 1: Solve
41
Example 1: Solution
43
Example 2: Setup
44
Example 2: Solution
45
LP Setup “Tricks”
Clearly the three components must be set up
correctly so Solver can find the solution
The Tricks:
– Identify the Decision Variables
– Identify the value to be optimized
– Write the formula for the Objective Function
– Identify all of the constraints
– Write the formula for each constraint
– Check your work by SLOWLY rereading the
problem and comparing it to your LP setup
46
LP Setup “Tricks”
Clearly the three components must bel set up ! !
c
correctly so Solver can find the solutione
The Tricks:
E x
e
– Identify the Decision Variables
– Identify the value to bevoptimized
o l
n v
– Write the formula for the Objective Function
i
– Identify all of the constraints
e
– Write the formula for each constraint
– Checkn
N o
problem
your work by SLOWLY rereading the
and comparing it to your LP setup
47
Steps to Solve LP Problems
1. Identify the Decision Variables
2. Identify and write the Objective Function
3. Identify the Constraints
4. Write the Constraints
5. Reread the problem and fix errors
6. Configure Excel’s Solver
7. Run Solver
48
Identify the Decision Variables
49
Identify the Objective
This, too, is typically obvious after reading the
problem
50
Identify the Objective
Sometimes these are NOT obvious after a brief
reading the problem
51
Write the Objective Function
This is translating the English phrase that describes
the objective into a mathematical formula
To do this:
– The value to be optimized is the value in cell G7; we
need to type its formula into this cell
– It must use all of the Decision Variables; more
complex objective functions may use additional
variables given in the problem
– The problem will give the parameters that relate the DVs
to the Objective. In our example, one table generated
$16 of revenue, so “16” is that parameter
52
Identify the Constraints
This step merely lists the constraints, it does not
write the formula – that comes next
53
Write the Constraints
Now we write out the formula for each constraint
individually
54
Step 5: Reread the Problem
This step absolutely cannot be skipped
56
Step 5: Reread the Problem
?
This is easily my most common error
and I teach this stuff
DON’T SKIP IT
57
Example 3
You work for the BIT Drill Company which manufactures two types of drills:
a corded model and a cordless model. You have contracted to supply a
national retail chain with at least 30,000 corded drills and at least 12,000
cordless drills. Your three departments have limited amounts of labor as
shown:
Department Corded Cordless Hrs Available
Production 0.2 0.3 10,000
Testing 0.3 0.4 15,000
Packaging 0.1 0.1 5,000
BIT makes its corded drill in-house for $52 and its cordless drill for $85.
How many of each type of drill should be made to minimize our costs?
58
Example 3: Setup
DVs: The number of Corded and Cordless drills
where C1 = # Corded drills
C2 = # Cordless drills
59
Example 3: Setup
Constraints:
Total Production hours <= 10,000
0.2 C1 + 0.3 C2 <= 10,000
Total Testing hours <= 15,000
0.3 C1 + 0.4 C2 <= 15,000
Total Packaging hours <= 5,000
0.1 C1 + 0.1 C2 <= 5,000
60
Example 3: Setup
Constraints:
Sales of Corded drills >= 30,000
1 C1 + 0 C2 >= 30,000
Sales of Cordless drills >= 12,000
0 C1 + 1 C2 >= 12,000
62
Example 3: Model
63
Example 3: Solution
64
Information in the Solution
65
Example 3b: Maximize
This example is a cost minimization problem – but
what would happen if we change it to a maximization
problem leaving the rest of the problem unchanged?
66
Example 3b: Maximize
• Costs rise to $2.69M
• Production is limited
to the max of 10,000
hours
• We made the
minimum number of
Corded drills
• We made more than
the minimum number
of Cordless drills
67
Example 4
Our BIT Drill Company was asked to expand the delivery
of Cordless drills to at least 16,000 drills. However, we
know that we cannot produce that many.
68
Example 4: Decision Variables
Reread the problem: Our company can make
Corded and Cordless drills, and we may buy
Corded and Cordless drills
69
Example 4: Setup
DVs:
– The number of Corded and Cordless drills that we make
where C1m = # Corded drills we make
C2m = # Cordless drills we make
70
Example 4: Setup
71
Example 4: Setup
Constraints:
Total Production hours <= 10,000
Total Testing hours <= 15,000
Total Packaging hours <= 5,000
Sales of Corded drills >= 30,000
1 C1m + 0 C2m + 1 C1b + 0 C2b >= 30,000
Sales of Cordless drills >= 16,000
0 C1m + 1 C2m + 0 C1b + 1 C2b >= 16,000
73
Example 4: Model
74
Example 4: Solution
75
Solve for the three variables
Have you seen this type of problem
on the internet?
76
Food Problem
Decision Variables ?
Krystal's (K), Fries (F), Chicken (C)
Objective Function ?
1K + 1F + 1C = ???
Constraints ?
Next slide
77
3 Constraints
• 3K + 0F + 0C = 24
• 2K - 1F + 0C = 12
• 0K + 1F + 1C = 11
78
Solver
K=8
F=4
C=7
79
Problem Presentation
80
Problem Presentation
Your Lego furniture company makes Tables and Chairs. Below, you are given the starting
inventory, selling price, and Bill of Materials (recipe, or construction requirements). You are to
determine the number of Tables and Chairs to be built to maximize revenue.
Your answer will be the revenue generated by your production plan - rounded to the nearest
whole dollar. (The number of tables and chairs may not be a whole number, which is acceptable
in this chapter.)
Use Scenario 2
Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5
Linear Programming
Excel’s Solver
Solver configuration
Solution interpretation
82
Learning
83
Questions?
84