Вы находитесь на странице: 1из 45

Chapter 13: Linear

Optimization
MGSC 207
Prof. Jonathan Hersh
Prescriptive Analysis
Linear Optimization
Optimization: The process of selecting values of
decision variables that minimize or maximize some
quantity of interest
Building Linear Optimization Models
1. Identify the decision variables
Values model can change to optimize objective function
2. Identify the objective function
Quantity we want to maximize
3. Identify the constraints
Limitations, requirements or restrictions imposed on a
problem
4. Write the objective function and constraints as a
mathematical expression
Example: Sklenka Ski Company
• Sklenka Ski Company sells two types of Skis – Jordanelle and Deercrest
• Manufacturing requires fabrication and finishing. The company operates 5
days a week.
• Fabrication department has 12 skilled workers, each of whom works 7
hours a day. Finishing department has 3 workers, who also work 7 hours a
day
• Jordanelle skis take 3.5 hours of fabrication and 1 hour of finishing.
Deercrest skis take 4 hours of fabrication and 1.5 labor hours of finishing
• The number of pairs of Deercrest skis must be at least twice the number of
Jordanelle skis
• The company makes a profit of $50 on Jordanelle models and $65 on
Deercrest
Step 1: Identify the decision variables
• What are the values the decision maker can change to
optimize the objective function?
Step 2: Identify the objective function
• What does the decision maker want to maximize or
minimize?
Step 3: Identify the constraints
• What are the limited resources, requirements that must be
met, or other restrictions on the problem?
Step 4.1: Represent the objective function
mathematically
• Profit per ski sold: $50 for Jordanelle, $65 for Deercrest

Objective function
Step 4.2: Represent constraints mathematically
• Want: to express constraints as algebraic inequalities
• Convention: variables on left hand side, constant terms on
right
• Key terms:
• “cannot exceed”  “≤”
• “at least”  “≥”
• “Must be exactly”  “=”
Step 4.2: Represent constraints mathematically
• Constraint function
• Variables on the left hand side (LHS) of constraint
expression
• E.g. Total labor hours used in fabrication cannot exceed
total hours available
Step 4.2: Fabrication constraint
Step 4.2: Finishing constraint
Step 4.2: Market mixture constraint
• The number of Deercrest skis must be at least twice the
number of Jordanelle skis
Step 4.2: Non-negativity constraint
• The number of Deercrest skis must be at least twice the
number of Jordanelle skis
• Note, constant on right hand side (RHS)
Practice: Constraints
• The amount of money spent on research and development
projects cannot exceed the assigned budget of $300,000.
• Contractual requirements specify that at least 500 units of
product must be produced.
• A mixture of fertilizer must contain exactly 30% nitrogen.
Practice: Constraints answers
• The amount of money spent on research and development projects
cannot exceed the assigned budget of $300,000.
• Amount spent on research and development ≤ 300,000
• Contractual requirements specify that at least 500 units of product
must be produced.
• Number of units of product produced ≥ 500
• A mixture of fertilizer must contain exactly 30% nitrogen.
• Amount of nitrogen in mixture/total amount in mixture = 0.30
Final optimization model
Maximize total profit = 50 Jordanelle + 65 Deercrest
3.5 Jordanelle + 4 Deercrest ≤ 84
1 Jordanelle + 1.5 Deercrest ≤ 21
−2 Jordanelle + 1 Deercrest ≥ 0
Jordanelle ≥ 0
Deercrest ≥ 0
Modeling complicated constraints
• A fertilizer mixture is made of two ingredients and must
contain exactly 30% nitrogen. Ingredient X contains 20%
nitrogen. Ingredient Y contains 33% nitrogen.

• Amount of nitrogen in mixture

• Total amount of mixture


Modeling complicated constraints
• A fertilizer mixture is made of two ingredients and must
contain exactly 30% nitrogen. Ingredient X contains 20%
nitrogen. Ingredient Y contains 33% nitrogen.
Linear optimization models
• Two basic properties
1. The objective function and all constraints are linear
functions of decision variables

2. All variables are continuous


More practice
• A manufacturer of lightweight mountain tents makes a standard
model and an expedition model. Each standard tent requires 1 labor-
hour from the cutting department and 3 labor-hours from the
assembly department. Each expedition tent requires 2 labor-hours
from the cutting department and 4 labor-hours from the assembly
department. The maximum labor-hours available per day in the
cutting and assembly departments are 32 and 84 hours respectively.
If the company makes a profit of $50 on each standard tent and $80
on each expedition tent. Translate the problem into a mathematical
objective function.
Practice problem solution
Maximize total profit = 50 standard + 80 Expedition
Subject to:
1 standard + 2 expedition ≤ 32
3 standard + 4 expedition ≤ 84
standard ≥ 0
expedition ≥ 0
Modeling Linear Optimization Problems in Excel
• Be logical about placement of function coefficients, constraint coefficients,
and right hand values.
• (e.g. you may want to put decision variables in columns and constraints in the rows)
• Clearly separate “data” section from ”model” section of spreadsheet
• Data holds parameters of problem, model references these to create a dynamic
representation of the problem
• Use cell shading to distinguish data from model
• Define separate cells for the objective function and each constraint
function (left hand side of constraint)
• Use labels everywhere
Ski Spreadsheet Model
Ski Spreadsheet Model
Ski Spreadsheet Model

One weird trick: set


each decision variable
equal to “1” and make
sure the model table
looks like the data table.
Ski Spreadsheet Model
Maximize Jordanelle + 65 Deercrest
3.5 Jordanelle + 4 Deercrest ≤ 84
1 Jordanelle + 1.5 Deercrest ≤ 21
−2 Jordanelle + 1 Deercrest ≥ 0
Jordanelle ≥ 0
Deercrest ≥ 0

Maximize D22 = B9* B14 + C9* C14


D15 = B6* B14 + C6* C14 ≤ D6
D16 = B7* B14 + C7* C14 ≤ D7
D19 = C14 - 2* B14 ≥ 0
B14 ≥ 0
C14 ≥ 0
Types of Solutions
• Feasible solution any solution that satisfies all constraints
• Optimal solution Among the set of feasible solutions, the solution
that maximizes our objective function

• Software: Excel Solver


• Free software to find solutions for optimization problems
• Premium solver
• Part of Analytic Solver Platform, and offers higher accuracy and better
reporting
Excel Solver
• To install:
• Mac: Tools -> PowerPoint Add-Ins -> Solver
• Windows: File -> Options -> Add-ins ->
Analysis ToolPak

• To use:
• Data Ribbon -> Solver
Solver Window

Set to cell we
want to maximize
Solver Window

Set to decision
variables
Solver Window

Set of
constraints

Add constraints
one by one
Solver Window

Set to “Simplex LP”


for now
Solver Window

Magic button
to press
when we are
done defining
the problem
Solver Window

Set non-negativity
constraints with
Ease here!
Adding Constraints

Add constraints
one by until
we are done

(e.g. Fabrication,
Finishing and
Product mix)
Solver Results
• Three reports from Solver:
• Answer
• Sensitivity
• Limits

• Click which one(s) you want!


Solver: Answer
Answer Report
Solver Answer Report
• Answer report provides basic information about the solution
• Reports original and optimal solutions

• Binding constraint is a constraint where the cell value is equal to


the limit of the constraint
• Non-binding constraint is one where the cell value does not reach
the constraint limit
• Slack is the difference between the value and the constraint limit
Understanding Slack
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
Now…your turn!
Practice Problem
• A furniture company has two plants that produce the lumber used in
manufacturing tables and chairs. In one day of operation, plant A can produce the
lumber required to manufacture 20 table and 60 chairs, and plant B can produce
the lumber required to manufacture 25 tables and 50 chairs. The company needs
enough lumber to manufacture at least 200 tables and 500 chairs. If the cost of
operating plant A for one day is $1000 and plant B is $900, how many days each
plant should operate to produce sufficient lumber at minimum cost?

1. Write out the objective function, decision variables and constraints


2. Translate this to excel like the previous problem
3. Use the solver to get the optimal solution
Another Practice Problem
• A fast food chain plans to expand by opening several new restaurants. The chain
operates two types of restaurants, drive-thru and full service. A drive-thru restaurant
costs $100,000 to construct, requires 5 employees and has expected annual revenue
of $200,000. A full service restaurant costs $150,000 to construct, requires 15
employees and has expected annual revenue of $500,000. The chain has $2,400,000
in capital available for extension. Labor contracts require that they have no more
than 210 employees and licensing restrictions require that they open no more than
20 new restaurants. How many restaurants of each type should the chain open in
order to maximize the expected revenue? What is the maximum expected revenue?
How much of their capital will they spend and how many employees will they hire
for this expansion?
1. Write out the objective function, decision variables and constraints
2. Translate this to excel like the previous problem
3. Use the solver to get the optimal solution

Вам также может понравиться