Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
81 views

Solving Linear Programming Problems and Transportation Problems Using Excel Solver

The document describes how to solve linear programming problems and transportation problems using Microsoft Excel Solver. It provides step-by-step instructions for installing Excel Solver and using it to optimize objective functions subject to constraints. Several examples are presented, including maximizing profits given supply and demand constraints. The key steps are setting up the objective function and constraints in a spreadsheet, selecting Solver from the Data menu, specifying the parameters, and clicking Solve to find the optimal solution.

Uploaded by

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

Solving Linear Programming Problems and Transportation Problems Using Excel Solver

The document describes how to solve linear programming problems and transportation problems using Microsoft Excel Solver. It provides step-by-step instructions for installing Excel Solver and using it to optimize objective functions subject to constraints. Several examples are presented, including maximizing profits given supply and demand constraints. The key steps are setting up the objective function and constraints in a spreadsheet, selecting Solver from the Data menu, specifying the parameters, and clicking Solve to find the optimal solution.

Uploaded by

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

lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 134
ISSN 2229-5518

Solving Linear Programming Problems and


Transportation Problems using Excel Solver
Ezeokwelume Obinna Vincent

Abstract- This paper outlines the steps required for installing Excel Solver in Microsoft Word 2010 for use in solving linear programming problems it
provides a step-by-step procedure with snapshots for improved performance. Several questions are solved including transportation problems using
Excel Solver.

Index Terms- Excel Solver, linear programming, maximization, minimization, optimization, profit, transportation problem.

——————————  ——————————

1
INTRODUCTION
THE use of Excel Solver for analysis of operations research
problems is important and useful in present day
technological world. It is difficult to solve linear programming d. Choose “excel solver” and click “Go” and “OK”
problems using the manual method in organizations that solve (figure 3).
problems with over fifty variables. A work that can take days
or weeks to solve could be done in a matter of seconds using e. Close and re-launch Microsoft Excel. Select the “Data”
Excel Solver. Excel Solver has proven to be relevant in other column. You can see “Solver” being displayed (figure
4).

IJSER
disciplines such as finance, production management, etc. in
this paper, I shall present a step-by-step procedure to follow in
the installation and use of Excel Solver for solving linear
programming problems and transportation problems.

2. Literature Review
Linear Programming

I will skip the definition of terms in linear programming and


the assumptions and go straight to problem solving with Excel
Solver. It is believed that the reader has prior knowledge of the
subject matter. If you haven’t installed Excel Solver in your
Microsoft Excel, then follow the steps below:

a. Launch Microsoft Excel.

b. Go to “File” click on it and select “Options” (figure 1).

c. A dialog box will be displayed. Select “Add-Ins”


(figure 2).

Figure 1

Ezeokwelume Obinna Vincent has currently completed his master’s


degree program in operations research in University of Lagos PH-
+2348169489727. E-mail: ezevincoxi@gmail.com

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 135
ISSN 2229-5518

Figure 4

Let’s begin with a simple illustration:


Figure 2
Example 1: Max. z = 20x 1 + 15 x 2

s.t.

IJSER
50x 1 + 35x 2 ≤ 6000
20x 1 + 15x 2 ≥ 2000
x1 ≤ 100
x 2 ≤ 100
x1, x2 ≤ 0

Input your data into Microsoft excel worksheet as you can see
in the figure 5 below. Then add the other items as displayed.

Figure 3

Figure 5

In the total column for maximization (i.e. in D3) input the


following command: B3*$B$10+C3*$C$10. You can either use
upper case or lower case to insert the command. When you are
done, click on D3, place the pointer at the lower right hand tip
of the cell and drag it down to D7. The formulae for the

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 136
ISSN 2229-5518
constraints will be automatically produced. By now, your excel In the objective column, type $D$3. By default, max is selected.
page should look like this: In minimization problems, you change to min. In the next
column, (i.e. “by changing variable cells”) type $b$10:$c$10. To
insert the constraints, select “Add” (figure 8) and input the
following command, the right hand side command on the
“Cell reference” box and the lefthand side command on the
“Constraint” box. Then select “OK.”

$B$10:$C$10≥0
$D$4:$D$7≤$F$4:$F$7

Figure 6

You can see the formula on D3 cell being displayed in the


formula bar. The formulae for D4 to D7 are:

D4 =b4*$b$10+c4*$c$10 Figure 8
D5 =b5*$b$10+c5*$c$10
This is how the Solver Parameter should look like after
D6 =b6*$b$10+c6*$c$10 inputing the instructions above:
D7 =b7*$b$10+c7*$c$10

IJSER
You can as well insert them one after the other if it’s more
convenient.

In cell D10, type “=D3”. Now that your data is ready, you
solve the linear programming problem using Excel Solver.
Click on Data on the menu bar and select Solver.

Figure 9

Then click on “Solve”. The values of x 1 , x 2 and the objective


function are: 64, 48 and 2000 respectively. The model and the
solution are shown below:

Figure 7

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 137
ISSN 2229-5518
Exercise 2: Max z= 5x 1 + 4x 2

s.t.

6x 1 + 4x 2 ≤ 24
x 1 + 2x 2 ≤ 6
-x 1 +x 2 ≤ 1
x2 ≤ 2
x1, x2≤ 0

The question and solution to the problem in the excel


worksheet is given below:

Figure 10

Here is a question for you to practice. Remember to follow the


step by step procedure I laid out for you above.

Exercise 1: Min z= 0.3x 1 + 0.9x 2

s.t.

x 1 + x 2 ≥ 800
0.21x 1 -0.3x 2 ≥ 0
0.03x 1 -0.1x 2 ≥ 0

IJSER
x1, x2 ≥ 0 Figure 12

The question and solution should look like this: Now, let’s solve a real life problem by first formulating the
model.

Example 2: Reddy Mikks produces both interior and exterior


painnts from two raw materials, M1 and M2. The following
table provides the basic data of the problem:

The Reddy Mikks Company

Tons of raw material per tons Maximum


of daily
available
Exterior Interior (tons)
paint paint

Raw 6 4 24
material M1

Figure 11
Raw 1 2 6
material M2
The non-negativity added is insignificant since it is already
included as one of the variables. Did you get the result right? It
Profit per 5 4
is very interesting. More exercises will help you master how to
ton ($1000)
solve linear programming problems using Excel Solver with
ease.
Table 1
Now, try this question:
A market survey indicates that the daily demand for interior
paint cannot exceed that for exterior piant by more than 1 ton.

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 138
ISSN 2229-5518
Also, the maximum daily demand for interior paint is 2 tons. Fraction of day body shop works on trucks = 1/ 60 x 2
Reddy Mikks wants to determine the optimum (best) product
mix of interior and exterior paints that maximizes the total Fraction of day body shop works on trucks = 1/ 50 x 1
daily profit [Taha (2011), p.47].
Fraction of day body shop works on cars = 1/ 50 x 2
Let x 1 represent the number of tons of exterior paints produced
and x 2 the number of interior paints produced. Hence, the constraints are:

Maximize z = 5x 1 + 4x 2 (in $1000) / x 1 + 1/ 60 x 2 ≤ 1 (Paint shop constraint)


1 40

/ x 1 + 1/ 50 x 2 ≤ 1 (Body shop constraint)


1 50

s.t.
The model for the problem is:
6x 1 + 4x 2 ≤ 24 (M1)
x 1 + 2x 2 ≤ 6 (M2) Max z = 3x 1 + 2x 2
-x 1 + x 2 ≤ 1 (Market limit)
s.t.
x 2 ≤ 2 (Maximum daily demand)
x1, x2 ≥ 0 / x 1 + 1/ 60 x 2 ≤ 1
1 40

/ x 1 + 1/ 50 x 2 ≤ 1
1 50
The solution to the problem is given in figure 13 below.
x1, x2 ≥ 0

Insert the model into a Microsoft Excel worksheet and solve.

TRANSPORTATION PROBLEM

IJSER
Transportation problems can be solved using Excel Solver.
What is required is to change the problem into a linear
programming problem and solve it as a minimization problem
following the same procedure as explained above. Before you
proceed, you may need to study transportation problem first
for better understanding.

Excel Solver and TORA can be used for solving different forms
Figure 13 of transportation problem. Excel Solver can only compute the
least transportation cost without giving credence to its
Now, try this exercise. computation using three methods: Least Cost Method, North
West Corner Method and Vogel Approximation; which are
Exercise 3: An auto company manufactures cars and trucks. exemplified by TORA. This is made possible because the
Each vehicle must be processed in the paint shop and body problem is first changed to a LP problem and solved using the
assembly shop. If the paint shop were only painting trucks, simplex method. According to Taha (2011),” TORA handles all
then 40 per day could be painted. If the body shop were only necessary computations in the background using the simplex
producing cars, then it could process 50 per day. Each truck method and uses the transportation model format only as a
contributes $300 to profit, and each car contributes $200 to screen ‘veneer’”. The two methods, however, do not solve
profit. Use linear programming to determine a daily transportation problems using the MODI method.
production schedule that will maximize the company’s profit
(Winston, 2004).

Solution: Let x 1 and x 2 represent the number of trucks and cars Example 1: MG Auto has three plants in Los Angeles, Detroit,
produced respectively. and New Orleans, and two major distribution centers in
Denver and Miami. The quarterly capacities of the three plants
Fraction of day paint shop works on trucks = (fraction of are 1000, 1500, and 1200 cars, and the demands at the two
day/truck) * (trucks/day) distribution centers for the same period for the same period are
2300 and 1400 cars [Taha (2011), p.209].
= 1/ 40 x 1

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 139
ISSN 2229-5518

Denver Miami Supply

Los Angeles 80 215 1000

Detroit 100 108 1500

New Orleans 102 68 1200

Demand 2300 1400


This problem can be changed to a linear programming
problem as follows:

Minimize Z= 80x 11 + 215x 12 + 100x 21 + 108x 22 + 102x 31


+ 68x 32
Subject to:
x 11 + x 12 ≥ 1000 (Los Angeles)
x 21 + x 22 ≥ 1500 (Detroit)
x 31 + x 32 ≥ 1200 (New Orleans)
x 11 + x 21 + x 31 ≥ 2300 (Denver) Figure 15
x 12 + x 22 + x 32 ≥ 1400 (Miami)
Click on “Solve” when you have supplied the values. Your
result will show in the worksheet as you can see in figure 16

IJSER
Insert the model into an excel worksheet. This is what you
below.
should have:

Figure 14
Figure 16
H4 was highlighted. Insert the formula for H4 and drag it
down to H9. Then in cell H12 type “ =H4”. Then go to Solver The result shows that 1000 units of the product should be
Parameter to solve the problem. With the help of the examples shipped to Denver from Los Angeles, 1300 units from Detriot
above, the Solver Parameter for this question should look like
to Denver, 200 units from Detroit to Miami and 1200 units
this:
from New Orleans to Miami to minimize cost.

Excel Solver only features the least cost method thus it cannot
solve the question using North-West Corner Method or Vogel
Approximation method. However, TORA software features all
three methods.

Below is a transportation question you can solve and the


solution there in.

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 140
ISSN 2229-5518
Exercise 1: Powerco has three electric power plants that supply
the needs of four cities. Each power plant can supply the
following numbers of kilwatt-hours (kwh) of electricity: plant Table 2
1-35million; plant 2-50 million; plant 3-40 million. The peak
power demands in these cities, which occur at the same time Xij= number of (million) kwh produced at plant i and sent to
(2p.m.), are as follows (in kwh): city 1-45 million; city 2-20 city j (where i=1,2,3 and j=1,2,3,4)
million; city 3-30 million; city 4-30 million. The costs of sending
Max z= 8x 11 + 6x 12 + 10x 13 + 9x 14 + 9x 21 + 12x 22 + 13x 23 + 7x 24 +
1 million kwh of electricity from plant to city depend on the
14x 31 + 9x 32 + 16x 33 + 5x 34
distance the electricity must travel. The cost of shipping is
shown in the table 1 below. Formulate an LP to minimize the Subject to:
cost of meeting each city’s peak power demand (Winston,
2004, p.360). Supply constraints: x 11 + x 12 + x 13 + x 14 ≤ 35
x 21 + x 22 + x 23 + x 24 ≤ 50
x 31 + x 32 + x 33 + x 34 ≤ 40
To
Demand constraints: x 11 + x 21 + x 31 ≤ 45
From City 1 City 2 City 3 City 4 x 12 + x 22 + x 32 ≤ 20
x 13 + x 23 + x 33 ≤ 30
Plant 1 $8 $6 $10 $9
x 14 + x 24 + x 34 ≤ 30
Plant 2 $9 $12 $13 $7 Insert the model into an excel worksheet. Then go to the
“solver parameter” and input the required command as shown
Plant 3 $14 $9 $16 $5
in figure 4 below.

IJSER
Table 1

Solution

The shipping cost, supply and demand for power is shown in


table 2 below.

Shipping costs, supply and Demand for Power


To
Supply
City City City (million
Figure
From City1 2 3 4 kwh)
4
Plant 1 8 6 10 9 35
The
Plant 2 9 12 13 7 50
model
and Plant 3 14 9 16 5 40
solutio Demand 45 20 30 30
n to
(million kwh)

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 141
ISSN 2229-5518
the problem are shown in table 5 below. Fill in the information as shown in figure below. To fill in the
range names to cells, select the appropriate cell and right click.

Figure 5

The formula for cell N9 is shown on the formula box. Always


check your input to confirm it is right before solving the
model. Optimal solution to this LP is z= 1020, x 12 =10, x 13 =25,
x 21 =45, x 23 =5, x 32 =10, x 34 =30.

This method of computation involves the generation of


variables that make the calculations cumbersome as the Figure 18
demand and supply centers increase.
Double-click on any cell. Select “define name” and a dialog

IJSER
Let’s try a different method for solving transportation box like the one in figure 19 appears. Fill in the necessary
problem below: details as shown on the range items in table below.

Example 2: SunRay Transport Company ships truckloads of


grain from three silos to four mills. The supply (in truckloads)
and the demand (also in truckloads) together with the unit
transportation costs per truckload on the different routes are
summarized in table . the unit transportation costs (shown in
the northeast cortner of each box) are in hundreds of dollars.
The model seeks the minimum-cost shipping schedule
between the silos and the mills.

Figure 19
SunRay Transportation Model
Open the Excel Solver and insert the information in the
appropriate order as shown in figure 20 below.
Mill

1 2 3 4 Supply

1 10 2 20 11 15

Silo 2 12 7 9 20 25

3 4 14 16 18 10

Demand 5 15 15 15

Table 3

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)


lOMoARcPSD|23416644

International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 142
ISSN 2229-5518

Figure 20

Click on Solve. The solution to the problem is displayed in the


worksheet as you can see below in figure 21.

IJSER
References

[1] Taha, H. A. (2011). Operations research: An introduction. 9th


Ed. Pearson: New Jersey

[2] Winston, W. L. (2004). Operations research: Applications


and algorithms (4th ed.) Brooks: Canada

IJSER © 2016
http://www.ijser.org

Downloaded by Amr Hemdan (amrehemdan@gmail.com)

You might also like