0% found this document useful (0 votes)
7 views

[IN] linear optimize

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

[IN] linear optimize

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

12/8/2024

 Optimization is the process of selecting values of


decision variables that minimize or maximize
some quantity of interest.
 Optimization models have wide applicability in
operations and supply chains, finance, marketing,
and other disciplines.
 This chapter focuses only on linear optimization
models.

Lecturer: Nguyen Van Dung Ph.D.


Slides are based on slides accompanied the book “Business Analytics:
Methods, Models, and Decisions”, with improvement from the lecturer

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

 Step 3: Identify the constraints


◦ Look for clues in the problem statement that describe limited resources
that are available, requirements that must be met, or other restrictions.
 Represent decision variables by descriptive
 Both the fabrication and finishing departments have limited numbers names, abbreviations, or subscripted letters
of workers, who work only 7 hours each day; this limits the amount (X1, X2, etc.)
of production time available in each department: ◦ For mathematical formulations involving many
◦ Fabrication: Total labor hours used in fabrication cannot exceed the amount of
labor hours available. variables, subscripted letters are often more
◦ Finishing: Total labor hours used in finishing cannot exceed the amount of labor convenient.
hours available.
◦ In spreadsheet models, we recommend using
 The problem also notes that the company anticipates selling at least
more descriptive names to make the models and
twice as many Deercrest models as Jordanelle models:
◦ Number of pairs of Deercrest skis must be at least twice the number of parts of solutions easier to understand.
Jordanelle skis.
 Negative values of the decision variables cannot occur
(“nonnegativity constraints”)

 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.

expression is correct:  All constraints in optimization models must be one of


◦ ($/pair of skis)(number of pairs of skis) = $.
these three forms.

 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

 Market mixture constraint Maximize total profit = 50 Jordanelle + 65 Deercrest


◦ The number of pairs of Deercrest skis must be at least 3.5 Jordanelle + 4 Deercrest ≤ 84
twice the number of Jordanelle skis.
1 Jordanelle + 1.5 Deercrest ≤ 21
◦ Deercrest ≥ 2 Jordanelle,
◦ or − 2 Jordanelle + 1 Deercrest ≥ 0 −2 Jordanelle + 1 Deercrest ≥ 0
Jordanelle ≥ 0
 Nonnegativity constraints:
Deercrest ≥ 0
◦ Jordanelle ≥ 0
◦ Deercrest ≥ 0 The highlighted portions are the constraint functions

 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

Maximize 50 Jordanelle + 65 Deercrest Maximize D22 = B9* B14 + C9* C14


3.5 Jordanelle + 4 Deercrest ≤ 84 D15 = B6* B14 + C6* C14 ≤ D6
1 Jordanelle + 1.5 Deercrest ≤ 21 D16 = B7* B14 + C7* C14 ≤ D7
−2 Jordanelle + 1 Deercrest ≥ 0 D19 = C14 - 2* B14 ≥ 0
Jordanelle ≥ 0 B14 ≥ 0
Deercrest ≥ 0 C14 ≥ 0

Decision variables Objective function Constraint functions

 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

 Three reports: Answer,


Solver Parameters dialog
Sensitivity, and Limits
Objective function cell ◦ To add them to your Excel
Decision variables cells workbook, click on the
Constraints ones you want and then
click OK.
to enter click Add and fill in the Add
Constraint dialog:  Do not check the box
Outline Reports; this is
an Excel feature that
produces the reports in
"outlined format."

Always select “Simplex LP”


Check box for Nonnegativity

 After installing Analytic Solver Platform, Premium


Solver will be found under the Add-Ins tab in the
Excel ribbon.
 Premium Solver has a different user interface than
the standard Solver.

 Solver Parameters  Next, highlight Normal


dialog under the Variables list
 First, click on Objective and click Add; this will
and then click the Add bring up an Add
button. The Add Variable Cells dialog.
Objective dialog Enter the range of the
appears, prompting you decisions variables in
for the cell reference for the Cell Reference field.
the objective function
and the type of objective
(min or max).

5
12/8/2024

 Next, highlight Normal


under the Constraints
list and click the Add
button; this brings up
the Add Constraint
dialog, just like in the  Check this box
standard version.
 Select “Standard
LP/Quadratic” for the
solving method

 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.

 Understanding slack values


Maximize profit = 50 Jordanelle + 65 Deercrest
3.5 Jordanelle + 4 Deercrest ≤ 84 (fabrication)
1 Jordanelle + 1.5 Deercrest ≤ 21 (finishing)
−2 Jordanelle + 1 Deercrest ≥ 0 (market mix)
Jordanelle ≥0
Deercrest ≥ 0

Optimal solution: Jordanelle = 5.25; Deercrest = 10.5

Fabrication constraint: 3.5(5.25) + 4(10.5) = 60.375 ≤ 84


 23.625 excess fabrication hours

Finishing constraint: 1(5.25) + 1.5(10.5) = 21 ≤ 21


 No excess finishing hours

Market mix constraint: −2(5.25) + 1(10.5) = 0 ≥ 0


 Exactly twice the number of Deercrest skis as Jordanelle skis

6
12/8/2024

 Fabrication constraint: 3.5 Jordanelle + 4 Deercrest ≤ 84


 The set of feasible solutions is called the feasible region. ◦ Plot the equation: 3.5 Jordanelle + 4 Deercrest = 84
 For a problem with only two decision variables, x1 and x2, we can draw the ◦ Set Jordanelle = 0; Deercrest = 21
feasible region on a two-dimensional coordinate system by plotting the ◦ Set Deercrest = 0; Jordanelle = 24
equations corresponding to each constraint.
 Nonnegativity constraints:

 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

 Because our objective is


to maximize profit, we
seek a corner point that
 Solver uses a mathematical algorithm called the simplex
has the largest value of method, which was developed in 1947 by the late Dr.
the objective function Total George Dantzig.
Profit = 50 Jordanelle + 65
◦ The simplex method characterizes feasible solutions
Deercrest.
algebraically by solving systems of linear equations.
 Graph the profit line and
move in an improving ◦ It moves systematically from one corner point to another to
direction until it passes improve the objective function until an optimal solution is found
through the last corner (or until the problem is deemed infeasible or unbounded).
point of the feasible ◦ It is quick and efficient.
region.
 Solve the two intersecting
equations simultaneously
to find the optimal
solution.

 Crebo Manufacturing produces 4 types of structural


 Define X1, X2, X3, and X4 as the number of plugs (ổ cắm
điện), rails (tay vịn), rivets (đinh tán), and clips (cái ghim)
support fittings.
to produce.
 Machining centers have a capacity of 280,000 minutes
per year.
 Objective:
 Maximize gross profit margin = 0.3 X1 + 1.3 X2 + 0.75X3 + 1.2X4
 Gross margin/unit and machining requirements:
 Constraints:
 1X1 + 2.5 X2 + 1.5X3 + 2X4 ≤ 280,000
 X1, X2, X3, X4 ≥ 0

 How many units of each product type should be


produced to maximize gross profit margin?

 The simplex method evaluates the impact of constraints


in terms of their contribution to the objective function for
each variable.
 For the simple case of only one constraint, the optimal
(maximum) solution is found by simply choosing the
variable with the highest ratio of the objective
 Clips have the highest marginal profit per unit of resource consumed.
coefficient to the constraint coefficient.
 Maximum possible production of clips
= 280,000 minutes ÷ minutes/unit
= 280,000 ÷ 2 = 140,000
 Profit for maximum production of clips
= gross margin/unit * max possible production
= $1.20 * 140,000 = $168,000

8
12/8/2024

 Solver assigns names to:  Name assigned to objective function


◦ Cell D22: “Profit Contribution + Total Profit”
◦ Target cells
 Names assigned to decision
◦ Changing cells variables:
◦ Constraint function cells ◦ Cell B14: “Quantity Produced + Jordanelle”
◦ Cell B15: Quantity Produced + Deercrest”
 Names are formed by concatenating (nối) the first
 Names assigned to constraints:
cell containing text to the: ◦ Cell D15: “Fabrication + Hours Used”
◦ Left of the cell and ◦ Cell D16: “Finishing + Hours Used”
◦ Cell D19: “Market mixture + Excess
◦ Above the cell Deercrest”

 Unique optimal solution


◦ there is exactly one solution that will result in the maximum (or  New objective function in the SSC problem:
minimum) objective. ◦ Max 50 Jordanelle + 75 Deercrest
 Alternative (multiple) optimal solutions
◦ the objective is maximized (or minimized) by more than one
combination of decision variables, all of which have the same
objective function value.
 Unbounded solution
◦ the objective can be increased or decreased without bound (i.e.,
to infinity for a maximization problem or negative infinity for a
minimization problem)
 Infeasibility
◦ no feasible solution exists

13-

 Suppose, by mistake, the modeler in the Sklenka Ski problem used


 Remove the finishing and fabrication constraints from the Sklenka a ≥ sign in the fabrication constraint (instead of ≤):
Ski problem.

 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?

 Summary of What-If scenarios:  The Sensitivity Report allows us to understand how


◦ the optimal objective value and optimal decision variables
are affected by changes in the objective function
coefficients,
◦ the impact of forced changes in certain decision variables,
or
◦ the impact of changes in the constraint resource limitations
or requirements.
 The Sensitivity Report information applies to changes in
only one of the model parameters at a time; all others
are assumed to remain at their original values.

Reduced Cost: How much the objective function coefficient needs to be


reduced for a nonnegative variable that is zero in the optimal solution to
become positive. If a variable is positive in the optimal solution, its reduced
cost is zero.
If the objective coefficient of any one variable that has positive value in the
current solution changes but stays within the range specified by the Allowable
Increase and Allowable Decrease, the optimal decision variables will stay the
same; however, the objective function value will change.

10
12/8/2024

 Sensitivity report for the Sklenka Ski model after


changing the profit on Jordanelle skis from $50 to $40

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?

◦ Check if the change in the right-hand-side value is within the


◦ The change in the unit profit exceeds the Allowable Decrease range of the Allowable Increase and Allowable Decrease in the
($6.67). We can conclude that the optimal values of the decision Constraints section of the report.
variables will change, although we must re-solve the problem to ◦ Ten additional finishing hours exceeds the Allowable Increase.
determine what the new values would be. Therefore, we must re-solve the problem to determine the new
solution.

 What if the number of finishing hours available is


 Solver can be used to perform sensitivity analysis
decreased by 2 hours because of planned equipment
maintenance? How will manufacturing plans be by either:
affected?  Examining the sensitivity reports or
 Changing data in the model and re-solving it

 Analytic Solver Platform offers an alternative


approach to sensitivity analysis called parameter
◦ A decrease of 2 hours in finishing capacity is within the Allowable analysis, which allows you to run multiple
Decrease. Total profit will decrease by the value of the shadow
price for each hour that finishing capacity is decreased. optimizations while varying model parameters
Therefore, we can predict that the total profit will decrease by 2 within predefined ranges.
×$45 = $90 to $855. However, we must re-solve the model in
order to determine the new values of the decision variables.

 From the Reports button in the


 Investigate the impact of Analysis group in the Analytic
changing finishing hour Solver Platform ribbon, select
capacity over a range from Optimization Reports and then
Parameter Analysis
10 to 60.
 Move decision variable and
◦ Choose an empty cell in the
objective function cells to the right
spreadsheet (e.g., F3)
Result Cells pane, and move the
◦ From Analytic Solver Platform parameter cell F3 to the right
ribbon, click Parameters button
Parameters pane.
and choose Optimization.
 In the drop-down box, select Vary
◦ Define range in Function
All Selected Parameters
Arguments dialog.
Simultaneously.
◦ Replace the value in cell D7 by
 Set Major Axis Points to number
=F3
of parameter values to test.

12
12/8/2024

 Parameter analysis results


 Suppose that we wish to examine the effect on the
optimal profit of changing both the Fabrication and
Finishing hour limitations, similar to a two-way
data table.
 Follow the procedure in Example 13.21 to define
◦ Reformat the results to make them easier to understand. the parameter for the Finishing limitation.
For example, name the columns with descriptive labels ◦ In the Function Arguments dialog, set the range for the
instead of cell references; use charts to visualize the Fabrication limitation between 50 and 100.
results.

 In the Multiple Optimizations  Results


Report dialog, choose both
parameter cells F2 and F3;
however, we can only choose
one result cell. In this case,
choose $D$22, which represents
the objective function value.
 In the drop-down box, select Vary
Two Selected Parameters
Independently.

13

You might also like