Solver Guideline
Solver Guideline
The next eight pages give a step-by-step guide for using the Solver' to solve linear
programming problems. It can be used to make overheads, or can serve as a handout for students.
It is based upon solving the following example problem. PowerPoint slides containing this
example problem and the notes for using the Solver (with the Lego example) are included on the
CD- ROM packaged with the text.
The Quality Furniture Corporation produces benches and picnic tables. The firm has two
main resources: its labour force and a supply of redwood for use in the furniture. During
the next production period, 1200 hours of manpower are available under a union
agreement. The firm also has a stock of 5000 pounds of quality redwood. Each bench that
Quality Furniture produces requires 4 labour hours and 10 pounds of redwood; each picnic
table takes 7 labour hours and 35 pounds of redwood. Completed benches yield a profit of
$9 each, and tables a profit of $20 each. What product mix will maximize total profit?
Following is the algebraic formulation of a linear programming model for this problem:
Formulating and Solving Linear Programming Models with Excel
Enter the input data and construct relationships among data elements in a readable, easy
to understand way. When building this foundation for your model, think ahead about the
optimization model you will be developing. Make sure there is a cell in your spreadsheet
for each of the following:
• Every relevant piece of data (see cells B5:C5, BS:C9, and F8:F9). These cells are
the "data cells."
• Every decision variable (for now, just label the cells, and enter an initial value for
each decision variable - see cells B3 and C3). These cells are the "changing cells."
• The quantity (objective function) you wish to maximize or minimize (this must be an
equation that calculates the profit or cost, based on the value of the decision
variables). The cell containing this quantity (see cell D5) is the "target cell."
Every quantity that you might want to constrain (include both sides of the
constraint-an equation for the left-hand-side representing the amount of the
resource used, and a number for the right-hand-side representing the amount of
the resource available). The left-hand-side totals being constrained (see cells
D8:D9) are the "output cells."
If you don't have any particular initial values you want to enter for your decision variables,
you can start by just entering a value of 0 in each changing cell. (Note that the following
spreadsheet places the changing cells and profits at the top, whereas the textbook places
them at the bottom. Either location is fine.)
The Formulas in the Spreadsheet
The formulas in the spreadsheet are shown next. Note the use of the SUMPRODUCT
function. SUMPRODUCT sums the products of individual cells in two ranges. For example,
SUMPRODUCT(B5:CS, B3:C3) sums the products BS*B3 plus C5*C3. The two specified
ranges must be the same shape (same number of rows and columns). For linear
programming, you should try to always use the SUMPRODUCT function (or SUM) for the
objective function and constraints, as this guarantees that the equations will be linear.
Defining the Target Cell (Objective Function)
Once you are satisfied that the spreadsheet model is complete, and so includes all four of the
elements of the linear programming model (data, decision variables, objective function, constraints),
then
To select the cell you wish to optimize, select the "Set Target Cell" window within the Solver
dialogue box, and then either
Note:
• The target cell must be a single cell (there can only be one objective).
• The target cell should contain an equation that defines the objective and depends on the
decision variables.
Identifying the Changing Cells (Decision Variables)
You next tell Solver which cells are decision variables-i.e., which cells Excel is allowed to change
when trying to optimize. Move the cursor to the "By Changing Cells" window, and either
• Drag the cursor across all cells you wish to treat as decision variables, or
• Type the addresses of every cell you wish to treat as a decision variable, separating them by
commas.
If you wish to use the "dragging" method, but the decision variables do not all lie in a connected
rectangle in the spreadsheet, you can "drag" them in one group at a time:
To begin entering constraints, click on the “Add” button to the right of the constraints windows. A
new dialogue box will appear. The cursor will be in the “Cell Reference” windows with this
dialogue box.
• Click on the cell that contains the quantity you want to constrain, or
• Type the cell address that contains the quantity you want to constrain.
The default inequality that first appears for a constraint is "<=". if you wish to change this,
• Click on the arrow beside the "<=" sign, and then
• Select the inequality (or equality) you wish from the list provided.
Notice that you may also force a decision variable to be an integer or binary (i.e., either 0 or 1) using
this window. These features fall outside the realm of linear programming.
After setting the inequality, move the cursor to the "Constraint" window.
• Click on the cell you want to use as the constraining value for that constraint, or
• Type the number or the cell reference you want to use as the constraining value for that
constraint, or
• Type a number that you want to use as the constraining value.
You may define a set of similar constraints (e.g., all <= constraints, or all >= constraints) in one step
if they are in adjacent rows (as was done here). Simply select the range of cells for the set of
constraints in both the "Cell Reference" and "Constraint" window.
The Solver dialogue box now contains the optimization model, including the target cell (objective
function), changing cells (decision variables), and constraints.
Once you are satisfied with this optimization model, there is one more very important step. Click on
the "Options" button in the Solver dialogue box, and click in both the "Assume Linear Model" and
the "Assume Non-Negative" box.
The "Assume Linear Model" option tells the Excel Solver that it is a linear programming model that
is being solved. This speeds the solution process, makes it more accurate, and enables a more
informative sensitivity report.
The "Assume Non-Negative" box adds non-negativity constraints to all the decision variables.
The Solution
After setting up the model and selecting the appropriate options, it is time to click "Solve". You then
will receive one of four messages:
• "Solver found a solution. All constraints and optimality conditions are satisfied". This
means that Solver has found an optimal solution.
• "Cell values did not converge". This means that the objective function can be improved
to infinity. You may have forgotten a constraint (perhaps the non-negativity constraints)
or made a mistake in a formula.
• "Solver could not find a feasible solution". This means that Solver could not find a
feasible solution to the constraints you entered. You may have made a mistake in typing
the constraints or in entering a formula in your spreadsheet.
• "Conditions for Assume Linear Model not satisfied". You may have included a formula
in your model that is nonlinear. There is also a slim chance that Solver has made an error.
(This bug shows up occasionally.)
If Solver finds an optimal solution, you have some options. First, you must choose whether you want
Solver to keep the optimal values in the spreadsheet (you usually want t 'his one) or go back to the
original numbers you typed in. Click the appropriate box to make your selection. You also get to
choose what kind of reports you want. You will often want to select "Sensitivity Report". Once you
have made your selections, click on "OK'. To view the sensitivity report, click on the "Sensitivity
Report" tab in the lower-left-hand corner of the window.