0% found this document useful (0 votes)
112 views

LPP Using Simplex Method

1. The document describes developing an Excel spreadsheet model to solve a linear programming problem (LPP) using the Simplex method. 2. It provides details on setting up the spreadsheet with input data, variables, objective function, and constraints. Solver is then used to link the spreadsheet to an LPP solution. 3. A sample problem is presented involving production planning with two products and two resources to demonstrate setting up and solving the model.

Uploaded by

Daniel Nimabwaya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

LPP Using Simplex Method

1. The document describes developing an Excel spreadsheet model to solve a linear programming problem (LPP) using the Simplex method. 2. It provides details on setting up the spreadsheet with input data, variables, objective function, and constraints. Solver is then used to link the spreadsheet to an LPP solution. 3. A sample problem is presented involving production planning with two products and two resources to demonstrate setting up and solving the model.

Uploaded by

Daniel Nimabwaya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Developing an excel spreadsheet program to solve LPP using

Simplex method

Introduction
In Excel Solver, the spreadsheet is the input and output medium for
the LP. Figure 1 shows the layout of the excel spreadsheet program.

Figure 1: LP Solver Simplex Method Model

The top of the figure includes four types of information:


1. input data cells (shaded areas in blue and green, B5:C9 and
F6:F9, respectively)
2. cells representing the variables and the objective function we
seek to evaluate (shaded rectangle cells in yellow, B13:D13)
3. algebraic definitions of the objective function and the left-hand
side of the constraints (dashed rectangle cells, D5:D9)
4. cells that provide explanatory names or symbols
Solver requires the first three types only. The fourth type enhances the
readability of the model and serves no other purpose.
How does Solver link to the spreadsheet data?
First, we provide equivalent “algebraic” definitions of the objective
function and the left-hand side of the constraints using the input data
(shaded areas in blue and green, B5:C9 and F6:F9, respectively) and
the objective function and the variables (shaded rectangle cells in
yellow, B13:D13), and then we place the resulting formulas in the
appropriate cells of the dashed rectangle D5:D9.

The table below shows the resulting formulas and their placement in
the appropriate cells:

Entered in cell Spreadsheet formula


D5 =B5*B$13+C5*C$13
D6 =B6*B$13+C6*C$13
D7 =B7*B$13+C7*C$13
D8 =B8*B$13+C8*C$13
D9 =B9*B$13+C9*C$13
D13 =D5

Actually, we only need to enter the formula for cell D5 and then copy
it into cells D6:D9.

All the elements of the LP model are now ready to be linked with
Solver. From Excel’s Data menu, select Solver to open the Solver
Parameters dialogue box shown in Figure 2.

First, we define the objective function, z, and the sense of optimization


by entering the following data:

Set Objective: $D$5


To: ● Max
By Changing Variable Cells: $B$13:$C$13
Figure 2: Solver Parameters dialogue box

The next step is to set up the constraints of the problem by clicking


Add. The Add Constraint dialogue box will be displayed (see Figure 3)
to facilitate entering the elements of the constraints as

$D$6:$D$9<= $F$6:$F$9
Figure 3: Add Constraint dialogue box

The only remaining constraints are the nonnegativity restrictions,


which are added to the model by clicking Add in the Add Constraint
dialogue box to enter

$B$13:$C$13>=0

Another way to enter the nonnegative constraints is to check □ Make


Unconstrained Variables Non-Negative on the Solver Parameters
dialogue box.

To solve the problem, click Solve on the Solver Parameters (Figure 2).
A new dialogue box, Solver Results, will then give the status of the
solution. If the model setup is correct, the optimum value of z will
appear in cell D5 and the values of x1 and x2 will go to cells B13 and
C13, respectively.

The Solver Results dialogue box will give you the opportunity to request
further details about the solution, including the important sensitivity
analysis report.
Figure 4: Solver Results dialogue box

THE SAMPLE PROBLEM OF TWO VARIABLES


Consider that a company produces two products (P1 and P2) with
two raw materials M1 and M2. The materials required to produce one
unit of x1 and x2 are:

Raw Material P1 P2
M1 7 8
M2 9 8

Available raw materials of M1 and M2 are 5000 and 6000 units,


respectively. Contribution per unit of P1 is K 90 and P2 is K 100. We are
required to determine the number of each product that optimizes the
maximum contribution of the products. In this context, we can assume
number of products P1 and P2 are x1 and x2, respectively)
SOLUTION
The model for the above LP problem is:

Objective Function Max = 90x1 + 100x2


Subject to constraints
7x1 + 8x2 ≤ 5000
9x1 + 8x2 ≤ 6000
Automatic constraint x1, x2 ≥ 0

To provide an easy approach of solving the above LP problem with


Excel Solver, we can consider the following steps in order.

1. Set the information in a table in Excel Worksheet (including


contributions and constraints) as in the model.
In the above table,

Cell D5 is set out with the =B5*B$13+C5*C$13


formula
Cell D6 is set out with the =B6*B$13+C6*C$13
formula
Cell D7 is set out with the =B7*B$13+C7*C$13
formula
Cell D13 is set out with the =D5
formula

Note: Other values in the table are the information available in


the problem.

2. Click the "Solver" in Analysis and do the following.

In the “Solver Parameter”,


3. Set the Target Cell (in this case, D5)
4. Set the Optimization Problem (Max)
5. Set the Changing Cells (in this case, B13 and C13 of Solution in
YELLOW)
6. Click “Add” in the solver and do the following to add constraints
7. Set the “Cell Reference” of Possible Total use of M1 and M2 (in
this case D6 and D7, respectively)
Set the constraint symbol (in this case <=)
Set the constraint cell of Limit of M1 and M2 (in this case F6 and
F7 in GREEN)
Click "Add" to add the constraint of M1 and M2
8. Close Add Constraint
9. Click "Make Unconstrained Variables Non-Negative"
10. Select a Solving method to “Simplex LP”
11. Click "Solve" in the "Solver Parameter" to open “Solver Results”

Select (Answer, Sensitivity and Limits) in the "Solver Results" and


click "OK" to get the problem solved in the Cells
The result will appear as in the Output results of the model

Answer Report 1
Objective Cell (Max)
Original
Cell Name Value Final Value
$D$5 Objective, z Totals 0 63750

Variable Cells
Original
Cell Name Value Final Value Integer
$B$13 Solution x1 0 500 Contin
$C$13 Solution x2 0 187.5 Contin

Constraints
Cell Name Cell Value Formula Status Slack
$D$6 Constraint M1 Totals 5000 $D$6<=$F$6 Binding 0
$D$7 Constraint M2 Totals 6000 $D$7<=$F$7 Binding 0
Sensitivity Report 1
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$13 Solution x1 500 0 90 22.5 2.5
$C$13 Solution x2 187.5 0 100 2.857142857 20

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Constraint M1 Totals 5000 11.25 5000 1000 333.3333333
$D$7 Constraint M2 Totals 6000 1.25 6000 428.5714286 1000

Limits Report 1
Objective
Cell Name Value
Objective, z
$D$5 Totals 63750

Variable Lower Objective Upper Objective


Cell Name Value Limit Result Limit Result
$B$13 Solution x1 500 0 18750 500 63750
$C$13 Solution x2 187.5 0 45000 187.5 63750

You might also like