Nhóm 5

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 89

Chapter 14

Applications of
Linear Optimization

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
Applications of Linear Optimization
Building Linear Optimization Models

🞂Building optimization models is more of an art


than a science.
◦ Learning how to build models requires logical thought
facilitated by studying examples and observing their
characteristics.
🞂Key issues:
◦ Formulation
◦ Spreadsheet implementation
◦ Interpreting results
◦ Scenario and sensitivity analysis
◦ Gaining insight for making good decisions
Types of Constraints in Optimization
Models
🞂 Simple Bounds (giới hạn)
◦ Constraints on values of a single variable
🞂 Limitations
◦ Allocation of scarce resources
🞂 Requirements
◦ Minimum levels of performance
🞂 Proportional (tỷ lệ) Relationships
◦ Requirements for mixtures or blends (pha trộn) of materials or
strategies
🞂 Balance Constraints
◦ Ensure the flow of material or money is accounted for at
locations or between time periods: input = output
Process Selection Models
🞂Process selection models generally involve
choosing among different types of processes to
produce a good.
◦ Example: make or buy decisions
Example 14.1: Camm Textiles
🞂 A mill that operates on a 24/7 basis produces three types
of fabric (vải) on a make-to-order basis.
🞂 The key decision is which type of loom (khung cửi dệt
vải) to use for each fabric (vải) type over the next 13
weeks.
🞂 The mill has 3 dobbie looms and 15 regular looms.
🞂 If demand cannot be met, the fabric is outsourced.
Example 14.1 Continued
🞂Model Formulation
🞂Di = yards fabric i to produce on dobbie loom
🞂Ri = yards fabric i to produce on regular loom
🞂Pi = yards fabric i to outsource
🞂Objective
🞂 Minimize total cost of milling (sự xay, sự nghiền, sự cán)
and outsourcing
🞂Constraints
🞂 Requirements: Total production and outsourcing of each
fabric = demand
🞂 Limitations: Production on each type of loom cannot
exceed the available production time
🞂 Nonnegativity
Example 14.1 Continued
🞂Demand constraints
🞂Production + outsourcing = demand
◦ Fabric 1: D1 + P1 = 45,000
◦ Fabric 2: D2 + R2 + P2 = 76,500
◦ Fabric 3: D3 + R3 + P3 = 10,000
Example 14.1: Continued
🞂Loom capacity limitation constraints
🞂 First convert yards/hour into hours/yard.
E.g., for fabric 1 on the dobbie loom:
hours/yard = 1/(4.7 yards/hour) = 0.213 hours/yard

🞂 Capacity of the three dobbie looms:


(24 hours/day)(7 days/week)(13 weeks)(3 looms) = 6,552 hours
🞂 Constraint on available production time on dobbie looms:
0.213D1 + 0.192D2 0.227D3 ≤ 6,552
🞂 Constraint for regular looms:
0.192R2 + 0.227R3 ≤ 32,760
Example 14.1 Continued

🞂Full Model
Spreadsheet Design
🞂 Camm Textiles model

🞂 Decision variables
🞂 Objective
Solver Model

Set cell C14 to zero as a constraint because


fabric 1 cannot be produced on a regular loom.
Whenever you restrict a single decision variable
to equal a value or set it as a ≤ or ≥ type of
constraint, Solver considers it as a simple bound.
Example 14.2: Interpreting Solver
Reports for the Camm Textiles Problem
🞂Answer Report
Example 14.2: Interpreting Solver
Reports for the Camm Textiles Problem
🞂Sensitivity Report
Solver Output and Data Visualization
🞂Solver requires some technical knowledge of
linear optimization concepts and terminology, such
as reduced costs and shadow prices (giá mờ-see
note).
🞂Data visualization can help analysts present
optimization results in forms that are more
understandable and can be easily explained to
managers and clients in a report or presentation.
Answer Report Visualization
🞂Camm Textiles
Sensitivity Report Visualization
🞂 Reduced costs: how much the unit production or
purchasing cost must be changed to force the value of a
variable to become positive in the solution.
Visualizing Allowable Ranges
🞂 Unit cost coefficients: use an Excel Stock Chart (see text
for details).
◦ A stock chart typically shows the “high-low-close” values of daily
stock prices; here we can compute the maximum-minimum-
current values of the unit cost coefficients.

For those lines that have


no maximum limit (the blue
dash) such as with Fabric 1
Purchased, the unit costs
can increase to infinity; for
those that have no lower
limit (the red triangle) such
as Fabric 1 on Dobbie, the
unit costs can decrease
indefinitely.
Visualizing Shadow Prices
🞂 Shadow prices show the impact of changing the right-hand side of a
binding constraint. Because the plant operates on a 24/7 schedule,
changes in loom capacity would require in “chunks” (i.e., purchasing
an additional loom) rather than incrementally (gia tăng, tăng thêm).
🞂 However, changes in the demand can easily be assessed using the
shadow price information.
Visualizing Allowable Ranges for
Shadow Prices
🞂Stock Chart
Blending Models
🞂Blending problems involve mixing several raw
materials that have different characteristics to
make a product that meets certain specifications.
◦ Dietary planning, gasoline and oil refining, coal and
fertilizer production, and the production of many other
types of bulk commodities involve blending.
🞂We typically see proportional constraints in
blending models.
Example 14.3: BG Seed Company
🞂BG Seed Company is developing a new birdseed
(hạt dùng cho chim ăn) mix.
◦ Nutritional requirements specify that the mixture contain
at least 13% protein, at least 15% fat, and no more than
14% fiber.
◦ BG’s objective is to determine the minimum cost mixture
that meets nutritional requirements.
Example 14.3 Continued
🞂Formulating the model
🞂Define Xi = pounds of ingredient i in 1 pound of mix
🞂Objective function
🞂 minimize 0.22X1 + 0.19X2 + 0.10X3 + 0.10X4 + 0.07X5 +
0.05X6 + 0.26X7 + 0.05X6 + 0.26X7 + 0.11X8
Example 14.3 Continued
🞂 Protein constraint
🞂 Total pounds of protein provided/total pounds of mix ≥
0.13
◦ (0.169X1 + 0.12X2 + 0.085X3 + 0.154X4 + 0.085X5 + 0.12X6 +
0.18X7 + 0.119X8)/(X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8) ≥ 0.13
🞂Add constraint X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 = 1
◦ Protein constraint simplifies to
◦ 0.169X1 + 0.12X2 + 0.085X3 + 0.154X4 + 0.085X5 + 0.12X6 +
0.18X7 + 0.119X8 ≥ 0.13

Formulate other nutritional


constraints in a similar way.
Example 14.3 Continued
🞂Complete model
Spreadsheet Implementation of BG Seed
Company
Solver Model for BG Seed Company
Dealing with Infeasibility
🞂 Solver solution shows the model is infeasible!
🞂 Solver Feasibility Report

A conflict exists in trying to meet both fat and fiber constraints.


Only sunflower seeds and safflower contain enough fat but they
also have a lot of fiber.
What-If Scenarios
🞂Lower the fat requirement or raise the fiber
limitation

1st Scenario:
Fat requirement is lowered from
15% to 14.5%.
2nd Scenario:
Fiber limitation is raised from
14% to 14.5%.

Optimal Cost per pound:


$0.148 if fat requirement lowered
$0.152 if fiber limitation raised
Portfolio Investment Models
🞂Many types of financial investment problems are
modeled and solved using linear optimization.
🞂Such portfolio investment models problems have
the basic characteristics of blending models.
Example 14.4: Innis Investments
🞂 Innis Investments manages 6 mutual funds. A client
wants to invest a $500,000 inheritance. The objective is
to minimize risk.
🞂Constraints:
🞂 Invest no more than $200,000 in any one fund.
🞂 Invest at least $50,000 each in the multinational and balanced
funds.
🞂 Invest at least 40% combined in the income equity and balanced
funds.
🞂 Achieve an average return of at least 5%.
Example 14.4 Continued
🞂Model Formulation
🞂 Define Xi = dollar amount invested in fund i
◦ The total risk would be measured by the weighted risk of the
portfolio, where the weights are the proportion of the total
investment in any fund (Xj/500,000)
Example 14.4 Continued
🞂Constraints
◦ Invest all money:

◦ Achieve required return:

◦ Have at least 40% in income equity and balanced funds:

◦ At least $50,000 in each of multinational and balanced funds:

◦ Restrict each investment to $200,000, and include nonnegativity:


Spreadsheet Implementation for Innis
Investments
Solver Model for Innis Investments
Example 14.5: Risk versus Reward
🞂Innis Investments
◦ Allowable Increase and Allowable Decrease values for the
weighted return are very small, 0.00906 and 0.00111,
respectively; so any changes in the target return will require re-
solving the model.
Scaling Issues in Using Solver
🞂 A poorly scaled model is one that computes values of
the objective, constraints, or intermediate results that
differ by several orders of magnitude.
🞂 Poor scaling can cause Solver engines to return
messages such as “Solver could not find a feasible
solution,” “Solver could not improve the current solution,”
or even “The linearity conditions required by this Solver
engine are not satisfied,” or it may return results that are
suboptimal.
◦ In the Solver options, you can check the box Use Automatic
Scaling.
◦ The best way to avoid scaling problems is to carefully choose the
“units” implicitly used in your model so that all computed results
are within a few orders of magnitude of each other.
Example 14.6: Little Investment
Advisors
🞂 Little Investment Advisors is working with a client on
determining an optimal portfolio of bond funds. The client
has $350,000 to invest and wants to achieve the largest
weighted percentage return and keep the weighted risk
measure no greater than 5.00.
Example 14.6 Continued
🞂 Model
◦ Define X1 through X6 be the amount invested in each of the six
funds.
◦ Maximize (6.11X1 + 7.61X2 + 5.29X3 + 2.79X4 + 7.37X5 +
5.65X6)/350,000
◦ X1 + X2 + X3 + X4 + X5 + X6 = 350,000
◦ (4.62X1 + 7.22X2 + 9.75X3 + 3.95X4 + 6.04X5 + 5.17X6) ≤ 5.00
◦ X1,…,X6 ≥ 0
Example 14.6 Continued
🞂 Premium Solver solution without scaling, resulting in an
incorrect solution!
Example 14.6 Continued
🞂 Solver solution after scaling the variables
Transportation Models
🞂The transportation problem involves
determining how much to ship from a set of
sources of supply (factories, warehouses, etc.) to
a set of demand locations (warehouses,
customers, etc.) at minimum cost.
Example 14.7: General Appliance
Corporation
🞂 GAC produces refrigerants at 2 plants and ships to 5
distribution centers.

🞂 Define the decision variables as: Xij = amount shipped


from plant i to distribution center j
🞂 The objective is to minimize the total cost of shipping
between plants and distribution centers.
◦ minimize 12.60X11 + 14.35X12 + 11.52X13 + 17.58X14 + 9.75X21 + 16.26X22
+ 8.11X23 + 17.92X24
Example 14.7 Continued
🞂Constraints
◦ The amount shipped from each plant cannot exceed its
capacity.
◦ Demand at each distribution center is met.
◦ Nonnegativity
GAC Spreadsheet Implementation and
Solver Model
Formatting the Sensitivity Report
🞂 Depending on how cells in your spreadsheet model are
formatted, the Sensitivity report produced by Solver may
not reflect the accurate values of reduced costs or
shadow prices because an insufficient number of
decimal places may be displayed.
🞂 We highly recommend that after you save the Sensitivity
report to your workbook, you select the reduced cost and
shadow price ranges and format them to have at least
two or three decimal places.
Example: GAC Sensitivity Report

Original Sensitivity Report Reformatted Sensitivity Report


Example 14.8: Interpreting Sensitivity
Information for the GAC Model
🞂 Reduced costs tell how
much the unit shipping
cost would have to be
reduced to make it
attractive to ship along a
route.
🞂 We cannot increase the
demand at any
distribution center
without creating an
infeasible problem. The
shadow prices reflect the
cost savings that would
occur for a unit decrease
in demand at one of the
distribution centers.
Degeneracy
🞂 The GAC solution exhibits a phenomenon called
degeneracy (sự thoái hoá). A solution is degenerate if
the right-hand-side value of any constraint has a zero
Allowable Increase or Allowable Decrease.
◦ Degeneracy can impact the interpretation of sensitivity analysis
information. For example, reduced costs and shadow prices may
not be unique, and you may have to change objective function
coefficients beyond their allowable increases or decreases before
the optimal solution will change.
Multiperiod Production Planning
Models
🞂 The basic decisions are how much to produce in each
time period to meet anticipated demand over each
period.
🞂 Although it might seem obvious to simply produce to the
anticipated level of sales, it may be advantageous to
produce more than needed in earlier time periods when
production costs may be lower and store the excess
production as inventory for use in later time periods,
thereby letting lower production costs offset the costs of
holding the inventory.
Example 14.9: K&L Designs
🞂 K&L Designs makes hand-painted jewelry boxes.
🞂 Forecasted sales are 150 in autumn, 400 in winter, and 50 in
spring.
🞂 Unpainted boxes cost $20 and each box takes 2 hours to
complete.
🞂 The cost of capital is 6% per quarter.
🞂 Holding cost per item = 0.06(20) = $1.20/quarter
🞂 Labor rates are $5.50, $7.00, and $6.25 per hour during autumn,
winter, and spring, respectively.
🞂 Minimize the combined cost of production and inventory
holding costs.
Example 14.9 Continued
🞂Decision variables
◦ Pi = amount to produce in quarter i (1 = autumn; 2 =
winter; 3 = spring)
◦ Ii = inventory at the end of quarter i
Example 14.9 Continued
🞂 Objective function
◦ The production cost per unit is computed by multiplying the labor
rate by the number of hours required to produce one.
◦ Thus, the unit cost in the autumn is ($5.50)(2) = $11.00; in the
winter, ($7.00)(2) = $14.00; and in the spring, ($6.25)(2) = $12.50.
Example 14.9 Continued
🞂 Constraints
◦ Satisfy demand using production in a quarter and the inventory
held from the previous time quarter. Any amount in excess of the
demand is held to the next quarter.
◦ Therefore, the constraints take the form of inventory balance
equations:
Example 14.9 Continued
🞂Complete model
Spreadsheet Implementation for K&L
Designs
Solver Model for K&L Designs
Example 14.10: An Alternative
Optimization Model for K&L Designs
🞂 To ensure that demand is satisfied, we can set the
cumulative production in each quarter to be at least as
great as the cumulative demand.
◦ This eliminates inventory variables.
Alternative Spreadsheet Model
Alternative Solver Model
Comparison of Sensitivity Reports
Ví dụ 14.11: D.A. Branch & Sons
🞂 Người quản lý tài chính của công ty cần đảm bảo rằng có đủ
tiền để thanh toán chi phí nhưng vẫn cần tối đa hóa thu nhập
từ đầu tư.
🞂 Ba khoản đầu tư ngắn hạn đang được xem xét như sau:

🞂 Chứng chỉ tiền gửi 1 tháng trả 0,25%


🞂 Chứng chỉ tiền gửi 3 tháng thanh toán 1,00% khi đáo hạn
🞂 Chứng chỉ tiền gửi 6 tháng thanh toán 2,30% khi đáo hạn

🞂 Chi phí ròng trong 6 tháng tới được dự đoán là $50.000,


($12.000), $23.000, ($20.000), $41.000 và ($13.000)
🞂Số dư tiền mặt $10.000 phải được duy trì. Hiện tại số dư tiền
mặt là $200,000.
Ví dụ 14.11 tiếp theo
🞂 Phát triển mô hình
◦ Ai = số tiền ($) để đầu tư vào CC tiền gửi 1 tháng vào đầu tháng i
◦ Bi = số tiền ($) để đầu tư vào CC tiền gửi 3 tháng vào đầu tháng i
◦ Ci = số tiền ($) để đầu tư vào CC tiền gửi 6 tháng vào đầu tháng i
Ví dụ 14.11 tiếp theo
🞂Mô hình tối ưu hoá
Bảng tính - mô hình của D.A. Branch
& Sons
Bảng tính - các công thức của
mô hình D.A. Branch & Sons
Mô hình Solver của D.A. Branch &
Sons
Mô hình với Biến Ràng Buộc
🞂 Solver có cách xử lí các giới hạn dưới đơn giản (VD:
C>=500) và giới hạn trên (VD: D<=1000) khác so với
các ràng buộc thường trong báo cáo độ nhạy.
🞂 Giới hạn dưới và giới hạn trên cũng tương tự như loại
ràng buộc không tiêu cực, không xuất hiện rõ ràng dưới
dạng các ràng buộc trong mô hình.
🞂 Điều này khiến cho việc giải thích thông tin về độ nhạy
trở nên khó, vì ta không còn giá bóng và mức tăng giảm
cho phép được liên kết với các ràng buộc.
Ví dụ 14.12: J&M Manufacturing
🞂 J&M Manufacturing sản xuất 4 mẫu bếp nướng gas.
🞂 Xác định số lượng bếp nướng cần sản xuất để tối đa
hóa lợi nhuận.
Ví dụ 14.12 tiếp theo
🞂 Phát triển mô hình
◦ Xác định A, B, C, D tương ứng số đơn vị từng mẫu
cần sản xuất
◦ Mục tiêu tối đa hóa lợi nhuận ròng: (250-210)A + (300-
240)B +(400-300)C + (650-520)D= 40A + 60B + 100C
+ 130D
🞂 Ràng buộc bao gồm sự hạn chế về số giờ sản xuất của
mỗi bộ phận, yêu cầu về doanh số tối thiểu, doanh số tối
đa giới hạn tiềm năng.
◦ Cẩn thận khi xem xét các dimensions.
Ví dụ 14.12 tiếp theo
🞂Ràng buộc:
◦ Khả năng của bộ phận:

◦ Yêu cầu doanh số tối thiểu và doanh số tối đa tiềm năng


Triển khai bảng tính cho J&M
Manufacturing
Bảng tính Công thức mô hình của
J&M Manufacturing
Mô hình Solver của J&M
Manufacturing
Báo cáo trả lời của J&M Manufacturing
Báo cáo độ nhạy của J&M
Manufacturing

Chú ý rằng không có giới hạn ràng buộc nào xuất hiện
trong mục Constraints.
Hiểu biết về Độ giảm chi phí
🞂 Đối với sản phẩm B, giới hạn ràng buộc dưới là B ≥ 0. Cần có lợi
nhuận bao nhiêu hơn nữa trên sản phẩm B để có lợi nhuận kinh tế
trong việc sản xuất số lượng sản phẩm nhiều hơn số lượng tối
thiểu yêu cầu?"
◦ Đáp án đưa ra bởi: Chi phí giảm. Lợi nhuận đơn vị trên sản phẩm B phải giảm ít
nhất là -1,905 đô la (tức tăng ít nhất là 1,905 đô la) để có thể sản xuất số lượng
sản phẩm nhiều hơn số lượng tối thiểu yêu cầu với lợi nhuận kinh tế.
🞂 Sản phẩm D ở giới hạn trên của nó.
◦ Chi phí giảm 19,29 đô la cho biết lợi nhuận đơn vị phải giảm bao nhiêu trước khi
không còn kinh tế để sản xuất số lượng tối đa.
Hiểu biết về Độ giảm chi phí và Giá mờ
(Shadow Price)
🞂 Việc tăng giá trị bên phải của ràng buộc giới hạn, B ≥ 0, lên 1 đơn vị
sẽ dẫn đến giảm lợi nhuận $1.905.
🞂 Việc tăng giá trị bên phải của ràng buộc D ≤ 1.000 lên 1 đơn vị sẽ
tăng lợi nhuận lên $19.29.
- Chi phí giảm liên quan đến một biến bị ràng buộc giống như giá bóng của ràng buộc
giới hạn. Tuy nhiên, chúng tôi không còn phạm vi cho phép để có thể thay đổi các
giá trị ràng buộc​​.
Các biến phụ trợ (Auxiliary variables) cho các ràng
buộc giới hạn
🞂 Các biến phụ trợ là một tập hợp các ô mới cho bất kỳ
biến quyết định nào có các ràng buộc giới hạn trên hoặc
dưới được tạo bằng cách tham chiếu (không sao chép)
các ô thay đổi ban đầu.
🞂 Trong mô hình Solver, sử dụng các ô biến phụ trợ—không phải
các ô biến thay đổi như đã xác định—để xác định các ràng buộc
ràng buộc.
🞂 Các biến phụ trợ cho phép giải thích dễ dàng hơn về giá mờ đối
với các biến giới hạn.
Example 14.13: Sử dụng các ô biến phụ
trợ
🞂 Mô hình sản xuất của J&M

Xác định các ràng buộc giới


hạn bằng cách sử dụng các ô
biến phụ trợ
Example 14.13 Tiếp theo
🞂 Báo cáo độ
nhạy
🞂 Ràng buộc
giới hạn không
xuất hiện trong
phần Ràng
buộc
Ví dụ 14.14: Walker Wines
🞂 Một vấn đề trong phân phối sản xuất/tiếp thị
🞂 Walker Wines mua nho từ những người nông dân địa phương và
pha trộn các loại rượu đã ép để tạo ra hai loại rượu vang (Shiraz và
Merlot). Chi phí nho cho mỗi chai là $1,60 với Shiraz và $1,40 với
Merlot.
🞂 Hợp đồng yêu cầu từ 40% đến 70% rượu là Shiraz.
🞂 Nhu cầu dự đoán về Shiraz là 1,000 chai nhưng sẽ tăng 5 chai cho
mỗi $1 chi cho quảng cáo; nhu cầu cơ bản về Merlot là 2,000 chai
nhưng sẽ tăng 8 chai cho mỗi $1 chi cho quảng cáo.
🞂 Số lượng sản xuất không được vượt quá nhu cầu.
🞂 Giá bán cho cửa hàng bán lẻ: Shiraz được bán với giá $6.25 mỗi
chai và Merlot được bán với giá $5.25 mỗi chai.
🞂 Có $50,000 để mua nho và quảng cáo sản phẩm.
Ví dụ 14.14 Tiếp theo
🞂 Xây dựng công thức
🞂 Quy ước
◦ S = số chai Shiraz được sản xuất
◦ M = số chai Merlot được sản xuất
◦ As = lượng đô la chi cho quảng cáo Shiraz
◦ Am = lượng đô la chi cho quảng cáo Merlot
🞂 Tối đa hoá lợi nhuận = ($6.25S + $5.25M) - ($1.60S +
$1.40M + As + Am) = 4.65S + 3.85M - As - Am
Ví dụ 14.14 Tiếp theo
🞂Ràng buộc
🞂Không được vượt quá ngân sách
◦ $1.60S + $1.40M + As + Am ≤ $50,000
🞂Đáp ứng yêu cầu hợp đồng
◦ 0.4 ≤ S/(S + M) ≤ 0.7, hoặc thể hiện ở dạng tuyến tính:
0.6S - 0.4M ≥ 0 và 0.3S - 0.7M ≤ 0
🞂 Số lượng sản xuất không được vượt quá nhu cầu.
◦ S ≤ 1,000 + 5As
◦ M ≤ 2,000 + 8Am
🞂Không âm
Xây dựng Bảng tính cho
Walker Wines
Mô hình Solver cho Walker Wines
Sử dụng Độ nhạy Thông tin một cách
chính xác
🞂Một giả định quan trọng trong việc giải thích độ
nhạy thông tin đối với những thay đổi trong tham
số mô hình là tất cả các tham số mô hình khác
được giữ cố định.
Ví dụ 14.15: Đánh giá mức tăng chi phí
của Walker Wines
🞂 Giả sử giá nho Shiraz tăng $0,05 mỗi chai.
🞂 Chi phí tăng 0,05 đô la dẫn đến lợi nhuận đơn vị của Shiraz giảm từ
4,65 đô la xuống 4,60 đô la. Tuy nhiên, trong báo cáo Độ nhạy, thay
đổi trong hệ số lợi nhuận nằm trong mức giảm cho phép (0,05328),
do đó sẽ không có sự thay đổi trong kết quả tối ưu.
Ví dụ 14.15 Tiếp theo
🞂 Nếu mô hình được tính lại
bằng tham số chi phí mới,
kết quả sẽ thay đổi đáng
kể.
🞂 Trong trường hợp này, chi
phí đơn vị cũng được
phản ánh qua ngân sách
ràng buộc. Khi thay đổi
tham số chi phí thì ràng
buộc cũng thay đổi theo.
Điều này vi phạm giả định
rằng tất cả các tham số
mô hình khác được giữ cố
định.

You might also like