Sie sind auf Seite 1von 8

# BIS302 Decision Support Systems I Lab Session 1 Linear Programming Models

EXAMPLE 1 (Maximisation Problem)1 Ramotswa Pottery Limited (RPL) is a small crafts company run by a group of 15 women. The company employs skilled artisans to produce clay bowls and mugs with authentic Setswana designs and colours. The two primary resources used by the company are special pottery clay and skilled labour. Given these limited resources, the company desires to know how many bowls and mugs to produce each day in order to maximize profit. The two products have the following resource requirements for production and profit per item produced (i.e. model parameters):

Resource Requirements Product Bowl Mug Labour (Hr./Unit) 1 2 Clay (Kg/Unit) 4 3 Profit (P/Unit) 40 50

This problem was discussed in class, and the following linear programming model derived (make sure you understood the process): Maximise Z = 40x1 + 50x2 Subject to x1 + 2x2 40 4x1 + 3x2 120 x1 >= 0, x2 0

## Source: Taylor (2007), with minor modifications.

COMPUTER SOLUTION WITH MICROSOFT EXCEL AND SOLVER What is Solver? Simple linear programming models can be solved graphically; however, for more complex models this approach quickly becomes untenable. A number of software packages are available for solving linear programming models take the time to search the Internet with a search engine such as Google to find out what is available out there. Microsoft Excel comes with an add-on called Solver that can be used to solve linear programming models. Solver uses the standard Microsoft Excel interface that you are familiar with: formulae are entered into cells, and results displayed in other cells. In particular, Solver uses the following types of cells: 1. Changing, or adjustable cells these are the decision variables. In our example, they refer to the bowls and mugs we should produce to maximise profit. You can think of it this way: these cells are called adjustable (or changing) because Solver keeps adjusting (or changing) them to see how the profit behaves with each new value of the decision variable(s). 2. Target cell the word target here refers to the thing we are targeting i.e. maximising the profit. So, the target cell will contain the best amount of profit we can make, subject to the constraints. 3. Constrained cells these capture the constraints in our model.

Preparing data for Solver Although one has a lot of freedom regarding the way one enters data into Microsoft Excel, there is a standard way recommended by most elementary linear programming texts 2if one intends to analyse the data with Solver. The approach uses the SUMPRODUCT function; to understand how this function works, look it up in the extensive Microsoft Excel online help system. It is important that you understand how this function works if do not understand it, then what follows will not much sense! According to this prescribed formulation, your spreadsheet for the above LP model will look similar to the following picture.

## A 1 2 3 4 5 6 7 8 9 10 11 Number of units Profit Constraints Labour Clay

RPL Manufacturing

X1 Bowls

X2 Mugs

40

50

=SUMPRODUCT(B6:C6, \$B\$4:\$C\$4)

1 4

2 3

<= <=

40 120

## In reality, of course, your spreadsheet will look something like this:

Remember that RPL produces bowls and mugs, and we chose (arbitrarily, of course) to use x1 to represent bowls, and x2 to represent mugs. Cells B5 and C5 are our changing cells i.e. they refer to the final values for bowls and mugs that we must produce to maximise profit, given the constraints. Recall that the profit contributions per unit were 40 for bowls and 50 for mugs; these go into cells B6 and C6 respectively (note that everything to do with bowls is in columns B and everything to do with mugs in column C). Once we know what goes into B5 and C5, we are able to calculate the actual maximum profit that we will generate using the formula in D6 can you see that this formula says 40x1 + 50x2, which is the objective function that we are trying to maximise? But how do we determine the actual values for cells B5 and C5 that will maximise cell D6? Well, that is what Solver is just about to tell us. 3

Invoking and using Solver To invoke Solver, go to the Data tab, and select Solver from the Analysis group (If Solver is not available, see the What if Solver is not available on your Microsoft Excel menu system section below.) This should display the following Solver Parameters dialog box:

In the Solver Parameters dialog box , you need to enter the following:

The target cell: you can either simply enter it in the input box, or you can click on Set target cell input box to actually select the target cell.

in the

Changing cells: again you can either simply enter the changing cells in the appropriate input box, or click on the in the By changing cells input box to actually select them

Constraints: Constraints are entered in the box labelled Subject to constraints. To add a constraint, click on the Add button, and the following dialog box, in which you can now enter the constraint, is displayed:

When you click the Add button, the following dialog is displayed, allowing to enter the constraint (click Add for each constraint you need to enter!), and be careful to specify the correct relational operator (greater than, equal to, etc):

When you are done entering constraints, click the OK button, which should take you back to the Solver parameters window. Notice the Change and Delete buttons that allow you to

(obviously!) change or delete constraints. Notice also that in our spreadsheet we did not specify the non-negativity constraints (remember we promised to come back to these?). To instruct Solver to enforce this constraints, click on the Options button, and in the Solver Options dialog box, check both the Assume liner model (remember ours is a linear programming model!) and the Assume Non-negative check boxes. Click OK, and this takes you back to the Solver Parameters dialog box, where you can now click on the Solve button to run the model. This should give you the following screen:

Understanding the Solver output Solver should run and (almost immediately) display the following window:

Good news Solver has found a solution! You can specify what reports Solver should produce: Answer, Sensitivity, or Limits. We are only interested in the Answer and Sensitivity reports, so select them. Finally, with the Keep Solver Solution option selected, click on the OK button.

Notice that the model has been solved: to maximise profit given our constraints, we need to produce 24 bowls and 8 mugs, and our profit will be P1360. We have covered quite a bit in this session, take the time to learn and understand it all!!! Do look at the generated reports and try to understand them, too!!!

What next? In summary, to solve a linear programming model with Solver, you need, first, to formulate it using pencil and paper only then can you enter it into the computer. So, practice formulating linear programming models and entering them into Microsoft Excel / Solver (some examples were given in class!) the next lab will give you a textual description of an LP problem to solve and submit, all in 2 hours!

What is Solver is not available on you Microsoft Excel menu system? The following instruction for loading solver come from (you guessed it!) the extensive Microsoft Excel on-line help system:

1. 2. 3. 4.

## , and then click Excel Options.

Click Add-Ins, and then in the Manage box, select Excel Add-ins. Click Go. In the Add-Ins available box, select the Solver Add-in check box, and then click OK.

Tip If Solver Add-in is not listed in the Add-Ins available box, click Browse to locate the add-in. If you get prompted that the Solver Add-in is not currently installed on your computer, click Yes to install it. 5. After you load the Solver Add-in, the Solver command is available in the Analysis group on the Data tab.