Uploaded by Tiago Ramos

AllSlides

advertisement
Chapter 1: Introduction
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
What is Modeling?
Modeling is the process of creating a
simplified representation of reality and
working with this representation in
order to understand or control
some aspect of the world.
|2
Types of Models
 Mental
 Visual
 Physical
 Mathematical
 Algebra
 Calculus
 Spreadsheets
|3
Why Study Modeling?
 Models generate insight which leads to better
decisions.
 Modeling improves thinking skills:
 Break problems down into components
 Make assumptions explicit
 Modeling improves quantitative skills:
 Ballpark estimation, number sense, sensitivity analysis
 Modeling is widely used by business analysts:
 Finance, marketing, operations
|4
Types of Models
decision maker)
 Will be the primary focus in this text
 Decision support models
 Embedded models
 A computer makes the decision without the user
being explicitly aware
User control
User expertise
 One time use models (usually built by the
|5
Benefits of Modeling
 Modeling allows us to make inexpensive errors.
 Allows exploration of the impossible
 Improves business intuition
 Provides timely information
 Reduces costs
|6
Role of Spreadsheets
 Main vehicle for modeling in business
 Mathematics at an accessible level
 Correspond nicely to accounting statements
 “The Swiss Army knife of business analysis”
|7
Spreadsheets:
“The Swiss Army Knife of Business Analysis”
 Prior to the 1980s, modeling was performed only by
specialists using demanding software on expensive
hardware.
 Spreadsheets changed all this in the 1990s
 The “second best” way to do many kinds of analyses
 Many specialized decision tools exist (e.g., simulation
software, optimization software, etc.).
 The best way to do most modeling
 An effective modeler should know its limitations and when to
call in specialists.
|8
Problems With Spreadsheet Usage
 End-user spreadsheets frequently have major bugs.
 End-users are overconfident about the quality of
their spreadsheets.
 Development process is inefficient.
 Most productive methods for generating insights not
employed.
|9
The Real World and The Model World
Formulation
Problem
statement
Assumptions
and model
structures
MODEL WORLD
REAL WORLD
Analysis
Solution
Results and
conclusions
Interpretation (Translation & Communication)
| 10
Model Formulation
 Decisions
 Possible choices or actions to take
 Outcomes
 Consequences of the decisions
 Structure
 Logic that links elements of the model together
 Data
 Numerical assumptions in model
| 11
Aspects of the Modeling Activity
 Problem context
 Situation from which modeler’s problem arises
 Model structure
 Building the model
 Model realization
 Fitting model to available data and calculating results
 Model assessment
 Evaluating model’s correctness, feasibility, and acceptability
 Model implementation
 Working with client to derive value from the model
| 12
Summary of Course Philosophy
 Modeling is a necessary skill
for every business analyst.
 Spreadsheets are the modeling platform of choice.
 Basic spreadsheet modeling skills
are an essential foundation.
 End-user modeling is cost-effective.
 Craft skills are essential to the effective modeler.
 Analysts can learn the required modeling skills.
 Management science/operations research
are important advanced tools.
| 13
Chapter 2: Modeling in
a Problem-solving
Framework
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
2-1
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
A “Problem” Versus a “Mess”
 A mess is a morass of unsettling symptoms, causes,
data, pressures, shortfalls, opportunities, etc.
 A problem is a well-defined situation that is capable
of resolution.
 Identifying a problem in the mess is the first step in
the creative problem solving process.
|2
Characteristics of
Well-Structured Problems
 The objectives of the analysis are clear.
 The assumptions that must be made are obvious.
 All the necessary data are readily available.
 The logical structure behind the analysis is well
understood.
 As an example, algebra problems are typically wellstructured problems.
|3
Ill-Structured Problems
 The objectives, assumptions, data, and structure of
the problem are all unclear.
 Example:
 Should the Red Cross institute a policy of paying for blood
donations?
|4
Mental Models
 Help us to relate cause and effect
 But often in a simplified, incomplete way
 Help us determine what is feasible
 But may be limited by personal experiences
Would a decrease in
the minimum wage
significantly reduce
the unemployment
rate?
 Are influenced by our preferences for certain
outcomes
 Are useful but can be limiting
 Problem solvers construct quick, informal mental
models at many different points in the process.
|5
Formal Models
 Provide the same kind of information
as mental models
 A linking of causes to effects
Would a decrease in
the minimum wage
significantly reduce
the unemployment
rate?
and aid with evaluation
 Require a set of potential solutions and criteria to
compare solutions to be identified
 More costly and time consuming to build than
mental models
 Make assumptions, logic, and preferences
explicit and open to debate
|6
Influence Chart
 Influence charts offer the modeler a bridge
between an ill-structured problem and a formal
model.
 A simple diagram to show outputs and how they
are calculated from inputs.
 Identifies main elements of a model.
 Delineates the boundaries of a model.
 Recommended for early stages of any problem
formulation task.
|7
Building an Influence Chart
 Built from right to left
 Conventions on types of variables
 Outputs – hexagons
 Decisions – boxes
 Inputs – triangles
 Intermediate variables – circles
 Random variables – double circles
|8
Influence Chart Principles
 Start with outcome measure
 Decompose outcome measure into independent
variables that directly determine it
 Repeat decomposition for each variable in turn
 Identify input data and decisions as they arise
 A variable should appear only once.
 Highlight special types of elements with special
symbols
|9
Example: Icebergs for Kuwait
 The cost of desalinating seawater using conventional
technology in the Persian Gulf is high (around 0.1$ per
cubic meter) and requires extensive amounts of oil. Some
time ago scientists suggested that it could well prove both
practically feasible and less expensive to tow icebergs
from the Antarctic, a distance of about 9,600 km.
Although some of the ice would undoubtedly melt in
transit, it was thought that a significant proportion of the
iceberg would remain intact upon arrival in the Gulf.
Bear in mind that since water expands upon freezing, 1
cubic meter of ice produces only 0.85 cubic meter of
water.
| 10
Example: Icebergs for Kuwait
 A study was carried out to evaluate the practical problems
associated with such a proposal and to quantify the factors
that were likely to influence the economics of such a
venture. One factor was the difference in rental costs and
capacities of towing vessels (summarized in the table
below). Note that each vessel has a maximum iceberg it can
tow (measured in cubic meters).
Ship Size
Daily rental ($)
Maximum load
(cu. meter)
Small
400
500,000
Medium
600
1,000,000
Large
800
10,000,000
| 11
Example: Icebergs for Kuwait
 It was found that the melting rate of the iceberg depends on
both the towing speed and the distance from the South
Pole. The data in the table below represents the rate at
which a hypothetical spherical iceberg shrinks in radius
over a day at the given distance from the Pole and at the
given towing speed.
Distance from Pole (km)
1,000 2,000 3,000 4,000
Speed
1km/hr
3 km/hr
5 km/hr
0.06
0.08
0.10
0.12
0.16
0.20
0.18
0.24
0.30
0.24
0.32
0.40
| 12
Example: Icebergs for Kuwait
 Finally, fuel cost was found to depend on the towing speed
and the (current) size of the iceberg (see table below).
Current Volume (cu. meter)
100,000 1,000,000 10,000,000
Speed
1km/hr
3 km/hr
5 km/hr
8.4
10.8
13.2
10.5
13.5
16.5
12.6
16.2
19.8
 Determine whether it is economically feasible to produce
water from icebergs in the Persian Gulf, and if it is,
determine the best means to do so.
| 13
Icebergs for Kuwait
 Analysis goals
 To assess if it is economically feasible to produce water from
icebergs in the Persian Gulf, and if it is, to determine the best
means to do so.
 Assumptions
 Icebergs are available for free, the ships’ speed is constant, the
icebergs are spherical.
 Data needed
 Desalinating cost, distance from the pole, shrink rate
(ice-water volume conversion), rental costs, capacities of
towing vessels, melting rates, fuel cost.
| 14
Icebergs for Kuwait – Influence Chart
Rental
cost
Boat
Cost
Days
Fuel
cost
Speed
Water
cost
Water
volume
Iceberg
size
Distance
from pole
Melting
rate
Shrin
king
rate
| 15
Icebergs for Kuwait – Influence Chart
Rental
cost
Boat
Cost
Days
Fuel
cost
Speed
Water
cost
Water
volume
Iceberg
size
Distance
from pole
Melting
rate
Shrin
king
rate
| 16
Influence Chart Extension
 Dependencies that are bounds (lower or upper) on
the decisions, variables or outcomes.
Max
Speed
Min
volume
Max
cost
Speed
Water
volume
Water
cost
| 17
The most common error…
… in drawing influence charts is to draw an arrow
from the output back to the decisions.
 The thinking seems to be that an outcome will be
used to determine the best decision.
 An influence chart is a description of how we will
calculate outcomes for a set of decisions and other
parameters, it is not intended to be used to find the
best decision!
| 18
Influence Charts Wrap-up
 The goal is to develop problem structure.
 Show outputs and how they are calculated from inputs.
 Charts ignore all available numerical data.
 There is no one correct chart, because
 Charts rely on modeling assumptions that should be
recorded as made.
| 19
Chapter 5: Spreadsheet
Engineering
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell, K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
Spreadsheet Engineering
 Builders use blueprints or plans.
 Without plans, structures will fail to be effective.
 Advanced planning in any sort of design can speed
up implementation.
 Spreadsheets are no different from other areas of
design.
 Engineering and advanced planning aids effectiveness.
|2
Spreadsheet Design
 An efficient process minimizes time spent.
 An effective process yields results that meet users’
requirements.
 Good design helps analysts spend the majority of
their effort improving decisions, rather than building
and fixing models.
|3
The Phases of Spreadsheet Modeling
 Designing
 Building
 Testing
|4
The advertising budget decision
As product-marketing manager, one of our jobs is to prepare recommendations to the Executive
Committee as to how advertising expenditures should be allocated. Last year's advertising budget of
$40,000 was spent in equal increments over the four quarters. Initial expectations are that we will
repeat this plan in the coming year. However, the committee would like to know whether some other
allocation would be advantageous and whether the total budget should be changed.
Our product sells for $40 and costs us $25 to produce. Sales in the past have been seasonal, and our
consultants have estimated seasonal adjustment factors for unit sales as follows:
Q1: 90% Q2:110% Q3: 80% Q4: 120%
(A seasonal adjustment factor measures the percentage of average quarterly demand experienced in a
given quarter.)
In addition to production costs, we must take into account the cost of the sales force (projected to be
$34,000 over the year, allocated as follows: Q1 and Q2, $8,000 each; Q3 and Q4, $9,000 each), the
cost of advertising itself, and overhead (typically around 15 percent of revenues).
Quarterly unit sales seem to run around 4,000 units when advertising is around $10,000.
Clearly, advertising will increase sales, but there are limits to its impact. Our consultants several years
ago estimated the relationship between advertising and sales. Converting that relationship to current
conditions gives the following formula:
3,000
35
|5
Influence Chart
Price
Budget
Revenue
Units
sold
Profit
Advertising
Cost
Unit
Cost
Cost
of
goods
Sales
expenses
Over
head
Overhead
(%)
|6
DESIGNING A
SPREADSHEET
Designing a Spreadsheet
 Plan
 Modularize
 Start small
 Parameterize
 Design for use
 Keep it simple
 Design for communication
 Document important data and formulas
|8
Plan
 “Measure twice, cut once”
 Will decrease time spent correcting mistakes
 Turn computer off and think before beginning
 Influence charts?
 Begin with a sketch
 Physical layout of major elements
 Rough indication of calculation flow
 Anticipate model’s ultimate uses
|9
Sketch
Back
| 10
Modularize
 Group like items and separate unlike items.
 Separate
 Data
 Decision variables
 Outcome measures
 Detailed calculations
 Influence diagrams aid with this design.
 Formulas should generally reference cells above
and to the left.
| 11
Start Small
 Sketch full design but do not build all at once.
 Isolate one module then build and test that module.
 Local mistakes are much easier to detect than when
they are part of the global model.
| 12
Parameterize
 Place parameters in a single location away from
calculations.
 Formulas should only contain cell references, not
numerical values.
 Assists in:
 Identifying parameters
 Sensitivity analysis
 Documentation
| 13
Design for Use
 Anticipate who will use the spreadsheet
 What type of questions will be asked?
 Make it easy to change common parameters.
 Make it easy to find key outputs.
 Group in one place
 Include graphs of outputs.
 Record numerical values of base case outputs.
| 14
Keep It Simple
 Complex spreadsheets:
 Require more time and effort to build
 Are much more difficult to debug
 Keep formulas short.
 Decompose complex calculations into intermediate steps.
| 15
Design for Communication
 Spreadsheets’ lives are often longer than expected.
 Use visual cues that reinforce model’s logic
 Use informative labels
 Use blank spaces
 Use outlines, color, bold fonts, as appropriate
 But avoid using merged cells.
 Split windows can aid in viewing.
| 16
Document Important Data and Formulas
 Record source for important parameters.
 Explain important formulas.
 Use Cell Comments to describe cell contents.
 Consider a separate module to list assumptions.
| 17
Cell Comments
 Insert Cell Comment – Review►Comments►New
Comment
| 18
Cell Comments
 Different display options
 Comment & indicator – permanently display
comment
 Indicator – red triangle indicates comment, display
when cursor in cell
 None – neither comment nor indicator visible
| 19
Protect Worksheets
From Unwanted Changes During Use
 Lock cells not to be changed.
 Use worksheet protection.
 Use data validation.
| 20
Locking Cells
 To lock all cells:
 Select entire worksheet
 Select Home►Font , choose the Protection tab, and check the
box for Locked
 To unlock variable cells:
 Select desired cells
 Select Home►Font and choose the Protection tab, but this
time we uncheck the box for Locked
| 21
Example of Locking Cells
| 22
Protecting Worksheets
 Review►Changes►Protect Sheet
 At top of Protect Sheet window check box for
Protect worksheet
| 23
Example of Protecting Worksheet
 If check only Select
Unlocked Cells
 User will be able to only
select and modify unlocked
cells.
 If check Select Locked
and Unlocked Cells
 User will be able to select any
cell but only modify unlocked
cells.
| 24
Data Validation
 Controls input values
 Highlight cells then click Data►Data Tools ►Data
Validation
| 25
The Data Validation Window
 Three tabs
 Settings: Restrict inputs (e.g., range of cell values)
 Input Message: Create message when cursor on cell
 Error Alert: Alert for invalid entry
| 26
Example:
Error alert produced by Data Validation
| 27
BUILDING A
WORKSHEET
Building a Worksheet
 Follow a plan.
 Build one module at a time.
 Predict the outcome of each formula.
 Copy and paste formulas carefully.
 Use relative and absolute addressing to simplify
copying.
 Use the Function Wizard to ensure correct syntax.
 Use range names to make formulas easy to read.
 Choose input data to make errors stand out.
| 29
Copying and Pasting Formulas
 Copying (rather than retyping) reduces the potential
for typographical errors.
 Copying can also be a source of bugs.
 e.g., wrong range copied
| 30
Relative and Absolute Addressing
 Necessary for efficient copying
 An address such as B7 is relative.
 In cell A6, B7 represents one row down and one column to the
right.
 If copied, new formula will refer to new cell that is one row
down and one column to the right.
 An address such as $B$6 is absolute.
 Cell will not change if formula is copied.
 Use for parameter values.
| 31
Function Wizard
 The button fx brings up the function wizard.
 Contains a complete list of all Excel functions
 Selecting a function will bring up a window showing
needed inputs.
 Function value will be shown in window
automatically
| 32
Range Names
 Any cell or range of cells may be named.
 Name or cell reference may be used in formulas.
 Names easier to debug and use
 Require extra work to enter and maintain
 Select Formulas►Defined Names►Define Name to
assign a name.
 Pull-down window at top left of spreadsheet.
 Shows all named cells for workbook
 Can be used to enter individual cell names
| 33
TESTING A
WORKSHEET
Testing a Spreadsheet
 Check that numerical results look plausible.
 Check that formulas are correct.
 Test that model performance is plausible.
| 35
Check That Numerical Results
Look Plausible
 Make rough estimates.
 Check with a calculator.
 Test extreme cases.
| 36
Check That Formulas Are Correct
 Check visually.
 Display individual cell references.
 Display all formulas.
 Use the Excel Auditing Tools.
 Use Excel Error Checking.
 Use error traps.
 Use auditing software.
| 37
Checking Formulas Visually
 Visually check formulas in each cell.
 Most effective when range names used
 Tends to be tedious
| 38
Displaying Individual Cell References
 Press F2 or double-click on cell of interest.
 Reveals formula with color-coded cell references
 Stronger visual clues than manual checking
| 39
Display All Formulas
 Hold down control key and press tilde key.
 All formulas are displayed
 Makes for easier scanning
 Aids in detecting deviations from patterns
 Reverse by repeating Control – Tilde
SHIFT + CTRL + ´
| 40
Using the Excel Auditing Tools
 Identifies predecessors and successors of cells
 Select Formulas►Formula Auditing identifies the
cells used to calculate a given cell.
 Trace Precedents
 Colored arrows to predecessors
 Trace Dependents
 Colored arrows to successors
| 41
Excel Error Checking
 Managed from the Formulas tab of the Excel Options
menu.
 Available in Excel 2002 and later versions
 Equivalent of grammar checking in word processing
 Cells with possible errors are flagged with colored
triangle
| 42
Errors Checked Under
Automatic Error Checking
| 43
Use Error Traps
 Error traps are formulas added to a spreadsheet that
warn the user of potential errors.
 They can check for errors in input data or for errors
in formulas.
 Any number of error traps can be added to a
workbook to improve its safety.
 It is important that the results of these error checks
be clearly visible to the user.
 One way to do this is to create an overall error trap
that checks whether any one of the individual traps is
true, and returns a warning.
| 44
Use Auditing Software
 A number of Excel add-ins are available for auditing
spreadsheets.
 These add-ins typically provide a set of tools for
detecting errors and displaying model structure
graphically.
 One such tool is Spreadsheet Professional
(www.spreadsheetinnovations.com).
| 45
Test That Model Performance Is Plausible
 Model should react in a plausible manner to a range
of inputs
 The user should be content with trends in output
based on varying inputs.
 Sensitivity testing (Chapter 6) is an important tool to
test plausibility.
| 46
SUMMARY
Summary
 Spreadsheets deserve careful engineering.
 Most spreadsheets contain errors.
 Users are over confident about their models.
 Rules for spreadsheet modeling:
 Designing a spreadsheet
 Building a spreadsheet
 Testing a spreadsheet
| 48
Chapter 6: Analysis
Using Spreadsheets
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell, K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
6-1
Five Categories of
Spreadsheet Analysis
 Base-case analysis
 What-if analysis
 Breakeven analysis
 Optimization analysis
 Risk analysis
 A detailed analysis may include all of the above
steps.
|2
Base Case Analysis
 Base case can describe one or more of the following:
 Current policy, most likely scenario, best or worst case
scenarios
 Answers questions such as:
 If we follow last year’s plan, how much profit should we expect
next year?
 How many items do we expect to sell next week?
|3
What-if Analysis
 Analyzes how key outputs change with changes in
one or more of the inputs
 May vary a parameter, a decision variable, or the
model structure
 Tests one alternative at a time
 Also called sensitivity analysis
 Also part of debugging process
 If output is unexpected we have uncovered either a bug or an
insight.
|4
What-if analysis
Varying a Parameter
 Asking what if given information were different
 Tests numerical assumptions of model
 e.g., in the Advertising Budget Model, if unit cost
rises to $26 from $25, how much will the profit
change?
|5
What-if analysis
Varying a Decision Variable
 Exploring outcomes we can influence
 Leads us to better decisions
 e.g., in the Advertising Budget Model, how much will
profit change if we spend an extra $1000 (extra 10%)
on advertising in the first quarter?
|6
What-if analysis
Varying the Model Structure
 Tests key structural assumptions in model
 More complex than changes to parameters or decision
variables
 e.g., in the Advertising Budget Model, how does profit
change if we change our non-linear relationship between
sales and advertising
Unit_sales  35  seasonal_factor  3000  Advertising
by a linear one
Unit_sales  3000  0.1 (Advertising  Seasonal_factor)
And how does profit vary now when Q1 advertising
increases by $1000?
|7
Benchmarking
 Record base-case to compare against results of a
what-if analysis, on a one to one basis.
 Base case can be recorded by:
 Home►Clipboard►Copy
 Home►Clipboard►Paste►Paste Special with Paste Values
Option selected
|8
The Paste Special Window
|9
Scenario Analysis
 Sets of parameter values often go together.
 A scenario is a set of internally consistent parameter
values.
 Adding scenarios
 Data►Data Tools►What-if Analysis►Scenario Manager
 Enter the first scenario by clicking on the Add button
 Enter the information required in the Add Scenario window
| 10
The Scenario Manager
 In the Advertising Budget model, construct:
 an optimistic scenario in which prices are high ($50) and costs
are low ($20) and
 a pessimistic scenario in which prices are low ($35) and costs
are high ($30).
 Use the scenario manager
| 11
The Scenario Manager Window
To see the
scenario
results on
the
worksheet
| 12
The Summary Produced by the
Scenario Manager
| 13
LOOKUP Functions
 When scenarios involve a large number of parameters it
is convenient to be able to switch from one set of
parameters to another all at once.
 This can be accomplished using the Excel VLOOKUP or
HLOOKUP functions.
 LOOKUP function selects a value from a range based on
an index number. The index number is the number of the
scenario and the range contains the inputs for a given
parameter.
 This allows the use of Scenario Manager with only one
changing cell, even if we want to change a large set
parameters.
| 14
Use of HLOOKUP Function
to Implement Scenarios
| 15
Install UPorto Analytics add-in
 Copy the file “UPorto Analytics.xlam” to any folder of
your computer.
 Be aware that after installation you should not move the file to
a different location.
 Double-click on the file. Accept macros.
 Or, alternatively:
 Open Excel and follow this sequence of menus and buttons:
 File ► Options ► Add-Ins ► Go… ► Browse…
 Tools ► Add-Ins ► Select…
 Find the location where you have saved the file, select it and
click on Open.
| 16
Parametric Sensitivity
 Tabulates output based on varying inputs
 It recalculates the spreadsheet for a series of values
of an input cell and generates a table with the
resulting values of an output cell
 Available in the “UPorto Analytics” add-in
 e.g., in the Advertising Budget, model unit cost
variation between $20 and $30 in steps of $1.
| 17
Parametric Sensitivity
 Add-Ins ► UPorto Analytics
| 18
Parametric Sensitivity
 Tools ► UPorto Analytics…
| 19
Parametric Sensitivity
 Choose the option “Parametric Sensitivity”
| 20
Parametric Sensitivity
 Fill-in the dialog box and press OK
| 21
Parametric Sensitivity
 Sensitivity Analysis Report
| 22
Two-Way Tables
 Allows two inputs to be varied
 Will output a two-dimensional table or a three-
dimensional chart that displays the output based on
the varying values of the two input variables
 e.g., in the Advertising Budget model, Q1 and Q2
variation between $5000 and $15000 in steps of
$1000
| 23
Two-Way Tables
| 24
Two-Way Tables Report
| 25
Tornado Charts
 Measures the sensitivity of several parameters
defined in the model
 Determines how the output changes based on changes in the
inputs
 Changes input values, one at a time, and records the
variations of the output
 Graphically displays which parameters have a major
impact on the results and which do not
| 26
Tornado Chart
 Choose de option “Identify” and select the Result Cell
| 27
Tornado Chart Window
| 28
Tornado Charts Interpretation
 Displays the incremental variation of the Result Cell,
around its base value, with the variation of each
parameter by 10% around its base value.
 The greater the bar the greater the variation.
 Blue bars display the result of incrementing the
parameter and red bars the result of decrementing
the parameter.
| 29
Limitations of Tornado Charts
 There are potential pitfalls of assuming every
parameter varies by the same percentage of the base
case.
 In models with significant nonlinearities there is an
additional pitfall:

If the output is related to an input in a nonlinear fashion,
the degree of sensitivity implied by a tornado chart may be
misleading.
 In general, we must be cautious about drawing
conclusions about the sensitivity of a model outside
the range of the parameters tested in a tornado
chart.
| 30
Breakeven Analysis
 Analyzes where a particular point of interest occurs
 For which value of the input parameter does the reach a given
value
 Answers questions such as:
 How high does our market share need to be before we turn a
profit?
 How high would the discount rate have to be in order for this
project to have a NPV of zero?
 Excel Goal Seek is a useful tool.
| 31
Goal Seek
 Used for a single output and a single input
 In the Advertising Budget model
 Find the breakeven cost
Value of cost (C8) that leads to a null profit (C21)
| 32
Goal Seek
 Used for a single output and a single input
Output cell address
Target level sought
Input to vary
| 33
Optimization Analysis
 Automatically finds the set of decision variables that
achieves best possible (maximum or minimum)
value of an output
 Excel Solver is an important tool.
 Answers questions such as:
 How should we allocate our budget to maximize profit?
 How much inventory should we stock of each type of product,
given constraints on shelf size and budget, so that cost is
minimized?
| 34
Simulation: Risk Analysis
 Analyzes the effect of uncertainty on the output with
the help of probability models.
 Answers questions such as:
 What is the expected NPV after 25 years given that my return
in each year is uncertain?
 What is the probability that the NPV after 25 years is greater
than $1,000,000, given that my return in each year is
uncertain?
 What is the distribution of NPV after 25 years given that my
return in each year is uncertain?
| 35
Summary
 Base-case analysis
 What-if analysis
 Benchmarking
 Scenario analysis
 Parametric sensitivity
 Tornado charts
 Breakeven analysis
 Goal Seek tool
 Optimization analysis
 Simulation or risk analysis
| 36
Chapter 10: Nonlinear
Programming
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
7-1
Optimization
 Find the best set of decisions for a particular
measure of performance
 Includes:
 The goal of finding the best set
 The algorithms to accomplish this goal
|2
The advertising budget decision
As product-marketing manager, one of our jobs is to prepare recommendations to the Executive
Committee as to how advertising expenditures should be allocated. Last year's advertising budget of
$40,000 was spent in equal increments over the four quarters. Initial expectations are that we will
repeat this plan in the coming year. However, the committee would like to know whether some other
allocation would be advantageous and whether the total budget should be changed.
Our product sells for $40 and costs us $25 to produce. Sales in the past have been seasonal, and our
consultants have estimated seasonal adjustment factors for unit sales as follows:
Q1: 90% Q2:110% Q3: 80% Q4: 120%
(A seasonal adjustment factor measures the percentage of average quarterly demand experienced in a
given quarter.)
In addition to production costs, we must take into account the cost of the sales force (projected to be
$34,000 over the year, allocated as follows: Q1 and Q2, $8,000 each; Q3 and Q4, $9,000 each), the
cost of advertising itself, and overhead (typically around 15 percent of revenues).
Quarterly unit sales seem to run around 4,000 units when advertising is around $10,000.
Clearly, advertising will increase sales, but there are limits to its impact. Our consultants several years
ago estimated the relationship between advertising and sales. Converting that relationship to current
conditions gives the following formula:
3,000
35
|3
Influence Chart
Price
Budget
Revenue
Units
sold
Profit
Advertising
Cost
Unit
Cost
Cost
of
goods
Sales
expenses
Over
head
Overhead
(%)
|4
Algebraic Model
Q1, Q2, Q3, Q4: Advertising expenditures in each quarter
Maximize Profit = Revenue - Cost
Subject to:
Revenue = 40  UnitsSold
3000
35 0.9
1+
3000
35 1.1
2+
35 0.8
3000
3+
35 1.2
3000
4
CostOfGoods = 25  UnitsSold
Cost = Q1 + Q2 + Q3 + Q4 +
CostOfGoods +
8000 + 8000 + 9000 + 9000 +
Overhead
Overhead = 0.15  Revenue
Q1 + Q2 + Q3 + Q4  40000
|5
Spreadsheet Model
|6
THE SOLVER
Excel Optimization Software
 Solver
 Standard with Excel
 Free of charge
 Available “forever”
 Complemented with U.Porto Analytics add-in
|8
Installing Solver
 File ► Options ► Add-Ins ►
Manage: Excel Add-Ins ► Go…
|9
Installing Solver
 Select “Solver” (or “Suplemento Solver” if it is a
Portuguese Office version) and click OK.
| 10
Calling Solver
 Data ► Solver
| 11
Installing Solver
 Tools ► Add-Ins…
| 12
Installing Solver
 Select Solver and click OK
| 13
Calling Solver
 Tools ► Solver…
| 14
Solver
 Advertising Budget Example
 Optimize over all four quarters
| 15
Decisions, Objective and Constraints
 Changing variable cells
 Decision variables
 We want to find the best values for the variables
 Finding these best values can be challenging
 Need Solver’s sophisticated software
 Still relatively easy to construct models beyond Solver’s
capabilities
| 16
Decisions, Objective and Constraints
 Objective
(or Target Cell in some versions of Solver)
 Maximize, minimize, or set equal to target value
 Constraints
 Restrictions on decision variables
| 17
Adding Constraints
Use formula cell on left
Use number cell on right
| 18
Solving the model
 Choose the Solving Method
 Click Solve
 Should predict outcome
before clicking Solve
| 19
Solver Options
Scaling discussed later
– usually not needed
Only used if need
intermediate results
e.g., for debugging
Check if decision
variables known
to be non-negative
| 20
Model solution
| 21
Solver Tip: Avoid Discontinuous Functions
 A number of functions familiar to experienced Excel
programmers should be avoided when using the
nonlinear solver.
 These include logical functions (such as IF or AND),
mathematical functions (such as ROUND or
CEILING), lookup and reference functions (such as
CHOOSE or VLOOKUP), and statistical functions
(such as RANK or COUNT).
 In general, any function that changes
discontinuously should be avoided.
| 22
OPTIMIZATION
SENSITIVITY
ANALYSIS
Sensitivity Analysis
for Nonlinear Programs
 Optimization Sensitivity
 Found in “UPorto Analytics” add-in
 Inputs similar to Parametric Sensitivity tool
 Shows effect of parameter changes on optimal value
of objective
 Resolves optimization for each input value
 UPorto Analytics ► Optimization Sensitivity option
 Report similar to Parametric Sensitivity tool
| 24
Solver Tip: Parametric Sensitivity or
Optimization Sensitivity?
 Optimization Sensitivity answers questions about how the
optimal solution changes with a change in a parameter.
 The Parametric Sensitivity tool answers questions about how
specific outputs change with a change in one or two
parameters.

If there are decision variables in the model, they remain fixed when the
input parameter changes, and they are not re-optimized.
 The Parametric Sensitivity tool can also be used to answer
questions about how specific outputs change with a change in
one or two decision variables.
Objective function:
Decision variables:
Cell to change:
C21 (Profit)
D18:G18 (Ad expenditures)
C7 (price) – 30 to 40, 21 points
| 25
Chapter 11: Linear
Optimization
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
7-1
Nonlinear optimization
Global Optimum
f(x) value
cost
Local optima
y
Decision variables
x
|2
Nonlinear optimization
 Hill climbing technique is used by the Solver for
nonlinear optimization
 GRG (Generalized Reduced Gradient) algorithm
 Analogy: Hill climbing in a fog
 Follow steepest path going up
 After a group of steps, find steepest
path and follow it
 Stop if no path leads up
cost
y
|3
Local and Global Optima
 What we want to find?
 The global optimum (highest peak).
 What does the GRG algorithm locate?
 Local optima (peaks higher than all points around them).
 Except in special circumstances, there is no way to guarantee
that a local optimum is the global optimum.
 If there are multiple local optima, the one which is found
depends on the starting point.
(run the Solver using several starting points)
cost
y
|4
Solutions from the GRG Algorithm
 Convergence Message
“Solver has converged to the current solution, all constraints are satisfied”
 Solver should be rerun from the point at which it finished.
 The message may reappear, in which case Solver should be rerun once
more.
 Optimality message
“Solver found a solution, all constraints and optimality conditions are
satisfied”
 Signifies that the solver has found a local optimum.
 To help determine whether the local optimum is also a global optimum,
the Solver should be restarted at a different set of decision variables and
rerun.
 If several widely differing starting solutions lead to the same local
optimum, that is some evidence that the local optimum is likely to be a
global optimum, but in general there is no way to know for sure.
|5
Model Classification
 Nonlinear optimization (or nonlinear programming)
 Either the objective or a constraint (or both) are nonlinear
functions of the decision variables.
 Linear optimization (or linear programming)
 Objective and all constraints are linear functions of the
decision variables.
 Techniques for solving linear models are more
powerful.
 Use linear models wherever possible.
|6
Objective function
The Simplex Algorithm For
Linear Optimization
Variable 2
Variable 1
|7
The Simplex Algorithm For
Linear Optimization
Objective function
Guaranteed to converge
to the global optimal solution
Variable 2
Variable 1
|8
The Simplex Algorithm For
Linear Optimization
Objective function
Guaranteed to converge
to the global optimal solution
Variable 2
cost
Variable 1
y
x
|9
FORMULATION
Formulation
 Decision variables
 What must be decided? Be explicit with units.
 Objective function
 What measure compares decision variables?
 Use only one measure – put in the target cell
 Constraints
 What restrictions limit our choice of decision variables?
Use the influence charts to help you with the formulation
| 11
Types of Constraints
 LT constraints (LHS<=RHS)
 Capacities or ceilings
 GT constraints (LHS>=RHS)
 Commitments or thresholds
 EQ constraints (LHS=RHS)
 Material balance
 Define related variables consistently
To further explore in Linear Programming models
| 12
About spreadsheet models
for optimization problems…
| 13
For the Spreadsheet Model
a Standard Model Template Is Recommended
 Enhances ability to communicate
 Provides a common language
 Reinforces the understanding on how models shaped
 Improves ability to diagnose errors
 Permits scaling more easily
Remember the worksheet organization “rules”
| 14
Layout
 Organize in modules
 Decision variables, objective function, constraints
 Place decision variables together (a single row or
column, if possible)
 Use color in a meaningfully way
 Place objective in single highlighted cell
 Use SUM or SUMPRODUCT where appropriate
 Arrange constraints to make LHS and RHS clear
 Use SUMPRODUCT for LHS where appropriate
| 15
Ranges for Decision Variables and
Constraints
 Changing cells allows for commas but better to put in
one contiguous range
 Add Constraint window allows for ranges
 Group LT, GT, EQ, constraints together
 Enter as ranges
 LHS will be matched with RHS in one-to-one correspondence
| 16
LINEAR
OPTIMIZATION
Properties of Linear Functions
 Additivity
 Contributions of the several variables get added (or
subtracted)
 Proportionality
 A variable contribution grows in proportion to its value
 Divisibility
 Fractional values for decision values are meaningful
| 18
Examples of Linear Functions
Profit =
(Total Revenue)
–
(Total Cost)
Profit = (Unit Revenue) × (Quantity Sold) – (Unit Cost) × (Quantity Purchased)
Profit =
100 × (Quantity Sold) –
60 × (Quantity Purchased)
Profit =
100 × x
60 × y
–
| 19
Mini
Lesson
The
Function
 Sumproduct takes the pairwise product of two sets of
numbers and sums the products.
 Sumproduct (array1;, array2)
 array1 (set of numbers)
[c1 c2 …. cn]
 array2 (set of numbers) [x1 x2 …. xn]
 the arrays
 must have identical layouts
 must be of the same size
 Sumproduct ([c1
c2 …. cn] ; [x1 x2 …. xn]) =
c1 x1 + c2 x2 + ….. + cnxn
| 20
Linear Optimization Problems
 Allocation Models
 Maximize objective subject to ൑ constraints on capacity
Veerman Furniture Company (page 242)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 21
Veerman Furniture Company
Optimal Solution
| 22
Optimization: Using Solver
| 23
SOLVER REPORTS
SENSITIVITY ANALYSIS
FOR LINEAR OPTIMIZATION
Generating Solver Reports
 Run Solver and click on “Answer” and “Sensitivity”
reports before clicking OK.
| 25
The Answer
report
| 26
The Sensitivity
Report
Interval in which the objective coefficient may vary
without a change in the optimal solution.
Interval in which the constraint R.H. Side coefficient may
vary without a change in the respective shadow price.
| 27
PATTERNS IN
LINEAR
PROGRAMMING
SOLUTIONS
Patterns in Linear Optimization Solutions
The optimal solution tells a “story” about a pattern of
economic priorities.
These patterns
 lead to more convincing explanations of the solutions
 can anticipate answers to “what-if” questions
 provide a level of understanding that enhances decision making
After the optimization
try to find the qualitative pattern in the solution
| 29
Constructing Patterns
 Decision variables
 Which are positive and which are zero?
 Constraints
 Which are binding and which are not?
 “Construct” the optimal solution from the given
parameters
 Determine one variable at a time
 Can be interpreted as a list of priorities which reveal the
economic forces at work
| 30
Constructing Patterns
6D + 2T = 1850
T = 100
6D + 2100 = 1850
D = 275
| 31
Constructing Patterns
Solution pattern:
•
•
•
don’t produce chairs;
market ceiling for tables
dictates the number of tables
to produce;
let the fabrication capacity
dictate the number of desks to
produce.
| 32
Defining Patterns
 Qualitative description
 A Pattern should be complete and unambiguous
 Should lead to the full solution
 Should always lead to the same solution
 Ask where shadow prices come from
 Should be able to trace the incremental changes to determine the
shadow price of a constraint, but…
 UPorto Optimization Sensitivity Reports and Solver Reports give us
the shadow prices
 Patterns are only valid for small changes in the
parameters.
 UPorto Optimization Sensitivity Reports and Solver Reports give us
the limits.
| 33
Linear Optimization Problems
 Blending Constraints
 How to model the demand for proportions in quantities?
Veerman Furniture Company (revisited)
The marketing department requires that each of the products must
make up at least 25% of the total units sold.
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 34
Veerman Furniture Company
with lower limits for production
Optimal Solution
| 35
Linear Optimization Problems
 Covering Models
 Minimize objective subject to ൒ constraints on required coverage
Dahlby Outfitters (page 247)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 36
Linear Optimization Problems
 Blending Models
 Mix materials with different properties to obtain best blend
The Diaz Coffee Company (page 252)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 37
Linear Optimization Problems
 Allocation models
 Maximize objective subject to ൑ constraints on capacity
 Covering models
 Minimize objective subject to ൒ constraints on required
coverage
 Blending models
 Mix materials with different properties to find best blend
 Network models
 Describe patterns of flow in a connected system
| 38
SUMMARY
Summary
 Linear optimization represents the most widely used
optimization technique in practice.
 Special features of a linear optimization model:
 linear objective function
 linear constraints.
 Linearity in the optimization model allows us to apply
the simplex method as a solution procedure, which in
turn guarantees finding a global optimum whenever an
optimum of any kind exists.
 Therefore, when we have a choice, we are better off with
a linear formulation of a problem than with a nonlinear
formulation.
| 40
Summary
 While optimization is a powerful technique, we should
not assume that a solution that is optimal for a model is
also optimal for the real world.
 Often, the realities of the application will force changes
in the optimal solution determined by the model.
 One powerful method for making this translation is to
look for the patterns of economic priorities in the optimal
solution.
 These economic priorities are often more valuable to the
decision makers than the precise solution to a particular
instance of the model.
| 41
Chapter 12: Network
models
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
7-1
Introduction
 A network model describes patterns of flow in a
connected system, where the flow might involve
material, people, or funds.
 The system elements may be locations, such as
cities, warehouses, or assembly lines; or they may be
points in time rather than points in space.
 When we construct diagrams to represent such
systems, the elements are represented by nodes, or
circles, in the diagram. The paths of flow are
represented by arcs, or arrows.
|2
TRANSPORTATION
PROBLEM
Transportation Problem
 A very common supply chain involves the shipment
of goods
 from suppliers at one set of locations
 to customers
at another set of locations.
 The classic transportation model is characterized by:
 a set of supply sources (each with known capacities),
 a set of demand locations (each with known requirements)
 and the unit costs of transportation between supply-demand
pairs.
|4
Transportation Problem
Network Diagram
O1
9000
D1
7500
0.60
0.56
D2
8500
0.40
O2
12000
…….
0.22
O3
13000
D3
9500
D4
8000
|5
Transportation Problem
Model Formulation
The transportation model has two kinds of constraints:
 capacity constraints and
 demand constraints
If total capacity equals total demand:
both capacity and demand constraints are “=“.
If capacity exceeds demand:
the capacity constraints are “<=” and the demand constraints are “>=“.
If demand exceeds capacity:
the capacity constraints are “>=” and the demand constraints are “<=“.
|6
Transportation Problems
Bonner Electronics (page 282)
DRAW
network diagram
WRITE
algebraic model
|7
Bonner Electronics
LP model
Minimize total cost
z = 0.60 MA + 0.56 MB + 0.22 MC + 0.40 MD +
0.36 PA + 0.30 PB + 0.28 PC + 0.58 PD +
0.65 TA + 0.68 TB + 0.55 TC + 0.42 TD
Subject to:
MA + MB + MC + MD ≤ 9000
PA + PB + PC + PD
≤ 12000
TA + TB + TC + TD
≤ 13000
MA + PA + TA
MB + PB + TB
MC + PC + TC
MD + PD + TD
≥ 7500
≥ 8500
≥ 9500
≥ 8000
Each plant can deliver at
most its capacity.
Each warehouse must
receive at least its
requirement.
MA, MB, MC, MD, PA, PB, PC, PD, TA, TB, TC, TD ≥ 0
|8
Transportation Problem
Spreadsheet Model
 Adopt a special format for this type of problem.
 Construct the model in rows and columns to mirror the
table of parameters that describes the problem.
 Parameters module of the worksheet
unit costs are displayed in a matrix
 Decisions module of the worksheet
decision variables appear in a matrix of the same size.
 At the right of each decision row
“Sent” quantity: sum of the flows along the row.
Capacities are given in the Parameters module.
 Below each decision column
“Received” quantity: sum down the column.
Requirements are given in the Parameters Module
|9
Bonner Electronics
Spreadsheet Model
| 10
Optimization: Using Solver
| 11
Bonner Electronics
Spreadsheet Model
| 12
Bonner Electronics
Sensitivity Analysis
| 13
Transportation Problems
Sensitivity Analysis
 In the transportation model, we have supply and
demand constraints, and the solution to the model
provides shadow prices on each.
 The shadow price on a demand constraint tells us
how much it costs to ship the marginal unit to the
corresponding location.
Sometimes, this figure is not obvious without some
careful thought.
| 14
TRANSPORTATION
PROBLEM
SOLUTION PATTERNS
Transportation Problem
Pattern Identification in the Solution
1.
Identify the demands that are covered by a unique
source
allocate the entire demand to these routes
remove these demands from consideration.
2. Identify the capacities that supply a single
destination
allocate the entire supply to these routes
remove these supplies from consideration.
3. Repeat the 1. and 2. using remaining demands and
remaining supplies each time, until all shipments
are accounted for.
| 16
Pattern Identification
in the Optimal Solution
M
9000
A
7500
9000
8500
P
12000
B
8500
Ship as much
as possible on
routes TD, PB
and MC
C
9500
T
13000
D
8000
8000
| 17
Pattern Identification
in the Optimal Solution
M
0
A
7500
9000
8500
P
3500
B
0
Ship as much
as possible on
routes TD, PB
and MC
C
500
T
5000
8000
D
0
| 18
Pattern Identification
in the Optimal Solution
M
0
P
3500
A
7500
9000
3500
8500
4000
500
T
5000
8000
B
0
Ship as much
as possible on
routes TC, TA
and PA
C
500
D
0
| 19
Solution Patterns
 Solution patterns induce an algorithm to find the
optimal solution.
 Solution patterns still hold if some parameters are
slightly altered, allowing the problem resolution with
that algorithm without rerunning the solver.
| 20
ASSIGNMENT
PROBLEM
Assignment Model
 An important special case of the transportation
problem occurs when all capacities and all
requirements are equal to one.
 In addition, total supply equals total demand.
 The classic assignment model is characterized by a
set of people, a set of tasks, and a score for each
possible assignment of a person to a task.
 The problem is to find the best assignment of people
to tasks.
| 22
Assignment Problem
The Buchanan Swim Club example (page 290)
DRAW
network diagram
WRITE
algebraic model
| 23
The Buchanan Swim Club
LP model
Minimize total time
z=
38 T1 + 75 T2 + 44 T3 + 27 T4 +
34 B1 + 76 B2 + 43 B3 + 25 B4 +
41 L1 + 71 L2 + 41 L3 + 26 L4 +
33 C1 + 80 C2 + 45 C3 + 30 C4
Subject to:
T1 + T2 + T3 + T4
=1
B1 + B2 + B3 + B4
=1
L1 + L2 + L3 + L4
=1
C1 + C2 + C3 + C4
=1
T1 + B1 + L1 + C1
T2 + B2 + L2 + C2
T3 + B3 + L3 + C3
T4 + B4 + L4 + C4
=1
=1
=1
=1
Each swimmer swims
exactly one stroke
There is exactly one
swimmer assigned to
each stroke
T1, T2, T3, T4, B1, B2, B3, B4, L1, L2, L3, L4, C1, C2, C3, C4 ≥ 0
| 24
Assignment Problems
Sensitivity Analysis
 It is rare that we would want to perform sensitivity
analysis with respect to either the supply parameters
or the demand parameters in an assignment model.
 However, we may well be interested in sensitivity
analysis with respect to the cost parameters.
| 25
GENERAL NETWORK
PROBLEMS
STANDARD FORM
General Network Problems
Standard Form
 Formulate general network problems as linear
models built exclusively on balance equations.
 Approach may not seem as intuitive but...
 it does link the flow diagram and the spreadsheet model more
closely;
 it allows us to see a more general structure that encompasses
other network models as well.
| 27
General Network Problems
 Each node in the network corresponds to a material-
balance equation:
total flow out = total flow in
W1
F1
D1
F2
W2
W3
W4
F3
W5
| 28
General Network Problems
 Each node in the network corresponds to a material-
balance equation:
total flow out = total flow in
 Once we have a network diagram for a problem, we
can translate it into a linear model by following these
simple steps:
 Define a variable for each arc.
 Include supplies as input flows and demands as output flows.
 Construct the balance equation for each node.
| 29
General Network Problems
Standard Form
 Every constraint is a balance equation. Thus, the
constraints take the form:
total flow out - total flow in = K
 Transfer nodes:
 Supply nodes:
 Demand nodes:
K=0
K>0
K<0
| 30
SUMMARY
Summary








Network models represent a distinct class of linear models.
They have special advantages because network diagrams can be used in the modeling
process.
Transportation, assignment, and transshipment models exhibit a characteristic From/To
structure that lends itself readily to spreadsheet display.
The balance equations in transshipment nodes are the key constraint format for network
models, extending to models in which yield factors apply and even to process models
where the inflow and outflow may not be of the same material.
The constraints in some network linear programs consist exclusively of balance
equations, whereas constraints in more complicated models may include allocation,
covering, and blending constraints appended to a central network representation.
The concepts of sensitivity analysis that were introduced in the previous chapter apply as
well to network models.
In particular, when it comes to interpreting optimal solutions, the network diagram is a
convenient device for constructing patterns.
The diagram often provides visual hints that lead to a systematic description of the
economic priorities in the solution of a network problem.
| 32
Chapter 13: Integer
Optimization
Management Science:
The Art of Modeling with Spreadsheets, 3e
S.G. Powell
K.R. Baker
© John Wiley and Sons, Inc.
Power Point Slides
Revised by:
Tony Ratcliffe, James Madison University
Adapted by:
José F. Oliveira, M. Antónia Carravilla, PBS
7-1
Introduction
 The optimal solution of a linear program may
contain fractional decision variables, and this is
appropriate—or at least tolerable—in most
applications.
 In some cases, however, it may be necessary to
ensure that some or all of the decision variables take
only integer values.
 Accommodating the requirement that variables must
be integers is the subject of integer optimization.
 In this chapter, we examine the formulation and
solution of integer problems.
|2
INTEGER
VARIABLES
INTEGER SOLVER
Integer Variables Integer Solver
 Solver allows us to directly designate decision variables as integer
values.
 In the case of integer linear models, Solver employs an algorithm that
checks all possible assignments of integer values to variables, although
some of the assignments may not have to be examined explicitly.
 This procedure may require the solution of a large number of linear
problems, but because Solver can do this quickly and reliably with the
simplex algorithm, it will eventually locate a global optimum.
 In the case of integer nonlinear problems, however, certain difficulties
can arise, although Solver will always attempt to find a solution.
 Because integer versions of nonlinear programs are particularly
challenging, we concentrate here on integer linear problems.
|4
Veerman Furniture Company
Optimal Solution
Non-integer
|5
Veerman Furniture Company
|6
Veerman Furniture Company
Optimal Solution with Integer Values
|7
Solver
tip
Integer Options
 The most important integer option is the Tolerance
parameter.
 The default value of the parameter is 5%, and we
may leave this value undisturbed while we debug our
model.
 Once we are convinced that our model is running
correctly, we can set the Tolerance parameter to 0%
so that an optimal solution is guaranteed.
|8
Setting the Tolerance Parameter
The Solver will stop when the
relative difference between
the best found solution and
the best possible solution is
less than this value (5%). A
value of zero guarantees the
true optimal integer.
|9
Binary Variables and Binary Choice Models
 A binary variable, which takes on the values zero or
one, can be used to represent a “go / no-go” decision.
 We can think in terms of discrete projects:
 value 1 represents the decision to accept the project;
 value 0 represents the decision to reject the project.
| 10
Designating Variables as Binary Integers
| 11
THE CAPITAL
BUDGETING
PROBLEM
The Capital Budgeting Problem
 Companies, committees, and even households often find
themselves facing a problem of allocating a capital
budget.
 As the problem arises in many firms, there is a specified
budget for the year, to be invested in multi-year projects.
 There are also several proposed projects under
consideration.
 The committee’s job is to determine how to maximize the
value of the projects selected, subject to the limitation on
expenditures represented by the capital budget.
| 13
The Capital Budgeting Problem
 In the classic version of the capital budgeting
problem, each project is described by two values: the
expenditure required and the value of the project.
 As a project is typically a multi-year activity, its value
is represented by the net present value (NPV) of its
cash flows over the project life.
 The expenditure, combined with the expenditures of
other projects selected, cannot be more than the
budget available.
| 14
Designating Variables as Binary Integers
| 15
The Capital Budgeting Problem
The Marr Corporation (page 318)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 16
The Marr Corporation
Algebraic Model
yj
1 if project j is accepted
0 otherwise
Maximize
z = 10y1 + 17y2 + 16y3 + 8y4 + 14y5
Subject to
48y1 + 96y2 + 80y3 + 32y4 + 64y5 ≤ 160
| 17
The Marr Corporation
Model without Binary Variables
yj ≥ 0
yj ≥ 0
yj ≤ 1
| 18
The Marr Corporation
Model with Binary Variables
| 19
RELATIONSHIPS
AMONG PROJECTS
Relationships among Projects
 We cover five types of relationships:
 at least m projects must be selected
 at most n projects must be selected
 exactly k projects must be selected
 some projects are mutually exclusive
 some projects have contingency relationships
| 21
Relationship:
at least m projects must be selected
y2 + y 3 + y 5 > 2
 At least two out of three projects (Project 2, Project
3, Project 5) will be selected, thus satisfying the
requirement of at least two selections.
| 22
Relationship:
at most n projects must be selected
y4 + y 5 < 1
 Project 4, or Project 5, or neither, but not both will
be selected, thus satisfying the requirement of at
most one selection.
| 23
Relationship:
exactly k projects must be selected
y4 + y 5 = 1
 Exactly one of either Project 4 or Project 5 will be
selected, thus satisfying the requirement of exactly
one selection.
| 24
Relationship:
some projects have contingency relationships
y3 – y5 > 0
 If Project 5 is selected, then project 3 must be as well.
| 25
THE SET
COVERING
PROBLEM
The Set Covering Problem
 The set covering problem is a variation of the
covering model in which the variables are all binary.
 In addition, the parameters in the constraints are all
zeroes and ones.
 In the classic version of the set covering problem,
each project is described by a subset of locations that
it “covers.”
 The problem is to cover all locations with a minimal
number of projects.
| 27
The Set Covering Problem
Emergency Coverage in Metropolis (page 320)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 28
Emergency Coverage in Metropolis
Algebraic Model
yj = 1 if site j is selected
0 otherwise
Minimize
Subject to
z = y1 + y2 + y3 + y4 + y5 + y6 + y7
y1
+ y6
+ y6
+ y6
y1
y1
y1
y1
y2
y2
y2
+ y4
+ y3
+ y3
y3
+ y4
+ y4
+ y5
+ y5
+ y5
+ y5
+ y6
+ y7
+ y7
+ y7
+ y7
≥1
≥1
≥1
≥1
≥1
≥1
≥1
≥1
≥1
| 29
BINARY VARIABLES
AND LOGICAL
RELATIONSHIPS
Binary Variables and Logical Relationships
 We sometimes encounter additional conditions
affecting the selection of projects in problems like
capital budgeting.
 relationships among projects
 fixed costs
 quantity discounts.
| 32
LINKING CONSTRAINTS
AND
FIXED COSTS
Linking Constraints and Fixed Costs
 We commonly encounter situations in which activity
costs are composed of fixed costs and variable costs,
with only the variable costs being proportional to
activity level.
 With an integer programming model, we can also
integrate the fixed component of cost.
| 34
Incorporating a fixed cost into the model
 We separate the fixed and variable components of
cost.
 In algebraic terms, we write cost as
Cost = F + cx,
where F represents the fixed cost, and c represents the linear
variable cost.
 The variables x and  are decision variables, where x
is a normal (continuous) variable, and  is a binary
variable.
| 35
Linking Constraint
 To achieve consistent linking of the two variables, we
add the following generic linking constraint to the
model:
x <= M
where M is an upper bound on the variable x.
(M is at least as large as any value we can feasibly choose for x)
| 36
Linking Constraint:
x < M

When  = 0 (and therefore no fixed cost is incurred), the right-hand
side becomes zero, and Solver interprets the constraint as x <= 0.
Since we also require x >= 0, these two constraints together force x
to be zero.
Thus, when  = 0, it will be consistent to avoid the fixed cost.

On the other hand, when y = 1, the right-hand side will be so large that
Solver does not need to restrict x at all, permitting its value to be
positive while we incur the fixed cost.
Thus, when  = 1, it will be consistent to incur the fixed cost.
Of course, because we are optimizing, Solver will never produce a
solution with the combination of  = 1 and x = 0, because it would
always be preferable to set  = 0.
| 37
Fixed Costs
Mayhugh Manufacturing Company (page 325)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 38
Solver
tip
Logical Functions
and Integer Programming
 Unfortunately, the linear solver does not always
detect the nonlinearity caused by the use of logical
functions, so it is important to remember never to
use an IF function in a model built for the linear
solver.
| 39
THRESHOLD LEVELS
AND
QUANTITY DISCOUNTS
Threshold Levels and Quantity Discounts
 Threshold level requirement: a decision variable is
either at least as large as a specified minimum, or
else it is zero.
 The existence of a threshold level does not directly
affect the objective function of a model, and it can be
represented in the constraints with the help of binary
variables.
| 41
Threshold Levels
x = 0 or A<= x <= M
 Suppose we have a variable x that is subject to a
threshold requirement.
 Let A denote the minimum feasible value of x if it is
nonzero.
 We can capture this structure in an integer
programming model by including the following pair of
constraints:
< x < M
where, as before, M is a large number that is greater
than or equal to any value x could feasibly take and is
a binary variable.
| 42
Threshold Levels
Mayhugh Manufacturing Company (page 325)
Product family F2, if produced, is required to have a
production of at least 250 units.
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 43
*The Facility Location Problem
 The transportation model is typically used to find optimal shipping
schedules in supply chains and logistics systems.
 The applications of the model can be viewed as tactical problems, in
the sense that the time interval of interest is usually short, say a
week or a month.
 Over that time period, the supply capacities and locations are
unlikely to change at all, and the demands can be predicted with
reasonable precision.
 Over a longer time frame, a strategic version of the problem arises.
In this setting, the decisions relate to the selection of supply
locations as well as the shipment schedule.
 These decisions are strategic in the sense that, once determined,
they influence the system for a relatively long time interval.
 The basic model for choosing supply locations is called the facility
location model.
| 44
The Facility Location Problem
Levinson Foods Company (page 330)
DEFINE
decision variables
objective
constraint types
WRITE
algebraic model
| 45
Levinson Foods Company
The Capacitated Problem
 Conceptually, we can think of this problem as
having two stages.
 First stage: decisions must be made about how many
warehouses to open and where they should be.
 Second stage: once we know where the warehouses are, we
can construct a transportation model to optimize the actual
shipments.
 The costs at stake are also of two types:
 fixed costs associated with keeping a warehouse open
 variable transportation costs associated with shipments from
the open warehouses.
| 46
The Facility Location Problem
Levinson Foods Company (page 330)
What would change if the capacity of the warehouses was
unlimited?
| 47
Levinson Foods Company
The Capacitated Problem
 Once we see how to solve the facility location
problem with capacities given, it is not difficult to
adapt the model to the uncapacitated case.
 Obviously, we could choose a virtual capacity for
each warehouse that is as large as the total demand,
so that capacity would never interfere with the
optimization.
| 48
SUMMARY
Summary
 Integer optimization problems are optimization problems in which at least
one of the variables is required to be an integer.
 Solver’s solutions to linear integer problems are reliable: a global optimal
solution always occurs as long as the Integer Tolerance parameter has been
set to zero.
 Binary variables can represent all-or-nothing decisions that allow only
accept/reject alternatives.
 Binary variables can also be instrumental in capturing complicated logic in
linear form so that we can harness the linear solver to find solutions.
 Binary variables make it possible to accommodate problem information on:




Contingency conditions between projects
Mutual exclusivity among projects
Linking constraints for consistency
Threshold constraints for minimum activity levels
 With the capability of formulating these kinds of relationships in
optimization problems, our modeling abilities expand well beyond the basic
capabilities of the linear and nonlinear solvers.
| 50
Download