Linear Programming

chap-5a
B.V.Ramana
September 13, 2006
Chapter
17:59
5
Linear Programming
5.1 INTRODUCTION
Optimization problems seek to maximize or minimize a function of a number of variables which
are subject to certain constraints. The objective may
be to maximize the profit or to minimize the cost.
The variables may be products, man-hours, money
or even machine hours. Optimal allocation of limited resources to achieve a given object forms programming problems. A programming problem in
which all the relations between the variables is linear including the function to be optimized is called a
Linear Programming Problem (LPP). G.B. Dantzig,
in 1947, first developed and applied general problem
of linear programming. Classical examples include
transportation problem, activity-analysis problem,
diet problems and network problem. The simplex
method, developed by GB Dantzig, in 1947, continues to be the most efficient and popular method to
solve general LPP. Karmarkar’s method developed
in 1984 has been found to be upto 50 times as fast as
the simplex algorithm. LPP is credited to the works
of Kuhn, Tucker, Koopmans, Kantorovich, Charnes
Cooper, Hitchcock, Stiegler. LPP has been used to
solve problems in banking, education, distribution
of goods, approximation theory, forestry, transportation and petroleum.
5.2 FORMULATION OF LPP
In a linear programming problem (LPP) we wish to
determine a set of variables known as decision vari-
ables. This is done with the objective of maximizing or minimizing a linear function of these variables, known as objective function, subject to certain
linear inequality or equality constraints. These variables, should also satisfy the nonnegativity restrictions since these physical quantities can not be negative. Here linearity is characterized by proportionality and additivity properties.
Let x1 , x2 . . . , xn be the n decision unknown variables and c1 , c2 . . . , cn be the associated (constant
cost) coefficients. Then the aim of LP is to optimize
(extremise) the linear function,
z = c1 x 1 + c 2 x 2 + . . . + c n x n
(1)
Here (1) is known as the objective function. (O.F.)
The variables xj are subject to the following m linear
constraints
⎧ ⎫
⎨≥⎬
ai1 x1 + ai2 x2 + . . . + ain xn ≤ bi
(2)
⎩ ⎭
≥
for i = 1, 2, ... m. In (2), for each constraint only one
of the signs ≥ or ≤ or = holds. Finally xi should also
satisfy nonnegativity restrictions
xj ≥ 0 for j = 1 to n
(3)
Thus a general linear programming problem consists
of an objective function (1) to be extremized subject
to the constraints (2) satisfying the non-negativity
restrictions (3).
5.1
chap-5a
B.V.Ramana
5.2
September 13, 2006
17:59
MATHEMATICAL METHODS
Solution
To LPP is any set of values {x1 , x2 . . . , xn } which
satisfies all the m constraints (2).
Feasible Solution
To LPP is any solution which would satisfy the non
negativity restrictions given by (3).
Optimal Feasible Solution
To LPP is any feasible solution which optimizes (i.e.
maximizes or minimizes) the objective function (1).
From among the infinite number of feasible solutions to an LPP, we should find the optimal feasible
solution in which the maximum (or minimum) value
of z is finite.
Example 1: Suppose Ajanta clock company produces two types of clocks “standard” and “deluxe”
using three different inputs A, B, C. From the data
given below formulate the LPP to determine the number of standard and deluxe clock to be manufactured
to maximize the profit.
Let x1 and x2 be the number of “standard” and
“deluxe” clocks to be produced.
Technical coefficients
Input
(Resource)
A
B
C
Profit (Rs)
Standard
Deluxe
2
2
4
2
4
2
0
3
Capacity
20
12
16
Then the objective function is to maximize the
total profit i.e. maximize z = 2x1 + 3x2 , since the
profit for one standard clock is Rs 2 and profit for
one deluxe and clock is Rs 3. Because of the limited
resources, for input A we have the following restriction. Since one standard clock consumes 2 units of
resource A, x1 units of standard clocks consume 2x1
units of input A. Similarly 4x2 units of input A is
required to produce x2 deluxe clocks. Thus the total
requirement of the input A for production of x1 , standard and x2 deluxe clocks is
2x1 + 4x2 .
However, the total amount of resource A available is
20 units only. Therefore the restriction on resource
A is
2x1 + 4x2 ≤ 20
Similarly the restriction of resource B is
2x1 + 2x2 ≤ 12
and restriction on source C is
4x1 ≤ 16.
Since x1 , x2 are physical quantities (the number of
clocks produced), they must be non negative i.e.
x1 ≥ 0
and
x2 ≥ 0.
Thus the LPP consists of the O.F., three inequality
constraints and the non-negativity restrictions.
5.3 GRAPHICAL SOLUTION OF LPP
When the number of decision variables (or products)
is two, the solution to linear programming problem
involving any number of constraints can be obtained
graphically. Consider the first quadrant of the x1 x2
plane since the two variables x1 and x2 should satisfy the nonnegativity restrictions x1 ≥ 0 and x2 ≥ 0.
Now the basic feasible solution space is obtained in
the first quadrant by plotting all the given constraints
as follows. For a given inequality, the equation with
equality sign (replacing the inequality) represents a
straight line in x1 x2 plane dividing it into two open
half spaces. By a test reference point, the correct side
of the inequality is identified. Say choosing origin
(0, 0) as a reference point, if the inequality is satisfied then the correct side of the inequality is the side
on which the origin (0, 0) lies. Indicate this by an
arrow. When all the inequalities are plotted like this,
in general, we get a bounded (or unbounded in case
of greater than inequalities) polygon which enclose
the feasible solution space, any point of which is a
feasible solution.
For z = z0 , the objective function z = c1 x1 + c2 x2
represents an iso-contribution
(or iso-profit) straight
z0
c1
z
2
x
+
line say x2 = − c x1 + c or x1 = −c
2
c
c
2
2
1
1
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
such that for any point on this line, the contribution (Profit) (value of z0 ) is same. To determine the
optimal solution, in the maximization case, assigning arbitrary values to z, move the iso-contribution
line in the increasing direction of z without leaving the feasible region. The optimum solution occurs
at a corner (extreme) point of the feasible region.
So the iso-profit line attains its maximum value of
z and passes through this corner point. If the isocontribution line (objective function) coincides with
one of the edges of the polygon, then any point on
this edge gives optimal solution with the same maximum (unique) value of the objective function. Such
a case is known as multiple (alternative) optima case.
In the minimization case, assigning arbitrary values
to z, move the iso-contribution line in the direction
of decreasing z until it passes through a corner point
(or coincides with an edge of the polygon) in which
case the minimum is attained at this corner point.
5.3
Examples:
(a) x1 +3x2 ≥ 3, x1 +x2 ≥ 2, x1 , x2 ≥ 0,
Maximize: z = 1.5x1 + 2.5x2 unbounded feasible region, unbounded solution (can be maximized indefinitely)
Fig. 5.1
(b) x1 −x2 ≥ 0, −0.5x1 +x2 ≤ 1 x1 , x2 ≥ 0
Maximize: z = x2 − 0.75x1 unbounded feasible
region z2 = 0.5 is bounded optimal solution.
Range of Optimality
For a given objective function z = c1 x1 + c2 x2 , slope
of z changes as the coefficients c1 and c2 change
which may result in the change of the optimal corner
point itself. In order to keep (maintain) the current
optimum solution valid, we can determine
the range
of optimality for the ratio cc1 or cc2 by restricting the
2
1
variations for both c1 and c2 .
Special Cases:
(a) The feasible region is unbounded and in the case
of maximization, has an unbounded solution or
bounded solution.
(b) Feasible region reduces to a single point which
itself is the optimal solution. Such a trivial solution is of no interest since this can be neither maximized nor minimized.
(c) A feasible region satisfying all the constraints is
not possible since the constraints are inconsistent.
(d) LPP is ill-posed if the non-negativity restriction
are not satisfied although all the remaining constraints are satisfied.
Fig. 5.2
(c) x1 + x2 ≤ 2, −x1 , −5x2 ≤ −10
Maximize: z = −5x2 , x1 , x2 ≥ 0, (0, 2) is unique
solution, max: z = −10.
(0, 2)
Fig. 5.3
(d) x1 + x2 ≤ 1, −0.5x1 − 5x2 ≤ −10
Maximize: z = −5x2 , x1 , x2 ≥ 0. No feasible
region. Constraints are inconsistent
B.V.Ramana
5.4
September 13, 2006
17:59
MATHEMATICAL METHODS
Fig. 5.4
(e) 1.5x1 + 1.5x2 ≥ 9, x1 + x2 ≤ 2.
No feasible region.
(0, 6)
(0, 2)
(2, 0)
(6, 0)
WORKED OUT EXAMPLES
Range of
optimality
0
=
9
To determine the feasible solution space consider
the first quadrant of the x1 x2 -plane since x1 ≥ 0
and x2 ≥ 0. Then draw the straight lines x1 + 4x2 =
z=
x2
3x1 + x2 ≤ 21
(assembly) (III)
x1 ≥ 0 non negative
(IV)
x2 ≥ 0 constraints
(V)
1
C
+
(testing) (II)
Solution
Space
x1 + 4
x2 =
24
x1
x1 + x 2 ≤ 9
D
1
=2
(wiring) (I)
3
2
+ x2
3x 1
Solution: Let x1 be the number of business calculators (BC) produced while x2 be the number of
scientific calculators (SC) produced. Then the objective is to maximize the profit z = 4x1 + 10x2 subject
to the following fine constraints:
x1 + 4x2 ≤ 24
x2
z=
66
z=
60
z= E
54
z=
28
um
im
pt
O
Example 1: ABC company produces two types of
calculators. A business calculator requires 1 hour of
wiring, one hour of testing and 3 hours of assembly, while a scientific calculator requires 4 hours of
wiring, one hour of testing and one hour of assembly.
A total of 24 hours of wiring, 21 hours of assembly
and 9 hours of testing are available with the company.
If the company makes a profit of Rs 4 on business
calculator (BC) and Rs 10 on scientific calculator
(SC), determine the best product mix to maximize
the profit.
24, x1 + x2 = 9 and 3x1 + x2 = 2.1. Note that an
inequality divides the x1 x2 -plane into two open halfspace. Choose any reference point in the first quadrant. If this reference point satisfies the inequality
then the correct side of the inequality is the side on
which the reference point lies. Generally origin (0,
0) is taken as the reference point. The correct side of
the inequality is indicated by an arrow. The shaded
region is the required feasible solution space satisfying all the five constraints. The five corner points of
the feasible region are A(0, 0), B(7, 0), C(6, 3), D(4,
5), E(0, 6). Identify the direction in which z increases
without leaving the region. Arbitrarily choosing z =
0, 28, 54, 60, 66, observe that the straight lines (profit
z
function) z = 4x1 + 10x2 or x2 = − 25 x1 + 10
passes
through the corner points A, B, C, E, D respectively.
The optimum solution occurs at the corner point D(4,
5), where the maximum value for z = 66 is attained.
Thus the best product mix is to produce 4 business
and 5 scientific calculator which gives a maximum
profit of Rs. 66.
Increasing z
chap-5a
A
B
x1
Fig. 5.5
Example 2: (a) Solve the above problems to minimize z = −4x1 − 10x2 .
(b) If z = c1 x1 + c2 x2 , does an alternative optimal
solution exists
(c)Determine
the range of optimality for the ratio
c1
c2
or
.
c
c
2
1
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
z
Solution: (a) Rewriting, x2 = − 25 x1 − 10
. Choose
z = 0, −28, −54, −60, −66, then the objective
function passes through the corner points A, B, C,
E, D respectively. Thus the minimum value z = −66
is attained at the corner point D(4, 5). Observe that
maximum of z = 4x1 + 10x2 is 66 and minimum of
z = −4x1 − 10x2 is − 66
i.e., max f (x) = − min (−f (x)).
(b) If z = c1 x1 + c2 x2 coincides with the straight line
CD: x1 + x2 = 9, then any point on the line segment
CD is an optimal solution to the current problem and
thus has multiple (infinite) alternative optima.
(c) Let z = c1 x1 + c2 x2 be the objective function.
Then for c2 = 0, we write this as
−c1
z
x1 +
x2 =
c2
c2
The straight line
x1 + 4x2 = 24 rewritten as x2 = − 41 x1 + 24
has
4
1
slope − 4 and the straight line x1 + x2 = 9 rewritten
as x2 = −x1 + 9 has slope −1. Thus range of optimality which will keep the present optimum solution
valid is
c1
1
≤1
≤
4
c2
For c2 = 4, 1 ≤ c1 ≤ 4
Similarly for c1 = 0, the range of optimality is
1 ≤ cc2 ≤ 4. For c1 = 2, 2 ≤ c2 ≤ 8.
10S + 10Y ≥ 80
and X, Y ≥ 0
Draw the straight lines
Fertilizer Nitrogen Phos. Potassium Price/100 kgs bag
A
20% 10%
10%
Rs 50
B
10% 20%
10%
Rs 40
Determine the number of bags of fertilizer A and
B which will meet the minimum requirements such
that the total cost is minimum.
Solution: Let X be the number of bags of fertilizer
A purchased and Y be the number of bags of fertilizer
B purchased. Then the objective is to minimize the
total cos t = z = 50X + 40Y
subject to
20X + 10Y ≥ 120
(Nitrogen)
10X + 20Y ≥ 100
(Phosphorous)
(Potassium)
2X + Y = 12
(1)
X + 2Y = 10
(2)
X+Y =8
(3)
A(0, 12), B(4, 4), C(6, 2), D(10, 0)
Decreasing
direction
of z
Y
1
A
3
(Unbounded)
Feasible
region
2
B
C
D
3
2
X
z
z =5
z =z = 3 = 480 00
8
1 360 0
Fig. 5.6
1
Example 3: The minimum fertilizer needed/hector
is 120 kgs nitrogen, 100 kgs phosphorous and 80 kgs
of potassium. Two brands of fertilizers available have
the following composition.
5.5
Objective function: iso-profit equation:
z
5
Y =− X+
4
40
(4)
Choose z = 500, 480, 380, 360 then (4) passes
through the corner points D, A, C, B respectively.
Thus the optimal solution occurs at B(4, 4) i.e. purchase four bags of fertilizer A and 4 bags of fertilizer
B with a total minimum cost of Rs 360/-.
EXERCISE
Solve the following LPP graphically:
1. Right Wood Furniture Company manufactures
chairs and desks. The time required (in minutes)
and the total available time is given below. If company sells a chair for a profit of Rs. 25 and desk
chap-5a
B.V.Ramana
5.6
September 13, 2006
17:59
MATHEMATICAL METHODS
for a profit of Rs 75/- determine the best product
mix that will maximize the profit.
Fabrication
Assembly
Upholstery
Linoleum
Chair
Desk
15
12
18.75
–
40
50
–
56.25
Input
Output
Process Crude A Crude B Gasoline X Gasoline Y
I
5
3
5
8
II
4
5
4
4
Available
time
27,000
27,000
27,000
27,000
Ans: Produce 1000 chairs and 300 desks, making a
profit of Rs 47,500.
Ans:
Hint: Corner points are A(0, 0), B(1440, 0),
C(1440, 135), D(1000, 300), E(250, 480), F(0,
480): Maximize: z = 25X + 75Y . s.t.
15X + 40Y ≤ 27, 000,
12X + 50Y ≤ 27000,
18.75X ≤ 27000, 56.25Y ≤ 27000
2. Asia paints produces two types of paints with the
following requirements.
Standard Delux Total Available
Paint Quantity (in tons)
Paint
Base
4
24
6
Chemicals
2
6
1
Profit (in 100’s) 5
4
A maximum of 200 units of crude A and 150
units of crude B are available. It is required to
produce at least 100 units of gasoline X and 80
units of gasoline Y . The profit from process I is Rs
300 while from process II is Rs 400. Determine
the optimal mix of the two processes.
Produce 30.7 units by process I and 11.5 units
from process II, getting a maximum profit of Rs
13,846.20.
Hint: Maximize: z = 300x1 + 400x2 , subject to
5x1 + 4x2 ≤ 200, 3x1 + 5x2 ≤ 150
5x1 + 4x2 ≥ 100, 8x1 + 4x2 ≥ 80
Corner points: A(20,
0), B(40, 0), D(0, 30),
150
E(0, 25), C 400
,
13
13
4. Minimize
z = 0.3x1 + 0.9x2
subject
to
x1 + x2 ≥ 800, 0.21x1 − 0.30 x2 ≥ 0, 0.03x1 −
−0.01 x2 ≥ 0, x1 , x2 ≥ 0
Ans: x1 = 470.6, x2 = 329.4, minimum cost: Rs
437.64.
5. Maximize: z = 30x1 + 20x2 subject to x1 ≤ 60,
x2 ≤ 75, 10x1 + 8x2 ≤ 800.
Determine the optimum (best) product mix of the Ans: x1 = 60, x2 = 25, Max: profit = Rs 2300
Hint: Corner points: A(0, 0), B(60, 0), C(60, 25),
paints that maximizes the total profit for the comD(20, 75), E(0, 75).
pany. Demand for deluxe paint can not exceed
that of standard paint by more than 1 ton. Also
6. Given x1 ≥ 0, x2 ≥ 0, x1 + 2x2 ≤ 8, 2x1 − x2 ≥
maximum demand of deluxe paint is 2 tons.
−2 solve to (a) max x1 (b) max x2 (c) min x1 (d)
min x2 (e) max 3x1 + 2x2 (f) min −3x1 − 2x2 (g)
Ans: Produce 3 tons of standard and 1.5 tons of deluxe
max 2x1 − 2x2
paint, making a profit of Rs 2100.
Hint: Corner points: A(0, 0), B(4, 0), C(3, 1.5), Ans: (a) x1 = 8 (b) x2 = 18
(c) x1 = 0 (d) x2 = 0 (e) z
5
D(2, 2), E(1, 2), F(0, 1); OF: Maximize z = 5x1 +
= 24, x1 = 8, x2 = 0 (f) z = −24, x1 = 8, x2 = 0
4x2 subject to
, x1 = 45 , x1 = 18
(g) z = − 28
5
5
6x1 + 4x2 ≤ 24, x1 + 2x2 ≤ 6,
−x1 + x2 ≤ 1, x2 ≤ 2, x1 , x2 ≥ 0.
7. Minimize
z = x1 + x2
x2 ≥ 0
2x1 = x2 ≥ 12,
x1 + 6x2 ≥ 28.
s.t.
x1 ≥ 0,
5x1 + 8x2 ≥ 74,
3. In an oil refinery, two possible blending processes Ans: x = 2, x = 8, min. 10
1
3
for which the inputs and outputs per production
Hint: Unbounded region with corner points
run are given below.
A(0, 12), B(2, 8), C(10, 3), D(28, 0)
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
8. Maximize: z = 5x1 + 3x2 s.t. x1 ≥ 0, x2 ≥ 0,
3x1 + 5x2 ≤ 15, 5x1 + 2x2 ≤ 10
Ans: x1 = 1.053, x2 = 2.368, Max: 12.37
Hint: Corner points: (0, 3), (1.053, 2.368), (2, 0)
9. Maximize: z = 2x1 − 4x2 s.t. x1 ≥ 0, x2 ≥ 0,
3x1 + 5x2 ≥ 15, 4x1 + 9x2 ≤ 36
Ans: x1 = 9, x2 = 0, Max: 18
Hint: Corner point: (0, 3), (0, 4), (5, 0) (9, 0)
10. Maximize: z = 3x1 + 4x2 s.t. x1 ≥ 0, x2 ≥ 0,
2x1 + x2 ≤ 40, 2x1 + 5x2 ≤ 180
Ans: x1 = 2.5, x2 = 35, z = 147.5
Hint: Corner points: 0(0, 0), A(20, 0), B(2.5, 35),
C(0, 36)
11. Minimize z = 6000x1 + 4000x2 s.t. x1 ≥ 0, x2 ≥
0, 3x1 + x2 ≥ 40, x1 + 2.5x2 ≥ 22, x1 + x2 ≥
40
.
3
Ans: x1 = 12, x2 = 4, zmin = 88,000
Hint: A(22, 0), B(12, 4), C(0, 40)
Note: Constraint x1 + x2 ≥ 40
is redundant.
3
12. Maximize z = 45x1 + 80x2 s.t. 5x1 + 20x2 ≤
400, 10x1 + 15x2 ≤ 450.
Ans: x1 = 24, x2 = 14, z = Rs2200.
5.4 CANONICAL AND STANDARD FORMS
OF LPP
Since max f (x) = − min (−f (x)), an LPP with
maximation can be transferred to a minimization
problem and vice versa. Thus, the following analysis
can be applied for a maximization or minimization
problem without any loss of generality.
Canonical form of LPP is an LPP given by (1) (2)
(3) with all the constraints (2) are of the less than or
equal to type.
Standard form of LPP consists of (1) (2) (3) with all
constraints (2) are of the equality type and with all
bi ≥ 0, for i = 1 to m.
Conversion to Standard Form Given any general
LPP, it can be transformed to standard LPP as follows:
1. In any constraint if the right hand side constant bi is negative, then multiply that constraint
5.7
throughout by −1. (Note that multiplication of an
inequality constraint by −1, reverses, the inequality sign i.e. −3 < −2, multiplied by −1 we get
(−1)(−3) > (−1)(−2) or 3 > 2.
2. A
less than or equal to type constraint
aij xj ≤ bi ; (bi ≥ 0) gets transformed to an
j
equality aij xj + si = bi
j
by the addition of a ’slack’ variable si , which
is non negative.
3. A greater
than or equal to type constraint
aij xj ≥ bi ; (bi ≥ 0)
j
can
be transformed to an equality
aij xj − si = bi
by subtracting a ’surplus’ variable Si , which
is non negative. In general, it is more convenient
to work with equations rather than with inequalities. So given any general LPP, convert it to a
standard LPP, consisting of ’m’ simultaneous linear equations in "n" unknown decision variables.
Minimize:
z = c1 x1 + c2 x2 + · · · + cn xn (1)
subject to
⎫
a11 x1 + a12 x2 + · · · + a1n xn = b1 ⎪
⎪
⎬
a21 x1 + a22 x2 + · · · + a2n xn = b2
(2)
− − − − − − − − − − − − − − −⎪
⎪
⎭
am1 x1 + am2 x2 + · · · + amn xn = bm
and x1 , x2 , x3 , · · · xn ≥ 0 (3)
Here cj (Prices), bj (requirements) and ai,j
(activity coefficients) for i = 1 to m, j = l to n)
are known constants.
If m > n, discard the m − n redundant equations. If m = n, the problem may have a unique
(single) solution which is of no interest since
it can neither be maximized or minimized. If
m < n, which ensures that none of the equations
is redundant, then there may exist infinite number
of solutions from which an optimal solution can
be obtained.
Assume that m < n. Set arbitrarily any
n − m variables equal to zero and solve the m
equations for the remaining m unknowns. Suppose the unique solution obtained be
{x1 , x2 , · · · xm }, by setting the remaining
(n − m) variables
xm+1 , · · · , xn all to zero.
chap-5a
B.V.Ramana
5.8
September 13, 2006
17:59
MATHEMATICAL METHODS
Basic solution
{x1 , x2 , · · · , xm } is the solution of the system of equations (2) in which n − m variables are set to zero.
Basic variables
are the variables x1 , x2 , · · · , xm in the basic solution.
Basis
is the set of m basic variables in the basic solution.
Non-basic variables
xm+1 , xm+2 , · · · xn are the (n − m) variables which
are equated to zero to solve the m equations (2),
(resulting in the basic solution).
Basic feasible solution
is a basic solution which satisfies the nonnegativity
restrictions, (3) i.e. all basic variables are non negative. (i.e. xj ≥ 0 for j = 1, 2, 3, · · · m)
Nondegenerate basic feasible solution
is a basic feasible solution in which all the basic variables are positive (i.e., xj > 0 for j = 1, 2, 3, · · · m)
Optimal basic feasible solution
is a basic feasible solution which optimizes (in this
case minimizes) the objective function (1).
Why Simplex Method
In an LPP with m equality constraints and n variables with m < n, the number of basic solutions is
nc m. For small n and m, all the basic solutions (corner points) can be enumerated (listed out) and the
optimal basic feasible solution can be determined.
Example:
Maximize: z = 2x1 + 3x2 s.t. 2x1 + x2 ≤ 4, x1 +
2x2 ≤ 5. Rewriting 2x1 + x2 + x3 = 4, x1 + 2x2 +
x4 = 5. Here m = 2, n = 4, nc m = 4c 2 = 6 The six
basic solutions are: 1. (0, 0, 4, 5), Feasible (F), Nondegenerate (ND) and z = value of O.F = 0
2. (0, 4, 0, -3), NF (non feasible)
3. (0, 2.5, 1.5, 0), z = 7.5 F, ND
4. (2, 0, 0, 3), z = 4, F, ND
5. (5, 0, - 6, 0), NF
6. (1, 2, 0, 0), z = 8,
Feasible nondegenerate and optimal.
However, even for n = 20, m = 10, the number
of basic solutions to be investigated is 1,84,756, a
large part of which are infeasible. It is proved that
the set of feasible solutions to a LPP form a convex
set (the line joining any two points of the set lies in
the set) and the corner (extreme) points of the convex
set are basic feasible solutions. If there is an optimal
solution, it exists at one of these corner points. The
simplex method devised by GB Dantzig is a powerful procedure which investigates in a systematic way
for optimal solution at these corner points which are
finite in number.
For m = 10, n = 20, simplex method obtains the
optimal in 15 steps, thus having an advantage of
92,378 to 1.
5.5 SIMPLEX METHOD
The simplex method is an algebraic iterative procedure which solves any LPP exactly (not approximately) or gives an indication of an unbounded solution. Starting at an initial extreme point, it moves
in a finite number of steps, between m and 2m, from
one extreme point to the optimal extreme point. Consider the following LPP with ’m’ less than or equal
to inequalities in ’n’ variables.
Maximize z = c1 x1 + c2 x2 + · · · + cn xn
subject to a11 x1 + a12 x2 + · · · + a1n xn ≤ b1
a21 x1 + a22 x2 + · · · + a2n xm ≤ b2
..........................................
am1 xm1 + am2 x2 + · · · + amn xn ≤ bm
Introducing ’m’ slack variables s1 , s2 , . . ., sm , the
less than or equal to in equalities are converted to
equations.
a11 x1 + a12 x2 + · · · + a1n xn + s1 = b1
a21 x1 + a22 x2 + · · · + a2n xn + s2 = b2
..........................................
am1 x1 + am2 x2 + · · · + amn xn + · · · + sm = bm
Here x1 , x2 , · · · , xn , s1 , s2 , · · · , sm are all nonnegative i.e. ≥ 0. The objective function is rewritten as
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
Maximize: z = c1 x1 + · · · + cn xn + 0.s1 + · · · +
0.sm .
Thus there are m equations in m + n variables.
Putting (m + n) − m = n variables zero we get a
starting basic feasible solution. Take x1 = x2 =
· · · xn = 0. Then the initial solution contains the m
basic variables s1 , s2 · · · , sm . This corresponds to the
corner point origin with value of the objective function zero. Since this is a problem of maximization,
the value of objective function will increase if we
introduce one of non-basic variable xj (j = 1 to n),
into the solution forcing out one of the basic variable.
The obvious choice is the xj with the largest cj . Ties
are broken arbitrarily. The objective equation is written as z − c1 x1 − c2 x2 − · · · − cn xn + 0.s1 + · · · +
0.sn = 0
For efficient use, this data is written in the form of
a table known as simplex tableau shown below:
5.9
Suppose abiji is the smallest non negative ratio
among these ratios
bi b2
bm
,
,···
,
aij a2j
amj
then the basic variable si will leave the basis (and
therefore will become a non basic variable). The ith
row is known as the pivotal row. The element aij
at the intersection of the pivotal column and pivotal
row is known as the pivotal element, which is encircled in the table step III. Compute the new simplex
tableau with (s1 , s2 , · · · , xj , · · · , sm ) as the new basis
compute.
Pivot row:
pivot row
New pivot row = current
.
pivot element
¼
¼
¼
¼
¼
sm
0
0
¼
s2
0
0
1
¼
¼
¼
Solution
0
b1
b2
¼
amn
0
0
¼
If all the z-row coefficients of the nonbasic variables
are nonnegative, then the current solution is optimal.
Stop. Otherwise goto step I.
Step I. Entering variables: Suppose - cj , the z-row
coefficient of the non basic variables xj is the most
negative, then the variable xj will enter the basis. The
j th column is known as the pivotal column.
Step II. Leaving variable: Divide the solution column with the corresponding elements of the pivotal
column, with strictly positive denominator. Ignore
the ratios, when the pivotal column elements are zero
or negative.
¼
Test for optimality
s1
0
1
0
¼
¼
The first row, z-row contains the coefficients of
the objective equation with last element in rectangle
indicating the current value of the objective function (In the present case it is zero). The left most
(first) column indicates the current basic variables
s1 , s2 , · · · , sm . The right most (last) column is the
solution column. Thus s1 = b1 , s2 = b2 , · · · , sm =
bm (all resources unused) is the basic solution with
the value of the objective function zero.
xn
– cn
a1n
a2n
¼
am2
¼
am1
¼
0
¼
sm
xj
– cj
a1j
a2j
aij
amj
¼
x2
– c2
a12
a22
¼
x1
– c1
a11
a21
¼
z
1
0
0
¼
Basis
z
s1
s2
¼
Remark
c1-row
s1-row
s2-row
si-row
sm-row
1
bm
All other rows including z:
New row = current row - (Corresponding pivot
column coefficient) × (New pivot row).
The solution-column in the new tableau readily
gives the new basic solution with new objective value
(last element in the z-row). Now test for optimality.
If yes, stop. Otherwise go to step I.
Optimality condition
The nonbasic variable having the most negative (positive) coefficient coefficient in the z-row will be the
entering variable in a maximization (minimization)
problem. Ties are broken arbitrarily. When all the zrow coefficients of the non basic variables are nonnegative (nonpositive) then the current solution is
optimal.
Feasibility condition
In both the maximization and minimization problems, the basic variable associated with the smallest
nonnegative ratio (with strictly positive denominator) will be the leaving variable.
chap-5a
B.V.Ramana
5.10
September 13, 2006
17:59
MATHEMATICAL METHODS
Thus the simplex method can be summarized as
follows:
Step 0. If all the constraints are less than or equal
to type, introduce slack variables and determine the
starting basic solution.
Step I. Using optimality condition, select the entering variable. If no variable can enter the basis, stop.
The current solution is optimal.
Step II. Using feasibility condition determine the
leaving variable.
Step III. Compute the new basic solution (new simplex tableau) and go to step I.
Artificial Variable Technique
For a LPP in which all the constraints are less than or
equal to type with bi ≥ 0, an all-slack, initial basic
feasible solution readily exists. However for problems involving ≥ inequalities or equality constrains
no such solution is possible. To alleviate this, artificial variables are introduced in each of the ≥ or =
type constraints, and slack variables for the less than
or equal to type which will then provide a starting
solution. The M-method and the two-phase method
are two closely related methods involving artificial
variables.
M-Method (also Known as Charne’s Method
or Big M-Method)
Since artificial variables are undesirable, the coefficient for the artificial variable in the objective function is taken as − M in maximization problem and
as + M in minimization problems. Here M is a very
large positive (penalty) value. The augmented problem is solved by simplex method, resulting in one of
the following cases:
1. When all the artificial variables have left the basis
and optimality condition is satisfied, then the current solution is optimal.
2. When one or more artificial variables are present
in the basis at zero level and the optimality condition is satisfied, then the solution is optimal with
some redundant constraints
3. No feasible solution exists when one or more artificial variables are present in the basis at a positive
level although the optimality condition is satisfied. Such a solution is known as pseudo optimal
solution since it satisfies the constraints but does
not optimize the objective function.
Note: Since artificial variables which is forced out
of the basis, is never considered for reentry, the column corresponding to the artificial variable may be
omitted from the next simplex tableau.
Two-Phase Method
In the M-method, M must be assigned some specific
numerical value which creates trouble of roundoff
errors especially in computer calculations. The zcoefficient of the artificial variable will be of the form
aM + b. For large chosen M, b may be lost and for
small chosen M and small a, b may be present leading
to incorrect results. The two phase method consists
of two phases and alleviates the difficulty in the Mmethod.
Phase I
Exactly as in M-method, introduce necessary artificial variables to get an initial basic feasible solution.
Solve this augmented problem, by simplex method
to minimize r, the sum of the artificial variables. If
r = 0, then all the artificial variables are forced out
of the basis. Goto phase II. If r > 0, indicating the
presence of artificial variables at non zero level, LP
has no feasible solution
Phase II
The feasible solution of phase I forms the initial basic
feasible solution to the original problem (without any
artificial variables). Apply simplex method to obtain
the optimal solution.
WORKED OUT EXAMPLES
Enumeration
Example 1: Solve the following LPP by enumerating all basic feasible solutions. Identify the infeasible
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
solutions. Find the optimal solution and the value of
the objective function.
Maximize z = 2x1 + 3x2 + 4x3 + 7x4 subject to
2x1 + 3x2 − x3 + 4x4 = 8
x1 − 2x2 + 6x3 − 7x4 = −3
and x1 , x2 , x3 , x4 ≥ 0.
Solution: The number of equations m = 2. The
number of variable n = 4. The number of basic variables = m = 2. The number of all possible solutions
is 4 c2 = 6.
1. Put x3 = x4 = 0, solving 2x1 + 3x2 = 8, x1 −
2x2 = −3, we get x1 = 1, x2 = 2, z = 8. Basic
feasible solution, not optimal, x1 , x2 are basic
variables, x3 , x2 are non basic variables (which
are always zero).
2. Put x2 = x4 = 0. Solving 2x1 − x3 = 8, x1 +
, x3 = − 14
. Since x3 <
6x3 = −3, we get x1 = 45
13
3
0, this is a basic non feasible solution.
3. Put x1 = x4 = 0. Solving 3x2 − x3 = 8, −2x2 +
7
6x3 = −3, we get x2 = 45
, x3 = 16
, z = 163
. This
16
16
is a basic feasible solution (not optimal).
4. Put x3 = x2 = 0, solving 2x1 + 4x4 = 8, x1 −
7x4 = −3, we get x1 = 22
, x4 = 79 , z = 93
, basic
9
9
feasible solution (not optimal).
5. Put x1 = x3 = 0. Solving 3x2 + 4x4 = 8, 2x2 +
, x4 = −7
7x4 = 3 we get x2 = 44
. This is a basic
13
13
non feasible solution.
6. Put x1 = x2 = 0. Solving −x3 + 4x4 = 8, 6x3 −
, x4 = 45
7x4 = −3, we get x3 = 44
. Thus the opti17
17
mal basic feasible solution with the basic variables x3 = 44
, x4 = 45
(and obviously the remain17
17
ing non basic variables x1 , x2 at zero value) has
the maximum value of the objective function as
491
.
17
Solution: Introducing three slack variables, the
given three less than or equal to inequality constraints
will be expressed as equations. Assign zero cost to
each of these slack variables. Then the standard form
of the LPP is to
Maximize z = 2x1 + 3x2 + 0 · s1 + 0 · s2 + 0 · s3
subject to
2x1 + 4x2 + s1
2x1 + 2x2
= 20
= 12
+ s2
+ s3 = 16
4x1
and x1 , x2 , s1 , s2 , s3 ≥ 0
Express the objective equation as
z − 2x1 − 3x2 = 0
Then the starting simplex tableau is represented as
follows:
Basis
z
s1
s2
s3
z x1 x2
1 –2 –3
0 2
4
0 2
2
0 4
0
s1
0
1
0
0
s2
0
0
1
0
s3 Solution Remark
0
0
z-row
0
20
s1-row
0
12
s2-row
1
16
s3-row
Corner points: A(0, 0), B(4, 0), C(4, 2), D(2, 4), E(0,
5). Value of O.F. at these extreme points: zA = 0,
zB = 8, zC = 14, zD = 16, zE = 15
x2
3
E
D
optimum (x1 = 2, x2 = 4)
zD = 16
C
A
1
x1
B
Simplex Method: Maximization
Example 1: Solve the following LPP by simplex
method.
Maximize z = 2x1 + 3x2
subject to 2x1 + 4x2 ≤ 20
2x1 + 2x2 ≤ 12
4x1 ≤ 16
x1 ≥ 0, x2 ≥ 0
5.11
2
Fig. 5.2
The initial basis consists of the three basic variables s1 = 20, s2 = 12, s3 = 16. The two non basic
variables are x1 = 0, x2 = 0. Note that non basic variables are always equal to zero. Thus this solution
corresponds to the corner (extreme) point A (0, 0) in
the graph. In the simplex tableau all the three basic
chap-5a
B.V.Ramana
5.12
September 13, 2006
17:59
MATHEMATICAL METHODS
variables are listed in the left-most (first) column
and their values (including the value of the objective
function), in the right-most (last) column. Here the
value of OF is 0 since all the resources are unutilized.
In the z-row, the value of the objective function in the
solution column is enclosed in a square. Since this is
a maximization problem, to improve (increase) the
value of z, one of the non-basic variables will enter
into the basis and there by forcing out one of the
current basic variable from the basis (since the number of basic variables in the basis is fixed and equals
to m = 3 the number of constraints). From the optimality condition, the entering variable is one with
the most negative coefficient in the z-row. In the zrow the most negative elements is −3. Thus the non
basic variable x2 will enter the basis. To determine the
leaving variable, calculate the ratios of the right-hand
side of the equations (solution-column) to the corresponding constraint coefficients under the entering
variable x2 , as follows:
Basis
Entering
x2
Solution
S1
4
20
S2
2
12
S3
0
16
i.e.,
0
2
4
1
2
4
4
1
1
4
1
4
= (0, 2, 2, 0, 1, 0, 12)−
−2 0, 21 , 1, 41 , 0, 0, 5 =
= (0, 1, 0, − 21 , 1, 0, 2)
New s3 -row = current s3 -row-(0) × (new pivot row)
= current s3 -row itself
= 0, 4, 0, 0, 0, 1, 16
Summarizing these results we get the new simplex
tableau corresponding to the new basis (x2 , s2 , s3 ) as
follows. Note that this new basis corresponds to the
corner point E(0, 5) with value of OF as 15.
z
x1
x2
s1
s2
s3
solution
z
1
0
0
15
0
0
0
5
s2
0
1
0
3
4
1
4
– 1
2
0
x2
– 1
2
1
2
1
0
2
x3
0
4
0
0
0
1
16
Basis
1
Ratio
20 = 5 minimum
4
12 = 6
2
16 = ¥ (Ignore)
0
Therefore s1 is the leaving variable. The value of
the entering variable x2 in the new solution equals to
this minimum ratio 5. Here s1 -row is the pivot row;
x2 column is the pivot column and the intersection
of pivot column and pivot row is the pivot element
4 which is circled in the tableau. The new pivot row
is obtained by dividing the current pivot row by the
pivot element 4. Thus the new pivot row is
0
4
New s2 -row = current s2 -row−(2) new pivot row
0
4
0
4
20
4
0
0
5
Recall that for all other rows, including z-row,
New row = current row − (corresponding pivot
coefficient) × (new pivot row)
New z-row = current z-row − (− 3) new pivot row
= (1, − 2, − 3, 0, 0, 0, 0)+
1
1
+3 0, , 1, , 0, 0, 5
2
4
1
3
= 1, − , 0, , 0, 0, 15
2
4
From the tableau, the solution is
x2 = 5, s2 = 2, s3 = 16 (basic variables)
x1 = 0, s1 = 0 (non basic variables), value of OF is
15.
Thus the solution moved from corner point A to
corner point E in this one iteration. Optimal solution
is not reached since all elements of z-row are not
non negative. Since − 21 is the most negative element
in the current z-row, the variable x1 will enter the
basis. To determine the leaving variable again calculate the ratios of RHS column with the elements of
the entering variable x1 .
Basis
Entering
x1
Solution
Ratio
x2
1
2
5
10
s2
1
2
2
x3
4
16
4
minimum
Therefore, s2 will leave the basis. The pivotal element is one; so pivot row remain the same. The
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
new simplex tableau corresponding to the new basis
(x2 , x1 , s3 ) is given below.
basic variables.
Basis
Basis
z
x1
x2
s1
1
2
1
2
– 1
2
z
1
0
0
x2
0
0
1
x1
0
1
0
s3
0
0
0
5.13
x1
x2
x3
x4
x5
x6
Solution
s2
s3
Solution
z
–1
–1
–1
0
0
0
13
1
2
– 1
2
0
16
x1
1
0
0
–1
0
–2
5
0
4
x2
0
1
0
2
–3
1
3
1
0
2
x3
0
0
1
2
–5
6
5
53
6
20
3
13
6
5
6
213
30
213
30
13
10
2
5
2
1
–4
− 21
8
pivot row
Here new z-row = current z-row −
= 1, − 21 , 0, 43 , 0, 0, 15 ×
× − − 21 0, 1, 0, − 21 , 1, 0, 2 =
= 1, 0, 0, 21 , 21 , 0, 16
Here new x2 -row = (current x2 row) − 21 (pivot row)
= 0, − 21 , 0, 43 , 0, 0, 15 ×
× − (1) 21 , 0, 1, 0, − 21 , 1, 0, 2 =
= 1, 0, 0, 21 , 21 , 0, 16
Here new s3 -row = current s3 -row − 4(pivot row)
= (0, 4, 0, 0, 0, 1, 16)
−4 0, 1, 0, − 21 , 1, 0, 2 =
= (0, 0, 0, 2, −4, 1, 8)
Since all the elements in the current z-row are nonnegative, the current solution is optimal. Read the
solution from the tableau as
x2 = 4, x1 = 2, s3 = 8 (basic variables)
s1 = 0, s2 = 0 (non basic variables)
value of O. F is 16.
Note that this solution corresponds to the corner
point D(2, 4). In this second iteration solution moved
from E to D.
Simplex Method: Minimization:
Example 1: Minimize: z = x1 + x2 + x3 subject
to x1 − x4 − 2x6 = 5, x2 + 2x4 − 3x5 + x6 = 3,
x3 + 2x4 − 5x5 + 6x6 = 5.
Solution: Fortunately the problem contains already
a starting basic feasible solution with x1 , x2 , x3 as the
z
–1
–1
–1
0
0
0
x1
1
0
0
1
x6
0
0
– 1
3
5
3
1
3
–5
3
– 13
6
5
–
6
0
x2
1
3
– 1
6
1
6
z
–1
–1
–1
0
0
0
x1
1
x6
0
– 63
30
– 13
10
– 2
5
0
0
3
10
– 1
10
+ 4
15
0
x4
1
5
3
5
– 1
5
1
0
Optimal
solution:
2
213
O.F
:
.
5
30
x1 =
0
1
0
1
213
, x4
30
=
13
, x6
10
=
Unbounded solution:
Example 1: Solve LPP by simplex method.
Maximize: z = 2x1 − 3x2 + 4x3 + x4 subject to
x1 + 5x2 + 9x3 − 6x4 ≥ −2
3x1 − x2 + x3 + 3x4 ≤ 10
−2x1 − 3x2 + 7x3 − 8x4 ≥ 0
and x1 , x2 , x3 , x4 ≥ 0.
Solution: Rewriting in the standard form
−x1 − 5x2 − 9x3 + 6x4 ≤ 2
3x1 − x2 + x3 + 3x4 ≤ 10
2x1 + 3x2 − 7x3 + 8x4 ≤ 0
Introducting 3 slack variables x5 , x6 , x7 we write the
LPP as
maximize: z = 2x1 − 3x2 + 4x3 + x4 + 0 · x5 + 0 ·
x6 + 0 · x 7
subject to
−x1 − 5x2 − 9x3 + 6x4 + x5
3x1 − x2 + x3 + 3x4
2x1 + 3x2 − 7x3 + 8x4
=2
+ x6
= 10
+ x7 = 0
chap-5a
B.V.Ramana
5.14
September 13, 2006
17:59
MATHEMATICAL METHODS
Objective equation is: z−2x1 +3x2 −4x3 −x4 = 0
The first simplex tableau with the 3 basic variables
x5 , x6 , x7 is given below:
Basis
x1
x2
x3
x4
x5
x6
x7
Solution
z
–2
3
–4
–1
0
0
0
0
x5
–1
–5
–9
6
1
0
0
2
x6
3
–1
1
3
0
1
0
10
x7
2
3
–7
8
0
0
1
0
Since −4 is most negative element in the z-row, the
associated variable x3 will enter the basis. Out of the
2 10 0
three ratios −9
, 1 , −7 , the first and third are ignored
(because the denominator is negative). So x6 will
be outgoing variable. The pivotal element is 1. So
pivotal row remains same. The next simplex tableau
with x5 , x3 , x7 is given below.
Basis
x1
x2
x3
x4
x5
x6
x7
Solution
z
10
–1
0
11
0
4
0
40
x5
26
– 14
0
33
1
9
0
92
x6
3
–1
1
3
0
1
0
10
x7
23
–4
0
29
0
7
1
70
In the current z-row, x2 has the most negative coefficient − 1, so normally x2 should enter the basis.
However, all the constraint coefficients under x2 are
negative, meaning that x2 can be increased indefinitely without violating any of the constraints. Thus
the problem has no bounded solution.
M-method:
Example 1: Solve the LPP by M-method
minimize z = 3x1 + 2.5x2
subject to
2x1 + 4x2 ≥ 40
3x1 + 2x2 ≥ 50
x1 , x2 ≥ 0
Solution: Introducing surplus variables x3 , x4 , the
greater than inequations are converted to equations.
Minimize z = 3x1 + 2.5x2 + 0 · x3 + 0 · x4
subject to
2x1 + 4x2 − x3 = 40
3x1 + 2x2 − x4 = 50
x1 , x 2 , x 3 , x4 ≥ 0
In order to have a starting solution, introduce two
artificial variables R1 and R2 in the first and second
equations. In the objective function the cost coefficients for these undesirable artificial variables R1 and
R2 are taken as a very large penalty value M. Thus
the LPP takes the following form:
Minimize z = 3x1 + 2.5x2 + 0 · x3 + 0 · x4 +
+ M · R1 + M · R 2
(1)
subject to
2x1 + 4x2 − x3 + R1 = 40
(2)
(3)
3x1 + 2x2 − x4 + R2 = 50
and x1 , x2 , x3 , x4 , R1 , R2 ≥ 0
The z-column is omitted in the tableau for convenience because it does not change in all the iterations.
Solving (2) and (3) we get
R1 = 40 − 2x1 − 4x2 + x3
(4)
R2 = 50 − 3x1 − 2x2 + x4
and
(5)
Substituting (4) and (5) in the objective function (1)
we get
z = 3x1 + 2.5x2 + M(40 − 2x1 − 4x2 + x3 )
+ M(50 − 3x1 − 2x2 + x4 )
or
z = (3 − 5M)x1 + (2.5 − 6M)x2 + M · x3 +
+M · x4 + 90 · M
which is independent of R1 and R2 . Thus the objection equation is
z − (3 − 5M)x1 − (2.5 − 6M)x2 − Mx3 −
−Mx4 = 90M
The simplex tableau with the starting basic solution
containing R1 and R2 as the basic variables in given
below:
Basis
z
x3
x4
R1
– 3 + 5M – 2.5– 6M – M
–M
0
0
90 M
x1
x2
R2 Solution
R1
2
4
–1
0
1
0
40
R2
3
2
0
–1
0
1
50
In the z-row, the most positive coefficient is
−2.5 + 6M. So x2 will be entering variable. Since
40
= 10, 50
= 25, the variable R1 will leave the
4
2
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
basis. So 4 is the pivotal element. New simplex
tableau is given below:
Basis
x2
x1
0
x2
– 3.5 + 4M
2
1
2
R2
2
0
z
x3
x4
– 2.5 + 2M
4
– 1
4
1
2
1
–M
0
–1
R1
2.5– 6M
4
1
4
– 1
2
Since −3·5+4M
is the most positive element in the z2
row, the variable x1 will enter the basis forcing R2 out
since the minimum of the ratios 101 = 20, 30
= 15 is
2
2
15. So pivotal element is 2. The next simplex tableau
is shown below:
Basis
x1
x2
x3
x4
– 7
8
1
4
– 1
2
z
0
0
– 3
16
x2
0
1
x1
1
0
– 3
8
1
4
R1
3 – 16 M
8
3
8
– 1
4
R2
7 –M
8
– 1
4
1
2
Solution
205
4
5
2
15
Since all the elements in the z-row are non positive, the current solution is optimal given by x1 = 15,
x2 = 25 with value of objective function 205
(observe
4
that the artificial variables R1 , R2 and surplus variables x3 , x4 are nonbasic variables assuming zero
values. Thus R1 , R2 have been forced out of the
basis).
Two-Phase Method
Example 1: Solve LPP by two-phase method
Maximize z = 2x1 + 3x2 − 5x3
subject to
x1 + x2 + x 3 = 7
2x1 − 5x2 + x3 ≥ 10
and x1 , x2 , x3 ≥ 0
Solution: Phase I: Introducing a surplus variable
x4 and two artificial variables R1 and R2 , the Phase
I of the LPP takes the following form:
Minimize
r = R1 + R 2
(1)
subject to
x1 + x 2 + x 3 + R 1 = 7
(2)
2x1 − 5x2 + x3 − x4 + R2 = 10
(3)
and x1 , x2 , x3 , x4 , R1 , R2 ≥ 0.
From (2), R1 = 7 − x1 − x2 − x3
(4)
5.15
From (3), R2 = 10 − 2x1 + 5x2 − x3 + x4
R2
Solution
0
25 + 30M
0
40
1
50
(5)
Substituting (4), (5) in (1) we get the objection function as
Minimize r = (7 − x1 − x2 − x3 ) + (10 − 2x1 +
5x2 − x3 + x4 )
or Minimize r = −3x1 + 4x2 − 2x3 + x4 + 17 or
r + 3x1 − 4x2 + 2x3 − x4 = 17
The simplex tableau containing the basic solution
with R1 , R2 as the basic variables is given below.
Basis
x1
x2
x3
R1
R2
x4
Solution
r
3
–4
2
0
0
–1
17
R1
1
1
1
1
0
0
R2
2
–5
1
0
1
–1
7
10
The variable x1 will enter the basis since 3 is most
positive coefficient in the r-row of this minimization
problem. The variable R2 will leave the basis since
10
= 5 is less than 71 = 7. The pivotal element is 2.
2
Dividing the pivot row by the pivot element 2, we get
the new pivot row as 1, − 25 , 21 , 0, 21 , − 21 , 5.
Here the new rth-row:
= (3 − 4 2 0 0 − 1 17) − 3 1 − 25 21 0 21 − 21 5
7 1
= 0 2 2 0 − 23 21 2
Here the new R1 -row: = (1 1 1 1 0 0 7) − 1 1 − 25 21 0 21 − 21 5
7 1
= 0 2 2 1 − 21 21 2
The new simplex table with R1 and x1 as the basic
variables is shown below:
x1
x2
x3
r
0
R1
0
R2
1
7
2
7
2
– 5
2
1
2
1
2
1
2
Basis
R1
R2
x4
0
– 3
2
– 1
2
1
2
1
2
1
2
– 1
2
1
0
Solution
2
7
5
Now x2 with most positive coefficient 27 , will enter
chap-5a
B.V.Ramana
5.16
September 13, 2006
17:59
MATHEMATICAL METHODS
the basis pushing out R1 with ratio
other ratio
5
− 25
2
7
2
= 47 . (The
is ignored since the denominator is
negative). The pivotal element is 27 . The pivot row is
1 4
0 1 17 27 −1
7 7 7
Here
new r-row:1 7 = 0 27 21 0 −3
2 − 2 0 1 17 27 − 17 17 47
2 2
= (0 0 0 − 1 − 1 0 0)
Here
new x1 -row:
= 1 − 25 21 0 21 − 21 5 −
5 − 2 0 1 17 27 − 17 17 47
= 1 0 67 57 17 − 17 45
7
The next simplex tableau of the second iteration with
x1 and x2 as the basic variables is given below.
Basis
x1
x2
x3
R1
R2
x4
r
0
0
0
–1
–1
0
0
1
7
6
7
2
7
5
7
– 1
7
1
7
1
7
– 1
7
4
7
45
7
x2
0
1
x1
1
0
Solution
already in the basis, the current solution is optimal.
, x2 = 47 and
The basic feasible solution is x1 = 45
7
.
the maximum value of the objective function is 102
7
5.6 LINEAR PROGRAMMING PROBLEM
EXERCISE
Enumeration:
1. If a person requires 3000 calories and 100 gms
of protein per day find the optimal product mix
of food items whose contents and costs are given
below such that the total cost is minimum. Formulate this as an LPP. Enumerate all possible solutions. Identify basic, feasible, nonfeasible, degenerate, non degenerate solutions and optimal solution.
Bread
x1
Meat
x2
Potatoes Cabbage
x3
x4
Milk
x5
The phase I is complete since r is minimized attain600
100
600
3000
Calories 2500
ing value 0, producing the basic feasible solution x1
40
10
20
150
80
Protein
= 45
, x2 = 47 . Note that both the artificial variables R1
7
3
2
1
10
3
Cost (Rs)
and R2 have been forced out of the (starting) basis.
Therefore the columns of R1 and R2 can altogether
Ans: LPP: Minimize z = 3x1 + 10x1 + x3 + 2x4 +
be ignored in the future simplex tableau.
3x5 .
s.t. 2500x1 + 3000x2 + 600x3 + 100x4 +
Phase II: Having deleted the artificial variables
600x5 = 3000
R1 and R2 and having obtained a basic feasible solu80x1 + 150x2 + 20x3 + 10x4 + 40x5 = 100,
tion x1 , x2 we solve the original problem given by
x1 , x2 , x3 , x4 , x5 ≥ 0; m = 2, n = 5, 5 c2 = 10
maximization of z = 2x1 + 3x2 − 5x3
basic solutions: F = Feasible, NF: non-feasible,
subject to
D: degenerate, ND: non degenerate
2
x2 + 17 x3 + 17 x4 = 47
1. x1 = 10
, x2 = 27
, z = 110
, F, ND
9
7
6
1
45
2. x1 = 0, x3 = 5, z = 5, F, D
x1 + 7 x3 − 7 x4 = 7
3. x1 = 20
, x4 = 10
, z = 80
, F, ND
and x1 , x2 , x3 , x4 ≥ 0
17
17
77
15
5
The tableau associated with this phase II is
4. x1 = 13 , x5 = 26 , z = 105
, F, ND, optimal,
26
5. x2 = 0, x3 = 5, z = 5, F, ND
x3
x4
x2
Basis x1
Solution
6. x2 = 43 , x4 = −10, z = − 20
, NF, ND
3
90
12
102
–3
–2
0
z
=
2,
x
=
−5,
z
=
5,
NF,
ND
7.
x
5
+
2
5
7
7 = 7
8.
x
=
5,
x
=
0,
z
=
5,
F,
D
3
4
4
1
1
x2
1
0
7
7
7
9. x3 = 5, x5 = 0, z = 5, F, D
6 – 1
45
x1
10. x4 = 10, x5 = −30, z = −30, NF, ND
0
1
7
7
7
All the remaining non basic variables are
Since x2 with most negative element in the z-row is
zero.
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
Hint: Max: z = 2x1 + x2 + 3x3 + x4 + 2x5 s.t.
x1 + 2x2 + x3 + x5 ≤ 100; x2 + x3 + x4 + x5 ≤
80; x1 + x3 + x4 ≤ 50
2. Find all basic solutions for
x1 + 2x2 + x3 = 4, 2x1 + x2 + 5x3 = 5
Ans: (2,
0)F, ND; (5, 0, − 1), NF, ND;
1,
0, 53 , 23 F, ND.
3. Find the optimal solution by enumeration
Max: z = 5x1 + 10x2 + 12x3
s.t. x1 , x2 , x3 ≥ 0,
15x1 + 10x2 + 10x3 ≤ 200, 10x1 + 25x2 +
20x3 = 300
(7.27, 9.1, 0, 0), z = 127 · 27
(5, 0, 12.5, 0), z = 175
(30, 0, 0, −250), NF
(0, −20, 40, 0), NF
(0, 12, 0, 80), z = 120
(0, 0, 15, 50), z = 180
(1) (2) (5) are F, ND:
(6) is optimal solution;
4. Find the optimal solution by enumeration
Ans: 1.
2.
3.
4.
5.
6.
Max: z = 2x1 + 3x2 s.t. 2x1 + x2 ≤ 4, x1 , x2 ≥
0, x1 + 2x2 ≤ 5.
Ans: 1.
2.
3.
4.
5.
6.
(0, 0, 4, 5), z = 0, F, ND
(0, 4, 0, −3) NF
(0, 2.5, 1.5, 0), z = 7.5, F, ND
(2, 0, 0, 3), z = 4, F, ND
(5, 0, −6, 0), NF
(1, 2, 0, 0), z = 8, F, ND, optimal.
Ans: x1 =
15
, x2
4
= 43 , z =
33
4
3. Max: z = 3x1 + 4x2 + x3 + 7x4 s.t. 8x1 + 3x2 +
4x3 + x4 ≤ 7,
2x1 + 6x2 + x3 + 5x4 ≤ 3,
x1 + 4x2 + 5x3 + 2x4 ≤ 8
x1 , x2 , x3 , x4 ≥ 0.
Ans: x1 =
16
, x4
19
=
5
, x7
19
=
126
,z
19
=
83
19
4. Minimize z = x2 − 3x2 + 2x5
s.t. x1 + 3x2 − x3 + 2x5 = 7,
−2x2 + 4x3 + x4 = 12,
−4x2 + 3x3 + 8x5 + x6 = 10
Ans: x2 = 4, x3 = 5, x6 = 11, z = −11
5. Max: z = 2x1 + 5x2 + 4x3
s.t. x1 + 2x2 + x3 ≤ 4; x1 + 2x2 + 2x3 ≤ 6
Ans: x2 = 1, x3 = 2, z = 13
Ans: x1 = 3, x2 = 23 , z = 21
7. Max: z = x1 + 2x2 + x3 s.t. x1 , x2 , x3 ≥ 0,
2x1 + x2 − x3 ≤ 2; −2x1 + x2 − 5x3 ≥ −6;
4x1 + x2 + x3 ≤ 6.
Solve the following LPP by simplex method.
1. A firm can produce 5 different products using 3
different input quantities, as follows.
Technical coefficients
1 2 3 4
5
1 2 1 0
1
0 1 1 1
1
1 0 1 1
0
2 1 3 1
2
2. Max: z = 2x1 + x2 s.t. x1 , x2 ≥ 0; 3x1 + 5x2 ≤
15; 6x1 + 2x2 ≤ 24.
6. Max: z = 5x1 + 4x2 s.t., x1 , x2 ≥ 0;
6x1 + 4x2 ≤ 24; x1 + 2x2 ≤ 6,
x1 − x2 ≥ −1; −x2 ≥ −2
Simplex Method
Input
quantity
A
B
C
Profit
5.17
Capacity
100
80
50
Maximize the profit
Ans: x1 = 20, x3 = 30, x5 = 50, profit: Rs = 30
Ans: x2 = 4, x3 = 2, x6 = 0, z = −10
(Note: Degenerate solution)
8. Max: z = −x1 + 3x2 − 2x3 s.t.
3x1 − x2 + 2x3 ≤ 7, 2x1 − 4x2 ≥ −12;
4x1 − 3x2 − 8x3 ≥ −10; x1 , x2 , x3 ≥ 0.
Ans: x1 = 4, x2 = 5, z = 11
9. Max. z = 6x1 + 9x2 s.t. x1 , x2 ≥ 0, 2x1 + 2x2 ≤
24; x1 + 5x2 ≤ 44, 6x1 + 2x2 ≤ 60
Ans: x1 = 4, x2 = 8, x6 = 20, z = 96
Multiple optima:
10. Minimize: z = −x1 − x2 s.t. x1 , x2 ≥ 0
x1 + x2 ≤ 2, x1 − x2 ≤ 1, x2 ≤ 1
Ans: x1 = 23 , x2 = 21 , z = −2
chap-5a
B.V.Ramana
5.18
September 13, 2006
17:59
MATHEMATICAL METHODS
Also another optimal solution is x1 = 1, x2 =
1, z = −2
11. Max: z = 6x1 + 4x2 s.t.
4, 2x2 ≤ 12, 3x1 + 2x2 ≤ 18
17. Min: z = 3x1 − x2 s.t. x1 , x2 ≥ 0, 2x1 + x2 ≥
2; x1 + 3x2 ≤ 3; x2 ≤ 4
x1 , x2 ≥ 0, x1 ≤ Ans: x1 = 3, x3 = 4, x6 = 4, z = 9
18. Max: z = x1 + 5x2 s.t. x1 , x2 ≥ 0, 3x1 + 4x2 ≤
Ans: x1 = 4, x2 = 3, z = 36
6; x1 + 3x2 ≥ 2
Another optimal solution: x1 = 2, x2 = 6, z =
Ans: x2 = 23 , x4 = 25 , z = − 15
2
36
Unbounded solution
19. Min: z = 2x1 + 4x2 + x3 s.t. x1 + 2x2 − x3 ≤
12. Max: z = 4x1 + x2 + 3x3 + 5x4 s.t.
5; 2x1 − x2 + 2x3 = 2; −x1 + 2x2 + 2x3 ≥ 1
3x1 − 2x2 + 4x3 + x4 ≤ 10,
Ans: x3 = 1, x4 = 6, x6 = 1, z = 1
8x1 − 3x2 + 3x3 + 2x4 ≤ 20,
−4x1 + 6x2 + 5x3 − 4x4 ≤ 20
Two-Phase Method:
Ans: Unbounded solution
Note: In the second simplex tableau, since x2 has 20. Max: z = x1 + 5x2 + 3x3 s.t. x1 , x2 , x3 ≥ 0, and
x1 + 2x2 + x3 = 3; 2x1 − x2 = 4
most negative coefficient in z-row, normally x2
should enter the basis. But all the entries in the Ans: (2, 0, 1), z = 5
column under x2 are negative or zero. So no variable can leave the basis. Hence the solution is not 21. Min: z = 4x1 + x2 s.t. x1 , x2 , x3 , x4 ≥ 0, and
3x1 + x2 = 3; 4x1 + 3x2 ≥ 6, x1 + 2x2 ≤ 4.
bounded
2 9
17
13. Min: z = −3x1 − 2x2 s.t. x1 , x2 ≥ 0, x1 − x2 ≤ Ans: 5 , 5 , 1, 0 , z = 5
1, 3x1 − 2x2 ≤ 6.
22. Minimize z = 7.5x1 − 3x2 s.t. x1 , x2 , x3 ≥
Ans: Unbounded solution
0, 3x1 − x2 − x3 ≥ 3; x1 − x2 + x3 ≥ 2
Note: In the 3rd simplex tableau, x3 having the
Ans: x1 = 45 , x2 = 0, x3 = 43 , z = 75
8
most positive value (12) in z-row should normally
enter the basis. But all the entries under x3 are 23. Minimize z = 3x1 + 2x2 , s.t. x1 , x2 , ≥ 0, x1 +
negative. So OF can be decreased indefinitely.
x2 ≥ 2; x1 + 3x2 ≤ 3, x1 − x2 = 1
M-Method
14. Minimize: z = 4x1 + 2x2 s.t. x1 , x2 ≥ 0, 3x1 +
x2 ≥ 27; −x1 − x2 ≤ −21, x1 + 2x2 ≥ 30.
Ans: x1 = 3, x2 = 18, z = 48
15. Max: z = x1 + 2x2 + 3x3 − x4 s.t.
x1 + 2x2 + 3x3 = 15, 2x1 + x2 + 5x3 = 20,
x1 + 2x2 + x3 + x4 = 10, x1 , x2 , x3 , x4 ≥ 0
Ans: x1 = x2 = x3 = 25 , x4 = 0, z = 15
Ans: x1 = 23 ; x2 = 21 , z =
24. Minimize: z = 5x1 − 6x2 − 7x3 s.t. x1 + 5x2 −
3x3 ≥ 15; 5x1 − 6x2 + 10x3 ≤ 20; x1 + x2 +
x3 = 5, x1 , x2 , x3 ≥ 0
Ans: x2 =
15
; x3
4
= 45 , x5 = 30, z =
−125
4
25. Max: z = 2x1 + x2 + x3 s.t.
4x1 + 6x2 + 3x3 ≤ 8;
3x1 − 6x2 − 4x3 ≤ 1; 2x1 + 3x2 − 5x3 ≥ 4;
x1 , x2 , x3 ≥ 0
16. Min: z = 2x1 + x2 s.t. x1 , x2 ≥ 0, 3x1 + x2 =
Ans: x1 = 97 ; x2 =
3, 4x1 + 3x2 ≥ 6, x1 + 2x2 ≤ 3
Ans: x1 = 35 , x2 = 65 , z = − 12
5
11
2
10
,z
21
=
64
21
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
5.7 THE TRANSPORTATION PROBLEM
The transportation problem is a special class of Linear programming problem. It is one of the earliest
and most useful application of linear programming
problem. It is credited to Hitchcock, Koopmans and
Kantorovich. The transportation model consists of
transporting (or shipping) a homogeneous product
from ‘m’ sources (or origins) to ‘n’ destinations, with
the objective of minimizing the total cost of transportation, while satisfying the supply and demand
limits.
Let ai denote the amount of supply at the ith
source, bj denote the demand at destination j ; cij
denote the cost of transportation per unit from ith
source to j th destination; xij the amount shipped
from origin i to destination j . Then the transportation
problem is to minimize the total cost of transportation
z=
m n
cij xij
(1)
Supply
Sources
a1
S1
a2
S2
am
Sm
c11; x11
D1
n
S1
xij = ai ,
D2
b2
Dn
bn
xij = bj , bj > 0; j = 1, 2, . . . , n
(3)
and
Dj
c1j
x1j
K
Dn
ai
c1n
x1n
a1
a2
ai
Si
Sm
cm1 cm2
xm1 xm2
cmj
xmj
cmn
xmn
bj
b1
bj
bn
b2
am
S ai =
S bj
(4)
In the balanced transportation problem it is assumed
that the total quantity required at the destinations is
precisely the same as the amount available at the
origins i.e.
n
c11 c12
x11 x12
K
K
(2)
i=1
xij ≥ 0
D2
S2
Destination constraint:
i=1
b1
K
ai > 0; i = 1, 2, . . . m
ai =
D1
Destinations
j =1
m
Demand
The system of equations (1) to (4) is a linear programming problem with m + n equations in mn variables. The transportation problem always has a finite
minimum feasible solution and an optimal solution
contains m + n − 1 positive xij ’s when there are m
origins and n destinations. It is degenerate if less than
m + n − 1 of the xij ’s are positive. No transportation
problem has ever been known to cycle.
Table for Transportation Problem
subject to the constraints
m
Destinations
cmn; xmn
i=1 j =1
source constraint :
5.19
Denoting the sources and destinations as nodes
and routes as arcs, the transportation problem can be
represented as a network shown below:
Sources
chap-5a
bj .
(5)
j =1
(5) is the necessary and sufficient condition for the
existance of a feasible solution to (2) and (3).
Note: Zero values for nonbasic variables are not
filled while zero values for basic variables are shown
in the tableau.
Like the simplex method the transport algorithm
consists of determining the initial basic feasible solution, identifying the entering variable by the use of
optimality condition and finally locating the leaving
variable by the use of feasibility condition.
chap-5a
B.V.Ramana
5.20
September 13, 2006
17:59
MATHEMATICAL METHODS
Determination of Initial (starting) Basic Feasible Solution
An initial basic feasible solution containing m + n −
1 basic variables can be obtained by any one of the
following methods (a) the north west corner rule
(b) row minimum (c) column minimum (d) matrix
minimum (or least cost method) (e) Vogel approximation method. In general, Vogel’s method gives
the best starting solution. Although computationally
north west corner rule is simple, the basic feasible
solution obtained by this method may be far from
optimal since the costs are completely ignored.
(b) Row-minimum
Identify the minimum cost element c1k in the first
row. (Ties are broken arbitrarily). Allocate as much
as possible to cell (1, k). If a1 ≤ bk then x1k = a1 so
move to the second row after changing bk to bk − a1 .
Identify the minimum element in second row and
allocate as much as possible. Continue this process
until all rows are exhausted. If a1 > bk then x11 = bk ,
change a1 to a1 − bk , and identify the next smallest
(minimum) element in the first row allocate, continue
the process until the first row is completely satisfied.
(c) Column-minimum
(a) North-west corner rule (due to Dantzig):
Step I: Allocate as much as possible to the north west
corner cell (1, 1). Thus let x11 = min(a1 , b1 ). If a1 ≤
b1 then x11 = a1 and all x1j = 0 for j = 2, 3, . . . n
i.e. except x11 all other elements of the first row are
zero. The first row is satisfied so cross out the first
row and move to x21 of second row.
If a1 ≥ b1 then x11 = b1 and all xi1 = 0 for i =
2, 3, . . . m i.e., except x11 all other elements in the
first column are zero. The first column is satisfied
so cross out the first column and move to x12 of the
second column.
Note: If both a row and column are satisfied (i.e.,
say x11 = a1 = b1 ) simultaneously, then cross out
either row or column only but not both row and column.
Step II: Allocating as much as possible to the cell
(2, 1) or (1, 2) cross out the row or column and move
to (3, 1) or (1, 3).
Step III: If exactly one row or column is left
uncrossed out, stop. Otherwise go to step II wherein
move to lower row (below) if a row has just been
crossed out or move to right column if a column has
just been crossed out.
Note: Cells from “crossed out” row or column can
not be chosen for basis cells at a later step in the
determination of starting basic solution.
This is exact parallel to the above row-minimum
method except that minimum in the columns are
identified instead of rows.
(d) Matrix minimum (least-cost method):
Identify the least (minimum) element cij in the
entire matrix. (Ties are broken arbitrarily). Allocate
as much as possible to the (i, j )th cell. If ai ≤ bj
then xij = ai , change bj to bj − ai . If ai ≥ bj then
xij = bj , change ai to ai − bj . Identify the next least
element and allocate as much as possible. Continue
this process until all the elements in the matrix are
allocated (satisfied).
(e) Vogel approximation method
Step I. The row penalty for a row is obtained by subtracting the smallest cost element in that row from
the next smallest cost element in the same row. Calculate the row penalties for each row and similarly
column penalties for each column.
Step II. Identify the row or column with the largest
penalty (ties are broken arbitrarily). In the selected
row or column, allocate as much as possible to the
cell with the least unit cost. Cross out the satisfied row
or column. If a row and column are satisfied simultaneously, cross out either a row or column but not
both. Assign zero supply (or demand) to the remaining row (or column). Any row or column with zero
supply or demand should not be used in computing
future penalties.
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
Step III.
(a) A starting solution is obtained when exactly one
row or one column with zero supply or demand
remains uncrossed out. Stop.
(b) Determine the basic variables in an uncrossed
row (column) with positive (non zero) supply
(demand) by the least-cost method. Stop.
(c) Determine the zero basic variables in all the
uncrossed out rows and columns having zero supply and demand by the least cost method. Stop.
(d) Otherwise, go to step 1, recalculate the row and
column penalties and go to step II.
Note: Vogel’s method, which is a generalization of
the matrix minimum (least cost method) gives better
solution in most cases than all the other methods
listed above.
Method of Multipliers
The optimal solution to the transportation problem is obtained by iterative computions using the
method of multipliers (also known as U V -method
or stepping-stone method or MODI (modified distribution) method). First of all, obtain a starting initial
basic feasible solution containing m + n − 1 basic
variables (by any one of the above methods).
Step I: Introduce unknowns ui with row i and vj with
column j such that for each current basic variable xij
in the tableau,
ui + vj = cij
is satisfied. This results in m + n equations in m + n
unknowns. Assume that u1 = 1 (or u1 = 0). (Instead
of u1 , any other variable ui or vj can be chosen as
zero or one, resulting in the same optimal solution
but with different values in the tableau). Solving the
equations in ui , vj we get ui for i = 1 to m and vj
for j = 1 to n.
Step II. For each non basic variable, compute
cij = ui + vj − cij
Step III: (a) If cij ≤ 0 for any i and j (i.e. for all
non basic variables), stop. The current tableau gives
the optimal solution with minimum cost.
5.21
(b) If cij > 0, then solution is to be revised. The
entering variable is one which has most positive cij
(i.e., max cij for all i and j ).
(c) The leaving variable is determined by constructing a closed θ -loop which starts and ends at the
entering variable and consists of connected horizontal and vertical lines (without any diagonals). Thus
each corner of the loop lies in the basic cell, except
the starting cell. The unknown θ is subtracted and
added alternatively at the successive corners so as
to adjust the supply and demand. From the cells in
which θ is subtracted, choose the maximum value
of θ such that xij − θ ≥ 0. This feasibility condition
determines the leaving variable. Now go to step I.
Maximization A transportation problem in which
the objective is to maximize (the profit) can be transfered to a minimization problem by subtracting all
the entries of the cost matrix from the largest entry
of the matrix.
Unbalanced problem in which the total supply is
not equal to the total demand can always be transfered to a balanced transportation problem by augmenting it with a dummy source or dummy destination. A dummy destination is added when supply is
greater than the demand. The cost of transportation
from any source to this dummy destination is taken
as zero. Similarly when demand is greater than supply, a dummy source is added. The cost of shipping
from this dummy source to any destination is taken
as zero. Now the corresponding balanced problem is
solved by the method of multipliers.
Transhipment problem consists of transporting
from source to destination via (through) intermediate or transient nodes, known as transhipment nodes
which act as both sources and destination. The transhipment node should be large enough to allow the
entire supply or demand to pass through it. Thus
the ‘capacity’ of the transient node is the ‘buffer’
amount which equal the total supply or demand.
Thus the transhipment model consists of pure supply nodes which tranship the original supply, pure
demand nodes which receive the original demand,
and transhipment node which can receive original
supply plus the buffer or can tranship the original
demand plus the buffer. A given transhipment prob-
chap-5a
B.V.Ramana
5.22
September 13, 2006
17:59
MATHEMATICAL METHODS
lem can be transformed to a regular transportation
problem as follows:
I. Identify the pure supply nodes, pure demand
nodes and transhipment nodes from the given network.
II. Denote the pure supply nodes and transhipment
nodes as the sources.
III. Denote the pure demand nodes and transhipment
nodes as the destinations.
IV. Note down the transportation costs cij read from
the given network. If ith source is not connected to
j th destination, put cij = M where M is a large
(penalty) value. Take cii = 0 since it costs zero
for transporting from ith source to itself (ith destination).
V. Identify supply at a pure supply node as the original supply; demand at a pure demand node as the
original demand; supply at a transhipment node as
the sum of original supply and buffer and finally
demand at a transhipment node as the sum of the
original demand and buffer.
Now the above transformed regular transportation
problem can be solved by using the method of multipliers.
The solution of a transport problem
is said to be degenerate when the number of basic
variables in the solution is less than m + n − 1. In
such cases, assign a small value ε to as many nonbasic variables as needed to augment to m + n − 1
variables. The problem is solved in the usual way
treating the ε cells as basic cells. As soon as the
optimum solution is obtained, let ε → 0.
Degeneracy
(e) Vogel’s (approximation) method
D1 D2 D3
2 8
4
0
4
3
2
5
0 6
2
1
S1
S2
S3
7
(a) NWCR:
D1
S1
7
Starting Solution:
Example 1: Obtain a (non artificial) starting basic
solution to the following transportation problem
using (a) North west corner rule (b) Row-minimum
(c) Column minimum (d) Least cost (Matrix minima)
D2
0
1
2
S2
D3
4
2
3
4
0
2
1
S3
6
7
8, 1
5
5
6, 5
6
6
Supply as much as possible to the north-west corner
cell (1, 1).
Cost: 7 × 0 + 1 × 4 + 5 × 3 + 6 × 0 = 19
Note: This is a degenerate solution because it contains only 4 basic variables (instead of 3 + 3 − 1 = 5
basic variables).
(b) Row Minimum
D1
S1
7
D2
D3
0
4
2
3
1
2
5
0
2
1
S3
8, 1
4
5
7
WORKED OUT EXAMPLES
6
Solution:
S2
5.8 Transportation Problem
6
1
5
6, 1
6, 5
6
1
Allot as much as possible in the first row to the cell
with least (minimum) cost i.e. (1, 1). The balance
allot to the next least cell in the first row.
Cost: 7 × 0 + 1 × 2 + 5 × 3 + 1 × 2 + 5 × 0 =
19
Note: This is a non-degenerate solution (since it
contains 3 + 3 − 1 = 5 basic variables).
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
(c) Column Minimum
D1
S1
7
S2
This is a non-degenerate solution.
D2
4
2
3
2
1
8, 1
Example 1: Solve the following transportation
problem by U V -method obtaining the initial basic
solution by (a) Vogel’s method (b) NWCR (c) compare the number of iterations in (a) and (b).
4
5
5
2
0
6, 1
6, 5
6
7
Method of Multipliers
D3
0
1
S3
6
D1
Cost: 7 × 0 + 1 × 2 + 5 × 4 + 6 × 2 = 34
This is a degenerate solution containing 4 basic
variables.
S1
S2
S3
(d) Least cost method (matrix minima)
D1
S1
D2
0
7
1
2
S2
2
3
4
D1
0
2
6
6, 1
0
2
0
2
1
4
2
0
5
0
25
S2
6
Column
penalties
D3
1
S1
7
2
3
S2
Row penalties
2
1
1
7
1
8 1
10
0
2
2
0
25
10
25
2
1
5
10
0
2
30
20
50
35
100
1
5
6 1
6
5
1
2
1
2
1
4P
6 1
1
1
2
2
Cost: 7 × 0 + 2 × 1 + 3 × 5 + 2 × 1 + 0 × 5 = 19
1
Row penalties
30
10
4
20
10
1
2
1
2
3
1
2
1
2
1
2
2
2
1
1
1
3P
2P2P
0
25 50 25
30
35
20 10 100
Thus the initial basic feasible solution by Vogel’s
method is given by
D1
1
2
10
ai
5
S2
S3
D2
3
S1
1
D4
2
2P 2P
4
5
S3
Column
penalties
D3
4
30
0
20
S3
bj
D2
(e) Vogel’s (approximation) method
0
ai
1
P
D2
D4
3
10
3
S1
6
Allot as much possible to that cell which has least
cost in the entire matrix say (1, 1) (tie broken arbitrarily between (1, 1) and (3, 3).
Cost: 7 × 0 + 1 × 4 + 5 × 3 + 6 × 0 = 19
This is a degenerate solution.
D1
D3
(a) Initial solution by Vogel’s method
8, 1
5
1
7
bj
D2
D3
4
5
S3
5.23
D3
1
D4
0
2
1
4
20
10
0
2
2
0
25
10
5
0
25
where the basic variables are circled
Total cost: (20 × 0) + (10 × 2) + (10 × 0) +
(10 × 1) + (25 × 0) + (25 × 0) = 30
In the U V -method (method of multipliers) associate the multipliers ui and vj with row i and column
chap-5a
B.V.Ramana
5.24
September 13, 2006
17:59
MATHEMATICAL METHODS
j such that for each basic variable xij we have
ui + vj = xij
Arbitrarily choosing u1 = 1 we solve for the
remaining ui , vj ’s as follows:
u, v equation
u1 + v3 = 0
u1 + v4 = 2
u3 + v4 = 0
u3 + v2 = 0
u2 + v3 = 1
u2 + v1 = 0
Basic variable
x13
x14
x34
x32
x23
x21
solution
v3 = −1
v4 = 1
u3 = −1
v2 = 1
u2 = 2
v1 = −2
To summarize u1 = 1, u2 = 2, u3 = −1
v1 = −2, v2 = 1, v3 = −1, v4 = 1
Now using ui and vj the non basic variables are
calculated as
xij = ui + vj − cij
Thus
Nonbasic
variable xij
x11
x12
x22
x24
x31
x33
Value
ui + vj − cij
u1 + v1 − c11
u1 + v2 − c12
u2 + v2 − c22
u2 + v4 − c24
u3 + v1 − c13
u3 + v3 − c33
= 1 − 2 − 3 = −4
=1+1−1=1
=2+1−2=1
= 2 + 1 − 4 = −1
= −1 − 2 − 2 = −5
= −1 − 1 − 5 = −7
u1 = 1
S1
u2 = 2
S2
u3 = –1
S3
bj
D2
10
25
D3
D4
1
2
0
10 –q
1 20
2
4
1
1 10
–1
5 +q 0
0
–7 25
30
The maximum value of θ is 10 (which keeps both
x14 , x22 nonnegative i.e., x14 = 0, x22 = 15 > 0).
Thus the new table is
v1 = –2 v2 = 0 v3 = –1 v4 = 0
D1
u1 = 1
S1
u2 = 2
S2
u3 = 0
S3
D2
D3
D4
ai
3
1
2
0
20
–4 10
2
0
4
1
10
–2
0 10
5
2
0
0
–4 15
–6 35
bj
10
25
30
30
20
50
35
ai
30
(b) Initial solution by NWC rule:
v1 = –2 v2 = 1 v3 = –1 v4 = 1
3P
q
–4
0
10
2 –q
–5 25
x22 = 25 − θ ≥ 0
Since for all non basic variables x11 , x14 , x22 , x24 ,
x31 , x33 the values (in the southeast) of ui + vj − cij
are all negative, the current table is the optimal. The
optimal solution with least cost is (10 × 1) +(20 ×
0) +(10 × 0) +(10 × 1) +(15 × 0) +(35 × 0) = 20.
Non basic variables are placed in the south east
corner of each cell. Then the new table is
D1
Incoming: Amongst the nonbasic variables, the
entering variable is the one with the most positive
value (in the south east corner of the cell). Thus x21
will be the entering variable.
Outgoing: The leaving (basic) variable is determined by constructing a closed θ -loop which starts
and ends at the entering variable x21 . In this modified
distribution all variables should be nonnegative and
supply and demand satisfied. Then
x14 = 10 − θ ≥ 0
20
50
Suppressing
the working details we get the optimal solution in 3
iterations.
3
0
35
During computation, it is not necessary to write u,
v equations and solve them explicitly. Instead, choosing u1 = 1, compute v3 , v4 from the basic variables
x13 , x14 in the first row. Now using v4 , u3 is obtained
from the basic variable x34 . Similarly u2 is obtained
using v3 from the basic variable x23 . Now using u2
we get v1 and finally using u3 we get v2 .
1
2
5
2
10
0
2 30
20
1
4 20
15
0 50
35
20
10
15
5
0
25
5
15
35
30
15
35
Associated cost
= (10 × 3) + (20 × 1) + (5 × 2) + (15 × 1)+
+ (15 × 5) + (35 × 0) = 150
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
By U V method with u1 = 1 we get
v1 = 2
3
u1 = 1
v2 = 0 v3 = –1
1
0
20
0
2
1
5 – + 15
10
0
u2 = 2
u3 = 6
–7
4
–8
0
35
with θ = 5, x22 , is outgoing and x12 is the incoming variable.
Then the new table is
2
0
3
1
10
–
20
0
–4
–2
2 +
0
5
1 P 0
q
6
2
1
– 6 20
5
0 –
5
10
0
–1
1
10
1 – 10
P 0
2 q
4
2
0
0
10
2
0
0
20
Plant
–8
0
0
2
+
1
–1
4
–
5
–2
0
–6
3
1
2
–4
0
1
10
10
0
0
P1
600
700
400
P2
320
300
350
P3
500
480
450
Solution:
2
1
–1
4
5
–2
0
10
35
optimal cost is 20. Optimal solution is x12 = 10,
x13 = 20, x21 = 10, x23 = 10, x32 = 15, x34 = 35.
City
c2
c3
P1
600
700
400
25
P2
320
300
350
40
P3
500
480
450
70
1000 1000
M
13
P4
0
–6
c3
c1
0
15
–4
c2
During the month of August, there is a 20%
increase in demand at each of the three cities, which
can be met by purchasing electricity from another
plant P4 at a premium rate of Rs 1000/- per kWh.
plant 4 is not linked to city 3. Determine the most
economical plane for the distribution and purchase
of additional energy. Determine the cost of additional
power purchased by each of the three cities.
35
20
2
2
0
–1
c1
35
0
15
0
City
–1
4
choose θ = 10. Then x11 is outgoing and x21 is
incoming with new following table which is the optimal solution since all xij = ui + vj − cij ≤ 0.
–2
Example 1: Three electric power plants P1 , P2 , P3
with capacities of 25, 40 and 30 kWh supply electricity to three cites C1 , C2 , C3 . The maximum demand
at the three cities are estimated at 30, 35 and 25 kWh.
The price per kWh at the three cites is given in the
following table
2
with cost 120. Now choose θ = 10, x13 will be
incoming and x33 will be outgoing variable resulting
in the following table.
3
Unbalanced Transportation Problem
0
0
2
is less when the
initial solution is obtained by Vogel’s method.
(c) The number of iterations
v4 = – 6
2
4
5
2 P 0 –
q
15
6
6
5.25
30 +6 35+7 25+5 148
Apply Vogel’s method to obtain the initial solution.
For all nonbasic variables ui + vj − cij ≤ 0. The
present table is optimal. The optimal solution
is P1 C3 : 25, P2 C1 = 23, P2 C2 = 17, P3 C2 = 25,
P3 C3 = 5, P4 C1 = 13.
Total cost: Rs 36,710 + Rs 13000 = Rs 49710 only
city C1 purchases an additional 13 kWh power from
plant P4 at an additional cost of Rs 13,000/-.
chap-5a
B.V.Ramana
5.26
September 13, 2006
MATHEMATICAL METHODS
c1
c3
700
Row penalties
400
25
320
300
350
500
480
450
25
1000
5
1000
42
30
23
P3
P4
c2
600
P1
P2
17:59
13
17
36
23
Column
penalties
180
M
180
180
P
200P 100
25
40
17
20
20
30
30
20
13
MP
M
150) = 300 units. A high penalty cost M is associated
with cell cij when there is no route from ith origin to
the j th destination. Zero cost is associated with cells
(i, i) which do not transfer to itself. The initial solution is obtained by Vogel’s method. Taking u1 = 0 and
M = 99 and applying method of multipliers we have
v1 = 1
P1
u1 = 0
180
P
P2
u2 = 2
u1 = 0
P1
u2 = –129
P2
u3 = 51
P3
u4 = 551
P4
c2
600
–151
320
23
500
0
1000
13
36
25
30
1
6
3
4
1
2
2
150
3
4
8
6
99
3
–4
2
–2
99
– 1 100
99
–q
6
1 200
99
0
200
+q
1
u4 = 0
T4
u5 = 97
D5
150
Solution: The entire supply of 300 units is transhipped from nodes P1 and P2 through T3 and T4
ultimately to destination nodes D5 and D6 . Here P1 ,
P2 are pure supply nodes; T3 , T4 , D5 are transhipment nodes; D6 is pure demand node. The transhipment model gets converted to a regular transportation
problem with 5 sources P1 , P2 , T3 , T4 , D5 and 4 destinations T3 , T4 , D5 and D6 . The buffer amount B =
total supply ( or demand) = 100 + 200 = (or 150 +
0
300
– 92
– 92 300
0
5
8
P
300
q
–2
–q
92
90 300
99
99
0
1
150
150
300
– 195
– 196
– 90
3
300
450
150
value of objective function is Rs 2650. Not all cij ≤
0. Note that c43 = 92 is most positive so the variable
x43 will enter into the basis. To determine the variable
leaving the basis, construct θ -loop from cells (4, 3)
to (2, 3) to (2, 2) to (4, 2). Choose θ = 0 to maintain
feasibility. Adjusting θ = 0, the leaving variable is
x23 . Thus the new tableau is
u1 = 0
p1
v1 = 1
0
5
6
t3
t4
d5
d6
2
p2
1
t3
0
t4
–5
d5
1
4
99
3
–4
2
–94
99
100
5
3
200
5
T3
D6
99
300
13
Example 1: The unit shipping costs through the
routes from nodes 1 and 2 to nodes 5 and 6 via nodes
3 and 4 are given in the following network. Solve the
transhipment model to find how the shipments are
made from the sources to destinations.
1
u3 = –91
40
Transhipment Problem
100
D5
4
0
c3
700
400
– 271 25
300
350
17
– 80
480
450
25
5
1000
M
– ve
–20
42
30
T4
v4 = 98
1
100
v1 = 449 v2 = 429 v3 = 399
c1
v3 = 97
T3
5
50
v2 = 0
200
–q
0
0
q
P 2
3
–2
99
– 103
300
+q
1
0
0
300
–q
99
– 104
300
99
–93 100
99
– 91 200
–92
6
99
300
– 92 300
–q
5
8
0
– 2 300
+q
0
1
150
150
300
150
150
value of objective function is Rs 2650. Not all
cij ≤ 0. Note that c31 = 2 is most positive. So x31
is the entering variable. To determine the leaving
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
variable construct a θ -loop from cells (3, 1) to (2, 1)
to (2, 2), to (4, 2) to (4, 3) to (3, 3) to (3, 1). Choose
maximum value of θ = 200. Then x21 will be the
leaving variable. Adjusting θ = 200, the new tableau
is given below.
1
2
t3
0
0
p1
–1
t3
–2
t4
t4
d5
d6
4
99
99
3
–2
2
–92
99
–91
99
– 2 200
0
1
200
0
0
3
–7
8
d5
100
–4
99
5
– 104
300
100
150
–2
1
150
450
6
4
8
5
2
1
10
2
3
7
0
200
6
4
8
300
5
2
1
300
9
2
10
2
3
7
0
11
6
4
8
5
2
1
9
2
S1
S2
S3
D2
D3
1
8
2
4
0
3
9
6
10
7
10
2
3
1
1
3
6
14
5
11
Solution: To transform this problem to a minimization, subtract all the cost entries in the matrix from
the largest cost entry 8. Then the relative loss matrix
is
4
1
12 1 4P
14
2
4
3
12 1 4P
14
2
4
3
11
7
0
11
6
4
8
5
2
1
4
8
9
8
1
10
7
0
1
2
14
3P
4
11
2
Finally
3
1
11
12
4
2
Allocate to (3, 2) since 3 is the largest penalty.
Example 1: Solve the following transportation
problem to maximize the profit.
5
14
Allocate to (1, 1) since 4 is the largest penalty
Maximization:
D1
3P
11
150
Observe that all cij ≤ 0. Therefore the current
tableau is optimal. The basic feasible optimal
solution is x11 = 100, x22 = 200, x31 = 200, x33 =
100, x42 = 100, x43 = 200, x53 = 150, x54 = 150.
The value of the objective function is
(100 × 1) + (200 × 2) + (200 × 0) + (100 × 6) +
(100 × 0) + (200 × 5) + (150 × 0) + (150 × 1) =
2250
12
11
1
11
300
0
0
Applying vogel’s method we get max penalty 3. So
allocate to (1, 3).
– 92
8
200
99
– 105
300
– 91
99
–92
6
100
7
9
2
1
100
p2
7
3
5.27
4
8
2
1
14
8
6
5
7
0
11
6
4
4
8
2
1
6
The maximum profit (wrt the original cost
matrix) is (1 × 5) + (11 × 8) + (8 × 2) + (6 × 4) +
(4 × 6) = 157
chap-5a
B.V.Ramana
5.28
September 13, 2006
17:59
MATHEMATICAL METHODS
Degeneracy
of the following transportation problems by (a)
North west corner rule (b) Row minimum (c) Column minimum (d) Least cost method (e) Vogel’s
method.
Example 1: Solve the following TP using NWCR
D2
D1
0
S1
2
S2
4
2
7
(i)
2
3
1
S3
D3
4
0
6
8
5
1
2
6
0
4
2
3
1
5
6
10
6
10
(iii)
Solution: By NWC rule
D2
D1
0
S1
7
3
4
1
2
S2
2
5
1
S3
2
7
6
6
0
8
0
S2
3
1
D1
D2
D3
2
–1
S3
4
2
3
0
4
2
–3
0
1
–3
1
–3
5
e
8
2
4
0
3
6
7
9
10
20
5
13
9
12
7 10
8 20
4
15
7
9 30
14
7
1
0 40
3
12
5
19 50
60
–1
7
1
60
20
12
14
4
11
10
6
6
0
S1
11
5
10
5
This is a degenerate solution since it contains only 4
basic variables (instead of 3 + 3 - 1 = 5 basic variables). To get rid of degeneracy, introduce any one
non-basic variable say in cell (3, 2) at ’ε’ level where
ε is a small quantity. Thus
u1 = 1
12
10
D3
4
(ii)
7
6
since all cij ≤ 0 current solution is optimal. Now
letting ε → 0 we get the solution as x11 = 7, x12 =
1, x22 = 5, x32 = 0, x33 = 6 with OF = 19 + 2 · ε =
19 as ε → 0
5.9 TRANSPORTATION PROBLEM
EXERCISE
1. Obtain the starting solution (and the corresponding cost i.e. value of objective function: OF)
Ans. (i) (a) x11 = 7, x21 = 3, x22 = 9, x32 = 1, x33 =
10, OF: 94
(i) (b) x11 = 7, x21 = 3, x23 = 9, x32 =
10, x31 = 1, OF: 40
(i) (c) x13 = 7, x21 = 10, x23 = 2, x32 =
10, x33 = 1, OF: 61
(i) (d) x13 = 7, x21 = 10, x23 = 2, x32 =
10, x33 = 1, OF: 61
(i) (e) x11 = 7, x21 = 2, x23 = 10, x31 =
1, x32 = 10, OF: 40
(ii) (a) x11 = 9, x12 = 3, x22 = 7, x23 =
7, x33 = 4, OF: 104
(ii) (b) x11 = 2, x12 = 10, x21 = 3, x23 =
11, x31 = 4, OF: 38
(ii) (c) x12 = 10, x13 = 2, x21 = 9, x23 =
5, x33 = 4, OF: 72
(ii) (d) x11 = 2, x12 = 10, x21 = 3, x23 =
11, x33 = 4, OF: 38
(ii) (e) x11 = 2, x12 = 10, x21 = 3, x23 =
11, x33 = 4, OF: 38
(iii) (a) x11 = 10, x21 = 20, x31 = 30, x42 =
40, x52 = 20, x53 = 20, x54 = 10, OF: 1290
(iii) (b) x13 = 10, x21 = 10, x24 = 10, x31 =
30, x42 = 30, x43 = 10, x51 = 30, x52 = 20, OF:
890
(iii) (c) x13 = 10, x21 = 20, x31 = 10, x33 =
10, x34 = 10, x42 = 40, x51 = 50, OF: 860
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
(iii) (d) x12 = 10, x22 = 20, x31 = 10, x32 =
20, x42 = 10, x43 = 20, x44 = 10, x51 = 50, OF:
960
(iii) (e) x11 = 10, x22 = 20, x31 = 30, x42 =
10, x43 = 20, x44 = 10, x51 = 20, x52 = 30, OF:
910
5.29
Vogel’s method (c) compare the two methods.
10
0
20
11
12
7
9
20
0
14
16
18
15
25
5
2. Solve the following TP by method of multipliers
5
15 15
10
method obtaining the starting solution by north
west corner rule.
Ans. (a) x12 = 5, x14 = 10, x22 = 10, x23 = 15, x31 =
(i)
3
0
4
1
1 40
5 OF: 315
2
2
4
0
6 70
(b) same (c) Vogel’s method give solution
0
0
0
1
1 60
closer to optimal. Number of iterations required
3
5
1
3
0 30
in Vogel is one while 3 in NWC rule.
30
60
50
40
20
Ans. x21 = 40, x21 = 10, x22 = 20, x24 = 40
x31 = 20, x33 = 40, x43 = 10, x45 = 20
70
4
2
1
5
1
(ii)
2
OF:
5. Solve the following TP by method of multipliers by obtaining the starting solution by (a) NWC
rule (b) Least-cost method (c) Vogel approximation method. State the starting solution and the
corresponding value of OF.
D1
30
3
2
1
4
3
4
2
5
9
6
2
3
1
7
3
4
6
3
20
40
30
10
50
50
S1
75
S2
20
S3
D3
D4
2
20
11
12
7
9
20
4
14
16
18
5
25
D2
10
15
15
15
25
10
15
Ans. x11 = 20, x13 = 10, x23 = 20, x24 = 10, x25 =
Ans. Starting solution and associated OF (a) x11 =
20
5, x12 = 10, x22 = 5, x23 = 15,
x32 = 40, x35 = 10, x36 = 25, x45 = 20 OF:
x24 = 5, x34 = 10, OF: 520
430
(b)
x12 = 15, x14 = 0, x23 = 15, x24 =
3. Solve the above problem 2 (ii) by obtaining the
10, x31 = 5, x34 = 5, OF: 475
initial solution by (a) row minimum (b) col(c)
x12 = 15, x14 = 0, x23 = 15, x24 =
umn minimum (c) matrix minimum (d) Vogel’s
10, x31 = 5, x34 = 5, OF: 475
method (e) compare the number of iterations
(d) Solution by UV method
required in each of these methods including the
x12 = 5, x14 = 10, x22 = 10, x23 =
north west corner rule.
15, x31 = 5, x34 = 5, OF: 435
Ans. Optimal solution and value of OF is same as in 2
6. Solve the TP (use VAM)
(ii) above for (a) (b) (c) (d). The number of iteraD1 D2 D3 D4
tions required are 7 in NWCR, 1 in row minimum
2 in column minimum, 1 in matrix minimum, 1
21 16
25
13 11
S1
in Vogel’s method.
4. Solve the TP by UV-method obtaining initial
solution by
(a) NWC rule
S2
17
18
14
23 13
S3
32
27
18
41 19
6
10
12
15
chap-5a
B.V.Ramana
5.30
September 13, 2006
17:59
MATHEMATICAL METHODS
Ans. x14 = 11, x21 = 6, x22 = 3, x24 = 4, x32 =
7, x33 = 12 optimal minimum cost: Rs 796
Degeneracy:
7. Solve the following TP.
12
9
6
9
10
7
3
7
7
5
5
6
5
9
11
3
11
6
8
11
2
2
10
9
4
4
6
2
4
5
6
2
9
Ans. x13 = 25, x14 = 25, x23 = 10, x25 = 30,
x31 = 30, x32 = 25, x34 = 15
minimum cost = 1150
Hint: Total supply = 50 + 40 + 70 = 160
Total demand = 30 + 25 + 35 + 40 = 130
Introduce a dummy destination D5 with
demand (requirement) of 30. Use VAM.
Note: x25 = 30 means, 30 units are left
undespatched from S2 . (Since it can not be send
to the dummy destination D5 ).
10. Solve the unbalanced TP;
2
Ans. x13 = 5, x22 = 4, x26 = 2, x31 = 1, x33 = 1,
x41 = 3, x44 = 2, x45 = 4, x13 =∈
minimum cost = 112 + 76ε = 112 as ε → 0
D1
D2
D3
S1
5
1
7 10
S2
6
4
6
80
Hint: The starting solution obtained by Vogel’s
3
2
5 15
S3
method is a degenerate since it contains only 8
basic variables (instead of 6 + 4 − 1 = 9 basic
75
20 50
variables). Introduce any one of the non basic
variable at ε level where ε is small and let ε → 0. Ans. x12 = 10, x21 = 20, x22 = 10, x23 = 50, x31 =
15 minimum cost: 515
Maximization:
8. Solve the following TP to maximize the profit
Hint: Introduce fictitious source S4 with supply
of 40. Demand of 40 units is not met at destina15 51
42
33 23
tion 1.
80
42
26
81 44
90
40
66
60 33
23
31
16
Transhipment Problem
11. Solve the following transhipment problem
30
D1
Ans. x12 = 23, x21 = 6, x22 = 8, x24 = 30,
x31 = 17, x33 = 16, OF = 7005
1000
D1
D2
D3
D4
11
20
7
8
S2
21
16
10
12 40
S3
8
12
18
9 70
25
35
40
6
D2
2
P2
900
4
5
T2
3
9
D3
500
Ans. P1 T2 = 1000, P2 T1 = 1200, T1 D1 = 800
S1
30
5
T1
4
1200
9. Solve the following unbalanced TP.
3
P1
Hint: Obtain the relative loss matrix by subtracting all the entries of the cost matrix from the
largest entry 90.
Unbalanced TP:
800
8
50
T1 D2 = 400, T2 D2 = 1000, D2 D3 = 500
minimum cost = (1000 × 4) + (1200 ×
2) + (800 × 8) + (400 × 6) + (100 × 4) +
+(500 × 3) = 20, 700.
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
Hint: The corresponding TP is given below:
T1
P1
P2
T1
T2
D1
D2
T2
D1
D2
D3
4
M
M
M
2
5
M
M
M
0
7
8
6
M
M
0
M
4
9
M
M
0
5
M
M
M
M
0
3
B 800+B 900+B
1000
1200
B
B
B
minimized. Thus the assignment problem is an integer linear programming problem. This combinatorial problem has n! number of possible assignments
which can be enumerated for small n. Even for n =
10, (n! = 3,628,800) the enumeration becomes very
time consuming and cumbersome. However the solution to the assignment problem is obtained by a simple method known as the “Hungarian method” or
“Floods’ technique”.
B
500
Here B = buffer = 1000 + 1200 = 2200 =
(800 + 900 + 500) and M = large penalty.
5.10 THE ASSIGNMENT PROBLEM
The assignment problem (or model) is a special case
of the transportation problem in which to each origin
there will correspond one and only one destination.
This can be described as a person-job assignment or
machine-task assignment model. Suppose there are
n persons who can perform any of the n different
jobs with varying degree of efficiency measured in
terms of cij representing the cost of assigning the i th
person to j th job (i = 1, 2, 3, . . . n, j = 1, 2, . . . n)
Then the objective of the assignment problem is to
minimize the total cost of performing all the n jobs by
assigning “the best person for the job” on the one to
one basis of one person to one job. The assignment
problem can be solved as a regular transportation
problem in which the persons represent the sources,
the jobs represent the destinations, the supply amount
at each source and demand amount at each destination being exactly
equal to 1.
1 if ith person assigned to j th job
Let xij =
0 if ith person not assigned to j th job
Since the ith person can be assigned to only one
n
job we have
xij = 1 for i = 1, 2, . . . n.
i=1
Since the j th job can be assigned to only one
n
person we have
xij = 1 for j = 1, 2, . . . , n. The
i=1
gers xij (either 1 or 0) such that the total cost repn n
resented by the objective function
cij xij is
i=1 j =1
3
B
5.31
assignment problem consists of determining the inte-
Hungarian Method or Flood’s Technique
1. Minimization case:
Step I. Determination of total-opportunity cost
(TOC) matrix:
(a) Subtracting the lowest entry of each column of the
given payoff (cost) matrix from all the entries of
that corresponding column results in the columnopportunity cost matrix.
(b) Now subtracting the lowest entry of each row of
the column-opportunity matrix (obtained in step
(a) above) from all the entries of the corresponding row results in the total opportunity cost (TOC)
matrix.
Step II. Check for optimal assignment: Let n be
the minimum number of horizontal and vertical lines
required which cover ALL the zeros in the current
TOC matrix. Let m be the order of the cost (TOC)
matrix.
(a) If n = m, an optimal assignment can be made.
Goto step V
(b) If n < m, revise the TOC matrix. Goto step III.
Step III. Revision of TOC matrix:
(a) Subtract the lowest entry (among the uncovered
cells) of the current TOC matrix from all the
uncovered cells.
(b) Add this lowest entry to only those cells at which
the covering lines of step II cross. This revises
TOC matrix.
chap-5a
B.V.Ramana
5.32
September 13, 2006
17:59
MATHEMATICAL METHODS
Step IV. Repeat steps II and III initial an optimal
assignment is reached:
Step V. Optimal assignment:
quoted is given in the pay-off matrix below. If each
contractor is to be assigned one job, find the assignment which minimises the total cost of the project.
(a) Identify a row or column (in the final TOC matrix)
having only one zero cell.
Contractor
Jobs
A
B
C
D
E
(b) Make assignment to this cell. Cross off both the
row and column in which this zero cell occurs.
1
120 150
75
90 100
2
140
80
90
85 170
(c) Repeat (a) for the remaining rows and columns
and make an assignment until a complete assignment is achieved.
3
50
40
40
70 110
4
75
65
45
70
5
110
90
90 140 115 100
2. Maximization case:
The maximization problem can be converted to a
minimization problem by subtracting all the entries
of the original cost matrix from the largest entry (of
the original cost matrix). The transformed entries
give the “relative costs”.
Solution: The column opportunity matrix is
obtained by subtracting the lowest entry in each column from all the entries in that column
Column-opportunity matrix
A
C
D
E
70 110
35
20
10
90
40
50
15
80
3
0
0
0
0
20
4
25
25
5
0
0
5
60
50 100
45
10
3. Alternative Optima:
1
The presence of alternative optimal solutions is indicated by the existance of a row or column in the final
TOC matrix with more than one zero cells.
2
4. Unbalanced Problem:
When the cost matrix is rectangular, a dummy row
or a dummy column added makes the cost matrix a
square matrix. All the costs cij associated with this
dummy row (or column) are taken as zeros.
The total-opportunity-cost (TOC) matrix is now
obtained by subtracting the lowest entry from each
row from all the entries in that row.
5. Problem with Restrictions:
When the assignment problem includes certain
restrictions such that a particular (specified) i th person can not be assigned to a particular j th job then
the associated cost cij is taken as a very big value M
(generally infinity) so that it is prohibitively expensive to make this undesirable assignment.
WORKED OUT EXAMPLES
Example 1: A national highway project consists
of 5 major jobs for which 5 contractors have submitted tenders. The tender amounts (in lakhs of rupees)
B
1
2
3
4
5
A
60
75
0
25
50
B
100
25
0
25
40
Toc Matrix
C
D
25
10
35
0
0
0
5
0
90
35
E
0
65
25
0
0
Since the minimum number of vertical and horizontal
lines (n) needed to cover all the zeros is less than the
number of row m (or columns) i.e. n = 3 < m = 5,
the current TOC matrix is to be revised by subtracting
the lowest entry among the uncovered cells from all
the uncovered cells and adding it to crossed cells
(where the vertical and horizontal lines intersect).
Thus the lowest entry 5 will be subtracted from all
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
the uncovered cells and added at the crossed cells (3,
4), and (3, 5). Then the revised TOC is
1
2
3
4
5
A
55
70
0
20
45
B
95
20
0
20
35
C
20
30
0
0
85
D
10
0
5
0
35
E
0
65
25
0
0
Here the minimum number of lines covering all the
zeros is less than the number of rows i.e. n = 4 <
m = 5. Revise the matrix as above
1
2
3
4
5
A
35
50
0
20
25
B
75
0
0
20
15
C
0
10
0
0
65
D
10
0
25
20
35
E
0
65
45
20
0
Here n = 4 < m = 5
Optimal Toc matrix
1
2
3
4
5
A
25
50
0
10
15
B
65
0
0
10
5
C
0
20
10
0
65
D
0
0
25
10
25
E
0
75
55
20
0
n=5=m=5
Ist optimal assignment: choose a row (or column)
containing only one zero. Choosing so the first column, make an assignment. Thus
1
2
3
4
5
A
25
50
´ 0
10
15
B
65
0
0
10
5
C
0
20
10
0
65
D
0
0
25
10
25
E
0
75
55
20
0
i.e. assign A to 3. Cross off first column and 3rd row.
5.33
Second and Third optimal assignment
1
2
3
4
5
A
25
50
0
10
15
B
65
´ 0
0
10
5
C
0
20
10
0
65
D
0
0
25
10
25
´
E
0
75
55
20
0
From among the remaining non-crossed out rows and
columns, choose a row or column with only one zero.
Thus assign B to 2 and D to 1. Cross off the 2 row
and 2 column and 4th column and first row.
4th and 5th optimal assignment:
1
2
3
4
5
A
25
50
0
10
15
B
65
0
0
10
5
C
0
20
10
´
0
65
D
0
0
25
10
25
E
0
75
55
20
0
´
i.e. assign C to 4 and E to 5
Thus the optimal assignment is
A3, B2, C4, D1, E5
with minimum cost = 50 + 80 + 45 + 90 + 100 = 365
Example 2: Maximization: The profit of assigning a particular job to a specific machine is given in
the following matrix. Maximize the profit to accomplish all the jobs by assigning one machine to one
job. Check by enumeration.
Machine
Job
A
B
C
1
380 610 330
2
210 380 415
3
260 210 300
Solution: To convert into a minimization problem,
subtract all the entries of the matrix from the largest
entry 610. Then
A
B
C
1
230
2
400 230 195
0 280
3
350 400 310
chap-5a
B.V.Ramana
5.34
September 13, 2006
17:59
MATHEMATICAL METHODS
Job opportunity column matrix
A
to one man.
B
Jobs
C
1
0
0
85
Men
J1
J2
J3
J4
2
170
230
0
M1
7
5
8
4
3
120
400
115
M2
5
6
7
4
M3
8
7
9
8
TOC matrix
A
B
C
1
0
0
85
2
170
230
0
3
5
285
0
Solution: Add a fictitious (dummy) fourth man, to
convert the unbalanced to balanced assignment problem. The amount of time taken by the fourth man is
taken as zero for each job.
n=2<m=3
Revised TOC matrix
Jobs
A
B
C
Men
J1
J2
J3
J4
1
0
0
90
M1
7
5
8
4
2
165
225
0
M2
5
6
7
4
3
0
280
0
M3
8
7
9
8
M4
0
0
0
0
J1
J2
J3
J4
n=3=m=3
Optimal assignment: A3, B1, C2
A
B
´
1
0
2
165
225
3
´
280
0
0
´
TOC matrix
C
M1
3
1
4
0
90
M2
1
2
3
0
0
M3
1
0
2
1
0
M4
0
0
0
0
Maximum profit: 260 + 610 + 415 = 1285
Check by enumeration:
n=3<m=4
Revised TOC Matrix
J1
J2
J3
J4
A1, B2, C3 : 380 + 380 + 300 = 1060
M1
2
0
3
0
A1, B3, C2 : 380 + 210 + 415 = 1005
M2
0
1
2
0
A2, B3, C1 : 210 + 210 + 330 = 750
M3
1
0
2
2
M4
0
0
0
1
A2, B1, C3 : 210 + 610 + 300 = 1120
A3, B1, C2 : 260 + 610 + 415 = 1285 Optimal solution
A3, B2, C1 : 260 + 380 + 330 = 970
Example 3: Unbalanced problem: The amount of
time (in hours) to perform a job by different men
is given below. Solve the unbalanced problem by
assigning four jobs to three men subject to one job
n=4=m=4
Optimal assignment
J1
J2
J3
J4
M1
2
0
3
0 ´
M2
0´
1
2
0
2
2
0
1
M3
1
0
M4
0
0
´
´
chap-5a
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
M 1 J4 , M 2 J1 , M 3 J2 , M 4 J3
Thus the job J3 is not assigned. The minimum
amount of time taken to accomplish all the three jobs
is 4 + 5 + 7 = 16 hours.
Persons M1
P1
P2
P3
P4
5
7
9
7
Machines
M2
M3
5
4
3
2
–
2
5
6
TOC Matrix
M4
2
3
–
7
Example 4: Assignment with restrictions: The following matrix consists of cost (in thousands of
rupees) of assigning each of the four jobs to four
different persons. However the first person can not
be assigned to machine 3 and third person can not be
assigned to machine 4.
(a) Find the optimal assignment to minimize the cost
(b) Suppose a 5th machine is available the assignment costs to the four persons as 2, 1, 2, 8, respectively. Find the optimal solution
(c) Is it economical to replace one of the existing
machines by the new (5th) machine
(d) In such case which machine is to be replaced
(unused). (A dash indicates that assignment is not
possible because of the restrictions imposed)
Solution: (a) Since first person can not be assigned
to machine 3 a prohibitive (penalty) cost is imposed,
denoted by ∞. Thus the cost matrix is
M1
M2
M3
M4
P1
P2
5
5
¥
2
7
4
3
P3
9
3
2
5
¥
P4
7
2
6
7
M1
M2
M3
M4
P1
3
3
¥
0
P2
P3
5
6
2
0
0
2
1
¥
P4
5
0
4
5
Row matrix
5.35
Revised TOC
0
3
¥
0
0
4
¥
0
2
2
0
1
1
2
0
0
3
0
2
¥
2
0
2
¥
2
0
4
5
1
0
4
4
n=3<m=4
Optimal assignment
n=3<m=4
M1
M2
M3
P1
0
5
¥
P2
1
P3
3
´
1
´
P4
0
M4
´
0
0
0
0
1
¥
0
3
3
´
P1 to M4 , P2 to M3 , P3 to M2 , P4 to M1
minimal cost: 2 + 2 + 3 + 7 = 14
(b) Introducing the 5th machine, the new cost matrix
is
M1
M2
M3
M4
M5
P1
3
5
¥
2
2
P2
7
4
2
3
1
P3
9
3
5
¥
2
P4
7
2
6
7
8
P5
0
0
0
0
0
Subtracting the row minimums from each row, we
get
LM 3
MM
MM
MN
6
7
5
0
3 ¥ 0 0
3 1 2 0
1 3 ¥ 0
0 4 5 6
0 0 0 0
n=4<m=5
PQ
PP
PP
OP
P1
P2
P3
P4
P5
optimal matrix
M1 M2 M3 M4 M5
¥
3
4
0
0
1
5
3
0
0
6
1
0´
2
¥
4 ´0
5
3
4
´0
0
1
1
0
n=5m=5
Optimal assignment:
P1 to M4 ; P2 → M3 , P3 → M5 , P4 → M2 ; P5 →
M1 Minimum cost: 2 + 2 + 2 + 2 = 8
(c) With the introduction of 5th machine the cost
has come down from 14 to 8. So it is economical to
introduce 5th machine.
chap-5a
B.V.Ramana
5.36
September 13, 2006
17:59
MATHEMATICAL METHODS
(d) Since the dummy person P5 is assigned to Ans: P1 to J2 , P2 to J1 , P3 to J3 , minimum cost: 27
machine 1, it means that M1 is not used and therefore
can be replaced (dispensed with).
Jobs
5.
J1
J2
P1
1
P2
9
P3
P4
Persons
5.11 ASSIGNMENT PROBLEM
EXERCISE
J3
J4
4
6
3
7
10
9
4
5
11
7
8
7
8
5
1. Solve the following assignment Problem for min- Ans. P1 to J1 , P2 to J3 ; P3 to J2 , P4 to J4 minimum
imum total cost. Check by enumeration.
cost: 21
Job
1
2
3
A
380
210
260
6. Assign the five jobs to the five machines so as to
maximize the total return if the following matrix
shows the return in (thousands of) 1 rupees for
assigning the ith machine (i = 1, 2, 3, 4, 5) to the
j th job (j = 1, 2, 3, 4, 5).
Machine
B
C
610 330
380 415
210 300
Ans. A2 , B3 , C1 : minimal cost: 750
A1 B2 C3 (1060), A1 B3 C2 (1005), A2 B1 C3 (1120),
A2 B3 C1 (750), A3 B1 C2 (1285), A3 B2 C1 (970).
2. Find the optimal solution with minimum cost in
the following assignment problem
Destinations
Origins
D1
D2
D3
O1
20
27
30
O2
10
18
16
O3
14
16
12
Machine
1
2
3
4
5
1
5
2
3
6
7
2
11
4
12
14
9
3
10
6
5
4
8
4
12
3
14
11
12
5
4
5
6
7
5
Ans. M1 J3 ; M2 J5 ; M3 J4 ; M4 J2 ; M5 J1 , Maximum
cost: 50
Ans. O1 to D2 , O2 to D1 ; O3 to D3
Total minimum cost: 49
3. Find the optimal assignment which maximizes
the total cost in the above problem 2.
Ans. O3 to D1 , O2 to D2 , O1 to D3 , maximum cost: 62
Solve the following assignment problem for
minimum cost
4.
Job
Jobs
Person
J1
J2
J3
P1
15
10
9
P2
9
15
10
P3
10
12
8
7. Four men can perform any of the four tasks with
different efficiency measured in terms of time
required to complete each task which is given in
the following table. Assign one task to one man
so as to minimize the total time spent on accomplishing the four tasks.
Men
Task
M1
M2
M3
M4
T1
18
26
17
11
T2
13
28
14
26
T3
38
19
18
15
T4
19
26
24
10
Ans. M1 to T2 ; M2 to T3 ; M3 to T1 ; M4 to T4 , minimum
total time = 59
B.V.Ramana
September 13, 2006
17:59
LINEAR PROGRAMMING
5.37
8. Multiple Optima: Solve the following assignment Ans. M1 D; M2 B; M3 C; M4 E, M5 A. Since (dummy
problem for minimum cost.
man) M5 is assigned to job A, the job A should
be
declined. Maximum profit: 101 + 84 + 111 +
Jobs
J1
J2
J3
J4
80 = 376
Men
M1
20
13
7
5
M2
25
18
13
10
M3
31
23
18
15
M4
45
40
23
21
11. With Restrictions Suppose five men are to be
assigned to five jobs with assignment costs given
in the following matrix. Find the optimal assignment schedule subject to the restriction that first
person M1 can not be assigned job 3 and third
person M3 can not be assigned to job 4.
Ans. Four optimal assignments all with the same minimum total cost: 76.
(i) M1 J1 ; M2 J4 ; M3 J2 ; M4 J3 .
(ii) M1 J2 ; M2 J1 ; M3 J4 ; M4 J3 .
(iii) M1 J1 ; M2 J2 ; M3 J4 ; M4 J3 .
(iv) M1 J4 ; M2 J1 ; M3 J2 ; M4 J3 .
Jobs
Men
J1
J2
J3
J4
J5
M1
5
5
–
2
6
M2
7
4
2
3
4
M3
9
3
5
–
3
M4
7
2
6
7
2
9. Unbalanced assignment problem Three work
M5
6
5
7
9
1
centers are required to manufacture, assemble and
to package a product. The handling cost at each
Ans. Minimal cost is 15 with three alternative optimum
of the four locations in the factory are given in
solutions.
the following matrix. Determine the location of
(i) M1 J4 , M2 J3 , M3 J2 , M4 J1 , M5 J5
work centres that minimizes total handling cost.
(ii) M1 J4 , M2 J3 , M3 J5 , M4 J2 , M5 J1
Locations
(iii) M1 J4 , M2 J3 , M3 J2 , M4 J5 , M5 J1
Job
Manufacturing
M1
Assembly
M2
Packaging
M3
L1
18
L2
15
L3
16
L4
13
16
11
–
15
9
10
12
8
12. Determine optimal location of three machines at
four different locations in a shop floor given the
cost estimate per unit of time of material handling is given in the following matrix. Note that
machine 2 can not be placed in location 2.
Locations
Ans: M1 to L4 ; M2 to L2 ; M3 to L1 . Location 3 is kept
idle (assigned to dummy job and no job is done).
10.
Jobs
Men
chap-5a
M1
M2
M3
M4
A
62
71
87
48
B
78
84
92
64
C
50
61
111
87
D
101
73
71
77
E
82
59
81
80
Maximize the profit. Which job should be
declined?
Machines L1
L2
L3
L4
M1
12
9
12
9
M2
15
-
0
20
M3
4
8
115
6
Ans. M1 to L2 or L4 ; M2 to L3 , M3 to L1
Dummy (fictitious) machine M4 is assigned
to location L4 or L2 .
Minimum cost: 9 + 13 + 4 = 26