0% found this document useful (0 votes)
8 views

Chapter 14b Solution Details

Business Analytics SCSM 3711

Uploaded by

hr5667071
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Chapter 14b Solution Details

Business Analytics SCSM 3711

Uploaded by

hr5667071
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 84

SCMS 3711

Business Analysis - Tools

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

What combination of tables and chairs can you


make to maximize your revenue given your limited
inventory?
2
Example 1: DVs
Since all LP problems have all three components,
we start by identifying them

Decision Variables: we control how many tables


and chairs we make, so these are our DVs
t = # tables
c = # chairs

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)

Objective Function: Revenue = $16t + $10c

The choice of whether to


“maximize” or “minimize” is always
related to the Objective Function

4
Example 1: Constraints
Constraints: we are limited to how much of each
type of lumber we have

The number of long pieces is 2 for each table and 1


for each chair, so:
# Long = 2t + 1c <= 5

The number of short pieces is 2 for each table and


2 for each chair, so:
# Short = 2t + 2c <= 12

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

We’ve taken this as far as we can without a tool:


we either need the mathematical technique or
algorithm, or we need a computing tool

We skip the mathematics and go to the tool:


Excel’s Solver

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

Although these variables and formulas can appear


anywhere in Excel, we will use a standard template

This gives us a standard that all of our problems


can use
7
LP Template
• DVs
(as needed)

• One objective
value

• Multiple
constraints

Download the Excel LP Template found online


8
LP Template: Notes
This template has been created for your use and
demonstration purposes

It visually reinforces some of the requirements of


Excel’s Solver

However, Excel itself does not impose many


requirements on where the DVs, Objective
Function, or Constraints are in a workbook
– they can even be on different worksheets
– DVs can be in columns, etc.

9
LP Template: Notes

This template also reinforces some best practices


for spreadsheet design such as:
– labeling every cell (or set of cells)
– having appropriate white space around blocks of
similar data or parameters
– selective, consistent, yet limited color coding to
highlight groups and/or types of data

10
LP Template: DVs
There will only be one
row and one value for
each Decision Variable

• These are the values that we are trying to find (the


number of tables and chairs, the number of employees,
etc.) – i.e., these are our “answer”, the values that we
can control (such as how many tables and chairs)
• We may enter values in these cells as we test our setup,
but these will be calculated by Excel’s Solver
• In actual business problems, there could be from 2 to
hundreds of thousands of columns (DVs)
11
LP Template: Objective
There is only one
value and typically
(but not always)
only one row
• These are aligned with the DVs above them
• They represent the units of the Objective Function
that correspond to the DVs
(for our example, they are the revenue per DV)
• The Value cell is an Excel formula that you create
(for our example, it is effectively 16T + 10C, but
we will develop the actual formula later)
12
LP Template: Constraints
The limitations
from the
problem

• These are also aligned with the DVs above them


• They represent the parameters from the
problem’s constraints, such as 2 long pieces of
lumber per table
• In actual business problems, there could be from
hundreds to millions of rows of Constraints

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)

• Green cells are fixed


numbers

• Blue cells have


identical Excel formulas
(later)
• Orange cells are entered based on the problem

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

• The value corresponding to the number of tables


is 16, because 16 times the # tables = revenue
• The value corresponding to the number of chairs
is 10, because 10 times the # chairs = revenue

18
SUMPRODUCT

SUMPRODUCT

Returns the sum of the products of


corresponding ranges or arrays

The default operation is multiplication

19
SUMPRODUCT
Example: Invoice Total

C9 calculates 22(1.15) + 1(42.95) + 4(19.95)


+ 1(0.98) + 15(2.29)
20
Example 1: Objective

The Revenue cell is


=SUMPRODUCT(D4:E4,D7:E7)
It performs the following calculation without having
to type all of the multiplication and addition signs:
D4 * D7 + E4 * E7
(Very useful if there are many DVs)
21
Example 1: Objective
Use absolute
referencing to reduce
the chance of human
error

The Revenue cell can be modified for absolute


referencing by using the F4 key
=SUMPRODUCT($D$4:$E$4,D7:E7)
Now the formula can be copied into the constraint
rows without bothering to adjust the reference to the
decision variables (as we will see later)
22
Use every DV in every
calculation

We just saw how we used every Decision


Variable to calculate our Objective Function,
Revenue
For this example, it was rather obvious
As we develop the constraints, we will
ALWAYS include every DV in every
constraint calculation
23
Multiplication by 0

You already know that 0 times anything is 0

We will use that knowledge along with the


SUMPRODUCT function a lot as we calculate
constraints
These actually simplify our calculations so
that we can use every DV in the
calculation of every constraint
24
Excel Absolute Reference

The “$” signs in Excel formulas are called


“absolute references” – they tell Excel to
keep the exact cell references in the formulas
(i.e., don’t move the location of the
referenced cell)

We will use this in our use of SUMPRODUCT


to be sure we always reference the Decision
Variable
25
Example 1: Constraints

The constraint for the number of Short pieces of Legos


must count the number of short pieces that will be used
– A table needs 2 and a chair needs 2

– The number of Short pieces is 2 * t + 2 * c

– Using SUMPRODUCT, it’s:


=SUMPRODUCT($D$4:$E$4,D11:E11)

26
Example 1: Constraints

The constraint for the number of Long pieces of Legos must


count the number of short pieces that will be used
– A table needs 2 and a chair needs 1

– The number of Long pieces is 2 * t + 1 * c

– Using SUMPRODUCT, it’s:


=SUMPRODUCT($D$4:$E$4,D12:E12)

27
Example 1: Constraints

• The LHS calculations all use SUMPRODUCT, similar to


the Revenue calculation in the Objective section
• Since the Objective Function was created using absolute
references to the decision variables, and assuming that
the LHS column is in the same column as the Objective
Function, then the objective function’s formula can be
copied and pasted in the LHS cells

28
Example 1: Constraints

• The number of short pieces are


2 * # tables + 2 * # chairs, and that total must be <= 12
• The number of long pieces are
2 * # tables + 1 * # chairs, and that total must be <= 5

29
Example 1: Constraints

• Although not stated, clearly the number of tables and


chairs must be >= 0 (i.e., positive)
• These two lines are required mathematically, but they are
optional when using Excel’s Solver because there is a
check box that tells Solver to have all DVs be positive
(it’s an option because it is so common, and it saves
creating all of the extra lines of constraints)

30
Example 1: Our Model

Now we can use Excel’s Solver to find the solution


Notice that the work is in creating the model,
not triggering the use of Excel

31
Excel Absolute Reference

Excel’s Solver function is found on the Data Tab in the


Analyze group at the far right

See Microsoft’s instructions on how to


load the Solver Add-in if it does not show for you (you only
have to do this once per computer)

32
Configuring Solver

To use Solver, we have to point it to the three


primary components of our problem:
Decision Variables, Objective, and
Constraints

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

For most business problems, these variables cannot be


negative in the real world (“make -4 tables”), but Solver is
only doing math and it will set a Decision Variable to be
negative if that generates the optimal value.

38
Example 1: Constraints
Trivia: The very first time Solver is used, this box is not
checked.

Solver will remember the previous use of this box.


• If you check this box, the next time Solver is started, this
box will be checked.
• If this box is unchecked, the next time Solver is started,
this box will not be checked.

39
Example 1: Technique

Three are
available, we
will always use
the Simplex LP
method

40
Example 1: Solve

41
Example 1: Solution

$50 is the maximum possible revenue given these


constraints; it is accomplished by building 5 chairs and
no tables
You can substitute other numbers in row 4; they will
either generate smaller revenue or violate one or both
of the constraints.
42
Example 2
We use the same Lego tables and chairs as in
Example 1, but we now have 8 long blocks
available, and the same 12 short blocks available

What combination of tables and chairs can you


make to maximize your revenue as a result of this
change in inventory?

43
Example 2: Setup

The only change !

44
Example 2: Solution

If we make 2 tables and 4 chairs,


we maximize our revenue at $72

We also see that we consume all of our inventory

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

The most work and time is consumed in Steps 1-5; those


are also where the errors happen so focus your effort on
those steps

48
Identify the Decision Variables

The problems will typically be rather clear regarding


what variables you can control, such as the number
of tables and chairs in the previous examples

This step requires reading the problem slowly and


repeatedly until these become obvious

Ask “What can I change that changes the objective?”

49
Identify the Objective
This, too, is typically obvious after reading the
problem

There must be one, and only one, number that is to


be maximized or minimized

Look for phrases such as:


– “Has the most inventory….”
– “Leaves the smallest…..”

50
Identify the Objective
Sometimes these are NOT obvious after a brief
reading the problem

For example, if there are costs provided and the


problem asks for the optimal solution, then it is
implied that you are minimizing costs, not
maximizing costs

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

These are always limits given in the problem such as


the inventory in our example; it could be minimum
values such as if our example said that we must
make at least 2 tables

Give brief names to these constraints; our example


called them “2x2 Short” and “2x4 Long”

53
Write the Constraints
Now we write out the formula for each constraint
individually

Many people find it easier to take an intermediate


step and write the formulas like simple algebra on
paper before trying to enter them into Excel – after
all, they are only simple algebra formulas

Each constraint must use all of the DVs,


so some of those parameters may be zero

54
Step 5: Reread the Problem
This step absolutely cannot be skipped

Even serious researchers and mathematicians who


have done this kind of analyses for years will err by
assuming that they have set the problem up correctly

I suggest reading just one sentence, stop and see


where that is represented in the LP model

Then repeat: read the next sentence, stop, and check


the problem for that statement
55
Step 5: Reread the Problem
This step absolutely cannot be skipped

Note that this is done AFTER the initial model is built


(Step 4) and BEFORE the model is entered into
Excel

There is great value is repeating this step yet again


after the model is entered into Excel (Step 6) and
before clicking the button to run Solver

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

Objective Function: Costs


Costs = $52 C1 + $85 C2

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

Notice the use of parameters that equal zero; we


explicitly multiply zero times the DV if it is not used

Look at how that appears in the model that follows


61
Example 3: Model

Notice the use of “Living Spreadsheet” concepts to


help explain the worksheet: the units of measure
have been named, the Objective function is labeled
“Costs”, and each Constraint is identified

62
Example 3: Model

Column F uses the SUMPRODUCT function with


Absolute referencing to calculate the totals for each
row. For example. Testing:
F12 = SUMPRODUCT($D$4:$E$4,D12:E12)

63
Example 3: Solution

The minimum costs possible while still meeting our


contractual obligations is $2,580,000

64
Information in the Solution

The LHS gives us a lot of information:


• Production uses 9,600 hours
• Testing uses 13,800 hours
• Packing uses 4,200 hours
• And the minimum number of each drill type was
produced

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.

We have chosen to outsource the production of both


Corded and Cordless drills, which will cost us $65 and $95
respectively.

Now how many of each type of drill should be made to


minimize our costs while meeting the contract goals?

68
Example 4: Decision Variables
Reread the problem: Our company can make
Corded and Cordless drills, and we may buy
Corded and Cordless drills

We now have four Decision Variables – one for


each possible source of 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

– The number of Corded and Cordless drills that we buy


where C1b = # Corded drills we buy
C2b = # Cordless drills we buy

70
Example 4: Setup

Objective Function: Costs


Costs = $52 C1m + $85 C2m + $65 C1b + $95 C2b

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

Note that the sale of drills doesn’t care whether we


made them or we bought them !!
72
Example 4: Model

Buying drills doesn’t cause us to consume production, testing,


or packaging hours – so these parameters are zero

73
Example 4: Model

Because we used the template and have zeros wherever a


decision variable is not a part of a constraint, the LHS formulas are
all the same – using SUMPRODUCT and absolute referencing

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

The following slide gives one example of how one


of these problems is presented in a homework,
quiz, or exam

There is a problem statement, the answer to be


calculated, and which scenario (column of data) to
use

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

Large wood per Table 4 4 2 3 5

Small wood per Table 2 2 2 3 2

Large wood per Chair 2 1 4 3 2

Small wood per Chair 4 4 2 3 6

Revenue per Table $23 $21 $19 $22.50 $25

Revenue per Chair $17 $16 $19 $27.95 $24

Large wood inventory 85 90 90 89 200

Small wood inventory 77 60 48 120 190


81
Summary

Linear Programming
­ Excel’s Solver
­ Solver configuration
­ Solution interpretation

82
Learning

What did I learn?


What do I not understand?
What applies to my career?

83
Questions?

84

You might also like