Professional Documents
Culture Documents
Science
Session 4
Wednesday 14th September
Recap
• Graphical solution of 2-variable LPs
– Plot constraints as straight lines
– Identify feasible region
– Plot objective function and find where it is
tangential to or overlaps with the boundary region
of the feasible solution space
• Basic Solver Setup
Preparing the Spreadsheet for Solver
• Organize the data for the model on the
spreadsheet.
• Reserve separate cells in the spreadsheet for
each decision variable in the model.
• Create a formula in a cell in the spreadsheet that
corresponds to the objective function.
• For each constraint, create a formula in a
separate cell in the spreadsheet that corresponds
to the left-hand side (LHS) of the constraint.
Importance of Spreadsheet Design
• Communication - A spreadsheet's primary business
purpose is communicating information to managers.
• Reliable - The output a spreadsheet generates should
be correct and consistent.
• Auditable - A manager should be able to retrace the
steps followed to generate the different outputs from
the model in order to understand and verify results.
• Modifiable - A well-designed spreadsheet should be
easy to change or enhance in order to meet dynamic
user requirements.
Guidelines for Spreadsheet Design
• Organize the data, then build the model around the data
• Do not embed numeric constants in formulas
• Things which are logically related should be physically related
• Use formulas that can be copied
• Column/rows totals should be close to the columns/rows
being totaled
• The English-reading eye scans left to right, top to bottom
• Use color, shading, borders and protection to distinguish
changeable parameters from other model elements
• Use text boxes and cell notes to document various elements
of the model
Applying Solver
• Target cell - the cell in the spreadsheet that represents
the objective function
• Constraint cells
– the cells in the spreadsheet representing the LHS formulas on
the constraints
– the cells in the spreadsheet representing the RHS formulas on
the constraints
Applying Solver
• At this point the challenge is not Solver – it is
problem formulation!
MAX: 4 X1 + 5 X2
Subject: 2 X1 + 3 X2 ≤ 120
4 X1 + 3 X2 ≤ 140
X1 + X2 ≥ 80
X 1, X 2 ≥ 0
The Simplex Method
• Powerful method of solving LPs
• Finds the optimal point on the surface of the
feasible solution space
• Step 1: Convert all inequalities to equalities
using slack variables
For example: ak1X1 + ak2X2 + … + aknXn <= bk
converts to: ak1X1 + ak2X2 + … + aknXn + Sk = bk
100
3
50
1 2
0
0 50 100 150 200 250 X1
Simplex Method Summary
Identify any basic feasible solution (or extreme
point) for an LP problem, then moving to an
adjacent extreme point, if such a move improves
the value of the objective function.
Moving from one extreme point to an adjacent one
occurs by switching one of the basic variables with
one of the nonbasic variables to create a new
basic feasible solution (for an adjacent extreme
point).
When no adjacent extreme point has a better
objective function value, stop -- the current
extreme point is optimal.
The Simplex Method
• What if you have 5 inequalities and 3 decision
variables, how many basic solutions are you
going to compute?
– That’s 5 slack variables
– So 5 equations and 8 variables
– Set 3 variables to 0 at a time to solve 5 equations
with 5 variables
– How many basic solutions?