limited finance test 2.5 hour
3QA3/2DA3
Management Science for Business
Lecture 05
C01: July 5, 2021
C02: July 6, 2021
Instructors:
Seyyed Hossein Alavi Zdravko Dimitrov
Simultaneous Changes in RHS
2
Case 1: All constraints whose RHS are being changed are non- binding,
Then all shadow prices by Solver are valid, as long as the changes are in allowable interval.
Case 2: At lease one of the constraints whose RHS are being changed is binding,
Then, we use 100% Rule.
The Solver reports are valid only if
𝐶ℎ𝑎𝑛𝑔𝑒𝑠
𝐶ℎ𝑎𝑛𝑔𝑒
𝐴𝑙𝑙𝑜𝑤𝑎𝑏𝑙𝑒 𝐶ℎ𝑎𝑛𝑔𝑒 ≤ 1
Simultaneous Changes in RHS
3
Flair Furniture Company
Change 2,400 to 2,500 (increase in carpentry time) and 1,000 to 870 (decrease in painting time)
100
225 +
130
150 = 0.44 + 0.86 = 1.3 ≰ 1
The information is not valid anymore. Solve the problem again.
Change 2,400 to 2,200 (decrease in carpentry time) and 1,000 to 900 (decrease in painting time)
200
900 +
100
150 = 0.22 + 0.66 = 0.88 ≤ 1
The information is valid.
✓ Obviously, if one of the changes is more than the allowable change, the ratio will be greater than 1.
Use of Shadow Price – Flair Company Example
4
1. Shows us the value of extra capacity: The value of one extra hour in carpentry department is $0.6
The value of one extra hour in painting department is $2.6
2. New product evaluation: Shows the opportunity cost of producing a new product that uses the same
resources available for the current products
Use of Shadow Price – Flair Company Example
5
Example (new product evaluation): A new product (e.g. cabinet) needs 3 hours/unit in the carpentry
department and 2 hours/unit in the painting department, and has a profit
margin of $8 /unit. Should the company produce it? Interpretation: The company has additionally obtained exactly 3 hours in the carpentry
department and 2 hours in the painting department
Which plan is better in terms of profit: 1) to use these extra hours to still make tables
and chairs, or 2) to make one unit of cabinet?
3
225 +
2
600 = 0.017 ≤ 1
Increase in the total profit by using the extra hours to produce the tables and chairs:
3 × 0.6 + 2 × 2.6 = $7
= Marginal worth of the resources that would be consumed by the cabinet, if produced
< Marginal (profit) contribution of the cabinet = $8
We should produce the cabinet (plan 2)!
Simultaneous Changes in OFC
6
Case 1: All variables whose OFCs are changed have non-zero reduced costs,
Then all reduced costs by Solver are valid, as long as the changes are in allowable interval.
Case 2: At least one of the variables whose OFCs are changed has a reduced cost of zero,
Then, we use 100% Rule.
The Solver reports are valid only if
𝐶ℎ𝑎𝑛𝑔𝑒𝑠
𝐶ℎ𝑎𝑛𝑔𝑒
𝐴𝑙𝑙𝑜𝑤𝑎𝑏𝑙𝑒 𝐶ℎ𝑎𝑛𝑔𝑒 ≤ 1
Simultaneous Changes in OFC
7
Flair Furniture Company
Change 7 to 8 (increase in table profit) and 5 to 7 (increase in chair profit)
1
3 +
2
4.33 = 0.33 + 0.46 = 0.79 ≤ 1
The information is valid!
Change 7 to 9 (increase in table profit) and 5 to 4 (decrease in chair profit)
2
3 +
1
1.5 = 0.66 + 0.66 = 1.33 ≰ 1
The information is not valid anymore. Solve the problem again.
✓ Obviously, if one of the changes is more than the allowable change, the ratio will be greater than 1.
A Minimization Example
8
Burn-Off Diet Drink Company
Min daily dosage of 36 and max of 40 ounces.
INGREDIENT (units/ounce)
A B C D REQUIREMENT
Chemical X 3 4 8 10 At least 280 units
Chemical Y 5 3 6 6 At least 200 units
Chemical Z 10 25 20 40 At most 1,050 units
Cost/ounce $0.40 $0.20 $0.60 $0.30
A Minimization Example
9
Burn-Off Diet Drink Company
Minimize 0.4𝐴 + 0.2𝐵 + 0.6𝐶 + 0.3𝐷
Subject to
𝐴 + 𝐵 + 𝐶 + 𝐷 ≥ 36 (daily dosage minimum)
𝐴 + 𝐵 + 𝐶 + 𝐷 ≤ 40 (daily dosage maximum)
3𝐴 + 4𝐵 + 8𝐶 + 10𝐷 ≥ 280 (chemical X requirement)
5𝐴 + 3𝐵 + 6𝐶 + 6𝐷 ≥ 200 (chemical Y requirement)
10𝐴 + 25𝐵 + 20𝐶 + 40𝐷 ≤ 1,050 (chemical Z max limit)
𝐴, 𝐵, 𝐶, 𝐷 ≥ 0 (non-negativity)
Questions:
10
1. What is the impact on cost of a change in daily dosage maximum?
2. What is the impact on cost if we increase X requirement to 290? What about a decrease to 270?
3. What is the impact on cost if we increase Z requirement to 1,070? What about a decrease to 1,020?
4. What is the impact on cost if we decrease Z requirement to 650?
5. Suppose we have a new ingredient “E” which costs $0.3, and contains 5,7, and 10 unit of chemicals X,Y, and Z, respectively. Is it optimal to use it? What if its cost is $0.7?
6. What is the impact on cost if we insist on using 1 ounce of ingredient B to make the drink?
7. There is some uncertainty in the cost of ingredient C. How sensitive is the current optimal solution to this cost?
8. We can decrease the minimum requirement for chemical X by 5 units (from 280 to 275), provided that the maximum limit allowed for chemical Z is reduced to 1,000 units (i.e., reduced by 50 units). Is this trade-off cost-effective for Burn- Off to implement?
Answers
11
1. The slack value in solver answer report shows that this constraint is not binding, with a slack of 4. So, increasing 40 is of no value in terms of reducing the cost. We can decrease it by 4 units without changing the solution because the allowable decrease is 4.
2. X requirement constraint is “≥“ and the increase to 290 will make the feasible region smaller. Also, it is a binding constraint and its shadow price is 0.0875. Since we add 10 units to the RHS (it does not exceed the allowable increase of 41), then 10 × 0.0875 = 0.875 will be added to the objective function value. Decreasing to 270 will make the feasible region bigger (the decrease of 10 units in RHS value also does not exceed the allowable decrease of 11), so 10 × 0.0875 = 0.875 will be deducted from the objective function. (Refer to the Excel file for class 5 – sheet Q2. 280->290 and sheet Q2. 280->270 for more details.)
3. Z requirement constraint is “≤“ and the increase to 1,070 will make the feasible region bigger. Also, it is a binding constraint and the shadow price is −0.02375. Since we add 20 units to the RHS (the increase of 20 units in RHS value does not exceed the allowable increase of 47), then the objective function value can be improved by 20 × −0.02375 = −0.475. Decreasing to 1,020 will worsen the objective function value by 30 × 0.02375 = 0.7125 (the decrease of 30 units in RHS value does not exceed the allowable decrease of 346). (Refer to the Excel file for class 5 – sheet Q3. 1050->1070 and sheet Q3. 1050->1020 for more details.)
4. The allowable decrease for the RHS of Z Req constraint is 346. So, the minimum number that keeps the solution valid is 1050-346=704. Any number less that 704 will be out of the range of feasibility. Therefore, with 650, the reports by Solver are not valid anymore, and we need to solve the problem again.
Answers
12
5. We calculate the marginal worth of this new ingredient:
𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠
(𝑆ℎ𝑎𝑑𝑜𝑤 𝑝𝑟𝑖𝑐𝑒 × 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡)
= 0.375 × 1 + 0 × 1 + 0.0875 × 5 + 0 × 5 + −0.02375 × 10 = 0.575
Since the cost for E is $0.3, it is optimal to use it.When it is $0.7, it is not.
(Refer to Excel file for class 5, sheets Q5. Cost=0.3 and Q5. Cost=0.7 )
6. The reduced cost of B shows a positive value of 0.06875. So, if we use one unit of B, the objective function value will increase by 0.06857 units. (Sheet Q6. 1 of Excel file for class 5)
In other words, if we reduce the cost of B by 0.06857 units, then it becomes cost-effective and will be used in the solution. (Sheet Q6. 2 of Excel file for class 5)
7. The range can be defined by allowable increase/decrease for variable C in the sensitivity report 0.6 − 0.0733 ,0.6 + 1.5 = 0.526,2.1
Answers
13
8. Since we are dealing with simultaneous changes, we use 100% rule:
5
11 +
50
346 = 0.599 < 1
So, the sensitivity report information is valid.
By this change for X constraint, the feasible region will be larger, so we
can improve the objective by 5 × 0.0875 = 0.4375.
For Z requirement constraint, the feasible region will be smaller, so the
objective will be adversely affected by 50 × −0.02375 = −1.1875.
Therefore, the net impact on the total cost is
0.4375 − 1.1875 = −0.75
The objective function value worsens. (Sheet Q8 in Excel file for Class 5)
Integer Programming (IP)
Integer Programming (IP)
15
In LP, we assume that fractional values are acceptable.
In real-world problems, sometimes only integer values are acceptable.
There are 2 types of IP:
General IP: variables can take any non-negative integer values such as 0,1,2,…
Binary IP: variables can only take 0 and 1
Pure Integer Programming (IP) Problems: when the problem only
contains integer variables
Mixed-Integer Programming (MIP) Problems: when there are both
integer and non-integer variables.
Most of real-world problems are MIP.
Does Rounding Work?
16
It may work, but not always!!
Consider the following problem:
Max 𝑥 + 0.64𝑦
50𝑥 + 31𝑦 ≤ 250
3𝑥 − 2𝑦 ≥ −4
𝑥, 𝑦 ∈ ℤ+ ➔ (𝑥, 𝑦 ≥ 0)
The LP solution : 𝑥 = 1.94 𝑦 = 4.92, 𝑂𝑏𝑗 = 5.09
Rounding off: 𝑥 = 2 𝑦 = 5, 𝑂𝑏𝑗 = 5.2 × Infeasible!
The IP Solution : 𝑥 = 5 𝑦 = 0, 𝑂𝑏𝑗 = 5
Solving IP
17
Now, consider the following problem:
Max 600𝑥 + 700𝑦
2𝑥 + 3𝑦 ≤ 12
6𝑥 + 5𝑦 ≤ 30
𝑥, 𝑦 ∈ ℤ+
If we change 𝑥, 𝑦 ∈ ℤ+ to 𝑥, 𝑦 ≥ 0, we call the new problem the linear relaxation of the original IP problem.
IP vs LP
18
The LP optimal solution is:
𝑥 = 3.75, 𝑦 = 1.5 𝑂𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒: 3,300
If we round to 𝑥 = 4, 𝑦 = 2, the solution is not feasible.
If we round to 𝑥 = 3, 𝑦 = 1, the solution is 1,800 .
If we round to 𝑥 = 4, 𝑦 = 1, the solution is 3,100 .
The IP optimal solution is:
𝑥 = 3, 𝑦 = 2 𝑂𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒: 3,200
❖IP solution CANNOT be better than relaxed LP solution.
Graphical Solution
19
+ = Integer Valued Point
6X + 5Y ≤ 30
Rounded-off IP Solution
(X = 4, Y = 2, Infeasible)
+
2X + 3Y ≤ 12+
+
+
++
+
+
+ Optimal LP Solution (X = 3.75, Y = 1.50, Profit = $3,300)
Y
L
6 –
5 –
4 –
3 –
2 –
1 –
– | | | | | |
0 1 2 3 4 5 6
Optimal IP
Solution
(X = 3, Y = 2,
Profit = $3,200)
Important Remarks
20
1. The IP optimal solution is not on a corner point. Therefore, the
Simplex method of Solver does not work.
2. Solver uses a method called “Branch-and-Bound” or “B&B”. It
searches the feasible region to find the optimal integer solution.
3. In changing an LP problem to IP problem, more restrictions will
be imposed on the problem. Therefore, the feasible region will be
smaller and the IP solution cannot be better. The IP solution is
either worse than LP solution or it is the same solution.
Binary Variables
21
Can only take 0 and 1 values
Very helpful in modelling
Yes/No decisions
Selection decisions
Covering decisions
Some Binary Applications
22
Investment Analysis Shall we make a certain investment?
Site selection Should a certain site be selected to locate a new facility?
Airline Application Should a certain type of airplane be assigned to a certain flight leg?
Should a certain sequence of flight legs be assigned to a crew?
Production and Distribution Network Should a certain plant remain open?
Should a certain site be selected for a new plant?
Should a certain distribution center be assigned to serve a certain market area?
Writing Constraints Using Binary Variables
23
Selecting 𝑘 out of 𝑛 choices (𝑛 ≥ 𝑘):
𝑥𝑖 = 1 if 𝑖 is selected; 0 otherwise
Selecting exactly 𝑘 out of 𝑛 choices:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 = 𝑘
Selecting at least 𝑘 out of 𝑛 choices:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 ≥ 𝑘
Selecting at most 𝑘 out of 𝑛 choices:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 ≤ 𝑘
Writing Constraints Using Binary Variables
24
Managing incompatible selections:
✓ 𝑥𝑖 = 1 if 𝑖 is selected; 0 otherwise
Mutually exclusive: Only one of the decision variables can be selected:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 = 1
If one is selected, others cannot be selected:
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 ≤ 1
Writing Constraints Using Binary Variables
25
Managing dependencies:
If decision 𝑥1 is selected, then 𝑥2 must be selected as well (one way):
𝑥1 ≤ 𝑥2 or 𝑥1 − 𝑥2 ≤ 0
In fact 𝑥1 requires 𝑥2.
If 𝑥1 requires 𝑥2 or 𝑥3: 𝑥1 ≤ 𝑥2 + 𝑥3 If 𝑥1 requires 𝑥2 and 𝑥3: 2𝑥1 ≤ 𝑥2 + 𝑥3
If decision 𝑥1 is selected, then 𝑥2 must be selected and vice versa (two way):
𝑥1 = 𝑥2 or 𝑥1 − 𝑥2 = 0
Managing Constraints Using Binary Variables
26
Managing incompatible constraints:
Sometimes, we need to select one of two constraints, with which we can get a better solution:
3𝑥1 + 2𝑥2 ≤ 5 𝑥1 + 4𝑥2 ≤ 8
Introduce a binary variable 𝑦 : 3𝑥1 + 2𝑥2 ≤ 5 + 𝑀𝑦 𝑥1 + 4𝑥2 ≤ 8 + 𝑀(1 − 𝑦)
Where 𝑀 is a very large positive number.
Example
27
We want to decide on locating libraries in a city. There are 3
potential locations 1,2,3 in the city and the mayor gives us profit
for locating in each location.
We do not have budget for more than 2 libraries.
If we locate in point 1, we have to locate in point 2 and vice versa.
Point 1 Point 2 Point 3 Max
Available
Resource 1 19 27 34 80
Resource 2 22 13 12 40
Profit $50 $45 $48
Example
28
𝑥𝑖 = ቊ 1, 𝑖𝑓 𝑤𝑒 𝑙𝑜𝑐𝑎𝑡𝑒 𝑎 𝑙𝑖𝑏𝑟𝑎𝑟𝑦 𝑖𝑛 𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛 𝑖 , 0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒.
Max 50𝑥1 + 45𝑥2 + 48𝑥3 Subject to
19𝑥1 + 27𝑥2 + 37𝑥3 ≤ 80 22𝑥1 + 13𝑥2 + 12𝑥3 ≤ 40
𝑥1 + 𝑥2 + 𝑥3 ≤ 2 𝑥1 − 𝑥2 = 0 𝑥1, 𝑥2, 𝑥3 ∈ 0,1
Nonlinear Programming (NLP)
What is NLP?
30
Recall that in LP, nonlinear terms such as 𝑥2, 𝑙𝑜𝑔𝑥, 1
𝑥 ,2𝑥𝑦, and etc. are
not allowed.
Suppose the profit of a unit is $5. In some real-world problems, it is
likely that the profit of a product decreases as its supply increases.
If the profit is 5 − 0.003𝑥, then the total profit, if we sell 𝑥 unit is:
𝑥 × 5 − 0.003𝑥 = 5𝑥 − 0.003𝑥2
An NLP model has a nonlinear objective function, or at least one
nonlinear constraint, or both.
Optimality in NLP?
31
In NLP, we have both local and global optimal solutions.
A Local Optimum is better than all nearby points.
A Global Optimum is the best point in the entire feasible region.
Unfortunately, in NLP, it is easy to get stuck at a local optimum and never find the global optimum.
We need an starting point to solve NLP. It is important to select a good one!
NLP Feasible Region
32
For a function with one variable
Local Maximum
Local Minimum
Global Minimum
Global Maximum
NLP Feasible Region
33
For a function with two variables
Nonlinear
Feasible
Region
Global Optimal
SolutionLocal Optimal Solution
C
BA
D
Starting point C may
lead to local optimal
point A first
Starting point D
may lead to
global optimal
point B first
Y
X
NLP Feasible Region
NLP Example
35
Max 45𝑥 + 2𝑥2 + 70𝑦 + 3𝑦2 + 2𝑥𝑦 + 60𝑧 + 3𝑧2
Subject to
𝑥 + 𝑦 + 𝑧 ≤ 200
𝑥 + 3𝑦 + 𝑧 ≤ 560 3𝑥 + 5𝑦 + 3.5𝑧 ≤ 1000
0.6𝑥 + 0.6𝑦 + 0.6𝑧 + 0.003𝑥2 + 0.003𝑥𝑦 + 0.003𝑥𝑧 ≤ 140
𝑥, 𝑦, 𝑧 ≥ 0
➢We can only say that the solution by Solver is a local optimum. It is
not guaranteed that the returned solution is globally optimum.
Practice Problems
CHAPTER 4
Discussion Questions 6, 8
Problems 13, 15, 21, 22, 23
CHAPTER 6
Discussion Question 3
Problems 13, 19, 37
36