SimplexLP



Load the Solver Add-in | Formulate the Model | Trial and Error | Solve the Model

  • Simplex LP – This is used to solve linear problems. Evolutionary – This is used to solve more complex and non-smooth non-linear problems. It looks for a global optimal solution, which makes it take longer to run compared to GRG Nonlinear. You can select any of the three options, but by default, the GRG Nonlinear method is used.
  • Hi, There seems to be a major bug in the Excel Simplex-LP solver. Attached is the Excel with the linear problem and the correct solution as derived for example by OpenSolver or SAS.
  • A model in which the objective function and all of the constraints (other than integer constraints) are linear functions of the decision variables is called a linear programming (LP) problem. (The term “programming” dates from the 1940s and the discipline of “planning and programming” where these solution methods were first used; it has nothing to do with computer programming.) As.

Excel includes a tool called solver that uses techniques from the operations research to find optimal solutions for all kind of decision problems.

Load the Solver Add-in

The kind of report that Excel will create when Solver is finished: When the Simplex LP or GRG Nonlinear Solving method is used, 1 creates an Answer report, 2 creates a Sensitivity report, and 3 creates a Limit report. When the Evolutionary Solving method is used, 1 creates an Answer report, and 2 creates a Population report.

To load the solver add-in, execute the following steps.

1. On the File tab, click Options.

2. Under Add-ins, select Solver Add-in and click on the Go button.

3. Check Solver Add-in and click OK.

4. You can find the Solver on the Data tab, in the Analyze group.

Simplex Lp Excel

Formulate the Model

The model we are going to solve looks as follows in Excel.

1. To formulate this linear programming model, answer the following three questions.

a. What are the decisions to be made? For this problem, we need Excel to find out how much to order of each product (bicycles, mopeds and child seats).

b. What are the constraints on these decisions? The constrains here are that the amount of capital and storage used by the products cannot exceed the limited amount of capital and storage (resources) available. For example, each bicycle uses 300 units of capital and 0.5 unit of storage.

c. What is the overall measure of performance for these decisions? The overall measure of performance is the total profit of the three products, so the objective is to maximize this quantity.

2. To make the model easier to understand, create the following named ranges.

Range NameCells
UnitProfitC4:E4
OrderSizeC12:E12
ResourcesUsedG7:G8
ResourcesAvailableI7:I8
TotalProfitI12

3. Insert the following three SUMPRODUCT functions.

Explanation: The amount of capital used equals the sumproduct of the range C7:E7 and OrderSize. The amount of storage used equals the sumproduct of the range C8:E8 and OrderSize. Total Profit equals the sumproduct of UnitProfit and OrderSize.

SimplexLP

Simplex Lp Solver

Trial and Error

With this formulation, it becomes easy to analyze any trial solution.

For example, if we order 20 bicycles, 40 mopeds and 100 child seats, the total amount of resources used does not exceed the amount of resources available. This solution has a total profit of 19000.

It is not necessary to use trial and error. We shall describe next how the Excel Solver can be used to quickly find the optimal solution.

Solve the Model

To find the optimal solution, execute the following steps.

1. On the Data tab, in the Analyze group, click Solver.

Enter the solver parameters (read on). The result should be consistent with the picture below.

You have the choice of typing the range names or clicking on the cells in the spreadsheet.

2. Enter TotalProfit for the Objective.

Simplex Lp1000 Ss

3. Click Max.

SimplexLP

4. Enter OrderSize for the Changing Variable Cells.

5. Click Add to enter the following constraint.

6. Check 'Make Unconstrained Variables Non-Negative' and select 'Simplex LP'.

7. Finally, click Solve.

Result:

The optimal solution:

Conclusion: it is optimal to order 94 bicycles and 54 mopeds. This solution gives the maximum profit of 25600. This solution uses all the resources available.

-->

Defines a basic Solver model. Equivalent to clicking Solver in the Data | Analysis group and then specifying options in the Solver Parameters dialog box.

Note The Solver add-in is not enabled by default. Before you can use this function, you must have the Solver add-in enabled and installed. For information about how to do that, see Using the Solver VBA Functions. After the Solver add-in is installed, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select Solver under Available References. If Solver does not appear under Available References, click Browse, and then open Solver.xlam in the Program FilesMicrosoft OfficeOffice14LibrarySOLVER subfolder.

SolverOk( SetCell, MaxMinVal, ValueOf, ByChange, Engine, EngineDesc)

Go.dorma Kaba/simplex Lp1000

SetCell Optional Variant. Refers to a single cell on the active worksheet. Corresponds to the Set Target Cell box in the Solver Parameters dialog box.MaxMinVal Optional Variant. Corresponds to the Max, Min, and Value options in the Solver Parameters dialog box.

MaxMinValSpecifies
1Maximize
2Minimize
3Match a specific value

ValueOf Optional Variant. If MaxMinVal is 3, you must specify the value to which the target cell is matched.

ByChange Optional Variant. The cell or range of cells that will be changed so that you will obtain the desired result in the target cell. Corresponds to the By Changing Cells box in the Solver Parameters dialog box.

Engine Optional Variant. The Solving method that should be used to solve the problem: 2 for the Simplex LP method, 1 for the GRG Nonlinear method, or 3 for the Evolutionary method. Corresponds to the Select a Solving Method dropdown list in the Solver Parameters dialog box.

EngineDesc Optional Variant. An alternate way to specify the Solving method that should be used to solve the problem as a string: 'Simplex LP', 'GRG Nonlinear', or 'Evolutionary'. Corresponds to the Select a Solving Method dropdown list in the Solver Parameters dialog box.

Example

This example uses the Solver functions to maximize gross profit in a business problem. The SolverOK function defines a problem by specifying the SetCell, MaxMinVal, and ByChange arguments.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.