Escolar Documentos
Profissional Documentos
Cultura Documentos
The aims of this chapter are: To introduce the modelling and identication of a Linear Programming problem; To introduce the dierent 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; To introduce some classical methods used to solve a Linear Programming problem and to interpret the obtained results.
Chapter 7
S Moutari, CenSSOR-QUB
Chapter 7
Page-1/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-2/78
Learning Outcomes
By the end of this chapter, you should: Understand the basic concepts on the formulation of a Linear Programming model from the statement of the problem; Be able to recognise a Linear Programming model; Be able to solve a Linear Programming problem using the appropriate method; Be able to interpret the solution of a Linear Programming problem.
Outline
Whats a Linear Programming problem? Some denitions and terminologies in Linear Programming. Solving a Linear Programming problem. Particular Linear Programming problems: Transportation problems.
S Moutari, CenSSOR-QUB
Chapter 7
Page-3/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-4/78
Constraints: Bricks: (10, 000 x1) bricks + (8, 000 x2) bricks 168, 000 bricks. Doors: (4 x1) doors + (2 x2) doors 60 doors. Positivity: x1 0 and x2 0. The mathematical model Maximise z = 200, 000x1 subject to 10, 000x1 4x1 5x1 + 250, 000x2 + 8, 000x2 168, 000 + 2x2 60 + 10x2 150 x1 0 x2 0 Windows: (5 x1) windows + (10 x2) windows 150 windows.
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.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-6/78
Applications of Linear Programming Linear programming is used to solve problems in many aspects of business administration and engineering problems including: Manufacturing, Design;
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 prot or to minimise the cost, etc... 2. Identify the decision variables and the constraints on them. For example, production 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 coecient 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.
Formulation of a Linear Programming problem 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:
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-7/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-8/78
Linear Programming assumptions Linear programming requires linearity in the constraints and the objective function, i.e., each decision variable is multiplied by a constant coecient. Linearity requires the following assumptions: Proportionality: a change in a variable results in a proportionate change in that variables contribution to the value of the function. Additivity: the function value is the sum of the contributions of each term. Divisibility: the decision variables can be divided into non-integer values, taking on fractional values.
bi ,
i I {1, . . . , m};
Additionally, linear programming assumes certainty, i.e., all the coecients are known and constant. Remark 1.When the divisibility assumption does not hold, one resorts to Integer Programming techniques to solve the problem.
I, K and R are disjunct and I K R = {1, . . . , m}; The coecients cj , aij , akj , arj , bj , bk and br are given real constants.
S Moutari, CenSSOR-QUB
Chapter 7
Page-9/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-10/78
The linear function z to be optimised is called objective function or cost function. The inequalities and equations are called constraints. Max z = s.t.
n j=1 cj xj n j=1 aij xj
= bi, i = 1, . . . , m; j = 1, . . . , n.
Canonical form of a LP
bi, i = 1, . . . , m; j = 1, . . . , n.
All the decision variables are non negative. From canonical to standard form 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:
n j=1 n
aij xj bi
Max z = s.t.
m i=1 0
Transformation rules xn+i = bi, i = 1, . . . , m; 0, j = 1, . . . , n + m. Minimisation Maximisation: Inequation : Equation : [Min z = cx] [Max z = cx].
+ xn+i xj
ax b (a)x b. ax b ax b ax b; (a)x b.
ax = b
Inequation equation:
ax b ax + s = b, s 0; ax b ax s = b, s 0. x R x = x + b; x 0. x=x x ; x , x 0.
Real variable non negative variable: Lower bounded variable: Absolute value: x b
|x| b
x b; x (b).
S Moutari, CenSSOR-QUB
Chapter 7
Page-14/78
Denition 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
n
aij xj = bi, i = 1, 2, . . . , m
j=1
is said to be a solution of this LP. Feasible solution: If a solution of a LP satises then it is called a feasible solution of this LP. Denition 3. Basis: A basis is any set of m variables chosen from x1, x2, . . . , xn such that the determinant of the corresponding coecients aij is non null. In other words the column vectors in the matrix A, associated to the m variables form a basis of Rm.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-15/78
z=
j=1
xj 0, j = 1, . . . , n,
c j xj
S Moutari, CenSSOR-QUB
Chapter 7
Page-16/78
Geometrical considerations Denition 5. The set of feasible solutions of a linear programming problem is called the feasible region of this problem. Denition 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 either an empty set;
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 nite optimal solution, then there exists at least an optimal solution which is an extreme point of its feasible region. Example 2. Consider the following systems of constraints in a two dimensional space: x1 + x2 5 2x + x 8 1 2 (S1) = x1 0 x2 0 x1 + x2 3x1 + 2x2 (S2) = x1 x2 3 6 0 0
The region described by the systems (S1) and (S2) are given by the closed polyhedrons colored in gray in the following gures.
S Moutari, CenSSOR-QUB
Chapter 7
Page-17/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-18/78
x2
x2
3 x
+
2
2x
x1 2 +x =8
x1 + x2 = 5
0 2 4 6 x1 4 4 0
Counting basic solutions method: This method is not suitable for practical problem since it is too long to implement!
x1 + x2 = 3
2 4 6 8 x1
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 nite number of iteration.
S Moutari, CenSSOR-QUB
Chapter 7
Page-19/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-20/78
Results of a linear optimisation One of the following cases occurs when a LP is solved: 1. The LP has a unique optimal solution.
Max s.t.
z= x1 2x1 2x1
x1 + + x2 + 3x2 x2 x1 , x2
3x2
z= x
+ 3x
14 12 12 0
= 30
z= x1 +
Dire
ction
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.
In this case, the feasible region is a convex polytope. In this region, we are looking for a point (or some points) that the coordinates maximise z. All the straight lines of equation x1 + 3x2 = constant are parallel and two of them are plotted when the constant is equal to 2 and 30, respectively. The optimal solution for this LP 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.
3x2 =2 in w hich z
4 Feasible region
incre ases
x1 + x2 = 14
12
S Moutari, CenSSOR-QUB
Chapter 7
Page-21/78
S Moutari, CenSSOR-QUB
2x 1
+x
=1
x 2
+ 1
3x 2
12
14
x1
Chapter 7
Page-22/78
2 x cr de 1 ea
1
se s
ct
In this example, the feasible region is also a convex polytope. In this region, we are looking for a point (or some points) that the coordinates minimise z. All the the straight lines of equation x2 x1 = constant are parallel. Therefore the straight lines representing the objective function and the constraint x1 x2 = 2 are parallel. The optimal solutions for this LP are: the extreme points A(2, 0) and B(3.5, 1.5) and all the points on the segment (A, B). Hence we have an innite number of optimal solutions. The corresponding value of z for all these solutions is z = 2.
2 Feasible region 0 2A B
x1
6 4 3 0
in
z=
6
x1 = 4
ich
x2
2x
wh
io
5x
Di
rec
re
7x
tio
Di
ni
50
nw
hic
hz
inc
4 x2 = 3
rea
ses
x1
5
In this example, the feasible region is an unbounded convex polyhedron. The value of the objective function z = 3x1 + 7x2 keeps growing indenitely in the feasible region. The optimal value of z is obtained at the points (x1 = +, x2 3), therefore z is innite.
x1 + x2 =
Feasible region
x1
x2
z=
5x
7x
x1
21
S Moutari, CenSSOR-QUB
Chapter 7
Page-23/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-24/78
2x
x2 x2 2x2 + x2 x1 , x2
x1 2 8 5 0
x1
In this example, the feasible region is an empty set! This means that the problem is infeasible. One can check that algebraically, by summing the three constraints term by term: 2x1 + x2 x1 2x2 x1 + x2 0 This is absurd! 2 8 5 1
When the feasible region is a convex polyhedron, the optimal solutions occurs at extreme points of this polyhedron. Therefore one may try to nd an optimal solution in the set of extreme points of the feasible region. In other words, since there exists a one to one correspondance 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. The principle of the Simplex method is as follows:
x1 + x2 = 5
x1
1. Find a rst basic feasible solution; 2. Move from one basic feasible solution to another such that the value of the objective function is improved at each step. 3. Stop when it is not possible to improve the value of the objective function. The last basic feasible solution is the optimal solution. Remark 2. When the feasible region is an unbounded convex polyhedron, the Simplex method enables to know whether the optimal solution is nite or not.
S Moutari, CenSSOR-QUB
Chapter 7
Page-25/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-26/78
The Simplex tableau The resolution of a LP using the Simplex method is usually presented is a form of successive tables, called Simplex tableaux. The rst Simplex tableau consists of the LP to be solved with constraints turned into equalities, written in the form below. In general, a Simplex tableau is presented in the following form:
Notations used in the Simplex tableau The notations used in is the Simplex tableau are dened as follows: xj j {1, . . . , m} : basic variables, j {m + 1, . . . , n} : non-basic variables.
c1 x1 1 0 . . . 0 . . . 0
m
c2 x2 0 1 . . . 0 . . . 0
m
... ... ... ... .. . ... .. . ... ci ai2 ... ... ... zr =
cr xr 0 0 . . . 1 . . . 0
m
... ... ... ... .. . ... .. . ... ci air ... ... ... zm =
cm xm 0 0 . . . 0 . . . 1
m
bi, i {1, . . . , m} : the constant term in the constraint i. aij , i {1, . . . , m}, j {1, . . . , n} : coecient of the variable j in the constraint i.
m
ci b i
z1 =
i=1
ci ai1
z2 =
i=1
ci aim
i=1
zm+1 =
i=1
ci ai,m+1
zk =
i=1
ci aik
zn =
i=1
ci ain
i=1
cj z j z j cj
c1 z 1 z 1 c1
c2 z 2 z 2 c2
cr z r z r cr
cm z m z m cm
ck z k z k ck
cn z n z n cn
zj , j {1, . . . , n} : zj =
m
ciaij
i=1
z0 =
S Moutari, CenSSOR-QUB
Chapter 7
Page-27/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-28/78
Filling in the next Simplex tableau The formulae used to ll in the next Simplex tableau can be summarized as follows: a.) The pivots row: To obtain the row corresponding to the pivots row in the next Simplex tableau one has to divide the pivots row in the current Simplex tableau by the pivot.
Yes End The solution is optimal
All the cj zj 0 No
b.) The other components: To obtain the corresponding component in the next Simplex tableau one has to apply the following rectangle rule:
s t
aik
(cj zj ) > 0 such that aij 0 i = 1, . . . , n No Changing the basis 1.) Find the new basic and non-basic variables in the next Simplex tableau
Yes
ark
Pivot
Minimisation type LP
- A non-basic variable xk becomes basic if (ck zk ) = max{(cj zj ) | (cj zj ) > 0 } br bi = min | aik > 0 - A basic variable xr becomes non-basic if ark aik ark is called the pivot 2.) Construct the new Simplex tableau - Pivots line: bk = br arj , akj = ark ark aik aik - Other lines (i = k): bi = bi br , aij = aij arj ark ark Replace cj zj by zj cj and proceed like for a maximisation type LP
Assume that ark is the pivot in the current Simplex tableau. Let s (equal aij or bi, i = r) be a component of the current Simplex tableau and let s (equal aij or bi, i = r) aik t . be the corresponding component in the next Simplex tableau, then s = s ark Remark 3. Any row in the current Simplex tableau containing a zero on the column of the pivot remains inchanged in the next Simplex tableau. Any column in the current Simplex tableau containing a zero on the row of the pivot remains inchanged in the next Simplex tableau.
S Moutari, CenSSOR-QUB
Chapter 7
Page-29/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-30/78
Examples of LP resolution using the Simplex method. Example 7. Consider the LP in Example 3: Max z = x1 s.t. x1 + 2x1 + 2x1 x1 , Step 1: Finding a basic feasible solution.
+ x2 3x2 x2 x2
3x2
14 12 12 0
Basis
After introducing slack variables, the LP writes Max z = x1 + 3x2 + 0s1 + 0s2 + 0s3 s.t. x1 + x2 + s1 = + s2 = 2x1 + 3x2 + s3 = 2x1 x2 x2 , s1, s2, s3 x1 ,
1 3 c B b x1 x2 s1 0 14 1 1 s2 0 12 2 3 s3 0 12 2 1 zj 0 0 0 cj zj 1 3
Max
0 s1 1 0 0 0 0
0 s2 0 1 0 0 0
0 s3 0 0 1 0 0
14 12 12 0
Since two quantities cj zj are positive (with values 1 and 3), this basic feasible solution is not optimal. Step 2: Finding a better basic feasible solution. We will try, if possible, to improve the previous basic feasible solution by changing the basis: We remove a basic variable from the basis and replace it by a non-basic variable, using the formulae presented in the diagram of the Simplex method.
Obviously x1 = x2 = 0, s1 = 14, s2 = 12, s3 = 12 is a basic feasible solution of this problem. However, nding a basic feasible solution is not always as obvious. In the sequel, a method used to handle the problem, will be presented.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-31/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-32/78
Accordingly, the non-basic variable x2 becomes basic, Therefore the pivots value is 3 (the surrounded value in the rst Simplex tableau).
Step 3: Finding a better basic feasible solution. The non-basic variable x1 becomes basic; Therefore the pivots value is 5/3 (the surrounded value in the second Simplex tableau).
The basic variable s1 becomes non-basic. The third Simplex tableau is the following:
The second Simplex tableau, obtained using the formulae presented in the diagram of the Simplex method, is the following:
Tableau 2 Max Basis
Tableau 3 Max
cB
1 x1
3 0 x2 s1 0 0 0 0 0
0 s2 1/3 1/3 1 1
0 s3 0 1 0 0
Basis
s1
0 10 5/3
x2 3 4 2/3 1 s3 0 16 4/3 0 zj 12 2 3 cj zj 3 0
1 1/3 0
cB b x1 1 6 x2 3 8 s3 0 8 zj 30 cj zj
1 x1 1 0 0 1 0
3 0 0 x2 s1 s2 0 3/5 1/5 1 2/5 1/5 0 4/5 3/5 3 9/5 2/5 0 9/5 2/5
0 s3 0 0 1 0 0
One cj zj is still positive (its value is 3), therefore the current solution is not optimal.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-33/78
All the quantities cj zj are non positive, therefore the current solution given by x1 = 6, x2 = 8, s1 = s2 = 0, s3 = 8 is optimal and the maximum value of the objective function is z = 30.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-34/78
Remark 4. For the above LP, the dierent steps of the Simplex method can be described graphically as follows: Step 1: The rst basic feasible solution corresponds to the extreme point A = (0; 0); Step 2: The basic feasible solution obtained at the end of this step corresponds to the extreme point B = (0; 3); Step 3: The optimal solution corresponds to the extreme point C = (6; 8).
x2
z= 30
8 C
Step
3
D
z= 12
Step
B 4
z= 0
2
A 0
Feasible region
After multiplying the rst constraint by (1) in order to obtain a positive right hand side term, we introduce slack variables, and the LP writes Min z = x2 x1 s.t. 2x1 + x2 + s1 = 2 + s2 = 2 x1 x2 + s3 = 5 x1 + x2 x2 , s1, s2, s3 0 x1 ,
x1
E 6
The solution x1 = x2 = 0, s1 = 2, s2 = 2, s3 = 5 is a basic feasible solution of this problem. Now, we can apply the Simplex method.
S Moutari, CenSSOR-QUB
Chapter 7
Page-35/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-36/78
Tableau 2
s1 s2 s3
cB 0 0 0
zj zj cj
b 2 2 5 0
1 x1 2 1 1 0 1
1 x2 1 1 1 0 1
0 s1 1 0 0 0 0
0 s2 0 1 0 0 0
0 s3 0 0 1 0 0
Min Basis
s1 x1 s3
cB 0 1 0
zj zj cj
b 6 2 3 2
1 x1 0 1 0 1 0
1 x2 1 1 2 1 0
0 s1 1 0 0 0 0
0 s2 2 1 1 1 1
0 s3 0 0 1 0 0
Basis
1 x2 0 0 1 1 0
The basic feasible solution given by x1 = 2, x2 = 0, s1 = 6, s2 = 0, s3 = 3 (i.e. z = 2) is an optimal solution of this LP, since all the terms zj cj are non positive. However, the quantities zj cj are not negative for all the basic variables (the value of some of them is 0!). Therefore, we can construct another Simplex tableau as follows: The non-basic variable x2 becomes basic and
The basic feasible solution given by x1 = 7/2, x2 = 3/2, s1 = 15/2, s2 = s3 = 0 (i.e. z = 2) is another optimal solution. This second optimal solution does not improve the value of the objective function z. We can construct another Simplex tableau since the terms zj cj are not negative for all non-basic variables but we will get again the rst optimal solution.
For this problem the Simplex method gives two (basic) optimal solutions which correspond to the extreme points A and B in the graphical resolution method (see Example 4). One can also check that all the points P such that P = A + (1 )B, 0 < < 1, are also feasible soltutions of this LP. Let us denote by z(A) and z(B) the value of the objective function at the points A and B, respectively. Since z is a linear function, the value of the objection function at the point P is given by: z(P ) = z(A) + (1 )z(B) = 2. Therefore, all the points P are also optimal solutions of this LP. However these optimal solutions can not be obtained with the Simplex method since this method provides only basic feasible solutions i.e. corresponding to the extreme points of the feasible region.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-38/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-37/78
Example 9. Consider the LP in Example 5: Max z = 5x1 + 7x2 s.t. x1 + x2 x1 x2 x1 , x2 After introducing slack variables, the LP writes Max z = 5x1 + 7x2 s.t. x1 + x2 s1 s2 x1 + s3 x2 x2 , s1, s2, s3 x1 ,
Max
Tableau 1
Tableau 2
6 4 3 0
Basis
cB b x2 7 2 x1 5 4 s3 0 1 zj 34 cj zj
5 x1 0 1 0 5 0
7 0 x2 s1 1 1 0 0 0 1 7 7 0 7
0 s2 1 1 1 2 2
0 s3 0 0 1 0 0
Max Basis
cB b x2 7 3 x1 5 4 s1 0 1 zj 41 cj zj
5 x1 0 1 0 5 0
7 x2 1 0 0 7 0
0 s1 0 0 1 0 0
0 s2 0 1 1 5 5
0 s3 1 0 1 7 7
= = =
6 4 3 0
We have a quantity cj zj which is positive (its value is 5) but all the coecients aij in the same column are non positive (0, 1, 1). Therefore, in this case, as stated in the Simplex method, the optimal solution is innite. We have obtained the same result previously, using the graphical method.
An initial basic feasible solution is not trivial for this problem. However, the solution x1 = 4, x2 = 2, s1 = s2 = 0, s3 = 1 is a basic feasible solution of the problem. Now, lets apply the Simplex method.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-39/78 S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-40/78
Finding an initial basic feasible solution In order to use the Simplex method we have to have an initial basic feasible solution at hand. As we have seen it is not always trivial to nd immediately an initial basic feasible solution so as to apply the Simplex method. Now, we are going to see a method, based on the introduction of some articial variables into (some) constraints, which can be used to handle the problem. This method is called The M method. Remark 5. It is not necessary to introduce articial variables in all the constraints of the LP. We have just to introduce only a sucient number so as to obtain an initial basic feasible solution. When a basic articial variable becomes non-basic, it can be ignored during the rest of the resolution process.
Minimisation type LP
cj xj +
m X i=1
M vi ;
No
S Moutari, CenSSOR-QUB
Chapter 7
Page-41/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-42/78
Example 10. Consider the LP in Example 5: After introducing slack variables, the LP writes: Max z = 5x1 + 7x2 s.t. x1 + x2 s1 s2 x1 + s3 x2 x2 , s1, s2, s3 x1 , = = = 6 4 3 0
The LP to be considered for the M method is the following: Max z = 5x1 + 7x2 M v1 M v2 s.t. x1 + x2 s1 + v1 s2 + v2 x1 + s3 x2 x2 , s1, s2, s3 , v1 , v2 , x1 , = = = 6 4 3 0
Having a basic feasible solution at hand, now, we can apply the Simplex method:
Tableau 1
Since we dont have an immediate basic feasible solution, let us introduce some articial varibles such as we get an initial basic feasible solution. In this case, only two articial variables are needed. Then the constraints of the LP writes: + v1 x1 + x2 s1 s2 + v2 x1 + s3 x2 x2 , s1, s2, s3, v1 , v2 x1 , = = = 6 4 3 0
5 7 0 0 Basis cB b x1 x2 s1 s2 v1 M 6 1 1 1 0 v2 M 4 1 0 0 1 s3 0 3 0 1 0 0 zj 10M 2M M M M cj zj 5 + 2M 7 + M M M
Max
0 M M s3 v1 v2 0 1 0 0 0 1 1 0 0 0 M M 0 0 0
In the next tableau, we ignore the articial variable v2 since it becomes non-basic.
S Moutari, CenSSOR-QUB
Chapter 7
Page-43/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-44/78
Example 11. Consider the LP in Example 6: 0 M s3 v1 0 1 0 0 1 0 0 M 0 0 After introducing slack variables, the LP writes
Min z = s.t. 2x1 x1 x1 x1 , x2 x1 x2 s1 2x2 + s2 + x2 + s3 x2 , s1 , s2 , s3 Min z = s.t. 2x1 x1 x1 x1 , x2 x1 + x2 + s1 + 2x2 s2 + x2 + s3 x2 , s1 , s2, s3
v1 x1 s3
cB M 5 0 zj
b 2 4 3 2M + 20 cj zj 0 s2 1 1 1 2 2 0 s3 0 0 1 0 0
5 7 0 0 x1 x2 s1 s2 0 1 1 1 1 0 0 1 0 1 0 0 5 M M M 5 0 7 + M M M + 5
Max Basis
= 2 = 8 = 5 0
= = =
2 8 5 0
Tableau 4
cB b x2 7 2 x1 5 4 s3 0 1 zj 34 cj zj
5 x1 0 1 0 5 0
7 0 x2 s1 1 1 0 0 0 1 7 7 0 7
cB b x2 7 3 x1 5 4 s1 0 1 zj 41 cj zj
5 x1 0 1 0 5 0
7 x2 1 0 0 7 0
0 s1 0 0 1 0 0
0 s2 0 1 1 5 5
0 s3 1 0 1 7 7
There is no immediate basic feasible solution, let us introduce some articial variables such as we get an initial basic feasible solution. In this case, only one articial variable is needed. Then the constraints of the LP write: 2x1 + x2 + s1 s2 + v x1 + 2x2 + s3 x1 + x2 x2 , s1, s2, s3, v x1 , = = = 2 8 5 0
As we have seen previously, the optimal solution for this problem is innite.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-45/78 S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research
Chapter 7
Page-46/78
The LP to be considered for the M method is the following: Min z = s.t. 2x1 x1 x1 x1 , x2 x1 + M v + x2 + s1 + 2x2 s2 + v + x2 + s3 x2 , s1, s2, s3 , v
Min
Tableau 2
Since the solution s1 = 2, v = 8, s3 = 5, x1 = x2 = s2 = 0 is a basic feasible solution of this problem, we can apply the Simplex method:
Tableau 1 Min Basis
Min
= = =
2 8 5 0
(1)
1 Basis cB b x1 x2 1 2 2 v M 4 3 s3 0 3 3 zj 4M + 2 3M 2 zj cj 3M 1
Tableau 3
1 0 0 x2 s1 s2 1 1 0 0 2 1 0 1 0 1 1 2M M 0 1 2M M
0 s3 0 0 1 0 0
M v 0 1 0 M 0
s1 v s3
cB 0 M 0
zj zj cj
b 2 8 5 8M
1 1 x1 x2 2 1 1 2 1 1 M 2M 1 M 2M 1
0 0 s1 s2 1 0 0 1 0 0 0 M 0 M
0 s3 0 0 1 0 0
M v 0 1 0 M 0
1 Basis cB b x1 x2 1 4 0 v M 1 0 x1 1 1 1 zj M + 3 1 zj cj 0
M v 0 1 0 M 0
The solution x1 = 1, x2 = 4, v = 1, s1 = s2 = s3 = 0 is the optimal solution of the LP. However the articial variable is positive (v = 1), therefore, the initial LP is infeasible, as we have seen graphically.
S Moutari, CenSSOR-QUB
Chapter 7
Page-47/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-48/78
Degeneracy and Cycling in Linear Programming Denition 7. Degenerate basic feasible solution: It may happen that, when introducing a new variable into the basis, one of the basic variables coincidentally becomes equal to zero. Such a basic feasible solutions is called degenerate. Cycling: Whenever there is a degenerate basic feasible solution in the LP, then the Simplex method may stuck in a loop: this phenomenon is called the cycling, in linear programming. When we have many choices for the variables to be introduced into the basis or to be removed from the basis, depending on the chosen variable, it could be possible to be trapped in a loop. Therefore, we need a rule to decide which variable will enter the basis and which one will be removed from the basis. Blands rule: The Blands rule or Blands anti-cycling rule is a technique used in the Simplex method for ensuring that a linear optimisation problem always converges to an answer. This rule consists of choosing the variable with the minimal index possible in the case of multiple choices. In order to apply this rule, if we have introduced k slack variables, they should be labelled xn+i, i = 1, . . . , k; and if we have introduced l articial variables, they should be labelled xn+k+j , j = 1, . . . , l. Another method to eliminate innite loops is the perturbation method.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-49/78
LP with variables unrestricted in sign Let us consider the following LP, where the k rst variables are unrestricted in sign (u.i.s.): Min z = s.t.
n j=1 cj xj n j=1 aij xj
bi, i = 1, . . . , m. j = 1, . . . , k n. 0, j = k + 1, . . . , n.
xj u.i.s., xj
There exist dierent methods to transform this LP into an equivalent form consisting of only non negative variables.
S Moutari, CenSSOR-QUB
Chapter 7
Page-50/78
Method 1 Since a variable unrestricted in sign can be written as a dierence of two non negative variables, we have just to replace the variables xj u.i.s. by xj = xj xj , xj , xj 0,
j = 1, . . . , k.
The drawback of this natural method is that it increases considerably the number of variables in the LP: We pass from n to n + k variables! Therefore the following method is preferable. Method 2 In this method only one additional variable x is introduced in the model. In fact, all the variables xj u.i.s. are replaced by xj = xj x , xj , x 0,
S Moutari, CenSSOR-QUB
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.
H HH HH HH HH H
j = 1, . . . , k.
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?
Chapter 7 Page-51/78 S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-52/78
Modelling a transportation problem In general a transportation problem is specied by the following informations: 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):
Demand points
Supply points
HH HH HH HH HH HH HH HH HH HH HH HH 11 12 1j 1n HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 11 12 1j 1n HH HH HH HH HH HH HH HH HH HH HH HH 21 22 2j 2n HH HH HH HH HH HH H H H H H H HH HH HH HH HH HH 21 22 2j 2n H H H H H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH i1 i2 ij in HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH i1 i2 ij in H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH m1 HH m2 HH HH mj HH HH mn HH HH HH HH HH HH HH HH HH HH HH HH m1 m2 mj mn
... ...
... ...
...
... ...
... ...
... ...
...
... ...
Problem. Find the quantity of goods xij ( i = 1, 2, . . . , m; j = 1, 2, . . . , n) to be shipped from the supply point si to the demand point dj in order to satisfy the demands at all the demand points and such that the shipment cost is minimal.
S Moutari, CenSSOR-QUB
Chapter 7
Page-53/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-54/78
Formulation of a transportation problem Let xij ( i = 1, 2, . . . , m; j = 1, 2, . . . , n) be the quantity of goods to be shipped from the supply point si to the demand point dj .
m n
cij xij .
si, i = 1, 2, . . . , m dj , j = 1, 2, . . . , n 0, i, j
(2)
Constraints: The total supply at each supply point i (i = 1, 2, . . . , m) is si, therefore we must have
n j=1
xij
xij si, i = 1, 2, . . . , m;
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 6. It may happen that a transportation problem is a maximisation type problem. However it remains a transportation problem as long as the constraints are similar to those in (2).
xij dj , j = 1, 2, . . . , n;
Remark 7. When the total supply equals the total demand, i.e.
m n
Demand points
Supply points
City 1 8 9 x x x x x x
City 2 6 x x x
City 3 10 13 16 x x x
City 4 9 7 5
Supply 35 50 40 125
si =
i=1 j=1
dj ,
then the transportation problem is said to be a balanced transportation problem. In this case the mathematical model can be written Minimise z = subject to
m i=1 n j=1 cij xij
H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 11 12 13 14 HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH 21 22 23 24 H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 31 32 33 34 H H H H
12 9
14
45
20
30
30
= si, i = 1, 2, . . . , m; = dj , j = 1, 2, . . . , n.
(3)
The transportation problem in Example 12 is a balanced transportation problem. The formulation and the corresponding mathematical model for this problem are as follows:
Min z = 8x11 + 6x12 + 10x13 + 9x14 + 9x21 + 12x22+ 13x23 + 7x24 + 14x31 + 9x32 + 16x33 + 5x34 s. t. x + x + x + x 35 11 12 13 14 x21 + x22 + x23 + x24 50 x + x32 + x33 + x34 40 31 x11 + x21 + x31 45 x + x + x 20 12 22 32 x + x + x 30 23 33 13 x + x + x 30 14 24 34 xij 0, i = 1, 2, 3; j = 1, 2, 3, 4.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-58/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-57/78
Balancing an unbalanced transportation problem Case of supply excess When the total supply exceeds the total demand in a transportation problem, i.e.
m i=1 n
Demand points
Supply points
City 1 8 9 x x x x x x
City 2 6 x x x
City 3 10 13 16 x x x
City 4 9 7 5 x x x
Dummy 0 0 0
Supply 35 50 40 125
si
dj ,
j=1
HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 11 12 13 14 15 H H H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 21 22 23 24 25 H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 31 32 33 34 35
12 9
14
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 13. Suppose that in Example 12, 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.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7
40
20
30
30
Case of unmet demand When the total supply is less the total demand in a transportation problem, i.e.
m i=1 n
si
dj ,
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).
Page-59/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-60/78
Example 14. Suppose that in Example 12, 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.
hhhh hhh hhhh hhh hhhh hhhh hhh hhhh h
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, we need some appropriate methods to nd an initial basic feasible solution in order to use the Transportation-Simplex method. Finding a basic feasible solution for a transportation problem Consider the following balanced transportation problem: Minimise z = subject to
m i=1 n j=1 cij xij
Demand points
Supply points
City 1 8 9 x x x x x x x x
City 2 6 x x x x
City 3 10 13 16 70 x x x x
City 4 9 7 5
Supply 35 50 40 5 130
HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH 11 12 13 14 H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 21 22 23 24 H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 31 32 33 34 H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 41 42 43 44 H H H H
12 9
14 70
70
70
= si, i = 1, 2, . . . , m; = dj , j = 1, 2, . . . , n.
SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-62/78
(4)
50
20
30
30
S Moutari, CenSSOR-QUB
Chapter 7
Page-61/78
S Moutari, CenSSOR-QUB
Remark 8. Any vector x = (xij ){i=1,2...m,j=1,2,...,n} which satises only one of the constraints in (4) satises automatically all the other constraints. Thanks to the above remark, we can consider only m + n 1 constraints of (4) in order to solve the problem. Denition 8. Any set consisting of an even number of cells which is larger or equal than four in a transportation tableau is called a loop if one of the following holds: Any two consecutive cells lie in the same row or the same column; No three consecutive cells lie in the same row or the same column; The last cell in the sequence has a row or a column in common with the rst cell in the sequence. Proposition 2. A collection of m + n 1 variables is a basic feasible solution of (4) if the corresponding cells (in the transporation tableau) contain no loop.
There exists various methods which can be used to nd a basic feasible solution for a balanced transportation problem. We are going to present two of them: 1. Northwest Corner method; 2. Minimum Cost method. Nothwest Corner method This method starts with the upper left cell of the transportation tableau (i.e. x11) and set x11 as large as possible. Clearly x11 = min{s1 , d1}. If x11 = d1, then cross out the rst column of the tableau and set s1 to s1 d1. If the rst row is crossed out, then set d1 to 0. If the rst column is crossed out, then set s1 to 0. If x11 = s1, then cross out the rst row of the tableau and set d1 to d1 s1.
If x11 = s1 = d1, then cross out either the rst row or the rst column but not both.
S Moutari, CenSSOR-QUB
Chapter 7
Page-63/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-64/78
Then the same procedure is applied to the most northwest cell in the tableau that does not lie in a crossed out row or column. Eventually, one will come to a point where there is only one cell that can be assigned a value. Assign this cell a value equal to its rows supply or columns demand, and cross out both the cells on the corresponding row and column. Then, we obtain a basic feasible solution of the problem. Example 15. Consider the following transportation problem. We omit the costs in the transportation tableau since they are not involved in the Northwest Corner method.
hhh hhhh hhh hhhh hhh hhhh hhhh hhh hh
Now lets apply the Northwest Corner method to nd a basic feasible solution.
PP PP PP PP PP PP PP P
Tableau 1 D. pt 1 2 D. pt 2 D. pt 3 D. pt 4 Supply 3 1 3
D. pts
S. pts
S. pt 1 S. pt 2 S. pt 3 Demand
HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
PP PP PP PP PP PP PP P
Tableau 2 D. pt 1 2 D. pt 2 3 D. pt 3 D. pt 4 Supply
D. pts
S. pts
S. pt 1 S. pt 2 S. pt 3 Demand
HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
1 3
4 Tableau 3 D. pt 1 2 D. pt 2 3 1
1 Tableau 4 D. pt 1 2 D. pt 2 3 1 0
PP PP PP PP PP PP PP P
D. pts
S. pts
D. pt 3
D. pt 4
Supply
S. pt 1
Demand points
Supply points
HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 11 12 13 14 H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 21 22 23 24 H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 31 32 33 34
Demand point 1 x x
Demand point 2 x x
Demand point 3 x x
Demand point 4 x x
Supply 5 1 3 9
S. pt 2 S. pt 3 Demand
H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H
PP PP PP PP PP PP PP P
D. pts
S. pts
D. pt 3
D. pt 4
Supply
S. pt 1 S. pt 2 S. pt 3 Demand
H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H
0 Tableau 5 D. pt 1 2 D. pt 2 3 1 0
2 Tableau 6 D. pt 1 2 D. pt 2 3 1 0 D. pt 3
PP PP PP PP PP PP PP P
D. pts
S. pts
D. pt 3
D. pt 4
Supply
x 2
x 4
x 2
x 1
S. pt 1 S. pt 2 S. pt 3 Demand
The total demand equals the total supply (=9), therefore this problem is a balanced transportation problem.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-65/78
HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
PP PP PP PP PP PP PP P
D. pts
S. pts
D. pt 4
Supply
S. pt 1 S. pt 2 S. pt 3 Demand
HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
S Moutari, CenSSOR-QUB
Chapter 7
Page-66/78
The Northwest Corner method assigned values to m + n 1 (3 + 4 1 = 6) variables and the set of cells corresponding to these variables does not contain a loop. A basic feasible solution given by this method is: - Basic variables: x11 = 2, x12 = 3, x22 = 1, x32 = 0, x33 = 2, x34 = 1; - Non-basic variables: x13 = x14 = x21 = x23 = x24 = x31 = 0. Remark 9. The disadvantage of the Northwest Corner method is that it does not involve the shipping costs to obtain a basic feasible solution. Therefore, it can provide a basic feasible solution with a very high shipping cost and then determining an optimal solution may require too many iterations. Hence the Minimum Cost method below is preferable. Minimum Cost Method In order to start this method, we have to nd, in the transportation tableau, the variable with the smallest shipping cost (say xij ). Then assign xij its largest possible value, i.e. xij = min{si, dj }. Like in the Northwest Corner method, cross out row i or column j and update the demand of the non crossed out column (i.e. dj dj xij ) or the supply of the non crossed out row (i.e. si si xij ). And continue the same procedure like in the Northwest Corner method by considering the minimun cost cell instead of the most northwest cell.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-67/78
Demand points
Supply points
H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 11 12 13 14 H H H H H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH 21 22 23 24 HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH 31 32 33 34 H H H H
Demand point 1 x x
Demand point 2 x x
Demand point 3 x x
Demand point 4 x x
Supply 6 5 6 5 10 15 30
2 2 3
3 1 8
5 3 4
x 12
x 8
x 4
x 6
The total demand equals the total supply (=30), therefore this problem is a balanced transportation problem. Now lets apply the Minimum Cost method to nd a basic feasible solution.
PP PP PP PP PP PP PP P
Tableau 1 D. pt 1 2 2 3 D. pt 2 3 1 8 D. pt 3 5 3 4 D. pt 4 6 5 6 Supply 5 2 15
D. pts
S. pts
S. pt 1 S. pt 2 S. pt 3 Demand
H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H H H HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H H H
PP PP PP PP PP PP PP P
Tableau 2 D. pt 1 2 2 3 D. pt 2 3 1 8 D. pt 3 5 3 4 D. pt 4 6 5 6 Supply 5
D. pts
S. pts
S. pt 1 S. pt 2 S. pt 3 Demand
H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H H H HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H H H H H
15
12
10
S Moutari, CenSSOR-QUB
Chapter 7
Page-68/78
PP PP PP PP PP PP PP P
Tableau 3 D. pt 1 2 2 5 2 D. pt 2 3 1 8 D. pt 3 5 3 4 D. pt 4 6 5 6 Supply
D. pts
S. pts
S. pt 1 S. pt 2 S. pt 3 Demand
H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H
PP PP PP PP PP PP PP P
Tableau 4 D. pt 1 2 2 3 5 2 5 D. pt 2 3 1 8 D. pt 3 5 3 4 D. pt 4 6 5 6 Supply
D. pts
The Transportation-Simplex method Algorithm Inputs: A transportation problem. Output: An optimal solution of the considered transportation problem. (1) If the transportation problem is unbalanced, balance it.
D. pt 3 D. pt 4 5 3 4 6 5 6 Supply
S. pts
S. pt 1 S. pt 2 15 S. pt 3 Demand
H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H
10
5 Tableau 5 D. pt 1 2 2 3 5 2 5 D. pt 2 3 1 8
4 Tableau 6 D. pt 1 2 2 3 5 2 5 D. pt 2 3 1 8
PP PP PP PP PP PP PP P
D. pts
S. pts
D. pt 3 5 3
D. pt 4 6 5 6
Supply
S. pt 1 S. pt 2 S. pt 3 Demand
HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
PP PP PP PP PP PP PP P
D. pts
S. pts
S. pt 1 S. pt 2 6 S. pt 3 Demand
HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH H H H H H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH H H H H HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH HH
(2) Find a basic feasible solution for the problem (using one of the above methods). (3) Solve the system of equations {ui+vj = cij , for all i, j such that xij is a basic variable}, (where ui and vj are the unknowns) by setting one unknown to zero (e.g., ui = 0), and nd all the ui and vj corresponding to the current basic feasible solution. (4) If ui + vj cij 0 for all i, j such that xij is a non-basic variable, then go to step (5). If on the other hand ui + vj cij > 0, then we enter the variable with the most positive value of ui + vj cij into the basis. Then use the Base changing Procedure (described below) to obtain the new basis. And go to step (3). (5) End. The current basic feasible solution is optimal.
The Minimum Cost method assigned values to m + n 1 (3 + 4 1 = 6) variables and the set of cells corresponding to these variables does not contain a loop. A basic feasible solution given by this method is: - Basic variables: x11 = 5, x21 = 2, x22 = 8, x31 = 5, x33 = 4, x34 = 6; - Non-basic variables: x12 = x13 = x14 = x23 = x24 = x32 = 0.
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-69/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-70/78
Basis changing Procedure (1) Find a loop (there is only one possible loop) involving the entering variable (determined at Step (4) of the Transportation-Simplex Algorithm) and some of the basic variables. (2) Label 2, 3, 4, 5 successively the four cells involved in the loop, by starting from the cell corresponding to the entering variable and moving forward either on the same row or on the same column. (3) Find the odd labelled cell (in the loop) whose variable has the smallest value (let us denote by this value). The variable corresponding to this odd cell will leave the basis. The basis changing is performed as follows: Variables involved in the loop: Decrease by the value of each variable corresponding to a cell (of the loop) having an odd label. Increase by the value of each variable corresponding to a cell (of the loop) having an even label. Variables not involved in the loop: The variables not involved in the loop remain unchanged.
Remark 10. For a maximisation type problem, replace the Step (4) in the TransportationSimplex method by the following: (4) If ui + vj cij 0 for all i, j such that xij is a non-basic variable, then go to Step (5). If on the other hand ui + vj cij < 0, then we enter the variable with the most positive value of ui + vj cij into the basis. Then use the Base changing Procedure (described above) to obtain the new basis. And go to Step (3). Example 17. Consider the transportation problem stated in Example 12. The total demand equals the total supply (=125), therefore this problem is a balanced transportation problem. A basic feasible solution of the problem, obtained using the Northwest Corner is given in Tableau 1, below. Iteration 1
XX XXX XX XXX XX XXX XXX XX
Demanders
Suppliers
12
13 16
20
20 10
14
45
20
30
30 30
S Moutari, CenSSOR-QUB
Chapter 7
Page-71/78
S Moutari, CenSSOR-QUB
Iteration 2 We consider the updated tableau at the end of the previous iteration.
XX XX XXX XXX XX XXX XXX XX
Demanders
Suppliers
12
13
10
30
14
16
45
10 20
30
30 30
Since the most positive value of ui + vj cij corresponds to the non-basic variable x32, then this variable becomes basic. The loop involving x32 is
Cells (3, 2) (3, 3) (2, 3) (2, 2) Values of variables 0 10 20 20 Label 2 3 4 5 Basic variables (xij ) Values ui + vj = cij x11 35 u1 + v 1 = 8 x21 10 u2 + v 1 = 9 x22 10 u2 + v2 = 12 x23 30 u2 + v3 = 13 x32 10 u3 + v 2 = 9 x34 30 u3 + v 4 = 5
Therefore = 10, and the basic variable x33 should be removed from the basis. Then the values of the variables involved in the loop are updated as follow.
Cells (3, 2) (3, 3) (2, 3) (2, 2) Updated values of variables 0 + = 0 + 10 = 10 10 = 10 10 = 0 20 + = 20 + 10 = 30 20 = 20 10 = 10 Label 2 3 4 5
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-73/78
The most positive value of ui + vj cij corresponds to the non-basic variable x12, then
S Moutari, CenSSOR-QUB SOR 1001 - Introduction to Probability and Operational Research Chapter 7 Page-74/78
Therefore = 10, and the basic variable x22 should be removed from the basis. Then the values of the variables involved in the loop are updated as follow.
Cells (1, 2) (2, 2) (2, 1) (1, 1) Updated values of variables 0 + = 0 + 10 = 10 10 = 10 10 = 0 10 + = 10 + 10 = 20 35 = 35 10 = 25 Label 2 3 4 5
Iteration 3 We consider the updated tableau at the end of the previous iteration.
XX XXX XX XXX XX XXX XXX XX
The most positive value of ui + vj cij corresponds to the non-basic variable x13, then this variable becomes basic. The loop involving x13 is
Cells (1, 3) (2, 3) (2, 1) (1, 1) Values of variables 0 30 20 25 Label 2 3 4 5
Tableau 2 City 1
HH HH HH
Demanders
Suppliers
City 2 8 6 10
City 3 10
City 4 9 7 5
Supply 35 50 40 125
PP HH HH PP HH HH PP PP HH HH PP HH HH HH PP PP HH HH HH P PP PP H H HH HH PP PP PP PP HH HH PP PP HH HH PP PP PP PP HH HH PP PP H H PP P PP H H PP HH HH PP PP PP HH HH PP PP PP H H PP PP HH HH PP PP PP HH HH PP P
25
12
13
Therefore = 25, and the basic variable x11 should be removed from the basis. Then the values of the variables involved in the loop are updated as follow.
Cells (1, 3) (2, 3) (2, 1) (1, 1) Updated values of variables 0 + = 0 + 25 = 25 30 = 30 25 = 5 10 + = 20 + 25 = 45 25 = 25 25 = 0 Label 2 3 4 5
20
30
14
16
45
10 20
30
30 30
S Moutari, CenSSOR-QUB
Chapter 7
Page-75/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-76/78
Iteration 4 We consider the updated tableau at the end of the previous iteration.
XX XX XXX XXX XX XXX XXX XX
Since all the ui + vj cij are negative for all non-basic variables, then the current solution is optimal.
Supply 9 7 5 35 50 40 125
HH HH H HH HH H
Demanders
Suppliers
Report The optimal shipping plan for this company the following:
12
13
45
14
16
45
10 20
30
30 30
To City 1 City 2 City 3 City 4 Supply From Plant 1 10 million Kwh 25 million Kwh 35 Plant 2 45 million Kwh 5 million Kwh 50 Plant 3 10 million Kwh 30 million Kwh 40 Demand 45 20 30 30 125 Total cost: 1020
S Moutari, CenSSOR-QUB
Chapter 7
Page-77/78
S Moutari, CenSSOR-QUB
Chapter 7
Page-78/78