0% found this document useful (0 votes)
23 views9 pages

Excel Solver for Optimization Problems

This document discusses using Excel Solver to solve optimization problems. It provides two examples: a linear investment allocation problem and a nonlinear network flow problem involving hazardous material transportation. For each problem, it formulates the mathematical model, translates it into a spreadsheet, and uses Solver to find the optimal solution. The linear problem involves allocating funds across five bonds to maximize return while meeting constraints. The nonlinear problem involves finding the lowest risk route to transport hazardous materials from Los Angeles to Amarillo. Excel Solver allows solving both types of optimization problems through spreadsheet modeling in a simple way.

Uploaded by

Chandrabali Saha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views9 pages

Excel Solver for Optimization Problems

This document discusses using Excel Solver to solve optimization problems. It provides two examples: a linear investment allocation problem and a nonlinear network flow problem involving hazardous material transportation. For each problem, it formulates the mathematical model, translates it into a spreadsheet, and uses Solver to find the optimal solution. The linear problem involves allocating funds across five bonds to maximize return while meeting constraints. The nonlinear problem involves finding the lowest risk route to transport hazardous materials from Los Angeles to Amarillo. Excel Solver allows solving both types of optimization problems through spreadsheet modeling in a simple way.

Uploaded by

Chandrabali Saha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

See discussions, stats, and author profiles for this publication at: [Link]

net/publication/267557388

USING EXCEL SOLVER IN OPTIMIZATION PROBLEMS

Article · November 2014

CITATIONS READS
13 14,783

1 author:

Leslie Chandrakantha
City University of New York - John Jay College of Criminal Justice
27 PUBLICATIONS   34 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Leslie Chandrakantha on 18 December 2014.

The user has requested enhancement of the downloaded file.


USING EXCEL SOLVER IN OPTIMIZATION PROBLEMS

Leslie Chandrakantha
John Jay College of Criminal Justice of CUNY
Mathematics and Computer Science Department
445 West 59th Street, New York, NY 10019
lchandra@[Link]

Abstract
We illustrate the use of spreadsheet modeling and Excel Solver in solving linear and
nonlinear programming problems in an introductory Operations Research course. This is
especially useful for interdisciplinary courses involving optimization problems. We work
through examples from different areas such as manufacturing, transportation, financial
planning, and scheduling to demonstrate the use of Solver.

Introduction
Optimization problems are real world problems we encounter in many areas such as
mathematics, engineering, science, business and economics. In these problems, we find
the optimal, or most efficient, way of using limited resources to achieve the objective of
the situation. This may be maximizing the profit, minimizing the cost, minimizing the
total distance travelled or minimizing the total time to complete a project. For the given
problem, we formulate a mathematical description called a mathematical model to
represent the situation. The model consists of following components:

• Decision variables: The decisions of the problem are represented using symbols
such as X1, X2, X3,…..Xn. These variables represent unknown quantities (number
of items to produce, amounts of money to invest in and so on).
• Objective function: The objective of the problem is expressed as a mathematical
expression in decision variables. The objective may be maximizing the profit,
minimizing the cost, distance, time, etc.,
• Constraints: The limitations or requirements of the problem are expressed as
inequalities or equations in decision variables.

If the model consists of a linear objective function and linear constraints in decision
variables, it is called a linear programming model. A nonlinear programming model
consists of a nonlinear objective function and nonlinear constraints. Linear programming
is a technique used to solve models with linear objective function and linear constraints.
The Simplex Algorithm developed by Dantzig (1963) is used to solve linear programming
problems. This technique can be used to solve problems in two or higher dimensions.

42
In this paper we show how to use spreadsheet modeling and Excel Solver for solving
linear and nonlinear programming problems.

Spreadsheet Modeling and Excel Solver


A mathematical model implemented in a spreadsheet is called a spreadsheet model.
Major spreadsheet packages come with a built-in optimization tool called Solver. Now
we demonstrate how to use Excel spreadsheet modeling and Solver to find the optimal
solution of optimization problems.

If the model has two variables, the graphical method can be used to solve the model.
Very few real world problems involve only two variables. For problems with more than
two variables, we need to use complex techniques and tedious calculations to find the
optimal solution. The spreadsheet and solver approach makes solving optimization
problems a fairly simple task and it is more useful for students who do not have strong
mathematics background.

The first step is to organize the spreadsheet to represent the model. We use separate
cells to represent decision variables, create a formula in a cell to represent the objective
function and create a formula in a cell for each constraint left hand side. Once the
model is implemented in a spreadsheet, next step is to use the Solver to find the
solution. In the Solver, we need to identify the locations (cells) of objective function,
decision variables, nature of the objective function (maximize/minimize) and
constraints.

Example One (Linear model): Investment Problem


Our first example illustrates how to allocate money to different bonds to maximize the
total return (Ragsdale 2011, p. 121).
A trust office at the Blacksburg National Bank needs to determine how to invest
$100,000 in following collection of bonds to maximize the annual return.
Bond Annual Maturity Risk Tax-Free
Return
A 9.5% Long High Yes
B 8.0% Short Low Yes
C 9.0% Long Low No
D 9.0% Long High Yes
E 9.0% Short High No
The officer wants to invest at least 50% of the money in short term issues and no more
than 50% in high-risk issues. At least 30% of the funds should go in tax-free investments,
and at least 40% of the total return should be tax free.

Creating the Linear Programming model to represent the problem:


Decision variables are the amounts of money should be invested in each bond.
X1 = Amount of money to invest in Bond A

43
X2 = Amount of money to invest in Bond B
X3 = Amount of money to invest in Bond C
X4 = Amount of money to invest in Bond D
X5 = Amount of money to invest in Bond E

Objective Function:
Objective is to maximize the total annual return.
Maximize f(X1, X2, X3, X4, X5) = 9.5%X1 + 8%X2 + 9%X3 + 9%X4 + 9%X5

Constraints:
Total investment:
X1 + X2 + X3 + X4 + X5 = 100,000.
At least 50% of the money goes to short term issues:
X2 + X5 >= 50,000.
No more than 50% of the money should go to high risk issues:
X1 + X4 + X5 <= 50,000.
At least 30% of the money should go to tax free investments:
X1 + X2 + X4 >= 30,000.
At least 40% of the total annual return should be tax free:
9.5%X1 + 8%X2 + 9%X4 >= 40%(9.5%X1 + 8%X2 + 9%X3 + 9%X4 + 9%X5)
Nonnegativity constraints (all the variables should be nonnegative):
X1, X2, X3, X4, X5 >= 0.

Complete linear programming model:


Max: .095X1 + .08X2 + .09X3 +.09X4 + .09X5

Subject to:
X1 + X2 + X3 + X4 + X5 = 100,000.
X2 + X5 >= 50,000.
X1 + X4 + X5 <= 50,000.
X1 + X2 + X4 >= 30,000.
9.5%X1 + 8%X2 + 9%X4 >= 40%(9.5%X1 + 8%X2 + 9%X3 + 9%X4 + 9%X5)
X1, X2, X3, X4, X5 >= 0.

Spreadsheet model and Solver implementation:


Implementing the problem in an Excel spreadsheet and Solver formulation produces the
following spreadsheet and Solver parameters. The cells B6 through B10 represent the
five decision variables. The cell C13 represents the objective function. The cells B11,
E11, G11, I11, B14, and B15 represent the constraint left hand sides. The nonnegativity
constraint is not implemented in the spreadsheet and it can be implemented in the
Solver. The complete set of constraints, target cell (objective function cell), variable cells
(changing cells) and whether to maximize or minimize the objective function are
identified in the Solver parameters box.

44
Figure 1: Spreadsheet implementation of example one

Figure 2: Solver implementation of example one

Figure 3: Spreadsheet with optimal solution of example one

45
Optimal money allocation:
Amount invested in Bond A = X1 = $20, 339.
Amount invested in Bond B = X2 = $20, 339.
Amount invested in Bond C = X3 = $29, 661.
Amount invested in Bond D = X4 = $0.
Amount invested in Bond E = X5 = $29, 661.

The Maximum annual return is $8,898.00

Example Two (Nonlinear model): Network Flow Problem


This example illustrates how to find the optimal path to transport hazardous material (
Ragsdale, 2011, p.367)
Safety Trans is a trucking company that specializes transporting extremely valuable and
extremely hazardous materials. Due to the nature of the business, the company places
great importance on maintaining a clean driving safety record. This not only helps keep
their reputation up but also helps keep their insurance premium down. The company is
also conscious of the fact that when carrying hazardous materials, the environmental
consequences of even a minor accident could be disastrous.
Safety Trans likes to ensure that it selects routes that are least likely to result in an
accident. The company is currently trying to identify the safest routes for carrying a load
of hazardous materials from Los Angeles to Amarillo, Texas. The following network
summarizes the routes under consideration. The numbers on each arc represent the
probability of having an accident on each potential leg of the journey.

Flagstaff Albuquerque
0.006 0.001
Las Vegas
6 8 0.001
2
0.003 Amarillo
Los Angeles
0.010 0.006
10
1 0.002 0.010 0.004
0.006
0.009
4
0.004 0.002 0.005
0.002
Phoenix 9
3
5 7
0.003 Lubbock
San Diego 0.010 0.003
Tucson
Las Cruces
Figure 4: Network diagram of example two

46
The objective is to find the route that minimizes the probability of having an accident, or
equivalently, the route that maximizes the probability of not having an accident.

Creating the mathematical model to represent the problem:


Each decision variable indicates whether or not a particular route is taken (they are
known as binary variables). We will define these variables in following way:
Xij = 1 , if the route from node i to node j is selected, and Xij = 0 otherwise.
Let Pij be the probability of having an accident while travelling from node i to node j
(1- Pij is the probability of not having an accident).

Objective function:
Minimize the probability of having an accident or equivalently, maximize the probability
of not having an accident. Note that this objective function is nonlinear.

Maximize f(X12, X13,….) = (1-P12*X12) (1-P13*X13) (1 – P14*X14) (1 – P24*X24) ………. (1 -


P9.10*X9,10)

Constraints:
We use the following strategy to construct constraints: That is, supply one unit at the
starting node and demand one unit at the ending node, and for every other node,
demand or supply is zero. We find the route in which the one unit travels.
Total supply = 1, and total demand = 1, so for each node,
Net flow (Inflow – Outflow) = demand or supply for that node (Balance of flow rule).
Then we have following set of constraints:
Node 1: - X12 – X13 – X14 = -1
Node 2: + X12 – X24 – X26 = 0
Node 3: + X13 – X34 – X35 = 0
Node 4: + X14 + X24 + X34 – X45 – X46 – X48 = 0
Node 5: + X35 + X45 – X57 = 0
Node 6: + X26 + X46 - X67 – X68 = 0
Node 7: + X57 + X67 – X78 – X7,10 = 0
Node 8: + X48 + X68 + X78 – X8,10 = 0
Node 9: + X79 – X9,10 = 0
Node 10: + X7,10 + X8,10 + X 9,10 = 1

Complete nonlinear Programming model:


Maximize: (1-P12*X12) (1-P13*X13) (1 – P14*X14) (1 – P24*X24) ………. (1-P9.10*X9,10)

Subject to:
- X12 – X13 – X14 = -1
+ X12 – X24 – X26 = 0
+ X13 – X34 – X35 = 0

47
+ X14 + X24 + X34 – X45 – X46 – X48 = 0
+ X35 + X45 – X57 = 0
+ X26 + X46 - X67 – X68 = 0
+ X57 + X67 – X78 – X7,10 = 0
+ X48 + X68 + X78 – X8,10 = 0
+ X79 – X9,10 = 0
+ X7,10 + X8,10 + X 9,10 = 1

All Xij are binary.

Spreadsheet model and Solver implementation:

Figure 5: Spreadsheet implementation of example Two

Figure 6: Solver implementation of example two

48
Figure 7: Spreadsheet with optimal solution of example two

The optimal path:


The route that minimizes the probability of having an accident is given below:

Los Angeles to Phoenix


Phoenix to Flagstaff
Flagstaff to Albuquerque
Albuquerque to Amarillo.

Conclusion:
Optimization problems in many fields can be modeled and solved using Excel Solver. It
does not require knowledge of complex mathematical concepts behind the solution
algorithms. This way is particularly helpful for students who are non math majors and
still want to take theses courses.

References:
1) Cliff T. Ragsdale, 2011, Spreadsheet Modeling and Decision Analysis, 6th Edition.
SOUTH-WESTERN, Cengage Learning.
2) Dantzig, G. B. 1963, Linear Programming and Extensions, Princeton University
Press, Princeton, NJ.
3) John Walkenbach, 2007, Excel 2007 Formulas, John Wiley and Sons.

49

Common questions

Powered by AI

The nonnegativity constraint in linear programming models ensures that the decision variables, such as investment amounts or quantities of goods, are not negative. This is significant as it reflects real-world conditions where negative values are not feasible, like investing a negative amount of money or producing a negative quantity of goods. This constraint is fundamental in maintaining the model's realism and ensuring practical, actionable solutions .

The constraints that must be considered in the investment problem's linear programming model include: (1) the total investment across all bonds must equal $100,000; (2) at least 50% of the money must be allocated to short-term issues; (3) no more than 50% of the investment should be in high-risk bonds; (4) at least 30% of the funds must go into tax-free investments; and (5) 40% or more of the total annual return should be tax-free. These constraints, when combined with the nonnegativity constraints ensuring no negative investments, form the linear programming model's structure .

Setting up an optimization model in a spreadsheet for Excel Solver involves several steps: firstly, decision variables are assigned in separate cells; secondly, the objective function is formulated in another cell using those decision variables; thirdly, constraints are represented by formulating expressions in additional cells. The Solver tool is then configured to use these components by indicating the target cell for the objective function, the changing cells for decision variables, and setting the nature of the objective (maximize or minimize) as well as specifying the constraints .

Using binary variables in network flow problems increases the complexity because each variable represents whether or not a specific route is selected, which introduces non-linearity to the optimization model, as seen in the Safety Trans example. This necessitates advanced problem-solving techniques and increases computational demands due to the need to find an optimal combination of binary decisions across possible routes that minimize accident probability, thereby complicating the Solver's task beyond simple linear programming .

To ensure a robust Excel Solver model, strategies such as thorough validation of input data, clear and accurate formulation of constraints and objective functions, sensitivity analyses to understand the impact of variable changes, and scenario modeling to account for potential uncertainties can be employed. Additionally, iteratively refining the model by incorporating feedback and testing it against known benchmarks can enhance its reliability and effectiveness in solving optimization problems .

Real-world constraints can complicate the formulation of a linear programming model in Excel Solver due to their potential complexity and interdependencies. Constraints must accurately reflect real-world limitations, such as budgetary, time, or resource restrictions, which might involve nonlinear relationships or conditional logic not easily represented in linear terms. Accurately capturing these nuances in the Solver's framework requires thoughtful modeling, often necessitating simplifications or assumptions that might affect the model's accuracy and feasibility .

Spreadsheet modeling with Excel Solver benefits students, especially those not majoring in mathematics, by providing a practical, user-friendly interface to apply mathematical and operations research concepts without requiring deep mathematical understanding. It simplifies complex calculations and model formulations, making the process accessible and engaging through visual tools and straightforward manipulation, which supports learning in an applied context across various disciplines .

The Simplex Algorithm is a method used to solve linear programming problems by iteratively moving along the edges of the feasible region to find the optimal vertex (or corner point). While Excel Solver doesn't explicitly require the user to implement the Simplex Algorithm manually, it operates on a similar underlying principle when solving linear models. Solver analyzes potential solutions within the feasible region, using algorithms akin to the Simplex method, to find the optimal solution as dictated by the objective function and constraints .

Excel Solver can be utilized to solve both linear and nonlinear optimization problems, which are prevalent in Operations Research, by creating a spreadsheet model that includes decision variables, an objective function, and constraints. Solver is then used to optimize the objective function, such as maximizing profit or minimizing cost, while adhering to the constraints set forth in the model. This approach is effective for educational purposes, especially for students without strong mathematical backgrounds, as it simplifies complex mathematical processes by leveraging spreadsheet functionalities .

In an optimization problem, the objective function defines the goal to be achieved, such as maximizing profit or minimizing cost. In an Excel Solver setting, the objective function is represented as a formula in one of the spreadsheet cells and is the target of the Solver's optimization process. Solver uses this function to assess different scenarios by altering decision variable values within defined constraints, seeking the optimal solution that meets the objective function specifications .

You might also like