Solver Tutorial v3
Solver Tutorial v3
The Solver Tool has the capability to solve linear (and often nonlinear) programming
problems. Linear and non-linear solvers are available in most commercially available
spreadsheets to include Excel, LibreOffice, GoogleSheets, etc. Our Solver Tutorial takes you
step by step through the process of creating a Solver model, using a Product Mix example.
We'll first show you how to (1) load the solver into your spreadsheet, (2) define the problem
and write out formulas for the objective and constraints, and (3) solve the problem. We will
focus on Microsoft Excel (Mac and PC) and LibreOffice.
Click the Microsoft Office Button, and then click Excel Options.
Click Add-Ins, and then in the Manage box, select Excel Add-ins and click Go.
In the Add-Ins available box, select the Solver Add-in check box, and then click OK.
If Solver Add-in is not listed in the Add-Ins available box, click Browse to locate the
add-in.
5. If you get prompted that Solver is not currently installed, click Yes to install it.
6. After you load Solver, the Solver command is available in the Analysis group on the
Data tab.
3. After restarting Excel for Mac (fully Quit Excel), select the Data tab, then select Solver
to launch. Now on the Tools menu, you should see the Solver command.
If you have an earlier version of Excel - then see https://support.microsoft.com/enus/kb/2431349 for details on where you can locate them.
LibreOffice
The Solver is found at Tools -> Solver from the main menu. The solver will then show up as a
separate window. At the bottom left of this window you'll find an Options... -button. Click this
button and make sure LibreOffice Linear Solver is selected as the solver engine.
You might also need to define your JAVA JRE client (sometimes an error occurrs when
launching the solver). In the same options tab, go to Advanced and select one of the Java Run
time Environment installed on your computer and click OK
Pacific
Savannah
Aspen
Glue (quarts)
50
50
100
50
Pressing (hours)
15
10
500
400
300
200
500
750
250
500
In the next production cycle, you have 5,800 quarts of glue; 730 hours of pressing capacity;
29,200 pounds of pine chips; and 60,500 pounds of oak chips available. Further assume that
each pallet of Tahoe, Pacific, Savannah, and Aspen panels can be sold for profits of $450,
$1,150, $800, and $400, respectively.
Writing the Formulas on the spreadsheet
Before we implement this problem statement in either Excel, let's write out formulas
corresponding to the verbal description above. If we use the symbol X1 for the number of
Tahoe pallets produced, X2 for the number of Pacific pallets produced, and X3 for the number
of Savannah pallets produced, and X4 for the number of Aspen pallets produced, the objective
(calculating total profit) is:
Maximize: 450 X1 + 1150 X2 + 800 X3 + 400 X4
In the worksheet below, we have reserved cells B4, C4, D4 and E4 to represent our decision
variables X1, X2, X3, and X4 representing the number of pallets of each type of panel to
produce. The Solver will determine the optimal values for these cells.
To add the constraints, we click on the Add button in the Solver Parameters dialog and select
cells F8:F11 in the Cell Reference edit box (the left hand side), and select cells G8:G11 in the
Constraint edit box (the right hand side); the default relation <= is OK. (Click on the image to
see it full-size.)
We choose the Add button again (either from the Add Constraint dialog above, or from the
main Solver Parameters dialog) to define the non-negativity constraint on the decision
variables.
When we've completely entered the problem, the Solver Parameters dialog appears as shown
below.
Libre Office
Now we'll start the LibreOffice Solver and insert the Target Cell, Desired result, the Cells that
needs changing and the Limiting Conditions. Cell locations are given just as an indication on
how to use Libre Office. Follow the same procedure as previously to solve the problem.
Cell D14 is your objective function will change (Target Cell ) as the solver changes to 0 or 1 in
cell range C8:C13.
Changes in the cell range C8:C13 makes Solver check if D14 has the same value as B2. Limiting
conditions are your constraints.
Have a look at the following figure to see the logic of the solver.
Then you just need to follow the same steps as in the Excel tutorial to optimize your solution.
The process is described in part 2.
References
There are many references available. We suggest the following as starting places :
-
Solver.com : http://www.solver.com/solver-tutorial-using-solver
MIT Open courseware: http://ocw.mit.edu