Linear and Integer Programming
2025-04-09
What is Linear Programming
Installing and Using Excel Solver (Review Demo)
Example 1 – Milk Production
One more complication – Integers (countable things)
Example 2 – Shipping Cookies
What you should know
In-class Polling (Session ID: bua345s25)
Session ID: bua345s25
Review Question from Lecture 23:
Recall the Bleu de Chanel data from Lecture 23. A store executive worries that sales are slow and wants to lower the price to $95. If the model shown in the plot is correct (wholesale price is $75), what do you tell them?
\[ \begin{align*} &= Demand \times Profit \\ &= (2486 – 15.61X) \times (X – 75) \\ &= -186450 + 3656.75X -15.61X^2 \end{align*} \]
Your farm in Upstate NY owns two herds of cows:
The two herds differ with respect to how many liters per day each herd can produce and the percent Milk-Fat in the herd’s milk.
Here are the production and milk-fat percentage data by herd:
In this example there is more than one optimal solution.
Excel seemed to pick the simplest one until we add an additional constraint.
What if our farm’s retail outlets requests 20 Liters of 2% Milk?
Which solutions below meet the criteria of 560 total Liters, 21.28 Liters of milk-fat and matches our optimal profit of $177.52?
Use the Excel Solver and update the relevant constriant to determine the correct choice.
A. 527 L Whole 20 L 2% 23 L Skim
B. 527 L Whole 20 L 2% 13 L Skim
C. 517 L Whole 20 L 2% 23 L Skim
D. 522 L Whole 20 L 2% 18 L Skim
E. 520 L Whole 20 L 2% 20 L Skim
This example describes an upstate NY cookie company with production plants in two locations:
The company distributes their holiday cookies to stores in three locations:
The company wants to know how many cookies they should ship from each plant to each store location to MINIMIZE shipping costs.
In the cookie example, production has increased at the Albany plant and so has demand in New York and Boston.
The Solver solution for these updated Supply and Demand constraints can be found below and in the supplementary Excel file.
Based on what you know of the geography, do you think this is the only correct solution or might it be possible to constrain the solution further to minimize transportation distances?
What constraint might you suggest to minimize transportation distances?
As an interactive lecture question, any coherent answer with correct spelling, punctuation, and grammar will receive full credit.
On the Final Exam, I will expect a coherent sentence that demonstrates understanding.
Linear equations and constraints can be written as lines of code in R or Python.
The costs and the supply and demand values can be specified as inputs into the function in R.
Output values would be the same as shown in Excel.
Linear equations and constraints can be written as lines of code in R or Python.
The costs and the supply and demand values can be specified as inputs into the function in R.
Output values would be the same as shown in Excel.
What is linear programming (optimization) as opposed to non-linear optimization.
What is meant by a constraint and how to describe each constraint in a sentence.
How to use the Excel Solver (HW 9 and HW 10 will include solver questions).
Which solver method is appropriate for which problem:
From Excel Documentation:
The examples shown here use a linear combination or equation to find the value in multiple variables that optimize Y, our objective.
Y can be
Additional constraints can be added iteratively if first solution does not meet all considerations.
Important to understand concepts and which method to use when (See previous slide).
HW 9 is due on 4/16.
Including today, there are five lectures and engagement questions remaining.
To submit an Engagement Question or Comment about material from Lecture 24: Submit it by midnight today (day of lecture).