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

DSME 6620

Decision Models and Applications

Lecture Two

Linear Programming I

1
DSME 6620
Decision Models and Applications

Agenda

• Motivation example
– Microcomputer problem
– Problem formulation
– Graphical method

• Learning Excel Solver


– Installing Solver
– Solving the microcomputer problem
– Reading report

• Sensitivity analysis
– Discussions of microcomputer problem
– Reading sensitivity report
– Another view of shadow price

2
DSME 6620
Decision Models and Applications

Microcomputer Problem

A manufacturer that assembles computers is about to start


production of two new microcomputers, Type 1 and Type 2
Microcomputers. Either type of microcomputer will require
assembly time, inspection time, and storage space. The
amount of each of these resources that can be devoted to the
production of microcomputers is limited. The resource
requirement by either type per unit, as well as the amount
availability, is summarized in the table below:

Resources Type 1 Type 2 Amount


available
Assembly time 4 hours 10 hours 100 hours
Inspection time 2 hours 1 hour 22 hours
The manager
Storage spaceof the3firm
cubicwould
feet like to determine
3 cubic feet thecubic
39 quantity
feet
of either microcomputer to produce in order to maximize the
total profit. The unit profit of Type 1 Microcomputer is $60,
while that of Type 2 is $50. There is ample demand in the
market.

3
DSME 6620
Decision Models and Applications

Formulation of
Microcomputer Problem
Typically, there are three basic steps in the formulation
process of an optimization problem:
• decision variables,
• objective function, and
• constraints.

1) Decision variables: What decisions will be made?

2) Objective function: What metric will the decision maker


want to optimize?

3) Constraints: What restrictions will limit the decisions?

4
DSME 6620
Decision Models and Applications

Formulation of
Microcomputer Problem

Write down the entire formulation:

Max p = 60x1 + 50x2


subject to
4x1 + 10x2 ≤ 100
2x1 + x2 ≤ 22
3x1 + 3x2 ≤ 39
x1 ≥ 0, x2 ≥ 0

Discussions:
1) Do we need to restrict the two decision variables to be
integers?

2) We probably have taken calculus, in which we use


differentiation to solve optimization problems. But a
linear program is an optimization problem that is solved
by methods other than differentiation.
5
DSME 6620
Decision Models and Applications

Linear Programming (LP)

• We just formulated the microcomputer problem as a


linear program.

• The word “linear” means that relationships are


linear, and the word “program” means plan or
schedule.

• A diversity of problems can be posed as linear


programs: they are routinely used in the business
world for planning and managing decision making.

• Linear programs are important!

6
DSME 6620
Decision Models and Applications

Graphical Method

Since there are only two variables, we can use a graph


to represent the problem. To find the optimal solution,
we can do the following:

 We can draw a line for each constraint and


determine which side of the line satisfies the
corresponding constraint.

 The lines thus define a feasible region where any


point in this region satisfies all the constraints.

 Represent the objective function by a movable line


that depends on the profit target.

7
DSME 6620
Decision Models and Applications

Graphical Method

Line 1: constraint on assembly time availability


Line 2: constraint on inspection time availability
Line 3: constraint on storage space availability

Line 2

objective function line

Line 1
Line 3

From the graph, we find that the optimal solution


corresponds to (x1, x2) = ( , ) with the optimal
profit p =
8
DSME 6620
Decision Models and Applications

Installing Solver in Excel 2007

• If using Excel 2007, click ‘Office Icon’ and then ‘Excel


Options’ at the bottom. In the new window, choose Add-ins
on the left and select Excel Add-ins in the Manage box,
followed by clicking Go. In the third window, select
the Solver Add-in check box, and then click OK.

• We can use Solver by clicking ‘Data’ in the menu.


DSME 6620
Decision Models and Applications

Installing Solver in Excel 2010+

• If using Excel 2010 or 2013, click ‘File’ in the menu and


then ‘Options’ on the left. In the new window, choose Add-
ins on the left and select Excel Add-ins in the Manage box,
followed by clicking Go. In the third window, select
the Solver Add-in check box, and then click OK.

• We can use Solver by clicking ‘Data’ in the menu.


DSME 6620
Decision Models and Applications

Inputting Data to Excel

Enter parameters and descriptions as shown below:


(see the next slide for formula)

Decision variable cells Constraint cells


B5:C5 E11:G13

Objective function cell


E8
11
DSME 6620
Decision Models and Applications

Inputting Data to Excel

• Decision variable cells (cells B5:C5):


– Fill zeros or other numbers as initial values

• Objective function cell (cell E8):


– Input “E8 = SUMPRODUCT(B5:C5,B8:C8)”

• Constraint cells (cell E11:G13):


– Input “E11 = SUMPRODUCT(B$5:C$5,B11:C11)”
– Copy E11 to E12:G13

Why place a dollar sign “$” here?

12
DSME 6620
Decision Models and Applications

Setting Solver Parameters


(Old Version)

Set Target Cell (Objective function): E8 Max


By Changing Cells (Decision variables): B5:C5
Subject to the Constraints: E11 <= G11
E12 <= G12
E13 <= G13 13
DSME 6620
Decision Models and Applications

Setting Solver Parameters


(New Version)

Set Target Cell (Objective function): E8 Max


By Changing Cells (Decision variables): B5:C5
Subject to the Constraints: E11 <= G11
E12 <= G12
E13 <= G13 14
DSME 6620
Decision Models and Applications

Setting Solver Options


(Old Version)

Assume Linear Model


Assume Non-Negative
15
DSME 6620
Decision Models and Applications

Setting Solver Options


(New Version)

Make Unconstrained Variables Non-Negative


Select a Solving Method: Simplex LP 16
DSME 6620
Decision Models and Applications

Reading Answer Report

Optimal decision
variable values
Optimal objective
(optimal solution)
function value

Constraints:
Binding means LHS = RHS, hence Slack = 0
Not Binding means LHS ≠ RHS, hence Slack ≠ 0

17
DSME 6620
Decision Models and Applications

Remarks on Solver

• Excel Solver is a useful tool for solving


optimization problems, including linear programs,
integer programs, and nonlinear programs.

• Pay attention to the following two issues when


using Solver to solve linear programs:
– How to inform Solver that we want to solve linear
programs (as opposed to nonlinear ones)
– How to inform Solver that some decision variables
are nonnegative

(See slides 15 and 16 for answers)

18
DSME 6620
Decision Models and Applications

Sensitivity Analysis

Discussion: On the supply side, there can be some variations


on the resource availability. Consider a case in which the
inspection time can be increased (for instance, by asking the
inspectors to work overtime). How much is the firm willing
to pay for the increase in the inspection time?

19
DSME 6620
Decision Models and Applications

Sensitivity Analysis

Discussion: On the demand side, there can be some


variations on the selling prices of the microcomputers.
Consider a case in which the profit of Type 1 Microcomputer
may change due to the probable variation in its selling price.
What is range of the profit change within which there is NO
need to vary the production quantities?

20
DSME 6620
Decision Models and Applications

Reading Sensitivity Report

Ranges for objective coefficient variations


within which the optimal solution keeps same

Shadow prices Ranges for


of constraints’ RHS shadow prices
(such as resources)
21
DSME 6620
Decision Models and Applications

Summary

• Linear programming is an important and useful tool for


decision making.

• Formulating a decision making problem as linear


programming involves three steps:
– Decision variables
– Objective function
– Constraints

• Excel Solver is a convenient tool for solving linear


programming problems.

22

You might also like