Você está na página 1de 5

What is Solver Add-In?

In the real world, we are often confronted with a number of waysof accomplishing a certain objective, some ways being better ina certain sense than others. For example, there are many combinationsof products a plant can manufacture, and we may be interestedin finding the combination that leads to maximum profit. Thevariables in real-world situations are subject to restrictionsthat we shall call constraints. In the first place, it is requiredin most instances that the variables not take on negative values. Furthermore, certain combinations of the variables are not permissible. For example, a product mix that requires a plant to operate morethan 24 hours a day obviously is not permissible, nor is it permissibleto schedule output at levels exceeding plant capacity. The problems sometimes can be as complicated as having more than 10 constraintson 6 variables. Don't worry because Excel has a powerful optimization feature called Solver Add-In which can calculates solution towhat-if scenarios based on adjustable cells, constraint cells,and, optionally, cells that must be optimized. Armed with this tool, we are able to solve large systems involving up to 200 variablesand 500 constraints in a matter of seconds by setting up a spreadsheet.

We must use an example to demonstrate the power of the Solver. You run a factory that makes drinking glasses, which use a singlemachine. The machine is available for 60 hr/week. You run on aweekly production schedule where you spend all week producingglasses, accumulating your output in a warehouse. At the end ofeach week you ship out that week's production. You produce two products, juice glasses and wine glasses, themachine takes 6 hours to produce 100 cases of juice glasses, and5 hours to produce 100 cases of wine glasses. Each case of juiceglasses takes up 10 cubic feet of storage in the warehouse, eachcase of wine glasses takes up 20 cubic feet of storage. The warehouseholds at most 15, 000 cubic feet. The net contribution per case of juice glasses to your profit(net of production costs) is $5, and is $4.50 per case of wineglasses. Your marketing department (your husband, as this is asmall company) estimates that you can sell as many cases of wineglasses as you can produce, but can sell a maximum of 800 casesof juice glasses per week. You must determine a production planthat respects all the limitations (constraints) which maximizestotal net profit. Algebraic formulation: Let J=# cases of juice glasses produce per week; W=# cases ofwine glasses produce per week. We want to maximize total net profit, in $: 5J + 4.5*W subject to Constraint on machine time, in hours: (6/100)*J + (5/100)*W <=60 Constraint on warehouse space, in cubic feet: 10*J + 20*W <=15,000 Constraint on juice glass demand, in cases: J <= 800 Non-negativity: J, W >= 0

Setting Target Cell

We first need to model the problem by a spreadsheet. The diagramshown below is one of the many ways to model the problem. Itis recommended that you specify a section for the constraintsbecause you can freely change their values later. We also encourageyou to assign names to the cells so that the summary report laterproduced by the Solver can become more meaningful and representative.

Let's try out the Solver! We first choose the Solver command fromthe Tools menu and then the Solver Parameters dialog box appears. Please do not worry about the edit boxes and the buttons in thedialog box since we'll explain them in the course of our tutorial.

You first encounter the Set Target Cell edit box in which you must specify the objective or target. Our objective is to maximizecell F5. (If you assign a name to the cell, you can enter thename in the box) In this example, we want the Solver to maximizethe target cell, so you have to select Max. If you want to minimizethe target cell, you will have to choose Min. In some circumstances,you might want the Solver to find a solution that makes the targetcell equal to some particular value, in which case you would selectthe Value of option and enter an amount, a cell reference, orthe name of a cell in the adjacent edit box. In our example, the variable cells lie in the range E2:E3. Youcan either enter cell coordinates, type cell name, or select cellsin the worksheet. You must enter it at least one cell that theformula in the target cell depends on for its calculation. Otherwise,the Solver will not perform any calculation.

Specifying Constraints
We need to specify constraints by clicking on the Add button inthe Solver Parameters dialog box and completing the Add Constraintsdialog box.

Our first constraint is the total time available for the machine(60 hours). The following figure shows how you can express thisconstraint.

In a similar vein, you can express other constraints of the problemby clicking on the Add button. Note that there are 4 comparisonoperators at your disposal. We must impose a non-negativity constrainton the changing cells because we want to make sure that J andW are positive values. After entering all constraints, you canclick the OK button to return the Solver Parameters dialog box.

Solving the Problem

To see the result of the Solver, click the Solver Parameters dialogbox. The optimal solution is displayed in the worksheet,

and the Solver Results dialog box appears.

You can either save Solver parameters as named scenarios by clickingthe Save Scenario button or restore original values. Saving theSolver parameters provides an excellent way to explore and performfurther what if analysis on a variety of possible outcomes.

Generating Reports
The Solver can summarize its results in 3 different ways whichprovides you with different views of analysis. The results canbe presented in either Answer Report, Sensitivity Report, or LimitsReport. The Answer Report displays the target cell, the changing cells,and the constraints. It also includes slack value for each constraint. The Limits Report tells you how much the values of the changingcells can be increased or decreased without violating the constraintsof your problem. The Sensitivity Report presents the sensitivity information aboutthe target cell. The detailed information of this report willbe delivered in class. The following is the sample of the SensitivityReport.

Configuring Solver Options

You can stipulate the time limits or the numbers of iterationsthat the Solver is allowed to reach before it finds a optimalsolution. You can also specify the precision and the toleranceof the solution. More importantly, you can define the natureof your model by deciding if it is a linear or nonlinear problem. In class, we always assume our problem a linear model; therefore,we activate the Assume Linear Model option as shown below.

You can also take advantage of the Show Iteration Results optionwhich shows you steps to achieving an optimal solution. Selectingthis option will make the Solver pause for solutions that breakthe constraints as well as for suboptimal solutions.