[IN] linear optimize
[IN] linear optimize
1. Identify the decision variables – the unknown values SSC sells two snow ski models - Jordanelle & Deercrest
that the model seeks to determine. Manufacturing requires fabrication (chế tạo) and finishing.
2. Identify the objective function – the quantity we seek The fabrication department has 12 skilled workers, each of
to minimize or maximize. whom works 7 hours per day. The finishing department has 3
workers, who also work a 7-hour shift.
3. Identify all appropriate constraints – limitations,
requirements, or other restrictions that are imposed on Each pair of Jordanelle skis requires 3.5 labor-hours in the
fabricating department and 1 labor-hour in finishing.
any solution, either from practical or technological
considerations or by management policy. The Deercrest model requires 4 labor-hours in fabricating and
1.5 labor-hours in finishing.
4. Write the objective function and constraints as
The company operates 5 days per week.
mathematical expressions.
SSC makes a net profit of $50 on the Jordanelle model and
$65 on the Deercrest model.
Step 1: Identify the decision variables Step 2: Identify the objective function
The company wants to determine how many of SSC wishes to maximize net profit, and we are given
each model should be produced on a daily the net profit figures for each type of ski.
◦ SSC makes a net profit of $50 on the Jordanelle model and $65
basis to maximize net profit. on the Deercrest model.
Define
◦ Jordanelle = number of pairs of Jordanelle skis
produced/day
◦ Deercrest = number of pairs of Deercrest skis
produced/day
Clearly specify the dimensions of the variables!
1
12/8/2024
Profit per pair of skis sold: Constraints are expressed as algebraic inequalities or
$50 for Jordanelle skis, $65 for Deercrest skis equations, with all variables on the left side and constant
terms on the right.
Objective Function: Look for key words in word statements of constraints:
Maximize total profit ◦ “Cannot exceed” translates mathematically as “≤”
= 50 Jordanelle + 65 Deercrest ◦ “At least,” would translate as “≥”
Note how the dimensions verify that the ◦ “Must contain exactly,” would specify an “= ” relationship.
Fabrication constraint
A constraint function is the left-hand side of a Available fabrication labor hours: (12 workers)(7 hours/day) = 84
constraint. hours/day
◦ E.g.: Total labor-hours used in fabrication cannot Required fabrication labor hours per ski pair: 3.5 hours for
exceed the amount of labor hours available. Jordanelle, 4 hours for Deercrest
Fabrication constraint: 3.5 Jordanelle + 4 Deercrest ≤ 84
Finishing constraint
Available finishing labor hours: (3 workers)(7 hours/day) = 21
hours/day
Required finishing labor hours per ski pair: 1 hour for Jordanelle;
1.5 hours for Deercrest
Finishing constraint: 1 Jordanelle + 1.5 Deercrest ≤ 21
2
12/8/2024
Some examples: A fertilizer mixture is made of two ingredients and must contain exactly
30% nitrogen. Ingredient X contains 20% nitrogen. Ingredient Y
The amount of money spent on research and contains 33% nitrogen.
development projects cannot exceed the assigned
Define x = the number of pounds of X in the mixture and y = the
budget of $300,000. number of pounds of Y in the mixture
◦ Amount spent on research and development ≤ 300,000 ◦ Amount of nitrogen in mixture = 0.20x + 0.33y
Contractual requirements specify that at least 500 units ◦ Total amount of mixture = x + y
of product must be produced. ◦ Fraction of nitrogen in mix = (0.20x + 0.33y)/(x + y)
◦ Number of units of product produced ≥ 500
Since the fraction of nitrogen must be 0.30, the constraint
A mixture of fertilizer must contain exactly 30% nitrogen. would be
◦ Amount of nitrogen in mixture/total amount in mixture = 0.30
(0.20x + 0.33y)/(x + y) = 0.30, or simplified as -0.1x - 0.03y = 0
Note that the first version is not linear; however the simplified
constraint is linear.
A linear optimization model (often called a Put the objective function coefficients, constraint coefficients, and
right-hand values in a logical format in the spreadsheet.
linear program, or LP) has two basic properties. ◦ For example, you might assign the decision variables to columns and the
1. The objective function and all constraints are constraints to rows
linear functions of the decision variables. Define a set of cells (either rows or columns) for the values of the
decision variables.
◦ This means that each function is simply a sum of terms, ◦ The names of the decision variables should be listed directly above the
each of which is some constant multiplied by a decision decision variable cells.
variable. ◦ Use shading or other formatting to distinguish these cells.
2. All variables are continuous Define separate cells for the objective function and each constraint
function (the left-hand side of a constraint).
◦ This means that they may assume any real value ◦ Use descriptive labels directly above these cells.
(typically, nonnegative).
3
12/8/2024
In Excel, the pairwise sum of products of terms Several common functions in Excel can cause difficulties
can easily be computed using the SUMPRODUCT when attempting to solve linear programs using Solver
function. because they are discontinuous (or “nonsmooth”) and do
not satisfy the conditions of a linear model.
◦ B9* B14 + C9*C14 = SUMPRODUCT(B9:C9,B14:C14)
These include:
This often simplifies the model-building process, ◦ IF
particularly when many variables are involved. ◦ MAX
◦ INT
◦ ROUND
◦ COUNT
A feasible solution to an optimization problem is Data > Analysis > Solver in the Excel ribbon
any solution that satisfies all of the constraints. Use the Solver Parameters dialog to define the
An optimal solution is the best of all the feasible objective, decision variables, and constraints from
solutions. your spreadsheet model.
Software for determining optimal solutions
◦ Solver (“standard Solver”) is a free add-in packaged with
Excel for solving optimization problems.
◦ Premium Solver, which is a part of Analytic Solver
Platform has better functionality, accuracy, reporting, and
interface.
4
12/8/2024
5
12/8/2024
Completed The Solver Answer Report provides basic information about the
solution, including the values of the original and optimal objective
Premium Solver function (in the Objective Cell section) and decision variables (in the
dialog Decision Variable Cells section).
In the Constraints section, Cell Value refers to the value of the
constraint function using the optimal values of the decision
variables.
A binding constraint is one for which the Cell Value is equal to the
right-hand side of the value of the constraint.
The Status column tells whether each constraint is binding or not
binding.
Slack refers to the difference between the left- and right-hand sides
of the constraints for the optimal solution.
6
12/8/2024
Finishing constraint: 1 Jordanelle + 1.5 Deercrest ≤ 21 Market mix constraint: -2 Jordanelle + 1 Deercrest ≥ 0
◦ Plot the equation: 1 Jordanelle + 1.5 Deercrest = 21 ◦ Plot the equation: -2 Jordanelle + 1 Deercrest = 0
◦ Set Jordanelle = 0; Deercrest = 14 ◦ Set Jordanelle = 5; Deercrest = 10
◦ Set Deercrest = 0; Jordanelle = 21 ◦ Set Deercrest = 0; Jordanelle = 0
Feasible region The points at which the constraint lines intersect along
the feasible region are called corner points.
If an optimal solution exists, then it will occur at a corner
point.
7
12/8/2024
8
12/8/2024
13-
Solver message:
9
12/8/2024
Models should be used to provide insight for Four questions are posed by the managers of
making better decisions. Sklenka Ski company:
◦ What might happen should the model assumptions 1. If the Jordanelle ski’s profit increased $10/pair,
change or when the data used in the model are how would the optimal solution change?
uncertain? 2. If the Jordanelle ski’s profit decreased $10/pair,
◦ With Solver, answers to such questions can easily be how would the optimal solution change?
found by simply changing the data and re-solving the 3. If 10 additional finishing hours were available,
model. how would manufacturing plans be affected?
4. If 2 fewer finishing hours were available, how
would manufacturing plans be affected?
10
12/8/2024
Shadow Price - how much the objective function will change as the
right hand side of a constraint is increased by 1.
Whenever a constraint has positive slack, the shadow price is zero.
When a constraint involves a limited resource, the shadow price
represents the economic value of having an additional unit of that
resource.
Shows the upper and lower limits that each If a change in an objective function coefficient remains
decision variable can assume while satisfying all within the Allowable Increase and Allowable Decrease
constraints and holding the other variables ranges in the Decision Variable Cells section of the
report, then the optimal values of the decision variables
constant.
will not change. However, you must recalculate the value
of the objective function using the new value of the
coefficient.
If a change in an objective function coefficient exceeds
the Allowable Increase or Allowable Decrease limits in
the Decision Variable Cells section of the report, then
you must re-solve the model to find the new optimal
values.
If a change in the right-hand side of a constraint remains Suppose that the unit profit on Jordanelle skis is increased by $10.
within the Allowable Increase and Allowable Decrease ranges How will the optimal solution change? What is the best product mix?
in the Constraints section of the report, then the shadow price
allows you to predict how the objective function value will
change. Multiply the change in the right-hand side (positive if
an increase, negative if a decrease) by the value of the
shadow price. However, you must re-solve the model to find ◦ Is the increase in the objective function coefficient is within the range of
the new values of the decision variables. the Allowable Increase and Allowable Decrease in the Decision Variable
Cells portion of the report?
If a change in the right-hand side of a constraint exceeds the
◦ Because $10 is less than the Allowable Increase of infinity, we can safely
Allowable Increase or Allowable Decrease limits in the conclude that the optimal quantities of the decision variables will not
Constraints section of the report, then you cannot predict how change.
the objective function value will change using the shadow ◦ However, because the objective function changed, we need to compute
price. You must re-solve the problem to find the new solution. the new value of the total profit: 5.25($60) + 10.5($65) = $997.50.
11
12/8/2024
Suppose that the unit profit on Jordanelle skis is Suppose that 10 additional finishing hours become
decreased by $10 because of higher material costs. How available through overtime. How will manufacturing
will the optimal solution change? What is the best plans be affected?
product mix?
12
12/8/2024
13