Lecture - Intro To Optimization and Linear Programming
Lecture - Intro To Optimization and Linear Programming
io/argmin/
Read along with Chapter 2 of “Spreadsheet Modeling and Decision Analysis: A Practical Introduction to Business
Analytics, 9th Edition, Cliff Ragsdale, Cengage © 2022”
Every business entity has limited resources (but unlimited potential for growth). The challenge is to Maximize the use
of limited resources by optimal allocation and maximize returns.
Mathematical Programming (MP) is a business analytics area that finds the most efficient (optimal) use of
available resources to accomplish the business goals.
In other words, MP is used to identify the optimal values for the decision parameters in a mathematical model. So, MP
is also called as Optimization and key to Prescriptive Analytics (for data-driven decision making). Prescriptive
Analytics recommends the best course of action for the business to move forward.
“Prescriptive analytics takes things one step further and presents actions you can take to meet organizational goals”.
(https://online.hbs.edu/blog/post/prescriptive-analytics ) [ Beyond descriptive and predictive analytics]
Every Business (Decision) Problem
is an Optimization Problem
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part. 5
Icebreaker: Class Scheduling
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Chapter Objectives (1 of 2)
By the end of this chapter, you should be able to:
• 02.01 Describe business applications of optimization.
• 02.02 Describe the components of an optimization problem.
• 02.03 Differentiate between LP and MP problems.
• 02.04 Describe the steps involved in formulating an LP problem
• 02.05 Formulate simple, two-variable LP models for business problems.
• 02.06 Draw the feasible region for an LP problem with two variables.
• 02.07 Identify the optimal solution to an LP problem with two variables using
level curves and by enumerating the corner points of the feasible region.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Chapter Objectives (2 of 2)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Polling Activity
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Introduction
• Every decision can be considered an optimization problem
• We generally try to make the best decision possible under the
circumstances
• We face decisions about how to use limited resources such as
• Class schedules
• Oil in the earth
• Land for dumps
• Time
• Money
• Workers
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Mathematical Programming…
• MP is a field of management science that finds the optimal, or
most efficient, way of using limited resources to achieve the
objectives of an individual of a business.
• a.k.a. Optimization
• Optimization underpins
• Descriptive analytics
• Predictive analytics
• Prescriptive analytics
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Applications of Optimization
• Determining Product Mix - how many of each product to make
to maximize profits or meet the market demand at minimal cost
• Manufacturing – optimizing manufacturing operations for
improving the productivity
• Routing and Logistics – Walmart, and other retailers – optimizing
their warehouse and retail stores inventory; FEDEX, UPS using
optimal routing.
• Financial Planning – Imagine 401k withdrawals – how to
minimize IRS taxes and get the best outcome and be in compliance.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Characteristics of Optimization Problems
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
General Form of an Optimization Problem
Decisions: X1, X2 etc are the decision variables (say, amount of $
MAX (or MIN): f0(X1, X2, …, Xn) from 401k withdrawal)
Subject to: f1(X1, X2, …, Xn)<=b1 Constraints: Represented as < =, >= or = constraints.
Here, the constraint is some function of the decision variables meeting
: the given constraints. Any number of constraints can be used for an
optimization problem.
fk(X1, X2, …, Xn)>=bk
For e.g., the $ amount withdrawn from 401k is at least the
: minimum amount required by the IRS (for compliance)
Note: If all the functions in an optimization are linear, the problem is a Linear
Programming (LP) problem
Goal of optimization to find the values of the decision variables which would Maximize (or Minimize) the business objective
function considering all the given constraints.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Linear Programming (LP) Problems
Objective function
MAX (or MIN): c1X1 + c2X2 + … + cnXn
Subject to: a11X1 + a12X2 + … + a1nXn <= b1
:
ak1X1 + ak2X2 + … + aknXn >=bk Constraints
:
am1X1 + am2X2 + … + amnXn = bm
• LP involves creating and solving optimization problems which have linear objective functions as well as linear constraints (linear in
nature – flat or straight line formation). LP is a very powerful business application tool for optimization.
• c1, c2 – objective function coefficients – represent the marginal profits associated with the decision variables X1, X2
• A11, a12 etc – weighted numeric coeeficients of the decision variables for constraints
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
An Example LP Problem
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part. 16
An Example LP Problem
• Blue Ridge Hot Tubs produces two types of hot tubs: Aqua-Spas & Hydro-
Luxes.
Aqua-Spa Hydro-Lux
Pumps 1 1
Labor 9 hours 6 hours
Tubing 12 feet 16 feet
Unit Profit $350 $300
• There are 200 pumps, 1566 hours of labor, and 2880 feet of tubing available during the next production cycle.
• The owner is confident that he can sell all the hot tubs he can produce
Challenge: Decide on how many of each type of hot tubs to produce during the next production cycle?
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
5 Steps in Formulating LP Models (1 of 2)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
5 Steps in Formulating LP Models (2 of 2)
4. State the constraints as linear combinations of the decision variables.
1X1 + 1X2 <= 200 } pumps
9X1 + 6X2 <= 1566 } labor
12X1 + 16X2 <= 2880 } tubing
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
LP Model for Blue Ridge Hot Tubs
Objective Function MAX: 350X1 + 300X2
X1 >= 0
X2 >= 0
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Discussion Activity: Relying on Intuition
• Idea: Each Aqua-Spa (X1) generates the highest unit profit ($350), so let’s
make as many of them as possible!
• How many would that be?
• Let X2 = 0 [ Because X1 nets $350 profit and makes sense to make X1 more]
1X1 + 1X2 <= 200
• 1st constraint: X1 <= ? (200)
• 2nd constraint: X1 <= ? (174) 9X1 + 6X2 <= 1566
• If X2=0, the maximum value of X1 is what (174 as it is the most restrictive of all the 3 constraint and is the largest X1 value to
satisfy all the constraints) , and what would the total profit be? ($350 x 174 = $60,900)
• Is this the best answer? – No. Let us explore. (because there will still be 26 pumps and 792 ft of tubing remaining)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Solving LP Problems: A Graphical Approach
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Plotting the First Constraint
Shaded area is the feasible region. (or
feasible solution)
Also,
X1 >= 0
X2 >= 0
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Plotting the Second Constraint
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Plotting the Third Constraint
We can have infinite number of feasible
solutions to maximize the objective. Let
us explore how we can easily eliminate
most of the options in an LP Problem by
consideration
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Plotting a Level Curve of the Objective Function
MAX: 350X1 + 300X2 How to narrow down the optimal solution from
the feasible region meeting all the 3 constraints?
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
A Second Level Curve of the Objective Function
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Using a level Curve to Locate the Optimal Solution
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Calculating the Optimal Solution
• The optimal solution occurs where the “pumps” and “labor” constraints intersect.
• This occurs where:
X1 + X2 = 200 (1)
and 9X1 + 6X2 = 1566 (2)
• From (1) we have, X2 = 200 −X1 (3)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Enumerating the Corner Points
Note: This technique will not work if the
solution is unbounded.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Summary of Graphical Solution to LP Problems
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Understanding How Things Change
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Special Conditions in LP Models
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Example of Alternate Optimal Solutions
There can be more than one optimal solution. (more
than one optimal point which maximizes the objective
function value)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Example of a Redundant Constraint
• Redundant constraint is one which plays
no role in determining the feasible
region of the LP Problem.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Example of an Unbounded Solution
There may be cases where objective
function can be made infinitely large.
For example,
MAX: X1 + X2 (subject to earlier
constraints)
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Example of Infeasibility to a LP Problem
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Self-Assessment
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Summary (1 of 2)
We learned how to
• Describe business applications of optimization.
• Describe the components of an optimization problem.
• Differentiate between LP and MP problems.
• Describe the steps involved in formulating an LP problem
• Formulate simple, two-variable LP models for business problems.
• Draw the feasible region for an LP problem with two variables.
• Identify the optimal solution to an LP problem with two variables using
level curves and by enumerating the corner points of the feasible region.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.
Summary (2 of 2)
Learned how to
• Describe how an LP problem’s feasible region and solution might
change as changes are made to the model parameters.
• Describe infeasibility in regard to optimization problems.
• Describe alternate optimal solutions in regard to optimization
problems.
• Describe redundant constraints in regard to optimization problems.
• Describe unbounded solutions in regard to optimization problems.
Cliff T. Ragsdale, Spreadsheet Modeling & Decision Analysis, Ninth Edition. © 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly
accessible website, in whole or in part.