Chapter 1 Linear Programming
Chapter 1 Linear Programming
Chapter 1
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-1/44
Learning Objectives
The aims of this chapter are:
• To introduce the different mathematical statements of a Linear Programming problem and the
transformation rules to pass from one statement to another;
• To introduce some basic algebraical and geometrical notions used in Linear Programming;
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-2/44
Learning Outcomes
By the end of this chapter, you should:
• Understand the basic concepts on the formulation of a Linear Programming model from the state-
ment of the problem;
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-3/44
Outline
♦ What’s a Linear Programming problem?
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-4/44
What’s a Linear Programming Problem?
Definition 1. A Linear Programming (LP) problem consists of an optimisation problem involving
a linear function to be optimised subject to linear equality and/or inequality constraints.
Example 1.
A developer can build and sell two types of house: type A and type B. A house of type
A requires 10, 000 bricks, 4 doors and 5 windows, whereas a house of type B requires
8, 000 bricks, 2 doors and 10 windows. A house of type A can be sold for £200, 000 and
a house of type B can be sold for £250, 000. The developer has 168, 000 bricks, 60 doors
and 150 windows.
How many houses of each type should this developer build if he wants to maximise the
total selling price?
Objective: Maximise the total selling price z = £200, 000 × x1 + £250, 000 × x2.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-5/44
Constraints:
• Bricks: (10, 000 × x1) bricks + (8, 000 × x2) bricks ≤ 168, 000 bricks.
• Doors: (4 × x1) doors + (2 × x2) doors ≤ 60 doors.
• Windows: (5 × x1) windows + (10 × x2) windows ≤ 150 windows.
• Positivity: x1 ≥ 0 and x2 ≥ 0.
The variables x1 and x2 are called decision variables of the model, the function to be
maximised (z) is called the objective function of the model and the inequalities in the
model are referred to as the constraints of the model.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-6/44
Applications of Linear Programming
• Manufacturing, Design;
• Transportation, Routing;
• Planning, Scheduling, Assignement, Restructuring;
• Distribution networks;
• Financial portfolios;
One of the main challenges in linear programming lies in the formulation of the problem:
translating the problem statement into a system of linear equations and/or inequations to
be solved (i.e. the mathematical model). The information required to write the model is
derived from the problem statement and therefore depends on the problem in question.
Here are some guidelines to follow when formulating a model from a Linear Programming
problem statement:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-7/44
1. Identify the objective to be achieved in the problem, i.e., which quantity is to be
optimised. For example, one may seek to maximise profit or to minimise the cost,
etc...
2. Identify the decision variables and the constraints on them. For example, produc-
tion quantities and production limits may serve as decision variables and constraints,
respectively.
3. Write the objective function and constraints in terms of the decision variables, by using
information from the problem statement to determine the proper coefficient for each
term. Discard any unnecessary and redundant information and make sure that each
variable in the objective function appears at least once in the constraints.
4. Add any implicit constraints, such as non-negative restrictions. For example, if there are
physical quantities that must be non-negative, then these constraints must be included
in the formulation.
5. Arrange the system of equations and/or inequations in a consistent form suitable for
solving. For example, place all variables on the left hand side of their equations or
inequations and list them in the order of their subscripts.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-8/44
Linear Programming assumptions
Linear programming requires linearity in the constraints and the objective function, i.e.,
each decision variable is multiplied by a constant coefficient. Linearity requires the follow-
ing assumptions:
Additionally, linear programming assumes certainty, i.e., all the coefficients are known and
constant.
Remark 1.When the divisibility assumption does not hold, one resorts to Integer Programming
techniques to solve the problem.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-9/44
Mathematical statements of a LP
General structure of a LP
Pn
Optimise z = j=1 cj xj
Pn
subject to j=1 aij xj ≤ bi , i ∈ I ⊆ {1, . . . , m};
Pn
j=1 akj xj ≥ bk , k ∈ K ⊆ {1, . . . , m};
Pn
j=1 arj xj = br , r ∈ R ⊆ {1, . . . , m};
lj ≤ xj ≤ uj , j = 1, . . . , n.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-10/44
Terminologies
Canonical form of a LP
Pn
Max z = j=1 cj xj
Pn
s.t. j=1 aij xj ≤ bi, i = 1, . . . , m;
xj ≥ 0, j = 1, . . . , n.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-11/44
Standard form of a LP
Pn
Max z = j=1 cj xj
Pn
s.t. j=1 aij xj = bi, i = 1, . . . , m;
xj ≥ 0, j = 1, . . . , n.
The standard form of a LP can be obtained from the canonical one by adding a positive
slack variable xn+i to the left hand side term of each constraint i:
Xn Xn
aij xj ≤ bi −→ aij xj + xn+i = bi.
j=1 j=1
xj ≥ 0, j = 1, . . . , n + m.
Max z = cx
s.t. Ax ≤ b,
x ≥ 0n ,
a11 · · · a1n x1 b1
with A = .. . . . .. , x = .. , b = .. with c = c1 · · · cn .
am1 · · · amn xn bm
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-13/44
Transformation rules
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-14/44
Some definitions and terminologies in Linear Programming
Algebraical considerations
Definition 2.
Solution: Any n-uplet (x1, x2, . . . , xn) which satisfies the following constraints of a LP
X n
aij xj = bi, i = 1, 2, . . . , m
j=1
Definition 3.
Basis: A basis is any set of m variables chosen from x1, x2, . . . , xn such that the determinant of
the corresponding coefficients aij is non null. In other words the column vectors in the matrix A,
associated to the m variables form a basis of Rm.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-15/44
Definition 4.
Basic solution: A basic solution is any solution which consists of n − m variables equal to zero and
such that the other m variables form a basis of Rm. In a basic solution, the variables which are
set equal to zero are referred to as non-basic variables and the other variables, forming the basis, are
called basic variables.
Basic feasible solution: A basic solution which is feasible is called a basic feasible solution.
Optimal solution: Any feasible solution which optimises (i.e., maximises or minimises) the objective
function
X n
z= c j xj
j=1
is called an optimal solution.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-16/44
Geometrical considerations
Definition 5. The set of feasible solutions of a linear programming problem is called the feasible
region of this problem.
Definition 6. A non empty set is a convex set if for any couple of points k1, k2 of this set and for
any λ ∈ (0, 1), we have λk1 + (1 − λ)k2 is also a point of this set.
Theorem 1. In the space of decision variables, the feasible region of a LP is a convex set which is
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-17/44
Proposition 1. Any basic feasible solution of a LP corresponds to an extreme point of the feasible
region of this LP.
Theorem 2. If a LP has at least one finite optimal solution, then there exists at least an optimal
solution which is an extreme point of its feasible region.
x1 + x2 ≤ 5
x1 + x2 ≥ 3
2x + x ≤ 8
1 2 −3x1 + 2x2
≤ 6
(S1) = (S2) =
x1 ≥ 0
x1 ≥ 0
x2 ≥ 0 ≥ 0
x2
The region described by the systems (S1) and (S2) are given by the closed polyhedrons
colored in gray in the following figures.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-18/44
x2 x2
8 8
6
=
2
2x
2x 1
+
+x
x1
−3
2
=8
x1
+
x2
4 4
=
5
x1
+
x2
=
3
0 2 4 6 x1 0 2 4 6 8 x1
The system (S1) describes a bounded polyhedron, i.e a polytope. The system (S2) describes an unbounded polyhedron.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-19/44
Solving a Linear Programming problem
There exist various methods which can be used to solve a LP. The most classical of them
are:
• Graphical method: This method is usable only if the problem consists of two (or three)
variables.
• Counting basic solutions’ method: This method is not suitable for practical problem since
it is too long to implement!
• Simplex method: This method enables to check if a LP has at least one feasible solution
and if yes, it provides an optimal solution of the LP after a finite number of iteration.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-20/44
Results of a linear optimisation
3. The LP is infeasible i.e. it has no feasible solutions (the feasible region is an empty set).
4. The LP is unbounded, i.e., in the feasible region there are points with arbitrarily large
(in the case of maximisation type problem) values of the objective function.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-21/44
Graphical resolution
Example 3. Consider the following LP:
x2
14
z=
Max z= x1 + 3x2 x1 +
3x2
= 30
s.t. x1 + x2 ≤ 14
−2x1 + 3x2 ≤ 12 8 b
2x1 − x2 ≤ 12
x1 , x2 ≥ 0 z=
x
b
1 + 3x
=2 4
x1
b
2
Dire
+
ction Feasible region
x2
in w
hich
=
z inc
14
In this case, the feasible region is a convex polytope. In reas es
this region, we are looking for a point (or some points) −6
b
0
b
6 14 x1
12
that the coordinates maximise z. All the straight lines 3x 2
=
+
of equation x1 + 3x2 = constant are parallel and two −2
x 1
2
=1
of them are plotted when the constant is equal to 2
2
+x
and 30, respectively. The optimal solution for this LP
1
2x
is unique and corresponds to the extreme point of the
feasible region with coordinates (6, 8) for which z = 30.
Therefore, x1 = 6, x2 = 8 and z = 30.
−12
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-22/44
Example 4. Consider the following LP:
x2
Min z = x2 − x1
s.t. 2x1 − x2 ≥ −2
2
=−
s
=
= ease
x1 − x2 ≤ 2
1
x
cr
2 −
1
2
de
−x
+ ≤ 5
−
x1 x2
z
=
= hich
1
1
x1 , x2 ≥ 0
x
z
2x
2 −
w
in
x
n
4
io
b
z
ct
re
In this example, the feasible region is also a con-
Di
vex polytope. In this region, we are looking for a
2 b
x1
b b
2A
+
straight lines representing the objective function 0 4 x1
x2
=
and the constraint x1 − x2 = 2 are parallel. The
5
optimal solutions for this LP are: the extreme
points A(2, 0) and B(3.5, 1.5) and all the points
2
=
on the segment (A, B). Hence we have an infinite
x2
−
number of optimal solutions. The corresponding
x1
value of z for all these solutions is z = −2.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-23/44
Example 5. Consider the following LP:
x2
x1
x1 = 4
+
s.t. x1 + x2 ≥ 6
x2
z= Di
=
5x rec
6
x1 ≥ 4 1 + ti on
7x in
x2 ≤ 3 6 2 = wh
50 i ch
x1 , x2 ≥ 0 zi
nc
rea
4 ses
x2 = 3 b
0 2 4 6 x1
the points (x1 = +∞, x2 ≤ 3), therefore z is infinite.
z=
5x
1 +
7x
2 =
21
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-24/44
Example 6. Consider the following LP:
x2
Min z = x2 − x1
2
s.t. 2x1 − x2 ≥ −2
=−
x1 − 2x2 ≤ −8
2
−x
x1 + x2 ≤ 5 8
=−
1
2x
2x 2
x1 , x2 ≥ 0 x1
−
6
x1
2
+
x2
=
−2x1 + x2 ≤ 2
5
x1 − 2x2 ≤ −8 0 2 4 6 x1
x1 + x2 ≤ 5
0 ≤ −1
This is absurd!
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-25/44
The Simplex method
When the feasible region is a convex polyhedron, the optimal solutions occurs at extreme
points of this polyhedron. Therefore one may try to find an optimal solution in the set of
extreme points of the feasible region. In other words, since there exists a one to one cor-
respondance between extreme points (of the feasible region) and basic feasible solutions,
one may look for the optimal solution in the set of basic feasible solutions.
Remark 2. When the feasible region is an unbounded convex polyhedron, the Simplex method
enables to know whether the optimal solution is finite or not.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-26/44
The Simplex method
Linear programming problems can be solved using algorithms such the Simplex Method
or the Interior Point Method. In R, methods for solving linear optimization problems can
be found in the package lpSolveAPI.
install.packages("lpSolveAPI")
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-27/44
Example 7. Let us consider the following Linear Programming problems:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-28/44
The problem (P1) can be solved using the lpSolveAPI package as follows:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-29/44
The problem (P2) is solved using the lpSolveAPI package as follows:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-30/44
The problem (P3) can be solved using the lpSolveAPI package as follows:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-31/44
The problem (P4) can be solved using the lpSolveAPI package as follows:
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-32/44
Now suppose that in the problem (P1) x1 is a binary variable (i.e. it takes only the value
0 or 1), and x2 is an integer variable, then we need to set them to the appropriate type
before solving the problem (P 1). This can be done as follows:
set.type(P1, 1, "binary")
set.type(P1, 2, "integer")
solve(P1)
[1] 0 #This indicates that the problem has a finite optimal
solution
get.variables(P1)
[1] 1 4 #These are the obtained optimal values of x1 and x2,
respectively
get.objective(P1)
[1] -13 #This is the obtained optimal value of -f, thus f=13
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-33/44
Particular LP problems: Transportation problems
Example 8. A national power company has three power plants which supply the needs
of four major cities of the country. Each power plant can supply the following number of
Kwh of electricity:
Plant 1 Plant 2 Plant 3
35 million 50 million 40 million
The peak power demands (in Kwh) in these four cities are following:
City 1 City 2 City 3 City 4
45 million 20 million 30 million 30 million
The costs of sending 1 million Kwh of electricity from a given plant to a given city are
summarized in the table below.
❍
❍❍
To
❍❍
❍❍ City 1 City 2 City 3 City 4
From ❍❍
❍
Plant 1 £8 £6 £10 £9
Plant 2 £9 £12 £13 £7
Plant 3 £14 £9 £16 £5
What could be the shipping plan for this company in order to supply all the four cities in
electricity from its plants at a minimum cost?
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-34/44
Modelling a transportation problem
• A set of m supply points from which goods are shipped. A supply point i can supply
at most si units of goods.
• A set of n demand points where goods are shipped. A demand point j must receive
at least dj units of goods.
• Each unit of goods shipped from supply point i to demand point j incurs a cost cij .
Let us denote by xij the quantity of goods to be shipped from supply point i to demand
point j. Then, the relevant data can be summarised in the following tableau (also referred
to as the transportation tableau):
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-35/44
❤❤❤
❤❤❤❤
❤❤❤
❤❤❤❤ Demand points
❤❤❤❤
❤❤❤ Demand Demand . . . Demand . . . Demand Supply
Supply points ❤❤❤❤
❤❤❤❤
❤
point 1 point 2 point j point n
❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
❍❍ c11 ❍❍❍ c12 ❍❍❍ . . . ❍❍❍ c1j ❍❍❍ . . . ❍❍❍ c1n
Supply point 1 ❍❍ ❍ ❍ ❍ ❍ ❍ s1
x11 ❍❍❍❍ x12 ❍❍❍❍ . . . ❍❍❍❍ x1j ❍❍❍❍ . . . ❍❍❍❍ x1n ❍❍❍❍
❍❍ ❍ ❍ ❍ ❍ ❍
❍❍ c21 ❍❍❍❍ c22 ❍❍❍❍ . . . ❍❍❍❍ c2j ❍❍❍❍ . . . ❍❍❍❍ c2n
Supply point 2 ❍❍ ❍ ❍ ❍ ❍ ❍ s2
x21 ❍❍❍❍ x22 ❍❍❍❍ . . . ❍❍❍❍ x2j ❍❍❍❍ . . . ❍❍❍❍ x2n ❍❍❍❍
❍
❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ ...
.. ❍❍ ❍ ❍ ❍ ❍ ❍ ..
... ❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍
❍ ❍ ❍ ❍ ❍ ❍
❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
❍❍ c i1 ❍❍ c i2 ❍❍ . . . ❍❍ c ij ❍❍ . . . ❍❍ c in
Supply point i ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
si
xi1 ❍❍❍❍ xi2 ❍❍❍❍ . . . ❍❍❍❍ xij ❍❍
❍❍ . . . ❍❍
❍❍ x in
❍❍
❍❍
❍
❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ . . . ❍❍❍❍ ...
.. ❍❍ ❍ ❍ ❍ ❍ ❍ ..
... ❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍ . . .
❍❍
❍❍
❍ ❍ ❍ ❍ ❍ ❍
❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
❍❍ c m1 ❍❍ c m2 ❍❍ . . . ❍❍ c mj ❍❍ . . . ❍❍ c mn
Supply point m ❍❍ ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
sm
xm1 ❍❍❍❍ xm2 ❍❍❍❍ . . . ❍❍❍❍ xmj ❍❍❍❍ . . . ❍❍❍❍ xmn ❍❍❍❍
Demand d1 d2 ... dj ... dn
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-36/44
Formulation of a transportation problem
Constraints:
• The total supply at each supply point i (i = 1, 2, . . . , m) is si, therefore we must have
Xn
xij ≤ si, i = 1, 2, . . . , m;
j=1
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-37/44
The mathematical model:
Pm Pn
Minimise z = i=1 j=1 cij xij
Pn
subject to j=1 xij ≤ si, i = 1, 2, . . . , m
(1)
Pm
i=1 xij ≥ dj , j = 1, 2, . . . , n
xij ≥ 0, ∀i, j
One can notice that a transportation problem is a linear programming problem (with too
many variables!), however there exists a variant of the Simplex method which can be used
to solve this class of LP more quickly than with the classical Simplex method.
Remark 3. It may happen that a transportation problem is a maximisation type problem. How-
ever it remains a transportation problem as long as the constraints are similar to those in (1).
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-38/44
Remark 4. When the total supply equals the total demand, i.e.
Xm Xn
si = dj ,
i=1 j=1
then the transportation problem is said to be a balanced transportation problem. In this case the
mathematical model can be written
Pm Pn
Minimise z = i=1 j=1 cij xij
Pn
subject to j=1 xij = si, i = 1, 2, . . . , m; (2)
Pm
i=1 xij = dj , j = 1, 2, . . . , n.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-39/44
❤❤❤
❤❤❤❤
❤❤❤
❤❤❤❤ Demand points
❤❤❤
❤❤❤❤ City 1 City 2 City 3 City 4 Supply
Supply points ❤❤❤
❤❤❤❤
❤❤
❍ ❍ ❍ ❍
❍
❍❍
❍
8
❍❍
❍
❍❍ 6 ❍
❍❍ 10 9
Plant 1 ❍❍ ❍❍ ❍❍ ❍❍
35
x 11
❍❍
❍❍ 12 x❍❍
❍❍ 13
❍❍
❍❍ x 14
❍❍
❍❍ x
❍❍ ❍❍ ❍❍ ❍❍
❍❍ 9
❍❍ ❍❍ 12 ❍❍ 13 7
Plant 2 ❍❍ ❍❍ ❍❍ ❍❍
50
x 21
❍
❍❍
❍ 22 x❍
❍❍
❍ 23
❍
❍❍
❍
x 24
❍
❍❍
❍
x
❍ ❍ ❍ ❍
❍❍
14
❍❍ ❍❍
9 ❍❍
16 5
Plant 3 ❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍ 40
x 31 ❍❍
❍ 32 x ❍❍
❍ 33 ❍❍
❍
x 34 ❍❍
❍
x
Demand 45 20 30 30 125
Min z = 8x11 + 6x12 + 10x13 + 9x14 + 9x21 + 12x22+
13x23 + 7x24 + 14x31 + 9x32 + 16x33 + 5x34
s. t.
x11 + x12 + x13 + x14 ≤ 35
x21 + x22 + x23 + x24 ≤ 50
x31 + x32 + x33 + x34 ≤ 40
x11 + x21 + x31 ≥ 45
x12 + x22 + x32 ≥ 20
x13 + x23 + x33 ≥ 30
x14 + x24 + x34 ≥ 30
xij ≥ 0, i = 1, 2, 3; j = 1, 2, 3, 4.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-40/44
Balancing an unbalanced transportation problem
When the total supply exceeds the total demand in a transportation problem, i.e.
Xm Xn
si ≥ dj ,
i=1 j=1
one can balance this problem by creating a dummy demand point whose demand is equal to
the amount of supply excess. Since the shipments at the dummy point are just “virtual”
shipments, they are assigned a zero cost.
Example 9.
Suppose that in Example 8, the electricity demand of City 1 is now 40 million Kwh. Then
the corresponding problem is an unbalanced transportation problem with supply excess.
Indeed, the total demand is now 120 million Kwh whereas the supply is 125 million Kwh.
In order to balance the problem, we add a dummy point whose demand is 5 million Kwh
(i.e. 125 − 120).
The cost of shipping 1 million Kwh from each plants to the dummy point is £0.
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-41/44
Then the formulation of the corresponding balanced transportation problem is as follows.
❤❤❤❤
❤❤❤
❤❤❤❤ Demand points
❤❤❤
❤❤❤❤
❤❤❤ City 1 City 2 City 3 City 4 Dummy Supply
Supply points ❤❤❤❤
❤❤❤❤
❤
❍❍ ❍❍ ❍❍ ❍❍ ❍❍
❍ 8
❍ ❍ 6 ❍ 10
❍ 9 0
Plant 1 ❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍ 35
x 11 ❍❍
❍ 12 x ❍❍
❍ 13 ❍❍
❍
x 14 ❍❍
❍ 15 x ❍❍
❍
x
❍ ❍ ❍ ❍ ❍
❍❍
9
❍❍ ❍❍
12 ❍❍
13
❍❍
7 0
Plant 2 ❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍ 50
x 21 ❍❍
❍ 22 x ❍❍
❍ 23 ❍❍
❍
x 24 ❍❍
❍ 25 x ❍❍
❍
x
❍❍ ❍❍ ❍❍ ❍❍ ❍❍
❍❍ 14
❍❍ ❍❍ 9 ❍❍ 16
❍❍ 5 0
Plant 3 ❍❍ ❍❍ ❍❍ ❍❍ ❍❍
40
x 31
❍❍
❍❍ 32 x❍❍
❍❍ 33
❍❍
❍❍ x 34
❍❍
❍❍ 35 x❍❍
❍❍ x
Demand 40 20 30 30 5 125
When the total supply is less the total demand in a transportation problem, i.e.
Xm n
X
si ≤ dj ,
i=1 j=1
the problem has no feasible solution. However, in order to make the problem feasible,
one can introduce a dummy supply point (for the shortage) whose supply will satisfy the
unmet demand with penalty (i.e. a cost).
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-42/44
Example 10.
Suppose that in Example 8, the electricity demand of City 1 is now 50 million Kwh. Then
the corresponding problem is an unbalanced transportation problem with unmet demand,
since the total demand is now 130 million Kwh whereas the supply is 125 million Kwh.
Assume that for each million of Kwh of unmet demand, there is a penalty of £70 (for this
case, the penalty could be for example the cost of supplying each million of Kwh of the
unmet electricity demand from another company).
Then the formulation of the corresponding balanced transportation problem is as follows.
❤❤❤❤
❤❤❤
❤❤❤❤ Demand points
❤❤❤
❤❤❤❤
❤❤❤❤ City 1 City 2 City 3 City 4 Supply
Supply points ❤❤❤
❤❤❤❤
❤
❍❍ ❍❍ ❍❍ ❍❍
❍❍ 8
❍❍ ❍❍ 6 ❍❍ 10 9
Plant 1 ❍
❍❍
❍
❍❍
❍
❍❍
❍
❍❍ 35
x11 ❍❍
❍ 12 x❍❍
❍ 13 ❍❍
❍
x14 ❍❍
❍
x
❍ ❍ ❍ ❍
❍❍ ❍❍
9 ❍❍
12 ❍❍
13 7
Plant 2 ❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍ 50
x21 ❍❍
❍ 22 x❍❍
❍ 23 ❍❍
❍
x24 ❍❍
❍
x
❍❍ ❍❍ ❍❍ ❍❍
❍❍ 14
❍❍ ❍❍ 9 ❍❍ 16 5
Plant 3 ❍❍ ❍❍ ❍❍ ❍❍
40
x31
❍❍
❍❍ 32 x
❍❍
❍❍ 33
❍❍
❍❍ x34
❍❍
❍❍ x
❍ ❍ ❍ ❍
❍❍
70
❍❍ ❍❍
70 ❍❍
70 70
Dummy (Shortage) ❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍
❍❍ 5
x41 ❍❍
❍ 42 x❍❍
❍ 43 ❍❍
❍
x44 ❍❍
❍
x
Demand 50 20 30 30 130
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-43/44
Solving a transportation problem
To solve a transportation problem, we will consider the balanced form of the problem
(which is nothing but the standard form of a Linear Programming problem). Then a
variant of the Simplex method, called the Transportation-Simplex method, can be used to
solve the balanced problem. However, in this course, we will always use lpSolveAPI
package to solve any transportation problem, as in Example 7.
❍
❍❍
To
❍❍
❍❍ City 1 City 2 City 3 City 4 Supply
From ❍
❍❍
QUB SOR1021 - Introduction to Statistical and Operational Research Methods Chapter 1 Page-44/44