Professional Documents
Culture Documents
INFO 220
4
3
2
5
What is solver?
An Excel add-in that can be used to find
an optimal solution to a problem,
based on some pre-determined objective
solved by changing a set of decision
variables such that the solutions meets a
given a set of limitations (constraints).
The objective is to find a minimum-cost diet that contains at least 500 calories,
at least 6 grams of chocolate, at least 10 grams of sugar, and at least 8 grams of
fat.
Step 3: Constraints
STEP 3: Constraints
To begin, we create a table in Excel that defines how
many calories and units of chocolate, sugar, and fat are
in each type of dessert.
Step 3: Constraints
STEP 3: Constraints
Next, we need to calculate the total amount of calories,
chocolate, sugar & fat - given the total number of each
item (decision variables).
Create a Total in Column F
=SUMPRODUCT($B$7:$E$7,B14:E14)
Step 3: Constraints
STEP 3: Constraints
Finally, we need to indicate the limitations highlighted in
the problem.
We add a >= in Column G
Add the limits in Column H
SOLVE IT!
Step 1: Set the Objective
Open Solver and click on the
to select the cell in our
spreadsheet that calculates our objective function Cell
B10
Next, we must identify the type of problem we are
solving - MIN
SOLVE IT!
Step 2: Identify the decision variables
Click on the
to select the cell in our spreadsheet to
tell solver which variables it can change to reach the
optimal solution.
SOLVE IT!
Step 3: Add constraints
On the right-hand side of the window there is a button to Add
a constraint
Use the cell reference to input the totals for each constraint
we calculated.
Example for Calories:
Click Add if adding more than constraints or Click OK if
finished.
SOLVE IT!
Step 3: Add constraints
We have now created 4 constraints and Solver will ensure that
the changing cells are chosen so that diet will be chosen to
ensure that enough calories, chocolate, sugar, and fat are eaten.
Note: The Change button allows you to modify a constraint already entered and Delete
allows you to delete a previously entered constraint. If you need to add more constraints,
simply click Add.
SOLVE IT!
Step 4: Minor changes to Solver
Parameters
Check the box Make Unconstrained
Variables Non-Negative (we do not
want any negative values)
Change the Solving Method to
SIMPLEX LP
Click SOLVE
Solution