Solving Linear Programming Problems and Transportation Problems Using Excel Solver
Solving Linear Programming Problems and Transportation Problems Using Excel Solver
International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 134
ISSN 2229-5518
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
Figure 1
IJSER © 2016
http://www.ijser.org
International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 135
ISSN 2229-5518
Figure 4
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
IJSER © 2016
http://www.ijser.org
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
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
Figure 7
IJSER © 2016
http://www.ijser.org
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
Figure 10
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.
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
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:
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
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
International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 139
ISSN 2229-5518
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.
IJSER © 2016
http://www.ijser.org
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
IJSER © 2016
http://www.ijser.org
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
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.
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
International Journal of Scientific & Engineering Research, Volume 7, Issue 9, September-2016 142
ISSN 2229-5518
Figure 20
IJSER
References
IJSER © 2016
http://www.ijser.org